diff --git a/README.md b/README.md index 956449e..948fb41 100644 --- a/README.md +++ b/README.md @@ -91,16 +91,11 @@ So in summary, remember the following: - JP1 jumper pins OPEN => VERA addresses the SD card. - JP1 jumper pins CLOSED => VERA addresses the SPI IC. - -![VERA-JP1-OPEN](https://raw.githubusercontent.com/FlightControl-User/x16-flash/main/images/VERA-JP1-OPEN.jpg) - -At the start position, before running the CX16 update program, ensure that the JP1 jumper pins on the VERA board are **OPEN** (Picture above)! This is necessary to instruct VERA to address any memory instruction to the SD card. - -![VERA-JP1-CLOSED](https://raw.githubusercontent.com/FlightControl-User/x16-flash/main/images/VERA-JP1-CLOSED.jpg) - -During the update process, the program will ask you to place a jumper cap, **CLOSING** the JP1 jumper pins (picture above). This is necessary to instruct VERA to address any memory instruction to the SPI IC, in order to allow for the memory flashing of the VERA.BIN file now stored in RAM, onto the SPI IC memory (only the first 128KB will be updated). - -Once the VERA memory has been updated, the program will ask you to remove the JP1 jumper cap, **opening** the pins again. This is necessary to direct VERA to address the SD card again for further file reads. +| | | +| --- | --- | +| 1. For preparation, before running the CX16 update program, **ensure** that the JP1 jumper pins on the VERA board are **OPEN** (Picture above)! This is necessary to instruct VERA to address any memory instruction to the SD card. | ![VERA-JP1-OPEN](https://raw.githubusercontent.com/FlightControl-User/x16-flash/main/images/VERA-JP1-OPEN.jpg) | +| 2. During the update process, the program will ask you to place a jumper cap, **CLOSING** the JP1 jumper pins (picture above). This is necessary to instruct VERA to address any memory instruction to the SPI IC, in order to allow for the memory flashing of the VERA.BIN file now stored in RAM, onto the SPI IC memory (only the first 128KB will be updated). | ![VERA-JP1-CLOSED](https://raw.githubusercontent.com/FlightControl-User/x16-flash/main/images/VERA-JP1-CLOSED.jpg) | +| 3. Once the VERA memory has been updated, the program will ask you to remove the JP1 jumper cap, **opening** the pins again. This is necessary to direct VERA to address the SD card again for further file reads. | ![VERA-JP1-OPEN](https://raw.githubusercontent.com/FlightControl-User/x16-flash/main/images/VERA-JP1-OPEN.jpg) | **Note that this will happen during the update process and it is crucial that you follow carefully the instructions given by the program! It might be advisory to practice this process before you execute the CX16 update program, with your CX16 board powered OFF! Put a jumper cap on the JP1 jumper pins closing it and re-opening it by removing. Simple, but if you've never done this, this may require a bit of practice!** @@ -108,23 +103,25 @@ Updating the **external** VERA card won't require you to follow this process. ### 1.3.2 Prepare: CLOSE SMC J5 jumper pins! -![CX16-J5](https://raw.githubusercontent.com/FlightControl-User/x16-flash/main/images/CX16-J5.jpg) - -Ensure that the J5 jumper pins on the Commander X16 main board are **closed**. If the J5 jumper pins are not closed, the keyboard won't be functional (Picture above)! +| | | +| --- | --- | +| Ensure that the J5 jumper pins on the Commander X16 main board are **closed**. If the J5 jumper pins are not closed, the keyboard won't be functional! | ![CX16-J5](https://raw.githubusercontent.com/FlightControl-User/x16-flash/main/images/CX16-J5.jpg) | ### 1.3.3 Prepare: CLOSE Main CX16 ROM J1 jumper pins! -![CX16-J1](https://raw.githubusercontent.com/FlightControl-User/x16-flash/main/images/CX16-J1.jpg) -Ensure that the J1 jumper pins on the Commander X16 main board are **closed**, to **remove the write protection** of the main CX16 ROM. If the J1 jumper pins are **not closed**, the **main CX16 ROM will not be detected** by the update program. (Picture above)! +| | | +| --- | --- | +| Ensure that the J1 jumper pins on the Commander X16 main board are **closed**, to **remove the write protection** of the main CX16 ROM. If the J1 jumper pins are **not closed**, the **main CX16 ROM will not be detected** by the update program! | ![CX16-J1](https://raw.githubusercontent.com/FlightControl-User/x16-flash/main/images/CX16-J1.jpg) | -### 1.3.4 Prepare: Flash multiple ROMs on the external RAM/ROM board or cartridge. -First for all clarity, find below a picture of such a ROM expansion cartridge: +### 1.3.4 Prepare: Flash multiple ROMs on the external RAM/ROM board or cartridge. -![ROM-CARD](https://raw.githubusercontent.com/FlightControl-User/x16-flash/main/images/ROM-CARD.jpg) +| | | +| --- | --- | +| First for all clarity, find below a picture of such a ROM expansion cartridge. | ![ROM-CARD](https://raw.githubusercontent.com/FlightControl-User/x16-flash/main/images/ROM-CARD.jpg) | On the ROM cartridge, 7 extra RAM/ROM chips can be placed for usage, and can be updated using this program. The cartridge is placed in one of the 4 PCI extension slots on the CX16 main board, and provides an extra 3.5 MB of banked RAM/ROM to your CX16 between addresses $C000 and $FFFF, with zeropage $01 as the bank register. Each bank has $4000 bytes! @@ -134,14 +131,15 @@ For example, `ROM1.BIN` will flash ROM#1 on the cartridge. `ROM5.BIN` will flash In order to flash the ROMs, **close** the relevant jumper pins: -![ROM-CARD-J1-CLOSED](https://raw.githubusercontent.com/FlightControl-User/x16-flash/main/images/ROM-CARD-J1-CLOSED.jpg) - -![ROM-CARD-J2-CLOSED](https://raw.githubusercontent.com/FlightControl-User/x16-flash/main/images/ROM-CARD-J2-CLOSED.jpg) +| Preparation | | +| --- | --- | +| 1. **Close** the J1 jumper pins (at the left side of the cartridge board) to remove the write-protection for ROM#1 till ROM#6. | ![ROM-CARD-J1-CLOSED](https://raw.githubusercontent.com/FlightControl-User/x16-flash/main/images/ROM-CARD-J1-CLOSED.jpg) | +| 2. **Close** the J2 jumper pins (at the right side of the cartridge board) to remove the write-protection for ROM#7. | ![ROM-CARD-J2-CLOSED](https://raw.githubusercontent.com/FlightControl-User/x16-flash/main/images/ROM-CARD-J2-CLOSED.jpg) | - 1. **Close** the J1 jumper pins (at the left side of the cartridge board) to remove the write-protection for ROM#1 till ROM#6. + - 2. **Close** the J2 jumper pins (at the right side of the cartridge board) to remove the write-protection for ROM#7. + Once you have the J1 and/or J2 jumper pins properly closed on the cartridge board, the ROMs will be detected by the flashing program. If the jumper pins are open, the ROMs won't be recognized by the flashing program and your ROM*n*.BIN file(s) will not be flashed! @@ -200,21 +198,17 @@ Please find below a detailed description of the complete process. ## 2.1.1 Introduction and briefing screens -![Into-1](https://raw.githubusercontent.com/FlightControl-User/x16-flash/main/images/INTRO1.jpg) - -At program start, you will see an introduction screen, introducing the update process. +| Step | Picture | +| --- | --- | +| At program start, you will see an introduction screen, introducing the update process. Please carefully read the text at the bottom panel of the screen, and press SPACE to continue ... | ![Into-1](https://raw.githubusercontent.com/FlightControl-User/x16-flash/main/images/INTRO1.jpg) | +| A second screen appears, which indicates the color schema used to indicate the update status of each component on your Commander X16 main board and/or your expansion cartridge board. Press SPACE to continue. | ![Into-2](https://raw.githubusercontent.com/FlightControl-User/x16-flash/main/images/INTRO2.jpg) | -Please carefully read the text at the bottom panel of the screen, and press SPACE to continue ... - -![Into-1](https://raw.githubusercontent.com/FlightControl-User/x16-flash/main/images/INTRO2.jpg) - -A second screen appears, which indicates the color schema used to indicate the update status of each component on your Commander X16 main board and/or your expansion cartridge board. Press SPACE to continue. ### 2.1.2 Component detection -Next, the update program detects which components are upgradable and will validate which files are found on the SD card. - -![FLASH-DETECT](https://raw.githubusercontent.com/FlightControl-User/x16-flash/main/images/FLASH-DETECT.jpg) +| Step | Picture | +| --- | --- | +| Next, the update program detects which components are upgradable and will validate which files are found on the SD card. The Commander X16 main board SMC, VERA and main ROM chip are detected, together with the external cardridge 7 ROM chips. | ![FLASH-DETECT](https://raw.githubusercontent.com/FlightControl-User/x16-flash/main/images/FLASH-DETECT.jpg) | The Commander X16 main board SMC, VERA and main ROM chip are detected, together with the external cardridge 7 ROM chips. @@ -224,21 +218,20 @@ The Commander X16 main board SMC, VERA and main ROM chip are detected, together ### 2.1.3 File presence and validation -After component detection, the program will immediately search for file presence for **each detected component** and will validate it. +| Step | Picture | +| --- | --- | +| After component detection, the program will immediately search for file presence for **each detected component** and will validate it. The program will read each file and check on data size and any validation content to be used before flashing. | ![FLASH-CHECK](https://raw.githubusercontent.com/FlightControl-User/x16-flash/main/images/FLASH-CHECK.jpg) | -![FLASH-CHECK](https://raw.githubusercontent.com/FlightControl-User/x16-flash/main/images/FLASH-CHECK.jpg) - -The program will read each file and check on data size and any validation content to be used before flashing. - Detected and valid files will result in the status of the component in a **PURPLE** led and status `Update`. -- Files that are not present, will result in the component not to be updated. The component will get a GREY led and status `skipped`. +- Files that are not present, will result in the component not to be updated. The component will get a GREY led and status `Skipped`. ### 2.1.4 Pre-Update conditions. -Before the update commences, there are important conditions vaidated to ensure that any upgrade file or component compatibility risk or issues, potentially corrupting your CX16, are properly mitigated. - -![SMC-ROM-COMPATIBILITY](https://raw.githubusercontent.com/FlightControl-User/x16-flash/main/images/SMC-ROM-COMPATIBILITY.jpg) +| Step | Picture | +| --- | --- | +| Before the update commences, there are important conditions vaidated to ensure that any upgrade file or component compatibility risk or issues, potentially corrupting your CX16, are properly mitigated. | ![SMC-ROM-COMPATIBILITY](https://raw.githubusercontent.com/FlightControl-User/x16-flash/main/images/SMC-ROM-COMPATIBILITY.jpg) | 1. SMC and ROM must be flashed together: To avoid an SMC update corrupting your CX16 because it is not supportive or compatible with your ROM. The SMC file contains flags to ensure the compatibility between the SMC and the ROM. @@ -247,48 +240,40 @@ Before the update commences, there are important conditions vaidated to ensure t 3. The main CX16 ROM not detected will stop the update process. -![UPDATE-CONFIRM](https://raw.githubusercontent.com/FlightControl-User/x16-flash/main/images/UPDATE-CONFIRM.jpg) - -When there are no issues, the user is asked for a confirmation to proceed with the update: - - - Replying `N` will cancel the update. - - Replying `Y` will proceed with the update! +| Step | Picture | +| --- | --- | +| When there are no issues, the user is asked for a confirmation to proceed with the update. Replying `N` will cancel the update. Replying `Y` will proceed with the update! | ![UPDATE-CONFIRM](https://raw.githubusercontent.com/FlightControl-User/x16-flash/main/images/UPDATE-CONFIRM.jpg) | -## 2.2 The update process, updating your components -The program will update each component that has status `Update`. +## 2.2 The CX16 update program updating your CX16 internal and external components -The program will read the firmware data into memory first, and will then commence with the update process, updating your component. +The CX16 update program will update each component that has status `Update`. -However, the update process differs for each component type, so please read carefully the below explanation: +For each component, program will read the firmware data into RAM memory first, and will then use the data stored in RAM to update your CX16 component. +The program guides you through the update process for each component in a very user friendly way, but mistakes are always possible, to please read carefully the below explanation. However, the **component update process differs for each component type**, so be aware! ### 2.2.1 The VERA update process -The update process of the VERA requires a manual interaction, where the user places the JP1 jumper cap, closing the JP1 jumper pins when requested on the VERA board. +| Step | Picture | +| --- | --- | +| Once the CX16 update has verified all the the files, and the VERA.BIN file is accepted, you need to confirm here with typing `Y` on the CX16 keyboard. | ![UPDATE-VERA-CONFIRMATION](https://raw.githubusercontent.com/FlightControl-User/x16-flash/main/images/UPDATE-VERA-CONFIRMATION.jpg) | +| You will be presented with this briefing, that explains the importance of the JP1 jumper pins manual handing during the update process (Picture above). Press SPACE on the CX16 keyboard to continue. | ![VERA-UPDATE-BRIEFING](https://raw.githubusercontent.com/FlightControl-User/x16-flash/main/images/VERA-UPDATE-BRIEFING.jpg) | ### 2.2.2 The SMC update process The SMC update is straightforward. -It will first read the `SMC.BIN` into internal memory. - -![POWER-RESET-SCREEN](https://raw.githubusercontent.com/FlightControl-User/x16-flash/main/images/POWER-RESET-SCREEN.jpg) - -Then, the program asks you to press the `POWER` and the `RESET` button at the same time on the CX16 board. - -![POWER-RESET](https://raw.githubusercontent.com/FlightControl-User/x16-flash/main/images/POWER-RESET.jpg) - -Do so on the CX16 board. - -When the POWER-RESET button is not pressed in time (there is a countdown), the program will cancel the update of the SMC but will continue updating any other component. The update of the ROM will be skipped, though! - -![SMC-ROM-ISSUE](https://raw.githubusercontent.com/FlightControl-User/x16-flash/main/images/SMC-ROM-ISSUE.jpg) - -The cancellation of the SMC update results in a reported issue, as the SMC and the ROM must be flashed together. - -When POWER-RESET is pressed, the program will flash your SMC. Don't interrupt the process. +| | | +| --- | --- | +| It will first read the `SMC.BIN` into internal memory. | | +| Then, the program asks you to press the `POWER` and the `RESET` button at the same time on the CX16 board. | ![POWER-RESET-SCREEN](https://raw.githubusercontent.com/FlightControl-User/x16-flash/main/images/POWER-RESET-SCREEN.jpg) | +| Do so on the CX16 board. | ![POWER-RESET](https://raw.githubusercontent.com/FlightControl-User/x16-flash/main/images/POWER-RESET.jpg) | +| When the POWER-RESET button is not pressed in time (there is a countdown), the program will cancel the update of the SMC but will continue updating any other component. The update of the ROM will be skipped, though! The cancellation of the SMC update results in a reported issue, as the SMC and the ROM must be flashed together. | ![SMC-ROM-ISSUE](https://raw.githubusercontent.com/FlightControl-User/x16-flash/main/images/SMC-ROM-ISSUE.jpg) | +| When POWER-RESET is pressed, the program will flash your SMC. Don't interrupt the process. | | +| To ensure that your SMC has been properly updated, the SMC will show as a **GREEN** led and status `Updated`. | | + **VERY IMPORTANT:** **Once your SMC is updated, you MUST wait till the end of the program to continue to update process, or your CX16 will be BRICKED!!!** @@ -297,6 +282,7 @@ When POWER-RESET is pressed, the program will flash your SMC. Don't interrupt th ### 2.2.3 The main CX16 ROM update process + ### 2.2.4 The external cardridge ROMs update process The loading process is seamless, if there is a file, each byte in the file is loaded into low and high RAM. The first $4000 bytes are loaded in low RAM, while the remainder of the ROM[N].BIN file is loaded in high RAM. This is nothing for you to be concerned about, just explaining how the program works. But note that a ROM[N].BIN file that is 512KB large, will be fully loaded into RAM on the Commander X16! diff --git a/images/INTRO1.jpg b/images/INTRO1.jpg index cbebf7d..71a7a4f 100644 Binary files a/images/INTRO1.jpg and b/images/INTRO1.jpg differ diff --git a/images/UPDATE-VERA-CONFIRMATION.jpg b/images/UPDATE-VERA-CONFIRMATION.jpg new file mode 100644 index 0000000..ef59dfd Binary files /dev/null and b/images/UPDATE-VERA-CONFIRMATION.jpg differ diff --git a/images/VERA-UPDATE-BRIEFING.jpg b/images/VERA-UPDATE-BRIEFING.jpg new file mode 100644 index 0000000..4a3f1d6 Binary files /dev/null and b/images/VERA-UPDATE-BRIEFING.jpg differ diff --git a/src/cx16-defines.h b/src/cx16-defines.h index 477437b..5de6cfc 100644 --- a/src/cx16-defines.h +++ b/src/cx16-defines.h @@ -33,16 +33,16 @@ #define __INTRO +#define __VERA_CHIP_PROCESS +// #define __SMC_CHIP_PROCESS +// #define __ROM_CHIP_PROCESS + + #define __VERA_JP1_DETECT // #define __VERA_FLASH #define __SMC_FLASH #define __ROM_FLASH - -#define __VERA_CHIP_PROCESS -#define __SMC_CHIP_PROCESS -#define __ROM_CHIP_PROCESS - #define __VERA_CHIP_DETECT #define __SMC_CHIP_DETECT #define __ROM_CHIP_DETECT diff --git a/target/src/CX16-UPDATE.PRG b/target/src/CX16-UPDATE.PRG index 2d870ed..a1c7e94 100644 Binary files a/target/src/CX16-UPDATE.PRG and b/target/src/CX16-UPDATE.PRG differ diff --git a/target/src/cx16-update.asm b/target/src/cx16-update.asm index 6a9be46..35be246 100644 --- a/target/src/cx16-update.asm +++ b/target/src/cx16-update.asm @@ -41,9 +41,6 @@ // Global Constants & labels - // Some addressing constants. - // These pre-processor directives allow to disable specific ROM flashing functions (for emulator development purposes). - // Normally they should be all activated. // #define __VERA_FLASH // To print the graphics on the vera. .const PROGRESS_X = 2 @@ -98,8 +95,6 @@ .const CX16_SCREEN_SET_CHARSET = $ff62 ///< CX16 Set character set. .const CX16_MACPTR = $ff44 - ///< CX16 Faster loading from SDCARD. - .const CX16_I2C_READ_BYTE = $fec6 ///< CX16 I2C read byte. .const CX16_I2C_WRITE_BYTE = $fec9 .const BINARY = 2 @@ -117,28 +112,10 @@ .const display_intro_briefing_count = $f .const display_intro_colors_count = $10 .const display_jp1_spi_vera_count = $10 - .const display_no_valid_smc_bootloader_count = 9 .const display_smc_rom_issue_count = 8 .const display_smc_unsupported_rom_count = 7 .const display_debriefing_count_smc = $e .const display_debriefing_count_rom = 4 - /** - * @file cx16-smc.h - * - * @author Wavicle from CX16 community (https://gist.github.com/jburks) -- Main ROM update logic & overall support and test assistance. - * @author MooingLemur from CX16 community (https://github.com/mooinglemur) -- Main SPI and VERA update logic, VERA firmware. - * @author Stefan Jakobsson from CX16 community (https://github.com/stefan-b-jakobsson) -- Main SMC update logic, SMC firmware and bootloader. - * @author Sven Van de Velde from CX16 community (https://github.com/FlightControl-User) -- Creation of this program, under the strong expertise by the people above. - * - * @brief COMMANDER X16 UPDATE TOOL SMC FIRMWARE UPDATE ROUTINES - * - * @version 2.0 - * @date 2023-09-21 - * - * @copyright Copyright (c) 2023 - * - */ - .const SMC_CHIP_SIZE = $2000 .const vera_size = $20000 .const STATUS_NONE = 0 .const STATUS_SKIP = 1 @@ -152,13 +129,6 @@ .const STATUS_ISSUE = 9 .const STATUS_ERROR = $a .const STATUS_WAITING = $b - .const ROM_PROGRESS_CELL = $200 - // A progress frame cell represents about 512 bytes for a ROM update. - .const ROM_PROGRESS_ROW = $8000 - // A progress frame row represents about 32768 bytes for a ROM update. - .const SMC_PROGRESS_CELL = 8 - // A progress frame cell represents about 8 bytes for a SMC update. - .const SMC_PROGRESS_ROW = $200 // A progress frame row represents about 512 bytes for a SMC update. .const VERA_PROGRESS_CELL = $80 // A progress frame cell represents about 128 bytes for a VERA compare. @@ -166,6 +136,8 @@ // A progress frame cell represents about 256 bytes for a VERA flash. .const VERA_PROGRESS_ROW = $2000 .const OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS = 1 + // Globals (to save zeropage and code overhead with parameter passing.) + .const smc_bootloader = 0 .const STACK_BASE = $103 .const SIZEOF_STRUCT___1 = $8f .const SIZEOF_STRUCT_PRINTF_BUFFER_NUMBER = $c @@ -221,7 +193,7 @@ .label BROM = 1 /// Current position in the buffer being filled ( initially *s passed to snprintf() /// Used to hold state while printing - .label __snprintf_buffer = $62 + .label __snprintf_buffer = $5d .segment Code // __start __start: { @@ -325,7 +297,10 @@ snputc: { // conio_x16_init /// Set initial screen values. conio_x16_init: { - .label conio_x16_init__5 = $7f + .label conio_x16_init__4 = $c0 + .label conio_x16_init__5 = $64 + .label conio_x16_init__6 = $c2 + .label conio_x16_init__7 = $c4 // screenlayer1() // [19] call screenlayer1 jsr screenlayer1 @@ -333,8 +308,8 @@ conio_x16_init: { // conio_x16_init::@1 // textcolor(CONIO_TEXTCOLOR_DEFAULT) // [21] call textcolor - // [784] phi from conio_x16_init::@1 to textcolor [phi:conio_x16_init::@1->textcolor] - // [784] phi textcolor::color#23 = WHITE [phi:conio_x16_init::@1->textcolor#0] -- vbum1=vbuc1 + // [439] phi from conio_x16_init::@1 to textcolor [phi:conio_x16_init::@1->textcolor] + // [439] phi textcolor::color#21 = WHITE [phi:conio_x16_init::@1->textcolor#0] -- vbum1=vbuc1 lda #WHITE sta textcolor.color jsr textcolor @@ -342,8 +317,8 @@ conio_x16_init: { // conio_x16_init::@2 // bgcolor(CONIO_BACKCOLOR_DEFAULT) // [23] call bgcolor - // [789] phi from conio_x16_init::@2 to bgcolor [phi:conio_x16_init::@2->bgcolor] - // [789] phi bgcolor::color#15 = BLUE [phi:conio_x16_init::@2->bgcolor#0] -- vbum1=vbuc1 + // [444] phi from conio_x16_init::@2 to bgcolor [phi:conio_x16_init::@2->bgcolor] + // [444] phi bgcolor::color#15 = BLUE [phi:conio_x16_init::@2->bgcolor#0] -- vbum1=vbuc1 lda #BLUE sta bgcolor.color jsr bgcolor @@ -359,13 +334,13 @@ conio_x16_init: { jsr cbm_k_plot_get // [28] cbm_k_plot_get::return#2 = cbm_k_plot_get::return#0 // conio_x16_init::@5 - // [29] conio_x16_init::$4 = cbm_k_plot_get::return#2 -- vwum1=vwum2 + // [29] conio_x16_init::$4 = cbm_k_plot_get::return#2 -- vwuz1=vwum2 lda cbm_k_plot_get.return - sta conio_x16_init__4 + sta.z conio_x16_init__4 lda cbm_k_plot_get.return+1 - sta conio_x16_init__4+1 + sta.z conio_x16_init__4+1 // BYTE1(cbm_k_plot_get()) - // [30] conio_x16_init::$5 = byte1 conio_x16_init::$4 -- vbuz1=_byte1_vwum2 + // [30] conio_x16_init::$5 = byte1 conio_x16_init::$4 -- vbuz1=_byte1_vwuz2 sta.z conio_x16_init__5 // __conio.cursor_x = BYTE1(cbm_k_plot_get()) // [31] *((char *)&__conio) = conio_x16_init::$5 -- _deref_pbuc1=vbuz1 @@ -375,17 +350,17 @@ conio_x16_init: { jsr cbm_k_plot_get // [33] cbm_k_plot_get::return#3 = cbm_k_plot_get::return#0 // conio_x16_init::@6 - // [34] conio_x16_init::$6 = cbm_k_plot_get::return#3 -- vwum1=vwum2 + // [34] conio_x16_init::$6 = cbm_k_plot_get::return#3 -- vwuz1=vwum2 lda cbm_k_plot_get.return - sta conio_x16_init__6 + sta.z conio_x16_init__6 lda cbm_k_plot_get.return+1 - sta conio_x16_init__6+1 + sta.z conio_x16_init__6+1 // BYTE0(cbm_k_plot_get()) - // [35] conio_x16_init::$7 = byte0 conio_x16_init::$6 -- vbum1=_byte0_vwum2 - lda conio_x16_init__6 - sta conio_x16_init__7 + // [35] conio_x16_init::$7 = byte0 conio_x16_init::$6 -- vbuz1=_byte0_vwuz2 + lda.z conio_x16_init__6 + sta.z conio_x16_init__7 // __conio.cursor_y = BYTE0(cbm_k_plot_get()) - // [36] *((char *)&__conio+1) = conio_x16_init::$7 -- _deref_pbuc1=vbum1 + // [36] *((char *)&__conio+1) = conio_x16_init::$7 -- _deref_pbuc1=vbuz1 sta __conio+1 // gotoxy(__conio.cursor_x, __conio.cursor_y) // [37] gotoxy::x#2 = *((char *)&__conio) -- vbum1=_deref_pbuc1 @@ -395,9 +370,9 @@ conio_x16_init: { lda __conio+1 sta gotoxy.y // [39] call gotoxy - // [802] phi from conio_x16_init::@6 to gotoxy [phi:conio_x16_init::@6->gotoxy] - // [802] phi gotoxy::y#37 = gotoxy::y#2 [phi:conio_x16_init::@6->gotoxy#0] -- register_copy - // [802] phi gotoxy::x#37 = gotoxy::x#2 [phi:conio_x16_init::@6->gotoxy#1] -- register_copy + // [457] phi from conio_x16_init::@6 to gotoxy [phi:conio_x16_init::@6->gotoxy] + // [457] phi gotoxy::y#26 = gotoxy::y#2 [phi:conio_x16_init::@6->gotoxy#0] -- register_copy + // [457] phi gotoxy::x#26 = gotoxy::x#2 [phi:conio_x16_init::@6->gotoxy#1] -- register_copy jsr gotoxy // conio_x16_init::@7 // __conio.scroll[0] = 1 @@ -411,12 +386,7 @@ conio_x16_init: { // } // [42] return rts - .segment Data - conio_x16_init__4: .word 0 - conio_x16_init__6: .word 0 - 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 @@ -424,8 +394,8 @@ conio_x16_init: { cputc: { .const OFFSET_STACK_C = 0 .label cputc__1 = $22 - .label cputc__2 = $52 - .label cputc__3 = $53 + .label cputc__2 = $47 + .label cputc__3 = $48 // [43] cputc::c#0 = stackidx(char,cputc::OFFSET_STACK_C) -- vbum1=_stackidxbyte_vbuc1 tsx lda STACK_BASE+OFFSET_STACK_C,x @@ -553,46 +523,56 @@ cputc: { // main main: { .const bank_set_brom1_bank = 4 + .const bank_set_brom2_bank = 0 + .const bank_set_bram1_bank = 0 .const bank_set_brom3_bank = 4 .const bank_set_brom4_bank = 0 - .const bank_set_brom5_bank = 0 - .const bank_set_brom6_bank = 4 - .const bank_set_bram1_bank = 0 - .const bank_set_brom7_bank = 4 - .const bank_set_brom8_bank = 0 - .const bank_set_brom9_bank = 0 - .const bank_set_brom10_bank = 4 - .label main__87 = $ce - .label main__111 = $e6 - .label main__112 = $e7 - .label main__113 = $cd - .label main__140 = $e4 - .label main__191 = $5e - .label check_status_smc1_main__0 = $6b - .label check_status_rom1_main__0 = $e8 - .label check_status_smc11_main__0 = $e9 - .label check_status_smc12_main__0 = $ea - .label rom_chip = $d6 - .label rom_chip1 = $d7 - .label rom_chip2 = $db - .label rom_bytes_read = $eb - .label rom_file_modulo = $e0 - .label rom_file_github_id = $6c - .label rom_file_prefix_id = $e5 - .label rom_chip3 = $d1 - .label flashed_bytes = $c3 - .label rom_chip4 = $da - .label file1 = $cf - .label rom_bytes_read1 = $dc - .label rom_differences = $f5 - .label w = $d9 - .label w1 = $d8 - .label main__371 = $ce - .label main__372 = $ce - .label main__373 = $ce - .label main__375 = $cd - .label main__376 = $cd - .label main__377 = $cd + .const bank_set_brom5_bank = 4 + .label main__30 = $e1 + .label main__47 = $e7 + .label main__56 = $e6 + .label main__69 = $e5 + .label main__72 = $a9 + .label main__111 = $e4 + .label main__116 = $42 + .label main__153 = $e2 + .label main__158 = $e3 + .label check_status_smc1_main__0 = $63 + .label check_status_cx16_rom1_check_status_rom1_main__0 = $c7 + .label check_status_smc2_main__0 = $c8 + .label check_status_cx16_rom2_check_status_rom1_main__0 = $c9 + .label check_status_smc3_main__0 = $ca + .label check_status_cx16_rom3_check_status_rom1_main__0 = $cb + .label check_status_smc4_main__0 = $cc + .label check_status_cx16_rom4_check_status_rom1_main__0 = $cd + .label check_status_smc5_main__0 = $ce + .label check_status_smc6_main__0 = $cf + .label check_status_vera1_main__0 = $d0 + .label check_status_smc7_main__0 = $d1 + .label check_status_vera2_main__0 = $d2 + .label check_status_vera3_main__0 = $d3 + .label check_status_vera4_main__0 = $dd + .label check_status_smc8_main__0 = $de + .label check_status_cx16_rom5_check_status_rom1_main__0 = $df + .label check_status_vera5_main__0 = $e0 + .label check_status_smc9_main__0 = $d4 + .label check_status_smc10_main__0 = $d5 + .label check_status_vera6_main__0 = $d6 + .label check_status_vera7_main__0 = $d7 + .label check_status_smc11_main__0 = $d8 + .label check_status_vera8_main__0 = $d9 + .label check_status_smc12_main__0 = $da + .label check_status_vera9_main__0 = $db + .label check_status_smc13_main__0 = $dc + .label rom_chip = $af + .label ch = $c6 + .label ch1 = $c5 + .label rom_chip1 = $aa + .label w = $b1 + .label w1 = $b0 + .label main__231 = $a9 + .label main__232 = $a9 + .label main__233 = $a9 // display_frame_init_64() // [71] call display_frame_init_64 // Get the current screen mode ... @@ -613,4367 +593,2036 @@ main: { } */ jsr display_frame_init_64 - // [72] phi from main to main::@97 [phi:main->main::@97] - // main::@97 + // [72] phi from main to main::@49 [phi:main->main::@49] + // main::@49 // display_frame_draw() // [73] call display_frame_draw // ST1 | Reset canvas to 64 columns - // [851] phi from main::@97 to display_frame_draw [phi:main::@97->display_frame_draw] + // [506] phi from main::@49 to display_frame_draw [phi:main::@49->display_frame_draw] jsr display_frame_draw - // [74] phi from main::@97 to main::@98 [phi:main::@97->main::@98] - // main::@98 + // [74] phi from main::@49 to main::@50 [phi:main::@49->main::@50] + // main::@50 // display_frame_title("Commander X16 Update Utility (v3.0.0) ") // [75] call display_frame_title - // [892] phi from main::@98 to display_frame_title [phi:main::@98->display_frame_title] + // [547] phi from main::@50 to display_frame_title [phi:main::@50->display_frame_title] jsr display_frame_title - // [76] phi from main::@98 to main::display_info_title1 [phi:main::@98->main::display_info_title1] + // [76] phi from main::@50 to main::display_info_title1 [phi:main::@50->main::display_info_title1] // main::display_info_title1 // cputsxy(INFO_X-2, INFO_Y-2, "# Chip Status Type Curr. Release Update Info") // [77] call cputsxy - // [897] phi from main::display_info_title1 to cputsxy [phi:main::display_info_title1->cputsxy] - // [897] phi cputsxy::s#4 = main::s [phi:main::display_info_title1->cputsxy#0] -- pbuz1=pbuc1 + // [552] phi from main::display_info_title1 to cputsxy [phi:main::display_info_title1->cputsxy] + // [552] phi cputsxy::s#3 = main::s [phi:main::display_info_title1->cputsxy#0] -- pbuz1=pbuc1 lda #s sta.z cputsxy.s+1 - // [897] phi cputsxy::y#4 = $11-2 [phi:main::display_info_title1->cputsxy#1] -- vbum1=vbuc1 + // [552] phi cputsxy::y#3 = $11-2 [phi:main::display_info_title1->cputsxy#1] -- vbum1=vbuc1 lda #$11-2 sta cputsxy.y - // [897] phi cputsxy::x#4 = 4-2 [phi:main::display_info_title1->cputsxy#2] -- vbum1=vbuc1 + // [552] phi cputsxy::x#3 = 4-2 [phi:main::display_info_title1->cputsxy#2] -- vbum1=vbuc1 lda #4-2 sta cputsxy.x jsr cputsxy - // [78] phi from main::display_info_title1 to main::@99 [phi:main::display_info_title1->main::@99] - // main::@99 + // [78] phi from main::display_info_title1 to main::@51 [phi:main::display_info_title1->main::@51] + // main::@51 // cputsxy(INFO_X-2, INFO_Y-1, "- ---- --------- ------ ------------- --------------------------") // [79] call cputsxy - // [897] phi from main::@99 to cputsxy [phi:main::@99->cputsxy] - // [897] phi cputsxy::s#4 = main::s1 [phi:main::@99->cputsxy#0] -- pbuz1=pbuc1 + // [552] phi from main::@51 to cputsxy [phi:main::@51->cputsxy] + // [552] phi cputsxy::s#3 = main::s1 [phi:main::@51->cputsxy#0] -- pbuz1=pbuc1 lda #s1 sta.z cputsxy.s+1 - // [897] phi cputsxy::y#4 = $11-1 [phi:main::@99->cputsxy#1] -- vbum1=vbuc1 + // [552] phi cputsxy::y#3 = $11-1 [phi:main::@51->cputsxy#1] -- vbum1=vbuc1 lda #$11-1 sta cputsxy.y - // [897] phi cputsxy::x#4 = 4-2 [phi:main::@99->cputsxy#2] -- vbum1=vbuc1 + // [552] phi cputsxy::x#3 = 4-2 [phi:main::@51->cputsxy#2] -- vbum1=vbuc1 lda #4-2 sta cputsxy.x jsr cputsxy - // [80] phi from main::@99 to main::@67 [phi:main::@99->main::@67] - // main::@67 + // [80] phi from main::@51 to main::@27 [phi:main::@51->main::@27] + // main::@27 // display_action_progress("Introduction, please read carefully the below!") // [81] call display_action_progress - // [904] phi from main::@67 to display_action_progress [phi:main::@67->display_action_progress] - // [904] phi display_action_progress::info_text#27 = main::info_text [phi:main::@67->display_action_progress#0] -- pbuz1=pbuc1 + // [559] phi from main::@27 to display_action_progress [phi:main::@27->display_action_progress] + // [559] phi display_action_progress::info_text#19 = main::info_text [phi:main::@27->display_action_progress#0] -- pbuz1=pbuc1 lda #info_text sta.z display_action_progress.info_text+1 jsr display_action_progress - // [82] phi from main::@67 to main::@100 [phi:main::@67->main::@100] - // main::@100 + // [82] phi from main::@27 to main::@52 [phi:main::@27->main::@52] + // main::@52 // display_progress_clear() // [83] call display_progress_clear - // [918] phi from main::@100 to display_progress_clear [phi:main::@100->display_progress_clear] + // [573] phi from main::@52 to display_progress_clear [phi:main::@52->display_progress_clear] jsr display_progress_clear - // [84] phi from main::@100 to main::@101 [phi:main::@100->main::@101] - // main::@101 + // [84] phi from main::@52 to main::@53 [phi:main::@52->main::@53] + // main::@53 // display_chip_smc() // [85] call display_chip_smc - // [933] phi from main::@101 to display_chip_smc [phi:main::@101->display_chip_smc] + // [588] phi from main::@53 to display_chip_smc [phi:main::@53->display_chip_smc] jsr display_chip_smc - // [86] phi from main::@101 to main::@102 [phi:main::@101->main::@102] - // main::@102 + // [86] phi from main::@53 to main::@54 [phi:main::@53->main::@54] + // main::@54 // display_chip_vera() // [87] call display_chip_vera - // [938] phi from main::@102 to display_chip_vera [phi:main::@102->display_chip_vera] + // [593] phi from main::@54 to display_chip_vera [phi:main::@54->display_chip_vera] jsr display_chip_vera - // [88] phi from main::@102 to main::@103 [phi:main::@102->main::@103] - // main::@103 + // [88] phi from main::@54 to main::@55 [phi:main::@54->main::@55] + // main::@55 // display_chip_rom() // [89] call display_chip_rom - // [943] phi from main::@103 to display_chip_rom [phi:main::@103->display_chip_rom] + // [598] phi from main::@55 to display_chip_rom [phi:main::@55->display_chip_rom] jsr display_chip_rom - // [90] phi from main::@103 to main::@104 [phi:main::@103->main::@104] - // main::@104 + // [90] phi from main::@55 to main::@56 [phi:main::@55->main::@56] + // main::@56 // display_info_smc(STATUS_COLOR_NONE, NULL) // [91] call display_info_smc - // [962] phi from main::@104 to display_info_smc [phi:main::@104->display_info_smc] - // [962] phi display_info_smc::info_text#20 = 0 [phi:main::@104->display_info_smc#0] -- pbuz1=vbuc1 + // [617] phi from main::@56 to display_info_smc [phi:main::@56->display_info_smc] + // [617] phi display_info_smc::info_text#10 = 0 [phi:main::@56->display_info_smc#0] -- pbuz1=vbuc1 lda #<0 sta.z display_info_smc.info_text sta.z display_info_smc.info_text+1 - // [962] phi smc_bootloader#14 = 0 [phi:main::@104->display_info_smc#1] -- vwum1=vwuc1 - sta smc_bootloader_1 - sta smc_bootloader_1+1 - // [962] phi display_info_smc::info_status#20 = BLACK [phi:main::@104->display_info_smc#2] -- vbum1=vbuc1 + // [617] phi display_info_smc::info_status#10 = BLACK [phi:main::@56->display_info_smc#1] -- vbum1=vbuc1 lda #BLACK sta display_info_smc.info_status jsr display_info_smc - // [92] phi from main::@104 to main::@105 [phi:main::@104->main::@105] - // main::@105 + // [92] phi from main::@56 to main::@57 [phi:main::@56->main::@57] + // main::@57 // display_info_vera(STATUS_NONE, NULL) // [93] call display_info_vera - // [998] phi from main::@105 to display_info_vera [phi:main::@105->display_info_vera] - // [998] phi display_info_vera::info_text#19 = 0 [phi:main::@105->display_info_vera#0] -- pbuz1=vbuc1 + // [653] phi from main::@57 to display_info_vera [phi:main::@57->display_info_vera] + // [653] phi display_info_vera::info_text#19 = 0 [phi:main::@57->display_info_vera#0] -- pbuz1=vbuc1 lda #<0 sta.z display_info_vera.info_text sta.z display_info_vera.info_text+1 - // [998] phi spi_memory_capacity#106 = 0 [phi:main::@105->display_info_vera#1] -- vbum1=vbuc1 + // [653] phi spi_memory_capacity#110 = 0 [phi:main::@57->display_info_vera#1] -- vbum1=vbuc1 sta spi_memory_capacity - // [998] phi spi_memory_type#107 = 0 [phi:main::@105->display_info_vera#2] -- vbum1=vbuc1 + // [653] phi spi_memory_type#111 = 0 [phi:main::@57->display_info_vera#2] -- vbum1=vbuc1 sta spi_memory_type - // [998] phi spi_manufacturer#108 = 0 [phi:main::@105->display_info_vera#3] -- vbum1=vbuc1 + // [653] phi spi_manufacturer#100 = 0 [phi:main::@57->display_info_vera#3] -- vbum1=vbuc1 sta spi_manufacturer - // [998] phi display_info_vera::info_status#19 = STATUS_NONE [phi:main::@105->display_info_vera#4] -- vbum1=vbuc1 + // [653] phi display_info_vera::info_status#19 = STATUS_NONE [phi:main::@57->display_info_vera#4] -- vbum1=vbuc1 lda #STATUS_NONE sta display_info_vera.info_status jsr display_info_vera - // [94] phi from main::@105 to main::@12 [phi:main::@105->main::@12] - // [94] phi main::rom_chip#2 = 0 [phi:main::@105->main::@12#0] -- vbuz1=vbuc1 + // [94] phi from main::@57 to main::@10 [phi:main::@57->main::@10] + // [94] phi main::rom_chip#2 = 0 [phi:main::@57->main::@10#0] -- vbuz1=vbuc1 lda #0 sta.z rom_chip - // main::@12 - __b12: + // main::@10 + __b10: // for(unsigned char rom_chip=0; rom_chip<8; rom_chip++) - // [95] if(main::rom_chip#2<8) goto main::@13 -- vbuz1_lt_vbuc1_then_la1 + // [95] if(main::rom_chip#2<8) goto main::@11 -- vbuz1_lt_vbuc1_then_la1 lda.z rom_chip cmp #8 - bcs !__b13+ - jmp __b13 - !__b13: - // [96] phi from main::@12 to main::@14 [phi:main::@12->main::@14] - // main::@14 + bcs !__b11+ + jmp __b11 + !__b11: + // [96] phi from main::@10 to main::@12 [phi:main::@10->main::@12] + // main::@12 // main_intro() // [97] call main_intro - // [1038] phi from main::@14 to main_intro [phi:main::@14->main_intro] + // [693] phi from main::@12 to main_intro [phi:main::@12->main_intro] jsr main_intro - // [98] phi from main::@14 to main::@108 [phi:main::@14->main::@108] - // main::@108 - // smc_detect() - // [99] call smc_detect - jsr smc_detect - // [100] smc_detect::return#2 = smc_detect::return#0 - // main::@109 - // smc_bootloader = smc_detect() - // [101] smc_bootloader#0 = smc_detect::return#2 -- vwum1=vwum2 - lda smc_detect.return - sta smc_bootloader - lda smc_detect.return+1 - sta smc_bootloader+1 - // strcpy(smc_version_text, "0.0.0") - // [102] call strcpy - // [1066] phi from main::@109 to strcpy [phi:main::@109->strcpy] - // [1066] phi strcpy::dst#0 = smc_version_text [phi:main::@109->strcpy#0] -- pbuz1=pbuc1 - lda #smc_version_text - sta.z strcpy.dst+1 - // [1066] phi strcpy::src#0 = main::source1 [phi:main::@109->strcpy#1] -- pbuz1=pbuc1 - lda #source1 - sta.z strcpy.src+1 - jsr strcpy - // [103] phi from main::@109 to main::@110 [phi:main::@109->main::@110] - // main::@110 - // display_chip_smc() - // [104] call display_chip_smc - // [933] phi from main::@110 to display_chip_smc [phi:main::@110->display_chip_smc] - jsr display_chip_smc - // main::@111 - // if(smc_bootloader == 0x0100) - // [105] if(smc_bootloader#0==$100) goto main::@1 -- vwum1_eq_vwuc1_then_la1 - lda smc_bootloader - cmp #<$100 - bne !+ - lda smc_bootloader+1 - cmp #>$100 - bne !__b1+ - jmp __b1 - !__b1: - !: - // main::@15 - // if(smc_bootloader == 0x0200) - // [106] if(smc_bootloader#0==$200) goto main::@18 -- vwum1_eq_vwuc1_then_la1 - lda smc_bootloader - cmp #<$200 - bne !+ - lda smc_bootloader+1 - cmp #>$200 - bne !__b18+ - jmp __b18 - !__b18: - !: - // main::@16 - // if(smc_bootloader > 0x2) - // [107] if(smc_bootloader#0>=2+1) goto main::@19 -- vwum1_ge_vbuc1_then_la1 - lda smc_bootloader+1 - beq !__b19+ - jmp __b19 - !__b19: - lda smc_bootloader - cmp #2+1 - bcc !__b19+ - jmp __b19 - !__b19: - !: - // main::@17 - // cx16_k_i2c_read_byte(FLASH_I2C_SMC_DEVICE, FLASH_I2C_SMC_VERSION) - // [108] cx16_k_i2c_read_byte::device = $42 -- vbum1=vbuc1 - lda #$42 - sta cx16_k_i2c_read_byte.device - // [109] cx16_k_i2c_read_byte::offset = $30 -- vbum1=vbuc1 - lda #$30 - sta cx16_k_i2c_read_byte.offset - // [110] call cx16_k_i2c_read_byte - jsr cx16_k_i2c_read_byte - // [111] cx16_k_i2c_read_byte::return#14 = cx16_k_i2c_read_byte::return#1 - // main::@118 - // smc_release = cx16_k_i2c_read_byte(FLASH_I2C_SMC_DEVICE, FLASH_I2C_SMC_VERSION) - // [112] smc_release#0 = cx16_k_i2c_read_byte::return#14 -- vbum1=vwum2 - lda cx16_k_i2c_read_byte.return - sta smc_release - // cx16_k_i2c_read_byte(FLASH_I2C_SMC_DEVICE, FLASH_I2C_SMC_MAJOR) - // [113] cx16_k_i2c_read_byte::device = $42 -- vbum1=vbuc1 - lda #$42 - sta cx16_k_i2c_read_byte.device - // [114] cx16_k_i2c_read_byte::offset = $31 -- vbum1=vbuc1 - lda #$31 - sta cx16_k_i2c_read_byte.offset - // [115] call cx16_k_i2c_read_byte - jsr cx16_k_i2c_read_byte - // [116] cx16_k_i2c_read_byte::return#15 = cx16_k_i2c_read_byte::return#1 - // main::@119 - // smc_major = cx16_k_i2c_read_byte(FLASH_I2C_SMC_DEVICE, FLASH_I2C_SMC_MAJOR) - // [117] smc_major#0 = cx16_k_i2c_read_byte::return#15 -- vbum1=vwum2 - lda cx16_k_i2c_read_byte.return - sta smc_major - // cx16_k_i2c_read_byte(FLASH_I2C_SMC_DEVICE, FLASH_I2C_SMC_MINOR) - // [118] cx16_k_i2c_read_byte::device = $42 -- vbum1=vbuc1 - lda #$42 - sta cx16_k_i2c_read_byte.device - // [119] cx16_k_i2c_read_byte::offset = $32 -- vbum1=vbuc1 - lda #$32 - sta cx16_k_i2c_read_byte.offset - // [120] call cx16_k_i2c_read_byte - jsr cx16_k_i2c_read_byte - // [121] cx16_k_i2c_read_byte::return#16 = cx16_k_i2c_read_byte::return#1 - // main::@120 - // smc_minor = cx16_k_i2c_read_byte(FLASH_I2C_SMC_DEVICE, FLASH_I2C_SMC_MINOR) - // [122] smc_minor#0 = cx16_k_i2c_read_byte::return#16 -- vbum1=vwum2 - lda cx16_k_i2c_read_byte.return - sta smc_minor - // smc_get_version_text(smc_version_text, smc_release, smc_major, smc_minor) - // [123] smc_get_version_text::release#0 = smc_release#0 -- vbum1=vbum2 - lda smc_release - sta smc_get_version_text.release - // [124] smc_get_version_text::major#0 = smc_major#0 -- vbum1=vbum2 - lda smc_major - sta smc_get_version_text.major - // [125] smc_get_version_text::minor#0 = smc_minor#0 -- vbum1=vbum2 - lda smc_minor - sta smc_get_version_text.minor - // [126] call smc_get_version_text - // [1079] phi from main::@120 to smc_get_version_text [phi:main::@120->smc_get_version_text] - // [1079] phi smc_get_version_text::minor#2 = smc_get_version_text::minor#0 [phi:main::@120->smc_get_version_text#0] -- register_copy - // [1079] phi smc_get_version_text::major#2 = smc_get_version_text::major#0 [phi:main::@120->smc_get_version_text#1] -- register_copy - // [1079] phi smc_get_version_text::release#2 = smc_get_version_text::release#0 [phi:main::@120->smc_get_version_text#2] -- register_copy - // [1079] phi smc_get_version_text::version_string#2 = smc_version_text [phi:main::@120->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::@121 - // [127] smc_bootloader#503 = 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) - // [128] call display_info_smc - // [962] phi from main::@121 to display_info_smc [phi:main::@121->display_info_smc] - // [962] phi display_info_smc::info_text#20 = 0 [phi:main::@121->display_info_smc#0] -- pbuz1=vbuc1 - lda #<0 - sta.z display_info_smc.info_text - sta.z display_info_smc.info_text+1 - // [962] phi smc_bootloader#14 = smc_bootloader#503 [phi:main::@121->display_info_smc#1] -- register_copy - // [962] phi display_info_smc::info_status#20 = STATUS_DETECTED [phi:main::@121->display_info_smc#2] -- vbum1=vbuc1 - lda #STATUS_DETECTED - sta display_info_smc.info_status - jsr display_info_smc - // [129] phi from main::@121 to main::@2 [phi:main::@121->main::@2] - // [129] phi smc_minor#398 = smc_minor#0 [phi:main::@121->main::@2#0] -- register_copy - // [129] phi smc_major#399 = smc_major#0 [phi:main::@121->main::@2#1] -- register_copy - // [129] phi smc_release#400 = smc_release#0 [phi:main::@121->main::@2#2] -- register_copy - // main::@2 - __b2: + // [98] phi from main::@12 to main::@60 [phi:main::@12->main::@60] + // main::@60 // main_vera_detect() - // [130] call main_vera_detect - // [1096] phi from main::@2 to main_vera_detect [phi:main::@2->main_vera_detect] + // [99] call main_vera_detect + // [710] phi from main::@60 to main_vera_detect [phi:main::@60->main_vera_detect] jsr main_vera_detect - // main::SEI1 - // asm - // asm { sei } - sei - // [132] phi from main::SEI1 to main::@68 [phi:main::SEI1->main::@68] - // main::@68 - // rom_detect() - // [133] call rom_detect - // Detecting ROM chips - // [1105] phi from main::@68 to rom_detect [phi:main::@68->rom_detect] - jsr rom_detect - // [134] phi from main::@68 to main::@122 [phi:main::@68->main::@122] - // main::@122 - // display_chip_rom() - // [135] call display_chip_rom - // [943] phi from main::@122 to display_chip_rom [phi:main::@122->display_chip_rom] - jsr display_chip_rom - // [136] phi from main::@122 to main::@20 [phi:main::@122->main::@20] - // [136] phi main::rom_chip1#10 = 0 [phi:main::@122->main::@20#0] -- vbuz1=vbuc1 - lda #0 - sta.z rom_chip1 - // main::@20 - __b20: - // for(unsigned char rom_chip = 0; rom_chip < 8; rom_chip++) - // [137] if(main::rom_chip1#10<8) goto main::@21 -- vbuz1_lt_vbuc1_then_la1 - lda.z rom_chip1 - cmp #8 - bcs !__b21+ - jmp __b21 - !__b21: // main::bank_set_brom1 // BROM = bank - // [138] BROM = main::bank_set_brom1_bank#0 -- vbuz1=vbuc1 + // [100] BROM = main::bank_set_brom1_bank#0 -- vbuz1=vbuc1 lda #bank_set_brom1_bank sta.z BROM // main::CLI1 // asm // asm { cli } cli - // main::check_status_smc1 - // status_smc == status - // [140] main::check_status_smc1_$0 = status_smc#0 == STATUS_DETECTED -- vboz1=vbum2_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); - // [141] main::check_status_smc1_return#0 = (char)main::check_status_smc1_$0 -- vbum1=vbuz2 - sta check_status_smc1_return - // main::@69 - // if(check_status_smc(STATUS_DETECTED)) - // [142] if(0==main::check_status_smc1_return#0) goto main::CLI2 -- 0_eq_vbum1_then_la1 - bne !__b7+ - jmp __b7 - !__b7: - // [143] phi from main::@69 to main::@24 [phi:main::@69->main::@24] - // main::@24 - // display_action_progress("Checking SMC.BIN ...") - // [144] call display_action_progress - // [904] phi from main::@24 to display_action_progress [phi:main::@24->display_action_progress] - // [904] phi display_action_progress::info_text#27 = main::info_text3 [phi:main::@24->display_action_progress#0] -- pbuz1=pbuc1 - lda #info_text3 - sta.z display_action_progress.info_text+1 - jsr display_action_progress - // [145] phi from main::@24 to main::@128 [phi:main::@24->main::@128] - // main::@128 - // smc_read(STATUS_CHECKING) - // [146] call smc_read - // [1155] phi from main::@128 to smc_read [phi:main::@128->smc_read] - // [1155] phi __errno#102 = 0 [phi:main::@128->smc_read#0] -- vwsm1=vwsc1 - lda #<0 - sta __errno - sta __errno+1 - // [1155] phi __stdio_filecount#128 = 0 [phi:main::@128->smc_read#1] -- vbum1=vbuc1 - sta __stdio_filecount - // [1155] phi smc_read::info_status#10 = STATUS_CHECKING [phi:main::@128->smc_read#2] -- vbum1=vbuc1 - lda #STATUS_CHECKING - sta smc_read.info_status - jsr smc_read - // smc_read(STATUS_CHECKING) - // [147] smc_read::return#2 = smc_read::return#0 - // main::@129 - // smc_file_size = smc_read(STATUS_CHECKING) - // [148] smc_file_size#0 = smc_read::return#2 -- vwum1=vwum2 - lda smc_read.return - sta smc_file_size - lda smc_read.return+1 - sta smc_file_size+1 - // if (!smc_file_size) - // [149] if(0==smc_file_size#0) goto main::@27 -- 0_eq_vwum1_then_la1 - lda smc_file_size - ora smc_file_size+1 - bne !__b27+ - jmp __b27 - !__b27: - // main::@25 - // if(smc_file_size > 0x1E00) - // [150] if(smc_file_size#0>$1e00) goto main::@28 -- vwum1_gt_vwuc1_then_la1 - lda #>$1e00 - cmp smc_file_size+1 - bcs !__b28+ - jmp __b28 - !__b28: - bne !+ - lda #<$1e00 - cmp smc_file_size - bcs !__b28+ - jmp __b28 - !__b28: - !: - // main::@26 - // smc_file_release = smc_file_header[0] - // [151] smc_file_release#0 = *smc_file_header -- vbum1=_deref_pbuc1 - // SF4 | SMC.BIN and all ok | Display the SMC.BIN file version and set SMC to Flash. | Flash - // The first 3 bytes of the smc file header is the version of the SMC file. - lda smc_file_header - sta smc_file_release - // smc_file_major = smc_file_header[1] - // [152] smc_file_major#0 = *(smc_file_header+1) -- vbum1=_deref_pbuc1 - lda smc_file_header+1 - sta smc_file_major - // smc_file_minor = smc_file_header[2] - // [153] smc_file_minor#0 = *(smc_file_header+2) -- vbum1=_deref_pbuc1 - lda smc_file_header+2 - sta smc_file_minor - // smc_get_version_text(smc_file_version_text, smc_file_release, smc_file_major, smc_file_minor) - // [154] smc_get_version_text::release#1 = smc_file_release#0 -- vbum1=vbum2 - lda smc_file_release - sta smc_get_version_text.release - // [155] smc_get_version_text::major#1 = smc_file_major#0 -- vbum1=vbum2 - lda smc_file_major - sta smc_get_version_text.major - // [156] smc_get_version_text::minor#1 = smc_file_minor#0 -- vbum1=vbum2 - lda smc_file_minor - sta smc_get_version_text.minor - // [157] call smc_get_version_text - // [1079] phi from main::@26 to smc_get_version_text [phi:main::@26->smc_get_version_text] - // [1079] phi smc_get_version_text::minor#2 = smc_get_version_text::minor#1 [phi:main::@26->smc_get_version_text#0] -- register_copy - // [1079] phi smc_get_version_text::major#2 = smc_get_version_text::major#1 [phi:main::@26->smc_get_version_text#1] -- register_copy - // [1079] phi smc_get_version_text::release#2 = smc_get_version_text::release#1 [phi:main::@26->smc_get_version_text#2] -- register_copy - // [1079] phi smc_get_version_text::version_string#2 = main::smc_file_version_text [phi:main::@26->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 - // [158] phi from main::@26 to main::@130 [phi:main::@26->main::@130] - // main::@130 - // sprintf(info_text, "SMC.BIN:%s", smc_file_version_text) - // [159] call snprintf_init - // [1205] phi from main::@130 to snprintf_init [phi:main::@130->snprintf_init] - // [1205] phi snprintf_init::s#31 = info_text [phi:main::@130->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 - // [160] phi from main::@130 to main::@131 [phi:main::@130->main::@131] - // main::@131 - // sprintf(info_text, "SMC.BIN:%s", smc_file_version_text) - // [161] call printf_str - // [1210] phi from main::@131 to printf_str [phi:main::@131->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:main::@131->printf_str#0] -- pprz1=pprc1 - lda #snputc - sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = main::s4 [phi:main::@131->printf_str#1] -- pbuz1=pbuc1 - lda #s4 - sta.z printf_str.s+1 - jsr printf_str - // [162] phi from main::@131 to main::@132 [phi:main::@131->main::@132] - // main::@132 - // sprintf(info_text, "SMC.BIN:%s", smc_file_version_text) - // [163] call printf_string - // [1219] phi from main::@132 to printf_string [phi:main::@132->printf_string] - // [1219] phi printf_string::putc#26 = &snputc [phi:main::@132->printf_string#0] -- pprz1=pprc1 - lda #snputc - sta.z printf_string.putc+1 - // [1219] phi printf_string::str#26 = main::smc_file_version_text [phi:main::@132->printf_string#1] -- pbuz1=pbuc1 - lda #smc_file_version_text - sta.z printf_string.str+1 - // [1219] phi printf_string::format_justify_left#26 = 0 [phi:main::@132->printf_string#2] -- vbum1=vbuc1 - lda #0 - sta printf_string.format_justify_left - // [1219] phi printf_string::format_min_length#26 = 0 [phi:main::@132->printf_string#3] -- vbum1=vbuc1 - sta printf_string.format_min_length - jsr printf_string - // main::@133 - // sprintf(info_text, "SMC.BIN:%s", smc_file_version_text) - // [164] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 - lda #0 - pha - // [165] callexecute snputc -- call_vprc1 - jsr snputc - // sideeffect stackpullpadding(1) -- _stackpullpadding_1 - pla - // [167] smc_bootloader#505 = smc_bootloader#0 -- vwum1=vwum2 - lda smc_bootloader - sta smc_bootloader_1 - lda smc_bootloader+1 - sta smc_bootloader_1+1 - // display_info_smc(STATUS_FLASH, info_text) - // [168] call display_info_smc - // All ok, display file version. - // [962] phi from main::@133 to display_info_smc [phi:main::@133->display_info_smc] - // [962] phi display_info_smc::info_text#20 = info_text [phi:main::@133->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 - // [962] phi smc_bootloader#14 = smc_bootloader#505 [phi:main::@133->display_info_smc#1] -- register_copy - // [962] phi display_info_smc::info_status#20 = STATUS_FLASH [phi:main::@133->display_info_smc#2] -- vbum1=vbuc1 - lda #STATUS_FLASH - sta display_info_smc.info_status - jsr display_info_smc - // [169] phi from main::@133 to main::CLI2 [phi:main::@133->main::CLI2] - // [169] phi smc_file_minor#301 = smc_file_minor#0 [phi:main::@133->main::CLI2#0] -- register_copy - // [169] phi smc_file_major#301 = smc_file_major#0 [phi:main::@133->main::CLI2#1] -- register_copy - // [169] phi smc_file_release#301 = smc_file_release#0 [phi:main::@133->main::CLI2#2] -- register_copy - // [169] phi __stdio_filecount#109 = __stdio_filecount#39 [phi:main::@133->main::CLI2#3] -- register_copy - // [169] phi __errno#113 = __errno#123 [phi:main::@133->main::CLI2#4] -- register_copy - jmp CLI2 - // [169] phi from main::@69 to main::CLI2 [phi:main::@69->main::CLI2] - __b7: - // [169] phi smc_file_minor#301 = 0 [phi:main::@69->main::CLI2#0] -- vbum1=vbuc1 - lda #0 - sta smc_file_minor - // [169] phi smc_file_major#301 = 0 [phi:main::@69->main::CLI2#1] -- vbum1=vbuc1 - sta smc_file_major - // [169] phi smc_file_release#301 = 0 [phi:main::@69->main::CLI2#2] -- vbum1=vbuc1 - sta smc_file_release - // [169] phi __stdio_filecount#109 = 0 [phi:main::@69->main::CLI2#3] -- vbum1=vbuc1 - sta __stdio_filecount - // [169] phi __errno#113 = 0 [phi:main::@69->main::CLI2#4] -- vwsm1=vwsc1 - sta __errno - sta __errno+1 - // main::CLI2 - CLI2: - // asm - // asm { cli } - cli - // main::bank_set_brom3 - // BROM = bank - // [171] BROM = main::bank_set_brom3_bank#0 -- vbuz1=vbuc1 - lda #bank_set_brom3_bank - sta.z BROM - // main::CLI3 - // asm - // asm { cli } - cli - // [173] phi from main::CLI3 to main::@71 [phi:main::CLI3->main::@71] - // main::@71 + // [102] phi from main::CLI1 to main::@28 [phi:main::CLI1->main::@28] + // main::@28 // display_progress_clear() - // [174] call display_progress_clear - // [918] phi from main::@71 to display_progress_clear [phi:main::@71->display_progress_clear] + // [103] call display_progress_clear + // [573] phi from main::@28 to display_progress_clear [phi:main::@28->display_progress_clear] jsr display_progress_clear - // [175] phi from main::@71 to main::@127 [phi:main::@71->main::@127] - // main::@127 + // [104] phi from main::@28 to main::@61 [phi:main::@28->main::@61] + // main::@61 // main_vera_check() - // [176] call main_vera_check - // [1244] phi from main::@127 to main_vera_check [phi:main::@127->main_vera_check] + // [105] call main_vera_check + // [719] phi from main::@61 to main_vera_check [phi:main::@61->main_vera_check] jsr main_vera_check - // main::bank_set_brom4 + // main::bank_set_brom2 // BROM = bank - // [177] BROM = main::bank_set_brom4_bank#0 -- vbuz1=vbuc1 - lda #bank_set_brom4_bank + // [106] BROM = main::bank_set_brom2_bank#0 -- vbuz1=vbuc1 + lda #bank_set_brom2_bank sta.z BROM - // main::SEI2 + // main::SEI1 // asm // asm { sei } sei - // main::SEI3 - // asm { sei } - sei - // [180] phi from main::SEI3 to main::@29 [phi:main::SEI3->main::@29] - // [180] phi __stdio_filecount#111 = __stdio_filecount#36 [phi:main::SEI3->main::@29#0] -- register_copy - // [180] phi __errno#115 = __errno#123 [phi:main::SEI3->main::@29#1] -- register_copy - // [180] phi main::rom_chip2#10 = 0 [phi:main::SEI3->main::@29#2] -- vbuz1=vbuc1 - lda #0 - sta.z 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::@29 - __b29: - // for(unsigned char rom_chip = 0; rom_chip < 8; rom_chip++) - // [181] if(main::rom_chip2#10<8) goto main::bank_set_brom5 -- vbuz1_lt_vbuc1_then_la1 - lda.z rom_chip2 - cmp #8 - bcs !bank_set_brom5+ - jmp bank_set_brom5 - !bank_set_brom5: - // main::bank_set_brom6 - // BROM = bank - // [182] BROM = main::bank_set_brom6_bank#0 -- vbuz1=vbuc1 - lda #bank_set_brom6_bank - sta.z BROM - // main::CLI4 - // asm - // asm { cli } - cli - // main::check_status_smc2 + // main::check_status_smc1 // status_smc == status - // [184] main::check_status_smc2_$0 = status_smc#0 == STATUS_FLASH -- vbom1=vbum2_eq_vbuc1 + // [108] main::check_status_smc1_$0 = status_smc#0 == STATUS_FLASH -- vboz1=vbum2_eq_vbuc1 lda status_smc eor #STATUS_FLASH beq !+ lda #1 !: eor #1 - sta check_status_smc2_main__0 + sta.z check_status_smc1_main__0 // return (unsigned char)(status_smc == status); - // [185] main::check_status_smc2_return#0 = (char)main::check_status_smc2_$0 -- vbum1=vbum2 - sta check_status_smc2_return - // [186] phi from main::check_status_smc2 to main::check_status_cx16_rom1 [phi:main::check_status_smc2->main::check_status_cx16_rom1] + // [109] main::check_status_smc1_return#0 = (char)main::check_status_smc1_$0 -- vbum1=vbuz2 + sta check_status_smc1_return + // [110] phi from main::check_status_smc1 to main::check_status_cx16_rom1 [phi:main::check_status_smc1->main::check_status_cx16_rom1] // main::check_status_cx16_rom1 // main::check_status_cx16_rom1_check_status_rom1 // status_rom[rom_chip] == status - // [187] main::check_status_cx16_rom1_check_status_rom1_$0 = *status_rom == STATUS_FLASH -- vbom1=_deref_pbuc1_eq_vbuc2 + // [111] main::check_status_cx16_rom1_check_status_rom1_$0 = *status_rom == STATUS_FLASH -- vboz1=_deref_pbuc1_eq_vbuc2 lda status_rom eor #STATUS_FLASH beq !+ lda #1 !: eor #1 - sta check_status_cx16_rom1_check_status_rom1_main__0 + sta.z check_status_cx16_rom1_check_status_rom1_main__0 // return (unsigned char)(status_rom[rom_chip] == status); - // [188] main::check_status_cx16_rom1_check_status_rom1_return#0 = (char)main::check_status_cx16_rom1_check_status_rom1_$0 -- vbum1=vbum2 + // [112] main::check_status_cx16_rom1_check_status_rom1_return#0 = (char)main::check_status_cx16_rom1_check_status_rom1_$0 -- vbum1=vbuz2 sta check_status_cx16_rom1_check_status_rom1_return - // main::@73 + // main::@29 // if(!check_status_smc(STATUS_FLASH) && check_status_cx16_rom(STATUS_FLASH)) - // [189] if(0!=main::check_status_smc2_return#0) goto main::check_status_smc3 -- 0_neq_vbum1_then_la1 - lda check_status_smc2_return - bne check_status_smc3 - // main::@244 - // [190] if(0!=main::check_status_cx16_rom1_check_status_rom1_return#0) goto main::@36 -- 0_neq_vbum1_then_la1 + // [113] if(0!=main::check_status_smc1_return#0) goto main::check_status_smc2 -- 0_neq_vbum1_then_la1 + lda check_status_smc1_return + bne check_status_smc2 + // main::@125 + // [114] if(0!=main::check_status_cx16_rom1_check_status_rom1_return#0) goto main::@13 -- 0_neq_vbum1_then_la1 lda check_status_cx16_rom1_check_status_rom1_return - beq !__b36+ - jmp __b36 - !__b36: - // main::check_status_smc3 - check_status_smc3: + beq !__b13+ + jmp __b13 + !__b13: + // main::check_status_smc2 + check_status_smc2: // status_smc == status - // [191] main::check_status_smc3_$0 = status_smc#0 == STATUS_FLASH -- vbom1=vbum2_eq_vbuc1 + // [115] main::check_status_smc2_$0 = status_smc#0 == STATUS_FLASH -- vboz1=vbum2_eq_vbuc1 lda status_smc eor #STATUS_FLASH beq !+ lda #1 !: eor #1 - sta check_status_smc3_main__0 + sta.z check_status_smc2_main__0 // return (unsigned char)(status_smc == status); - // [192] main::check_status_smc3_return#0 = (char)main::check_status_smc3_$0 -- vbum1=vbum2 - sta check_status_smc3_return - // [193] phi from main::check_status_smc3 to main::check_status_cx16_rom2 [phi:main::check_status_smc3->main::check_status_cx16_rom2] + // [116] main::check_status_smc2_return#0 = (char)main::check_status_smc2_$0 -- vbum1=vbuz2 + sta check_status_smc2_return + // [117] phi from main::check_status_smc2 to main::check_status_cx16_rom2 [phi:main::check_status_smc2->main::check_status_cx16_rom2] // main::check_status_cx16_rom2 // main::check_status_cx16_rom2_check_status_rom1 // status_rom[rom_chip] == status - // [194] main::check_status_cx16_rom2_check_status_rom1_$0 = *status_rom == STATUS_NONE -- vbom1=_deref_pbuc1_eq_vbuc2 + // [118] main::check_status_cx16_rom2_check_status_rom1_$0 = *status_rom == STATUS_NONE -- vboz1=_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 + sta.z check_status_cx16_rom2_check_status_rom1_main__0 // return (unsigned char)(status_rom[rom_chip] == status); - // [195] main::check_status_cx16_rom2_check_status_rom1_return#0 = (char)main::check_status_cx16_rom2_check_status_rom1_$0 -- vbum1=vbum2 + // [119] main::check_status_cx16_rom2_check_status_rom1_return#0 = (char)main::check_status_cx16_rom2_check_status_rom1_$0 -- vbum1=vbuz2 sta check_status_cx16_rom2_check_status_rom1_return - // main::@74 + // main::@30 // if(check_status_smc(STATUS_FLASH) && check_status_cx16_rom(STATUS_NONE)) - // [196] if(0==main::check_status_smc3_return#0) goto main::check_status_smc4 -- 0_eq_vbum1_then_la1 + // [120] if(0==main::check_status_smc2_return#0) goto main::check_status_smc3 -- 0_eq_vbum1_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 - beq check_status_smc4 - // main::@245 - // [197] if(0!=main::check_status_cx16_rom2_check_status_rom1_return#0) goto main::@3 -- 0_neq_vbum1_then_la1 + lda check_status_smc2_return + beq check_status_smc3 + // main::@126 + // [121] if(0!=main::check_status_cx16_rom2_check_status_rom1_return#0) goto main::@1 -- 0_neq_vbum1_then_la1 lda check_status_cx16_rom2_check_status_rom1_return - beq !__b3+ - jmp __b3 - !__b3: - // main::check_status_smc4 - check_status_smc4: + beq !__b1+ + jmp __b1 + !__b1: + // main::check_status_smc3 + check_status_smc3: // status_smc == status - // [198] main::check_status_smc4_$0 = status_smc#0 == STATUS_FLASH -- vbom1=vbum2_eq_vbuc1 + // [122] main::check_status_smc3_$0 = status_smc#0 == STATUS_FLASH -- vboz1=vbum2_eq_vbuc1 lda status_smc eor #STATUS_FLASH beq !+ lda #1 !: eor #1 - sta check_status_smc4_main__0 + sta.z check_status_smc3_main__0 // return (unsigned char)(status_smc == status); - // [199] main::check_status_smc4_return#0 = (char)main::check_status_smc4_$0 -- vbum1=vbum2 - sta check_status_smc4_return - // [200] phi from main::check_status_smc4 to main::check_status_cx16_rom3 [phi:main::check_status_smc4->main::check_status_cx16_rom3] + // [123] main::check_status_smc3_return#0 = (char)main::check_status_smc3_$0 -- vbum1=vbuz2 + sta check_status_smc3_return + // [124] phi from main::check_status_smc3 to main::check_status_cx16_rom3 [phi:main::check_status_smc3->main::check_status_cx16_rom3] // main::check_status_cx16_rom3 // main::check_status_cx16_rom3_check_status_rom1 // status_rom[rom_chip] == status - // [201] main::check_status_cx16_rom3_check_status_rom1_$0 = *status_rom == STATUS_FLASH -- vbom1=_deref_pbuc1_eq_vbuc2 + // [125] main::check_status_cx16_rom3_check_status_rom1_$0 = *status_rom == STATUS_FLASH -- vboz1=_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 + sta.z check_status_cx16_rom3_check_status_rom1_main__0 // return (unsigned char)(status_rom[rom_chip] == status); - // [202] main::check_status_cx16_rom3_check_status_rom1_return#0 = (char)main::check_status_cx16_rom3_check_status_rom1_$0 -- vbum1=vbum2 + // [126] main::check_status_cx16_rom3_check_status_rom1_return#0 = (char)main::check_status_cx16_rom3_check_status_rom1_$0 -- vbum1=vbuz2 sta check_status_cx16_rom3_check_status_rom1_return - // main::@75 + // main::@31 // if(check_status_smc(STATUS_FLASH) && !check_status_cx16_rom(STATUS_FLASH)) - // [203] if(0==main::check_status_smc4_return#0) goto main::check_status_smc5 -- 0_eq_vbum1_then_la1 - lda check_status_smc4_return - beq check_status_smc5 - // main::@246 - // [204] if(0==main::check_status_cx16_rom3_check_status_rom1_return#0) goto main::@5 -- 0_eq_vbum1_then_la1 + // [127] if(0==main::check_status_smc3_return#0) goto main::check_status_smc4 -- 0_eq_vbum1_then_la1 + lda check_status_smc3_return + beq check_status_smc4 + // main::@127 + // [128] if(0==main::check_status_cx16_rom3_check_status_rom1_return#0) goto main::@3 -- 0_eq_vbum1_then_la1 lda check_status_cx16_rom3_check_status_rom1_return - bne !__b5+ - jmp __b5 - !__b5: - // main::check_status_smc5 - check_status_smc5: + bne !__b3+ + jmp __b3 + !__b3: + // main::check_status_smc4 + check_status_smc4: // status_smc == status - // [205] main::check_status_smc5_$0 = status_smc#0 == STATUS_FLASH -- vbom1=vbum2_eq_vbuc1 + // [129] main::check_status_smc4_$0 = status_smc#0 == STATUS_FLASH -- vboz1=vbum2_eq_vbuc1 lda status_smc eor #STATUS_FLASH beq !+ lda #1 !: eor #1 - sta check_status_smc5_main__0 + sta.z check_status_smc4_main__0 // return (unsigned char)(status_smc == status); - // [206] main::check_status_smc5_return#0 = (char)main::check_status_smc5_$0 -- vbum1=vbum2 - sta check_status_smc5_return - // [207] phi from main::check_status_smc5 to main::check_status_cx16_rom4 [phi:main::check_status_smc5->main::check_status_cx16_rom4] + // [130] main::check_status_smc4_return#0 = (char)main::check_status_smc4_$0 -- vbum1=vbuz2 + sta check_status_smc4_return + // [131] phi from main::check_status_smc4 to main::check_status_cx16_rom4 [phi:main::check_status_smc4->main::check_status_cx16_rom4] // main::check_status_cx16_rom4 // main::check_status_cx16_rom4_check_status_rom1 // status_rom[rom_chip] == status - // [208] main::check_status_cx16_rom4_check_status_rom1_$0 = *status_rom == STATUS_FLASH -- vbom1=_deref_pbuc1_eq_vbuc2 + // [132] main::check_status_cx16_rom4_check_status_rom1_$0 = *status_rom == STATUS_FLASH -- vboz1=_deref_pbuc1_eq_vbuc2 lda status_rom eor #STATUS_FLASH beq !+ lda #1 !: eor #1 - sta check_status_cx16_rom4_check_status_rom1_main__0 + sta.z check_status_cx16_rom4_check_status_rom1_main__0 // return (unsigned char)(status_rom[rom_chip] == status); - // [209] main::check_status_cx16_rom4_check_status_rom1_return#0 = (char)main::check_status_cx16_rom4_check_status_rom1_$0 -- vbum1=vbum2 + // [133] main::check_status_cx16_rom4_check_status_rom1_return#0 = (char)main::check_status_cx16_rom4_check_status_rom1_$0 -- vbum1=vbuz2 sta check_status_cx16_rom4_check_status_rom1_return - // main::@76 + // main::@32 // smc_supported_rom(rom_release[0]) - // [210] smc_supported_rom::rom_release#0 = *rom_release -- vbum1=_deref_pbuc1 + // [134] smc_supported_rom::rom_release#0 = *rom_release -- vbum1=_deref_pbuc1 lda rom_release sta smc_supported_rom.rom_release - // [211] call smc_supported_rom - // [1271] phi from main::@76 to smc_supported_rom [phi:main::@76->smc_supported_rom] + // [135] call smc_supported_rom + // [746] phi from main::@32 to smc_supported_rom [phi:main::@32->smc_supported_rom] jsr smc_supported_rom // smc_supported_rom(rom_release[0]) - // [212] smc_supported_rom::return#3 = smc_supported_rom::return#2 - // main::@168 - // [213] main::$45 = smc_supported_rom::return#3 -- vbum1=vbum2 + // [136] smc_supported_rom::return#3 = smc_supported_rom::return#2 + // main::@74 + // [137] main::$30 = smc_supported_rom::return#3 -- vbuz1=vbum2 lda smc_supported_rom.return - sta main__45 + sta.z main__30 // if(check_status_smc(STATUS_FLASH) && check_status_cx16_rom(STATUS_FLASH) && !smc_supported_rom(rom_release[0])) - // [214] if(0==main::check_status_smc5_return#0) goto main::check_status_smc6 -- 0_eq_vbum1_then_la1 - lda check_status_smc5_return - beq check_status_smc6 - // main::@248 - // [215] if(0==main::check_status_cx16_rom4_check_status_rom1_return#0) goto main::check_status_smc6 -- 0_eq_vbum1_then_la1 + // [138] if(0==main::check_status_smc4_return#0) goto main::check_status_smc5 -- 0_eq_vbum1_then_la1 + lda check_status_smc4_return + beq check_status_smc5 + // main::@129 + // [139] if(0==main::check_status_cx16_rom4_check_status_rom1_return#0) goto main::check_status_smc5 -- 0_eq_vbum1_then_la1 lda check_status_cx16_rom4_check_status_rom1_return - beq check_status_smc6 - // main::@247 - // [216] if(0==main::$45) goto main::@6 -- 0_eq_vbum1_then_la1 - lda main__45 - bne !__b6+ - jmp __b6 - !__b6: - // main::check_status_smc6 - check_status_smc6: + beq check_status_smc5 + // main::@128 + // [140] if(0==main::$30) goto main::@4 -- 0_eq_vbuz1_then_la1 + lda.z main__30 + bne !__b4+ + jmp __b4 + !__b4: + // main::check_status_smc5 + check_status_smc5: // status_smc == status - // [217] main::check_status_smc6_$0 = status_smc#0 == STATUS_FLASH -- vbom1=vbum2_eq_vbuc1 + // [141] main::check_status_smc5_$0 = status_smc#0 == STATUS_FLASH -- vboz1=vbum2_eq_vbuc1 lda status_smc eor #STATUS_FLASH beq !+ lda #1 !: eor #1 - sta check_status_smc6_main__0 + sta.z check_status_smc5_main__0 // return (unsigned char)(status_smc == status); - // [218] main::check_status_smc6_return#0 = (char)main::check_status_smc6_$0 -- vbum1=vbum2 - sta check_status_smc6_return - // main::@77 + // [142] main::check_status_smc5_return#0 = (char)main::check_status_smc5_$0 -- vbum1=vbuz2 + sta check_status_smc5_return + // main::@33 // if(check_status_smc(STATUS_FLASH) && smc_release == smc_file_release && smc_major == smc_file_major && smc_minor == smc_file_minor) - // [219] if(0==main::check_status_smc6_return#0) goto main::check_status_smc7 -- 0_eq_vbum1_then_la1 - beq check_status_smc7 - // main::@251 - // [220] if(smc_release#400==smc_file_release#301) goto main::@250 -- vbum1_eq_vbum2_then_la1 - lda smc_release - cmp smc_file_release - bne !__b250+ - jmp __b250 - !__b250: - // main::check_status_smc7 - check_status_smc7: + // [143] if(0!=main::check_status_smc5_return#0) goto main::@6 -- 0_neq_vbum1_then_la1 + beq !__b6+ + jmp __b6 + !__b6: + // main::check_status_smc6 + check_status_smc6: // status_smc == status - // [221] main::check_status_smc7_$0 = status_smc#0 == STATUS_ISSUE -- vbom1=vbum2_eq_vbuc1 + // [144] main::check_status_smc6_$0 = status_smc#0 == STATUS_ISSUE -- vboz1=vbum2_eq_vbuc1 lda status_smc eor #STATUS_ISSUE beq !+ lda #1 !: eor #1 - sta check_status_smc7_main__0 + sta.z check_status_smc6_main__0 // return (unsigned char)(status_smc == status); - // [222] main::check_status_smc7_return#0 = (char)main::check_status_smc7_$0 -- vbum1=vbum2 - sta check_status_smc7_return + // [145] main::check_status_smc6_return#0 = (char)main::check_status_smc6_$0 -- vbum1=vbuz2 + sta check_status_smc6_return // main::check_status_vera1 // status_vera == status - // [223] main::check_status_vera1_$0 = status_vera#127 == STATUS_ISSUE -- vbom1=vbum2_eq_vbuc1 + // [146] main::check_status_vera1_$0 = status_vera#127 == STATUS_ISSUE -- vboz1=vbum2_eq_vbuc1 lda status_vera eor #STATUS_ISSUE beq !+ lda #1 !: eor #1 - sta check_status_vera1_main__0 + sta.z check_status_vera1_main__0 // return (unsigned char)(status_vera == status); - // [224] main::check_status_vera1_return#0 = (char)main::check_status_vera1_$0 -- vbum1=vbum2 + // [147] main::check_status_vera1_return#0 = (char)main::check_status_vera1_$0 -- vbum1=vbuz2 sta check_status_vera1_return - // [225] phi from main::check_status_vera1 to main::@78 [phi:main::check_status_vera1->main::@78] - // main::@78 + // [148] phi from main::check_status_vera1 to main::@34 [phi:main::check_status_vera1->main::@34] + // main::@34 // check_status_roms(STATUS_ISSUE) - // [226] call check_status_roms - // [1278] phi from main::@78 to check_status_roms [phi:main::@78->check_status_roms] - // [1278] phi check_status_roms::status#6 = STATUS_ISSUE [phi:main::@78->check_status_roms#0] -- vbum1=vbuc1 + // [149] call check_status_roms + // [753] phi from main::@34 to check_status_roms [phi:main::@34->check_status_roms] + // [753] phi check_status_roms::status#6 = STATUS_ISSUE [phi:main::@34->check_status_roms#0] -- vbum1=vbuc1 lda #STATUS_ISSUE sta check_status_roms.status jsr check_status_roms // check_status_roms(STATUS_ISSUE) - // [227] check_status_roms::return#3 = check_status_roms::return#2 - // main::@173 - // [228] main::$62 = check_status_roms::return#3 -- vbum1=vbum2 + // [150] check_status_roms::return#3 = check_status_roms::return#2 + // main::@79 + // [151] main::$47 = check_status_roms::return#3 -- vbuz1=vbum2 lda check_status_roms.return - sta main__62 - // main::check_status_smc8 + sta.z main__47 + // main::check_status_smc7 // status_smc == status - // [229] main::check_status_smc8_$0 = status_smc#0 == STATUS_ERROR -- vbom1=vbum2_eq_vbuc1 + // [152] main::check_status_smc7_$0 = status_smc#0 == STATUS_ERROR -- vboz1=vbum2_eq_vbuc1 lda status_smc eor #STATUS_ERROR beq !+ lda #1 !: eor #1 - sta check_status_smc8_main__0 + sta.z check_status_smc7_main__0 // return (unsigned char)(status_smc == status); - // [230] main::check_status_smc8_return#0 = (char)main::check_status_smc8_$0 -- vbum1=vbum2 - sta check_status_smc8_return + // [153] main::check_status_smc7_return#0 = (char)main::check_status_smc7_$0 -- vbum1=vbuz2 + sta check_status_smc7_return // main::check_status_vera2 // status_vera == status - // [231] main::check_status_vera2_$0 = status_vera#127 == STATUS_ERROR -- vbom1=vbum2_eq_vbuc1 + // [154] main::check_status_vera2_$0 = status_vera#127 == STATUS_ERROR -- vboz1=vbum2_eq_vbuc1 lda status_vera eor #STATUS_ERROR beq !+ lda #1 !: eor #1 - sta check_status_vera2_main__0 + sta.z check_status_vera2_main__0 // return (unsigned char)(status_vera == status); - // [232] main::check_status_vera2_return#0 = (char)main::check_status_vera2_$0 -- vbum1=vbum2 + // [155] main::check_status_vera2_return#0 = (char)main::check_status_vera2_$0 -- vbum1=vbuz2 sta check_status_vera2_return - // [233] phi from main::check_status_vera2 to main::@79 [phi:main::check_status_vera2->main::@79] - // main::@79 + // [156] phi from main::check_status_vera2 to main::@35 [phi:main::check_status_vera2->main::@35] + // main::@35 // check_status_roms(STATUS_ERROR) - // [234] call check_status_roms - // [1278] phi from main::@79 to check_status_roms [phi:main::@79->check_status_roms] - // [1278] phi check_status_roms::status#6 = STATUS_ERROR [phi:main::@79->check_status_roms#0] -- vbum1=vbuc1 + // [157] call check_status_roms + // [753] phi from main::@35 to check_status_roms [phi:main::@35->check_status_roms] + // [753] phi check_status_roms::status#6 = STATUS_ERROR [phi:main::@35->check_status_roms#0] -- vbum1=vbuc1 lda #STATUS_ERROR sta check_status_roms.status jsr check_status_roms // check_status_roms(STATUS_ERROR) - // [235] check_status_roms::return#4 = check_status_roms::return#2 - // main::@174 - // [236] main::$71 = check_status_roms::return#4 -- vbum1=vbum2 + // [158] check_status_roms::return#4 = check_status_roms::return#2 + // main::@80 + // [159] main::$56 = check_status_roms::return#4 -- vbuz1=vbum2 lda check_status_roms.return - sta main__71 + sta.z main__56 // 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)) - // [237] if(0!=main::check_status_smc7_return#0) goto main::check_status_vera3 -- 0_neq_vbum1_then_la1 - lda check_status_smc7_return + // [160] if(0!=main::check_status_smc6_return#0) goto main::check_status_vera3 -- 0_neq_vbum1_then_la1 + lda check_status_smc6_return bne check_status_vera3 - // main::@256 - // [238] if(0==main::check_status_vera1_return#0) goto main::@255 -- 0_eq_vbum1_then_la1 + // main::@134 + // [161] if(0==main::check_status_vera1_return#0) goto main::@133 -- 0_eq_vbum1_then_la1 lda check_status_vera1_return - bne !__b255+ - jmp __b255 - !__b255: + bne !__b133+ + jmp __b133 + !__b133: // main::check_status_vera3 check_status_vera3: // status_vera == status - // [239] main::check_status_vera3_$0 = status_vera#127 == STATUS_ERROR -- vbom1=vbum2_eq_vbuc1 + // [162] main::check_status_vera3_$0 = status_vera#127 == STATUS_ERROR -- vboz1=vbum2_eq_vbuc1 lda status_vera eor #STATUS_ERROR beq !+ lda #1 !: eor #1 - sta check_status_vera3_main__0 + sta.z check_status_vera3_main__0 // return (unsigned char)(status_vera == status); - // [240] main::check_status_vera3_return#0 = (char)main::check_status_vera3_$0 -- vbum1=vbum2 + // [163] main::check_status_vera3_return#0 = (char)main::check_status_vera3_$0 -- vbum1=vbuz2 sta check_status_vera3_return - // main::@80 + // main::@36 // if(check_status_vera(STATUS_ERROR)) - // [241] if(0==main::check_status_vera3_return#0) goto main::check_status_smc13 -- 0_eq_vbum1_then_la1 - bne !check_status_smc13+ - jmp check_status_smc13 - !check_status_smc13: - // main::bank_set_brom10 + // [164] if(0==main::check_status_vera3_return#0) goto main::check_status_smc9 -- 0_eq_vbum1_then_la1 + bne !check_status_smc9+ + jmp check_status_smc9 + !check_status_smc9: + // main::bank_set_brom5 // BROM = bank - // [242] BROM = main::bank_set_brom10_bank#0 -- vbuz1=vbuc1 - lda #bank_set_brom10_bank + // [165] BROM = main::bank_set_brom5_bank#0 -- vbuz1=vbuc1 + lda #bank_set_brom5_bank sta.z BROM - // main::CLI6 + // main::CLI3 // asm // asm { cli } cli // main::vera_display_set_border_color1 // *VERA_CTRL &= ~VERA_DCSEL - // [244] *VERA_CTRL = *VERA_CTRL & ~VERA_DCSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 + // [167] *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 - // [245] *VERA_DC_BORDER = RED -- _deref_pbuc1=vbuc2 + // [168] *VERA_DC_BORDER = RED -- _deref_pbuc1=vbuc2 lda #RED sta VERA_DC_BORDER - // [246] phi from main::vera_display_set_border_color1 to main::@89 [phi:main::vera_display_set_border_color1->main::@89] - // main::@89 + // [169] phi from main::vera_display_set_border_color1 to main::@41 [phi:main::vera_display_set_border_color1->main::@41] + // main::@41 // textcolor(WHITE) - // [247] call textcolor - // [784] phi from main::@89 to textcolor [phi:main::@89->textcolor] - // [784] phi textcolor::color#23 = WHITE [phi:main::@89->textcolor#0] -- vbum1=vbuc1 + // [170] call textcolor + // [439] phi from main::@41 to textcolor [phi:main::@41->textcolor] + // [439] phi textcolor::color#21 = WHITE [phi:main::@41->textcolor#0] -- vbum1=vbuc1 lda #WHITE sta textcolor.color jsr textcolor - // [248] phi from main::@89 to main::@211 [phi:main::@89->main::@211] - // main::@211 + // [171] phi from main::@41 to main::@92 [phi:main::@41->main::@92] + // main::@92 // bgcolor(BLUE) - // [249] call bgcolor - // [789] phi from main::@211 to bgcolor [phi:main::@211->bgcolor] - // [789] phi bgcolor::color#15 = BLUE [phi:main::@211->bgcolor#0] -- vbum1=vbuc1 + // [172] call bgcolor + // [444] phi from main::@92 to bgcolor [phi:main::@92->bgcolor] + // [444] phi bgcolor::color#15 = BLUE [phi:main::@92->bgcolor#0] -- vbum1=vbuc1 lda #BLUE sta bgcolor.color jsr bgcolor - // [250] phi from main::@211 to main::@212 [phi:main::@211->main::@212] - // main::@212 + // [173] phi from main::@92 to main::@93 [phi:main::@92->main::@93] + // main::@93 // clrscr() - // [251] call clrscr + // [174] call clrscr jsr clrscr - // [252] phi from main::@212 to main::@213 [phi:main::@212->main::@213] - // main::@213 + // [175] phi from main::@93 to main::@94 [phi:main::@93->main::@94] + // main::@94 // printf("There was a severe error updating your VERA!") - // [253] call printf_str - // [1210] phi from main::@213 to printf_str [phi:main::@213->printf_str] - // [1210] phi printf_str::putc#84 = &cputc [phi:main::@213->printf_str#0] -- pprz1=pprc1 + // [176] call printf_str + // [785] phi from main::@94 to printf_str [phi:main::@94->printf_str] + // [785] phi printf_str::putc#53 = &cputc [phi:main::@94->printf_str#0] -- pprz1=pprc1 lda #cputc sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = main::s15 [phi:main::@213->printf_str#1] -- pbuz1=pbuc1 - lda #printf_str#1] -- pbuz1=pbuc1 + lda #s15 + lda #>s2 sta.z printf_str.s+1 jsr printf_str - // [254] phi from main::@213 to main::@214 [phi:main::@213->main::@214] - // main::@214 + // [177] phi from main::@94 to main::@95 [phi:main::@94->main::@95] + // main::@95 // printf("You are back at the READY prompt without resetting your CX16.\n\n") - // [255] call printf_str - // [1210] phi from main::@214 to printf_str [phi:main::@214->printf_str] - // [1210] phi printf_str::putc#84 = &cputc [phi:main::@214->printf_str#0] -- pprz1=pprc1 + // [178] call printf_str + // [785] phi from main::@95 to printf_str [phi:main::@95->printf_str] + // [785] phi printf_str::putc#53 = &cputc [phi:main::@95->printf_str#0] -- pprz1=pprc1 lda #cputc sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = main::s16 [phi:main::@214->printf_str#1] -- pbuz1=pbuc1 - lda #printf_str#1] -- pbuz1=pbuc1 + lda #s16 + lda #>s3 sta.z printf_str.s+1 jsr printf_str - // [256] phi from main::@214 to main::@215 [phi:main::@214->main::@215] - // main::@215 + // [179] phi from main::@95 to main::@96 [phi:main::@95->main::@96] + // main::@96 // printf("Please don't reset or shut down your VERA until you've\n") - // [257] call printf_str - // [1210] phi from main::@215 to printf_str [phi:main::@215->printf_str] - // [1210] phi printf_str::putc#84 = &cputc [phi:main::@215->printf_str#0] -- pprz1=pprc1 + // [180] call printf_str + // [785] phi from main::@96 to printf_str [phi:main::@96->printf_str] + // [785] phi printf_str::putc#53 = &cputc [phi:main::@96->printf_str#0] -- pprz1=pprc1 lda #cputc sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = main::s17 [phi:main::@215->printf_str#1] -- pbuz1=pbuc1 - lda #printf_str#1] -- pbuz1=pbuc1 + lda #s17 + lda #>s4 sta.z printf_str.s+1 jsr printf_str - // [258] phi from main::@215 to main::@216 [phi:main::@215->main::@216] - // main::@216 + // [181] phi from main::@96 to main::@97 [phi:main::@96->main::@97] + // main::@97 // printf("managed to either reflash your VERA with the previous firmware ") - // [259] call printf_str - // [1210] phi from main::@216 to printf_str [phi:main::@216->printf_str] - // [1210] phi printf_str::putc#84 = &cputc [phi:main::@216->printf_str#0] -- pprz1=pprc1 + // [182] call printf_str + // [785] phi from main::@97 to printf_str [phi:main::@97->printf_str] + // [785] phi printf_str::putc#53 = &cputc [phi:main::@97->printf_str#0] -- pprz1=pprc1 lda #cputc sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = main::s18 [phi:main::@216->printf_str#1] -- pbuz1=pbuc1 - lda #printf_str#1] -- pbuz1=pbuc1 + lda #s18 + lda #>s5 sta.z printf_str.s+1 jsr printf_str - // [260] phi from main::@216 to main::@217 [phi:main::@216->main::@217] - // main::@217 + // [183] phi from main::@97 to main::@98 [phi:main::@97->main::@98] + // main::@98 // printf("or have update successs retrying!\n\n") - // [261] call printf_str - // [1210] phi from main::@217 to printf_str [phi:main::@217->printf_str] - // [1210] phi printf_str::putc#84 = &cputc [phi:main::@217->printf_str#0] -- pprz1=pprc1 + // [184] call printf_str + // [785] phi from main::@98 to printf_str [phi:main::@98->printf_str] + // [785] phi printf_str::putc#53 = &cputc [phi:main::@98->printf_str#0] -- pprz1=pprc1 lda #cputc sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = main::s19 [phi:main::@217->printf_str#1] -- pbuz1=pbuc1 - lda #printf_str#1] -- pbuz1=pbuc1 + lda #s19 + lda #>s6 sta.z printf_str.s+1 jsr printf_str - // [262] phi from main::@217 to main::@218 [phi:main::@217->main::@218] - // main::@218 + // [185] phi from main::@98 to main::@99 [phi:main::@98->main::@99] + // main::@99 // printf("PLEASE REMOVE THE JP1 JUMPER OR YOUR SDCARD WON'T WORK!\n") - // [263] call printf_str - // [1210] phi from main::@218 to printf_str [phi:main::@218->printf_str] - // [1210] phi printf_str::putc#84 = &cputc [phi:main::@218->printf_str#0] -- pprz1=pprc1 + // [186] call printf_str + // [785] phi from main::@99 to printf_str [phi:main::@99->printf_str] + // [785] phi printf_str::putc#53 = &cputc [phi:main::@99->printf_str#0] -- pprz1=pprc1 lda #cputc sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = main::s20 [phi:main::@218->printf_str#1] -- pbuz1=pbuc1 - lda #printf_str#1] -- pbuz1=pbuc1 + lda #s20 + lda #>s7 sta.z printf_str.s+1 jsr printf_str - // [264] phi from main::@218 to main::@219 [phi:main::@218->main::@219] - // main::@219 + // [187] phi from main::@99 to main::@100 [phi:main::@99->main::@100] + // main::@100 // wait_moment(32) - // [265] call wait_moment - // [1310] phi from main::@219 to wait_moment [phi:main::@219->wait_moment] - // [1310] phi wait_moment::w#13 = $20 [phi:main::@219->wait_moment#0] -- vbum1=vbuc1 + // [188] call wait_moment + // [794] phi from main::@100 to wait_moment [phi:main::@100->wait_moment] + // [794] phi wait_moment::w#10 = $20 [phi:main::@100->wait_moment#0] -- vbum1=vbuc1 lda #$20 sta wait_moment.w jsr wait_moment - // [266] phi from main::@219 to main::@220 [phi:main::@219->main::@220] - // main::@220 + // [189] phi from main::@100 to main::@101 [phi:main::@100->main::@101] + // main::@101 // system_reset() - // [267] call system_reset - // [1318] phi from main::@220 to system_reset [phi:main::@220->system_reset] + // [190] call system_reset + // [802] phi from main::@101 to system_reset [phi:main::@101->system_reset] jsr system_reset // main::@return // } - // [268] return + // [191] return rts - // main::check_status_smc13 - check_status_smc13: + // main::check_status_smc9 + check_status_smc9: // status_smc == status - // [269] main::check_status_smc13_$0 = status_smc#0 == STATUS_SKIP -- vbom1=vbum2_eq_vbuc1 + // [192] main::check_status_smc9_$0 = status_smc#0 == STATUS_SKIP -- vboz1=vbum2_eq_vbuc1 lda status_smc eor #STATUS_SKIP beq !+ lda #1 !: eor #1 - sta check_status_smc13_main__0 + sta.z check_status_smc9_main__0 // return (unsigned char)(status_smc == status); - // [270] main::check_status_smc13_return#0 = (char)main::check_status_smc13_$0 -- vbum1=vbum2 - sta check_status_smc13_return - // main::check_status_smc14 + // [193] main::check_status_smc9_return#0 = (char)main::check_status_smc9_$0 -- vbum1=vbuz2 + sta check_status_smc9_return + // main::check_status_smc10 // status_smc == status - // [271] main::check_status_smc14_$0 = status_smc#0 == STATUS_NONE -- vbom1=vbum2_eq_vbuc1 + // [194] main::check_status_smc10_$0 = status_smc#0 == STATUS_NONE -- vboz1=vbum2_eq_vbuc1 lda status_smc eor #STATUS_NONE beq !+ lda #1 !: eor #1 - sta check_status_smc14_main__0 + sta.z check_status_smc10_main__0 // return (unsigned char)(status_smc == status); - // [272] main::check_status_smc14_return#0 = (char)main::check_status_smc14_$0 -- vbum1=vbum2 - sta check_status_smc14_return + // [195] main::check_status_smc10_return#0 = (char)main::check_status_smc10_$0 -- vbum1=vbuz2 + sta check_status_smc10_return // main::check_status_vera6 // status_vera == status - // [273] main::check_status_vera6_$0 = status_vera#127 == STATUS_SKIP -- vbom1=vbum2_eq_vbuc1 + // [196] main::check_status_vera6_$0 = status_vera#127 == STATUS_SKIP -- vboz1=vbum2_eq_vbuc1 lda status_vera eor #STATUS_SKIP beq !+ lda #1 !: eor #1 - sta check_status_vera6_main__0 + sta.z check_status_vera6_main__0 // return (unsigned char)(status_vera == status); - // [274] main::check_status_vera6_return#0 = (char)main::check_status_vera6_$0 -- vbum1=vbum2 + // [197] main::check_status_vera6_return#0 = (char)main::check_status_vera6_$0 -- vbum1=vbuz2 sta check_status_vera6_return // main::check_status_vera7 // status_vera == status - // [275] main::check_status_vera7_$0 = status_vera#127 == STATUS_NONE -- vbom1=vbum2_eq_vbuc1 + // [198] main::check_status_vera7_$0 = status_vera#127 == STATUS_NONE -- vboz1=vbum2_eq_vbuc1 lda status_vera eor #STATUS_NONE beq !+ lda #1 !: eor #1 - sta check_status_vera7_main__0 + sta.z check_status_vera7_main__0 // return (unsigned char)(status_vera == status); - // [276] main::check_status_vera7_return#0 = (char)main::check_status_vera7_$0 -- vbum1=vbum2 + // [199] main::check_status_vera7_return#0 = (char)main::check_status_vera7_$0 -- vbum1=vbuz2 sta check_status_vera7_return - // [277] phi from main::check_status_vera7 to main::@88 [phi:main::check_status_vera7->main::@88] - // main::@88 + // [200] phi from main::check_status_vera7 to main::@40 [phi:main::check_status_vera7->main::@40] + // main::@40 // check_status_roms_less(STATUS_SKIP) - // [278] call check_status_roms_less - // [1323] phi from main::@88 to check_status_roms_less [phi:main::@88->check_status_roms_less] + // [201] call check_status_roms_less + // [807] phi from main::@40 to check_status_roms_less [phi:main::@40->check_status_roms_less] jsr check_status_roms_less // check_status_roms_less(STATUS_SKIP) - // [279] check_status_roms_less::return#3 = check_status_roms_less::return#2 - // main::@210 - // [280] main::$84 = check_status_roms_less::return#3 -- vbum1=vbum2 + // [202] check_status_roms_less::return#3 = check_status_roms_less::return#2 + // main::@91 + // [203] main::$69 = check_status_roms_less::return#3 -- vbuz1=vbum2 lda check_status_roms_less.return - sta main__84 + sta.z main__69 // 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)) ) - // [281] if(0!=main::check_status_smc13_return#0) goto main::@264 -- 0_neq_vbum1_then_la1 - lda check_status_smc13_return - beq !__b264+ - jmp __b264 - !__b264: - // main::@265 - // [282] if(0!=main::check_status_smc14_return#0) goto main::@264 -- 0_neq_vbum1_then_la1 - lda check_status_smc14_return - beq !__b264+ - jmp __b264 - !__b264: - // main::check_status_smc15 - check_status_smc15: + // [204] if(0!=main::check_status_smc9_return#0) goto main::@139 -- 0_neq_vbum1_then_la1 + lda check_status_smc9_return + beq !__b139+ + jmp __b139 + !__b139: + // main::@140 + // [205] if(0!=main::check_status_smc10_return#0) goto main::@139 -- 0_neq_vbum1_then_la1 + lda check_status_smc10_return + beq !__b139+ + jmp __b139 + !__b139: + // main::check_status_smc11 + check_status_smc11: // status_smc == status - // [283] main::check_status_smc15_$0 = status_smc#0 == STATUS_ERROR -- vbom1=vbum2_eq_vbuc1 + // [206] main::check_status_smc11_$0 = status_smc#0 == STATUS_ERROR -- vboz1=vbum2_eq_vbuc1 lda status_smc eor #STATUS_ERROR beq !+ lda #1 !: eor #1 - sta check_status_smc15_main__0 + sta.z check_status_smc11_main__0 // return (unsigned char)(status_smc == status); - // [284] main::check_status_smc15_return#0 = (char)main::check_status_smc15_$0 -- vbum1=vbum2 - sta check_status_smc15_return + // [207] main::check_status_smc11_return#0 = (char)main::check_status_smc11_$0 -- vbum1=vbuz2 + sta check_status_smc11_return // main::check_status_vera8 // status_vera == status - // [285] main::check_status_vera8_$0 = status_vera#127 == STATUS_ERROR -- vbom1=vbum2_eq_vbuc1 + // [208] main::check_status_vera8_$0 = status_vera#127 == STATUS_ERROR -- vboz1=vbum2_eq_vbuc1 lda status_vera eor #STATUS_ERROR beq !+ lda #1 !: eor #1 - sta check_status_vera8_main__0 + sta.z check_status_vera8_main__0 // return (unsigned char)(status_vera == status); - // [286] main::check_status_vera8_return#0 = (char)main::check_status_vera8_$0 -- vbum1=vbum2 + // [209] main::check_status_vera8_return#0 = (char)main::check_status_vera8_$0 -- vbum1=vbuz2 sta check_status_vera8_return - // [287] phi from main::check_status_vera8 to main::@91 [phi:main::check_status_vera8->main::@91] - // main::@91 + // [210] phi from main::check_status_vera8 to main::@43 [phi:main::check_status_vera8->main::@43] + // main::@43 // check_status_roms(STATUS_ERROR) - // [288] call check_status_roms - // [1278] phi from main::@91 to check_status_roms [phi:main::@91->check_status_roms] - // [1278] phi check_status_roms::status#6 = STATUS_ERROR [phi:main::@91->check_status_roms#0] -- vbum1=vbuc1 + // [211] call check_status_roms + // [753] phi from main::@43 to check_status_roms [phi:main::@43->check_status_roms] + // [753] phi check_status_roms::status#6 = STATUS_ERROR [phi:main::@43->check_status_roms#0] -- vbum1=vbuc1 lda #STATUS_ERROR sta check_status_roms.status jsr check_status_roms // check_status_roms(STATUS_ERROR) - // [289] check_status_roms::return#10 = check_status_roms::return#2 - // main::@221 - // [290] main::$274 = check_status_roms::return#10 -- vbum1=vbum2 + // [212] check_status_roms::return#10 = check_status_roms::return#2 + // main::@102 + // [213] main::$153 = check_status_roms::return#10 -- vbuz1=vbum2 lda check_status_roms.return - sta main__274 + sta.z main__153 // if(check_status_smc(STATUS_ERROR) || check_status_vera(STATUS_ERROR) || check_status_roms(STATUS_ERROR)) - // [291] if(0!=main::check_status_smc15_return#0) goto main::vera_display_set_border_color3 -- 0_neq_vbum1_then_la1 - lda check_status_smc15_return + // [214] if(0!=main::check_status_smc11_return#0) goto main::vera_display_set_border_color3 -- 0_neq_vbum1_then_la1 + lda check_status_smc11_return beq !vera_display_set_border_color3+ jmp vera_display_set_border_color3 !vera_display_set_border_color3: - // main::@267 - // [292] if(0!=main::check_status_vera8_return#0) goto main::vera_display_set_border_color3 -- 0_neq_vbum1_then_la1 + // main::@142 + // [215] if(0!=main::check_status_vera8_return#0) goto main::vera_display_set_border_color3 -- 0_neq_vbum1_then_la1 lda check_status_vera8_return beq !vera_display_set_border_color3+ jmp vera_display_set_border_color3 !vera_display_set_border_color3: - // main::@266 - // [293] if(0!=main::$274) goto main::vera_display_set_border_color3 -- 0_neq_vbum1_then_la1 - lda main__274 + // main::@141 + // [216] if(0!=main::$153) goto main::vera_display_set_border_color3 -- 0_neq_vbuz1_then_la1 + lda.z main__153 beq !vera_display_set_border_color3+ jmp vera_display_set_border_color3 !vera_display_set_border_color3: - // main::check_status_smc16 + // main::check_status_smc12 // status_smc == status - // [294] main::check_status_smc16_$0 = status_smc#0 == STATUS_ISSUE -- vbom1=vbum2_eq_vbuc1 + // [217] main::check_status_smc12_$0 = status_smc#0 == STATUS_ISSUE -- vboz1=vbum2_eq_vbuc1 lda status_smc eor #STATUS_ISSUE beq !+ lda #1 !: eor #1 - sta check_status_smc16_main__0 + sta.z check_status_smc12_main__0 // return (unsigned char)(status_smc == status); - // [295] main::check_status_smc16_return#0 = (char)main::check_status_smc16_$0 -- vbum1=vbum2 - sta check_status_smc16_return + // [218] main::check_status_smc12_return#0 = (char)main::check_status_smc12_$0 -- vbum1=vbuz2 + sta check_status_smc12_return // main::check_status_vera9 // status_vera == status - // [296] main::check_status_vera9_$0 = status_vera#127 == STATUS_ISSUE -- vbom1=vbum2_eq_vbuc1 + // [219] main::check_status_vera9_$0 = status_vera#127 == STATUS_ISSUE -- vboz1=vbum2_eq_vbuc1 lda status_vera eor #STATUS_ISSUE beq !+ lda #1 !: eor #1 - sta check_status_vera9_main__0 + sta.z check_status_vera9_main__0 // return (unsigned char)(status_vera == status); - // [297] main::check_status_vera9_return#0 = (char)main::check_status_vera9_$0 -- vbum1=vbum2 + // [220] main::check_status_vera9_return#0 = (char)main::check_status_vera9_$0 -- vbum1=vbuz2 sta check_status_vera9_return - // [298] phi from main::check_status_vera9 to main::@93 [phi:main::check_status_vera9->main::@93] - // main::@93 + // [221] phi from main::check_status_vera9 to main::@45 [phi:main::check_status_vera9->main::@45] + // main::@45 // check_status_roms(STATUS_ISSUE) - // [299] call check_status_roms - // [1278] phi from main::@93 to check_status_roms [phi:main::@93->check_status_roms] - // [1278] phi check_status_roms::status#6 = STATUS_ISSUE [phi:main::@93->check_status_roms#0] -- vbum1=vbuc1 + // [222] call check_status_roms + // [753] phi from main::@45 to check_status_roms [phi:main::@45->check_status_roms] + // [753] phi check_status_roms::status#6 = STATUS_ISSUE [phi:main::@45->check_status_roms#0] -- vbum1=vbuc1 lda #STATUS_ISSUE sta check_status_roms.status jsr check_status_roms // check_status_roms(STATUS_ISSUE) - // [300] check_status_roms::return#11 = check_status_roms::return#2 - // main::@223 - // [301] main::$279 = check_status_roms::return#11 -- vbum1=vbum2 + // [223] check_status_roms::return#11 = check_status_roms::return#2 + // main::@104 + // [224] main::$158 = check_status_roms::return#11 -- vbuz1=vbum2 lda check_status_roms.return - sta main__279 + sta.z main__158 // if(check_status_smc(STATUS_ISSUE) || check_status_vera(STATUS_ISSUE) || check_status_roms(STATUS_ISSUE)) - // [302] if(0!=main::check_status_smc16_return#0) goto main::vera_display_set_border_color4 -- 0_neq_vbum1_then_la1 - lda check_status_smc16_return + // [225] if(0!=main::check_status_smc12_return#0) goto main::vera_display_set_border_color4 -- 0_neq_vbum1_then_la1 + lda check_status_smc12_return beq !vera_display_set_border_color4+ jmp vera_display_set_border_color4 !vera_display_set_border_color4: - // main::@269 - // [303] if(0!=main::check_status_vera9_return#0) goto main::vera_display_set_border_color4 -- 0_neq_vbum1_then_la1 + // main::@144 + // [226] if(0!=main::check_status_vera9_return#0) goto main::vera_display_set_border_color4 -- 0_neq_vbum1_then_la1 lda check_status_vera9_return beq !vera_display_set_border_color4+ jmp vera_display_set_border_color4 !vera_display_set_border_color4: - // main::@268 - // [304] if(0!=main::$279) goto main::vera_display_set_border_color4 -- 0_neq_vbum1_then_la1 - lda main__279 + // main::@143 + // [227] if(0!=main::$158) goto main::vera_display_set_border_color4 -- 0_neq_vbuz1_then_la1 + lda.z main__158 beq !vera_display_set_border_color4+ jmp vera_display_set_border_color4 !vera_display_set_border_color4: // main::vera_display_set_border_color5 // *VERA_CTRL &= ~VERA_DCSEL - // [305] *VERA_CTRL = *VERA_CTRL & ~VERA_DCSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 + // [228] *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 - // [306] *VERA_DC_BORDER = GREEN -- _deref_pbuc1=vbuc2 + // [229] *VERA_DC_BORDER = GREEN -- _deref_pbuc1=vbuc2 lda #GREEN sta VERA_DC_BORDER - // [307] phi from main::vera_display_set_border_color5 to main::@95 [phi:main::vera_display_set_border_color5->main::@95] - // main::@95 + // [230] phi from main::vera_display_set_border_color5 to main::@47 [phi:main::vera_display_set_border_color5->main::@47] + // main::@47 // display_action_progress("Your CX16 update is a success!") - // [308] call display_action_progress - // [904] phi from main::@95 to display_action_progress [phi:main::@95->display_action_progress] - // [904] phi display_action_progress::info_text#27 = main::info_text37 [phi:main::@95->display_action_progress#0] -- pbuz1=pbuc1 - lda #display_action_progress] + // [559] phi display_action_progress::info_text#19 = main::info_text22 [phi:main::@47->display_action_progress#0] -- pbuz1=pbuc1 + lda #info_text37 + lda #>info_text22 sta.z display_action_progress.info_text+1 jsr display_action_progress - // main::check_status_smc17 + // main::check_status_smc13 // status_smc == status - // [309] main::check_status_smc17_$0 = status_smc#0 == STATUS_FLASHED -- vbom1=vbum2_eq_vbuc1 + // [232] main::check_status_smc13_$0 = status_smc#0 == STATUS_FLASHED -- vboz1=vbum2_eq_vbuc1 lda status_smc eor #STATUS_FLASHED beq !+ lda #1 !: eor #1 - sta check_status_smc17_main__0 + sta.z check_status_smc13_main__0 // return (unsigned char)(status_smc == status); - // [310] main::check_status_smc17_return#0 = (char)main::check_status_smc17_$0 -- vbum1=vbum2 - sta check_status_smc17_return - // main::@96 + // [233] main::check_status_smc13_return#0 = (char)main::check_status_smc13_$0 -- vbum1=vbuz2 + sta check_status_smc13_return + // main::@48 // if(check_status_smc(STATUS_FLASHED)) - // [311] if(0!=main::check_status_smc17_return#0) goto main::@56 -- 0_neq_vbum1_then_la1 - beq !__b56+ - jmp __b56 - !__b56: - // [312] phi from main::@96 to main::@11 [phi:main::@96->main::@11] - // main::@11 + // [234] if(0!=main::check_status_smc13_return#0) goto main::@18 -- 0_neq_vbum1_then_la1 + beq !__b18+ + jmp __b18 + !__b18: + // [235] phi from main::@48 to main::@9 [phi:main::@48->main::@9] + // main::@9 // display_progress_text(display_debriefing_text_rom, display_debriefing_count_rom) - // [313] call display_progress_text - // [1331] phi from main::@11 to display_progress_text [phi:main::@11->display_progress_text] - // [1331] phi display_progress_text::text#13 = display_debriefing_text_rom [phi:main::@11->display_progress_text#0] -- qbuz1=qbuc1 + // [236] call display_progress_text + // [815] phi from main::@9 to display_progress_text [phi:main::@9->display_progress_text] + // [815] phi display_progress_text::text#11 = display_debriefing_text_rom [phi:main::@9->display_progress_text#0] -- qbuz1=qbuc1 lda #display_debriefing_text_rom sta.z display_progress_text.text+1 - // [1331] phi display_progress_text::lines#12 = display_debriefing_count_rom [phi:main::@11->display_progress_text#1] -- vbum1=vbuc1 + // [815] phi display_progress_text::lines#10 = display_debriefing_count_rom [phi:main::@9->display_progress_text#1] -- vbum1=vbuc1 lda #display_debriefing_count_rom sta display_progress_text.lines jsr display_progress_text - // [314] phi from main::@11 main::@90 main::@94 to main::@4 [phi:main::@11/main::@90/main::@94->main::@4] - // main::@4 - __b4: + // [237] phi from main::@42 main::@46 main::@9 to main::@2 [phi:main::@42/main::@46/main::@9->main::@2] + // main::@2 + __b2: // textcolor(PINK) - // [315] call textcolor + // [238] call textcolor // DE6 | Wait until reset - // [784] phi from main::@4 to textcolor [phi:main::@4->textcolor] - // [784] phi textcolor::color#23 = PINK [phi:main::@4->textcolor#0] -- vbum1=vbuc1 + // [439] phi from main::@2 to textcolor [phi:main::@2->textcolor] + // [439] phi textcolor::color#21 = PINK [phi:main::@2->textcolor#0] -- vbum1=vbuc1 lda #PINK sta textcolor.color jsr textcolor - // [316] phi from main::@4 to main::@236 [phi:main::@4->main::@236] - // main::@236 + // [239] phi from main::@2 to main::@117 [phi:main::@2->main::@117] + // main::@117 // display_progress_line(2, "DON'T DO ANYTHING UNTIL COUNTDOWN FINISHES!") - // [317] call display_progress_line - // [1341] phi from main::@236 to display_progress_line [phi:main::@236->display_progress_line] - // [1341] phi display_progress_line::text#3 = main::text [phi:main::@236->display_progress_line#0] -- pbuz1=pbuc1 + // [240] call display_progress_line + // [825] phi from main::@117 to display_progress_line [phi:main::@117->display_progress_line] + // [825] phi display_progress_line::text#3 = main::text [phi:main::@117->display_progress_line#0] -- pbuz1=pbuc1 lda #text sta.z display_progress_line.text+1 - // [1341] phi display_progress_line::line#3 = 2 [phi:main::@236->display_progress_line#1] -- vbum1=vbuc1 + // [825] phi display_progress_line::line#3 = 2 [phi:main::@117->display_progress_line#1] -- vbum1=vbuc1 lda #2 sta display_progress_line.line jsr display_progress_line - // [318] phi from main::@236 to main::@237 [phi:main::@236->main::@237] - // main::@237 + // [241] phi from main::@117 to main::@118 [phi:main::@117->main::@118] + // main::@118 // textcolor(WHITE) - // [319] call textcolor - // [784] phi from main::@237 to textcolor [phi:main::@237->textcolor] - // [784] phi textcolor::color#23 = WHITE [phi:main::@237->textcolor#0] -- vbum1=vbuc1 + // [242] call textcolor + // [439] phi from main::@118 to textcolor [phi:main::@118->textcolor] + // [439] phi textcolor::color#21 = WHITE [phi:main::@118->textcolor#0] -- vbum1=vbuc1 lda #WHITE sta textcolor.color jsr textcolor - // [320] phi from main::@237 to main::@64 [phi:main::@237->main::@64] - // [320] phi main::w1#2 = $78 [phi:main::@237->main::@64#0] -- vbuz1=vbuc1 + // [243] phi from main::@118 to main::@24 [phi:main::@118->main::@24] + // [243] phi main::w1#2 = $78 [phi:main::@118->main::@24#0] -- vbuz1=vbuc1 lda #$78 sta.z w1 - // main::@64 - __b64: + // main::@24 + __b24: // for (unsigned char w=120; w>0; w--) - // [321] if(main::w1#2>0) goto main::@65 -- vbuz1_gt_0_then_la1 + // [244] if(main::w1#2>0) goto main::@25 -- vbuz1_gt_0_then_la1 lda.z w1 - bne __b65 - // [322] phi from main::@64 to main::@66 [phi:main::@64->main::@66] - // main::@66 + bne __b25 + // [245] phi from main::@24 to main::@26 [phi:main::@24->main::@26] + // main::@26 // system_reset() - // [323] call system_reset - // [1318] phi from main::@66 to system_reset [phi:main::@66->system_reset] + // [246] call system_reset + // [802] phi from main::@26 to system_reset [phi:main::@26->system_reset] jsr system_reset rts - // [324] phi from main::@64 to main::@65 [phi:main::@64->main::@65] - // main::@65 - __b65: + // [247] phi from main::@24 to main::@25 [phi:main::@24->main::@25] + // main::@25 + __b25: // wait_moment(1) - // [325] call wait_moment - // [1310] phi from main::@65 to wait_moment [phi:main::@65->wait_moment] - // [1310] phi wait_moment::w#13 = 1 [phi:main::@65->wait_moment#0] -- vbum1=vbuc1 + // [248] call wait_moment + // [794] phi from main::@25 to wait_moment [phi:main::@25->wait_moment] + // [794] phi wait_moment::w#10 = 1 [phi:main::@25->wait_moment#0] -- vbum1=vbuc1 lda #1 sta wait_moment.w jsr wait_moment - // [326] phi from main::@65 to main::@238 [phi:main::@65->main::@238] - // main::@238 + // [249] phi from main::@25 to main::@119 [phi:main::@25->main::@119] + // main::@119 // sprintf(info_text, "(%u) Your CX16 will reset after countdown ...", w) - // [327] call snprintf_init - // [1205] phi from main::@238 to snprintf_init [phi:main::@238->snprintf_init] - // [1205] phi snprintf_init::s#31 = info_text [phi:main::@238->snprintf_init#0] -- pbuz1=pbuc1 - lda #<@info_text - sta.z snprintf_init.s - lda #>@info_text - sta.z snprintf_init.s+1 + // [250] call snprintf_init jsr snprintf_init - // [328] phi from main::@238 to main::@239 [phi:main::@238->main::@239] - // main::@239 + // [251] phi from main::@119 to main::@120 [phi:main::@119->main::@120] + // main::@120 // sprintf(info_text, "(%u) Your CX16 will reset after countdown ...", w) - // [329] call printf_str - // [1210] phi from main::@239 to printf_str [phi:main::@239->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:main::@239->printf_str#0] -- pprz1=pprc1 + // [252] call printf_str + // [785] phi from main::@120 to printf_str [phi:main::@120->printf_str] + // [785] phi printf_str::putc#53 = &snputc [phi:main::@120->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = main::s24 [phi:main::@239->printf_str#1] -- pbuz1=pbuc1 - lda #printf_str#1] -- pbuz1=pbuc1 + lda #s24 + lda #>s11 sta.z printf_str.s+1 jsr printf_str - // main::@240 + // main::@121 // sprintf(info_text, "(%u) Your CX16 will reset after countdown ...", w) - // [330] printf_uchar::uvalue#17 = main::w1#2 -- vbum1=vbuz2 + // [253] printf_uchar::uvalue#8 = main::w1#2 -- vbum1=vbuz2 lda.z w1 sta printf_uchar.uvalue - // [331] call printf_uchar - // [1346] phi from main::@240 to printf_uchar [phi:main::@240->printf_uchar] - // [1346] phi printf_uchar::format_zero_padding#18 = 0 [phi:main::@240->printf_uchar#0] -- vbum1=vbuc1 + // [254] call printf_uchar + // [834] phi from main::@121 to printf_uchar [phi:main::@121->printf_uchar] + // [834] phi printf_uchar::format_zero_padding#10 = 0 [phi:main::@121->printf_uchar#0] -- vbum1=vbuc1 lda #0 sta printf_uchar.format_zero_padding - // [1346] phi printf_uchar::format_min_length#18 = 0 [phi:main::@240->printf_uchar#1] -- vbum1=vbuc1 + // [834] phi printf_uchar::format_min_length#10 = 0 [phi:main::@121->printf_uchar#1] -- vbum1=vbuc1 sta printf_uchar.format_min_length - // [1346] phi printf_uchar::putc#18 = &snputc [phi:main::@240->printf_uchar#2] -- pprz1=pprc1 + // [834] phi printf_uchar::putc#10 = &snputc [phi:main::@121->printf_uchar#2] -- pprz1=pprc1 lda #snputc sta.z printf_uchar.putc+1 - // [1346] phi printf_uchar::format_radix#18 = DECIMAL [phi:main::@240->printf_uchar#3] -- vbum1=vbuc1 + // [834] phi printf_uchar::format_radix#10 = DECIMAL [phi:main::@121->printf_uchar#3] -- vbum1=vbuc1 lda #DECIMAL sta printf_uchar.format_radix - // [1346] phi printf_uchar::uvalue#18 = printf_uchar::uvalue#17 [phi:main::@240->printf_uchar#4] -- register_copy + // [834] phi printf_uchar::uvalue#10 = printf_uchar::uvalue#8 [phi:main::@121->printf_uchar#4] -- register_copy jsr printf_uchar - // [332] phi from main::@240 to main::@241 [phi:main::@240->main::@241] - // main::@241 + // [255] phi from main::@121 to main::@122 [phi:main::@121->main::@122] + // main::@122 // sprintf(info_text, "(%u) Your CX16 will reset after countdown ...", w) - // [333] call printf_str - // [1210] phi from main::@241 to printf_str [phi:main::@241->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:main::@241->printf_str#0] -- pprz1=pprc1 + // [256] call printf_str + // [785] phi from main::@122 to printf_str [phi:main::@122->printf_str] + // [785] phi printf_str::putc#53 = &snputc [phi:main::@122->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = main::s25 [phi:main::@241->printf_str#1] -- pbuz1=pbuc1 - lda #printf_str#1] -- pbuz1=pbuc1 + lda #s25 + lda #>s12 sta.z printf_str.s+1 jsr printf_str - // main::@242 + // main::@123 // sprintf(info_text, "(%u) Your CX16 will reset after countdown ...", w) - // [334] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 + // [257] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 lda #0 pha - // [335] callexecute snputc -- call_vprc1 + // [258] callexecute snputc -- call_vprc1 jsr snputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla // display_action_text(info_text) - // [337] call display_action_text - // [1357] phi from main::@242 to display_action_text [phi:main::@242->display_action_text] - // [1357] phi display_action_text::info_text#25 = info_text [phi:main::@242->display_action_text#0] -- pbuz1=pbuc1 + // [260] call display_action_text + // [845] phi from main::@123 to display_action_text [phi:main::@123->display_action_text] + // [845] phi display_action_text::info_text#17 = info_text [phi:main::@123->display_action_text#0] -- pbuz1=pbuc1 lda #<@info_text sta.z display_action_text.info_text lda #>@info_text sta.z display_action_text.info_text+1 jsr display_action_text - // main::@243 + // main::@124 // for (unsigned char w=120; w>0; w--) - // [338] main::w1#1 = -- main::w1#2 -- vbuz1=_dec_vbuz1 + // [261] main::w1#1 = -- main::w1#2 -- vbuz1=_dec_vbuz1 dec.z w1 - // [320] phi from main::@243 to main::@64 [phi:main::@243->main::@64] - // [320] phi main::w1#2 = main::w1#1 [phi:main::@243->main::@64#0] -- register_copy - jmp __b64 - // main::@56 - __b56: - // if(smc_bootloader == 1) - // [339] if(smc_bootloader#0!=1) goto main::@57 -- vwum1_neq_vbuc1_then_la1 - lda smc_bootloader+1 - bne __b57 - lda smc_bootloader - cmp #1 - bne __b57 - // [340] phi from main::@56 to main::@62 [phi:main::@56->main::@62] - // main::@62 - // smc_reset() - // [341] call smc_reset - // [1371] phi from main::@62 to smc_reset [phi:main::@62->smc_reset] - jsr smc_reset - // [342] phi from main::@56 main::@62 to main::@57 [phi:main::@56/main::@62->main::@57] - // main::@57 - __b57: + // [243] phi from main::@124 to main::@24 [phi:main::@124->main::@24] + // [243] phi main::w1#2 = main::w1#1 [phi:main::@124->main::@24#0] -- register_copy + jmp __b24 + // [262] phi from main::@48 to main::@18 [phi:main::@48->main::@18] + // main::@18 + __b18: // display_progress_text(display_debriefing_text_smc, display_debriefing_count_smc) - // [343] call display_progress_text - // [1331] phi from main::@57 to display_progress_text [phi:main::@57->display_progress_text] - // [1331] phi display_progress_text::text#13 = display_debriefing_text_smc [phi:main::@57->display_progress_text#0] -- qbuz1=qbuc1 + // [263] call display_progress_text + // [815] phi from main::@18 to display_progress_text [phi:main::@18->display_progress_text] + // [815] phi display_progress_text::text#11 = display_debriefing_text_smc [phi:main::@18->display_progress_text#0] -- qbuz1=qbuc1 lda #display_debriefing_text_smc sta.z display_progress_text.text+1 - // [1331] phi display_progress_text::lines#12 = display_debriefing_count_smc [phi:main::@57->display_progress_text#1] -- vbum1=vbuc1 + // [815] phi display_progress_text::lines#10 = display_debriefing_count_smc [phi:main::@18->display_progress_text#1] -- vbum1=vbuc1 lda #display_debriefing_count_smc sta display_progress_text.lines jsr display_progress_text - // [344] phi from main::@57 to main::@224 [phi:main::@57->main::@224] - // main::@224 + // [264] phi from main::@18 to main::@105 [phi:main::@18->main::@105] + // main::@105 // textcolor(PINK) - // [345] call textcolor - // [784] phi from main::@224 to textcolor [phi:main::@224->textcolor] - // [784] phi textcolor::color#23 = PINK [phi:main::@224->textcolor#0] -- vbum1=vbuc1 + // [265] call textcolor + // [439] phi from main::@105 to textcolor [phi:main::@105->textcolor] + // [439] phi textcolor::color#21 = PINK [phi:main::@105->textcolor#0] -- vbum1=vbuc1 lda #PINK sta textcolor.color jsr textcolor - // [346] phi from main::@224 to main::@225 [phi:main::@224->main::@225] - // main::@225 + // [266] phi from main::@105 to main::@106 [phi:main::@105->main::@106] + // main::@106 // display_progress_line(2, "DON'T DO ANYTHING UNTIL COUNTDOWN FINISHES!") - // [347] call display_progress_line - // [1341] phi from main::@225 to display_progress_line [phi:main::@225->display_progress_line] - // [1341] phi display_progress_line::text#3 = main::text [phi:main::@225->display_progress_line#0] -- pbuz1=pbuc1 + // [267] call display_progress_line + // [825] phi from main::@106 to display_progress_line [phi:main::@106->display_progress_line] + // [825] phi display_progress_line::text#3 = main::text [phi:main::@106->display_progress_line#0] -- pbuz1=pbuc1 lda #text sta.z display_progress_line.text+1 - // [1341] phi display_progress_line::line#3 = 2 [phi:main::@225->display_progress_line#1] -- vbum1=vbuc1 + // [825] phi display_progress_line::line#3 = 2 [phi:main::@106->display_progress_line#1] -- vbum1=vbuc1 lda #2 sta display_progress_line.line jsr display_progress_line - // [348] phi from main::@225 to main::@226 [phi:main::@225->main::@226] - // main::@226 + // [268] phi from main::@106 to main::@107 [phi:main::@106->main::@107] + // main::@107 // textcolor(WHITE) - // [349] call textcolor - // [784] phi from main::@226 to textcolor [phi:main::@226->textcolor] - // [784] phi textcolor::color#23 = WHITE [phi:main::@226->textcolor#0] -- vbum1=vbuc1 + // [269] call textcolor + // [439] phi from main::@107 to textcolor [phi:main::@107->textcolor] + // [439] phi textcolor::color#21 = WHITE [phi:main::@107->textcolor#0] -- vbum1=vbuc1 lda #WHITE sta textcolor.color jsr textcolor - // [350] phi from main::@226 to main::@58 [phi:main::@226->main::@58] - // [350] phi main::w#2 = $78 [phi:main::@226->main::@58#0] -- vbuz1=vbuc1 + // [270] phi from main::@107 to main::@19 [phi:main::@107->main::@19] + // [270] phi main::w#2 = $78 [phi:main::@107->main::@19#0] -- vbuz1=vbuc1 lda #$78 sta.z w - // main::@58 - __b58: + // main::@19 + __b19: // for (unsigned char w=120; w>0; w--) - // [351] if(main::w#2>0) goto main::@59 -- vbuz1_gt_0_then_la1 + // [271] if(main::w#2>0) goto main::@20 -- vbuz1_gt_0_then_la1 lda.z w - bne __b59 - // [352] phi from main::@58 to main::@60 [phi:main::@58->main::@60] - // main::@60 + bne __b20 + // [272] phi from main::@19 to main::@21 [phi:main::@19->main::@21] + // main::@21 // sprintf(info_text, "Please disconnect your CX16 from power source ...") - // [353] call snprintf_init - // [1205] phi from main::@60 to snprintf_init [phi:main::@60->snprintf_init] - // [1205] phi snprintf_init::s#31 = 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 + // [273] call snprintf_init jsr snprintf_init - // [354] phi from main::@60 to main::@233 [phi:main::@60->main::@233] - // main::@233 + // [274] phi from main::@21 to main::@114 [phi:main::@21->main::@114] + // main::@114 // sprintf(info_text, "Please disconnect your CX16 from power source ...") - // [355] call printf_str - // [1210] phi from main::@233 to printf_str [phi:main::@233->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:main::@233->printf_str#0] -- pprz1=pprc1 + // [275] call printf_str + // [785] phi from main::@114 to printf_str [phi:main::@114->printf_str] + // [785] phi printf_str::putc#53 = &snputc [phi:main::@114->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = main::s23 [phi:main::@233->printf_str#1] -- pbuz1=pbuc1 - lda #printf_str#1] -- pbuz1=pbuc1 + lda #s23 + lda #>s10 sta.z printf_str.s+1 jsr printf_str - // main::@234 + // main::@115 // sprintf(info_text, "Please disconnect your CX16 from power source ...") - // [356] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 + // [276] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 lda #0 pha - // [357] callexecute snputc -- call_vprc1 + // [277] callexecute snputc -- call_vprc1 jsr snputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla // display_action_text(info_text) - // [359] call display_action_text - // [1357] phi from main::@234 to display_action_text [phi:main::@234->display_action_text] - // [1357] phi display_action_text::info_text#25 = info_text [phi:main::@234->display_action_text#0] -- pbuz1=pbuc1 + // [279] call display_action_text + // [845] phi from main::@115 to display_action_text [phi:main::@115->display_action_text] + // [845] phi display_action_text::info_text#17 = info_text [phi:main::@115->display_action_text#0] -- pbuz1=pbuc1 lda #<@info_text sta.z display_action_text.info_text lda #>@info_text sta.z display_action_text.info_text+1 jsr display_action_text - // [360] phi from main::@234 to main::@235 [phi:main::@234->main::@235] - // main::@235 + // [280] phi from main::@115 to main::@116 [phi:main::@115->main::@116] + // main::@116 // smc_reset() - // [361] call smc_reset + // [281] 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. - // [1371] phi from main::@235 to smc_reset [phi:main::@235->smc_reset] + // [859] phi from main::@116 to smc_reset [phi:main::@116->smc_reset] jsr smc_reset - // [362] phi from main::@235 main::@61 to main::@61 [phi:main::@235/main::@61->main::@61] - __b10: + // [282] phi from main::@116 main::@22 to main::@22 [phi:main::@116/main::@22->main::@22] + __b5: // This call will reboot the SMC, which will reset the CX16 if bootloader R2. - // main::@61 - jmp __b10 - // [363] phi from main::@58 to main::@59 [phi:main::@58->main::@59] - // main::@59 - __b59: + // main::@22 + jmp __b5 + // [283] phi from main::@19 to main::@20 [phi:main::@19->main::@20] + // main::@20 + __b20: // wait_moment(1) - // [364] call wait_moment - // [1310] phi from main::@59 to wait_moment [phi:main::@59->wait_moment] - // [1310] phi wait_moment::w#13 = 1 [phi:main::@59->wait_moment#0] -- vbum1=vbuc1 + // [284] call wait_moment + // [794] phi from main::@20 to wait_moment [phi:main::@20->wait_moment] + // [794] phi wait_moment::w#10 = 1 [phi:main::@20->wait_moment#0] -- vbum1=vbuc1 lda #1 sta wait_moment.w jsr wait_moment - // [365] phi from main::@59 to main::@227 [phi:main::@59->main::@227] - // main::@227 + // [285] phi from main::@20 to main::@108 [phi:main::@20->main::@108] + // main::@108 // sprintf(info_text, "[%03u] Please read carefully the below ...", w) - // [366] call snprintf_init - // [1205] phi from main::@227 to snprintf_init [phi:main::@227->snprintf_init] - // [1205] phi snprintf_init::s#31 = info_text [phi:main::@227->snprintf_init#0] -- pbuz1=pbuc1 - lda #<@info_text - sta.z snprintf_init.s - lda #>@info_text - sta.z snprintf_init.s+1 + // [286] call snprintf_init jsr snprintf_init - // [367] phi from main::@227 to main::@228 [phi:main::@227->main::@228] - // main::@228 + // [287] phi from main::@108 to main::@109 [phi:main::@108->main::@109] + // main::@109 // sprintf(info_text, "[%03u] Please read carefully the below ...", w) - // [368] call printf_str - // [1210] phi from main::@228 to printf_str [phi:main::@228->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:main::@228->printf_str#0] -- pprz1=pprc1 + // [288] call printf_str + // [785] phi from main::@109 to printf_str [phi:main::@109->printf_str] + // [785] phi printf_str::putc#53 = &snputc [phi:main::@109->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = s21 [phi:main::@228->printf_str#1] -- pbuz1=pbuc1 - lda #printf_str#1] -- pbuz1=pbuc1 + lda #s21 + lda #>s8 sta.z printf_str.s+1 jsr printf_str - // main::@229 + // main::@110 // sprintf(info_text, "[%03u] Please read carefully the below ...", w) - // [369] printf_uchar::uvalue#16 = main::w#2 -- vbum1=vbuz2 + // [289] printf_uchar::uvalue#7 = main::w#2 -- vbum1=vbuz2 lda.z w sta printf_uchar.uvalue - // [370] call printf_uchar - // [1346] phi from main::@229 to printf_uchar [phi:main::@229->printf_uchar] - // [1346] phi printf_uchar::format_zero_padding#18 = 1 [phi:main::@229->printf_uchar#0] -- vbum1=vbuc1 + // [290] call printf_uchar + // [834] phi from main::@110 to printf_uchar [phi:main::@110->printf_uchar] + // [834] phi printf_uchar::format_zero_padding#10 = 1 [phi:main::@110->printf_uchar#0] -- vbum1=vbuc1 lda #1 sta printf_uchar.format_zero_padding - // [1346] phi printf_uchar::format_min_length#18 = 3 [phi:main::@229->printf_uchar#1] -- vbum1=vbuc1 + // [834] phi printf_uchar::format_min_length#10 = 3 [phi:main::@110->printf_uchar#1] -- vbum1=vbuc1 lda #3 sta printf_uchar.format_min_length - // [1346] phi printf_uchar::putc#18 = &snputc [phi:main::@229->printf_uchar#2] -- pprz1=pprc1 + // [834] phi printf_uchar::putc#10 = &snputc [phi:main::@110->printf_uchar#2] -- pprz1=pprc1 lda #snputc sta.z printf_uchar.putc+1 - // [1346] phi printf_uchar::format_radix#18 = DECIMAL [phi:main::@229->printf_uchar#3] -- vbum1=vbuc1 + // [834] phi printf_uchar::format_radix#10 = DECIMAL [phi:main::@110->printf_uchar#3] -- vbum1=vbuc1 lda #DECIMAL sta printf_uchar.format_radix - // [1346] phi printf_uchar::uvalue#18 = printf_uchar::uvalue#16 [phi:main::@229->printf_uchar#4] -- register_copy + // [834] phi printf_uchar::uvalue#10 = printf_uchar::uvalue#7 [phi:main::@110->printf_uchar#4] -- register_copy jsr printf_uchar - // [371] phi from main::@229 to main::@230 [phi:main::@229->main::@230] - // main::@230 + // [291] phi from main::@110 to main::@111 [phi:main::@110->main::@111] + // main::@111 // sprintf(info_text, "[%03u] Please read carefully the below ...", w) - // [372] call printf_str - // [1210] phi from main::@230 to printf_str [phi:main::@230->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:main::@230->printf_str#0] -- pprz1=pprc1 + // [292] call printf_str + // [785] phi from main::@111 to printf_str [phi:main::@111->printf_str] + // [785] phi printf_str::putc#53 = &snputc [phi:main::@111->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = main::s22 [phi:main::@230->printf_str#1] -- pbuz1=pbuc1 - lda #printf_str#1] -- pbuz1=pbuc1 + lda #s22 + lda #>s9 sta.z printf_str.s+1 jsr printf_str - // main::@231 + // main::@112 // sprintf(info_text, "[%03u] Please read carefully the below ...", w) - // [373] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 + // [293] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 lda #0 pha - // [374] callexecute snputc -- call_vprc1 + // [294] callexecute snputc -- call_vprc1 jsr snputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla // display_action_text(info_text) - // [376] call display_action_text - // [1357] phi from main::@231 to display_action_text [phi:main::@231->display_action_text] - // [1357] phi display_action_text::info_text#25 = info_text [phi:main::@231->display_action_text#0] -- pbuz1=pbuc1 + // [296] call display_action_text + // [845] phi from main::@112 to display_action_text [phi:main::@112->display_action_text] + // [845] phi display_action_text::info_text#17 = info_text [phi:main::@112->display_action_text#0] -- pbuz1=pbuc1 lda #<@info_text sta.z display_action_text.info_text lda #>@info_text sta.z display_action_text.info_text+1 jsr display_action_text - // main::@232 + // main::@113 // for (unsigned char w=120; w>0; w--) - // [377] main::w#1 = -- main::w#2 -- vbuz1=_dec_vbuz1 + // [297] main::w#1 = -- main::w#2 -- vbuz1=_dec_vbuz1 dec.z w - // [350] phi from main::@232 to main::@58 [phi:main::@232->main::@58] - // [350] phi main::w#2 = main::w#1 [phi:main::@232->main::@58#0] -- register_copy - jmp __b58 + // [270] phi from main::@113 to main::@19 [phi:main::@113->main::@19] + // [270] phi main::w#2 = main::w#1 [phi:main::@113->main::@19#0] -- register_copy + jmp __b19 // main::vera_display_set_border_color4 vera_display_set_border_color4: // *VERA_CTRL &= ~VERA_DCSEL - // [378] *VERA_CTRL = *VERA_CTRL & ~VERA_DCSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 + // [298] *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 - // [379] *VERA_DC_BORDER = YELLOW -- _deref_pbuc1=vbuc2 + // [299] *VERA_DC_BORDER = YELLOW -- _deref_pbuc1=vbuc2 lda #YELLOW sta VERA_DC_BORDER - // [380] phi from main::vera_display_set_border_color4 to main::@94 [phi:main::vera_display_set_border_color4->main::@94] - // main::@94 + // [300] phi from main::vera_display_set_border_color4 to main::@46 [phi:main::vera_display_set_border_color4->main::@46] + // main::@46 // display_action_progress("Update issues, your CX16 is not updated!") - // [381] call display_action_progress - // [904] phi from main::@94 to display_action_progress [phi:main::@94->display_action_progress] - // [904] phi display_action_progress::info_text#27 = main::info_text36 [phi:main::@94->display_action_progress#0] -- pbuz1=pbuc1 - lda #display_action_progress] + // [559] phi display_action_progress::info_text#19 = main::info_text21 [phi:main::@46->display_action_progress#0] -- pbuz1=pbuc1 + lda #info_text36 + lda #>info_text21 sta.z display_action_progress.info_text+1 jsr display_action_progress - jmp __b4 + jmp __b2 // main::vera_display_set_border_color3 vera_display_set_border_color3: // *VERA_CTRL &= ~VERA_DCSEL - // [382] *VERA_CTRL = *VERA_CTRL & ~VERA_DCSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 + // [302] *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 - // [383] *VERA_DC_BORDER = RED -- _deref_pbuc1=vbuc2 + // [303] *VERA_DC_BORDER = RED -- _deref_pbuc1=vbuc2 lda #RED sta VERA_DC_BORDER - // [384] phi from main::vera_display_set_border_color3 to main::@92 [phi:main::vera_display_set_border_color3->main::@92] - // main::@92 + // [304] phi from main::vera_display_set_border_color3 to main::@44 [phi:main::vera_display_set_border_color3->main::@44] + // main::@44 // display_action_progress("Update Failure! Your CX16 may no longer boot!") - // [385] call display_action_progress - // [904] phi from main::@92 to display_action_progress [phi:main::@92->display_action_progress] - // [904] phi display_action_progress::info_text#27 = main::info_text34 [phi:main::@92->display_action_progress#0] -- pbuz1=pbuc1 - lda #display_action_progress] + // [559] phi display_action_progress::info_text#19 = main::info_text19 [phi:main::@44->display_action_progress#0] -- pbuz1=pbuc1 + lda #info_text34 + lda #>info_text19 sta.z display_action_progress.info_text+1 jsr display_action_progress - // [386] phi from main::@92 to main::@222 [phi:main::@92->main::@222] - // main::@222 + // [306] phi from main::@44 to main::@103 [phi:main::@44->main::@103] + // main::@103 // display_action_text("Take a photo of this screen, shut down power and retry!") - // [387] call display_action_text - // [1357] phi from main::@222 to display_action_text [phi:main::@222->display_action_text] - // [1357] phi display_action_text::info_text#25 = main::info_text35 [phi:main::@222->display_action_text#0] -- pbuz1=pbuc1 - lda #display_action_text] + // [845] phi display_action_text::info_text#17 = main::info_text20 [phi:main::@103->display_action_text#0] -- pbuz1=pbuc1 + lda #info_text35 + lda #>info_text20 sta.z display_action_text.info_text+1 jsr display_action_text - // [388] phi from main::@222 main::@63 to main::@63 [phi:main::@222/main::@63->main::@63] - // main::@63 - __b63: - jmp __b63 - // main::@264 - __b264: + // [308] phi from main::@103 main::@23 to main::@23 [phi:main::@103/main::@23->main::@23] + // main::@23 + __b23: + jmp __b23 + // main::@139 + __b139: // 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)) ) - // [389] if(0!=main::check_status_vera6_return#0) goto main::@263 -- 0_neq_vbum1_then_la1 + // [309] if(0!=main::check_status_vera6_return#0) goto main::@138 -- 0_neq_vbum1_then_la1 lda check_status_vera6_return - bne __b263 - // main::@271 - // [390] if(0==main::check_status_vera7_return#0) goto main::check_status_smc15 -- 0_eq_vbum1_then_la1 + bne __b138 + // main::@145 + // [310] if(0==main::check_status_vera7_return#0) goto main::check_status_smc11 -- 0_eq_vbum1_then_la1 lda check_status_vera7_return - bne !check_status_smc15+ - jmp check_status_smc15 - !check_status_smc15: - // main::@263 - __b263: - // [391] if(0!=main::$84) goto main::vera_display_set_border_color2 -- 0_neq_vbum1_then_la1 - lda main__84 + bne !check_status_smc11+ + jmp check_status_smc11 + !check_status_smc11: + // main::@138 + __b138: + // [311] if(0!=main::$69) goto main::vera_display_set_border_color2 -- 0_neq_vbuz1_then_la1 + lda.z main__69 bne vera_display_set_border_color2 - jmp check_status_smc15 + jmp check_status_smc11 // main::vera_display_set_border_color2 vera_display_set_border_color2: // *VERA_CTRL &= ~VERA_DCSEL - // [392] *VERA_CTRL = *VERA_CTRL & ~VERA_DCSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 + // [312] *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 - // [393] *VERA_DC_BORDER = BLACK -- _deref_pbuc1=vbuc2 + // [313] *VERA_DC_BORDER = BLACK -- _deref_pbuc1=vbuc2 lda #BLACK sta VERA_DC_BORDER - // [394] phi from main::vera_display_set_border_color2 to main::@90 [phi:main::vera_display_set_border_color2->main::@90] - // main::@90 + // [314] phi from main::vera_display_set_border_color2 to main::@42 [phi:main::vera_display_set_border_color2->main::@42] + // main::@42 // display_action_progress("No CX16 component has been updated with new firmware!") - // [395] call display_action_progress - // [904] phi from main::@90 to display_action_progress [phi:main::@90->display_action_progress] - // [904] phi display_action_progress::info_text#27 = main::info_text33 [phi:main::@90->display_action_progress#0] -- pbuz1=pbuc1 - lda #display_action_progress] + // [559] phi display_action_progress::info_text#19 = main::info_text18 [phi:main::@42->display_action_progress#0] -- pbuz1=pbuc1 + lda #info_text33 + lda #>info_text18 sta.z display_action_progress.info_text+1 jsr display_action_progress - jmp __b4 - // main::@255 - __b255: + jmp __b2 + // main::@133 + __b133: // 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)) - // [396] if(0!=main::$62) goto main::check_status_vera3 -- 0_neq_vbum1_then_la1 - lda main__62 + // [316] if(0!=main::$47) goto main::check_status_vera3 -- 0_neq_vbuz1_then_la1 + lda.z main__47 beq !check_status_vera3+ jmp check_status_vera3 !check_status_vera3: - // main::@254 - // [397] if(0==main::check_status_smc8_return#0) goto main::@253 -- 0_eq_vbum1_then_la1 - lda check_status_smc8_return - beq __b253 + // main::@132 + // [317] if(0==main::check_status_smc7_return#0) goto main::@131 -- 0_eq_vbum1_then_la1 + lda check_status_smc7_return + beq __b131 jmp check_status_vera3 - // main::@253 - __b253: - // [398] if(0!=main::check_status_vera2_return#0) goto main::check_status_vera3 -- 0_neq_vbum1_then_la1 + // main::@131 + __b131: + // [318] if(0!=main::check_status_vera2_return#0) goto main::check_status_vera3 -- 0_neq_vbum1_then_la1 lda check_status_vera2_return beq !check_status_vera3+ jmp check_status_vera3 !check_status_vera3: - // main::@252 - // [399] if(0==main::$71) goto main::check_status_vera4 -- 0_eq_vbum1_then_la1 - lda main__71 + // main::@130 + // [319] if(0==main::$56) goto main::check_status_vera4 -- 0_eq_vbuz1_then_la1 + lda.z main__56 beq check_status_vera4 jmp check_status_vera3 // main::check_status_vera4 check_status_vera4: // status_vera == status - // [400] main::check_status_vera4_$0 = status_vera#127 == STATUS_FLASH -- vbom1=vbum2_eq_vbuc1 + // [320] main::check_status_vera4_$0 = status_vera#127 == STATUS_FLASH -- vboz1=vbum2_eq_vbuc1 lda status_vera eor #STATUS_FLASH beq !+ lda #1 !: eor #1 - sta check_status_vera4_main__0 + sta.z check_status_vera4_main__0 // return (unsigned char)(status_vera == status); - // [401] main::check_status_vera4_return#0 = (char)main::check_status_vera4_$0 -- vbum1=vbum2 + // [321] main::check_status_vera4_return#0 = (char)main::check_status_vera4_$0 -- vbum1=vbuz2 sta check_status_vera4_return - // main::check_status_smc9 + // main::check_status_smc8 // status_smc == status - // [402] main::check_status_smc9_$0 = status_smc#0 == STATUS_FLASH -- vbom1=vbum2_eq_vbuc1 + // [322] main::check_status_smc8_$0 = status_smc#0 == STATUS_FLASH -- vboz1=vbum2_eq_vbuc1 lda status_smc eor #STATUS_FLASH beq !+ lda #1 !: eor #1 - sta check_status_smc9_main__0 + sta.z check_status_smc8_main__0 // return (unsigned char)(status_smc == status); - // [403] main::check_status_smc9_return#0 = (char)main::check_status_smc9_$0 -- vbum1=vbum2 - sta check_status_smc9_return - // [404] phi from main::check_status_smc9 to main::check_status_cx16_rom5 [phi:main::check_status_smc9->main::check_status_cx16_rom5] + // [323] main::check_status_smc8_return#0 = (char)main::check_status_smc8_$0 -- vbum1=vbuz2 + sta check_status_smc8_return + // [324] phi from main::check_status_smc8 to main::check_status_cx16_rom5 [phi:main::check_status_smc8->main::check_status_cx16_rom5] // main::check_status_cx16_rom5 // main::check_status_cx16_rom5_check_status_rom1 // status_rom[rom_chip] == status - // [405] main::check_status_cx16_rom5_check_status_rom1_$0 = *status_rom == STATUS_FLASH -- vbom1=_deref_pbuc1_eq_vbuc2 + // [325] main::check_status_cx16_rom5_check_status_rom1_$0 = *status_rom == STATUS_FLASH -- vboz1=_deref_pbuc1_eq_vbuc2 lda status_rom eor #STATUS_FLASH beq !+ lda #1 !: eor #1 - sta check_status_cx16_rom5_check_status_rom1_main__0 + sta.z check_status_cx16_rom5_check_status_rom1_main__0 // return (unsigned char)(status_rom[rom_chip] == status); - // [406] main::check_status_cx16_rom5_check_status_rom1_return#0 = (char)main::check_status_cx16_rom5_check_status_rom1_$0 -- vbum1=vbum2 + // [326] main::check_status_cx16_rom5_check_status_rom1_return#0 = (char)main::check_status_cx16_rom5_check_status_rom1_$0 -- vbum1=vbuz2 sta check_status_cx16_rom5_check_status_rom1_return - // [407] phi from main::check_status_cx16_rom5_check_status_rom1 to main::@81 [phi:main::check_status_cx16_rom5_check_status_rom1->main::@81] - // main::@81 + // [327] phi from main::check_status_cx16_rom5_check_status_rom1 to main::@37 [phi:main::check_status_cx16_rom5_check_status_rom1->main::@37] + // main::@37 // check_status_card_roms(STATUS_FLASH) - // [408] call check_status_card_roms - // [1380] phi from main::@81 to check_status_card_roms [phi:main::@81->check_status_card_roms] + // [328] call check_status_card_roms + // [868] phi from main::@37 to check_status_card_roms [phi:main::@37->check_status_card_roms] jsr check_status_card_roms // check_status_card_roms(STATUS_FLASH) - // [409] check_status_card_roms::return#3 = check_status_card_roms::return#2 - // main::@177 - // [410] main::$186 = check_status_card_roms::return#3 -- vbum1=vbum2 + // [329] check_status_card_roms::return#3 = check_status_card_roms::return#2 + // main::@83 + // [330] main::$111 = check_status_card_roms::return#3 -- vbuz1=vbum2 lda check_status_card_roms.return - sta main__186 + sta.z main__111 // if(check_status_vera(STATUS_FLASH) || check_status_smc(STATUS_FLASH) || check_status_cx16_rom(STATUS_FLASH) || check_status_card_roms(STATUS_FLASH)) - // [411] if(0!=main::check_status_vera4_return#0) goto main::@9 -- 0_neq_vbum1_then_la1 + // [331] if(0!=main::check_status_vera4_return#0) goto main::@7 -- 0_neq_vbum1_then_la1 lda check_status_vera4_return - beq !__b9+ - jmp __b9 - !__b9: - // main::@259 - // [412] if(0!=main::check_status_smc9_return#0) goto main::@9 -- 0_neq_vbum1_then_la1 - lda check_status_smc9_return - beq !__b9+ - jmp __b9 - !__b9: - // main::@258 - // [413] if(0!=main::check_status_cx16_rom5_check_status_rom1_return#0) goto main::@9 -- 0_neq_vbum1_then_la1 + bne __b7 + // main::@137 + // [332] if(0!=main::check_status_smc8_return#0) goto main::@7 -- 0_neq_vbum1_then_la1 + lda check_status_smc8_return + bne __b7 + // main::@136 + // [333] if(0!=main::check_status_cx16_rom5_check_status_rom1_return#0) goto main::@7 -- 0_neq_vbum1_then_la1 lda check_status_cx16_rom5_check_status_rom1_return - beq !__b9+ - jmp __b9 - !__b9: - // main::@257 - // [414] if(0!=main::$186) goto main::@9 -- 0_neq_vbum1_then_la1 - lda main__186 - beq !__b9+ - jmp __b9 - !__b9: + bne __b7 + // main::@135 + // [334] if(0!=main::$111) goto main::@7 -- 0_neq_vbuz1_then_la1 + lda.z main__111 + bne __b7 // main::bank_set_bram1 bank_set_bram1: // BRAM = bank - // [415] BRAM = main::bank_set_bram1_bank#0 -- vbuz1=vbuc1 + // [335] BRAM = main::bank_set_bram1_bank#0 -- vbuz1=vbuc1 lda #bank_set_bram1_bank sta.z BRAM - // main::SEI4 + // main::SEI2 // asm // asm { sei } sei - // main::bank_set_brom7 + // main::bank_set_brom3 // BROM = bank - // [417] BROM = main::bank_set_brom7_bank#0 -- vbuz1=vbuc1 - lda #bank_set_brom7_bank + // [337] BROM = main::bank_set_brom3_bank#0 -- vbuz1=vbuc1 + lda #bank_set_brom3_bank sta.z BROM - // main::CLI5 + // main::CLI2 // asm // asm { cli } cli // main::check_status_vera5 // status_vera == status - // [419] main::check_status_vera5_$0 = status_vera#127 == STATUS_FLASH -- vbom1=vbum2_eq_vbuc1 + // [339] main::check_status_vera5_$0 = status_vera#127 == STATUS_FLASH -- vboz1=vbum2_eq_vbuc1 lda status_vera eor #STATUS_FLASH beq !+ lda #1 !: eor #1 - sta check_status_vera5_main__0 + sta.z check_status_vera5_main__0 // return (unsigned char)(status_vera == status); - // [420] main::check_status_vera5_return#0 = (char)main::check_status_vera5_$0 -- vbum1=vbum2 + // [340] main::check_status_vera5_return#0 = (char)main::check_status_vera5_$0 -- vbum1=vbuz2 sta check_status_vera5_return - // main::@82 + // main::@38 // if(check_status_vera(STATUS_FLASH)) - // [421] if(0==main::check_status_vera5_return#0) goto main::SEI5 -- 0_eq_vbum1_then_la1 - beq SEI5 - // [422] phi from main::@82 to main::@51 [phi:main::@82->main::@51] - // main::@51 + // [341] if(0==main::check_status_vera5_return#0) goto main::SEI3 -- 0_eq_vbum1_then_la1 + beq SEI3 + // [342] phi from main::@38 to main::@17 [phi:main::@38->main::@17] + // main::@17 // display_progress_text(display_jp1_spi_vera_text, display_jp1_spi_vera_count) - // [423] call display_progress_text - // [1331] phi from main::@51 to display_progress_text [phi:main::@51->display_progress_text] - // [1331] phi display_progress_text::text#13 = display_jp1_spi_vera_text [phi:main::@51->display_progress_text#0] -- qbuz1=qbuc1 + // [343] call display_progress_text + // [815] phi from main::@17 to display_progress_text [phi:main::@17->display_progress_text] + // [815] phi display_progress_text::text#11 = display_jp1_spi_vera_text [phi:main::@17->display_progress_text#0] -- qbuz1=qbuc1 lda #display_jp1_spi_vera_text sta.z display_progress_text.text+1 - // [1331] phi display_progress_text::lines#12 = display_jp1_spi_vera_count [phi:main::@51->display_progress_text#1] -- vbum1=vbuc1 + // [815] phi display_progress_text::lines#10 = display_jp1_spi_vera_count [phi:main::@17->display_progress_text#1] -- vbum1=vbuc1 lda #display_jp1_spi_vera_count sta display_progress_text.lines jsr display_progress_text - // [424] phi from main::@51 to main::@183 [phi:main::@51->main::@183] - // main::@183 + // [344] phi from main::@17 to main::@89 [phi:main::@17->main::@89] + // main::@89 // util_wait_space() - // [425] call util_wait_space - // [1389] phi from main::@183 to util_wait_space [phi:main::@183->util_wait_space] + // [345] call util_wait_space + // [877] phi from main::@89 to util_wait_space [phi:main::@89->util_wait_space] jsr util_wait_space - // [426] phi from main::@183 to main::@184 [phi:main::@183->main::@184] - // main::@184 + // [346] phi from main::@89 to main::@90 [phi:main::@89->main::@90] + // main::@90 // main_vera_flash() - // [427] call main_vera_flash - // [1392] phi from main::@184 to main_vera_flash [phi:main::@184->main_vera_flash] + // [347] call main_vera_flash + // [880] phi from main::@90 to main_vera_flash [phi:main::@90->main_vera_flash] jsr main_vera_flash - // [428] phi from main::@184 main::@82 to main::SEI5 [phi:main::@184/main::@82->main::SEI5] - // [428] phi __stdio_filecount#113 = __stdio_filecount#36 [phi:main::@184/main::@82->main::SEI5#0] -- register_copy - // [428] phi __errno#117 = __errno#123 [phi:main::@184/main::@82->main::SEI5#1] -- register_copy - // main::SEI5 - SEI5: + // main::SEI3 + SEI3: // asm // asm { sei } sei - // main::bank_set_brom8 + // main::bank_set_brom4 // BROM = bank - // [430] BROM = main::bank_set_brom8_bank#0 -- vbuz1=vbuc1 - lda #bank_set_brom8_bank + // [349] BROM = main::bank_set_brom4_bank#0 -- vbuz1=vbuc1 + lda #bank_set_brom4_bank sta.z BROM - // [431] phi from main::bank_set_brom8 to main::@83 [phi:main::bank_set_brom8->main::@83] - // main::@83 + // [350] phi from main::bank_set_brom4 to main::@39 [phi:main::bank_set_brom4->main::@39] + // main::@39 // display_progress_clear() - // [432] call display_progress_clear - // [918] phi from main::@83 to display_progress_clear [phi:main::@83->display_progress_clear] + // [351] call display_progress_clear + // [573] phi from main::@39 to display_progress_clear [phi:main::@39->display_progress_clear] jsr display_progress_clear - // main::check_status_smc10 - // status_smc == status - // [433] main::check_status_smc10_$0 = status_smc#0 == STATUS_FLASH -- vbom1=vbum2_eq_vbuc1 - lda status_smc - eor #STATUS_FLASH - beq !+ - lda #1 - !: - eor #1 - sta check_status_smc10_main__0 - // return (unsigned char)(status_smc == status); - // [434] main::check_status_smc10_return#0 = (char)main::check_status_smc10_$0 -- vbum1=vbum2 - sta check_status_smc10_return - // [435] phi from main::check_status_smc10 to main::check_status_cx16_rom6 [phi:main::check_status_smc10->main::check_status_cx16_rom6] - // main::check_status_cx16_rom6 - // main::check_status_cx16_rom6_check_status_rom1 - // status_rom[rom_chip] == status - // [436] main::check_status_cx16_rom6_check_status_rom1_$0 = *status_rom == STATUS_FLASH -- vbom1=_deref_pbuc1_eq_vbuc2 - lda status_rom - eor #STATUS_FLASH - beq !+ - lda #1 - !: - eor #1 - sta check_status_cx16_rom6_check_status_rom1_main__0 - // return (unsigned char)(status_rom[rom_chip] == status); - // [437] main::check_status_cx16_rom6_check_status_rom1_return#0 = (char)main::check_status_cx16_rom6_check_status_rom1_$0 -- vbum1=vbum2 - sta check_status_cx16_rom6_check_status_rom1_return - // main::@84 - // if (check_status_smc(STATUS_FLASH) && check_status_cx16_rom(STATUS_FLASH)) - // [438] if(0==main::check_status_smc10_return#0) goto main::SEI6 -- 0_eq_vbum1_then_la1 - lda check_status_smc10_return - beq SEI6 - // main::@260 - // [439] if(0!=main::check_status_cx16_rom6_check_status_rom1_return#0) goto main::@52 -- 0_neq_vbum1_then_la1 - lda check_status_cx16_rom6_check_status_rom1_return - beq !__b52+ - jmp __b52 - !__b52: - // [440] phi from main::@260 to main::SEI6 [phi:main::@260->main::SEI6] - // [440] phi from main::@187 main::@40 main::@41 main::@55 main::@84 to main::SEI6 [phi:main::@187/main::@40/main::@41/main::@55/main::@84->main::SEI6] - // [440] phi __stdio_filecount#582 = __stdio_filecount#39 [phi:main::@187/main::@40/main::@41/main::@55/main::@84->main::SEI6#0] -- register_copy - // [440] phi __errno#589 = __errno#123 [phi:main::@187/main::@40/main::@41/main::@55/main::@84->main::SEI6#1] -- register_copy - // main::SEI6 - SEI6: + // main::SEI4 // asm // asm { sei } sei - // [442] phi from main::SEI6 to main::@42 [phi:main::SEI6->main::@42] - // [442] phi __stdio_filecount#114 = __stdio_filecount#582 [phi:main::SEI6->main::@42#0] -- register_copy - // [442] phi __errno#118 = __errno#589 [phi:main::SEI6->main::@42#1] -- register_copy - // [442] phi main::rom_chip4#10 = 7 [phi:main::SEI6->main::@42#2] -- vbuz1=vbuc1 - lda #7 - sta.z rom_chip4 - // Flash the ROM chips. - // We loop first all the ROM chips and read the file contents. - // Then we verify the file contents and flash the ROM only for the differences. - // If the file contents are the same as the ROM contents, then no flashing is required. - // IMPORTANT! We start to flash the ROMs on the extension card. - // The last ROM flashed is the CX16 ROM on the CX16 board! - // main::@42 - __b42: - // for(unsigned char rom_chip = 7; rom_chip != 255; rom_chip--) - // [443] if(main::rom_chip4#10!=$ff) goto main::check_status_rom1 -- vbuz1_neq_vbuc1_then_la1 - lda #$ff - cmp.z rom_chip4 - bne check_status_rom1 - // [444] phi from main::@42 to main::@43 [phi:main::@42->main::@43] - // main::@43 - // display_progress_clear() - // [445] call display_progress_clear - // [918] phi from main::@43 to display_progress_clear [phi:main::@43->display_progress_clear] - jsr display_progress_clear jmp check_status_vera3 - // main::check_status_rom1 - check_status_rom1: - // status_rom[rom_chip] == status - // [446] main::check_status_rom1_$0 = status_rom[main::rom_chip4#10] == STATUS_FLASH -- vboz1=pbuc1_derefidx_vbuz2_eq_vbuc2 - lda #STATUS_FLASH - ldy.z rom_chip4 - eor status_rom,y - beq !+ - lda #1 - !: - eor #1 - sta.z check_status_rom1_main__0 - // return (unsigned char)(status_rom[rom_chip] == status); - // [447] main::check_status_rom1_return#0 = (char)main::check_status_rom1_$0 -- vbum1=vbuz2 - sta check_status_rom1_return + // [353] phi from main::@135 main::@136 main::@137 main::@83 to main::@7 [phi:main::@135/main::@136/main::@137/main::@83->main::@7] + // main::@7 + __b7: + // display_action_progress("Chipsets have been detected and update files validated!") + // [354] call display_action_progress + // [559] phi from main::@7 to display_action_progress [phi:main::@7->display_action_progress] + // [559] phi display_action_progress::info_text#19 = main::info_text12 [phi:main::@7->display_action_progress#0] -- pbuz1=pbuc1 + lda #info_text12 + sta.z display_action_progress.info_text+1 + jsr display_action_progress + // [355] phi from main::@7 to main::@84 [phi:main::@7->main::@84] + // main::@84 + // unsigned char ch = util_wait_key("Continue with update of highlighted chipsets? [Y/N]", "nyNY") + // [356] call util_wait_key + // [1034] phi from main::@84 to util_wait_key [phi:main::@84->util_wait_key] + // [1034] phi util_wait_key::filter#13 = main::filter1 [phi:main::@84->util_wait_key#0] -- pbuz1=pbuc1 + lda #filter1 + sta.z util_wait_key.filter+1 + // [1034] phi util_wait_key::info_text#3 = main::info_text13 [phi:main::@84->util_wait_key#1] -- pbuz1=pbuc1 + lda #info_text13 + 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") + // [357] util_wait_key::return#4 = util_wait_key::ch#4 -- vbum1=vwum2 + lda util_wait_key.ch + sta util_wait_key.return_1 // main::@85 - // if(check_status_rom(rom_chip, STATUS_FLASH)) - // [448] if(0==main::check_status_rom1_return#0) goto main::@44 -- 0_eq_vbum1_then_la1 - beq __b44 - // main::check_status_smc11 - // status_smc == status - // [449] main::check_status_smc11_$0 = status_smc#0 == STATUS_FLASHED -- vboz1=vbum2_eq_vbuc1 - lda status_smc - eor #STATUS_FLASHED - beq !+ - lda #1 - !: - eor #1 - sta.z check_status_smc11_main__0 - // return (unsigned char)(status_smc == status); - // [450] main::check_status_smc11_return#0 = (char)main::check_status_smc11_$0 -- vbum1=vbuz2 - sta check_status_smc11_return - // main::check_status_smc12 - // status_smc == status - // [451] main::check_status_smc12_$0 = status_smc#0 == STATUS_SKIP -- vboz1=vbum2_eq_vbuc1 - lda status_smc - eor #STATUS_SKIP - beq !+ - lda #1 - !: - eor #1 - sta.z check_status_smc12_main__0 - // return (unsigned char)(status_smc == status); - // [452] main::check_status_smc12_return#0 = (char)main::check_status_smc12_$0 -- vbum1=vbuz2 - sta check_status_smc12_return + // [358] main::ch1#0 = util_wait_key::return#4 -- vbuz1=vbum2 + sta.z ch1 + // strchr("nN", ch) + // [359] strchr::c#1 = main::ch1#0 -- vbum1=vbuz2 + sta strchr.c + // [360] call strchr + // [1058] phi from main::@85 to strchr [phi:main::@85->strchr] + // [1058] phi strchr::c#4 = strchr::c#1 [phi:main::@85->strchr#0] -- register_copy + // [1058] phi strchr::str#2 = (const void *)main::$208 [phi:main::@85->strchr#1] -- pvoz1=pvoc1 + lda #main__208 + sta.z strchr.str+1 + jsr strchr + // strchr("nN", ch) + // [361] strchr::return#4 = strchr::return#2 // main::@86 - // if((rom_chip == 0 && (check_status_smc(STATUS_FLASHED) || check_status_smc(STATUS_SKIP))) || (rom_chip != 0)) - // [453] if(main::rom_chip4#10==0) goto main::@262 -- vbuz1_eq_0_then_la1 - // IMPORTANT! We only flash the CX16 ROM chip if the SMC got flashed succesfully! - lda.z rom_chip4 - bne !__b262+ - jmp __b262 - !__b262: - // main::@261 - __b261: - // [454] if(main::rom_chip4#10!=0) goto main::bank_set_brom9 -- vbuz1_neq_0_then_la1 - lda.z rom_chip4 - bne bank_set_brom9 - // main::@50 - // display_info_rom(rom_chip, STATUS_ISSUE, "SMC Update failed!") - // [455] display_info_rom::rom_chip#11 = main::rom_chip4#10 -- vbum1=vbuz2 + // [362] main::$116 = strchr::return#4 + // if(strchr("nN", ch)) + // [363] if((void *)0==main::$116) goto main::bank_set_bram1 -- pvoc1_eq_pvoz1_then_la1 + lda.z main__116 + cmp #<0 + bne !+ + lda.z main__116+1 + cmp #>0 + beq bank_set_bram1 + !: + // [364] phi from main::@86 to main::@8 [phi:main::@86->main::@8] + // main::@8 + // display_info_smc(STATUS_SKIP, "Cancelled") + // [365] call display_info_smc + // We cancel all updates, the updates are skipped. + // [617] phi from main::@8 to display_info_smc [phi:main::@8->display_info_smc] + // [617] phi display_info_smc::info_text#10 = main::info_text14 [phi:main::@8->display_info_smc#0] -- pbuz1=pbuc1 + lda #info_text14 + sta.z display_info_smc.info_text+1 + // [617] phi display_info_smc::info_status#10 = STATUS_SKIP [phi:main::@8->display_info_smc#1] -- vbum1=vbuc1 + lda #STATUS_SKIP + sta display_info_smc.info_status + jsr display_info_smc + // main::@87 + // [366] spi_manufacturer#407 = spi_read::return#0 -- vbum1=vbum2 + lda spi_read.return + sta spi_manufacturer + // [367] spi_memory_type#408 = spi_read::return#1 -- vbum1=vbum2 + lda spi_read.return_1 + sta spi_memory_type + // [368] spi_memory_capacity#409 = spi_read::return#2 -- vbum1=vbum2 + lda spi_read.return_2 + sta spi_memory_capacity + // display_info_vera(STATUS_SKIP, "Cancelled") + // [369] call display_info_vera + // [653] phi from main::@87 to display_info_vera [phi:main::@87->display_info_vera] + // [653] phi display_info_vera::info_text#19 = main::info_text14 [phi:main::@87->display_info_vera#0] -- pbuz1=pbuc1 + lda #info_text14 + sta.z display_info_vera.info_text+1 + // [653] phi spi_memory_capacity#110 = spi_memory_capacity#409 [phi:main::@87->display_info_vera#1] -- register_copy + // [653] phi spi_memory_type#111 = spi_memory_type#408 [phi:main::@87->display_info_vera#2] -- register_copy + // [653] phi spi_manufacturer#100 = spi_manufacturer#407 [phi:main::@87->display_info_vera#3] -- register_copy + // [653] phi display_info_vera::info_status#19 = STATUS_SKIP [phi:main::@87->display_info_vera#4] -- vbum1=vbuc1 + lda #STATUS_SKIP + sta display_info_vera.info_status + jsr display_info_vera + // [370] phi from main::@87 to main::@14 [phi:main::@87->main::@14] + // [370] phi main::rom_chip1#2 = 0 [phi:main::@87->main::@14#0] -- vbuz1=vbuc1 + lda #0 + sta.z rom_chip1 + // main::@14 + __b14: + // for(unsigned char rom_chip = 0; rom_chip < 8; rom_chip++) + // [371] if(main::rom_chip1#2<8) goto main::@15 -- vbuz1_lt_vbuc1_then_la1 + lda.z rom_chip1 + cmp #8 + bcc __b15 + // [372] phi from main::@14 to main::@16 [phi:main::@14->main::@16] + // main::@16 + // display_action_text("You have selected not to cancel the update ... ") + // [373] call display_action_text + // [845] phi from main::@16 to display_action_text [phi:main::@16->display_action_text] + // [845] phi display_action_text::info_text#17 = main::info_text17 [phi:main::@16->display_action_text#0] -- pbuz1=pbuc1 + lda #info_text17 + sta.z display_action_text.info_text+1 + jsr display_action_text + jmp bank_set_bram1 + // main::@15 + __b15: + // display_info_rom(rom_chip, STATUS_SKIP, "Cancelled") + // [374] display_info_rom::rom_chip#3 = main::rom_chip1#2 -- vbum1=vbuz2 + lda.z rom_chip1 sta display_info_rom.rom_chip - // [456] call display_info_rom - // [1546] phi from main::@50 to display_info_rom [phi:main::@50->display_info_rom] - // [1546] phi display_info_rom::info_text#17 = main::info_text29 [phi:main::@50->display_info_rom#0] -- pbuz1=pbuc1 - lda #display_info_rom] + // [1067] phi display_info_rom::info_text#10 = main::info_text14 [phi:main::@15->display_info_rom#0] -- pbuz1=pbuc1 + lda #info_text29 + lda #>info_text14 sta.z display_info_rom.info_text+1 - // [1546] phi display_info_rom::rom_chip#17 = display_info_rom::rom_chip#11 [phi:main::@50->display_info_rom#1] -- register_copy - // [1546] phi display_info_rom::info_status#17 = STATUS_ISSUE [phi:main::@50->display_info_rom#2] -- vbum1=vbuc1 - lda #STATUS_ISSUE + // [1067] phi display_info_rom::rom_chip#10 = display_info_rom::rom_chip#3 [phi:main::@15->display_info_rom#1] -- register_copy + // [1067] phi display_info_rom::info_status#10 = STATUS_SKIP [phi:main::@15->display_info_rom#2] -- vbum1=vbuc1 + lda #STATUS_SKIP sta display_info_rom.info_status jsr display_info_rom - // [457] phi from main::@198 main::@209 main::@45 main::@49 main::@50 main::@85 to main::@44 [phi:main::@198/main::@209/main::@45/main::@49/main::@50/main::@85->main::@44] - // [457] phi __stdio_filecount#583 = __stdio_filecount#12 [phi:main::@198/main::@209/main::@45/main::@49/main::@50/main::@85->main::@44#0] -- register_copy - // [457] phi __errno#590 = __errno#123 [phi:main::@198/main::@209/main::@45/main::@49/main::@50/main::@85->main::@44#1] -- register_copy - // main::@44 - __b44: - // for(unsigned char rom_chip = 7; rom_chip != 255; rom_chip--) - // [458] main::rom_chip4#1 = -- main::rom_chip4#10 -- vbuz1=_dec_vbuz1 - dec.z rom_chip4 - // [442] phi from main::@44 to main::@42 [phi:main::@44->main::@42] - // [442] phi __stdio_filecount#114 = __stdio_filecount#583 [phi:main::@44->main::@42#0] -- register_copy - // [442] phi __errno#118 = __errno#590 [phi:main::@44->main::@42#1] -- register_copy - // [442] phi main::rom_chip4#10 = main::rom_chip4#1 [phi:main::@44->main::@42#2] -- register_copy - jmp __b42 - // main::bank_set_brom9 - bank_set_brom9: - // BROM = bank - // [459] BROM = main::bank_set_brom9_bank#0 -- vbuz1=vbuc1 - lda #bank_set_brom9_bank - sta.z BROM - // [460] phi from main::bank_set_brom9 to main::@87 [phi:main::bank_set_brom9->main::@87] - // main::@87 - // display_progress_clear() - // [461] call display_progress_clear - // [918] phi from main::@87 to display_progress_clear [phi:main::@87->display_progress_clear] - jsr display_progress_clear - // main::@191 - // unsigned char rom_bank = rom_chip * 32 - // [462] main::rom_bank1#0 = main::rom_chip4#10 << 5 -- vbum1=vbuz2_rol_5 - lda.z rom_chip4 - asl - asl - asl - asl - asl - sta rom_bank1 - // unsigned char* file = rom_file(rom_chip) - // [463] rom_file::rom_chip#1 = main::rom_chip4#10 -- vbum1=vbuz2 - lda.z rom_chip4 - sta rom_file.rom_chip - // [464] call rom_file - // [1591] phi from main::@191 to rom_file [phi:main::@191->rom_file] - // [1591] phi rom_file::rom_chip#2 = rom_file::rom_chip#1 [phi:main::@191->rom_file#0] -- register_copy - jsr rom_file - // unsigned char* file = rom_file(rom_chip) - // [465] rom_file::return#5 = rom_file::return#2 - // main::@192 - // [466] main::file1#0 = rom_file::return#5 - // sprintf(info_text, "Reading %s ... (.) data ( ) empty", file) - // [467] call snprintf_init - // [1205] phi from main::@192 to snprintf_init [phi:main::@192->snprintf_init] - // [1205] phi snprintf_init::s#31 = info_text [phi:main::@192->snprintf_init#0] -- pbuz1=pbuc1 - lda #<@info_text - sta.z snprintf_init.s - lda #>@info_text - sta.z snprintf_init.s+1 - jsr snprintf_init - // [468] phi from main::@192 to main::@193 [phi:main::@192->main::@193] - // main::@193 - // sprintf(info_text, "Reading %s ... (.) data ( ) empty", file) - // [469] call printf_str - // [1210] phi from main::@193 to printf_str [phi:main::@193->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:main::@193->printf_str#0] -- pprz1=pprc1 - lda #snputc - sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = main::s11 [phi:main::@193->printf_str#1] -- pbuz1=pbuc1 - lda #s11 - sta.z printf_str.s+1 - jsr printf_str - // main::@194 - // sprintf(info_text, "Reading %s ... (.) data ( ) empty", file) - // [470] printf_string::str#25 = main::file1#0 -- pbuz1=pbuz2 - lda.z file1 - sta.z printf_string.str - lda.z file1+1 - sta.z printf_string.str+1 - // [471] call printf_string - // [1219] phi from main::@194 to printf_string [phi:main::@194->printf_string] - // [1219] phi printf_string::putc#26 = &snputc [phi:main::@194->printf_string#0] -- pprz1=pprc1 - lda #snputc - sta.z printf_string.putc+1 - // [1219] phi printf_string::str#26 = printf_string::str#25 [phi:main::@194->printf_string#1] -- register_copy - // [1219] phi printf_string::format_justify_left#26 = 0 [phi:main::@194->printf_string#2] -- vbum1=vbuc1 - lda #0 - sta printf_string.format_justify_left - // [1219] phi printf_string::format_min_length#26 = 0 [phi:main::@194->printf_string#3] -- vbum1=vbuc1 - sta printf_string.format_min_length - jsr printf_string - // [472] phi from main::@194 to main::@195 [phi:main::@194->main::@195] - // main::@195 - // sprintf(info_text, "Reading %s ... (.) data ( ) empty", file) - // [473] call printf_str - // [1210] phi from main::@195 to printf_str [phi:main::@195->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:main::@195->printf_str#0] -- pprz1=pprc1 - lda #snputc - sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = main::s12 [phi:main::@195->printf_str#1] -- pbuz1=pbuc1 - lda #s12 - sta.z printf_str.s+1 - jsr printf_str - // main::@196 - // sprintf(info_text, "Reading %s ... (.) data ( ) empty", file) - // [474] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 - lda #0 - pha - // [475] callexecute snputc -- call_vprc1 - jsr snputc - // sideeffect stackpullpadding(1) -- _stackpullpadding_1 - pla - // display_action_progress(info_text) - // [477] call display_action_progress - // [904] phi from main::@196 to display_action_progress [phi:main::@196->display_action_progress] - // [904] phi display_action_progress::info_text#27 = info_text [phi:main::@196->display_action_progress#0] -- pbuz1=pbuc1 - lda #<@info_text + // main::@88 + // for(unsigned char rom_chip = 0; rom_chip < 8; rom_chip++) + // [376] main::rom_chip1#1 = ++ main::rom_chip1#2 -- vbuz1=_inc_vbuz1 + inc.z rom_chip1 + // [370] phi from main::@88 to main::@14 [phi:main::@88->main::@14] + // [370] phi main::rom_chip1#2 = main::rom_chip1#1 [phi:main::@88->main::@14#0] -- register_copy + jmp __b14 + // [377] phi from main::@33 to main::@6 [phi:main::@33->main::@6] + // main::@6 + __b6: + // display_action_progress("The SMC chip and SMC.BIN versions are equal, no flash required!") + // [378] call display_action_progress + // [559] phi from main::@6 to display_action_progress [phi:main::@6->display_action_progress] + // [559] phi display_action_progress::info_text#19 = main::info_text10 [phi:main::@6->display_action_progress#0] -- pbuz1=pbuc1 + lda #@info_text + lda #>info_text10 sta.z display_action_progress.info_text+1 jsr display_action_progress - // main::@197 - // unsigned long rom_bytes_read = rom_read(rom_chip, file, STATUS_READING, rom_bank, rom_sizes[rom_chip]) - // [478] main::$317 = main::rom_chip4#10 << 2 -- vbum1=vbuz2_rol_2 - lda.z rom_chip4 - asl - asl - sta main__317 - // [479] rom_read::rom_chip#1 = main::rom_chip4#10 -- vbum1=vbuz2 - lda.z rom_chip4 - sta rom_read.rom_chip - // [480] rom_read::file#1 = main::file1#0 -- pbuz1=pbuz2 - lda.z file1 - sta.z rom_read.file - lda.z file1+1 - sta.z rom_read.file+1 - // [481] rom_read::brom_bank_start#2 = main::rom_bank1#0 -- vbum1=vbum2 - lda rom_bank1 - sta rom_read.brom_bank_start - // [482] rom_read::rom_size#1 = rom_sizes[main::$317] -- vdum1=pduc1_derefidx_vbum2 - ldy main__317 - lda rom_sizes,y - sta rom_read.rom_size - lda rom_sizes+1,y - sta rom_read.rom_size+1 - lda rom_sizes+2,y - sta rom_read.rom_size+2 - lda rom_sizes+3,y - sta rom_read.rom_size+3 - // [483] call rom_read - // [1597] phi from main::@197 to rom_read [phi:main::@197->rom_read] - // [1597] phi rom_read::rom_chip#20 = rom_read::rom_chip#1 [phi:main::@197->rom_read#0] -- register_copy - // [1597] phi rom_read::rom_size#12 = rom_read::rom_size#1 [phi:main::@197->rom_read#1] -- register_copy - // [1597] phi __errno#105 = __errno#118 [phi:main::@197->rom_read#2] -- register_copy - // [1597] phi __stdio_filecount#100 = __stdio_filecount#114 [phi:main::@197->rom_read#3] -- register_copy - // [1597] phi rom_read::file#10 = rom_read::file#1 [phi:main::@197->rom_read#4] -- register_copy - // [1597] phi rom_read::brom_bank_start#10 = rom_read::brom_bank_start#2 [phi:main::@197->rom_read#5] -- register_copy - // [1597] phi rom_read::info_status#11 = STATUS_READING [phi:main::@197->rom_read#6] -- vbum1=vbuc1 - lda #STATUS_READING - sta rom_read.info_status - jsr rom_read - // unsigned long rom_bytes_read = rom_read(rom_chip, file, STATUS_READING, rom_bank, rom_sizes[rom_chip]) - // [484] rom_read::return#3 = rom_read::return#0 - // main::@198 - // [485] main::rom_bytes_read1#0 = rom_read::return#3 -- vduz1=vdum2 - lda rom_read.return - sta.z rom_bytes_read1 - lda rom_read.return+1 - sta.z rom_bytes_read1+1 - lda rom_read.return+2 - sta.z rom_bytes_read1+2 - lda rom_read.return+3 - sta.z rom_bytes_read1+3 - // if(rom_bytes_read) - // [486] if(0==main::rom_bytes_read1#0) goto main::@44 -- 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 !__b44+ - jmp __b44 - !__b44: - // [487] phi from main::@198 to main::@47 [phi:main::@198->main::@47] - // main::@47 - // display_action_progress("Comparing ... (.) data, (=) same, (*) different.") - // [488] call display_action_progress - // Now we compare the RAM with the actual ROM contents. - // [904] phi from main::@47 to display_action_progress [phi:main::@47->display_action_progress] - // [904] phi display_action_progress::info_text#27 = main::info_text30 [phi:main::@47->display_action_progress#0] -- pbuz1=pbuc1 - lda #main::@81] + // main::@81 + // util_wait_space() + // [380] call util_wait_space + // [877] phi from main::@81 to util_wait_space [phi:main::@81->util_wait_space] + jsr util_wait_space + // [381] phi from main::@81 to main::@82 [phi:main::@81->main::@82] + // main::@82 + // display_info_smc(STATUS_SKIP, "SMC.BIN and SMC equal.") + // [382] call display_info_smc + // [617] phi from main::@82 to display_info_smc [phi:main::@82->display_info_smc] + // [617] phi display_info_smc::info_text#10 = main::info_text11 [phi:main::@82->display_info_smc#0] -- pbuz1=pbuc1 + lda #info_text11 + sta.z display_info_smc.info_text+1 + // [617] phi display_info_smc::info_status#10 = STATUS_SKIP [phi:main::@82->display_info_smc#1] -- vbum1=vbuc1 + lda #STATUS_SKIP + sta display_info_smc.info_status + jsr display_info_smc + jmp check_status_smc6 + // [383] phi from main::@128 to main::@4 [phi:main::@128->main::@4] + // main::@4 + __b4: + // display_action_progress("Compatibility between ROM.BIN and SMC.BIN can't be assured!") + // [384] call display_action_progress + // [559] phi from main::@4 to display_action_progress [phi:main::@4->display_action_progress] + // [559] phi display_action_progress::info_text#19 = main::info_text8 [phi:main::@4->display_action_progress#0] -- pbuz1=pbuc1 + lda #info_text30 + lda #>info_text8 sta.z display_action_progress.info_text+1 jsr display_action_progress - // main::@199 - // display_info_rom(rom_chip, STATUS_COMPARING, "") - // [489] display_info_rom::rom_chip#12 = main::rom_chip4#10 -- vbum1=vbuz2 - lda.z rom_chip4 - sta display_info_rom.rom_chip - // [490] call display_info_rom - // [1546] phi from main::@199 to display_info_rom [phi:main::@199->display_info_rom] - // [1546] phi display_info_rom::info_text#17 = str [phi:main::@199->display_info_rom#0] -- pbuz1=pbuc1 - lda #str - sta.z display_info_rom.info_text+1 - // [1546] phi display_info_rom::rom_chip#17 = display_info_rom::rom_chip#12 [phi:main::@199->display_info_rom#1] -- register_copy - // [1546] phi display_info_rom::info_status#17 = STATUS_COMPARING [phi:main::@199->display_info_rom#2] -- vbum1=vbuc1 - lda #STATUS_COMPARING - sta display_info_rom.info_status - jsr display_info_rom - // main::@200 - // unsigned long rom_differences = rom_verify( - // rom_chip, rom_bank, file_sizes[rom_chip]) - // [491] rom_verify::rom_chip#0 = main::rom_chip4#10 -- vbum1=vbuz2 - lda.z rom_chip4 - sta rom_verify.rom_chip - // [492] rom_verify::rom_bank_start#0 = main::rom_bank1#0 -- vbum1=vbum2 - lda rom_bank1 - sta rom_verify.rom_bank_start - // [493] rom_verify::file_size#0 = file_sizes[main::$317] -- vdum1=pduc1_derefidx_vbum2 - ldy main__317 - lda file_sizes,y - sta rom_verify.file_size - lda file_sizes+1,y - sta rom_verify.file_size+1 - lda file_sizes+2,y - sta rom_verify.file_size+2 - lda file_sizes+3,y - sta rom_verify.file_size+3 - // [494] call rom_verify - // Verify the ROM... - // [1677] phi from main::@200 to rom_verify [phi:main::@200->rom_verify] - jsr rom_verify - // unsigned long rom_differences = rom_verify( - // rom_chip, rom_bank, file_sizes[rom_chip]) - // [495] rom_verify::return#2 = rom_verify::rom_different_bytes#11 - // main::@201 - // [496] main::rom_differences#0 = rom_verify::return#2 -- vduz1=vdum2 - lda rom_verify.return - sta.z rom_differences - lda rom_verify.return+1 - sta.z rom_differences+1 - lda rom_verify.return+2 - sta.z rom_differences+2 - lda rom_verify.return+3 - sta.z rom_differences+3 - // if (!rom_differences) - // [497] if(0==main::rom_differences#0) goto main::@45 -- 0_eq_vduz1_then_la1 - lda.z rom_differences - ora.z rom_differences+1 - ora.z rom_differences+2 - ora.z rom_differences+3 - bne !__b45+ - jmp __b45 - !__b45: - // [498] phi from main::@201 to main::@48 [phi:main::@201->main::@48] - // main::@48 - // sprintf(info_text, "%05x differences!", rom_differences) - // [499] call snprintf_init - // [1205] phi from main::@48 to snprintf_init [phi:main::@48->snprintf_init] - // [1205] phi snprintf_init::s#31 = info_text [phi:main::@48->snprintf_init#0] -- pbuz1=pbuc1 - lda #<@info_text - sta.z snprintf_init.s - lda #>@info_text - sta.z snprintf_init.s+1 - jsr snprintf_init - // main::@202 - // sprintf(info_text, "%05x differences!", rom_differences) - // [500] printf_ulong::uvalue#13 = main::rom_differences#0 -- vdum1=vduz2 - lda.z rom_differences - sta printf_ulong.uvalue - lda.z rom_differences+1 - sta printf_ulong.uvalue+1 - lda.z rom_differences+2 - sta printf_ulong.uvalue+2 - lda.z rom_differences+3 - sta printf_ulong.uvalue+3 - // [501] call printf_ulong - // [1741] phi from main::@202 to printf_ulong [phi:main::@202->printf_ulong] - // [1741] phi printf_ulong::format_zero_padding#15 = 1 [phi:main::@202->printf_ulong#0] -- vbum1=vbuc1 - lda #1 - sta printf_ulong.format_zero_padding - // [1741] phi printf_ulong::format_min_length#15 = 5 [phi:main::@202->printf_ulong#1] -- vbum1=vbuc1 - lda #5 - sta printf_ulong.format_min_length - // [1741] phi printf_ulong::format_radix#15 = HEXADECIMAL [phi:main::@202->printf_ulong#2] -- vbum1=vbuc1 - lda #HEXADECIMAL - sta printf_ulong.format_radix - // [1741] phi printf_ulong::uvalue#15 = printf_ulong::uvalue#13 [phi:main::@202->printf_ulong#3] -- register_copy - jsr printf_ulong - // [502] phi from main::@202 to main::@203 [phi:main::@202->main::@203] - // main::@203 - // sprintf(info_text, "%05x differences!", rom_differences) - // [503] call printf_str - // [1210] phi from main::@203 to printf_str [phi:main::@203->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:main::@203->printf_str#0] -- pprz1=pprc1 - lda #snputc - sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = s13 [phi:main::@203->printf_str#1] -- pbuz1=pbuc1 - lda #s13 - sta.z printf_str.s+1 - jsr printf_str - // main::@204 - // sprintf(info_text, "%05x differences!", rom_differences) - // [504] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 - lda #0 - pha - // [505] callexecute snputc -- call_vprc1 - jsr snputc - // sideeffect stackpullpadding(1) -- _stackpullpadding_1 - pla - // display_info_rom(rom_chip, STATUS_FLASH, info_text) - // [507] display_info_rom::rom_chip#14 = main::rom_chip4#10 -- vbum1=vbuz2 - lda.z rom_chip4 - sta display_info_rom.rom_chip - // [508] call display_info_rom - // [1546] phi from main::@204 to display_info_rom [phi:main::@204->display_info_rom] - // [1546] phi display_info_rom::info_text#17 = info_text [phi:main::@204->display_info_rom#0] -- pbuz1=pbuc1 - lda #<@info_text - sta.z display_info_rom.info_text - lda #>@info_text - sta.z display_info_rom.info_text+1 - // [1546] phi display_info_rom::rom_chip#17 = display_info_rom::rom_chip#14 [phi:main::@204->display_info_rom#1] -- register_copy - // [1546] phi display_info_rom::info_status#17 = STATUS_FLASH [phi:main::@204->display_info_rom#2] -- vbum1=vbuc1 - lda #STATUS_FLASH - sta display_info_rom.info_status - jsr display_info_rom - // main::@205 - // unsigned long rom_flash_errors = rom_flash( - // rom_chip, rom_bank, file_sizes[rom_chip]) - // [509] rom_flash::rom_chip#0 = main::rom_chip4#10 -- vbum1=vbuz2 - lda.z rom_chip4 - sta rom_flash.rom_chip - // [510] rom_flash::rom_bank_start#0 = main::rom_bank1#0 -- vbum1=vbum2 - lda rom_bank1 - sta rom_flash.rom_bank_start - // [511] rom_flash::file_size#0 = file_sizes[main::$317] -- vdum1=pduc1_derefidx_vbum2 - ldy main__317 - lda file_sizes,y - sta rom_flash.file_size - lda file_sizes+1,y - sta rom_flash.file_size+1 - lda file_sizes+2,y - sta rom_flash.file_size+2 - lda file_sizes+3,y - sta rom_flash.file_size+3 - // [512] call rom_flash - // [1751] phi from main::@205 to rom_flash [phi:main::@205->rom_flash] - jsr rom_flash - // unsigned long rom_flash_errors = rom_flash( - // rom_chip, rom_bank, file_sizes[rom_chip]) - // [513] rom_flash::return#2 = rom_flash::flash_errors#12 - // main::@206 - // [514] 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 - // if(rom_flash_errors) - // [515] if(0!=main::rom_flash_errors#0) goto main::@46 -- 0_neq_vdum1_then_la1 - lda rom_flash_errors - ora rom_flash_errors+1 - ora rom_flash_errors+2 - ora rom_flash_errors+3 - bne __b46 - // main::@49 - // display_info_rom(rom_chip, STATUS_FLASHED, NULL) - // [516] display_info_rom::rom_chip#16 = main::rom_chip4#10 -- vbum1=vbuz2 - lda.z rom_chip4 - sta display_info_rom.rom_chip - // [517] call display_info_rom - // RFL3 | Flash ROM and all ok - // [1546] phi from main::@49 to display_info_rom [phi:main::@49->display_info_rom] - // [1546] phi display_info_rom::info_text#17 = 0 [phi:main::@49->display_info_rom#0] -- pbuz1=vbuc1 - lda #<0 - sta.z display_info_rom.info_text - sta.z display_info_rom.info_text+1 - // [1546] phi display_info_rom::rom_chip#17 = display_info_rom::rom_chip#16 [phi:main::@49->display_info_rom#1] -- register_copy - // [1546] phi display_info_rom::info_status#17 = STATUS_FLASHED [phi:main::@49->display_info_rom#2] -- vbum1=vbuc1 - lda #STATUS_FLASHED - sta display_info_rom.info_status - jsr display_info_rom - jmp __b44 - // [518] phi from main::@206 to main::@46 [phi:main::@206->main::@46] - // main::@46 - __b46: - // sprintf(info_text, "%u flash errors!", rom_flash_errors) - // [519] call snprintf_init - // [1205] phi from main::@46 to snprintf_init [phi:main::@46->snprintf_init] - // [1205] phi snprintf_init::s#31 = info_text [phi:main::@46->snprintf_init#0] -- pbuz1=pbuc1 - lda #<@info_text - sta.z snprintf_init.s - lda #>@info_text - sta.z snprintf_init.s+1 - jsr snprintf_init - // main::@207 - // sprintf(info_text, "%u flash errors!", rom_flash_errors) - // [520] printf_ulong::uvalue#14 = main::rom_flash_errors#0 -- vdum1=vdum2 - lda rom_flash_errors - sta printf_ulong.uvalue - lda rom_flash_errors+1 - sta printf_ulong.uvalue+1 - lda rom_flash_errors+2 - sta printf_ulong.uvalue+2 - lda rom_flash_errors+3 - sta printf_ulong.uvalue+3 - // [521] call printf_ulong - // [1741] phi from main::@207 to printf_ulong [phi:main::@207->printf_ulong] - // [1741] phi printf_ulong::format_zero_padding#15 = 0 [phi:main::@207->printf_ulong#0] -- vbum1=vbuc1 - lda #0 - sta printf_ulong.format_zero_padding - // [1741] phi printf_ulong::format_min_length#15 = 0 [phi:main::@207->printf_ulong#1] -- vbum1=vbuc1 - sta printf_ulong.format_min_length - // [1741] phi printf_ulong::format_radix#15 = DECIMAL [phi:main::@207->printf_ulong#2] -- vbum1=vbuc1 - lda #DECIMAL - sta printf_ulong.format_radix - // [1741] phi printf_ulong::uvalue#15 = printf_ulong::uvalue#14 [phi:main::@207->printf_ulong#3] -- register_copy - jsr printf_ulong - // [522] phi from main::@207 to main::@208 [phi:main::@207->main::@208] - // main::@208 - // sprintf(info_text, "%u flash errors!", rom_flash_errors) - // [523] call printf_str - // [1210] phi from main::@208 to printf_str [phi:main::@208->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:main::@208->printf_str#0] -- pprz1=pprc1 - lda #snputc - sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = main::s14 [phi:main::@208->printf_str#1] -- pbuz1=pbuc1 - lda #s14 - sta.z printf_str.s+1 - jsr printf_str - // main::@209 - // sprintf(info_text, "%u flash errors!", rom_flash_errors) - // [524] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 - lda #0 - pha - // [525] callexecute snputc -- call_vprc1 - jsr snputc - // sideeffect stackpullpadding(1) -- _stackpullpadding_1 - pla - // display_info_rom(rom_chip, STATUS_ERROR, info_text) - // [527] display_info_rom::rom_chip#15 = main::rom_chip4#10 -- vbum1=vbuz2 - lda.z rom_chip4 - sta display_info_rom.rom_chip - // [528] call display_info_rom - // [1546] phi from main::@209 to display_info_rom [phi:main::@209->display_info_rom] - // [1546] phi display_info_rom::info_text#17 = info_text [phi:main::@209->display_info_rom#0] -- pbuz1=pbuc1 - lda #<@info_text - sta.z display_info_rom.info_text - lda #>@info_text - sta.z display_info_rom.info_text+1 - // [1546] phi display_info_rom::rom_chip#17 = display_info_rom::rom_chip#15 [phi:main::@209->display_info_rom#1] -- register_copy - // [1546] phi display_info_rom::info_status#17 = STATUS_ERROR [phi:main::@209->display_info_rom#2] -- vbum1=vbuc1 - lda #STATUS_ERROR - sta display_info_rom.info_status - jsr display_info_rom - jmp __b44 - // main::@45 - __b45: - // display_info_rom(rom_chip, STATUS_SKIP, "No update required") - // [529] display_info_rom::rom_chip#13 = main::rom_chip4#10 -- vbum1=vbuz2 - lda.z rom_chip4 - sta display_info_rom.rom_chip - // [530] 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 - // [1546] phi from main::@45 to display_info_rom [phi:main::@45->display_info_rom] - // [1546] phi display_info_rom::info_text#17 = info_text6 [phi:main::@45->display_info_rom#0] -- pbuz1=pbuc1 - lda #<@info_text6 - sta.z display_info_rom.info_text - lda #>@info_text6 - sta.z display_info_rom.info_text+1 - // [1546] phi display_info_rom::rom_chip#17 = display_info_rom::rom_chip#13 [phi:main::@45->display_info_rom#1] -- register_copy - // [1546] phi display_info_rom::info_status#17 = STATUS_SKIP [phi:main::@45->display_info_rom#2] -- vbum1=vbuc1 - lda #STATUS_SKIP - sta display_info_rom.info_status - jsr display_info_rom - jmp __b44 - // main::@262 - __b262: - // if((rom_chip == 0 && (check_status_smc(STATUS_FLASHED) || check_status_smc(STATUS_SKIP))) || (rom_chip != 0)) - // [531] if(0!=main::check_status_smc11_return#0) goto main::bank_set_brom9 -- 0_neq_vbum1_then_la1 - lda check_status_smc11_return - beq !bank_set_brom9+ - jmp bank_set_brom9 - !bank_set_brom9: - // main::@270 - // [532] if(0!=main::check_status_smc12_return#0) goto main::bank_set_brom9 -- 0_neq_vbum1_then_la1 - lda check_status_smc12_return - beq !bank_set_brom9+ - jmp bank_set_brom9 - !bank_set_brom9: - jmp __b261 - // [533] phi from main::@260 to main::@52 [phi:main::@260->main::@52] - // main::@52 - __b52: - // display_action_progress("Reading SMC.BIN ... (.) data, ( ) empty") - // [534] call display_action_progress - // [904] phi from main::@52 to display_action_progress [phi:main::@52->display_action_progress] - // [904] phi display_action_progress::info_text#27 = main::info_text23 [phi:main::@52->display_action_progress#0] -- pbuz1=pbuc1 - lda #info_text23 - sta.z display_action_progress.info_text+1 - jsr display_action_progress - // [535] phi from main::@52 to main::@185 [phi:main::@52->main::@185] - // main::@185 - // display_progress_clear() - // [536] call display_progress_clear - // [918] phi from main::@185 to display_progress_clear [phi:main::@185->display_progress_clear] - jsr display_progress_clear - // [537] phi from main::@185 to main::@186 [phi:main::@185->main::@186] - // main::@186 - // smc_read(STATUS_READING) - // [538] call smc_read - // [1155] phi from main::@186 to smc_read [phi:main::@186->smc_read] - // [1155] phi __errno#102 = __errno#117 [phi:main::@186->smc_read#0] -- register_copy - // [1155] phi __stdio_filecount#128 = __stdio_filecount#113 [phi:main::@186->smc_read#1] -- register_copy - // [1155] phi smc_read::info_status#10 = STATUS_READING [phi:main::@186->smc_read#2] -- vbum1=vbuc1 - lda #STATUS_READING - sta smc_read.info_status - jsr smc_read - // smc_read(STATUS_READING) - // [539] smc_read::return#3 = smc_read::return#0 - // main::@187 - // smc_file_size = smc_read(STATUS_READING) - // [540] smc_file_size#1 = smc_read::return#3 -- vwum1=vwum2 - lda smc_read.return - sta smc_file_size_1 - lda smc_read.return+1 - sta smc_file_size_1+1 - // if(smc_file_size) - // [541] if(0==smc_file_size#1) goto main::SEI6 -- 0_eq_vwum1_then_la1 - lda smc_file_size_1 - ora smc_file_size_1+1 - bne !SEI6+ - jmp SEI6 - !SEI6: - // [542] phi from main::@187 to main::@53 [phi:main::@187->main::@53] - // main::@53 - // display_action_text("Press both POWER/RESET buttons on the CX16 board!") - // [543] call display_action_text - // Flash the SMC chip. - // [1357] phi from main::@53 to display_action_text [phi:main::@53->display_action_text] - // [1357] phi display_action_text::info_text#25 = main::info_text24 [phi:main::@53->display_action_text#0] -- pbuz1=pbuc1 - lda #info_text24 - sta.z display_action_text.info_text+1 - jsr display_action_text - // main::@188 - // [544] smc_bootloader#510 = smc_bootloader#0 -- vwum1=vwum2 - lda smc_bootloader - sta smc_bootloader_1 - lda smc_bootloader+1 - sta smc_bootloader_1+1 - // display_info_smc(STATUS_FLASHING, "Press POWER/RESET!") - // [545] call display_info_smc - // [962] phi from main::@188 to display_info_smc [phi:main::@188->display_info_smc] - // [962] phi display_info_smc::info_text#20 = main::info_text25 [phi:main::@188->display_info_smc#0] -- pbuz1=pbuc1 - lda #info_text25 - sta.z display_info_smc.info_text+1 - // [962] phi smc_bootloader#14 = smc_bootloader#510 [phi:main::@188->display_info_smc#1] -- register_copy - // [962] phi display_info_smc::info_status#20 = STATUS_FLASHING [phi:main::@188->display_info_smc#2] -- vbum1=vbuc1 - lda #STATUS_FLASHING - sta display_info_smc.info_status - jsr display_info_smc - // main::@189 - // unsigned int flashed_bytes = smc_flash(smc_file_size) - // [546] smc_flash::smc_bytes_total#0 = smc_file_size#1 -- vwum1=vwum2 - lda smc_file_size_1 - sta smc_flash.smc_bytes_total - lda smc_file_size_1+1 - sta smc_flash.smc_bytes_total+1 - // [547] call smc_flash - // [1850] phi from main::@189 to smc_flash [phi:main::@189->smc_flash] - jsr smc_flash - // unsigned int flashed_bytes = smc_flash(smc_file_size) - // [548] smc_flash::return#5 = smc_flash::return#1 - // main::@190 - // [549] main::flashed_bytes#0 = smc_flash::return#5 -- vwuz1=vwum2 - lda smc_flash.return - sta.z flashed_bytes - lda smc_flash.return+1 - sta.z flashed_bytes+1 - // if(flashed_bytes) - // [550] if(0!=main::flashed_bytes#0) goto main::@40 -- 0_neq_vwuz1_then_la1 - lda.z flashed_bytes - ora.z flashed_bytes+1 - bne __b40 - // main::@54 - // if(flashed_bytes == (unsigned int)0xFFFF) - // [551] if(main::flashed_bytes#0==$ffff) goto main::@41 -- vwuz1_eq_vwuc1_then_la1 - lda.z flashed_bytes - cmp #<$ffff - bne !+ - lda.z flashed_bytes+1 - cmp #>$ffff - beq __b41 - !: - // main::@55 - // [552] smc_bootloader#516 = smc_bootloader#0 -- vwum1=vwum2 - lda smc_bootloader - sta smc_bootloader_1 - lda smc_bootloader+1 - sta smc_bootloader_1+1 - // display_info_smc(STATUS_ISSUE, "POWER/RESET not pressed!") - // [553] call display_info_smc - // SFL2 | no action on POWER/RESET press request - // [962] phi from main::@55 to display_info_smc [phi:main::@55->display_info_smc] - // [962] phi display_info_smc::info_text#20 = main::info_text28 [phi:main::@55->display_info_smc#0] -- pbuz1=pbuc1 - lda #info_text28 - sta.z display_info_smc.info_text+1 - // [962] phi smc_bootloader#14 = smc_bootloader#516 [phi:main::@55->display_info_smc#1] -- register_copy - // [962] phi display_info_smc::info_status#20 = STATUS_ISSUE [phi:main::@55->display_info_smc#2] -- vbum1=vbuc1 - lda #STATUS_ISSUE - sta display_info_smc.info_status - jsr display_info_smc - jmp SEI6 - // main::@41 - __b41: - // [554] smc_bootloader#515 = smc_bootloader#0 -- vwum1=vwum2 - lda smc_bootloader - sta smc_bootloader_1 - lda smc_bootloader+1 - sta smc_bootloader_1+1 - // display_info_smc(STATUS_ERROR, "SMC has errors!") - // [555] call display_info_smc - // SFL3 | errors during flash - // [962] phi from main::@41 to display_info_smc [phi:main::@41->display_info_smc] - // [962] phi display_info_smc::info_text#20 = main::info_text27 [phi:main::@41->display_info_smc#0] -- pbuz1=pbuc1 - lda #info_text27 - sta.z display_info_smc.info_text+1 - // [962] phi smc_bootloader#14 = smc_bootloader#515 [phi:main::@41->display_info_smc#1] -- register_copy - // [962] phi display_info_smc::info_status#20 = STATUS_ERROR [phi:main::@41->display_info_smc#2] -- vbum1=vbuc1 - lda #STATUS_ERROR - sta display_info_smc.info_status - jsr display_info_smc - jmp SEI6 - // main::@40 - __b40: - // [556] smc_bootloader#514 = smc_bootloader#0 -- vwum1=vwum2 - lda smc_bootloader - sta smc_bootloader_1 - lda smc_bootloader+1 - sta smc_bootloader_1+1 - // display_info_smc(STATUS_FLASHED, "") - // [557] call display_info_smc - // SFL1 | and POWER/RESET pressed - // [962] phi from main::@40 to display_info_smc [phi:main::@40->display_info_smc] - // [962] phi display_info_smc::info_text#20 = str [phi:main::@40->display_info_smc#0] -- pbuz1=pbuc1 - lda #str - sta.z display_info_smc.info_text+1 - // [962] phi smc_bootloader#14 = smc_bootloader#514 [phi:main::@40->display_info_smc#1] -- register_copy - // [962] phi display_info_smc::info_status#20 = STATUS_FLASHED [phi:main::@40->display_info_smc#2] -- vbum1=vbuc1 - lda #STATUS_FLASHED - sta display_info_smc.info_status - jsr display_info_smc - jmp SEI6 - // [558] phi from main::@177 main::@257 main::@258 main::@259 to main::@9 [phi:main::@177/main::@257/main::@258/main::@259->main::@9] - // main::@9 - __b9: - // display_action_progress("Chipsets have been detected and update files validated!") - // [559] call display_action_progress - // [904] phi from main::@9 to display_action_progress [phi:main::@9->display_action_progress] - // [904] phi display_action_progress::info_text#27 = main::info_text17 [phi:main::@9->display_action_progress#0] -- pbuz1=pbuc1 - lda #info_text17 - sta.z display_action_progress.info_text+1 - jsr display_action_progress - // [560] phi from main::@9 to main::@178 [phi:main::@9->main::@178] - // main::@178 - // unsigned char ch = util_wait_key("Continue with update of highlighted chipsets? [Y/N]", "nyNY") - // [561] call util_wait_key - // [1999] phi from main::@178 to util_wait_key [phi:main::@178->util_wait_key] - // [1999] phi util_wait_key::filter#13 = main::filter1 [phi:main::@178->util_wait_key#0] -- pbuz1=pbuc1 - lda #filter1 - sta.z util_wait_key.filter+1 - // [1999] phi util_wait_key::info_text#3 = main::info_text18 [phi:main::@178->util_wait_key#1] -- pbuz1=pbuc1 - lda #info_text18 - 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") - // [562] util_wait_key::return#4 = util_wait_key::ch#4 -- vbum1=vwum2 - lda util_wait_key.ch - sta util_wait_key.return_1 - // main::@179 - // [563] main::ch1#0 = util_wait_key::return#4 -- vbum1=vbum2 - sta ch1 - // strchr("nN", ch) - // [564] strchr::c#1 = main::ch1#0 -- vbum1=vbum2 - sta strchr.c - // [565] call strchr - // [2023] phi from main::@179 to strchr [phi:main::@179->strchr] - // [2023] phi strchr::c#4 = strchr::c#1 [phi:main::@179->strchr#0] -- register_copy - // [2023] phi strchr::str#2 = (const void *)main::$344 [phi:main::@179->strchr#1] -- pvoz1=pvoc1 - lda #main__344 - sta.z strchr.str+1 - jsr strchr - // strchr("nN", ch) - // [566] strchr::return#4 = strchr::return#2 - // main::@180 - // [567] main::$191 = strchr::return#4 - // if(strchr("nN", ch)) - // [568] if((void *)0==main::$191) goto main::bank_set_bram1 -- pvoc1_eq_pvoz1_then_la1 - lda.z main__191 - cmp #<0 - bne !+ - lda.z main__191+1 - cmp #>0 - bne !bank_set_bram1+ - jmp bank_set_bram1 - !bank_set_bram1: - !: - // main::@10 - // [569] smc_bootloader#504 = smc_bootloader#0 -- vwum1=vwum2 - lda smc_bootloader - sta smc_bootloader_1 - lda smc_bootloader+1 - sta smc_bootloader_1+1 - // display_info_smc(STATUS_SKIP, "Cancelled") - // [570] call display_info_smc - // We cancel all updates, the updates are skipped. - // [962] phi from main::@10 to display_info_smc [phi:main::@10->display_info_smc] - // [962] phi display_info_smc::info_text#20 = main::info_text19 [phi:main::@10->display_info_smc#0] -- pbuz1=pbuc1 - lda #info_text19 - sta.z display_info_smc.info_text+1 - // [962] phi smc_bootloader#14 = smc_bootloader#504 [phi:main::@10->display_info_smc#1] -- register_copy - // [962] phi display_info_smc::info_status#20 = STATUS_SKIP [phi:main::@10->display_info_smc#2] -- vbum1=vbuc1 - lda #STATUS_SKIP - sta display_info_smc.info_status - jsr display_info_smc - // main::@181 - // [571] spi_manufacturer#581 = spi_read::return#0 -- vbum1=vbum2 - lda spi_read.return - sta spi_manufacturer - // [572] spi_memory_type#582 = spi_read::return#1 -- vbum1=vbum2 - lda spi_read.return_1 - sta spi_memory_type - // [573] spi_memory_capacity#583 = spi_read::return#2 -- vbum1=vbum2 - lda spi_read.return_2 - sta spi_memory_capacity - // display_info_vera(STATUS_SKIP, "Cancelled") - // [574] call display_info_vera - // [998] phi from main::@181 to display_info_vera [phi:main::@181->display_info_vera] - // [998] phi display_info_vera::info_text#19 = main::info_text19 [phi:main::@181->display_info_vera#0] -- pbuz1=pbuc1 - lda #info_text19 - sta.z display_info_vera.info_text+1 - // [998] phi spi_memory_capacity#106 = spi_memory_capacity#583 [phi:main::@181->display_info_vera#1] -- register_copy - // [998] phi spi_memory_type#107 = spi_memory_type#582 [phi:main::@181->display_info_vera#2] -- register_copy - // [998] phi spi_manufacturer#108 = spi_manufacturer#581 [phi:main::@181->display_info_vera#3] -- register_copy - // [998] phi display_info_vera::info_status#19 = STATUS_SKIP [phi:main::@181->display_info_vera#4] -- vbum1=vbuc1 - lda #STATUS_SKIP - sta display_info_vera.info_status - jsr display_info_vera - // [575] phi from main::@181 to main::@37 [phi:main::@181->main::@37] - // [575] phi main::rom_chip3#2 = 0 [phi:main::@181->main::@37#0] -- vbuz1=vbuc1 - lda #0 - sta.z rom_chip3 - // main::@37 - __b37: - // for(unsigned char rom_chip = 0; rom_chip < 8; rom_chip++) - // [576] if(main::rom_chip3#2<8) goto main::@38 -- vbuz1_lt_vbuc1_then_la1 - lda.z rom_chip3 - cmp #8 - bcc __b38 - // [577] phi from main::@37 to main::@39 [phi:main::@37->main::@39] - // main::@39 - // display_action_text("You have selected not to cancel the update ... ") - // [578] call display_action_text - // [1357] phi from main::@39 to display_action_text [phi:main::@39->display_action_text] - // [1357] phi display_action_text::info_text#25 = main::info_text22 [phi:main::@39->display_action_text#0] -- pbuz1=pbuc1 - lda #info_text22 - sta.z display_action_text.info_text+1 - jsr display_action_text - jmp bank_set_bram1 - // main::@38 - __b38: - // display_info_rom(rom_chip, STATUS_SKIP, "Cancelled") - // [579] display_info_rom::rom_chip#10 = main::rom_chip3#2 -- vbum1=vbuz2 - lda.z rom_chip3 - sta display_info_rom.rom_chip - // [580] call display_info_rom - // [1546] phi from main::@38 to display_info_rom [phi:main::@38->display_info_rom] - // [1546] phi display_info_rom::info_text#17 = main::info_text19 [phi:main::@38->display_info_rom#0] -- pbuz1=pbuc1 - lda #info_text19 - sta.z display_info_rom.info_text+1 - // [1546] phi display_info_rom::rom_chip#17 = display_info_rom::rom_chip#10 [phi:main::@38->display_info_rom#1] -- register_copy - // [1546] phi display_info_rom::info_status#17 = STATUS_SKIP [phi:main::@38->display_info_rom#2] -- vbum1=vbuc1 - lda #STATUS_SKIP - sta display_info_rom.info_status - jsr display_info_rom - // main::@182 - // for(unsigned char rom_chip = 0; rom_chip < 8; rom_chip++) - // [581] main::rom_chip3#1 = ++ main::rom_chip3#2 -- vbuz1=_inc_vbuz1 - inc.z rom_chip3 - // [575] phi from main::@182 to main::@37 [phi:main::@182->main::@37] - // [575] phi main::rom_chip3#2 = main::rom_chip3#1 [phi:main::@182->main::@37#0] -- register_copy - jmp __b37 - // main::@250 - __b250: - // if(check_status_smc(STATUS_FLASH) && smc_release == smc_file_release && smc_major == smc_file_major && smc_minor == smc_file_minor) - // [582] if(smc_major#399!=smc_file_major#301) 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::@249 - // [583] if(smc_minor#398==smc_file_minor#301) goto main::@8 -- vbum1_eq_vbum2_then_la1 - lda smc_minor - cmp smc_file_minor - beq __b8 - jmp check_status_smc7 - // [584] phi from main::@249 to main::@8 [phi:main::@249->main::@8] - // main::@8 - __b8: - // display_action_progress("The SMC chip and SMC.BIN versions are equal, no flash required!") - // [585] call display_action_progress - // [904] phi from main::@8 to display_action_progress [phi:main::@8->display_action_progress] - // [904] phi display_action_progress::info_text#27 = main::info_text15 [phi:main::@8->display_action_progress#0] -- pbuz1=pbuc1 - lda #info_text15 - sta.z display_action_progress.info_text+1 - jsr display_action_progress - // [586] phi from main::@8 to main::@175 [phi:main::@8->main::@175] - // main::@175 - // util_wait_space() - // [587] call util_wait_space - // [1389] phi from main::@175 to util_wait_space [phi:main::@175->util_wait_space] - jsr util_wait_space - // main::@176 - // [588] smc_bootloader#509 = smc_bootloader#0 -- vwum1=vwum2 - lda smc_bootloader - sta smc_bootloader_1 - lda smc_bootloader+1 - sta smc_bootloader_1+1 - // display_info_smc(STATUS_SKIP, "SMC.BIN and SMC equal.") - // [589] call display_info_smc - // [962] phi from main::@176 to display_info_smc [phi:main::@176->display_info_smc] - // [962] phi display_info_smc::info_text#20 = main::info_text16 [phi:main::@176->display_info_smc#0] -- pbuz1=pbuc1 - lda #info_text16 - sta.z display_info_smc.info_text+1 - // [962] phi smc_bootloader#14 = smc_bootloader#509 [phi:main::@176->display_info_smc#1] -- register_copy - // [962] phi display_info_smc::info_status#20 = STATUS_SKIP [phi:main::@176->display_info_smc#2] -- vbum1=vbuc1 - lda #STATUS_SKIP - sta display_info_smc.info_status - jsr display_info_smc - jmp check_status_smc7 - // [590] phi from main::@247 to main::@6 [phi:main::@247->main::@6] - // main::@6 - __b6: - // display_action_progress("Compatibility between ROM.BIN and SMC.BIN can't be assured!") - // [591] call display_action_progress - // [904] phi from main::@6 to display_action_progress [phi:main::@6->display_action_progress] - // [904] phi display_action_progress::info_text#27 = main::info_text13 [phi:main::@6->display_action_progress#0] -- pbuz1=pbuc1 - lda #info_text13 - sta.z display_action_progress.info_text+1 - jsr display_action_progress - // [592] phi from main::@6 to main::@169 [phi:main::@6->main::@169] - // main::@169 + // [385] phi from main::@4 to main::@75 [phi:main::@4->main::@75] + // main::@75 // display_progress_text(display_smc_unsupported_rom_text, display_smc_unsupported_rom_count) - // [593] call display_progress_text - // [1331] phi from main::@169 to display_progress_text [phi:main::@169->display_progress_text] - // [1331] phi display_progress_text::text#13 = display_smc_unsupported_rom_text [phi:main::@169->display_progress_text#0] -- qbuz1=qbuc1 + // [386] call display_progress_text + // [815] phi from main::@75 to display_progress_text [phi:main::@75->display_progress_text] + // [815] phi display_progress_text::text#11 = display_smc_unsupported_rom_text [phi:main::@75->display_progress_text#0] -- qbuz1=qbuc1 lda #display_smc_unsupported_rom_text sta.z display_progress_text.text+1 - // [1331] phi display_progress_text::lines#12 = display_smc_unsupported_rom_count [phi:main::@169->display_progress_text#1] -- vbum1=vbuc1 + // [815] phi display_progress_text::lines#10 = display_smc_unsupported_rom_count [phi:main::@75->display_progress_text#1] -- vbum1=vbuc1 lda #display_smc_unsupported_rom_count sta display_progress_text.lines jsr display_progress_text - // [594] phi from main::@169 to main::@170 [phi:main::@169->main::@170] - // main::@170 + // [387] phi from main::@75 to main::@76 [phi:main::@75->main::@76] + // main::@76 // unsigned char ch = util_wait_key("Continue with flashing anyway? [Y/N]", "YN") - // [595] call util_wait_key - // [1999] phi from main::@170 to util_wait_key [phi:main::@170->util_wait_key] - // [1999] phi util_wait_key::filter#13 = main::filter [phi:main::@170->util_wait_key#0] -- pbuz1=pbuc1 + // [388] call util_wait_key + // [1034] phi from main::@76 to util_wait_key [phi:main::@76->util_wait_key] + // [1034] phi util_wait_key::filter#13 = main::filter [phi:main::@76->util_wait_key#0] -- pbuz1=pbuc1 lda #filter sta.z util_wait_key.filter+1 - // [1999] phi util_wait_key::info_text#3 = main::info_text14 [phi:main::@170->util_wait_key#1] -- pbuz1=pbuc1 - lda #util_wait_key#1] -- pbuz1=pbuc1 + lda #info_text14 + lda #>info_text9 sta.z util_wait_key.info_text+1 jsr util_wait_key // unsigned char ch = util_wait_key("Continue with flashing anyway? [Y/N]", "YN") - // [596] util_wait_key::return#3 = util_wait_key::ch#4 -- vbum1=vwum2 + // [389] util_wait_key::return#3 = util_wait_key::ch#4 -- vbum1=vwum2 lda util_wait_key.ch sta util_wait_key.return - // main::@171 - // [597] main::ch#0 = util_wait_key::return#3 -- vbum1=vbum2 - sta ch + // main::@77 + // [390] main::ch#0 = util_wait_key::return#3 -- vbuz1=vbum2 + sta.z ch // if(ch == 'N') - // [598] if(main::ch#0!='N') goto main::check_status_smc6 -- vbum1_neq_vbuc1_then_la1 + // [391] if(main::ch#0!='N') goto main::check_status_smc5 -- vbuz1_neq_vbuc1_then_la1 lda #'N' - cmp ch - beq !check_status_smc6+ - jmp check_status_smc6 - !check_status_smc6: - // main::@7 - // [599] smc_bootloader#501 = smc_bootloader#0 -- vwum1=vwum2 - lda smc_bootloader - sta smc_bootloader_1 - lda smc_bootloader+1 - sta smc_bootloader_1+1 + cmp.z ch + beq !check_status_smc5+ + jmp check_status_smc5 + !check_status_smc5: + // [392] phi from main::@77 to main::@5 [phi:main::@77->main::@5] + // main::@5 // display_info_smc(STATUS_ISSUE, NULL) - // [600] call display_info_smc + // [393] call display_info_smc // Cancel flash - // [962] phi from main::@7 to display_info_smc [phi:main::@7->display_info_smc] - // [962] phi display_info_smc::info_text#20 = 0 [phi:main::@7->display_info_smc#0] -- pbuz1=vbuc1 + // [617] phi from main::@5 to display_info_smc [phi:main::@5->display_info_smc] + // [617] phi display_info_smc::info_text#10 = 0 [phi:main::@5->display_info_smc#0] -- pbuz1=vbuc1 lda #<0 sta.z display_info_smc.info_text sta.z display_info_smc.info_text+1 - // [962] phi smc_bootloader#14 = smc_bootloader#501 [phi:main::@7->display_info_smc#1] -- register_copy - // [962] phi display_info_smc::info_status#20 = STATUS_ISSUE [phi:main::@7->display_info_smc#2] -- vbum1=vbuc1 + // [617] phi display_info_smc::info_status#10 = STATUS_ISSUE [phi:main::@5->display_info_smc#1] -- vbum1=vbuc1 lda #STATUS_ISSUE sta display_info_smc.info_status jsr display_info_smc - // [601] phi from main::@7 to main::@172 [phi:main::@7->main::@172] - // main::@172 + // [394] phi from main::@5 to main::@78 [phi:main::@5->main::@78] + // main::@78 // display_info_cx16_rom(STATUS_ISSUE, NULL) - // [602] call display_info_cx16_rom - // [2032] phi from main::@172 to display_info_cx16_rom [phi:main::@172->display_info_cx16_rom] - // [2032] phi display_info_cx16_rom::info_text#4 = 0 [phi:main::@172->display_info_cx16_rom#0] -- pbuz1=vbuc1 + // [395] call display_info_cx16_rom + // [1112] phi from main::@78 to display_info_cx16_rom [phi:main::@78->display_info_cx16_rom] + // [1112] phi display_info_cx16_rom::info_text#4 = 0 [phi:main::@78->display_info_cx16_rom#0] -- pbuz1=vbuc1 lda #<0 sta.z display_info_cx16_rom.info_text sta.z display_info_cx16_rom.info_text+1 - // [2032] phi display_info_cx16_rom::info_status#4 = STATUS_ISSUE [phi:main::@172->display_info_cx16_rom#1] -- vbum1=vbuc1 + // [1112] phi display_info_cx16_rom::info_status#4 = STATUS_ISSUE [phi:main::@78->display_info_cx16_rom#1] -- vbum1=vbuc1 lda #STATUS_ISSUE sta display_info_cx16_rom.info_status jsr display_info_cx16_rom - jmp check_status_smc6 - // [603] phi from main::@246 to main::@5 [phi:main::@246->main::@5] - // main::@5 - __b5: + jmp check_status_smc5 + // [396] phi from main::@127 to main::@3 [phi:main::@127->main::@3] + // main::@3 + __b3: // display_action_progress("CX16 ROM update issue!") - // [604] call display_action_progress - // [904] phi from main::@5 to display_action_progress [phi:main::@5->display_action_progress] - // [904] phi display_action_progress::info_text#27 = main::info_text11 [phi:main::@5->display_action_progress#0] -- pbuz1=pbuc1 - lda #display_action_progress] + // [559] phi display_action_progress::info_text#19 = main::info_text6 [phi:main::@3->display_action_progress#0] -- pbuz1=pbuc1 + lda #info_text11 + lda #>info_text6 sta.z display_action_progress.info_text+1 jsr display_action_progress - // [605] phi from main::@5 to main::@164 [phi:main::@5->main::@164] - // main::@164 + // [398] phi from main::@3 to main::@70 [phi:main::@3->main::@70] + // main::@70 // display_progress_text(display_smc_rom_issue_text, display_smc_rom_issue_count) - // [606] call display_progress_text - // [1331] phi from main::@164 to display_progress_text [phi:main::@164->display_progress_text] - // [1331] phi display_progress_text::text#13 = display_smc_rom_issue_text [phi:main::@164->display_progress_text#0] -- qbuz1=qbuc1 + // [399] call display_progress_text + // [815] phi from main::@70 to display_progress_text [phi:main::@70->display_progress_text] + // [815] phi display_progress_text::text#11 = display_smc_rom_issue_text [phi:main::@70->display_progress_text#0] -- qbuz1=qbuc1 lda #display_smc_rom_issue_text sta.z display_progress_text.text+1 - // [1331] phi display_progress_text::lines#12 = display_smc_rom_issue_count [phi:main::@164->display_progress_text#1] -- vbum1=vbuc1 + // [815] phi display_progress_text::lines#10 = display_smc_rom_issue_count [phi:main::@70->display_progress_text#1] -- vbum1=vbuc1 lda #display_smc_rom_issue_count sta display_progress_text.lines jsr display_progress_text - // main::@165 - // [607] smc_bootloader#508 = smc_bootloader#0 -- vwum1=vwum2 - lda smc_bootloader - sta smc_bootloader_1 - lda smc_bootloader+1 - sta smc_bootloader_1+1 + // [400] phi from main::@70 to main::@71 [phi:main::@70->main::@71] + // main::@71 // display_info_smc(STATUS_SKIP, "Issue with main CX16 ROM!") - // [608] call display_info_smc - // [962] phi from main::@165 to display_info_smc [phi:main::@165->display_info_smc] - // [962] phi display_info_smc::info_text#20 = main::info_text9 [phi:main::@165->display_info_smc#0] -- pbuz1=pbuc1 - lda #display_info_smc] + // [617] phi display_info_smc::info_text#10 = main::info_text4 [phi:main::@71->display_info_smc#0] -- pbuz1=pbuc1 + lda #info_text9 + lda #>info_text4 sta.z display_info_smc.info_text+1 - // [962] phi smc_bootloader#14 = smc_bootloader#508 [phi:main::@165->display_info_smc#1] -- register_copy - // [962] phi display_info_smc::info_status#20 = STATUS_SKIP [phi:main::@165->display_info_smc#2] -- vbum1=vbuc1 + // [617] phi display_info_smc::info_status#10 = STATUS_SKIP [phi:main::@71->display_info_smc#1] -- vbum1=vbuc1 lda #STATUS_SKIP sta display_info_smc.info_status jsr display_info_smc - // [609] phi from main::@165 to main::@166 [phi:main::@165->main::@166] - // main::@166 + // [402] phi from main::@71 to main::@72 [phi:main::@71->main::@72] + // main::@72 // display_info_cx16_rom(STATUS_ISSUE, NULL) - // [610] call display_info_cx16_rom - // [2032] phi from main::@166 to display_info_cx16_rom [phi:main::@166->display_info_cx16_rom] - // [2032] phi display_info_cx16_rom::info_text#4 = 0 [phi:main::@166->display_info_cx16_rom#0] -- pbuz1=vbuc1 + // [403] call display_info_cx16_rom + // [1112] phi from main::@72 to display_info_cx16_rom [phi:main::@72->display_info_cx16_rom] + // [1112] phi display_info_cx16_rom::info_text#4 = 0 [phi:main::@72->display_info_cx16_rom#0] -- pbuz1=vbuc1 lda #<0 sta.z display_info_cx16_rom.info_text sta.z display_info_cx16_rom.info_text+1 - // [2032] phi display_info_cx16_rom::info_status#4 = STATUS_ISSUE [phi:main::@166->display_info_cx16_rom#1] -- vbum1=vbuc1 + // [1112] phi display_info_cx16_rom::info_status#4 = STATUS_ISSUE [phi:main::@72->display_info_cx16_rom#1] -- vbum1=vbuc1 lda #STATUS_ISSUE sta display_info_cx16_rom.info_status jsr display_info_cx16_rom - // [611] phi from main::@166 to main::@167 [phi:main::@166->main::@167] - // main::@167 + // [404] phi from main::@72 to main::@73 [phi:main::@72->main::@73] + // main::@73 // util_wait_space() - // [612] call util_wait_space - // [1389] phi from main::@167 to util_wait_space [phi:main::@167->util_wait_space] + // [405] call util_wait_space + // [877] phi from main::@73 to util_wait_space [phi:main::@73->util_wait_space] jsr util_wait_space - jmp check_status_smc5 - // [613] phi from main::@245 to main::@3 [phi:main::@245->main::@3] - // main::@3 - __b3: + jmp check_status_smc4 + // [406] phi from main::@126 to main::@1 [phi:main::@126->main::@1] + // main::@1 + __b1: // display_action_progress("CX16 ROM update issue, ROM not detected!") - // [614] call display_action_progress - // [904] phi from main::@3 to display_action_progress [phi:main::@3->display_action_progress] - // [904] phi display_action_progress::info_text#27 = main::info_text8 [phi:main::@3->display_action_progress#0] -- pbuz1=pbuc1 - lda #display_action_progress] + // [559] phi display_action_progress::info_text#19 = main::info_text3 [phi:main::@1->display_action_progress#0] -- pbuz1=pbuc1 + lda #info_text8 + lda #>info_text3 sta.z display_action_progress.info_text+1 jsr display_action_progress - // [615] phi from main::@3 to main::@160 [phi:main::@3->main::@160] - // main::@160 + // [408] phi from main::@1 to main::@66 [phi:main::@1->main::@66] + // main::@66 // display_progress_text(display_smc_rom_issue_text, display_smc_rom_issue_count) - // [616] call display_progress_text - // [1331] phi from main::@160 to display_progress_text [phi:main::@160->display_progress_text] - // [1331] phi display_progress_text::text#13 = display_smc_rom_issue_text [phi:main::@160->display_progress_text#0] -- qbuz1=qbuc1 + // [409] call display_progress_text + // [815] phi from main::@66 to display_progress_text [phi:main::@66->display_progress_text] + // [815] phi display_progress_text::text#11 = display_smc_rom_issue_text [phi:main::@66->display_progress_text#0] -- qbuz1=qbuc1 lda #display_smc_rom_issue_text sta.z display_progress_text.text+1 - // [1331] phi display_progress_text::lines#12 = display_smc_rom_issue_count [phi:main::@160->display_progress_text#1] -- vbum1=vbuc1 + // [815] phi display_progress_text::lines#10 = display_smc_rom_issue_count [phi:main::@66->display_progress_text#1] -- vbum1=vbuc1 lda #display_smc_rom_issue_count sta display_progress_text.lines jsr display_progress_text - // main::@161 - // [617] smc_bootloader#507 = smc_bootloader#0 -- vwum1=vwum2 - lda smc_bootloader - sta smc_bootloader_1 - lda smc_bootloader+1 - sta smc_bootloader_1+1 + // [410] phi from main::@66 to main::@67 [phi:main::@66->main::@67] + // main::@67 // display_info_smc(STATUS_SKIP, "Issue with main CX16 ROM!") - // [618] call display_info_smc - // [962] phi from main::@161 to display_info_smc [phi:main::@161->display_info_smc] - // [962] phi display_info_smc::info_text#20 = main::info_text9 [phi:main::@161->display_info_smc#0] -- pbuz1=pbuc1 - lda #display_info_smc] + // [617] phi display_info_smc::info_text#10 = main::info_text4 [phi:main::@67->display_info_smc#0] -- pbuz1=pbuc1 + lda #info_text9 + lda #>info_text4 sta.z display_info_smc.info_text+1 - // [962] phi smc_bootloader#14 = smc_bootloader#507 [phi:main::@161->display_info_smc#1] -- register_copy - // [962] phi display_info_smc::info_status#20 = STATUS_SKIP [phi:main::@161->display_info_smc#2] -- vbum1=vbuc1 + // [617] phi display_info_smc::info_status#10 = STATUS_SKIP [phi:main::@67->display_info_smc#1] -- vbum1=vbuc1 lda #STATUS_SKIP sta display_info_smc.info_status jsr display_info_smc - // [619] phi from main::@161 to main::@162 [phi:main::@161->main::@162] - // main::@162 + // [412] phi from main::@67 to main::@68 [phi:main::@67->main::@68] + // main::@68 // display_info_cx16_rom(STATUS_ISSUE, "Are J1 jumper pins closed?") - // [620] call display_info_cx16_rom - // [2032] phi from main::@162 to display_info_cx16_rom [phi:main::@162->display_info_cx16_rom] - // [2032] phi display_info_cx16_rom::info_text#4 = main::info_text10 [phi:main::@162->display_info_cx16_rom#0] -- pbuz1=pbuc1 - lda #display_info_cx16_rom] + // [1112] phi display_info_cx16_rom::info_text#4 = main::info_text5 [phi:main::@68->display_info_cx16_rom#0] -- pbuz1=pbuc1 + lda #info_text10 + lda #>info_text5 sta.z display_info_cx16_rom.info_text+1 - // [2032] phi display_info_cx16_rom::info_status#4 = STATUS_ISSUE [phi:main::@162->display_info_cx16_rom#1] -- vbum1=vbuc1 + // [1112] phi display_info_cx16_rom::info_status#4 = STATUS_ISSUE [phi:main::@68->display_info_cx16_rom#1] -- vbum1=vbuc1 lda #STATUS_ISSUE sta display_info_cx16_rom.info_status jsr display_info_cx16_rom - // [621] phi from main::@162 to main::@163 [phi:main::@162->main::@163] - // main::@163 + // [414] phi from main::@68 to main::@69 [phi:main::@68->main::@69] + // main::@69 // util_wait_space() - // [622] call util_wait_space - // [1389] phi from main::@163 to util_wait_space [phi:main::@163->util_wait_space] + // [415] call util_wait_space + // [877] phi from main::@69 to util_wait_space [phi:main::@69->util_wait_space] jsr util_wait_space - jmp check_status_smc5 - // [623] phi from main::@244 to main::@36 [phi:main::@244->main::@36] - // main::@36 - __b36: + jmp check_status_smc4 + // [416] phi from main::@125 to main::@13 [phi:main::@125->main::@13] + // main::@13 + __b13: // display_action_progress("SMC update issue!") - // [624] call display_action_progress - // [904] phi from main::@36 to display_action_progress [phi:main::@36->display_action_progress] - // [904] phi display_action_progress::info_text#27 = main::info_text6 [phi:main::@36->display_action_progress#0] -- pbuz1=pbuc1 - lda #display_action_progress] + // [559] phi display_action_progress::info_text#19 = main::info_text1 [phi:main::@13->display_action_progress#0] -- pbuz1=pbuc1 + lda #info_text6 + lda #>info_text1 sta.z display_action_progress.info_text+1 jsr display_action_progress - // [625] phi from main::@36 to main::@156 [phi:main::@36->main::@156] - // main::@156 + // [418] phi from main::@13 to main::@62 [phi:main::@13->main::@62] + // main::@62 // display_progress_text(display_smc_rom_issue_text, display_smc_rom_issue_count) - // [626] call display_progress_text - // [1331] phi from main::@156 to display_progress_text [phi:main::@156->display_progress_text] - // [1331] phi display_progress_text::text#13 = display_smc_rom_issue_text [phi:main::@156->display_progress_text#0] -- qbuz1=qbuc1 + // [419] call display_progress_text + // [815] phi from main::@62 to display_progress_text [phi:main::@62->display_progress_text] + // [815] phi display_progress_text::text#11 = display_smc_rom_issue_text [phi:main::@62->display_progress_text#0] -- qbuz1=qbuc1 lda #display_smc_rom_issue_text sta.z display_progress_text.text+1 - // [1331] phi display_progress_text::lines#12 = display_smc_rom_issue_count [phi:main::@156->display_progress_text#1] -- vbum1=vbuc1 + // [815] phi display_progress_text::lines#10 = display_smc_rom_issue_count [phi:main::@62->display_progress_text#1] -- vbum1=vbuc1 lda #display_smc_rom_issue_count sta display_progress_text.lines jsr display_progress_text - // [627] phi from main::@156 to main::@157 [phi:main::@156->main::@157] - // main::@157 + // [420] phi from main::@62 to main::@63 [phi:main::@62->main::@63] + // main::@63 // display_info_cx16_rom(STATUS_SKIP, "Issue with SMC!") - // [628] call display_info_cx16_rom - // [2032] phi from main::@157 to display_info_cx16_rom [phi:main::@157->display_info_cx16_rom] - // [2032] phi display_info_cx16_rom::info_text#4 = main::info_text7 [phi:main::@157->display_info_cx16_rom#0] -- pbuz1=pbuc1 - lda #display_info_cx16_rom] + // [1112] phi display_info_cx16_rom::info_text#4 = main::info_text2 [phi:main::@63->display_info_cx16_rom#0] -- pbuz1=pbuc1 + lda #info_text7 + lda #>info_text2 sta.z display_info_cx16_rom.info_text+1 - // [2032] phi display_info_cx16_rom::info_status#4 = STATUS_SKIP [phi:main::@157->display_info_cx16_rom#1] -- vbum1=vbuc1 + // [1112] phi display_info_cx16_rom::info_status#4 = STATUS_SKIP [phi:main::@63->display_info_cx16_rom#1] -- vbum1=vbuc1 lda #STATUS_SKIP sta display_info_cx16_rom.info_status jsr display_info_cx16_rom - // main::@158 - // [629] smc_bootloader#506 = smc_bootloader#0 -- vwum1=vwum2 - lda smc_bootloader - sta smc_bootloader_1 - lda smc_bootloader+1 - sta smc_bootloader_1+1 + // [422] phi from main::@63 to main::@64 [phi:main::@63->main::@64] + // main::@64 // display_info_smc(STATUS_ISSUE, NULL) - // [630] call display_info_smc - // [962] phi from main::@158 to display_info_smc [phi:main::@158->display_info_smc] - // [962] phi display_info_smc::info_text#20 = 0 [phi:main::@158->display_info_smc#0] -- pbuz1=vbuc1 + // [423] call display_info_smc + // [617] phi from main::@64 to display_info_smc [phi:main::@64->display_info_smc] + // [617] phi display_info_smc::info_text#10 = 0 [phi:main::@64->display_info_smc#0] -- pbuz1=vbuc1 lda #<0 sta.z display_info_smc.info_text sta.z display_info_smc.info_text+1 - // [962] phi smc_bootloader#14 = smc_bootloader#506 [phi:main::@158->display_info_smc#1] -- register_copy - // [962] phi display_info_smc::info_status#20 = STATUS_ISSUE [phi:main::@158->display_info_smc#2] -- vbum1=vbuc1 + // [617] phi display_info_smc::info_status#10 = STATUS_ISSUE [phi:main::@64->display_info_smc#1] -- vbum1=vbuc1 lda #STATUS_ISSUE sta display_info_smc.info_status jsr display_info_smc - // [631] phi from main::@158 to main::@159 [phi:main::@158->main::@159] - // main::@159 + // [424] phi from main::@64 to main::@65 [phi:main::@64->main::@65] + // main::@65 // util_wait_space() - // [632] call util_wait_space - // [1389] phi from main::@159 to util_wait_space [phi:main::@159->util_wait_space] + // [425] call util_wait_space + // [877] phi from main::@65 to util_wait_space [phi:main::@65->util_wait_space] jsr util_wait_space - jmp check_status_smc3 - // main::bank_set_brom5 - bank_set_brom5: - // BROM = bank - // [633] BROM = main::bank_set_brom5_bank#0 -- vbuz1=vbuc1 - lda #bank_set_brom5_bank - sta.z BROM - // main::@72 - // if(rom_device_ids[rom_chip] != UNKNOWN) - // [634] if(rom_device_ids[main::rom_chip2#10]==$55) goto main::@30 -- pbuc1_derefidx_vbuz1_eq_vbuc2_then_la1 - ldy.z rom_chip2 - lda rom_device_ids,y - cmp #$55 - bne !__b30+ - jmp __b30 - !__b30: - // [635] phi from main::@72 to main::@33 [phi:main::@72->main::@33] - // main::@33 - // display_progress_clear() - // [636] call display_progress_clear - // [918] phi from main::@33 to display_progress_clear [phi:main::@33->display_progress_clear] - jsr display_progress_clear - // main::@134 - // unsigned char rom_bank = rom_chip * 32 - // [637] main::rom_bank#0 = main::rom_chip2#10 << 5 -- vbum1=vbuz2_rol_5 - lda.z rom_chip2 - asl - asl - asl - asl - asl - sta rom_bank - // unsigned char* file = rom_file(rom_chip) - // [638] rom_file::rom_chip#0 = main::rom_chip2#10 -- vbum1=vbuz2 - lda.z rom_chip2 - sta rom_file.rom_chip - // [639] call rom_file - // [1591] phi from main::@134 to rom_file [phi:main::@134->rom_file] - // [1591] phi rom_file::rom_chip#2 = rom_file::rom_chip#0 [phi:main::@134->rom_file#0] -- register_copy - jsr rom_file - // unsigned char* file = rom_file(rom_chip) - // [640] rom_file::return#4 = rom_file::return#2 - // main::@135 - // [641] main::file#0 = rom_file::return#4 -- pbum1=pbuz2 - lda.z rom_file.return - sta file - lda.z rom_file.return+1 - sta file+1 - // sprintf(info_text, "Checking %s ...", file) - // [642] call snprintf_init - // [1205] phi from main::@135 to snprintf_init [phi:main::@135->snprintf_init] - // [1205] phi snprintf_init::s#31 = info_text [phi:main::@135->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 - // [643] phi from main::@135 to main::@136 [phi:main::@135->main::@136] - // main::@136 - // sprintf(info_text, "Checking %s ...", file) - // [644] call printf_str - // [1210] phi from main::@136 to printf_str [phi:main::@136->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:main::@136->printf_str#0] -- pprz1=pprc1 - lda #snputc - sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = main::s5 [phi:main::@136->printf_str#1] -- pbuz1=pbuc1 - lda #s5 - sta.z printf_str.s+1 - jsr printf_str - // main::@137 - // sprintf(info_text, "Checking %s ...", file) - // [645] printf_string::str#20 = main::file#0 -- pbuz1=pbum2 - lda file - sta.z printf_string.str - lda file+1 - sta.z printf_string.str+1 - // [646] call printf_string - // [1219] phi from main::@137 to printf_string [phi:main::@137->printf_string] - // [1219] phi printf_string::putc#26 = &snputc [phi:main::@137->printf_string#0] -- pprz1=pprc1 - lda #snputc - sta.z printf_string.putc+1 - // [1219] phi printf_string::str#26 = printf_string::str#20 [phi:main::@137->printf_string#1] -- register_copy - // [1219] phi printf_string::format_justify_left#26 = 0 [phi:main::@137->printf_string#2] -- vbum1=vbuc1 - lda #0 - sta printf_string.format_justify_left - // [1219] phi printf_string::format_min_length#26 = 0 [phi:main::@137->printf_string#3] -- vbum1=vbuc1 - sta printf_string.format_min_length - jsr printf_string - // [647] phi from main::@137 to main::@138 [phi:main::@137->main::@138] - // main::@138 - // sprintf(info_text, "Checking %s ...", file) - // [648] call printf_str - // [1210] phi from main::@138 to printf_str [phi:main::@138->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:main::@138->printf_str#0] -- pprz1=pprc1 - lda #snputc - sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = s6 [phi:main::@138->printf_str#1] -- pbuz1=pbuc1 - lda #s6 - sta.z printf_str.s+1 - jsr printf_str - // main::@139 - // sprintf(info_text, "Checking %s ...", file) - // [649] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 - lda #0 - pha - // [650] callexecute snputc -- call_vprc1 - jsr snputc - // sideeffect stackpullpadding(1) -- _stackpullpadding_1 - pla - // display_action_progress(info_text) - // [652] call display_action_progress - // [904] phi from main::@139 to display_action_progress [phi:main::@139->display_action_progress] - // [904] phi display_action_progress::info_text#27 = info_text [phi:main::@139->display_action_progress#0] -- pbuz1=pbuc1 - lda #<@info_text - sta.z display_action_progress.info_text - lda #>@info_text - sta.z display_action_progress.info_text+1 - jsr display_action_progress - // main::@140 - // unsigned long rom_bytes_read = rom_read(rom_chip, file, STATUS_CHECKING, rom_bank, rom_sizes[rom_chip]) - // [653] main::$315 = main::rom_chip2#10 << 2 -- vbum1=vbuz2_rol_2 - lda.z rom_chip2 - asl - asl - sta main__315 - // [654] rom_read::rom_chip#0 = main::rom_chip2#10 -- vbum1=vbuz2 - lda.z rom_chip2 - sta rom_read.rom_chip - // [655] rom_read::file#0 = main::file#0 -- pbuz1=pbum2 - lda file - sta.z rom_read.file - lda file+1 - sta.z rom_read.file+1 - // [656] rom_read::brom_bank_start#1 = main::rom_bank#0 -- vbum1=vbum2 - lda rom_bank - sta rom_read.brom_bank_start - // [657] rom_read::rom_size#0 = rom_sizes[main::$315] -- vdum1=pduc1_derefidx_vbum2 - ldy main__315 - lda rom_sizes,y - sta rom_read.rom_size - lda rom_sizes+1,y - sta rom_read.rom_size+1 - lda rom_sizes+2,y - sta rom_read.rom_size+2 - lda rom_sizes+3,y - sta rom_read.rom_size+3 - // [658] call rom_read - // Read the ROM(n).BIN file. - // [1597] phi from main::@140 to rom_read [phi:main::@140->rom_read] - // [1597] phi rom_read::rom_chip#20 = rom_read::rom_chip#0 [phi:main::@140->rom_read#0] -- register_copy - // [1597] phi rom_read::rom_size#12 = rom_read::rom_size#0 [phi:main::@140->rom_read#1] -- register_copy - // [1597] phi __errno#105 = __errno#115 [phi:main::@140->rom_read#2] -- register_copy - // [1597] phi __stdio_filecount#100 = __stdio_filecount#111 [phi:main::@140->rom_read#3] -- register_copy - // [1597] phi rom_read::file#10 = rom_read::file#0 [phi:main::@140->rom_read#4] -- register_copy - // [1597] phi rom_read::brom_bank_start#10 = rom_read::brom_bank_start#1 [phi:main::@140->rom_read#5] -- register_copy - // [1597] phi rom_read::info_status#11 = STATUS_CHECKING [phi:main::@140->rom_read#6] -- vbum1=vbuc1 - lda #STATUS_CHECKING - sta rom_read.info_status - jsr rom_read - // unsigned long rom_bytes_read = rom_read(rom_chip, file, STATUS_CHECKING, rom_bank, rom_sizes[rom_chip]) - // [659] rom_read::return#2 = rom_read::return#0 - // main::@141 - // [660] main::rom_bytes_read#0 = rom_read::return#2 -- vduz1=vdum2 - lda rom_read.return - sta.z rom_bytes_read - lda rom_read.return+1 - sta.z rom_bytes_read+1 - lda rom_read.return+2 - sta.z rom_bytes_read+2 - lda rom_read.return+3 - sta.z rom_bytes_read+3 - // if (!rom_bytes_read) - // [661] if(0==main::rom_bytes_read#0) goto main::@31 -- 0_eq_vduz1_then_la1 - // In case no file was found, set the status to none and skip to the next, else, mention the amount of bytes read. - lda.z rom_bytes_read - ora.z rom_bytes_read+1 - ora.z rom_bytes_read+2 - ora.z rom_bytes_read+3 - bne !__b31+ - jmp __b31 - !__b31: - // main::@34 - // unsigned long rom_file_modulo = rom_bytes_read % 0x4000 - // [662] main::rom_file_modulo#0 = main::rom_bytes_read#0 & $4000-1 -- vduz1=vduz2_band_vduc1 - lda.z rom_bytes_read - and #<$4000-1 - sta.z rom_file_modulo - lda.z rom_bytes_read+1 - and #>$4000-1 - sta.z rom_file_modulo+1 - lda.z rom_bytes_read+2 - and #<$4000-1>>$10 - sta.z rom_file_modulo+2 - lda.z rom_bytes_read+3 - and #>$4000-1>>$10 - sta.z rom_file_modulo+3 - // if(rom_file_modulo) - // [663] if(0!=main::rom_file_modulo#0) goto main::@32 -- 0_neq_vduz1_then_la1 - lda.z rom_file_modulo - ora.z rom_file_modulo+1 - ora.z rom_file_modulo+2 - ora.z rom_file_modulo+3 - beq !__b32+ - jmp __b32 - !__b32: - // main::@35 - // file_sizes[rom_chip] = rom_bytes_read - // [664] file_sizes[main::$315] = 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__315 - lda.z rom_bytes_read - sta file_sizes,y - lda.z rom_bytes_read+1 - sta file_sizes+1,y - lda.z rom_bytes_read+2 - sta file_sizes+2,y - lda.z rom_bytes_read+3 - sta file_sizes+3,y - // 8*rom_chip - // [665] main::$140 = main::rom_chip2#10 << 3 -- vbuz1=vbuz2_rol_3 - lda.z rom_chip2 + jmp check_status_smc2 + // main::@11 + __b11: + // rom_chip*13 + // [426] main::$231 = main::rom_chip#2 << 1 -- vbuz1=vbuz2_rol_1 + lda.z rom_chip asl + sta.z main__231 + // [427] main::$232 = main::$231 + main::rom_chip#2 -- vbuz1=vbuz1_plus_vbuz2 + lda.z main__232 + clc + adc.z rom_chip + sta.z main__232 + // [428] main::$233 = main::$232 << 2 -- vbuz1=vbuz1_rol_2 + lda.z main__233 asl asl - sta.z main__140 - // unsigned char* rom_file_github_id = &rom_file_github[8*rom_chip] - // [666] main::rom_file_github_id#0 = rom_file_github + main::$140 -- pbuz1=pbuc1_plus_vbuz2 - // Fill the version data ... + sta.z main__233 + // [429] main::$72 = main::$233 + main::rom_chip#2 -- vbuz1=vbuz1_plus_vbuz2 + lda.z main__72 + clc + adc.z rom_chip + sta.z main__72 + // strcpy(&rom_release_text[rom_chip*13], " " ) + // [430] strcpy::destination#1 = rom_release_text + main::$72 -- pbuz1=pbuc1_plus_vbuz2 clc - adc #rom_file_github + adc #rom_release_text adc #0 - sta.z rom_file_github_id+1 - // unsigned char rom_file_release_id = rom_get_release(rom_file_release[rom_chip]) - // [667] rom_get_release::release#2 = rom_file_release[main::rom_chip2#10] -- vbum1=pbuc1_derefidx_vbuz2 - ldy.z rom_chip2 - lda rom_file_release,y - sta rom_get_release.release - // [668] call rom_get_release - // [2037] phi from main::@35 to rom_get_release [phi:main::@35->rom_get_release] - // [2037] phi rom_get_release::release#3 = rom_get_release::release#2 [phi:main::@35->rom_get_release#0] -- register_copy - jsr rom_get_release - // unsigned char rom_file_release_id = rom_get_release(rom_file_release[rom_chip]) - // [669] rom_get_release::return#3 = rom_get_release::return#0 - // main::@149 - // [670] main::rom_file_release_id#0 = rom_get_release::return#3 -- vbum1=vbum2 - lda rom_get_release.return - sta rom_file_release_id - // unsigned char rom_file_prefix_id = rom_get_prefix(rom_file_release[rom_chip]) - // [671] rom_get_prefix::release#1 = rom_file_release[main::rom_chip2#10] -- vbum1=pbuc1_derefidx_vbuz2 - ldy.z rom_chip2 - lda rom_file_release,y - sta rom_get_prefix.release - // [672] call rom_get_prefix - // [2044] phi from main::@149 to rom_get_prefix [phi:main::@149->rom_get_prefix] - // [2044] phi rom_get_prefix::release#2 = rom_get_prefix::release#1 [phi:main::@149->rom_get_prefix#0] -- register_copy - jsr rom_get_prefix - // unsigned char rom_file_prefix_id = rom_get_prefix(rom_file_release[rom_chip]) - // [673] rom_get_prefix::return#3 = rom_get_prefix::return#0 - // main::@150 - // [674] main::rom_file_prefix_id#0 = rom_get_prefix::return#3 -- vbuz1=vbum2 - lda rom_get_prefix.return - sta.z rom_file_prefix_id - // rom_get_version_text(rom_file_release_text, rom_file_prefix_id, rom_file_release_id, rom_file_github_id) - // [675] rom_get_version_text::prefix#1 = main::rom_file_prefix_id#0 -- vbum1=vbuz2 - sta rom_get_version_text.prefix - // [676] rom_get_version_text::release#1 = main::rom_file_release_id#0 -- vbum1=vbum2 - lda rom_file_release_id - sta rom_get_version_text.release - // [677] rom_get_version_text::github#1 = main::rom_file_github_id#0 - // [678] call rom_get_version_text - // [2053] phi from main::@150 to rom_get_version_text [phi:main::@150->rom_get_version_text] - // [2053] phi rom_get_version_text::github#2 = rom_get_version_text::github#1 [phi:main::@150->rom_get_version_text#0] -- register_copy - // [2053] phi rom_get_version_text::release#2 = rom_get_version_text::release#1 [phi:main::@150->rom_get_version_text#1] -- register_copy - // [2053] phi rom_get_version_text::prefix#2 = rom_get_version_text::prefix#1 [phi:main::@150->rom_get_version_text#2] -- register_copy - // [2053] phi rom_get_version_text::release_info#2 = main::rom_file_release_text [phi:main::@150->rom_get_version_text#3] -- pbuz1=pbuc1 - lda #rom_file_release_text - sta.z rom_get_version_text.release_info+1 - jsr rom_get_version_text - // [679] phi from main::@150 to main::@151 [phi:main::@150->main::@151] - // main::@151 - // sprintf(info_text, "%s:%s", file, rom_file_release_text) - // [680] call snprintf_init - // [1205] phi from main::@151 to snprintf_init [phi:main::@151->snprintf_init] - // [1205] phi snprintf_init::s#31 = info_text [phi:main::@151->snprintf_init#0] -- pbuz1=pbuc1 - lda #<@info_text - sta.z snprintf_init.s - lda #>@info_text - sta.z snprintf_init.s+1 - jsr snprintf_init - // main::@152 - // sprintf(info_text, "%s:%s", file, rom_file_release_text) - // [681] printf_string::str#23 = main::file#0 -- pbuz1=pbum2 - lda file - sta.z printf_string.str - lda file+1 - sta.z printf_string.str+1 - // [682] call printf_string - // [1219] phi from main::@152 to printf_string [phi:main::@152->printf_string] - // [1219] phi printf_string::putc#26 = &snputc [phi:main::@152->printf_string#0] -- pprz1=pprc1 - lda #snputc - sta.z printf_string.putc+1 - // [1219] phi printf_string::str#26 = printf_string::str#23 [phi:main::@152->printf_string#1] -- register_copy - // [1219] phi printf_string::format_justify_left#26 = 0 [phi:main::@152->printf_string#2] -- vbum1=vbuc1 - lda #0 - sta printf_string.format_justify_left - // [1219] phi printf_string::format_min_length#26 = 0 [phi:main::@152->printf_string#3] -- vbum1=vbuc1 - sta printf_string.format_min_length - jsr printf_string - // [683] phi from main::@152 to main::@153 [phi:main::@152->main::@153] - // main::@153 - // sprintf(info_text, "%s:%s", file, rom_file_release_text) - // [684] call printf_str - // [1210] phi from main::@153 to printf_str [phi:main::@153->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:main::@153->printf_str#0] -- pprz1=pprc1 - lda #snputc - sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = s2 [phi:main::@153->printf_str#1] -- pbuz1=pbuc1 - lda #<@s2 - sta.z printf_str.s - lda #>@s2 - sta.z printf_str.s+1 - jsr printf_str - // [685] phi from main::@153 to main::@154 [phi:main::@153->main::@154] - // main::@154 - // sprintf(info_text, "%s:%s", file, rom_file_release_text) - // [686] call printf_string - // [1219] phi from main::@154 to printf_string [phi:main::@154->printf_string] - // [1219] phi printf_string::putc#26 = &snputc [phi:main::@154->printf_string#0] -- pprz1=pprc1 - lda #snputc - sta.z printf_string.putc+1 - // [1219] phi printf_string::str#26 = main::rom_file_release_text [phi:main::@154->printf_string#1] -- pbuz1=pbuc1 - lda #rom_file_release_text - sta.z printf_string.str+1 - // [1219] phi printf_string::format_justify_left#26 = 0 [phi:main::@154->printf_string#2] -- vbum1=vbuc1 - lda #0 - sta printf_string.format_justify_left - // [1219] phi printf_string::format_min_length#26 = 0 [phi:main::@154->printf_string#3] -- vbum1=vbuc1 - sta printf_string.format_min_length - jsr printf_string - // main::@155 - // sprintf(info_text, "%s:%s", file, rom_file_release_text) - // [687] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 - lda #0 - pha - // [688] callexecute snputc -- call_vprc1 - jsr snputc - // sideeffect stackpullpadding(1) -- _stackpullpadding_1 - pla - // display_info_rom(rom_chip, STATUS_FLASH, info_text) - // [690] display_info_rom::rom_chip#9 = main::rom_chip2#10 -- vbum1=vbuz2 - lda.z rom_chip2 - sta display_info_rom.rom_chip - // [691] call display_info_rom - // [1546] phi from main::@155 to display_info_rom [phi:main::@155->display_info_rom] - // [1546] phi display_info_rom::info_text#17 = info_text [phi:main::@155->display_info_rom#0] -- pbuz1=pbuc1 - lda #<@info_text - sta.z display_info_rom.info_text - lda #>@info_text - sta.z display_info_rom.info_text+1 - // [1546] phi display_info_rom::rom_chip#17 = display_info_rom::rom_chip#9 [phi:main::@155->display_info_rom#1] -- register_copy - // [1546] phi display_info_rom::info_status#17 = STATUS_FLASH [phi:main::@155->display_info_rom#2] -- vbum1=vbuc1 - lda #STATUS_FLASH - sta display_info_rom.info_status - jsr display_info_rom - // [692] phi from main::@144 main::@148 main::@155 main::@72 to main::@30 [phi:main::@144/main::@148/main::@155/main::@72->main::@30] - // [692] phi __stdio_filecount#404 = __stdio_filecount#12 [phi:main::@144/main::@148/main::@155/main::@72->main::@30#0] -- register_copy - // [692] phi __errno#389 = __errno#123 [phi:main::@144/main::@148/main::@155/main::@72->main::@30#1] -- register_copy - // main::@30 - __b30: - // for(unsigned char rom_chip = 0; rom_chip < 8; rom_chip++) - // [693] main::rom_chip2#1 = ++ main::rom_chip2#10 -- vbuz1=_inc_vbuz1 - inc.z rom_chip2 - // [180] phi from main::@30 to main::@29 [phi:main::@30->main::@29] - // [180] phi __stdio_filecount#111 = __stdio_filecount#404 [phi:main::@30->main::@29#0] -- register_copy - // [180] phi __errno#115 = __errno#389 [phi:main::@30->main::@29#1] -- register_copy - // [180] phi main::rom_chip2#10 = main::rom_chip2#1 [phi:main::@30->main::@29#2] -- register_copy - jmp __b29 - // [694] phi from main::@34 to main::@32 [phi:main::@34->main::@32] - // main::@32 - __b32: - // sprintf(info_text, "File %s size error!", file) - // [695] call snprintf_init - // [1205] phi from main::@32 to snprintf_init [phi:main::@32->snprintf_init] - // [1205] phi snprintf_init::s#31 = 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 - // [696] phi from main::@32 to main::@145 [phi:main::@32->main::@145] - // main::@145 - // sprintf(info_text, "File %s size error!", file) - // [697] call printf_str - // [1210] phi from main::@145 to printf_str [phi:main::@145->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:main::@145->printf_str#0] -- pprz1=pprc1 - lda #snputc - sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = main::s8 [phi:main::@145->printf_str#1] -- pbuz1=pbuc1 - lda #s8 - sta.z printf_str.s+1 - jsr printf_str - // main::@146 - // sprintf(info_text, "File %s size error!", file) - // [698] printf_string::str#22 = main::file#0 -- pbuz1=pbum2 - lda file - sta.z printf_string.str - lda file+1 - sta.z printf_string.str+1 - // [699] call printf_string - // [1219] phi from main::@146 to printf_string [phi:main::@146->printf_string] - // [1219] phi printf_string::putc#26 = &snputc [phi:main::@146->printf_string#0] -- pprz1=pprc1 - lda #snputc - sta.z printf_string.putc+1 - // [1219] phi printf_string::str#26 = printf_string::str#22 [phi:main::@146->printf_string#1] -- register_copy - // [1219] phi printf_string::format_justify_left#26 = 0 [phi:main::@146->printf_string#2] -- vbum1=vbuc1 - lda #0 - sta printf_string.format_justify_left - // [1219] phi printf_string::format_min_length#26 = 0 [phi:main::@146->printf_string#3] -- vbum1=vbuc1 - sta printf_string.format_min_length - jsr printf_string - // [700] phi from main::@146 to main::@147 [phi:main::@146->main::@147] - // main::@147 - // sprintf(info_text, "File %s size error!", file) - // [701] call printf_str - // [1210] phi from main::@147 to printf_str [phi:main::@147->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:main::@147->printf_str#0] -- pprz1=pprc1 - lda #snputc - sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = main::s9 [phi:main::@147->printf_str#1] -- pbuz1=pbuc1 - lda #s9 - sta.z printf_str.s+1 - jsr printf_str - // main::@148 - // sprintf(info_text, "File %s size error!", file) - // [702] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 - lda #0 - pha - // [703] callexecute snputc -- call_vprc1 - jsr snputc - // sideeffect stackpullpadding(1) -- _stackpullpadding_1 - pla - // display_info_rom(rom_chip, STATUS_ISSUE, info_text) - // [705] display_info_rom::rom_chip#8 = main::rom_chip2#10 -- vbum1=vbuz2 - lda.z rom_chip2 - sta display_info_rom.rom_chip - // [706] call display_info_rom - // [1546] phi from main::@148 to display_info_rom [phi:main::@148->display_info_rom] - // [1546] phi display_info_rom::info_text#17 = info_text [phi:main::@148->display_info_rom#0] -- pbuz1=pbuc1 - lda #<@info_text - sta.z display_info_rom.info_text - lda #>@info_text - sta.z display_info_rom.info_text+1 - // [1546] phi display_info_rom::rom_chip#17 = display_info_rom::rom_chip#8 [phi:main::@148->display_info_rom#1] -- register_copy - // [1546] phi display_info_rom::info_status#17 = STATUS_ISSUE [phi:main::@148->display_info_rom#2] -- vbum1=vbuc1 - lda #STATUS_ISSUE - sta display_info_rom.info_status - jsr display_info_rom - jmp __b30 - // [707] phi from main::@141 to main::@31 [phi:main::@141->main::@31] - // main::@31 - __b31: - // sprintf(info_text, "No %s", file) - // [708] call snprintf_init - // [1205] phi from main::@31 to snprintf_init [phi:main::@31->snprintf_init] - // [1205] phi snprintf_init::s#31 = info_text [phi:main::@31->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 - // [709] phi from main::@31 to main::@142 [phi:main::@31->main::@142] - // main::@142 - // sprintf(info_text, "No %s", file) - // [710] call printf_str - // [1210] phi from main::@142 to printf_str [phi:main::@142->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:main::@142->printf_str#0] -- pprz1=pprc1 - lda #snputc - sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = main::s7 [phi:main::@142->printf_str#1] -- pbuz1=pbuc1 - lda #s7 - sta.z printf_str.s+1 - jsr printf_str - // main::@143 - // sprintf(info_text, "No %s", file) - // [711] printf_string::str#21 = main::file#0 -- pbuz1=pbum2 - lda file - sta.z printf_string.str - lda file+1 - sta.z printf_string.str+1 - // [712] call printf_string - // [1219] phi from main::@143 to printf_string [phi:main::@143->printf_string] - // [1219] phi printf_string::putc#26 = &snputc [phi:main::@143->printf_string#0] -- pprz1=pprc1 - lda #snputc - sta.z printf_string.putc+1 - // [1219] phi printf_string::str#26 = printf_string::str#21 [phi:main::@143->printf_string#1] -- register_copy - // [1219] phi printf_string::format_justify_left#26 = 0 [phi:main::@143->printf_string#2] -- vbum1=vbuc1 - lda #0 - sta printf_string.format_justify_left - // [1219] phi printf_string::format_min_length#26 = 0 [phi:main::@143->printf_string#3] -- vbum1=vbuc1 - sta printf_string.format_min_length - jsr printf_string - // main::@144 - // sprintf(info_text, "No %s", file) - // [713] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 - lda #0 - pha - // [714] callexecute snputc -- call_vprc1 - jsr snputc - // sideeffect stackpullpadding(1) -- _stackpullpadding_1 - pla - // display_info_rom(rom_chip, STATUS_SKIP, info_text) - // [716] display_info_rom::rom_chip#7 = main::rom_chip2#10 -- vbum1=vbuz2 - lda.z rom_chip2 + sta.z strcpy.destination+1 + // [431] call strcpy + // [1117] phi from main::@11 to strcpy [phi:main::@11->strcpy] + // [1117] phi strcpy::dst#0 = strcpy::destination#1 [phi:main::@11->strcpy#0] -- register_copy + // [1117] phi strcpy::src#0 = main::source [phi:main::@11->strcpy#1] -- pbuz1=pbuc1 + lda #source + sta.z strcpy.src+1 + jsr strcpy + // main::@58 + // display_info_rom(rom_chip, STATUS_NONE, NULL) + // [432] display_info_rom::rom_chip#2 = main::rom_chip#2 -- vbum1=vbuz2 + lda.z rom_chip sta display_info_rom.rom_chip - // [717] call display_info_rom - // [1546] phi from main::@144 to display_info_rom [phi:main::@144->display_info_rom] - // [1546] phi display_info_rom::info_text#17 = info_text [phi:main::@144->display_info_rom#0] -- pbuz1=pbuc1 - lda #<@info_text + // [433] call display_info_rom + // [1067] phi from main::@58 to display_info_rom [phi:main::@58->display_info_rom] + // [1067] phi display_info_rom::info_text#10 = 0 [phi:main::@58->display_info_rom#0] -- pbuz1=vbuc1 + lda #<0 sta.z display_info_rom.info_text - lda #>@info_text sta.z display_info_rom.info_text+1 - // [1546] phi display_info_rom::rom_chip#17 = display_info_rom::rom_chip#7 [phi:main::@144->display_info_rom#1] -- register_copy - // [1546] phi display_info_rom::info_status#17 = STATUS_SKIP [phi:main::@144->display_info_rom#2] -- vbum1=vbuc1 - lda #STATUS_SKIP + // [1067] phi display_info_rom::rom_chip#10 = display_info_rom::rom_chip#2 [phi:main::@58->display_info_rom#1] -- register_copy + // [1067] phi display_info_rom::info_status#10 = STATUS_NONE [phi:main::@58->display_info_rom#2] -- vbum1=vbuc1 + lda #STATUS_NONE sta display_info_rom.info_status jsr display_info_rom - jmp __b30 - // main::@28 - __b28: - // [718] smc_bootloader#513 = smc_bootloader#0 -- vwum1=vwum2 - lda smc_bootloader - sta smc_bootloader_1 - lda smc_bootloader+1 - sta smc_bootloader_1+1 - // display_info_smc(STATUS_ISSUE, "SMC.BIN too large!") - // [719] 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 - // [962] phi from main::@28 to display_info_smc [phi:main::@28->display_info_smc] - // [962] phi display_info_smc::info_text#20 = main::info_text5 [phi:main::@28->display_info_smc#0] -- pbuz1=pbuc1 - lda #info_text5 - sta.z display_info_smc.info_text+1 - // [962] phi smc_bootloader#14 = smc_bootloader#513 [phi:main::@28->display_info_smc#1] -- register_copy - // [962] phi display_info_smc::info_status#20 = STATUS_ISSUE [phi:main::@28->display_info_smc#2] -- vbum1=vbuc1 - lda #STATUS_ISSUE - sta display_info_smc.info_status - jsr display_info_smc - // [169] phi from main::@27 main::@28 to main::CLI2 [phi:main::@27/main::@28->main::CLI2] - __b11: - // [169] phi smc_file_minor#301 = 0 [phi:main::@27/main::@28->main::CLI2#0] -- vbum1=vbuc1 - lda #0 - sta smc_file_minor - // [169] phi smc_file_major#301 = 0 [phi:main::@27/main::@28->main::CLI2#1] -- vbum1=vbuc1 - sta smc_file_major - // [169] phi smc_file_release#301 = 0 [phi:main::@27/main::@28->main::CLI2#2] -- vbum1=vbuc1 - sta smc_file_release - // [169] phi __stdio_filecount#109 = __stdio_filecount#39 [phi:main::@27/main::@28->main::CLI2#3] -- register_copy - // [169] phi __errno#113 = __errno#123 [phi:main::@27/main::@28->main::CLI2#4] -- register_copy - jmp CLI2 - // main::@27 - __b27: - // [720] smc_bootloader#512 = smc_bootloader#0 -- vwum1=vwum2 - lda smc_bootloader - sta smc_bootloader_1 - lda smc_bootloader+1 - sta smc_bootloader_1+1 - // display_info_smc(STATUS_SKIP, "No SMC.BIN!") - // [721] 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 - // [962] phi from main::@27 to display_info_smc [phi:main::@27->display_info_smc] - // [962] phi display_info_smc::info_text#20 = main::info_text4 [phi:main::@27->display_info_smc#0] -- pbuz1=pbuc1 - lda #info_text4 - sta.z display_info_smc.info_text+1 - // [962] phi smc_bootloader#14 = smc_bootloader#512 [phi:main::@27->display_info_smc#1] -- register_copy - // [962] phi display_info_smc::info_status#20 = STATUS_SKIP [phi:main::@27->display_info_smc#2] -- vbum1=vbuc1 - lda #STATUS_SKIP - sta display_info_smc.info_status - jsr display_info_smc - jmp __b11 - // main::@21 - __b21: - // if(rom_device_ids[rom_chip] != UNKNOWN) - // [722] if(rom_device_ids[main::rom_chip1#10]!=$55) goto main::@22 -- pbuc1_derefidx_vbuz1_neq_vbuc2_then_la1 - lda #$55 - ldy.z rom_chip1 - cmp rom_device_ids,y - bne __b22 - // main::@23 - __b23: - // for(unsigned char rom_chip = 0; rom_chip < 8; rom_chip++) - // [723] main::rom_chip1#1 = ++ main::rom_chip1#10 -- vbuz1=_inc_vbuz1 - inc.z rom_chip1 - // [136] phi from main::@23 to main::@20 [phi:main::@23->main::@20] - // [136] phi main::rom_chip1#10 = main::rom_chip1#1 [phi:main::@23->main::@20#0] -- register_copy - jmp __b20 - // main::@22 - __b22: - // bank_set_brom(rom_chip*32) - // [724] main::bank_set_brom2_bank#0 = main::rom_chip1#10 << 5 -- vbum1=vbuz2_rol_5 - lda.z rom_chip1 - asl - asl - asl - asl - asl - sta bank_set_brom2_bank - // main::bank_set_brom2 - // BROM = bank - // [725] BROM = main::bank_set_brom2_bank#0 -- vbuz1=vbum2 - sta.z BROM - // main::@70 - // rom_chip*8 - // [726] main::$115 = main::rom_chip1#10 << 3 -- vbum1=vbuz2_rol_3 - lda.z rom_chip1 - asl - asl - asl - sta main__115 - // rom_get_github_commit_id(&rom_github[rom_chip*8], (char*)0xC000) - // [727] rom_get_github_commit_id::commit_id#1 = rom_github + main::$115 -- pbuz1=pbuc1_plus_vbum2 - clc - adc #rom_github - adc #0 - sta.z rom_get_github_commit_id.commit_id+1 - // [728] call rom_get_github_commit_id - // [2069] phi from main::@70 to rom_get_github_commit_id [phi:main::@70->rom_get_github_commit_id] - // [2069] phi rom_get_github_commit_id::commit_id#6 = rom_get_github_commit_id::commit_id#1 [phi:main::@70->rom_get_github_commit_id#0] -- register_copy - // [2069] 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::@123 - // rom_get_release(*((char*)0xFF80)) - // [729] rom_get_release::release#1 = *((char *) 65408) -- vbum1=_deref_pbuc1 - lda $ff80 - sta rom_get_release.release - // [730] call rom_get_release - // [2037] phi from main::@123 to rom_get_release [phi:main::@123->rom_get_release] - // [2037] phi rom_get_release::release#3 = rom_get_release::release#1 [phi:main::@123->rom_get_release#0] -- register_copy - jsr rom_get_release - // rom_get_release(*((char*)0xFF80)) - // [731] rom_get_release::return#2 = rom_get_release::return#0 - // main::@124 - // [732] main::$111 = rom_get_release::return#2 -- vbuz1=vbum2 - lda rom_get_release.return - sta.z main__111 - // rom_release[rom_chip] = rom_get_release(*((char*)0xFF80)) - // [733] rom_release[main::rom_chip1#10] = main::$111 -- pbuc1_derefidx_vbuz1=vbuz2 - ldy.z rom_chip1 - sta rom_release,y - // rom_get_prefix(*((char*)0xFF80)) - // [734] rom_get_prefix::release#0 = *((char *) 65408) -- vbum1=_deref_pbuc1 - lda $ff80 - sta rom_get_prefix.release - // [735] call rom_get_prefix - // [2044] phi from main::@124 to rom_get_prefix [phi:main::@124->rom_get_prefix] - // [2044] phi rom_get_prefix::release#2 = rom_get_prefix::release#0 [phi:main::@124->rom_get_prefix#0] -- register_copy - jsr rom_get_prefix - // rom_get_prefix(*((char*)0xFF80)) - // [736] rom_get_prefix::return#2 = rom_get_prefix::return#0 - // main::@125 - // [737] main::$112 = rom_get_prefix::return#2 -- vbuz1=vbum2 - lda rom_get_prefix.return - sta.z main__112 - // rom_prefix[rom_chip] = rom_get_prefix(*((char*)0xFF80)) - // [738] rom_prefix[main::rom_chip1#10] = main::$112 -- pbuc1_derefidx_vbuz1=vbuz2 - ldy.z rom_chip1 - sta rom_prefix,y - // rom_chip*13 - // [739] main::$375 = main::rom_chip1#10 << 1 -- vbuz1=vbuz2_rol_1 - tya - asl - sta.z main__375 - // [740] main::$376 = main::$375 + main::rom_chip1#10 -- vbuz1=vbuz1_plus_vbuz2 - lda.z main__376 - clc - adc.z rom_chip1 - sta.z main__376 - // [741] main::$377 = main::$376 << 2 -- vbuz1=vbuz1_rol_2 - lda.z main__377 - asl - asl - sta.z main__377 - // [742] main::$113 = main::$377 + main::rom_chip1#10 -- vbuz1=vbuz1_plus_vbuz2 - lda.z main__113 - clc - adc.z rom_chip1 - sta.z main__113 - // rom_get_version_text(&rom_release_text[rom_chip*13], rom_prefix[rom_chip], rom_release[rom_chip], &rom_github[rom_chip*8]) - // [743] rom_get_version_text::release_info#0 = rom_release_text + main::$113 -- pbuz1=pbuc1_plus_vbuz2 - clc - adc #rom_release_text - adc #0 - sta.z rom_get_version_text.release_info+1 - // [744] rom_get_version_text::github#0 = rom_github + main::$115 -- pbuz1=pbuc1_plus_vbum2 - lda main__115 - clc - adc #rom_github - adc #0 - sta.z rom_get_version_text.github+1 - // [745] rom_get_version_text::prefix#0 = rom_prefix[main::rom_chip1#10] -- vbum1=pbuc1_derefidx_vbuz2 - lda rom_prefix,y - sta rom_get_version_text.prefix - // [746] rom_get_version_text::release#0 = rom_release[main::rom_chip1#10] -- vbum1=pbuc1_derefidx_vbuz2 - lda rom_release,y - sta rom_get_version_text.release - // [747] call rom_get_version_text - // [2053] phi from main::@125 to rom_get_version_text [phi:main::@125->rom_get_version_text] - // [2053] phi rom_get_version_text::github#2 = rom_get_version_text::github#0 [phi:main::@125->rom_get_version_text#0] -- register_copy - // [2053] phi rom_get_version_text::release#2 = rom_get_version_text::release#0 [phi:main::@125->rom_get_version_text#1] -- register_copy - // [2053] phi rom_get_version_text::prefix#2 = rom_get_version_text::prefix#0 [phi:main::@125->rom_get_version_text#2] -- register_copy - // [2053] phi rom_get_version_text::release_info#2 = rom_get_version_text::release_info#0 [phi:main::@125->rom_get_version_text#3] -- register_copy - jsr rom_get_version_text - // main::@126 - // display_info_rom(rom_chip, STATUS_DETECTED, NULL) - // [748] display_info_rom::rom_chip#6 = main::rom_chip1#10 -- vbum1=vbuz2 - lda.z rom_chip1 - sta display_info_rom.rom_chip - // [749] call display_info_rom - // [1546] phi from main::@126 to display_info_rom [phi:main::@126->display_info_rom] - // [1546] phi display_info_rom::info_text#17 = 0 [phi:main::@126->display_info_rom#0] -- pbuz1=vbuc1 - lda #<0 - sta.z display_info_rom.info_text - sta.z display_info_rom.info_text+1 - // [1546] phi display_info_rom::rom_chip#17 = display_info_rom::rom_chip#6 [phi:main::@126->display_info_rom#1] -- register_copy - // [1546] phi display_info_rom::info_status#17 = STATUS_DETECTED [phi:main::@126->display_info_rom#2] -- vbum1=vbuc1 - lda #STATUS_DETECTED - sta display_info_rom.info_status - jsr display_info_rom - jmp __b23 - // [750] phi from main::@16 to main::@19 [phi:main::@16->main::@19] - // main::@19 - __b19: - // sprintf(info_text, "Bootloader v%02x invalid! !", smc_bootloader) - // [751] call snprintf_init - // [1205] phi from main::@19 to snprintf_init [phi:main::@19->snprintf_init] - // [1205] phi snprintf_init::s#31 = info_text [phi:main::@19->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 - // [752] phi from main::@19 to main::@113 [phi:main::@19->main::@113] - // main::@113 - // sprintf(info_text, "Bootloader v%02x invalid! !", smc_bootloader) - // [753] call printf_str - // [1210] phi from main::@113 to printf_str [phi:main::@113->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:main::@113->printf_str#0] -- pprz1=pprc1 - lda #snputc - sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = main::s2 [phi:main::@113->printf_str#1] -- pbuz1=pbuc1 - lda #s2 - sta.z printf_str.s+1 - jsr printf_str - // main::@114 - // sprintf(info_text, "Bootloader v%02x invalid! !", smc_bootloader) - // [754] printf_uint::uvalue#7 = smc_bootloader#0 -- vwum1=vwum2 - lda smc_bootloader - sta printf_uint.uvalue - lda smc_bootloader+1 - sta printf_uint.uvalue+1 - // [755] call printf_uint - // [2086] phi from main::@114 to printf_uint [phi:main::@114->printf_uint] - // [2086] phi printf_uint::format_zero_padding#10 = 1 [phi:main::@114->printf_uint#0] -- vbum1=vbuc1 - lda #1 - sta printf_uint.format_zero_padding - // [2086] phi printf_uint::format_min_length#10 = 2 [phi:main::@114->printf_uint#1] -- vbum1=vbuc1 - lda #2 - sta printf_uint.format_min_length - // [2086] phi printf_uint::putc#10 = &snputc [phi:main::@114->printf_uint#2] -- pprz1=pprc1 - lda #snputc - sta.z printf_uint.putc+1 - // [2086] phi printf_uint::format_radix#10 = HEXADECIMAL [phi:main::@114->printf_uint#3] -- vbum1=vbuc1 - lda #HEXADECIMAL - sta printf_uint.format_radix - // [2086] phi printf_uint::uvalue#10 = printf_uint::uvalue#7 [phi:main::@114->printf_uint#4] -- register_copy - jsr printf_uint - // [756] phi from main::@114 to main::@115 [phi:main::@114->main::@115] - // main::@115 - // sprintf(info_text, "Bootloader v%02x invalid! !", smc_bootloader) - // [757] call printf_str - // [1210] phi from main::@115 to printf_str [phi:main::@115->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:main::@115->printf_str#0] -- pprz1=pprc1 - lda #snputc - sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = main::s3 [phi:main::@115->printf_str#1] -- pbuz1=pbuc1 - lda #s3 - sta.z printf_str.s+1 - jsr printf_str - // main::@116 - // sprintf(info_text, "Bootloader v%02x invalid! !", smc_bootloader) - // [758] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 - lda #0 - pha - // [759] callexecute snputc -- call_vprc1 - jsr snputc - // sideeffect stackpullpadding(1) -- _stackpullpadding_1 - pla - // [761] smc_bootloader#502 = 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) - // [762] call display_info_smc - // [962] phi from main::@116 to display_info_smc [phi:main::@116->display_info_smc] - // [962] phi display_info_smc::info_text#20 = info_text [phi:main::@116->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 - // [962] phi smc_bootloader#14 = smc_bootloader#502 [phi:main::@116->display_info_smc#1] -- register_copy - // [962] phi display_info_smc::info_status#20 = STATUS_ISSUE [phi:main::@116->display_info_smc#2] -- vbum1=vbuc1 - lda #STATUS_ISSUE - sta display_info_smc.info_status - jsr display_info_smc - // [763] phi from main::@116 to main::@117 [phi:main::@116->main::@117] - // main::@117 - // display_progress_text(display_no_valid_smc_bootloader_text, display_no_valid_smc_bootloader_count) - // [764] call display_progress_text - // Bootloader is not supported by this utility, but is not error. - // [1331] phi from main::@117 to display_progress_text [phi:main::@117->display_progress_text] - // [1331] phi display_progress_text::text#13 = display_no_valid_smc_bootloader_text [phi:main::@117->display_progress_text#0] -- qbuz1=qbuc1 - lda #display_no_valid_smc_bootloader_text - sta.z display_progress_text.text+1 - // [1331] phi display_progress_text::lines#12 = display_no_valid_smc_bootloader_count [phi:main::@117->display_progress_text#1] -- vbum1=vbuc1 - lda #display_no_valid_smc_bootloader_count - sta display_progress_text.lines - jsr display_progress_text - // [129] phi from main::@112 main::@117 main::@18 to main::@2 [phi:main::@112/main::@117/main::@18->main::@2] - __b14: - // [129] phi smc_minor#398 = 0 [phi:main::@112/main::@117/main::@18->main::@2#0] -- vbum1=vbuc1 - lda #0 - sta smc_minor - // [129] phi smc_major#399 = 0 [phi:main::@112/main::@117/main::@18->main::@2#1] -- vbum1=vbuc1 - sta smc_major - // [129] phi smc_release#400 = 0 [phi:main::@112/main::@117/main::@18->main::@2#2] -- vbum1=vbuc1 - sta smc_release - jmp __b2 - // main::@18 - __b18: - // [765] smc_bootloader#511 = 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!") - // [766] call display_info_smc - // SD2 | SMC chip not detected | Display that the SMC chip is not detected and set SMC to Error. | Error - // [962] phi from main::@18 to display_info_smc [phi:main::@18->display_info_smc] - // [962] phi display_info_smc::info_text#20 = main::info_text2 [phi:main::@18->display_info_smc#0] -- pbuz1=pbuc1 - lda #info_text2 - sta.z display_info_smc.info_text+1 - // [962] phi smc_bootloader#14 = smc_bootloader#511 [phi:main::@18->display_info_smc#1] -- register_copy - // [962] phi display_info_smc::info_status#20 = STATUS_ERROR [phi:main::@18->display_info_smc#2] -- vbum1=vbuc1 - lda #STATUS_ERROR - sta display_info_smc.info_status - jsr display_info_smc - jmp __b14 - // main::@1 - __b1: - // [767] smc_bootloader#500 = 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!") - // [768] call display_info_smc - // SD1 | No Bootloader | Display that there is no bootloader and set SMC to Issue. | Issue - // [962] phi from main::@1 to display_info_smc [phi:main::@1->display_info_smc] - // [962] phi display_info_smc::info_text#20 = main::info_text1 [phi:main::@1->display_info_smc#0] -- pbuz1=pbuc1 - lda #info_text1 - sta.z display_info_smc.info_text+1 - // [962] phi smc_bootloader#14 = smc_bootloader#500 [phi:main::@1->display_info_smc#1] -- register_copy - // [962] phi display_info_smc::info_status#20 = STATUS_ISSUE [phi:main::@1->display_info_smc#2] -- vbum1=vbuc1 - lda #STATUS_ISSUE - sta display_info_smc.info_status - jsr display_info_smc - // [769] phi from main::@1 to main::@112 [phi:main::@1->main::@112] - // main::@112 - // display_progress_text(display_no_valid_smc_bootloader_text, display_no_valid_smc_bootloader_count) - // [770] call display_progress_text - // If the CX16 board does not have a bootloader, display info how to flash bootloader. - // [1331] phi from main::@112 to display_progress_text [phi:main::@112->display_progress_text] - // [1331] phi display_progress_text::text#13 = display_no_valid_smc_bootloader_text [phi:main::@112->display_progress_text#0] -- qbuz1=qbuc1 - lda #display_no_valid_smc_bootloader_text - sta.z display_progress_text.text+1 - // [1331] phi display_progress_text::lines#12 = display_no_valid_smc_bootloader_count [phi:main::@112->display_progress_text#1] -- vbum1=vbuc1 - lda #display_no_valid_smc_bootloader_count - sta display_progress_text.lines - jsr display_progress_text - jmp __b14 - // main::@13 - __b13: - // rom_chip*13 - // [771] main::$371 = main::rom_chip#2 << 1 -- vbuz1=vbuz2_rol_1 - lda.z rom_chip - asl - sta.z main__371 - // [772] main::$372 = main::$371 + main::rom_chip#2 -- vbuz1=vbuz1_plus_vbuz2 - lda.z main__372 - clc - adc.z rom_chip - sta.z main__372 - // [773] main::$373 = main::$372 << 2 -- vbuz1=vbuz1_rol_2 - lda.z main__373 - asl - asl - sta.z main__373 - // [774] main::$87 = main::$373 + main::rom_chip#2 -- vbuz1=vbuz1_plus_vbuz2 - lda.z main__87 - clc - adc.z rom_chip - sta.z main__87 - // strcpy(&rom_release_text[rom_chip*13], " " ) - // [775] strcpy::destination#1 = rom_release_text + main::$87 -- pbuz1=pbuc1_plus_vbuz2 - clc - adc #rom_release_text - adc #0 - sta.z strcpy.destination+1 - // [776] call strcpy - // [1066] phi from main::@13 to strcpy [phi:main::@13->strcpy] - // [1066] phi strcpy::dst#0 = strcpy::destination#1 [phi:main::@13->strcpy#0] -- register_copy - // [1066] phi strcpy::src#0 = main::source [phi:main::@13->strcpy#1] -- pbuz1=pbuc1 - lda #source - sta.z strcpy.src+1 - jsr strcpy - // main::@106 - // display_info_rom(rom_chip, STATUS_NONE, NULL) - // [777] display_info_rom::rom_chip#5 = main::rom_chip#2 -- vbum1=vbuz2 - lda.z rom_chip - sta display_info_rom.rom_chip - // [778] call display_info_rom - // [1546] phi from main::@106 to display_info_rom [phi:main::@106->display_info_rom] - // [1546] phi display_info_rom::info_text#17 = 0 [phi:main::@106->display_info_rom#0] -- pbuz1=vbuc1 - lda #<0 - sta.z display_info_rom.info_text - sta.z display_info_rom.info_text+1 - // [1546] phi display_info_rom::rom_chip#17 = display_info_rom::rom_chip#5 [phi:main::@106->display_info_rom#1] -- register_copy - // [1546] phi display_info_rom::info_status#17 = STATUS_NONE [phi:main::@106->display_info_rom#2] -- vbum1=vbuc1 - lda #STATUS_NONE - sta display_info_rom.info_status - jsr display_info_rom - // main::@107 + // main::@59 // for(unsigned char rom_chip=0; rom_chip<8; rom_chip++) - // [779] main::rom_chip#1 = ++ main::rom_chip#2 -- vbuz1=_inc_vbuz1 + // [434] main::rom_chip#1 = ++ main::rom_chip#2 -- vbuz1=_inc_vbuz1 inc.z rom_chip - // [94] phi from main::@107 to main::@12 [phi:main::@107->main::@12] - // [94] phi main::rom_chip#2 = main::rom_chip#1 [phi:main::@107->main::@12#0] -- register_copy - jmp __b12 + // [94] phi from main::@59 to main::@10 [phi:main::@59->main::@10] + // [94] phi main::rom_chip#2 = main::rom_chip#1 [phi:main::@59->main::@10#0] -- register_copy + jmp __b10 .segment Data - smc_file_version_text: .fill $d, 0 - rom_file_release_text: .fill $d, 0 title_text: .text "Commander X16 Update Utility (v3.0.0) " .byte 0 s: .text "# Chip Status Type Curr. Release Update Info" @@ -4984,215 +2633,118 @@ main: { .byte 0 source: .text " " .byte 0 - source1: .text "0.0.0" - .byte 0 - info_text1: .text "No Bootloader!" - .byte 0 - info_text2: .text "SMC Unreachable!" - .byte 0 - s2: .text "Bootloader v" - .byte 0 - s3: .text " invalid! !" - .byte 0 - info_text3: .text "Checking SMC.BIN ..." - .byte 0 - info_text4: .text "No SMC.BIN!" - .byte 0 - info_text5: .text "SMC.BIN too large!" - .byte 0 - s4: .text "SMC.BIN:" - .byte 0 - s5: .text "Checking " + info_text1: .text "SMC update issue!" .byte 0 - s7: .text "No " + info_text2: .text "Issue with SMC!" .byte 0 - s8: .text "File " + info_text3: .text "CX16 ROM update issue, ROM not detected!" .byte 0 - s9: .text " size error!" + info_text4: .text "Issue with main CX16 ROM!" .byte 0 - info_text6: .text "SMC update issue!" + info_text5: .text "Are J1 jumper pins closed?" .byte 0 - info_text7: .text "Issue with SMC!" + info_text6: .text "CX16 ROM update issue!" .byte 0 - info_text8: .text "CX16 ROM update issue, ROM not detected!" + info_text8: .text "Compatibility between ROM.BIN and SMC.BIN can't be assured!" .byte 0 - info_text9: .text "Issue with main CX16 ROM!" - .byte 0 - info_text10: .text "Are J1 jumper pins closed?" - .byte 0 - info_text11: .text "CX16 ROM update issue!" - .byte 0 - info_text13: .text "Compatibility between ROM.BIN and SMC.BIN can't be assured!" - .byte 0 - info_text14: .text "Continue with flashing anyway? [Y/N]" + info_text9: .text "Continue with flashing anyway? [Y/N]" .byte 0 filter: .text "YN" .byte 0 - info_text15: .text "The SMC chip and SMC.BIN versions are equal, no flash required!" + info_text10: .text "The SMC chip and SMC.BIN versions are equal, no flash required!" .byte 0 - info_text16: .text "SMC.BIN and SMC equal." + info_text11: .text "SMC.BIN and SMC equal." .byte 0 - info_text17: .text "Chipsets have been detected and update files validated!" + info_text12: .text "Chipsets have been detected and update files validated!" .byte 0 - info_text18: .text "Continue with update of highlighted chipsets? [Y/N]" + info_text13: .text "Continue with update of highlighted chipsets? [Y/N]" .byte 0 filter1: .text "nyNY" .byte 0 - main__344: .text "nN" - .byte 0 - info_text19: .text "Cancelled" - .byte 0 - info_text22: .text "You have selected not to cancel the update ... " - .byte 0 - info_text23: .text "Reading SMC.BIN ... (.) data, ( ) empty" - .byte 0 - info_text24: .text "Press both POWER/RESET buttons on the CX16 board!" + main__208: .text "nN" .byte 0 - info_text25: .text "Press POWER/RESET!" + info_text14: .text "Cancelled" .byte 0 - info_text27: .text "SMC has errors!" + info_text17: .text "You have selected not to cancel the update ... " .byte 0 - info_text28: .text "POWER/RESET not pressed!" + s2: .text "There was a severe error updating your VERA!" .byte 0 - s11: .text "Reading " + s3: .text @"You are back at the READY prompt without resetting your CX16.\n\n" .byte 0 - s12: .text " ... (.) data ( ) empty" + s4: .text @"Please don't reset or shut down your VERA until you've\n" .byte 0 - info_text29: .text "SMC Update failed!" + s5: .text "managed to either reflash your VERA with the previous firmware " .byte 0 - info_text30: .text "Comparing ... (.) data, (=) same, (*) different." + s6: .text @"or have update successs retrying!\n\n" .byte 0 - s14: .text " flash errors!" + s7: .text @"PLEASE REMOVE THE JP1 JUMPER OR YOUR SDCARD WON'T WORK!\n" .byte 0 - s15: .text "There was a severe error updating your VERA!" + info_text18: .text "No CX16 component has been updated with new firmware!" .byte 0 - s16: .text @"You are back at the READY prompt without resetting your CX16.\n\n" + info_text19: .text "Update Failure! Your CX16 may no longer boot!" .byte 0 - s17: .text @"Please don't reset or shut down your VERA until you've\n" + info_text20: .text "Take a photo of this screen, shut down power and retry!" .byte 0 - s18: .text "managed to either reflash your VERA with the previous firmware " + info_text21: .text "Update issues, your CX16 is not updated!" .byte 0 - s19: .text @"or have update successs retrying!\n\n" - .byte 0 - s20: .text @"PLEASE REMOVE THE JP1 JUMPER OR YOUR SDCARD WON'T WORK!\n" - .byte 0 - info_text33: .text "No CX16 component has been updated with new firmware!" - .byte 0 - info_text34: .text "Update Failure! Your CX16 may no longer boot!" - .byte 0 - info_text35: .text "Take a photo of this screen, shut down power and retry!" - .byte 0 - info_text36: .text "Update issues, your CX16 is not updated!" - .byte 0 - info_text37: .text "Your CX16 update is a success!" + info_text22: .text "Your CX16 update is a success!" .byte 0 text: .text "DON'T DO ANYTHING UNTIL COUNTDOWN FINISHES!" .byte 0 - s22: .text "] Please read carefully the below ..." + s8: .text "[" .byte 0 - s23: .text "Please disconnect your CX16 from power source ..." + s9: .text "] Please read carefully the below ..." .byte 0 - s24: .text "(" + s10: .text "Please disconnect your CX16 from power source ..." .byte 0 - s25: .text ") Your CX16 will reset after countdown ..." + s11: .text "(" + .byte 0 + s12: .text ") Your CX16 will reset after countdown ..." .byte 0 - main__45: .byte 0 - main__62: .byte 0 - main__71: .byte 0 - main__84: .byte 0 - main__115: .byte 0 - main__186: .byte 0 - main__274: .byte 0 - main__279: .byte 0 - main__315: .byte 0 - main__317: .byte 0 - check_status_smc2_main__0: .byte 0 - check_status_cx16_rom1_check_status_rom1_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_cx16_rom4_check_status_rom1_main__0: .byte 0 - check_status_smc6_main__0: .byte 0 - check_status_smc7_main__0: .byte 0 - check_status_vera1_main__0: .byte 0 - check_status_smc8_main__0: .byte 0 - check_status_vera2_main__0: .byte 0 - check_status_vera3_main__0: .byte 0 - check_status_vera4_main__0: .byte 0 - check_status_smc9_main__0: .byte 0 - check_status_cx16_rom5_check_status_rom1_main__0: .byte 0 - check_status_vera5_main__0: .byte 0 - check_status_smc10_main__0: .byte 0 - check_status_cx16_rom6_check_status_rom1_main__0: .byte 0 - check_status_smc13_main__0: .byte 0 - check_status_smc14_main__0: .byte 0 - check_status_vera6_main__0: .byte 0 - check_status_vera7_main__0: .byte 0 - check_status_smc15_main__0: .byte 0 - check_status_vera8_main__0: .byte 0 - check_status_smc16_main__0: .byte 0 - check_status_vera9_main__0: .byte 0 - check_status_smc17_main__0: .byte 0 check_status_smc1_return: .byte 0 - bank_set_brom2_bank: .byte 0 - check_status_smc2_return: .byte 0 check_status_cx16_rom1_check_status_rom1_return: .byte 0 - rom_bank: .byte 0 - file: .word 0 - rom_file_release_id: .byte 0 - check_status_smc3_return: .byte 0 + check_status_smc2_return: .byte 0 check_status_cx16_rom2_check_status_rom1_return: .byte 0 - check_status_smc4_return: .byte 0 + check_status_smc3_return: .byte 0 check_status_cx16_rom3_check_status_rom1_return: .byte 0 - check_status_smc5_return: .byte 0 + check_status_smc4_return: .byte 0 check_status_cx16_rom4_check_status_rom1_return: .byte 0 + check_status_smc5_return: .byte 0 check_status_smc6_return: .byte 0 - ch: .byte 0 - check_status_smc7_return: .byte 0 check_status_vera1_return: .byte 0 - check_status_smc8_return: .byte 0 + check_status_smc7_return: .byte 0 check_status_vera2_return: .byte 0 check_status_vera3_return: .byte 0 check_status_vera4_return: .byte 0 - check_status_smc9_return: .byte 0 + check_status_smc8_return: .byte 0 check_status_cx16_rom5_check_status_rom1_return: .byte 0 check_status_vera5_return: .byte 0 - ch1: .byte 0 + check_status_smc9_return: .byte 0 check_status_smc10_return: .byte 0 - check_status_cx16_rom6_check_status_rom1_return: .byte 0 - check_status_rom1_return: .byte 0 - check_status_smc11_return: .byte 0 - check_status_smc12_return: .byte 0 - rom_bank1: .byte 0 - rom_flash_errors: .dword 0 - check_status_smc13_return: .byte 0 - check_status_smc14_return: .byte 0 check_status_vera6_return: .byte 0 check_status_vera7_return: .byte 0 - check_status_smc15_return: .byte 0 + check_status_smc11_return: .byte 0 check_status_vera8_return: .byte 0 - check_status_smc16_return: .byte 0 + check_status_smc12_return: .byte 0 check_status_vera9_return: .byte 0 - check_status_smc17_return: .byte 0 + check_status_smc13_return: .byte 0 } .segment Code // screenlayer1 // Set the layer with which the conio will interact. screenlayer1: { // screenlayer(1, *VERA_L1_MAPBASE, *VERA_L1_CONFIG) - // [780] screenlayer::mapbase#0 = *VERA_L1_MAPBASE -- vbum1=_deref_pbuc1 + // [435] screenlayer::mapbase#0 = *VERA_L1_MAPBASE -- vbum1=_deref_pbuc1 lda VERA_L1_MAPBASE sta screenlayer.mapbase - // [781] screenlayer::config#0 = *VERA_L1_CONFIG -- vbum1=_deref_pbuc1 + // [436] screenlayer::config#0 = *VERA_L1_CONFIG -- vbum1=_deref_pbuc1 lda VERA_L1_CONFIG sta screenlayer.config - // [782] call screenlayer + // [437] call screenlayer jsr screenlayer // screenlayer1::@return // } - // [783] return + // [438] return rts } // textcolor @@ -5202,24 +2754,24 @@ screenlayer1: { // Note that on the VERA, the transparent color has value 0. // char textcolor(__mem() char color) textcolor: { - .label textcolor__0 = $5c - .label textcolor__1 = $5c + .label textcolor__0 = $55 + .label textcolor__1 = $55 // __conio.color & 0xF0 - // [785] textcolor::$0 = *((char *)&__conio+$d) & $f0 -- vbuz1=_deref_pbuc1_band_vbuc2 + // [440] textcolor::$0 = *((char *)&__conio+$d) & $f0 -- vbuz1=_deref_pbuc1_band_vbuc2 lda #$f0 and __conio+$d sta.z textcolor__0 // __conio.color & 0xF0 | color - // [786] textcolor::$1 = textcolor::$0 | textcolor::color#23 -- vbuz1=vbuz1_bor_vbum2 + // [441] textcolor::$1 = textcolor::$0 | textcolor::color#21 -- vbuz1=vbuz1_bor_vbum2 lda color ora.z textcolor__1 sta.z textcolor__1 // __conio.color = __conio.color & 0xF0 | color - // [787] *((char *)&__conio+$d) = textcolor::$1 -- _deref_pbuc1=vbuz1 + // [442] *((char *)&__conio+$d) = textcolor::$1 -- _deref_pbuc1=vbuz1 sta __conio+$d // textcolor::@return // } - // [788] return + // [443] return rts .segment Data color: .byte 0 @@ -5232,16 +2784,16 @@ textcolor: { // Note that on the VERA, the transparent color has value 0. // char bgcolor(__mem() char color) bgcolor: { - .label bgcolor__0 = $5c - .label bgcolor__1 = $5d - .label bgcolor__2 = $5c + .label bgcolor__0 = $55 + .label bgcolor__1 = $58 + .label bgcolor__2 = $55 // __conio.color & 0x0F - // [790] bgcolor::$0 = *((char *)&__conio+$d) & $f -- vbuz1=_deref_pbuc1_band_vbuc2 + // [445] bgcolor::$0 = *((char *)&__conio+$d) & $f -- vbuz1=_deref_pbuc1_band_vbuc2 lda #$f and __conio+$d sta.z bgcolor__0 // color << 4 - // [791] bgcolor::$1 = bgcolor::color#15 << 4 -- vbuz1=vbum2_rol_4 + // [446] bgcolor::$1 = bgcolor::color#15 << 4 -- vbuz1=vbum2_rol_4 lda color asl asl @@ -5249,16 +2801,16 @@ bgcolor: { asl sta.z bgcolor__1 // __conio.color & 0x0F | color << 4 - // [792] bgcolor::$2 = bgcolor::$0 | bgcolor::$1 -- vbuz1=vbuz1_bor_vbuz2 + // [447] bgcolor::$2 = bgcolor::$0 | bgcolor::$1 -- vbuz1=vbuz1_bor_vbuz2 lda.z bgcolor__2 ora.z bgcolor__1 sta.z bgcolor__2 // __conio.color = __conio.color & 0x0F | color << 4 - // [793] *((char *)&__conio+$d) = bgcolor::$2 -- _deref_pbuc1=vbuz1 + // [448] *((char *)&__conio+$d) = bgcolor::$2 -- _deref_pbuc1=vbuz1 sta __conio+$d // bgcolor::@return // } - // [794] return + // [449] return rts .segment Data color: .byte 0 @@ -5272,12 +2824,12 @@ bgcolor: { cursor: { .const onoff = 0 // __conio.cursor = onoff - // [795] *((char *)&__conio+$c) = cursor::onoff#0 -- _deref_pbuc1=vbuc2 + // [450] *((char *)&__conio+$c) = cursor::onoff#0 -- _deref_pbuc1=vbuc2 lda #onoff sta __conio+$c // cursor::@return // } - // [796] return + // [451] return rts } // cbm_k_plot_get @@ -5287,11 +2839,11 @@ cursor: { */ cbm_k_plot_get: { // __mem unsigned char x - // [797] cbm_k_plot_get::x = 0 -- vbum1=vbuc1 + // [452] cbm_k_plot_get::x = 0 -- vbum1=vbuc1 lda #0 sta x // __mem unsigned char y - // [798] cbm_k_plot_get::y = 0 -- vbum1=vbuc1 + // [453] cbm_k_plot_get::y = 0 -- vbum1=vbuc1 sta y // kickasm // kickasm( uses cbm_k_plot_get::x uses cbm_k_plot_get::y uses CBM_PLOT) {{ sec jsr CBM_PLOT stx y sty x }} @@ -5301,14 +2853,14 @@ cbm_k_plot_get: { sty x // MAKEWORD(x,y) - // [800] cbm_k_plot_get::return#0 = cbm_k_plot_get::x w= cbm_k_plot_get::y -- vwum1=vbum2_word_vbum3 + // [455] cbm_k_plot_get::return#0 = cbm_k_plot_get::x w= cbm_k_plot_get::y -- vwum1=vbum2_word_vbum3 lda x sta return+1 lda y sta return // cbm_k_plot_get::@return // } - // [801] return + // [456] return rts .segment Data x: .byte 0 @@ -5320,63 +2872,63 @@ cbm_k_plot_get: { // Set the cursor to the specified position // void gotoxy(__mem() char x, __mem() char y) gotoxy: { - .label gotoxy__2 = $30 - .label gotoxy__3 = $30 - .label gotoxy__6 = $2f - .label gotoxy__7 = $2f - .label gotoxy__8 = $37 - .label gotoxy__9 = $34 - .label gotoxy__10 = $33 - .label gotoxy__14 = $2f + .label gotoxy__2 = $2c + .label gotoxy__3 = $2c + .label gotoxy__6 = $2b + .label gotoxy__7 = $2b + .label gotoxy__8 = $33 + .label gotoxy__9 = $30 + .label gotoxy__10 = $2f + .label gotoxy__14 = $2b // (x>=__conio.width)?__conio.width:x - // [803] if(gotoxy::x#37>=*((char *)&__conio+6)) goto gotoxy::@1 -- vbum1_ge__deref_pbuc1_then_la1 + // [458] if(gotoxy::x#26>=*((char *)&__conio+6)) goto gotoxy::@1 -- vbum1_ge__deref_pbuc1_then_la1 lda x cmp __conio+6 bcs __b1 - // [805] phi from gotoxy to gotoxy::@2 [phi:gotoxy->gotoxy::@2] - // [805] phi gotoxy::$3 = gotoxy::x#37 [phi:gotoxy->gotoxy::@2#0] -- vbuz1=vbum2 + // [460] phi from gotoxy to gotoxy::@2 [phi:gotoxy->gotoxy::@2] + // [460] phi gotoxy::$3 = gotoxy::x#26 [phi:gotoxy->gotoxy::@2#0] -- vbuz1=vbum2 sta.z gotoxy__3 jmp __b2 // gotoxy::@1 __b1: - // [804] gotoxy::$2 = *((char *)&__conio+6) -- vbuz1=_deref_pbuc1 + // [459] gotoxy::$2 = *((char *)&__conio+6) -- vbuz1=_deref_pbuc1 lda __conio+6 sta.z gotoxy__2 - // [805] phi from gotoxy::@1 to gotoxy::@2 [phi:gotoxy::@1->gotoxy::@2] - // [805] phi gotoxy::$3 = gotoxy::$2 [phi:gotoxy::@1->gotoxy::@2#0] -- register_copy + // [460] phi from gotoxy::@1 to gotoxy::@2 [phi:gotoxy::@1->gotoxy::@2] + // [460] phi gotoxy::$3 = gotoxy::$2 [phi:gotoxy::@1->gotoxy::@2#0] -- register_copy // gotoxy::@2 __b2: // __conio.cursor_x = (x>=__conio.width)?__conio.width:x - // [806] *((char *)&__conio) = gotoxy::$3 -- _deref_pbuc1=vbuz1 + // [461] *((char *)&__conio) = gotoxy::$3 -- _deref_pbuc1=vbuz1 lda.z gotoxy__3 sta __conio // (y>=__conio.height)?__conio.height:y - // [807] if(gotoxy::y#37>=*((char *)&__conio+7)) goto gotoxy::@3 -- vbum1_ge__deref_pbuc1_then_la1 + // [462] if(gotoxy::y#26>=*((char *)&__conio+7)) goto gotoxy::@3 -- vbum1_ge__deref_pbuc1_then_la1 lda y cmp __conio+7 bcs __b3 // gotoxy::@4 - // [808] gotoxy::$14 = gotoxy::y#37 -- vbuz1=vbum2 + // [463] gotoxy::$14 = gotoxy::y#26 -- vbuz1=vbum2 sta.z gotoxy__14 - // [809] phi from gotoxy::@3 gotoxy::@4 to gotoxy::@5 [phi:gotoxy::@3/gotoxy::@4->gotoxy::@5] - // [809] phi gotoxy::$7 = gotoxy::$6 [phi:gotoxy::@3/gotoxy::@4->gotoxy::@5#0] -- register_copy + // [464] phi from gotoxy::@3 gotoxy::@4 to gotoxy::@5 [phi:gotoxy::@3/gotoxy::@4->gotoxy::@5] + // [464] 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 - // [810] *((char *)&__conio+1) = gotoxy::$7 -- _deref_pbuc1=vbuz1 + // [465] *((char *)&__conio+1) = gotoxy::$7 -- _deref_pbuc1=vbuz1 lda.z gotoxy__7 sta __conio+1 // __conio.cursor_x << 1 - // [811] gotoxy::$8 = *((char *)&__conio) << 1 -- vbuz1=_deref_pbuc1_rol_1 + // [466] gotoxy::$8 = *((char *)&__conio) << 1 -- vbuz1=_deref_pbuc1_rol_1 lda __conio asl sta.z gotoxy__8 // __conio.offsets[y] + __conio.cursor_x << 1 - // [812] gotoxy::$10 = gotoxy::y#37 << 1 -- vbuz1=vbum2_rol_1 + // [467] gotoxy::$10 = gotoxy::y#26 << 1 -- vbuz1=vbum2_rol_1 lda y asl sta.z gotoxy__10 - // [813] gotoxy::$9 = ((unsigned int *)&__conio+$15)[gotoxy::$10] + gotoxy::$8 -- vwuz1=pwuc1_derefidx_vbuz2_plus_vbuz3 + // [468] gotoxy::$9 = ((unsigned int *)&__conio+$15)[gotoxy::$10] + gotoxy::$8 -- vwuz1=pwuc1_derefidx_vbuz2_plus_vbuz3 lda.z gotoxy__8 ldy.z gotoxy__10 clc @@ -5386,19 +2938,19 @@ gotoxy: { adc #0 sta.z gotoxy__9+1 // __conio.offset = __conio.offsets[y] + __conio.cursor_x << 1 - // [814] *((unsigned int *)&__conio+$13) = gotoxy::$9 -- _deref_pwuc1=vwuz1 + // [469] *((unsigned int *)&__conio+$13) = gotoxy::$9 -- _deref_pwuc1=vwuz1 lda.z gotoxy__9 sta __conio+$13 lda.z gotoxy__9+1 sta __conio+$13+1 // gotoxy::@return // } - // [815] return + // [470] return rts // gotoxy::@3 __b3: // (y>=__conio.height)?__conio.height:y - // [816] gotoxy::$6 = *((char *)&__conio+7) -- vbuz1=_deref_pbuc1 + // [471] gotoxy::$6 = *((char *)&__conio+7) -- vbuz1=_deref_pbuc1 lda __conio+7 sta.z gotoxy__6 jmp __b5 @@ -5410,31 +2962,31 @@ gotoxy: { // cputln // Print a newline cputln: { - .label cputln__2 = $49 + .label cputln__2 = $44 // __conio.cursor_x = 0 - // [817] *((char *)&__conio) = 0 -- _deref_pbuc1=vbuc2 + // [472] *((char *)&__conio) = 0 -- _deref_pbuc1=vbuc2 lda #0 sta __conio // __conio.cursor_y++; - // [818] *((char *)&__conio+1) = ++ *((char *)&__conio+1) -- _deref_pbuc1=_inc__deref_pbuc1 + // [473] *((char *)&__conio+1) = ++ *((char *)&__conio+1) -- _deref_pbuc1=_inc__deref_pbuc1 inc __conio+1 // __conio.offset = __conio.offsets[__conio.cursor_y] - // [819] cputln::$2 = *((char *)&__conio+1) << 1 -- vbuz1=_deref_pbuc1_rol_1 + // [474] cputln::$2 = *((char *)&__conio+1) << 1 -- vbuz1=_deref_pbuc1_rol_1 lda __conio+1 asl sta.z cputln__2 - // [820] *((unsigned int *)&__conio+$13) = ((unsigned int *)&__conio+$15)[cputln::$2] -- _deref_pwuc1=pwuc2_derefidx_vbuz1 + // [475] *((unsigned int *)&__conio+$13) = ((unsigned int *)&__conio+$15)[cputln::$2] -- _deref_pwuc1=pwuc2_derefidx_vbuz1 tay lda __conio+$15,y sta __conio+$13 lda __conio+$15+1,y sta __conio+$13+1 // cscroll() - // [821] call cscroll + // [476] call cscroll jsr cscroll // cputln::@return // } - // [822] return + // [477] return rts } // display_frame_init_64 @@ -5446,25 +2998,25 @@ display_frame_init_64: { .const vera_display_set_hstop1_stop = $93 .const vera_display_set_vstart1_start = $13 .const vera_display_set_vstop1_stop = $db - .label cx16_k_screen_set_charset1_offset = $ef + .label cx16_k_screen_set_charset1_offset = $b2 // cx16_k_screen_set_mode(0) - // [823] cx16_k_screen_set_mode::mode = 0 -- vbum1=vbuc1 + // [478] cx16_k_screen_set_mode::mode = 0 -- vbum1=vbuc1 lda #0 sta cx16_k_screen_set_mode.mode - // [824] call cx16_k_screen_set_mode + // [479] call cx16_k_screen_set_mode jsr cx16_k_screen_set_mode - // [825] phi from display_frame_init_64 to display_frame_init_64::@2 [phi:display_frame_init_64->display_frame_init_64::@2] + // [480] phi from display_frame_init_64 to display_frame_init_64::@2 [phi:display_frame_init_64->display_frame_init_64::@2] // display_frame_init_64::@2 // screenlayer1() - // [826] call screenlayer1 + // [481] call screenlayer1 // Default 80 columns mode. jsr screenlayer1 // display_frame_init_64::@3 // cx16_k_screen_set_charset(3, (char *)0) - // [827] display_frame_init_64::cx16_k_screen_set_charset1_charset = 3 -- vbum1=vbuc1 + // [482] display_frame_init_64::cx16_k_screen_set_charset1_charset = 3 -- vbum1=vbuc1 lda #3 sta cx16_k_screen_set_charset1_charset - // [828] display_frame_init_64::cx16_k_screen_set_charset1_offset = (char *) 0 -- pbuz1=pbuc1 + // [483] display_frame_init_64::cx16_k_screen_set_charset1_offset = (char *) 0 -- pbuz1=pbuc1 lda #<0 sta.z cx16_k_screen_set_charset1_offset sta.z cx16_k_screen_set_charset1_offset+1 @@ -5477,107 +3029,107 @@ display_frame_init_64: { jsr CX16_SCREEN_SET_CHARSET // display_frame_init_64::vera_display_set_hstart1 // *VERA_CTRL |= VERA_DCSEL - // [830] *VERA_CTRL = *VERA_CTRL | VERA_DCSEL -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2 + // [485] *VERA_CTRL = *VERA_CTRL | VERA_DCSEL -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2 lda #VERA_DCSEL ora VERA_CTRL sta VERA_CTRL // *VERA_DC_HSTART = start - // [831] *VERA_DC_HSTART = display_frame_init_64::vera_display_set_hstart1_start#0 -- _deref_pbuc1=vbuc2 + // [486] *VERA_DC_HSTART = display_frame_init_64::vera_display_set_hstart1_start#0 -- _deref_pbuc1=vbuc2 lda #vera_display_set_hstart1_start sta VERA_DC_HSTART // display_frame_init_64::vera_display_set_hstop1 // *VERA_CTRL |= VERA_DCSEL - // [832] *VERA_CTRL = *VERA_CTRL | VERA_DCSEL -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2 + // [487] *VERA_CTRL = *VERA_CTRL | VERA_DCSEL -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2 lda #VERA_DCSEL ora VERA_CTRL sta VERA_CTRL // *VERA_DC_HSTOP = stop - // [833] *VERA_DC_HSTOP = display_frame_init_64::vera_display_set_hstop1_stop#0 -- _deref_pbuc1=vbuc2 + // [488] *VERA_DC_HSTOP = display_frame_init_64::vera_display_set_hstop1_stop#0 -- _deref_pbuc1=vbuc2 lda #vera_display_set_hstop1_stop sta VERA_DC_HSTOP // display_frame_init_64::vera_display_set_vstart1 // *VERA_CTRL |= VERA_DCSEL - // [834] *VERA_CTRL = *VERA_CTRL | VERA_DCSEL -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2 + // [489] *VERA_CTRL = *VERA_CTRL | VERA_DCSEL -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2 lda #VERA_DCSEL ora VERA_CTRL sta VERA_CTRL // *VERA_DC_VSTART = start - // [835] *VERA_DC_VSTART = display_frame_init_64::vera_display_set_vstart1_start#0 -- _deref_pbuc1=vbuc2 + // [490] *VERA_DC_VSTART = display_frame_init_64::vera_display_set_vstart1_start#0 -- _deref_pbuc1=vbuc2 lda #vera_display_set_vstart1_start sta VERA_DC_VSTART // display_frame_init_64::vera_display_set_vstop1 // *VERA_CTRL |= VERA_DCSEL - // [836] *VERA_CTRL = *VERA_CTRL | VERA_DCSEL -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2 + // [491] *VERA_CTRL = *VERA_CTRL | VERA_DCSEL -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2 lda #VERA_DCSEL ora VERA_CTRL sta VERA_CTRL // *VERA_DC_VSTOP = stop - // [837] *VERA_DC_VSTOP = display_frame_init_64::vera_display_set_vstop1_stop#0 -- _deref_pbuc1=vbuc2 + // [492] *VERA_DC_VSTOP = display_frame_init_64::vera_display_set_vstop1_stop#0 -- _deref_pbuc1=vbuc2 lda #vera_display_set_vstop1_stop sta VERA_DC_VSTOP // display_frame_init_64::vera_sprites_hide1 // *VERA_CTRL &= ~VERA_DCSEL - // [838] *VERA_CTRL = *VERA_CTRL & ~VERA_DCSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 + // [493] *VERA_CTRL = *VERA_CTRL & ~VERA_DCSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 lda #VERA_DCSEL^$ff and VERA_CTRL sta VERA_CTRL // *VERA_DC_VIDEO &= ~VERA_SPRITES_ENABLE - // [839] *VERA_DC_VIDEO = *VERA_DC_VIDEO & ~VERA_SPRITES_ENABLE -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 + // [494] *VERA_DC_VIDEO = *VERA_DC_VIDEO & ~VERA_SPRITES_ENABLE -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 lda #VERA_SPRITES_ENABLE^$ff and VERA_DC_VIDEO sta VERA_DC_VIDEO // display_frame_init_64::vera_layer0_hide1 // *VERA_CTRL &= ~VERA_DCSEL - // [840] *VERA_CTRL = *VERA_CTRL & ~VERA_DCSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 + // [495] *VERA_CTRL = *VERA_CTRL & ~VERA_DCSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 lda #VERA_DCSEL^$ff and VERA_CTRL sta VERA_CTRL // *VERA_DC_VIDEO &= ~VERA_LAYER0_ENABLE - // [841] *VERA_DC_VIDEO = *VERA_DC_VIDEO & ~VERA_LAYER0_ENABLE -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 + // [496] *VERA_DC_VIDEO = *VERA_DC_VIDEO & ~VERA_LAYER0_ENABLE -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 lda #VERA_LAYER0_ENABLE^$ff and VERA_DC_VIDEO sta VERA_DC_VIDEO // display_frame_init_64::vera_layer1_show1 // *VERA_CTRL &= ~VERA_DCSEL - // [842] *VERA_CTRL = *VERA_CTRL & ~VERA_DCSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 + // [497] *VERA_CTRL = *VERA_CTRL & ~VERA_DCSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 lda #VERA_DCSEL^$ff and VERA_CTRL sta VERA_CTRL // *VERA_DC_VIDEO |= VERA_LAYER1_ENABLE - // [843] *VERA_DC_VIDEO = *VERA_DC_VIDEO | VERA_LAYER1_ENABLE -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2 + // [498] *VERA_DC_VIDEO = *VERA_DC_VIDEO | VERA_LAYER1_ENABLE -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2 lda #VERA_LAYER1_ENABLE ora VERA_DC_VIDEO sta VERA_DC_VIDEO - // [844] phi from display_frame_init_64::vera_layer1_show1 to display_frame_init_64::@1 [phi:display_frame_init_64::vera_layer1_show1->display_frame_init_64::@1] + // [499] phi from display_frame_init_64::vera_layer1_show1 to display_frame_init_64::@1 [phi:display_frame_init_64::vera_layer1_show1->display_frame_init_64::@1] // display_frame_init_64::@1 // textcolor(WHITE) - // [845] call textcolor + // [500] call textcolor // Layer 1 is the current text canvas. - // [784] phi from display_frame_init_64::@1 to textcolor [phi:display_frame_init_64::@1->textcolor] - // [784] phi textcolor::color#23 = WHITE [phi:display_frame_init_64::@1->textcolor#0] -- vbum1=vbuc1 + // [439] phi from display_frame_init_64::@1 to textcolor [phi:display_frame_init_64::@1->textcolor] + // [439] phi textcolor::color#21 = WHITE [phi:display_frame_init_64::@1->textcolor#0] -- vbum1=vbuc1 lda #WHITE sta textcolor.color jsr textcolor - // [846] phi from display_frame_init_64::@1 to display_frame_init_64::@4 [phi:display_frame_init_64::@1->display_frame_init_64::@4] + // [501] phi from display_frame_init_64::@1 to display_frame_init_64::@4 [phi:display_frame_init_64::@1->display_frame_init_64::@4] // display_frame_init_64::@4 // bgcolor(BLUE) - // [847] call bgcolor + // [502] call bgcolor // Default text color is white. - // [789] phi from display_frame_init_64::@4 to bgcolor [phi:display_frame_init_64::@4->bgcolor] - // [789] phi bgcolor::color#15 = BLUE [phi:display_frame_init_64::@4->bgcolor#0] -- vbum1=vbuc1 + // [444] phi from display_frame_init_64::@4 to bgcolor [phi:display_frame_init_64::@4->bgcolor] + // [444] phi bgcolor::color#15 = BLUE [phi:display_frame_init_64::@4->bgcolor#0] -- vbum1=vbuc1 lda #BLUE sta bgcolor.color jsr bgcolor - // [848] phi from display_frame_init_64::@4 to display_frame_init_64::@5 [phi:display_frame_init_64::@4->display_frame_init_64::@5] + // [503] phi from display_frame_init_64::@4 to display_frame_init_64::@5 [phi:display_frame_init_64::@4->display_frame_init_64::@5] // display_frame_init_64::@5 // clrscr() - // [849] call clrscr + // [504] call clrscr // With a blue background. // cx16-conio.c won't compile scrolling code for this program with the underlying define, resulting in less code overhead! jsr clrscr // display_frame_init_64::@return // } - // [850] return + // [505] return rts .segment Data cx16_k_screen_set_charset1_charset: .byte 0 @@ -5589,328 +3141,328 @@ display_frame_init_64: { */ display_frame_draw: { // textcolor(LIGHT_BLUE) - // [852] call textcolor - // [784] phi from display_frame_draw to textcolor [phi:display_frame_draw->textcolor] - // [784] phi textcolor::color#23 = LIGHT_BLUE [phi:display_frame_draw->textcolor#0] -- vbum1=vbuc1 + // [507] call textcolor + // [439] phi from display_frame_draw to textcolor [phi:display_frame_draw->textcolor] + // [439] phi textcolor::color#21 = LIGHT_BLUE [phi:display_frame_draw->textcolor#0] -- vbum1=vbuc1 lda #LIGHT_BLUE sta textcolor.color jsr textcolor - // [853] phi from display_frame_draw to display_frame_draw::@1 [phi:display_frame_draw->display_frame_draw::@1] + // [508] phi from display_frame_draw to display_frame_draw::@1 [phi:display_frame_draw->display_frame_draw::@1] // display_frame_draw::@1 // bgcolor(BLUE) - // [854] call bgcolor - // [789] phi from display_frame_draw::@1 to bgcolor [phi:display_frame_draw::@1->bgcolor] - // [789] phi bgcolor::color#15 = BLUE [phi:display_frame_draw::@1->bgcolor#0] -- vbum1=vbuc1 + // [509] call bgcolor + // [444] phi from display_frame_draw::@1 to bgcolor [phi:display_frame_draw::@1->bgcolor] + // [444] phi bgcolor::color#15 = BLUE [phi:display_frame_draw::@1->bgcolor#0] -- vbum1=vbuc1 lda #BLUE sta bgcolor.color jsr bgcolor - // [855] phi from display_frame_draw::@1 to display_frame_draw::@2 [phi:display_frame_draw::@1->display_frame_draw::@2] + // [510] phi from display_frame_draw::@1 to display_frame_draw::@2 [phi:display_frame_draw::@1->display_frame_draw::@2] // display_frame_draw::@2 // clrscr() - // [856] call clrscr + // [511] call clrscr jsr clrscr - // [857] phi from display_frame_draw::@2 to display_frame_draw::@3 [phi:display_frame_draw::@2->display_frame_draw::@3] + // [512] phi from display_frame_draw::@2 to display_frame_draw::@3 [phi:display_frame_draw::@2->display_frame_draw::@3] // display_frame_draw::@3 // display_frame(0, 0, 67, 14) - // [858] call display_frame - // [2146] phi from display_frame_draw::@3 to display_frame [phi:display_frame_draw::@3->display_frame] - // [2146] phi display_frame::y#0 = 0 [phi:display_frame_draw::@3->display_frame#0] -- vbum1=vbuc1 + // [513] call display_frame + // [1174] phi from display_frame_draw::@3 to display_frame [phi:display_frame_draw::@3->display_frame] + // [1174] phi display_frame::y#0 = 0 [phi:display_frame_draw::@3->display_frame#0] -- vbum1=vbuc1 lda #0 sta display_frame.y - // [2146] phi display_frame::y1#16 = $e [phi:display_frame_draw::@3->display_frame#1] -- vbum1=vbuc1 + // [1174] phi display_frame::y1#16 = $e [phi:display_frame_draw::@3->display_frame#1] -- vbum1=vbuc1 lda #$e sta display_frame.y1 - // [2146] phi display_frame::x#0 = 0 [phi:display_frame_draw::@3->display_frame#2] -- vbum1=vbuc1 + // [1174] phi display_frame::x#0 = 0 [phi:display_frame_draw::@3->display_frame#2] -- vbum1=vbuc1 lda #0 sta display_frame.x - // [2146] phi display_frame::x1#16 = $43 [phi:display_frame_draw::@3->display_frame#3] -- vbum1=vbuc1 + // [1174] phi display_frame::x1#16 = $43 [phi:display_frame_draw::@3->display_frame#3] -- vbum1=vbuc1 lda #$43 sta display_frame.x1 jsr display_frame - // [859] phi from display_frame_draw::@3 to display_frame_draw::@4 [phi:display_frame_draw::@3->display_frame_draw::@4] + // [514] phi from display_frame_draw::@3 to display_frame_draw::@4 [phi:display_frame_draw::@3->display_frame_draw::@4] // display_frame_draw::@4 // display_frame(0, 0, 67, 2) - // [860] call display_frame - // [2146] phi from display_frame_draw::@4 to display_frame [phi:display_frame_draw::@4->display_frame] - // [2146] phi display_frame::y#0 = 0 [phi:display_frame_draw::@4->display_frame#0] -- vbum1=vbuc1 + // [515] call display_frame + // [1174] phi from display_frame_draw::@4 to display_frame [phi:display_frame_draw::@4->display_frame] + // [1174] phi display_frame::y#0 = 0 [phi:display_frame_draw::@4->display_frame#0] -- vbum1=vbuc1 lda #0 sta display_frame.y - // [2146] phi display_frame::y1#16 = 2 [phi:display_frame_draw::@4->display_frame#1] -- vbum1=vbuc1 + // [1174] phi display_frame::y1#16 = 2 [phi:display_frame_draw::@4->display_frame#1] -- vbum1=vbuc1 lda #2 sta display_frame.y1 - // [2146] phi display_frame::x#0 = 0 [phi:display_frame_draw::@4->display_frame#2] -- vbum1=vbuc1 + // [1174] phi display_frame::x#0 = 0 [phi:display_frame_draw::@4->display_frame#2] -- vbum1=vbuc1 lda #0 sta display_frame.x - // [2146] phi display_frame::x1#16 = $43 [phi:display_frame_draw::@4->display_frame#3] -- vbum1=vbuc1 + // [1174] phi display_frame::x1#16 = $43 [phi:display_frame_draw::@4->display_frame#3] -- vbum1=vbuc1 lda #$43 sta display_frame.x1 jsr display_frame - // [861] phi from display_frame_draw::@4 to display_frame_draw::@5 [phi:display_frame_draw::@4->display_frame_draw::@5] + // [516] phi from display_frame_draw::@4 to display_frame_draw::@5 [phi:display_frame_draw::@4->display_frame_draw::@5] // display_frame_draw::@5 // display_frame(0, 2, 67, 14) - // [862] call display_frame - // [2146] phi from display_frame_draw::@5 to display_frame [phi:display_frame_draw::@5->display_frame] - // [2146] phi display_frame::y#0 = 2 [phi:display_frame_draw::@5->display_frame#0] -- vbum1=vbuc1 + // [517] call display_frame + // [1174] phi from display_frame_draw::@5 to display_frame [phi:display_frame_draw::@5->display_frame] + // [1174] phi display_frame::y#0 = 2 [phi:display_frame_draw::@5->display_frame#0] -- vbum1=vbuc1 lda #2 sta display_frame.y - // [2146] phi display_frame::y1#16 = $e [phi:display_frame_draw::@5->display_frame#1] -- vbum1=vbuc1 + // [1174] phi display_frame::y1#16 = $e [phi:display_frame_draw::@5->display_frame#1] -- vbum1=vbuc1 lda #$e sta display_frame.y1 - // [2146] phi display_frame::x#0 = 0 [phi:display_frame_draw::@5->display_frame#2] -- vbum1=vbuc1 + // [1174] phi display_frame::x#0 = 0 [phi:display_frame_draw::@5->display_frame#2] -- vbum1=vbuc1 lda #0 sta display_frame.x - // [2146] phi display_frame::x1#16 = $43 [phi:display_frame_draw::@5->display_frame#3] -- vbum1=vbuc1 + // [1174] phi display_frame::x1#16 = $43 [phi:display_frame_draw::@5->display_frame#3] -- vbum1=vbuc1 lda #$43 sta display_frame.x1 jsr display_frame - // [863] phi from display_frame_draw::@5 to display_frame_draw::@6 [phi:display_frame_draw::@5->display_frame_draw::@6] + // [518] phi from display_frame_draw::@5 to display_frame_draw::@6 [phi:display_frame_draw::@5->display_frame_draw::@6] // display_frame_draw::@6 // display_frame(0, 2, 8, 14) - // [864] call display_frame + // [519] call display_frame // Chipset areas - // [2146] phi from display_frame_draw::@6 to display_frame [phi:display_frame_draw::@6->display_frame] - // [2146] phi display_frame::y#0 = 2 [phi:display_frame_draw::@6->display_frame#0] -- vbum1=vbuc1 + // [1174] phi from display_frame_draw::@6 to display_frame [phi:display_frame_draw::@6->display_frame] + // [1174] phi display_frame::y#0 = 2 [phi:display_frame_draw::@6->display_frame#0] -- vbum1=vbuc1 lda #2 sta display_frame.y - // [2146] phi display_frame::y1#16 = $e [phi:display_frame_draw::@6->display_frame#1] -- vbum1=vbuc1 + // [1174] phi display_frame::y1#16 = $e [phi:display_frame_draw::@6->display_frame#1] -- vbum1=vbuc1 lda #$e sta display_frame.y1 - // [2146] phi display_frame::x#0 = 0 [phi:display_frame_draw::@6->display_frame#2] -- vbum1=vbuc1 + // [1174] phi display_frame::x#0 = 0 [phi:display_frame_draw::@6->display_frame#2] -- vbum1=vbuc1 lda #0 sta display_frame.x - // [2146] phi display_frame::x1#16 = 8 [phi:display_frame_draw::@6->display_frame#3] -- vbum1=vbuc1 + // [1174] phi display_frame::x1#16 = 8 [phi:display_frame_draw::@6->display_frame#3] -- vbum1=vbuc1 lda #8 sta display_frame.x1 jsr display_frame - // [865] phi from display_frame_draw::@6 to display_frame_draw::@7 [phi:display_frame_draw::@6->display_frame_draw::@7] + // [520] phi from display_frame_draw::@6 to display_frame_draw::@7 [phi:display_frame_draw::@6->display_frame_draw::@7] // display_frame_draw::@7 // display_frame(8, 2, 19, 14) - // [866] call display_frame - // [2146] phi from display_frame_draw::@7 to display_frame [phi:display_frame_draw::@7->display_frame] - // [2146] phi display_frame::y#0 = 2 [phi:display_frame_draw::@7->display_frame#0] -- vbum1=vbuc1 + // [521] call display_frame + // [1174] phi from display_frame_draw::@7 to display_frame [phi:display_frame_draw::@7->display_frame] + // [1174] phi display_frame::y#0 = 2 [phi:display_frame_draw::@7->display_frame#0] -- vbum1=vbuc1 lda #2 sta display_frame.y - // [2146] phi display_frame::y1#16 = $e [phi:display_frame_draw::@7->display_frame#1] -- vbum1=vbuc1 + // [1174] phi display_frame::y1#16 = $e [phi:display_frame_draw::@7->display_frame#1] -- vbum1=vbuc1 lda #$e sta display_frame.y1 - // [2146] phi display_frame::x#0 = 8 [phi:display_frame_draw::@7->display_frame#2] -- vbum1=vbuc1 + // [1174] phi display_frame::x#0 = 8 [phi:display_frame_draw::@7->display_frame#2] -- vbum1=vbuc1 lda #8 sta display_frame.x - // [2146] phi display_frame::x1#16 = $13 [phi:display_frame_draw::@7->display_frame#3] -- vbum1=vbuc1 + // [1174] phi display_frame::x1#16 = $13 [phi:display_frame_draw::@7->display_frame#3] -- vbum1=vbuc1 lda #$13 sta display_frame.x1 jsr display_frame - // [867] phi from display_frame_draw::@7 to display_frame_draw::@8 [phi:display_frame_draw::@7->display_frame_draw::@8] + // [522] phi from display_frame_draw::@7 to display_frame_draw::@8 [phi:display_frame_draw::@7->display_frame_draw::@8] // display_frame_draw::@8 // display_frame(19, 2, 25, 14) - // [868] call display_frame - // [2146] phi from display_frame_draw::@8 to display_frame [phi:display_frame_draw::@8->display_frame] - // [2146] phi display_frame::y#0 = 2 [phi:display_frame_draw::@8->display_frame#0] -- vbum1=vbuc1 + // [523] call display_frame + // [1174] phi from display_frame_draw::@8 to display_frame [phi:display_frame_draw::@8->display_frame] + // [1174] phi display_frame::y#0 = 2 [phi:display_frame_draw::@8->display_frame#0] -- vbum1=vbuc1 lda #2 sta display_frame.y - // [2146] phi display_frame::y1#16 = $e [phi:display_frame_draw::@8->display_frame#1] -- vbum1=vbuc1 + // [1174] phi display_frame::y1#16 = $e [phi:display_frame_draw::@8->display_frame#1] -- vbum1=vbuc1 lda #$e sta display_frame.y1 - // [2146] phi display_frame::x#0 = $13 [phi:display_frame_draw::@8->display_frame#2] -- vbum1=vbuc1 + // [1174] phi display_frame::x#0 = $13 [phi:display_frame_draw::@8->display_frame#2] -- vbum1=vbuc1 lda #$13 sta display_frame.x - // [2146] phi display_frame::x1#16 = $19 [phi:display_frame_draw::@8->display_frame#3] -- vbum1=vbuc1 + // [1174] phi display_frame::x1#16 = $19 [phi:display_frame_draw::@8->display_frame#3] -- vbum1=vbuc1 lda #$19 sta display_frame.x1 jsr display_frame - // [869] phi from display_frame_draw::@8 to display_frame_draw::@9 [phi:display_frame_draw::@8->display_frame_draw::@9] + // [524] phi from display_frame_draw::@8 to display_frame_draw::@9 [phi:display_frame_draw::@8->display_frame_draw::@9] // display_frame_draw::@9 // display_frame(25, 2, 31, 14) - // [870] call display_frame - // [2146] phi from display_frame_draw::@9 to display_frame [phi:display_frame_draw::@9->display_frame] - // [2146] phi display_frame::y#0 = 2 [phi:display_frame_draw::@9->display_frame#0] -- vbum1=vbuc1 + // [525] call display_frame + // [1174] phi from display_frame_draw::@9 to display_frame [phi:display_frame_draw::@9->display_frame] + // [1174] phi display_frame::y#0 = 2 [phi:display_frame_draw::@9->display_frame#0] -- vbum1=vbuc1 lda #2 sta display_frame.y - // [2146] phi display_frame::y1#16 = $e [phi:display_frame_draw::@9->display_frame#1] -- vbum1=vbuc1 + // [1174] phi display_frame::y1#16 = $e [phi:display_frame_draw::@9->display_frame#1] -- vbum1=vbuc1 lda #$e sta display_frame.y1 - // [2146] phi display_frame::x#0 = $19 [phi:display_frame_draw::@9->display_frame#2] -- vbum1=vbuc1 + // [1174] phi display_frame::x#0 = $19 [phi:display_frame_draw::@9->display_frame#2] -- vbum1=vbuc1 lda #$19 sta display_frame.x - // [2146] phi display_frame::x1#16 = $1f [phi:display_frame_draw::@9->display_frame#3] -- vbum1=vbuc1 + // [1174] phi display_frame::x1#16 = $1f [phi:display_frame_draw::@9->display_frame#3] -- vbum1=vbuc1 lda #$1f sta display_frame.x1 jsr display_frame - // [871] phi from display_frame_draw::@9 to display_frame_draw::@10 [phi:display_frame_draw::@9->display_frame_draw::@10] + // [526] phi from display_frame_draw::@9 to display_frame_draw::@10 [phi:display_frame_draw::@9->display_frame_draw::@10] // display_frame_draw::@10 // display_frame(31, 2, 37, 14) - // [872] call display_frame - // [2146] phi from display_frame_draw::@10 to display_frame [phi:display_frame_draw::@10->display_frame] - // [2146] phi display_frame::y#0 = 2 [phi:display_frame_draw::@10->display_frame#0] -- vbum1=vbuc1 + // [527] call display_frame + // [1174] phi from display_frame_draw::@10 to display_frame [phi:display_frame_draw::@10->display_frame] + // [1174] phi display_frame::y#0 = 2 [phi:display_frame_draw::@10->display_frame#0] -- vbum1=vbuc1 lda #2 sta display_frame.y - // [2146] phi display_frame::y1#16 = $e [phi:display_frame_draw::@10->display_frame#1] -- vbum1=vbuc1 + // [1174] phi display_frame::y1#16 = $e [phi:display_frame_draw::@10->display_frame#1] -- vbum1=vbuc1 lda #$e sta display_frame.y1 - // [2146] phi display_frame::x#0 = $1f [phi:display_frame_draw::@10->display_frame#2] -- vbum1=vbuc1 + // [1174] phi display_frame::x#0 = $1f [phi:display_frame_draw::@10->display_frame#2] -- vbum1=vbuc1 lda #$1f sta display_frame.x - // [2146] phi display_frame::x1#16 = $25 [phi:display_frame_draw::@10->display_frame#3] -- vbum1=vbuc1 + // [1174] phi display_frame::x1#16 = $25 [phi:display_frame_draw::@10->display_frame#3] -- vbum1=vbuc1 lda #$25 sta display_frame.x1 jsr display_frame - // [873] phi from display_frame_draw::@10 to display_frame_draw::@11 [phi:display_frame_draw::@10->display_frame_draw::@11] + // [528] phi from display_frame_draw::@10 to display_frame_draw::@11 [phi:display_frame_draw::@10->display_frame_draw::@11] // display_frame_draw::@11 // display_frame(37, 2, 43, 14) - // [874] call display_frame - // [2146] phi from display_frame_draw::@11 to display_frame [phi:display_frame_draw::@11->display_frame] - // [2146] phi display_frame::y#0 = 2 [phi:display_frame_draw::@11->display_frame#0] -- vbum1=vbuc1 + // [529] call display_frame + // [1174] phi from display_frame_draw::@11 to display_frame [phi:display_frame_draw::@11->display_frame] + // [1174] phi display_frame::y#0 = 2 [phi:display_frame_draw::@11->display_frame#0] -- vbum1=vbuc1 lda #2 sta display_frame.y - // [2146] phi display_frame::y1#16 = $e [phi:display_frame_draw::@11->display_frame#1] -- vbum1=vbuc1 + // [1174] phi display_frame::y1#16 = $e [phi:display_frame_draw::@11->display_frame#1] -- vbum1=vbuc1 lda #$e sta display_frame.y1 - // [2146] phi display_frame::x#0 = $25 [phi:display_frame_draw::@11->display_frame#2] -- vbum1=vbuc1 + // [1174] phi display_frame::x#0 = $25 [phi:display_frame_draw::@11->display_frame#2] -- vbum1=vbuc1 lda #$25 sta display_frame.x - // [2146] phi display_frame::x1#16 = $2b [phi:display_frame_draw::@11->display_frame#3] -- vbum1=vbuc1 + // [1174] phi display_frame::x1#16 = $2b [phi:display_frame_draw::@11->display_frame#3] -- vbum1=vbuc1 lda #$2b sta display_frame.x1 jsr display_frame - // [875] phi from display_frame_draw::@11 to display_frame_draw::@12 [phi:display_frame_draw::@11->display_frame_draw::@12] + // [530] phi from display_frame_draw::@11 to display_frame_draw::@12 [phi:display_frame_draw::@11->display_frame_draw::@12] // display_frame_draw::@12 // display_frame(43, 2, 49, 14) - // [876] call display_frame - // [2146] phi from display_frame_draw::@12 to display_frame [phi:display_frame_draw::@12->display_frame] - // [2146] phi display_frame::y#0 = 2 [phi:display_frame_draw::@12->display_frame#0] -- vbum1=vbuc1 + // [531] call display_frame + // [1174] phi from display_frame_draw::@12 to display_frame [phi:display_frame_draw::@12->display_frame] + // [1174] phi display_frame::y#0 = 2 [phi:display_frame_draw::@12->display_frame#0] -- vbum1=vbuc1 lda #2 sta display_frame.y - // [2146] phi display_frame::y1#16 = $e [phi:display_frame_draw::@12->display_frame#1] -- vbum1=vbuc1 + // [1174] phi display_frame::y1#16 = $e [phi:display_frame_draw::@12->display_frame#1] -- vbum1=vbuc1 lda #$e sta display_frame.y1 - // [2146] phi display_frame::x#0 = $2b [phi:display_frame_draw::@12->display_frame#2] -- vbum1=vbuc1 + // [1174] phi display_frame::x#0 = $2b [phi:display_frame_draw::@12->display_frame#2] -- vbum1=vbuc1 lda #$2b sta display_frame.x - // [2146] phi display_frame::x1#16 = $31 [phi:display_frame_draw::@12->display_frame#3] -- vbum1=vbuc1 + // [1174] phi display_frame::x1#16 = $31 [phi:display_frame_draw::@12->display_frame#3] -- vbum1=vbuc1 lda #$31 sta display_frame.x1 jsr display_frame - // [877] phi from display_frame_draw::@12 to display_frame_draw::@13 [phi:display_frame_draw::@12->display_frame_draw::@13] + // [532] phi from display_frame_draw::@12 to display_frame_draw::@13 [phi:display_frame_draw::@12->display_frame_draw::@13] // display_frame_draw::@13 // display_frame(49, 2, 55, 14) - // [878] call display_frame - // [2146] phi from display_frame_draw::@13 to display_frame [phi:display_frame_draw::@13->display_frame] - // [2146] phi display_frame::y#0 = 2 [phi:display_frame_draw::@13->display_frame#0] -- vbum1=vbuc1 + // [533] call display_frame + // [1174] phi from display_frame_draw::@13 to display_frame [phi:display_frame_draw::@13->display_frame] + // [1174] phi display_frame::y#0 = 2 [phi:display_frame_draw::@13->display_frame#0] -- vbum1=vbuc1 lda #2 sta display_frame.y - // [2146] phi display_frame::y1#16 = $e [phi:display_frame_draw::@13->display_frame#1] -- vbum1=vbuc1 + // [1174] phi display_frame::y1#16 = $e [phi:display_frame_draw::@13->display_frame#1] -- vbum1=vbuc1 lda #$e sta display_frame.y1 - // [2146] phi display_frame::x#0 = $31 [phi:display_frame_draw::@13->display_frame#2] -- vbum1=vbuc1 + // [1174] phi display_frame::x#0 = $31 [phi:display_frame_draw::@13->display_frame#2] -- vbum1=vbuc1 lda #$31 sta display_frame.x - // [2146] phi display_frame::x1#16 = $37 [phi:display_frame_draw::@13->display_frame#3] -- vbum1=vbuc1 + // [1174] phi display_frame::x1#16 = $37 [phi:display_frame_draw::@13->display_frame#3] -- vbum1=vbuc1 lda #$37 sta display_frame.x1 jsr display_frame - // [879] phi from display_frame_draw::@13 to display_frame_draw::@14 [phi:display_frame_draw::@13->display_frame_draw::@14] + // [534] phi from display_frame_draw::@13 to display_frame_draw::@14 [phi:display_frame_draw::@13->display_frame_draw::@14] // display_frame_draw::@14 // display_frame(55, 2, 61, 14) - // [880] call display_frame - // [2146] phi from display_frame_draw::@14 to display_frame [phi:display_frame_draw::@14->display_frame] - // [2146] phi display_frame::y#0 = 2 [phi:display_frame_draw::@14->display_frame#0] -- vbum1=vbuc1 + // [535] call display_frame + // [1174] phi from display_frame_draw::@14 to display_frame [phi:display_frame_draw::@14->display_frame] + // [1174] phi display_frame::y#0 = 2 [phi:display_frame_draw::@14->display_frame#0] -- vbum1=vbuc1 lda #2 sta display_frame.y - // [2146] phi display_frame::y1#16 = $e [phi:display_frame_draw::@14->display_frame#1] -- vbum1=vbuc1 + // [1174] phi display_frame::y1#16 = $e [phi:display_frame_draw::@14->display_frame#1] -- vbum1=vbuc1 lda #$e sta display_frame.y1 - // [2146] phi display_frame::x#0 = $37 [phi:display_frame_draw::@14->display_frame#2] -- vbum1=vbuc1 + // [1174] phi display_frame::x#0 = $37 [phi:display_frame_draw::@14->display_frame#2] -- vbum1=vbuc1 lda #$37 sta display_frame.x - // [2146] phi display_frame::x1#16 = $3d [phi:display_frame_draw::@14->display_frame#3] -- vbum1=vbuc1 + // [1174] phi display_frame::x1#16 = $3d [phi:display_frame_draw::@14->display_frame#3] -- vbum1=vbuc1 lda #$3d sta display_frame.x1 jsr display_frame - // [881] phi from display_frame_draw::@14 to display_frame_draw::@15 [phi:display_frame_draw::@14->display_frame_draw::@15] + // [536] phi from display_frame_draw::@14 to display_frame_draw::@15 [phi:display_frame_draw::@14->display_frame_draw::@15] // display_frame_draw::@15 // display_frame(61, 2, 67, 14) - // [882] call display_frame - // [2146] phi from display_frame_draw::@15 to display_frame [phi:display_frame_draw::@15->display_frame] - // [2146] phi display_frame::y#0 = 2 [phi:display_frame_draw::@15->display_frame#0] -- vbum1=vbuc1 + // [537] call display_frame + // [1174] phi from display_frame_draw::@15 to display_frame [phi:display_frame_draw::@15->display_frame] + // [1174] phi display_frame::y#0 = 2 [phi:display_frame_draw::@15->display_frame#0] -- vbum1=vbuc1 lda #2 sta display_frame.y - // [2146] phi display_frame::y1#16 = $e [phi:display_frame_draw::@15->display_frame#1] -- vbum1=vbuc1 + // [1174] phi display_frame::y1#16 = $e [phi:display_frame_draw::@15->display_frame#1] -- vbum1=vbuc1 lda #$e sta display_frame.y1 - // [2146] phi display_frame::x#0 = $3d [phi:display_frame_draw::@15->display_frame#2] -- vbum1=vbuc1 + // [1174] phi display_frame::x#0 = $3d [phi:display_frame_draw::@15->display_frame#2] -- vbum1=vbuc1 lda #$3d sta display_frame.x - // [2146] phi display_frame::x1#16 = $43 [phi:display_frame_draw::@15->display_frame#3] -- vbum1=vbuc1 + // [1174] phi display_frame::x1#16 = $43 [phi:display_frame_draw::@15->display_frame#3] -- vbum1=vbuc1 lda #$43 sta display_frame.x1 jsr display_frame - // [883] phi from display_frame_draw::@15 to display_frame_draw::@16 [phi:display_frame_draw::@15->display_frame_draw::@16] + // [538] phi from display_frame_draw::@15 to display_frame_draw::@16 [phi:display_frame_draw::@15->display_frame_draw::@16] // display_frame_draw::@16 // display_frame(0, 14, 67, PROGRESS_Y-5) - // [884] call display_frame + // [539] call display_frame // Progress area - // [2146] phi from display_frame_draw::@16 to display_frame [phi:display_frame_draw::@16->display_frame] - // [2146] phi display_frame::y#0 = $e [phi:display_frame_draw::@16->display_frame#0] -- vbum1=vbuc1 + // [1174] phi from display_frame_draw::@16 to display_frame [phi:display_frame_draw::@16->display_frame] + // [1174] phi display_frame::y#0 = $e [phi:display_frame_draw::@16->display_frame#0] -- vbum1=vbuc1 lda #$e sta display_frame.y - // [2146] phi display_frame::y1#16 = PROGRESS_Y-5 [phi:display_frame_draw::@16->display_frame#1] -- vbum1=vbuc1 + // [1174] phi display_frame::y1#16 = PROGRESS_Y-5 [phi:display_frame_draw::@16->display_frame#1] -- vbum1=vbuc1 lda #PROGRESS_Y-5 sta display_frame.y1 - // [2146] phi display_frame::x#0 = 0 [phi:display_frame_draw::@16->display_frame#2] -- vbum1=vbuc1 + // [1174] phi display_frame::x#0 = 0 [phi:display_frame_draw::@16->display_frame#2] -- vbum1=vbuc1 lda #0 sta display_frame.x - // [2146] phi display_frame::x1#16 = $43 [phi:display_frame_draw::@16->display_frame#3] -- vbum1=vbuc1 + // [1174] phi display_frame::x1#16 = $43 [phi:display_frame_draw::@16->display_frame#3] -- vbum1=vbuc1 lda #$43 sta display_frame.x1 jsr display_frame - // [885] phi from display_frame_draw::@16 to display_frame_draw::@17 [phi:display_frame_draw::@16->display_frame_draw::@17] + // [540] phi from display_frame_draw::@16 to display_frame_draw::@17 [phi:display_frame_draw::@16->display_frame_draw::@17] // display_frame_draw::@17 // display_frame(0, PROGRESS_Y-5, 67, PROGRESS_Y-2) - // [886] call display_frame - // [2146] phi from display_frame_draw::@17 to display_frame [phi:display_frame_draw::@17->display_frame] - // [2146] phi display_frame::y#0 = PROGRESS_Y-5 [phi:display_frame_draw::@17->display_frame#0] -- vbum1=vbuc1 + // [541] call display_frame + // [1174] phi from display_frame_draw::@17 to display_frame [phi:display_frame_draw::@17->display_frame] + // [1174] phi display_frame::y#0 = PROGRESS_Y-5 [phi:display_frame_draw::@17->display_frame#0] -- vbum1=vbuc1 lda #PROGRESS_Y-5 sta display_frame.y - // [2146] phi display_frame::y1#16 = PROGRESS_Y-2 [phi:display_frame_draw::@17->display_frame#1] -- vbum1=vbuc1 + // [1174] phi display_frame::y1#16 = PROGRESS_Y-2 [phi:display_frame_draw::@17->display_frame#1] -- vbum1=vbuc1 lda #PROGRESS_Y-2 sta display_frame.y1 - // [2146] phi display_frame::x#0 = 0 [phi:display_frame_draw::@17->display_frame#2] -- vbum1=vbuc1 + // [1174] phi display_frame::x#0 = 0 [phi:display_frame_draw::@17->display_frame#2] -- vbum1=vbuc1 lda #0 sta display_frame.x - // [2146] phi display_frame::x1#16 = $43 [phi:display_frame_draw::@17->display_frame#3] -- vbum1=vbuc1 + // [1174] phi display_frame::x1#16 = $43 [phi:display_frame_draw::@17->display_frame#3] -- vbum1=vbuc1 lda #$43 sta display_frame.x1 jsr display_frame - // [887] phi from display_frame_draw::@17 to display_frame_draw::@18 [phi:display_frame_draw::@17->display_frame_draw::@18] + // [542] phi from display_frame_draw::@17 to display_frame_draw::@18 [phi:display_frame_draw::@17->display_frame_draw::@18] // display_frame_draw::@18 // display_frame(0, PROGRESS_Y-2, 67, 49) - // [888] call display_frame - // [2146] phi from display_frame_draw::@18 to display_frame [phi:display_frame_draw::@18->display_frame] - // [2146] phi display_frame::y#0 = PROGRESS_Y-2 [phi:display_frame_draw::@18->display_frame#0] -- vbum1=vbuc1 + // [543] call display_frame + // [1174] phi from display_frame_draw::@18 to display_frame [phi:display_frame_draw::@18->display_frame] + // [1174] phi display_frame::y#0 = PROGRESS_Y-2 [phi:display_frame_draw::@18->display_frame#0] -- vbum1=vbuc1 lda #PROGRESS_Y-2 sta display_frame.y - // [2146] phi display_frame::y1#16 = $31 [phi:display_frame_draw::@18->display_frame#1] -- vbum1=vbuc1 + // [1174] phi display_frame::y1#16 = $31 [phi:display_frame_draw::@18->display_frame#1] -- vbum1=vbuc1 lda #$31 sta display_frame.y1 - // [2146] phi display_frame::x#0 = 0 [phi:display_frame_draw::@18->display_frame#2] -- vbum1=vbuc1 + // [1174] phi display_frame::x#0 = 0 [phi:display_frame_draw::@18->display_frame#2] -- vbum1=vbuc1 lda #0 sta display_frame.x - // [2146] phi display_frame::x1#16 = $43 [phi:display_frame_draw::@18->display_frame#3] -- vbum1=vbuc1 + // [1174] phi display_frame::x1#16 = $43 [phi:display_frame_draw::@18->display_frame#3] -- vbum1=vbuc1 lda #$43 sta display_frame.x1 jsr display_frame - // [889] phi from display_frame_draw::@18 to display_frame_draw::@19 [phi:display_frame_draw::@18->display_frame_draw::@19] + // [544] phi from display_frame_draw::@18 to display_frame_draw::@19 [phi:display_frame_draw::@18->display_frame_draw::@19] // display_frame_draw::@19 // textcolor(WHITE) - // [890] call textcolor - // [784] phi from display_frame_draw::@19 to textcolor [phi:display_frame_draw::@19->textcolor] - // [784] phi textcolor::color#23 = WHITE [phi:display_frame_draw::@19->textcolor#0] -- vbum1=vbuc1 + // [545] call textcolor + // [439] phi from display_frame_draw::@19 to textcolor [phi:display_frame_draw::@19->textcolor] + // [439] phi textcolor::color#21 = WHITE [phi:display_frame_draw::@19->textcolor#0] -- vbum1=vbuc1 lda #WHITE sta textcolor.color jsr textcolor // display_frame_draw::@return // } - // [891] return + // [546] return rts } // display_frame_title @@ -5922,73 +3474,73 @@ display_frame_draw: { // void display_frame_title(char *title_text) display_frame_title: { // gotoxy(2, 1) - // [893] call gotoxy - // [802] phi from display_frame_title to gotoxy [phi:display_frame_title->gotoxy] - // [802] phi gotoxy::y#37 = 1 [phi:display_frame_title->gotoxy#0] -- vbum1=vbuc1 + // [548] call gotoxy + // [457] phi from display_frame_title to gotoxy [phi:display_frame_title->gotoxy] + // [457] phi gotoxy::y#26 = 1 [phi:display_frame_title->gotoxy#0] -- vbum1=vbuc1 lda #1 sta gotoxy.y - // [802] phi gotoxy::x#37 = 2 [phi:display_frame_title->gotoxy#1] -- vbum1=vbuc1 + // [457] phi gotoxy::x#26 = 2 [phi:display_frame_title->gotoxy#1] -- vbum1=vbuc1 lda #2 sta gotoxy.x jsr gotoxy - // [894] phi from display_frame_title to display_frame_title::@1 [phi:display_frame_title->display_frame_title::@1] + // [549] phi from display_frame_title to display_frame_title::@1 [phi:display_frame_title->display_frame_title::@1] // display_frame_title::@1 // printf("%-65s", title_text) - // [895] call printf_string - // [1219] phi from display_frame_title::@1 to printf_string [phi:display_frame_title::@1->printf_string] - // [1219] phi printf_string::putc#26 = &cputc [phi:display_frame_title::@1->printf_string#0] -- pprz1=pprc1 + // [550] call printf_string + // [1308] phi from display_frame_title::@1 to printf_string [phi:display_frame_title::@1->printf_string] + // [1308] phi printf_string::putc#17 = &cputc [phi:display_frame_title::@1->printf_string#0] -- pprz1=pprc1 lda #cputc sta.z printf_string.putc+1 - // [1219] phi printf_string::str#26 = main::title_text [phi:display_frame_title::@1->printf_string#1] -- pbuz1=pbuc1 + // [1308] phi printf_string::str#17 = main::title_text [phi:display_frame_title::@1->printf_string#1] -- pbuz1=pbuc1 lda #main.title_text sta.z printf_string.str+1 - // [1219] phi printf_string::format_justify_left#26 = 1 [phi:display_frame_title::@1->printf_string#2] -- vbum1=vbuc1 + // [1308] phi printf_string::format_justify_left#17 = 1 [phi:display_frame_title::@1->printf_string#2] -- vbum1=vbuc1 lda #1 sta printf_string.format_justify_left - // [1219] phi printf_string::format_min_length#26 = $41 [phi:display_frame_title::@1->printf_string#3] -- vbum1=vbuc1 + // [1308] phi printf_string::format_min_length#17 = $41 [phi:display_frame_title::@1->printf_string#3] -- vbum1=vbuc1 lda #$41 sta printf_string.format_min_length jsr printf_string // display_frame_title::@return // } - // [896] return + // [551] return rts } // cputsxy // Move cursor and output a NUL-terminated string // Same as "gotoxy (x, y); puts (s);" -// void cputsxy(__mem() char x, __mem() char y, __zp($6c) const char *s) +// void cputsxy(__mem() char x, __mem() char y, __zp($49) const char *s) cputsxy: { - .label s = $6c + .label s = $49 // gotoxy(x, y) - // [898] gotoxy::x#1 = cputsxy::x#4 -- vbum1=vbum2 + // [553] gotoxy::x#1 = cputsxy::x#3 -- vbum1=vbum2 lda x sta gotoxy.x - // [899] gotoxy::y#1 = cputsxy::y#4 -- vbum1=vbum2 + // [554] gotoxy::y#1 = cputsxy::y#3 -- vbum1=vbum2 lda y sta gotoxy.y - // [900] call gotoxy - // [802] phi from cputsxy to gotoxy [phi:cputsxy->gotoxy] - // [802] phi gotoxy::y#37 = gotoxy::y#1 [phi:cputsxy->gotoxy#0] -- register_copy - // [802] phi gotoxy::x#37 = gotoxy::x#1 [phi:cputsxy->gotoxy#1] -- register_copy + // [555] call gotoxy + // [457] phi from cputsxy to gotoxy [phi:cputsxy->gotoxy] + // [457] phi gotoxy::y#26 = gotoxy::y#1 [phi:cputsxy->gotoxy#0] -- register_copy + // [457] phi gotoxy::x#26 = gotoxy::x#1 [phi:cputsxy->gotoxy#1] -- register_copy jsr gotoxy // cputsxy::@1 // cputs(s) - // [901] cputs::s#1 = cputsxy::s#4 -- pbuz1=pbuz2 + // [556] cputs::s#1 = cputsxy::s#3 -- pbuz1=pbuz2 lda.z s sta.z cputs.s lda.z s+1 sta.z cputs.s+1 - // [902] call cputs - // [2280] phi from cputsxy::@1 to cputs [phi:cputsxy::@1->cputs] + // [557] call cputs + // [1333] phi from cputsxy::@1 to cputs [phi:cputsxy::@1->cputs] jsr cputs // cputsxy::@return // } - // [903] return + // [558] return rts .segment Data y: .byte 0 @@ -6001,65 +3553,65 @@ cputsxy: { * * @param info_text The progress text to be displayed. */ -// void display_action_progress(__zp($50) char *info_text) +// void display_action_progress(__zp($42) char *info_text) display_action_progress: { - .label info_text = $50 + .label info_text = $42 // unsigned char x = wherex() - // [905] call wherex + // [560] call wherex jsr wherex - // [906] wherex::return#2 = wherex::return#0 + // [561] wherex::return#2 = wherex::return#0 // display_action_progress::@1 - // [907] display_action_progress::x#0 = wherex::return#2 + // [562] display_action_progress::x#0 = wherex::return#2 // unsigned char y = wherey() - // [908] call wherey + // [563] call wherey jsr wherey - // [909] wherey::return#2 = wherey::return#0 + // [564] wherey::return#2 = wherey::return#0 // display_action_progress::@2 - // [910] display_action_progress::y#0 = wherey::return#2 + // [565] display_action_progress::y#0 = wherey::return#2 // gotoxy(2, PROGRESS_Y-4) - // [911] call gotoxy - // [802] phi from display_action_progress::@2 to gotoxy [phi:display_action_progress::@2->gotoxy] - // [802] phi gotoxy::y#37 = PROGRESS_Y-4 [phi:display_action_progress::@2->gotoxy#0] -- vbum1=vbuc1 + // [566] call gotoxy + // [457] phi from display_action_progress::@2 to gotoxy [phi:display_action_progress::@2->gotoxy] + // [457] phi gotoxy::y#26 = PROGRESS_Y-4 [phi:display_action_progress::@2->gotoxy#0] -- vbum1=vbuc1 lda #PROGRESS_Y-4 sta gotoxy.y - // [802] phi gotoxy::x#37 = 2 [phi:display_action_progress::@2->gotoxy#1] -- vbum1=vbuc1 + // [457] phi gotoxy::x#26 = 2 [phi:display_action_progress::@2->gotoxy#1] -- vbum1=vbuc1 lda #2 sta gotoxy.x jsr gotoxy // display_action_progress::@3 // printf("%-65s", info_text) - // [912] printf_string::str#1 = display_action_progress::info_text#27 - // [913] call printf_string - // [1219] phi from display_action_progress::@3 to printf_string [phi:display_action_progress::@3->printf_string] - // [1219] phi printf_string::putc#26 = &cputc [phi:display_action_progress::@3->printf_string#0] -- pprz1=pprc1 + // [567] printf_string::str#1 = display_action_progress::info_text#19 + // [568] call printf_string + // [1308] phi from display_action_progress::@3 to printf_string [phi:display_action_progress::@3->printf_string] + // [1308] phi printf_string::putc#17 = &cputc [phi:display_action_progress::@3->printf_string#0] -- pprz1=pprc1 lda #cputc sta.z printf_string.putc+1 - // [1219] phi printf_string::str#26 = printf_string::str#1 [phi:display_action_progress::@3->printf_string#1] -- register_copy - // [1219] phi printf_string::format_justify_left#26 = 1 [phi:display_action_progress::@3->printf_string#2] -- vbum1=vbuc1 + // [1308] phi printf_string::str#17 = printf_string::str#1 [phi:display_action_progress::@3->printf_string#1] -- register_copy + // [1308] phi printf_string::format_justify_left#17 = 1 [phi:display_action_progress::@3->printf_string#2] -- vbum1=vbuc1 lda #1 sta printf_string.format_justify_left - // [1219] phi printf_string::format_min_length#26 = $41 [phi:display_action_progress::@3->printf_string#3] -- vbum1=vbuc1 + // [1308] phi printf_string::format_min_length#17 = $41 [phi:display_action_progress::@3->printf_string#3] -- vbum1=vbuc1 lda #$41 sta printf_string.format_min_length jsr printf_string // display_action_progress::@4 // gotoxy(x, y) - // [914] gotoxy::x#14 = display_action_progress::x#0 -- vbum1=vbum2 + // [569] gotoxy::x#14 = display_action_progress::x#0 -- vbum1=vbum2 lda x sta gotoxy.x - // [915] gotoxy::y#14 = display_action_progress::y#0 -- vbum1=vbum2 + // [570] gotoxy::y#14 = display_action_progress::y#0 -- vbum1=vbum2 lda y sta gotoxy.y - // [916] call gotoxy - // [802] phi from display_action_progress::@4 to gotoxy [phi:display_action_progress::@4->gotoxy] - // [802] phi gotoxy::y#37 = gotoxy::y#14 [phi:display_action_progress::@4->gotoxy#0] -- register_copy - // [802] phi gotoxy::x#37 = gotoxy::x#14 [phi:display_action_progress::@4->gotoxy#1] -- register_copy + // [571] call gotoxy + // [457] phi from display_action_progress::@4 to gotoxy [phi:display_action_progress::@4->gotoxy] + // [457] phi gotoxy::y#26 = gotoxy::y#14 [phi:display_action_progress::@4->gotoxy#0] -- register_copy + // [457] phi gotoxy::x#26 = gotoxy::x#14 [phi:display_action_progress::@4->gotoxy#1] -- register_copy jsr gotoxy // display_action_progress::@return // } - // [917] return + // [572] return rts .segment Data .label x = wherex.return @@ -6073,85 +3625,85 @@ display_action_progress: { display_progress_clear: { .const h = PROGRESS_Y+PROGRESS_H // textcolor(WHITE) - // [919] call textcolor - // [784] phi from display_progress_clear to textcolor [phi:display_progress_clear->textcolor] - // [784] phi textcolor::color#23 = WHITE [phi:display_progress_clear->textcolor#0] -- vbum1=vbuc1 + // [574] call textcolor + // [439] phi from display_progress_clear to textcolor [phi:display_progress_clear->textcolor] + // [439] phi textcolor::color#21 = WHITE [phi:display_progress_clear->textcolor#0] -- vbum1=vbuc1 lda #WHITE sta textcolor.color jsr textcolor - // [920] phi from display_progress_clear to display_progress_clear::@5 [phi:display_progress_clear->display_progress_clear::@5] + // [575] phi from display_progress_clear to display_progress_clear::@5 [phi:display_progress_clear->display_progress_clear::@5] // display_progress_clear::@5 // bgcolor(BLUE) - // [921] call bgcolor - // [789] phi from display_progress_clear::@5 to bgcolor [phi:display_progress_clear::@5->bgcolor] - // [789] phi bgcolor::color#15 = BLUE [phi:display_progress_clear::@5->bgcolor#0] -- vbum1=vbuc1 + // [576] call bgcolor + // [444] phi from display_progress_clear::@5 to bgcolor [phi:display_progress_clear::@5->bgcolor] + // [444] phi bgcolor::color#15 = BLUE [phi:display_progress_clear::@5->bgcolor#0] -- vbum1=vbuc1 lda #BLUE sta bgcolor.color jsr bgcolor - // [922] phi from display_progress_clear::@5 to display_progress_clear::@1 [phi:display_progress_clear::@5->display_progress_clear::@1] - // [922] phi display_progress_clear::y#2 = PROGRESS_Y [phi:display_progress_clear::@5->display_progress_clear::@1#0] -- vbum1=vbuc1 + // [577] phi from display_progress_clear::@5 to display_progress_clear::@1 [phi:display_progress_clear::@5->display_progress_clear::@1] + // [577] phi display_progress_clear::y#2 = PROGRESS_Y [phi:display_progress_clear::@5->display_progress_clear::@1#0] -- vbum1=vbuc1 lda #PROGRESS_Y sta y // display_progress_clear::@1 __b1: // while (y < h) - // [923] if(display_progress_clear::y#2display_progress_clear::@2] + // [580] phi from display_progress_clear::@1 to display_progress_clear::@2 [phi:display_progress_clear::@1->display_progress_clear::@2] __b4: - // [925] phi display_progress_clear::x#2 = PROGRESS_X [phi:display_progress_clear::@1->display_progress_clear::@2#0] -- vbum1=vbuc1 + // [580] phi display_progress_clear::x#2 = PROGRESS_X [phi:display_progress_clear::@1->display_progress_clear::@2#0] -- vbum1=vbuc1 lda #PROGRESS_X sta x - // [925] phi display_progress_clear::i#2 = 0 [phi:display_progress_clear::@1->display_progress_clear::@2#1] -- vbum1=vbuc1 + // [580] phi display_progress_clear::i#2 = 0 [phi:display_progress_clear::@1->display_progress_clear::@2#1] -- vbum1=vbuc1 lda #0 sta i // display_progress_clear::@2 __b2: // for(unsigned char i = 0; i < w; i++) - // [926] if(display_progress_clear::i#2display_progress_clear::@1] - // [922] phi display_progress_clear::y#2 = display_progress_clear::y#1 [phi:display_progress_clear::@4->display_progress_clear::@1#0] -- register_copy + // [577] phi from display_progress_clear::@4 to display_progress_clear::@1 [phi:display_progress_clear::@4->display_progress_clear::@1] + // [577] 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, ' ') - // [928] cputcxy::x#14 = display_progress_clear::x#2 -- vbum1=vbum2 + // [583] cputcxy::x#14 = display_progress_clear::x#2 -- vbum1=vbum2 lda x sta cputcxy.x - // [929] cputcxy::y#14 = display_progress_clear::y#2 -- vbum1=vbum2 + // [584] cputcxy::y#14 = display_progress_clear::y#2 -- vbum1=vbum2 lda y sta cputcxy.y - // [930] call cputcxy - // [2293] phi from display_progress_clear::@3 to cputcxy [phi:display_progress_clear::@3->cputcxy] - // [2293] phi cputcxy::c#17 = ' ' [phi:display_progress_clear::@3->cputcxy#0] -- vbum1=vbuc1 + // [585] call cputcxy + // [1346] phi from display_progress_clear::@3 to cputcxy [phi:display_progress_clear::@3->cputcxy] + // [1346] phi cputcxy::c#15 = ' ' [phi:display_progress_clear::@3->cputcxy#0] -- vbum1=vbuc1 lda #' ' sta cputcxy.c - // [2293] phi cputcxy::y#17 = cputcxy::y#14 [phi:display_progress_clear::@3->cputcxy#1] -- register_copy - // [2293] phi cputcxy::x#17 = cputcxy::x#14 [phi:display_progress_clear::@3->cputcxy#2] -- register_copy + // [1346] phi cputcxy::y#15 = cputcxy::y#14 [phi:display_progress_clear::@3->cputcxy#1] -- register_copy + // [1346] phi cputcxy::x#15 = cputcxy::x#14 [phi:display_progress_clear::@3->cputcxy#2] -- register_copy jsr cputcxy // display_progress_clear::@6 // x++; - // [931] display_progress_clear::x#1 = ++ display_progress_clear::x#2 -- vbum1=_inc_vbum1 + // [586] display_progress_clear::x#1 = ++ display_progress_clear::x#2 -- vbum1=_inc_vbum1 inc x // for(unsigned char i = 0; i < w; i++) - // [932] display_progress_clear::i#1 = ++ display_progress_clear::i#2 -- vbum1=_inc_vbum1 + // [587] display_progress_clear::i#1 = ++ display_progress_clear::i#2 -- vbum1=_inc_vbum1 inc i - // [925] phi from display_progress_clear::@6 to display_progress_clear::@2 [phi:display_progress_clear::@6->display_progress_clear::@2] - // [925] phi display_progress_clear::x#2 = display_progress_clear::x#1 [phi:display_progress_clear::@6->display_progress_clear::@2#0] -- register_copy - // [925] phi display_progress_clear::i#2 = display_progress_clear::i#1 [phi:display_progress_clear::@6->display_progress_clear::@2#1] -- register_copy + // [580] phi from display_progress_clear::@6 to display_progress_clear::@2 [phi:display_progress_clear::@6->display_progress_clear::@2] + // [580] phi display_progress_clear::x#2 = display_progress_clear::x#1 [phi:display_progress_clear::@6->display_progress_clear::@2#0] -- register_copy + // [580] 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 x: .byte 0 @@ -6162,32 +3714,32 @@ display_progress_clear: { // display_chip_smc display_chip_smc: { // display_smc_led(GREY) - // [934] call display_smc_led - // [2301] phi from display_chip_smc to display_smc_led [phi:display_chip_smc->display_smc_led] - // [2301] phi display_smc_led::c#2 = GREY [phi:display_chip_smc->display_smc_led#0] -- vbum1=vbuc1 + // [589] call display_smc_led + // [1354] phi from display_chip_smc to display_smc_led [phi:display_chip_smc->display_smc_led] + // [1354] phi display_smc_led::c#2 = GREY [phi:display_chip_smc->display_smc_led#0] -- vbum1=vbuc1 lda #GREY sta display_smc_led.c jsr display_smc_led - // [935] phi from display_chip_smc to display_chip_smc::@1 [phi:display_chip_smc->display_chip_smc::@1] + // [590] phi from display_chip_smc to display_chip_smc::@1 [phi:display_chip_smc->display_chip_smc::@1] // display_chip_smc::@1 // display_print_chip(CHIP_SMC_X, CHIP_SMC_Y+2, CHIP_SMC_W, "SMC ") - // [936] call display_print_chip - // [2307] phi from display_chip_smc::@1 to display_print_chip [phi:display_chip_smc::@1->display_print_chip] - // [2307] phi display_print_chip::text#11 = display_chip_smc::text [phi:display_chip_smc::@1->display_print_chip#0] -- pbuz1=pbuc1 + // [591] call display_print_chip + // [1360] phi from display_chip_smc::@1 to display_print_chip [phi:display_chip_smc::@1->display_print_chip] + // [1360] phi display_print_chip::text#11 = display_chip_smc::text [phi:display_chip_smc::@1->display_print_chip#0] -- pbuz1=pbuc1 lda #text sta.z display_print_chip.text_2+1 - // [2307] phi display_print_chip::w#10 = 5 [phi:display_chip_smc::@1->display_print_chip#1] -- vbum1=vbuc1 + // [1360] phi display_print_chip::w#10 = 5 [phi:display_chip_smc::@1->display_print_chip#1] -- vbum1=vbuc1 lda #5 sta display_print_chip.w - // [2307] phi display_print_chip::x#10 = 1 [phi:display_chip_smc::@1->display_print_chip#2] -- vbum1=vbuc1 + // [1360] phi display_print_chip::x#10 = 1 [phi:display_chip_smc::@1->display_print_chip#2] -- vbum1=vbuc1 lda #1 sta display_print_chip.x jsr display_print_chip // display_chip_smc::@return // } - // [937] return + // [592] return rts .segment Data text: .text "SMC " @@ -6197,32 +3749,32 @@ display_chip_smc: { // display_chip_vera display_chip_vera: { // display_vera_led(GREY) - // [939] call display_vera_led - // [2351] phi from display_chip_vera to display_vera_led [phi:display_chip_vera->display_vera_led] - // [2351] phi display_vera_led::c#2 = GREY [phi:display_chip_vera->display_vera_led#0] -- vbum1=vbuc1 + // [594] call display_vera_led + // [1404] phi from display_chip_vera to display_vera_led [phi:display_chip_vera->display_vera_led] + // [1404] phi display_vera_led::c#2 = GREY [phi:display_chip_vera->display_vera_led#0] -- vbum1=vbuc1 lda #GREY sta display_vera_led.c jsr display_vera_led - // [940] phi from display_chip_vera to display_chip_vera::@1 [phi:display_chip_vera->display_chip_vera::@1] + // [595] phi from display_chip_vera to display_chip_vera::@1 [phi:display_chip_vera->display_chip_vera::@1] // display_chip_vera::@1 // display_print_chip(CHIP_VERA_X, CHIP_VERA_Y+2, CHIP_VERA_W, "VERA ") - // [941] call display_print_chip - // [2307] phi from display_chip_vera::@1 to display_print_chip [phi:display_chip_vera::@1->display_print_chip] - // [2307] phi display_print_chip::text#11 = display_chip_vera::text [phi:display_chip_vera::@1->display_print_chip#0] -- pbuz1=pbuc1 + // [596] call display_print_chip + // [1360] phi from display_chip_vera::@1 to display_print_chip [phi:display_chip_vera::@1->display_print_chip] + // [1360] phi display_print_chip::text#11 = display_chip_vera::text [phi:display_chip_vera::@1->display_print_chip#0] -- pbuz1=pbuc1 lda #text sta.z display_print_chip.text_2+1 - // [2307] phi display_print_chip::w#10 = 8 [phi:display_chip_vera::@1->display_print_chip#1] -- vbum1=vbuc1 + // [1360] phi display_print_chip::w#10 = 8 [phi:display_chip_vera::@1->display_print_chip#1] -- vbum1=vbuc1 lda #8 sta display_print_chip.w - // [2307] phi display_print_chip::x#10 = 9 [phi:display_chip_vera::@1->display_print_chip#2] -- vbum1=vbuc1 + // [1360] phi display_print_chip::x#10 = 9 [phi:display_chip_vera::@1->display_print_chip#2] -- vbum1=vbuc1 lda #9 sta display_print_chip.x jsr display_print_chip // display_chip_vera::@return // } - // [942] return + // [597] return rts .segment Data text: .text "VERA " @@ -6235,37 +3787,37 @@ display_chip_vera: { * */ display_chip_rom: { - .label display_chip_rom__4 = $42 - .label display_chip_rom__6 = $2b - .label display_chip_rom__11 = $2b - .label display_chip_rom__12 = $2b - // [944] phi from display_chip_rom to display_chip_rom::@1 [phi:display_chip_rom->display_chip_rom::@1] - // [944] phi display_chip_rom::r#2 = 0 [phi:display_chip_rom->display_chip_rom::@1#0] -- vbum1=vbuc1 + .label display_chip_rom__4 = $4e + .label display_chip_rom__6 = $4d + .label display_chip_rom__11 = $4d + .label display_chip_rom__12 = $4d + // [599] phi from display_chip_rom to display_chip_rom::@1 [phi:display_chip_rom->display_chip_rom::@1] + // [599] phi display_chip_rom::r#2 = 0 [phi:display_chip_rom->display_chip_rom::@1#0] -- vbum1=vbuc1 lda #0 sta r // display_chip_rom::@1 __b1: // for (unsigned char r = 0; r < 8; r++) - // [945] if(display_chip_rom::r#2<8) goto display_chip_rom::@2 -- vbum1_lt_vbuc1_then_la1 + // [600] if(display_chip_rom::r#2<8) goto display_chip_rom::@2 -- vbum1_lt_vbuc1_then_la1 lda r cmp #8 bcc __b2 // display_chip_rom::@return // } - // [946] return + // [601] return rts - // [947] phi from display_chip_rom::@1 to display_chip_rom::@2 [phi:display_chip_rom::@1->display_chip_rom::@2] + // [602] phi from display_chip_rom::@1 to display_chip_rom::@2 [phi:display_chip_rom::@1->display_chip_rom::@2] // display_chip_rom::@2 __b2: // strcpy(rom, "ROM ") - // [948] call strcpy - // [1066] phi from display_chip_rom::@2 to strcpy [phi:display_chip_rom::@2->strcpy] - // [1066] phi strcpy::dst#0 = display_chip_rom::rom [phi:display_chip_rom::@2->strcpy#0] -- pbuz1=pbuc1 + // [603] call strcpy + // [1117] phi from display_chip_rom::@2 to strcpy [phi:display_chip_rom::@2->strcpy] + // [1117] phi strcpy::dst#0 = display_chip_rom::rom [phi:display_chip_rom::@2->strcpy#0] -- pbuz1=pbuc1 lda #rom sta.z strcpy.dst+1 - // [1066] phi strcpy::src#0 = display_chip_rom::source [phi:display_chip_rom::@2->strcpy#1] -- pbuz1=pbuc1 + // [1117] phi strcpy::src#0 = display_chip_rom::source [phi:display_chip_rom::@2->strcpy#1] -- pbuz1=pbuc1 lda #source @@ -6273,80 +3825,80 @@ display_chip_rom: { jsr strcpy // display_chip_rom::@5 // strcat(rom, rom_size_strings[r]) - // [949] display_chip_rom::$11 = display_chip_rom::r#2 << 1 -- vbuz1=vbum2_rol_1 + // [604] display_chip_rom::$11 = display_chip_rom::r#2 << 1 -- vbuz1=vbum2_rol_1 lda r asl sta.z display_chip_rom__11 - // [950] strcat::source#0 = rom_size_strings[display_chip_rom::$11] -- pbuz1=qbuc1_derefidx_vbuz2 + // [605] strcat::source#0 = rom_size_strings[display_chip_rom::$11] -- pbuz1=qbuc1_derefidx_vbuz2 tay lda rom_size_strings,y sta.z strcat.source lda rom_size_strings+1,y sta.z strcat.source+1 - // [951] call strcat - // [2357] phi from display_chip_rom::@5 to strcat [phi:display_chip_rom::@5->strcat] + // [606] call strcat + // [1410] phi from display_chip_rom::@5 to strcat [phi:display_chip_rom::@5->strcat] jsr strcat // display_chip_rom::@6 // if(r) - // [952] if(0==display_chip_rom::r#2) goto display_chip_rom::@3 -- 0_eq_vbum1_then_la1 + // [607] if(0==display_chip_rom::r#2) goto display_chip_rom::@3 -- 0_eq_vbum1_then_la1 lda r beq __b3 // display_chip_rom::@4 // r+'0' - // [953] display_chip_rom::$4 = display_chip_rom::r#2 + '0' -- vbuz1=vbum2_plus_vbuc1 + // [608] display_chip_rom::$4 = display_chip_rom::r#2 + '0' -- vbuz1=vbum2_plus_vbuc1 lda #'0' clc adc r sta.z display_chip_rom__4 // *(rom+3) = r+'0' - // [954] *(display_chip_rom::rom+3) = display_chip_rom::$4 -- _deref_pbuc1=vbuz1 + // [609] *(display_chip_rom::rom+3) = display_chip_rom::$4 -- _deref_pbuc1=vbuz1 sta rom+3 // display_chip_rom::@3 __b3: // display_rom_led(r, GREY) - // [955] display_rom_led::chip#0 = display_chip_rom::r#2 -- vbum1=vbum2 + // [610] display_rom_led::chip#0 = display_chip_rom::r#2 -- vbum1=vbum2 lda r sta display_rom_led.chip - // [956] call display_rom_led - // [2369] phi from display_chip_rom::@3 to display_rom_led [phi:display_chip_rom::@3->display_rom_led] - // [2369] phi display_rom_led::c#2 = GREY [phi:display_chip_rom::@3->display_rom_led#0] -- vbum1=vbuc1 + // [611] call display_rom_led + // [1422] phi from display_chip_rom::@3 to display_rom_led [phi:display_chip_rom::@3->display_rom_led] + // [1422] phi display_rom_led::c#2 = GREY [phi:display_chip_rom::@3->display_rom_led#0] -- vbum1=vbuc1 lda #GREY sta display_rom_led.c - // [2369] phi display_rom_led::chip#2 = display_rom_led::chip#0 [phi:display_chip_rom::@3->display_rom_led#1] -- register_copy + // [1422] phi display_rom_led::chip#2 = display_rom_led::chip#0 [phi:display_chip_rom::@3->display_rom_led#1] -- register_copy jsr display_rom_led // display_chip_rom::@7 // r*6 - // [957] display_chip_rom::$12 = display_chip_rom::$11 + display_chip_rom::r#2 -- vbuz1=vbuz1_plus_vbum2 + // [612] display_chip_rom::$12 = display_chip_rom::$11 + display_chip_rom::r#2 -- vbuz1=vbuz1_plus_vbum2 lda r clc adc.z display_chip_rom__12 sta.z display_chip_rom__12 - // [958] display_chip_rom::$6 = display_chip_rom::$12 << 1 -- vbuz1=vbuz1_rol_1 + // [613] display_chip_rom::$6 = display_chip_rom::$12 << 1 -- vbuz1=vbuz1_rol_1 asl.z display_chip_rom__6 // display_print_chip(CHIP_ROM_X+r*6, CHIP_ROM_Y+2, CHIP_ROM_W, rom) - // [959] display_print_chip::x#2 = $14 + display_chip_rom::$6 -- vbum1=vbuc1_plus_vbuz2 + // [614] display_print_chip::x#2 = $14 + display_chip_rom::$6 -- vbum1=vbuc1_plus_vbuz2 lda #$14 clc adc.z display_chip_rom__6 sta display_print_chip.x - // [960] call display_print_chip - // [2307] phi from display_chip_rom::@7 to display_print_chip [phi:display_chip_rom::@7->display_print_chip] - // [2307] phi display_print_chip::text#11 = display_chip_rom::rom [phi:display_chip_rom::@7->display_print_chip#0] -- pbuz1=pbuc1 + // [615] call display_print_chip + // [1360] phi from display_chip_rom::@7 to display_print_chip [phi:display_chip_rom::@7->display_print_chip] + // [1360] phi display_print_chip::text#11 = display_chip_rom::rom [phi:display_chip_rom::@7->display_print_chip#0] -- pbuz1=pbuc1 lda #rom sta.z display_print_chip.text_2+1 - // [2307] phi display_print_chip::w#10 = 3 [phi:display_chip_rom::@7->display_print_chip#1] -- vbum1=vbuc1 + // [1360] phi display_print_chip::w#10 = 3 [phi:display_chip_rom::@7->display_print_chip#1] -- vbum1=vbuc1 lda #3 sta display_print_chip.w - // [2307] phi display_print_chip::x#10 = display_print_chip::x#2 [phi:display_chip_rom::@7->display_print_chip#2] -- register_copy + // [1360] phi display_print_chip::x#10 = display_print_chip::x#2 [phi:display_chip_rom::@7->display_print_chip#2] -- register_copy jsr display_print_chip // display_chip_rom::@8 // for (unsigned char r = 0; r < 8; r++) - // [961] display_chip_rom::r#1 = ++ display_chip_rom::r#2 -- vbum1=_inc_vbum1 + // [616] display_chip_rom::r#1 = ++ display_chip_rom::r#2 -- vbum1=_inc_vbum1 inc r - // [944] phi from display_chip_rom::@8 to display_chip_rom::@1 [phi:display_chip_rom::@8->display_chip_rom::@1] - // [944] phi display_chip_rom::r#2 = display_chip_rom::r#1 [phi:display_chip_rom::@8->display_chip_rom::@1#0] -- register_copy + // [599] phi from display_chip_rom::@8 to display_chip_rom::@1 [phi:display_chip_rom::@8->display_chip_rom::@1] + // [599] phi display_chip_rom::r#2 = display_chip_rom::r#1 [phi:display_chip_rom::@8->display_chip_rom::@1#0] -- register_copy jmp __b1 .segment Data rom: .fill $10, 0 @@ -6363,62 +3915,62 @@ display_chip_rom: { * * @remark The smc_booloader is a global variable. */ -// void display_info_smc(__mem() char info_status, __zp($45) char *info_text) +// void display_info_smc(__mem() char info_status, __zp($34) char *info_text) display_info_smc: { - .label display_info_smc__9 = $2b - .label info_text = $45 + .label display_info_smc__9 = $4d + .label info_text = $34 // unsigned char x = wherex() - // [963] call wherex + // [618] call wherex jsr wherex - // [964] wherex::return#10 = wherex::return#0 -- vbum1=vbum2 + // [619] wherex::return#10 = wherex::return#0 -- vbum1=vbum2 lda wherex.return sta wherex.return_2 // display_info_smc::@3 - // [965] display_info_smc::x#0 = wherex::return#10 + // [620] display_info_smc::x#0 = wherex::return#10 // unsigned char y = wherey() - // [966] call wherey + // [621] call wherey jsr wherey - // [967] wherey::return#10 = wherey::return#0 -- vbum1=vbum2 + // [622] wherey::return#10 = wherey::return#0 -- vbum1=vbum2 lda wherey.return sta wherey.return_2 // display_info_smc::@4 - // [968] display_info_smc::y#0 = wherey::return#10 + // [623] display_info_smc::y#0 = wherey::return#10 // status_smc = info_status - // [969] status_smc#0 = display_info_smc::info_status#20 -- vbum1=vbum2 + // [624] status_smc#0 = display_info_smc::info_status#10 -- vbum1=vbum2 lda info_status sta status_smc // display_smc_led(status_color[info_status]) - // [970] display_smc_led::c#1 = status_color[display_info_smc::info_status#20] -- vbum1=pbuc1_derefidx_vbum2 + // [625] display_smc_led::c#1 = status_color[display_info_smc::info_status#10] -- vbum1=pbuc1_derefidx_vbum2 ldy info_status lda status_color,y sta display_smc_led.c - // [971] call display_smc_led - // [2301] phi from display_info_smc::@4 to display_smc_led [phi:display_info_smc::@4->display_smc_led] - // [2301] phi display_smc_led::c#2 = display_smc_led::c#1 [phi:display_info_smc::@4->display_smc_led#0] -- register_copy + // [626] call display_smc_led + // [1354] phi from display_info_smc::@4 to display_smc_led [phi:display_info_smc::@4->display_smc_led] + // [1354] phi display_smc_led::c#2 = display_smc_led::c#1 [phi:display_info_smc::@4->display_smc_led#0] -- register_copy jsr display_smc_led - // [972] phi from display_info_smc::@4 to display_info_smc::@5 [phi:display_info_smc::@4->display_info_smc::@5] + // [627] phi from display_info_smc::@4 to display_info_smc::@5 [phi:display_info_smc::@4->display_info_smc::@5] // display_info_smc::@5 // gotoxy(INFO_X, INFO_Y) - // [973] call gotoxy - // [802] phi from display_info_smc::@5 to gotoxy [phi:display_info_smc::@5->gotoxy] - // [802] phi gotoxy::y#37 = $11 [phi:display_info_smc::@5->gotoxy#0] -- vbum1=vbuc1 + // [628] call gotoxy + // [457] phi from display_info_smc::@5 to gotoxy [phi:display_info_smc::@5->gotoxy] + // [457] phi gotoxy::y#26 = $11 [phi:display_info_smc::@5->gotoxy#0] -- vbum1=vbuc1 lda #$11 sta gotoxy.y - // [802] phi gotoxy::x#37 = 4 [phi:display_info_smc::@5->gotoxy#1] -- vbum1=vbuc1 + // [457] phi gotoxy::x#26 = 4 [phi:display_info_smc::@5->gotoxy#1] -- vbum1=vbuc1 lda #4 sta gotoxy.x jsr gotoxy - // [974] phi from display_info_smc::@5 to display_info_smc::@6 [phi:display_info_smc::@5->display_info_smc::@6] + // [629] phi from display_info_smc::@5 to display_info_smc::@6 [phi:display_info_smc::@5->display_info_smc::@6] // display_info_smc::@6 // printf("SMC %-9s ATTiny %-8s BL:%u ", status_text[info_status], smc_version_text, smc_bootloader) - // [975] call printf_str - // [1210] phi from display_info_smc::@6 to printf_str [phi:display_info_smc::@6->printf_str] - // [1210] phi printf_str::putc#84 = &cputc [phi:display_info_smc::@6->printf_str#0] -- pprz1=pprc1 + // [630] call printf_str + // [785] phi from display_info_smc::@6 to printf_str [phi:display_info_smc::@6->printf_str] + // [785] phi printf_str::putc#53 = &cputc [phi:display_info_smc::@6->printf_str#0] -- pprz1=pprc1 lda #cputc sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = display_info_smc::s [phi:display_info_smc::@6->printf_str#1] -- pbuz1=pbuc1 + // [785] phi printf_str::s#53 = display_info_smc::s [phi:display_info_smc::@6->printf_str#1] -- pbuz1=pbuc1 lda #s @@ -6426,128 +3978,128 @@ 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) - // [976] display_info_smc::$9 = display_info_smc::info_status#20 << 1 -- vbuz1=vbum2_rol_1 + // [631] display_info_smc::$9 = display_info_smc::info_status#10 << 1 -- vbuz1=vbum2_rol_1 lda info_status asl sta.z display_info_smc__9 - // [977] printf_string::str#3 = status_text[display_info_smc::$9] -- pbuz1=qbuc1_derefidx_vbuz2 + // [632] printf_string::str#3 = status_text[display_info_smc::$9] -- pbuz1=qbuc1_derefidx_vbuz2 tay lda status_text,y sta.z printf_string.str lda status_text+1,y sta.z printf_string.str+1 - // [978] call printf_string - // [1219] phi from display_info_smc::@7 to printf_string [phi:display_info_smc::@7->printf_string] - // [1219] phi printf_string::putc#26 = &cputc [phi:display_info_smc::@7->printf_string#0] -- pprz1=pprc1 + // [633] call printf_string + // [1308] phi from display_info_smc::@7 to printf_string [phi:display_info_smc::@7->printf_string] + // [1308] phi printf_string::putc#17 = &cputc [phi:display_info_smc::@7->printf_string#0] -- pprz1=pprc1 lda #cputc sta.z printf_string.putc+1 - // [1219] phi printf_string::str#26 = printf_string::str#3 [phi:display_info_smc::@7->printf_string#1] -- register_copy - // [1219] phi printf_string::format_justify_left#26 = 1 [phi:display_info_smc::@7->printf_string#2] -- vbum1=vbuc1 + // [1308] phi printf_string::str#17 = printf_string::str#3 [phi:display_info_smc::@7->printf_string#1] -- register_copy + // [1308] phi printf_string::format_justify_left#17 = 1 [phi:display_info_smc::@7->printf_string#2] -- vbum1=vbuc1 lda #1 sta printf_string.format_justify_left - // [1219] phi printf_string::format_min_length#26 = 9 [phi:display_info_smc::@7->printf_string#3] -- vbum1=vbuc1 + // [1308] phi printf_string::format_min_length#17 = 9 [phi:display_info_smc::@7->printf_string#3] -- vbum1=vbuc1 lda #9 sta printf_string.format_min_length jsr printf_string - // [979] phi from display_info_smc::@7 to display_info_smc::@8 [phi:display_info_smc::@7->display_info_smc::@8] + // [634] phi from display_info_smc::@7 to display_info_smc::@8 [phi:display_info_smc::@7->display_info_smc::@8] // display_info_smc::@8 // printf("SMC %-9s ATTiny %-8s BL:%u ", status_text[info_status], smc_version_text, smc_bootloader) - // [980] call printf_str - // [1210] phi from display_info_smc::@8 to printf_str [phi:display_info_smc::@8->printf_str] - // [1210] phi printf_str::putc#84 = &cputc [phi:display_info_smc::@8->printf_str#0] -- pprz1=pprc1 + // [635] call printf_str + // [785] phi from display_info_smc::@8 to printf_str [phi:display_info_smc::@8->printf_str] + // [785] phi printf_str::putc#53 = &cputc [phi:display_info_smc::@8->printf_str#0] -- pprz1=pprc1 lda #cputc sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = display_info_smc::s1 [phi:display_info_smc::@8->printf_str#1] -- pbuz1=pbuc1 + // [785] phi printf_str::s#53 = display_info_smc::s1 [phi:display_info_smc::@8->printf_str#1] -- pbuz1=pbuc1 lda #s1 sta.z printf_str.s+1 jsr printf_str - // [981] phi from display_info_smc::@8 to display_info_smc::@9 [phi:display_info_smc::@8->display_info_smc::@9] + // [636] phi from display_info_smc::@8 to display_info_smc::@9 [phi:display_info_smc::@8->display_info_smc::@9] // display_info_smc::@9 // printf("SMC %-9s ATTiny %-8s BL:%u ", status_text[info_status], smc_version_text, smc_bootloader) - // [982] call printf_string - // [1219] phi from display_info_smc::@9 to printf_string [phi:display_info_smc::@9->printf_string] - // [1219] phi printf_string::putc#26 = &cputc [phi:display_info_smc::@9->printf_string#0] -- pprz1=pprc1 + // [637] call printf_string + // [1308] phi from display_info_smc::@9 to printf_string [phi:display_info_smc::@9->printf_string] + // [1308] phi printf_string::putc#17 = &cputc [phi:display_info_smc::@9->printf_string#0] -- pprz1=pprc1 lda #cputc sta.z printf_string.putc+1 - // [1219] phi printf_string::str#26 = smc_version_text [phi:display_info_smc::@9->printf_string#1] -- pbuz1=pbuc1 + // [1308] phi printf_string::str#17 = smc_version_text [phi:display_info_smc::@9->printf_string#1] -- pbuz1=pbuc1 lda #smc_version_text sta.z printf_string.str+1 - // [1219] phi printf_string::format_justify_left#26 = 1 [phi:display_info_smc::@9->printf_string#2] -- vbum1=vbuc1 + // [1308] phi printf_string::format_justify_left#17 = 1 [phi:display_info_smc::@9->printf_string#2] -- vbum1=vbuc1 lda #1 sta printf_string.format_justify_left - // [1219] phi printf_string::format_min_length#26 = 8 [phi:display_info_smc::@9->printf_string#3] -- vbum1=vbuc1 + // [1308] phi printf_string::format_min_length#17 = 8 [phi:display_info_smc::@9->printf_string#3] -- vbum1=vbuc1 lda #8 sta printf_string.format_min_length jsr printf_string - // [983] phi from display_info_smc::@9 to display_info_smc::@10 [phi:display_info_smc::@9->display_info_smc::@10] + // [638] phi from display_info_smc::@9 to display_info_smc::@10 [phi:display_info_smc::@9->display_info_smc::@10] // display_info_smc::@10 // printf("SMC %-9s ATTiny %-8s BL:%u ", status_text[info_status], smc_version_text, smc_bootloader) - // [984] call printf_str - // [1210] phi from display_info_smc::@10 to printf_str [phi:display_info_smc::@10->printf_str] - // [1210] phi printf_str::putc#84 = &cputc [phi:display_info_smc::@10->printf_str#0] -- pprz1=pprc1 + // [639] call printf_str + // [785] phi from display_info_smc::@10 to printf_str [phi:display_info_smc::@10->printf_str] + // [785] phi printf_str::putc#53 = &cputc [phi:display_info_smc::@10->printf_str#0] -- pprz1=pprc1 lda #cputc sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = display_info_smc::s2 [phi:display_info_smc::@10->printf_str#1] -- pbuz1=pbuc1 + // [785] phi printf_str::s#53 = display_info_smc::s2 [phi:display_info_smc::@10->printf_str#1] -- pbuz1=pbuc1 lda #s2 sta.z printf_str.s+1 jsr printf_str + // [640] phi from display_info_smc::@10 to display_info_smc::@11 [phi:display_info_smc::@10->display_info_smc::@11] // display_info_smc::@11 // printf("SMC %-9s ATTiny %-8s BL:%u ", status_text[info_status], smc_version_text, smc_bootloader) - // [985] printf_uint::uvalue#1 = smc_bootloader#14 -- vwum1=vwum2 - lda smc_bootloader_1 - sta printf_uint.uvalue - lda smc_bootloader_1+1 - sta printf_uint.uvalue+1 - // [986] call printf_uint - // [2086] phi from display_info_smc::@11 to printf_uint [phi:display_info_smc::@11->printf_uint] - // [2086] phi printf_uint::format_zero_padding#10 = 0 [phi:display_info_smc::@11->printf_uint#0] -- vbum1=vbuc1 + // [641] call printf_uint + // [1433] phi from display_info_smc::@11 to printf_uint [phi:display_info_smc::@11->printf_uint] + // [1433] phi printf_uint::format_zero_padding#4 = 0 [phi:display_info_smc::@11->printf_uint#0] -- vbum1=vbuc1 lda #0 sta printf_uint.format_zero_padding - // [2086] phi printf_uint::format_min_length#10 = 0 [phi:display_info_smc::@11->printf_uint#1] -- vbum1=vbuc1 + // [1433] phi printf_uint::format_min_length#4 = 0 [phi:display_info_smc::@11->printf_uint#1] -- vbum1=vbuc1 sta printf_uint.format_min_length - // [2086] phi printf_uint::putc#10 = &cputc [phi:display_info_smc::@11->printf_uint#2] -- pprz1=pprc1 + // [1433] phi printf_uint::putc#4 = &cputc [phi:display_info_smc::@11->printf_uint#2] -- pprz1=pprc1 lda #cputc sta.z printf_uint.putc+1 - // [2086] phi printf_uint::format_radix#10 = DECIMAL [phi:display_info_smc::@11->printf_uint#3] -- vbum1=vbuc1 + // [1433] phi printf_uint::format_radix#4 = DECIMAL [phi:display_info_smc::@11->printf_uint#3] -- vbum1=vbuc1 lda #DECIMAL sta printf_uint.format_radix - // [2086] phi printf_uint::uvalue#10 = printf_uint::uvalue#1 [phi:display_info_smc::@11->printf_uint#4] -- register_copy + // [1433] phi printf_uint::uvalue#4 = smc_bootloader [phi:display_info_smc::@11->printf_uint#4] -- vwum1=vwuc1 + lda #smc_bootloader + sta printf_uint.uvalue+1 jsr printf_uint - // [987] phi from display_info_smc::@11 to display_info_smc::@12 [phi:display_info_smc::@11->display_info_smc::@12] + // [642] phi from display_info_smc::@11 to display_info_smc::@12 [phi:display_info_smc::@11->display_info_smc::@12] // display_info_smc::@12 // printf("SMC %-9s ATTiny %-8s BL:%u ", status_text[info_status], smc_version_text, smc_bootloader) - // [988] call printf_str - // [1210] phi from display_info_smc::@12 to printf_str [phi:display_info_smc::@12->printf_str] - // [1210] phi printf_str::putc#84 = &cputc [phi:display_info_smc::@12->printf_str#0] -- pprz1=pprc1 + // [643] call printf_str + // [785] phi from display_info_smc::@12 to printf_str [phi:display_info_smc::@12->printf_str] + // [785] phi printf_str::putc#53 = &cputc [phi:display_info_smc::@12->printf_str#0] -- pprz1=pprc1 lda #cputc sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = s4 [phi:display_info_smc::@12->printf_str#1] -- pbuz1=pbuc1 - lda #printf_str#1] -- pbuz1=pbuc1 + lda #<@s sta.z printf_str.s - lda #>s4 + lda #>@s sta.z printf_str.s+1 jsr printf_str // display_info_smc::@13 // if(info_text) - // [989] if((char *)0==display_info_smc::info_text#20) goto display_info_smc::@1 -- pbuc1_eq_pbuz1_then_la1 + // [644] if((char *)0==display_info_smc::info_text#10) goto display_info_smc::@1 -- pbuc1_eq_pbuz1_then_la1 lda.z info_text cmp #<0 bne !+ @@ -6555,57 +4107,57 @@ display_info_smc: { cmp #>0 beq __b1 !: - // [990] phi from display_info_smc::@13 to display_info_smc::@2 [phi:display_info_smc::@13->display_info_smc::@2] + // [645] phi from display_info_smc::@13 to display_info_smc::@2 [phi:display_info_smc::@13->display_info_smc::@2] // display_info_smc::@2 // gotoxy(INFO_X+64-28, INFO_Y) - // [991] call gotoxy - // [802] phi from display_info_smc::@2 to gotoxy [phi:display_info_smc::@2->gotoxy] - // [802] phi gotoxy::y#37 = $11 [phi:display_info_smc::@2->gotoxy#0] -- vbum1=vbuc1 + // [646] call gotoxy + // [457] phi from display_info_smc::@2 to gotoxy [phi:display_info_smc::@2->gotoxy] + // [457] phi gotoxy::y#26 = $11 [phi:display_info_smc::@2->gotoxy#0] -- vbum1=vbuc1 lda #$11 sta gotoxy.y - // [802] phi gotoxy::x#37 = 4+$40-$1c [phi:display_info_smc::@2->gotoxy#1] -- vbum1=vbuc1 + // [457] phi gotoxy::x#26 = 4+$40-$1c [phi:display_info_smc::@2->gotoxy#1] -- vbum1=vbuc1 lda #4+$40-$1c sta gotoxy.x jsr gotoxy // display_info_smc::@14 // printf("%-25s", info_text) - // [992] printf_string::str#5 = display_info_smc::info_text#20 -- pbuz1=pbuz2 + // [647] printf_string::str#5 = display_info_smc::info_text#10 -- pbuz1=pbuz2 lda.z info_text sta.z printf_string.str lda.z info_text+1 sta.z printf_string.str+1 - // [993] call printf_string - // [1219] phi from display_info_smc::@14 to printf_string [phi:display_info_smc::@14->printf_string] - // [1219] phi printf_string::putc#26 = &cputc [phi:display_info_smc::@14->printf_string#0] -- pprz1=pprc1 + // [648] call printf_string + // [1308] phi from display_info_smc::@14 to printf_string [phi:display_info_smc::@14->printf_string] + // [1308] phi printf_string::putc#17 = &cputc [phi:display_info_smc::@14->printf_string#0] -- pprz1=pprc1 lda #cputc sta.z printf_string.putc+1 - // [1219] phi printf_string::str#26 = printf_string::str#5 [phi:display_info_smc::@14->printf_string#1] -- register_copy - // [1219] phi printf_string::format_justify_left#26 = 1 [phi:display_info_smc::@14->printf_string#2] -- vbum1=vbuc1 + // [1308] phi printf_string::str#17 = printf_string::str#5 [phi:display_info_smc::@14->printf_string#1] -- register_copy + // [1308] phi printf_string::format_justify_left#17 = 1 [phi:display_info_smc::@14->printf_string#2] -- vbum1=vbuc1 lda #1 sta printf_string.format_justify_left - // [1219] phi printf_string::format_min_length#26 = $19 [phi:display_info_smc::@14->printf_string#3] -- vbum1=vbuc1 + // [1308] phi printf_string::format_min_length#17 = $19 [phi:display_info_smc::@14->printf_string#3] -- vbum1=vbuc1 lda #$19 sta printf_string.format_min_length jsr printf_string // display_info_smc::@1 __b1: // gotoxy(x, y) - // [994] gotoxy::x#18 = display_info_smc::x#0 -- vbum1=vbum2 + // [649] gotoxy::x#18 = display_info_smc::x#0 -- vbum1=vbum2 lda x sta gotoxy.x - // [995] gotoxy::y#18 = display_info_smc::y#0 -- vbum1=vbum2 + // [650] gotoxy::y#18 = display_info_smc::y#0 -- vbum1=vbum2 lda y sta gotoxy.y - // [996] call gotoxy - // [802] phi from display_info_smc::@1 to gotoxy [phi:display_info_smc::@1->gotoxy] - // [802] phi gotoxy::y#37 = gotoxy::y#18 [phi:display_info_smc::@1->gotoxy#0] -- register_copy - // [802] phi gotoxy::x#37 = gotoxy::x#18 [phi:display_info_smc::@1->gotoxy#1] -- register_copy + // [651] call gotoxy + // [457] phi from display_info_smc::@1 to gotoxy [phi:display_info_smc::@1->gotoxy] + // [457] phi gotoxy::y#26 = gotoxy::y#18 [phi:display_info_smc::@1->gotoxy#0] -- register_copy + // [457] phi gotoxy::x#26 = gotoxy::x#18 [phi:display_info_smc::@1->gotoxy#1] -- register_copy jsr gotoxy // display_info_smc::@return // } - // [997] return + // [652] return rts .segment Data s: .text "SMC " @@ -6625,62 +4177,62 @@ display_info_smc: { * * @param info_status The STATUS_ */ -// void display_info_vera(__mem() char info_status, __zp($5e) char *info_text) +// void display_info_vera(__mem() char info_status, __zp($36) char *info_text) display_info_vera: { - .label display_info_vera__9 = $42 - .label info_text = $5e + .label display_info_vera__9 = $4e + .label info_text = $36 // unsigned char x = wherex() - // [999] call wherex + // [654] call wherex jsr wherex - // [1000] wherex::return#11 = wherex::return#0 -- vbum1=vbum2 + // [655] wherex::return#11 = wherex::return#0 -- vbum1=vbum2 lda wherex.return sta wherex.return_3 // display_info_vera::@3 - // [1001] display_info_vera::x#0 = wherex::return#11 + // [656] display_info_vera::x#0 = wherex::return#11 // unsigned char y = wherey() - // [1002] call wherey + // [657] call wherey jsr wherey - // [1003] wherey::return#11 = wherey::return#0 -- vbum1=vbum2 + // [658] wherey::return#11 = wherey::return#0 -- vbum1=vbum2 lda wherey.return sta wherey.return_3 // display_info_vera::@4 - // [1004] display_info_vera::y#0 = wherey::return#11 + // [659] display_info_vera::y#0 = wherey::return#11 // status_vera = info_status - // [1005] status_vera#127 = display_info_vera::info_status#19 -- vbum1=vbum2 + // [660] status_vera#127 = display_info_vera::info_status#19 -- vbum1=vbum2 lda info_status sta status_vera // display_vera_led(status_color[info_status]) - // [1006] display_vera_led::c#1 = status_color[display_info_vera::info_status#19] -- vbum1=pbuc1_derefidx_vbum2 + // [661] display_vera_led::c#1 = status_color[display_info_vera::info_status#19] -- vbum1=pbuc1_derefidx_vbum2 ldy info_status lda status_color,y sta display_vera_led.c - // [1007] call display_vera_led - // [2351] phi from display_info_vera::@4 to display_vera_led [phi:display_info_vera::@4->display_vera_led] - // [2351] phi display_vera_led::c#2 = display_vera_led::c#1 [phi:display_info_vera::@4->display_vera_led#0] -- register_copy + // [662] call display_vera_led + // [1404] phi from display_info_vera::@4 to display_vera_led [phi:display_info_vera::@4->display_vera_led] + // [1404] phi display_vera_led::c#2 = display_vera_led::c#1 [phi:display_info_vera::@4->display_vera_led#0] -- register_copy jsr display_vera_led - // [1008] phi from display_info_vera::@4 to display_info_vera::@5 [phi:display_info_vera::@4->display_info_vera::@5] + // [663] phi from display_info_vera::@4 to display_info_vera::@5 [phi:display_info_vera::@4->display_info_vera::@5] // display_info_vera::@5 // gotoxy(INFO_X, INFO_Y+1) - // [1009] call gotoxy - // [802] phi from display_info_vera::@5 to gotoxy [phi:display_info_vera::@5->gotoxy] - // [802] phi gotoxy::y#37 = $11+1 [phi:display_info_vera::@5->gotoxy#0] -- vbum1=vbuc1 + // [664] call gotoxy + // [457] phi from display_info_vera::@5 to gotoxy [phi:display_info_vera::@5->gotoxy] + // [457] phi gotoxy::y#26 = $11+1 [phi:display_info_vera::@5->gotoxy#0] -- vbum1=vbuc1 lda #$11+1 sta gotoxy.y - // [802] phi gotoxy::x#37 = 4 [phi:display_info_vera::@5->gotoxy#1] -- vbum1=vbuc1 + // [457] phi gotoxy::x#26 = 4 [phi:display_info_vera::@5->gotoxy#1] -- vbum1=vbuc1 lda #4 sta gotoxy.x jsr gotoxy - // [1010] phi from display_info_vera::@5 to display_info_vera::@6 [phi:display_info_vera::@5->display_info_vera::@6] + // [665] phi from display_info_vera::@5 to display_info_vera::@6 [phi:display_info_vera::@5->display_info_vera::@6] // display_info_vera::@6 // printf("VERA %-9s SPI %0x %0x %0x ", status_text[info_status], spi_manufacturer, spi_memory_type, spi_memory_capacity) - // [1011] call printf_str - // [1210] phi from display_info_vera::@6 to printf_str [phi:display_info_vera::@6->printf_str] - // [1210] phi printf_str::putc#84 = &cputc [phi:display_info_vera::@6->printf_str#0] -- pprz1=pprc1 + // [666] call printf_str + // [785] phi from display_info_vera::@6 to printf_str [phi:display_info_vera::@6->printf_str] + // [785] phi printf_str::putc#53 = &cputc [phi:display_info_vera::@6->printf_str#0] -- pprz1=pprc1 lda #cputc sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = display_info_vera::s [phi:display_info_vera::@6->printf_str#1] -- pbuz1=pbuc1 + // [785] phi printf_str::s#53 = display_info_vera::s [phi:display_info_vera::@6->printf_str#1] -- pbuz1=pbuc1 lda #s @@ -6688,42 +4240,42 @@ display_info_vera: { jsr printf_str // display_info_vera::@7 // printf("VERA %-9s SPI %0x %0x %0x ", status_text[info_status], spi_manufacturer, spi_memory_type, spi_memory_capacity) - // [1012] display_info_vera::$9 = display_info_vera::info_status#19 << 1 -- vbuz1=vbum2_rol_1 + // [667] display_info_vera::$9 = display_info_vera::info_status#19 << 1 -- vbuz1=vbum2_rol_1 lda info_status asl sta.z display_info_vera__9 - // [1013] printf_string::str#6 = status_text[display_info_vera::$9] -- pbuz1=qbuc1_derefidx_vbuz2 + // [668] printf_string::str#6 = status_text[display_info_vera::$9] -- pbuz1=qbuc1_derefidx_vbuz2 tay lda status_text,y sta.z printf_string.str lda status_text+1,y sta.z printf_string.str+1 - // [1014] call printf_string - // [1219] phi from display_info_vera::@7 to printf_string [phi:display_info_vera::@7->printf_string] - // [1219] phi printf_string::putc#26 = &cputc [phi:display_info_vera::@7->printf_string#0] -- pprz1=pprc1 + // [669] call printf_string + // [1308] phi from display_info_vera::@7 to printf_string [phi:display_info_vera::@7->printf_string] + // [1308] phi printf_string::putc#17 = &cputc [phi:display_info_vera::@7->printf_string#0] -- pprz1=pprc1 lda #cputc sta.z printf_string.putc+1 - // [1219] phi printf_string::str#26 = printf_string::str#6 [phi:display_info_vera::@7->printf_string#1] -- register_copy - // [1219] phi printf_string::format_justify_left#26 = 1 [phi:display_info_vera::@7->printf_string#2] -- vbum1=vbuc1 + // [1308] phi printf_string::str#17 = printf_string::str#6 [phi:display_info_vera::@7->printf_string#1] -- register_copy + // [1308] phi printf_string::format_justify_left#17 = 1 [phi:display_info_vera::@7->printf_string#2] -- vbum1=vbuc1 lda #1 sta printf_string.format_justify_left - // [1219] phi printf_string::format_min_length#26 = 9 [phi:display_info_vera::@7->printf_string#3] -- vbum1=vbuc1 + // [1308] phi printf_string::format_min_length#17 = 9 [phi:display_info_vera::@7->printf_string#3] -- vbum1=vbuc1 lda #9 sta printf_string.format_min_length jsr printf_string - // [1015] phi from display_info_vera::@7 to display_info_vera::@8 [phi:display_info_vera::@7->display_info_vera::@8] + // [670] phi from display_info_vera::@7 to display_info_vera::@8 [phi:display_info_vera::@7->display_info_vera::@8] // display_info_vera::@8 // printf("VERA %-9s SPI %0x %0x %0x ", status_text[info_status], spi_manufacturer, spi_memory_type, spi_memory_capacity) - // [1016] call printf_str - // [1210] phi from display_info_vera::@8 to printf_str [phi:display_info_vera::@8->printf_str] - // [1210] phi printf_str::putc#84 = &cputc [phi:display_info_vera::@8->printf_str#0] -- pprz1=pprc1 + // [671] call printf_str + // [785] phi from display_info_vera::@8 to printf_str [phi:display_info_vera::@8->printf_str] + // [785] phi printf_str::putc#53 = &cputc [phi:display_info_vera::@8->printf_str#0] -- pprz1=pprc1 lda #cputc sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = display_info_vera::s1 [phi:display_info_vera::@8->printf_str#1] -- pbuz1=pbuc1 + // [785] phi printf_str::s#53 = display_info_vera::s1 [phi:display_info_vera::@8->printf_str#1] -- pbuz1=pbuc1 lda #s1 @@ -6731,116 +4283,116 @@ display_info_vera: { jsr printf_str // display_info_vera::@9 // printf("VERA %-9s SPI %0x %0x %0x ", status_text[info_status], spi_manufacturer, spi_memory_type, spi_memory_capacity) - // [1017] printf_uchar::uvalue#1 = spi_manufacturer#108 -- vbum1=vbum2 + // [672] printf_uchar::uvalue#1 = spi_manufacturer#100 -- vbum1=vbum2 lda spi_manufacturer sta printf_uchar.uvalue - // [1018] call printf_uchar - // [1346] phi from display_info_vera::@9 to printf_uchar [phi:display_info_vera::@9->printf_uchar] - // [1346] phi printf_uchar::format_zero_padding#18 = 1 [phi:display_info_vera::@9->printf_uchar#0] -- vbum1=vbuc1 + // [673] call printf_uchar + // [834] phi from display_info_vera::@9 to printf_uchar [phi:display_info_vera::@9->printf_uchar] + // [834] phi printf_uchar::format_zero_padding#10 = 1 [phi:display_info_vera::@9->printf_uchar#0] -- vbum1=vbuc1 lda #1 sta printf_uchar.format_zero_padding - // [1346] phi printf_uchar::format_min_length#18 = 0 [phi:display_info_vera::@9->printf_uchar#1] -- vbum1=vbuc1 + // [834] phi printf_uchar::format_min_length#10 = 0 [phi:display_info_vera::@9->printf_uchar#1] -- vbum1=vbuc1 lda #0 sta printf_uchar.format_min_length - // [1346] phi printf_uchar::putc#18 = &cputc [phi:display_info_vera::@9->printf_uchar#2] -- pprz1=pprc1 + // [834] phi printf_uchar::putc#10 = &cputc [phi:display_info_vera::@9->printf_uchar#2] -- pprz1=pprc1 lda #cputc sta.z printf_uchar.putc+1 - // [1346] phi printf_uchar::format_radix#18 = HEXADECIMAL [phi:display_info_vera::@9->printf_uchar#3] -- vbum1=vbuc1 + // [834] phi printf_uchar::format_radix#10 = HEXADECIMAL [phi:display_info_vera::@9->printf_uchar#3] -- vbum1=vbuc1 lda #HEXADECIMAL sta printf_uchar.format_radix - // [1346] phi printf_uchar::uvalue#18 = printf_uchar::uvalue#1 [phi:display_info_vera::@9->printf_uchar#4] -- register_copy + // [834] phi printf_uchar::uvalue#10 = printf_uchar::uvalue#1 [phi:display_info_vera::@9->printf_uchar#4] -- register_copy jsr printf_uchar - // [1019] phi from display_info_vera::@9 to display_info_vera::@10 [phi:display_info_vera::@9->display_info_vera::@10] + // [674] phi from display_info_vera::@9 to display_info_vera::@10 [phi:display_info_vera::@9->display_info_vera::@10] // display_info_vera::@10 // printf("VERA %-9s SPI %0x %0x %0x ", status_text[info_status], spi_manufacturer, spi_memory_type, spi_memory_capacity) - // [1020] call printf_str - // [1210] phi from display_info_vera::@10 to printf_str [phi:display_info_vera::@10->printf_str] - // [1210] phi printf_str::putc#84 = &cputc [phi:display_info_vera::@10->printf_str#0] -- pprz1=pprc1 + // [675] call printf_str + // [785] phi from display_info_vera::@10 to printf_str [phi:display_info_vera::@10->printf_str] + // [785] phi printf_str::putc#53 = &cputc [phi:display_info_vera::@10->printf_str#0] -- pprz1=pprc1 lda #cputc sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = s4 [phi:display_info_vera::@10->printf_str#1] -- pbuz1=pbuc1 - lda #<@s4 + // [785] phi printf_str::s#53 = s [phi:display_info_vera::@10->printf_str#1] -- pbuz1=pbuc1 + lda #<@s sta.z printf_str.s - lda #>@s4 + lda #>@s sta.z printf_str.s+1 jsr printf_str // display_info_vera::@11 // printf("VERA %-9s SPI %0x %0x %0x ", status_text[info_status], spi_manufacturer, spi_memory_type, spi_memory_capacity) - // [1021] printf_uchar::uvalue#2 = spi_memory_type#107 -- vbum1=vbum2 + // [676] printf_uchar::uvalue#2 = spi_memory_type#111 -- vbum1=vbum2 lda spi_memory_type sta printf_uchar.uvalue - // [1022] call printf_uchar - // [1346] phi from display_info_vera::@11 to printf_uchar [phi:display_info_vera::@11->printf_uchar] - // [1346] phi printf_uchar::format_zero_padding#18 = 1 [phi:display_info_vera::@11->printf_uchar#0] -- vbum1=vbuc1 + // [677] call printf_uchar + // [834] phi from display_info_vera::@11 to printf_uchar [phi:display_info_vera::@11->printf_uchar] + // [834] phi printf_uchar::format_zero_padding#10 = 1 [phi:display_info_vera::@11->printf_uchar#0] -- vbum1=vbuc1 lda #1 sta printf_uchar.format_zero_padding - // [1346] phi printf_uchar::format_min_length#18 = 0 [phi:display_info_vera::@11->printf_uchar#1] -- vbum1=vbuc1 + // [834] phi printf_uchar::format_min_length#10 = 0 [phi:display_info_vera::@11->printf_uchar#1] -- vbum1=vbuc1 lda #0 sta printf_uchar.format_min_length - // [1346] phi printf_uchar::putc#18 = &cputc [phi:display_info_vera::@11->printf_uchar#2] -- pprz1=pprc1 + // [834] phi printf_uchar::putc#10 = &cputc [phi:display_info_vera::@11->printf_uchar#2] -- pprz1=pprc1 lda #cputc sta.z printf_uchar.putc+1 - // [1346] phi printf_uchar::format_radix#18 = HEXADECIMAL [phi:display_info_vera::@11->printf_uchar#3] -- vbum1=vbuc1 + // [834] phi printf_uchar::format_radix#10 = HEXADECIMAL [phi:display_info_vera::@11->printf_uchar#3] -- vbum1=vbuc1 lda #HEXADECIMAL sta printf_uchar.format_radix - // [1346] phi printf_uchar::uvalue#18 = printf_uchar::uvalue#2 [phi:display_info_vera::@11->printf_uchar#4] -- register_copy + // [834] phi printf_uchar::uvalue#10 = printf_uchar::uvalue#2 [phi:display_info_vera::@11->printf_uchar#4] -- register_copy jsr printf_uchar - // [1023] phi from display_info_vera::@11 to display_info_vera::@12 [phi:display_info_vera::@11->display_info_vera::@12] + // [678] phi from display_info_vera::@11 to display_info_vera::@12 [phi:display_info_vera::@11->display_info_vera::@12] // display_info_vera::@12 // printf("VERA %-9s SPI %0x %0x %0x ", status_text[info_status], spi_manufacturer, spi_memory_type, spi_memory_capacity) - // [1024] call printf_str - // [1210] phi from display_info_vera::@12 to printf_str [phi:display_info_vera::@12->printf_str] - // [1210] phi printf_str::putc#84 = &cputc [phi:display_info_vera::@12->printf_str#0] -- pprz1=pprc1 + // [679] call printf_str + // [785] phi from display_info_vera::@12 to printf_str [phi:display_info_vera::@12->printf_str] + // [785] phi printf_str::putc#53 = &cputc [phi:display_info_vera::@12->printf_str#0] -- pprz1=pprc1 lda #cputc sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = s4 [phi:display_info_vera::@12->printf_str#1] -- pbuz1=pbuc1 - lda #<@s4 + // [785] phi printf_str::s#53 = s [phi:display_info_vera::@12->printf_str#1] -- pbuz1=pbuc1 + lda #<@s sta.z printf_str.s - lda #>@s4 + lda #>@s sta.z printf_str.s+1 jsr printf_str // display_info_vera::@13 // printf("VERA %-9s SPI %0x %0x %0x ", status_text[info_status], spi_manufacturer, spi_memory_type, spi_memory_capacity) - // [1025] printf_uchar::uvalue#3 = spi_memory_capacity#106 -- vbum1=vbum2 + // [680] printf_uchar::uvalue#3 = spi_memory_capacity#110 -- vbum1=vbum2 lda spi_memory_capacity sta printf_uchar.uvalue - // [1026] call printf_uchar - // [1346] phi from display_info_vera::@13 to printf_uchar [phi:display_info_vera::@13->printf_uchar] - // [1346] phi printf_uchar::format_zero_padding#18 = 1 [phi:display_info_vera::@13->printf_uchar#0] -- vbum1=vbuc1 + // [681] call printf_uchar + // [834] phi from display_info_vera::@13 to printf_uchar [phi:display_info_vera::@13->printf_uchar] + // [834] phi printf_uchar::format_zero_padding#10 = 1 [phi:display_info_vera::@13->printf_uchar#0] -- vbum1=vbuc1 lda #1 sta printf_uchar.format_zero_padding - // [1346] phi printf_uchar::format_min_length#18 = 0 [phi:display_info_vera::@13->printf_uchar#1] -- vbum1=vbuc1 + // [834] phi printf_uchar::format_min_length#10 = 0 [phi:display_info_vera::@13->printf_uchar#1] -- vbum1=vbuc1 lda #0 sta printf_uchar.format_min_length - // [1346] phi printf_uchar::putc#18 = &cputc [phi:display_info_vera::@13->printf_uchar#2] -- pprz1=pprc1 + // [834] phi printf_uchar::putc#10 = &cputc [phi:display_info_vera::@13->printf_uchar#2] -- pprz1=pprc1 lda #cputc sta.z printf_uchar.putc+1 - // [1346] phi printf_uchar::format_radix#18 = HEXADECIMAL [phi:display_info_vera::@13->printf_uchar#3] -- vbum1=vbuc1 + // [834] phi printf_uchar::format_radix#10 = HEXADECIMAL [phi:display_info_vera::@13->printf_uchar#3] -- vbum1=vbuc1 lda #HEXADECIMAL sta printf_uchar.format_radix - // [1346] phi printf_uchar::uvalue#18 = printf_uchar::uvalue#3 [phi:display_info_vera::@13->printf_uchar#4] -- register_copy + // [834] phi printf_uchar::uvalue#10 = printf_uchar::uvalue#3 [phi:display_info_vera::@13->printf_uchar#4] -- register_copy jsr printf_uchar - // [1027] phi from display_info_vera::@13 to display_info_vera::@14 [phi:display_info_vera::@13->display_info_vera::@14] + // [682] phi from display_info_vera::@13 to display_info_vera::@14 [phi:display_info_vera::@13->display_info_vera::@14] // display_info_vera::@14 // printf("VERA %-9s SPI %0x %0x %0x ", status_text[info_status], spi_manufacturer, spi_memory_type, spi_memory_capacity) - // [1028] call printf_str - // [1210] phi from display_info_vera::@14 to printf_str [phi:display_info_vera::@14->printf_str] - // [1210] phi printf_str::putc#84 = &cputc [phi:display_info_vera::@14->printf_str#0] -- pprz1=pprc1 + // [683] call printf_str + // [785] phi from display_info_vera::@14 to printf_str [phi:display_info_vera::@14->printf_str] + // [785] phi printf_str::putc#53 = &cputc [phi:display_info_vera::@14->printf_str#0] -- pprz1=pprc1 lda #cputc sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = display_info_vera::s4 [phi:display_info_vera::@14->printf_str#1] -- pbuz1=pbuc1 + // [785] phi printf_str::s#53 = display_info_vera::s4 [phi:display_info_vera::@14->printf_str#1] -- pbuz1=pbuc1 lda #s4 @@ -6848,7 +4400,7 @@ display_info_vera: { jsr printf_str // display_info_vera::@15 // if(info_text) - // [1029] if((char *)0==display_info_vera::info_text#19) goto display_info_vera::@1 -- pbuc1_eq_pbuz1_then_la1 + // [684] if((char *)0==display_info_vera::info_text#19) goto display_info_vera::@1 -- pbuc1_eq_pbuz1_then_la1 lda.z info_text cmp #<0 bne !+ @@ -6856,57 +4408,57 @@ display_info_vera: { cmp #>0 beq __b1 !: - // [1030] phi from display_info_vera::@15 to display_info_vera::@2 [phi:display_info_vera::@15->display_info_vera::@2] + // [685] phi from display_info_vera::@15 to display_info_vera::@2 [phi:display_info_vera::@15->display_info_vera::@2] // display_info_vera::@2 // gotoxy(INFO_X+64-28, INFO_Y+1) - // [1031] call gotoxy - // [802] phi from display_info_vera::@2 to gotoxy [phi:display_info_vera::@2->gotoxy] - // [802] phi gotoxy::y#37 = $11+1 [phi:display_info_vera::@2->gotoxy#0] -- vbum1=vbuc1 + // [686] call gotoxy + // [457] phi from display_info_vera::@2 to gotoxy [phi:display_info_vera::@2->gotoxy] + // [457] phi gotoxy::y#26 = $11+1 [phi:display_info_vera::@2->gotoxy#0] -- vbum1=vbuc1 lda #$11+1 sta gotoxy.y - // [802] phi gotoxy::x#37 = 4+$40-$1c [phi:display_info_vera::@2->gotoxy#1] -- vbum1=vbuc1 + // [457] phi gotoxy::x#26 = 4+$40-$1c [phi:display_info_vera::@2->gotoxy#1] -- vbum1=vbuc1 lda #4+$40-$1c sta gotoxy.x jsr gotoxy // display_info_vera::@16 // printf("%-25s", info_text) - // [1032] printf_string::str#7 = display_info_vera::info_text#19 -- pbuz1=pbuz2 + // [687] printf_string::str#7 = display_info_vera::info_text#19 -- pbuz1=pbuz2 lda.z info_text sta.z printf_string.str lda.z info_text+1 sta.z printf_string.str+1 - // [1033] call printf_string - // [1219] phi from display_info_vera::@16 to printf_string [phi:display_info_vera::@16->printf_string] - // [1219] phi printf_string::putc#26 = &cputc [phi:display_info_vera::@16->printf_string#0] -- pprz1=pprc1 + // [688] call printf_string + // [1308] phi from display_info_vera::@16 to printf_string [phi:display_info_vera::@16->printf_string] + // [1308] phi printf_string::putc#17 = &cputc [phi:display_info_vera::@16->printf_string#0] -- pprz1=pprc1 lda #cputc sta.z printf_string.putc+1 - // [1219] phi printf_string::str#26 = printf_string::str#7 [phi:display_info_vera::@16->printf_string#1] -- register_copy - // [1219] phi printf_string::format_justify_left#26 = 1 [phi:display_info_vera::@16->printf_string#2] -- vbum1=vbuc1 + // [1308] phi printf_string::str#17 = printf_string::str#7 [phi:display_info_vera::@16->printf_string#1] -- register_copy + // [1308] phi printf_string::format_justify_left#17 = 1 [phi:display_info_vera::@16->printf_string#2] -- vbum1=vbuc1 lda #1 sta printf_string.format_justify_left - // [1219] phi printf_string::format_min_length#26 = $19 [phi:display_info_vera::@16->printf_string#3] -- vbum1=vbuc1 + // [1308] phi printf_string::format_min_length#17 = $19 [phi:display_info_vera::@16->printf_string#3] -- vbum1=vbuc1 lda #$19 sta printf_string.format_min_length jsr printf_string // display_info_vera::@1 __b1: // gotoxy(x, y) - // [1034] gotoxy::x#21 = display_info_vera::x#0 -- vbum1=vbum2 + // [689] gotoxy::x#21 = display_info_vera::x#0 -- vbum1=vbum2 lda x sta gotoxy.x - // [1035] gotoxy::y#21 = display_info_vera::y#0 -- vbum1=vbum2 + // [690] gotoxy::y#21 = display_info_vera::y#0 -- vbum1=vbum2 lda y sta gotoxy.y - // [1036] call gotoxy - // [802] phi from display_info_vera::@1 to gotoxy [phi:display_info_vera::@1->gotoxy] - // [802] phi gotoxy::y#37 = gotoxy::y#21 [phi:display_info_vera::@1->gotoxy#0] -- register_copy - // [802] phi gotoxy::x#37 = gotoxy::x#21 [phi:display_info_vera::@1->gotoxy#1] -- register_copy + // [691] call gotoxy + // [457] phi from display_info_vera::@1 to gotoxy [phi:display_info_vera::@1->gotoxy] + // [457] phi gotoxy::y#26 = gotoxy::y#21 [phi:display_info_vera::@1->gotoxy#0] -- register_copy + // [457] phi gotoxy::x#26 = gotoxy::x#21 [phi:display_info_vera::@1->gotoxy#1] -- register_copy jsr gotoxy // display_info_vera::@return // } - // [1037] return + // [692] return rts .segment Data s: .text "VERA " @@ -6922,2030 +4474,761 @@ display_info_vera: { .segment CodeIntro // main_intro main_intro: { - .label intro_status = $c7 + .label intro_status = $7a // display_progress_text(display_into_briefing_text, display_intro_briefing_count) - // [1039] call display_progress_text - // [1331] phi from main_intro to display_progress_text [phi:main_intro->display_progress_text] - // [1331] phi display_progress_text::text#13 = display_into_briefing_text [phi:main_intro->display_progress_text#0] -- qbuz1=qbuc1 + // [694] call display_progress_text + // [815] phi from main_intro to display_progress_text [phi:main_intro->display_progress_text] + // [815] phi display_progress_text::text#11 = display_into_briefing_text [phi:main_intro->display_progress_text#0] -- qbuz1=qbuc1 lda #display_into_briefing_text sta.z display_progress_text.text+1 - // [1331] phi display_progress_text::lines#12 = display_intro_briefing_count [phi:main_intro->display_progress_text#1] -- vbum1=vbuc1 + // [815] phi display_progress_text::lines#10 = display_intro_briefing_count [phi:main_intro->display_progress_text#1] -- vbum1=vbuc1 lda #display_intro_briefing_count sta display_progress_text.lines jsr display_progress_text - // [1040] phi from main_intro to main_intro::@4 [phi:main_intro->main_intro::@4] + // [695] phi from main_intro to main_intro::@4 [phi:main_intro->main_intro::@4] // main_intro::@4 // util_wait_space() - // [1041] call util_wait_space - // [1389] phi from main_intro::@4 to util_wait_space [phi:main_intro::@4->util_wait_space] + // [696] call util_wait_space + // [877] phi from main_intro::@4 to util_wait_space [phi:main_intro::@4->util_wait_space] jsr util_wait_space - // [1042] phi from main_intro::@4 to main_intro::@5 [phi:main_intro::@4->main_intro::@5] + // [697] phi from main_intro::@4 to main_intro::@5 [phi:main_intro::@4->main_intro::@5] // main_intro::@5 // display_progress_text(display_into_colors_text, display_intro_colors_count) - // [1043] call display_progress_text - // [1331] phi from main_intro::@5 to display_progress_text [phi:main_intro::@5->display_progress_text] - // [1331] phi display_progress_text::text#13 = display_into_colors_text [phi:main_intro::@5->display_progress_text#0] -- qbuz1=qbuc1 + // [698] call display_progress_text + // [815] phi from main_intro::@5 to display_progress_text [phi:main_intro::@5->display_progress_text] + // [815] phi display_progress_text::text#11 = display_into_colors_text [phi:main_intro::@5->display_progress_text#0] -- qbuz1=qbuc1 lda #display_into_colors_text sta.z display_progress_text.text+1 - // [1331] phi display_progress_text::lines#12 = display_intro_colors_count [phi:main_intro::@5->display_progress_text#1] -- vbum1=vbuc1 + // [815] phi display_progress_text::lines#10 = display_intro_colors_count [phi:main_intro::@5->display_progress_text#1] -- vbum1=vbuc1 lda #display_intro_colors_count sta display_progress_text.lines jsr display_progress_text - // [1044] phi from main_intro::@5 to main_intro::@1 [phi:main_intro::@5->main_intro::@1] - // [1044] phi main_intro::intro_status#2 = 0 [phi:main_intro::@5->main_intro::@1#0] -- vbuz1=vbuc1 + // [699] phi from main_intro::@5 to main_intro::@1 [phi:main_intro::@5->main_intro::@1] + // [699] phi main_intro::intro_status#2 = 0 [phi:main_intro::@5->main_intro::@1#0] -- vbuz1=vbuc1 lda #0 sta.z intro_status // main_intro::@1 __b1: // for(unsigned char intro_status=0; intro_status<11; intro_status++) - // [1045] if(main_intro::intro_status#2<$b) goto main_intro::@2 -- vbuz1_lt_vbuc1_then_la1 + // [700] if(main_intro::intro_status#2<$b) goto main_intro::@2 -- vbuz1_lt_vbuc1_then_la1 lda.z intro_status cmp #$b bcc __b2 - // [1046] phi from main_intro::@1 to main_intro::@3 [phi:main_intro::@1->main_intro::@3] + // [701] phi from main_intro::@1 to main_intro::@3 [phi:main_intro::@1->main_intro::@3] // main_intro::@3 // util_wait_space() - // [1047] call util_wait_space - // [1389] phi from main_intro::@3 to util_wait_space [phi:main_intro::@3->util_wait_space] + // [702] call util_wait_space + // [877] phi from main_intro::@3 to util_wait_space [phi:main_intro::@3->util_wait_space] jsr util_wait_space - // [1048] phi from main_intro::@3 to main_intro::@7 [phi:main_intro::@3->main_intro::@7] + // [703] phi from main_intro::@3 to main_intro::@7 [phi:main_intro::@3->main_intro::@7] // main_intro::@7 // display_progress_clear() - // [1049] call display_progress_clear - // [918] phi from main_intro::@7 to display_progress_clear [phi:main_intro::@7->display_progress_clear] + // [704] call display_progress_clear + // [573] phi from main_intro::@7 to display_progress_clear [phi:main_intro::@7->display_progress_clear] jsr display_progress_clear // main_intro::@return // } - // [1050] return + // [705] return rts // main_intro::@2 __b2: // display_info_led(PROGRESS_X + 3, PROGRESS_Y + 3 + intro_status, status_color[intro_status], BLUE) - // [1051] display_info_led::y#3 = PROGRESS_Y+3 + main_intro::intro_status#2 -- vbum1=vbuc1_plus_vbuz2 + // [706] display_info_led::y#3 = PROGRESS_Y+3 + main_intro::intro_status#2 -- vbum1=vbuc1_plus_vbuz2 lda #PROGRESS_Y+3 clc adc.z intro_status sta display_info_led.y - // [1052] display_info_led::tc#3 = status_color[main_intro::intro_status#2] -- vbum1=pbuc1_derefidx_vbuz2 + // [707] display_info_led::tc#3 = status_color[main_intro::intro_status#2] -- vbum1=pbuc1_derefidx_vbuz2 ldy.z intro_status lda status_color,y sta display_info_led.tc - // [1053] call display_info_led - // [2380] phi from main_intro::@2 to display_info_led [phi:main_intro::@2->display_info_led] - // [2380] phi display_info_led::y#4 = display_info_led::y#3 [phi:main_intro::@2->display_info_led#0] -- register_copy - // [2380] phi display_info_led::x#4 = PROGRESS_X+3 [phi:main_intro::@2->display_info_led#1] -- vbum1=vbuc1 + // [708] call display_info_led + // [1444] phi from main_intro::@2 to display_info_led [phi:main_intro::@2->display_info_led] + // [1444] phi display_info_led::y#4 = display_info_led::y#3 [phi:main_intro::@2->display_info_led#0] -- register_copy + // [1444] phi display_info_led::x#4 = PROGRESS_X+3 [phi:main_intro::@2->display_info_led#1] -- vbum1=vbuc1 lda #PROGRESS_X+3 sta display_info_led.x - // [2380] phi display_info_led::tc#4 = display_info_led::tc#3 [phi:main_intro::@2->display_info_led#2] -- register_copy + // [1444] phi display_info_led::tc#4 = display_info_led::tc#3 [phi:main_intro::@2->display_info_led#2] -- register_copy jsr display_info_led // main_intro::@6 // for(unsigned char intro_status=0; intro_status<11; intro_status++) - // [1054] main_intro::intro_status#1 = ++ main_intro::intro_status#2 -- vbuz1=_inc_vbuz1 + // [709] main_intro::intro_status#1 = ++ main_intro::intro_status#2 -- vbuz1=_inc_vbuz1 inc.z intro_status - // [1044] phi from main_intro::@6 to main_intro::@1 [phi:main_intro::@6->main_intro::@1] - // [1044] phi main_intro::intro_status#2 = main_intro::intro_status#1 [phi:main_intro::@6->main_intro::@1#0] -- register_copy + // [699] phi from main_intro::@6 to main_intro::@1 [phi:main_intro::@6->main_intro::@1] + // [699] phi main_intro::intro_status#2 = main_intro::intro_status#1 [phi:main_intro::@6->main_intro::@1#0] -- register_copy jmp __b1 } -.segment Code - // smc_detect -/** - * @brief Detect the SMC chip on the CX16 board, and the bootloader version contained in it. - * - * @return unsigned int bootloader version in the SMC chip, if all is OK. - * @return unsigned int 0x0100 if there is no bootloader in the SMC chip. - * @return unsigned int 0x0200 if there is a technical error reading or detecting the SMC chip. - */ -smc_detect: { - .label smc_detect__1 = $2b - // cx16_k_i2c_read_byte(FLASH_I2C_SMC_DEVICE, FLASH_I2C_SMC_OFFSET) - // [1055] cx16_k_i2c_read_byte::device = $42 -- vbum1=vbuc1 - lda #$42 - sta cx16_k_i2c_read_byte.device - // [1056] cx16_k_i2c_read_byte::offset = $8e -- vbum1=vbuc1 - lda #$8e - sta cx16_k_i2c_read_byte.offset - // [1057] call cx16_k_i2c_read_byte - jsr cx16_k_i2c_read_byte - // [1058] 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) - // [1059] smc_detect::smc_bootloader_version#1 = cx16_k_i2c_read_byte::return#10 - // BYTE1(smc_bootloader_version) - // [1060] smc_detect::$1 = byte1 smc_detect::smc_bootloader_version#1 -- vbuz1=_byte1_vwum2 - lda smc_bootloader_version+1 - sta.z smc_detect__1 - // if(!BYTE1(smc_bootloader_version)) - // [1061] if(0==smc_detect::$1) goto smc_detect::@1 -- 0_eq_vbuz1_then_la1 - beq __b1 - // [1064] phi from smc_detect::@3 to smc_detect::@2 [phi:smc_detect::@3->smc_detect::@2] - // [1064] phi smc_detect::return#0 = $200 [phi:smc_detect::@3->smc_detect::@2#0] -- vwum1=vwuc1 - lda #<$200 - sta return - lda #>$200 - sta return+1 - rts - // smc_detect::@1 - __b1: - // if(smc_bootloader_version == 0xFF) - // [1062] if(smc_detect::smc_bootloader_version#1!=$ff) goto smc_detect::@4 -- vwum1_neq_vbuc1_then_la1 - lda smc_bootloader_version+1 - bne __b2 - lda smc_bootloader_version - cmp #$ff - bne __b2 - // [1064] phi from smc_detect::@1 to smc_detect::@2 [phi:smc_detect::@1->smc_detect::@2] - // [1064] phi smc_detect::return#0 = $100 [phi:smc_detect::@1->smc_detect::@2#0] -- vwum1=vwuc1 - lda #<$100 - sta return - lda #>$100 - sta return+1 - rts - // [1063] phi from smc_detect::@1 to smc_detect::@4 [phi:smc_detect::@1->smc_detect::@4] - // smc_detect::@4 - // [1064] phi from smc_detect::@4 to smc_detect::@2 [phi:smc_detect::@4->smc_detect::@2] - // [1064] 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 - // } - // [1065] return - rts - .segment Data - // When the bootloader is not present, 0xFF is returned. - .label smc_bootloader_version = return - return: .word 0 -} -.segment Code - // 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($50) char *destination, char *source) -strcpy: { - .label src = $6c - .label dst = $50 - .label destination = $50 - // [1067] phi from strcpy strcpy::@2 to strcpy::@1 [phi:strcpy/strcpy::@2->strcpy::@1] - // [1067] phi strcpy::dst#2 = strcpy::dst#0 [phi:strcpy/strcpy::@2->strcpy::@1#0] -- register_copy - // [1067] phi strcpy::src#2 = strcpy::src#0 [phi:strcpy/strcpy::@2->strcpy::@1#1] -- register_copy - // strcpy::@1 - __b1: - // while(*src) - // [1068] 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 - // [1069] *strcpy::dst#2 = 0 -- _deref_pbuz1=vbuc1 - tya - tay - sta (dst),y - // strcpy::@return - // } - // [1070] return - rts - // strcpy::@2 - __b2: - // *dst++ = *src++ - // [1071] *strcpy::dst#2 = *strcpy::src#2 -- _deref_pbuz1=_deref_pbuz2 - ldy #0 - lda (src),y - sta (dst),y - // *dst++ = *src++; - // [1072] strcpy::dst#1 = ++ strcpy::dst#2 -- pbuz1=_inc_pbuz1 - inc.z dst - bne !+ - inc.z dst+1 - !: - // [1073] strcpy::src#1 = ++ strcpy::src#2 -- pbuz1=_inc_pbuz1 - inc.z src - bne !+ - inc.z src+1 - !: - jmp __b1 -} - // cx16_k_i2c_read_byte -/** - * @brief Read a byte at a given offset from a given I2C device. - * Description: The routine i2c_read_byte reads a single byte - * at offset .Y from I2C device .X and returns the result in .A. - * .C is 0 if the read was successful, and 1 if no such device exists. - * @example - * LDX #$6F ; RTC device - * LDY #$20 ; start of NVRAM inside RTC - * JSR i2c_read_byte ; read first byte of NVRAM -*/ -// __mem() unsigned int cx16_k_i2c_read_byte(__mem() volatile char device, __mem() volatile char offset) -cx16_k_i2c_read_byte: { - // unsigned int result - // [1074] cx16_k_i2c_read_byte::result = 0 -- vwum1=vwuc1 +.segment CodeVera + // main_vera_detect +main_vera_detect: { + // vera_detect() + // [711] call vera_detect + // [1455] phi from main_vera_detect to vera_detect [phi:main_vera_detect->vera_detect] + jsr vera_detect + // [712] phi from main_vera_detect to main_vera_detect::@1 [phi:main_vera_detect->main_vera_detect::@1] + // main_vera_detect::@1 + // display_chip_vera() + // [713] call display_chip_vera + // [593] phi from main_vera_detect::@1 to display_chip_vera [phi:main_vera_detect::@1->display_chip_vera] + jsr display_chip_vera + // main_vera_detect::@2 + // [714] spi_manufacturer#410 = spi_read::return#0 -- vbum1=vbum2 + lda spi_read.return + sta spi_manufacturer + // [715] spi_memory_type#411 = spi_read::return#1 -- vbum1=vbum2 + lda spi_read.return_1 + sta spi_memory_type + // [716] spi_memory_capacity#412 = spi_read::return#2 -- vbum1=vbum2 + lda spi_read.return_2 + sta spi_memory_capacity + // display_info_vera(STATUS_DETECTED, NULL) + // [717] call display_info_vera + // [653] phi from main_vera_detect::@2 to display_info_vera [phi:main_vera_detect::@2->display_info_vera] + // [653] phi display_info_vera::info_text#19 = 0 [phi:main_vera_detect::@2->display_info_vera#0] -- pbuz1=vbuc1 lda #<0 - sta result - sta result+1 - // asm - // asm { ldxdevice ldyoffset stzresult+1 jsrCX16_I2C_READ_BYTE staresult rolresult+1 } - ldx device - ldy offset - stz result+1 - jsr CX16_I2C_READ_BYTE - sta result - rol result+1 - // return result; - // [1076] cx16_k_i2c_read_byte::return#0 = cx16_k_i2c_read_byte::result -- vwum1=vwum2 - sta return - lda result+1 - sta return+1 - // cx16_k_i2c_read_byte::@return + sta.z display_info_vera.info_text + sta.z display_info_vera.info_text+1 + // [653] phi spi_memory_capacity#110 = spi_memory_capacity#412 [phi:main_vera_detect::@2->display_info_vera#1] -- register_copy + // [653] phi spi_memory_type#111 = spi_memory_type#411 [phi:main_vera_detect::@2->display_info_vera#2] -- register_copy + // [653] phi spi_manufacturer#100 = spi_manufacturer#410 [phi:main_vera_detect::@2->display_info_vera#3] -- register_copy + // [653] phi display_info_vera::info_status#19 = STATUS_DETECTED [phi:main_vera_detect::@2->display_info_vera#4] -- vbum1=vbuc1 + lda #STATUS_DETECTED + sta display_info_vera.info_status + jsr display_info_vera + // main_vera_detect::@return // } - // [1077] cx16_k_i2c_read_byte::return#1 = cx16_k_i2c_read_byte::return#0 - // [1078] return + // [718] return rts - .segment Data - device: .byte 0 - offset: .byte 0 - result: .word 0 - .label return = smc_detect.return } -.segment Code - // smc_get_version_text -/** - * @brief Detect and write the SMC version number into the info_text. - * - * @param version_string The string containing the SMC version filled upon return. - */ -// unsigned long smc_get_version_text(__zp($45) char *version_string, __mem() char release, __mem() char major, __mem() char minor) -smc_get_version_text: { - .label version_string = $45 - // sprintf(version_string, "%u.%u.%u", release, major, minor) - // [1080] snprintf_init::s#4 = smc_get_version_text::version_string#2 - // [1081] call snprintf_init - // [1205] phi from smc_get_version_text to snprintf_init [phi:smc_get_version_text->snprintf_init] - // [1205] phi snprintf_init::s#31 = snprintf_init::s#4 [phi:smc_get_version_text->snprintf_init#0] -- register_copy + // main_vera_check +main_vera_check: { + .label vera_bytes_read = $ab + // display_action_progress("Checking VERA.BIN ...") + // [720] call display_action_progress + // [559] phi from main_vera_check to display_action_progress [phi:main_vera_check->display_action_progress] + // [559] phi display_action_progress::info_text#19 = main_vera_check::info_text [phi:main_vera_check->display_action_progress#0] -- pbuz1=pbuc1 + lda #info_text + sta.z display_action_progress.info_text+1 + jsr display_action_progress + // [721] phi from main_vera_check to main_vera_check::@4 [phi:main_vera_check->main_vera_check::@4] + // main_vera_check::@4 + // unsigned long vera_bytes_read = vera_read(STATUS_CHECKING) + // [722] call vera_read + // Read the VERA.BIN file. + // [1458] phi from main_vera_check::@4 to vera_read [phi:main_vera_check::@4->vera_read] + // [1458] phi __errno#118 = 0 [phi:main_vera_check::@4->vera_read#0] -- vwsm1=vwsc1 + lda #<0 + sta __errno + sta __errno+1 + // [1458] phi __stdio_filecount#105 = 0 [phi:main_vera_check::@4->vera_read#1] -- vbum1=vbuc1 + sta __stdio_filecount + // [1458] phi vera_read::info_status#12 = STATUS_CHECKING [phi:main_vera_check::@4->vera_read#2] -- vbum1=vbuc1 + lda #STATUS_CHECKING + sta vera_read.info_status + jsr vera_read + // unsigned long vera_bytes_read = vera_read(STATUS_CHECKING) + // [723] vera_read::return#2 = vera_read::return#0 + // main_vera_check::@5 + // [724] main_vera_check::vera_bytes_read#0 = vera_read::return#2 -- vduz1=vdum2 + lda vera_read.return + sta.z vera_bytes_read + lda vera_read.return+1 + sta.z vera_bytes_read+1 + lda vera_read.return+2 + sta.z vera_bytes_read+2 + lda vera_read.return+3 + sta.z vera_bytes_read+3 + // wait_moment(10) + // [725] call wait_moment + // [794] phi from main_vera_check::@5 to wait_moment [phi:main_vera_check::@5->wait_moment] + // [794] phi wait_moment::w#10 = $a [phi:main_vera_check::@5->wait_moment#0] -- vbum1=vbuc1 + lda #$a + sta wait_moment.w + jsr wait_moment + // main_vera_check::@6 + // if (!vera_bytes_read) + // [726] if(0==main_vera_check::vera_bytes_read#0) goto main_vera_check::@1 -- 0_eq_vduz1_then_la1 + // In case no file was found, set the status to none and skip to the next, else, mention the amount of bytes read. + lda.z vera_bytes_read + ora.z vera_bytes_read+1 + ora.z vera_bytes_read+2 + ora.z vera_bytes_read+3 + beq __b1 + // main_vera_check::@3 + // vera_file_size = vera_bytes_read + // [727] vera_file_size#0 = main_vera_check::vera_bytes_read#0 -- vdum1=vduz2 + // VF5 | VERA.BIN all ok | Display the VERA.BIN release version and github commit id (if any) and set VERA to Flash | Flash + // We know the file size, so we indicate it in the status panel. + lda.z vera_bytes_read + sta vera_file_size + lda.z vera_bytes_read+1 + sta vera_file_size+1 + lda.z vera_bytes_read+2 + sta vera_file_size+2 + lda.z vera_bytes_read+3 + sta vera_file_size+3 + // sprintf(info_text, "VERA.BIN:%s", "") + // [728] call snprintf_init jsr snprintf_init - // smc_get_version_text::@1 - // sprintf(version_string, "%u.%u.%u", release, major, minor) - // [1082] printf_uchar::uvalue#7 = smc_get_version_text::release#2 - // [1083] call printf_uchar - // [1346] phi from smc_get_version_text::@1 to printf_uchar [phi:smc_get_version_text::@1->printf_uchar] - // [1346] phi printf_uchar::format_zero_padding#18 = 0 [phi:smc_get_version_text::@1->printf_uchar#0] -- vbum1=vbuc1 - lda #0 - sta printf_uchar.format_zero_padding - // [1346] phi printf_uchar::format_min_length#18 = 0 [phi:smc_get_version_text::@1->printf_uchar#1] -- vbum1=vbuc1 - sta printf_uchar.format_min_length - // [1346] phi printf_uchar::putc#18 = &snputc [phi:smc_get_version_text::@1->printf_uchar#2] -- pprz1=pprc1 - lda #snputc - sta.z printf_uchar.putc+1 - // [1346] phi printf_uchar::format_radix#18 = DECIMAL [phi:smc_get_version_text::@1->printf_uchar#3] -- vbum1=vbuc1 - lda #DECIMAL - sta printf_uchar.format_radix - // [1346] phi printf_uchar::uvalue#18 = printf_uchar::uvalue#7 [phi:smc_get_version_text::@1->printf_uchar#4] -- register_copy - jsr printf_uchar - // [1084] 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) - // [1085] call printf_str - // [1210] phi from smc_get_version_text::@2 to printf_str [phi:smc_get_version_text::@2->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:smc_get_version_text::@2->printf_str#0] -- pprz1=pprc1 + // [729] phi from main_vera_check::@3 to main_vera_check::@7 [phi:main_vera_check::@3->main_vera_check::@7] + // main_vera_check::@7 + // sprintf(info_text, "VERA.BIN:%s", "") + // [730] call printf_str + // [785] phi from main_vera_check::@7 to printf_str [phi:main_vera_check::@7->printf_str] + // [785] phi printf_str::putc#53 = &snputc [phi:main_vera_check::@7->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = smc_get_version_text::s [phi:smc_get_version_text::@2->printf_str#1] -- pbuz1=pbuc1 + // [785] phi printf_str::s#53 = main_vera_check::s [phi:main_vera_check::@7->printf_str#1] -- pbuz1=pbuc1 lda #s sta.z printf_str.s+1 jsr printf_str - // smc_get_version_text::@3 - // sprintf(version_string, "%u.%u.%u", release, major, minor) - // [1086] printf_uchar::uvalue#8 = smc_get_version_text::major#2 -- vbum1=vbum2 - lda major - sta printf_uchar.uvalue - // [1087] call printf_uchar - // [1346] phi from smc_get_version_text::@3 to printf_uchar [phi:smc_get_version_text::@3->printf_uchar] - // [1346] phi printf_uchar::format_zero_padding#18 = 0 [phi:smc_get_version_text::@3->printf_uchar#0] -- vbum1=vbuc1 - lda #0 - sta printf_uchar.format_zero_padding - // [1346] phi printf_uchar::format_min_length#18 = 0 [phi:smc_get_version_text::@3->printf_uchar#1] -- vbum1=vbuc1 - sta printf_uchar.format_min_length - // [1346] phi printf_uchar::putc#18 = &snputc [phi:smc_get_version_text::@3->printf_uchar#2] -- pprz1=pprc1 - lda #snputc - sta.z printf_uchar.putc+1 - // [1346] phi printf_uchar::format_radix#18 = DECIMAL [phi:smc_get_version_text::@3->printf_uchar#3] -- vbum1=vbuc1 - lda #DECIMAL - sta printf_uchar.format_radix - // [1346] phi printf_uchar::uvalue#18 = printf_uchar::uvalue#8 [phi:smc_get_version_text::@3->printf_uchar#4] -- register_copy - jsr printf_uchar - // [1088] 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) - // [1089] call printf_str - // [1210] phi from smc_get_version_text::@4 to printf_str [phi:smc_get_version_text::@4->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:smc_get_version_text::@4->printf_str#0] -- pprz1=pprc1 + // [731] phi from main_vera_check::@7 to main_vera_check::@8 [phi:main_vera_check::@7->main_vera_check::@8] + // main_vera_check::@8 + // sprintf(info_text, "VERA.BIN:%s", "") + // [732] call printf_string + // [1308] phi from main_vera_check::@8 to printf_string [phi:main_vera_check::@8->printf_string] + // [1308] phi printf_string::putc#17 = &snputc [phi:main_vera_check::@8->printf_string#0] -- pprz1=pprc1 lda #snputc - sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = smc_get_version_text::s [phi:smc_get_version_text::@4->printf_str#1] -- pbuz1=pbuc1 - lda #s - sta.z printf_str.s+1 - jsr printf_str - // smc_get_version_text::@5 - // sprintf(version_string, "%u.%u.%u", release, major, minor) - // [1090] printf_uchar::uvalue#9 = smc_get_version_text::minor#2 -- vbum1=vbum2 - lda minor - sta printf_uchar.uvalue - // [1091] call printf_uchar - // [1346] phi from smc_get_version_text::@5 to printf_uchar [phi:smc_get_version_text::@5->printf_uchar] - // [1346] phi printf_uchar::format_zero_padding#18 = 0 [phi:smc_get_version_text::@5->printf_uchar#0] -- vbum1=vbuc1 + sta.z printf_string.putc+1 + // [1308] phi printf_string::str#17 = str [phi:main_vera_check::@8->printf_string#1] -- pbuz1=pbuc1 + lda #str + sta.z printf_string.str+1 + // [1308] phi printf_string::format_justify_left#17 = 0 [phi:main_vera_check::@8->printf_string#2] -- vbum1=vbuc1 lda #0 - sta printf_uchar.format_zero_padding - // [1346] phi printf_uchar::format_min_length#18 = 0 [phi:smc_get_version_text::@5->printf_uchar#1] -- vbum1=vbuc1 - sta printf_uchar.format_min_length - // [1346] phi printf_uchar::putc#18 = &snputc [phi:smc_get_version_text::@5->printf_uchar#2] -- pprz1=pprc1 - lda #snputc - sta.z printf_uchar.putc+1 - // [1346] phi printf_uchar::format_radix#18 = DECIMAL [phi:smc_get_version_text::@5->printf_uchar#3] -- vbum1=vbuc1 - lda #DECIMAL - sta printf_uchar.format_radix - // [1346] phi printf_uchar::uvalue#18 = printf_uchar::uvalue#9 [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) - // [1092] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 + sta printf_string.format_justify_left + // [1308] phi printf_string::format_min_length#17 = 0 [phi:main_vera_check::@8->printf_string#3] -- vbum1=vbuc1 + sta printf_string.format_min_length + jsr printf_string + // main_vera_check::@9 + // sprintf(info_text, "VERA.BIN:%s", "") + // [733] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 lda #0 pha - // [1093] callexecute snputc -- call_vprc1 + // [734] callexecute snputc -- call_vprc1 jsr snputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla - // smc_get_version_text::@return + // [736] spi_manufacturer#409 = spi_read::return#0 -- vbum1=vbum2 + lda spi_read.return + sta spi_manufacturer + // [737] spi_memory_type#410 = spi_read::return#1 -- vbum1=vbum2 + lda spi_read.return_1 + sta spi_memory_type + // [738] spi_memory_capacity#411 = spi_read::return#2 -- vbum1=vbum2 + lda spi_read.return_2 + sta spi_memory_capacity + // display_info_vera(STATUS_FLASH, info_text) + // [739] call display_info_vera + // [653] phi from main_vera_check::@9 to display_info_vera [phi:main_vera_check::@9->display_info_vera] + // [653] phi display_info_vera::info_text#19 = info_text [phi:main_vera_check::@9->display_info_vera#0] -- pbuz1=pbuc1 + lda #<@info_text + sta.z display_info_vera.info_text + lda #>@info_text + sta.z display_info_vera.info_text+1 + // [653] phi spi_memory_capacity#110 = spi_memory_capacity#411 [phi:main_vera_check::@9->display_info_vera#1] -- register_copy + // [653] phi spi_memory_type#111 = spi_memory_type#410 [phi:main_vera_check::@9->display_info_vera#2] -- register_copy + // [653] phi spi_manufacturer#100 = spi_manufacturer#409 [phi:main_vera_check::@9->display_info_vera#3] -- register_copy + // [653] phi display_info_vera::info_status#19 = STATUS_FLASH [phi:main_vera_check::@9->display_info_vera#4] -- vbum1=vbuc1 + lda #STATUS_FLASH + sta display_info_vera.info_status + jsr display_info_vera + // [740] phi from main_vera_check::@9 to main_vera_check::@2 [phi:main_vera_check::@9->main_vera_check::@2] + // [740] phi vera_file_size#1 = vera_file_size#0 [phi:main_vera_check::@9->main_vera_check::@2#0] -- register_copy + // main_vera_check::@2 + // main_vera_check::@return // } - // [1095] return + // [741] return rts - .segment Data - s: .text "." - .byte 0 - release: .byte 0 - major: .byte 0 - minor: .byte 0 -} -.segment CodeVera - // main_vera_detect -main_vera_detect: { - // vera_detect() - // [1097] call vera_detect - // [2391] phi from main_vera_detect to vera_detect [phi:main_vera_detect->vera_detect] - jsr vera_detect - // [1098] phi from main_vera_detect to main_vera_detect::@1 [phi:main_vera_detect->main_vera_detect::@1] - // main_vera_detect::@1 - // display_chip_vera() - // [1099] call display_chip_vera - // [938] phi from main_vera_detect::@1 to display_chip_vera [phi:main_vera_detect::@1->display_chip_vera] - jsr display_chip_vera - // main_vera_detect::@2 - // [1100] spi_manufacturer#584 = spi_read::return#0 -- vbum1=vbum2 + // main_vera_check::@1 + __b1: + // [742] spi_manufacturer#408 = spi_read::return#0 -- vbum1=vbum2 lda spi_read.return sta spi_manufacturer - // [1101] spi_memory_type#585 = spi_read::return#1 -- vbum1=vbum2 + // [743] spi_memory_type#409 = spi_read::return#1 -- vbum1=vbum2 lda spi_read.return_1 sta spi_memory_type - // [1102] spi_memory_capacity#586 = spi_read::return#2 -- vbum1=vbum2 + // [744] spi_memory_capacity#410 = spi_read::return#2 -- vbum1=vbum2 lda spi_read.return_2 sta spi_memory_capacity - // display_info_vera(STATUS_DETECTED, NULL) - // [1103] call display_info_vera - // [998] phi from main_vera_detect::@2 to display_info_vera [phi:main_vera_detect::@2->display_info_vera] - // [998] phi display_info_vera::info_text#19 = 0 [phi:main_vera_detect::@2->display_info_vera#0] -- pbuz1=vbuc1 - lda #<0 + // display_info_vera(STATUS_SKIP, "No VERA.BIN") + // [745] call display_info_vera + // VF1 | no VERA.BIN | Ask the user to place the VERA.BIN file onto the SDcard. Set VERA to Issue. | Issue + // VF2 | VERA.BIN size 0 | Ask the user to place a correct VERA.BIN file onto the SDcard. Set VERA to Issue. | Issue + // TODO: VF4 | ROM.BIN size over 0x20000 | Ask the user to place a correct VERA.BIN file onto the SDcard. Set VERA to Issue. | Issue + // [653] phi from main_vera_check::@1 to display_info_vera [phi:main_vera_check::@1->display_info_vera] + // [653] phi display_info_vera::info_text#19 = main_vera_check::info_text1 [phi:main_vera_check::@1->display_info_vera#0] -- pbuz1=pbuc1 + lda #info_text1 sta.z display_info_vera.info_text+1 - // [998] phi spi_memory_capacity#106 = spi_memory_capacity#586 [phi:main_vera_detect::@2->display_info_vera#1] -- register_copy - // [998] phi spi_memory_type#107 = spi_memory_type#585 [phi:main_vera_detect::@2->display_info_vera#2] -- register_copy - // [998] phi spi_manufacturer#108 = spi_manufacturer#584 [phi:main_vera_detect::@2->display_info_vera#3] -- register_copy - // [998] phi display_info_vera::info_status#19 = STATUS_DETECTED [phi:main_vera_detect::@2->display_info_vera#4] -- vbum1=vbuc1 - lda #STATUS_DETECTED + // [653] phi spi_memory_capacity#110 = spi_memory_capacity#410 [phi:main_vera_check::@1->display_info_vera#1] -- register_copy + // [653] phi spi_memory_type#111 = spi_memory_type#409 [phi:main_vera_check::@1->display_info_vera#2] -- register_copy + // [653] phi spi_manufacturer#100 = spi_manufacturer#408 [phi:main_vera_check::@1->display_info_vera#3] -- register_copy + // [653] phi display_info_vera::info_status#19 = STATUS_SKIP [phi:main_vera_check::@1->display_info_vera#4] -- vbum1=vbuc1 + lda #STATUS_SKIP sta display_info_vera.info_status jsr display_info_vera - // main_vera_detect::@return - // } - // [1104] return + // [740] phi from main_vera_check::@1 to main_vera_check::@2 [phi:main_vera_check::@1->main_vera_check::@2] + // [740] phi vera_file_size#1 = 0 [phi:main_vera_check::@1->main_vera_check::@2#0] -- vdum1=vduc1 + lda #<0 + sta vera_file_size + sta vera_file_size+1 + lda #<0>>$10 + sta vera_file_size+2 + lda #>0>>$10 + sta vera_file_size+3 rts + .segment DataVera + info_text: .text "Checking VERA.BIN ..." + .byte 0 + info_text1: .text "No VERA.BIN" + .byte 0 + s: .text "VERA.BIN:" + .byte 0 } .segment Code - // rom_detect -rom_detect: { - .const bank_set_brom1_bank = 4 - .label rom_detect__3 = $2b - .label rom_detect__5 = $42 - .label rom_detect__9 = $41 - .label rom_detect__14 = $68 - .label rom_detect__15 = $61 - .label rom_detect__18 = $60 - .label rom_detect__21 = $c2 - .label rom_detect__24 = $78 - // [1106] phi from rom_detect to rom_detect::@1 [phi:rom_detect->rom_detect::@1] - // [1106] phi rom_detect::rom_chip#10 = 0 [phi:rom_detect->rom_detect::@1#0] -- vbum1=vbuc1 - lda #0 - sta rom_chip - // [1106] phi rom_detect::rom_detect_address#10 = 0 [phi:rom_detect->rom_detect::@1#1] -- vdum1=vduc1 - sta rom_detect_address - sta rom_detect_address+1 - lda #<0>>$10 - sta rom_detect_address+2 - lda #>0>>$10 - sta rom_detect_address+3 - // Ensure the ROM is set to BASIC. - // bank_set_brom(4); - // rom_detect::@1 + // smc_supported_rom +/** + * @brief Search in the smc file header for supported ROM.BIN releases. + * The first 3 bytes of the smc file header contain the SMC.BIN version, major and minor numbers. + * + * @param rom_release The ROM release to search for. + * @return unsigned char true if found. + */ +// __mem() char smc_supported_rom(__mem() char rom_release) +smc_supported_rom: { + // [747] phi from smc_supported_rom to smc_supported_rom::@1 [phi:smc_supported_rom->smc_supported_rom::@1] + // [747] phi smc_supported_rom::i#2 = $1f [phi:smc_supported_rom->smc_supported_rom::@1#0] -- vbum1=vbuc1 + lda #$1f + sta i + // smc_supported_rom::@1 __b1: - // for (unsigned long rom_detect_address = 0; rom_detect_address < 8 * 0x80000; rom_detect_address += 0x80000) - // [1107] if(rom_detect::rom_detect_address#10<8*$80000) goto rom_detect::@2 -- vdum1_lt_vduc1_then_la1 - lda rom_detect_address+3 - cmp #>8*$80000>>$10 - bcc __b2 - bne !+ - lda rom_detect_address+2 - cmp #<8*$80000>>$10 - bcc __b2 - bne !+ - lda rom_detect_address+1 - cmp #>8*$80000 - bcc __b2 - bne !+ - lda rom_detect_address - cmp #<8*$80000 - bcc __b2 - !: - // rom_detect::@return - // } - // [1108] return + // for(unsigned char i=31; i>3; i--) + // [748] if(smc_supported_rom::i#2>=3+1) goto smc_supported_rom::@2 -- vbum1_ge_vbuc1_then_la1 + lda i + cmp #3+1 + bcs __b2 + // [750] phi from smc_supported_rom::@1 to smc_supported_rom::@return [phi:smc_supported_rom::@1->smc_supported_rom::@return] + // [750] phi smc_supported_rom::return#2 = 0 [phi:smc_supported_rom::@1->smc_supported_rom::@return#0] -- vbum1=vbuc1 + lda #0 + sta return rts - // rom_detect::@2 + // smc_supported_rom::@2 __b2: - // rom_manufacturer_ids[rom_chip] = 0 - // [1109] 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 - // [1110] 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) - // [1111] rom_unlock::address#2 = rom_detect::rom_detect_address#10 + $5555 -- vdum1=vdum2_plus_vwuc1 - clc - lda rom_detect_address - adc #<$5555 - sta rom_unlock.address - lda rom_detect_address+1 - adc #>$5555 - sta rom_unlock.address+1 - lda rom_detect_address+2 - adc #0 - sta rom_unlock.address+2 - lda rom_detect_address+3 - adc #0 - sta rom_unlock.address+3 - // [1112] call rom_unlock - // [2394] phi from rom_detect::@2 to rom_unlock [phi:rom_detect::@2->rom_unlock] - // [2394] phi rom_unlock::unlock_code#5 = $90 [phi:rom_detect::@2->rom_unlock#0] -- vbum1=vbuc1 - lda #$90 - sta rom_unlock.unlock_code - // [2394] 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) - // [1113] rom_read_byte::address#0 = rom_detect::rom_detect_address#10 -- vdum1=vdum2 - lda rom_detect_address - sta rom_read_byte.address - lda rom_detect_address+1 - sta rom_read_byte.address+1 - lda rom_detect_address+2 - sta rom_read_byte.address+2 - lda rom_detect_address+3 - sta rom_read_byte.address+3 - // [1114] call rom_read_byte - // [2404] phi from rom_detect::@12 to rom_read_byte [phi:rom_detect::@12->rom_read_byte] - // [2404] 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) - // [1115] rom_read_byte::return#2 = rom_read_byte::return#0 - // rom_detect::@13 - // [1116] rom_detect::$3 = rom_read_byte::return#2 -- vbuz1=vbum2 - lda rom_read_byte.return - sta.z rom_detect__3 - // rom_manufacturer_ids[rom_chip] = rom_read_byte(rom_detect_address) - // [1117] rom_manufacturer_ids[rom_detect::rom_chip#10] = rom_detect::$3 -- pbuc1_derefidx_vbum1=vbuz2 - ldy rom_chip - sta rom_manufacturer_ids,y - // rom_read_byte(rom_detect_address + 1) - // [1118] rom_read_byte::address#1 = rom_detect::rom_detect_address#10 + 1 -- vdum1=vdum2_plus_1 - lda rom_detect_address - clc - adc #1 - sta rom_read_byte.address - lda rom_detect_address+1 - adc #0 - sta rom_read_byte.address+1 - lda rom_detect_address+2 - adc #0 - sta rom_read_byte.address+2 - lda rom_detect_address+3 - adc #0 - sta rom_read_byte.address+3 - // [1119] call rom_read_byte - // [2404] phi from rom_detect::@13 to rom_read_byte [phi:rom_detect::@13->rom_read_byte] - // [2404] 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) - // [1120] rom_read_byte::return#3 = rom_read_byte::return#0 - // rom_detect::@14 - // [1121] rom_detect::$5 = rom_read_byte::return#3 -- vbuz1=vbum2 - lda rom_read_byte.return - sta.z rom_detect__5 - // rom_device_ids[rom_chip] = rom_read_byte(rom_detect_address + 1) - // [1122] rom_device_ids[rom_detect::rom_chip#10] = rom_detect::$5 -- pbuc1_derefidx_vbum1=vbuz2 - ldy rom_chip - sta rom_device_ids,y - // rom_unlock(rom_detect_address + 0x05555, 0xF0) - // [1123] rom_unlock::address#3 = rom_detect::rom_detect_address#10 + $5555 -- vdum1=vdum2_plus_vwuc1 - clc - lda rom_detect_address - adc #<$5555 - sta rom_unlock.address - lda rom_detect_address+1 - adc #>$5555 - sta rom_unlock.address+1 - lda rom_detect_address+2 - adc #0 - sta rom_unlock.address+2 - lda rom_detect_address+3 - adc #0 - sta rom_unlock.address+3 - // [1124] call rom_unlock - // [2394] phi from rom_detect::@14 to rom_unlock [phi:rom_detect::@14->rom_unlock] - // [2394] phi rom_unlock::unlock_code#5 = $f0 [phi:rom_detect::@14->rom_unlock#0] -- vbum1=vbuc1 - lda #$f0 - sta rom_unlock.unlock_code - // [2394] 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 - // [1125] BROM = rom_detect::bank_set_brom1_bank#0 -- vbuz1=vbuc1 - lda #bank_set_brom1_bank - sta.z BROM - // rom_detect::@11 - // rom_chip*3 - // [1126] rom_detect::$14 = rom_detect::rom_chip#10 << 1 -- vbuz1=vbum2_rol_1 - lda rom_chip - asl - sta.z rom_detect__14 - // [1127] rom_detect::$9 = rom_detect::$14 + rom_detect::rom_chip#10 -- vbuz1=vbuz2_plus_vbum3 - lda rom_chip - clc - adc.z rom_detect__14 - sta.z rom_detect__9 - // gotoxy(rom_chip*3+40, 1) - // [1128] gotoxy::x#30 = rom_detect::$9 + $28 -- vbum1=vbuz2_plus_vbuc1 - lda #$28 - clc - adc.z rom_detect__9 - sta gotoxy.x - // [1129] call gotoxy - // [802] phi from rom_detect::@11 to gotoxy [phi:rom_detect::@11->gotoxy] - // [802] phi gotoxy::y#37 = 1 [phi:rom_detect::@11->gotoxy#0] -- vbum1=vbuc1 - lda #1 - sta gotoxy.y - // [802] phi gotoxy::x#37 = gotoxy::x#30 [phi:rom_detect::@11->gotoxy#1] -- register_copy - jsr gotoxy - // rom_detect::@15 - // printf("%02x", rom_device_ids[rom_chip]) - // [1130] printf_uchar::uvalue#14 = rom_device_ids[rom_detect::rom_chip#10] -- vbum1=pbuc1_derefidx_vbum2 - ldy rom_chip - lda rom_device_ids,y - sta printf_uchar.uvalue - // [1131] call printf_uchar - // [1346] phi from rom_detect::@15 to printf_uchar [phi:rom_detect::@15->printf_uchar] - // [1346] phi printf_uchar::format_zero_padding#18 = 1 [phi:rom_detect::@15->printf_uchar#0] -- vbum1=vbuc1 + // if(smc_file_header[i] == rom_release) + // [749] if(smc_file_header[smc_supported_rom::i#2]!=smc_supported_rom::rom_release#0) goto smc_supported_rom::@3 -- pbuc1_derefidx_vbum1_neq_vbum2_then_la1 + lda rom_release + ldy i + cmp smc_file_header,y + bne __b3 + // [750] phi from smc_supported_rom::@2 to smc_supported_rom::@return [phi:smc_supported_rom::@2->smc_supported_rom::@return] + // [750] phi smc_supported_rom::return#2 = 1 [phi:smc_supported_rom::@2->smc_supported_rom::@return#0] -- vbum1=vbuc1 lda #1 - sta printf_uchar.format_zero_padding - // [1346] phi printf_uchar::format_min_length#18 = 2 [phi:rom_detect::@15->printf_uchar#1] -- vbum1=vbuc1 - lda #2 - sta printf_uchar.format_min_length - // [1346] phi printf_uchar::putc#18 = &cputc [phi:rom_detect::@15->printf_uchar#2] -- pprz1=pprc1 - lda #cputc - sta.z printf_uchar.putc+1 - // [1346] phi printf_uchar::format_radix#18 = HEXADECIMAL [phi:rom_detect::@15->printf_uchar#3] -- vbum1=vbuc1 - lda #HEXADECIMAL - sta printf_uchar.format_radix - // [1346] phi printf_uchar::uvalue#18 = printf_uchar::uvalue#14 [phi:rom_detect::@15->printf_uchar#4] -- register_copy - jsr printf_uchar - // rom_detect::@16 - // case SST39SF010A: - // rom_device_names[rom_chip] = "f010a"; - // rom_size_strings[rom_chip] = "128"; - // rom_sizes[rom_chip] = 128 * 1024; - // break; - // [1132] 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 - bne !__b3+ - jmp __b3 - !__b3: - // rom_detect::@9 - // case SST39SF020A: - // rom_device_names[rom_chip] = "f020a"; - // rom_size_strings[rom_chip] = "256"; - // rom_sizes[rom_chip] = 256 * 1024; - // break; - // [1133] 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+ - jmp __b4 - !__b4: - // rom_detect::@10 - // case SST39SF040: - // rom_device_names[rom_chip] = "f040"; - // rom_size_strings[rom_chip] = "512"; - // rom_sizes[rom_chip] = 512 * 1024; - // break; - // [1134] 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 - // [1135] rom_manufacturer_ids[rom_detect::rom_chip#10] = 0 -- pbuc1_derefidx_vbum1=vbuc2 + sta return + // smc_supported_rom::@return + // } + // [751] return + rts + // smc_supported_rom::@3 + __b3: + // for(unsigned char i=31; i>3; i--) + // [752] smc_supported_rom::i#1 = -- smc_supported_rom::i#2 -- vbum1=_dec_vbum1 + dec i + // [747] phi from smc_supported_rom::@3 to smc_supported_rom::@1 [phi:smc_supported_rom::@3->smc_supported_rom::@1] + // [747] 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 + i: .byte 0 + return: .byte 0 + rom_release: .byte 0 +} +.segment Code + // check_status_roms +/** + * @brief Check the status of any of the ROMs. + * + * @param status The status to be checked. + * @return unsigned char true if one chip is equal to the status. + */ +// __mem() char check_status_roms(__mem() char status) +check_status_roms: { + .label check_status_rom1_check_status_roms__0 = $4d + // [754] phi from check_status_roms to check_status_roms::@1 [phi:check_status_roms->check_status_roms::@1] + // [754] phi check_status_roms::rom_chip#2 = 0 [phi:check_status_roms->check_status_roms::@1#0] -- vbum1=vbuc1 lda #0 - sta rom_manufacturer_ids,y - // rom_device_names[rom_chip] = "----" - // [1136] rom_device_names[rom_detect::$14] = rom_detect::$31 -- qbuc1_derefidx_vbuz1=pbuc2 - ldy.z rom_detect__14 - lda #rom_detect__31 - sta rom_device_names+1,y - // rom_size_strings[rom_chip] = "000" - // [1137] rom_size_strings[rom_detect::$14] = rom_detect::$32 -- qbuc1_derefidx_vbuz1=pbuc2 - lda #rom_detect__32 - sta rom_size_strings+1,y - // rom_sizes[rom_chip] = 0 - // [1138] rom_detect::$24 = rom_detect::rom_chip#10 << 2 -- vbuz1=vbum2_rol_2 + sta rom_chip + // check_status_roms::@1 + __b1: + // for(unsigned char rom_chip = 0; rom_chip < 8; rom_chip++) + // [755] if(check_status_roms::rom_chip#2<8) goto check_status_roms::check_status_rom1 -- vbum1_lt_vbuc1_then_la1 lda rom_chip - asl - asl - sta.z rom_detect__24 - // [1139] rom_sizes[rom_detect::$24] = 0 -- pduc1_derefidx_vbuz1=vbuc2 - tay + cmp #8 + bcc check_status_rom1 + // [756] phi from check_status_roms::@1 to check_status_roms::@return [phi:check_status_roms::@1->check_status_roms::@return] + // [756] phi check_status_roms::return#2 = 0 [phi:check_status_roms::@1->check_status_roms::@return#0] -- vbum1=vbuc1 lda #0 - sta rom_sizes,y - sta rom_sizes+1,y - sta rom_sizes+2,y - sta rom_sizes+3,y - // rom_device_ids[rom_chip] = UNKNOWN - // [1140] rom_device_ids[rom_detect::rom_chip#10] = $55 -- pbuc1_derefidx_vbum1=vbuc2 - lda #$55 + sta return + // check_status_roms::@return + // } + // [757] return + rts + // check_status_roms::check_status_rom1 + check_status_rom1: + // status_rom[rom_chip] == status + // [758] check_status_roms::check_status_rom1_$0 = status_rom[check_status_roms::rom_chip#2] == check_status_roms::status#6 -- vboz1=pbuc1_derefidx_vbum2_eq_vbum3 + lda status ldy rom_chip - sta rom_device_ids,y - // rom_detect::@7 - __b7: - // rom_chip++; - // [1141] rom_detect::rom_chip#1 = ++ rom_detect::rom_chip#10 -- vbum1=_inc_vbum1 + 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); + // [759] check_status_roms::check_status_rom1_return#0 = (char)check_status_roms::check_status_rom1_$0 -- vbum1=vbuz2 + sta check_status_rom1_return + // check_status_roms::@3 + // if(check_status_rom(rom_chip, status)) + // [760] if(0==check_status_roms::check_status_rom1_return#0) goto check_status_roms::@2 -- 0_eq_vbum1_then_la1 + beq __b2 + // [756] phi from check_status_roms::@3 to check_status_roms::@return [phi:check_status_roms::@3->check_status_roms::@return] + // [756] phi check_status_roms::return#2 = 1 [phi:check_status_roms::@3->check_status_roms::@return#0] -- vbum1=vbuc1 + lda #1 + sta return + rts + // check_status_roms::@2 + __b2: + // for(unsigned char rom_chip = 0; rom_chip < 8; rom_chip++) + // [761] check_status_roms::rom_chip#1 = ++ check_status_roms::rom_chip#2 -- vbum1=_inc_vbum1 inc rom_chip - // rom_detect::@8 - // rom_detect_address += 0x80000 - // [1142] rom_detect::rom_detect_address#1 = rom_detect::rom_detect_address#10 + $80000 -- vdum1=vdum1_plus_vduc1 - clc - lda rom_detect_address - adc #<$80000 - sta rom_detect_address - lda rom_detect_address+1 - adc #>$80000 - sta rom_detect_address+1 - lda rom_detect_address+2 - adc #<$80000>>$10 - sta rom_detect_address+2 - lda rom_detect_address+3 - adc #>$80000>>$10 - sta rom_detect_address+3 - // [1106] phi from rom_detect::@8 to rom_detect::@1 [phi:rom_detect::@8->rom_detect::@1] - // [1106] phi rom_detect::rom_chip#10 = rom_detect::rom_chip#1 [phi:rom_detect::@8->rom_detect::@1#0] -- register_copy - // [1106] phi rom_detect::rom_detect_address#10 = rom_detect::rom_detect_address#1 [phi:rom_detect::@8->rom_detect::@1#1] -- register_copy + // [754] phi from check_status_roms::@2 to check_status_roms::@1 [phi:check_status_roms::@2->check_status_roms::@1] + // [754] 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 - // rom_detect::@5 - __b5: - // rom_device_names[rom_chip] = "f040" - // [1143] rom_device_names[rom_detect::$14] = rom_detect::$29 -- qbuc1_derefidx_vbuz1=pbuc2 - ldy.z rom_detect__14 - lda #rom_detect__29 - sta rom_device_names+1,y - // rom_size_strings[rom_chip] = "512" - // [1144] rom_size_strings[rom_detect::$14] = rom_detect::$30 -- qbuc1_derefidx_vbuz1=pbuc2 - lda #rom_detect__30 - sta rom_size_strings+1,y - // rom_sizes[rom_chip] = 512 * 1024 - // [1145] rom_detect::$21 = rom_detect::rom_chip#10 << 2 -- vbuz1=vbum2_rol_2 - lda rom_chip - asl - asl - sta.z rom_detect__21 - // [1146] rom_sizes[rom_detect::$21] = (unsigned long)$200*$400 -- pduc1_derefidx_vbuz1=vduc2 - tay - lda #<$200*$400 - sta rom_sizes,y - lda #>$200*$400 - sta rom_sizes+1,y - lda #<$200*$400>>$10 - sta rom_sizes+2,y - lda #>$200*$400>>$10 - sta rom_sizes+3,y - jmp __b7 - // rom_detect::@4 - __b4: - // rom_device_names[rom_chip] = "f020a" - // [1147] rom_device_names[rom_detect::$14] = rom_detect::$27 -- qbuc1_derefidx_vbuz1=pbuc2 - ldy.z rom_detect__14 - lda #rom_detect__27 - sta rom_device_names+1,y - // rom_size_strings[rom_chip] = "256" - // [1148] rom_size_strings[rom_detect::$14] = rom_detect::$28 -- qbuc1_derefidx_vbuz1=pbuc2 - lda #rom_detect__28 - sta rom_size_strings+1,y - // rom_sizes[rom_chip] = 256 * 1024 - // [1149] rom_detect::$18 = rom_detect::rom_chip#10 << 2 -- vbuz1=vbum2_rol_2 - lda rom_chip - asl - asl - sta.z rom_detect__18 - // [1150] rom_sizes[rom_detect::$18] = (unsigned long)$100*$400 -- pduc1_derefidx_vbuz1=vduc2 - tay - lda #<$100*$400 - sta rom_sizes,y - lda #>$100*$400 - sta rom_sizes+1,y - lda #<$100*$400>>$10 - sta rom_sizes+2,y - lda #>$100*$400>>$10 - sta rom_sizes+3,y - jmp __b7 - // rom_detect::@3 - __b3: - // rom_device_names[rom_chip] = "f010a" - // [1151] rom_device_names[rom_detect::$14] = rom_detect::$25 -- qbuc1_derefidx_vbuz1=pbuc2 - ldy.z rom_detect__14 - lda #rom_detect__25 - sta rom_device_names+1,y - // rom_size_strings[rom_chip] = "128" - // [1152] rom_size_strings[rom_detect::$14] = rom_detect::$26 -- qbuc1_derefidx_vbuz1=pbuc2 - lda #rom_detect__26 - sta rom_size_strings+1,y - // rom_sizes[rom_chip] = 128 * 1024 - // [1153] rom_detect::$15 = rom_detect::rom_chip#10 << 2 -- vbuz1=vbum2_rol_2 - lda rom_chip - asl - asl - sta.z rom_detect__15 - // [1154] rom_sizes[rom_detect::$15] = (unsigned long)$80*$400 -- pduc1_derefidx_vbuz1=vduc2 - tay - lda #<$80*$400 - sta rom_sizes,y - lda #>$80*$400 - sta rom_sizes+1,y - lda #<$80*$400>>$10 - sta rom_sizes+2,y - lda #>$80*$400>>$10 - sta rom_sizes+3,y - jmp __b7 .segment Data - rom_detect__25: .text "f010a" - .byte 0 - rom_detect__26: .text "128" - .byte 0 - rom_detect__27: .text "f020a" - .byte 0 - rom_detect__28: .text "256" - .byte 0 - rom_detect__29: .text "f040" - .byte 0 - rom_detect__30: .text "512" - .byte 0 - rom_detect__31: .text "----" - .byte 0 - rom_detect__32: .text "000" - .byte 0 + check_status_rom1_return: .byte 0 rom_chip: .byte 0 - rom_detect_address: .dword 0 + return: .byte 0 + status: .byte 0 } .segment Code - // smc_read -/** - * @brief Read the SMC.BIN file into RAM_BASE. - * The maximum size of SMC.BIN data that should be in the file is 0x1E00. - * - * @return unsigned int The amount of bytes read from SMC.BIN to be flashed. - */ -// __mem() unsigned int smc_read(__mem() char info_status) -smc_read: { - .const smc_bram_bank = 1 - .label fp = $c3 - .label smc_bram_ptr = $4c - .label smc_action_text = $79 - // if(info_status == STATUS_READING) - // [1156] if(smc_read::info_status#10==STATUS_READING) goto smc_read::@1 -- vbum1_eq_vbuc1_then_la1 - lda #STATUS_READING - cmp info_status - beq __b1 - // [1158] phi from smc_read to smc_read::@2 [phi:smc_read->smc_read::@2] - // [1158] phi smc_read::smc_action_text#12 = smc_action_text#2 [phi:smc_read->smc_read::@2#0] -- pbuz1=pbuc1 - lda #smc_action_text_1 - sta.z smc_action_text+1 - jmp __b2 - // [1157] phi from smc_read to smc_read::@1 [phi:smc_read->smc_read::@1] - // smc_read::@1 + // clrscr +// clears the screen and moves the cursor to the upper left-hand corner of the screen. +clrscr: { + .label clrscr__0 = $4d + .label clrscr__1 = $4e + .label clrscr__2 = $3b + // unsigned int line_text = __conio.mapbase_offset + // [762] clrscr::line_text#0 = *((unsigned int *)&__conio+3) -- vwum1=_deref_pwuc1 + lda __conio+3 + sta line_text + lda __conio+3+1 + sta line_text+1 + // *VERA_CTRL &= ~VERA_ADDRSEL + // [763] *VERA_CTRL = *VERA_CTRL & ~VERA_ADDRSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 + lda #VERA_ADDRSEL^$ff + and VERA_CTRL + sta VERA_CTRL + // __conio.mapbase_bank | VERA_INC_1 + // [764] clrscr::$0 = *((char *)&__conio+5) | VERA_INC_1 -- vbuz1=_deref_pbuc1_bor_vbuc2 + lda #VERA_INC_1 + ora __conio+5 + sta.z clrscr__0 + // *VERA_ADDRX_H = __conio.mapbase_bank | VERA_INC_1 + // [765] *VERA_ADDRX_H = clrscr::$0 -- _deref_pbuc1=vbuz1 + sta VERA_ADDRX_H + // unsigned char l = __conio.mapheight + // [766] clrscr::l#0 = *((char *)&__conio+9) -- vbum1=_deref_pbuc1 + lda __conio+9 + sta l + // [767] phi from clrscr clrscr::@3 to clrscr::@1 [phi:clrscr/clrscr::@3->clrscr::@1] + // [767] phi clrscr::l#4 = clrscr::l#0 [phi:clrscr/clrscr::@3->clrscr::@1#0] -- register_copy + // [767] phi clrscr::ch#0 = clrscr::line_text#0 [phi:clrscr/clrscr::@3->clrscr::@1#1] -- register_copy + // clrscr::@1 __b1: - // [1158] phi from smc_read::@1 to smc_read::@2 [phi:smc_read::@1->smc_read::@2] - // [1158] 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.z smc_action_text+1 - // smc_read::@2 + // BYTE0(ch) + // [768] clrscr::$1 = byte0 clrscr::ch#0 -- vbuz1=_byte0_vwum2 + lda ch + sta.z clrscr__1 + // *VERA_ADDRX_L = BYTE0(ch) + // [769] *VERA_ADDRX_L = clrscr::$1 -- _deref_pbuc1=vbuz1 + // Set address + sta VERA_ADDRX_L + // BYTE1(ch) + // [770] clrscr::$2 = byte1 clrscr::ch#0 -- vbuz1=_byte1_vwum2 + lda ch+1 + sta.z clrscr__2 + // *VERA_ADDRX_M = BYTE1(ch) + // [771] *VERA_ADDRX_M = clrscr::$2 -- _deref_pbuc1=vbuz1 + sta VERA_ADDRX_M + // unsigned char c = __conio.mapwidth+1 + // [772] clrscr::c#0 = *((char *)&__conio+8) + 1 -- vbum1=_deref_pbuc1_plus_1 + lda __conio+8 + inc + sta c + // [773] phi from clrscr::@1 clrscr::@2 to clrscr::@2 [phi:clrscr::@1/clrscr::@2->clrscr::@2] + // [773] phi clrscr::c#2 = clrscr::c#0 [phi:clrscr::@1/clrscr::@2->clrscr::@2#0] -- register_copy + // clrscr::@2 __b2: - // smc_read::bank_set_bram1 - // BRAM = bank - // [1159] BRAM = smc_read::smc_bram_bank -- vbuz1=vbuc1 - lda #smc_bram_bank - sta.z BRAM - // [1160] phi from smc_read::bank_set_bram1 to smc_read::@16 [phi:smc_read::bank_set_bram1->smc_read::@16] - // smc_read::@16 - // textcolor(WHITE) - // [1161] call textcolor - // [784] phi from smc_read::@16 to textcolor [phi:smc_read::@16->textcolor] - // [784] phi textcolor::color#23 = WHITE [phi:smc_read::@16->textcolor#0] -- vbum1=vbuc1 - lda #WHITE - sta textcolor.color - jsr textcolor - // [1162] phi from smc_read::@16 to smc_read::@17 [phi:smc_read::@16->smc_read::@17] - // smc_read::@17 - // gotoxy(x, y) - // [1163] call gotoxy - // [802] phi from smc_read::@17 to gotoxy [phi:smc_read::@17->gotoxy] - // [802] phi gotoxy::y#37 = PROGRESS_Y [phi:smc_read::@17->gotoxy#0] -- vbum1=vbuc1 - lda #PROGRESS_Y - sta gotoxy.y - // [802] phi gotoxy::x#37 = PROGRESS_X [phi:smc_read::@17->gotoxy#1] -- vbum1=vbuc1 - lda #PROGRESS_X - sta gotoxy.x - jsr gotoxy - // [1164] phi from smc_read::@17 to smc_read::@18 [phi:smc_read::@17->smc_read::@18] - // smc_read::@18 - // FILE *fp = fopen("SMC.BIN", "r") - // [1165] call fopen - // [2416] phi from smc_read::@18 to fopen [phi:smc_read::@18->fopen] - // [2416] phi __errno#473 = __errno#102 [phi:smc_read::@18->fopen#0] -- register_copy - // [2416] phi fopen::pathtoken#0 = smc_read::path [phi:smc_read::@18->fopen#1] -- pbuz1=pbuc1 - lda #path - sta.z fopen.pathtoken+1 - // [2416] phi __stdio_filecount#27 = __stdio_filecount#128 [phi:smc_read::@18->fopen#2] -- register_copy - jsr fopen - // FILE *fp = fopen("SMC.BIN", "r") - // [1166] fopen::return#4 = fopen::return#2 - // smc_read::@19 - // [1167] smc_read::fp#0 = fopen::return#4 -- pssz1=pssz2 - lda.z fopen.return - sta.z fp - lda.z fopen.return+1 - sta.z fp+1 - // if (fp) - // [1168] if((struct $2 *)0==smc_read::fp#0) goto smc_read::@3 -- pssc1_eq_pssz1_then_la1 - lda.z fp - cmp #<0 - bne !+ - lda.z fp+1 - cmp #>0 - bne !__b5+ - jmp __b5 - !__b5: - !: - // smc_read::@4 - // fgets(smc_file_header, 32, fp) - // [1169] fgets::stream#1 = smc_read::fp#0 -- pssz1=pssz2 - lda.z fp - sta.z fgets.stream - lda.z fp+1 - sta.z fgets.stream+1 - // [1170] call fgets - // [2497] phi from smc_read::@4 to fgets [phi:smc_read::@4->fgets] - // [2497] phi fgets::ptr#14 = smc_file_header [phi:smc_read::@4->fgets#0] -- pbuz1=pbuc1 - lda #smc_file_header - sta.z fgets.ptr+1 - // [2497] phi fgets::size#10 = $20 [phi:smc_read::@4->fgets#1] -- vwum1=vbuc1 - lda #<$20 - sta fgets.size - lda #>$20 - sta fgets.size+1 - // [2497] phi fgets::stream#4 = fgets::stream#1 [phi:smc_read::@4->fgets#2] -- register_copy - jsr fgets - // fgets(smc_file_header, 32, fp) - // [1171] fgets::return#11 = fgets::return#1 - // smc_read::@20 - // smc_file_read = fgets(smc_file_header, 32, fp) - // [1172] smc_read::smc_file_read#1 = fgets::return#11 - // if(smc_file_read) - // [1173] if(0==smc_read::smc_file_read#1) goto smc_read::@3 -- 0_eq_vwum1_then_la1 - lda smc_file_read - ora smc_file_read+1 - beq __b5 - // smc_read::@5 - // if(info_status == STATUS_CHECKING) - // [1174] if(smc_read::info_status#10!=STATUS_CHECKING) goto smc_read::@7 -- vbum1_neq_vbuc1_then_la1 - lda #STATUS_CHECKING - cmp info_status - bne __b4 - // [1175] phi from smc_read::@5 to smc_read::@6 [phi:smc_read::@5->smc_read::@6] - // smc_read::@6 - // [1176] phi from smc_read::@6 to smc_read::@7 [phi:smc_read::@6->smc_read::@7] - // [1176] phi smc_read::y#12 = PROGRESS_Y [phi:smc_read::@6->smc_read::@7#0] -- vbum1=vbuc1 - lda #PROGRESS_Y - sta y - // [1176] phi smc_read::progress_row_bytes#10 = 0 [phi:smc_read::@6->smc_read::@7#1] -- vwum1=vwuc1 - lda #<0 - sta progress_row_bytes - sta progress_row_bytes+1 - // [1176] phi smc_read::smc_file_size#10 = 0 [phi:smc_read::@6->smc_read::@7#2] -- vwum1=vwuc1 - sta smc_file_size - sta smc_file_size+1 - // [1176] phi smc_read::smc_bram_ptr#10 = (char *) 1024 [phi:smc_read::@6->smc_read::@7#3] -- pbuz1=pbuc1 - lda #<$400 - sta.z smc_bram_ptr - lda #>$400 - sta.z smc_bram_ptr+1 - jmp __b7 - // We read block_size bytes at a time, and each block_size bytes we plot a dot. - // Every r bytes we move to the next line. - // [1176] phi from smc_read::@5 to smc_read::@7 [phi:smc_read::@5->smc_read::@7] - __b4: - // [1176] phi smc_read::y#12 = PROGRESS_Y [phi:smc_read::@5->smc_read::@7#0] -- vbum1=vbuc1 - lda #PROGRESS_Y - sta y - // [1176] phi smc_read::progress_row_bytes#10 = 0 [phi:smc_read::@5->smc_read::@7#1] -- vwum1=vwuc1 - lda #<0 - sta progress_row_bytes - sta progress_row_bytes+1 - // [1176] phi smc_read::smc_file_size#10 = 0 [phi:smc_read::@5->smc_read::@7#2] -- vwum1=vwuc1 - sta smc_file_size - sta smc_file_size+1 - // [1176] phi smc_read::smc_bram_ptr#10 = (char *)$a000 [phi:smc_read::@5->smc_read::@7#3] -- pbuz1=pbuc1 - lda #<$a000 - sta.z smc_bram_ptr - lda #>$a000 - sta.z smc_bram_ptr+1 - // smc_read::@7 - __b7: - // fgets(smc_bram_ptr, SMC_PROGRESS_CELL, fp) - // [1177] fgets::ptr#4 = smc_read::smc_bram_ptr#10 -- pbuz1=pbuz2 - lda.z smc_bram_ptr - sta.z fgets.ptr - lda.z smc_bram_ptr+1 - sta.z fgets.ptr+1 - // [1178] fgets::stream#2 = smc_read::fp#0 -- pssz1=pssz2 - lda.z fp - sta.z fgets.stream - lda.z fp+1 - sta.z fgets.stream+1 - // [1179] call fgets - // [2497] phi from smc_read::@7 to fgets [phi:smc_read::@7->fgets] - // [2497] phi fgets::ptr#14 = fgets::ptr#4 [phi:smc_read::@7->fgets#0] -- register_copy - // [2497] phi fgets::size#10 = SMC_PROGRESS_CELL [phi:smc_read::@7->fgets#1] -- vwum1=vbuc1 - lda #SMC_PROGRESS_CELL - sta fgets.size+1 - // [2497] phi fgets::stream#4 = fgets::stream#2 [phi:smc_read::@7->fgets#2] -- register_copy - jsr fgets - // fgets(smc_bram_ptr, SMC_PROGRESS_CELL, fp) - // [1180] fgets::return#12 = fgets::return#1 - // smc_read::@21 - // smc_file_read = fgets(smc_bram_ptr, SMC_PROGRESS_CELL, fp) - // [1181] smc_read::smc_file_read#10 = fgets::return#12 - // while (smc_file_read = fgets(smc_bram_ptr, SMC_PROGRESS_CELL, fp)) - // [1182] if(0!=smc_read::smc_file_read#10) goto smc_read::@8 -- 0_neq_vwum1_then_la1 - lda smc_file_read - ora smc_file_read+1 - bne __b8 - // smc_read::@9 - // fclose(fp) - // [1183] fclose::stream#1 = smc_read::fp#0 - // [1184] call fclose - // [2551] phi from smc_read::@9 to fclose [phi:smc_read::@9->fclose] - // [2551] phi fclose::stream#3 = fclose::stream#1 [phi:smc_read::@9->fclose#0] -- register_copy - jsr fclose - // [1185] phi from smc_read::@9 to smc_read::@3 [phi:smc_read::@9->smc_read::@3] - // [1185] phi __stdio_filecount#39 = __stdio_filecount#2 [phi:smc_read::@9->smc_read::@3#0] -- register_copy - // [1185] phi smc_read::return#0 = smc_read::smc_file_size#10 [phi:smc_read::@9->smc_read::@3#1] -- register_copy - rts - // [1185] phi from smc_read::@19 smc_read::@20 to smc_read::@3 [phi:smc_read::@19/smc_read::@20->smc_read::@3] - __b5: - // [1185] phi __stdio_filecount#39 = __stdio_filecount#1 [phi:smc_read::@19/smc_read::@20->smc_read::@3#0] -- register_copy - // [1185] phi smc_read::return#0 = 0 [phi:smc_read::@19/smc_read::@20->smc_read::@3#1] -- vwum1=vwuc1 - lda #<0 - sta return - sta return+1 - // smc_read::@3 - // smc_read::@return + // *VERA_DATA0 = ' ' + // [774] *VERA_DATA0 = ' ' -- _deref_pbuc1=vbuc2 + lda #' ' + sta VERA_DATA0 + // *VERA_DATA0 = __conio.color + // [775] *VERA_DATA0 = *((char *)&__conio+$d) -- _deref_pbuc1=_deref_pbuc2 + lda __conio+$d + sta VERA_DATA0 + // c--; + // [776] clrscr::c#1 = -- clrscr::c#2 -- vbum1=_dec_vbum1 + dec c + // while(c) + // [777] if(0!=clrscr::c#1) goto clrscr::@2 -- 0_neq_vbum1_then_la1 + lda c + bne __b2 + // clrscr::@3 + // line_text += __conio.rowskip + // [778] clrscr::line_text#1 = clrscr::ch#0 + *((unsigned int *)&__conio+$a) -- vwum1=vwum1_plus__deref_pwuc1 + clc + lda line_text + adc __conio+$a + sta line_text + lda line_text+1 + adc __conio+$a+1 + sta line_text+1 + // l--; + // [779] clrscr::l#1 = -- clrscr::l#4 -- vbum1=_dec_vbum1 + dec l + // while(l) + // [780] if(0!=clrscr::l#1) goto clrscr::@1 -- 0_neq_vbum1_then_la1 + lda l + bne __b1 + // clrscr::@4 + // __conio.cursor_x = 0 + // [781] *((char *)&__conio) = 0 -- _deref_pbuc1=vbuc2 + lda #0 + sta __conio + // __conio.cursor_y = 0 + // [782] *((char *)&__conio+1) = 0 -- _deref_pbuc1=vbuc2 + sta __conio+1 + // __conio.offset = __conio.mapbase_offset + // [783] *((unsigned int *)&__conio+$13) = *((unsigned int *)&__conio+3) -- _deref_pwuc1=_deref_pwuc2 + lda __conio+3 + sta __conio+$13 + lda __conio+3+1 + sta __conio+$13+1 + // clrscr::@return // } - // [1186] return + // [784] return rts - // smc_read::@8 - __b8: - // display_action_text_reading(smc_action_text, "SMC.BIN", smc_file_size, SMC_CHIP_SIZE, smc_bram_bank, smc_bram_ptr) - // [1187] display_action_text_reading::action#1 = smc_read::smc_action_text#12 -- pbuz1=pbuz2 - lda.z smc_action_text - sta.z display_action_text_reading.action - lda.z smc_action_text+1 - sta.z display_action_text_reading.action+1 - // [1188] display_action_text_reading::bytes#1 = smc_read::smc_file_size#10 -- vdum1=vwum2 - lda smc_file_size - sta display_action_text_reading.bytes - lda smc_file_size+1 - sta display_action_text_reading.bytes+1 - lda #0 - sta display_action_text_reading.bytes+2 - sta display_action_text_reading.bytes+3 - // [1189] display_action_text_reading::bram_ptr#1 = smc_read::smc_bram_ptr#10 -- pbuz1=pbuz2 - lda.z smc_bram_ptr - sta.z display_action_text_reading.bram_ptr - lda.z smc_bram_ptr+1 - sta.z display_action_text_reading.bram_ptr+1 - // [1190] call display_action_text_reading - // [2580] phi from smc_read::@8 to display_action_text_reading [phi:smc_read::@8->display_action_text_reading] - // [2580] phi display_action_text_reading::bram_ptr#10 = display_action_text_reading::bram_ptr#1 [phi:smc_read::@8->display_action_text_reading#0] -- register_copy - // [2580] phi display_action_text_reading::bram_bank#10 = smc_read::smc_bram_bank [phi:smc_read::@8->display_action_text_reading#1] -- vbum1=vbuc1 - lda #smc_bram_bank - sta display_action_text_reading.bram_bank - // [2580] phi display_action_text_reading::size#10 = SMC_CHIP_SIZE [phi:smc_read::@8->display_action_text_reading#2] -- vdum1=vduc1 - lda #SMC_CHIP_SIZE - sta display_action_text_reading.size+1 - lda #>$10 - sta display_action_text_reading.size+2 - lda #>SMC_CHIP_SIZE>>$10 - sta display_action_text_reading.size+3 - // [2580] phi display_action_text_reading::bytes#3 = display_action_text_reading::bytes#1 [phi:smc_read::@8->display_action_text_reading#3] -- register_copy - // [2580] phi display_action_text_reading::file#3 = smc_read::path [phi:smc_read::@8->display_action_text_reading#4] -- pbuz1=pbuc1 - lda #path - sta.z display_action_text_reading.file+1 - // [2580] phi display_action_text_reading::action#3 = display_action_text_reading::action#1 [phi:smc_read::@8->display_action_text_reading#5] -- register_copy - jsr display_action_text_reading - // smc_read::@22 - // if (progress_row_bytes == SMC_PROGRESS_ROW) - // [1191] if(smc_read::progress_row_bytes#10!=SMC_PROGRESS_ROW) goto smc_read::@10 -- vwum1_neq_vwuc1_then_la1 - lda progress_row_bytes+1 - cmp #>SMC_PROGRESS_ROW - bne __b10 - lda progress_row_bytes - cmp #gotoxy] - // [802] phi gotoxy::y#37 = gotoxy::y#27 [phi:smc_read::@13->gotoxy#0] -- register_copy - // [802] phi gotoxy::x#37 = PROGRESS_X [phi:smc_read::@13->gotoxy#1] -- vbum1=vbuc1 - lda #PROGRESS_X - sta gotoxy.x - jsr gotoxy - // [1195] phi from smc_read::@13 to smc_read::@10 [phi:smc_read::@13->smc_read::@10] - // [1195] phi smc_read::y#13 = smc_read::y#1 [phi:smc_read::@13->smc_read::@10#0] -- register_copy - // [1195] phi smc_read::progress_row_bytes#11 = 0 [phi:smc_read::@13->smc_read::@10#1] -- vwum1=vbuc1 - lda #<0 - sta progress_row_bytes - sta progress_row_bytes+1 - // [1195] phi from smc_read::@22 to smc_read::@10 [phi:smc_read::@22->smc_read::@10] - // [1195] phi smc_read::y#13 = smc_read::y#12 [phi:smc_read::@22->smc_read::@10#0] -- register_copy - // [1195] phi smc_read::progress_row_bytes#11 = smc_read::progress_row_bytes#10 [phi:smc_read::@22->smc_read::@10#1] -- register_copy - // smc_read::@10 - __b10: - // if(info_status == STATUS_READING) - // [1196] if(smc_read::info_status#10!=STATUS_READING) goto smc_read::@11 -- vbum1_neq_vbuc1_then_la1 - lda #STATUS_READING - cmp info_status - bne __b11 - // smc_read::@14 - // cputc('.') - // [1197] stackpush(char) = '.' -- _stackpushbyte_=vbuc1 - lda #'.' - pha - // [1198] callexecute cputc -- call_vprc1 - jsr cputc - // sideeffect stackpullpadding(1) -- _stackpullpadding_1 - pla - // smc_read::@11 - __b11: - // if(info_status == STATUS_CHECKING) - // [1200] if(smc_read::info_status#10==STATUS_CHECKING) goto smc_read::@12 -- vbum1_eq_vbuc1_then_la1 - lda #STATUS_CHECKING - cmp info_status - beq __b6 - // smc_read::@15 - // smc_bram_ptr += smc_file_read - // [1201] smc_read::smc_bram_ptr#3 = smc_read::smc_bram_ptr#10 + smc_read::smc_file_read#10 -- pbuz1=pbuz1_plus_vwum2 - clc - lda.z smc_bram_ptr - adc smc_file_read - sta.z smc_bram_ptr - lda.z smc_bram_ptr+1 - adc smc_file_read+1 - sta.z smc_bram_ptr+1 - // [1202] phi from smc_read::@15 to smc_read::@12 [phi:smc_read::@15->smc_read::@12] - // [1202] phi smc_read::smc_bram_ptr#7 = smc_read::smc_bram_ptr#3 [phi:smc_read::@15->smc_read::@12#0] -- register_copy - jmp __b12 - // [1202] phi from smc_read::@11 to smc_read::@12 [phi:smc_read::@11->smc_read::@12] - __b6: - // [1202] phi smc_read::smc_bram_ptr#7 = (char *) 1024 [phi:smc_read::@11->smc_read::@12#0] -- pbuz1=pbuc1 - lda #<$400 - sta.z smc_bram_ptr - lda #>$400 - sta.z smc_bram_ptr+1 - // smc_read::@12 - __b12: - // smc_file_size += smc_file_read - // [1203] smc_read::smc_file_size#1 = smc_read::smc_file_size#10 + smc_read::smc_file_read#10 -- vwum1=vwum1_plus_vwum2 - clc - lda smc_file_size - adc smc_file_read - sta smc_file_size - lda smc_file_size+1 - adc smc_file_read+1 - sta smc_file_size+1 - // progress_row_bytes += smc_file_read - // [1204] smc_read::progress_row_bytes#2 = smc_read::progress_row_bytes#11 + smc_read::smc_file_read#10 -- vwum1=vwum1_plus_vwum2 - clc - lda progress_row_bytes - adc smc_file_read - sta progress_row_bytes - lda progress_row_bytes+1 - adc smc_file_read+1 - sta progress_row_bytes+1 - // [1176] phi from smc_read::@12 to smc_read::@7 [phi:smc_read::@12->smc_read::@7] - // [1176] phi smc_read::y#12 = smc_read::y#13 [phi:smc_read::@12->smc_read::@7#0] -- register_copy - // [1176] phi smc_read::progress_row_bytes#10 = smc_read::progress_row_bytes#2 [phi:smc_read::@12->smc_read::@7#1] -- register_copy - // [1176] phi smc_read::smc_file_size#10 = smc_read::smc_file_size#1 [phi:smc_read::@12->smc_read::@7#2] -- register_copy - // [1176] phi smc_read::smc_bram_ptr#10 = smc_read::smc_bram_ptr#7 [phi:smc_read::@12->smc_read::@7#3] -- register_copy - jmp __b7 .segment Data - path: .text "SMC.BIN" - .byte 0 - return: .word 0 - .label smc_file_read = fgets.read - y: .byte 0 - .label smc_file_size = return - /// Holds the amount of bytes actually read in the memory to be flashed. - progress_row_bytes: .word 0 - info_status: .byte 0 + .label line_text = ch + l: .byte 0 + ch: .word 0 + c: .byte 0 } .segment Code - // snprintf_init -/// Initialize the snprintf() state -// void snprintf_init(__zp($45) char *s, unsigned int n) -snprintf_init: { - .label s = $45 - // __snprintf_capacity = n - // [1206] __snprintf_capacity = $ffff -- vwum1=vwuc1 - lda #<$ffff - sta __snprintf_capacity - lda #>$ffff - sta __snprintf_capacity+1 - // __snprintf_size = 0 - // [1207] __snprintf_size = 0 -- vwum1=vbuc1 - lda #<0 - sta __snprintf_size - sta __snprintf_size+1 - // __snprintf_buffer = s - // [1208] __snprintf_buffer = snprintf_init::s#31 -- pbuz1=pbuz2 - lda.z s - sta.z __snprintf_buffer - lda.z s+1 - sta.z __snprintf_buffer+1 - // snprintf_init::@return - // } - // [1209] return - rts -} // printf_str /// Print a NUL-terminated string -// void printf_str(__zp($3b) void (*putc)(char), __zp($50) const char *s) +// void printf_str(__zp($49) void (*putc)(char), __zp($42) const char *s) printf_str: { - .label s = $50 - .label putc = $3b - // [1211] phi from printf_str printf_str::@2 to printf_str::@1 [phi:printf_str/printf_str::@2->printf_str::@1] - // [1211] phi printf_str::s#83 = printf_str::s#84 [phi:printf_str/printf_str::@2->printf_str::@1#0] -- register_copy + .label s = $42 + .label putc = $49 + // [786] phi from printf_str printf_str::@2 to printf_str::@1 [phi:printf_str/printf_str::@2->printf_str::@1] + // [786] phi printf_str::s#52 = printf_str::s#53 [phi:printf_str/printf_str::@2->printf_str::@1#0] -- register_copy // printf_str::@1 __b1: // while(c=*s++) - // [1212] printf_str::c#1 = *printf_str::s#83 -- vbum1=_deref_pbuz2 + // [787] printf_str::c#1 = *printf_str::s#52 -- vbum1=_deref_pbuz2 ldy #0 lda (s),y sta c - // [1213] printf_str::s#0 = ++ printf_str::s#83 -- pbuz1=_inc_pbuz1 + // [788] printf_str::s#0 = ++ printf_str::s#52 -- pbuz1=_inc_pbuz1 inc.z s bne !+ inc.z s+1 !: - // [1214] if(0!=printf_str::c#1) goto printf_str::@2 -- 0_neq_vbum1_then_la1 + // [789] if(0!=printf_str::c#1) goto printf_str::@2 -- 0_neq_vbum1_then_la1 lda c bne __b2 // printf_str::@return // } - // [1215] return + // [790] return rts // printf_str::@2 __b2: // putc(c) - // [1216] stackpush(char) = printf_str::c#1 -- _stackpushbyte_=vbum1 + // [791] stackpush(char) = printf_str::c#1 -- _stackpushbyte_=vbum1 lda c pha - // [1217] callexecute *printf_str::putc#84 -- call__deref_pprz1 - jsr icall15 + // [792] callexecute *printf_str::putc#53 -- call__deref_pprz1 + jsr icall5 // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla jmp __b1 // Outside Flow - icall15: + icall5: jmp (putc) .segment Data c: .byte 0 } .segment Code - // printf_string -// Print a string value using a specific format -// Handles justification and min length -// void printf_string(__zp($4a) void (*putc)(char), __zp($50) char *str, __mem() char format_min_length, __mem() char format_justify_left) -printf_string: { - .label printf_string__9 = $3d - .label str = $50 - .label str_1 = $b0 - .label putc = $4a - // if(format.min_length) - // [1220] if(0==printf_string::format_min_length#26) goto printf_string::@1 -- 0_eq_vbum1_then_la1 - lda format_min_length - beq __b3 - // printf_string::@3 - // strlen(str) - // [1221] strlen::str#3 = printf_string::str#26 -- pbuz1=pbuz2 - lda.z str - sta.z strlen.str - lda.z str+1 - sta.z strlen.str+1 - // [1222] call strlen - // [2611] phi from printf_string::@3 to strlen [phi:printf_string::@3->strlen] - // [2611] phi strlen::str#8 = strlen::str#3 [phi:printf_string::@3->strlen#0] -- register_copy - jsr strlen - // strlen(str) - // [1223] strlen::return#10 = strlen::len#2 - // printf_string::@6 - // [1224] printf_string::$9 = strlen::return#10 -- vwuz1=vwum2 - lda strlen.return - sta.z printf_string__9 - lda strlen.return+1 - sta.z printf_string__9+1 - // signed char len = (signed char)strlen(str) - // [1225] printf_string::len#0 = (signed char)printf_string::$9 -- vbsm1=_sbyte_vwuz2 - lda.z printf_string__9 - sta len - // padding = (signed char)format.min_length - len - // [1226] printf_string::padding#1 = (signed char)printf_string::format_min_length#26 - printf_string::len#0 -- vbsm1=vbsm1_minus_vbsm2 - lda padding - sec - sbc len - sta padding - // if(padding<0) - // [1227] if(printf_string::padding#1>=0) goto printf_string::@10 -- vbsm1_ge_0_then_la1 - cmp #0 - bpl __b1 - // [1229] phi from printf_string printf_string::@6 to printf_string::@1 [phi:printf_string/printf_string::@6->printf_string::@1] - __b3: - // [1229] phi printf_string::padding#3 = 0 [phi:printf_string/printf_string::@6->printf_string::@1#0] -- vbsm1=vbsc1 + // wait_moment +/** + * @brief + * + */ +// void wait_moment(__mem() char w) +wait_moment: { + // [795] phi from wait_moment to wait_moment::@1 [phi:wait_moment->wait_moment::@1] + // [795] phi wait_moment::j#2 = 0 [phi:wait_moment->wait_moment::@1#0] -- vbum1=vbuc1 lda #0 - sta padding - // [1228] phi from printf_string::@6 to printf_string::@10 [phi:printf_string::@6->printf_string::@10] - // printf_string::@10 - // [1229] phi from printf_string::@10 to printf_string::@1 [phi:printf_string::@10->printf_string::@1] - // [1229] phi printf_string::padding#3 = printf_string::padding#1 [phi:printf_string::@10->printf_string::@1#0] -- register_copy - // printf_string::@1 + sta j + // wait_moment::@1 __b1: - // if(!format.justify_left && padding) - // [1230] if(0!=printf_string::format_justify_left#26) goto printf_string::@2 -- 0_neq_vbum1_then_la1 - lda format_justify_left - bne __b2 - // printf_string::@8 - // [1231] if(0!=printf_string::padding#3) goto printf_string::@4 -- 0_neq_vbsm1_then_la1 - lda padding - cmp #0 - bne __b4 - jmp __b2 - // printf_string::@4 - __b4: - // printf_padding(putc, ' ',(char)padding) - // [1232] printf_padding::putc#3 = printf_string::putc#26 -- pprz1=pprz2 - lda.z putc - sta.z printf_padding.putc - lda.z putc+1 - sta.z printf_padding.putc+1 - // [1233] printf_padding::length#3 = (char)printf_string::padding#3 -- vbum1=vbum2 - lda padding - sta printf_padding.length - // [1234] call printf_padding - // [2617] phi from printf_string::@4 to printf_padding [phi:printf_string::@4->printf_padding] - // [2617] phi printf_padding::putc#7 = printf_padding::putc#3 [phi:printf_string::@4->printf_padding#0] -- register_copy - // [2617] phi printf_padding::pad#7 = ' ' [phi:printf_string::@4->printf_padding#1] -- vbum1=vbuc1 - lda #' ' - sta printf_padding.pad - // [2617] phi printf_padding::length#6 = printf_padding::length#3 [phi:printf_string::@4->printf_padding#2] -- register_copy - jsr printf_padding - // printf_string::@2 - __b2: - // printf_str(putc, str) - // [1235] printf_str::putc#1 = printf_string::putc#26 -- pprz1=pprz2 - lda.z putc - sta.z printf_str.putc - lda.z putc+1 - sta.z printf_str.putc+1 - // [1236] printf_str::s#2 = printf_string::str#26 - // [1237] call printf_str - // [1210] phi from printf_string::@2 to printf_str [phi:printf_string::@2->printf_str] - // [1210] phi printf_str::putc#84 = printf_str::putc#1 [phi:printf_string::@2->printf_str#0] -- register_copy - // [1210] phi printf_str::s#84 = printf_str::s#2 [phi:printf_string::@2->printf_str#1] -- register_copy - jsr printf_str - // printf_string::@7 - // if(format.justify_left && padding) - // [1238] if(0==printf_string::format_justify_left#26) goto printf_string::@return -- 0_eq_vbum1_then_la1 - lda format_justify_left - beq __breturn - // printf_string::@9 - // [1239] if(0!=printf_string::padding#3) goto printf_string::@5 -- 0_neq_vbsm1_then_la1 - lda padding - cmp #0 - bne __b5 - rts - // printf_string::@5 - __b5: - // printf_padding(putc, ' ',(char)padding) - // [1240] printf_padding::putc#4 = printf_string::putc#26 -- pprz1=pprz2 - lda.z putc - sta.z printf_padding.putc - lda.z putc+1 - sta.z printf_padding.putc+1 - // [1241] printf_padding::length#4 = (char)printf_string::padding#3 -- vbum1=vbum2 - lda padding - sta printf_padding.length - // [1242] call printf_padding - // [2617] phi from printf_string::@5 to printf_padding [phi:printf_string::@5->printf_padding] - // [2617] phi printf_padding::putc#7 = printf_padding::putc#4 [phi:printf_string::@5->printf_padding#0] -- register_copy - // [2617] phi printf_padding::pad#7 = ' ' [phi:printf_string::@5->printf_padding#1] -- vbum1=vbuc1 - lda #' ' - sta printf_padding.pad - // [2617] phi printf_padding::length#6 = printf_padding::length#4 [phi:printf_string::@5->printf_padding#2] -- register_copy - jsr printf_padding - // printf_string::@return - __breturn: + // for(unsigned char j=0; jwait_moment::@2] + __b4: + // [798] phi wait_moment::i#2 = $ffff [phi:wait_moment::@1->wait_moment::@2#0] -- vwum1=vwuc1 + lda #<$ffff + sta i + lda #>$ffff + sta i+1 + // wait_moment::@2 + __b2: + // for(unsigned int i=65535; i>0; i--) + // [799] if(wait_moment::i#2>0) goto wait_moment::@3 -- vwum1_gt_0_then_la1 + lda i+1 + bne __b3 + lda i + bne __b3 + !: + // wait_moment::@4 + // for(unsigned char j=0; jwait_moment::@1] + // [795] phi wait_moment::j#2 = wait_moment::j#1 [phi:wait_moment::@4->wait_moment::@1#0] -- register_copy + jmp __b1 + // wait_moment::@3 + __b3: + // for(unsigned int i=65535; i>0; i--) + // [801] wait_moment::i#1 = -- wait_moment::i#2 -- vwum1=_dec_vwum1 + lda i + bne !+ + dec i+1 + !: + dec i + // [798] phi from wait_moment::@3 to wait_moment::@2 [phi:wait_moment::@3->wait_moment::@2] + // [798] phi wait_moment::i#2 = wait_moment::i#1 [phi:wait_moment::@3->wait_moment::@2#0] -- register_copy + jmp __b2 .segment Data - len: .byte 0 - .label padding = format_min_length - format_min_length: .byte 0 - format_justify_left: .byte 0 -} -.segment CodeVera - // main_vera_check -main_vera_check: { - .label vera_bytes_read = $d2 - // display_action_progress("Checking VERA.BIN ...") - // [1245] call display_action_progress - // [904] phi from main_vera_check to display_action_progress [phi:main_vera_check->display_action_progress] - // [904] phi display_action_progress::info_text#27 = main_vera_check::info_text [phi:main_vera_check->display_action_progress#0] -- pbuz1=pbuc1 - lda #info_text - sta.z display_action_progress.info_text+1 - jsr display_action_progress - // [1246] phi from main_vera_check to main_vera_check::@4 [phi:main_vera_check->main_vera_check::@4] - // main_vera_check::@4 - // unsigned long vera_bytes_read = vera_read(STATUS_CHECKING) - // [1247] call vera_read - // Read the VERA.BIN file. - // [2625] phi from main_vera_check::@4 to vera_read [phi:main_vera_check::@4->vera_read] - // [2625] phi __errno#100 = __errno#113 [phi:main_vera_check::@4->vera_read#0] -- register_copy - // [2625] phi __stdio_filecount#123 = __stdio_filecount#109 [phi:main_vera_check::@4->vera_read#1] -- register_copy - // [2625] phi vera_read::info_status#12 = STATUS_CHECKING [phi:main_vera_check::@4->vera_read#2] -- vbum1=vbuc1 - lda #STATUS_CHECKING - sta vera_read.info_status - jsr vera_read - // unsigned long vera_bytes_read = vera_read(STATUS_CHECKING) - // [1248] vera_read::return#2 = vera_read::return#0 - // main_vera_check::@5 - // [1249] main_vera_check::vera_bytes_read#0 = vera_read::return#2 -- vduz1=vdum2 - lda vera_read.return - sta.z vera_bytes_read - lda vera_read.return+1 - sta.z vera_bytes_read+1 - lda vera_read.return+2 - sta.z vera_bytes_read+2 - lda vera_read.return+3 - sta.z vera_bytes_read+3 - // wait_moment(10) - // [1250] call wait_moment - // [1310] phi from main_vera_check::@5 to wait_moment [phi:main_vera_check::@5->wait_moment] - // [1310] phi wait_moment::w#13 = $a [phi:main_vera_check::@5->wait_moment#0] -- vbum1=vbuc1 - lda #$a - sta wait_moment.w - jsr wait_moment - // main_vera_check::@6 - // if (!vera_bytes_read) - // [1251] if(0==main_vera_check::vera_bytes_read#0) goto main_vera_check::@1 -- 0_eq_vduz1_then_la1 - // In case no file was found, set the status to none and skip to the next, else, mention the amount of bytes read. - lda.z vera_bytes_read - ora.z vera_bytes_read+1 - ora.z vera_bytes_read+2 - ora.z vera_bytes_read+3 - beq __b1 - // main_vera_check::@3 - // vera_file_size = vera_bytes_read - // [1252] vera_file_size#0 = main_vera_check::vera_bytes_read#0 -- vdum1=vduz2 - // VF5 | VERA.BIN all ok | Display the VERA.BIN release version and github commit id (if any) and set VERA to Flash | Flash - // We know the file size, so we indicate it in the status panel. - lda.z vera_bytes_read - sta vera_file_size - lda.z vera_bytes_read+1 - sta vera_file_size+1 - lda.z vera_bytes_read+2 - sta vera_file_size+2 - lda.z vera_bytes_read+3 - sta vera_file_size+3 - // sprintf(info_text, "VERA.BIN:%s", "") - // [1253] call snprintf_init - // [1205] phi from main_vera_check::@3 to snprintf_init [phi:main_vera_check::@3->snprintf_init] - // [1205] phi snprintf_init::s#31 = info_text [phi:main_vera_check::@3->snprintf_init#0] -- pbuz1=pbuc1 - lda #<@info_text - sta.z snprintf_init.s - lda #>@info_text - sta.z snprintf_init.s+1 - jsr snprintf_init - // [1254] phi from main_vera_check::@3 to main_vera_check::@7 [phi:main_vera_check::@3->main_vera_check::@7] - // main_vera_check::@7 - // sprintf(info_text, "VERA.BIN:%s", "") - // [1255] call printf_str - // [1210] phi from main_vera_check::@7 to printf_str [phi:main_vera_check::@7->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:main_vera_check::@7->printf_str#0] -- pprz1=pprc1 - lda #snputc - sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = main_vera_check::s [phi:main_vera_check::@7->printf_str#1] -- pbuz1=pbuc1 - lda #s - sta.z printf_str.s+1 - jsr printf_str - // [1256] phi from main_vera_check::@7 to main_vera_check::@8 [phi:main_vera_check::@7->main_vera_check::@8] - // main_vera_check::@8 - // sprintf(info_text, "VERA.BIN:%s", "") - // [1257] call printf_string - // [1219] phi from main_vera_check::@8 to printf_string [phi:main_vera_check::@8->printf_string] - // [1219] phi printf_string::putc#26 = &snputc [phi:main_vera_check::@8->printf_string#0] -- pprz1=pprc1 - lda #snputc - sta.z printf_string.putc+1 - // [1219] phi printf_string::str#26 = str [phi:main_vera_check::@8->printf_string#1] -- pbuz1=pbuc1 - lda #str - sta.z printf_string.str+1 - // [1219] phi printf_string::format_justify_left#26 = 0 [phi:main_vera_check::@8->printf_string#2] -- vbum1=vbuc1 - lda #0 - sta printf_string.format_justify_left - // [1219] phi printf_string::format_min_length#26 = 0 [phi:main_vera_check::@8->printf_string#3] -- vbum1=vbuc1 - sta printf_string.format_min_length - jsr printf_string - // main_vera_check::@9 - // sprintf(info_text, "VERA.BIN:%s", "") - // [1258] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 - lda #0 - pha - // [1259] callexecute snputc -- call_vprc1 - jsr snputc - // sideeffect stackpullpadding(1) -- _stackpullpadding_1 - pla - // [1261] spi_manufacturer#583 = spi_read::return#0 -- vbum1=vbum2 - lda spi_read.return - sta spi_manufacturer - // [1262] spi_memory_type#584 = spi_read::return#1 -- vbum1=vbum2 - lda spi_read.return_1 - sta spi_memory_type - // [1263] spi_memory_capacity#585 = spi_read::return#2 -- vbum1=vbum2 - lda spi_read.return_2 - sta spi_memory_capacity - // display_info_vera(STATUS_FLASH, info_text) - // [1264] call display_info_vera - // [998] phi from main_vera_check::@9 to display_info_vera [phi:main_vera_check::@9->display_info_vera] - // [998] phi display_info_vera::info_text#19 = info_text [phi:main_vera_check::@9->display_info_vera#0] -- pbuz1=pbuc1 - lda #<@info_text - sta.z display_info_vera.info_text - lda #>@info_text - sta.z display_info_vera.info_text+1 - // [998] phi spi_memory_capacity#106 = spi_memory_capacity#585 [phi:main_vera_check::@9->display_info_vera#1] -- register_copy - // [998] phi spi_memory_type#107 = spi_memory_type#584 [phi:main_vera_check::@9->display_info_vera#2] -- register_copy - // [998] phi spi_manufacturer#108 = spi_manufacturer#583 [phi:main_vera_check::@9->display_info_vera#3] -- register_copy - // [998] phi display_info_vera::info_status#19 = STATUS_FLASH [phi:main_vera_check::@9->display_info_vera#4] -- vbum1=vbuc1 - lda #STATUS_FLASH - sta display_info_vera.info_status - jsr display_info_vera - // [1265] phi from main_vera_check::@9 to main_vera_check::@2 [phi:main_vera_check::@9->main_vera_check::@2] - // [1265] phi vera_file_size#1 = vera_file_size#0 [phi:main_vera_check::@9->main_vera_check::@2#0] -- register_copy - // main_vera_check::@2 - // main_vera_check::@return - // } - // [1266] return - rts - // main_vera_check::@1 - __b1: - // [1267] spi_manufacturer#582 = spi_read::return#0 -- vbum1=vbum2 - lda spi_read.return - sta spi_manufacturer - // [1268] spi_memory_type#583 = spi_read::return#1 -- vbum1=vbum2 - lda spi_read.return_1 - sta spi_memory_type - // [1269] spi_memory_capacity#584 = spi_read::return#2 -- vbum1=vbum2 - lda spi_read.return_2 - sta spi_memory_capacity - // display_info_vera(STATUS_SKIP, "No VERA.BIN") - // [1270] call display_info_vera - // VF1 | no VERA.BIN | Ask the user to place the VERA.BIN file onto the SDcard. Set VERA to Issue. | Issue - // VF2 | VERA.BIN size 0 | Ask the user to place a correct VERA.BIN file onto the SDcard. Set VERA to Issue. | Issue - // TODO: VF4 | ROM.BIN size over 0x20000 | Ask the user to place a correct VERA.BIN file onto the SDcard. Set VERA to Issue. | Issue - // [998] phi from main_vera_check::@1 to display_info_vera [phi:main_vera_check::@1->display_info_vera] - // [998] phi display_info_vera::info_text#19 = main_vera_check::info_text1 [phi:main_vera_check::@1->display_info_vera#0] -- pbuz1=pbuc1 - lda #info_text1 - sta.z display_info_vera.info_text+1 - // [998] phi spi_memory_capacity#106 = spi_memory_capacity#584 [phi:main_vera_check::@1->display_info_vera#1] -- register_copy - // [998] phi spi_memory_type#107 = spi_memory_type#583 [phi:main_vera_check::@1->display_info_vera#2] -- register_copy - // [998] phi spi_manufacturer#108 = spi_manufacturer#582 [phi:main_vera_check::@1->display_info_vera#3] -- register_copy - // [998] phi display_info_vera::info_status#19 = STATUS_SKIP [phi:main_vera_check::@1->display_info_vera#4] -- vbum1=vbuc1 - lda #STATUS_SKIP - sta display_info_vera.info_status - jsr display_info_vera - // [1265] phi from main_vera_check::@1 to main_vera_check::@2 [phi:main_vera_check::@1->main_vera_check::@2] - // [1265] phi vera_file_size#1 = 0 [phi:main_vera_check::@1->main_vera_check::@2#0] -- vdum1=vduc1 - lda #<0 - sta vera_file_size - sta vera_file_size+1 - lda #<0>>$10 - sta vera_file_size+2 - lda #>0>>$10 - sta vera_file_size+3 - rts - .segment DataVera - info_text: .text "Checking VERA.BIN ..." - .byte 0 - info_text1: .text "No VERA.BIN" - .byte 0 - s: .text "VERA.BIN:" - .byte 0 + i: .word 0 + j: .byte 0 + w: .byte 0 } .segment Code - // smc_supported_rom + // system_reset /** - * @brief Search in the smc file header for supported ROM.BIN releases. - * The first 3 bytes of the smc file header contain the SMC.BIN version, major and minor numbers. + * @brief * - * @param rom_release The ROM release to search for. - * @return unsigned char true if found. */ -// __mem() char smc_supported_rom(__mem() char rom_release) -smc_supported_rom: { - // [1272] phi from smc_supported_rom to smc_supported_rom::@1 [phi:smc_supported_rom->smc_supported_rom::@1] - // [1272] phi smc_supported_rom::i#2 = $1f [phi:smc_supported_rom->smc_supported_rom::@1#0] -- vbum1=vbuc1 - lda #$1f - sta i - // smc_supported_rom::@1 +system_reset: { + .const bank_set_bram1_bank = 0 + .const bank_set_brom1_bank = 0 + // system_reset::bank_set_bram1 + // BRAM = bank + // [803] BRAM = system_reset::bank_set_bram1_bank#0 -- vbuz1=vbuc1 + lda #bank_set_bram1_bank + sta.z BRAM + // system_reset::bank_set_brom1 + // BROM = bank + // [804] BROM = system_reset::bank_set_brom1_bank#0 -- vbuz1=vbuc1 + lda #bank_set_brom1_bank + sta.z BROM + // system_reset::@2 + // asm + // asm { jmp($FFFC) } + jmp ($fffc) + // [806] phi from system_reset::@1 system_reset::@2 to system_reset::@1 [phi:system_reset::@1/system_reset::@2->system_reset::@1] + // system_reset::@1 __b1: - // for(unsigned char i=31; i>3; i--) - // [1273] if(smc_supported_rom::i#2>=3+1) goto smc_supported_rom::@2 -- vbum1_ge_vbuc1_then_la1 - lda i - cmp #3+1 - bcs __b2 - // [1275] phi from smc_supported_rom::@1 to smc_supported_rom::@return [phi:smc_supported_rom::@1->smc_supported_rom::@return] - // [1275] phi smc_supported_rom::return#2 = 0 [phi:smc_supported_rom::@1->smc_supported_rom::@return#0] -- vbum1=vbuc1 - lda #0 - sta return - rts - // smc_supported_rom::@2 - __b2: - // if(smc_file_header[i] == rom_release) - // [1274] if(smc_file_header[smc_supported_rom::i#2]!=smc_supported_rom::rom_release#0) goto smc_supported_rom::@3 -- pbuc1_derefidx_vbum1_neq_vbum2_then_la1 - lda rom_release - ldy i - cmp smc_file_header,y - bne __b3 - // [1275] phi from smc_supported_rom::@2 to smc_supported_rom::@return [phi:smc_supported_rom::@2->smc_supported_rom::@return] - // [1275] phi smc_supported_rom::return#2 = 1 [phi:smc_supported_rom::@2->smc_supported_rom::@return#0] -- vbum1=vbuc1 - lda #1 - sta return - // smc_supported_rom::@return - // } - // [1276] return - rts - // smc_supported_rom::@3 - __b3: - // for(unsigned char i=31; i>3; i--) - // [1277] smc_supported_rom::i#1 = -- smc_supported_rom::i#2 -- vbum1=_dec_vbum1 - dec i - // [1272] phi from smc_supported_rom::@3 to smc_supported_rom::@1 [phi:smc_supported_rom::@3->smc_supported_rom::@1] - // [1272] 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 - i: .byte 0 - return: .byte 0 - rom_release: .byte 0 } -.segment Code - // check_status_roms + // check_status_roms_less /** - * @brief Check the status of any of the ROMs. + * @brief Check the status of all the ROMs. * * @param status The status to be checked. - * @return unsigned char true if one chip is equal to the status. + * @return unsigned char true if all chips are equal to the status. */ -// __mem() char check_status_roms(__mem() char status) -check_status_roms: { - .label check_status_rom1_check_status_roms__0 = $42 - // [1279] phi from check_status_roms to check_status_roms::@1 [phi:check_status_roms->check_status_roms::@1] - // [1279] phi check_status_roms::rom_chip#2 = 0 [phi:check_status_roms->check_status_roms::@1#0] -- vbum1=vbuc1 +// __mem() char check_status_roms_less(char status) +check_status_roms_less: { + .label check_status_roms_less__1 = $4e + // [808] phi from check_status_roms_less to check_status_roms_less::@1 [phi:check_status_roms_less->check_status_roms_less::@1] + // [808] 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 - // check_status_roms::@1 + // check_status_roms_less::@1 __b1: // for(unsigned char rom_chip = 0; rom_chip < 8; rom_chip++) - // [1280] if(check_status_roms::rom_chip#2<8) goto check_status_roms::check_status_rom1 -- vbum1_lt_vbuc1_then_la1 + // [809] if(check_status_roms_less::rom_chip#2<8) goto check_status_roms_less::@2 -- vbum1_lt_vbuc1_then_la1 lda rom_chip cmp #8 - bcc check_status_rom1 - // [1281] phi from check_status_roms::@1 to check_status_roms::@return [phi:check_status_roms::@1->check_status_roms::@return] - // [1281] phi check_status_roms::return#2 = 0 [phi:check_status_roms::@1->check_status_roms::@return#0] -- vbum1=vbuc1 - lda #0 + bcc __b2 + // [812] phi from check_status_roms_less::@1 to check_status_roms_less::@return [phi:check_status_roms_less::@1->check_status_roms_less::@return] + // [812] phi check_status_roms_less::return#2 = 1 [phi:check_status_roms_less::@1->check_status_roms_less::@return#0] -- vbum1=vbuc1 + lda #1 sta return - // check_status_roms::@return - // } - // [1282] return rts - // check_status_roms::check_status_rom1 - check_status_rom1: - // status_rom[rom_chip] == status - // [1283] check_status_roms::check_status_rom1_$0 = status_rom[check_status_roms::rom_chip#2] == check_status_roms::status#6 -- vboz1=pbuc1_derefidx_vbum2_eq_vbum3 - lda status + // check_status_roms_less::@2 + __b2: + // status_rom[rom_chip] > status + // [810] check_status_roms_less::$1 = status_rom[check_status_roms_less::rom_chip#2] > STATUS_SKIP -- vboz1=pbuc1_derefidx_vbum2_gt_vbuc2 ldy rom_chip - 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); - // [1284] check_status_roms::check_status_rom1_return#0 = (char)check_status_roms::check_status_rom1_$0 -- vbum1=vbuz2 - sta check_status_rom1_return - // check_status_roms::@3 - // if(check_status_rom(rom_chip, status)) - // [1285] if(0==check_status_roms::check_status_rom1_return#0) goto check_status_roms::@2 -- 0_eq_vbum1_then_la1 - beq __b2 - // [1281] phi from check_status_roms::@3 to check_status_roms::@return [phi:check_status_roms::@3->check_status_roms::@return] - // [1281] phi check_status_roms::return#2 = 1 [phi:check_status_roms::@3->check_status_roms::@return#0] -- vbum1=vbuc1 - lda #1 + lda status_rom,y + cmp #STATUS_SKIP + lda #0 + rol + sta.z check_status_roms_less__1 + // if((unsigned char)(status_rom[rom_chip] > status)) + // [811] if(0==(char)check_status_roms_less::$1) goto check_status_roms_less::@3 -- 0_eq_vbuz1_then_la1 + beq __b3 + // [812] phi from check_status_roms_less::@2 to check_status_roms_less::@return [phi:check_status_roms_less::@2->check_status_roms_less::@return] + // [812] phi check_status_roms_less::return#2 = 0 [phi:check_status_roms_less::@2->check_status_roms_less::@return#0] -- vbum1=vbuc1 + lda #0 sta return + // check_status_roms_less::@return + // } + // [813] return rts - // check_status_roms::@2 - __b2: + // check_status_roms_less::@3 + __b3: // for(unsigned char rom_chip = 0; rom_chip < 8; rom_chip++) - // [1286] check_status_roms::rom_chip#1 = ++ check_status_roms::rom_chip#2 -- vbum1=_inc_vbum1 + // [814] check_status_roms_less::rom_chip#1 = ++ check_status_roms_less::rom_chip#2 -- vbum1=_inc_vbum1 inc rom_chip - // [1279] phi from check_status_roms::@2 to check_status_roms::@1 [phi:check_status_roms::@2->check_status_roms::@1] - // [1279] 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 - check_status_rom1_return: .byte 0 - rom_chip: .byte 0 - return: .byte 0 - status: .byte 0 -} -.segment Code - // clrscr -// clears the screen and moves the cursor to the upper left-hand corner of the screen. -clrscr: { - .label clrscr__0 = $68 - .label clrscr__1 = $41 - .label clrscr__2 = $78 - // unsigned int line_text = __conio.mapbase_offset - // [1287] clrscr::line_text#0 = *((unsigned int *)&__conio+3) -- vwum1=_deref_pwuc1 - lda __conio+3 - sta line_text - lda __conio+3+1 - sta line_text+1 - // *VERA_CTRL &= ~VERA_ADDRSEL - // [1288] *VERA_CTRL = *VERA_CTRL & ~VERA_ADDRSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 - lda #VERA_ADDRSEL^$ff - and VERA_CTRL - sta VERA_CTRL - // __conio.mapbase_bank | VERA_INC_1 - // [1289] clrscr::$0 = *((char *)&__conio+5) | VERA_INC_1 -- vbuz1=_deref_pbuc1_bor_vbuc2 - lda #VERA_INC_1 - ora __conio+5 - sta.z clrscr__0 - // *VERA_ADDRX_H = __conio.mapbase_bank | VERA_INC_1 - // [1290] *VERA_ADDRX_H = clrscr::$0 -- _deref_pbuc1=vbuz1 - sta VERA_ADDRX_H - // unsigned char l = __conio.mapheight - // [1291] clrscr::l#0 = *((char *)&__conio+9) -- vbum1=_deref_pbuc1 - lda __conio+9 - sta l - // [1292] phi from clrscr clrscr::@3 to clrscr::@1 [phi:clrscr/clrscr::@3->clrscr::@1] - // [1292] phi clrscr::l#4 = clrscr::l#0 [phi:clrscr/clrscr::@3->clrscr::@1#0] -- register_copy - // [1292] phi clrscr::ch#0 = clrscr::line_text#0 [phi:clrscr/clrscr::@3->clrscr::@1#1] -- register_copy - // clrscr::@1 - __b1: - // BYTE0(ch) - // [1293] clrscr::$1 = byte0 clrscr::ch#0 -- vbuz1=_byte0_vwum2 - lda ch - sta.z clrscr__1 - // *VERA_ADDRX_L = BYTE0(ch) - // [1294] *VERA_ADDRX_L = clrscr::$1 -- _deref_pbuc1=vbuz1 - // Set address - sta VERA_ADDRX_L - // BYTE1(ch) - // [1295] clrscr::$2 = byte1 clrscr::ch#0 -- vbuz1=_byte1_vwum2 - lda ch+1 - sta.z clrscr__2 - // *VERA_ADDRX_M = BYTE1(ch) - // [1296] *VERA_ADDRX_M = clrscr::$2 -- _deref_pbuc1=vbuz1 - sta VERA_ADDRX_M - // unsigned char c = __conio.mapwidth+1 - // [1297] clrscr::c#0 = *((char *)&__conio+8) + 1 -- vbum1=_deref_pbuc1_plus_1 - lda __conio+8 - inc - sta c - // [1298] phi from clrscr::@1 clrscr::@2 to clrscr::@2 [phi:clrscr::@1/clrscr::@2->clrscr::@2] - // [1298] phi clrscr::c#2 = clrscr::c#0 [phi:clrscr::@1/clrscr::@2->clrscr::@2#0] -- register_copy - // clrscr::@2 - __b2: - // *VERA_DATA0 = ' ' - // [1299] *VERA_DATA0 = ' ' -- _deref_pbuc1=vbuc2 - lda #' ' - sta VERA_DATA0 - // *VERA_DATA0 = __conio.color - // [1300] *VERA_DATA0 = *((char *)&__conio+$d) -- _deref_pbuc1=_deref_pbuc2 - lda __conio+$d - sta VERA_DATA0 - // c--; - // [1301] clrscr::c#1 = -- clrscr::c#2 -- vbum1=_dec_vbum1 - dec c - // while(c) - // [1302] if(0!=clrscr::c#1) goto clrscr::@2 -- 0_neq_vbum1_then_la1 - lda c - bne __b2 - // clrscr::@3 - // line_text += __conio.rowskip - // [1303] clrscr::line_text#1 = clrscr::ch#0 + *((unsigned int *)&__conio+$a) -- vwum1=vwum1_plus__deref_pwuc1 - clc - lda line_text - adc __conio+$a - sta line_text - lda line_text+1 - adc __conio+$a+1 - sta line_text+1 - // l--; - // [1304] clrscr::l#1 = -- clrscr::l#4 -- vbum1=_dec_vbum1 - dec l - // while(l) - // [1305] if(0!=clrscr::l#1) goto clrscr::@1 -- 0_neq_vbum1_then_la1 - lda l - bne __b1 - // clrscr::@4 - // __conio.cursor_x = 0 - // [1306] *((char *)&__conio) = 0 -- _deref_pbuc1=vbuc2 - lda #0 - sta __conio - // __conio.cursor_y = 0 - // [1307] *((char *)&__conio+1) = 0 -- _deref_pbuc1=vbuc2 - sta __conio+1 - // __conio.offset = __conio.mapbase_offset - // [1308] *((unsigned int *)&__conio+$13) = *((unsigned int *)&__conio+3) -- _deref_pwuc1=_deref_pwuc2 - lda __conio+3 - sta __conio+$13 - lda __conio+3+1 - sta __conio+$13+1 - // clrscr::@return - // } - // [1309] return - rts - .segment Data - .label line_text = ch - l: .byte 0 - ch: .word 0 - c: .byte 0 -} -.segment Code - // wait_moment -/** - * @brief - * - */ -// void wait_moment(__mem() char w) -wait_moment: { - // [1311] phi from wait_moment to wait_moment::@1 [phi:wait_moment->wait_moment::@1] - // [1311] phi wait_moment::j#2 = 0 [phi:wait_moment->wait_moment::@1#0] -- vbum1=vbuc1 - lda #0 - sta j - // wait_moment::@1 - __b1: - // for(unsigned char j=0; jwait_moment::@2] - __b4: - // [1314] phi wait_moment::i#2 = $ffff [phi:wait_moment::@1->wait_moment::@2#0] -- vwum1=vwuc1 - lda #<$ffff - sta i - lda #>$ffff - sta i+1 - // wait_moment::@2 - __b2: - // for(unsigned int i=65535; i>0; i--) - // [1315] if(wait_moment::i#2>0) goto wait_moment::@3 -- vwum1_gt_0_then_la1 - lda i+1 - bne __b3 - lda i - bne __b3 - !: - // wait_moment::@4 - // for(unsigned char j=0; jwait_moment::@1] - // [1311] phi wait_moment::j#2 = wait_moment::j#1 [phi:wait_moment::@4->wait_moment::@1#0] -- register_copy - jmp __b1 - // wait_moment::@3 - __b3: - // for(unsigned int i=65535; i>0; i--) - // [1317] wait_moment::i#1 = -- wait_moment::i#2 -- vwum1=_dec_vwum1 - lda i - bne !+ - dec i+1 - !: - dec i - // [1314] phi from wait_moment::@3 to wait_moment::@2 [phi:wait_moment::@3->wait_moment::@2] - // [1314] phi wait_moment::i#2 = wait_moment::i#1 [phi:wait_moment::@3->wait_moment::@2#0] -- register_copy - jmp __b2 - .segment Data - i: .word 0 - j: .byte 0 - w: .byte 0 -} -.segment Code - // system_reset -/** - * @brief - * - */ -system_reset: { - .const bank_set_bram1_bank = 0 - .const bank_set_brom1_bank = 0 - // system_reset::bank_set_bram1 - // BRAM = bank - // [1319] BRAM = system_reset::bank_set_bram1_bank#0 -- vbuz1=vbuc1 - lda #bank_set_bram1_bank - sta.z BRAM - // system_reset::bank_set_brom1 - // BROM = bank - // [1320] BROM = system_reset::bank_set_brom1_bank#0 -- vbuz1=vbuc1 - lda #bank_set_brom1_bank - sta.z BROM - // system_reset::@2 - // asm - // asm { jmp($FFFC) } - jmp ($fffc) - // [1322] phi from system_reset::@1 system_reset::@2 to system_reset::@1 [phi:system_reset::@1/system_reset::@2->system_reset::@1] - // system_reset::@1 - __b1: - jmp __b1 -} - // check_status_roms_less -/** - * @brief Check the status of all the 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) -check_status_roms_less: { - .label check_status_roms_less__1 = $c2 - // [1324] phi from check_status_roms_less to check_status_roms_less::@1 [phi:check_status_roms_less->check_status_roms_less::@1] - // [1324] 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 - // check_status_roms_less::@1 - __b1: - // for(unsigned char rom_chip = 0; rom_chip < 8; rom_chip++) - // [1325] if(check_status_roms_less::rom_chip#2<8) goto check_status_roms_less::@2 -- vbum1_lt_vbuc1_then_la1 - lda rom_chip - cmp #8 - bcc __b2 - // [1328] phi from check_status_roms_less::@1 to check_status_roms_less::@return [phi:check_status_roms_less::@1->check_status_roms_less::@return] - // [1328] phi check_status_roms_less::return#2 = 1 [phi:check_status_roms_less::@1->check_status_roms_less::@return#0] -- vbum1=vbuc1 - lda #1 - sta return - rts - // check_status_roms_less::@2 - __b2: - // status_rom[rom_chip] > status - // [1326] check_status_roms_less::$1 = status_rom[check_status_roms_less::rom_chip#2] > STATUS_SKIP -- vboz1=pbuc1_derefidx_vbum2_gt_vbuc2 - ldy rom_chip - lda status_rom,y - cmp #STATUS_SKIP - lda #0 - rol - sta.z check_status_roms_less__1 - // if((unsigned char)(status_rom[rom_chip] > status)) - // [1327] if(0==(char)check_status_roms_less::$1) goto check_status_roms_less::@3 -- 0_eq_vbuz1_then_la1 - beq __b3 - // [1328] phi from check_status_roms_less::@2 to check_status_roms_less::@return [phi:check_status_roms_less::@2->check_status_roms_less::@return] - // [1328] phi check_status_roms_less::return#2 = 0 [phi:check_status_roms_less::@2->check_status_roms_less::@return#0] -- vbum1=vbuc1 - lda #0 - sta return - // check_status_roms_less::@return - // } - // [1329] return - rts - // check_status_roms_less::@3 - __b3: - // for(unsigned char rom_chip = 0; rom_chip < 8; rom_chip++) - // [1330] check_status_roms_less::rom_chip#1 = ++ check_status_roms_less::rom_chip#2 -- vbum1=_inc_vbum1 - inc rom_chip - // [1324] phi from check_status_roms_less::@3 to check_status_roms_less::@1 [phi:check_status_roms_less::@3->check_status_roms_less::@1] - // [1324] phi check_status_roms_less::rom_chip#2 = check_status_roms_less::rom_chip#1 [phi:check_status_roms_less::@3->check_status_roms_less::@1#0] -- register_copy + // [808] phi from check_status_roms_less::@3 to check_status_roms_less::@1 [phi:check_status_roms_less::@3->check_status_roms_less::@1] + // [808] phi check_status_roms_less::rom_chip#2 = check_status_roms_less::rom_chip#1 [phi:check_status_roms_less::@3->check_status_roms_less::@1#0] -- register_copy jmp __b1 .segment Data rom_chip: .byte 0 @@ -8959,57 +5242,57 @@ check_status_roms_less: { * @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($3b) char **text, __mem() char lines) +// void display_progress_text(__zp($3e) char **text, __mem() char lines) display_progress_text: { - .label display_progress_text__3 = $60 - .label text = $3b + .label display_progress_text__3 = $3b + .label text = $3e // display_progress_clear() - // [1332] call display_progress_clear - // [918] phi from display_progress_text to display_progress_clear [phi:display_progress_text->display_progress_clear] + // [816] call display_progress_clear + // [573] phi from display_progress_text to display_progress_clear [phi:display_progress_text->display_progress_clear] jsr display_progress_clear - // [1333] phi from display_progress_text to display_progress_text::@1 [phi:display_progress_text->display_progress_text::@1] - // [1333] phi display_progress_text::l#2 = 0 [phi:display_progress_text->display_progress_text::@1#0] -- vbum1=vbuc1 + // [817] phi from display_progress_text to display_progress_text::@1 [phi:display_progress_text->display_progress_text::@1] + // [817] 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_line] - // [1341] phi display_progress_line::text#3 = display_progress_line::text#0 [phi:display_progress_text::@2->display_progress_line#0] -- register_copy - // [1341] phi display_progress_line::line#3 = display_progress_line::line#0 [phi:display_progress_text::@2->display_progress_line#1] -- register_copy + // [823] call display_progress_line + // [825] phi from display_progress_text::@2 to display_progress_line [phi:display_progress_text::@2->display_progress_line] + // [825] phi display_progress_line::text#3 = display_progress_line::text#0 [phi:display_progress_text::@2->display_progress_line#0] -- register_copy + // [825] phi display_progress_line::line#3 = display_progress_line::line#0 [phi:display_progress_text::@2->display_progress_line#1] -- register_copy jsr display_progress_line // display_progress_text::@3 // for(unsigned char l=0; ldisplay_progress_text::@1] - // [1333] phi display_progress_text::l#2 = display_progress_text::l#1 [phi:display_progress_text::@3->display_progress_text::@1#0] -- register_copy + // [817] phi from display_progress_text::@3 to display_progress_text::@1 [phi:display_progress_text::@3->display_progress_text::@1] + // [817] 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 l: .byte 0 @@ -9023,71 +5306,97 @@ display_progress_text: { * @param line The start line, counting from 0. * @param text The text to be displayed. */ -// void display_progress_line(__mem() char line, __zp($6c) char *text) +// void display_progress_line(__mem() char line, __zp($49) char *text) display_progress_line: { - .label text = $6c + .label text = $49 // cputsxy(PROGRESS_X, PROGRESS_Y+line, text) - // [1342] cputsxy::y#0 = PROGRESS_Y + display_progress_line::line#3 -- vbum1=vbuc1_plus_vbum1 + // [826] cputsxy::y#0 = PROGRESS_Y + display_progress_line::line#3 -- vbum1=vbuc1_plus_vbum1 lda #PROGRESS_Y clc adc cputsxy.y sta cputsxy.y - // [1343] cputsxy::s#0 = display_progress_line::text#3 - // [1344] call cputsxy - // [897] phi from display_progress_line to cputsxy [phi:display_progress_line->cputsxy] - // [897] phi cputsxy::s#4 = cputsxy::s#0 [phi:display_progress_line->cputsxy#0] -- register_copy - // [897] phi cputsxy::y#4 = cputsxy::y#0 [phi:display_progress_line->cputsxy#1] -- register_copy - // [897] phi cputsxy::x#4 = PROGRESS_X [phi:display_progress_line->cputsxy#2] -- vbum1=vbuc1 + // [827] cputsxy::s#0 = display_progress_line::text#3 + // [828] call cputsxy + // [552] phi from display_progress_line to cputsxy [phi:display_progress_line->cputsxy] + // [552] phi cputsxy::s#3 = cputsxy::s#0 [phi:display_progress_line->cputsxy#0] -- register_copy + // [552] phi cputsxy::y#3 = cputsxy::y#0 [phi:display_progress_line->cputsxy#1] -- register_copy + // [552] phi cputsxy::x#3 = PROGRESS_X [phi:display_progress_line->cputsxy#2] -- vbum1=vbuc1 lda #PROGRESS_X sta cputsxy.x jsr cputsxy // display_progress_line::@return // } - // [1345] return + // [829] return rts .segment Data .label line = cputsxy.y } .segment Code + // snprintf_init +/// Initialize the snprintf() state +// void snprintf_init(char *s, unsigned int n) +snprintf_init: { + // __snprintf_capacity = n + // [830] __snprintf_capacity = $ffff -- vwum1=vwuc1 + lda #<$ffff + sta __snprintf_capacity + lda #>$ffff + sta __snprintf_capacity+1 + // __snprintf_size = 0 + // [831] __snprintf_size = 0 -- vwum1=vbuc1 + lda #<0 + sta __snprintf_size + sta __snprintf_size+1 + // __snprintf_buffer = s + // [832] __snprintf_buffer = info_text -- pbuz1=pbuc1 + lda #info_text + sta.z __snprintf_buffer+1 + // snprintf_init::@return + // } + // [833] return + rts +} // printf_uchar // Print an unsigned char using a specific format -// void printf_uchar(__zp($3b) void (*putc)(char), __mem() char uvalue, __mem() char format_min_length, char format_justify_left, char format_sign_always, __mem() char format_zero_padding, char format_upper_case, __mem() char format_radix) +// void printf_uchar(__zp($49) void (*putc)(char), __mem() char uvalue, __mem() char format_min_length, char format_justify_left, char format_sign_always, __mem() char format_zero_padding, char format_upper_case, __mem() char format_radix) printf_uchar: { - .label putc = $3b + .label putc = $49 // printf_uchar::@1 // printf_buffer.sign = format.sign_always?'+':0 - // [1347] *((char *)&printf_buffer) = 0 -- _deref_pbuc1=vbuc2 + // [835] *((char *)&printf_buffer) = 0 -- _deref_pbuc1=vbuc2 // Handle any sign lda #0 sta printf_buffer // uctoa(uvalue, printf_buffer.digits, format.radix) - // [1348] uctoa::value#1 = printf_uchar::uvalue#18 - // [1349] uctoa::radix#0 = printf_uchar::format_radix#18 - // [1350] call uctoa + // [836] uctoa::value#1 = printf_uchar::uvalue#10 + // [837] uctoa::radix#0 = printf_uchar::format_radix#10 + // [838] call uctoa // Format number into buffer jsr uctoa // printf_uchar::@2 // printf_number_buffer(putc, printf_buffer, format) - // [1351] printf_number_buffer::putc#2 = printf_uchar::putc#18 - // [1352] printf_number_buffer::buffer_sign#2 = *((char *)&printf_buffer) -- vbum1=_deref_pbuc1 + // [839] printf_number_buffer::putc#2 = printf_uchar::putc#10 + // [840] printf_number_buffer::buffer_sign#2 = *((char *)&printf_buffer) -- vbum1=_deref_pbuc1 lda printf_buffer sta printf_number_buffer.buffer_sign - // [1353] printf_number_buffer::format_min_length#2 = printf_uchar::format_min_length#18 - // [1354] printf_number_buffer::format_zero_padding#2 = printf_uchar::format_zero_padding#18 - // [1355] call printf_number_buffer + // [841] printf_number_buffer::format_min_length#2 = printf_uchar::format_min_length#10 + // [842] printf_number_buffer::format_zero_padding#2 = printf_uchar::format_zero_padding#10 + // [843] call printf_number_buffer // Print using format - // [2706] phi from printf_uchar::@2 to printf_number_buffer [phi:printf_uchar::@2->printf_number_buffer] - // [2706] phi printf_number_buffer::putc#10 = printf_number_buffer::putc#2 [phi:printf_uchar::@2->printf_number_buffer#0] -- register_copy - // [2706] phi printf_number_buffer::buffer_sign#10 = printf_number_buffer::buffer_sign#2 [phi:printf_uchar::@2->printf_number_buffer#1] -- register_copy - // [2706] phi printf_number_buffer::format_zero_padding#10 = printf_number_buffer::format_zero_padding#2 [phi:printf_uchar::@2->printf_number_buffer#2] -- register_copy - // [2706] phi printf_number_buffer::format_min_length#3 = printf_number_buffer::format_min_length#2 [phi:printf_uchar::@2->printf_number_buffer#3] -- register_copy + // [1539] phi from printf_uchar::@2 to printf_number_buffer [phi:printf_uchar::@2->printf_number_buffer] + // [1539] phi printf_number_buffer::putc#10 = printf_number_buffer::putc#2 [phi:printf_uchar::@2->printf_number_buffer#0] -- register_copy + // [1539] phi printf_number_buffer::buffer_sign#10 = printf_number_buffer::buffer_sign#2 [phi:printf_uchar::@2->printf_number_buffer#1] -- register_copy + // [1539] phi printf_number_buffer::format_zero_padding#10 = printf_number_buffer::format_zero_padding#2 [phi:printf_uchar::@2->printf_number_buffer#2] -- register_copy + // [1539] phi printf_number_buffer::format_min_length#3 = printf_number_buffer::format_min_length#2 [phi:printf_uchar::@2->printf_number_buffer#3] -- register_copy jsr printf_number_buffer // printf_uchar::@return // } - // [1356] return + // [844] return rts .segment Data - .label uvalue = smc_get_version_text.release + uvalue: .byte 0 format_radix: .byte 0 format_min_length: .byte 0 format_zero_padding: .byte 0 @@ -9099,73 +5408,73 @@ printf_uchar: { * * @param info_text The info text to be displayed. */ -// void display_action_text(__zp($4a) char *info_text) +// void display_action_text(__zp($59) char *info_text) display_action_text: { - .label info_text = $4a + .label info_text = $59 // unsigned char x = wherex() - // [1358] call wherex + // [846] call wherex jsr wherex - // [1359] wherex::return#3 = wherex::return#0 -- vbum1=vbum2 + // [847] wherex::return#3 = wherex::return#0 -- vbum1=vbum2 lda wherex.return sta wherex.return_1 // display_action_text::@1 - // [1360] display_action_text::x#0 = wherex::return#3 + // [848] display_action_text::x#0 = wherex::return#3 // unsigned char y = wherey() - // [1361] call wherey + // [849] call wherey jsr wherey - // [1362] wherey::return#3 = wherey::return#0 -- vbum1=vbum2 + // [850] wherey::return#3 = wherey::return#0 -- vbum1=vbum2 lda wherey.return sta wherey.return_1 // display_action_text::@2 - // [1363] display_action_text::y#0 = wherey::return#3 + // [851] display_action_text::y#0 = wherey::return#3 // gotoxy(2, PROGRESS_Y-3) - // [1364] call gotoxy - // [802] phi from display_action_text::@2 to gotoxy [phi:display_action_text::@2->gotoxy] - // [802] phi gotoxy::y#37 = PROGRESS_Y-3 [phi:display_action_text::@2->gotoxy#0] -- vbum1=vbuc1 + // [852] call gotoxy + // [457] phi from display_action_text::@2 to gotoxy [phi:display_action_text::@2->gotoxy] + // [457] phi gotoxy::y#26 = PROGRESS_Y-3 [phi:display_action_text::@2->gotoxy#0] -- vbum1=vbuc1 lda #PROGRESS_Y-3 sta gotoxy.y - // [802] phi gotoxy::x#37 = 2 [phi:display_action_text::@2->gotoxy#1] -- vbum1=vbuc1 + // [457] phi gotoxy::x#26 = 2 [phi:display_action_text::@2->gotoxy#1] -- vbum1=vbuc1 lda #2 sta gotoxy.x jsr gotoxy // display_action_text::@3 // printf("%-65s", info_text) - // [1365] printf_string::str#2 = display_action_text::info_text#25 -- pbuz1=pbuz2 + // [853] printf_string::str#2 = display_action_text::info_text#17 -- pbuz1=pbuz2 lda.z info_text sta.z printf_string.str lda.z info_text+1 sta.z printf_string.str+1 - // [1366] call printf_string - // [1219] phi from display_action_text::@3 to printf_string [phi:display_action_text::@3->printf_string] - // [1219] phi printf_string::putc#26 = &cputc [phi:display_action_text::@3->printf_string#0] -- pprz1=pprc1 + // [854] call printf_string + // [1308] phi from display_action_text::@3 to printf_string [phi:display_action_text::@3->printf_string] + // [1308] phi printf_string::putc#17 = &cputc [phi:display_action_text::@3->printf_string#0] -- pprz1=pprc1 lda #cputc sta.z printf_string.putc+1 - // [1219] phi printf_string::str#26 = printf_string::str#2 [phi:display_action_text::@3->printf_string#1] -- register_copy - // [1219] phi printf_string::format_justify_left#26 = 1 [phi:display_action_text::@3->printf_string#2] -- vbum1=vbuc1 + // [1308] phi printf_string::str#17 = printf_string::str#2 [phi:display_action_text::@3->printf_string#1] -- register_copy + // [1308] phi printf_string::format_justify_left#17 = 1 [phi:display_action_text::@3->printf_string#2] -- vbum1=vbuc1 lda #1 sta printf_string.format_justify_left - // [1219] phi printf_string::format_min_length#26 = $41 [phi:display_action_text::@3->printf_string#3] -- vbum1=vbuc1 + // [1308] phi printf_string::format_min_length#17 = $41 [phi:display_action_text::@3->printf_string#3] -- vbum1=vbuc1 lda #$41 sta printf_string.format_min_length jsr printf_string // display_action_text::@4 // gotoxy(x, y) - // [1367] gotoxy::x#16 = display_action_text::x#0 -- vbum1=vbum2 + // [855] gotoxy::x#16 = display_action_text::x#0 -- vbum1=vbum2 lda x sta gotoxy.x - // [1368] gotoxy::y#16 = display_action_text::y#0 -- vbum1=vbum2 + // [856] gotoxy::y#16 = display_action_text::y#0 -- vbum1=vbum2 lda y sta gotoxy.y - // [1369] call gotoxy - // [802] phi from display_action_text::@4 to gotoxy [phi:display_action_text::@4->gotoxy] - // [802] phi gotoxy::y#37 = gotoxy::y#16 [phi:display_action_text::@4->gotoxy#0] -- register_copy - // [802] phi gotoxy::x#37 = gotoxy::x#16 [phi:display_action_text::@4->gotoxy#1] -- register_copy + // [857] call gotoxy + // [457] phi from display_action_text::@4 to gotoxy [phi:display_action_text::@4->gotoxy] + // [457] phi gotoxy::y#26 = gotoxy::y#16 [phi:display_action_text::@4->gotoxy#0] -- register_copy + // [457] phi gotoxy::x#26 = gotoxy::x#16 [phi:display_action_text::@4->gotoxy#1] -- register_copy jsr gotoxy // display_action_text::@return // } - // [1370] return + // [858] return rts .segment Data .label x = wherex.return_1 @@ -9185,28 +5494,28 @@ smc_reset: { .const bank_set_brom1_bank = 0 // smc_reset::bank_set_bram1 // BRAM = bank - // [1372] BRAM = smc_reset::bank_set_bram1_bank#0 -- vbuz1=vbuc1 + // [860] BRAM = smc_reset::bank_set_bram1_bank#0 -- vbuz1=vbuc1 lda #bank_set_bram1_bank sta.z BRAM // smc_reset::bank_set_brom1 // BROM = bank - // [1373] BROM = smc_reset::bank_set_brom1_bank#0 -- vbuz1=vbuc1 + // [861] BROM = smc_reset::bank_set_brom1_bank#0 -- vbuz1=vbuc1 lda #bank_set_brom1_bank sta.z BROM // smc_reset::@1 // cx16_k_i2c_write_byte(FLASH_I2C_SMC_DEVICE, FLASH_I2C_SMC_REBOOT, 0) - // [1374] smc_reset::cx16_k_i2c_write_byte1_device = $42 -- vbum1=vbuc1 + // [862] smc_reset::cx16_k_i2c_write_byte1_device = $42 -- vbum1=vbuc1 lda #$42 sta cx16_k_i2c_write_byte1_device - // [1375] smc_reset::cx16_k_i2c_write_byte1_offset = $82 -- vbum1=vbuc1 + // [863] smc_reset::cx16_k_i2c_write_byte1_offset = $82 -- vbum1=vbuc1 lda #$82 sta cx16_k_i2c_write_byte1_offset - // [1376] smc_reset::cx16_k_i2c_write_byte1_value = 0 -- vbum1=vbuc1 + // [864] smc_reset::cx16_k_i2c_write_byte1_value = 0 -- vbum1=vbuc1 lda #0 sta cx16_k_i2c_write_byte1_value // smc_reset::cx16_k_i2c_write_byte1 // unsigned char result - // [1377] smc_reset::cx16_k_i2c_write_byte1_result = 0 -- vbum1=vbuc1 + // [865] smc_reset::cx16_k_i2c_write_byte1_result = 0 -- vbum1=vbuc1 sta cx16_k_i2c_write_byte1_result // asm // asm { ldxdevice ldyoffset ldavalue stzresult jsrCX16_I2C_WRITE_BYTE rolresult } @@ -9218,7 +5527,7 @@ smc_reset: { rol cx16_k_i2c_write_byte1_result // smc_reset::@return // } - // [1379] return + // [867] return rts .segment Data cx16_k_i2c_write_byte1_device: .byte 0 @@ -9236,30 +5545,30 @@ smc_reset: { */ // __mem() char check_status_card_roms(char status) check_status_card_roms: { - .label check_status_rom1_check_status_card_roms__0 = $61 - // [1381] phi from check_status_card_roms to check_status_card_roms::@1 [phi:check_status_card_roms->check_status_card_roms::@1] - // [1381] phi check_status_card_roms::rom_chip#2 = 1 [phi:check_status_card_roms->check_status_card_roms::@1#0] -- vbum1=vbuc1 + .label check_status_rom1_check_status_card_roms__0 = $3b + // [869] phi from check_status_card_roms to check_status_card_roms::@1 [phi:check_status_card_roms->check_status_card_roms::@1] + // [869] phi check_status_card_roms::rom_chip#2 = 1 [phi:check_status_card_roms->check_status_card_roms::@1#0] -- vbum1=vbuc1 lda #1 sta rom_chip // check_status_card_roms::@1 __b1: // for(unsigned char rom_chip = 1; rom_chip < 8; rom_chip++) - // [1382] if(check_status_card_roms::rom_chip#2<8) goto check_status_card_roms::check_status_rom1 -- vbum1_lt_vbuc1_then_la1 + // [870] if(check_status_card_roms::rom_chip#2<8) goto check_status_card_roms::check_status_rom1 -- vbum1_lt_vbuc1_then_la1 lda rom_chip cmp #8 bcc check_status_rom1 - // [1383] phi from check_status_card_roms::@1 to check_status_card_roms::@return [phi:check_status_card_roms::@1->check_status_card_roms::@return] - // [1383] phi check_status_card_roms::return#2 = 0 [phi:check_status_card_roms::@1->check_status_card_roms::@return#0] -- vbum1=vbuc1 + // [871] phi from check_status_card_roms::@1 to check_status_card_roms::@return [phi:check_status_card_roms::@1->check_status_card_roms::@return] + // [871] phi check_status_card_roms::return#2 = 0 [phi:check_status_card_roms::@1->check_status_card_roms::@return#0] -- vbum1=vbuc1 lda #0 sta return // check_status_card_roms::@return // } - // [1384] return + // [872] return rts // check_status_card_roms::check_status_rom1 check_status_rom1: // status_rom[rom_chip] == status - // [1385] check_status_card_roms::check_status_rom1_$0 = status_rom[check_status_card_roms::rom_chip#2] == STATUS_FLASH -- vboz1=pbuc1_derefidx_vbum2_eq_vbuc2 + // [873] check_status_card_roms::check_status_rom1_$0 = status_rom[check_status_card_roms::rom_chip#2] == STATUS_FLASH -- vboz1=pbuc1_derefidx_vbum2_eq_vbuc2 lda #STATUS_FLASH ldy rom_chip eor status_rom,y @@ -9269,24 +5578,24 @@ check_status_card_roms: { eor #1 sta.z check_status_rom1_check_status_card_roms__0 // return (unsigned char)(status_rom[rom_chip] == status); - // [1386] check_status_card_roms::check_status_rom1_return#0 = (char)check_status_card_roms::check_status_rom1_$0 -- vbum1=vbuz2 + // [874] check_status_card_roms::check_status_rom1_return#0 = (char)check_status_card_roms::check_status_rom1_$0 -- vbum1=vbuz2 sta check_status_rom1_return // check_status_card_roms::@3 // if(check_status_rom(rom_chip, status)) - // [1387] if(0==check_status_card_roms::check_status_rom1_return#0) goto check_status_card_roms::@2 -- 0_eq_vbum1_then_la1 + // [875] if(0==check_status_card_roms::check_status_rom1_return#0) goto check_status_card_roms::@2 -- 0_eq_vbum1_then_la1 beq __b2 - // [1383] phi from check_status_card_roms::@3 to check_status_card_roms::@return [phi:check_status_card_roms::@3->check_status_card_roms::@return] - // [1383] phi check_status_card_roms::return#2 = 1 [phi:check_status_card_roms::@3->check_status_card_roms::@return#0] -- vbum1=vbuc1 + // [871] phi from check_status_card_roms::@3 to check_status_card_roms::@return [phi:check_status_card_roms::@3->check_status_card_roms::@return] + // [871] phi check_status_card_roms::return#2 = 1 [phi:check_status_card_roms::@3->check_status_card_roms::@return#0] -- vbum1=vbuc1 lda #1 sta return rts // check_status_card_roms::@2 __b2: // for(unsigned char rom_chip = 1; rom_chip < 8; rom_chip++) - // [1388] check_status_card_roms::rom_chip#1 = ++ check_status_card_roms::rom_chip#2 -- vbum1=_inc_vbum1 + // [876] check_status_card_roms::rom_chip#1 = ++ check_status_card_roms::rom_chip#2 -- vbum1=_inc_vbum1 inc rom_chip - // [1381] phi from check_status_card_roms::@2 to check_status_card_roms::@1 [phi:check_status_card_roms::@2->check_status_card_roms::@1] - // [1381] 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 + // [869] phi from check_status_card_roms::@2 to check_status_card_roms::@1 [phi:check_status_card_roms::@2->check_status_card_roms::@1] + // [869] phi check_status_card_roms::rom_chip#2 = check_status_card_roms::rom_chip#1 [phi:check_status_card_roms::@2->check_status_card_roms::@1#0] -- register_copy jmp __b1 .segment Data check_status_rom1_return: .byte 0 @@ -9297,14 +5606,14 @@ check_status_card_roms: { // util_wait_space util_wait_space: { // util_wait_key("Press [SPACE] to continue ...", " ") - // [1390] call util_wait_key - // [1999] phi from util_wait_space to util_wait_key [phi:util_wait_space->util_wait_key] - // [1999] phi util_wait_key::filter#13 = s4 [phi:util_wait_space->util_wait_key#0] -- pbuz1=pbuc1 - lda #util_wait_key] + // [1034] phi util_wait_key::filter#13 = s [phi:util_wait_space->util_wait_key#0] -- pbuz1=pbuc1 + lda #s4 + lda #>s sta.z util_wait_key.filter+1 - // [1999] phi util_wait_key::info_text#3 = util_wait_space::info_text [phi:util_wait_space->util_wait_key#1] -- pbuz1=pbuc1 + // [1034] 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 @@ -9312,7 +5621,7 @@ util_wait_space: { jsr util_wait_key // util_wait_space::@return // } - // [1391] return + // [879] return rts .segment Data info_text: .text "Press [SPACE] to continue ..." @@ -9321,36 +5630,32 @@ util_wait_space: { .segment CodeVera // main_vera_flash main_vera_flash: { - .label vera_bytes_read = $d2 - .label spi_ensure_detect = $ca - .label vera_differences1 = $f1 - .label spi_ensure_detect_1 = $cb + .label vera_bytes_read = $ab + .label vera_differences = $b8 + .label spi_ensure_detect = $7d + .label vera_flashed = $bc + .label vera_differences1 = $b4 + .label spi_ensure_detect_1 = $7e // display_progress_clear() - // [1393] call display_progress_clear - // [918] phi from main_vera_flash to display_progress_clear [phi:main_vera_flash->display_progress_clear] + // [881] call display_progress_clear + // [573] phi from main_vera_flash to display_progress_clear [phi:main_vera_flash->display_progress_clear] jsr display_progress_clear - // [1394] phi from main_vera_flash to main_vera_flash::@19 [phi:main_vera_flash->main_vera_flash::@19] + // [882] phi from main_vera_flash to main_vera_flash::@19 [phi:main_vera_flash->main_vera_flash::@19] // main_vera_flash::@19 // sprintf(info_text, "Reading VERA.BIN ... (.) data ( ) empty") - // [1395] call snprintf_init - // [1205] phi from main_vera_flash::@19 to snprintf_init [phi:main_vera_flash::@19->snprintf_init] - // [1205] phi snprintf_init::s#31 = info_text [phi:main_vera_flash::@19->snprintf_init#0] -- pbuz1=pbuc1 - lda #<@info_text - sta.z snprintf_init.s - lda #>@info_text - sta.z snprintf_init.s+1 + // [883] call snprintf_init jsr snprintf_init - // [1396] phi from main_vera_flash::@19 to main_vera_flash::@20 [phi:main_vera_flash::@19->main_vera_flash::@20] + // [884] phi from main_vera_flash::@19 to main_vera_flash::@20 [phi:main_vera_flash::@19->main_vera_flash::@20] // main_vera_flash::@20 // sprintf(info_text, "Reading VERA.BIN ... (.) data ( ) empty") - // [1397] call printf_str - // [1210] phi from main_vera_flash::@20 to printf_str [phi:main_vera_flash::@20->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:main_vera_flash::@20->printf_str#0] -- pprz1=pprc1 + // [885] call printf_str + // [785] phi from main_vera_flash::@20 to printf_str [phi:main_vera_flash::@20->printf_str] + // [785] phi printf_str::putc#53 = &snputc [phi:main_vera_flash::@20->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = main_vera_flash::s [phi:main_vera_flash::@20->printf_str#1] -- pbuz1=pbuc1 + // [785] phi printf_str::s#53 = main_vera_flash::s [phi:main_vera_flash::@20->printf_str#1] -- pbuz1=pbuc1 lda #s @@ -9358,37 +5663,37 @@ main_vera_flash: { jsr printf_str // main_vera_flash::@21 // sprintf(info_text, "Reading VERA.BIN ... (.) data ( ) empty") - // [1398] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 + // [886] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 lda #0 pha - // [1399] callexecute snputc -- call_vprc1 + // [887] callexecute snputc -- call_vprc1 jsr snputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla // display_action_progress(info_text) - // [1401] call display_action_progress - // [904] phi from main_vera_flash::@21 to display_action_progress [phi:main_vera_flash::@21->display_action_progress] - // [904] phi display_action_progress::info_text#27 = info_text [phi:main_vera_flash::@21->display_action_progress#0] -- pbuz1=pbuc1 + // [889] call display_action_progress + // [559] phi from main_vera_flash::@21 to display_action_progress [phi:main_vera_flash::@21->display_action_progress] + // [559] phi display_action_progress::info_text#19 = info_text [phi:main_vera_flash::@21->display_action_progress#0] -- pbuz1=pbuc1 lda #<@info_text sta.z display_action_progress.info_text lda #>@info_text sta.z display_action_progress.info_text+1 jsr display_action_progress - // [1402] phi from main_vera_flash::@21 to main_vera_flash::@22 [phi:main_vera_flash::@21->main_vera_flash::@22] + // [890] phi from main_vera_flash::@21 to main_vera_flash::@22 [phi:main_vera_flash::@21->main_vera_flash::@22] // main_vera_flash::@22 // unsigned long vera_bytes_read = vera_read(STATUS_READING) - // [1403] call vera_read - // [2625] phi from main_vera_flash::@22 to vera_read [phi:main_vera_flash::@22->vera_read] - // [2625] phi __errno#100 = __errno#115 [phi:main_vera_flash::@22->vera_read#0] -- register_copy - // [2625] phi __stdio_filecount#123 = __stdio_filecount#111 [phi:main_vera_flash::@22->vera_read#1] -- register_copy - // [2625] phi vera_read::info_status#12 = STATUS_READING [phi:main_vera_flash::@22->vera_read#2] -- vbum1=vbuc1 + // [891] call vera_read + // [1458] phi from main_vera_flash::@22 to vera_read [phi:main_vera_flash::@22->vera_read] + // [1458] phi __errno#118 = __errno#18 [phi:main_vera_flash::@22->vera_read#0] -- register_copy + // [1458] phi __stdio_filecount#105 = __stdio_filecount#26 [phi:main_vera_flash::@22->vera_read#1] -- register_copy + // [1458] phi vera_read::info_status#12 = STATUS_READING [phi:main_vera_flash::@22->vera_read#2] -- vbum1=vbuc1 lda #STATUS_READING sta vera_read.info_status jsr vera_read // unsigned long vera_bytes_read = vera_read(STATUS_READING) - // [1404] vera_read::return#3 = vera_read::return#0 + // [892] vera_read::return#3 = vera_read::return#0 // main_vera_flash::@23 - // [1405] main_vera_flash::vera_bytes_read#0 = vera_read::return#3 -- vduz1=vdum2 + // [893] main_vera_flash::vera_bytes_read#0 = vera_read::return#3 -- vduz1=vdum2 lda vera_read.return sta.z vera_bytes_read lda vera_read.return+1 @@ -9398,7 +5703,7 @@ main_vera_flash: { lda vera_read.return+3 sta.z vera_bytes_read+3 // if(vera_bytes_read) - // [1406] if(0==main_vera_flash::vera_bytes_read#0) goto main_vera_flash::@1 -- 0_eq_vduz1_then_la1 + // [894] if(0==main_vera_flash::vera_bytes_read#0) goto main_vera_flash::@1 -- 0_eq_vduz1_then_la1 lda.z vera_bytes_read ora.z vera_bytes_read+1 ora.z vera_bytes_read+2 @@ -9406,401 +5711,380 @@ main_vera_flash: { bne !__b1+ jmp __b1 !__b1: - // [1407] phi from main_vera_flash::@23 to main_vera_flash::@2 [phi:main_vera_flash::@23->main_vera_flash::@2] + // [895] phi from main_vera_flash::@23 to main_vera_flash::@2 [phi:main_vera_flash::@23->main_vera_flash::@2] // main_vera_flash::@2 // display_action_progress("VERA SPI activation ...") - // [1408] call display_action_progress + // [896] call display_action_progress // Now we loop until jumper JP1 has been placed! - // [904] phi from main_vera_flash::@2 to display_action_progress [phi:main_vera_flash::@2->display_action_progress] - // [904] phi display_action_progress::info_text#27 = main_vera_flash::info_text [phi:main_vera_flash::@2->display_action_progress#0] -- pbuz1=pbuc1 + // [559] phi from main_vera_flash::@2 to display_action_progress [phi:main_vera_flash::@2->display_action_progress] + // [559] phi display_action_progress::info_text#19 = main_vera_flash::info_text [phi:main_vera_flash::@2->display_action_progress#0] -- pbuz1=pbuc1 lda #info_text sta.z display_action_progress.info_text+1 jsr display_action_progress - // [1409] phi from main_vera_flash::@2 to main_vera_flash::@24 [phi:main_vera_flash::@2->main_vera_flash::@24] + // [897] phi from main_vera_flash::@2 to main_vera_flash::@24 [phi:main_vera_flash::@2->main_vera_flash::@24] // main_vera_flash::@24 // display_action_text("Please close the jumper JP1 on the VERA board!") - // [1410] call display_action_text - // [1357] phi from main_vera_flash::@24 to display_action_text [phi:main_vera_flash::@24->display_action_text] - // [1357] phi display_action_text::info_text#25 = main_vera_flash::info_text1 [phi:main_vera_flash::@24->display_action_text#0] -- pbuz1=pbuc1 + // [898] call display_action_text + // [845] phi from main_vera_flash::@24 to display_action_text [phi:main_vera_flash::@24->display_action_text] + // [845] phi display_action_text::info_text#17 = main_vera_flash::info_text1 [phi:main_vera_flash::@24->display_action_text#0] -- pbuz1=pbuc1 lda #info_text1 sta.z display_action_text.info_text+1 jsr display_action_text - // [1411] phi from main_vera_flash::@24 to main_vera_flash::@25 [phi:main_vera_flash::@24->main_vera_flash::@25] + // [899] phi from main_vera_flash::@24 to main_vera_flash::@25 [phi:main_vera_flash::@24->main_vera_flash::@25] // main_vera_flash::@25 // vera_detect() - // [1412] call vera_detect - // [2391] phi from main_vera_flash::@25 to vera_detect [phi:main_vera_flash::@25->vera_detect] + // [900] call vera_detect + // [1455] phi from main_vera_flash::@25 to vera_detect [phi:main_vera_flash::@25->vera_detect] jsr vera_detect - // [1413] phi from main_vera_flash::@25 main_vera_flash::@7 to main_vera_flash::@3 [phi:main_vera_flash::@25/main_vera_flash::@7->main_vera_flash::@3] + // [901] phi from main_vera_flash::@25 main_vera_flash::@7 to main_vera_flash::@3 [phi:main_vera_flash::@25/main_vera_flash::@7->main_vera_flash::@3] __b2: - // [1413] phi main_vera_flash::spi_ensure_detect#11 = 0 [phi:main_vera_flash::@25/main_vera_flash::@7->main_vera_flash::@3#0] -- vbuz1=vbuc1 + // [901] phi main_vera_flash::spi_ensure_detect#11 = 0 [phi:main_vera_flash::@25/main_vera_flash::@7->main_vera_flash::@3#0] -- vbuz1=vbuc1 lda #0 sta.z spi_ensure_detect // main_vera_flash::@3 __b3: // while(spi_ensure_detect < 16) - // [1414] if(main_vera_flash::spi_ensure_detect#11<$10) goto main_vera_flash::@4 -- vbuz1_lt_vbuc1_then_la1 + // [902] if(main_vera_flash::spi_ensure_detect#11<$10) goto main_vera_flash::@4 -- vbuz1_lt_vbuc1_then_la1 lda.z spi_ensure_detect cmp #$10 bcs !__b4+ jmp __b4 !__b4: - // [1415] phi from main_vera_flash::@3 to main_vera_flash::@5 [phi:main_vera_flash::@3->main_vera_flash::@5] + // [903] phi from main_vera_flash::@3 to main_vera_flash::@5 [phi:main_vera_flash::@3->main_vera_flash::@5] // main_vera_flash::@5 // display_action_text("The jumper JP1 has been closed on the VERA!") - // [1416] call display_action_text - // [1357] phi from main_vera_flash::@5 to display_action_text [phi:main_vera_flash::@5->display_action_text] - // [1357] phi display_action_text::info_text#25 = main_vera_flash::info_text2 [phi:main_vera_flash::@5->display_action_text#0] -- pbuz1=pbuc1 + // [904] call display_action_text + // [845] phi from main_vera_flash::@5 to display_action_text [phi:main_vera_flash::@5->display_action_text] + // [845] phi display_action_text::info_text#17 = main_vera_flash::info_text2 [phi:main_vera_flash::@5->display_action_text#0] -- pbuz1=pbuc1 lda #info_text2 sta.z display_action_text.info_text+1 jsr display_action_text - // [1417] phi from main_vera_flash::@5 to main_vera_flash::@28 [phi:main_vera_flash::@5->main_vera_flash::@28] + // [905] phi from main_vera_flash::@5 to main_vera_flash::@28 [phi:main_vera_flash::@5->main_vera_flash::@28] // main_vera_flash::@28 // display_action_progress("Comparing VERA ... (.) data, (=) same, (*) different.") - // [1418] call display_action_progress + // [906] call display_action_progress // Now we compare the RAM with the actual VERA contents. - // [904] phi from main_vera_flash::@28 to display_action_progress [phi:main_vera_flash::@28->display_action_progress] - // [904] phi display_action_progress::info_text#27 = main_vera_flash::info_text3 [phi:main_vera_flash::@28->display_action_progress#0] -- pbuz1=pbuc1 + // [559] phi from main_vera_flash::@28 to display_action_progress [phi:main_vera_flash::@28->display_action_progress] + // [559] phi display_action_progress::info_text#19 = main_vera_flash::info_text3 [phi:main_vera_flash::@28->display_action_progress#0] -- pbuz1=pbuc1 lda #info_text3 sta.z display_action_progress.info_text+1 jsr display_action_progress // main_vera_flash::@29 - // [1419] spi_manufacturer#589 = spi_read::return#0 -- vbum1=vbum2 + // [907] spi_manufacturer#415 = spi_read::return#0 -- vbum1=vbum2 lda spi_read.return sta spi_manufacturer - // [1420] spi_memory_type#590 = spi_read::return#1 -- vbum1=vbum2 + // [908] spi_memory_type#416 = spi_read::return#1 -- vbum1=vbum2 lda spi_read.return_1 sta spi_memory_type - // [1421] spi_memory_capacity#591 = spi_read::return#2 -- vbum1=vbum2 + // [909] spi_memory_capacity#417 = spi_read::return#2 -- vbum1=vbum2 lda spi_read.return_2 sta spi_memory_capacity // display_info_vera(STATUS_COMPARING, NULL) - // [1422] call display_info_vera - // [998] phi from main_vera_flash::@29 to display_info_vera [phi:main_vera_flash::@29->display_info_vera] - // [998] phi display_info_vera::info_text#19 = 0 [phi:main_vera_flash::@29->display_info_vera#0] -- pbuz1=vbuc1 + // [910] call display_info_vera + // [653] phi from main_vera_flash::@29 to display_info_vera [phi:main_vera_flash::@29->display_info_vera] + // [653] phi display_info_vera::info_text#19 = 0 [phi:main_vera_flash::@29->display_info_vera#0] -- pbuz1=vbuc1 lda #<0 sta.z display_info_vera.info_text sta.z display_info_vera.info_text+1 - // [998] phi spi_memory_capacity#106 = spi_memory_capacity#591 [phi:main_vera_flash::@29->display_info_vera#1] -- register_copy - // [998] phi spi_memory_type#107 = spi_memory_type#590 [phi:main_vera_flash::@29->display_info_vera#2] -- register_copy - // [998] phi spi_manufacturer#108 = spi_manufacturer#589 [phi:main_vera_flash::@29->display_info_vera#3] -- register_copy - // [998] phi display_info_vera::info_status#19 = STATUS_COMPARING [phi:main_vera_flash::@29->display_info_vera#4] -- vbum1=vbuc1 + // [653] phi spi_memory_capacity#110 = spi_memory_capacity#417 [phi:main_vera_flash::@29->display_info_vera#1] -- register_copy + // [653] phi spi_memory_type#111 = spi_memory_type#416 [phi:main_vera_flash::@29->display_info_vera#2] -- register_copy + // [653] phi spi_manufacturer#100 = spi_manufacturer#415 [phi:main_vera_flash::@29->display_info_vera#3] -- register_copy + // [653] phi display_info_vera::info_status#19 = STATUS_COMPARING [phi:main_vera_flash::@29->display_info_vera#4] -- vbum1=vbuc1 lda #STATUS_COMPARING sta display_info_vera.info_status jsr display_info_vera - // [1423] phi from main_vera_flash::@29 to main_vera_flash::@30 [phi:main_vera_flash::@29->main_vera_flash::@30] + // [911] phi from main_vera_flash::@29 to main_vera_flash::@30 [phi:main_vera_flash::@29->main_vera_flash::@30] // main_vera_flash::@30 // unsigned long vera_differences = vera_verify() - // [1424] call vera_verify + // [912] call vera_verify // Verify VERA ... - // [2737] phi from main_vera_flash::@30 to vera_verify [phi:main_vera_flash::@30->vera_verify] + // [1570] phi from main_vera_flash::@30 to vera_verify [phi:main_vera_flash::@30->vera_verify] jsr vera_verify // unsigned long vera_differences = vera_verify() - // [1425] vera_verify::return#2 = vera_verify::vera_different_bytes#11 + // [913] vera_verify::return#2 = vera_verify::vera_different_bytes#11 // main_vera_flash::@31 - // [1426] main_vera_flash::vera_differences#0 = vera_verify::return#2 -- vdum1=vdum2 + // [914] main_vera_flash::vera_differences#0 = vera_verify::return#2 -- vduz1=vdum2 lda vera_verify.return - sta vera_differences + sta.z vera_differences lda vera_verify.return+1 - sta vera_differences+1 + sta.z vera_differences+1 lda vera_verify.return+2 - sta vera_differences+2 + sta.z vera_differences+2 lda vera_verify.return+3 - sta vera_differences+3 + sta.z vera_differences+3 // if (!vera_differences) - // [1427] if(0==main_vera_flash::vera_differences#0) goto main_vera_flash::@9 -- 0_eq_vdum1_then_la1 - lda vera_differences - ora vera_differences+1 - ora vera_differences+2 - ora vera_differences+3 + // [915] if(0==main_vera_flash::vera_differences#0) goto main_vera_flash::@9 -- 0_eq_vduz1_then_la1 + lda.z vera_differences + ora.z vera_differences+1 + ora.z vera_differences+2 + ora.z vera_differences+3 bne !__b9+ jmp __b9 !__b9: - // [1428] phi from main_vera_flash::@31 to main_vera_flash::@8 [phi:main_vera_flash::@31->main_vera_flash::@8] + // [916] phi from main_vera_flash::@31 to main_vera_flash::@8 [phi:main_vera_flash::@31->main_vera_flash::@8] // main_vera_flash::@8 // sprintf(info_text, "%05x differences!", vera_differences) - // [1429] call snprintf_init - // [1205] phi from main_vera_flash::@8 to snprintf_init [phi:main_vera_flash::@8->snprintf_init] - // [1205] phi snprintf_init::s#31 = info_text [phi:main_vera_flash::@8->snprintf_init#0] -- pbuz1=pbuc1 - lda #<@info_text - sta.z snprintf_init.s - lda #>@info_text - sta.z snprintf_init.s+1 + // [917] call snprintf_init jsr snprintf_init // main_vera_flash::@33 - // sprintf(info_text, "%05x differences!", vera_differences) - // [1430] printf_ulong::uvalue#10 = main_vera_flash::vera_differences#0 -- vdum1=vdum2 - lda vera_differences + // [918] printf_ulong::uvalue#7 = main_vera_flash::vera_differences#0 -- vdum1=vduz2 + lda.z vera_differences sta printf_ulong.uvalue - lda vera_differences+1 + lda.z vera_differences+1 sta printf_ulong.uvalue+1 - lda vera_differences+2 + lda.z vera_differences+2 sta printf_ulong.uvalue+2 - lda vera_differences+3 + lda.z vera_differences+3 sta printf_ulong.uvalue+3 - // [1431] call printf_ulong - // [1741] phi from main_vera_flash::@33 to printf_ulong [phi:main_vera_flash::@33->printf_ulong] - // [1741] phi printf_ulong::format_zero_padding#15 = 1 [phi:main_vera_flash::@33->printf_ulong#0] -- vbum1=vbuc1 + // [919] call printf_ulong + // [1633] phi from main_vera_flash::@33 to printf_ulong [phi:main_vera_flash::@33->printf_ulong] + // [1633] phi printf_ulong::format_zero_padding#10 = 1 [phi:main_vera_flash::@33->printf_ulong#0] -- vbum1=vbuc1 lda #1 sta printf_ulong.format_zero_padding - // [1741] phi printf_ulong::format_min_length#15 = 5 [phi:main_vera_flash::@33->printf_ulong#1] -- vbum1=vbuc1 + // [1633] phi printf_ulong::format_min_length#10 = 5 [phi:main_vera_flash::@33->printf_ulong#1] -- vbum1=vbuc1 lda #5 sta printf_ulong.format_min_length - // [1741] phi printf_ulong::format_radix#15 = HEXADECIMAL [phi:main_vera_flash::@33->printf_ulong#2] -- vbum1=vbuc1 + // [1633] phi printf_ulong::format_radix#10 = HEXADECIMAL [phi:main_vera_flash::@33->printf_ulong#2] -- vbum1=vbuc1 lda #HEXADECIMAL sta printf_ulong.format_radix - // [1741] phi printf_ulong::uvalue#15 = printf_ulong::uvalue#10 [phi:main_vera_flash::@33->printf_ulong#3] -- register_copy + // [1633] phi printf_ulong::uvalue#10 = printf_ulong::uvalue#7 [phi:main_vera_flash::@33->printf_ulong#3] -- register_copy jsr printf_ulong - // [1432] phi from main_vera_flash::@33 to main_vera_flash::@34 [phi:main_vera_flash::@33->main_vera_flash::@34] + // [920] phi from main_vera_flash::@33 to main_vera_flash::@34 [phi:main_vera_flash::@33->main_vera_flash::@34] // main_vera_flash::@34 // sprintf(info_text, "%05x differences!", vera_differences) - // [1433] call printf_str - // [1210] phi from main_vera_flash::@34 to printf_str [phi:main_vera_flash::@34->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:main_vera_flash::@34->printf_str#0] -- pprz1=pprc1 + // [921] call printf_str + // [785] phi from main_vera_flash::@34 to printf_str [phi:main_vera_flash::@34->printf_str] + // [785] phi printf_str::putc#53 = &snputc [phi:main_vera_flash::@34->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = s13 [phi:main_vera_flash::@34->printf_str#1] -- pbuz1=pbuc1 - lda #printf_str#1] -- pbuz1=pbuc1 + lda #s13 + lda #>s1 sta.z printf_str.s+1 jsr printf_str // main_vera_flash::@35 // sprintf(info_text, "%05x differences!", vera_differences) - // [1434] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 + // [922] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 lda #0 pha - // [1435] callexecute snputc -- call_vprc1 + // [923] callexecute snputc -- call_vprc1 jsr snputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla - // [1437] spi_manufacturer#590 = spi_read::return#0 -- vbum1=vbum2 + // [925] spi_manufacturer#416 = spi_read::return#0 -- vbum1=vbum2 lda spi_read.return sta spi_manufacturer - // [1438] spi_memory_type#591 = spi_read::return#1 -- vbum1=vbum2 + // [926] spi_memory_type#417 = spi_read::return#1 -- vbum1=vbum2 lda spi_read.return_1 sta spi_memory_type - // [1439] spi_memory_capacity#592 = spi_read::return#2 -- vbum1=vbum2 + // [927] spi_memory_capacity#418 = spi_read::return#2 -- vbum1=vbum2 lda spi_read.return_2 sta spi_memory_capacity // display_info_vera(STATUS_FLASH, info_text) - // [1440] call display_info_vera - // [998] phi from main_vera_flash::@35 to display_info_vera [phi:main_vera_flash::@35->display_info_vera] - // [998] phi display_info_vera::info_text#19 = info_text [phi:main_vera_flash::@35->display_info_vera#0] -- pbuz1=pbuc1 + // [928] call display_info_vera + // [653] phi from main_vera_flash::@35 to display_info_vera [phi:main_vera_flash::@35->display_info_vera] + // [653] phi display_info_vera::info_text#19 = info_text [phi:main_vera_flash::@35->display_info_vera#0] -- pbuz1=pbuc1 lda #<@info_text sta.z display_info_vera.info_text lda #>@info_text sta.z display_info_vera.info_text+1 - // [998] phi spi_memory_capacity#106 = spi_memory_capacity#592 [phi:main_vera_flash::@35->display_info_vera#1] -- register_copy - // [998] phi spi_memory_type#107 = spi_memory_type#591 [phi:main_vera_flash::@35->display_info_vera#2] -- register_copy - // [998] phi spi_manufacturer#108 = spi_manufacturer#590 [phi:main_vera_flash::@35->display_info_vera#3] -- register_copy - // [998] phi display_info_vera::info_status#19 = STATUS_FLASH [phi:main_vera_flash::@35->display_info_vera#4] -- vbum1=vbuc1 + // [653] phi spi_memory_capacity#110 = spi_memory_capacity#418 [phi:main_vera_flash::@35->display_info_vera#1] -- register_copy + // [653] phi spi_memory_type#111 = spi_memory_type#417 [phi:main_vera_flash::@35->display_info_vera#2] -- register_copy + // [653] phi spi_manufacturer#100 = spi_manufacturer#416 [phi:main_vera_flash::@35->display_info_vera#3] -- register_copy + // [653] phi display_info_vera::info_status#19 = STATUS_FLASH [phi:main_vera_flash::@35->display_info_vera#4] -- vbum1=vbuc1 lda #STATUS_FLASH sta display_info_vera.info_status jsr display_info_vera - // [1441] phi from main_vera_flash::@35 to main_vera_flash::@36 [phi:main_vera_flash::@35->main_vera_flash::@36] + // [929] phi from main_vera_flash::@35 to main_vera_flash::@36 [phi:main_vera_flash::@35->main_vera_flash::@36] // main_vera_flash::@36 // unsigned char vera_erase_error = vera_erase() - // [1442] call vera_erase + // [930] call vera_erase jsr vera_erase - // [1443] phi from main_vera_flash::@36 to main_vera_flash::@10 [phi:main_vera_flash::@36->main_vera_flash::@10] + // [931] phi from main_vera_flash::@36 to main_vera_flash::@10 [phi:main_vera_flash::@36->main_vera_flash::@10] // main_vera_flash::@10 // unsigned long vera_flashed = vera_flash() - // [1444] call vera_flash - // [2806] phi from main_vera_flash::@10 to vera_flash [phi:main_vera_flash::@10->vera_flash] + // [932] call vera_flash + // [1649] phi from main_vera_flash::@10 to vera_flash [phi:main_vera_flash::@10->vera_flash] jsr vera_flash // unsigned long vera_flashed = vera_flash() - // [1445] vera_flash::return#3 = vera_flash::return#2 + // [933] vera_flash::return#3 = vera_flash::return#2 // main_vera_flash::@37 - // [1446] main_vera_flash::vera_flashed#0 = vera_flash::return#3 -- vdum1=vdum2 + // [934] main_vera_flash::vera_flashed#0 = vera_flash::return#3 -- vduz1=vdum2 lda vera_flash.return - sta vera_flashed + sta.z vera_flashed lda vera_flash.return+1 - sta vera_flashed+1 + sta.z vera_flashed+1 lda vera_flash.return+2 - sta vera_flashed+2 + sta.z vera_flashed+2 lda vera_flash.return+3 - sta vera_flashed+3 + sta.z vera_flashed+3 // if(vera_flashed) - // [1447] if(0!=main_vera_flash::vera_flashed#0) goto main_vera_flash::@11 -- 0_neq_vdum1_then_la1 - lda vera_flashed - ora vera_flashed+1 - ora vera_flashed+2 - ora vera_flashed+3 - beq !__b11+ - jmp __b11 - !__b11: + // [935] if(0!=main_vera_flash::vera_flashed#0) goto main_vera_flash::@11 -- 0_neq_vduz1_then_la1 + lda.z vera_flashed + ora.z vera_flashed+1 + ora.z vera_flashed+2 + ora.z vera_flashed+3 + bne __b11 // main_vera_flash::@12 - // [1448] spi_manufacturer#586 = spi_read::return#0 -- vbum1=vbum2 + // [936] spi_manufacturer#412 = spi_read::return#0 -- vbum1=vbum2 lda spi_read.return sta spi_manufacturer - // [1449] spi_memory_type#587 = spi_read::return#1 -- vbum1=vbum2 + // [937] spi_memory_type#413 = spi_read::return#1 -- vbum1=vbum2 lda spi_read.return_1 sta spi_memory_type - // [1450] spi_memory_capacity#588 = spi_read::return#2 -- vbum1=vbum2 + // [938] spi_memory_capacity#414 = spi_read::return#2 -- vbum1=vbum2 lda spi_read.return_2 sta spi_memory_capacity // display_info_vera(STATUS_ERROR, info_text) - // [1451] call display_info_vera + // [939] call display_info_vera // VFL2 | Flash VERA resulting in errors - // [998] phi from main_vera_flash::@12 to display_info_vera [phi:main_vera_flash::@12->display_info_vera] - // [998] phi display_info_vera::info_text#19 = info_text [phi:main_vera_flash::@12->display_info_vera#0] -- pbuz1=pbuc1 + // [653] phi from main_vera_flash::@12 to display_info_vera [phi:main_vera_flash::@12->display_info_vera] + // [653] phi display_info_vera::info_text#19 = info_text [phi:main_vera_flash::@12->display_info_vera#0] -- pbuz1=pbuc1 lda #<@info_text sta.z display_info_vera.info_text lda #>@info_text sta.z display_info_vera.info_text+1 - // [998] phi spi_memory_capacity#106 = spi_memory_capacity#588 [phi:main_vera_flash::@12->display_info_vera#1] -- register_copy - // [998] phi spi_memory_type#107 = spi_memory_type#587 [phi:main_vera_flash::@12->display_info_vera#2] -- register_copy - // [998] phi spi_manufacturer#108 = spi_manufacturer#586 [phi:main_vera_flash::@12->display_info_vera#3] -- register_copy - // [998] phi display_info_vera::info_status#19 = STATUS_ERROR [phi:main_vera_flash::@12->display_info_vera#4] -- vbum1=vbuc1 + // [653] phi spi_memory_capacity#110 = spi_memory_capacity#414 [phi:main_vera_flash::@12->display_info_vera#1] -- register_copy + // [653] phi spi_memory_type#111 = spi_memory_type#413 [phi:main_vera_flash::@12->display_info_vera#2] -- register_copy + // [653] phi spi_manufacturer#100 = spi_manufacturer#412 [phi:main_vera_flash::@12->display_info_vera#3] -- register_copy + // [653] phi display_info_vera::info_status#19 = STATUS_ERROR [phi:main_vera_flash::@12->display_info_vera#4] -- vbum1=vbuc1 lda #STATUS_ERROR sta display_info_vera.info_status jsr display_info_vera - // [1452] phi from main_vera_flash::@12 to main_vera_flash::@46 [phi:main_vera_flash::@12->main_vera_flash::@46] + // [940] phi from main_vera_flash::@12 to main_vera_flash::@46 [phi:main_vera_flash::@12->main_vera_flash::@46] // main_vera_flash::@46 // display_action_progress("There was an error updating your VERA flash memory!") - // [1453] call display_action_progress - // [904] phi from main_vera_flash::@46 to display_action_progress [phi:main_vera_flash::@46->display_action_progress] - // [904] phi display_action_progress::info_text#27 = main_vera_flash::info_text10 [phi:main_vera_flash::@46->display_action_progress#0] -- pbuz1=pbuc1 + // [941] call display_action_progress + // [559] phi from main_vera_flash::@46 to display_action_progress [phi:main_vera_flash::@46->display_action_progress] + // [559] phi display_action_progress::info_text#19 = main_vera_flash::info_text10 [phi:main_vera_flash::@46->display_action_progress#0] -- pbuz1=pbuc1 lda #info_text10 sta.z display_action_progress.info_text+1 jsr display_action_progress - // [1454] phi from main_vera_flash::@46 to main_vera_flash::@47 [phi:main_vera_flash::@46->main_vera_flash::@47] + // [942] phi from main_vera_flash::@46 to main_vera_flash::@47 [phi:main_vera_flash::@46->main_vera_flash::@47] // main_vera_flash::@47 // display_action_text("DO NOT RESET or REBOOT YOUR CX16 AND WAIT!") - // [1455] call display_action_text - // [1357] phi from main_vera_flash::@47 to display_action_text [phi:main_vera_flash::@47->display_action_text] - // [1357] phi display_action_text::info_text#25 = main_vera_flash::info_text8 [phi:main_vera_flash::@47->display_action_text#0] -- pbuz1=pbuc1 + // [943] call display_action_text + // [845] phi from main_vera_flash::@47 to display_action_text [phi:main_vera_flash::@47->display_action_text] + // [845] phi display_action_text::info_text#17 = main_vera_flash::info_text8 [phi:main_vera_flash::@47->display_action_text#0] -- pbuz1=pbuc1 lda #info_text8 sta.z display_action_text.info_text+1 jsr display_action_text // main_vera_flash::@48 - // [1456] spi_manufacturer#594 = spi_read::return#0 -- vbum1=vbum2 + // [944] spi_manufacturer#420 = spi_read::return#0 -- vbum1=vbum2 lda spi_read.return sta spi_manufacturer - // [1457] spi_memory_type#595 = spi_read::return#1 -- vbum1=vbum2 + // [945] spi_memory_type#421 = spi_read::return#1 -- vbum1=vbum2 lda spi_read.return_1 sta spi_memory_type - // [1458] spi_memory_capacity#596 = spi_read::return#2 -- vbum1=vbum2 + // [946] spi_memory_capacity#422 = spi_read::return#2 -- vbum1=vbum2 lda spi_read.return_2 sta spi_memory_capacity // display_info_vera(STATUS_ERROR, "FLASH ERROR!") - // [1459] call display_info_vera - // [998] phi from main_vera_flash::@48 to display_info_vera [phi:main_vera_flash::@48->display_info_vera] - // [998] phi display_info_vera::info_text#19 = main_vera_flash::info_text12 [phi:main_vera_flash::@48->display_info_vera#0] -- pbuz1=pbuc1 + // [947] call display_info_vera + // [653] phi from main_vera_flash::@48 to display_info_vera [phi:main_vera_flash::@48->display_info_vera] + // [653] phi display_info_vera::info_text#19 = main_vera_flash::info_text12 [phi:main_vera_flash::@48->display_info_vera#0] -- pbuz1=pbuc1 lda #info_text12 sta.z display_info_vera.info_text+1 - // [998] phi spi_memory_capacity#106 = spi_memory_capacity#596 [phi:main_vera_flash::@48->display_info_vera#1] -- register_copy - // [998] phi spi_memory_type#107 = spi_memory_type#595 [phi:main_vera_flash::@48->display_info_vera#2] -- register_copy - // [998] phi spi_manufacturer#108 = spi_manufacturer#594 [phi:main_vera_flash::@48->display_info_vera#3] -- register_copy - // [998] phi display_info_vera::info_status#19 = STATUS_ERROR [phi:main_vera_flash::@48->display_info_vera#4] -- vbum1=vbuc1 + // [653] phi spi_memory_capacity#110 = spi_memory_capacity#422 [phi:main_vera_flash::@48->display_info_vera#1] -- register_copy + // [653] phi spi_memory_type#111 = spi_memory_type#421 [phi:main_vera_flash::@48->display_info_vera#2] -- register_copy + // [653] phi spi_manufacturer#100 = spi_manufacturer#420 [phi:main_vera_flash::@48->display_info_vera#3] -- register_copy + // [653] phi display_info_vera::info_status#19 = STATUS_ERROR [phi:main_vera_flash::@48->display_info_vera#4] -- vbum1=vbuc1 lda #STATUS_ERROR sta display_info_vera.info_status jsr display_info_vera + // [948] phi from main_vera_flash::@48 to main_vera_flash::@49 [phi:main_vera_flash::@48->main_vera_flash::@49] // main_vera_flash::@49 - // [1460] smc_bootloader#517 = smc_bootloader#0 -- vwum1=vwum2 - lda smc_bootloader - sta smc_bootloader_1 - lda smc_bootloader+1 - sta smc_bootloader_1+1 // display_info_smc(STATUS_ERROR, NULL) - // [1461] call display_info_smc - // [962] phi from main_vera_flash::@49 to display_info_smc [phi:main_vera_flash::@49->display_info_smc] - // [962] phi display_info_smc::info_text#20 = 0 [phi:main_vera_flash::@49->display_info_smc#0] -- pbuz1=vbuc1 + // [949] call display_info_smc + // [617] phi from main_vera_flash::@49 to display_info_smc [phi:main_vera_flash::@49->display_info_smc] + // [617] phi display_info_smc::info_text#10 = 0 [phi:main_vera_flash::@49->display_info_smc#0] -- pbuz1=vbuc1 lda #<0 sta.z display_info_smc.info_text sta.z display_info_smc.info_text+1 - // [962] phi smc_bootloader#14 = smc_bootloader#517 [phi:main_vera_flash::@49->display_info_smc#1] -- register_copy - // [962] phi display_info_smc::info_status#20 = STATUS_ERROR [phi:main_vera_flash::@49->display_info_smc#2] -- vbum1=vbuc1 + // [617] phi display_info_smc::info_status#10 = STATUS_ERROR [phi:main_vera_flash::@49->display_info_smc#1] -- vbum1=vbuc1 lda #STATUS_ERROR sta display_info_smc.info_status jsr display_info_smc - // [1462] phi from main_vera_flash::@49 to main_vera_flash::@50 [phi:main_vera_flash::@49->main_vera_flash::@50] + // [950] phi from main_vera_flash::@49 to main_vera_flash::@50 [phi:main_vera_flash::@49->main_vera_flash::@50] // main_vera_flash::@50 // display_info_roms(STATUS_ERROR, NULL) - // [1463] call display_info_roms - // [2856] phi from main_vera_flash::@50 to display_info_roms [phi:main_vera_flash::@50->display_info_roms] + // [951] call display_info_roms + // [1699] phi from main_vera_flash::@50 to display_info_roms [phi:main_vera_flash::@50->display_info_roms] jsr display_info_roms - // [1464] phi from main_vera_flash::@50 to main_vera_flash::@51 [phi:main_vera_flash::@50->main_vera_flash::@51] + // [952] phi from main_vera_flash::@50 to main_vera_flash::@51 [phi:main_vera_flash::@50->main_vera_flash::@51] // main_vera_flash::@51 // wait_moment(32) - // [1465] call wait_moment - // [1310] phi from main_vera_flash::@51 to wait_moment [phi:main_vera_flash::@51->wait_moment] - // [1310] phi wait_moment::w#13 = $20 [phi:main_vera_flash::@51->wait_moment#0] -- vbum1=vbuc1 + // [953] call wait_moment + // [794] phi from main_vera_flash::@51 to wait_moment [phi:main_vera_flash::@51->wait_moment] + // [794] phi wait_moment::w#10 = $20 [phi:main_vera_flash::@51->wait_moment#0] -- vbum1=vbuc1 lda #$20 sta wait_moment.w jsr wait_moment - // [1466] phi from main_vera_flash::@51 to main_vera_flash::@52 [phi:main_vera_flash::@51->main_vera_flash::@52] + // [954] phi from main_vera_flash::@51 to main_vera_flash::@52 [phi:main_vera_flash::@51->main_vera_flash::@52] // main_vera_flash::@52 // spi_deselect() - // [1467] call spi_deselect + // [955] call spi_deselect jsr spi_deselect // main_vera_flash::@return // } - // [1468] return + // [956] return rts - // [1469] phi from main_vera_flash::@37 to main_vera_flash::@11 [phi:main_vera_flash::@37->main_vera_flash::@11] + // [957] phi from main_vera_flash::@37 to main_vera_flash::@11 [phi:main_vera_flash::@37->main_vera_flash::@11] // main_vera_flash::@11 __b11: // sprintf(info_text, "%x bytes flashed!", vera_flashed) - // [1470] call snprintf_init - // [1205] phi from main_vera_flash::@11 to snprintf_init [phi:main_vera_flash::@11->snprintf_init] - // [1205] phi snprintf_init::s#31 = info_text [phi:main_vera_flash::@11->snprintf_init#0] -- pbuz1=pbuc1 - lda #<@info_text - sta.z snprintf_init.s - lda #>@info_text - sta.z snprintf_init.s+1 + // [958] call snprintf_init jsr snprintf_init // main_vera_flash::@38 - // sprintf(info_text, "%x bytes flashed!", vera_flashed) - // [1471] printf_ulong::uvalue#11 = main_vera_flash::vera_flashed#0 -- vdum1=vdum2 - lda vera_flashed + // [959] printf_ulong::uvalue#8 = main_vera_flash::vera_flashed#0 -- vdum1=vduz2 + lda.z vera_flashed sta printf_ulong.uvalue - lda vera_flashed+1 + lda.z vera_flashed+1 sta printf_ulong.uvalue+1 - lda vera_flashed+2 + lda.z vera_flashed+2 sta printf_ulong.uvalue+2 - lda vera_flashed+3 + lda.z vera_flashed+3 sta printf_ulong.uvalue+3 - // [1472] call printf_ulong - // [1741] phi from main_vera_flash::@38 to printf_ulong [phi:main_vera_flash::@38->printf_ulong] - // [1741] phi printf_ulong::format_zero_padding#15 = 0 [phi:main_vera_flash::@38->printf_ulong#0] -- vbum1=vbuc1 + // [960] call printf_ulong + // [1633] phi from main_vera_flash::@38 to printf_ulong [phi:main_vera_flash::@38->printf_ulong] + // [1633] phi printf_ulong::format_zero_padding#10 = 0 [phi:main_vera_flash::@38->printf_ulong#0] -- vbum1=vbuc1 lda #0 sta printf_ulong.format_zero_padding - // [1741] phi printf_ulong::format_min_length#15 = 0 [phi:main_vera_flash::@38->printf_ulong#1] -- vbum1=vbuc1 + // [1633] phi printf_ulong::format_min_length#10 = 0 [phi:main_vera_flash::@38->printf_ulong#1] -- vbum1=vbuc1 sta printf_ulong.format_min_length - // [1741] phi printf_ulong::format_radix#15 = HEXADECIMAL [phi:main_vera_flash::@38->printf_ulong#2] -- vbum1=vbuc1 + // [1633] phi printf_ulong::format_radix#10 = HEXADECIMAL [phi:main_vera_flash::@38->printf_ulong#2] -- vbum1=vbuc1 lda #HEXADECIMAL sta printf_ulong.format_radix - // [1741] phi printf_ulong::uvalue#15 = printf_ulong::uvalue#11 [phi:main_vera_flash::@38->printf_ulong#3] -- register_copy + // [1633] phi printf_ulong::uvalue#10 = printf_ulong::uvalue#8 [phi:main_vera_flash::@38->printf_ulong#3] -- register_copy jsr printf_ulong - // [1473] phi from main_vera_flash::@38 to main_vera_flash::@39 [phi:main_vera_flash::@38->main_vera_flash::@39] + // [961] phi from main_vera_flash::@38 to main_vera_flash::@39 [phi:main_vera_flash::@38->main_vera_flash::@39] // main_vera_flash::@39 // sprintf(info_text, "%x bytes flashed!", vera_flashed) - // [1474] call printf_str - // [1210] phi from main_vera_flash::@39 to printf_str [phi:main_vera_flash::@39->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:main_vera_flash::@39->printf_str#0] -- pprz1=pprc1 + // [962] call printf_str + // [785] phi from main_vera_flash::@39 to printf_str [phi:main_vera_flash::@39->printf_str] + // [785] phi printf_str::putc#53 = &snputc [phi:main_vera_flash::@39->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = main_vera_flash::s2 [phi:main_vera_flash::@39->printf_str#1] -- pbuz1=pbuc1 + // [785] phi printf_str::s#53 = main_vera_flash::s2 [phi:main_vera_flash::@39->printf_str#1] -- pbuz1=pbuc1 lda #s2 @@ -9808,47 +6092,47 @@ main_vera_flash: { jsr printf_str // main_vera_flash::@40 // sprintf(info_text, "%x bytes flashed!", vera_flashed) - // [1475] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 + // [963] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 lda #0 pha - // [1476] callexecute snputc -- call_vprc1 + // [964] callexecute snputc -- call_vprc1 jsr snputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla - // [1478] spi_manufacturer#591 = spi_read::return#0 -- vbum1=vbum2 + // [966] spi_manufacturer#417 = spi_read::return#0 -- vbum1=vbum2 lda spi_read.return sta spi_manufacturer - // [1479] spi_memory_type#592 = spi_read::return#1 -- vbum1=vbum2 + // [967] spi_memory_type#418 = spi_read::return#1 -- vbum1=vbum2 lda spi_read.return_1 sta spi_memory_type - // [1480] spi_memory_capacity#593 = spi_read::return#2 -- vbum1=vbum2 + // [968] spi_memory_capacity#419 = spi_read::return#2 -- vbum1=vbum2 lda spi_read.return_2 sta spi_memory_capacity // display_info_vera(STATUS_FLASHED, info_text) - // [1481] call display_info_vera - // [998] phi from main_vera_flash::@40 to display_info_vera [phi:main_vera_flash::@40->display_info_vera] - // [998] phi display_info_vera::info_text#19 = info_text [phi:main_vera_flash::@40->display_info_vera#0] -- pbuz1=pbuc1 + // [969] call display_info_vera + // [653] phi from main_vera_flash::@40 to display_info_vera [phi:main_vera_flash::@40->display_info_vera] + // [653] phi display_info_vera::info_text#19 = info_text [phi:main_vera_flash::@40->display_info_vera#0] -- pbuz1=pbuc1 lda #<@info_text sta.z display_info_vera.info_text lda #>@info_text sta.z display_info_vera.info_text+1 - // [998] phi spi_memory_capacity#106 = spi_memory_capacity#593 [phi:main_vera_flash::@40->display_info_vera#1] -- register_copy - // [998] phi spi_memory_type#107 = spi_memory_type#592 [phi:main_vera_flash::@40->display_info_vera#2] -- register_copy - // [998] phi spi_manufacturer#108 = spi_manufacturer#591 [phi:main_vera_flash::@40->display_info_vera#3] -- register_copy - // [998] phi display_info_vera::info_status#19 = STATUS_FLASHED [phi:main_vera_flash::@40->display_info_vera#4] -- vbum1=vbuc1 + // [653] phi spi_memory_capacity#110 = spi_memory_capacity#419 [phi:main_vera_flash::@40->display_info_vera#1] -- register_copy + // [653] phi spi_memory_type#111 = spi_memory_type#418 [phi:main_vera_flash::@40->display_info_vera#2] -- register_copy + // [653] phi spi_manufacturer#100 = spi_manufacturer#417 [phi:main_vera_flash::@40->display_info_vera#3] -- register_copy + // [653] phi display_info_vera::info_status#19 = STATUS_FLASHED [phi:main_vera_flash::@40->display_info_vera#4] -- vbum1=vbuc1 lda #STATUS_FLASHED sta display_info_vera.info_status jsr display_info_vera - // [1482] phi from main_vera_flash::@40 to main_vera_flash::@41 [phi:main_vera_flash::@40->main_vera_flash::@41] + // [970] phi from main_vera_flash::@40 to main_vera_flash::@41 [phi:main_vera_flash::@40->main_vera_flash::@41] // main_vera_flash::@41 // unsigned long vera_differences = vera_verify() - // [1483] call vera_verify - // [2737] phi from main_vera_flash::@41 to vera_verify [phi:main_vera_flash::@41->vera_verify] + // [971] call vera_verify + // [1570] phi from main_vera_flash::@41 to vera_verify [phi:main_vera_flash::@41->vera_verify] jsr vera_verify // unsigned long vera_differences = vera_verify() - // [1484] vera_verify::return#3 = vera_verify::vera_different_bytes#11 + // [972] vera_verify::return#3 = vera_verify::vera_different_bytes#11 // main_vera_flash::@42 - // [1485] main_vera_flash::vera_differences1#0 = vera_verify::return#3 -- vduz1=vdum2 + // [973] main_vera_flash::vera_differences1#0 = vera_verify::return#3 -- vduz1=vdum2 lda vera_verify.return sta.z vera_differences1 lda vera_verify.return+1 @@ -9858,17 +6142,10 @@ main_vera_flash: { lda vera_verify.return+3 sta.z vera_differences1+3 // sprintf(info_text, "%05x differences!", vera_differences) - // [1486] call snprintf_init - // [1205] phi from main_vera_flash::@42 to snprintf_init [phi:main_vera_flash::@42->snprintf_init] - // [1205] phi snprintf_init::s#31 = info_text [phi:main_vera_flash::@42->snprintf_init#0] -- pbuz1=pbuc1 - lda #<@info_text - sta.z snprintf_init.s - lda #>@info_text - sta.z snprintf_init.s+1 + // [974] call snprintf_init jsr snprintf_init // main_vera_flash::@43 - // sprintf(info_text, "%05x differences!", vera_differences) - // [1487] printf_ulong::uvalue#12 = main_vera_flash::vera_differences1#0 -- vdum1=vduz2 + // [975] printf_ulong::uvalue#9 = main_vera_flash::vera_differences1#0 -- vdum1=vduz2 lda.z vera_differences1 sta printf_ulong.uvalue lda.z vera_differences1+1 @@ -9877,337 +6154,337 @@ main_vera_flash: { sta printf_ulong.uvalue+2 lda.z vera_differences1+3 sta printf_ulong.uvalue+3 - // [1488] call printf_ulong - // [1741] phi from main_vera_flash::@43 to printf_ulong [phi:main_vera_flash::@43->printf_ulong] - // [1741] phi printf_ulong::format_zero_padding#15 = 1 [phi:main_vera_flash::@43->printf_ulong#0] -- vbum1=vbuc1 + // [976] call printf_ulong + // [1633] phi from main_vera_flash::@43 to printf_ulong [phi:main_vera_flash::@43->printf_ulong] + // [1633] phi printf_ulong::format_zero_padding#10 = 1 [phi:main_vera_flash::@43->printf_ulong#0] -- vbum1=vbuc1 lda #1 sta printf_ulong.format_zero_padding - // [1741] phi printf_ulong::format_min_length#15 = 5 [phi:main_vera_flash::@43->printf_ulong#1] -- vbum1=vbuc1 + // [1633] phi printf_ulong::format_min_length#10 = 5 [phi:main_vera_flash::@43->printf_ulong#1] -- vbum1=vbuc1 lda #5 sta printf_ulong.format_min_length - // [1741] phi printf_ulong::format_radix#15 = HEXADECIMAL [phi:main_vera_flash::@43->printf_ulong#2] -- vbum1=vbuc1 + // [1633] phi printf_ulong::format_radix#10 = HEXADECIMAL [phi:main_vera_flash::@43->printf_ulong#2] -- vbum1=vbuc1 lda #HEXADECIMAL sta printf_ulong.format_radix - // [1741] phi printf_ulong::uvalue#15 = printf_ulong::uvalue#12 [phi:main_vera_flash::@43->printf_ulong#3] -- register_copy + // [1633] phi printf_ulong::uvalue#10 = printf_ulong::uvalue#9 [phi:main_vera_flash::@43->printf_ulong#3] -- register_copy jsr printf_ulong - // [1489] phi from main_vera_flash::@43 to main_vera_flash::@44 [phi:main_vera_flash::@43->main_vera_flash::@44] + // [977] phi from main_vera_flash::@43 to main_vera_flash::@44 [phi:main_vera_flash::@43->main_vera_flash::@44] // main_vera_flash::@44 // sprintf(info_text, "%05x differences!", vera_differences) - // [1490] call printf_str - // [1210] phi from main_vera_flash::@44 to printf_str [phi:main_vera_flash::@44->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:main_vera_flash::@44->printf_str#0] -- pprz1=pprc1 + // [978] call printf_str + // [785] phi from main_vera_flash::@44 to printf_str [phi:main_vera_flash::@44->printf_str] + // [785] phi printf_str::putc#53 = &snputc [phi:main_vera_flash::@44->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = s13 [phi:main_vera_flash::@44->printf_str#1] -- pbuz1=pbuc1 - lda #printf_str#1] -- pbuz1=pbuc1 + lda #s13 + lda #>s1 sta.z printf_str.s+1 jsr printf_str // main_vera_flash::@45 // sprintf(info_text, "%05x differences!", vera_differences) - // [1491] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 + // [979] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 lda #0 pha - // [1492] callexecute snputc -- call_vprc1 + // [980] callexecute snputc -- call_vprc1 jsr snputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla - // [1494] spi_manufacturer#592 = spi_read::return#0 -- vbum1=vbum2 + // [982] spi_manufacturer#418 = spi_read::return#0 -- vbum1=vbum2 lda spi_read.return sta spi_manufacturer - // [1495] spi_memory_type#593 = spi_read::return#1 -- vbum1=vbum2 + // [983] spi_memory_type#419 = spi_read::return#1 -- vbum1=vbum2 lda spi_read.return_1 sta spi_memory_type - // [1496] spi_memory_capacity#594 = spi_read::return#2 -- vbum1=vbum2 + // [984] spi_memory_capacity#420 = spi_read::return#2 -- vbum1=vbum2 lda spi_read.return_2 sta spi_memory_capacity // display_info_vera(STATUS_FLASHED, info_text) - // [1497] call display_info_vera - // [998] phi from main_vera_flash::@45 to display_info_vera [phi:main_vera_flash::@45->display_info_vera] - // [998] phi display_info_vera::info_text#19 = info_text [phi:main_vera_flash::@45->display_info_vera#0] -- pbuz1=pbuc1 + // [985] call display_info_vera + // [653] phi from main_vera_flash::@45 to display_info_vera [phi:main_vera_flash::@45->display_info_vera] + // [653] phi display_info_vera::info_text#19 = info_text [phi:main_vera_flash::@45->display_info_vera#0] -- pbuz1=pbuc1 lda #<@info_text sta.z display_info_vera.info_text lda #>@info_text sta.z display_info_vera.info_text+1 - // [998] phi spi_memory_capacity#106 = spi_memory_capacity#594 [phi:main_vera_flash::@45->display_info_vera#1] -- register_copy - // [998] phi spi_memory_type#107 = spi_memory_type#593 [phi:main_vera_flash::@45->display_info_vera#2] -- register_copy - // [998] phi spi_manufacturer#108 = spi_manufacturer#592 [phi:main_vera_flash::@45->display_info_vera#3] -- register_copy - // [998] phi display_info_vera::info_status#19 = STATUS_FLASHED [phi:main_vera_flash::@45->display_info_vera#4] -- vbum1=vbuc1 + // [653] phi spi_memory_capacity#110 = spi_memory_capacity#420 [phi:main_vera_flash::@45->display_info_vera#1] -- register_copy + // [653] phi spi_memory_type#111 = spi_memory_type#419 [phi:main_vera_flash::@45->display_info_vera#2] -- register_copy + // [653] phi spi_manufacturer#100 = spi_manufacturer#418 [phi:main_vera_flash::@45->display_info_vera#3] -- register_copy + // [653] phi display_info_vera::info_status#19 = STATUS_FLASHED [phi:main_vera_flash::@45->display_info_vera#4] -- vbum1=vbuc1 lda #STATUS_FLASHED sta display_info_vera.info_status jsr display_info_vera - // [1498] phi from main_vera_flash::@45 main_vera_flash::@9 to main_vera_flash::@13 [phi:main_vera_flash::@45/main_vera_flash::@9->main_vera_flash::@13] + // [986] phi from main_vera_flash::@45 main_vera_flash::@9 to main_vera_flash::@13 [phi:main_vera_flash::@45/main_vera_flash::@9->main_vera_flash::@13] // main_vera_flash::@13 __b13: // display_action_progress("VERA SPI de-activation ...") - // [1499] call display_action_progress + // [987] call display_action_progress // Now we loop until jumper JP1 is open again! - // [904] phi from main_vera_flash::@13 to display_action_progress [phi:main_vera_flash::@13->display_action_progress] - // [904] phi display_action_progress::info_text#27 = main_vera_flash::info_text13 [phi:main_vera_flash::@13->display_action_progress#0] -- pbuz1=pbuc1 + // [559] phi from main_vera_flash::@13 to display_action_progress [phi:main_vera_flash::@13->display_action_progress] + // [559] phi display_action_progress::info_text#19 = main_vera_flash::info_text13 [phi:main_vera_flash::@13->display_action_progress#0] -- pbuz1=pbuc1 lda #info_text13 sta.z display_action_progress.info_text+1 jsr display_action_progress - // [1500] phi from main_vera_flash::@13 to main_vera_flash::@53 [phi:main_vera_flash::@13->main_vera_flash::@53] + // [988] phi from main_vera_flash::@13 to main_vera_flash::@53 [phi:main_vera_flash::@13->main_vera_flash::@53] // main_vera_flash::@53 // display_action_text("Please OPEN the jumper JP1 on the VERA board!") - // [1501] call display_action_text - // [1357] phi from main_vera_flash::@53 to display_action_text [phi:main_vera_flash::@53->display_action_text] - // [1357] phi display_action_text::info_text#25 = main_vera_flash::info_text14 [phi:main_vera_flash::@53->display_action_text#0] -- pbuz1=pbuc1 + // [989] call display_action_text + // [845] phi from main_vera_flash::@53 to display_action_text [phi:main_vera_flash::@53->display_action_text] + // [845] phi display_action_text::info_text#17 = main_vera_flash::info_text14 [phi:main_vera_flash::@53->display_action_text#0] -- pbuz1=pbuc1 lda #info_text14 sta.z display_action_text.info_text+1 jsr display_action_text - // [1502] phi from main_vera_flash::@53 to main_vera_flash::@54 [phi:main_vera_flash::@53->main_vera_flash::@54] + // [990] phi from main_vera_flash::@53 to main_vera_flash::@54 [phi:main_vera_flash::@53->main_vera_flash::@54] // main_vera_flash::@54 // vera_detect() - // [1503] call vera_detect - // [2391] phi from main_vera_flash::@54 to vera_detect [phi:main_vera_flash::@54->vera_detect] + // [991] call vera_detect + // [1455] phi from main_vera_flash::@54 to vera_detect [phi:main_vera_flash::@54->vera_detect] jsr vera_detect - // [1504] phi from main_vera_flash::@18 main_vera_flash::@54 to main_vera_flash::@14 [phi:main_vera_flash::@18/main_vera_flash::@54->main_vera_flash::@14] + // [992] phi from main_vera_flash::@18 main_vera_flash::@54 to main_vera_flash::@14 [phi:main_vera_flash::@18/main_vera_flash::@54->main_vera_flash::@14] __b5: - // [1504] phi main_vera_flash::spi_ensure_detect#12 = 0 [phi:main_vera_flash::@18/main_vera_flash::@54->main_vera_flash::@14#0] -- vbuz1=vbuc1 + // [992] phi main_vera_flash::spi_ensure_detect#12 = 0 [phi:main_vera_flash::@18/main_vera_flash::@54->main_vera_flash::@14#0] -- vbuz1=vbuc1 lda #0 sta.z spi_ensure_detect_1 // main_vera_flash::@14 __b14: // while(spi_ensure_detect < 16) - // [1505] if(main_vera_flash::spi_ensure_detect#12<$10) goto main_vera_flash::@15 -- vbuz1_lt_vbuc1_then_la1 + // [993] if(main_vera_flash::spi_ensure_detect#12<$10) goto main_vera_flash::@15 -- vbuz1_lt_vbuc1_then_la1 lda.z spi_ensure_detect_1 cmp #$10 bcc __b15 - // [1506] phi from main_vera_flash::@14 to main_vera_flash::@16 [phi:main_vera_flash::@14->main_vera_flash::@16] + // [994] phi from main_vera_flash::@14 to main_vera_flash::@16 [phi:main_vera_flash::@14->main_vera_flash::@16] // main_vera_flash::@16 // display_action_text("The jumper JP1 has been opened on the VERA!") - // [1507] call display_action_text - // [1357] phi from main_vera_flash::@16 to display_action_text [phi:main_vera_flash::@16->display_action_text] - // [1357] phi display_action_text::info_text#25 = main_vera_flash::info_text15 [phi:main_vera_flash::@16->display_action_text#0] -- pbuz1=pbuc1 + // [995] call display_action_text + // [845] phi from main_vera_flash::@16 to display_action_text [phi:main_vera_flash::@16->display_action_text] + // [845] phi display_action_text::info_text#17 = main_vera_flash::info_text15 [phi:main_vera_flash::@16->display_action_text#0] -- pbuz1=pbuc1 lda #info_text15 sta.z display_action_text.info_text+1 jsr display_action_text - // [1508] phi from main_vera_flash::@16 main_vera_flash::@23 to main_vera_flash::@1 [phi:main_vera_flash::@16/main_vera_flash::@23->main_vera_flash::@1] + // [996] phi from main_vera_flash::@16 main_vera_flash::@23 to main_vera_flash::@1 [phi:main_vera_flash::@16/main_vera_flash::@23->main_vera_flash::@1] // main_vera_flash::@1 __b1: // spi_deselect() - // [1509] call spi_deselect + // [997] call spi_deselect jsr spi_deselect rts - // [1510] phi from main_vera_flash::@14 to main_vera_flash::@15 [phi:main_vera_flash::@14->main_vera_flash::@15] + // [998] phi from main_vera_flash::@14 to main_vera_flash::@15 [phi:main_vera_flash::@14->main_vera_flash::@15] // main_vera_flash::@15 __b15: // vera_detect() - // [1511] call vera_detect - // [2391] phi from main_vera_flash::@15 to vera_detect [phi:main_vera_flash::@15->vera_detect] + // [999] call vera_detect + // [1455] phi from main_vera_flash::@15 to vera_detect [phi:main_vera_flash::@15->vera_detect] jsr vera_detect - // [1512] phi from main_vera_flash::@15 to main_vera_flash::@55 [phi:main_vera_flash::@15->main_vera_flash::@55] + // [1000] phi from main_vera_flash::@15 to main_vera_flash::@55 [phi:main_vera_flash::@15->main_vera_flash::@55] // main_vera_flash::@55 // wait_moment(1) - // [1513] call wait_moment - // [1310] phi from main_vera_flash::@55 to wait_moment [phi:main_vera_flash::@55->wait_moment] - // [1310] phi wait_moment::w#13 = 1 [phi:main_vera_flash::@55->wait_moment#0] -- vbum1=vbuc1 + // [1001] call wait_moment + // [794] phi from main_vera_flash::@55 to wait_moment [phi:main_vera_flash::@55->wait_moment] + // [794] phi wait_moment::w#10 = 1 [phi:main_vera_flash::@55->wait_moment#0] -- vbum1=vbuc1 lda #1 sta wait_moment.w jsr wait_moment // main_vera_flash::@56 // if(spi_manufacturer != 0xEF && spi_memory_type != 0x40 && spi_memory_capacity != 0x15) - // [1514] if(spi_read::return#0==$ef) goto main_vera_flash::@18 -- vbum1_eq_vbuc1_then_la1 + // [1002] if(spi_read::return#0==$ef) goto main_vera_flash::@18 -- vbum1_eq_vbuc1_then_la1 lda #$ef cmp spi_read.return beq __b18 // main_vera_flash::@61 - // [1515] if(spi_read::return#1==$40) goto main_vera_flash::@18 -- vbum1_eq_vbuc1_then_la1 + // [1003] if(spi_read::return#1==$40) goto main_vera_flash::@18 -- vbum1_eq_vbuc1_then_la1 lda #$40 cmp spi_read.return_1 beq __b18 // main_vera_flash::@60 - // [1516] if(spi_read::return#2!=$15) goto main_vera_flash::@17 -- vbum1_neq_vbuc1_then_la1 + // [1004] if(spi_read::return#2!=$15) goto main_vera_flash::@17 -- vbum1_neq_vbuc1_then_la1 lda #$15 cmp spi_read.return_2 bne __b17 // main_vera_flash::@18 __b18: - // [1517] spi_manufacturer#588 = spi_read::return#0 -- vbum1=vbum2 + // [1005] spi_manufacturer#414 = spi_read::return#0 -- vbum1=vbum2 lda spi_read.return sta spi_manufacturer - // [1518] spi_memory_type#589 = spi_read::return#1 -- vbum1=vbum2 + // [1006] spi_memory_type#415 = spi_read::return#1 -- vbum1=vbum2 lda spi_read.return_1 sta spi_memory_type - // [1519] spi_memory_capacity#590 = spi_read::return#2 -- vbum1=vbum2 + // [1007] spi_memory_capacity#416 = spi_read::return#2 -- vbum1=vbum2 lda spi_read.return_2 sta spi_memory_capacity // display_info_vera(STATUS_WAITING, NULL) - // [1520] call display_info_vera - // [998] phi from main_vera_flash::@18 to display_info_vera [phi:main_vera_flash::@18->display_info_vera] - // [998] phi display_info_vera::info_text#19 = 0 [phi:main_vera_flash::@18->display_info_vera#0] -- pbuz1=vbuc1 + // [1008] call display_info_vera + // [653] phi from main_vera_flash::@18 to display_info_vera [phi:main_vera_flash::@18->display_info_vera] + // [653] phi display_info_vera::info_text#19 = 0 [phi:main_vera_flash::@18->display_info_vera#0] -- pbuz1=vbuc1 lda #<0 sta.z display_info_vera.info_text sta.z display_info_vera.info_text+1 - // [998] phi spi_memory_capacity#106 = spi_memory_capacity#590 [phi:main_vera_flash::@18->display_info_vera#1] -- register_copy - // [998] phi spi_memory_type#107 = spi_memory_type#589 [phi:main_vera_flash::@18->display_info_vera#2] -- register_copy - // [998] phi spi_manufacturer#108 = spi_manufacturer#588 [phi:main_vera_flash::@18->display_info_vera#3] -- register_copy - // [998] phi display_info_vera::info_status#19 = STATUS_WAITING [phi:main_vera_flash::@18->display_info_vera#4] -- vbum1=vbuc1 + // [653] phi spi_memory_capacity#110 = spi_memory_capacity#416 [phi:main_vera_flash::@18->display_info_vera#1] -- register_copy + // [653] phi spi_memory_type#111 = spi_memory_type#415 [phi:main_vera_flash::@18->display_info_vera#2] -- register_copy + // [653] phi spi_manufacturer#100 = spi_manufacturer#414 [phi:main_vera_flash::@18->display_info_vera#3] -- register_copy + // [653] phi display_info_vera::info_status#19 = STATUS_WAITING [phi:main_vera_flash::@18->display_info_vera#4] -- vbum1=vbuc1 lda #STATUS_WAITING sta display_info_vera.info_status jsr display_info_vera jmp __b5 // main_vera_flash::@17 __b17: - // [1521] spi_manufacturer#587 = spi_read::return#0 -- vbum1=vbum2 + // [1009] spi_manufacturer#413 = spi_read::return#0 -- vbum1=vbum2 lda spi_read.return sta spi_manufacturer - // [1522] spi_memory_type#588 = spi_read::return#1 -- vbum1=vbum2 + // [1010] spi_memory_type#414 = spi_read::return#1 -- vbum1=vbum2 lda spi_read.return_1 sta spi_memory_type - // [1523] spi_memory_capacity#589 = spi_read::return#2 -- vbum1=vbum2 + // [1011] spi_memory_capacity#415 = spi_read::return#2 -- vbum1=vbum2 lda spi_read.return_2 sta spi_memory_capacity // display_info_vera(STATUS_DETECTED, NULL) - // [1524] call display_info_vera - // [998] phi from main_vera_flash::@17 to display_info_vera [phi:main_vera_flash::@17->display_info_vera] - // [998] phi display_info_vera::info_text#19 = 0 [phi:main_vera_flash::@17->display_info_vera#0] -- pbuz1=vbuc1 + // [1012] call display_info_vera + // [653] phi from main_vera_flash::@17 to display_info_vera [phi:main_vera_flash::@17->display_info_vera] + // [653] phi display_info_vera::info_text#19 = 0 [phi:main_vera_flash::@17->display_info_vera#0] -- pbuz1=vbuc1 lda #<0 sta.z display_info_vera.info_text sta.z display_info_vera.info_text+1 - // [998] phi spi_memory_capacity#106 = spi_memory_capacity#589 [phi:main_vera_flash::@17->display_info_vera#1] -- register_copy - // [998] phi spi_memory_type#107 = spi_memory_type#588 [phi:main_vera_flash::@17->display_info_vera#2] -- register_copy - // [998] phi spi_manufacturer#108 = spi_manufacturer#587 [phi:main_vera_flash::@17->display_info_vera#3] -- register_copy - // [998] phi display_info_vera::info_status#19 = STATUS_DETECTED [phi:main_vera_flash::@17->display_info_vera#4] -- vbum1=vbuc1 + // [653] phi spi_memory_capacity#110 = spi_memory_capacity#415 [phi:main_vera_flash::@17->display_info_vera#1] -- register_copy + // [653] phi spi_memory_type#111 = spi_memory_type#414 [phi:main_vera_flash::@17->display_info_vera#2] -- register_copy + // [653] phi spi_manufacturer#100 = spi_manufacturer#413 [phi:main_vera_flash::@17->display_info_vera#3] -- register_copy + // [653] phi display_info_vera::info_status#19 = STATUS_DETECTED [phi:main_vera_flash::@17->display_info_vera#4] -- vbum1=vbuc1 lda #STATUS_DETECTED sta display_info_vera.info_status jsr display_info_vera // main_vera_flash::@57 // spi_ensure_detect++; - // [1525] main_vera_flash::spi_ensure_detect#4 = ++ main_vera_flash::spi_ensure_detect#12 -- vbuz1=_inc_vbuz1 + // [1013] main_vera_flash::spi_ensure_detect#4 = ++ main_vera_flash::spi_ensure_detect#12 -- vbuz1=_inc_vbuz1 inc.z spi_ensure_detect_1 - // [1504] phi from main_vera_flash::@57 to main_vera_flash::@14 [phi:main_vera_flash::@57->main_vera_flash::@14] - // [1504] phi main_vera_flash::spi_ensure_detect#12 = main_vera_flash::spi_ensure_detect#4 [phi:main_vera_flash::@57->main_vera_flash::@14#0] -- register_copy + // [992] phi from main_vera_flash::@57 to main_vera_flash::@14 [phi:main_vera_flash::@57->main_vera_flash::@14] + // [992] phi main_vera_flash::spi_ensure_detect#12 = main_vera_flash::spi_ensure_detect#4 [phi:main_vera_flash::@57->main_vera_flash::@14#0] -- register_copy jmp __b14 // main_vera_flash::@9 __b9: - // [1526] spi_manufacturer#585 = spi_read::return#0 -- vbum1=vbum2 + // [1014] spi_manufacturer#411 = spi_read::return#0 -- vbum1=vbum2 lda spi_read.return sta spi_manufacturer - // [1527] spi_memory_type#586 = spi_read::return#1 -- vbum1=vbum2 + // [1015] spi_memory_type#412 = spi_read::return#1 -- vbum1=vbum2 lda spi_read.return_1 sta spi_memory_type - // [1528] spi_memory_capacity#587 = spi_read::return#2 -- vbum1=vbum2 + // [1016] spi_memory_capacity#413 = spi_read::return#2 -- vbum1=vbum2 lda spi_read.return_2 sta spi_memory_capacity // display_info_vera(STATUS_SKIP, "No update required") - // [1529] call display_info_vera + // [1017] call display_info_vera // VFL1 | VERA and VERA.BIN equal | Display that there are no differences between the VERA and VERA.BIN. Set VERA to Flashed. | None - // [998] phi from main_vera_flash::@9 to display_info_vera [phi:main_vera_flash::@9->display_info_vera] - // [998] phi display_info_vera::info_text#19 = info_text6 [phi:main_vera_flash::@9->display_info_vera#0] -- pbuz1=pbuc1 + // [653] phi from main_vera_flash::@9 to display_info_vera [phi:main_vera_flash::@9->display_info_vera] + // [653] phi display_info_vera::info_text#19 = main_vera_flash::info_text6 [phi:main_vera_flash::@9->display_info_vera#0] -- pbuz1=pbuc1 lda #info_text6 sta.z display_info_vera.info_text+1 - // [998] phi spi_memory_capacity#106 = spi_memory_capacity#587 [phi:main_vera_flash::@9->display_info_vera#1] -- register_copy - // [998] phi spi_memory_type#107 = spi_memory_type#586 [phi:main_vera_flash::@9->display_info_vera#2] -- register_copy - // [998] phi spi_manufacturer#108 = spi_manufacturer#585 [phi:main_vera_flash::@9->display_info_vera#3] -- register_copy - // [998] phi display_info_vera::info_status#19 = STATUS_SKIP [phi:main_vera_flash::@9->display_info_vera#4] -- vbum1=vbuc1 + // [653] phi spi_memory_capacity#110 = spi_memory_capacity#413 [phi:main_vera_flash::@9->display_info_vera#1] -- register_copy + // [653] phi spi_memory_type#111 = spi_memory_type#412 [phi:main_vera_flash::@9->display_info_vera#2] -- register_copy + // [653] phi spi_manufacturer#100 = spi_manufacturer#411 [phi:main_vera_flash::@9->display_info_vera#3] -- register_copy + // [653] phi display_info_vera::info_status#19 = STATUS_SKIP [phi:main_vera_flash::@9->display_info_vera#4] -- vbum1=vbuc1 lda #STATUS_SKIP sta display_info_vera.info_status jsr display_info_vera jmp __b13 - // [1530] phi from main_vera_flash::@3 to main_vera_flash::@4 [phi:main_vera_flash::@3->main_vera_flash::@4] + // [1018] phi from main_vera_flash::@3 to main_vera_flash::@4 [phi:main_vera_flash::@3->main_vera_flash::@4] // main_vera_flash::@4 __b4: // vera_detect() - // [1531] call vera_detect - // [2391] phi from main_vera_flash::@4 to vera_detect [phi:main_vera_flash::@4->vera_detect] + // [1019] call vera_detect + // [1455] phi from main_vera_flash::@4 to vera_detect [phi:main_vera_flash::@4->vera_detect] jsr vera_detect - // [1532] phi from main_vera_flash::@4 to main_vera_flash::@26 [phi:main_vera_flash::@4->main_vera_flash::@26] + // [1020] phi from main_vera_flash::@4 to main_vera_flash::@26 [phi:main_vera_flash::@4->main_vera_flash::@26] // main_vera_flash::@26 // wait_moment(1) - // [1533] call wait_moment - // [1310] phi from main_vera_flash::@26 to wait_moment [phi:main_vera_flash::@26->wait_moment] - // [1310] phi wait_moment::w#13 = 1 [phi:main_vera_flash::@26->wait_moment#0] -- vbum1=vbuc1 + // [1021] call wait_moment + // [794] phi from main_vera_flash::@26 to wait_moment [phi:main_vera_flash::@26->wait_moment] + // [794] phi wait_moment::w#10 = 1 [phi:main_vera_flash::@26->wait_moment#0] -- vbum1=vbuc1 lda #1 sta wait_moment.w jsr wait_moment // main_vera_flash::@27 // if(spi_manufacturer == 0xEF && spi_memory_type == 0x40 && spi_memory_capacity == 0x15) - // [1534] if(spi_read::return#0!=$ef) goto main_vera_flash::@7 -- vbum1_neq_vbuc1_then_la1 + // [1022] if(spi_read::return#0!=$ef) goto main_vera_flash::@7 -- vbum1_neq_vbuc1_then_la1 lda #$ef cmp spi_read.return bne __b7 // main_vera_flash::@59 - // [1535] if(spi_read::return#1!=$40) goto main_vera_flash::@7 -- vbum1_neq_vbuc1_then_la1 + // [1023] if(spi_read::return#1!=$40) goto main_vera_flash::@7 -- vbum1_neq_vbuc1_then_la1 lda #$40 cmp spi_read.return_1 bne __b7 // main_vera_flash::@58 - // [1536] if(spi_read::return#2==$15) goto main_vera_flash::@6 -- vbum1_eq_vbuc1_then_la1 + // [1024] if(spi_read::return#2==$15) goto main_vera_flash::@6 -- vbum1_eq_vbuc1_then_la1 lda #$15 cmp spi_read.return_2 beq __b6 // main_vera_flash::@7 __b7: - // [1537] spi_manufacturer#595 = spi_read::return#0 -- vbum1=vbum2 + // [1025] spi_manufacturer#421 = spi_read::return#0 -- vbum1=vbum2 lda spi_read.return sta spi_manufacturer - // [1538] spi_memory_type#596 = spi_read::return#1 -- vbum1=vbum2 + // [1026] spi_memory_type#422 = spi_read::return#1 -- vbum1=vbum2 lda spi_read.return_1 sta spi_memory_type - // [1539] spi_memory_capacity#597 = spi_read::return#2 -- vbum1=vbum2 + // [1027] spi_memory_capacity#423 = spi_read::return#2 -- vbum1=vbum2 lda spi_read.return_2 sta spi_memory_capacity // display_info_vera(STATUS_WAITING, "Close JP1 jumper pins!") - // [1540] call display_info_vera - // [998] phi from main_vera_flash::@7 to display_info_vera [phi:main_vera_flash::@7->display_info_vera] - // [998] phi display_info_vera::info_text#19 = main_vera_flash::info_text5 [phi:main_vera_flash::@7->display_info_vera#0] -- pbuz1=pbuc1 + // [1028] call display_info_vera + // [653] phi from main_vera_flash::@7 to display_info_vera [phi:main_vera_flash::@7->display_info_vera] + // [653] phi display_info_vera::info_text#19 = main_vera_flash::info_text5 [phi:main_vera_flash::@7->display_info_vera#0] -- pbuz1=pbuc1 lda #info_text5 sta.z display_info_vera.info_text+1 - // [998] phi spi_memory_capacity#106 = spi_memory_capacity#597 [phi:main_vera_flash::@7->display_info_vera#1] -- register_copy - // [998] phi spi_memory_type#107 = spi_memory_type#596 [phi:main_vera_flash::@7->display_info_vera#2] -- register_copy - // [998] phi spi_manufacturer#108 = spi_manufacturer#595 [phi:main_vera_flash::@7->display_info_vera#3] -- register_copy - // [998] phi display_info_vera::info_status#19 = STATUS_WAITING [phi:main_vera_flash::@7->display_info_vera#4] -- vbum1=vbuc1 + // [653] phi spi_memory_capacity#110 = spi_memory_capacity#423 [phi:main_vera_flash::@7->display_info_vera#1] -- register_copy + // [653] phi spi_memory_type#111 = spi_memory_type#422 [phi:main_vera_flash::@7->display_info_vera#2] -- register_copy + // [653] phi spi_manufacturer#100 = spi_manufacturer#421 [phi:main_vera_flash::@7->display_info_vera#3] -- register_copy + // [653] phi display_info_vera::info_status#19 = STATUS_WAITING [phi:main_vera_flash::@7->display_info_vera#4] -- vbum1=vbuc1 lda #STATUS_WAITING sta display_info_vera.info_status jsr display_info_vera jmp __b2 // main_vera_flash::@6 __b6: - // [1541] spi_manufacturer#593 = spi_read::return#0 -- vbum1=vbum2 + // [1029] spi_manufacturer#419 = spi_read::return#0 -- vbum1=vbum2 lda spi_read.return sta spi_manufacturer - // [1542] spi_memory_type#594 = spi_read::return#1 -- vbum1=vbum2 + // [1030] spi_memory_type#420 = spi_read::return#1 -- vbum1=vbum2 lda spi_read.return_1 sta spi_memory_type - // [1543] spi_memory_capacity#595 = spi_read::return#2 -- vbum1=vbum2 + // [1031] spi_memory_capacity#421 = spi_read::return#2 -- vbum1=vbum2 lda spi_read.return_2 sta spi_memory_capacity // display_info_vera(STATUS_DETECTED, "JP1 jumper pins closed!") - // [1544] call display_info_vera - // [998] phi from main_vera_flash::@6 to display_info_vera [phi:main_vera_flash::@6->display_info_vera] - // [998] phi display_info_vera::info_text#19 = main_vera_flash::info_text4 [phi:main_vera_flash::@6->display_info_vera#0] -- pbuz1=pbuc1 + // [1032] call display_info_vera + // [653] phi from main_vera_flash::@6 to display_info_vera [phi:main_vera_flash::@6->display_info_vera] + // [653] phi display_info_vera::info_text#19 = main_vera_flash::info_text4 [phi:main_vera_flash::@6->display_info_vera#0] -- pbuz1=pbuc1 lda #info_text4 sta.z display_info_vera.info_text+1 - // [998] phi spi_memory_capacity#106 = spi_memory_capacity#595 [phi:main_vera_flash::@6->display_info_vera#1] -- register_copy - // [998] phi spi_memory_type#107 = spi_memory_type#594 [phi:main_vera_flash::@6->display_info_vera#2] -- register_copy - // [998] phi spi_manufacturer#108 = spi_manufacturer#593 [phi:main_vera_flash::@6->display_info_vera#3] -- register_copy - // [998] phi display_info_vera::info_status#19 = STATUS_DETECTED [phi:main_vera_flash::@6->display_info_vera#4] -- vbum1=vbuc1 + // [653] phi spi_memory_capacity#110 = spi_memory_capacity#421 [phi:main_vera_flash::@6->display_info_vera#1] -- register_copy + // [653] phi spi_memory_type#111 = spi_memory_type#420 [phi:main_vera_flash::@6->display_info_vera#2] -- register_copy + // [653] phi spi_manufacturer#100 = spi_manufacturer#419 [phi:main_vera_flash::@6->display_info_vera#3] -- register_copy + // [653] phi display_info_vera::info_status#19 = STATUS_DETECTED [phi:main_vera_flash::@6->display_info_vera#4] -- vbum1=vbuc1 lda #STATUS_DETECTED sta display_info_vera.info_status jsr display_info_vera // main_vera_flash::@32 // spi_ensure_detect++; - // [1545] main_vera_flash::spi_ensure_detect#1 = ++ main_vera_flash::spi_ensure_detect#11 -- vbuz1=_inc_vbuz1 + // [1033] main_vera_flash::spi_ensure_detect#1 = ++ main_vera_flash::spi_ensure_detect#11 -- vbuz1=_inc_vbuz1 inc.z spi_ensure_detect - // [1413] phi from main_vera_flash::@32 to main_vera_flash::@3 [phi:main_vera_flash::@32->main_vera_flash::@3] - // [1413] phi main_vera_flash::spi_ensure_detect#11 = main_vera_flash::spi_ensure_detect#1 [phi:main_vera_flash::@32->main_vera_flash::@3#0] -- register_copy + // [901] phi from main_vera_flash::@32 to main_vera_flash::@3 [phi:main_vera_flash::@32->main_vera_flash::@3] + // [901] phi main_vera_flash::spi_ensure_detect#11 = main_vera_flash::spi_ensure_detect#1 [phi:main_vera_flash::@32->main_vera_flash::@3#0] -- register_copy jmp __b3 .segment DataVera s: .text "Reading VERA.BIN ... (.) data ( ) empty" @@ -10224,6 +6501,10 @@ main_vera_flash: { .byte 0 info_text5: .text "Close JP1 jumper pins!" .byte 0 + info_text6: .text "No update required" + .byte 0 + s1: .text " differences!" + .byte 0 info_text8: .text "DO NOT RESET or REBOOT YOUR CX16 AND WAIT!" .byte 0 s2: .text " bytes flashed!" @@ -10238,278 +6519,458 @@ main_vera_flash: { .byte 0 info_text15: .text "The jumper JP1 has been opened on the VERA!" .byte 0 - vera_differences: .dword 0 - vera_flashed: .dword 0 } .segment Code - // display_info_rom + // util_wait_key /** - * @brief Display the ROM status of a specific rom chip. + * @brief * - * @param rom_chip The ROM chip, 0 is the main CX16 ROM chip, maximum 7 ROMs. - * @param info_status The status. - * @param info_text The status text. - */ -// void display_info_rom(__mem() char rom_chip, __mem() char info_status, __zp($3f) char *info_text) + * @param info_text + * @param filter + * @return unsigned char + */ +// __mem() char util_wait_key(__zp($59) char *info_text, __zp($5f) char *filter) +util_wait_key: { + .const bank_set_bram1_bank = 0 + .const bank_set_brom1_bank = 4 + .label util_wait_key__9 = $42 + .label info_text = $59 + .label filter = $5f + // display_action_text(info_text) + // [1035] display_action_text::info_text#5 = util_wait_key::info_text#3 + // [1036] call display_action_text + // [845] phi from util_wait_key to display_action_text [phi:util_wait_key->display_action_text] + // [845] phi display_action_text::info_text#17 = display_action_text::info_text#5 [phi:util_wait_key->display_action_text#0] -- register_copy + jsr display_action_text + // util_wait_key::bank_get_bram1 + // return BRAM; + // [1037] util_wait_key::bram#0 = BRAM -- vbum1=vbuz2 + lda.z BRAM + sta bram + // util_wait_key::bank_get_brom1 + // return BROM; + // [1038] util_wait_key::bank_get_brom1_return#0 = BROM -- vbum1=vbuz2 + lda.z BROM + sta bank_get_brom1_return + // util_wait_key::bank_set_bram1 + // BRAM = bank + // [1039] BRAM = util_wait_key::bank_set_bram1_bank#0 -- vbuz1=vbuc1 + lda #bank_set_bram1_bank + sta.z BRAM + // util_wait_key::bank_set_brom1 + // BROM = bank + // [1040] BROM = util_wait_key::bank_set_brom1_bank#0 -- vbuz1=vbuc1 + lda #bank_set_brom1_bank + sta.z BROM + // [1041] phi from util_wait_key::@2 util_wait_key::@5 util_wait_key::bank_set_brom1 to util_wait_key::kbhit1 [phi:util_wait_key::@2/util_wait_key::@5/util_wait_key::bank_set_brom1->util_wait_key::kbhit1] + // util_wait_key::kbhit1 + kbhit1: + // util_wait_key::kbhit1_cbm_k_clrchn1 + // asm + // asm { jsrCBM_CLRCHN } + jsr CBM_CLRCHN + // [1043] phi from util_wait_key::kbhit1_cbm_k_clrchn1 to util_wait_key::kbhit1_@2 [phi:util_wait_key::kbhit1_cbm_k_clrchn1->util_wait_key::kbhit1_@2] + // util_wait_key::kbhit1_@2 + // cbm_k_getin() + // [1044] call cbm_k_getin + jsr cbm_k_getin + // [1045] cbm_k_getin::return#2 = cbm_k_getin::return#1 + // util_wait_key::@4 + // [1046] util_wait_key::ch#4 = cbm_k_getin::return#2 -- vwum1=vbum2 + lda cbm_k_getin.return + sta ch + lda #0 + sta ch+1 + // util_wait_key::@3 + // if (filter) + // [1047] if((char *)0!=util_wait_key::filter#13) goto util_wait_key::@1 -- pbuc1_neq_pbuz1_then_la1 + // if there is a filter, check the filter, otherwise return ch. + lda.z filter+1 + cmp #>0 + bne __b1 + lda.z filter + cmp #<0 + bne __b1 + // util_wait_key::@2 + // if(ch) + // [1048] if(0!=util_wait_key::ch#4) goto util_wait_key::bank_set_bram2 -- 0_neq_vwum1_then_la1 + lda ch + ora ch+1 + bne bank_set_bram2 + jmp kbhit1 + // util_wait_key::bank_set_bram2 + bank_set_bram2: + // BRAM = bank + // [1049] BRAM = util_wait_key::bram#0 -- vbuz1=vbum2 + lda bram + sta.z BRAM + // util_wait_key::bank_set_brom2 + // BROM = bank + // [1050] BROM = util_wait_key::bank_get_brom1_return#0 -- vbuz1=vbum2 + lda bank_get_brom1_return + sta.z BROM + // util_wait_key::@return + // } + // [1051] return + rts + // util_wait_key::@1 + __b1: + // strchr(filter, ch) + // [1052] strchr::str#0 = (const void *)util_wait_key::filter#13 -- pvoz1=pvoz2 + lda.z filter + sta.z strchr.str + lda.z filter+1 + sta.z strchr.str+1 + // [1053] strchr::c#0 = util_wait_key::ch#4 -- vbum1=vwum2 + lda ch + sta strchr.c + // [1054] call strchr + // [1058] phi from util_wait_key::@1 to strchr [phi:util_wait_key::@1->strchr] + // [1058] phi strchr::c#4 = strchr::c#0 [phi:util_wait_key::@1->strchr#0] -- register_copy + // [1058] phi strchr::str#2 = strchr::str#0 [phi:util_wait_key::@1->strchr#1] -- register_copy + jsr strchr + // strchr(filter, ch) + // [1055] strchr::return#3 = strchr::return#2 + // util_wait_key::@5 + // [1056] util_wait_key::$9 = strchr::return#3 + // if(strchr(filter, ch) != NULL) + // [1057] if(util_wait_key::$9!=0) goto util_wait_key::bank_set_bram2 -- pvoz1_neq_0_then_la1 + lda.z util_wait_key__9 + ora.z util_wait_key__9+1 + bne bank_set_bram2 + jmp kbhit1 + .segment Data + bram: .byte 0 + bank_get_brom1_return: .byte 0 + return: .byte 0 + return_1: .byte 0 + ch: .word 0 +} +.segment Code + // strchr +// Searches for the first occurrence of the character c (an unsigned char) in the string pointed to, by the argument str. +// - 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($42) void * strchr(__zp($42) const void *str, __mem() char c) +strchr: { + .label ptr = $42 + .label return = $42 + .label str = $42 + // [1059] strchr::ptr#6 = (char *)strchr::str#2 + // [1060] phi from strchr strchr::@3 to strchr::@1 [phi:strchr/strchr::@3->strchr::@1] + // [1060] phi strchr::ptr#2 = strchr::ptr#6 [phi:strchr/strchr::@3->strchr::@1#0] -- register_copy + // strchr::@1 + __b1: + // while(*ptr) + // [1061] if(0!=*strchr::ptr#2) goto strchr::@2 -- 0_neq__deref_pbuz1_then_la1 + ldy #0 + lda (ptr),y + cmp #0 + bne __b2 + // [1062] phi from strchr::@1 to strchr::@return [phi:strchr::@1->strchr::@return] + // [1062] phi strchr::return#2 = (void *) 0 [phi:strchr::@1->strchr::@return#0] -- pvoz1=pvoc1 + tya + sta.z return + sta.z return+1 + // strchr::@return + // } + // [1063] return + rts + // strchr::@2 + __b2: + // if(*ptr==c) + // [1064] if(*strchr::ptr#2!=strchr::c#4) goto strchr::@3 -- _deref_pbuz1_neq_vbum2_then_la1 + ldy #0 + lda (ptr),y + cmp c + bne __b3 + // strchr::@4 + // [1065] strchr::return#8 = (void *)strchr::ptr#2 + // [1062] phi from strchr::@4 to strchr::@return [phi:strchr::@4->strchr::@return] + // [1062] phi strchr::return#2 = strchr::return#8 [phi:strchr::@4->strchr::@return#0] -- register_copy + rts + // strchr::@3 + __b3: + // ptr++; + // [1066] strchr::ptr#1 = ++ strchr::ptr#2 -- pbuz1=_inc_pbuz1 + inc.z ptr + bne !+ + inc.z ptr+1 + !: + jmp __b1 + .segment Data + c: .byte 0 +} +.segment Code + // display_info_rom +/** + * @brief Display the ROM status of a specific rom chip. + * + * @param rom_chip The ROM chip, 0 is the main CX16 ROM chip, maximum 7 ROMs. + * @param info_status The status. + * @param info_text The status text. + */ +// void display_info_rom(__mem() char rom_chip, __mem() char info_status, __zp($3c) char *info_text) display_info_rom: { - .label display_info_rom__6 = $68 - .label display_info_rom__15 = $78 - .label display_info_rom__16 = $41 - .label info_text = $3f - .label display_info_rom__19 = $68 - .label display_info_rom__20 = $68 + .label display_info_rom__6 = $38 + .label display_info_rom__15 = $4e + .label display_info_rom__16 = $3b + .label info_text = $3c + .label display_info_rom__19 = $38 + .label display_info_rom__20 = $38 // unsigned char x = wherex() - // [1547] call wherex + // [1068] call wherex jsr wherex - // [1548] wherex::return#12 = wherex::return#0 -- vbum1=vbum2 + // [1069] wherex::return#12 = wherex::return#0 -- vbum1=vbum2 lda wherex.return sta wherex.return_4 // display_info_rom::@3 - // [1549] display_info_rom::x#0 = wherex::return#12 + // [1070] display_info_rom::x#0 = wherex::return#12 // unsigned char y = wherey() - // [1550] call wherey + // [1071] call wherey jsr wherey - // [1551] wherey::return#12 = wherey::return#0 -- vbum1=vbum2 + // [1072] wherey::return#12 = wherey::return#0 -- vbum1=vbum2 lda wherey.return sta wherey.return_4 // display_info_rom::@4 - // [1552] display_info_rom::y#0 = wherey::return#12 + // [1073] display_info_rom::y#0 = wherey::return#12 // status_rom[rom_chip] = info_status - // [1553] status_rom[display_info_rom::rom_chip#17] = display_info_rom::info_status#17 -- pbuc1_derefidx_vbum1=vbum2 + // [1074] status_rom[display_info_rom::rom_chip#10] = display_info_rom::info_status#10 -- pbuc1_derefidx_vbum1=vbum2 lda info_status ldy rom_chip sta status_rom,y // display_rom_led(rom_chip, status_color[info_status]) - // [1554] display_rom_led::chip#1 = display_info_rom::rom_chip#17 -- vbum1=vbum2 + // [1075] display_rom_led::chip#1 = display_info_rom::rom_chip#10 -- vbum1=vbum2 tya sta display_rom_led.chip - // [1555] display_rom_led::c#1 = status_color[display_info_rom::info_status#17] -- vbum1=pbuc1_derefidx_vbum2 + // [1076] display_rom_led::c#1 = status_color[display_info_rom::info_status#10] -- vbum1=pbuc1_derefidx_vbum2 ldy info_status lda status_color,y sta display_rom_led.c - // [1556] call display_rom_led - // [2369] phi from display_info_rom::@4 to display_rom_led [phi:display_info_rom::@4->display_rom_led] - // [2369] phi display_rom_led::c#2 = display_rom_led::c#1 [phi:display_info_rom::@4->display_rom_led#0] -- register_copy - // [2369] phi display_rom_led::chip#2 = display_rom_led::chip#1 [phi:display_info_rom::@4->display_rom_led#1] -- register_copy + // [1077] call display_rom_led + // [1422] phi from display_info_rom::@4 to display_rom_led [phi:display_info_rom::@4->display_rom_led] + // [1422] phi display_rom_led::c#2 = display_rom_led::c#1 [phi:display_info_rom::@4->display_rom_led#0] -- register_copy + // [1422] phi display_rom_led::chip#2 = display_rom_led::chip#1 [phi:display_info_rom::@4->display_rom_led#1] -- register_copy jsr display_rom_led // display_info_rom::@5 // gotoxy(INFO_X, INFO_Y+rom_chip+2) - // [1557] gotoxy::y#23 = display_info_rom::rom_chip#17 + $11+2 -- vbum1=vbum2_plus_vbuc1 + // [1078] gotoxy::y#23 = display_info_rom::rom_chip#10 + $11+2 -- vbum1=vbum2_plus_vbuc1 lda #$11+2 clc adc rom_chip sta gotoxy.y - // [1558] call gotoxy - // [802] phi from display_info_rom::@5 to gotoxy [phi:display_info_rom::@5->gotoxy] - // [802] phi gotoxy::y#37 = gotoxy::y#23 [phi:display_info_rom::@5->gotoxy#0] -- register_copy - // [802] phi gotoxy::x#37 = 4 [phi:display_info_rom::@5->gotoxy#1] -- vbum1=vbuc1 + // [1079] call gotoxy + // [457] phi from display_info_rom::@5 to gotoxy [phi:display_info_rom::@5->gotoxy] + // [457] phi gotoxy::y#26 = gotoxy::y#23 [phi:display_info_rom::@5->gotoxy#0] -- register_copy + // [457] phi gotoxy::x#26 = 4 [phi:display_info_rom::@5->gotoxy#1] -- vbum1=vbuc1 lda #4 sta gotoxy.x 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]) - // [1559] display_info_rom::$16 = display_info_rom::rom_chip#17 << 1 -- vbuz1=vbum2_rol_1 + // [1080] display_info_rom::$16 = display_info_rom::rom_chip#10 << 1 -- vbuz1=vbum2_rol_1 lda rom_chip asl sta.z display_info_rom__16 // rom_chip*13 - // [1560] display_info_rom::$19 = display_info_rom::$16 + display_info_rom::rom_chip#17 -- vbuz1=vbuz2_plus_vbum3 + // [1081] display_info_rom::$19 = display_info_rom::$16 + display_info_rom::rom_chip#10 -- vbuz1=vbuz2_plus_vbum3 lda rom_chip clc adc.z display_info_rom__16 sta.z display_info_rom__19 - // [1561] display_info_rom::$20 = display_info_rom::$19 << 2 -- vbuz1=vbuz1_rol_2 + // [1082] display_info_rom::$20 = display_info_rom::$19 << 2 -- vbuz1=vbuz1_rol_2 lda.z display_info_rom__20 asl asl sta.z display_info_rom__20 - // [1562] display_info_rom::$6 = display_info_rom::$20 + display_info_rom::rom_chip#17 -- vbuz1=vbuz1_plus_vbum2 + // [1083] display_info_rom::$6 = display_info_rom::$20 + display_info_rom::rom_chip#10 -- vbuz1=vbuz1_plus_vbum2 lda rom_chip clc adc.z display_info_rom__6 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]) - // [1563] printf_string::str#10 = rom_release_text + display_info_rom::$6 -- pbuz1=pbuc1_plus_vbuz2 + // [1084] printf_string::str#10 = rom_release_text + display_info_rom::$6 -- pbuz1=pbuc1_plus_vbuz2 clc adc #rom_release_text adc #0 sta.z printf_string.str_1+1 - // [1564] call printf_str - // [1210] phi from display_info_rom::@6 to printf_str [phi:display_info_rom::@6->printf_str] - // [1210] phi printf_str::putc#84 = &cputc [phi:display_info_rom::@6->printf_str#0] -- pprz1=pprc1 + // [1085] call printf_str + // [785] phi from display_info_rom::@6 to printf_str [phi:display_info_rom::@6->printf_str] + // [785] phi printf_str::putc#53 = &cputc [phi:display_info_rom::@6->printf_str#0] -- pprz1=pprc1 lda #cputc sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = chip [phi:display_info_rom::@6->printf_str#1] -- pbuz1=pbuc1 - lda #printf_str#1] -- pbuz1=pbuc1 + lda #chip + lda #>s sta.z printf_str.s+1 jsr printf_str // display_info_rom::@7 // printf("ROM%u %-9s %-6s %-13s ", rom_chip, status_text[info_status], rom_device_names[rom_chip], &rom_release_text[rom_chip*13]) - // [1565] printf_uchar::uvalue#4 = display_info_rom::rom_chip#17 -- vbum1=vbum2 + // [1086] printf_uchar::uvalue#4 = display_info_rom::rom_chip#10 -- vbum1=vbum2 lda rom_chip sta printf_uchar.uvalue - // [1566] call printf_uchar - // [1346] phi from display_info_rom::@7 to printf_uchar [phi:display_info_rom::@7->printf_uchar] - // [1346] phi printf_uchar::format_zero_padding#18 = 0 [phi:display_info_rom::@7->printf_uchar#0] -- vbum1=vbuc1 + // [1087] call printf_uchar + // [834] phi from display_info_rom::@7 to printf_uchar [phi:display_info_rom::@7->printf_uchar] + // [834] phi printf_uchar::format_zero_padding#10 = 0 [phi:display_info_rom::@7->printf_uchar#0] -- vbum1=vbuc1 lda #0 sta printf_uchar.format_zero_padding - // [1346] phi printf_uchar::format_min_length#18 = 0 [phi:display_info_rom::@7->printf_uchar#1] -- vbum1=vbuc1 + // [834] phi printf_uchar::format_min_length#10 = 0 [phi:display_info_rom::@7->printf_uchar#1] -- vbum1=vbuc1 sta printf_uchar.format_min_length - // [1346] phi printf_uchar::putc#18 = &cputc [phi:display_info_rom::@7->printf_uchar#2] -- pprz1=pprc1 + // [834] phi printf_uchar::putc#10 = &cputc [phi:display_info_rom::@7->printf_uchar#2] -- pprz1=pprc1 lda #cputc sta.z printf_uchar.putc+1 - // [1346] phi printf_uchar::format_radix#18 = DECIMAL [phi:display_info_rom::@7->printf_uchar#3] -- vbum1=vbuc1 + // [834] phi printf_uchar::format_radix#10 = DECIMAL [phi:display_info_rom::@7->printf_uchar#3] -- vbum1=vbuc1 lda #DECIMAL sta printf_uchar.format_radix - // [1346] phi printf_uchar::uvalue#18 = printf_uchar::uvalue#4 [phi:display_info_rom::@7->printf_uchar#4] -- register_copy + // [834] phi printf_uchar::uvalue#10 = printf_uchar::uvalue#4 [phi:display_info_rom::@7->printf_uchar#4] -- register_copy jsr printf_uchar - // [1567] phi from display_info_rom::@7 to display_info_rom::@8 [phi:display_info_rom::@7->display_info_rom::@8] + // [1088] phi from display_info_rom::@7 to display_info_rom::@8 [phi:display_info_rom::@7->display_info_rom::@8] // display_info_rom::@8 // printf("ROM%u %-9s %-6s %-13s ", rom_chip, status_text[info_status], rom_device_names[rom_chip], &rom_release_text[rom_chip*13]) - // [1568] call printf_str - // [1210] phi from display_info_rom::@8 to printf_str [phi:display_info_rom::@8->printf_str] - // [1210] phi printf_str::putc#84 = &cputc [phi:display_info_rom::@8->printf_str#0] -- pprz1=pprc1 + // [1089] call printf_str + // [785] phi from display_info_rom::@8 to printf_str [phi:display_info_rom::@8->printf_str] + // [785] phi printf_str::putc#53 = &cputc [phi:display_info_rom::@8->printf_str#0] -- pprz1=pprc1 lda #cputc sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = s4 [phi:display_info_rom::@8->printf_str#1] -- pbuz1=pbuc1 - lda #printf_str#1] -- pbuz1=pbuc1 + lda #<@s sta.z printf_str.s - lda #>s4 + lda #>@s sta.z printf_str.s+1 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]) - // [1569] display_info_rom::$15 = display_info_rom::info_status#17 << 1 -- vbuz1=vbum2_rol_1 + // [1090] display_info_rom::$15 = display_info_rom::info_status#10 << 1 -- vbuz1=vbum2_rol_1 lda info_status asl sta.z display_info_rom__15 - // [1570] printf_string::str#8 = status_text[display_info_rom::$15] -- pbuz1=qbuc1_derefidx_vbuz2 + // [1091] printf_string::str#8 = status_text[display_info_rom::$15] -- pbuz1=qbuc1_derefidx_vbuz2 tay lda status_text,y sta.z printf_string.str lda status_text+1,y sta.z printf_string.str+1 - // [1571] call printf_string - // [1219] phi from display_info_rom::@9 to printf_string [phi:display_info_rom::@9->printf_string] - // [1219] phi printf_string::putc#26 = &cputc [phi:display_info_rom::@9->printf_string#0] -- pprz1=pprc1 + // [1092] call printf_string + // [1308] phi from display_info_rom::@9 to printf_string [phi:display_info_rom::@9->printf_string] + // [1308] phi printf_string::putc#17 = &cputc [phi:display_info_rom::@9->printf_string#0] -- pprz1=pprc1 lda #cputc sta.z printf_string.putc+1 - // [1219] phi printf_string::str#26 = printf_string::str#8 [phi:display_info_rom::@9->printf_string#1] -- register_copy - // [1219] phi printf_string::format_justify_left#26 = 1 [phi:display_info_rom::@9->printf_string#2] -- vbum1=vbuc1 + // [1308] phi printf_string::str#17 = printf_string::str#8 [phi:display_info_rom::@9->printf_string#1] -- register_copy + // [1308] phi printf_string::format_justify_left#17 = 1 [phi:display_info_rom::@9->printf_string#2] -- vbum1=vbuc1 lda #1 sta printf_string.format_justify_left - // [1219] phi printf_string::format_min_length#26 = 9 [phi:display_info_rom::@9->printf_string#3] -- vbum1=vbuc1 + // [1308] phi printf_string::format_min_length#17 = 9 [phi:display_info_rom::@9->printf_string#3] -- vbum1=vbuc1 lda #9 sta printf_string.format_min_length jsr printf_string - // [1572] phi from display_info_rom::@9 to display_info_rom::@10 [phi:display_info_rom::@9->display_info_rom::@10] + // [1093] phi from display_info_rom::@9 to display_info_rom::@10 [phi:display_info_rom::@9->display_info_rom::@10] // display_info_rom::@10 // printf("ROM%u %-9s %-6s %-13s ", rom_chip, status_text[info_status], rom_device_names[rom_chip], &rom_release_text[rom_chip*13]) - // [1573] call printf_str - // [1210] phi from display_info_rom::@10 to printf_str [phi:display_info_rom::@10->printf_str] - // [1210] phi printf_str::putc#84 = &cputc [phi:display_info_rom::@10->printf_str#0] -- pprz1=pprc1 + // [1094] call printf_str + // [785] phi from display_info_rom::@10 to printf_str [phi:display_info_rom::@10->printf_str] + // [785] phi printf_str::putc#53 = &cputc [phi:display_info_rom::@10->printf_str#0] -- pprz1=pprc1 lda #cputc sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = s4 [phi:display_info_rom::@10->printf_str#1] -- pbuz1=pbuc1 - lda #printf_str#1] -- pbuz1=pbuc1 + lda #<@s sta.z printf_str.s - lda #>s4 + lda #>@s sta.z printf_str.s+1 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]) - // [1574] printf_string::str#9 = rom_device_names[display_info_rom::$16] -- pbuz1=qbuc1_derefidx_vbuz2 + // [1095] printf_string::str#9 = rom_device_names[display_info_rom::$16] -- pbuz1=qbuc1_derefidx_vbuz2 ldy.z display_info_rom__16 lda rom_device_names,y sta.z printf_string.str lda rom_device_names+1,y sta.z printf_string.str+1 - // [1575] call printf_string - // [1219] phi from display_info_rom::@11 to printf_string [phi:display_info_rom::@11->printf_string] - // [1219] phi printf_string::putc#26 = &cputc [phi:display_info_rom::@11->printf_string#0] -- pprz1=pprc1 + // [1096] call printf_string + // [1308] phi from display_info_rom::@11 to printf_string [phi:display_info_rom::@11->printf_string] + // [1308] phi printf_string::putc#17 = &cputc [phi:display_info_rom::@11->printf_string#0] -- pprz1=pprc1 lda #cputc sta.z printf_string.putc+1 - // [1219] phi printf_string::str#26 = printf_string::str#9 [phi:display_info_rom::@11->printf_string#1] -- register_copy - // [1219] phi printf_string::format_justify_left#26 = 1 [phi:display_info_rom::@11->printf_string#2] -- vbum1=vbuc1 + // [1308] phi printf_string::str#17 = printf_string::str#9 [phi:display_info_rom::@11->printf_string#1] -- register_copy + // [1308] phi printf_string::format_justify_left#17 = 1 [phi:display_info_rom::@11->printf_string#2] -- vbum1=vbuc1 lda #1 sta printf_string.format_justify_left - // [1219] phi printf_string::format_min_length#26 = 6 [phi:display_info_rom::@11->printf_string#3] -- vbum1=vbuc1 + // [1308] phi printf_string::format_min_length#17 = 6 [phi:display_info_rom::@11->printf_string#3] -- vbum1=vbuc1 lda #6 sta printf_string.format_min_length jsr printf_string - // [1576] phi from display_info_rom::@11 to display_info_rom::@12 [phi:display_info_rom::@11->display_info_rom::@12] + // [1097] phi from display_info_rom::@11 to display_info_rom::@12 [phi:display_info_rom::@11->display_info_rom::@12] // display_info_rom::@12 // printf("ROM%u %-9s %-6s %-13s ", rom_chip, status_text[info_status], rom_device_names[rom_chip], &rom_release_text[rom_chip*13]) - // [1577] call printf_str - // [1210] phi from display_info_rom::@12 to printf_str [phi:display_info_rom::@12->printf_str] - // [1210] phi printf_str::putc#84 = &cputc [phi:display_info_rom::@12->printf_str#0] -- pprz1=pprc1 + // [1098] call printf_str + // [785] phi from display_info_rom::@12 to printf_str [phi:display_info_rom::@12->printf_str] + // [785] phi printf_str::putc#53 = &cputc [phi:display_info_rom::@12->printf_str#0] -- pprz1=pprc1 lda #cputc sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = s4 [phi:display_info_rom::@12->printf_str#1] -- pbuz1=pbuc1 - lda #printf_str#1] -- pbuz1=pbuc1 + lda #<@s sta.z printf_str.s - lda #>s4 + lda #>@s sta.z printf_str.s+1 jsr printf_str // display_info_rom::@13 - // [1578] printf_string::str#41 = printf_string::str#10 -- pbuz1=pbuz2 + // [1099] printf_string::str#29 = printf_string::str#10 -- pbuz1=pbuz2 lda.z printf_string.str_1 sta.z printf_string.str lda.z printf_string.str_1+1 sta.z printf_string.str+1 // printf("ROM%u %-9s %-6s %-13s ", rom_chip, status_text[info_status], rom_device_names[rom_chip], &rom_release_text[rom_chip*13]) - // [1579] call printf_string - // [1219] phi from display_info_rom::@13 to printf_string [phi:display_info_rom::@13->printf_string] - // [1219] phi printf_string::putc#26 = &cputc [phi:display_info_rom::@13->printf_string#0] -- pprz1=pprc1 + // [1100] call printf_string + // [1308] phi from display_info_rom::@13 to printf_string [phi:display_info_rom::@13->printf_string] + // [1308] phi printf_string::putc#17 = &cputc [phi:display_info_rom::@13->printf_string#0] -- pprz1=pprc1 lda #cputc sta.z printf_string.putc+1 - // [1219] phi printf_string::str#26 = printf_string::str#41 [phi:display_info_rom::@13->printf_string#1] -- register_copy - // [1219] phi printf_string::format_justify_left#26 = 1 [phi:display_info_rom::@13->printf_string#2] -- vbum1=vbuc1 + // [1308] phi printf_string::str#17 = printf_string::str#29 [phi:display_info_rom::@13->printf_string#1] -- register_copy + // [1308] phi printf_string::format_justify_left#17 = 1 [phi:display_info_rom::@13->printf_string#2] -- vbum1=vbuc1 lda #1 sta printf_string.format_justify_left - // [1219] phi printf_string::format_min_length#26 = $d [phi:display_info_rom::@13->printf_string#3] -- vbum1=vbuc1 + // [1308] phi printf_string::format_min_length#17 = $d [phi:display_info_rom::@13->printf_string#3] -- vbum1=vbuc1 lda #$d sta printf_string.format_min_length jsr printf_string - // [1580] phi from display_info_rom::@13 to display_info_rom::@14 [phi:display_info_rom::@13->display_info_rom::@14] + // [1101] phi from display_info_rom::@13 to display_info_rom::@14 [phi:display_info_rom::@13->display_info_rom::@14] // display_info_rom::@14 // printf("ROM%u %-9s %-6s %-13s ", rom_chip, status_text[info_status], rom_device_names[rom_chip], &rom_release_text[rom_chip*13]) - // [1581] call printf_str - // [1210] phi from display_info_rom::@14 to printf_str [phi:display_info_rom::@14->printf_str] - // [1210] phi printf_str::putc#84 = &cputc [phi:display_info_rom::@14->printf_str#0] -- pprz1=pprc1 + // [1102] call printf_str + // [785] phi from display_info_rom::@14 to printf_str [phi:display_info_rom::@14->printf_str] + // [785] phi printf_str::putc#53 = &cputc [phi:display_info_rom::@14->printf_str#0] -- pprz1=pprc1 lda #cputc sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = s4 [phi:display_info_rom::@14->printf_str#1] -- pbuz1=pbuc1 - lda #printf_str#1] -- pbuz1=pbuc1 + lda #<@s sta.z printf_str.s - lda #>s4 + lda #>@s sta.z printf_str.s+1 jsr printf_str // display_info_rom::@15 // if(info_text) - // [1582] if((char *)0==display_info_rom::info_text#17) goto display_info_rom::@1 -- pbuc1_eq_pbuz1_then_la1 + // [1103] if((char *)0==display_info_rom::info_text#10) goto display_info_rom::@1 -- pbuc1_eq_pbuz1_then_la1 lda.z info_text cmp #<0 bne !+ @@ -10519,6642 +6980,4371 @@ display_info_rom: { !: // display_info_rom::@2 // gotoxy(INFO_X+64-28, INFO_Y+rom_chip+2) - // [1583] gotoxy::y#25 = display_info_rom::rom_chip#17 + $11+2 -- vbum1=vbum2_plus_vbuc1 + // [1104] gotoxy::y#25 = display_info_rom::rom_chip#10 + $11+2 -- vbum1=vbum2_plus_vbuc1 lda #$11+2 clc adc rom_chip sta gotoxy.y - // [1584] call gotoxy - // [802] phi from display_info_rom::@2 to gotoxy [phi:display_info_rom::@2->gotoxy] - // [802] phi gotoxy::y#37 = gotoxy::y#25 [phi:display_info_rom::@2->gotoxy#0] -- register_copy - // [802] phi gotoxy::x#37 = 4+$40-$1c [phi:display_info_rom::@2->gotoxy#1] -- vbum1=vbuc1 + // [1105] call gotoxy + // [457] phi from display_info_rom::@2 to gotoxy [phi:display_info_rom::@2->gotoxy] + // [457] phi gotoxy::y#26 = gotoxy::y#25 [phi:display_info_rom::@2->gotoxy#0] -- register_copy + // [457] phi gotoxy::x#26 = 4+$40-$1c [phi:display_info_rom::@2->gotoxy#1] -- vbum1=vbuc1 lda #4+$40-$1c sta gotoxy.x jsr gotoxy // display_info_rom::@16 // printf("%-25s", info_text) - // [1585] printf_string::str#11 = display_info_rom::info_text#17 -- pbuz1=pbuz2 + // [1106] printf_string::str#11 = display_info_rom::info_text#10 -- pbuz1=pbuz2 lda.z info_text sta.z printf_string.str lda.z info_text+1 sta.z printf_string.str+1 - // [1586] call printf_string - // [1219] phi from display_info_rom::@16 to printf_string [phi:display_info_rom::@16->printf_string] - // [1219] phi printf_string::putc#26 = &cputc [phi:display_info_rom::@16->printf_string#0] -- pprz1=pprc1 + // [1107] call printf_string + // [1308] phi from display_info_rom::@16 to printf_string [phi:display_info_rom::@16->printf_string] + // [1308] phi printf_string::putc#17 = &cputc [phi:display_info_rom::@16->printf_string#0] -- pprz1=pprc1 lda #cputc sta.z printf_string.putc+1 - // [1219] phi printf_string::str#26 = printf_string::str#11 [phi:display_info_rom::@16->printf_string#1] -- register_copy - // [1219] phi printf_string::format_justify_left#26 = 1 [phi:display_info_rom::@16->printf_string#2] -- vbum1=vbuc1 + // [1308] phi printf_string::str#17 = printf_string::str#11 [phi:display_info_rom::@16->printf_string#1] -- register_copy + // [1308] phi printf_string::format_justify_left#17 = 1 [phi:display_info_rom::@16->printf_string#2] -- vbum1=vbuc1 lda #1 sta printf_string.format_justify_left - // [1219] phi printf_string::format_min_length#26 = $19 [phi:display_info_rom::@16->printf_string#3] -- vbum1=vbuc1 + // [1308] phi printf_string::format_min_length#17 = $19 [phi:display_info_rom::@16->printf_string#3] -- vbum1=vbuc1 lda #$19 sta printf_string.format_min_length jsr printf_string // display_info_rom::@1 __b1: // gotoxy(x,y) - // [1587] gotoxy::x#24 = display_info_rom::x#0 -- vbum1=vbum2 + // [1108] gotoxy::x#24 = display_info_rom::x#0 -- vbum1=vbum2 lda x sta gotoxy.x - // [1588] gotoxy::y#24 = display_info_rom::y#0 -- vbum1=vbum2 + // [1109] gotoxy::y#24 = display_info_rom::y#0 -- vbum1=vbum2 lda y sta gotoxy.y - // [1589] call gotoxy - // [802] phi from display_info_rom::@1 to gotoxy [phi:display_info_rom::@1->gotoxy] - // [802] phi gotoxy::y#37 = gotoxy::y#24 [phi:display_info_rom::@1->gotoxy#0] -- register_copy - // [802] phi gotoxy::x#37 = gotoxy::x#24 [phi:display_info_rom::@1->gotoxy#1] -- register_copy + // [1110] call gotoxy + // [457] phi from display_info_rom::@1 to gotoxy [phi:display_info_rom::@1->gotoxy] + // [457] phi gotoxy::y#26 = gotoxy::y#24 [phi:display_info_rom::@1->gotoxy#0] -- register_copy + // [457] phi gotoxy::x#26 = gotoxy::x#24 [phi:display_info_rom::@1->gotoxy#1] -- register_copy jsr gotoxy // display_info_rom::@return // } - // [1590] return + // [1111] return rts .segment Data + s: .text "ROM" + .byte 0 .label x = wherex.return_4 .label y = wherey.return_4 info_status: .byte 0 rom_chip: .byte 0 } .segment Code - // rom_file -// __zp($cf) char * rom_file(__mem() char rom_chip) -rom_file: { - .label rom_file__0 = $41 - .label return = $cf - // if(rom_chip) - // [1592] if(0!=rom_file::rom_chip#2) goto rom_file::@1 -- 0_neq_vbum1_then_la1 - lda rom_chip - bne __b1 - // [1595] phi from rom_file to rom_file::@return [phi:rom_file->rom_file::@return] - // [1595] phi rom_file::return#2 = rom_file::file_rom_cx16 [phi:rom_file->rom_file::@return#0] -- pbuz1=pbuc1 - lda #file_rom_cx16 - sta.z return+1 - rts - // rom_file::@1 - __b1: - // '0'+rom_chip - // [1593] rom_file::$0 = '0' + rom_file::rom_chip#2 -- vbuz1=vbuc1_plus_vbum2 - lda #'0' - clc - adc rom_chip - sta.z rom_file__0 - // file_rom_card[3] = '0'+rom_chip - // [1594] *(rom_file::file_rom_card+3) = rom_file::$0 -- _deref_pbuc1=vbuz1 - sta file_rom_card+3 - // [1595] phi from rom_file::@1 to rom_file::@return [phi:rom_file::@1->rom_file::@return] - // [1595] phi rom_file::return#2 = rom_file::file_rom_card [phi:rom_file::@1->rom_file::@return#0] -- pbuz1=pbuc1 - lda #file_rom_card - sta.z return+1 - // rom_file::@return + // display_info_cx16_rom +/** + * @brief Display the ROM status of the main CX16 ROM chip. + * + * @param info_status The status. + * @param info_text The status text. + */ +// void display_info_cx16_rom(__mem() char info_status, __zp($3c) char *info_text) +display_info_cx16_rom: { + .label info_text = $3c + // display_info_rom(0, info_status, info_text) + // [1113] display_info_rom::info_status#0 = display_info_cx16_rom::info_status#4 + // [1114] display_info_rom::info_text#0 = display_info_cx16_rom::info_text#4 + // [1115] call display_info_rom + // [1067] phi from display_info_cx16_rom to display_info_rom [phi:display_info_cx16_rom->display_info_rom] + // [1067] phi display_info_rom::info_text#10 = display_info_rom::info_text#0 [phi:display_info_cx16_rom->display_info_rom#0] -- register_copy + // [1067] phi display_info_rom::rom_chip#10 = 0 [phi:display_info_cx16_rom->display_info_rom#1] -- vbum1=vbuc1 + lda #0 + sta display_info_rom.rom_chip + // [1067] phi display_info_rom::info_status#10 = display_info_rom::info_status#0 [phi:display_info_cx16_rom->display_info_rom#2] -- register_copy + jsr display_info_rom + // display_info_cx16_rom::@return // } - // [1596] return + // [1116] return rts .segment Data - file_rom_cx16: .text "ROM.BIN" - .byte 0 - file_rom_card: .text "ROMn.BIN" - .byte 0 - rom_chip: .byte 0 + .label info_status = display_info_rom.info_status } .segment Code - // rom_read -// __mem() unsigned long rom_read(__mem() char rom_chip, __zp($56) char *file, __mem() char info_status, __mem() char brom_bank_start, __mem() unsigned long rom_size) -rom_read: { - .const bank_set_brom1_bank = 0 - .label rom_read__13 = $74 - .label rom_read__24 = $68 - .label fp = $b6 - .label rom_bram_ptr = $2d - .label file = $56 - .label rom_action_text = $54 - // rom_read::bank_set_bram1 - // BRAM = bank - // [1598] BRAM = 0 -- vbuz1=vbuc1 - lda #0 - sta.z BRAM - // rom_read::bank_set_brom1 - // BROM = bank - // [1599] BROM = rom_read::bank_set_brom1_bank#0 -- vbuz1=vbuc1 - lda #bank_set_brom1_bank - sta.z BROM - // rom_read::@23 - // if(info_status == STATUS_READING) - // [1600] if(rom_read::info_status#11==STATUS_READING) goto rom_read::@1 -- vbum1_eq_vbuc1_then_la1 - lda #STATUS_READING - cmp info_status - beq __b1 - // [1602] phi from rom_read::@23 to rom_read::@2 [phi:rom_read::@23->rom_read::@2] - // [1602] phi rom_read::rom_action_text#10 = smc_action_text#2 [phi:rom_read::@23->rom_read::@2#0] -- pbuz1=pbuc1 - lda #smc_action_text_1 - sta.z rom_action_text+1 - jmp __b2 - // [1601] phi from rom_read::@23 to rom_read::@1 [phi:rom_read::@23->rom_read::@1] - // rom_read::@1 + // 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($36) char *destination, char *source) +strcpy: { + .label src = $34 + .label dst = $36 + .label destination = $36 + // [1118] phi from strcpy strcpy::@2 to strcpy::@1 [phi:strcpy/strcpy::@2->strcpy::@1] + // [1118] phi strcpy::dst#2 = strcpy::dst#0 [phi:strcpy/strcpy::@2->strcpy::@1#0] -- register_copy + // [1118] phi strcpy::src#2 = strcpy::src#0 [phi:strcpy/strcpy::@2->strcpy::@1#1] -- register_copy + // strcpy::@1 __b1: - // [1602] phi from rom_read::@1 to rom_read::@2 [phi:rom_read::@1->rom_read::@2] - // [1602] phi rom_read::rom_action_text#10 = smc_action_text#1 [phi:rom_read::@1->rom_read::@2#0] -- pbuz1=pbuc1 - lda #smc_action_text - sta.z rom_action_text+1 - // rom_read::@2 + // while(*src) + // [1119] 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 + // [1120] *strcpy::dst#2 = 0 -- _deref_pbuz1=vbuc1 + tya + tay + sta (dst),y + // strcpy::@return + // } + // [1121] return + rts + // strcpy::@2 __b2: - // unsigned long rom_address = rom_address_from_bank(brom_bank_start) - // [1603] rom_address_from_bank::rom_bank#0 = rom_read::brom_bank_start#10 -- vbum1=vbum2 - lda brom_bank_start - sta rom_address_from_bank.rom_bank - // [1604] call rom_address_from_bank - // [2866] phi from rom_read::@2 to rom_address_from_bank [phi:rom_read::@2->rom_address_from_bank] - // [2866] phi rom_address_from_bank::rom_bank#3 = rom_address_from_bank::rom_bank#0 [phi:rom_read::@2->rom_address_from_bank#0] -- register_copy - jsr rom_address_from_bank - // unsigned long rom_address = rom_address_from_bank(brom_bank_start) - // [1605] rom_address_from_bank::return#2 = rom_address_from_bank::return#0 - // rom_read::@25 - // [1606] rom_read::rom_address#0 = rom_address_from_bank::return#2 - // sprintf(info_text, "Opening %s from SD card ...", file) - // [1607] call snprintf_init - // [1205] phi from rom_read::@25 to snprintf_init [phi:rom_read::@25->snprintf_init] - // [1205] phi snprintf_init::s#31 = info_text [phi:rom_read::@25->snprintf_init#0] -- pbuz1=pbuc1 - lda #info_text - sta.z snprintf_init.s+1 - jsr snprintf_init - // [1608] phi from rom_read::@25 to rom_read::@26 [phi:rom_read::@25->rom_read::@26] - // rom_read::@26 - // sprintf(info_text, "Opening %s from SD card ...", file) - // [1609] call printf_str - // [1210] phi from rom_read::@26 to printf_str [phi:rom_read::@26->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:rom_read::@26->printf_str#0] -- pprz1=pprc1 - lda #snputc - sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = rom_read::s [phi:rom_read::@26->printf_str#1] -- pbuz1=pbuc1 - lda #s - sta.z printf_str.s+1 - jsr printf_str - // rom_read::@27 - // sprintf(info_text, "Opening %s from SD card ...", file) - // [1610] printf_string::str#17 = rom_read::file#10 -- pbuz1=pbuz2 - lda.z file - sta.z printf_string.str - lda.z file+1 - sta.z printf_string.str+1 - // [1611] call printf_string - // [1219] phi from rom_read::@27 to printf_string [phi:rom_read::@27->printf_string] - // [1219] phi printf_string::putc#26 = &snputc [phi:rom_read::@27->printf_string#0] -- pprz1=pprc1 - lda #snputc - sta.z printf_string.putc+1 - // [1219] phi printf_string::str#26 = printf_string::str#17 [phi:rom_read::@27->printf_string#1] -- register_copy - // [1219] phi printf_string::format_justify_left#26 = 0 [phi:rom_read::@27->printf_string#2] -- vbum1=vbuc1 + // *dst++ = *src++ + // [1122] *strcpy::dst#2 = *strcpy::src#2 -- _deref_pbuz1=_deref_pbuz2 + ldy #0 + lda (src),y + sta (dst),y + // *dst++ = *src++; + // [1123] strcpy::dst#1 = ++ strcpy::dst#2 -- pbuz1=_inc_pbuz1 + inc.z dst + bne !+ + inc.z dst+1 + !: + // [1124] strcpy::src#1 = ++ strcpy::src#2 -- pbuz1=_inc_pbuz1 + inc.z src + bne !+ + inc.z src+1 + !: + jmp __b1 +} + // screenlayer +// --- layer management in VERA --- +// void screenlayer(char layer, __mem() char mapbase, __mem() char config) +screenlayer: { + .label screenlayer__0 = $58 + .label screenlayer__1 = $55 + .label screenlayer__2 = $74 + .label screenlayer__5 = $71 + .label screenlayer__6 = $71 + .label screenlayer__7 = $70 + .label screenlayer__8 = $70 + .label screenlayer__9 = $6e + .label screenlayer__10 = $6e + .label screenlayer__11 = $6e + .label screenlayer__12 = $6f + .label screenlayer__13 = $6f + .label screenlayer__14 = $6f + .label screenlayer__16 = $70 + .label screenlayer__17 = $67 + .label screenlayer__18 = $6e + .label screenlayer__19 = $6f + .label y = $64 + // __mem char vera_dc_hscale_temp = *VERA_DC_HSCALE + // [1125] screenlayer::vera_dc_hscale_temp#0 = *VERA_DC_HSCALE -- vbum1=_deref_pbuc1 + lda VERA_DC_HSCALE + sta vera_dc_hscale_temp + // __mem char vera_dc_vscale_temp = *VERA_DC_VSCALE + // [1126] screenlayer::vera_dc_vscale_temp#0 = *VERA_DC_VSCALE -- vbum1=_deref_pbuc1 + lda VERA_DC_VSCALE + sta vera_dc_vscale_temp + // __conio.layer = 0 + // [1127] *((char *)&__conio+2) = 0 -- _deref_pbuc1=vbuc2 lda #0 - sta printf_string.format_justify_left - // [1219] phi printf_string::format_min_length#26 = 0 [phi:rom_read::@27->printf_string#3] -- vbum1=vbuc1 - sta printf_string.format_min_length - jsr printf_string - // [1612] phi from rom_read::@27 to rom_read::@28 [phi:rom_read::@27->rom_read::@28] - // rom_read::@28 - // sprintf(info_text, "Opening %s from SD card ...", file) - // [1613] call printf_str - // [1210] phi from rom_read::@28 to printf_str [phi:rom_read::@28->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:rom_read::@28->printf_str#0] -- pprz1=pprc1 - lda #snputc - sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = rom_read::s1 [phi:rom_read::@28->printf_str#1] -- pbuz1=pbuc1 - lda #s1 - sta.z printf_str.s+1 - jsr printf_str - // rom_read::@29 - // sprintf(info_text, "Opening %s from SD card ...", file) - // [1614] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 + sta __conio+2 + // mapbase >> 7 + // [1128] screenlayer::$0 = screenlayer::mapbase#0 >> 7 -- vbuz1=vbum2_ror_7 + lda mapbase + rol + rol + and #1 + sta.z screenlayer__0 + // __conio.mapbase_bank = mapbase >> 7 + // [1129] *((char *)&__conio+5) = screenlayer::$0 -- _deref_pbuc1=vbuz1 + sta __conio+5 + // (mapbase)<<1 + // [1130] screenlayer::$1 = screenlayer::mapbase#0 << 1 -- vbuz1=vbum2_rol_1 + lda mapbase + asl + sta.z screenlayer__1 + // MAKEWORD((mapbase)<<1,0) + // [1131] screenlayer::$2 = screenlayer::$1 w= 0 -- vwuz1=vbuz2_word_vbuc1 lda #0 - pha - // [1615] callexecute snputc -- call_vprc1 - jsr snputc - // sideeffect stackpullpadding(1) -- _stackpullpadding_1 - pla - // display_action_text(info_text) - // [1617] call display_action_text - // [1357] phi from rom_read::@29 to display_action_text [phi:rom_read::@29->display_action_text] - // [1357] phi display_action_text::info_text#25 = info_text [phi:rom_read::@29->display_action_text#0] -- pbuz1=pbuc1 - lda #info_text - sta.z display_action_text.info_text+1 - jsr display_action_text - // rom_read::@30 - // FILE *fp = fopen(file, "r") - // [1618] fopen::path#4 = rom_read::file#10 -- pbuz1=pbuz2 - lda.z file - sta.z fopen.path - lda.z file+1 - sta.z fopen.path+1 - // [1619] call fopen - // [2416] phi from rom_read::@30 to fopen [phi:rom_read::@30->fopen] - // [2416] phi __errno#473 = __errno#105 [phi:rom_read::@30->fopen#0] -- register_copy - // [2416] phi fopen::pathtoken#0 = fopen::path#4 [phi:rom_read::@30->fopen#1] -- register_copy - // [2416] phi __stdio_filecount#27 = __stdio_filecount#100 [phi:rom_read::@30->fopen#2] -- register_copy - jsr fopen - // FILE *fp = fopen(file, "r") - // [1620] fopen::return#5 = fopen::return#2 - // rom_read::@31 - // [1621] rom_read::fp#0 = fopen::return#5 -- pssz1=pssz2 - lda.z fopen.return - sta.z fp - lda.z fopen.return+1 - sta.z fp+1 - // if (fp) - // [1622] if((struct $2 *)0==rom_read::fp#0) goto rom_read::@3 -- pssc1_eq_pssz1_then_la1 - lda.z fp - cmp #<0 - bne !+ - lda.z fp+1 - cmp #>0 - beq __b4 + ldy.z screenlayer__1 + sty.z screenlayer__2+1 + sta.z screenlayer__2 + // __conio.mapbase_offset = MAKEWORD((mapbase)<<1,0) + // [1132] *((unsigned int *)&__conio+3) = screenlayer::$2 -- _deref_pwuc1=vwuz1 + sta __conio+3 + tya + sta __conio+3+1 + // config & VERA_LAYER_WIDTH_MASK + // [1133] screenlayer::$7 = screenlayer::config#0 & VERA_LAYER_WIDTH_MASK -- vbuz1=vbum2_band_vbuc1 + lda #VERA_LAYER_WIDTH_MASK + and config + sta.z screenlayer__7 + // (config & VERA_LAYER_WIDTH_MASK) >> 4 + // [1134] screenlayer::$8 = screenlayer::$7 >> 4 -- vbuz1=vbuz1_ror_4 + lda.z screenlayer__8 + lsr + lsr + lsr + lsr + sta.z screenlayer__8 + // __conio.mapwidth = VERA_LAYER_DIM[ (config & VERA_LAYER_WIDTH_MASK) >> 4] + // [1135] *((char *)&__conio+8) = screenlayer::VERA_LAYER_DIM[screenlayer::$8] -- _deref_pbuc1=pbuc2_derefidx_vbuz1 + tay + lda VERA_LAYER_DIM,y + sta __conio+8 + // config & VERA_LAYER_HEIGHT_MASK + // [1136] screenlayer::$5 = screenlayer::config#0 & VERA_LAYER_HEIGHT_MASK -- vbuz1=vbum2_band_vbuc1 + lda #VERA_LAYER_HEIGHT_MASK + and config + sta.z screenlayer__5 + // (config & VERA_LAYER_HEIGHT_MASK) >> 6 + // [1137] screenlayer::$6 = screenlayer::$5 >> 6 -- vbuz1=vbuz1_ror_6 + lda.z screenlayer__6 + rol + rol + rol + and #3 + sta.z screenlayer__6 + // __conio.mapheight = VERA_LAYER_DIM[ (config & VERA_LAYER_HEIGHT_MASK) >> 6] + // [1138] *((char *)&__conio+9) = screenlayer::VERA_LAYER_DIM[screenlayer::$6] -- _deref_pbuc1=pbuc2_derefidx_vbuz1 + tay + lda VERA_LAYER_DIM,y + sta __conio+9 + // __conio.rowskip = VERA_LAYER_SKIP[(config & VERA_LAYER_WIDTH_MASK)>>4] + // [1139] screenlayer::$16 = screenlayer::$8 << 1 -- vbuz1=vbuz1_rol_1 + asl.z screenlayer__16 + // [1140] *((unsigned int *)&__conio+$a) = screenlayer::VERA_LAYER_SKIP[screenlayer::$16] -- _deref_pwuc1=pwuc2_derefidx_vbuz1 + // __conio.rowshift = ((config & VERA_LAYER_WIDTH_MASK)>>4)+6; + ldy.z screenlayer__16 + lda VERA_LAYER_SKIP,y + sta __conio+$a + lda VERA_LAYER_SKIP+1,y + sta __conio+$a+1 + // vera_dc_hscale_temp == 0x80 + // [1141] screenlayer::$9 = screenlayer::vera_dc_hscale_temp#0 == $80 -- vboz1=vbum2_eq_vbuc1 + lda vera_dc_hscale_temp + eor #$80 + beq !+ + lda #1 !: - // [1623] phi from rom_read::@31 to rom_read::@4 [phi:rom_read::@31->rom_read::@4] - // rom_read::@4 - // gotoxy(x, y) - // [1624] call gotoxy - // [802] phi from rom_read::@4 to gotoxy [phi:rom_read::@4->gotoxy] - // [802] phi gotoxy::y#37 = PROGRESS_Y [phi:rom_read::@4->gotoxy#0] -- vbum1=vbuc1 - lda #PROGRESS_Y - sta gotoxy.y - // [802] phi gotoxy::x#37 = PROGRESS_X [phi:rom_read::@4->gotoxy#1] -- vbum1=vbuc1 - lda #PROGRESS_X - sta gotoxy.x - jsr gotoxy - // [1625] phi from rom_read::@4 to rom_read::@5 [phi:rom_read::@4->rom_read::@5] - // [1625] phi rom_read::y#11 = PROGRESS_Y [phi:rom_read::@4->rom_read::@5#0] -- vbum1=vbuc1 - lda #PROGRESS_Y - sta y - // [1625] phi rom_read::rom_row_current#10 = 0 [phi:rom_read::@4->rom_read::@5#1] -- vwum1=vwuc1 - lda #<0 - sta rom_row_current - sta rom_row_current+1 - // [1625] phi rom_read::brom_bank_start#11 = rom_read::brom_bank_start#10 [phi:rom_read::@4->rom_read::@5#2] -- register_copy - // [1625] phi rom_read::rom_address#10 = rom_read::rom_address#0 [phi:rom_read::@4->rom_read::@5#3] -- register_copy - // [1625] phi rom_read::rom_bram_ptr#13 = (char *)$7800 [phi:rom_read::@4->rom_read::@5#4] -- pbuz1=pbuc1 - lda #<$7800 - sta.z rom_bram_ptr - lda #>$7800 - sta.z rom_bram_ptr+1 - // [1625] phi rom_read::rom_bram_bank#10 = 0 [phi:rom_read::@4->rom_read::@5#5] -- vbum1=vbuc1 - lda #0 - sta rom_bram_bank - // [1625] phi rom_read::rom_file_size#13 = 0 [phi:rom_read::@4->rom_read::@5#6] -- vdum1=vduc1 - sta rom_file_size - sta rom_file_size+1 - lda #<0>>$10 - sta rom_file_size+2 - lda #>0>>$10 - sta rom_file_size+3 - // rom_read::@5 - __b5: - // while (rom_file_size < rom_size) - // [1626] if(rom_read::rom_file_size#13fclose] - // [2551] phi fclose::stream#3 = fclose::stream#2 [phi:rom_read::@10->fclose#0] -- register_copy - jsr fclose - // [1629] phi from rom_read::@10 to rom_read::@3 [phi:rom_read::@10->rom_read::@3] - // [1629] phi __stdio_filecount#12 = __stdio_filecount#2 [phi:rom_read::@10->rom_read::@3#0] -- register_copy - // [1629] phi rom_read::return#0 = rom_read::rom_file_size#13 [phi:rom_read::@10->rom_read::@3#1] -- register_copy - rts - // [1629] phi from rom_read::@31 to rom_read::@3 [phi:rom_read::@31->rom_read::@3] - __b4: - // [1629] phi __stdio_filecount#12 = __stdio_filecount#1 [phi:rom_read::@31->rom_read::@3#0] -- register_copy - // [1629] phi rom_read::return#0 = 0 [phi:rom_read::@31->rom_read::@3#1] -- vdum1=vduc1 - lda #<0 - sta return - sta return+1 - lda #<0>>$10 - sta return+2 - lda #>0>>$10 - sta return+3 - // rom_read::@3 - // rom_read::@return - // } - // [1630] return - rts - // rom_read::@6 - __b6: - // if(info_status == STATUS_CHECKING) - // [1631] if(rom_read::info_status#11!=STATUS_CHECKING) goto rom_read::@35 -- vbum1_neq_vbuc1_then_la1 - lda #STATUS_CHECKING - cmp info_status - bne __b7 - // [1633] phi from rom_read::@6 to rom_read::@7 [phi:rom_read::@6->rom_read::@7] - // [1633] phi rom_read::rom_bram_ptr#10 = (char *) 1024 [phi:rom_read::@6->rom_read::@7#0] -- pbuz1=pbuc1 - lda #<$400 - sta.z rom_bram_ptr - lda #>$400 - sta.z rom_bram_ptr+1 - // [1632] phi from rom_read::@6 to rom_read::@35 [phi:rom_read::@6->rom_read::@35] - // rom_read::@35 - // [1633] phi from rom_read::@35 to rom_read::@7 [phi:rom_read::@35->rom_read::@7] - // [1633] phi rom_read::rom_bram_ptr#10 = rom_read::rom_bram_ptr#13 [phi:rom_read::@35->rom_read::@7#0] -- register_copy - // rom_read::@7 - __b7: - // display_action_text_reading(rom_action_text, file, rom_file_size, rom_size, rom_bram_bank, rom_bram_ptr) - // [1634] display_action_text_reading::action#2 = rom_read::rom_action_text#10 -- pbuz1=pbuz2 - lda.z rom_action_text - sta.z display_action_text_reading.action - lda.z rom_action_text+1 - sta.z display_action_text_reading.action+1 - // [1635] display_action_text_reading::file#2 = rom_read::file#10 -- pbuz1=pbuz2 - lda.z file - sta.z display_action_text_reading.file - lda.z file+1 - sta.z display_action_text_reading.file+1 - // [1636] display_action_text_reading::bytes#2 = rom_read::rom_file_size#13 -- vdum1=vdum2 - lda rom_file_size - sta display_action_text_reading.bytes - lda rom_file_size+1 - sta display_action_text_reading.bytes+1 - lda rom_file_size+2 - sta display_action_text_reading.bytes+2 - lda rom_file_size+3 - sta display_action_text_reading.bytes+3 - // [1637] display_action_text_reading::size#2 = rom_read::rom_size#12 -- vdum1=vdum2 - lda rom_size - sta display_action_text_reading.size - lda rom_size+1 - sta display_action_text_reading.size+1 - lda rom_size+2 - sta display_action_text_reading.size+2 - lda rom_size+3 - sta display_action_text_reading.size+3 - // [1638] display_action_text_reading::bram_bank#2 = rom_read::rom_bram_bank#10 -- vbum1=vbum2 - lda rom_bram_bank - sta display_action_text_reading.bram_bank - // [1639] display_action_text_reading::bram_ptr#2 = rom_read::rom_bram_ptr#10 -- pbuz1=pbuz2 - lda.z rom_bram_ptr - sta.z display_action_text_reading.bram_ptr - lda.z rom_bram_ptr+1 - sta.z display_action_text_reading.bram_ptr+1 - // [1640] call display_action_text_reading - // [2580] phi from rom_read::@7 to display_action_text_reading [phi:rom_read::@7->display_action_text_reading] - // [2580] phi display_action_text_reading::bram_ptr#10 = display_action_text_reading::bram_ptr#2 [phi:rom_read::@7->display_action_text_reading#0] -- register_copy - // [2580] phi display_action_text_reading::bram_bank#10 = display_action_text_reading::bram_bank#2 [phi:rom_read::@7->display_action_text_reading#1] -- register_copy - // [2580] phi display_action_text_reading::size#10 = display_action_text_reading::size#2 [phi:rom_read::@7->display_action_text_reading#2] -- register_copy - // [2580] phi display_action_text_reading::bytes#3 = display_action_text_reading::bytes#2 [phi:rom_read::@7->display_action_text_reading#3] -- register_copy - // [2580] phi display_action_text_reading::file#3 = display_action_text_reading::file#2 [phi:rom_read::@7->display_action_text_reading#4] -- register_copy - // [2580] phi display_action_text_reading::action#3 = display_action_text_reading::action#2 [phi:rom_read::@7->display_action_text_reading#5] -- register_copy - jsr display_action_text_reading - // rom_read::@32 - // rom_address % 0x04000 - // [1641] rom_read::$13 = rom_read::rom_address#10 & $4000-1 -- vduz1=vdum2_band_vduc1 - lda rom_address - and #<$4000-1 - sta.z rom_read__13 - lda rom_address+1 - and #>$4000-1 - sta.z rom_read__13+1 - lda rom_address+2 - and #<$4000-1>>$10 - sta.z rom_read__13+2 - lda rom_address+3 - and #>$4000-1>>$10 - sta.z rom_read__13+3 - // if (!(rom_address % 0x04000)) - // [1642] if(0!=rom_read::$13) goto rom_read::@8 -- 0_neq_vduz1_then_la1 - lda.z rom_read__13 - ora.z rom_read__13+1 - ora.z rom_read__13+2 - ora.z rom_read__13+3 - bne __b8 - // rom_read::@17 - // brom_bank_start++; - // [1643] rom_read::brom_bank_start#0 = ++ rom_read::brom_bank_start#11 -- vbum1=_inc_vbum1 - inc brom_bank_start - // [1644] phi from rom_read::@17 rom_read::@32 to rom_read::@8 [phi:rom_read::@17/rom_read::@32->rom_read::@8] - // [1644] phi rom_read::brom_bank_start#16 = rom_read::brom_bank_start#0 [phi:rom_read::@17/rom_read::@32->rom_read::@8#0] -- register_copy - // rom_read::@8 - __b8: - // rom_read::bank_set_bram2 - // BRAM = bank - // [1645] BRAM = rom_read::rom_bram_bank#10 -- vbuz1=vbum2 - lda rom_bram_bank - sta.z BRAM - // rom_read::@24 - // unsigned int rom_package_read = fgets(rom_bram_ptr, ROM_PROGRESS_CELL, fp) - // [1646] fgets::ptr#5 = rom_read::rom_bram_ptr#10 -- pbuz1=pbuz2 - lda.z rom_bram_ptr - sta.z fgets.ptr - lda.z rom_bram_ptr+1 - sta.z fgets.ptr+1 - // [1647] fgets::stream#3 = rom_read::fp#0 -- pssz1=pssz2 - lda.z fp - sta.z fgets.stream - lda.z fp+1 - sta.z fgets.stream+1 - // [1648] call fgets - // [2497] phi from rom_read::@24 to fgets [phi:rom_read::@24->fgets] - // [2497] phi fgets::ptr#14 = fgets::ptr#5 [phi:rom_read::@24->fgets#0] -- register_copy - // [2497] phi fgets::size#10 = ROM_PROGRESS_CELL [phi:rom_read::@24->fgets#1] -- vwum1=vwuc1 - lda #ROM_PROGRESS_CELL - sta fgets.size+1 - // [2497] phi fgets::stream#4 = fgets::stream#3 [phi:rom_read::@24->fgets#2] -- register_copy - jsr fgets - // unsigned int rom_package_read = fgets(rom_bram_ptr, ROM_PROGRESS_CELL, fp) - // [1649] fgets::return#13 = fgets::return#1 - // rom_read::@33 - // [1650] rom_read::rom_package_read#0 = fgets::return#13 -- vwum1=vwum2 - lda fgets.return - sta rom_package_read - lda fgets.return+1 - sta rom_package_read+1 - // if (!rom_package_read) - // [1651] if(0!=rom_read::rom_package_read#0) goto rom_read::@9 -- 0_neq_vwum1_then_la1 - lda rom_package_read - ora rom_package_read+1 - bne __b9 - jmp __b10 - // rom_read::@9 - __b9: - // if(info_status == STATUS_CHECKING) - // [1652] if(rom_read::info_status#11!=STATUS_CHECKING) goto rom_read::@11 -- vbum1_neq_vbuc1_then_la1 - lda #STATUS_CHECKING - cmp info_status - bne __b11 - // rom_read::@18 - // if(rom_file_size == 0x0) - // [1653] if(rom_read::rom_file_size#13!=0) goto rom_read::@12 -- vdum1_neq_0_then_la1 - lda rom_file_size - ora rom_file_size+1 - ora rom_file_size+2 - ora rom_file_size+3 - bne __b12 - // rom_read::@19 - // rom_chip*8 - // [1654] rom_read::$24 = rom_read::rom_chip#20 << 3 -- vbuz1=vbum2_rol_3 - lda rom_chip asl + dey + bne !- + !e: + sta.z screenlayer__10 + // (40 << (char)(vera_dc_hscale_temp == 0x80))-1 + // [1144] screenlayer::$11 = screenlayer::$10 - 1 -- vbuz1=vbuz1_minus_1 + dec.z screenlayer__11 + // __conio.width = (40 << (char)(vera_dc_hscale_temp == 0x80))-1 + // [1145] *((char *)&__conio+6) = screenlayer::$11 -- _deref_pbuc1=vbuz1 + lda.z screenlayer__11 + sta __conio+6 + // vera_dc_vscale_temp == 0x80 + // [1146] screenlayer::$12 = screenlayer::vera_dc_vscale_temp#0 == $80 -- vboz1=vbum2_eq_vbuc1 + lda vera_dc_vscale_temp + eor #$80 + beq !+ + lda #1 + !: + eor #1 + sta.z screenlayer__12 + // 30 << (char)(vera_dc_vscale_temp == 0x80) + // [1147] screenlayer::$19 = (char)screenlayer::$12 + // [1148] screenlayer::$13 = $1e << screenlayer::$19 -- vbuz1=vbuc1_rol_vbuz1 + lda #$1e + ldy.z screenlayer__13 + cpy #0 + beq !e+ + !: asl + dey + bne !- + !e: + sta.z screenlayer__13 + // (30 << (char)(vera_dc_vscale_temp == 0x80))-1 + // [1149] screenlayer::$14 = screenlayer::$13 - 1 -- vbuz1=vbuz1_minus_1 + dec.z screenlayer__14 + // __conio.height = (30 << (char)(vera_dc_vscale_temp == 0x80))-1 + // [1150] *((char *)&__conio+7) = screenlayer::$14 -- _deref_pbuc1=vbuz1 + lda.z screenlayer__14 + sta __conio+7 + // unsigned int mapbase_offset = __conio.mapbase_offset + // [1151] screenlayer::mapbase_offset#0 = *((unsigned int *)&__conio+3) -- vwum1=_deref_pwuc1 + lda __conio+3 + sta mapbase_offset + lda __conio+3+1 + sta mapbase_offset+1 + // [1152] phi from screenlayer to screenlayer::@1 [phi:screenlayer->screenlayer::@1] + // [1152] phi screenlayer::mapbase_offset#2 = screenlayer::mapbase_offset#0 [phi:screenlayer->screenlayer::@1#0] -- register_copy + // [1152] phi screenlayer::y#2 = 0 [phi:screenlayer->screenlayer::@1#1] -- vbuz1=vbuc1 + lda #0 + sta.z y + // screenlayer::@1 + __b1: + // for(register char y=0; y<=__conio.height; y++) + // [1153] if(screenlayer::y#2<=*((char *)&__conio+7)) goto screenlayer::@2 -- vbuz1_le__deref_pbuc1_then_la1 + lda __conio+7 + cmp.z y + bcs __b2 + // screenlayer::@return + // } + // [1154] return + rts + // screenlayer::@2 + __b2: + // __conio.offsets[y] = mapbase_offset + // [1155] screenlayer::$17 = screenlayer::y#2 << 1 -- vbuz1=vbuz2_rol_1 + lda.z y asl - sta.z rom_read__24 - // rom_get_github_commit_id(&rom_file_github[rom_chip*8], (char*)0x0400) - // [1655] rom_get_github_commit_id::commit_id#0 = rom_file_github + rom_read::$24 -- pbuz1=pbuc1_plus_vbuz2 + sta.z screenlayer__17 + // [1156] ((unsigned int *)&__conio+$15)[screenlayer::$17] = screenlayer::mapbase_offset#2 -- pwuc1_derefidx_vbuz1=vwum2 + tay + lda mapbase_offset + sta __conio+$15,y + lda mapbase_offset+1 + sta __conio+$15+1,y + // mapbase_offset += __conio.rowskip + // [1157] screenlayer::mapbase_offset#1 = screenlayer::mapbase_offset#2 + *((unsigned int *)&__conio+$a) -- vwum1=vwum1_plus__deref_pwuc1 clc - adc #rom_file_github - adc #0 - sta.z rom_get_github_commit_id.commit_id+1 - // [1656] call rom_get_github_commit_id - // [2069] phi from rom_read::@19 to rom_get_github_commit_id [phi:rom_read::@19->rom_get_github_commit_id] - // [2069] phi rom_get_github_commit_id::commit_id#6 = rom_get_github_commit_id::commit_id#0 [phi:rom_read::@19->rom_get_github_commit_id#0] -- register_copy - // [2069] phi rom_get_github_commit_id::from#6 = (char *) 1024 [phi:rom_read::@19->rom_get_github_commit_id#1] -- pbuz1=pbuc1 - lda #<$400 - sta.z rom_get_github_commit_id.from - lda #>$400 - sta.z rom_get_github_commit_id.from+1 - jsr rom_get_github_commit_id - // rom_read::@12 - __b12: - // if(rom_file_size == 0x3E00) - // [1657] if(rom_read::rom_file_size#13!=$3e00) goto rom_read::@11 -- vdum1_neq_vduc1_then_la1 - lda rom_file_size+3 - cmp #>$3e00>>$10 - bne __b11 - lda rom_file_size+2 - cmp #<$3e00>>$10 - bne __b11 - lda rom_file_size+1 - cmp #>$3e00 - bne __b11 - lda rom_file_size - cmp #<$3e00 - bne __b11 - // rom_read::@13 - // rom_file_release[rom_chip] = *((char*)(0x0400+0x0180)) - // [1658] rom_file_release[rom_read::rom_chip#20] = *((char *)$400+$180) -- pbuc1_derefidx_vbum1=_deref_pbuc2 - lda $400+$180 - ldy rom_chip - sta rom_file_release,y - // rom_read::@11 - __b11: - // if (rom_row_current == ROM_PROGRESS_ROW) - // [1659] if(rom_read::rom_row_current#10!=ROM_PROGRESS_ROW) goto rom_read::@14 -- vwum1_neq_vwuc1_then_la1 - lda rom_row_current+1 - cmp #>ROM_PROGRESS_ROW - bne __b14 - lda rom_row_current - cmp #gotoxy] - // [802] phi gotoxy::y#37 = gotoxy::y#32 [phi:rom_read::@20->gotoxy#0] -- register_copy - // [802] phi gotoxy::x#37 = PROGRESS_X [phi:rom_read::@20->gotoxy#1] -- vbum1=vbuc1 - lda #PROGRESS_X - sta gotoxy.x - jsr gotoxy - // [1663] phi from rom_read::@20 to rom_read::@14 [phi:rom_read::@20->rom_read::@14] - // [1663] phi rom_read::y#33 = rom_read::y#1 [phi:rom_read::@20->rom_read::@14#0] -- register_copy - // [1663] phi rom_read::rom_row_current#4 = 0 [phi:rom_read::@20->rom_read::@14#1] -- vwum1=vbuc1 - lda #<0 - sta rom_row_current - sta rom_row_current+1 - // [1663] phi from rom_read::@11 to rom_read::@14 [phi:rom_read::@11->rom_read::@14] - // [1663] phi rom_read::y#33 = rom_read::y#11 [phi:rom_read::@11->rom_read::@14#0] -- register_copy - // [1663] phi rom_read::rom_row_current#4 = rom_read::rom_row_current#10 [phi:rom_read::@11->rom_read::@14#1] -- register_copy - // rom_read::@14 - __b14: - // if(info_status == STATUS_READING) - // [1664] if(rom_read::info_status#11!=STATUS_READING) goto rom_read::@15 -- vbum1_neq_vbuc1_then_la1 - lda #STATUS_READING - cmp info_status - bne __b15 - // rom_read::@21 - // cputc('.') - // [1665] stackpush(char) = '.' -- _stackpushbyte_=vbuc1 - lda #'.' - pha - // [1666] callexecute cputc -- call_vprc1 - jsr cputc - // sideeffect stackpullpadding(1) -- _stackpullpadding_1 - pla - // rom_read::@15 - __b15: - // rom_bram_ptr += rom_package_read - // [1668] rom_read::rom_bram_ptr#2 = rom_read::rom_bram_ptr#10 + rom_read::rom_package_read#0 -- pbuz1=pbuz1_plus_vwum2 - clc - lda.z rom_bram_ptr - adc rom_package_read - sta.z rom_bram_ptr - lda.z rom_bram_ptr+1 - adc rom_package_read+1 - sta.z rom_bram_ptr+1 - // rom_address += rom_package_read - // [1669] rom_read::rom_address#1 = rom_read::rom_address#10 + rom_read::rom_package_read#0 -- vdum1=vdum1_plus_vwum2 - lda rom_address - clc - adc rom_package_read - sta rom_address - lda rom_address+1 - adc rom_package_read+1 - sta rom_address+1 - lda rom_address+2 - adc #0 - sta rom_address+2 - lda rom_address+3 - adc #0 - sta rom_address+3 - // rom_file_size += rom_package_read - // [1670] rom_read::rom_file_size#1 = rom_read::rom_file_size#13 + rom_read::rom_package_read#0 -- vdum1=vdum1_plus_vwum2 - lda rom_file_size - clc - adc rom_package_read - sta rom_file_size - lda rom_file_size+1 - adc rom_package_read+1 - sta rom_file_size+1 - lda rom_file_size+2 - adc #0 - sta rom_file_size+2 - lda rom_file_size+3 - adc #0 - sta rom_file_size+3 - // rom_row_current += rom_package_read - // [1671] rom_read::rom_row_current#2 = rom_read::rom_row_current#4 + rom_read::rom_package_read#0 -- vwum1=vwum1_plus_vwum2 - clc - lda rom_row_current - adc rom_package_read - sta rom_row_current - lda rom_row_current+1 - adc rom_package_read+1 - sta rom_row_current+1 - // if (rom_bram_ptr == (bram_ptr_t)BRAM_HIGH) - // [1672] if(rom_read::rom_bram_ptr#2!=(char *)$c000) goto rom_read::@16 -- pbuz1_neq_pbuc1_then_la1 - lda.z rom_bram_ptr+1 - cmp #>$c000 - bne __b16 - lda.z rom_bram_ptr - cmp #<$c000 - bne __b16 - // rom_read::@22 - // rom_bram_bank++; - // [1673] rom_read::rom_bram_bank#1 = ++ rom_read::rom_bram_bank#10 -- vbum1=_inc_vbum1 - inc rom_bram_bank - // [1674] phi from rom_read::@22 to rom_read::@16 [phi:rom_read::@22->rom_read::@16] - // [1674] phi rom_read::rom_bram_bank#14 = rom_read::rom_bram_bank#1 [phi:rom_read::@22->rom_read::@16#0] -- register_copy - // [1674] phi rom_read::rom_bram_ptr#8 = (char *)$a000 [phi:rom_read::@22->rom_read::@16#1] -- pbuz1=pbuc1 - lda #<$a000 - sta.z rom_bram_ptr - lda #>$a000 - sta.z rom_bram_ptr+1 - // [1674] phi from rom_read::@15 to rom_read::@16 [phi:rom_read::@15->rom_read::@16] - // [1674] phi rom_read::rom_bram_bank#14 = rom_read::rom_bram_bank#10 [phi:rom_read::@15->rom_read::@16#0] -- register_copy - // [1674] phi rom_read::rom_bram_ptr#8 = rom_read::rom_bram_ptr#2 [phi:rom_read::@15->rom_read::@16#1] -- register_copy - // rom_read::@16 - __b16: - // if (rom_bram_ptr == (bram_ptr_t)RAM_HIGH) - // [1675] if(rom_read::rom_bram_ptr#8!=(char *)$9800) goto rom_read::@34 -- pbuz1_neq_pbuc1_then_la1 - lda.z rom_bram_ptr+1 - cmp #>$9800 - beq !__b5+ - jmp __b5 - !__b5: - lda.z rom_bram_ptr - cmp #<$9800 - beq !__b5+ - jmp __b5 - !__b5: - // [1625] phi from rom_read::@16 to rom_read::@5 [phi:rom_read::@16->rom_read::@5] - // [1625] phi rom_read::y#11 = rom_read::y#33 [phi:rom_read::@16->rom_read::@5#0] -- register_copy - // [1625] phi rom_read::rom_row_current#10 = rom_read::rom_row_current#2 [phi:rom_read::@16->rom_read::@5#1] -- register_copy - // [1625] phi rom_read::brom_bank_start#11 = rom_read::brom_bank_start#16 [phi:rom_read::@16->rom_read::@5#2] -- register_copy - // [1625] phi rom_read::rom_address#10 = rom_read::rom_address#1 [phi:rom_read::@16->rom_read::@5#3] -- register_copy - // [1625] phi rom_read::rom_bram_ptr#13 = (char *)$a000 [phi:rom_read::@16->rom_read::@5#4] -- pbuz1=pbuc1 - lda #<$a000 - sta.z rom_bram_ptr - lda #>$a000 - sta.z rom_bram_ptr+1 - // [1625] phi rom_read::rom_bram_bank#10 = 1 [phi:rom_read::@16->rom_read::@5#5] -- vbum1=vbuc1 - lda #1 - sta rom_bram_bank - // [1625] phi rom_read::rom_file_size#13 = rom_read::rom_file_size#1 [phi:rom_read::@16->rom_read::@5#6] -- register_copy - jmp __b5 - // [1676] phi from rom_read::@16 to rom_read::@34 [phi:rom_read::@16->rom_read::@34] - // rom_read::@34 - // [1625] phi from rom_read::@34 to rom_read::@5 [phi:rom_read::@34->rom_read::@5] - // [1625] phi rom_read::y#11 = rom_read::y#33 [phi:rom_read::@34->rom_read::@5#0] -- register_copy - // [1625] phi rom_read::rom_row_current#10 = rom_read::rom_row_current#2 [phi:rom_read::@34->rom_read::@5#1] -- register_copy - // [1625] phi rom_read::brom_bank_start#11 = rom_read::brom_bank_start#16 [phi:rom_read::@34->rom_read::@5#2] -- register_copy - // [1625] phi rom_read::rom_address#10 = rom_read::rom_address#1 [phi:rom_read::@34->rom_read::@5#3] -- register_copy - // [1625] phi rom_read::rom_bram_ptr#13 = rom_read::rom_bram_ptr#8 [phi:rom_read::@34->rom_read::@5#4] -- register_copy - // [1625] phi rom_read::rom_bram_bank#10 = rom_read::rom_bram_bank#14 [phi:rom_read::@34->rom_read::@5#5] -- register_copy - // [1625] phi rom_read::rom_file_size#13 = rom_read::rom_file_size#1 [phi:rom_read::@34->rom_read::@5#6] -- register_copy + lda mapbase_offset + adc __conio+$a + sta mapbase_offset + lda mapbase_offset+1 + adc __conio+$a+1 + sta mapbase_offset+1 + // for(register char y=0; y<=__conio.height; y++) + // [1158] screenlayer::y#1 = ++ screenlayer::y#2 -- vbuz1=_inc_vbuz1 + inc.z y + // [1152] phi from screenlayer::@2 to screenlayer::@1 [phi:screenlayer::@2->screenlayer::@1] + // [1152] phi screenlayer::mapbase_offset#2 = screenlayer::mapbase_offset#1 [phi:screenlayer::@2->screenlayer::@1#0] -- register_copy + // [1152] phi screenlayer::y#2 = screenlayer::y#1 [phi:screenlayer::@2->screenlayer::@1#1] -- register_copy + jmp __b1 .segment Data - s: .text "Opening " - .byte 0 - s1: .text " from SD card ..." - .byte 0 - rom_address: .dword 0 - return: .dword 0 - rom_package_read: .word 0 - brom_bank_start: .byte 0 - y: .byte 0 - .label rom_file_size = return - /// Holds the amount of bytes actually read in the memory to be flashed. - rom_row_current: .word 0 - // We start for ROM from 0x0:0x7800 !!!! - rom_bram_bank: .byte 0 - rom_chip: .byte 0 - rom_size: .dword 0 - info_status: .byte 0 + VERA_LAYER_DIM: .byte $1f, $3f, $7f, $ff + VERA_LAYER_SKIP: .word $40, $80, $100, $200 + mapbase: .byte 0 + config: .byte 0 + vera_dc_hscale_temp: .byte 0 + vera_dc_vscale_temp: .byte 0 + mapbase_offset: .word 0 } .segment Code - // rom_verify -// __mem() unsigned long rom_verify(__mem() char rom_chip, __mem() char rom_bank_start, __mem() unsigned long file_size) -rom_verify: { - .label rom_verify__17 = $70 - .label rom_bram_ptr = $47 - // rom_verify::bank_set_bram1 - // BRAM = bank - // [1678] BRAM = 0 -- vbuz1=vbuc1 + // cscroll +// Scroll the entire screen if the cursor is beyond the last line +cscroll: { + // if(__conio.cursor_y>__conio.height) + // [1159] if(*((char *)&__conio+1)<=*((char *)&__conio+7)) goto cscroll::@return -- _deref_pbuc1_le__deref_pbuc2_then_la1 + lda __conio+7 + cmp __conio+1 + bcs __breturn + // cscroll::@1 + // if(__conio.scroll[__conio.layer]) + // [1160] if(0!=((char *)&__conio+$f)[*((char *)&__conio+2)]) goto cscroll::@4 -- 0_neq_pbuc1_derefidx_(_deref_pbuc2)_then_la1 + ldy __conio+2 + lda __conio+$f,y + cmp #0 + bne __b4 + // cscroll::@2 + // if(__conio.cursor_y>__conio.height) + // [1161] if(*((char *)&__conio+1)<=*((char *)&__conio+7)) goto cscroll::@return -- _deref_pbuc1_le__deref_pbuc2_then_la1 + lda __conio+7 + cmp __conio+1 + bcs __breturn + // [1162] phi from cscroll::@2 to cscroll::@3 [phi:cscroll::@2->cscroll::@3] + // cscroll::@3 + // gotoxy(0,0) + // [1163] call gotoxy + // [457] phi from cscroll::@3 to gotoxy [phi:cscroll::@3->gotoxy] + // [457] phi gotoxy::y#26 = 0 [phi:cscroll::@3->gotoxy#0] -- vbum1=vbuc1 lda #0 - sta.z BRAM - // rom_verify::@11 - // unsigned long rom_address = rom_address_from_bank(rom_bank_start) - // [1679] rom_address_from_bank::rom_bank#1 = rom_verify::rom_bank_start#0 - // [1680] call rom_address_from_bank - // [2866] phi from rom_verify::@11 to rom_address_from_bank [phi:rom_verify::@11->rom_address_from_bank] - // [2866] phi rom_address_from_bank::rom_bank#3 = rom_address_from_bank::rom_bank#1 [phi:rom_verify::@11->rom_address_from_bank#0] -- register_copy - jsr rom_address_from_bank - // unsigned long rom_address = rom_address_from_bank(rom_bank_start) - // [1681] rom_address_from_bank::return#3 = rom_address_from_bank::return#0 -- vdum1=vdum2 - lda rom_address_from_bank.return - sta rom_address_from_bank.return_1 - lda rom_address_from_bank.return+1 - sta rom_address_from_bank.return_1+1 - lda rom_address_from_bank.return+2 - sta rom_address_from_bank.return_1+2 - lda rom_address_from_bank.return+3 - sta rom_address_from_bank.return_1+3 - // rom_verify::@12 - // [1682] rom_verify::rom_address#0 = rom_address_from_bank::return#3 - // unsigned long rom_boundary = rom_address + file_size - // [1683] rom_verify::rom_boundary#0 = rom_verify::rom_address#0 + rom_verify::file_size#0 -- vdum1=vdum2_plus_vdum1 - clc - lda rom_boundary - adc rom_address - sta rom_boundary - lda rom_boundary+1 - adc rom_address+1 - sta rom_boundary+1 - lda rom_boundary+2 - adc rom_address+2 - sta rom_boundary+2 - lda rom_boundary+3 - adc rom_address+3 - sta rom_boundary+3 - // display_info_rom(rom_chip, STATUS_COMPARING, "Comparing ...") - // [1684] display_info_rom::rom_chip#1 = rom_verify::rom_chip#0 - // [1685] call display_info_rom - // [1546] phi from rom_verify::@12 to display_info_rom [phi:rom_verify::@12->display_info_rom] - // [1546] phi display_info_rom::info_text#17 = rom_verify::info_text [phi:rom_verify::@12->display_info_rom#0] -- pbuz1=pbuc1 - lda #info_text - sta.z display_info_rom.info_text+1 - // [1546] phi display_info_rom::rom_chip#17 = display_info_rom::rom_chip#1 [phi:rom_verify::@12->display_info_rom#1] -- register_copy - // [1546] phi display_info_rom::info_status#17 = STATUS_COMPARING [phi:rom_verify::@12->display_info_rom#2] -- vbum1=vbuc1 - lda #STATUS_COMPARING - sta display_info_rom.info_status - jsr display_info_rom - // [1686] phi from rom_verify::@12 to rom_verify::@13 [phi:rom_verify::@12->rom_verify::@13] - // rom_verify::@13 - // gotoxy(x, y) - // [1687] call gotoxy - // [802] phi from rom_verify::@13 to gotoxy [phi:rom_verify::@13->gotoxy] - // [802] phi gotoxy::y#37 = PROGRESS_Y [phi:rom_verify::@13->gotoxy#0] -- vbum1=vbuc1 - lda #PROGRESS_Y sta gotoxy.y - // [802] phi gotoxy::x#37 = PROGRESS_X [phi:rom_verify::@13->gotoxy#1] -- vbum1=vbuc1 - lda #PROGRESS_X + // [457] phi gotoxy::x#26 = 0 [phi:cscroll::@3->gotoxy#1] -- vbum1=vbuc1 sta gotoxy.x jsr gotoxy - // [1688] phi from rom_verify::@13 to rom_verify::@1 [phi:rom_verify::@13->rom_verify::@1] - // [1688] phi rom_verify::y#3 = PROGRESS_Y [phi:rom_verify::@13->rom_verify::@1#0] -- vbum1=vbuc1 - lda #PROGRESS_Y - sta y - // [1688] phi rom_verify::progress_row_current#3 = 0 [phi:rom_verify::@13->rom_verify::@1#1] -- vwum1=vwuc1 - lda #<0 - sta progress_row_current - sta progress_row_current+1 - // [1688] phi rom_verify::rom_different_bytes#11 = 0 [phi:rom_verify::@13->rom_verify::@1#2] -- vdum1=vduc1 - sta rom_different_bytes - sta rom_different_bytes+1 - lda #<0>>$10 - sta rom_different_bytes+2 - lda #>0>>$10 - sta rom_different_bytes+3 - // [1688] phi rom_verify::rom_bram_ptr#10 = (char *)$7800 [phi:rom_verify::@13->rom_verify::@1#3] -- pbuz1=pbuc1 - lda #<$7800 - sta.z rom_bram_ptr - lda #>$7800 - sta.z rom_bram_ptr+1 - // [1688] phi rom_verify::rom_bram_bank#11 = 0 [phi:rom_verify::@13->rom_verify::@1#4] -- vbum1=vbuc1 - lda #0 - sta rom_bram_bank - // [1688] phi rom_verify::rom_address#12 = rom_verify::rom_address#0 [phi:rom_verify::@13->rom_verify::@1#5] -- register_copy - // rom_verify::@1 - __b1: - // while (rom_address < rom_boundary) - // [1689] if(rom_verify::rom_address#12rom_compare] - // [2870] phi rom_compare::ptr_ram#10 = rom_compare::ptr_ram#1 [phi:rom_verify::@2->rom_compare#0] -- register_copy - // [2870] phi rom_compare::rom_compare_size#11 = ROM_PROGRESS_CELL [phi:rom_verify::@2->rom_compare#1] -- vwum1=vwuc1 - lda #ROM_PROGRESS_CELL - sta rom_compare.rom_compare_size+1 - // [2870] phi rom_compare::rom_compare_address#3 = rom_compare::rom_compare_address#0 [phi:rom_verify::@2->rom_compare#2] -- register_copy - // [2870] phi rom_compare::bank_set_bram1_bank#0 = rom_compare::bank_ram#0 [phi:rom_verify::@2->rom_compare#3] -- register_copy - jsr rom_compare - // unsigned int equal_bytes = rom_compare(rom_bram_bank, (bram_ptr_t)rom_bram_ptr, rom_address, ROM_PROGRESS_CELL) - // [1695] rom_compare::return#2 = rom_compare::equal_bytes#2 - // rom_verify::@14 - // [1696] rom_verify::equal_bytes#0 = rom_compare::return#2 - // if (progress_row_current == ROM_PROGRESS_ROW) - // [1697] if(rom_verify::progress_row_current#3!=ROM_PROGRESS_ROW) goto rom_verify::@3 -- vwum1_neq_vwuc1_then_la1 - lda progress_row_current+1 - cmp #>ROM_PROGRESS_ROW - bne __b3 - lda progress_row_current - cmp #cscroll::@4] + // cscroll::@4 + __b4: + // insertup(1) + // [1166] call insertup + jsr insertup + // cscroll::@5 + // gotoxy( 0, __conio.height) + // [1167] gotoxy::y#3 = *((char *)&__conio+7) -- vbum1=_deref_pbuc1 + lda __conio+7 sta gotoxy.y - // [1700] call gotoxy - // [802] phi from rom_verify::@8 to gotoxy [phi:rom_verify::@8->gotoxy] - // [802] phi gotoxy::y#37 = gotoxy::y#34 [phi:rom_verify::@8->gotoxy#0] -- register_copy - // [802] phi gotoxy::x#37 = PROGRESS_X [phi:rom_verify::@8->gotoxy#1] -- vbum1=vbuc1 - lda #PROGRESS_X + // [1168] call gotoxy + // [457] phi from cscroll::@5 to gotoxy [phi:cscroll::@5->gotoxy] + // [457] phi gotoxy::y#26 = gotoxy::y#3 [phi:cscroll::@5->gotoxy#0] -- register_copy + // [457] phi gotoxy::x#26 = 0 [phi:cscroll::@5->gotoxy#1] -- vbum1=vbuc1 + lda #0 sta gotoxy.x jsr gotoxy - // [1701] phi from rom_verify::@8 to rom_verify::@3 [phi:rom_verify::@8->rom_verify::@3] - // [1701] phi rom_verify::y#11 = rom_verify::y#1 [phi:rom_verify::@8->rom_verify::@3#0] -- register_copy - // [1701] phi rom_verify::progress_row_current#4 = 0 [phi:rom_verify::@8->rom_verify::@3#1] -- vwum1=vbuc1 - lda #<0 - sta progress_row_current - sta progress_row_current+1 - // [1701] phi from rom_verify::@14 to rom_verify::@3 [phi:rom_verify::@14->rom_verify::@3] - // [1701] phi rom_verify::y#11 = rom_verify::y#3 [phi:rom_verify::@14->rom_verify::@3#0] -- register_copy - // [1701] phi rom_verify::progress_row_current#4 = rom_verify::progress_row_current#3 [phi:rom_verify::@14->rom_verify::@3#1] -- register_copy - // rom_verify::@3 - __b3: - // if (equal_bytes != ROM_PROGRESS_CELL) - // [1702] if(rom_verify::equal_bytes#0!=ROM_PROGRESS_CELL) goto rom_verify::@4 -- vwum1_neq_vwuc1_then_la1 - lda equal_bytes+1 - cmp #>ROM_PROGRESS_CELL - beq !__b4+ - jmp __b4 - !__b4: - lda equal_bytes - cmp #printf_number_buffer] - // [2706] phi printf_number_buffer::putc#10 = &snputc [phi:printf_ulong::@2->printf_number_buffer#0] -- pprz1=pprc1 - lda #snputc - sta.z printf_number_buffer.putc+1 - // [2706] phi printf_number_buffer::buffer_sign#10 = printf_number_buffer::buffer_sign#0 [phi:printf_ulong::@2->printf_number_buffer#1] -- register_copy - // [2706] phi printf_number_buffer::format_zero_padding#10 = printf_number_buffer::format_zero_padding#0 [phi:printf_ulong::@2->printf_number_buffer#2] -- register_copy - // [2706] phi printf_number_buffer::format_min_length#3 = printf_number_buffer::format_min_length#0 [phi:printf_ulong::@2->printf_number_buffer#3] -- register_copy - jsr printf_number_buffer - // printf_ulong::@return - // } - // [1750] return - rts - .segment Data - uvalue: .dword 0 - format_radix: .byte 0 - .label format_min_length = printf_uchar.format_min_length - .label format_zero_padding = printf_uchar.format_zero_padding -} -.segment Code - // rom_flash -// __mem() unsigned long rom_flash(__mem() char rom_chip, __mem() char rom_bank_start, __mem() unsigned long file_size) -rom_flash: { - .label rom_flash__29 = $74 - .label ram_address_sector = $7b - .label ram_address = $5a - // rom_flash::bank_set_bram1 - // BRAM = bank - // [1752] BRAM = 0 -- vbuz1=vbuc1 - lda #0 - sta.z BRAM - // [1753] phi from rom_flash::bank_set_bram1 to rom_flash::@19 [phi:rom_flash::bank_set_bram1->rom_flash::@19] - // rom_flash::@19 - // display_action_progress("Flashing ... (-) equal, (+) flashed, (!) error.") - // [1754] call display_action_progress - // Now we compare the RAM with the actual ROM contents. - // [904] phi from rom_flash::@19 to display_action_progress [phi:rom_flash::@19->display_action_progress] - // [904] phi display_action_progress::info_text#27 = string_0 [phi:rom_flash::@19->display_action_progress#0] -- pbuz1=pbuc1 - lda #string_0 - sta.z display_action_progress.info_text+1 - jsr display_action_progress - // rom_flash::@20 - // unsigned long rom_address_sector = rom_address_from_bank(rom_bank_start) - // [1755] rom_address_from_bank::rom_bank#2 = rom_flash::rom_bank_start#0 - // [1756] call rom_address_from_bank - // [2866] phi from rom_flash::@20 to rom_address_from_bank [phi:rom_flash::@20->rom_address_from_bank] - // [2866] phi rom_address_from_bank::rom_bank#3 = rom_address_from_bank::rom_bank#2 [phi:rom_flash::@20->rom_address_from_bank#0] -- register_copy - jsr rom_address_from_bank - // unsigned long rom_address_sector = rom_address_from_bank(rom_bank_start) - // [1757] rom_address_from_bank::return#4 = rom_address_from_bank::return#0 -- vdum1=vdum2 - lda rom_address_from_bank.return - sta rom_address_from_bank.return_2 - lda rom_address_from_bank.return+1 - sta rom_address_from_bank.return_2+1 - lda rom_address_from_bank.return+2 - sta rom_address_from_bank.return_2+2 - lda rom_address_from_bank.return+3 - sta rom_address_from_bank.return_2+3 - // rom_flash::@21 - // [1758] rom_flash::rom_address_sector#0 = rom_address_from_bank::return#4 - // unsigned long rom_boundary = rom_address_sector + file_size - // [1759] rom_flash::rom_boundary#0 = rom_flash::rom_address_sector#0 + rom_flash::file_size#0 -- vdum1=vdum2_plus_vdum3 - lda rom_address_sector - clc - adc file_size - sta rom_boundary - lda rom_address_sector+1 - adc file_size+1 - sta rom_boundary+1 - lda rom_address_sector+2 - adc file_size+2 - sta rom_boundary+2 - lda rom_address_sector+3 - adc file_size+3 - sta rom_boundary+3 - // display_info_rom(rom_chip, STATUS_FLASHING, "Flashing ...") - // [1760] display_info_rom::rom_chip#2 = rom_flash::rom_chip#0 -- vbum1=vbum2 - lda rom_chip - sta display_info_rom.rom_chip - // [1761] call display_info_rom - // [1546] phi from rom_flash::@21 to display_info_rom [phi:rom_flash::@21->display_info_rom] - // [1546] phi display_info_rom::info_text#17 = info_text1 [phi:rom_flash::@21->display_info_rom#0] -- pbuz1=pbuc1 - lda #info_text1 - sta.z display_info_rom.info_text+1 - // [1546] phi display_info_rom::rom_chip#17 = display_info_rom::rom_chip#2 [phi:rom_flash::@21->display_info_rom#1] -- register_copy - // [1546] phi display_info_rom::info_status#17 = STATUS_FLASHING [phi:rom_flash::@21->display_info_rom#2] -- vbum1=vbuc1 - lda #STATUS_FLASHING - sta display_info_rom.info_status - jsr display_info_rom - // [1762] phi from rom_flash::@21 to rom_flash::@1 [phi:rom_flash::@21->rom_flash::@1] - // [1762] phi rom_flash::flash_errors#12 = 0 [phi:rom_flash::@21->rom_flash::@1#0] -- vdum1=vduc1 - lda #<0 - sta flash_errors - sta flash_errors+1 - lda #<0>>$10 - sta flash_errors+2 - lda #>0>>$10 - sta flash_errors+3 - // [1762] phi rom_flash::y_sector#13 = PROGRESS_Y [phi:rom_flash::@21->rom_flash::@1#1] -- vbum1=vbuc1 - lda #PROGRESS_Y - sta y_sector - // [1762] phi rom_flash::x_sector#10 = PROGRESS_X [phi:rom_flash::@21->rom_flash::@1#2] -- vbum1=vbuc1 - lda #PROGRESS_X - sta x_sector - // [1762] phi rom_flash::ram_address_sector#11 = (char *)$7800 [phi:rom_flash::@21->rom_flash::@1#3] -- pbuz1=pbuc1 - lda #<$7800 - sta.z ram_address_sector - lda #>$7800 - sta.z ram_address_sector+1 - // [1762] phi rom_flash::bram_bank_sector#14 = 0 [phi:rom_flash::@21->rom_flash::@1#4] -- vbum1=vbuc1 - lda #0 - sta bram_bank_sector - // [1762] phi rom_flash::rom_address_sector#13 = rom_flash::rom_address_sector#0 [phi:rom_flash::@21->rom_flash::@1#5] -- register_copy - // rom_flash::@1 + !__b5: + // [1195] phi from display_frame::@36 display_frame::@4 to display_frame::@1 [phi:display_frame::@36/display_frame::@4->display_frame::@1] + // [1195] phi display_frame::x#24 = display_frame::x#30 [phi:display_frame::@36/display_frame::@4->display_frame::@1#0] -- register_copy + // display_frame::@1 __b1: - // while (rom_address_sector < rom_boundary) - // [1763] if(rom_flash::rom_address_sector#13display_action_text_flashed] - // [2926] phi display_action_text_flashed::chip#3 = chip [phi:rom_flash::@3->display_action_text_flashed#0] -- pbuz1=pbuc1 - lda #chip - sta.z display_action_text_flashed.chip+1 - // [2926] phi display_action_text_flashed::bytes#3 = display_action_text_flashed::bytes#2 [phi:rom_flash::@3->display_action_text_flashed#1] -- register_copy - jsr display_action_text_flashed - // [1766] phi from rom_flash::@3 to rom_flash::@23 [phi:rom_flash::@3->rom_flash::@23] - // rom_flash::@23 - // wait_moment(32) - // [1767] call wait_moment - // [1310] phi from rom_flash::@23 to wait_moment [phi:rom_flash::@23->wait_moment] - // [1310] phi wait_moment::w#13 = $20 [phi:rom_flash::@23->wait_moment#0] -- vbum1=vbuc1 - lda #$20 - sta wait_moment.w - jsr wait_moment - // rom_flash::@return - // } - // [1768] return - rts - // rom_flash::@2 - __b2: - // unsigned int equal_bytes = rom_compare(bram_bank_sector, (bram_ptr_t)ram_address_sector, rom_address_sector, ROM_SECTOR) - // [1769] rom_compare::bank_ram#1 = rom_flash::bram_bank_sector#14 -- vbum1=vbum2 - lda bram_bank_sector - sta rom_compare.bank_ram - // [1770] rom_compare::ptr_ram#2 = rom_flash::ram_address_sector#11 -- pbuz1=pbuz2 - lda.z ram_address_sector - sta.z rom_compare.ptr_ram - lda.z ram_address_sector+1 - sta.z rom_compare.ptr_ram+1 - // [1771] rom_compare::rom_compare_address#1 = rom_flash::rom_address_sector#13 -- vdum1=vdum2 - lda rom_address_sector - sta rom_compare.rom_compare_address - lda rom_address_sector+1 - sta rom_compare.rom_compare_address+1 - lda rom_address_sector+2 - sta rom_compare.rom_compare_address+2 - lda rom_address_sector+3 - sta rom_compare.rom_compare_address+3 - // [1772] call rom_compare - // {asm{.byte $db}} - // [2870] phi from rom_flash::@2 to rom_compare [phi:rom_flash::@2->rom_compare] - // [2870] phi rom_compare::ptr_ram#10 = rom_compare::ptr_ram#2 [phi:rom_flash::@2->rom_compare#0] -- register_copy - // [2870] phi rom_compare::rom_compare_size#11 = $1000 [phi:rom_flash::@2->rom_compare#1] -- vwum1=vwuc1 - lda #<$1000 - sta rom_compare.rom_compare_size - lda #>$1000 - sta rom_compare.rom_compare_size+1 - // [2870] phi rom_compare::rom_compare_address#3 = rom_compare::rom_compare_address#1 [phi:rom_flash::@2->rom_compare#2] -- register_copy - // [2870] phi rom_compare::bank_set_bram1_bank#0 = rom_compare::bank_ram#1 [phi:rom_flash::@2->rom_compare#3] -- register_copy - jsr rom_compare - // unsigned int equal_bytes = rom_compare(bram_bank_sector, (bram_ptr_t)ram_address_sector, rom_address_sector, ROM_SECTOR) - // [1773] rom_compare::return#3 = rom_compare::equal_bytes#2 - // rom_flash::@22 - // [1774] rom_flash::equal_bytes#0 = rom_compare::return#3 - // if (equal_bytes != ROM_SECTOR) - // [1775] if(rom_flash::equal_bytes#0!=$1000) goto rom_flash::@5 -- vwum1_neq_vwuc1_then_la1 - lda equal_bytes+1 - cmp #>$1000 - beq !__b3+ - jmp __b3 - !__b3: - lda equal_bytes - cmp #<$1000 - beq !__b3+ - jmp __b3 - !__b3: - // rom_flash::@16 - // cputsxy(x_sector, y_sector, "--------") - // [1776] cputsxy::x#1 = rom_flash::x_sector#10 -- vbum1=vbum2 - lda x_sector - sta cputsxy.x - // [1777] cputsxy::y#1 = rom_flash::y_sector#13 -- vbum1=vbum2 - lda y_sector - sta cputsxy.y - // [1778] call cputsxy - // [897] phi from rom_flash::@16 to cputsxy [phi:rom_flash::@16->cputsxy] - // [897] phi cputsxy::s#4 = rom_flash::s [phi:rom_flash::@16->cputsxy#0] -- pbuz1=pbuc1 - lda #s - sta.z cputsxy.s+1 - // [897] phi cputsxy::y#4 = cputsxy::y#1 [phi:rom_flash::@16->cputsxy#1] -- register_copy - // [897] phi cputsxy::x#4 = cputsxy::x#1 [phi:rom_flash::@16->cputsxy#2] -- register_copy - jsr cputsxy - // [1779] phi from rom_flash::@12 rom_flash::@16 to rom_flash::@4 [phi:rom_flash::@12/rom_flash::@16->rom_flash::@4] - // [1779] phi rom_flash::flash_errors#10 = rom_flash::flash_errors#1 [phi:rom_flash::@12/rom_flash::@16->rom_flash::@4#0] -- register_copy - // rom_flash::@4 - __b4: - // ram_address_sector += ROM_SECTOR - // [1780] rom_flash::ram_address_sector#1 = rom_flash::ram_address_sector#11 + $1000 -- pbuz1=pbuz1_plus_vwuc1 - lda.z ram_address_sector - clc - adc #<$1000 - sta.z ram_address_sector - lda.z ram_address_sector+1 - adc #>$1000 - sta.z ram_address_sector+1 - // rom_address_sector += ROM_SECTOR - // [1781] rom_flash::rom_address_sector#1 = rom_flash::rom_address_sector#13 + $1000 -- vdum1=vdum1_plus_vwuc1 - clc - lda rom_address_sector - adc #<$1000 - sta rom_address_sector - lda rom_address_sector+1 - adc #>$1000 - sta rom_address_sector+1 - lda rom_address_sector+2 - adc #0 - sta rom_address_sector+2 - lda rom_address_sector+3 - adc #0 - sta rom_address_sector+3 - // if (ram_address_sector == BRAM_HIGH) - // [1782] if(rom_flash::ram_address_sector#1!=$c000) goto rom_flash::@13 -- pbuz1_neq_vwuc1_then_la1 - lda.z ram_address_sector+1 - cmp #>$c000 - bne __b13 - lda.z ram_address_sector - cmp #<$c000 - bne __b13 - // rom_flash::@17 - // bram_bank_sector++; - // [1783] rom_flash::bram_bank_sector#1 = ++ rom_flash::bram_bank_sector#14 -- vbum1=_inc_vbum1 - inc bram_bank_sector - // [1784] phi from rom_flash::@17 to rom_flash::@13 [phi:rom_flash::@17->rom_flash::@13] - // [1784] phi rom_flash::bram_bank_sector#40 = rom_flash::bram_bank_sector#1 [phi:rom_flash::@17->rom_flash::@13#0] -- register_copy - // [1784] phi rom_flash::ram_address_sector#8 = (char *)$a000 [phi:rom_flash::@17->rom_flash::@13#1] -- pbuz1=pbuc1 - lda #<$a000 - sta.z ram_address_sector - lda #>$a000 - sta.z ram_address_sector+1 - // [1784] phi from rom_flash::@4 to rom_flash::@13 [phi:rom_flash::@4->rom_flash::@13] - // [1784] phi rom_flash::bram_bank_sector#40 = rom_flash::bram_bank_sector#14 [phi:rom_flash::@4->rom_flash::@13#0] -- register_copy - // [1784] phi rom_flash::ram_address_sector#8 = rom_flash::ram_address_sector#1 [phi:rom_flash::@4->rom_flash::@13#1] -- register_copy - // rom_flash::@13 - __b13: - // if (ram_address_sector == RAM_HIGH) - // [1785] if(rom_flash::ram_address_sector#8!=$9800) goto rom_flash::@36 -- pbuz1_neq_vwuc1_then_la1 - lda.z ram_address_sector+1 - cmp #>$9800 - bne __b14 - lda.z ram_address_sector - cmp #<$9800 - bne __b14 - // [1787] phi from rom_flash::@13 to rom_flash::@14 [phi:rom_flash::@13->rom_flash::@14] - // [1787] phi rom_flash::ram_address_sector#15 = (char *)$a000 [phi:rom_flash::@13->rom_flash::@14#0] -- pbuz1=pbuc1 - lda #<$a000 - sta.z ram_address_sector - lda #>$a000 - sta.z ram_address_sector+1 - // [1787] phi rom_flash::bram_bank_sector#12 = 1 [phi:rom_flash::@13->rom_flash::@14#1] -- vbum1=vbuc1 - lda #1 - sta bram_bank_sector - // [1786] phi from rom_flash::@13 to rom_flash::@36 [phi:rom_flash::@13->rom_flash::@36] - // rom_flash::@36 - // [1787] phi from rom_flash::@36 to rom_flash::@14 [phi:rom_flash::@36->rom_flash::@14] - // [1787] phi rom_flash::ram_address_sector#15 = rom_flash::ram_address_sector#8 [phi:rom_flash::@36->rom_flash::@14#0] -- register_copy - // [1787] phi rom_flash::bram_bank_sector#12 = rom_flash::bram_bank_sector#40 [phi:rom_flash::@36->rom_flash::@14#1] -- register_copy - // rom_flash::@14 - __b14: - // x_sector += 8 - // [1788] rom_flash::x_sector#1 = rom_flash::x_sector#10 + 8 -- vbum1=vbum1_plus_vbuc1 - lda #8 - clc - adc x_sector - sta x_sector - // rom_address_sector % ROM_PROGRESS_ROW - // [1789] rom_flash::$29 = rom_flash::rom_address_sector#1 & ROM_PROGRESS_ROW-1 -- vduz1=vdum2_band_vduc1 - lda rom_address_sector - and #ROM_PROGRESS_ROW-1 - sta.z rom_flash__29+1 - lda rom_address_sector+2 - and #>$10 - sta.z rom_flash__29+2 - lda rom_address_sector+3 - and #>ROM_PROGRESS_ROW-1>>$10 - sta.z rom_flash__29+3 - // if (!(rom_address_sector % ROM_PROGRESS_ROW)) - // [1790] if(0!=rom_flash::$29) goto rom_flash::@15 -- 0_neq_vduz1_then_la1 - lda.z rom_flash__29 - ora.z rom_flash__29+1 - ora.z rom_flash__29+2 - ora.z rom_flash__29+3 - bne __b15 - // rom_flash::@18 - // y_sector++; - // [1791] rom_flash::y_sector#1 = ++ rom_flash::y_sector#13 -- vbum1=_inc_vbum1 - inc y_sector - // [1792] phi from rom_flash::@18 to rom_flash::@15 [phi:rom_flash::@18->rom_flash::@15] - // [1792] phi rom_flash::y_sector#18 = rom_flash::y_sector#1 [phi:rom_flash::@18->rom_flash::@15#0] -- register_copy - // [1792] phi rom_flash::x_sector#20 = PROGRESS_X [phi:rom_flash::@18->rom_flash::@15#1] -- vbum1=vbuc1 - lda #PROGRESS_X - sta x_sector - // [1792] phi from rom_flash::@14 to rom_flash::@15 [phi:rom_flash::@14->rom_flash::@15] - // [1792] phi rom_flash::y_sector#18 = rom_flash::y_sector#13 [phi:rom_flash::@14->rom_flash::@15#0] -- register_copy - // [1792] phi rom_flash::x_sector#20 = rom_flash::x_sector#1 [phi:rom_flash::@14->rom_flash::@15#1] -- register_copy - // rom_flash::@15 - __b15: - // sprintf(info_text, "%u flash errors ...", flash_errors) - // [1793] call snprintf_init - // [1205] phi from rom_flash::@15 to snprintf_init [phi:rom_flash::@15->snprintf_init] - // [1205] phi snprintf_init::s#31 = info_text [phi:rom_flash::@15->snprintf_init#0] -- pbuz1=pbuc1 - lda #info_text - sta.z snprintf_init.s+1 - jsr snprintf_init - // rom_flash::@32 - // sprintf(info_text, "%u flash errors ...", flash_errors) - // [1794] printf_ulong::uvalue#9 = rom_flash::flash_errors#10 -- vdum1=vdum2 - lda flash_errors - sta printf_ulong.uvalue - lda flash_errors+1 - sta printf_ulong.uvalue+1 - lda flash_errors+2 - sta printf_ulong.uvalue+2 - lda flash_errors+3 - sta printf_ulong.uvalue+3 - // [1795] call printf_ulong - // [1741] phi from rom_flash::@32 to printf_ulong [phi:rom_flash::@32->printf_ulong] - // [1741] phi printf_ulong::format_zero_padding#15 = 0 [phi:rom_flash::@32->printf_ulong#0] -- vbum1=vbuc1 - lda #0 - sta printf_ulong.format_zero_padding - // [1741] phi printf_ulong::format_min_length#15 = 0 [phi:rom_flash::@32->printf_ulong#1] -- vbum1=vbuc1 - sta printf_ulong.format_min_length - // [1741] phi printf_ulong::format_radix#15 = DECIMAL [phi:rom_flash::@32->printf_ulong#2] -- vbum1=vbuc1 - lda #DECIMAL - sta printf_ulong.format_radix - // [1741] phi printf_ulong::uvalue#15 = printf_ulong::uvalue#9 [phi:rom_flash::@32->printf_ulong#3] -- register_copy - jsr printf_ulong - // [1796] phi from rom_flash::@32 to rom_flash::@33 [phi:rom_flash::@32->rom_flash::@33] - // rom_flash::@33 - // sprintf(info_text, "%u flash errors ...", flash_errors) - // [1797] call printf_str - // [1210] phi from rom_flash::@33 to printf_str [phi:rom_flash::@33->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:rom_flash::@33->printf_str#0] -- pprz1=pprc1 - lda #snputc - sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = rom_flash::s2 [phi:rom_flash::@33->printf_str#1] -- pbuz1=pbuc1 - lda #s2 - sta.z printf_str.s+1 - jsr printf_str - // rom_flash::@34 - // sprintf(info_text, "%u flash errors ...", flash_errors) - // [1798] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 - lda #0 - pha - // [1799] callexecute snputc -- call_vprc1 - jsr snputc - // sideeffect stackpullpadding(1) -- _stackpullpadding_1 - pla - // display_info_rom(rom_chip, STATUS_FLASHING, info_text) - // [1801] display_info_rom::rom_chip#3 = rom_flash::rom_chip#0 -- vbum1=vbum2 - lda rom_chip - sta display_info_rom.rom_chip - // [1802] call display_info_rom - // [1546] phi from rom_flash::@34 to display_info_rom [phi:rom_flash::@34->display_info_rom] - // [1546] phi display_info_rom::info_text#17 = info_text [phi:rom_flash::@34->display_info_rom#0] -- pbuz1=pbuc1 - lda #info_text - sta.z display_info_rom.info_text+1 - // [1546] phi display_info_rom::rom_chip#17 = display_info_rom::rom_chip#3 [phi:rom_flash::@34->display_info_rom#1] -- register_copy - // [1546] phi display_info_rom::info_status#17 = STATUS_FLASHING [phi:rom_flash::@34->display_info_rom#2] -- vbum1=vbuc1 - lda #STATUS_FLASHING - sta display_info_rom.info_status - jsr display_info_rom - // [1762] phi from rom_flash::@34 to rom_flash::@1 [phi:rom_flash::@34->rom_flash::@1] - // [1762] phi rom_flash::flash_errors#12 = rom_flash::flash_errors#10 [phi:rom_flash::@34->rom_flash::@1#0] -- register_copy - // [1762] phi rom_flash::y_sector#13 = rom_flash::y_sector#18 [phi:rom_flash::@34->rom_flash::@1#1] -- register_copy - // [1762] phi rom_flash::x_sector#10 = rom_flash::x_sector#20 [phi:rom_flash::@34->rom_flash::@1#2] -- register_copy - // [1762] phi rom_flash::ram_address_sector#11 = rom_flash::ram_address_sector#15 [phi:rom_flash::@34->rom_flash::@1#3] -- register_copy - // [1762] phi rom_flash::bram_bank_sector#14 = rom_flash::bram_bank_sector#12 [phi:rom_flash::@34->rom_flash::@1#4] -- register_copy - // [1762] phi rom_flash::rom_address_sector#13 = rom_flash::rom_address_sector#1 [phi:rom_flash::@34->rom_flash::@1#5] -- register_copy - jmp __b1 - // [1803] phi from rom_flash::@22 to rom_flash::@5 [phi:rom_flash::@22->rom_flash::@5] - __b3: - // [1803] phi rom_flash::flash_errors_sector#10 = 0 [phi:rom_flash::@22->rom_flash::@5#0] -- vwum1=vwuc1 - lda #<0 - sta flash_errors_sector - sta flash_errors_sector+1 - // [1803] phi rom_flash::retries#12 = 0 [phi:rom_flash::@22->rom_flash::@5#1] -- vbum1=vbuc1 - sta retries - // [1803] phi from rom_flash::@35 to rom_flash::@5 [phi:rom_flash::@35->rom_flash::@5] - // [1803] phi rom_flash::flash_errors_sector#10 = rom_flash::flash_errors_sector#11 [phi:rom_flash::@35->rom_flash::@5#0] -- register_copy - // [1803] phi rom_flash::retries#12 = rom_flash::retries#1 [phi:rom_flash::@35->rom_flash::@5#1] -- register_copy - // rom_flash::@5 - __b5: - // rom_sector_erase(rom_address_sector) - // [1804] rom_sector_erase::address#0 = rom_flash::rom_address_sector#13 -- vdum1=vdum2 - lda rom_address_sector - sta rom_sector_erase.address - lda rom_address_sector+1 - sta rom_sector_erase.address+1 - lda rom_address_sector+2 - sta rom_sector_erase.address+2 - lda rom_address_sector+3 - sta rom_sector_erase.address+3 - // [1805] call rom_sector_erase - // [2943] phi from rom_flash::@5 to rom_sector_erase [phi:rom_flash::@5->rom_sector_erase] - jsr rom_sector_erase - // rom_flash::@24 - // unsigned long rom_sector_boundary = rom_address_sector + ROM_SECTOR - // [1806] rom_flash::rom_sector_boundary#0 = rom_flash::rom_address_sector#13 + $1000 -- vdum1=vdum2_plus_vwuc1 - clc - lda rom_address_sector - adc #<$1000 - sta rom_sector_boundary - lda rom_address_sector+1 - adc #>$1000 - sta rom_sector_boundary+1 - lda rom_address_sector+2 - adc #0 - sta rom_sector_boundary+2 - lda rom_address_sector+3 - adc #0 - sta rom_sector_boundary+3 - // gotoxy(x, y) - // [1807] gotoxy::x#35 = rom_flash::x_sector#10 -- vbum1=vbum2 - lda x_sector - sta gotoxy.x - // [1808] gotoxy::y#35 = rom_flash::y_sector#13 -- vbum1=vbum2 - lda y_sector - sta gotoxy.y - // [1809] call gotoxy - // [802] phi from rom_flash::@24 to gotoxy [phi:rom_flash::@24->gotoxy] - // [802] phi gotoxy::y#37 = gotoxy::y#35 [phi:rom_flash::@24->gotoxy#0] -- register_copy - // [802] phi gotoxy::x#37 = gotoxy::x#35 [phi:rom_flash::@24->gotoxy#1] -- register_copy - jsr gotoxy - // [1810] phi from rom_flash::@24 to rom_flash::@25 [phi:rom_flash::@24->rom_flash::@25] - // rom_flash::@25 - // printf("........") - // [1811] call printf_str - // [1210] phi from rom_flash::@25 to printf_str [phi:rom_flash::@25->printf_str] - // [1210] phi printf_str::putc#84 = &cputc [phi:rom_flash::@25->printf_str#0] -- pprz1=pprc1 - lda #cputc - sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = rom_flash::s1 [phi:rom_flash::@25->printf_str#1] -- pbuz1=pbuc1 - lda #s1 - sta.z printf_str.s+1 - jsr printf_str - // rom_flash::@26 - // [1812] rom_flash::rom_address#16 = rom_flash::rom_address_sector#13 -- vdum1=vdum2 - lda rom_address_sector - sta rom_address - lda rom_address_sector+1 - sta rom_address+1 - lda rom_address_sector+2 - sta rom_address+2 - lda rom_address_sector+3 - sta rom_address+3 - // [1813] rom_flash::ram_address#16 = rom_flash::ram_address_sector#11 -- pbuz1=pbuz2 - lda.z ram_address_sector - sta.z ram_address - lda.z ram_address_sector+1 - sta.z ram_address+1 - // [1814] rom_flash::x#16 = rom_flash::x_sector#10 -- vbum1=vbum2 - lda x_sector - sta x - // [1815] phi from rom_flash::@10 rom_flash::@26 to rom_flash::@6 [phi:rom_flash::@10/rom_flash::@26->rom_flash::@6] - // [1815] phi rom_flash::x#10 = rom_flash::x#1 [phi:rom_flash::@10/rom_flash::@26->rom_flash::@6#0] -- register_copy - // [1815] phi rom_flash::ram_address#10 = rom_flash::ram_address#1 [phi:rom_flash::@10/rom_flash::@26->rom_flash::@6#1] -- register_copy - // [1815] phi rom_flash::flash_errors_sector#11 = rom_flash::flash_errors_sector#7 [phi:rom_flash::@10/rom_flash::@26->rom_flash::@6#2] -- register_copy - // [1815] phi rom_flash::rom_address#11 = rom_flash::rom_address#1 [phi:rom_flash::@10/rom_flash::@26->rom_flash::@6#3] -- register_copy - // rom_flash::@6 + // display_frame_maskxy(x, y) + // [1196] display_frame_maskxy::x#1 = display_frame::x#24 -- vbum1=vbum2 + lda x_1 + sta display_frame_maskxy.x + // [1197] display_frame_maskxy::y#1 = display_frame::y#0 -- vbum1=vbum2 + lda y + sta display_frame_maskxy.y + // [1198] call display_frame_maskxy + // [1747] phi from display_frame::@1 to display_frame_maskxy [phi:display_frame::@1->display_frame_maskxy] + // [1747] phi display_frame_maskxy::cpeekcxy1_y#0 = display_frame_maskxy::y#1 [phi:display_frame::@1->display_frame_maskxy#0] -- register_copy + // [1747] phi display_frame_maskxy::cpeekcxy1_x#0 = display_frame_maskxy::x#1 [phi:display_frame::@1->display_frame_maskxy#1] -- register_copy + jsr display_frame_maskxy + // display_frame_maskxy(x, y) + // [1199] display_frame_maskxy::return#14 = display_frame_maskxy::return#12 + // display_frame::@16 + // mask = display_frame_maskxy(x, y) + // [1200] display_frame::mask#2 = display_frame_maskxy::return#14 + // mask |= 0b0011 + // [1201] display_frame::mask#3 = display_frame::mask#2 | 3 -- vbum1=vbum1_bor_vbuc1 + lda #3 + ora mask + sta mask + // display_frame_char(mask) + // [1202] display_frame_char::mask#1 = display_frame::mask#3 + // [1203] call display_frame_char + // [1773] phi from display_frame::@16 to display_frame_char [phi:display_frame::@16->display_frame_char] + // [1773] phi display_frame_char::mask#10 = display_frame_char::mask#1 [phi:display_frame::@16->display_frame_char#0] -- register_copy + jsr display_frame_char + // display_frame_char(mask) + // [1204] display_frame_char::return#14 = display_frame_char::return#12 + // display_frame::@17 + // c = display_frame_char(mask) + // [1205] display_frame::c#1 = display_frame_char::return#14 + // cputcxy(x, y, c) + // [1206] cputcxy::x#3 = display_frame::x#24 -- vbum1=vbum2 + lda x_1 + sta cputcxy.x + // [1207] cputcxy::y#3 = display_frame::y#0 -- vbum1=vbum2 + lda y + sta cputcxy.y + // [1208] cputcxy::c#3 = display_frame::c#1 + // [1209] call cputcxy + // [1346] phi from display_frame::@17 to cputcxy [phi:display_frame::@17->cputcxy] + // [1346] phi cputcxy::c#15 = cputcxy::c#3 [phi:display_frame::@17->cputcxy#0] -- register_copy + // [1346] phi cputcxy::y#15 = cputcxy::y#3 [phi:display_frame::@17->cputcxy#1] -- register_copy + // [1346] phi cputcxy::x#15 = cputcxy::x#3 [phi:display_frame::@17->cputcxy#2] -- register_copy + jsr cputcxy + // display_frame::@18 + // if(h>=2) + // [1210] if(display_frame::h#0<2) goto display_frame::@return -- vbum1_lt_vbuc1_then_la1 + lda h + cmp #2 + bcc __breturn + // display_frame::@3 + // y++; + // [1211] display_frame::y#1 = ++ display_frame::y#0 -- vbum1=_inc_vbum2 + lda y + inc + sta y_1 + // [1212] phi from display_frame::@27 display_frame::@3 to display_frame::@6 [phi:display_frame::@27/display_frame::@3->display_frame::@6] + // [1212] phi display_frame::y#10 = display_frame::y#2 [phi:display_frame::@27/display_frame::@3->display_frame::@6#0] -- register_copy + // display_frame::@6 __b6: - // while (rom_address < rom_sector_boundary) - // [1816] if(rom_flash::rom_address#11display_action_text_flashing] - // [2955] phi display_action_text_flashing::address#10 = display_action_text_flashing::address#2 [phi:rom_flash::@7->display_action_text_flashing#0] -- register_copy - // [2955] phi display_action_text_flashing::chip#10 = chip [phi:rom_flash::@7->display_action_text_flashing#1] -- pbuz1=pbuc1 - lda #chip - sta.z display_action_text_flashing.chip+1 - // [2955] phi display_action_text_flashing::bram_ptr#3 = display_action_text_flashing::bram_ptr#2 [phi:rom_flash::@7->display_action_text_flashing#2] -- register_copy - // [2955] phi display_action_text_flashing::bram_bank#3 = display_action_text_flashing::bram_bank#2 [phi:rom_flash::@7->display_action_text_flashing#3] -- register_copy - // [2955] phi display_action_text_flashing::bytes#3 = $1000 [phi:rom_flash::@7->display_action_text_flashing#4] -- vdum1=vduc1 - lda #<$1000 - sta display_action_text_flashing.bytes - lda #>$1000 - sta display_action_text_flashing.bytes+1 - lda #<$1000>>$10 - sta display_action_text_flashing.bytes+2 - lda #>$1000>>$10 - sta display_action_text_flashing.bytes+3 - jsr display_action_text_flashing - // rom_flash::@27 - // unsigned long written_bytes = rom_write(bram_bank, (bram_ptr_t)ram_address, rom_address, ROM_PROGRESS_CELL) - // [1825] rom_write::flash_ram_bank#0 = rom_flash::bram_bank_sector#14 -- vbum1=vbum2 - lda bram_bank_sector - sta rom_write.flash_ram_bank - // [1826] rom_write::flash_ram_address#1 = rom_flash::ram_address#10 -- pbuz1=pbuz2 - lda.z ram_address - sta.z rom_write.flash_ram_address - lda.z ram_address+1 - sta.z rom_write.flash_ram_address+1 - // [1827] rom_write::flash_rom_address#1 = rom_flash::rom_address#11 -- vdum1=vdum2 - lda rom_address - sta rom_write.flash_rom_address - lda rom_address+1 - sta rom_write.flash_rom_address+1 - lda rom_address+2 - sta rom_write.flash_rom_address+2 - lda rom_address+3 - sta rom_write.flash_rom_address+3 - // [1828] call rom_write - jsr rom_write - // rom_flash::@28 - // rom_compare(bram_bank, (bram_ptr_t)ram_address, rom_address, ROM_PROGRESS_CELL) - // [1829] rom_compare::bank_ram#2 = rom_flash::bram_bank_sector#14 -- vbum1=vbum2 - lda bram_bank_sector - sta rom_compare.bank_ram - // [1830] rom_compare::ptr_ram#3 = rom_flash::ram_address#10 -- pbuz1=pbuz2 - lda.z ram_address - sta.z rom_compare.ptr_ram - lda.z ram_address+1 - sta.z rom_compare.ptr_ram+1 - // [1831] rom_compare::rom_compare_address#2 = rom_flash::rom_address#11 -- vdum1=vdum2 - lda rom_address - sta rom_compare.rom_compare_address - lda rom_address+1 - sta rom_compare.rom_compare_address+1 - lda rom_address+2 - sta rom_compare.rom_compare_address+2 - lda rom_address+3 - sta rom_compare.rom_compare_address+3 - // [1832] call rom_compare - // [2870] phi from rom_flash::@28 to rom_compare [phi:rom_flash::@28->rom_compare] - // [2870] phi rom_compare::ptr_ram#10 = rom_compare::ptr_ram#3 [phi:rom_flash::@28->rom_compare#0] -- register_copy - // [2870] phi rom_compare::rom_compare_size#11 = ROM_PROGRESS_CELL [phi:rom_flash::@28->rom_compare#1] -- vwum1=vwuc1 - lda #ROM_PROGRESS_CELL - sta rom_compare.rom_compare_size+1 - // [2870] phi rom_compare::rom_compare_address#3 = rom_compare::rom_compare_address#2 [phi:rom_flash::@28->rom_compare#2] -- register_copy - // [2870] phi rom_compare::bank_set_bram1_bank#0 = rom_compare::bank_ram#2 [phi:rom_flash::@28->rom_compare#3] -- register_copy - jsr rom_compare - // rom_compare(bram_bank, (bram_ptr_t)ram_address, rom_address, ROM_PROGRESS_CELL) - // [1833] rom_compare::return#4 = rom_compare::equal_bytes#2 - // rom_flash::@29 - // equal_bytes = rom_compare(bram_bank, (bram_ptr_t)ram_address, rom_address, ROM_PROGRESS_CELL) - // [1834] rom_flash::equal_bytes#1 = rom_compare::return#4 -- vwum1=vwum2 - lda rom_compare.return - sta equal_bytes_1 - lda rom_compare.return+1 - sta equal_bytes_1+1 - // gotoxy(x, y) - // [1835] gotoxy::x#36 = rom_flash::x#10 -- vbum1=vbum2 + // while(y < y1) + // [1213] if(display_frame::y#10gotoxy] - // [802] phi gotoxy::y#37 = gotoxy::y#36 [phi:rom_flash::@29->gotoxy#0] -- register_copy - // [802] phi gotoxy::x#37 = gotoxy::x#36 [phi:rom_flash::@29->gotoxy#1] -- register_copy - jsr gotoxy - // rom_flash::@30 - // if (equal_bytes != ROM_PROGRESS_CELL) - // [1838] if(rom_flash::equal_bytes#1!=ROM_PROGRESS_CELL) goto rom_flash::@9 -- vwum1_neq_vwuc1_then_la1 - lda equal_bytes_1+1 - cmp #>ROM_PROGRESS_CELL - bne __b9 - lda equal_bytes_1 - cmp #display_frame_maskxy] + // [1747] phi display_frame_maskxy::cpeekcxy1_y#0 = display_frame_maskxy::y#5 [phi:display_frame::@8->display_frame_maskxy#0] -- register_copy + // [1747] phi display_frame_maskxy::cpeekcxy1_x#0 = display_frame_maskxy::x#5 [phi:display_frame::@8->display_frame_maskxy#1] -- register_copy + jsr display_frame_maskxy + // display_frame_maskxy(x, y) + // [1217] display_frame_maskxy::return#18 = display_frame_maskxy::return#12 + // display_frame::@28 + // mask = display_frame_maskxy(x, y) + // [1218] display_frame::mask#10 = display_frame_maskxy::return#18 + // mask |= 0b1100 + // [1219] display_frame::mask#11 = display_frame::mask#10 | $c -- vbum1=vbum1_bor_vbuc1 + lda #$c + ora mask + sta mask + // display_frame_char(mask) + // [1220] display_frame_char::mask#5 = display_frame::mask#11 + // [1221] call display_frame_char + // [1773] phi from display_frame::@28 to display_frame_char [phi:display_frame::@28->display_frame_char] + // [1773] phi display_frame_char::mask#10 = display_frame_char::mask#5 [phi:display_frame::@28->display_frame_char#0] -- register_copy + jsr display_frame_char + // display_frame_char(mask) + // [1222] display_frame_char::return#18 = display_frame_char::return#12 + // display_frame::@29 + // c = display_frame_char(mask) + // [1223] display_frame::c#5 = display_frame_char::return#18 + // cputcxy(x, y, c) + // [1224] cputcxy::x#7 = display_frame::x#0 -- vbum1=vbum2 lda x sta cputcxy.x - // [1840] cputcxy::y#16 = rom_flash::y_sector#13 -- vbum1=vbum2 - lda y_sector + // [1225] cputcxy::y#7 = display_frame::y#10 -- vbum1=vbum2 + lda y_1 sta cputcxy.y - // [1841] call cputcxy - // [2293] phi from rom_flash::@11 to cputcxy [phi:rom_flash::@11->cputcxy] - // [2293] phi cputcxy::c#17 = '+' [phi:rom_flash::@11->cputcxy#0] -- vbum1=vbuc1 - lda #'+' - sta cputcxy.c - // [2293] phi cputcxy::y#17 = cputcxy::y#16 [phi:rom_flash::@11->cputcxy#1] -- register_copy - // [2293] phi cputcxy::x#17 = cputcxy::x#16 [phi:rom_flash::@11->cputcxy#2] -- register_copy + // [1226] cputcxy::c#7 = display_frame::c#5 + // [1227] call cputcxy + // [1346] phi from display_frame::@29 to cputcxy [phi:display_frame::@29->cputcxy] + // [1346] phi cputcxy::c#15 = cputcxy::c#7 [phi:display_frame::@29->cputcxy#0] -- register_copy + // [1346] phi cputcxy::y#15 = cputcxy::y#7 [phi:display_frame::@29->cputcxy#1] -- register_copy + // [1346] phi cputcxy::x#15 = cputcxy::x#7 [phi:display_frame::@29->cputcxy#2] -- register_copy jsr cputcxy - // [1842] phi from rom_flash::@11 rom_flash::@31 to rom_flash::@10 [phi:rom_flash::@11/rom_flash::@31->rom_flash::@10] - // [1842] phi rom_flash::flash_errors_sector#7 = rom_flash::flash_errors_sector#11 [phi:rom_flash::@11/rom_flash::@31->rom_flash::@10#0] -- register_copy - // rom_flash::@10 - __b10: - // ram_address += ROM_PROGRESS_CELL - // [1843] rom_flash::ram_address#1 = rom_flash::ram_address#10 + ROM_PROGRESS_CELL -- pbuz1=pbuz1_plus_vwuc1 - lda.z ram_address - clc - adc #ROM_PROGRESS_CELL - sta.z ram_address+1 - // rom_address += ROM_PROGRESS_CELL - // [1844] rom_flash::rom_address#1 = rom_flash::rom_address#11 + ROM_PROGRESS_CELL -- vdum1=vdum1_plus_vwuc1 - clc - lda rom_address - adc #ROM_PROGRESS_CELL - sta rom_address+1 - lda rom_address+2 - adc #0 - sta rom_address+2 - lda rom_address+3 - adc #0 - sta rom_address+3 + // display_frame::@30 + // if(w>=2) + // [1228] if(display_frame::w#0<2) goto display_frame::@10 -- vbum1_lt_vbuc1_then_la1 + lda w + cmp #2 + bcc __b10 + // display_frame::@9 // x++; - // [1845] rom_flash::x#1 = ++ rom_flash::x#10 -- vbum1=_inc_vbum1 + // [1229] display_frame::x#4 = ++ display_frame::x#0 -- vbum1=_inc_vbum1 inc x - jmp __b6 - // rom_flash::@9 - __b9: - // cputcxy(x,y,'!') - // [1846] cputcxy::x#15 = rom_flash::x#10 -- vbum1=vbum2 + // [1230] phi from display_frame::@35 display_frame::@9 to display_frame::@11 [phi:display_frame::@35/display_frame::@9->display_frame::@11] + // [1230] phi display_frame::x#18 = display_frame::x#5 [phi:display_frame::@35/display_frame::@9->display_frame::@11#0] -- register_copy + // display_frame::@11 + __b11: + // while(x < x1) + // [1231] if(display_frame::x#18display_frame::@10] + // [1232] phi display_frame::x#15 = display_frame::x#18 [phi:display_frame::@11/display_frame::@30->display_frame::@10#0] -- register_copy + // display_frame::@10 + __b10: + // display_frame_maskxy(x, y) + // [1233] display_frame_maskxy::x#6 = display_frame::x#15 -- vbum1=vbum2 + lda x + sta display_frame_maskxy.x + // [1234] display_frame_maskxy::y#6 = display_frame::y#10 -- vbum1=vbum2 + lda y_1 + sta display_frame_maskxy.y + // [1235] call display_frame_maskxy + // [1747] phi from display_frame::@10 to display_frame_maskxy [phi:display_frame::@10->display_frame_maskxy] + // [1747] phi display_frame_maskxy::cpeekcxy1_y#0 = display_frame_maskxy::y#6 [phi:display_frame::@10->display_frame_maskxy#0] -- register_copy + // [1747] phi display_frame_maskxy::cpeekcxy1_x#0 = display_frame_maskxy::x#6 [phi:display_frame::@10->display_frame_maskxy#1] -- register_copy + jsr display_frame_maskxy + // display_frame_maskxy(x, y) + // [1236] display_frame_maskxy::return#19 = display_frame_maskxy::return#12 + // display_frame::@31 + // mask = display_frame_maskxy(x, y) + // [1237] display_frame::mask#12 = display_frame_maskxy::return#19 + // mask |= 0b1001 + // [1238] display_frame::mask#13 = display_frame::mask#12 | 9 -- vbum1=vbum1_bor_vbuc1 + lda #9 + ora mask + sta mask + // display_frame_char(mask) + // [1239] display_frame_char::mask#6 = display_frame::mask#13 + // [1240] call display_frame_char + // [1773] phi from display_frame::@31 to display_frame_char [phi:display_frame::@31->display_frame_char] + // [1773] phi display_frame_char::mask#10 = display_frame_char::mask#6 [phi:display_frame::@31->display_frame_char#0] -- register_copy + jsr display_frame_char + // display_frame_char(mask) + // [1241] display_frame_char::return#19 = display_frame_char::return#12 + // display_frame::@32 + // c = display_frame_char(mask) + // [1242] display_frame::c#6 = display_frame_char::return#19 + // cputcxy(x, y, c) + // [1243] cputcxy::x#8 = display_frame::x#15 -- vbum1=vbum2 lda x sta cputcxy.x - // [1847] cputcxy::y#15 = rom_flash::y_sector#13 -- vbum1=vbum2 - lda y_sector + // [1244] cputcxy::y#8 = display_frame::y#10 -- vbum1=vbum2 + lda y_1 sta cputcxy.y - // [1848] call cputcxy - // [2293] phi from rom_flash::@9 to cputcxy [phi:rom_flash::@9->cputcxy] - // [2293] phi cputcxy::c#17 = '!' [phi:rom_flash::@9->cputcxy#0] -- vbum1=vbuc1 - lda #'!' - sta cputcxy.c - // [2293] phi cputcxy::y#17 = cputcxy::y#15 [phi:rom_flash::@9->cputcxy#1] -- register_copy - // [2293] phi cputcxy::x#17 = cputcxy::x#15 [phi:rom_flash::@9->cputcxy#2] -- register_copy + // [1245] cputcxy::c#8 = display_frame::c#6 + // [1246] call cputcxy + // [1346] phi from display_frame::@32 to cputcxy [phi:display_frame::@32->cputcxy] + // [1346] phi cputcxy::c#15 = cputcxy::c#8 [phi:display_frame::@32->cputcxy#0] -- register_copy + // [1346] phi cputcxy::y#15 = cputcxy::y#8 [phi:display_frame::@32->cputcxy#1] -- register_copy + // [1346] phi cputcxy::x#15 = cputcxy::x#8 [phi:display_frame::@32->cputcxy#2] -- register_copy jsr cputcxy - // rom_flash::@31 - // flash_errors_sector++; - // [1849] rom_flash::flash_errors_sector#1 = ++ rom_flash::flash_errors_sector#11 -- vwum1=_inc_vwum1 - inc flash_errors_sector - bne !+ - inc flash_errors_sector+1 - !: - jmp __b10 - .segment Data - s: .text "--------" - .byte 0 - s1: .text "........" - .byte 0 - s2: .text " flash errors ..." - .byte 0 - rom_address_sector: .dword 0 - rom_boundary: .dword 0 - .label equal_bytes = rom_compare.equal_bytes - rom_sector_boundary: .dword 0 - equal_bytes_1: .word 0 - retries: .byte 0 - flash_errors_sector: .word 0 - rom_address: .dword 0 - x: .byte 0 - flash_errors: .dword 0 - // We start for ROM from 0x0:0x7800 !!!! - bram_bank_sector: .byte 0 - x_sector: .byte 0 - y_sector: .byte 0 - rom_chip: .byte 0 - .label rom_bank_start = rom_address_from_bank.rom_bank - file_size: .dword 0 - .label return = flash_errors -} -.segment Code - // smc_flash -/** - * @brief Flash the SMC using the new firmware stored in RAM. - * The bootloader starts from address 0x1E00 in the SMC, and should never be overwritten! - * The flashing starts by pressing the POWER and RESET button on the CX16 board simultaneously. - * - * @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(__mem() unsigned int smc_bytes_total) -smc_flash: { - .const smc_bram_bank = 1 - .label smc_flash__29 = $78 - .label smc_flash__30 = $78 - .label smc_bram_ptr = $6e - // smc_flash::bank_set_bram1 - // BRAM = bank - // [1851] BRAM = smc_flash::smc_bram_bank -- vbuz1=vbuc1 - lda #smc_bram_bank - sta.z BRAM - // [1852] phi from smc_flash::bank_set_bram1 to smc_flash::@24 [phi:smc_flash::bank_set_bram1->smc_flash::@24] - // smc_flash::@24 - // display_action_progress("To start the SMC update, do the following ...") - // [1853] call display_action_progress - // [904] phi from smc_flash::@24 to display_action_progress [phi:smc_flash::@24->display_action_progress] - // [904] phi display_action_progress::info_text#27 = smc_flash::info_text [phi:smc_flash::@24->display_action_progress#0] -- pbuz1=pbuc1 - lda #info_text - sta.z display_action_progress.info_text+1 - jsr display_action_progress - // smc_flash::@28 - // unsigned char smc_bootloader_start = cx16_k_i2c_write_byte(FLASH_I2C_SMC_DEVICE, FLASH_I2C_SMC_BOOTLOADER_RESET, 0x31) - // [1854] smc_flash::cx16_k_i2c_write_byte1_device = $42 -- vbum1=vbuc1 - lda #$42 - sta cx16_k_i2c_write_byte1_device - // [1855] smc_flash::cx16_k_i2c_write_byte1_offset = $8f -- vbum1=vbuc1 - lda #$8f - sta cx16_k_i2c_write_byte1_offset - // [1856] smc_flash::cx16_k_i2c_write_byte1_value = $31 -- vbum1=vbuc1 - lda #$31 - sta cx16_k_i2c_write_byte1_value - // smc_flash::cx16_k_i2c_write_byte1 - // unsigned char result - // [1857] smc_flash::cx16_k_i2c_write_byte1_result = 0 -- vbum1=vbuc1 - lda #0 - sta cx16_k_i2c_write_byte1_result - // asm - // asm { ldxdevice ldyoffset ldavalue stzresult jsrCX16_I2C_WRITE_BYTE rolresult } - ldx cx16_k_i2c_write_byte1_device - ldy cx16_k_i2c_write_byte1_offset - lda cx16_k_i2c_write_byte1_value - stz cx16_k_i2c_write_byte1_result - jsr CX16_I2C_WRITE_BYTE - rol cx16_k_i2c_write_byte1_result - // return result; - // [1859] smc_flash::cx16_k_i2c_write_byte1_return#0 = smc_flash::cx16_k_i2c_write_byte1_result -- vbum1=vbum2 - lda cx16_k_i2c_write_byte1_result - sta cx16_k_i2c_write_byte1_return - // smc_flash::cx16_k_i2c_write_byte1_@return + // display_frame::@return + __breturn: // } - // [1860] smc_flash::cx16_k_i2c_write_byte1_return#1 = smc_flash::cx16_k_i2c_write_byte1_return#0 - // smc_flash::@25 - // unsigned char smc_bootloader_start = cx16_k_i2c_write_byte(FLASH_I2C_SMC_DEVICE, FLASH_I2C_SMC_BOOTLOADER_RESET, 0x31) - // [1861] smc_flash::smc_bootloader_start#0 = smc_flash::cx16_k_i2c_write_byte1_return#1 - // if(smc_bootloader_start) - // [1862] if(0==smc_flash::smc_bootloader_start#0) goto smc_flash::@3 -- 0_eq_vbum1_then_la1 - lda smc_bootloader_start - beq __b6 - // [1863] phi from smc_flash::@25 to smc_flash::@2 [phi:smc_flash::@25->smc_flash::@2] - // smc_flash::@2 - // sprintf(info_text, "There was a problem starting the SMC bootloader: %x", smc_bootloader_start) - // [1864] call snprintf_init - // [1205] phi from smc_flash::@2 to snprintf_init [phi:smc_flash::@2->snprintf_init] - // [1205] phi snprintf_init::s#31 = info_text [phi:smc_flash::@2->snprintf_init#0] -- pbuz1=pbuc1 - lda #<@info_text - sta.z snprintf_init.s - lda #>@info_text - sta.z snprintf_init.s+1 - jsr snprintf_init - // [1865] phi from smc_flash::@2 to smc_flash::@29 [phi:smc_flash::@2->smc_flash::@29] - // smc_flash::@29 - // sprintf(info_text, "There was a problem starting the SMC bootloader: %x", smc_bootloader_start) - // [1866] call printf_str - // [1210] phi from smc_flash::@29 to printf_str [phi:smc_flash::@29->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:smc_flash::@29->printf_str#0] -- pprz1=pprc1 - lda #snputc - sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = smc_flash::s [phi:smc_flash::@29->printf_str#1] -- pbuz1=pbuc1 - lda #s - sta.z printf_str.s+1 - jsr printf_str - // smc_flash::@30 - // sprintf(info_text, "There was a problem starting the SMC bootloader: %x", smc_bootloader_start) - // [1867] printf_uchar::uvalue#10 = smc_flash::smc_bootloader_start#0 -- vbum1=vbum2 - lda smc_bootloader_start - sta printf_uchar.uvalue - // [1868] call printf_uchar - // [1346] phi from smc_flash::@30 to printf_uchar [phi:smc_flash::@30->printf_uchar] - // [1346] phi printf_uchar::format_zero_padding#18 = 0 [phi:smc_flash::@30->printf_uchar#0] -- vbum1=vbuc1 - lda #0 - sta printf_uchar.format_zero_padding - // [1346] phi printf_uchar::format_min_length#18 = 0 [phi:smc_flash::@30->printf_uchar#1] -- vbum1=vbuc1 - sta printf_uchar.format_min_length - // [1346] phi printf_uchar::putc#18 = &snputc [phi:smc_flash::@30->printf_uchar#2] -- pprz1=pprc1 - lda #snputc - sta.z printf_uchar.putc+1 - // [1346] phi printf_uchar::format_radix#18 = HEXADECIMAL [phi:smc_flash::@30->printf_uchar#3] -- vbum1=vbuc1 - lda #HEXADECIMAL - sta printf_uchar.format_radix - // [1346] phi printf_uchar::uvalue#18 = printf_uchar::uvalue#10 [phi:smc_flash::@30->printf_uchar#4] -- register_copy - jsr printf_uchar - // smc_flash::@31 - // sprintf(info_text, "There was a problem starting the SMC bootloader: %x", smc_bootloader_start) - // [1869] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 - lda #0 - pha - // [1870] callexecute snputc -- call_vprc1 - jsr snputc - // sideeffect stackpullpadding(1) -- _stackpullpadding_1 - pla - // display_action_text(info_text) - // [1872] call display_action_text - // [1357] phi from smc_flash::@31 to display_action_text [phi:smc_flash::@31->display_action_text] - // [1357] phi display_action_text::info_text#25 = info_text [phi:smc_flash::@31->display_action_text#0] -- pbuz1=pbuc1 - lda #<@info_text - sta.z display_action_text.info_text - lda #>@info_text - sta.z display_action_text.info_text+1 - jsr display_action_text - // smc_flash::@32 - // cx16_k_i2c_write_byte(FLASH_I2C_SMC_DEVICE, FLASH_I2C_SMC_REBOOT, 0) - // [1873] smc_flash::cx16_k_i2c_write_byte2_device = $42 -- vbum1=vbuc1 - lda #$42 - sta cx16_k_i2c_write_byte2_device - // [1874] smc_flash::cx16_k_i2c_write_byte2_offset = $82 -- vbum1=vbuc1 - lda #$82 - sta cx16_k_i2c_write_byte2_offset - // [1875] smc_flash::cx16_k_i2c_write_byte2_value = 0 -- vbum1=vbuc1 - lda #0 - sta cx16_k_i2c_write_byte2_value - // smc_flash::cx16_k_i2c_write_byte2 - // unsigned char result - // [1876] smc_flash::cx16_k_i2c_write_byte2_result = 0 -- vbum1=vbuc1 - sta cx16_k_i2c_write_byte2_result - // asm - // asm { ldxdevice ldyoffset ldavalue stzresult jsrCX16_I2C_WRITE_BYTE rolresult } - ldx cx16_k_i2c_write_byte2_device - ldy cx16_k_i2c_write_byte2_offset - lda cx16_k_i2c_write_byte2_value - stz cx16_k_i2c_write_byte2_result - jsr CX16_I2C_WRITE_BYTE - rol cx16_k_i2c_write_byte2_result - // [1878] phi from smc_flash::@50 smc_flash::cx16_k_i2c_write_byte2 to smc_flash::@return [phi:smc_flash::@50/smc_flash::cx16_k_i2c_write_byte2->smc_flash::@return] - __b2: - // [1878] phi smc_flash::return#1 = 0 [phi:smc_flash::@50/smc_flash::cx16_k_i2c_write_byte2->smc_flash::@return#0] -- vwum1=vbuc1 - lda #<0 - sta return - sta return+1 - // smc_flash::@return - // } - // [1879] return + // [1247] return rts - // [1880] phi from smc_flash::@25 to smc_flash::@3 [phi:smc_flash::@25->smc_flash::@3] - __b6: - // [1880] phi smc_flash::smc_bootloader_activation_countdown#10 = $80 [phi:smc_flash::@25->smc_flash::@3#0] -- vbum1=vbuc1 - lda #$80 - sta smc_bootloader_activation_countdown - // smc_flash::@3 - __b3: - // while(smc_bootloader_activation_countdown) - // [1881] if(0!=smc_flash::smc_bootloader_activation_countdown#10) goto smc_flash::@4 -- 0_neq_vbum1_then_la1 - lda smc_bootloader_activation_countdown - beq !__b4+ - jmp __b4 - !__b4: - // [1882] phi from smc_flash::@3 smc_flash::@33 to smc_flash::@7 [phi:smc_flash::@3/smc_flash::@33->smc_flash::@7] - __b9: - // [1882] phi smc_flash::smc_bootloader_activation_countdown#12 = $a [phi:smc_flash::@3/smc_flash::@33->smc_flash::@7#0] -- vbum1=vbuc1 - lda #$a - sta smc_bootloader_activation_countdown_1 - // smc_flash::@7 + // display_frame::@12 + __b12: + // display_frame_maskxy(x, y) + // [1248] display_frame_maskxy::x#7 = display_frame::x#18 -- vbum1=vbum2 + lda x + sta display_frame_maskxy.x + // [1249] display_frame_maskxy::y#7 = display_frame::y#10 -- vbum1=vbum2 + lda y_1 + sta display_frame_maskxy.y + // [1250] call display_frame_maskxy + // [1747] phi from display_frame::@12 to display_frame_maskxy [phi:display_frame::@12->display_frame_maskxy] + // [1747] phi display_frame_maskxy::cpeekcxy1_y#0 = display_frame_maskxy::y#7 [phi:display_frame::@12->display_frame_maskxy#0] -- register_copy + // [1747] phi display_frame_maskxy::cpeekcxy1_x#0 = display_frame_maskxy::x#7 [phi:display_frame::@12->display_frame_maskxy#1] -- register_copy + jsr display_frame_maskxy + // display_frame_maskxy(x, y) + // [1251] display_frame_maskxy::return#20 = display_frame_maskxy::return#12 + // display_frame::@33 + // mask = display_frame_maskxy(x, y) + // [1252] display_frame::mask#14 = display_frame_maskxy::return#20 + // mask |= 0b0101 + // [1253] display_frame::mask#15 = display_frame::mask#14 | 5 -- vbum1=vbum1_bor_vbuc1 + lda #5 + ora mask + sta mask + // display_frame_char(mask) + // [1254] display_frame_char::mask#7 = display_frame::mask#15 + // [1255] call display_frame_char + // [1773] phi from display_frame::@33 to display_frame_char [phi:display_frame::@33->display_frame_char] + // [1773] phi display_frame_char::mask#10 = display_frame_char::mask#7 [phi:display_frame::@33->display_frame_char#0] -- register_copy + jsr display_frame_char + // display_frame_char(mask) + // [1256] display_frame_char::return#20 = display_frame_char::return#12 + // display_frame::@34 + // c = display_frame_char(mask) + // [1257] display_frame::c#7 = display_frame_char::return#20 + // cputcxy(x, y, c) + // [1258] cputcxy::x#9 = display_frame::x#18 -- vbum1=vbum2 + lda x + sta cputcxy.x + // [1259] cputcxy::y#9 = display_frame::y#10 -- vbum1=vbum2 + lda y_1 + sta cputcxy.y + // [1260] cputcxy::c#9 = display_frame::c#7 + // [1261] call cputcxy + // [1346] phi from display_frame::@34 to cputcxy [phi:display_frame::@34->cputcxy] + // [1346] phi cputcxy::c#15 = cputcxy::c#9 [phi:display_frame::@34->cputcxy#0] -- register_copy + // [1346] phi cputcxy::y#15 = cputcxy::y#9 [phi:display_frame::@34->cputcxy#1] -- register_copy + // [1346] phi cputcxy::x#15 = cputcxy::x#9 [phi:display_frame::@34->cputcxy#2] -- register_copy + jsr cputcxy + // display_frame::@35 + // x++; + // [1262] display_frame::x#5 = ++ display_frame::x#18 -- vbum1=_inc_vbum1 + inc x + jmp __b11 + // display_frame::@7 __b7: - // while(smc_bootloader_activation_countdown) - // [1883] if(0!=smc_flash::smc_bootloader_activation_countdown#12) goto smc_flash::@8 -- 0_neq_vbum1_then_la1 - lda smc_bootloader_activation_countdown_1 - beq !__b8+ - jmp __b8 - !__b8: - // smc_flash::@9 - // cx16_k_i2c_read_byte(FLASH_I2C_SMC_DEVICE, FLASH_I2C_SMC_OFFSET) - // [1884] cx16_k_i2c_read_byte::device = $42 -- vbum1=vbuc1 - lda #$42 - sta cx16_k_i2c_read_byte.device - // [1885] cx16_k_i2c_read_byte::offset = $8e -- vbum1=vbuc1 - lda #$8e - sta cx16_k_i2c_read_byte.offset - // [1886] call cx16_k_i2c_read_byte - jsr cx16_k_i2c_read_byte - // [1887] cx16_k_i2c_read_byte::return#12 = cx16_k_i2c_read_byte::return#1 - // smc_flash::@45 - // smc_bootloader_not_activated = cx16_k_i2c_read_byte(FLASH_I2C_SMC_DEVICE, FLASH_I2C_SMC_OFFSET) - // [1888] smc_flash::smc_bootloader_not_activated#1 = cx16_k_i2c_read_byte::return#12 - // if(smc_bootloader_not_activated) - // [1889] if(0==smc_flash::smc_bootloader_not_activated#1) goto smc_flash::@1 -- 0_eq_vwum1_then_la1 - lda smc_bootloader_not_activated - ora smc_bootloader_not_activated+1 - beq __b1 - // [1890] phi from smc_flash::@45 to smc_flash::@10 [phi:smc_flash::@45->smc_flash::@10] - // smc_flash::@10 - // sprintf(info_text, "There was a problem activating the SMC bootloader: %x", smc_bootloader_not_activated) - // [1891] call snprintf_init - // [1205] phi from smc_flash::@10 to snprintf_init [phi:smc_flash::@10->snprintf_init] - // [1205] phi snprintf_init::s#31 = info_text [phi:smc_flash::@10->snprintf_init#0] -- pbuz1=pbuc1 - lda #<@info_text - sta.z snprintf_init.s - lda #>@info_text - sta.z snprintf_init.s+1 - jsr snprintf_init - // [1892] phi from smc_flash::@10 to smc_flash::@48 [phi:smc_flash::@10->smc_flash::@48] - // smc_flash::@48 - // sprintf(info_text, "There was a problem activating the SMC bootloader: %x", smc_bootloader_not_activated) - // [1893] call printf_str - // [1210] phi from smc_flash::@48 to printf_str [phi:smc_flash::@48->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:smc_flash::@48->printf_str#0] -- pprz1=pprc1 - lda #display_frame_maskxy] + // [1747] phi display_frame_maskxy::cpeekcxy1_y#0 = display_frame_maskxy::y#3 [phi:display_frame::@7->display_frame_maskxy#0] -- register_copy + // [1747] phi display_frame_maskxy::cpeekcxy1_x#0 = display_frame_maskxy::x#3 [phi:display_frame::@7->display_frame_maskxy#1] -- register_copy + jsr display_frame_maskxy + // display_frame_maskxy(x0, y) + // [1266] display_frame_maskxy::return#16 = display_frame_maskxy::return#12 + // display_frame::@22 + // mask = display_frame_maskxy(x0, y) + // [1267] display_frame::mask#6 = display_frame_maskxy::return#16 + // mask |= 0b1010 + // [1268] display_frame::mask#7 = display_frame::mask#6 | $a -- vbum1=vbum1_bor_vbuc1 + lda #$a + ora mask + sta mask + // display_frame_char(mask) + // [1269] display_frame_char::mask#3 = display_frame::mask#7 + // [1270] call display_frame_char + // [1773] phi from display_frame::@22 to display_frame_char [phi:display_frame::@22->display_frame_char] + // [1773] phi display_frame_char::mask#10 = display_frame_char::mask#3 [phi:display_frame::@22->display_frame_char#0] -- register_copy + jsr display_frame_char + // display_frame_char(mask) + // [1271] display_frame_char::return#16 = display_frame_char::return#12 + // display_frame::@23 + // c = display_frame_char(mask) + // [1272] display_frame::c#3 = display_frame_char::return#16 + // cputcxy(x0, y, c) + // [1273] cputcxy::x#5 = display_frame::x#0 -- vbum1=vbum2 + lda x + sta cputcxy.x + // [1274] cputcxy::y#5 = display_frame::y#10 -- vbum1=vbum2 + lda y_1 + sta cputcxy.y + // [1275] cputcxy::c#5 = display_frame::c#3 + // [1276] call cputcxy + // [1346] phi from display_frame::@23 to cputcxy [phi:display_frame::@23->cputcxy] + // [1346] phi cputcxy::c#15 = cputcxy::c#5 [phi:display_frame::@23->cputcxy#0] -- register_copy + // [1346] phi cputcxy::y#15 = cputcxy::y#5 [phi:display_frame::@23->cputcxy#1] -- register_copy + // [1346] phi cputcxy::x#15 = cputcxy::x#5 [phi:display_frame::@23->cputcxy#2] -- register_copy + jsr cputcxy + // display_frame::@24 + // display_frame_maskxy(x1, y) + // [1277] display_frame_maskxy::x#4 = display_frame::x1#16 -- vbum1=vbum2 + lda x1 + sta display_frame_maskxy.x + // [1278] display_frame_maskxy::y#4 = display_frame::y#10 -- vbum1=vbum2 + lda y_1 + sta display_frame_maskxy.y + // [1279] call display_frame_maskxy + // [1747] phi from display_frame::@24 to display_frame_maskxy [phi:display_frame::@24->display_frame_maskxy] + // [1747] phi display_frame_maskxy::cpeekcxy1_y#0 = display_frame_maskxy::y#4 [phi:display_frame::@24->display_frame_maskxy#0] -- register_copy + // [1747] phi display_frame_maskxy::cpeekcxy1_x#0 = display_frame_maskxy::x#4 [phi:display_frame::@24->display_frame_maskxy#1] -- register_copy + jsr display_frame_maskxy + // display_frame_maskxy(x1, y) + // [1280] display_frame_maskxy::return#17 = display_frame_maskxy::return#12 + // display_frame::@25 + // mask = display_frame_maskxy(x1, y) + // [1281] display_frame::mask#8 = display_frame_maskxy::return#17 + // mask |= 0b1010 + // [1282] display_frame::mask#9 = display_frame::mask#8 | $a -- vbum1=vbum1_bor_vbuc1 + lda #$a + ora mask + sta mask + // display_frame_char(mask) + // [1283] display_frame_char::mask#4 = display_frame::mask#9 + // [1284] call display_frame_char + // [1773] phi from display_frame::@25 to display_frame_char [phi:display_frame::@25->display_frame_char] + // [1773] phi display_frame_char::mask#10 = display_frame_char::mask#4 [phi:display_frame::@25->display_frame_char#0] -- register_copy + jsr display_frame_char + // display_frame_char(mask) + // [1285] display_frame_char::return#17 = display_frame_char::return#12 + // display_frame::@26 + // c = display_frame_char(mask) + // [1286] display_frame::c#4 = display_frame_char::return#17 + // cputcxy(x1, y, c) + // [1287] cputcxy::x#6 = display_frame::x1#16 -- vbum1=vbum2 + lda x1 + sta cputcxy.x + // [1288] cputcxy::y#6 = display_frame::y#10 -- vbum1=vbum2 + lda y_1 + sta cputcxy.y + // [1289] cputcxy::c#6 = display_frame::c#4 + // [1290] call cputcxy + // [1346] phi from display_frame::@26 to cputcxy [phi:display_frame::@26->cputcxy] + // [1346] phi cputcxy::c#15 = cputcxy::c#6 [phi:display_frame::@26->cputcxy#0] -- register_copy + // [1346] phi cputcxy::y#15 = cputcxy::y#6 [phi:display_frame::@26->cputcxy#1] -- register_copy + // [1346] phi cputcxy::x#15 = cputcxy::x#6 [phi:display_frame::@26->cputcxy#2] -- register_copy + jsr cputcxy + // display_frame::@27 + // y++; + // [1291] display_frame::y#2 = ++ display_frame::y#10 -- vbum1=_inc_vbum1 + inc y_1 + jmp __b6 + // display_frame::@5 + __b5: + // display_frame_maskxy(x, y) + // [1292] display_frame_maskxy::x#2 = display_frame::x#10 -- vbum1=vbum2 + lda x_1 + sta display_frame_maskxy.x + // [1293] display_frame_maskxy::y#2 = display_frame::y#0 -- vbum1=vbum2 + lda y + sta display_frame_maskxy.y + // [1294] call display_frame_maskxy + // [1747] phi from display_frame::@5 to display_frame_maskxy [phi:display_frame::@5->display_frame_maskxy] + // [1747] phi display_frame_maskxy::cpeekcxy1_y#0 = display_frame_maskxy::y#2 [phi:display_frame::@5->display_frame_maskxy#0] -- register_copy + // [1747] phi display_frame_maskxy::cpeekcxy1_x#0 = display_frame_maskxy::x#2 [phi:display_frame::@5->display_frame_maskxy#1] -- register_copy + jsr display_frame_maskxy + // display_frame_maskxy(x, y) + // [1295] display_frame_maskxy::return#15 = display_frame_maskxy::return#12 + // display_frame::@19 + // mask = display_frame_maskxy(x, y) + // [1296] display_frame::mask#4 = display_frame_maskxy::return#15 + // mask |= 0b0101 + // [1297] display_frame::mask#5 = display_frame::mask#4 | 5 -- vbum1=vbum1_bor_vbuc1 + lda #5 + ora mask + sta mask + // display_frame_char(mask) + // [1298] display_frame_char::mask#2 = display_frame::mask#5 + // [1299] call display_frame_char + // [1773] phi from display_frame::@19 to display_frame_char [phi:display_frame::@19->display_frame_char] + // [1773] phi display_frame_char::mask#10 = display_frame_char::mask#2 [phi:display_frame::@19->display_frame_char#0] -- register_copy + jsr display_frame_char + // display_frame_char(mask) + // [1300] display_frame_char::return#15 = display_frame_char::return#12 + // display_frame::@20 + // c = display_frame_char(mask) + // [1301] display_frame::c#2 = display_frame_char::return#15 + // cputcxy(x, y, c) + // [1302] cputcxy::x#4 = display_frame::x#10 -- vbum1=vbum2 + lda x_1 + sta cputcxy.x + // [1303] cputcxy::y#4 = display_frame::y#0 -- vbum1=vbum2 + lda y + sta cputcxy.y + // [1304] cputcxy::c#4 = display_frame::c#2 + // [1305] call cputcxy + // [1346] phi from display_frame::@20 to cputcxy [phi:display_frame::@20->cputcxy] + // [1346] phi cputcxy::c#15 = cputcxy::c#4 [phi:display_frame::@20->cputcxy#0] -- register_copy + // [1346] phi cputcxy::y#15 = cputcxy::y#4 [phi:display_frame::@20->cputcxy#1] -- register_copy + // [1346] phi cputcxy::x#15 = cputcxy::x#4 [phi:display_frame::@20->cputcxy#2] -- register_copy + jsr cputcxy + // display_frame::@21 + // x++; + // [1306] display_frame::x#2 = ++ display_frame::x#10 -- vbum1=_inc_vbum1 + inc x_1 + jmp __b4 + // display_frame::@36 + __b36: + // [1307] display_frame::x#30 = display_frame::x#0 -- vbum1=vbum2 + lda x + sta x_1 + jmp __b1 + .segment Data + w: .byte 0 + h: .byte 0 + x: .byte 0 + y: .byte 0 + .label mask = display_frame_maskxy.return + .label c = cputcxy.c + x_1: .byte 0 + y_1: .byte 0 + x1: .byte 0 + y1: .byte 0 +} +.segment Code + // printf_string +// Print a string value using a specific format +// Handles justification and min length +// void printf_string(__zp($3e) void (*putc)(char), __zp($42) char *str, __mem() char format_min_length, __mem() char format_justify_left) +printf_string: { + .label printf_string__9 = $51 + .label str = $42 + .label str_1 = $4f + .label putc = $3e + // if(format.min_length) + // [1309] if(0==printf_string::format_min_length#17) goto printf_string::@1 -- 0_eq_vbum1_then_la1 + lda format_min_length + beq __b3 + // printf_string::@3 + // strlen(str) + // [1310] strlen::str#3 = printf_string::str#17 -- pbuz1=pbuz2 + lda.z str + sta.z strlen.str + lda.z str+1 + sta.z strlen.str+1 + // [1311] call strlen + // [1788] phi from printf_string::@3 to strlen [phi:printf_string::@3->strlen] + // [1788] phi strlen::str#8 = strlen::str#3 [phi:printf_string::@3->strlen#0] -- register_copy + jsr strlen + // strlen(str) + // [1312] strlen::return#10 = strlen::len#2 + // printf_string::@6 + // [1313] printf_string::$9 = strlen::return#10 -- vwuz1=vwum2 + lda strlen.return + sta.z printf_string__9 + lda strlen.return+1 + sta.z printf_string__9+1 + // signed char len = (signed char)strlen(str) + // [1314] printf_string::len#0 = (signed char)printf_string::$9 -- vbsm1=_sbyte_vwuz2 + lda.z printf_string__9 + sta len + // padding = (signed char)format.min_length - len + // [1315] printf_string::padding#1 = (signed char)printf_string::format_min_length#17 - printf_string::len#0 -- vbsm1=vbsm1_minus_vbsm2 + lda padding + sec + sbc len + sta padding + // if(padding<0) + // [1316] if(printf_string::padding#1>=0) goto printf_string::@10 -- vbsm1_ge_0_then_la1 + cmp #0 + bpl __b1 + // [1318] phi from printf_string printf_string::@6 to printf_string::@1 [phi:printf_string/printf_string::@6->printf_string::@1] + __b3: + // [1318] phi printf_string::padding#3 = 0 [phi:printf_string/printf_string::@6->printf_string::@1#0] -- vbsm1=vbsc1 + lda #0 + sta padding + // [1317] phi from printf_string::@6 to printf_string::@10 [phi:printf_string::@6->printf_string::@10] + // printf_string::@10 + // [1318] phi from printf_string::@10 to printf_string::@1 [phi:printf_string::@10->printf_string::@1] + // [1318] phi printf_string::padding#3 = printf_string::padding#1 [phi:printf_string::@10->printf_string::@1#0] -- register_copy + // printf_string::@1 + __b1: + // if(!format.justify_left && padding) + // [1319] if(0!=printf_string::format_justify_left#17) goto printf_string::@2 -- 0_neq_vbum1_then_la1 + lda format_justify_left + bne __b2 + // printf_string::@8 + // [1320] if(0!=printf_string::padding#3) goto printf_string::@4 -- 0_neq_vbsm1_then_la1 + lda padding + cmp #0 + bne __b4 + jmp __b2 + // printf_string::@4 + __b4: + // printf_padding(putc, ' ',(char)padding) + // [1321] printf_padding::putc#3 = printf_string::putc#17 -- pprz1=pprz2 + lda.z putc + sta.z printf_padding.putc + lda.z putc+1 + sta.z printf_padding.putc+1 + // [1322] printf_padding::length#3 = (char)printf_string::padding#3 -- vbum1=vbum2 + lda padding + sta printf_padding.length + // [1323] call printf_padding + // [1794] phi from printf_string::@4 to printf_padding [phi:printf_string::@4->printf_padding] + // [1794] phi printf_padding::putc#7 = printf_padding::putc#3 [phi:printf_string::@4->printf_padding#0] -- register_copy + // [1794] phi printf_padding::pad#7 = ' ' [phi:printf_string::@4->printf_padding#1] -- vbum1=vbuc1 + lda #' ' + sta printf_padding.pad + // [1794] phi printf_padding::length#6 = printf_padding::length#3 [phi:printf_string::@4->printf_padding#2] -- register_copy + jsr printf_padding + // printf_string::@2 + __b2: + // printf_str(putc, str) + // [1324] printf_str::putc#1 = printf_string::putc#17 -- pprz1=pprz2 + lda.z putc sta.z printf_str.putc - lda #>snputc + lda.z putc+1 sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = smc_flash::s5 [phi:smc_flash::@48->printf_str#1] -- pbuz1=pbuc1 - lda #s5 - sta.z printf_str.s+1 + // [1325] printf_str::s#2 = printf_string::str#17 + // [1326] call printf_str + // [785] phi from printf_string::@2 to printf_str [phi:printf_string::@2->printf_str] + // [785] phi printf_str::putc#53 = printf_str::putc#1 [phi:printf_string::@2->printf_str#0] -- register_copy + // [785] phi printf_str::s#53 = printf_str::s#2 [phi:printf_string::@2->printf_str#1] -- register_copy jsr printf_str - // smc_flash::@49 - // sprintf(info_text, "There was a problem activating the SMC bootloader: %x", smc_bootloader_not_activated) - // [1894] printf_uint::uvalue#4 = smc_flash::smc_bootloader_not_activated#1 - // [1895] call printf_uint - // [2086] phi from smc_flash::@49 to printf_uint [phi:smc_flash::@49->printf_uint] - // [2086] phi printf_uint::format_zero_padding#10 = 0 [phi:smc_flash::@49->printf_uint#0] -- vbum1=vbuc1 - lda #0 - sta printf_uint.format_zero_padding - // [2086] phi printf_uint::format_min_length#10 = 0 [phi:smc_flash::@49->printf_uint#1] -- vbum1=vbuc1 - sta printf_uint.format_min_length - // [2086] phi printf_uint::putc#10 = &snputc [phi:smc_flash::@49->printf_uint#2] -- pprz1=pprc1 - lda #snputc - sta.z printf_uint.putc+1 - // [2086] phi printf_uint::format_radix#10 = HEXADECIMAL [phi:smc_flash::@49->printf_uint#3] -- vbum1=vbuc1 - lda #HEXADECIMAL - sta printf_uint.format_radix - // [2086] phi printf_uint::uvalue#10 = printf_uint::uvalue#4 [phi:smc_flash::@49->printf_uint#4] -- register_copy - jsr printf_uint - // smc_flash::@50 - // sprintf(info_text, "There was a problem activating the SMC bootloader: %x", smc_bootloader_not_activated) - // [1896] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 - lda #0 - pha - // [1897] callexecute snputc -- call_vprc1 - jsr snputc - // sideeffect stackpullpadding(1) -- _stackpullpadding_1 - pla - // display_action_text(info_text) - // [1899] call display_action_text - // [1357] phi from smc_flash::@50 to display_action_text [phi:smc_flash::@50->display_action_text] - // [1357] phi display_action_text::info_text#25 = info_text [phi:smc_flash::@50->display_action_text#0] -- pbuz1=pbuc1 - lda #<@info_text - sta.z display_action_text.info_text - lda #>@info_text - sta.z display_action_text.info_text+1 - jsr display_action_text - jmp __b2 - // [1900] phi from smc_flash::@45 to smc_flash::@1 [phi:smc_flash::@45->smc_flash::@1] - // smc_flash::@1 + // printf_string::@7 + // if(format.justify_left && padding) + // [1327] if(0==printf_string::format_justify_left#17) goto printf_string::@return -- 0_eq_vbum1_then_la1 + lda format_justify_left + beq __breturn + // printf_string::@9 + // [1328] if(0!=printf_string::padding#3) goto printf_string::@5 -- 0_neq_vbsm1_then_la1 + lda padding + cmp #0 + bne __b5 + rts + // printf_string::@5 + __b5: + // printf_padding(putc, ' ',(char)padding) + // [1329] printf_padding::putc#4 = printf_string::putc#17 -- pprz1=pprz2 + lda.z putc + sta.z printf_padding.putc + lda.z putc+1 + sta.z printf_padding.putc+1 + // [1330] printf_padding::length#4 = (char)printf_string::padding#3 -- vbum1=vbum2 + lda padding + sta printf_padding.length + // [1331] call printf_padding + // [1794] phi from printf_string::@5 to printf_padding [phi:printf_string::@5->printf_padding] + // [1794] phi printf_padding::putc#7 = printf_padding::putc#4 [phi:printf_string::@5->printf_padding#0] -- register_copy + // [1794] phi printf_padding::pad#7 = ' ' [phi:printf_string::@5->printf_padding#1] -- vbum1=vbuc1 + lda #' ' + sta printf_padding.pad + // [1794] phi printf_padding::length#6 = printf_padding::length#4 [phi:printf_string::@5->printf_padding#2] -- register_copy + jsr printf_padding + // printf_string::@return + __breturn: + // } + // [1332] return + rts + .segment Data + len: .byte 0 + .label padding = format_min_length + format_min_length: .byte 0 + format_justify_left: .byte 0 +} +.segment Code + // cputs +// Output a NUL-terminated string at the current cursor position +// void cputs(__zp($2d) const char *s) +cputs: { + .label s = $2d + // [1334] phi from cputs cputs::@2 to cputs::@1 [phi:cputs/cputs::@2->cputs::@1] + // [1334] phi cputs::s#2 = cputs::s#1 [phi:cputs/cputs::@2->cputs::@1#0] -- register_copy + // cputs::@1 __b1: - // display_action_progress("Updating SMC firmware ... (+) Updated") - // [1901] call display_action_progress - // [904] phi from smc_flash::@1 to display_action_progress [phi:smc_flash::@1->display_action_progress] - // [904] phi display_action_progress::info_text#27 = smc_flash::info_text1 [phi:smc_flash::@1->display_action_progress#0] -- pbuz1=pbuc1 - lda #info_text1 - sta.z display_action_progress.info_text+1 - jsr display_action_progress - // [1902] phi from smc_flash::@1 to smc_flash::@46 [phi:smc_flash::@1->smc_flash::@46] - // smc_flash::@46 - // textcolor(WHITE) - // [1903] call textcolor - // [784] phi from smc_flash::@46 to textcolor [phi:smc_flash::@46->textcolor] - // [784] phi textcolor::color#23 = WHITE [phi:smc_flash::@46->textcolor#0] -- vbum1=vbuc1 - lda #WHITE - sta textcolor.color - jsr textcolor - // [1904] phi from smc_flash::@46 to smc_flash::@47 [phi:smc_flash::@46->smc_flash::@47] - // smc_flash::@47 - // gotoxy(x, y) - // [1905] call gotoxy - // [802] phi from smc_flash::@47 to gotoxy [phi:smc_flash::@47->gotoxy] - // [802] phi gotoxy::y#37 = PROGRESS_Y [phi:smc_flash::@47->gotoxy#0] -- vbum1=vbuc1 - lda #PROGRESS_Y - sta gotoxy.y - // [802] phi gotoxy::x#37 = PROGRESS_X [phi:smc_flash::@47->gotoxy#1] -- vbum1=vbuc1 - lda #PROGRESS_X - sta gotoxy.x - jsr gotoxy - // [1906] phi from smc_flash::@47 to smc_flash::@11 [phi:smc_flash::@47->smc_flash::@11] - // [1906] phi smc_flash::y#36 = PROGRESS_Y [phi:smc_flash::@47->smc_flash::@11#0] -- vbum1=vbuc1 - lda #PROGRESS_Y - sta y - // [1906] phi smc_flash::smc_row_bytes#16 = 0 [phi:smc_flash::@47->smc_flash::@11#1] -- vwum1=vwuc1 - lda #<0 - sta smc_row_bytes - sta smc_row_bytes+1 - // [1906] phi smc_flash::smc_bram_ptr#14 = (char *)$a000 [phi:smc_flash::@47->smc_flash::@11#2] -- pbuz1=pbuc1 - lda #<$a000 - sta.z smc_bram_ptr - lda #>$a000 - sta.z smc_bram_ptr+1 - // [1906] phi smc_flash::smc_bytes_flashed#13 = 0 [phi:smc_flash::@47->smc_flash::@11#3] -- vwum1=vwuc1 - lda #<0 - sta smc_bytes_flashed - sta smc_bytes_flashed+1 - // [1906] phi from smc_flash::@15 to smc_flash::@11 [phi:smc_flash::@15->smc_flash::@11] - // [1906] phi smc_flash::y#36 = smc_flash::y#21 [phi:smc_flash::@15->smc_flash::@11#0] -- register_copy - // [1906] phi smc_flash::smc_row_bytes#16 = smc_flash::smc_row_bytes#11 [phi:smc_flash::@15->smc_flash::@11#1] -- register_copy - // [1906] phi smc_flash::smc_bram_ptr#14 = smc_flash::smc_bram_ptr#12 [phi:smc_flash::@15->smc_flash::@11#2] -- register_copy - // [1906] phi smc_flash::smc_bytes_flashed#13 = smc_flash::smc_bytes_flashed#12 [phi:smc_flash::@15->smc_flash::@11#3] -- register_copy - // smc_flash::@11 - __b11: - // while(smc_bytes_flashed < smc_bytes_total) - // [1907] if(smc_flash::smc_bytes_flashed#13display_action_text_flashed] - // [2926] phi display_action_text_flashed::chip#3 = smc_flash::chip [phi:smc_flash::@12->display_action_text_flashed#0] -- pbuz1=pbuc1 - lda #chip - sta.z display_action_text_flashed.chip+1 - // [2926] phi display_action_text_flashed::bytes#3 = display_action_text_flashed::bytes#1 [phi:smc_flash::@12->display_action_text_flashed#1] -- register_copy - jsr display_action_text_flashed - // [1878] phi from smc_flash::@12 to smc_flash::@return [phi:smc_flash::@12->smc_flash::@return] - // [1878] phi smc_flash::return#1 = smc_flash::smc_bytes_flashed#13 [phi:smc_flash::@12->smc_flash::@return#0] -- register_copy + // [1337] if(0!=cputs::c#1) goto cputs::@2 -- 0_neq_vbum1_then_la1 + lda c + bne __b2 + // cputs::@return + // } + // [1338] return rts - // [1910] phi from smc_flash::@11 to smc_flash::@13 [phi:smc_flash::@11->smc_flash::@13] - __b10: - // [1910] phi smc_flash::y#21 = smc_flash::y#36 [phi:smc_flash::@11->smc_flash::@13#0] -- register_copy - // [1910] phi smc_flash::smc_row_bytes#11 = smc_flash::smc_row_bytes#16 [phi:smc_flash::@11->smc_flash::@13#1] -- register_copy - // [1910] phi smc_flash::smc_bytes_flashed#12 = smc_flash::smc_bytes_flashed#13 [phi:smc_flash::@11->smc_flash::@13#2] -- register_copy - // [1910] phi smc_flash::smc_bram_ptr#12 = smc_flash::smc_bram_ptr#14 [phi:smc_flash::@11->smc_flash::@13#3] -- register_copy - // [1910] phi smc_flash::smc_attempts_flashed#15 = 0 [phi:smc_flash::@11->smc_flash::@13#4] -- vbum1=vbuc1 - lda #0 - sta smc_attempts_flashed - // [1910] phi smc_flash::smc_package_committed#10 = 0 [phi:smc_flash::@11->smc_flash::@13#5] -- vbum1=vbuc1 - sta smc_package_committed - // smc_flash::@13 - __b13: - // while(!smc_package_committed && smc_attempts_flashed < 10) - // [1911] if(0!=smc_flash::smc_package_committed#10) goto smc_flash::@15 -- 0_neq_vbum1_then_la1 - lda smc_package_committed - bne __b15 - // smc_flash::@55 - // [1912] if(smc_flash::smc_attempts_flashed#15<$a) goto smc_flash::@14 -- vbum1_lt_vbuc1_then_la1 - lda smc_attempts_flashed - cmp #$a - bcc __b14 - // smc_flash::@15 - __b15: - // if(smc_attempts_flashed >= 10) - // [1913] if(smc_flash::smc_attempts_flashed#15<$a) goto smc_flash::@11 -- vbum1_lt_vbuc1_then_la1 - lda smc_attempts_flashed - cmp #$a - bcc __b11 - // [1914] phi from smc_flash::@15 to smc_flash::@23 [phi:smc_flash::@15->smc_flash::@23] - // smc_flash::@23 - // sprintf(info_text, "There were too many attempts trying to flash the SMC at location %04x", smc_bytes_flashed) - // [1915] call snprintf_init - // [1205] phi from smc_flash::@23 to snprintf_init [phi:smc_flash::@23->snprintf_init] - // [1205] phi snprintf_init::s#31 = info_text [phi:smc_flash::@23->snprintf_init#0] -- pbuz1=pbuc1 - lda #<@info_text - sta.z snprintf_init.s - lda #>@info_text - sta.z snprintf_init.s+1 - jsr snprintf_init - // [1916] phi from smc_flash::@23 to smc_flash::@52 [phi:smc_flash::@23->smc_flash::@52] - // smc_flash::@52 - // sprintf(info_text, "There were too many attempts trying to flash the SMC at location %04x", smc_bytes_flashed) - // [1917] call printf_str - // [1210] phi from smc_flash::@52 to printf_str [phi:smc_flash::@52->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:smc_flash::@52->printf_str#0] -- pprz1=pprc1 - lda #snputc - sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = smc_flash::s6 [phi:smc_flash::@52->printf_str#1] -- pbuz1=pbuc1 - lda #s6 - sta.z printf_str.s+1 - jsr printf_str - // smc_flash::@53 - // sprintf(info_text, "There were too many attempts trying to flash the SMC at location %04x", smc_bytes_flashed) - // [1918] printf_uint::uvalue#5 = smc_flash::smc_bytes_flashed#12 -- vwum1=vwum2 - lda smc_bytes_flashed - sta printf_uint.uvalue - lda smc_bytes_flashed+1 - sta printf_uint.uvalue+1 - // [1919] call printf_uint - // [2086] phi from smc_flash::@53 to printf_uint [phi:smc_flash::@53->printf_uint] - // [2086] phi printf_uint::format_zero_padding#10 = 1 [phi:smc_flash::@53->printf_uint#0] -- vbum1=vbuc1 - lda #1 - sta printf_uint.format_zero_padding - // [2086] phi printf_uint::format_min_length#10 = 4 [phi:smc_flash::@53->printf_uint#1] -- vbum1=vbuc1 - lda #4 - sta printf_uint.format_min_length - // [2086] phi printf_uint::putc#10 = &snputc [phi:smc_flash::@53->printf_uint#2] -- pprz1=pprc1 - lda #snputc - sta.z printf_uint.putc+1 - // [2086] phi printf_uint::format_radix#10 = HEXADECIMAL [phi:smc_flash::@53->printf_uint#3] -- vbum1=vbuc1 - lda #HEXADECIMAL - sta printf_uint.format_radix - // [2086] phi printf_uint::uvalue#10 = printf_uint::uvalue#5 [phi:smc_flash::@53->printf_uint#4] -- register_copy - jsr printf_uint - // smc_flash::@54 - // sprintf(info_text, "There were too many attempts trying to flash the SMC at location %04x", smc_bytes_flashed) - // [1920] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 - lda #0 + // cputs::@2 + __b2: + // cputc(c) + // [1339] stackpush(char) = cputs::c#1 -- _stackpushbyte_=vbum1 + lda c pha - // [1921] callexecute snputc -- call_vprc1 - jsr snputc + // [1340] callexecute cputc -- call_vprc1 + jsr cputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla - // display_action_text(info_text) - // [1923] call display_action_text - // [1357] phi from smc_flash::@54 to display_action_text [phi:smc_flash::@54->display_action_text] - // [1357] phi display_action_text::info_text#25 = info_text [phi:smc_flash::@54->display_action_text#0] -- pbuz1=pbuc1 - lda #<@info_text - sta.z display_action_text.info_text - lda #>@info_text - sta.z display_action_text.info_text+1 - jsr display_action_text - // [1878] phi from smc_flash::@54 to smc_flash::@return [phi:smc_flash::@54->smc_flash::@return] - // [1878] phi smc_flash::return#1 = $ffff [phi:smc_flash::@54->smc_flash::@return#0] -- vwum1=vwuc1 - lda #<$ffff + jmp __b1 + .segment Data + c: .byte 0 +} +.segment Code + // wherex +// Return the x position of the cursor +wherex: { + // return __conio.cursor_x; + // [1342] wherex::return#0 = *((char *)&__conio) -- vbum1=_deref_pbuc1 + lda __conio sta return - lda #>$ffff - sta return+1 + // wherex::@return + // } + // [1343] return rts - // smc_flash::@14 - __b14: - // display_action_text_flashing(8, "SMC", smc_bram_bank, smc_bram_ptr, smc_bytes_flashed) - // [1924] display_action_text_flashing::bram_ptr#1 = smc_flash::smc_bram_ptr#12 -- pbuz1=pbuz2 - lda.z smc_bram_ptr - sta.z display_action_text_flashing.bram_ptr - lda.z smc_bram_ptr+1 - sta.z display_action_text_flashing.bram_ptr+1 - // [1925] display_action_text_flashing::address#1 = smc_flash::smc_bytes_flashed#12 -- vdum1=vwum2 - lda smc_bytes_flashed - sta display_action_text_flashing.address - lda smc_bytes_flashed+1 - sta display_action_text_flashing.address+1 - lda #0 - sta display_action_text_flashing.address+2 - sta display_action_text_flashing.address+3 - // [1926] call display_action_text_flashing - // [2955] phi from smc_flash::@14 to display_action_text_flashing [phi:smc_flash::@14->display_action_text_flashing] - // [2955] phi display_action_text_flashing::address#10 = display_action_text_flashing::address#1 [phi:smc_flash::@14->display_action_text_flashing#0] -- register_copy - // [2955] phi display_action_text_flashing::chip#10 = smc_flash::chip [phi:smc_flash::@14->display_action_text_flashing#1] -- pbuz1=pbuc1 - lda #chip - sta.z display_action_text_flashing.chip+1 - // [2955] phi display_action_text_flashing::bram_ptr#3 = display_action_text_flashing::bram_ptr#1 [phi:smc_flash::@14->display_action_text_flashing#2] -- register_copy - // [2955] phi display_action_text_flashing::bram_bank#3 = smc_flash::smc_bram_bank [phi:smc_flash::@14->display_action_text_flashing#3] -- vbum1=vbuc1 - lda #smc_bram_bank - sta display_action_text_flashing.bram_bank - // [2955] phi display_action_text_flashing::bytes#3 = 8 [phi:smc_flash::@14->display_action_text_flashing#4] -- vdum1=vbuc1 - lda #8 - sta display_action_text_flashing.bytes - lda #0 - sta display_action_text_flashing.bytes+1 - sta display_action_text_flashing.bytes+2 - sta display_action_text_flashing.bytes+3 - jsr display_action_text_flashing - // [1927] phi from smc_flash::@14 to smc_flash::@16 [phi:smc_flash::@14->smc_flash::@16] - // [1927] phi smc_flash::smc_bytes_checksum#2 = 0 [phi:smc_flash::@14->smc_flash::@16#0] -- vbum1=vbuc1 - lda #0 - sta smc_bytes_checksum - // [1927] phi smc_flash::smc_bram_ptr#10 = smc_flash::smc_bram_ptr#12 [phi:smc_flash::@14->smc_flash::@16#1] -- register_copy - // [1927] phi smc_flash::smc_package_flashed#2 = 0 [phi:smc_flash::@14->smc_flash::@16#2] -- vwum1=vwuc1 - sta smc_package_flashed - sta smc_package_flashed+1 - // smc_flash::@16 - __b16: - // while(smc_package_flashed < SMC_PROGRESS_CELL) - // [1928] if(smc_flash::smc_package_flashed#2smc_flash::@13] - // [1910] phi smc_flash::y#21 = smc_flash::y#21 [phi:smc_flash::@19->smc_flash::@13#0] -- register_copy - // [1910] phi smc_flash::smc_row_bytes#11 = smc_flash::smc_row_bytes#11 [phi:smc_flash::@19->smc_flash::@13#1] -- register_copy - // [1910] phi smc_flash::smc_bytes_flashed#12 = smc_flash::smc_bytes_flashed#12 [phi:smc_flash::@19->smc_flash::@13#2] -- register_copy - // [1910] phi smc_flash::smc_bram_ptr#12 = smc_flash::smc_bram_ptr#2 [phi:smc_flash::@19->smc_flash::@13#3] -- register_copy - // [1910] phi smc_flash::smc_attempts_flashed#15 = smc_flash::smc_attempts_flashed#1 [phi:smc_flash::@19->smc_flash::@13#4] -- register_copy - // [1910] phi smc_flash::smc_package_committed#10 = smc_flash::smc_package_committed#10 [phi:smc_flash::@19->smc_flash::@13#5] -- register_copy - jmp __b13 - // smc_flash::@20 - __b20: - // if (smc_row_bytes == SMC_PROGRESS_ROW) - // [1944] if(smc_flash::smc_row_bytes#11!=SMC_PROGRESS_ROW) goto smc_flash::@21 -- vwum1_neq_vwuc1_then_la1 - lda smc_row_bytes+1 - cmp #>SMC_PROGRESS_ROW - bne __b21 - lda smc_row_bytes - cmp #gotoxy] - // [802] phi gotoxy::y#37 = gotoxy::y#29 [phi:smc_flash::@22->gotoxy#0] -- register_copy - // [802] phi gotoxy::x#37 = PROGRESS_X [phi:smc_flash::@22->gotoxy#1] -- vbum1=vbuc1 - lda #PROGRESS_X - sta gotoxy.x + // [1349] call gotoxy + // [457] phi from cputcxy to gotoxy [phi:cputcxy->gotoxy] + // [457] phi gotoxy::y#26 = gotoxy::y#0 [phi:cputcxy->gotoxy#0] -- register_copy + // [457] phi gotoxy::x#26 = gotoxy::x#0 [phi:cputcxy->gotoxy#1] -- register_copy jsr gotoxy - // [1948] phi from smc_flash::@22 to smc_flash::@21 [phi:smc_flash::@22->smc_flash::@21] - // [1948] phi smc_flash::y#38 = smc_flash::y#1 [phi:smc_flash::@22->smc_flash::@21#0] -- register_copy - // [1948] phi smc_flash::smc_row_bytes#4 = 0 [phi:smc_flash::@22->smc_flash::@21#1] -- vwum1=vbuc1 - lda #<0 - sta smc_row_bytes - sta smc_row_bytes+1 - // [1948] phi from smc_flash::@20 to smc_flash::@21 [phi:smc_flash::@20->smc_flash::@21] - // [1948] phi smc_flash::y#38 = smc_flash::y#21 [phi:smc_flash::@20->smc_flash::@21#0] -- register_copy - // [1948] phi smc_flash::smc_row_bytes#4 = smc_flash::smc_row_bytes#11 [phi:smc_flash::@20->smc_flash::@21#1] -- register_copy - // smc_flash::@21 - __b21: - // cputc('+') - // [1949] stackpush(char) = '+' -- _stackpushbyte_=vbuc1 - lda #'+' + // cputcxy::@1 + // cputc(c) + // [1350] stackpush(char) = cputcxy::c#15 -- _stackpushbyte_=vbum1 + lda c pha - // [1950] callexecute cputc -- call_vprc1 + // [1351] callexecute cputc -- call_vprc1 jsr cputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla - // smc_bytes_flashed += SMC_PROGRESS_CELL - // [1952] smc_flash::smc_bytes_flashed#1 = smc_flash::smc_bytes_flashed#12 + SMC_PROGRESS_CELL -- vwum1=vwum1_plus_vbuc1 - lda #SMC_PROGRESS_CELL - clc - adc smc_bytes_flashed - sta smc_bytes_flashed - bcc !+ - inc smc_bytes_flashed+1 - !: - // smc_row_bytes += SMC_PROGRESS_CELL - // [1953] smc_flash::smc_row_bytes#1 = smc_flash::smc_row_bytes#4 + SMC_PROGRESS_CELL -- vwum1=vwum1_plus_vbuc1 - lda #SMC_PROGRESS_CELL - clc - adc smc_row_bytes - sta smc_row_bytes - bcc !+ - inc smc_row_bytes+1 - !: - // [1910] phi from smc_flash::@21 to smc_flash::@13 [phi:smc_flash::@21->smc_flash::@13] - // [1910] phi smc_flash::y#21 = smc_flash::y#38 [phi:smc_flash::@21->smc_flash::@13#0] -- register_copy - // [1910] phi smc_flash::smc_row_bytes#11 = smc_flash::smc_row_bytes#1 [phi:smc_flash::@21->smc_flash::@13#1] -- register_copy - // [1910] phi smc_flash::smc_bytes_flashed#12 = smc_flash::smc_bytes_flashed#1 [phi:smc_flash::@21->smc_flash::@13#2] -- register_copy - // [1910] phi smc_flash::smc_bram_ptr#12 = smc_flash::smc_bram_ptr#10 [phi:smc_flash::@21->smc_flash::@13#3] -- register_copy - // [1910] phi smc_flash::smc_attempts_flashed#15 = smc_flash::smc_attempts_flashed#15 [phi:smc_flash::@21->smc_flash::@13#4] -- register_copy - // [1910] phi smc_flash::smc_package_committed#10 = 1 [phi:smc_flash::@21->smc_flash::@13#5] -- vbum1=vbuc1 - lda #1 - sta smc_package_committed - jmp __b13 - // smc_flash::@17 - __b17: - // unsigned char smc_byte_upload = *smc_bram_ptr - // [1954] smc_flash::smc_byte_upload#0 = *smc_flash::smc_bram_ptr#10 -- vbum1=_deref_pbuz2 - ldy #0 - lda (smc_bram_ptr),y - sta smc_byte_upload - // smc_bram_ptr++; - // [1955] smc_flash::smc_bram_ptr#1 = ++ smc_flash::smc_bram_ptr#10 -- pbuz1=_inc_pbuz1 - inc.z smc_bram_ptr - bne !+ - inc.z smc_bram_ptr+1 - !: - // smc_bytes_checksum += smc_byte_upload - // [1956] smc_flash::smc_bytes_checksum#1 = smc_flash::smc_bytes_checksum#2 + smc_flash::smc_byte_upload#0 -- vbum1=vbum1_plus_vbum2 - lda smc_bytes_checksum - clc - adc smc_byte_upload - 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) - // [1957] smc_flash::cx16_k_i2c_write_byte3_device = $42 -- vbum1=vbuc1 - lda #$42 - sta cx16_k_i2c_write_byte3_device - // [1958] smc_flash::cx16_k_i2c_write_byte3_offset = $80 -- vbum1=vbuc1 - lda #$80 - sta cx16_k_i2c_write_byte3_offset - // [1959] smc_flash::cx16_k_i2c_write_byte3_value = smc_flash::smc_byte_upload#0 -- vbum1=vbum2 - lda smc_byte_upload - sta cx16_k_i2c_write_byte3_value - // smc_flash::cx16_k_i2c_write_byte3 - // unsigned char result - // [1960] smc_flash::cx16_k_i2c_write_byte3_result = 0 -- vbum1=vbuc1 - lda #0 - sta cx16_k_i2c_write_byte3_result - // asm - // asm { ldxdevice ldyoffset ldavalue stzresult jsrCX16_I2C_WRITE_BYTE rolresult } - ldx cx16_k_i2c_write_byte3_device - ldy cx16_k_i2c_write_byte3_offset - lda cx16_k_i2c_write_byte3_value - stz cx16_k_i2c_write_byte3_result - jsr CX16_I2C_WRITE_BYTE - rol cx16_k_i2c_write_byte3_result - // smc_flash::@26 - // smc_package_flashed++; - // [1962] smc_flash::smc_package_flashed#1 = ++ smc_flash::smc_package_flashed#2 -- vwum1=_inc_vwum1 - inc smc_package_flashed - bne !+ - inc smc_package_flashed+1 - !: - // [1927] phi from smc_flash::@26 to smc_flash::@16 [phi:smc_flash::@26->smc_flash::@16] - // [1927] phi smc_flash::smc_bytes_checksum#2 = smc_flash::smc_bytes_checksum#1 [phi:smc_flash::@26->smc_flash::@16#0] -- register_copy - // [1927] phi smc_flash::smc_bram_ptr#10 = smc_flash::smc_bram_ptr#1 [phi:smc_flash::@26->smc_flash::@16#1] -- register_copy - // [1927] phi smc_flash::smc_package_flashed#2 = smc_flash::smc_package_flashed#1 [phi:smc_flash::@26->smc_flash::@16#2] -- register_copy - jmp __b16 - // [1963] phi from smc_flash::@7 to smc_flash::@8 [phi:smc_flash::@7->smc_flash::@8] - // smc_flash::@8 - __b8: - // wait_moment(1) - // [1964] call wait_moment - // [1310] phi from smc_flash::@8 to wait_moment [phi:smc_flash::@8->wait_moment] - // [1310] phi wait_moment::w#13 = 1 [phi:smc_flash::@8->wait_moment#0] -- vbum1=vbuc1 - lda #1 - sta wait_moment.w - jsr wait_moment - // [1965] phi from smc_flash::@8 to smc_flash::@39 [phi:smc_flash::@8->smc_flash::@39] - // smc_flash::@39 - // sprintf(info_text, "Updating SMC in %u ...", smc_bootloader_activation_countdown) - // [1966] call snprintf_init - // [1205] phi from smc_flash::@39 to snprintf_init [phi:smc_flash::@39->snprintf_init] - // [1205] phi snprintf_init::s#31 = info_text [phi:smc_flash::@39->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 - // [1967] phi from smc_flash::@39 to smc_flash::@40 [phi:smc_flash::@39->smc_flash::@40] - // smc_flash::@40 - // sprintf(info_text, "Updating SMC in %u ...", smc_bootloader_activation_countdown) - // [1968] call printf_str - // [1210] phi from smc_flash::@40 to printf_str [phi:smc_flash::@40->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:smc_flash::@40->printf_str#0] -- pprz1=pprc1 - lda #snputc - sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = smc_flash::s3 [phi:smc_flash::@40->printf_str#1] -- pbuz1=pbuc1 - lda #s3 - sta.z printf_str.s+1 - jsr printf_str - // smc_flash::@41 - // sprintf(info_text, "Updating SMC in %u ...", smc_bootloader_activation_countdown) - // [1969] printf_uchar::uvalue#12 = smc_flash::smc_bootloader_activation_countdown#12 -- vbum1=vbum2 - lda smc_bootloader_activation_countdown_1 - sta printf_uchar.uvalue - // [1970] call printf_uchar - // [1346] phi from smc_flash::@41 to printf_uchar [phi:smc_flash::@41->printf_uchar] - // [1346] phi printf_uchar::format_zero_padding#18 = 0 [phi:smc_flash::@41->printf_uchar#0] -- vbum1=vbuc1 - lda #0 - sta printf_uchar.format_zero_padding - // [1346] phi printf_uchar::format_min_length#18 = 0 [phi:smc_flash::@41->printf_uchar#1] -- vbum1=vbuc1 - sta printf_uchar.format_min_length - // [1346] phi printf_uchar::putc#18 = &snputc [phi:smc_flash::@41->printf_uchar#2] -- pprz1=pprc1 - lda #snputc - sta.z printf_uchar.putc+1 - // [1346] phi printf_uchar::format_radix#18 = DECIMAL [phi:smc_flash::@41->printf_uchar#3] -- vbum1=vbuc1 - lda #DECIMAL - sta printf_uchar.format_radix - // [1346] phi printf_uchar::uvalue#18 = printf_uchar::uvalue#12 [phi:smc_flash::@41->printf_uchar#4] -- register_copy - jsr printf_uchar - // [1971] phi from smc_flash::@41 to smc_flash::@42 [phi:smc_flash::@41->smc_flash::@42] - // smc_flash::@42 - // sprintf(info_text, "Updating SMC in %u ...", smc_bootloader_activation_countdown) - // [1972] call printf_str - // [1210] phi from smc_flash::@42 to printf_str [phi:smc_flash::@42->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:smc_flash::@42->printf_str#0] -- pprz1=pprc1 - lda #snputc - sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = s6 [phi:smc_flash::@42->printf_str#1] -- pbuz1=pbuc1 - lda #<@s6 - sta.z printf_str.s - lda #>@s6 - sta.z printf_str.s+1 - jsr printf_str - // smc_flash::@43 - // sprintf(info_text, "Updating SMC in %u ...", smc_bootloader_activation_countdown) - // [1973] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 - lda #0 - pha - // [1974] callexecute snputc -- call_vprc1 - jsr snputc - // sideeffect stackpullpadding(1) -- _stackpullpadding_1 - pla - // display_action_text(info_text) - // [1976] call display_action_text - // [1357] phi from smc_flash::@43 to display_action_text [phi:smc_flash::@43->display_action_text] - // [1357] phi display_action_text::info_text#25 = info_text [phi:smc_flash::@43->display_action_text#0] -- pbuz1=pbuc1 - lda #<@info_text - sta.z display_action_text.info_text - lda #>@info_text - sta.z display_action_text.info_text+1 - jsr display_action_text - // smc_flash::@44 - // smc_bootloader_activation_countdown--; - // [1977] smc_flash::smc_bootloader_activation_countdown#3 = -- smc_flash::smc_bootloader_activation_countdown#12 -- vbum1=_dec_vbum1 - dec smc_bootloader_activation_countdown_1 - // [1882] phi from smc_flash::@44 to smc_flash::@7 [phi:smc_flash::@44->smc_flash::@7] - // [1882] phi smc_flash::smc_bootloader_activation_countdown#12 = smc_flash::smc_bootloader_activation_countdown#3 [phi:smc_flash::@44->smc_flash::@7#0] -- register_copy - jmp __b7 - // smc_flash::@4 - __b4: - // unsigned int smc_bootloader_not_activated = cx16_k_i2c_read_byte(FLASH_I2C_SMC_DEVICE, FLASH_I2C_SMC_OFFSET) - // [1978] cx16_k_i2c_read_byte::device = $42 -- vbum1=vbuc1 - lda #$42 - sta cx16_k_i2c_read_byte.device - // [1979] cx16_k_i2c_read_byte::offset = $8e -- vbum1=vbuc1 - lda #$8e - sta cx16_k_i2c_read_byte.offset - // [1980] call cx16_k_i2c_read_byte - jsr cx16_k_i2c_read_byte - // [1981] cx16_k_i2c_read_byte::return#11 = cx16_k_i2c_read_byte::return#1 - // smc_flash::@33 - // [1982] smc_flash::smc_bootloader_not_activated1#0 = cx16_k_i2c_read_byte::return#11 - // if(smc_bootloader_not_activated) - // [1983] if(0!=smc_flash::smc_bootloader_not_activated1#0) goto smc_flash::@5 -- 0_neq_vwum1_then_la1 - lda smc_bootloader_not_activated1 - ora smc_bootloader_not_activated1+1 - bne __b5 - jmp __b9 - // [1984] phi from smc_flash::@33 to smc_flash::@5 [phi:smc_flash::@33->smc_flash::@5] - // smc_flash::@5 - __b5: - // wait_moment(1) - // [1985] call wait_moment - // [1310] phi from smc_flash::@5 to wait_moment [phi:smc_flash::@5->wait_moment] - // [1310] phi wait_moment::w#13 = 1 [phi:smc_flash::@5->wait_moment#0] -- vbum1=vbuc1 - lda #1 - sta wait_moment.w - jsr wait_moment - // [1986] phi from smc_flash::@5 to smc_flash::@34 [phi:smc_flash::@5->smc_flash::@34] - // smc_flash::@34 - // sprintf(info_text, "[%03u] Press POWER and RESET on the CX16 to start the SMC update!", smc_bootloader_activation_countdown) - // [1987] call snprintf_init - // [1205] phi from smc_flash::@34 to snprintf_init [phi:smc_flash::@34->snprintf_init] - // [1205] phi snprintf_init::s#31 = info_text [phi:smc_flash::@34->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 - // [1988] phi from smc_flash::@34 to smc_flash::@35 [phi:smc_flash::@34->smc_flash::@35] - // smc_flash::@35 - // sprintf(info_text, "[%03u] Press POWER and RESET on the CX16 to start the SMC update!", smc_bootloader_activation_countdown) - // [1989] call printf_str - // [1210] phi from smc_flash::@35 to printf_str [phi:smc_flash::@35->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:smc_flash::@35->printf_str#0] -- pprz1=pprc1 - lda #snputc - sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = s21 [phi:smc_flash::@35->printf_str#1] -- pbuz1=pbuc1 - lda #s21 - sta.z printf_str.s+1 - jsr printf_str - // smc_flash::@36 - // sprintf(info_text, "[%03u] Press POWER and RESET on the CX16 to start the SMC update!", smc_bootloader_activation_countdown) - // [1990] printf_uchar::uvalue#11 = smc_flash::smc_bootloader_activation_countdown#10 -- vbum1=vbum2 - lda smc_bootloader_activation_countdown - sta printf_uchar.uvalue - // [1991] call printf_uchar - // [1346] phi from smc_flash::@36 to printf_uchar [phi:smc_flash::@36->printf_uchar] - // [1346] phi printf_uchar::format_zero_padding#18 = 1 [phi:smc_flash::@36->printf_uchar#0] -- vbum1=vbuc1 - lda #1 - sta printf_uchar.format_zero_padding - // [1346] phi printf_uchar::format_min_length#18 = 3 [phi:smc_flash::@36->printf_uchar#1] -- vbum1=vbuc1 - lda #3 - sta printf_uchar.format_min_length - // [1346] phi printf_uchar::putc#18 = &snputc [phi:smc_flash::@36->printf_uchar#2] -- pprz1=pprc1 - lda #snputc - sta.z printf_uchar.putc+1 - // [1346] phi printf_uchar::format_radix#18 = DECIMAL [phi:smc_flash::@36->printf_uchar#3] -- vbum1=vbuc1 - lda #DECIMAL - sta printf_uchar.format_radix - // [1346] phi printf_uchar::uvalue#18 = printf_uchar::uvalue#11 [phi:smc_flash::@36->printf_uchar#4] -- register_copy - jsr printf_uchar - // [1992] phi from smc_flash::@36 to smc_flash::@37 [phi:smc_flash::@36->smc_flash::@37] - // smc_flash::@37 - // sprintf(info_text, "[%03u] Press POWER and RESET on the CX16 to start the SMC update!", smc_bootloader_activation_countdown) - // [1993] call printf_str - // [1210] phi from smc_flash::@37 to printf_str [phi:smc_flash::@37->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:smc_flash::@37->printf_str#0] -- pprz1=pprc1 - lda #snputc - sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = smc_flash::s2 [phi:smc_flash::@37->printf_str#1] -- pbuz1=pbuc1 - lda #s2 - sta.z printf_str.s+1 - jsr printf_str - // smc_flash::@38 - // sprintf(info_text, "[%03u] Press POWER and RESET on the CX16 to start the SMC update!", smc_bootloader_activation_countdown) - // [1994] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 - lda #0 - pha - // [1995] callexecute snputc -- call_vprc1 - jsr snputc - // sideeffect stackpullpadding(1) -- _stackpullpadding_1 - pla - // display_action_text(info_text) - // [1997] call display_action_text - // [1357] phi from smc_flash::@38 to display_action_text [phi:smc_flash::@38->display_action_text] - // [1357] phi display_action_text::info_text#25 = info_text [phi:smc_flash::@38->display_action_text#0] -- pbuz1=pbuc1 - lda #<@info_text - sta.z display_action_text.info_text - lda #>@info_text - sta.z display_action_text.info_text+1 - jsr display_action_text - // smc_flash::@6 - // smc_bootloader_activation_countdown--; - // [1998] smc_flash::smc_bootloader_activation_countdown#2 = -- smc_flash::smc_bootloader_activation_countdown#10 -- vbum1=_dec_vbum1 - dec smc_bootloader_activation_countdown - // [1880] phi from smc_flash::@6 to smc_flash::@3 [phi:smc_flash::@6->smc_flash::@3] - // [1880] phi smc_flash::smc_bootloader_activation_countdown#10 = smc_flash::smc_bootloader_activation_countdown#2 [phi:smc_flash::@6->smc_flash::@3#0] -- register_copy - jmp __b3 + // cputcxy::@return + // } + // [1353] return + rts .segment Data - info_text: .text "To start the SMC update, do the following ..." - .byte 0 - s: .text "There was a problem starting the SMC bootloader: " - .byte 0 - s2: .text "] Press POWER and RESET on the CX16 to start the SMC update!" - .byte 0 - s3: .text "Updating SMC in " - .byte 0 - info_text1: .text "Updating SMC firmware ... (+) Updated" - .byte 0 - s5: .text "There was a problem activating the SMC bootloader: " - .byte 0 - chip: .text "SMC" - .byte 0 - s6: .text "There were too many attempts trying to flash the SMC at location " - .byte 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 - cx16_k_i2c_write_byte1_result: .byte 0 - cx16_k_i2c_write_byte2_device: .byte 0 - cx16_k_i2c_write_byte2_offset: .byte 0 - cx16_k_i2c_write_byte2_value: .byte 0 - cx16_k_i2c_write_byte2_result: .byte 0 - cx16_k_i2c_write_byte3_device: .byte 0 - cx16_k_i2c_write_byte3_offset: .byte 0 - cx16_k_i2c_write_byte3_value: .byte 0 - cx16_k_i2c_write_byte3_result: .byte 0 - cx16_k_i2c_write_byte4_device: .byte 0 - cx16_k_i2c_write_byte4_offset: .byte 0 - cx16_k_i2c_write_byte4_value: .byte 0 - cx16_k_i2c_write_byte4_result: .byte 0 - cx16_k_i2c_write_byte1_return: .byte 0 - .label smc_bootloader_start = cx16_k_i2c_write_byte1_return - return: .word 0 - .label smc_bootloader_not_activated1 = smc_detect.return - // Waiting a bit to ensure the bootloader is activated. - smc_bootloader_activation_countdown: .byte 0 - // Waiting a bit to ensure the bootloader is activated. - smc_bootloader_activation_countdown_1: .byte 0 - .label smc_bootloader_not_activated = smc_detect.return - smc_byte_upload: .byte 0 - smc_bytes_checksum: .byte 0 - smc_package_flashed: .word 0 - .label smc_commit_result = smc_detect.return - smc_attempts_flashed: .byte 0 - .label smc_bytes_flashed = return - smc_row_bytes: .word 0 + x: .byte 0 y: .byte 0 - smc_bytes_total: .word 0 - smc_package_committed: .byte 0 + c: .byte 0 } .segment Code - // util_wait_key + // display_smc_led /** - * @brief + * @brief Print SMC led above the SMC chip. * - * @param info_text - * @param filter - * @return unsigned char + * @param c Led color */ -// __mem() char util_wait_key(__zp($4a) char *info_text, __zp($43) char *filter) -util_wait_key: { - .const bank_set_bram1_bank = 0 - .const bank_set_brom1_bank = 4 - .label util_wait_key__9 = $5e - .label info_text = $4a - .label filter = $43 - // display_action_text(info_text) - // [2000] display_action_text::info_text#10 = util_wait_key::info_text#3 - // [2001] call display_action_text - // [1357] phi from util_wait_key to display_action_text [phi:util_wait_key->display_action_text] - // [1357] phi display_action_text::info_text#25 = display_action_text::info_text#10 [phi:util_wait_key->display_action_text#0] -- register_copy - jsr display_action_text - // util_wait_key::bank_get_bram1 - // return BRAM; - // [2002] util_wait_key::bram#0 = BRAM -- vbum1=vbuz2 - lda.z BRAM - sta bram - // util_wait_key::bank_get_brom1 - // return BROM; - // [2003] util_wait_key::bank_get_brom1_return#0 = BROM -- vbum1=vbuz2 - lda.z BROM - sta bank_get_brom1_return - // util_wait_key::bank_set_bram1 - // BRAM = bank - // [2004] BRAM = util_wait_key::bank_set_bram1_bank#0 -- vbuz1=vbuc1 - lda #bank_set_bram1_bank - sta.z BRAM - // util_wait_key::bank_set_brom1 - // BROM = bank - // [2005] BROM = util_wait_key::bank_set_brom1_bank#0 -- vbuz1=vbuc1 - lda #bank_set_brom1_bank - sta.z BROM - // [2006] phi from util_wait_key::@2 util_wait_key::@5 util_wait_key::bank_set_brom1 to util_wait_key::kbhit1 [phi:util_wait_key::@2/util_wait_key::@5/util_wait_key::bank_set_brom1->util_wait_key::kbhit1] - // util_wait_key::kbhit1 - kbhit1: - // util_wait_key::kbhit1_cbm_k_clrchn1 - // asm - // asm { jsrCBM_CLRCHN } - jsr CBM_CLRCHN - // [2008] phi from util_wait_key::kbhit1_cbm_k_clrchn1 to util_wait_key::kbhit1_@2 [phi:util_wait_key::kbhit1_cbm_k_clrchn1->util_wait_key::kbhit1_@2] - // util_wait_key::kbhit1_@2 - // cbm_k_getin() - // [2009] call cbm_k_getin - jsr cbm_k_getin - // [2010] cbm_k_getin::return#2 = cbm_k_getin::return#1 - // util_wait_key::@4 - // [2011] util_wait_key::ch#4 = cbm_k_getin::return#2 -- vwum1=vbum2 - lda cbm_k_getin.return - sta ch - lda #0 - sta ch+1 - // util_wait_key::@3 - // if (filter) - // [2012] if((char *)0!=util_wait_key::filter#13) goto util_wait_key::@1 -- pbuc1_neq_pbuz1_then_la1 - // if there is a filter, check the filter, otherwise return ch. - lda.z filter+1 - cmp #>0 - bne __b1 - lda.z filter - cmp #<0 - bne __b1 - // util_wait_key::@2 - // if(ch) - // [2013] if(0!=util_wait_key::ch#4) goto util_wait_key::bank_set_bram2 -- 0_neq_vwum1_then_la1 - lda ch - ora ch+1 - bne bank_set_bram2 - jmp kbhit1 - // util_wait_key::bank_set_bram2 - bank_set_bram2: - // BRAM = bank - // [2014] BRAM = util_wait_key::bram#0 -- vbuz1=vbum2 - lda bram - sta.z BRAM - // util_wait_key::bank_set_brom2 - // BROM = bank - // [2015] BROM = util_wait_key::bank_get_brom1_return#0 -- vbuz1=vbum2 - lda bank_get_brom1_return - sta.z BROM - // util_wait_key::@return - // } - // [2016] return - rts - // util_wait_key::@1 - __b1: - // strchr(filter, ch) - // [2017] strchr::str#0 = (const void *)util_wait_key::filter#13 -- pvoz1=pvoz2 - lda.z filter - sta.z strchr.str - lda.z filter+1 - sta.z strchr.str+1 - // [2018] strchr::c#0 = util_wait_key::ch#4 -- vbum1=vwum2 - lda ch - sta strchr.c - // [2019] call strchr - // [2023] phi from util_wait_key::@1 to strchr [phi:util_wait_key::@1->strchr] - // [2023] phi strchr::c#4 = strchr::c#0 [phi:util_wait_key::@1->strchr#0] -- register_copy - // [2023] phi strchr::str#2 = strchr::str#0 [phi:util_wait_key::@1->strchr#1] -- register_copy - jsr strchr - // strchr(filter, ch) - // [2020] strchr::return#3 = strchr::return#2 - // util_wait_key::@5 - // [2021] util_wait_key::$9 = strchr::return#3 - // if(strchr(filter, ch) != NULL) - // [2022] if(util_wait_key::$9!=0) goto util_wait_key::bank_set_bram2 -- pvoz1_neq_0_then_la1 - lda.z util_wait_key__9 - ora.z util_wait_key__9+1 - bne bank_set_bram2 - jmp kbhit1 - .segment Data - bram: .byte 0 - bank_get_brom1_return: .byte 0 - return: .byte 0 - return_1: .byte 0 - ch: .word 0 -} -.segment Code - // strchr -// Searches for the first occurrence of the character c (an unsigned char) in the string pointed to, by the argument str. -// - 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($5e) void * strchr(__zp($5e) const void *str, __mem() char c) -strchr: { - .label ptr = $5e - .label return = $5e - .label str = $5e - // [2024] strchr::ptr#6 = (char *)strchr::str#2 - // [2025] phi from strchr strchr::@3 to strchr::@1 [phi:strchr/strchr::@3->strchr::@1] - // [2025] phi strchr::ptr#2 = strchr::ptr#6 [phi:strchr/strchr::@3->strchr::@1#0] -- register_copy - // strchr::@1 - __b1: - // while(*ptr) - // [2026] if(0!=*strchr::ptr#2) goto strchr::@2 -- 0_neq__deref_pbuz1_then_la1 - ldy #0 - lda (ptr),y - cmp #0 - bne __b2 - // [2027] phi from strchr::@1 to strchr::@return [phi:strchr::@1->strchr::@return] - // [2027] phi strchr::return#2 = (void *) 0 [phi:strchr::@1->strchr::@return#0] -- pvoz1=pvoc1 - tya - sta.z return - sta.z return+1 - // strchr::@return +// void display_smc_led(__mem() char c) +display_smc_led: { + // display_chip_led(CHIP_SMC_X+1, CHIP_SMC_Y, CHIP_SMC_W, c, BLUE) + // [1355] display_chip_led::tc#0 = display_smc_led::c#2 -- vbum1=vbum2 + lda c + sta display_chip_led.tc + // [1356] call display_chip_led + // [1802] phi from display_smc_led to display_chip_led [phi:display_smc_led->display_chip_led] + // [1802] phi display_chip_led::w#7 = 5 [phi:display_smc_led->display_chip_led#0] -- vbum1=vbuc1 + lda #5 + sta display_chip_led.w + // [1802] phi display_chip_led::x#7 = 1+1 [phi:display_smc_led->display_chip_led#1] -- vbum1=vbuc1 + lda #1+1 + sta display_chip_led.x + // [1802] phi display_chip_led::tc#3 = display_chip_led::tc#0 [phi:display_smc_led->display_chip_led#2] -- register_copy + jsr display_chip_led + // display_smc_led::@1 + // display_info_led(INFO_X-2, INFO_Y, c, BLUE) + // [1357] display_info_led::tc#0 = display_smc_led::c#2 + // [1358] call display_info_led + // [1444] phi from display_smc_led::@1 to display_info_led [phi:display_smc_led::@1->display_info_led] + // [1444] phi display_info_led::y#4 = $11 [phi:display_smc_led::@1->display_info_led#0] -- vbum1=vbuc1 + lda #$11 + sta display_info_led.y + // [1444] phi display_info_led::x#4 = 4-2 [phi:display_smc_led::@1->display_info_led#1] -- vbum1=vbuc1 + lda #4-2 + sta display_info_led.x + // [1444] 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 // } - // [2028] return - rts - // strchr::@2 - __b2: - // if(*ptr==c) - // [2029] if(*strchr::ptr#2!=strchr::c#4) goto strchr::@3 -- _deref_pbuz1_neq_vbum2_then_la1 - ldy #0 - lda (ptr),y - cmp c - bne __b3 - // strchr::@4 - // [2030] strchr::return#8 = (void *)strchr::ptr#2 - // [2027] phi from strchr::@4 to strchr::@return [phi:strchr::@4->strchr::@return] - // [2027] phi strchr::return#2 = strchr::return#8 [phi:strchr::@4->strchr::@return#0] -- register_copy + // [1359] return rts - // strchr::@3 - __b3: - // ptr++; - // [2031] strchr::ptr#1 = ++ strchr::ptr#2 -- pbuz1=_inc_pbuz1 - inc.z ptr - bne !+ - inc.z ptr+1 - !: - jmp __b1 .segment Data c: .byte 0 } .segment Code - // display_info_cx16_rom + // display_print_chip /** - * @brief Display the ROM status of the main CX16 ROM chip. + * @brief Print a full chip. * - * @param info_status The status. - * @param info_text The status text. + * @param x Start X + * @param y Start Y + * @param w Width + * @param text Vertical text to be displayed in the chip, starting from the top. */ -// void display_info_cx16_rom(__mem() char info_status, __zp($3f) char *info_text) -display_info_cx16_rom: { - .label info_text = $3f - // display_info_rom(0, info_status, info_text) - // [2033] display_info_rom::info_status#0 = display_info_cx16_rom::info_status#4 - // [2034] display_info_rom::info_text#0 = display_info_cx16_rom::info_text#4 - // [2035] call display_info_rom - // [1546] phi from display_info_cx16_rom to display_info_rom [phi:display_info_cx16_rom->display_info_rom] - // [1546] phi display_info_rom::info_text#17 = display_info_rom::info_text#0 [phi:display_info_cx16_rom->display_info_rom#0] -- register_copy - // [1546] phi display_info_rom::rom_chip#17 = 0 [phi:display_info_cx16_rom->display_info_rom#1] -- vbum1=vbuc1 - lda #0 - sta display_info_rom.rom_chip - // [1546] phi display_info_rom::info_status#17 = display_info_rom::info_status#0 [phi:display_info_cx16_rom->display_info_rom#2] -- register_copy - jsr display_info_rom - // display_info_cx16_rom::@return +// void display_print_chip(__mem() char x, char y, __mem() char w, __zp($51) char *text) +display_print_chip: { + .label y = 3+2+1+1+1+1+1+1+1+1 + .label text = $51 + .label text_1 = $4f + .label text_2 = $40 + .label text_3 = $6c + .label text_4 = $4b + .label text_5 = $45 + .label text_6 = $53 + // display_chip_line(x, y++, w, *text++) + // [1361] display_chip_line::x#0 = display_print_chip::x#10 -- vbum1=vbum2 + lda x + sta display_chip_line.x + // [1362] display_chip_line::w#0 = display_print_chip::w#10 -- vbum1=vbum2 + lda w + sta display_chip_line.w + // [1363] display_chip_line::c#0 = *display_print_chip::text#11 -- vbum1=_deref_pbuz2 + ldy #0 + lda (text_2),y + sta display_chip_line.c + // [1364] call display_chip_line + // [1820] phi from display_print_chip to display_chip_line [phi:display_print_chip->display_chip_line] + // [1820] phi display_chip_line::c#15 = display_chip_line::c#0 [phi:display_print_chip->display_chip_line#0] -- register_copy + // [1820] phi display_chip_line::w#10 = display_chip_line::w#0 [phi:display_print_chip->display_chip_line#1] -- register_copy + // [1820] phi display_chip_line::y#16 = 3+2 [phi:display_print_chip->display_chip_line#2] -- vbum1=vbuc1 + lda #3+2 + sta display_chip_line.y + // [1820] phi display_chip_line::x#16 = display_chip_line::x#0 [phi:display_print_chip->display_chip_line#3] -- register_copy + jsr display_chip_line + // display_print_chip::@1 + // display_chip_line(x, y++, w, *text++); + // [1365] display_print_chip::text#0 = ++ display_print_chip::text#11 -- pbuz1=_inc_pbuz2 + clc + lda.z text_2 + adc #1 + sta.z text + lda.z text_2+1 + adc #0 + sta.z text+1 + // display_chip_line(x, y++, w, *text++) + // [1366] display_chip_line::x#1 = display_print_chip::x#10 -- vbum1=vbum2 + lda x + sta display_chip_line.x + // [1367] display_chip_line::w#1 = display_print_chip::w#10 -- vbum1=vbum2 + lda w + sta display_chip_line.w + // [1368] display_chip_line::c#1 = *display_print_chip::text#0 -- vbum1=_deref_pbuz2 + ldy #0 + lda (text),y + sta display_chip_line.c + // [1369] call display_chip_line + // [1820] phi from display_print_chip::@1 to display_chip_line [phi:display_print_chip::@1->display_chip_line] + // [1820] phi display_chip_line::c#15 = display_chip_line::c#1 [phi:display_print_chip::@1->display_chip_line#0] -- register_copy + // [1820] phi display_chip_line::w#10 = display_chip_line::w#1 [phi:display_print_chip::@1->display_chip_line#1] -- register_copy + // [1820] phi display_chip_line::y#16 = ++3+2 [phi:display_print_chip::@1->display_chip_line#2] -- vbum1=vbuc1 + lda #3+2+1 + sta display_chip_line.y + // [1820] phi display_chip_line::x#16 = display_chip_line::x#1 [phi:display_print_chip::@1->display_chip_line#3] -- register_copy + jsr display_chip_line + // display_print_chip::@2 + // display_chip_line(x, y++, w, *text++); + // [1370] display_print_chip::text#1 = ++ display_print_chip::text#0 -- pbuz1=_inc_pbuz2 + clc + lda.z text + adc #1 + sta.z text_1 + lda.z text+1 + adc #0 + sta.z text_1+1 + // display_chip_line(x, y++, w, *text++) + // [1371] display_chip_line::x#2 = display_print_chip::x#10 -- vbum1=vbum2 + lda x + sta display_chip_line.x + // [1372] display_chip_line::w#2 = display_print_chip::w#10 -- vbum1=vbum2 + lda w + sta display_chip_line.w + // [1373] display_chip_line::c#2 = *display_print_chip::text#1 -- vbum1=_deref_pbuz2 + ldy #0 + lda (text_1),y + sta display_chip_line.c + // [1374] call display_chip_line + // [1820] phi from display_print_chip::@2 to display_chip_line [phi:display_print_chip::@2->display_chip_line] + // [1820] phi display_chip_line::c#15 = display_chip_line::c#2 [phi:display_print_chip::@2->display_chip_line#0] -- register_copy + // [1820] phi display_chip_line::w#10 = display_chip_line::w#2 [phi:display_print_chip::@2->display_chip_line#1] -- register_copy + // [1820] phi display_chip_line::y#16 = ++++3+2 [phi:display_print_chip::@2->display_chip_line#2] -- vbum1=vbuc1 + lda #3+2+1+1 + sta display_chip_line.y + // [1820] phi display_chip_line::x#16 = display_chip_line::x#2 [phi:display_print_chip::@2->display_chip_line#3] -- register_copy + jsr display_chip_line + // display_print_chip::@3 + // display_chip_line(x, y++, w, *text++); + // [1375] display_print_chip::text#15 = ++ display_print_chip::text#1 -- pbuz1=_inc_pbuz2 + clc + lda.z text_1 + adc #1 + sta.z text_3 + lda.z text_1+1 + adc #0 + sta.z text_3+1 + // display_chip_line(x, y++, w, *text++) + // [1376] display_chip_line::x#3 = display_print_chip::x#10 -- vbum1=vbum2 + lda x + sta display_chip_line.x + // [1377] display_chip_line::w#3 = display_print_chip::w#10 -- vbum1=vbum2 + lda w + sta display_chip_line.w + // [1378] display_chip_line::c#3 = *display_print_chip::text#15 -- vbum1=_deref_pbuz2 + ldy #0 + lda (text_3),y + sta display_chip_line.c + // [1379] call display_chip_line + // [1820] phi from display_print_chip::@3 to display_chip_line [phi:display_print_chip::@3->display_chip_line] + // [1820] phi display_chip_line::c#15 = display_chip_line::c#3 [phi:display_print_chip::@3->display_chip_line#0] -- register_copy + // [1820] phi display_chip_line::w#10 = display_chip_line::w#3 [phi:display_print_chip::@3->display_chip_line#1] -- register_copy + // [1820] phi display_chip_line::y#16 = ++++++3+2 [phi:display_print_chip::@3->display_chip_line#2] -- vbum1=vbuc1 + lda #3+2+1+1+1 + sta display_chip_line.y + // [1820] phi display_chip_line::x#16 = display_chip_line::x#3 [phi:display_print_chip::@3->display_chip_line#3] -- register_copy + jsr display_chip_line + // display_print_chip::@4 + // display_chip_line(x, y++, w, *text++); + // [1380] display_print_chip::text#16 = ++ display_print_chip::text#15 -- pbuz1=_inc_pbuz2 + clc + lda.z text_3 + adc #1 + sta.z text_4 + lda.z text_3+1 + adc #0 + sta.z text_4+1 + // display_chip_line(x, y++, w, *text++) + // [1381] display_chip_line::x#4 = display_print_chip::x#10 -- vbum1=vbum2 + lda x + sta display_chip_line.x + // [1382] display_chip_line::w#4 = display_print_chip::w#10 -- vbum1=vbum2 + lda w + sta display_chip_line.w + // [1383] display_chip_line::c#4 = *display_print_chip::text#16 -- vbum1=_deref_pbuz2 + ldy #0 + lda (text_4),y + sta display_chip_line.c + // [1384] call display_chip_line + // [1820] phi from display_print_chip::@4 to display_chip_line [phi:display_print_chip::@4->display_chip_line] + // [1820] phi display_chip_line::c#15 = display_chip_line::c#4 [phi:display_print_chip::@4->display_chip_line#0] -- register_copy + // [1820] phi display_chip_line::w#10 = display_chip_line::w#4 [phi:display_print_chip::@4->display_chip_line#1] -- register_copy + // [1820] phi display_chip_line::y#16 = ++++++++3+2 [phi:display_print_chip::@4->display_chip_line#2] -- vbum1=vbuc1 + lda #3+2+1+1+1+1 + sta display_chip_line.y + // [1820] phi display_chip_line::x#16 = display_chip_line::x#4 [phi:display_print_chip::@4->display_chip_line#3] -- register_copy + jsr display_chip_line + // display_print_chip::@5 + // display_chip_line(x, y++, w, *text++); + // [1385] display_print_chip::text#17 = ++ display_print_chip::text#16 -- pbuz1=_inc_pbuz2 + clc + lda.z text_4 + adc #1 + sta.z text_5 + lda.z text_4+1 + adc #0 + sta.z text_5+1 + // display_chip_line(x, y++, w, *text++) + // [1386] display_chip_line::x#5 = display_print_chip::x#10 -- vbum1=vbum2 + lda x + sta display_chip_line.x + // [1387] display_chip_line::w#5 = display_print_chip::w#10 -- vbum1=vbum2 + lda w + sta display_chip_line.w + // [1388] display_chip_line::c#5 = *display_print_chip::text#17 -- vbum1=_deref_pbuz2 + ldy #0 + lda (text_5),y + sta display_chip_line.c + // [1389] call display_chip_line + // [1820] phi from display_print_chip::@5 to display_chip_line [phi:display_print_chip::@5->display_chip_line] + // [1820] phi display_chip_line::c#15 = display_chip_line::c#5 [phi:display_print_chip::@5->display_chip_line#0] -- register_copy + // [1820] phi display_chip_line::w#10 = display_chip_line::w#5 [phi:display_print_chip::@5->display_chip_line#1] -- register_copy + // [1820] phi display_chip_line::y#16 = ++++++++++3+2 [phi:display_print_chip::@5->display_chip_line#2] -- vbum1=vbuc1 + lda #3+2+1+1+1+1+1 + sta display_chip_line.y + // [1820] phi display_chip_line::x#16 = display_chip_line::x#5 [phi:display_print_chip::@5->display_chip_line#3] -- register_copy + jsr display_chip_line + // display_print_chip::@6 + // display_chip_line(x, y++, w, *text++); + // [1390] display_print_chip::text#18 = ++ display_print_chip::text#17 -- pbuz1=_inc_pbuz2 + clc + lda.z text_5 + adc #1 + sta.z text_6 + lda.z text_5+1 + adc #0 + sta.z text_6+1 + // display_chip_line(x, y++, w, *text++) + // [1391] display_chip_line::x#6 = display_print_chip::x#10 -- vbum1=vbum2 + lda x + sta display_chip_line.x + // [1392] display_chip_line::w#6 = display_print_chip::w#10 -- vbum1=vbum2 + lda w + sta display_chip_line.w + // [1393] display_chip_line::c#6 = *display_print_chip::text#18 -- vbum1=_deref_pbuz2 + ldy #0 + lda (text_6),y + sta display_chip_line.c + // [1394] call display_chip_line + // [1820] phi from display_print_chip::@6 to display_chip_line [phi:display_print_chip::@6->display_chip_line] + // [1820] phi display_chip_line::c#15 = display_chip_line::c#6 [phi:display_print_chip::@6->display_chip_line#0] -- register_copy + // [1820] phi display_chip_line::w#10 = display_chip_line::w#6 [phi:display_print_chip::@6->display_chip_line#1] -- register_copy + // [1820] phi display_chip_line::y#16 = ++++++++++++3+2 [phi:display_print_chip::@6->display_chip_line#2] -- vbum1=vbuc1 + lda #3+2+1+1+1+1+1+1 + sta display_chip_line.y + // [1820] phi display_chip_line::x#16 = display_chip_line::x#6 [phi:display_print_chip::@6->display_chip_line#3] -- register_copy + jsr display_chip_line + // display_print_chip::@7 + // display_chip_line(x, y++, w, *text++); + // [1395] display_print_chip::text#19 = ++ display_print_chip::text#18 -- pbuz1=_inc_pbuz1 + inc.z text_6 + bne !+ + inc.z text_6+1 + !: + // display_chip_line(x, y++, w, *text++) + // [1396] display_chip_line::x#7 = display_print_chip::x#10 -- vbum1=vbum2 + lda x + sta display_chip_line.x + // [1397] display_chip_line::w#7 = display_print_chip::w#10 -- vbum1=vbum2 + lda w + sta display_chip_line.w + // [1398] display_chip_line::c#7 = *display_print_chip::text#19 -- vbum1=_deref_pbuz2 + ldy #0 + lda (text_6),y + sta display_chip_line.c + // [1399] call display_chip_line + // [1820] phi from display_print_chip::@7 to display_chip_line [phi:display_print_chip::@7->display_chip_line] + // [1820] phi display_chip_line::c#15 = display_chip_line::c#7 [phi:display_print_chip::@7->display_chip_line#0] -- register_copy + // [1820] phi display_chip_line::w#10 = display_chip_line::w#7 [phi:display_print_chip::@7->display_chip_line#1] -- register_copy + // [1820] phi display_chip_line::y#16 = ++++++++++++++3+2 [phi:display_print_chip::@7->display_chip_line#2] -- vbum1=vbuc1 + lda #3+2+1+1+1+1+1+1+1 + sta display_chip_line.y + // [1820] phi display_chip_line::x#16 = display_chip_line::x#7 [phi:display_print_chip::@7->display_chip_line#3] -- register_copy + jsr display_chip_line + // display_print_chip::@8 + // display_chip_end(x, y++, w) + // [1400] display_chip_end::x#0 = display_print_chip::x#10 + // [1401] display_chip_end::w#0 = display_print_chip::w#10 -- vbum1=vbum2 + lda w + sta display_chip_end.w + // [1402] call display_chip_end + jsr display_chip_end + // display_print_chip::@return // } - // [2036] return + // [1403] return rts .segment Data - .label info_status = display_info_rom.info_status + x: .byte 0 + w: .byte 0 } .segment Code - // rom_get_release + // display_vera_led /** - * @brief Calculate the correct ROM release number. - * The 2's complement is taken if bit 7 is set of the release number. + * @brief Print VERA led above the VERA chip. * - * @param release The raw release number. - * @return unsigned char The release potentially taken 2's complement. + * @param c Led color */ -// __mem() char rom_get_release(__mem() char release) -rom_get_release: { - .label rom_get_release__0 = $c2 - .label rom_get_release__2 = $60 - // release & 0x80 - // [2038] rom_get_release::$0 = rom_get_release::release#3 & $80 -- vbuz1=vbum2_band_vbuc1 - lda #$80 - and release - sta.z rom_get_release__0 - // if(release & 0x80) - // [2039] if(0==rom_get_release::$0) goto rom_get_release::@1 -- 0_eq_vbuz1_then_la1 - beq __b1 - // rom_get_release::@2 - // ~release - // [2040] rom_get_release::$2 = ~ rom_get_release::release#3 -- vbuz1=_bnot_vbum2 - lda release - eor #$ff - sta.z rom_get_release__2 - // release = ~release + 1 - // [2041] rom_get_release::release#0 = rom_get_release::$2 + 1 -- vbum1=vbuz2_plus_1 - inc - sta release - // [2042] 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] - // [2042] phi rom_get_release::return#0 = rom_get_release::release#3 [phi:rom_get_release/rom_get_release::@2->rom_get_release::@1#0] -- register_copy - // rom_get_release::@1 - __b1: - // rom_get_release::@return +// void display_vera_led(__mem() char c) +display_vera_led: { + // display_chip_led(CHIP_VERA_X+1, CHIP_VERA_Y, CHIP_VERA_W, c, BLUE) + // [1405] display_chip_led::tc#1 = display_vera_led::c#2 -- vbum1=vbum2 + lda c + sta display_chip_led.tc + // [1406] call display_chip_led + // [1802] phi from display_vera_led to display_chip_led [phi:display_vera_led->display_chip_led] + // [1802] phi display_chip_led::w#7 = 8 [phi:display_vera_led->display_chip_led#0] -- vbum1=vbuc1 + lda #8 + sta display_chip_led.w + // [1802] phi display_chip_led::x#7 = 9+1 [phi:display_vera_led->display_chip_led#1] -- vbum1=vbuc1 + lda #9+1 + sta display_chip_led.x + // [1802] phi display_chip_led::tc#3 = display_chip_led::tc#1 [phi:display_vera_led->display_chip_led#2] -- register_copy + jsr display_chip_led + // display_vera_led::@1 + // display_info_led(INFO_X-2, INFO_Y+1, c, BLUE) + // [1407] display_info_led::tc#1 = display_vera_led::c#2 -- vbum1=vbum2 + lda c + sta display_info_led.tc + // [1408] call display_info_led + // [1444] phi from display_vera_led::@1 to display_info_led [phi:display_vera_led::@1->display_info_led] + // [1444] phi display_info_led::y#4 = $11+1 [phi:display_vera_led::@1->display_info_led#0] -- vbum1=vbuc1 + lda #$11+1 + sta display_info_led.y + // [1444] phi display_info_led::x#4 = 4-2 [phi:display_vera_led::@1->display_info_led#1] -- vbum1=vbuc1 + lda #4-2 + sta display_info_led.x + // [1444] 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 // } - // [2043] return + // [1409] return rts .segment Data - return: .byte 0 - .label release = return + c: .byte 0 } .segment Code - // rom_get_prefix -/** - * @brief Determine the prefix of the ROM release number. - * If the version is 0xFF or bit 7 of the version is set, then the release is a preview. - * - * @param rom_chip The ROM chip to calculate the 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) -rom_get_prefix: { - .label rom_get_prefix__2 = $c2 - // if(release == 0xFF) - // [2045] if(rom_get_prefix::release#2!=$ff) goto rom_get_prefix::@1 -- vbum1_neq_vbuc1_then_la1 - lda #$ff - cmp release - bne __b3 - // [2046] phi from rom_get_prefix to rom_get_prefix::@3 [phi:rom_get_prefix->rom_get_prefix::@3] - // rom_get_prefix::@3 - // [2047] phi from rom_get_prefix::@3 to rom_get_prefix::@1 [phi:rom_get_prefix::@3->rom_get_prefix::@1] - // [2047] phi rom_get_prefix::prefix#4 = 'p' [phi:rom_get_prefix::@3->rom_get_prefix::@1#0] -- vbum1=vbuc1 - lda #'p' - sta prefix - jmp __b1 - // [2047] phi from rom_get_prefix to rom_get_prefix::@1 [phi:rom_get_prefix->rom_get_prefix::@1] - __b3: - // [2047] phi rom_get_prefix::prefix#4 = 'r' [phi:rom_get_prefix->rom_get_prefix::@1#0] -- vbum1=vbuc1 - lda #'r' - sta prefix - // rom_get_prefix::@1 + // strcat +// Concatenates the C string pointed by source into the array pointed by destination, including the terminating null character (and stopping at that point). +// char * strcat(char *destination, __zp($59) char *source) +strcat: { + .label strcat__0 = $5f + .label dst = $5f + .label src = $59 + .label source = $59 + // strlen(destination) + // [1411] call strlen + // [1788] phi from strcat to strlen [phi:strcat->strlen] + // [1788] phi strlen::str#8 = display_chip_rom::rom [phi:strcat->strlen#0] -- pbuz1=pbuc1 + lda #display_chip_rom.rom + sta.z strlen.str+1 + jsr strlen + // strlen(destination) + // [1412] strlen::return#0 = strlen::len#2 + // strcat::@4 + // [1413] strcat::$0 = strlen::return#0 -- vwuz1=vwum2 + lda strlen.return + sta.z strcat__0 + lda strlen.return+1 + sta.z strcat__0+1 + // char* dst = destination + strlen(destination) + // [1414] strcat::dst#0 = display_chip_rom::rom + strcat::$0 -- pbuz1=pbuc1_plus_vwuz1 + lda.z dst + clc + adc #display_chip_rom.rom + sta.z dst+1 + // [1415] phi from strcat::@2 strcat::@4 to strcat::@1 [phi:strcat::@2/strcat::@4->strcat::@1] + // [1415] phi strcat::dst#2 = strcat::dst#1 [phi:strcat::@2/strcat::@4->strcat::@1#0] -- register_copy + // [1415] phi strcat::src#2 = strcat::src#1 [phi:strcat::@2/strcat::@4->strcat::@1#1] -- register_copy + // strcat::@1 __b1: - // release & 0x80 - // [2048] rom_get_prefix::$2 = rom_get_prefix::release#2 & $80 -- vbuz1=vbum2_band_vbuc1 - lda #$80 - and release - sta.z rom_get_prefix__2 - // if(release & 0x80) - // [2049] if(0==rom_get_prefix::$2) goto rom_get_prefix::@4 -- 0_eq_vbuz1_then_la1 - beq __b2 - // [2051] phi from rom_get_prefix::@1 to rom_get_prefix::@2 [phi:rom_get_prefix::@1->rom_get_prefix::@2] - // [2051] phi rom_get_prefix::return#0 = 'p' [phi:rom_get_prefix::@1->rom_get_prefix::@2#0] -- vbum1=vbuc1 - lda #'p' - sta return - rts - // [2050] phi from rom_get_prefix::@1 to rom_get_prefix::@4 [phi:rom_get_prefix::@1->rom_get_prefix::@4] - // rom_get_prefix::@4 - // [2051] phi from rom_get_prefix::@4 to rom_get_prefix::@2 [phi:rom_get_prefix::@4->rom_get_prefix::@2] - // [2051] phi rom_get_prefix::return#0 = rom_get_prefix::prefix#4 [phi:rom_get_prefix::@4->rom_get_prefix::@2#0] -- register_copy - // rom_get_prefix::@2 - __b2: - // rom_get_prefix::@return + // while(*src) + // [1416] if(0!=*strcat::src#2) goto strcat::@2 -- 0_neq__deref_pbuz1_then_la1 + ldy #0 + lda (src),y + cmp #0 + bne __b2 + // strcat::@3 + // *dst = 0 + // [1417] *strcat::dst#2 = 0 -- _deref_pbuz1=vbuc1 + tya + tay + sta (dst),y + // strcat::@return // } - // [2052] return + // [1418] return rts - .segment Data - return: .byte 0 - release: .byte 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 + // strcat::@2 + __b2: + // *dst++ = *src++ + // [1419] *strcat::dst#2 = *strcat::src#2 -- _deref_pbuz1=_deref_pbuz2 + ldy #0 + lda (src),y + sta (dst),y + // *dst++ = *src++; + // [1420] strcat::dst#1 = ++ strcat::dst#2 -- pbuz1=_inc_pbuz1 + inc.z dst + bne !+ + inc.z dst+1 + !: + // [1421] strcat::src#1 = ++ strcat::src#2 -- pbuz1=_inc_pbuz1 + inc.z src + bne !+ + inc.z src+1 + !: + jmp __b1 } -.segment Code - // rom_get_version_text -// void rom_get_version_text(__zp($45) char *release_info, __mem() char prefix, __mem() char release, __zp($6c) char *github) -rom_get_version_text: { - .label release_info = $45 - .label github = $6c - // sprintf(release_info, "%c%u %s", prefix, release, github) - // [2054] snprintf_init::s#10 = rom_get_version_text::release_info#2 - // [2055] call snprintf_init - // [1205] phi from rom_get_version_text to snprintf_init [phi:rom_get_version_text->snprintf_init] - // [1205] phi snprintf_init::s#31 = snprintf_init::s#10 [phi:rom_get_version_text->snprintf_init#0] -- register_copy - jsr snprintf_init - // rom_get_version_text::@1 - // sprintf(release_info, "%c%u %s", prefix, release, github) - // [2056] stackpush(char) = rom_get_version_text::prefix#2 -- _stackpushbyte_=vbum1 - lda prefix - pha - // [2057] callexecute snputc -- call_vprc1 - jsr snputc - // sideeffect stackpullpadding(1) -- _stackpullpadding_1 - pla - // [2059] printf_uchar::uvalue#13 = rom_get_version_text::release#2 -- vbum1=vbum2 - lda release - sta printf_uchar.uvalue - // [2060] call printf_uchar - // [1346] phi from rom_get_version_text::@1 to printf_uchar [phi:rom_get_version_text::@1->printf_uchar] - // [1346] phi printf_uchar::format_zero_padding#18 = 0 [phi:rom_get_version_text::@1->printf_uchar#0] -- vbum1=vbuc1 - lda #0 - sta printf_uchar.format_zero_padding - // [1346] phi printf_uchar::format_min_length#18 = 0 [phi:rom_get_version_text::@1->printf_uchar#1] -- vbum1=vbuc1 - sta printf_uchar.format_min_length - // [1346] phi printf_uchar::putc#18 = &snputc [phi:rom_get_version_text::@1->printf_uchar#2] -- pprz1=pprc1 - lda #snputc - sta.z printf_uchar.putc+1 - // [1346] phi printf_uchar::format_radix#18 = DECIMAL [phi:rom_get_version_text::@1->printf_uchar#3] -- vbum1=vbuc1 - lda #DECIMAL - sta printf_uchar.format_radix - // [1346] phi printf_uchar::uvalue#18 = printf_uchar::uvalue#13 [phi:rom_get_version_text::@1->printf_uchar#4] -- register_copy - jsr printf_uchar - // [2061] phi from rom_get_version_text::@1 to rom_get_version_text::@2 [phi:rom_get_version_text::@1->rom_get_version_text::@2] - // rom_get_version_text::@2 - // sprintf(release_info, "%c%u %s", prefix, release, github) - // [2062] call printf_str - // [1210] phi from rom_get_version_text::@2 to printf_str [phi:rom_get_version_text::@2->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:rom_get_version_text::@2->printf_str#0] -- pprz1=pprc1 - lda #snputc - sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = s4 [phi:rom_get_version_text::@2->printf_str#1] -- pbuz1=pbuc1 - lda #s4 - sta.z printf_str.s+1 - jsr printf_str - // rom_get_version_text::@3 - // sprintf(release_info, "%c%u %s", prefix, release, github) - // [2063] printf_string::str#16 = rom_get_version_text::github#2 -- pbuz1=pbuz2 - lda.z github - sta.z printf_string.str - lda.z github+1 - sta.z printf_string.str+1 - // [2064] call printf_string - // [1219] phi from rom_get_version_text::@3 to printf_string [phi:rom_get_version_text::@3->printf_string] - // [1219] phi printf_string::putc#26 = &snputc [phi:rom_get_version_text::@3->printf_string#0] -- pprz1=pprc1 - lda #snputc - sta.z printf_string.putc+1 - // [1219] phi printf_string::str#26 = printf_string::str#16 [phi:rom_get_version_text::@3->printf_string#1] -- register_copy - // [1219] phi printf_string::format_justify_left#26 = 0 [phi:rom_get_version_text::@3->printf_string#2] -- vbum1=vbuc1 - lda #0 - sta printf_string.format_justify_left - // [1219] phi printf_string::format_min_length#26 = 0 [phi:rom_get_version_text::@3->printf_string#3] -- vbum1=vbuc1 - sta printf_string.format_min_length - jsr printf_string - // rom_get_version_text::@4 - // sprintf(release_info, "%c%u %s", prefix, release, github) - // [2065] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 - lda #0 - pha - // [2066] callexecute snputc -- call_vprc1 - jsr snputc - // sideeffect stackpullpadding(1) -- _stackpullpadding_1 - pla - // rom_get_version_text::@return - // } - // [2068] return - rts - .segment Data - prefix: .byte 0 - release: .byte 0 -} -.segment Code - // rom_get_github_commit_id + // display_rom_led /** - * @brief Copy the github commit_id only if the commit_id contains hexadecimal characters. + * @brief Print ROM led above the ROM chip. * - * @param commit_id The target commit_id. - * @param from The source ptr in ROM or RAM. + * @param chip ROM chip number (0 is main rom chip of CX16) + * @param c Led color */ -// void rom_get_github_commit_id(__zp($47) char *commit_id, __zp($3f) char *from) -rom_get_github_commit_id: { - .label commit_id = $47 - .label from = $3f - // [2070] 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] - // [2070] 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 - lda #1 - sta commit_id_ok - // [2070] 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 - // rom_get_github_commit_id::@2 - __b2: - // for(unsigned char c=0; c<7; c++) - // [2071] if(rom_get_github_commit_id::c#2<7) goto rom_get_github_commit_id::@3 -- vbum1_lt_vbuc1_then_la1 +// void display_rom_led(__mem() char chip, __mem() char c) +display_rom_led: { + .label display_rom_led__0 = $38 + .label display_rom_led__7 = $38 + .label display_rom_led__8 = $38 + // chip*6 + // [1423] display_rom_led::$7 = display_rom_led::chip#2 << 1 -- vbuz1=vbum2_rol_1 + lda chip + asl + sta.z display_rom_led__7 + // [1424] display_rom_led::$8 = display_rom_led::$7 + display_rom_led::chip#2 -- vbuz1=vbuz1_plus_vbum2 + lda chip + clc + adc.z display_rom_led__8 + sta.z display_rom_led__8 + // CHIP_ROM_X+chip*6 + // [1425] display_rom_led::$0 = display_rom_led::$8 << 1 -- vbuz1=vbuz1_rol_1 + asl.z display_rom_led__0 + // display_chip_led(CHIP_ROM_X+chip*6+1, CHIP_ROM_Y, CHIP_ROM_W, c, BLUE) + // [1426] display_chip_led::x#3 = display_rom_led::$0 + $14+1 -- vbum1=vbuz2_plus_vbuc1 + lda #$14+1 + clc + adc.z display_rom_led__0 + sta display_chip_led.x + // [1427] display_chip_led::tc#2 = display_rom_led::c#2 -- vbum1=vbum2 lda c - cmp #7 - bcc __b3 - // rom_get_github_commit_id::@4 - // if(commit_id_ok) - // [2072] 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 - bne __b1 - // rom_get_github_commit_id::@6 - // *commit_id = '\0' - // [2073] *rom_get_github_commit_id::commit_id#6 = '@' -- _deref_pbuz1=vbuc1 - lda #'@' - ldy #0 - sta (commit_id),y - // rom_get_github_commit_id::@return + sta display_chip_led.tc + // [1428] call display_chip_led + // [1802] phi from display_rom_led to display_chip_led [phi:display_rom_led->display_chip_led] + // [1802] phi display_chip_led::w#7 = 3 [phi:display_rom_led->display_chip_led#0] -- vbum1=vbuc1 + lda #3 + sta display_chip_led.w + // [1802] phi display_chip_led::x#7 = display_chip_led::x#3 [phi:display_rom_led->display_chip_led#1] -- register_copy + // [1802] phi display_chip_led::tc#3 = display_chip_led::tc#2 [phi:display_rom_led->display_chip_led#2] -- register_copy + jsr display_chip_led + // display_rom_led::@1 + // display_info_led(INFO_X-2, INFO_Y+chip+2, c, BLUE) + // [1429] display_info_led::y#2 = display_rom_led::chip#2 + $11+2 -- vbum1=vbum2_plus_vbuc1 + lda #$11+2 + clc + adc chip + sta display_info_led.y + // [1430] display_info_led::tc#2 = display_rom_led::c#2 -- vbum1=vbum2 + lda c + sta display_info_led.tc + // [1431] call display_info_led + // [1444] phi from display_rom_led::@1 to display_info_led [phi:display_rom_led::@1->display_info_led] + // [1444] phi display_info_led::y#4 = display_info_led::y#2 [phi:display_rom_led::@1->display_info_led#0] -- register_copy + // [1444] phi display_info_led::x#4 = 4-2 [phi:display_rom_led::@1->display_info_led#1] -- vbum1=vbuc1 + lda #4-2 + sta display_info_led.x + // [1444] 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 // } - // [2074] return + // [1432] return rts - // rom_get_github_commit_id::@1 - __b1: - // strncpy(commit_id, from, 7) - // [2075] strncpy::dst#2 = rom_get_github_commit_id::commit_id#6 - // [2076] strncpy::src#2 = rom_get_github_commit_id::from#6 - // [2077] call strncpy - // [3002] phi from rom_get_github_commit_id::@1 to strncpy [phi:rom_get_github_commit_id::@1->strncpy] - // [3002] phi strncpy::dst#8 = strncpy::dst#2 [phi:rom_get_github_commit_id::@1->strncpy#0] -- register_copy - // [3002] phi strncpy::src#6 = strncpy::src#2 [phi:rom_get_github_commit_id::@1->strncpy#1] -- register_copy - // [3002] phi strncpy::n#3 = 7 [phi:rom_get_github_commit_id::@1->strncpy#2] -- vwum1=vbuc1 - lda #<7 - sta strncpy.n - lda #>7 - sta strncpy.n+1 - jsr strncpy - rts - // rom_get_github_commit_id::@3 - __b3: - // unsigned char ch = from[c] - // [2078] rom_get_github_commit_id::ch#0 = rom_get_github_commit_id::from#6[rom_get_github_commit_id::c#2] -- vbum1=pbuz2_derefidx_vbum3 - ldy c - lda (from),y - sta ch - // if(!(ch >= 48 && ch <= 48+9 || ch >= 65 && ch <= 65+26)) - // [2079] if(rom_get_github_commit_id::ch#0<$30) goto rom_get_github_commit_id::@7 -- vbum1_lt_vbuc1_then_la1 - cmp #$30 - bcc __b7 - // rom_get_github_commit_id::@8 - // [2080] if(rom_get_github_commit_id::ch#0<$30+9+1) goto rom_get_github_commit_id::@5 -- vbum1_lt_vbuc1_then_la1 - cmp #$30+9+1 - bcc __b5 - // rom_get_github_commit_id::@7 - __b7: - // [2081] if(rom_get_github_commit_id::ch#0<$41) goto rom_get_github_commit_id::@5 -- vbum1_lt_vbuc1_then_la1 - lda ch - cmp #$41 - bcc __b4 - // rom_get_github_commit_id::@9 - // [2082] if(rom_get_github_commit_id::ch#0<$41+$1a+1) goto rom_get_github_commit_id::@10 -- vbum1_lt_vbuc1_then_la1 - cmp #$41+$1a+1 - bcc __b5 - // [2084] 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: - // [2084] 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 - lda #0 - sta commit_id_ok - // [2083] 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 - // [2084] 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] - // [2084] phi rom_get_github_commit_id::commit_id_ok#4 = rom_get_github_commit_id::commit_id_ok#2 [phi:rom_get_github_commit_id::@10/rom_get_github_commit_id::@8->rom_get_github_commit_id::@5#0] -- register_copy - // rom_get_github_commit_id::@5 - __b5: - // for(unsigned char c=0; c<7; c++) - // [2085] rom_get_github_commit_id::c#1 = ++ rom_get_github_commit_id::c#2 -- vbum1=_inc_vbum1 - inc c - // [2070] 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] - // [2070] 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 - // [2070] 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 - ch: .byte 0 + chip: .byte 0 c: .byte 0 - commit_id_ok: .byte 0 } .segment Code // printf_uint // Print an unsigned int using a specific format -// void printf_uint(__zp($3b) void (*putc)(char), __mem() unsigned int uvalue, __mem() char format_min_length, char format_justify_left, char format_sign_always, __mem() char format_zero_padding, char format_upper_case, __mem() char format_radix) +// void printf_uint(__zp($49) void (*putc)(char), __mem() unsigned int uvalue, __mem() char format_min_length, char format_justify_left, char format_sign_always, __mem() char format_zero_padding, char format_upper_case, __mem() char format_radix) printf_uint: { - .label putc = $3b + .label putc = $49 // printf_uint::@1 // printf_buffer.sign = format.sign_always?'+':0 - // [2087] *((char *)&printf_buffer) = 0 -- _deref_pbuc1=vbuc2 + // [1434] *((char *)&printf_buffer) = 0 -- _deref_pbuc1=vbuc2 // Handle any sign lda #0 sta printf_buffer // utoa(uvalue, printf_buffer.digits, format.radix) - // [2088] utoa::value#1 = printf_uint::uvalue#10 - // [2089] utoa::radix#0 = printf_uint::format_radix#10 - // [2090] call utoa + // [1435] utoa::value#1 = printf_uint::uvalue#4 + // [1436] utoa::radix#0 = printf_uint::format_radix#4 + // [1437] call utoa // Format number into buffer jsr utoa // printf_uint::@2 // printf_number_buffer(putc, printf_buffer, format) - // [2091] printf_number_buffer::putc#1 = printf_uint::putc#10 - // [2092] printf_number_buffer::buffer_sign#1 = *((char *)&printf_buffer) -- vbum1=_deref_pbuc1 + // [1438] printf_number_buffer::putc#1 = printf_uint::putc#4 + // [1439] printf_number_buffer::buffer_sign#1 = *((char *)&printf_buffer) -- vbum1=_deref_pbuc1 lda printf_buffer sta printf_number_buffer.buffer_sign - // [2093] printf_number_buffer::format_min_length#1 = printf_uint::format_min_length#10 - // [2094] printf_number_buffer::format_zero_padding#1 = printf_uint::format_zero_padding#10 - // [2095] call printf_number_buffer + // [1440] printf_number_buffer::format_min_length#1 = printf_uint::format_min_length#4 + // [1441] printf_number_buffer::format_zero_padding#1 = printf_uint::format_zero_padding#4 + // [1442] call printf_number_buffer // Print using format - // [2706] phi from printf_uint::@2 to printf_number_buffer [phi:printf_uint::@2->printf_number_buffer] - // [2706] phi printf_number_buffer::putc#10 = printf_number_buffer::putc#1 [phi:printf_uint::@2->printf_number_buffer#0] -- register_copy - // [2706] phi printf_number_buffer::buffer_sign#10 = printf_number_buffer::buffer_sign#1 [phi:printf_uint::@2->printf_number_buffer#1] -- register_copy - // [2706] 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 - // [2706] 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 + // [1539] phi from printf_uint::@2 to printf_number_buffer [phi:printf_uint::@2->printf_number_buffer] + // [1539] phi printf_number_buffer::putc#10 = printf_number_buffer::putc#1 [phi:printf_uint::@2->printf_number_buffer#0] -- register_copy + // [1539] phi printf_number_buffer::buffer_sign#10 = printf_number_buffer::buffer_sign#1 [phi:printf_uint::@2->printf_number_buffer#1] -- register_copy + // [1539] 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 + // [1539] 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 // } - // [2096] return + // [1443] return rts .segment Data - .label uvalue = smc_detect.return + uvalue: .word 0 format_radix: .byte 0 .label format_min_length = printf_uchar.format_min_length .label format_zero_padding = printf_uchar.format_zero_padding } .segment Code - // screenlayer -// --- layer management in VERA --- -// void screenlayer(char layer, __mem() char mapbase, __mem() char config) -screenlayer: { - .label screenlayer__0 = $5d - .label screenlayer__1 = $5c - .label screenlayer__2 = $ba - .label screenlayer__5 = $b5 - .label screenlayer__6 = $b5 - .label screenlayer__7 = $b4 - .label screenlayer__8 = $b4 - .label screenlayer__9 = $b2 - .label screenlayer__10 = $b2 - .label screenlayer__11 = $b2 - .label screenlayer__12 = $b3 - .label screenlayer__13 = $b3 - .label screenlayer__14 = $b3 - .label screenlayer__16 = $b4 - .label screenlayer__17 = $ab - .label screenlayer__18 = $b2 - .label screenlayer__19 = $b3 - .label y = $7f - // __mem char vera_dc_hscale_temp = *VERA_DC_HSCALE - // [2097] screenlayer::vera_dc_hscale_temp#0 = *VERA_DC_HSCALE -- vbum1=_deref_pbuc1 - lda VERA_DC_HSCALE - sta vera_dc_hscale_temp - // __mem char vera_dc_vscale_temp = *VERA_DC_VSCALE - // [2098] screenlayer::vera_dc_vscale_temp#0 = *VERA_DC_VSCALE -- vbum1=_deref_pbuc1 - lda VERA_DC_VSCALE - sta vera_dc_vscale_temp - // __conio.layer = 0 - // [2099] *((char *)&__conio+2) = 0 -- _deref_pbuc1=vbuc2 - lda #0 - sta __conio+2 - // mapbase >> 7 - // [2100] screenlayer::$0 = screenlayer::mapbase#0 >> 7 -- vbuz1=vbum2_ror_7 - lda mapbase - rol - rol - and #1 - sta.z screenlayer__0 - // __conio.mapbase_bank = mapbase >> 7 - // [2101] *((char *)&__conio+5) = screenlayer::$0 -- _deref_pbuc1=vbuz1 - sta __conio+5 - // (mapbase)<<1 - // [2102] screenlayer::$1 = screenlayer::mapbase#0 << 1 -- vbuz1=vbum2_rol_1 - lda mapbase - asl - sta.z screenlayer__1 - // MAKEWORD((mapbase)<<1,0) - // [2103] screenlayer::$2 = screenlayer::$1 w= 0 -- vwuz1=vbuz2_word_vbuc1 + // display_info_led +/** + * @brief Print the colored led of an info line in the info frame. + * + * @param x Start X + * @param y Start Y + * @param tc Fore color + * @param bc Back color + */ +// void display_info_led(__mem() char x, __mem() char y, __mem() char tc, char bc) +display_info_led: { + // textcolor(tc) + // [1445] textcolor::color#13 = display_info_led::tc#4 -- vbum1=vbum2 + lda tc + sta textcolor.color + // [1446] call textcolor + // [439] phi from display_info_led to textcolor [phi:display_info_led->textcolor] + // [439] phi textcolor::color#21 = textcolor::color#13 [phi:display_info_led->textcolor#0] -- register_copy + jsr textcolor + // [1447] phi from display_info_led to display_info_led::@1 [phi:display_info_led->display_info_led::@1] + // display_info_led::@1 + // bgcolor(bc) + // [1448] call bgcolor + // [444] phi from display_info_led::@1 to bgcolor [phi:display_info_led::@1->bgcolor] + // [444] phi bgcolor::color#15 = BLUE [phi:display_info_led::@1->bgcolor#0] -- vbum1=vbuc1 + lda #BLUE + sta bgcolor.color + jsr bgcolor + // display_info_led::@2 + // cputcxy(x, y, VERA_CHR_UR) + // [1449] cputcxy::x#13 = display_info_led::x#4 + // [1450] cputcxy::y#13 = display_info_led::y#4 + // [1451] call cputcxy + // [1346] phi from display_info_led::@2 to cputcxy [phi:display_info_led::@2->cputcxy] + // [1346] phi cputcxy::c#15 = $7c [phi:display_info_led::@2->cputcxy#0] -- vbum1=vbuc1 + lda #$7c + sta cputcxy.c + // [1346] phi cputcxy::y#15 = cputcxy::y#13 [phi:display_info_led::@2->cputcxy#1] -- register_copy + // [1346] phi cputcxy::x#15 = cputcxy::x#13 [phi:display_info_led::@2->cputcxy#2] -- register_copy + jsr cputcxy + // [1452] 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) + // [1453] call textcolor + // [439] phi from display_info_led::@3 to textcolor [phi:display_info_led::@3->textcolor] + // [439] phi textcolor::color#21 = WHITE [phi:display_info_led::@3->textcolor#0] -- vbum1=vbuc1 + lda #WHITE + sta textcolor.color + jsr textcolor + // display_info_led::@return + // } + // [1454] return + rts + .segment Data + .label tc = display_smc_led.c + .label y = cputcxy.y + .label x = cputcxy.x +} +.segment CodeVera + // vera_detect +vera_detect: { + // spi_get_jedec() + // [1456] call spi_get_jedec + // This conditional compilation ensures that only the detection interpretation happens if it is switched on. + // [1911] phi from vera_detect to spi_get_jedec [phi:vera_detect->spi_get_jedec] + jsr spi_get_jedec + // vera_detect::@return + // } + // [1457] return + rts +} + // vera_read +// __mem() unsigned long vera_read(__mem() char info_status) +vera_read: { + .const bank_set_brom1_bank = 0 + .label fp = $7b + // We start for VERA from 0x1:0xA000. + .label vera_bram_ptr = $65 + .label vera_action_text = $5b + // vera_read::bank_set_bram1 + // BRAM = bank + // [1459] BRAM = 1 -- vbuz1=vbuc1 + lda #1 + sta.z BRAM + // vera_read::@16 + // if(info_status == STATUS_READING) + // [1460] if(vera_read::info_status#12==STATUS_READING) goto vera_read::@1 -- vbum1_eq_vbuc1_then_la1 + lda #STATUS_READING + cmp info_status + beq __b1 + // [1462] phi from vera_read::@16 to vera_read::@2 [phi:vera_read::@16->vera_read::@2] + // [1462] phi vera_read::vera_bram_bank#14 = 0 [phi:vera_read::@16->vera_read::@2#0] -- vbum1=vbuc1 lda #0 - ldy.z screenlayer__1 - sty.z screenlayer__2+1 - sta.z screenlayer__2 - // __conio.mapbase_offset = MAKEWORD((mapbase)<<1,0) - // [2104] *((unsigned int *)&__conio+3) = screenlayer::$2 -- _deref_pwuc1=vwuz1 - sta __conio+3 - tya - sta __conio+3+1 - // config & VERA_LAYER_WIDTH_MASK - // [2105] screenlayer::$7 = screenlayer::config#0 & VERA_LAYER_WIDTH_MASK -- vbuz1=vbum2_band_vbuc1 - lda #VERA_LAYER_WIDTH_MASK - and config - sta.z screenlayer__7 - // (config & VERA_LAYER_WIDTH_MASK) >> 4 - // [2106] screenlayer::$8 = screenlayer::$7 >> 4 -- vbuz1=vbuz1_ror_4 - lda.z screenlayer__8 - lsr - lsr - lsr - lsr - sta.z screenlayer__8 - // __conio.mapwidth = VERA_LAYER_DIM[ (config & VERA_LAYER_WIDTH_MASK) >> 4] - // [2107] *((char *)&__conio+8) = screenlayer::VERA_LAYER_DIM[screenlayer::$8] -- _deref_pbuc1=pbuc2_derefidx_vbuz1 - tay - lda VERA_LAYER_DIM,y - sta __conio+8 - // config & VERA_LAYER_HEIGHT_MASK - // [2108] screenlayer::$5 = screenlayer::config#0 & VERA_LAYER_HEIGHT_MASK -- vbuz1=vbum2_band_vbuc1 - lda #VERA_LAYER_HEIGHT_MASK - and config - sta.z screenlayer__5 - // (config & VERA_LAYER_HEIGHT_MASK) >> 6 - // [2109] screenlayer::$6 = screenlayer::$5 >> 6 -- vbuz1=vbuz1_ror_6 - lda.z screenlayer__6 - rol - rol - rol - and #3 - sta.z screenlayer__6 - // __conio.mapheight = VERA_LAYER_DIM[ (config & VERA_LAYER_HEIGHT_MASK) >> 6] - // [2110] *((char *)&__conio+9) = screenlayer::VERA_LAYER_DIM[screenlayer::$6] -- _deref_pbuc1=pbuc2_derefidx_vbuz1 - tay - lda VERA_LAYER_DIM,y - sta __conio+9 - // __conio.rowskip = VERA_LAYER_SKIP[(config & VERA_LAYER_WIDTH_MASK)>>4] - // [2111] screenlayer::$16 = screenlayer::$8 << 1 -- vbuz1=vbuz1_rol_1 - asl.z screenlayer__16 - // [2112] *((unsigned int *)&__conio+$a) = screenlayer::VERA_LAYER_SKIP[screenlayer::$16] -- _deref_pwuc1=pwuc2_derefidx_vbuz1 - // __conio.rowshift = ((config & VERA_LAYER_WIDTH_MASK)>>4)+6; - ldy.z screenlayer__16 - lda VERA_LAYER_SKIP,y - sta __conio+$a - lda VERA_LAYER_SKIP+1,y - sta __conio+$a+1 - // vera_dc_hscale_temp == 0x80 - // [2113] screenlayer::$9 = screenlayer::vera_dc_hscale_temp#0 == $80 -- vboz1=vbum2_eq_vbuc1 - lda vera_dc_hscale_temp - eor #$80 - beq !+ + sta vera_bram_bank + // [1462] phi vera_read::vera_action_text#10 = vera_read::vera_action_text#2 [phi:vera_read::@16->vera_read::@2#1] -- pbuz1=pbuc1 + lda #vera_action_text_2 + sta.z vera_action_text+1 + jmp __b2 + // [1461] phi from vera_read::@16 to vera_read::@1 [phi:vera_read::@16->vera_read::@1] + // vera_read::@1 + __b1: + // [1462] phi from vera_read::@1 to vera_read::@2 [phi:vera_read::@1->vera_read::@2] + // [1462] phi vera_read::vera_bram_bank#14 = 1 [phi:vera_read::@1->vera_read::@2#0] -- vbum1=vbuc1 lda #1 - !: - eor #1 - sta.z screenlayer__9 - // 40 << (char)(vera_dc_hscale_temp == 0x80) - // [2114] screenlayer::$18 = (char)screenlayer::$9 - // [2115] screenlayer::$10 = $28 << screenlayer::$18 -- vbuz1=vbuc1_rol_vbuz1 - lda #$28 - ldy.z screenlayer__10 - cpy #0 - beq !e+ - !: - asl - dey - bne !- - !e: - sta.z screenlayer__10 - // (40 << (char)(vera_dc_hscale_temp == 0x80))-1 - // [2116] screenlayer::$11 = screenlayer::$10 - 1 -- vbuz1=vbuz1_minus_1 - dec.z screenlayer__11 - // __conio.width = (40 << (char)(vera_dc_hscale_temp == 0x80))-1 - // [2117] *((char *)&__conio+6) = screenlayer::$11 -- _deref_pbuc1=vbuz1 - lda.z screenlayer__11 - sta __conio+6 - // vera_dc_vscale_temp == 0x80 - // [2118] screenlayer::$12 = screenlayer::vera_dc_vscale_temp#0 == $80 -- vboz1=vbum2_eq_vbuc1 - lda vera_dc_vscale_temp - eor #$80 - beq !+ - lda #1 - !: - eor #1 - sta.z screenlayer__12 - // 30 << (char)(vera_dc_vscale_temp == 0x80) - // [2119] screenlayer::$19 = (char)screenlayer::$12 - // [2120] screenlayer::$13 = $1e << screenlayer::$19 -- vbuz1=vbuc1_rol_vbuz1 - lda #$1e - ldy.z screenlayer__13 - cpy #0 - beq !e+ - !: - asl - dey - bne !- - !e: - sta.z screenlayer__13 - // (30 << (char)(vera_dc_vscale_temp == 0x80))-1 - // [2121] screenlayer::$14 = screenlayer::$13 - 1 -- vbuz1=vbuz1_minus_1 - dec.z screenlayer__14 - // __conio.height = (30 << (char)(vera_dc_vscale_temp == 0x80))-1 - // [2122] *((char *)&__conio+7) = screenlayer::$14 -- _deref_pbuc1=vbuz1 - lda.z screenlayer__14 - sta __conio+7 - // unsigned int mapbase_offset = __conio.mapbase_offset - // [2123] screenlayer::mapbase_offset#0 = *((unsigned int *)&__conio+3) -- vwum1=_deref_pwuc1 - lda __conio+3 - sta mapbase_offset - lda __conio+3+1 - sta mapbase_offset+1 - // [2124] phi from screenlayer to screenlayer::@1 [phi:screenlayer->screenlayer::@1] - // [2124] phi screenlayer::mapbase_offset#2 = screenlayer::mapbase_offset#0 [phi:screenlayer->screenlayer::@1#0] -- register_copy - // [2124] phi screenlayer::y#2 = 0 [phi:screenlayer->screenlayer::@1#1] -- vbuz1=vbuc1 - lda #0 - sta.z y - // screenlayer::@1 - __b1: - // for(register char y=0; y<=__conio.height; y++) - // [2125] if(screenlayer::y#2<=*((char *)&__conio+7)) goto screenlayer::@2 -- vbuz1_le__deref_pbuc1_then_la1 - lda __conio+7 - cmp.z y - bcs __b2 - // screenlayer::@return - // } - // [2126] return - rts - // screenlayer::@2 + sta vera_bram_bank + // [1462] phi vera_read::vera_action_text#10 = vera_read::vera_action_text#1 [phi:vera_read::@1->vera_read::@2#1] -- pbuz1=pbuc1 + lda #vera_action_text_1 + sta.z vera_action_text+1 + // vera_read::@2 __b2: - // __conio.offsets[y] = mapbase_offset - // [2127] screenlayer::$17 = screenlayer::y#2 << 1 -- vbuz1=vbuz2_rol_1 - lda.z y - asl - sta.z screenlayer__17 - // [2128] ((unsigned int *)&__conio+$15)[screenlayer::$17] = screenlayer::mapbase_offset#2 -- pwuc1_derefidx_vbuz1=vwum2 - tay - lda mapbase_offset - sta __conio+$15,y - lda mapbase_offset+1 - sta __conio+$15+1,y - // mapbase_offset += __conio.rowskip - // [2129] screenlayer::mapbase_offset#1 = screenlayer::mapbase_offset#2 + *((unsigned int *)&__conio+$a) -- vwum1=vwum1_plus__deref_pwuc1 - clc - lda mapbase_offset - adc __conio+$a - sta mapbase_offset - lda mapbase_offset+1 - adc __conio+$a+1 - sta mapbase_offset+1 - // for(register char y=0; y<=__conio.height; y++) - // [2130] screenlayer::y#1 = ++ screenlayer::y#2 -- vbuz1=_inc_vbuz1 - inc.z y - // [2124] phi from screenlayer::@2 to screenlayer::@1 [phi:screenlayer::@2->screenlayer::@1] - // [2124] phi screenlayer::mapbase_offset#2 = screenlayer::mapbase_offset#1 [phi:screenlayer::@2->screenlayer::@1#0] -- register_copy - // [2124] phi screenlayer::y#2 = screenlayer::y#1 [phi:screenlayer::@2->screenlayer::@1#1] -- register_copy - jmp __b1 - .segment Data - VERA_LAYER_DIM: .byte $1f, $3f, $7f, $ff - VERA_LAYER_SKIP: .word $40, $80, $100, $200 - mapbase: .byte 0 - config: .byte 0 - vera_dc_hscale_temp: .byte 0 - vera_dc_vscale_temp: .byte 0 - mapbase_offset: .word 0 -} -.segment Code - // cscroll -// Scroll the entire screen if the cursor is beyond the last line -cscroll: { - // if(__conio.cursor_y>__conio.height) - // [2131] if(*((char *)&__conio+1)<=*((char *)&__conio+7)) goto cscroll::@return -- _deref_pbuc1_le__deref_pbuc2_then_la1 - lda __conio+7 - cmp __conio+1 - bcs __breturn - // cscroll::@1 - // if(__conio.scroll[__conio.layer]) - // [2132] if(0!=((char *)&__conio+$f)[*((char *)&__conio+2)]) goto cscroll::@4 -- 0_neq_pbuc1_derefidx_(_deref_pbuc2)_then_la1 - ldy __conio+2 - lda __conio+$f,y - cmp #0 - bne __b4 - // cscroll::@2 - // if(__conio.cursor_y>__conio.height) - // [2133] if(*((char *)&__conio+1)<=*((char *)&__conio+7)) goto cscroll::@return -- _deref_pbuc1_le__deref_pbuc2_then_la1 - lda __conio+7 - cmp __conio+1 - bcs __breturn - // [2134] phi from cscroll::@2 to cscroll::@3 [phi:cscroll::@2->cscroll::@3] - // cscroll::@3 - // gotoxy(0,0) - // [2135] call gotoxy - // [802] phi from cscroll::@3 to gotoxy [phi:cscroll::@3->gotoxy] - // [802] phi gotoxy::y#37 = 0 [phi:cscroll::@3->gotoxy#0] -- vbum1=vbuc1 - lda #0 + // vera_read::bank_set_brom1 + // BROM = bank + // [1463] BROM = vera_read::bank_set_brom1_bank#0 -- vbuz1=vbuc1 + lda #bank_set_brom1_bank + sta.z BROM + // [1464] phi from vera_read::bank_set_brom1 to vera_read::@17 [phi:vera_read::bank_set_brom1->vera_read::@17] + // vera_read::@17 + // display_action_text("Opening VERA.BIN from SD card ...") + // [1465] call display_action_text + // [845] phi from vera_read::@17 to display_action_text [phi:vera_read::@17->display_action_text] + // [845] phi display_action_text::info_text#17 = vera_read::info_text [phi:vera_read::@17->display_action_text#0] -- pbuz1=pbuc1 + lda #info_text + sta.z display_action_text.info_text+1 + jsr display_action_text + // [1466] phi from vera_read::@17 to vera_read::@19 [phi:vera_read::@17->vera_read::@19] + // vera_read::@19 + // FILE *fp = fopen("VERA.BIN", "r") + // [1467] call fopen + jsr fopen + // [1468] fopen::return#3 = fopen::return#2 + // vera_read::@20 + // [1469] vera_read::fp#0 = fopen::return#3 -- pssz1=pssz2 + lda.z fopen.return + sta.z fp + lda.z fopen.return+1 + sta.z fp+1 + // if (fp) + // [1470] if((struct $2 *)0==vera_read::fp#0) goto vera_read::@3 -- pssc1_eq_pssz1_then_la1 + lda.z fp + cmp #<0 + bne !+ + lda.z fp+1 + cmp #>0 + beq __b4 + !: + // [1471] phi from vera_read::@20 to vera_read::@4 [phi:vera_read::@20->vera_read::@4] + // vera_read::@4 + // gotoxy(x, y) + // [1472] call gotoxy + // [457] phi from vera_read::@4 to gotoxy [phi:vera_read::@4->gotoxy] + // [457] phi gotoxy::y#26 = PROGRESS_Y [phi:vera_read::@4->gotoxy#0] -- vbum1=vbuc1 + lda #PROGRESS_Y sta gotoxy.y - // [802] phi gotoxy::x#37 = 0 [phi:cscroll::@3->gotoxy#1] -- vbum1=vbuc1 + // [457] phi gotoxy::x#26 = PROGRESS_X [phi:vera_read::@4->gotoxy#1] -- vbum1=vbuc1 + lda #PROGRESS_X sta gotoxy.x jsr gotoxy - // cscroll::@return - __breturn: - // } - // [2136] return + // [1473] phi from vera_read::@4 to vera_read::@5 [phi:vera_read::@4->vera_read::@5] + // [1473] phi vera_read::y#11 = PROGRESS_Y [phi:vera_read::@4->vera_read::@5#0] -- vbum1=vbuc1 + lda #PROGRESS_Y + sta y + // [1473] phi vera_read::progress_row_current#10 = 0 [phi:vera_read::@4->vera_read::@5#1] -- vwum1=vwuc1 + lda #<0 + sta progress_row_current + sta progress_row_current+1 + // [1473] phi vera_read::vera_bram_ptr#13 = (char *)$a000 [phi:vera_read::@4->vera_read::@5#2] -- pbuz1=pbuc1 + lda #<$a000 + sta.z vera_bram_ptr + lda #>$a000 + sta.z vera_bram_ptr+1 + // [1473] phi vera_read::vera_bram_bank#10 = vera_read::vera_bram_bank#14 [phi:vera_read::@4->vera_read::@5#3] -- register_copy + // [1473] phi vera_read::vera_file_size#11 = 0 [phi:vera_read::@4->vera_read::@5#4] -- vdum1=vduc1 + lda #<0 + sta vera_file_size + sta vera_file_size+1 + lda #<0>>$10 + sta vera_file_size+2 + lda #>0>>$10 + sta vera_file_size+3 + // vera_read::@5 + __b5: + // while (vera_file_size < vera_size) + // [1474] if(vera_read::vera_file_size#11vera_size>>$10 + bcc __b6 + bne !+ + lda vera_file_size+2 + cmp #>$10 + bcc __b6 + bne !+ + lda vera_file_size+1 + cmp #>vera_size + bcc __b6 + bne !+ + lda vera_file_size + cmp #vera_read::@3] + // [1477] phi __stdio_filecount#26 = __stdio_filecount#2 [phi:vera_read::@9->vera_read::@3#0] -- register_copy + // [1477] phi vera_read::return#0 = vera_read::vera_file_size#11 [phi:vera_read::@9->vera_read::@3#1] -- register_copy rts - // [2137] phi from cscroll::@1 to cscroll::@4 [phi:cscroll::@1->cscroll::@4] - // cscroll::@4 + // [1477] phi from vera_read::@20 to vera_read::@3 [phi:vera_read::@20->vera_read::@3] __b4: - // insertup(1) - // [2138] call insertup - jsr insertup - // cscroll::@5 - // gotoxy( 0, __conio.height) - // [2139] gotoxy::y#3 = *((char *)&__conio+7) -- vbum1=_deref_pbuc1 - lda __conio+7 - sta gotoxy.y - // [2140] call gotoxy - // [802] phi from cscroll::@5 to gotoxy [phi:cscroll::@5->gotoxy] - // [802] phi gotoxy::y#37 = gotoxy::y#3 [phi:cscroll::@5->gotoxy#0] -- register_copy - // [802] phi gotoxy::x#37 = 0 [phi:cscroll::@5->gotoxy#1] -- vbum1=vbuc1 - lda #0 - sta gotoxy.x - jsr gotoxy - // [2141] phi from cscroll::@5 to cscroll::@6 [phi:cscroll::@5->cscroll::@6] - // cscroll::@6 - // clearline() - // [2142] call clearline - jsr clearline - rts -} - // cx16_k_screen_set_mode -/** - * @brief Sets the screen mode. - * - * @return cx16_k_screen_mode_error_t Contains 1 if there is an error. - */ -// char cx16_k_screen_set_mode(__mem() volatile char mode) -cx16_k_screen_set_mode: { - // cx16_k_screen_mode_error_t error = 0 - // [2143] cx16_k_screen_set_mode::error = 0 -- vbum1=vbuc1 - lda #0 - sta error - // asm - // asm { clc ldamode jsrCX16_SCREEN_MODE rolerror } - clc - lda mode - jsr CX16_SCREEN_MODE - rol error - // cx16_k_screen_set_mode::@return + // [1477] phi __stdio_filecount#26 = __stdio_filecount#1 [phi:vera_read::@20->vera_read::@3#0] -- register_copy + // [1477] phi vera_read::return#0 = 0 [phi:vera_read::@20->vera_read::@3#1] -- vdum1=vduc1 + lda #<0 + sta return + sta return+1 + lda #<0>>$10 + sta return+2 + lda #>0>>$10 + sta return+3 + // vera_read::@3 + // vera_read::@return // } - // [2145] return + // [1478] return rts - .segment Data - mode: .byte 0 - error: .byte 0 -} -.segment Code - // display_frame -/** - * @brief Draw a rectangle or a line given the coordinates. - * Draw a line horizontal from a given xy position and a given length. - * The line should calculate the matching characters to draw and glue them. - * So it first needs to peek the characters at the given position. - * And then calculate the resulting characters to draw. - * - * @param x0 Left up X position, counting from 0. - * @param y0 Left up Y position, counting from 0, - * @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, __mem() char x1, __mem() char y1) -display_frame: { - // unsigned char w = x1 - x0 - // [2147] display_frame::w#0 = display_frame::x1#16 - display_frame::x#0 -- vbum1=vbum2_minus_vbum3 - lda x1 - sec - sbc x - sta w - // unsigned char h = y1 - y0 - // [2148] display_frame::h#0 = display_frame::y1#16 - display_frame::y#0 -- vbum1=vbum2_minus_vbum3 - lda y1 - sec - sbc y - sta h - // unsigned char mask = display_frame_maskxy(x, y) - // [2149] display_frame_maskxy::x#0 = display_frame::x#0 -- vbum1=vbum2 - lda x - sta display_frame_maskxy.x - // [2150] display_frame_maskxy::y#0 = display_frame::y#0 -- vbum1=vbum2 - lda y - sta display_frame_maskxy.y - // [2151] call display_frame_maskxy - // [3076] phi from display_frame to display_frame_maskxy [phi:display_frame->display_frame_maskxy] - // [3076] phi display_frame_maskxy::cpeekcxy1_y#0 = display_frame_maskxy::y#0 [phi:display_frame->display_frame_maskxy#0] -- register_copy - // [3076] phi display_frame_maskxy::cpeekcxy1_x#0 = display_frame_maskxy::x#0 [phi:display_frame->display_frame_maskxy#1] -- register_copy - jsr display_frame_maskxy - // unsigned char mask = display_frame_maskxy(x, y) - // [2152] display_frame_maskxy::return#13 = display_frame_maskxy::return#12 - // display_frame::@13 - // [2153] display_frame::mask#0 = display_frame_maskxy::return#13 - // mask |= 0b0110 - // [2154] display_frame::mask#1 = display_frame::mask#0 | 6 -- vbum1=vbum1_bor_vbuc1 - lda #6 - ora mask - sta mask - // unsigned char c = display_frame_char(mask) - // [2155] display_frame_char::mask#0 = display_frame::mask#1 - // [2156] call display_frame_char - // Add a corner. - // [3102] phi from display_frame::@13 to display_frame_char [phi:display_frame::@13->display_frame_char] - // [3102] phi display_frame_char::mask#10 = display_frame_char::mask#0 [phi:display_frame::@13->display_frame_char#0] -- register_copy - jsr display_frame_char - // unsigned char c = display_frame_char(mask) - // [2157] display_frame_char::return#13 = display_frame_char::return#12 - // display_frame::@14 - // [2158] display_frame::c#0 = display_frame_char::return#13 - // cputcxy(x, y, c) - // [2159] cputcxy::x#2 = display_frame::x#0 -- vbum1=vbum2 - lda x - sta cputcxy.x - // [2160] cputcxy::y#2 = display_frame::y#0 -- vbum1=vbum2 + // vera_read::@6 + __b6: + // if(info_status == STATUS_CHECKING) + // [1479] if(vera_read::info_status#12!=STATUS_CHECKING) goto vera_read::@23 -- vbum1_neq_vbuc1_then_la1 + lda #STATUS_CHECKING + cmp info_status + bne __b7 + // [1481] phi from vera_read::@6 to vera_read::@7 [phi:vera_read::@6->vera_read::@7] + // [1481] phi vera_read::vera_bram_ptr#10 = (char *) 1024 [phi:vera_read::@6->vera_read::@7#0] -- pbuz1=pbuc1 + lda #<$400 + sta.z vera_bram_ptr + lda #>$400 + sta.z vera_bram_ptr+1 + // [1480] phi from vera_read::@6 to vera_read::@23 [phi:vera_read::@6->vera_read::@23] + // vera_read::@23 + // [1481] phi from vera_read::@23 to vera_read::@7 [phi:vera_read::@23->vera_read::@7] + // [1481] phi vera_read::vera_bram_ptr#10 = vera_read::vera_bram_ptr#13 [phi:vera_read::@23->vera_read::@7#0] -- register_copy + // vera_read::@7 + __b7: + // display_action_text_reading(vera_action_text, "VERA.BIN", vera_file_size, vera_size, vera_bram_bank, vera_bram_ptr) + // [1482] display_action_text_reading::action#0 = vera_read::vera_action_text#10 -- pbuz1=pbuz2 + lda.z vera_action_text + sta.z display_action_text_reading.action + lda.z vera_action_text+1 + sta.z display_action_text_reading.action+1 + // [1483] display_action_text_reading::bytes#0 = vera_read::vera_file_size#11 -- vdum1=vdum2 + lda vera_file_size + sta display_action_text_reading.bytes + lda vera_file_size+1 + sta display_action_text_reading.bytes+1 + lda vera_file_size+2 + sta display_action_text_reading.bytes+2 + lda vera_file_size+3 + sta display_action_text_reading.bytes+3 + // [1484] display_action_text_reading::bram_bank#0 = vera_read::vera_bram_bank#10 -- vbum1=vbum2 + lda vera_bram_bank + sta display_action_text_reading.bram_bank + // [1485] display_action_text_reading::bram_ptr#0 = vera_read::vera_bram_ptr#10 -- pbuz1=pbuz2 + lda.z vera_bram_ptr + sta.z display_action_text_reading.bram_ptr + lda.z vera_bram_ptr+1 + sta.z display_action_text_reading.bram_ptr+1 + // [1486] call display_action_text_reading + // [2034] phi from vera_read::@7 to display_action_text_reading [phi:vera_read::@7->display_action_text_reading] + jsr display_action_text_reading + // vera_read::bank_set_bram2 + // BRAM = bank + // [1487] BRAM = vera_read::vera_bram_bank#10 -- vbuz1=vbum2 + lda vera_bram_bank + sta.z BRAM + // vera_read::@18 + // unsigned int vera_package_read = fgets(vera_bram_ptr, VERA_PROGRESS_CELL, fp) + // [1488] fgets::ptr#2 = vera_read::vera_bram_ptr#10 -- pbuz1=pbuz2 + lda.z vera_bram_ptr + sta.z fgets.ptr + lda.z vera_bram_ptr+1 + sta.z fgets.ptr+1 + // [1489] fgets::stream#0 = vera_read::fp#0 -- pssz1=pssz2 + lda.z fp + sta.z fgets.stream + lda.z fp+1 + sta.z fgets.stream+1 + // [1490] call fgets + jsr fgets + // [1491] fgets::return#5 = fgets::return#1 + // vera_read::@21 + // [1492] vera_read::vera_package_read#0 = fgets::return#5 -- vwum1=vwum2 + lda fgets.return + sta vera_package_read + lda fgets.return+1 + sta vera_package_read+1 + // if (!vera_package_read) + // [1493] if(0!=vera_read::vera_package_read#0) goto vera_read::@8 -- 0_neq_vwum1_then_la1 + lda vera_package_read + ora vera_package_read+1 + bne __b8 + jmp __b9 + // vera_read::@8 + __b8: + // if (progress_row_current == VERA_PROGRESS_ROW) + // [1494] if(vera_read::progress_row_current#10!=VERA_PROGRESS_ROW) goto vera_read::@10 -- vwum1_neq_vwuc1_then_la1 + lda progress_row_current+1 + cmp #>VERA_PROGRESS_ROW + bne __b10 + lda progress_row_current + cmp #cputcxy] - // [2293] phi cputcxy::c#17 = cputcxy::c#2 [phi:display_frame::@14->cputcxy#0] -- register_copy - // [2293] phi cputcxy::y#17 = cputcxy::y#2 [phi:display_frame::@14->cputcxy#1] -- register_copy - // [2293] phi cputcxy::x#17 = cputcxy::x#2 [phi:display_frame::@14->cputcxy#2] -- register_copy - jsr cputcxy - // display_frame::@15 - // if(w>=2) - // [2163] if(display_frame::w#0<2) goto display_frame::@36 -- vbum1_lt_vbuc1_then_la1 - lda w - cmp #2 - bcs !__b36+ - jmp __b36 - !__b36: - // display_frame::@2 - // x++; - // [2164] display_frame::x#1 = ++ display_frame::x#0 -- vbum1=_inc_vbum2 - lda x - inc - sta x_1 - // [2165] phi from display_frame::@2 display_frame::@21 to display_frame::@4 [phi:display_frame::@2/display_frame::@21->display_frame::@4] - // [2165] phi display_frame::x#10 = display_frame::x#1 [phi:display_frame::@2/display_frame::@21->display_frame::@4#0] -- register_copy - // display_frame::@4 - __b4: - // while(x < x1) - // [2166] if(display_frame::x#10gotoxy] + // [457] phi gotoxy::y#26 = gotoxy::y#6 [phi:vera_read::@13->gotoxy#0] -- register_copy + // [457] phi gotoxy::x#26 = PROGRESS_X [phi:vera_read::@13->gotoxy#1] -- vbum1=vbuc1 + lda #PROGRESS_X + sta gotoxy.x + jsr gotoxy + // [1498] phi from vera_read::@13 to vera_read::@10 [phi:vera_read::@13->vera_read::@10] + // [1498] phi vera_read::y#22 = vera_read::y#1 [phi:vera_read::@13->vera_read::@10#0] -- register_copy + // [1498] phi vera_read::progress_row_current#4 = 0 [phi:vera_read::@13->vera_read::@10#1] -- vwum1=vbuc1 + lda #<0 + sta progress_row_current + sta progress_row_current+1 + // [1498] phi from vera_read::@8 to vera_read::@10 [phi:vera_read::@8->vera_read::@10] + // [1498] phi vera_read::y#22 = vera_read::y#11 [phi:vera_read::@8->vera_read::@10#0] -- register_copy + // [1498] phi vera_read::progress_row_current#4 = vera_read::progress_row_current#10 [phi:vera_read::@8->vera_read::@10#1] -- register_copy + // vera_read::@10 + __b10: + // if(info_status == STATUS_READING) + // [1499] if(vera_read::info_status#12!=STATUS_READING) goto vera_read::@11 -- vbum1_neq_vbuc1_then_la1 + lda #STATUS_READING + cmp info_status + bne __b11 + // vera_read::@14 + // cputc('.') + // [1500] stackpush(char) = '.' -- _stackpushbyte_=vbuc1 + lda #'.' + pha + // [1501] callexecute cputc -- call_vprc1 + jsr cputc + // sideeffect stackpullpadding(1) -- _stackpullpadding_1 + pla + // vera_read::@11 + __b11: + // vera_bram_ptr += vera_package_read + // [1503] vera_read::vera_bram_ptr#2 = vera_read::vera_bram_ptr#10 + vera_read::vera_package_read#0 -- pbuz1=pbuz1_plus_vwum2 + clc + lda.z vera_bram_ptr + adc vera_package_read + sta.z vera_bram_ptr + lda.z vera_bram_ptr+1 + adc vera_package_read+1 + sta.z vera_bram_ptr+1 + // vera_file_size += vera_package_read + // [1504] vera_read::vera_file_size#1 = vera_read::vera_file_size#11 + vera_read::vera_package_read#0 -- vdum1=vdum1_plus_vwum2 + lda vera_file_size + clc + adc vera_package_read + sta vera_file_size + lda vera_file_size+1 + adc vera_package_read+1 + sta vera_file_size+1 + lda vera_file_size+2 + adc #0 + sta vera_file_size+2 + lda vera_file_size+3 + adc #0 + sta vera_file_size+3 + // progress_row_current += vera_package_read + // [1505] vera_read::progress_row_current#15 = vera_read::progress_row_current#4 + vera_read::vera_package_read#0 -- vwum1=vwum1_plus_vwum2 + clc + lda progress_row_current + adc vera_package_read + sta progress_row_current + lda progress_row_current+1 + adc vera_package_read+1 + sta progress_row_current+1 + // if (vera_bram_ptr == (bram_ptr_t)BRAM_HIGH) + // [1506] if(vera_read::vera_bram_ptr#2!=(char *)$c000) goto vera_read::@12 -- pbuz1_neq_pbuc1_then_la1 + lda.z vera_bram_ptr+1 + cmp #>$c000 + bne __b12 + lda.z vera_bram_ptr + cmp #<$c000 + bne __b12 + // vera_read::@15 + // vera_bram_bank++; + // [1507] vera_read::vera_bram_bank#2 = ++ vera_read::vera_bram_bank#10 -- vbum1=_inc_vbum1 + inc vera_bram_bank + // [1508] phi from vera_read::@15 to vera_read::@12 [phi:vera_read::@15->vera_read::@12] + // [1508] phi vera_read::vera_bram_bank#13 = vera_read::vera_bram_bank#2 [phi:vera_read::@15->vera_read::@12#0] -- register_copy + // [1508] phi vera_read::vera_bram_ptr#8 = (char *)$a000 [phi:vera_read::@15->vera_read::@12#1] -- pbuz1=pbuc1 + lda #<$a000 + sta.z vera_bram_ptr + lda #>$a000 + sta.z vera_bram_ptr+1 + // [1508] phi from vera_read::@11 to vera_read::@12 [phi:vera_read::@11->vera_read::@12] + // [1508] phi vera_read::vera_bram_bank#13 = vera_read::vera_bram_bank#10 [phi:vera_read::@11->vera_read::@12#0] -- register_copy + // [1508] phi vera_read::vera_bram_ptr#8 = vera_read::vera_bram_ptr#2 [phi:vera_read::@11->vera_read::@12#1] -- register_copy + // vera_read::@12 + __b12: + // if (vera_bram_ptr == (bram_ptr_t)RAM_HIGH) + // [1509] if(vera_read::vera_bram_ptr#8!=(char *)$9800) goto vera_read::@22 -- pbuz1_neq_pbuc1_then_la1 + lda.z vera_bram_ptr+1 + cmp #>$9800 + beq !__b5+ jmp __b5 !__b5: - // [2167] phi from display_frame::@36 display_frame::@4 to display_frame::@1 [phi:display_frame::@36/display_frame::@4->display_frame::@1] - // [2167] phi display_frame::x#24 = display_frame::x#30 [phi:display_frame::@36/display_frame::@4->display_frame::@1#0] -- register_copy - // display_frame::@1 - __b1: - // display_frame_maskxy(x, y) - // [2168] display_frame_maskxy::x#1 = display_frame::x#24 -- vbum1=vbum2 - lda x_1 - sta display_frame_maskxy.x - // [2169] display_frame_maskxy::y#1 = display_frame::y#0 -- vbum1=vbum2 - lda y - sta display_frame_maskxy.y - // [2170] call display_frame_maskxy - // [3076] phi from display_frame::@1 to display_frame_maskxy [phi:display_frame::@1->display_frame_maskxy] - // [3076] phi display_frame_maskxy::cpeekcxy1_y#0 = display_frame_maskxy::y#1 [phi:display_frame::@1->display_frame_maskxy#0] -- register_copy - // [3076] phi display_frame_maskxy::cpeekcxy1_x#0 = display_frame_maskxy::x#1 [phi:display_frame::@1->display_frame_maskxy#1] -- register_copy - jsr display_frame_maskxy - // display_frame_maskxy(x, y) - // [2171] display_frame_maskxy::return#14 = display_frame_maskxy::return#12 - // display_frame::@16 - // mask = display_frame_maskxy(x, y) - // [2172] display_frame::mask#2 = display_frame_maskxy::return#14 - // mask |= 0b0011 - // [2173] display_frame::mask#3 = display_frame::mask#2 | 3 -- vbum1=vbum1_bor_vbuc1 - lda #3 - ora mask - sta mask - // display_frame_char(mask) - // [2174] display_frame_char::mask#1 = display_frame::mask#3 - // [2175] call display_frame_char - // [3102] phi from display_frame::@16 to display_frame_char [phi:display_frame::@16->display_frame_char] - // [3102] phi display_frame_char::mask#10 = display_frame_char::mask#1 [phi:display_frame::@16->display_frame_char#0] -- register_copy - jsr display_frame_char - // display_frame_char(mask) - // [2176] display_frame_char::return#14 = display_frame_char::return#12 - // display_frame::@17 - // c = display_frame_char(mask) - // [2177] display_frame::c#1 = display_frame_char::return#14 - // cputcxy(x, y, c) - // [2178] cputcxy::x#3 = display_frame::x#24 -- vbum1=vbum2 - lda x_1 - sta cputcxy.x - // [2179] cputcxy::y#3 = display_frame::y#0 -- vbum1=vbum2 - lda y - sta cputcxy.y - // [2180] cputcxy::c#3 = display_frame::c#1 - // [2181] call cputcxy - // [2293] phi from display_frame::@17 to cputcxy [phi:display_frame::@17->cputcxy] - // [2293] phi cputcxy::c#17 = cputcxy::c#3 [phi:display_frame::@17->cputcxy#0] -- register_copy - // [2293] phi cputcxy::y#17 = cputcxy::y#3 [phi:display_frame::@17->cputcxy#1] -- register_copy - // [2293] phi cputcxy::x#17 = cputcxy::x#3 [phi:display_frame::@17->cputcxy#2] -- register_copy - jsr cputcxy - // display_frame::@18 - // if(h>=2) - // [2182] if(display_frame::h#0<2) goto display_frame::@return -- vbum1_lt_vbuc1_then_la1 - lda h - cmp #2 - bcc __breturn - // display_frame::@3 - // y++; - // [2183] display_frame::y#1 = ++ display_frame::y#0 -- vbum1=_inc_vbum2 - lda y - inc - sta y_1 - // [2184] phi from display_frame::@27 display_frame::@3 to display_frame::@6 [phi:display_frame::@27/display_frame::@3->display_frame::@6] - // [2184] phi display_frame::y#10 = display_frame::y#2 [phi:display_frame::@27/display_frame::@3->display_frame::@6#0] -- register_copy - // display_frame::@6 - __b6: - // while(y < y1) - // [2185] if(display_frame::y#10display_frame_maskxy] - // [3076] phi display_frame_maskxy::cpeekcxy1_y#0 = display_frame_maskxy::y#5 [phi:display_frame::@8->display_frame_maskxy#0] -- register_copy - // [3076] phi display_frame_maskxy::cpeekcxy1_x#0 = display_frame_maskxy::x#5 [phi:display_frame::@8->display_frame_maskxy#1] -- register_copy - jsr display_frame_maskxy - // display_frame_maskxy(x, y) - // [2189] display_frame_maskxy::return#18 = display_frame_maskxy::return#12 - // display_frame::@28 - // mask = display_frame_maskxy(x, y) - // [2190] display_frame::mask#10 = display_frame_maskxy::return#18 - // mask |= 0b1100 - // [2191] display_frame::mask#11 = display_frame::mask#10 | $c -- vbum1=vbum1_bor_vbuc1 - lda #$c - ora mask - sta mask - // display_frame_char(mask) - // [2192] display_frame_char::mask#5 = display_frame::mask#11 - // [2193] call display_frame_char - // [3102] phi from display_frame::@28 to display_frame_char [phi:display_frame::@28->display_frame_char] - // [3102] phi display_frame_char::mask#10 = display_frame_char::mask#5 [phi:display_frame::@28->display_frame_char#0] -- register_copy - jsr display_frame_char - // display_frame_char(mask) - // [2194] display_frame_char::return#18 = display_frame_char::return#12 - // display_frame::@29 - // c = display_frame_char(mask) - // [2195] display_frame::c#5 = display_frame_char::return#18 - // cputcxy(x, y, c) - // [2196] cputcxy::x#7 = display_frame::x#0 -- vbum1=vbum2 - lda x - sta cputcxy.x - // [2197] cputcxy::y#7 = display_frame::y#10 -- vbum1=vbum2 - lda y_1 - sta cputcxy.y - // [2198] cputcxy::c#7 = display_frame::c#5 - // [2199] call cputcxy - // [2293] phi from display_frame::@29 to cputcxy [phi:display_frame::@29->cputcxy] - // [2293] phi cputcxy::c#17 = cputcxy::c#7 [phi:display_frame::@29->cputcxy#0] -- register_copy - // [2293] phi cputcxy::y#17 = cputcxy::y#7 [phi:display_frame::@29->cputcxy#1] -- register_copy - // [2293] phi cputcxy::x#17 = cputcxy::x#7 [phi:display_frame::@29->cputcxy#2] -- register_copy - jsr cputcxy - // display_frame::@30 - // if(w>=2) - // [2200] if(display_frame::w#0<2) goto display_frame::@10 -- vbum1_lt_vbuc1_then_la1 - lda w - cmp #2 - bcc __b10 - // display_frame::@9 - // x++; - // [2201] display_frame::x#4 = ++ display_frame::x#0 -- vbum1=_inc_vbum1 - inc x - // [2202] phi from display_frame::@35 display_frame::@9 to display_frame::@11 [phi:display_frame::@35/display_frame::@9->display_frame::@11] - // [2202] phi display_frame::x#18 = display_frame::x#5 [phi:display_frame::@35/display_frame::@9->display_frame::@11#0] -- register_copy - // display_frame::@11 - __b11: - // while(x < x1) - // [2203] if(display_frame::x#18display_frame::@10] - // [2204] phi display_frame::x#15 = display_frame::x#18 [phi:display_frame::@11/display_frame::@30->display_frame::@10#0] -- register_copy - // display_frame::@10 - __b10: - // display_frame_maskxy(x, y) - // [2205] display_frame_maskxy::x#6 = display_frame::x#15 -- vbum1=vbum2 - lda x - sta display_frame_maskxy.x - // [2206] display_frame_maskxy::y#6 = display_frame::y#10 -- vbum1=vbum2 - lda y_1 - sta display_frame_maskxy.y - // [2207] call display_frame_maskxy - // [3076] phi from display_frame::@10 to display_frame_maskxy [phi:display_frame::@10->display_frame_maskxy] - // [3076] phi display_frame_maskxy::cpeekcxy1_y#0 = display_frame_maskxy::y#6 [phi:display_frame::@10->display_frame_maskxy#0] -- register_copy - // [3076] phi display_frame_maskxy::cpeekcxy1_x#0 = display_frame_maskxy::x#6 [phi:display_frame::@10->display_frame_maskxy#1] -- register_copy - jsr display_frame_maskxy - // display_frame_maskxy(x, y) - // [2208] display_frame_maskxy::return#19 = display_frame_maskxy::return#12 - // display_frame::@31 - // mask = display_frame_maskxy(x, y) - // [2209] display_frame::mask#12 = display_frame_maskxy::return#19 - // mask |= 0b1001 - // [2210] display_frame::mask#13 = display_frame::mask#12 | 9 -- vbum1=vbum1_bor_vbuc1 - lda #9 - ora mask - sta mask - // display_frame_char(mask) - // [2211] display_frame_char::mask#6 = display_frame::mask#13 - // [2212] call display_frame_char - // [3102] phi from display_frame::@31 to display_frame_char [phi:display_frame::@31->display_frame_char] - // [3102] phi display_frame_char::mask#10 = display_frame_char::mask#6 [phi:display_frame::@31->display_frame_char#0] -- register_copy - jsr display_frame_char - // display_frame_char(mask) - // [2213] display_frame_char::return#19 = display_frame_char::return#12 - // display_frame::@32 - // c = display_frame_char(mask) - // [2214] display_frame::c#6 = display_frame_char::return#19 - // cputcxy(x, y, c) - // [2215] cputcxy::x#8 = display_frame::x#15 -- vbum1=vbum2 - lda x - sta cputcxy.x - // [2216] cputcxy::y#8 = display_frame::y#10 -- vbum1=vbum2 - lda y_1 - sta cputcxy.y - // [2217] cputcxy::c#8 = display_frame::c#6 - // [2218] call cputcxy - // [2293] phi from display_frame::@32 to cputcxy [phi:display_frame::@32->cputcxy] - // [2293] phi cputcxy::c#17 = cputcxy::c#8 [phi:display_frame::@32->cputcxy#0] -- register_copy - // [2293] phi cputcxy::y#17 = cputcxy::y#8 [phi:display_frame::@32->cputcxy#1] -- register_copy - // [2293] phi cputcxy::x#17 = cputcxy::x#8 [phi:display_frame::@32->cputcxy#2] -- register_copy - jsr cputcxy - // display_frame::@return - __breturn: - // } - // [2219] return - rts - // display_frame::@12 - __b12: - // display_frame_maskxy(x, y) - // [2220] display_frame_maskxy::x#7 = display_frame::x#18 -- vbum1=vbum2 - lda x - sta display_frame_maskxy.x - // [2221] display_frame_maskxy::y#7 = display_frame::y#10 -- vbum1=vbum2 - lda y_1 - sta display_frame_maskxy.y - // [2222] call display_frame_maskxy - // [3076] phi from display_frame::@12 to display_frame_maskxy [phi:display_frame::@12->display_frame_maskxy] - // [3076] phi display_frame_maskxy::cpeekcxy1_y#0 = display_frame_maskxy::y#7 [phi:display_frame::@12->display_frame_maskxy#0] -- register_copy - // [3076] phi display_frame_maskxy::cpeekcxy1_x#0 = display_frame_maskxy::x#7 [phi:display_frame::@12->display_frame_maskxy#1] -- register_copy - jsr display_frame_maskxy - // display_frame_maskxy(x, y) - // [2223] display_frame_maskxy::return#20 = display_frame_maskxy::return#12 - // display_frame::@33 - // mask = display_frame_maskxy(x, y) - // [2224] display_frame::mask#14 = display_frame_maskxy::return#20 - // mask |= 0b0101 - // [2225] display_frame::mask#15 = display_frame::mask#14 | 5 -- vbum1=vbum1_bor_vbuc1 - lda #5 - ora mask - sta mask - // display_frame_char(mask) - // [2226] display_frame_char::mask#7 = display_frame::mask#15 - // [2227] call display_frame_char - // [3102] phi from display_frame::@33 to display_frame_char [phi:display_frame::@33->display_frame_char] - // [3102] phi display_frame_char::mask#10 = display_frame_char::mask#7 [phi:display_frame::@33->display_frame_char#0] -- register_copy - jsr display_frame_char - // display_frame_char(mask) - // [2228] display_frame_char::return#20 = display_frame_char::return#12 - // display_frame::@34 - // c = display_frame_char(mask) - // [2229] display_frame::c#7 = display_frame_char::return#20 - // cputcxy(x, y, c) - // [2230] cputcxy::x#9 = display_frame::x#18 -- vbum1=vbum2 - lda x - sta cputcxy.x - // [2231] cputcxy::y#9 = display_frame::y#10 -- vbum1=vbum2 - lda y_1 - sta cputcxy.y - // [2232] cputcxy::c#9 = display_frame::c#7 - // [2233] call cputcxy - // [2293] phi from display_frame::@34 to cputcxy [phi:display_frame::@34->cputcxy] - // [2293] phi cputcxy::c#17 = cputcxy::c#9 [phi:display_frame::@34->cputcxy#0] -- register_copy - // [2293] phi cputcxy::y#17 = cputcxy::y#9 [phi:display_frame::@34->cputcxy#1] -- register_copy - // [2293] phi cputcxy::x#17 = cputcxy::x#9 [phi:display_frame::@34->cputcxy#2] -- register_copy - jsr cputcxy - // display_frame::@35 - // x++; - // [2234] display_frame::x#5 = ++ display_frame::x#18 -- vbum1=_inc_vbum1 - inc x - jmp __b11 - // display_frame::@7 - __b7: - // display_frame_maskxy(x0, y) - // [2235] display_frame_maskxy::x#3 = display_frame::x#0 -- vbum1=vbum2 - lda x - sta display_frame_maskxy.x - // [2236] display_frame_maskxy::y#3 = display_frame::y#10 -- vbum1=vbum2 - lda y_1 - sta display_frame_maskxy.y - // [2237] call display_frame_maskxy - // [3076] phi from display_frame::@7 to display_frame_maskxy [phi:display_frame::@7->display_frame_maskxy] - // [3076] phi display_frame_maskxy::cpeekcxy1_y#0 = display_frame_maskxy::y#3 [phi:display_frame::@7->display_frame_maskxy#0] -- register_copy - // [3076] phi display_frame_maskxy::cpeekcxy1_x#0 = display_frame_maskxy::x#3 [phi:display_frame::@7->display_frame_maskxy#1] -- register_copy - jsr display_frame_maskxy - // display_frame_maskxy(x0, y) - // [2238] display_frame_maskxy::return#16 = display_frame_maskxy::return#12 - // display_frame::@22 - // mask = display_frame_maskxy(x0, y) - // [2239] display_frame::mask#6 = display_frame_maskxy::return#16 - // mask |= 0b1010 - // [2240] display_frame::mask#7 = display_frame::mask#6 | $a -- vbum1=vbum1_bor_vbuc1 - lda #$a - ora mask - sta mask - // display_frame_char(mask) - // [2241] display_frame_char::mask#3 = display_frame::mask#7 - // [2242] call display_frame_char - // [3102] phi from display_frame::@22 to display_frame_char [phi:display_frame::@22->display_frame_char] - // [3102] phi display_frame_char::mask#10 = display_frame_char::mask#3 [phi:display_frame::@22->display_frame_char#0] -- register_copy - jsr display_frame_char - // display_frame_char(mask) - // [2243] display_frame_char::return#16 = display_frame_char::return#12 - // display_frame::@23 - // c = display_frame_char(mask) - // [2244] display_frame::c#3 = display_frame_char::return#16 - // cputcxy(x0, y, c) - // [2245] cputcxy::x#5 = display_frame::x#0 -- vbum1=vbum2 - lda x - sta cputcxy.x - // [2246] cputcxy::y#5 = display_frame::y#10 -- vbum1=vbum2 - lda y_1 - sta cputcxy.y - // [2247] cputcxy::c#5 = display_frame::c#3 - // [2248] call cputcxy - // [2293] phi from display_frame::@23 to cputcxy [phi:display_frame::@23->cputcxy] - // [2293] phi cputcxy::c#17 = cputcxy::c#5 [phi:display_frame::@23->cputcxy#0] -- register_copy - // [2293] phi cputcxy::y#17 = cputcxy::y#5 [phi:display_frame::@23->cputcxy#1] -- register_copy - // [2293] phi cputcxy::x#17 = cputcxy::x#5 [phi:display_frame::@23->cputcxy#2] -- register_copy - jsr cputcxy - // display_frame::@24 - // display_frame_maskxy(x1, y) - // [2249] display_frame_maskxy::x#4 = display_frame::x1#16 -- vbum1=vbum2 - lda x1 - sta display_frame_maskxy.x - // [2250] display_frame_maskxy::y#4 = display_frame::y#10 -- vbum1=vbum2 - lda y_1 - sta display_frame_maskxy.y - // [2251] call display_frame_maskxy - // [3076] phi from display_frame::@24 to display_frame_maskxy [phi:display_frame::@24->display_frame_maskxy] - // [3076] phi display_frame_maskxy::cpeekcxy1_y#0 = display_frame_maskxy::y#4 [phi:display_frame::@24->display_frame_maskxy#0] -- register_copy - // [3076] phi display_frame_maskxy::cpeekcxy1_x#0 = display_frame_maskxy::x#4 [phi:display_frame::@24->display_frame_maskxy#1] -- register_copy - jsr display_frame_maskxy - // display_frame_maskxy(x1, y) - // [2252] display_frame_maskxy::return#17 = display_frame_maskxy::return#12 - // display_frame::@25 - // mask = display_frame_maskxy(x1, y) - // [2253] display_frame::mask#8 = display_frame_maskxy::return#17 - // mask |= 0b1010 - // [2254] display_frame::mask#9 = display_frame::mask#8 | $a -- vbum1=vbum1_bor_vbuc1 - lda #$a - ora mask - sta mask - // display_frame_char(mask) - // [2255] display_frame_char::mask#4 = display_frame::mask#9 - // [2256] call display_frame_char - // [3102] phi from display_frame::@25 to display_frame_char [phi:display_frame::@25->display_frame_char] - // [3102] phi display_frame_char::mask#10 = display_frame_char::mask#4 [phi:display_frame::@25->display_frame_char#0] -- register_copy - jsr display_frame_char - // display_frame_char(mask) - // [2257] display_frame_char::return#17 = display_frame_char::return#12 - // display_frame::@26 - // c = display_frame_char(mask) - // [2258] display_frame::c#4 = display_frame_char::return#17 - // cputcxy(x1, y, c) - // [2259] cputcxy::x#6 = display_frame::x1#16 -- vbum1=vbum2 - lda x1 - sta cputcxy.x - // [2260] cputcxy::y#6 = display_frame::y#10 -- vbum1=vbum2 - lda y_1 - sta cputcxy.y - // [2261] cputcxy::c#6 = display_frame::c#4 - // [2262] call cputcxy - // [2293] phi from display_frame::@26 to cputcxy [phi:display_frame::@26->cputcxy] - // [2293] phi cputcxy::c#17 = cputcxy::c#6 [phi:display_frame::@26->cputcxy#0] -- register_copy - // [2293] phi cputcxy::y#17 = cputcxy::y#6 [phi:display_frame::@26->cputcxy#1] -- register_copy - // [2293] phi cputcxy::x#17 = cputcxy::x#6 [phi:display_frame::@26->cputcxy#2] -- register_copy - jsr cputcxy - // display_frame::@27 - // y++; - // [2263] display_frame::y#2 = ++ display_frame::y#10 -- vbum1=_inc_vbum1 - inc y_1 - jmp __b6 - // display_frame::@5 - __b5: - // display_frame_maskxy(x, y) - // [2264] display_frame_maskxy::x#2 = display_frame::x#10 -- vbum1=vbum2 - lda x_1 - sta display_frame_maskxy.x - // [2265] display_frame_maskxy::y#2 = display_frame::y#0 -- vbum1=vbum2 - lda y - sta display_frame_maskxy.y - // [2266] call display_frame_maskxy - // [3076] phi from display_frame::@5 to display_frame_maskxy [phi:display_frame::@5->display_frame_maskxy] - // [3076] phi display_frame_maskxy::cpeekcxy1_y#0 = display_frame_maskxy::y#2 [phi:display_frame::@5->display_frame_maskxy#0] -- register_copy - // [3076] phi display_frame_maskxy::cpeekcxy1_x#0 = display_frame_maskxy::x#2 [phi:display_frame::@5->display_frame_maskxy#1] -- register_copy - jsr display_frame_maskxy - // display_frame_maskxy(x, y) - // [2267] display_frame_maskxy::return#15 = display_frame_maskxy::return#12 - // display_frame::@19 - // mask = display_frame_maskxy(x, y) - // [2268] display_frame::mask#4 = display_frame_maskxy::return#15 - // mask |= 0b0101 - // [2269] display_frame::mask#5 = display_frame::mask#4 | 5 -- vbum1=vbum1_bor_vbuc1 - lda #5 - ora mask - sta mask - // display_frame_char(mask) - // [2270] display_frame_char::mask#2 = display_frame::mask#5 - // [2271] call display_frame_char - // [3102] phi from display_frame::@19 to display_frame_char [phi:display_frame::@19->display_frame_char] - // [3102] phi display_frame_char::mask#10 = display_frame_char::mask#2 [phi:display_frame::@19->display_frame_char#0] -- register_copy - jsr display_frame_char - // display_frame_char(mask) - // [2272] display_frame_char::return#15 = display_frame_char::return#12 - // display_frame::@20 - // c = display_frame_char(mask) - // [2273] display_frame::c#2 = display_frame_char::return#15 - // cputcxy(x, y, c) - // [2274] cputcxy::x#4 = display_frame::x#10 -- vbum1=vbum2 - lda x_1 - sta cputcxy.x - // [2275] cputcxy::y#4 = display_frame::y#0 -- vbum1=vbum2 - lda y - sta cputcxy.y - // [2276] cputcxy::c#4 = display_frame::c#2 - // [2277] call cputcxy - // [2293] phi from display_frame::@20 to cputcxy [phi:display_frame::@20->cputcxy] - // [2293] phi cputcxy::c#17 = cputcxy::c#4 [phi:display_frame::@20->cputcxy#0] -- register_copy - // [2293] phi cputcxy::y#17 = cputcxy::y#4 [phi:display_frame::@20->cputcxy#1] -- register_copy - // [2293] phi cputcxy::x#17 = cputcxy::x#4 [phi:display_frame::@20->cputcxy#2] -- register_copy - jsr cputcxy - // display_frame::@21 - // x++; - // [2278] display_frame::x#2 = ++ display_frame::x#10 -- vbum1=_inc_vbum1 - inc x_1 - jmp __b4 - // display_frame::@36 - __b36: - // [2279] display_frame::x#30 = display_frame::x#0 -- vbum1=vbum2 - lda x - sta x_1 - jmp __b1 - .segment Data - w: .byte 0 - h: .byte 0 - x: .byte 0 + lda.z vera_bram_ptr + cmp #<$9800 + beq !__b5+ + jmp __b5 + !__b5: + // [1473] phi from vera_read::@12 to vera_read::@5 [phi:vera_read::@12->vera_read::@5] + // [1473] phi vera_read::y#11 = vera_read::y#22 [phi:vera_read::@12->vera_read::@5#0] -- register_copy + // [1473] phi vera_read::progress_row_current#10 = vera_read::progress_row_current#15 [phi:vera_read::@12->vera_read::@5#1] -- register_copy + // [1473] phi vera_read::vera_bram_ptr#13 = (char *)$a000 [phi:vera_read::@12->vera_read::@5#2] -- pbuz1=pbuc1 + lda #<$a000 + sta.z vera_bram_ptr + lda #>$a000 + sta.z vera_bram_ptr+1 + // [1473] phi vera_read::vera_bram_bank#10 = 1 [phi:vera_read::@12->vera_read::@5#3] -- vbum1=vbuc1 + lda #1 + sta vera_bram_bank + // [1473] phi vera_read::vera_file_size#11 = vera_read::vera_file_size#1 [phi:vera_read::@12->vera_read::@5#4] -- register_copy + jmp __b5 + // [1510] phi from vera_read::@12 to vera_read::@22 [phi:vera_read::@12->vera_read::@22] + // vera_read::@22 + // [1473] phi from vera_read::@22 to vera_read::@5 [phi:vera_read::@22->vera_read::@5] + // [1473] phi vera_read::y#11 = vera_read::y#22 [phi:vera_read::@22->vera_read::@5#0] -- register_copy + // [1473] phi vera_read::progress_row_current#10 = vera_read::progress_row_current#15 [phi:vera_read::@22->vera_read::@5#1] -- register_copy + // [1473] phi vera_read::vera_bram_ptr#13 = vera_read::vera_bram_ptr#8 [phi:vera_read::@22->vera_read::@5#2] -- register_copy + // [1473] phi vera_read::vera_bram_bank#10 = vera_read::vera_bram_bank#13 [phi:vera_read::@22->vera_read::@5#3] -- register_copy + // [1473] phi vera_read::vera_file_size#11 = vera_read::vera_file_size#1 [phi:vera_read::@22->vera_read::@5#4] -- register_copy + .segment DataVera + info_text: .text "Opening VERA.BIN from SD card ..." + .byte 0 + path: .text "VERA.BIN" + .byte 0 + vera_action_text_1: .text "Reading" + .byte 0 + vera_action_text_2: .text "Checking" + .byte 0 + return: .dword 0 + vera_package_read: .word 0 y: .byte 0 - .label mask = display_frame_maskxy.return - .label c = cputcxy.c - x_1: .byte 0 - y_1: .byte 0 - x1: .byte 0 - y1: .byte 0 + .label vera_file_size = return + vera_bram_bank: .byte 0 + progress_row_current: .word 0 + info_status: .byte 0 } .segment Code - // cputs -// Output a NUL-terminated string at the current cursor position -// void cputs(__zp($38) const char *s) -cputs: { - .label s = $38 - // [2281] phi from cputs cputs::@2 to cputs::@1 [phi:cputs/cputs::@2->cputs::@1] - // [2281] phi cputs::s#2 = cputs::s#1 [phi:cputs/cputs::@2->cputs::@1#0] -- register_copy - // cputs::@1 - __b1: - // while(c=*s++) - // [2282] cputs::c#1 = *cputs::s#2 -- vbum1=_deref_pbuz2 - ldy #0 - lda (s),y - sta c - // [2283] cputs::s#0 = ++ cputs::s#2 -- pbuz1=_inc_pbuz1 - inc.z s - bne !+ - inc.z s+1 - !: - // [2284] if(0!=cputs::c#1) goto cputs::@2 -- 0_neq_vbum1_then_la1 - lda c - bne __b2 - // cputs::@return + // uctoa +// Converts unsigned number value to a string representing it in RADIX format. +// If the leading digits are zero they are not included in the string. +// - value : The number to be converted to RADIX +// - buffer : receives the string representing the number and zero-termination. +// - radix : The radix to convert the number to (from the enum RADIX) +// void uctoa(__mem() char value, __zp($40) char *buffer, __mem() char radix) +uctoa: { + .label uctoa__4 = $38 + .label buffer = $40 + .label digit_values = $2d + // if(radix==DECIMAL) + // [1511] if(uctoa::radix#0==DECIMAL) goto uctoa::@1 -- vbum1_eq_vbuc1_then_la1 + lda #DECIMAL + cmp radix + beq __b2 + // uctoa::@2 + // if(radix==HEXADECIMAL) + // [1512] if(uctoa::radix#0==HEXADECIMAL) goto uctoa::@1 -- vbum1_eq_vbuc1_then_la1 + lda #HEXADECIMAL + cmp radix + beq __b3 + // uctoa::@3 + // if(radix==OCTAL) + // [1513] if(uctoa::radix#0==OCTAL) goto uctoa::@1 -- vbum1_eq_vbuc1_then_la1 + lda #OCTAL + cmp radix + beq __b4 + // uctoa::@4 + // if(radix==BINARY) + // [1514] if(uctoa::radix#0==BINARY) goto uctoa::@1 -- vbum1_eq_vbuc1_then_la1 + lda #BINARY + cmp radix + beq __b5 + // uctoa::@5 + // *buffer++ = 'e' + // [1515] *((char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS) = 'e' -- _deref_pbuc1=vbuc2 + // Unknown radix + lda #'e' + sta printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS + // *buffer++ = 'r' + // [1516] *((char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+1) = 'r' -- _deref_pbuc1=vbuc2 + lda #'r' + sta printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+1 + // [1517] *((char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+2) = 'r' -- _deref_pbuc1=vbuc2 + sta printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+2 + // *buffer = 0 + // [1518] *((char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+3) = 0 -- _deref_pbuc1=vbuc2 + lda #0 + sta printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+3 + // uctoa::@return // } - // [2285] return + // [1519] return rts - // cputs::@2 + // [1520] phi from uctoa to uctoa::@1 [phi:uctoa->uctoa::@1] __b2: - // cputc(c) - // [2286] stackpush(char) = cputs::c#1 -- _stackpushbyte_=vbum1 - lda c - pha - // [2287] callexecute cputc -- call_vprc1 - jsr cputc - // sideeffect stackpullpadding(1) -- _stackpullpadding_1 - pla + // [1520] phi uctoa::digit_values#8 = RADIX_DECIMAL_VALUES_CHAR [phi:uctoa->uctoa::@1#0] -- pbuz1=pbuc1 + lda #RADIX_DECIMAL_VALUES_CHAR + sta.z digit_values+1 + // [1520] phi uctoa::max_digits#7 = 3 [phi:uctoa->uctoa::@1#1] -- vbum1=vbuc1 + lda #3 + sta max_digits jmp __b1 - .segment Data - c: .byte 0 -} -.segment Code - // wherex -// Return the x position of the cursor -wherex: { - // return __conio.cursor_x; - // [2289] wherex::return#0 = *((char *)&__conio) -- vbum1=_deref_pbuc1 - lda __conio - sta return - // wherex::@return - // } - // [2290] return + // [1520] phi from uctoa::@2 to uctoa::@1 [phi:uctoa::@2->uctoa::@1] + __b3: + // [1520] phi uctoa::digit_values#8 = RADIX_HEXADECIMAL_VALUES_CHAR [phi:uctoa::@2->uctoa::@1#0] -- pbuz1=pbuc1 + lda #RADIX_HEXADECIMAL_VALUES_CHAR + sta.z digit_values+1 + // [1520] phi uctoa::max_digits#7 = 2 [phi:uctoa::@2->uctoa::@1#1] -- vbum1=vbuc1 + lda #2 + sta max_digits + jmp __b1 + // [1520] phi from uctoa::@3 to uctoa::@1 [phi:uctoa::@3->uctoa::@1] + __b4: + // [1520] phi uctoa::digit_values#8 = RADIX_OCTAL_VALUES_CHAR [phi:uctoa::@3->uctoa::@1#0] -- pbuz1=pbuc1 + lda #RADIX_OCTAL_VALUES_CHAR + sta.z digit_values+1 + // [1520] phi uctoa::max_digits#7 = 3 [phi:uctoa::@3->uctoa::@1#1] -- vbum1=vbuc1 + lda #3 + sta max_digits + jmp __b1 + // [1520] phi from uctoa::@4 to uctoa::@1 [phi:uctoa::@4->uctoa::@1] + __b5: + // [1520] phi uctoa::digit_values#8 = RADIX_BINARY_VALUES_CHAR [phi:uctoa::@4->uctoa::@1#0] -- pbuz1=pbuc1 + lda #RADIX_BINARY_VALUES_CHAR + sta.z digit_values+1 + // [1520] phi uctoa::max_digits#7 = 8 [phi:uctoa::@4->uctoa::@1#1] -- vbum1=vbuc1 + lda #8 + sta max_digits + // uctoa::@1 + __b1: + // [1521] phi from uctoa::@1 to uctoa::@6 [phi:uctoa::@1->uctoa::@6] + // [1521] phi uctoa::buffer#11 = (char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS [phi:uctoa::@1->uctoa::@6#0] -- pbuz1=pbuc1 + lda #printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS + sta.z buffer+1 + // [1521] phi uctoa::started#2 = 0 [phi:uctoa::@1->uctoa::@6#1] -- vbum1=vbuc1 + lda #0 + sta started + // [1521] phi uctoa::value#2 = uctoa::value#1 [phi:uctoa::@1->uctoa::@6#2] -- register_copy + // [1521] phi uctoa::digit#2 = 0 [phi:uctoa::@1->uctoa::@6#3] -- vbum1=vbuc1 + sta digit + // uctoa::@6 + __b6: + // max_digits-1 + // [1522] uctoa::$4 = uctoa::max_digits#7 - 1 -- vbuz1=vbum2_minus_1 + ldx max_digits + dex + stx.z uctoa__4 + // for( char digit=0; digit= digit_value) + // [1528] if(0!=uctoa::started#2) goto uctoa::@10 -- 0_neq_vbum1_then_la1 + lda started + bne __b10 + // uctoa::@12 + // [1529] if(uctoa::value#2>=uctoa::digit_value#0) goto uctoa::@10 -- vbum1_ge_vbum2_then_la1 + lda value + cmp digit_value + bcs __b10 + // [1530] phi from uctoa::@12 to uctoa::@9 [phi:uctoa::@12->uctoa::@9] + // [1530] phi uctoa::buffer#14 = uctoa::buffer#11 [phi:uctoa::@12->uctoa::@9#0] -- register_copy + // [1530] phi uctoa::started#4 = uctoa::started#2 [phi:uctoa::@12->uctoa::@9#1] -- register_copy + // [1530] phi uctoa::value#6 = uctoa::value#2 [phi:uctoa::@12->uctoa::@9#2] -- register_copy + // uctoa::@9 + __b9: + // for( char digit=0; digituctoa::@6] + // [1521] phi uctoa::buffer#11 = uctoa::buffer#14 [phi:uctoa::@9->uctoa::@6#0] -- register_copy + // [1521] phi uctoa::started#2 = uctoa::started#4 [phi:uctoa::@9->uctoa::@6#1] -- register_copy + // [1521] phi uctoa::value#2 = uctoa::value#6 [phi:uctoa::@9->uctoa::@6#2] -- register_copy + // [1521] phi uctoa::digit#2 = uctoa::digit#1 [phi:uctoa::@9->uctoa::@6#3] -- register_copy + jmp __b6 + // uctoa::@10 + __b10: + // uctoa_append(buffer++, value, digit_value) + // [1532] uctoa_append::buffer#0 = uctoa::buffer#11 -- pbuz1=pbuz2 + lda.z buffer + sta.z uctoa_append.buffer + lda.z buffer+1 + sta.z uctoa_append.buffer+1 + // [1533] uctoa_append::value#0 = uctoa::value#2 + // [1534] uctoa_append::sub#0 = uctoa::digit_value#0 + // [1535] call uctoa_append + // [2109] phi from uctoa::@10 to uctoa_append [phi:uctoa::@10->uctoa_append] + jsr uctoa_append + // uctoa_append(buffer++, value, digit_value) + // [1536] uctoa_append::return#0 = uctoa_append::value#2 + // uctoa::@11 + // value = uctoa_append(buffer++, value, digit_value) + // [1537] uctoa::value#0 = uctoa_append::return#0 + // value = uctoa_append(buffer++, value, digit_value); + // [1538] uctoa::buffer#4 = ++ uctoa::buffer#11 -- pbuz1=_inc_pbuz1 + inc.z buffer + bne !+ + inc.z buffer+1 + !: + // [1530] phi from uctoa::@11 to uctoa::@9 [phi:uctoa::@11->uctoa::@9] + // [1530] phi uctoa::buffer#14 = uctoa::buffer#4 [phi:uctoa::@11->uctoa::@9#0] -- register_copy + // [1530] phi uctoa::started#4 = 1 [phi:uctoa::@11->uctoa::@9#1] -- vbum1=vbuc1 + lda #1 + sta started + // [1530] phi uctoa::value#6 = uctoa::value#0 [phi:uctoa::@11->uctoa::@9#2] -- register_copy + jmp __b9 .segment Data - return: .byte 0 - return_1: .byte 0 - return_2: .byte 0 - return_3: .byte 0 - return_4: .byte 0 + digit_value: .byte 0 + digit: .byte 0 + .label value = printf_uchar.uvalue + .label radix = printf_uchar.format_radix + started: .byte 0 + max_digits: .byte 0 } .segment Code - // wherey -// Return the y position of the cursor -wherey: { - // return __conio.cursor_y; - // [2291] wherey::return#0 = *((char *)&__conio+1) -- vbum1=_deref_pbuc1 - lda __conio+1 - sta return - // wherey::@return + // 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($49) void (*putc)(char), __mem() char buffer_sign, char *buffer_digits, __mem() char format_min_length, char format_justify_left, char format_sign_always, __mem() char format_zero_padding, char format_upper_case, char format_radix) +printf_number_buffer: { + .label printf_number_buffer__19 = $53 + .label putc = $49 + // if(format.min_length) + // [1540] if(0==printf_number_buffer::format_min_length#3) goto printf_number_buffer::@1 -- 0_eq_vbum1_then_la1 + lda format_min_length + beq __b5 + // [1541] phi from printf_number_buffer to printf_number_buffer::@5 [phi:printf_number_buffer->printf_number_buffer::@5] + // printf_number_buffer::@5 + // strlen(buffer.digits) + // [1542] call strlen + // [1788] phi from printf_number_buffer::@5 to strlen [phi:printf_number_buffer::@5->strlen] + // [1788] phi strlen::str#8 = (char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS [phi:printf_number_buffer::@5->strlen#0] -- pbuz1=pbuc1 + lda #printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS + sta.z strlen.str+1 + jsr strlen + // strlen(buffer.digits) + // [1543] strlen::return#3 = strlen::len#2 + // printf_number_buffer::@11 + // [1544] printf_number_buffer::$19 = strlen::return#3 -- vwuz1=vwum2 + lda strlen.return + sta.z printf_number_buffer__19 + lda strlen.return+1 + sta.z printf_number_buffer__19+1 + // signed char len = (signed char)strlen(buffer.digits) + // [1545] printf_number_buffer::len#0 = (signed char)printf_number_buffer::$19 -- vbsm1=_sbyte_vwuz2 + // There is a minimum length - work out the padding + lda.z printf_number_buffer__19 + sta len + // if(buffer.sign) + // [1546] if(0==printf_number_buffer::buffer_sign#10) goto printf_number_buffer::@10 -- 0_eq_vbum1_then_la1 + lda buffer_sign + beq __b10 + // printf_number_buffer::@6 + // len++; + // [1547] printf_number_buffer::len#1 = ++ printf_number_buffer::len#0 -- vbsm1=_inc_vbsm1 + inc len + // [1548] 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] + // [1548] 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 + // [1549] printf_number_buffer::padding#1 = (signed char)printf_number_buffer::format_min_length#3 - printf_number_buffer::len#2 -- vbsm1=vbsm2_minus_vbsm1 + lda format_min_length + sec + sbc padding + sta padding + // if(padding<0) + // [1550] if(printf_number_buffer::padding#1>=0) goto printf_number_buffer::@15 -- vbsm1_ge_0_then_la1 + cmp #0 + bpl __b1 + // [1552] phi from printf_number_buffer printf_number_buffer::@10 to printf_number_buffer::@1 [phi:printf_number_buffer/printf_number_buffer::@10->printf_number_buffer::@1] + __b5: + // [1552] phi printf_number_buffer::padding#10 = 0 [phi:printf_number_buffer/printf_number_buffer::@10->printf_number_buffer::@1#0] -- vbsm1=vbsc1 + lda #0 + sta padding + // [1551] phi from printf_number_buffer::@10 to printf_number_buffer::@15 [phi:printf_number_buffer::@10->printf_number_buffer::@15] + // printf_number_buffer::@15 + // [1552] phi from printf_number_buffer::@15 to printf_number_buffer::@1 [phi:printf_number_buffer::@15->printf_number_buffer::@1] + // [1552] phi printf_number_buffer::padding#10 = printf_number_buffer::padding#1 [phi:printf_number_buffer::@15->printf_number_buffer::@1#0] -- register_copy + // printf_number_buffer::@1 + __b1: + // printf_number_buffer::@13 + // if(!format.justify_left && !format.zero_padding && padding) + // [1553] if(0!=printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@2 -- 0_neq_vbum1_then_la1 + lda format_zero_padding + bne __b2 + // printf_number_buffer::@12 + // [1554] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@7 -- 0_neq_vbsm1_then_la1 + lda padding + cmp #0 + bne __b7 + jmp __b2 + // printf_number_buffer::@7 + __b7: + // printf_padding(putc, ' ',(char)padding) + // [1555] printf_padding::putc#0 = printf_number_buffer::putc#10 -- pprz1=pprz2 + lda.z putc + sta.z printf_padding.putc + lda.z putc+1 + sta.z printf_padding.putc+1 + // [1556] printf_padding::length#0 = (char)printf_number_buffer::padding#10 -- vbum1=vbum2 + lda padding + sta printf_padding.length + // [1557] call printf_padding + // [1794] phi from printf_number_buffer::@7 to printf_padding [phi:printf_number_buffer::@7->printf_padding] + // [1794] phi printf_padding::putc#7 = printf_padding::putc#0 [phi:printf_number_buffer::@7->printf_padding#0] -- register_copy + // [1794] phi printf_padding::pad#7 = ' ' [phi:printf_number_buffer::@7->printf_padding#1] -- vbum1=vbuc1 + lda #' ' + sta printf_padding.pad + // [1794] phi printf_padding::length#6 = printf_padding::length#0 [phi:printf_number_buffer::@7->printf_padding#2] -- register_copy + jsr printf_padding + // printf_number_buffer::@2 + __b2: + // if(buffer.sign) + // [1558] if(0==printf_number_buffer::buffer_sign#10) goto printf_number_buffer::@3 -- 0_eq_vbum1_then_la1 + lda buffer_sign + beq __b3 + // printf_number_buffer::@8 + // putc(buffer.sign) + // [1559] stackpush(char) = printf_number_buffer::buffer_sign#10 -- _stackpushbyte_=vbum1 + pha + // [1560] callexecute *printf_number_buffer::putc#10 -- call__deref_pprz1 + jsr icall13 + // sideeffect stackpullpadding(1) -- _stackpullpadding_1 + pla + // printf_number_buffer::@3 + __b3: + // if(format.zero_padding && padding) + // [1562] if(0==printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@4 -- 0_eq_vbum1_then_la1 + lda format_zero_padding + beq __b4 + // printf_number_buffer::@14 + // [1563] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@9 -- 0_neq_vbsm1_then_la1 + lda padding + cmp #0 + bne __b9 + jmp __b4 + // printf_number_buffer::@9 + __b9: + // printf_padding(putc, '0',(char)padding) + // [1564] printf_padding::putc#1 = printf_number_buffer::putc#10 -- pprz1=pprz2 + lda.z putc + sta.z printf_padding.putc + lda.z putc+1 + sta.z printf_padding.putc+1 + // [1565] printf_padding::length#1 = (char)printf_number_buffer::padding#10 -- vbum1=vbum2 + lda padding + sta printf_padding.length + // [1566] call printf_padding + // [1794] phi from printf_number_buffer::@9 to printf_padding [phi:printf_number_buffer::@9->printf_padding] + // [1794] phi printf_padding::putc#7 = printf_padding::putc#1 [phi:printf_number_buffer::@9->printf_padding#0] -- register_copy + // [1794] phi printf_padding::pad#7 = '0' [phi:printf_number_buffer::@9->printf_padding#1] -- vbum1=vbuc1 + lda #'0' + sta printf_padding.pad + // [1794] phi printf_padding::length#6 = printf_padding::length#1 [phi:printf_number_buffer::@9->printf_padding#2] -- register_copy + jsr printf_padding + // printf_number_buffer::@4 + __b4: + // printf_str(putc, buffer.digits) + // [1567] printf_str::putc#0 = printf_number_buffer::putc#10 + // [1568] call printf_str + // [785] phi from printf_number_buffer::@4 to printf_str [phi:printf_number_buffer::@4->printf_str] + // [785] phi printf_str::putc#53 = printf_str::putc#0 [phi:printf_number_buffer::@4->printf_str#0] -- register_copy + // [785] phi printf_str::s#53 = (char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS [phi:printf_number_buffer::@4->printf_str#1] -- pbuz1=pbuc1 + lda #printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS + sta.z printf_str.s+1 + jsr printf_str + // printf_number_buffer::@return // } - // [2292] return + // [1569] return rts + // Outside Flow + icall13: + jmp (putc) .segment Data - return: .byte 0 - return_1: .byte 0 - return_2: .byte 0 - return_3: .byte 0 - return_4: .byte 0 + buffer_sign: .byte 0 + .label format_min_length = printf_uchar.format_min_length + .label format_zero_padding = printf_uchar.format_zero_padding + len: .byte 0 + .label padding = len } -.segment Code - // cputcxy -// Move cursor and output one character -// Same as "gotoxy (x, y); cputc (c);" -// void cputcxy(__mem() char x, __mem() char y, __mem() char c) -cputcxy: { +.segment CodeVera + // vera_verify +vera_verify: { + .label vera_verify__16 = $65 + .label vera_bram_ptr = $76 + // vera_verify::bank_set_bram1 + // BRAM = bank + // [1571] BRAM = 1 -- vbuz1=vbuc1 + lda #1 + sta.z BRAM + // vera_verify::@11 + // unsigned long vera_boundary = vera_file_size + // [1572] vera_verify::vera_boundary#0 = vera_file_size#1 -- vdum1=vdum2 + lda vera_file_size + sta vera_boundary + lda vera_file_size+1 + sta vera_boundary+1 + lda vera_file_size+2 + sta vera_boundary+2 + lda vera_file_size+3 + sta vera_boundary+3 + // [1573] spi_manufacturer#423 = spi_read::return#0 -- vbum1=vbum2 + lda spi_read.return + sta spi_manufacturer + // [1574] spi_memory_type#424 = spi_read::return#1 -- vbum1=vbum2 + lda spi_read.return_1 + sta spi_memory_type + // [1575] spi_memory_capacity#425 = spi_read::return#2 -- vbum1=vbum2 + lda spi_read.return_2 + sta spi_memory_capacity + // display_info_vera(STATUS_COMPARING, "Comparing VERA ...") + // [1576] call display_info_vera + // [653] phi from vera_verify::@11 to display_info_vera [phi:vera_verify::@11->display_info_vera] + // [653] phi display_info_vera::info_text#19 = vera_verify::info_text [phi:vera_verify::@11->display_info_vera#0] -- pbuz1=pbuc1 + lda #info_text + sta.z display_info_vera.info_text+1 + // [653] phi spi_memory_capacity#110 = spi_memory_capacity#425 [phi:vera_verify::@11->display_info_vera#1] -- register_copy + // [653] phi spi_memory_type#111 = spi_memory_type#424 [phi:vera_verify::@11->display_info_vera#2] -- register_copy + // [653] phi spi_manufacturer#100 = spi_manufacturer#423 [phi:vera_verify::@11->display_info_vera#3] -- register_copy + // [653] phi display_info_vera::info_status#19 = STATUS_COMPARING [phi:vera_verify::@11->display_info_vera#4] -- vbum1=vbuc1 + lda #STATUS_COMPARING + sta display_info_vera.info_status + jsr display_info_vera + // [1577] phi from vera_verify::@11 to vera_verify::@12 [phi:vera_verify::@11->vera_verify::@12] + // vera_verify::@12 // gotoxy(x, y) - // [2294] gotoxy::x#0 = cputcxy::x#17 -- vbum1=vbum2 - lda x + // [1578] call gotoxy + // [457] phi from vera_verify::@12 to gotoxy [phi:vera_verify::@12->gotoxy] + // [457] phi gotoxy::y#26 = PROGRESS_Y [phi:vera_verify::@12->gotoxy#0] -- vbum1=vbuc1 + lda #PROGRESS_Y + sta gotoxy.y + // [457] phi gotoxy::x#26 = PROGRESS_X [phi:vera_verify::@12->gotoxy#1] -- vbum1=vbuc1 + lda #PROGRESS_X sta gotoxy.x - // [2295] gotoxy::y#0 = cputcxy::y#17 -- vbum1=vbum2 + jsr gotoxy + // [1579] phi from vera_verify::@12 to vera_verify::@13 [phi:vera_verify::@12->vera_verify::@13] + // vera_verify::@13 + // spi_read_flash(0UL) + // [1580] call spi_read_flash + // [2116] phi from vera_verify::@13 to spi_read_flash [phi:vera_verify::@13->spi_read_flash] + jsr spi_read_flash + // [1581] phi from vera_verify::@13 to vera_verify::@1 [phi:vera_verify::@13->vera_verify::@1] + // [1581] phi vera_verify::y#3 = PROGRESS_Y [phi:vera_verify::@13->vera_verify::@1#0] -- vbum1=vbuc1 + lda #PROGRESS_Y + sta y + // [1581] phi vera_verify::progress_row_current#3 = 0 [phi:vera_verify::@13->vera_verify::@1#1] -- vwum1=vwuc1 + lda #<0 + sta progress_row_current + sta progress_row_current+1 + // [1581] phi vera_verify::vera_different_bytes#11 = 0 [phi:vera_verify::@13->vera_verify::@1#2] -- vdum1=vduc1 + sta vera_different_bytes + sta vera_different_bytes+1 + lda #<0>>$10 + sta vera_different_bytes+2 + lda #>0>>$10 + sta vera_different_bytes+3 + // [1581] phi vera_verify::vera_bram_ptr#10 = (char *)$a000 [phi:vera_verify::@13->vera_verify::@1#3] -- pbuz1=pbuc1 + lda #<$a000 + sta.z vera_bram_ptr + lda #>$a000 + sta.z vera_bram_ptr+1 + // [1581] phi vera_verify::vera_bram_bank#11 = 1 [phi:vera_verify::@13->vera_verify::@1#4] -- vbum1=vbuc1 + lda #1 + sta vera_bram_bank + // [1581] phi vera_verify::vera_address#11 = 0 [phi:vera_verify::@13->vera_verify::@1#5] -- vdum1=vduc1 + lda #<0 + sta vera_address + sta vera_address+1 + lda #<0>>$10 + sta vera_address+2 + lda #>0>>$10 + sta vera_address+3 + // vera_verify::@1 + __b1: + // while (vera_address < vera_boundary) + // [1582] if(vera_verify::vera_address#11vera_compare] + jsr vera_compare + // unsigned int equal_bytes = vera_compare(vera_bram_bank, (bram_ptr_t)vera_bram_ptr, VERA_PROGRESS_CELL) + // [1587] vera_compare::return#0 = vera_compare::equal_bytes#2 + // vera_verify::@14 + // [1588] vera_verify::equal_bytes#0 = vera_compare::return#0 + // if (progress_row_current == VERA_PROGRESS_ROW) + // [1589] if(vera_verify::progress_row_current#3!=VERA_PROGRESS_ROW) goto vera_verify::@3 -- vwum1_neq_vwuc1_then_la1 + lda progress_row_current+1 + cmp #>VERA_PROGRESS_ROW + bne __b3 + lda progress_row_current + cmp #gotoxy] - // [802] phi gotoxy::y#37 = gotoxy::y#0 [phi:cputcxy->gotoxy#0] -- register_copy - // [802] phi gotoxy::x#37 = gotoxy::x#0 [phi:cputcxy->gotoxy#1] -- register_copy + // [1592] call gotoxy + // [457] phi from vera_verify::@8 to gotoxy [phi:vera_verify::@8->gotoxy] + // [457] phi gotoxy::y#26 = gotoxy::y#8 [phi:vera_verify::@8->gotoxy#0] -- register_copy + // [457] phi gotoxy::x#26 = PROGRESS_X [phi:vera_verify::@8->gotoxy#1] -- vbum1=vbuc1 + lda #PROGRESS_X + sta gotoxy.x jsr gotoxy - // cputcxy::@1 - // cputc(c) - // [2297] stackpush(char) = cputcxy::c#17 -- _stackpushbyte_=vbum1 - lda c + // [1593] phi from vera_verify::@8 to vera_verify::@3 [phi:vera_verify::@8->vera_verify::@3] + // [1593] phi vera_verify::y#10 = vera_verify::y#1 [phi:vera_verify::@8->vera_verify::@3#0] -- register_copy + // [1593] phi vera_verify::progress_row_current#4 = 0 [phi:vera_verify::@8->vera_verify::@3#1] -- vwum1=vbuc1 + lda #<0 + sta progress_row_current + sta progress_row_current+1 + // [1593] phi from vera_verify::@14 to vera_verify::@3 [phi:vera_verify::@14->vera_verify::@3] + // [1593] phi vera_verify::y#10 = vera_verify::y#3 [phi:vera_verify::@14->vera_verify::@3#0] -- register_copy + // [1593] phi vera_verify::progress_row_current#4 = vera_verify::progress_row_current#3 [phi:vera_verify::@14->vera_verify::@3#1] -- register_copy + // vera_verify::@3 + __b3: + // if (equal_bytes != VERA_PROGRESS_CELL) + // [1594] if(vera_verify::equal_bytes#0!=VERA_PROGRESS_CELL) goto vera_verify::@4 -- vwum1_neq_vbuc1_then_la1 + lda equal_bytes+1 + beq !__b4+ + jmp __b4 + !__b4: + lda equal_bytes + cmp #VERA_PROGRESS_CELL + beq !__b4+ + jmp __b4 + !__b4: + // vera_verify::@9 + // cputc('=') + // [1595] stackpush(char) = '=' -- _stackpushbyte_=vbuc1 + lda #'=' pha - // [2298] callexecute cputc -- call_vprc1 + // [1596] callexecute cputc -- call_vprc1 jsr cputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla - // cputcxy::@return - // } - // [2300] return - rts - .segment Data - x: .byte 0 - y: .byte 0 - c: .byte 0 -} -.segment Code - // display_smc_led -/** - * @brief Print SMC led above the SMC chip. - * - * @param c Led color - */ -// void display_smc_led(__mem() char c) -display_smc_led: { - // display_chip_led(CHIP_SMC_X+1, CHIP_SMC_Y, CHIP_SMC_W, c, BLUE) - // [2302] display_chip_led::tc#0 = display_smc_led::c#2 -- vbum1=vbum2 - lda c - sta display_chip_led.tc - // [2303] call display_chip_led - // [3117] phi from display_smc_led to display_chip_led [phi:display_smc_led->display_chip_led] - // [3117] phi display_chip_led::w#7 = 5 [phi:display_smc_led->display_chip_led#0] -- vbum1=vbuc1 - lda #5 - sta display_chip_led.w - // [3117] phi display_chip_led::x#7 = 1+1 [phi:display_smc_led->display_chip_led#1] -- vbum1=vbuc1 - lda #1+1 - sta display_chip_led.x - // [3117] phi display_chip_led::tc#3 = display_chip_led::tc#0 [phi:display_smc_led->display_chip_led#2] -- register_copy - jsr display_chip_led - // display_smc_led::@1 - // display_info_led(INFO_X-2, INFO_Y, c, BLUE) - // [2304] display_info_led::tc#0 = display_smc_led::c#2 - // [2305] call display_info_led - // [2380] phi from display_smc_led::@1 to display_info_led [phi:display_smc_led::@1->display_info_led] - // [2380] phi display_info_led::y#4 = $11 [phi:display_smc_led::@1->display_info_led#0] -- vbum1=vbuc1 - lda #$11 - sta display_info_led.y - // [2380] phi display_info_led::x#4 = 4-2 [phi:display_smc_led::@1->display_info_led#1] -- vbum1=vbuc1 - lda #4-2 - sta display_info_led.x - // [2380] 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 - // } - // [2306] return - rts - .segment Data - c: .byte 0 -} -.segment Code - // display_print_chip -/** - * @brief Print a full chip. - * - * @param x Start X - * @param y Start Y - * @param w Width - * @param text Vertical text to be displayed in the chip, starting from the top. - */ -// void display_print_chip(__mem() char x, char y, __mem() char w, __zp($72) char *text) -display_print_chip: { - .label y = 3+2+1+1+1+1+1+1+1+1 - .label text = $72 - .label text_1 = $66 - .label text_2 = $3d - .label text_3 = $69 - .label text_4 = $b0 - .label text_5 = $31 - .label text_6 = $4e - // display_chip_line(x, y++, w, *text++) - // [2308] display_chip_line::x#0 = display_print_chip::x#10 -- vbum1=vbum2 - lda x - sta display_chip_line.x - // [2309] display_chip_line::w#0 = display_print_chip::w#10 -- vbum1=vbum2 - lda w - sta display_chip_line.w - // [2310] display_chip_line::c#0 = *display_print_chip::text#11 -- vbum1=_deref_pbuz2 - ldy #0 - lda (text_2),y - sta display_chip_line.c - // [2311] call display_chip_line - // [3135] phi from display_print_chip to display_chip_line [phi:display_print_chip->display_chip_line] - // [3135] phi display_chip_line::c#15 = display_chip_line::c#0 [phi:display_print_chip->display_chip_line#0] -- register_copy - // [3135] phi display_chip_line::w#10 = display_chip_line::w#0 [phi:display_print_chip->display_chip_line#1] -- register_copy - // [3135] phi display_chip_line::y#16 = 3+2 [phi:display_print_chip->display_chip_line#2] -- vbum1=vbuc1 - lda #3+2 - sta display_chip_line.y - // [3135] phi display_chip_line::x#16 = display_chip_line::x#0 [phi:display_print_chip->display_chip_line#3] -- register_copy - jsr display_chip_line - // display_print_chip::@1 - // display_chip_line(x, y++, w, *text++); - // [2312] display_print_chip::text#0 = ++ display_print_chip::text#11 -- pbuz1=_inc_pbuz2 - clc - lda.z text_2 - adc #1 - sta.z text - lda.z text_2+1 - adc #0 - sta.z text+1 - // display_chip_line(x, y++, w, *text++) - // [2313] display_chip_line::x#1 = display_print_chip::x#10 -- vbum1=vbum2 - lda x - sta display_chip_line.x - // [2314] display_chip_line::w#1 = display_print_chip::w#10 -- vbum1=vbum2 - lda w - sta display_chip_line.w - // [2315] display_chip_line::c#1 = *display_print_chip::text#0 -- vbum1=_deref_pbuz2 - ldy #0 - lda (text),y - sta display_chip_line.c - // [2316] call display_chip_line - // [3135] phi from display_print_chip::@1 to display_chip_line [phi:display_print_chip::@1->display_chip_line] - // [3135] phi display_chip_line::c#15 = display_chip_line::c#1 [phi:display_print_chip::@1->display_chip_line#0] -- register_copy - // [3135] phi display_chip_line::w#10 = display_chip_line::w#1 [phi:display_print_chip::@1->display_chip_line#1] -- register_copy - // [3135] phi display_chip_line::y#16 = ++3+2 [phi:display_print_chip::@1->display_chip_line#2] -- vbum1=vbuc1 - lda #3+2+1 - sta display_chip_line.y - // [3135] phi display_chip_line::x#16 = display_chip_line::x#1 [phi:display_print_chip::@1->display_chip_line#3] -- register_copy - jsr display_chip_line - // display_print_chip::@2 - // display_chip_line(x, y++, w, *text++); - // [2317] display_print_chip::text#1 = ++ display_print_chip::text#0 -- pbuz1=_inc_pbuz2 + // vera_verify::@5 + __b5: + // vera_bram_ptr += VERA_PROGRESS_CELL + // [1598] vera_verify::vera_bram_ptr#1 = vera_verify::vera_bram_ptr#10 + VERA_PROGRESS_CELL -- pbuz1=pbuz1_plus_vbuc1 + lda #VERA_PROGRESS_CELL clc - lda.z text - adc #1 - sta.z text_1 - lda.z text+1 - adc #0 - sta.z text_1+1 - // display_chip_line(x, y++, w, *text++) - // [2318] display_chip_line::x#2 = display_print_chip::x#10 -- vbum1=vbum2 - lda x - sta display_chip_line.x - // [2319] display_chip_line::w#2 = display_print_chip::w#10 -- vbum1=vbum2 - lda w - sta display_chip_line.w - // [2320] display_chip_line::c#2 = *display_print_chip::text#1 -- vbum1=_deref_pbuz2 - ldy #0 - lda (text_1),y - sta display_chip_line.c - // [2321] call display_chip_line - // [3135] phi from display_print_chip::@2 to display_chip_line [phi:display_print_chip::@2->display_chip_line] - // [3135] phi display_chip_line::c#15 = display_chip_line::c#2 [phi:display_print_chip::@2->display_chip_line#0] -- register_copy - // [3135] phi display_chip_line::w#10 = display_chip_line::w#2 [phi:display_print_chip::@2->display_chip_line#1] -- register_copy - // [3135] phi display_chip_line::y#16 = ++++3+2 [phi:display_print_chip::@2->display_chip_line#2] -- vbum1=vbuc1 - lda #3+2+1+1 - sta display_chip_line.y - // [3135] phi display_chip_line::x#16 = display_chip_line::x#2 [phi:display_print_chip::@2->display_chip_line#3] -- register_copy - jsr display_chip_line - // display_print_chip::@3 - // display_chip_line(x, y++, w, *text++); - // [2322] display_print_chip::text#15 = ++ display_print_chip::text#1 -- pbuz1=_inc_pbuz2 + adc.z vera_bram_ptr + sta.z vera_bram_ptr + bcc !+ + inc.z vera_bram_ptr+1 + !: + // vera_address += VERA_PROGRESS_CELL + // [1599] vera_verify::vera_address#1 = vera_verify::vera_address#11 + VERA_PROGRESS_CELL -- vdum1=vdum1_plus_vbuc1 + lda vera_address clc - lda.z text_1 - adc #1 - sta.z text_3 - lda.z text_1+1 - adc #0 - sta.z text_3+1 - // display_chip_line(x, y++, w, *text++) - // [2323] display_chip_line::x#3 = display_print_chip::x#10 -- vbum1=vbum2 - lda x - sta display_chip_line.x - // [2324] display_chip_line::w#3 = display_print_chip::w#10 -- vbum1=vbum2 - lda w - sta display_chip_line.w - // [2325] display_chip_line::c#3 = *display_print_chip::text#15 -- vbum1=_deref_pbuz2 - ldy #0 - lda (text_3),y - sta display_chip_line.c - // [2326] call display_chip_line - // [3135] phi from display_print_chip::@3 to display_chip_line [phi:display_print_chip::@3->display_chip_line] - // [3135] phi display_chip_line::c#15 = display_chip_line::c#3 [phi:display_print_chip::@3->display_chip_line#0] -- register_copy - // [3135] phi display_chip_line::w#10 = display_chip_line::w#3 [phi:display_print_chip::@3->display_chip_line#1] -- register_copy - // [3135] phi display_chip_line::y#16 = ++++++3+2 [phi:display_print_chip::@3->display_chip_line#2] -- vbum1=vbuc1 - lda #3+2+1+1+1 - sta display_chip_line.y - // [3135] phi display_chip_line::x#16 = display_chip_line::x#3 [phi:display_print_chip::@3->display_chip_line#3] -- register_copy - jsr display_chip_line - // display_print_chip::@4 - // display_chip_line(x, y++, w, *text++); - // [2327] display_print_chip::text#16 = ++ display_print_chip::text#15 -- pbuz1=_inc_pbuz2 - clc - lda.z text_3 - adc #1 - sta.z text_4 - lda.z text_3+1 - adc #0 - sta.z text_4+1 - // display_chip_line(x, y++, w, *text++) - // [2328] display_chip_line::x#4 = display_print_chip::x#10 -- vbum1=vbum2 - lda x - sta display_chip_line.x - // [2329] display_chip_line::w#4 = display_print_chip::w#10 -- vbum1=vbum2 - lda w - sta display_chip_line.w - // [2330] display_chip_line::c#4 = *display_print_chip::text#16 -- vbum1=_deref_pbuz2 - ldy #0 - lda (text_4),y - sta display_chip_line.c - // [2331] call display_chip_line - // [3135] phi from display_print_chip::@4 to display_chip_line [phi:display_print_chip::@4->display_chip_line] - // [3135] phi display_chip_line::c#15 = display_chip_line::c#4 [phi:display_print_chip::@4->display_chip_line#0] -- register_copy - // [3135] phi display_chip_line::w#10 = display_chip_line::w#4 [phi:display_print_chip::@4->display_chip_line#1] -- register_copy - // [3135] phi display_chip_line::y#16 = ++++++++3+2 [phi:display_print_chip::@4->display_chip_line#2] -- vbum1=vbuc1 - lda #3+2+1+1+1+1 - sta display_chip_line.y - // [3135] phi display_chip_line::x#16 = display_chip_line::x#4 [phi:display_print_chip::@4->display_chip_line#3] -- register_copy - jsr display_chip_line - // display_print_chip::@5 - // display_chip_line(x, y++, w, *text++); - // [2332] display_print_chip::text#17 = ++ display_print_chip::text#16 -- pbuz1=_inc_pbuz2 - clc - lda.z text_4 - adc #1 - sta.z text_5 - lda.z text_4+1 - adc #0 - sta.z text_5+1 - // display_chip_line(x, y++, w, *text++) - // [2333] display_chip_line::x#5 = display_print_chip::x#10 -- vbum1=vbum2 - lda x - sta display_chip_line.x - // [2334] display_chip_line::w#5 = display_print_chip::w#10 -- vbum1=vbum2 - lda w - sta display_chip_line.w - // [2335] display_chip_line::c#5 = *display_print_chip::text#17 -- vbum1=_deref_pbuz2 - ldy #0 - lda (text_5),y - sta display_chip_line.c - // [2336] call display_chip_line - // [3135] phi from display_print_chip::@5 to display_chip_line [phi:display_print_chip::@5->display_chip_line] - // [3135] phi display_chip_line::c#15 = display_chip_line::c#5 [phi:display_print_chip::@5->display_chip_line#0] -- register_copy - // [3135] phi display_chip_line::w#10 = display_chip_line::w#5 [phi:display_print_chip::@5->display_chip_line#1] -- register_copy - // [3135] phi display_chip_line::y#16 = ++++++++++3+2 [phi:display_print_chip::@5->display_chip_line#2] -- vbum1=vbuc1 - lda #3+2+1+1+1+1+1 - sta display_chip_line.y - // [3135] phi display_chip_line::x#16 = display_chip_line::x#5 [phi:display_print_chip::@5->display_chip_line#3] -- register_copy - jsr display_chip_line - // display_print_chip::@6 - // display_chip_line(x, y++, w, *text++); - // [2337] display_print_chip::text#18 = ++ display_print_chip::text#17 -- pbuz1=_inc_pbuz2 - clc - lda.z text_5 - adc #1 - sta.z text_6 - lda.z text_5+1 - adc #0 - sta.z text_6+1 - // display_chip_line(x, y++, w, *text++) - // [2338] display_chip_line::x#6 = display_print_chip::x#10 -- vbum1=vbum2 - lda x - sta display_chip_line.x - // [2339] display_chip_line::w#6 = display_print_chip::w#10 -- vbum1=vbum2 - lda w - sta display_chip_line.w - // [2340] display_chip_line::c#6 = *display_print_chip::text#18 -- vbum1=_deref_pbuz2 - ldy #0 - lda (text_6),y - sta display_chip_line.c - // [2341] call display_chip_line - // [3135] phi from display_print_chip::@6 to display_chip_line [phi:display_print_chip::@6->display_chip_line] - // [3135] phi display_chip_line::c#15 = display_chip_line::c#6 [phi:display_print_chip::@6->display_chip_line#0] -- register_copy - // [3135] phi display_chip_line::w#10 = display_chip_line::w#6 [phi:display_print_chip::@6->display_chip_line#1] -- register_copy - // [3135] phi display_chip_line::y#16 = ++++++++++++3+2 [phi:display_print_chip::@6->display_chip_line#2] -- vbum1=vbuc1 - lda #3+2+1+1+1+1+1+1 - sta display_chip_line.y - // [3135] phi display_chip_line::x#16 = display_chip_line::x#6 [phi:display_print_chip::@6->display_chip_line#3] -- register_copy - jsr display_chip_line - // display_print_chip::@7 - // display_chip_line(x, y++, w, *text++); - // [2342] display_print_chip::text#19 = ++ display_print_chip::text#18 -- pbuz1=_inc_pbuz1 - inc.z text_6 + adc #VERA_PROGRESS_CELL + sta vera_address + bcc !+ + inc vera_address+1 bne !+ - inc.z text_6+1 - !: - // display_chip_line(x, y++, w, *text++) - // [2343] display_chip_line::x#7 = display_print_chip::x#10 -- vbum1=vbum2 - lda x - sta display_chip_line.x - // [2344] display_chip_line::w#7 = display_print_chip::w#10 -- vbum1=vbum2 - lda w - sta display_chip_line.w - // [2345] display_chip_line::c#7 = *display_print_chip::text#19 -- vbum1=_deref_pbuz2 - ldy #0 - lda (text_6),y - sta display_chip_line.c - // [2346] call display_chip_line - // [3135] phi from display_print_chip::@7 to display_chip_line [phi:display_print_chip::@7->display_chip_line] - // [3135] phi display_chip_line::c#15 = display_chip_line::c#7 [phi:display_print_chip::@7->display_chip_line#0] -- register_copy - // [3135] phi display_chip_line::w#10 = display_chip_line::w#7 [phi:display_print_chip::@7->display_chip_line#1] -- register_copy - // [3135] phi display_chip_line::y#16 = ++++++++++++++3+2 [phi:display_print_chip::@7->display_chip_line#2] -- vbum1=vbuc1 - lda #3+2+1+1+1+1+1+1+1 - sta display_chip_line.y - // [3135] phi display_chip_line::x#16 = display_chip_line::x#7 [phi:display_print_chip::@7->display_chip_line#3] -- register_copy - jsr display_chip_line - // display_print_chip::@8 - // display_chip_end(x, y++, w) - // [2347] display_chip_end::x#0 = display_print_chip::x#10 - // [2348] display_chip_end::w#0 = display_print_chip::w#10 -- vbum1=vbum2 - lda w - sta display_chip_end.w - // [2349] call display_chip_end - jsr display_chip_end - // display_print_chip::@return - // } - // [2350] return - rts - .segment Data - x: .byte 0 - w: .byte 0 -} -.segment Code - // display_vera_led -/** - * @brief Print VERA led above the VERA chip. - * - * @param c Led color - */ -// void display_vera_led(__mem() char c) -display_vera_led: { - // display_chip_led(CHIP_VERA_X+1, CHIP_VERA_Y, CHIP_VERA_W, c, BLUE) - // [2352] display_chip_led::tc#1 = display_vera_led::c#2 -- vbum1=vbum2 - lda c - sta display_chip_led.tc - // [2353] call display_chip_led - // [3117] phi from display_vera_led to display_chip_led [phi:display_vera_led->display_chip_led] - // [3117] phi display_chip_led::w#7 = 8 [phi:display_vera_led->display_chip_led#0] -- vbum1=vbuc1 - lda #8 - sta display_chip_led.w - // [3117] phi display_chip_led::x#7 = 9+1 [phi:display_vera_led->display_chip_led#1] -- vbum1=vbuc1 - lda #9+1 - sta display_chip_led.x - // [3117] phi display_chip_led::tc#3 = display_chip_led::tc#1 [phi:display_vera_led->display_chip_led#2] -- register_copy - jsr display_chip_led - // display_vera_led::@1 - // display_info_led(INFO_X-2, INFO_Y+1, c, BLUE) - // [2354] display_info_led::tc#1 = display_vera_led::c#2 -- vbum1=vbum2 - lda c - sta display_info_led.tc - // [2355] call display_info_led - // [2380] phi from display_vera_led::@1 to display_info_led [phi:display_vera_led::@1->display_info_led] - // [2380] phi display_info_led::y#4 = $11+1 [phi:display_vera_led::@1->display_info_led#0] -- vbum1=vbuc1 - lda #$11+1 - sta display_info_led.y - // [2380] phi display_info_led::x#4 = 4-2 [phi:display_vera_led::@1->display_info_led#1] -- vbum1=vbuc1 - lda #4-2 - sta display_info_led.x - // [2380] 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 - // } - // [2356] return - rts - .segment Data - c: .byte 0 -} -.segment Code - // strcat -// Concatenates the C string pointed by source into the array pointed by destination, including the terminating null character (and stopping at that point). -// char * strcat(char *destination, __zp($38) char *source) -strcat: { - .label strcat__0 = $79 - .label dst = $79 - .label src = $38 - .label source = $38 - // strlen(destination) - // [2358] call strlen - // [2611] phi from strcat to strlen [phi:strcat->strlen] - // [2611] phi strlen::str#8 = display_chip_rom::rom [phi:strcat->strlen#0] -- pbuz1=pbuc1 - lda #display_chip_rom.rom - sta.z strlen.str+1 - jsr strlen - // strlen(destination) - // [2359] strlen::return#0 = strlen::len#2 - // strcat::@4 - // [2360] strcat::$0 = strlen::return#0 -- vwuz1=vwum2 - lda strlen.return - sta.z strcat__0 - lda strlen.return+1 - sta.z strcat__0+1 - // char* dst = destination + strlen(destination) - // [2361] strcat::dst#0 = display_chip_rom::rom + strcat::$0 -- pbuz1=pbuc1_plus_vwuz1 - lda.z dst - clc - adc #display_chip_rom.rom - sta.z dst+1 - // [2362] phi from strcat::@2 strcat::@4 to strcat::@1 [phi:strcat::@2/strcat::@4->strcat::@1] - // [2362] phi strcat::dst#2 = strcat::dst#1 [phi:strcat::@2/strcat::@4->strcat::@1#0] -- register_copy - // [2362] phi strcat::src#2 = strcat::src#1 [phi:strcat::@2/strcat::@4->strcat::@1#1] -- register_copy - // strcat::@1 - __b1: - // while(*src) - // [2363] if(0!=*strcat::src#2) goto strcat::@2 -- 0_neq__deref_pbuz1_then_la1 - ldy #0 - lda (src),y - cmp #0 - bne __b2 - // strcat::@3 - // *dst = 0 - // [2364] *strcat::dst#2 = 0 -- _deref_pbuz1=vbuc1 - tya - tay - sta (dst),y - // strcat::@return - // } - // [2365] return - rts - // strcat::@2 - __b2: - // *dst++ = *src++ - // [2366] *strcat::dst#2 = *strcat::src#2 -- _deref_pbuz1=_deref_pbuz2 - ldy #0 - lda (src),y - sta (dst),y - // *dst++ = *src++; - // [2367] strcat::dst#1 = ++ strcat::dst#2 -- pbuz1=_inc_pbuz1 - inc.z dst + inc vera_address+2 bne !+ - inc.z dst+1 + inc vera_address+3 !: - // [2368] strcat::src#1 = ++ strcat::src#2 -- pbuz1=_inc_pbuz1 - inc.z src - bne !+ - inc.z src+1 + // progress_row_current += VERA_PROGRESS_CELL + // [1600] vera_verify::progress_row_current#11 = vera_verify::progress_row_current#4 + VERA_PROGRESS_CELL -- vwum1=vwum1_plus_vbuc1 + lda #VERA_PROGRESS_CELL + clc + adc progress_row_current + sta progress_row_current + bcc !+ + inc progress_row_current+1 !: - jmp __b1 -} - // display_rom_led -/** - * @brief Print ROM led above the ROM chip. - * - * @param chip ROM chip number (0 is main rom chip of CX16) - * @param c Led color - */ -// void display_rom_led(__mem() char chip, __mem() char c) -display_rom_led: { - .label display_rom_led__0 = $60 - .label display_rom_led__7 = $60 - .label display_rom_led__8 = $60 - // chip*6 - // [2370] display_rom_led::$7 = display_rom_led::chip#2 << 1 -- vbuz1=vbum2_rol_1 - lda chip - asl - sta.z display_rom_led__7 - // [2371] display_rom_led::$8 = display_rom_led::$7 + display_rom_led::chip#2 -- vbuz1=vbuz1_plus_vbum2 - lda chip + // if (vera_bram_ptr == BRAM_HIGH) + // [1601] if(vera_verify::vera_bram_ptr#1!=$c000) goto vera_verify::@6 -- pbuz1_neq_vwuc1_then_la1 + lda.z vera_bram_ptr+1 + cmp #>$c000 + bne __b6 + lda.z vera_bram_ptr + cmp #<$c000 + bne __b6 + // vera_verify::@10 + // vera_bram_bank++; + // [1602] vera_verify::vera_bram_bank#1 = ++ vera_verify::vera_bram_bank#11 -- vbum1=_inc_vbum1 + inc vera_bram_bank + // [1603] phi from vera_verify::@10 to vera_verify::@6 [phi:vera_verify::@10->vera_verify::@6] + // [1603] phi vera_verify::vera_bram_bank#25 = vera_verify::vera_bram_bank#1 [phi:vera_verify::@10->vera_verify::@6#0] -- register_copy + // [1603] phi vera_verify::vera_bram_ptr#6 = (char *)$a000 [phi:vera_verify::@10->vera_verify::@6#1] -- pbuz1=pbuc1 + lda #<$a000 + sta.z vera_bram_ptr + lda #>$a000 + sta.z vera_bram_ptr+1 + // [1603] phi from vera_verify::@5 to vera_verify::@6 [phi:vera_verify::@5->vera_verify::@6] + // [1603] phi vera_verify::vera_bram_bank#25 = vera_verify::vera_bram_bank#11 [phi:vera_verify::@5->vera_verify::@6#0] -- register_copy + // [1603] phi vera_verify::vera_bram_ptr#6 = vera_verify::vera_bram_ptr#1 [phi:vera_verify::@5->vera_verify::@6#1] -- register_copy + // vera_verify::@6 + __b6: + // if (vera_bram_ptr == RAM_HIGH) + // [1604] if(vera_verify::vera_bram_ptr#6!=$9800) goto vera_verify::@24 -- pbuz1_neq_vwuc1_then_la1 + lda.z vera_bram_ptr+1 + cmp #>$9800 + bne __b7 + lda.z vera_bram_ptr + cmp #<$9800 + bne __b7 + // [1606] phi from vera_verify::@6 to vera_verify::@7 [phi:vera_verify::@6->vera_verify::@7] + // [1606] phi vera_verify::vera_bram_ptr#11 = (char *)$a000 [phi:vera_verify::@6->vera_verify::@7#0] -- pbuz1=pbuc1 + lda #<$a000 + sta.z vera_bram_ptr + lda #>$a000 + sta.z vera_bram_ptr+1 + // [1606] phi vera_verify::vera_bram_bank#10 = 1 [phi:vera_verify::@6->vera_verify::@7#1] -- vbum1=vbuc1 + lda #1 + sta vera_bram_bank + // [1605] phi from vera_verify::@6 to vera_verify::@24 [phi:vera_verify::@6->vera_verify::@24] + // vera_verify::@24 + // [1606] phi from vera_verify::@24 to vera_verify::@7 [phi:vera_verify::@24->vera_verify::@7] + // [1606] phi vera_verify::vera_bram_ptr#11 = vera_verify::vera_bram_ptr#6 [phi:vera_verify::@24->vera_verify::@7#0] -- register_copy + // [1606] phi vera_verify::vera_bram_bank#10 = vera_verify::vera_bram_bank#25 [phi:vera_verify::@24->vera_verify::@7#1] -- register_copy + // vera_verify::@7 + __b7: + // VERA_PROGRESS_CELL - equal_bytes + // [1607] vera_verify::$16 = VERA_PROGRESS_CELL - vera_verify::equal_bytes#0 -- vwuz1=vwuc1_minus_vwum2 + sec + lda #VERA_PROGRESS_CELL + sbc equal_bytes+1 + sta.z vera_verify__16+1 + // vera_different_bytes += (VERA_PROGRESS_CELL - equal_bytes) + // [1608] vera_verify::vera_different_bytes#1 = vera_verify::vera_different_bytes#11 + vera_verify::$16 -- vdum1=vdum1_plus_vwuz2 + lda vera_different_bytes clc - adc.z display_rom_led__8 - sta.z display_rom_led__8 - // CHIP_ROM_X+chip*6 - // [2372] display_rom_led::$0 = display_rom_led::$8 << 1 -- vbuz1=vbuz1_rol_1 - asl.z display_rom_led__0 - // display_chip_led(CHIP_ROM_X+chip*6+1, CHIP_ROM_Y, CHIP_ROM_W, c, BLUE) - // [2373] display_chip_led::x#3 = display_rom_led::$0 + $14+1 -- vbum1=vbuz2_plus_vbuc1 - lda #$14+1 - clc - adc.z display_rom_led__0 - sta display_chip_led.x - // [2374] display_chip_led::tc#2 = display_rom_led::c#2 -- vbum1=vbum2 - lda c - sta display_chip_led.tc - // [2375] call display_chip_led - // [3117] phi from display_rom_led to display_chip_led [phi:display_rom_led->display_chip_led] - // [3117] phi display_chip_led::w#7 = 3 [phi:display_rom_led->display_chip_led#0] -- vbum1=vbuc1 - lda #3 - sta display_chip_led.w - // [3117] phi display_chip_led::x#7 = display_chip_led::x#3 [phi:display_rom_led->display_chip_led#1] -- register_copy - // [3117] phi display_chip_led::tc#3 = display_chip_led::tc#2 [phi:display_rom_led->display_chip_led#2] -- register_copy - jsr display_chip_led - // display_rom_led::@1 - // display_info_led(INFO_X-2, INFO_Y+chip+2, c, BLUE) - // [2376] display_info_led::y#2 = display_rom_led::chip#2 + $11+2 -- vbum1=vbum2_plus_vbuc1 - lda #$11+2 - clc - adc chip - sta display_info_led.y - // [2377] display_info_led::tc#2 = display_rom_led::c#2 -- vbum1=vbum2 - lda c - sta display_info_led.tc - // [2378] call display_info_led - // [2380] phi from display_rom_led::@1 to display_info_led [phi:display_rom_led::@1->display_info_led] - // [2380] phi display_info_led::y#4 = display_info_led::y#2 [phi:display_rom_led::@1->display_info_led#0] -- register_copy - // [2380] phi display_info_led::x#4 = 4-2 [phi:display_rom_led::@1->display_info_led#1] -- vbum1=vbuc1 - lda #4-2 - sta display_info_led.x - // [2380] 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 - // } - // [2379] return - rts - .segment Data - chip: .byte 0 - c: .byte 0 + adc.z vera_verify__16 + sta vera_different_bytes + lda vera_different_bytes+1 + adc.z vera_verify__16+1 + sta vera_different_bytes+1 + lda vera_different_bytes+2 + adc #0 + sta vera_different_bytes+2 + lda vera_different_bytes+3 + adc #0 + sta vera_different_bytes+3 + // sprintf(info_text, "Comparing: %05x differences between RAM:%02x:%04p <-> ROM:%05x", vera_different_bytes, vera_bram_bank, vera_bram_ptr, vera_address) + // [1609] call snprintf_init + jsr snprintf_init + // [1610] phi from vera_verify::@7 to vera_verify::@15 [phi:vera_verify::@7->vera_verify::@15] + // vera_verify::@15 + // sprintf(info_text, "Comparing: %05x differences between RAM:%02x:%04p <-> ROM:%05x", vera_different_bytes, vera_bram_bank, vera_bram_ptr, vera_address) + // [1611] call printf_str + // [785] phi from vera_verify::@15 to printf_str [phi:vera_verify::@15->printf_str] + // [785] phi printf_str::putc#53 = &snputc [phi:vera_verify::@15->printf_str#0] -- pprz1=pprc1 + lda #snputc + sta.z printf_str.putc+1 + // [785] phi printf_str::s#53 = vera_verify::s [phi:vera_verify::@15->printf_str#1] -- pbuz1=pbuc1 + lda #s + sta.z printf_str.s+1 + jsr printf_str + // vera_verify::@16 + // sprintf(info_text, "Comparing: %05x differences between RAM:%02x:%04p <-> ROM:%05x", vera_different_bytes, vera_bram_bank, vera_bram_ptr, vera_address) + // [1612] printf_ulong::uvalue#0 = vera_verify::vera_different_bytes#1 -- vdum1=vdum2 + lda vera_different_bytes + sta printf_ulong.uvalue + lda vera_different_bytes+1 + sta printf_ulong.uvalue+1 + lda vera_different_bytes+2 + sta printf_ulong.uvalue+2 + lda vera_different_bytes+3 + sta printf_ulong.uvalue+3 + // [1613] call printf_ulong + // [1633] phi from vera_verify::@16 to printf_ulong [phi:vera_verify::@16->printf_ulong] + // [1633] phi printf_ulong::format_zero_padding#10 = 1 [phi:vera_verify::@16->printf_ulong#0] -- vbum1=vbuc1 + lda #1 + sta printf_ulong.format_zero_padding + // [1633] phi printf_ulong::format_min_length#10 = 5 [phi:vera_verify::@16->printf_ulong#1] -- vbum1=vbuc1 + lda #5 + sta printf_ulong.format_min_length + // [1633] phi printf_ulong::format_radix#10 = HEXADECIMAL [phi:vera_verify::@16->printf_ulong#2] -- vbum1=vbuc1 + lda #HEXADECIMAL + sta printf_ulong.format_radix + // [1633] phi printf_ulong::uvalue#10 = printf_ulong::uvalue#0 [phi:vera_verify::@16->printf_ulong#3] -- register_copy + jsr printf_ulong + // [1614] phi from vera_verify::@16 to vera_verify::@17 [phi:vera_verify::@16->vera_verify::@17] + // vera_verify::@17 + // sprintf(info_text, "Comparing: %05x differences between RAM:%02x:%04p <-> ROM:%05x", vera_different_bytes, vera_bram_bank, vera_bram_ptr, vera_address) + // [1615] call printf_str + // [785] phi from vera_verify::@17 to printf_str [phi:vera_verify::@17->printf_str] + // [785] phi printf_str::putc#53 = &snputc [phi:vera_verify::@17->printf_str#0] -- pprz1=pprc1 + lda #snputc + sta.z printf_str.putc+1 + // [785] phi printf_str::s#53 = vera_verify::s1 [phi:vera_verify::@17->printf_str#1] -- pbuz1=pbuc1 + lda #s1 + sta.z printf_str.s+1 + jsr printf_str + // vera_verify::@18 + // sprintf(info_text, "Comparing: %05x differences between RAM:%02x:%04p <-> ROM:%05x", vera_different_bytes, vera_bram_bank, vera_bram_ptr, vera_address) + // [1616] printf_uchar::uvalue#0 = vera_verify::vera_bram_bank#10 -- vbum1=vbum2 + lda vera_bram_bank + sta printf_uchar.uvalue + // [1617] call printf_uchar + // [834] phi from vera_verify::@18 to printf_uchar [phi:vera_verify::@18->printf_uchar] + // [834] phi printf_uchar::format_zero_padding#10 = 1 [phi:vera_verify::@18->printf_uchar#0] -- vbum1=vbuc1 + lda #1 + sta printf_uchar.format_zero_padding + // [834] phi printf_uchar::format_min_length#10 = 2 [phi:vera_verify::@18->printf_uchar#1] -- vbum1=vbuc1 + lda #2 + sta printf_uchar.format_min_length + // [834] phi printf_uchar::putc#10 = &snputc [phi:vera_verify::@18->printf_uchar#2] -- pprz1=pprc1 + lda #snputc + sta.z printf_uchar.putc+1 + // [834] phi printf_uchar::format_radix#10 = HEXADECIMAL [phi:vera_verify::@18->printf_uchar#3] -- vbum1=vbuc1 + lda #HEXADECIMAL + sta printf_uchar.format_radix + // [834] phi printf_uchar::uvalue#10 = printf_uchar::uvalue#0 [phi:vera_verify::@18->printf_uchar#4] -- register_copy + jsr printf_uchar + // [1618] phi from vera_verify::@18 to vera_verify::@19 [phi:vera_verify::@18->vera_verify::@19] + // vera_verify::@19 + // sprintf(info_text, "Comparing: %05x differences between RAM:%02x:%04p <-> ROM:%05x", vera_different_bytes, vera_bram_bank, vera_bram_ptr, vera_address) + // [1619] call printf_str + // [785] phi from vera_verify::@19 to printf_str [phi:vera_verify::@19->printf_str] + // [785] phi printf_str::putc#53 = &snputc [phi:vera_verify::@19->printf_str#0] -- pprz1=pprc1 + lda #snputc + sta.z printf_str.putc+1 + // [785] phi printf_str::s#53 = s2 [phi:vera_verify::@19->printf_str#1] -- pbuz1=pbuc1 + lda #s2 + sta.z printf_str.s+1 + jsr printf_str + // vera_verify::@20 + // sprintf(info_text, "Comparing: %05x differences between RAM:%02x:%04p <-> ROM:%05x", vera_different_bytes, vera_bram_bank, vera_bram_ptr, vera_address) + // [1620] printf_uint::uvalue#0 = (unsigned int)vera_verify::vera_bram_ptr#11 -- vwum1=vwuz2 + lda.z vera_bram_ptr + sta printf_uint.uvalue + lda.z vera_bram_ptr+1 + sta printf_uint.uvalue+1 + // [1621] call printf_uint + // [1433] phi from vera_verify::@20 to printf_uint [phi:vera_verify::@20->printf_uint] + // [1433] phi printf_uint::format_zero_padding#4 = 1 [phi:vera_verify::@20->printf_uint#0] -- vbum1=vbuc1 + lda #1 + sta printf_uint.format_zero_padding + // [1433] phi printf_uint::format_min_length#4 = 4 [phi:vera_verify::@20->printf_uint#1] -- vbum1=vbuc1 + lda #4 + sta printf_uint.format_min_length + // [1433] phi printf_uint::putc#4 = &snputc [phi:vera_verify::@20->printf_uint#2] -- pprz1=pprc1 + lda #snputc + sta.z printf_uint.putc+1 + // [1433] phi printf_uint::format_radix#4 = HEXADECIMAL [phi:vera_verify::@20->printf_uint#3] -- vbum1=vbuc1 + lda #HEXADECIMAL + sta printf_uint.format_radix + // [1433] phi printf_uint::uvalue#4 = printf_uint::uvalue#0 [phi:vera_verify::@20->printf_uint#4] -- register_copy + jsr printf_uint + // [1622] phi from vera_verify::@20 to vera_verify::@21 [phi:vera_verify::@20->vera_verify::@21] + // vera_verify::@21 + // sprintf(info_text, "Comparing: %05x differences between RAM:%02x:%04p <-> ROM:%05x", vera_different_bytes, vera_bram_bank, vera_bram_ptr, vera_address) + // [1623] call printf_str + // [785] phi from vera_verify::@21 to printf_str [phi:vera_verify::@21->printf_str] + // [785] phi printf_str::putc#53 = &snputc [phi:vera_verify::@21->printf_str#0] -- pprz1=pprc1 + lda #snputc + sta.z printf_str.putc+1 + // [785] phi printf_str::s#53 = vera_verify::s3 [phi:vera_verify::@21->printf_str#1] -- pbuz1=pbuc1 + lda #s3 + sta.z printf_str.s+1 + jsr printf_str + // vera_verify::@22 + // sprintf(info_text, "Comparing: %05x differences between RAM:%02x:%04p <-> ROM:%05x", vera_different_bytes, vera_bram_bank, vera_bram_ptr, vera_address) + // [1624] printf_ulong::uvalue#1 = vera_verify::vera_address#1 -- vdum1=vdum2 + lda vera_address + sta printf_ulong.uvalue + lda vera_address+1 + sta printf_ulong.uvalue+1 + lda vera_address+2 + sta printf_ulong.uvalue+2 + lda vera_address+3 + sta printf_ulong.uvalue+3 + // [1625] call printf_ulong + // [1633] phi from vera_verify::@22 to printf_ulong [phi:vera_verify::@22->printf_ulong] + // [1633] phi printf_ulong::format_zero_padding#10 = 1 [phi:vera_verify::@22->printf_ulong#0] -- vbum1=vbuc1 + lda #1 + sta printf_ulong.format_zero_padding + // [1633] phi printf_ulong::format_min_length#10 = 5 [phi:vera_verify::@22->printf_ulong#1] -- vbum1=vbuc1 + lda #5 + sta printf_ulong.format_min_length + // [1633] phi printf_ulong::format_radix#10 = HEXADECIMAL [phi:vera_verify::@22->printf_ulong#2] -- vbum1=vbuc1 + lda #HEXADECIMAL + sta printf_ulong.format_radix + // [1633] phi printf_ulong::uvalue#10 = printf_ulong::uvalue#1 [phi:vera_verify::@22->printf_ulong#3] -- register_copy + jsr printf_ulong + // vera_verify::@23 + // sprintf(info_text, "Comparing: %05x differences between RAM:%02x:%04p <-> ROM:%05x", vera_different_bytes, vera_bram_bank, vera_bram_ptr, vera_address) + // [1626] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 + lda #0 + pha + // [1627] callexecute snputc -- call_vprc1 + jsr snputc + // sideeffect stackpullpadding(1) -- _stackpullpadding_1 + pla + // display_action_text(info_text) + // [1629] call display_action_text + // [845] phi from vera_verify::@23 to display_action_text [phi:vera_verify::@23->display_action_text] + // [845] phi display_action_text::info_text#17 = info_text [phi:vera_verify::@23->display_action_text#0] -- pbuz1=pbuc1 + lda #<@info_text + sta.z display_action_text.info_text + lda #>@info_text + sta.z display_action_text.info_text+1 + jsr display_action_text + // [1581] phi from vera_verify::@23 to vera_verify::@1 [phi:vera_verify::@23->vera_verify::@1] + // [1581] phi vera_verify::y#3 = vera_verify::y#10 [phi:vera_verify::@23->vera_verify::@1#0] -- register_copy + // [1581] phi vera_verify::progress_row_current#3 = vera_verify::progress_row_current#11 [phi:vera_verify::@23->vera_verify::@1#1] -- register_copy + // [1581] phi vera_verify::vera_different_bytes#11 = vera_verify::vera_different_bytes#1 [phi:vera_verify::@23->vera_verify::@1#2] -- register_copy + // [1581] phi vera_verify::vera_bram_ptr#10 = vera_verify::vera_bram_ptr#11 [phi:vera_verify::@23->vera_verify::@1#3] -- register_copy + // [1581] phi vera_verify::vera_bram_bank#11 = vera_verify::vera_bram_bank#10 [phi:vera_verify::@23->vera_verify::@1#4] -- register_copy + // [1581] phi vera_verify::vera_address#11 = vera_verify::vera_address#1 [phi:vera_verify::@23->vera_verify::@1#5] -- register_copy + jmp __b1 + // vera_verify::@4 + __b4: + // cputc('*') + // [1630] stackpush(char) = '*' -- _stackpushbyte_=vbuc1 + lda #'*' + pha + // [1631] callexecute cputc -- call_vprc1 + jsr cputc + // sideeffect stackpullpadding(1) -- _stackpullpadding_1 + pla + jmp __b5 + .segment DataVera + info_text: .text "Comparing VERA ..." + .byte 0 + s: .text "Comparing: " + .byte 0 + s1: .text " differences between RAM:" + .byte 0 + s3: .text " <-> ROM:" + .byte 0 + vera_boundary: .dword 0 + .label equal_bytes = vera_compare.equal_bytes + y: .byte 0 + vera_address: .dword 0 + vera_bram_bank: .byte 0 + vera_different_bytes: .dword 0 + .label return = vera_different_bytes + progress_row_current: .word 0 } .segment Code - // display_info_led -/** - * @brief Print the colored led of an info line in the info frame. - * - * @param x Start X - * @param y Start Y - * @param tc Fore color - * @param bc Back color - */ -// void display_info_led(__mem() char x, __mem() char y, __mem() char tc, char bc) -display_info_led: { - // textcolor(tc) - // [2381] textcolor::color#13 = display_info_led::tc#4 -- vbum1=vbum2 - lda tc - sta textcolor.color - // [2382] call textcolor - // [784] phi from display_info_led to textcolor [phi:display_info_led->textcolor] - // [784] phi textcolor::color#23 = textcolor::color#13 [phi:display_info_led->textcolor#0] -- register_copy - jsr textcolor - // [2383] phi from display_info_led to display_info_led::@1 [phi:display_info_led->display_info_led::@1] - // display_info_led::@1 - // bgcolor(bc) - // [2384] call bgcolor - // [789] phi from display_info_led::@1 to bgcolor [phi:display_info_led::@1->bgcolor] - // [789] phi bgcolor::color#15 = BLUE [phi:display_info_led::@1->bgcolor#0] -- vbum1=vbuc1 - lda #BLUE - sta bgcolor.color - jsr bgcolor - // display_info_led::@2 - // cputcxy(x, y, VERA_CHR_UR) - // [2385] cputcxy::x#13 = display_info_led::x#4 - // [2386] cputcxy::y#13 = display_info_led::y#4 - // [2387] call cputcxy - // [2293] phi from display_info_led::@2 to cputcxy [phi:display_info_led::@2->cputcxy] - // [2293] phi cputcxy::c#17 = $7c [phi:display_info_led::@2->cputcxy#0] -- vbum1=vbuc1 - lda #$7c - sta cputcxy.c - // [2293] phi cputcxy::y#17 = cputcxy::y#13 [phi:display_info_led::@2->cputcxy#1] -- register_copy - // [2293] phi cputcxy::x#17 = cputcxy::x#13 [phi:display_info_led::@2->cputcxy#2] -- register_copy - jsr cputcxy - // [2388] 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) - // [2389] call textcolor - // [784] phi from display_info_led::@3 to textcolor [phi:display_info_led::@3->textcolor] - // [784] phi textcolor::color#23 = WHITE [phi:display_info_led::@3->textcolor#0] -- vbum1=vbuc1 - lda #WHITE - sta textcolor.color - jsr textcolor - // display_info_led::@return + // printf_ulong +// Print an unsigned int using a specific format +// void printf_ulong(void (*putc)(char), __mem() unsigned long uvalue, __mem() char format_min_length, char format_justify_left, char format_sign_always, __mem() char format_zero_padding, char format_upper_case, __mem() char format_radix) +printf_ulong: { + // printf_ulong::@1 + // printf_buffer.sign = format.sign_always?'+':0 + // [1634] *((char *)&printf_buffer) = 0 -- _deref_pbuc1=vbuc2 + // Handle any sign + lda #0 + sta printf_buffer + // ultoa(uvalue, printf_buffer.digits, format.radix) + // [1635] ultoa::value#1 = printf_ulong::uvalue#10 + // [1636] ultoa::radix#0 = printf_ulong::format_radix#10 + // [1637] call ultoa + // Format number into buffer + jsr ultoa + // printf_ulong::@2 + // printf_number_buffer(putc, printf_buffer, format) + // [1638] printf_number_buffer::buffer_sign#0 = *((char *)&printf_buffer) -- vbum1=_deref_pbuc1 + lda printf_buffer + sta printf_number_buffer.buffer_sign + // [1639] printf_number_buffer::format_min_length#0 = printf_ulong::format_min_length#10 + // [1640] printf_number_buffer::format_zero_padding#0 = printf_ulong::format_zero_padding#10 + // [1641] call printf_number_buffer + // Print using format + // [1539] phi from printf_ulong::@2 to printf_number_buffer [phi:printf_ulong::@2->printf_number_buffer] + // [1539] phi printf_number_buffer::putc#10 = &snputc [phi:printf_ulong::@2->printf_number_buffer#0] -- pprz1=pprc1 + lda #snputc + sta.z printf_number_buffer.putc+1 + // [1539] phi printf_number_buffer::buffer_sign#10 = printf_number_buffer::buffer_sign#0 [phi:printf_ulong::@2->printf_number_buffer#1] -- register_copy + // [1539] phi printf_number_buffer::format_zero_padding#10 = printf_number_buffer::format_zero_padding#0 [phi:printf_ulong::@2->printf_number_buffer#2] -- register_copy + // [1539] phi printf_number_buffer::format_min_length#3 = printf_number_buffer::format_min_length#0 [phi:printf_ulong::@2->printf_number_buffer#3] -- register_copy + jsr printf_number_buffer + // printf_ulong::@return // } - // [2390] return + // [1642] return rts .segment Data - .label tc = display_smc_led.c - .label y = cputcxy.y - .label x = cputcxy.x + uvalue: .dword 0 + format_radix: .byte 0 + .label format_min_length = printf_uchar.format_min_length + .label format_zero_padding = printf_uchar.format_zero_padding } .segment CodeVera - // vera_detect -vera_detect: { - // spi_get_jedec() - // [2392] call spi_get_jedec - // This conditional compilation ensures that only the detection interpretation happens if it is switched on. - // [3196] phi from vera_detect to spi_get_jedec [phi:vera_detect->spi_get_jedec] - jsr spi_get_jedec - // vera_detect::@return + // vera_erase +vera_erase: { + .label vera_erase__0 = $7f + // BYTE2(vera_file_size) + // [1643] vera_erase::$0 = byte2 vera_file_size#1 -- vbuz1=_byte2_vdum2 + lda vera_file_size+2 + sta.z vera_erase__0 + // unsigned char vera_total_64k_blocks = BYTE2(vera_file_size)+1 + // [1644] vera_erase::vera_total_64k_blocks#0 = vera_erase::$0 + 1 -- vbum1=vbuz2_plus_1 + inc + sta vera_total_64k_blocks + // [1645] phi from vera_erase to vera_erase::@1 [phi:vera_erase->vera_erase::@1] + // [1645] phi vera_erase::vera_current_64k_block#2 = 0 [phi:vera_erase->vera_erase::@1#0] -- vbum1=vbuc1 + lda #0 + sta vera_current_64k_block + // vera_erase::@1 + __b1: + // while(vera_current_64k_block < vera_total_64k_blocks) + // [1646] if(vera_erase::vera_current_64k_block#2vera_erase::@1] + // [1645] phi vera_erase::vera_current_64k_block#2 = vera_erase::vera_current_64k_block#1 [phi:vera_erase::@2->vera_erase::@1#0] -- register_copy + jmp __b1 + .segment DataVera + vera_total_64k_blocks: .byte 0 + vera_current_64k_block: .byte 0 } -.segment Code - // rom_unlock -/** - * @brief Unlock a byte location for flashing using the 22 bit address. - * This is a various purpose routine to unlock the ROM for flashing a byte. - * The 3rd byte can be variable, depending on the write sequence used, so this byte is a parameter into the routine. - * - * @param address The 3rd write to model the specific unlock sequence. - * @param unlock_code The 3rd write to model the specific unlock sequence. - */ -/* inline */ -// void rom_unlock(__mem() unsigned long address, __mem() char unlock_code) -rom_unlock: { - // unsigned long chip_address = address & ROM_CHIP_MASK - // [2395] rom_unlock::chip_address#0 = rom_unlock::address#5 & $380000 -- vdum1=vdum2_band_vduc1 - lda address - and #<$380000 - sta chip_address - lda address+1 - and #>$380000 - sta chip_address+1 - lda address+2 - and #<$380000>>$10 - sta chip_address+2 - lda address+3 - and #>$380000>>$10 - sta chip_address+3 - // rom_write_byte(chip_address + 0x05555, 0xAA) - // [2396] rom_write_byte::address#0 = rom_unlock::chip_address#0 + $5555 -- vdum1=vdum2_plus_vwuc1 - clc - lda chip_address - adc #<$5555 - sta rom_write_byte.address - lda chip_address+1 - adc #>$5555 - sta rom_write_byte.address+1 - lda chip_address+2 - adc #0 - sta rom_write_byte.address+2 - lda chip_address+3 - adc #0 - sta rom_write_byte.address+3 - // [2397] call rom_write_byte - // This is a very important operation... - // [3212] phi from rom_unlock to rom_write_byte [phi:rom_unlock->rom_write_byte] - // [3212] phi rom_write_byte::value#10 = $aa [phi:rom_unlock->rom_write_byte#0] -- vbum1=vbuc1 - lda #$aa - sta rom_write_byte.value - // [3212] 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) - // [2398] rom_write_byte::address#1 = rom_unlock::chip_address#0 + $2aaa -- vdum1=vdum2_plus_vwuc1 +.segment CodeVera + // vera_flash +vera_flash: { + .label vera_flash__18 = $68 + .label vera_bram_ptr = $61 + // display_action_progress("Flashing ... (-) equal, (+) flashed, (!) error.") + // [1650] call display_action_progress + // Now we compare the RAM with the actual ROM contents. + // [559] phi from vera_flash to display_action_progress [phi:vera_flash->display_action_progress] + // [559] phi display_action_progress::info_text#19 = vera_flash::info_text [phi:vera_flash->display_action_progress#0] -- pbuz1=pbuc1 + lda #info_text + sta.z display_action_progress.info_text+1 + jsr display_action_progress + // vera_flash::@14 + // [1651] spi_manufacturer#422 = spi_read::return#0 -- vbum1=vbum2 + lda spi_read.return + sta spi_manufacturer + // [1652] spi_memory_type#423 = spi_read::return#1 -- vbum1=vbum2 + lda spi_read.return_1 + sta spi_memory_type + // [1653] spi_memory_capacity#424 = spi_read::return#2 -- vbum1=vbum2 + lda spi_read.return_2 + sta spi_memory_capacity + // display_info_vera(STATUS_FLASHING, "Flashing ...") + // [1654] call display_info_vera + // [653] phi from vera_flash::@14 to display_info_vera [phi:vera_flash::@14->display_info_vera] + // [653] phi display_info_vera::info_text#19 = vera_flash::info_text1 [phi:vera_flash::@14->display_info_vera#0] -- pbuz1=pbuc1 + lda #info_text1 + sta.z display_info_vera.info_text+1 + // [653] phi spi_memory_capacity#110 = spi_memory_capacity#424 [phi:vera_flash::@14->display_info_vera#1] -- register_copy + // [653] phi spi_memory_type#111 = spi_memory_type#423 [phi:vera_flash::@14->display_info_vera#2] -- register_copy + // [653] phi spi_manufacturer#100 = spi_manufacturer#422 [phi:vera_flash::@14->display_info_vera#3] -- register_copy + // [653] phi display_info_vera::info_status#19 = STATUS_FLASHING [phi:vera_flash::@14->display_info_vera#4] -- vbum1=vbuc1 + lda #STATUS_FLASHING + sta display_info_vera.info_status + jsr display_info_vera + // [1655] phi from vera_flash::@14 to vera_flash::@1 [phi:vera_flash::@14->vera_flash::@1] + // [1655] phi vera_flash::vera_bram_ptr#10 = (char *)$a000 [phi:vera_flash::@14->vera_flash::@1#0] -- pbuz1=pbuc1 + lda #<$a000 + sta.z vera_bram_ptr + lda #>$a000 + sta.z vera_bram_ptr+1 + // [1655] phi vera_flash::vera_bram_bank#11 = 1 [phi:vera_flash::@14->vera_flash::@1#1] -- vbum1=vbuc1 + lda #1 + sta vera_bram_bank + // [1655] phi vera_flash::y_sector#14 = PROGRESS_Y [phi:vera_flash::@14->vera_flash::@1#2] -- vbum1=vbuc1 + lda #PROGRESS_Y + sta y_sector + // [1655] phi vera_flash::x_sector#14 = PROGRESS_X [phi:vera_flash::@14->vera_flash::@1#3] -- vbum1=vbuc1 + lda #PROGRESS_X + sta x_sector + // [1655] phi vera_flash::return#2 = 0 [phi:vera_flash::@14->vera_flash::@1#4] -- vdum1=vduc1 + lda #<0 + sta return + sta return+1 + lda #<0>>$10 + sta return+2 + lda #>0>>$10 + sta return+3 + // [1655] phi from vera_flash::@11 to vera_flash::@1 [phi:vera_flash::@11->vera_flash::@1] + // [1655] phi vera_flash::vera_bram_ptr#10 = vera_flash::vera_bram_ptr#18 [phi:vera_flash::@11->vera_flash::@1#0] -- register_copy + // [1655] phi vera_flash::vera_bram_bank#11 = vera_flash::vera_bram_bank#14 [phi:vera_flash::@11->vera_flash::@1#1] -- register_copy + // [1655] phi vera_flash::y_sector#14 = vera_flash::y_sector#14 [phi:vera_flash::@11->vera_flash::@1#2] -- register_copy + // [1655] phi vera_flash::x_sector#14 = vera_flash::x_sector#1 [phi:vera_flash::@11->vera_flash::@1#3] -- register_copy + // [1655] phi vera_flash::return#2 = vera_flash::vera_address_page#12 [phi:vera_flash::@11->vera_flash::@1#4] -- register_copy + // vera_flash::@1 + __b1: + // while (vera_address_page < vera_file_size) + // [1656] if(vera_flash::return#2display_action_text_flashed] + jsr display_action_text_flashed + // [1659] phi from vera_flash::@3 to vera_flash::@16 [phi:vera_flash::@3->vera_flash::@16] + // vera_flash::@16 + // wait_moment(32) + // [1660] call wait_moment + // [794] phi from vera_flash::@16 to wait_moment [phi:vera_flash::@16->wait_moment] + // [794] phi wait_moment::w#10 = $20 [phi:vera_flash::@16->wait_moment#0] -- vbum1=vbuc1 + lda #$20 + sta wait_moment.w + jsr wait_moment + // vera_flash::@return + // } + // [1661] return + rts + // vera_flash::@2 + __b2: + // unsigned long vera_page_boundary = vera_address_page + VERA_PROGRESS_PAGE + // [1662] vera_flash::vera_page_boundary#0 = vera_flash::return#2 + VERA_PROGRESS_PAGE -- vdum1=vdum2_plus_vwuc1 + // {asm{.byte $db}} clc - lda chip_address - adc #<$2aaa - sta rom_write_byte.address - lda chip_address+1 - adc #>$2aaa - sta rom_write_byte.address+1 - lda chip_address+2 + lda return + adc #VERA_PROGRESS_PAGE + sta vera_page_boundary+1 + lda return+2 adc #0 - sta rom_write_byte.address+2 - lda chip_address+3 + sta vera_page_boundary+2 + lda return+3 adc #0 - sta rom_write_byte.address+3 - // [2399] call rom_write_byte - // [3212] phi from rom_unlock::@1 to rom_write_byte [phi:rom_unlock::@1->rom_write_byte] - // [3212] phi rom_write_byte::value#10 = $55 [phi:rom_unlock::@1->rom_write_byte#0] -- vbum1=vbuc1 - lda #$55 - sta rom_write_byte.value - // [3212] 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) - // [2400] rom_write_byte::address#2 = rom_unlock::address#5 -- vdum1=vdum2 - lda address - sta rom_write_byte.address - lda address+1 - sta rom_write_byte.address+1 - lda address+2 - sta rom_write_byte.address+2 - lda address+3 - sta rom_write_byte.address+3 - // [2401] rom_write_byte::value#2 = rom_unlock::unlock_code#5 -- vbum1=vbum2 - lda unlock_code - sta rom_write_byte.value - // [2402] call rom_write_byte - // [3212] phi from rom_unlock::@2 to rom_write_byte [phi:rom_unlock::@2->rom_write_byte] - // [3212] phi rom_write_byte::value#10 = rom_write_byte::value#2 [phi:rom_unlock::@2->rom_write_byte#0] -- register_copy - // [3212] 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 - // } - // [2403] return - rts - .segment Data - chip_address: .dword 0 - address: .dword 0 - unlock_code: .byte 0 -} -.segment Code - // rom_read_byte -/** - * @brief Read a byte from the ROM using the 22 bit address. - * The lower 14 bits of the 22 bit ROM address are transformed into the **ptr_rom** 16 bit ROM address. - * The higher 8 bits of the 22 bit ROM address are transformed into the **bank_rom** 8 bit bank number. - * **bank_ptr* is used to set the bank using ZP $01. **ptr_rom** is used to read the byte. - * - * @param address The 22 bit ROM address. - * @return unsigned char The byte read from the ROM. - */ -// __mem() char rom_read_byte(__mem() unsigned long address) -rom_read_byte: { - .label rom_bank1_rom_read_byte__0 = $3a - .label rom_bank1_rom_read_byte__1 = $42 - .label rom_bank1_rom_read_byte__2 = $b6 - .label rom_ptr1_rom_read_byte__0 = $31 - .label rom_ptr1_rom_read_byte__2 = $31 - .label rom_ptr1_return = $31 - // rom_read_byte::rom_bank1 - // BYTE2(address) - // [2405] rom_read_byte::rom_bank1_$0 = byte2 rom_read_byte::address#2 -- vbuz1=_byte2_vdum2 - lda address+2 - sta.z rom_bank1_rom_read_byte__0 - // BYTE1(address) - // [2406] rom_read_byte::rom_bank1_$1 = byte1 rom_read_byte::address#2 -- vbuz1=_byte1_vdum2 - lda address+1 - sta.z rom_bank1_rom_read_byte__1 - // MAKEWORD(BYTE2(address),BYTE1(address)) - // [2407] rom_read_byte::rom_bank1_$2 = rom_read_byte::rom_bank1_$0 w= rom_read_byte::rom_bank1_$1 -- vwuz1=vbuz2_word_vbuz3 - lda.z rom_bank1_rom_read_byte__0 - sta.z rom_bank1_rom_read_byte__2+1 - lda.z rom_bank1_rom_read_byte__1 - sta.z rom_bank1_rom_read_byte__2 - // unsigned int bank_unshifted = MAKEWORD(BYTE2(address),BYTE1(address)) << 2 - // [2408] rom_read_byte::rom_bank1_bank_unshifted#0 = rom_read_byte::rom_bank1_$2 << 2 -- vwum1=vwuz2_rol_2 - asl - sta rom_bank1_bank_unshifted - lda.z rom_bank1_rom_read_byte__2+1 - rol - sta rom_bank1_bank_unshifted+1 - asl rom_bank1_bank_unshifted - rol rom_bank1_bank_unshifted+1 - // unsigned char bank = BYTE1(bank_unshifted) - // [2409] rom_read_byte::rom_bank1_return#0 = byte1 rom_read_byte::rom_bank1_bank_unshifted#0 -- vbum1=_byte1_vwum2 - lda rom_bank1_bank_unshifted+1 - sta rom_bank1_return - // rom_read_byte::rom_ptr1 - // (unsigned int)(address) & ROM_PTR_MASK - // [2410] rom_read_byte::rom_ptr1_$2 = (unsigned int)rom_read_byte::address#2 -- vwuz1=_word_vdum2 - lda address - sta.z rom_ptr1_rom_read_byte__2 - lda address+1 - sta.z rom_ptr1_rom_read_byte__2+1 - // [2411] 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 - lda.z rom_ptr1_rom_read_byte__0+1 - and #>$3fff - sta.z rom_ptr1_rom_read_byte__0+1 - // ((unsigned int)(address) & ROM_PTR_MASK) + ROM_BASE - // [2412] rom_read_byte::rom_ptr1_return#0 = rom_read_byte::rom_ptr1_$0 + $c000 -- vwuz1=vwuz1_plus_vwuc1 - lda.z rom_ptr1_return + sta vera_page_boundary+3 + // cputcxy(x,y,'.') + // [1663] cputcxy::x#0 = vera_flash::x_sector#14 -- vbum1=vbum2 + lda x_sector + sta cputcxy.x + // [1664] cputcxy::y#0 = vera_flash::y_sector#14 -- vbum1=vbum2 + lda y_sector + sta cputcxy.y + // [1665] call cputcxy + // [1346] phi from vera_flash::@2 to cputcxy [phi:vera_flash::@2->cputcxy] + // [1346] phi cputcxy::c#15 = '.' [phi:vera_flash::@2->cputcxy#0] -- vbum1=vbuc1 + lda #'.' + sta cputcxy.c + // [1346] phi cputcxy::y#15 = cputcxy::y#0 [phi:vera_flash::@2->cputcxy#1] -- register_copy + // [1346] phi cputcxy::x#15 = cputcxy::x#0 [phi:vera_flash::@2->cputcxy#2] -- register_copy + jsr cputcxy + // vera_flash::@15 + // cputc('.') + // [1666] stackpush(char) = '.' -- _stackpushbyte_=vbuc1 + lda #'.' + pha + // [1667] callexecute cputc -- call_vprc1 + jsr cputc + // sideeffect stackpullpadding(1) -- _stackpullpadding_1 + pla + // vera_flash::bank_set_bram1 + // BRAM = bank + // [1669] BRAM = vera_flash::vera_bram_bank#11 -- vbuz1=vbum2 + lda vera_bram_bank + sta.z BRAM + // [1670] vera_flash::vera_address#13 = vera_flash::return#2 -- vdum1=vdum2 + lda return + sta vera_address + lda return+1 + sta vera_address+1 + lda return+2 + sta vera_address+2 + lda return+3 + sta vera_address+3 + // [1671] phi from vera_flash::@17 vera_flash::bank_set_bram1 to vera_flash::@5 [phi:vera_flash::@17/vera_flash::bank_set_bram1->vera_flash::@5] + // [1671] phi vera_flash::vera_address_page#12 = vera_flash::vera_address_page#1 [phi:vera_flash::@17/vera_flash::bank_set_bram1->vera_flash::@5#0] -- register_copy + // [1671] phi vera_flash::vera_bram_ptr#13 = vera_flash::vera_bram_ptr#1 [phi:vera_flash::@17/vera_flash::bank_set_bram1->vera_flash::@5#1] -- register_copy + // [1671] phi vera_flash::vera_address#10 = vera_flash::vera_address#1 [phi:vera_flash::@17/vera_flash::bank_set_bram1->vera_flash::@5#2] -- register_copy + // vera_flash::@5 + __b5: + // while (vera_address < vera_page_boundary) + // [1672] if(vera_flash::vera_address#10$c000 + bne __b10 + lda.z vera_bram_ptr + cmp #<$c000 + bne __b10 + // vera_flash::@12 + // vera_bram_bank++; + // [1674] vera_flash::vera_bram_bank#1 = ++ vera_flash::vera_bram_bank#11 -- vbum1=_inc_vbum1 + inc vera_bram_bank + // [1675] phi from vera_flash::@12 to vera_flash::@10 [phi:vera_flash::@12->vera_flash::@10] + // [1675] phi vera_flash::vera_bram_bank#21 = vera_flash::vera_bram_bank#1 [phi:vera_flash::@12->vera_flash::@10#0] -- register_copy + // [1675] phi vera_flash::vera_bram_ptr#7 = (char *)$a000 [phi:vera_flash::@12->vera_flash::@10#1] -- pbuz1=pbuc1 + lda #<$a000 + sta.z vera_bram_ptr + lda #>$a000 + sta.z vera_bram_ptr+1 + // [1675] phi from vera_flash::@4 to vera_flash::@10 [phi:vera_flash::@4->vera_flash::@10] + // [1675] phi vera_flash::vera_bram_bank#21 = vera_flash::vera_bram_bank#11 [phi:vera_flash::@4->vera_flash::@10#0] -- register_copy + // [1675] phi vera_flash::vera_bram_ptr#7 = vera_flash::vera_bram_ptr#13 [phi:vera_flash::@4->vera_flash::@10#1] -- register_copy + // vera_flash::@10 + __b10: + // if (vera_bram_ptr == RAM_HIGH) + // [1676] if(vera_flash::vera_bram_ptr#7!=$9800) goto vera_flash::@18 -- pbuz1_neq_vwuc1_then_la1 + lda.z vera_bram_ptr+1 + cmp #>$9800 + bne __b11 + lda.z vera_bram_ptr + cmp #<$9800 + bne __b11 + // [1678] phi from vera_flash::@10 to vera_flash::@11 [phi:vera_flash::@10->vera_flash::@11] + // [1678] phi vera_flash::vera_bram_ptr#18 = (char *)$a000 [phi:vera_flash::@10->vera_flash::@11#0] -- pbuz1=pbuc1 + lda #<$a000 + sta.z vera_bram_ptr + lda #>$a000 + sta.z vera_bram_ptr+1 + // [1678] phi vera_flash::vera_bram_bank#14 = 1 [phi:vera_flash::@10->vera_flash::@11#1] -- vbum1=vbuc1 + lda #1 + sta vera_bram_bank + // [1677] phi from vera_flash::@10 to vera_flash::@18 [phi:vera_flash::@10->vera_flash::@18] + // vera_flash::@18 + // [1678] phi from vera_flash::@18 to vera_flash::@11 [phi:vera_flash::@18->vera_flash::@11] + // [1678] phi vera_flash::vera_bram_ptr#18 = vera_flash::vera_bram_ptr#7 [phi:vera_flash::@18->vera_flash::@11#0] -- register_copy + // [1678] phi vera_flash::vera_bram_bank#14 = vera_flash::vera_bram_bank#21 [phi:vera_flash::@18->vera_flash::@11#1] -- register_copy + // vera_flash::@11 + __b11: + // x_sector += 2 + // [1679] vera_flash::x_sector#1 = vera_flash::x_sector#14 + 2 -- vbum1=vbum1_plus_2 + lda x_sector clc - adc #<$c000 - sta.z rom_ptr1_return - lda.z rom_ptr1_return+1 - adc #>$c000 - sta.z rom_ptr1_return+1 - // rom_read_byte::bank_set_brom1 - // BROM = bank - // [2413] BROM = rom_read_byte::rom_bank1_return#0 -- vbuz1=vbum2 - lda rom_bank1_return - sta.z BROM - // rom_read_byte::@1 - // return *ptr_rom; - // [2414] rom_read_byte::return#0 = *((char *)rom_read_byte::rom_ptr1_return#0) -- vbum1=_deref_pbuz2 - ldy #0 - lda (rom_ptr1_return),y - sta return - // rom_read_byte::@return - // } - // [2415] return - rts - .segment Data - rom_bank1_bank_unshifted: .word 0 - rom_bank1_return: .byte 0 - return: .byte 0 - address: .dword 0 -} -.segment Code - // fopen -/** - * @brief Load a file to banked ram located between address 0xA000 and 0xBFFF incrementing the banks. - * - * @param channel Input channel. - * @param device Input device. - * @param secondary Secondary channel. - * @param filename Name of the file to be loaded. - * @return - * - 0x0000: Something is wrong! Kernal Error Code (https://commodore.ca/manuals/pdfs/commodore_error_messages.pdf) - * - other: OK! The last pointer between 0xA000 and 0xBFFF is returned. Note that the last pointer is indicating the first free byte. - */ -// __zp($3d) struct $2 * fopen(__zp($5a) const char *path, const char *mode) -fopen: { - .label fopen__4 = $3a - .label fopen__9 = $42 - .label fopen__11 = $43 - .label fopen__15 = $61 - .label fopen__16 = $50 - .label fopen__26 = $45 - .label fopen__28 = $4e - .label fopen__30 = $3d - .label cbm_k_setnam1_filename = $c5 - .label cbm_k_setnam1_fopen__0 = $4a - .label stream = $3d - .label pathtoken = $5a - .label pathtoken_1 = $7b - .label path = $5a - .label return = $3d - // unsigned char sp = __stdio_filecount - // [2417] fopen::sp#0 = __stdio_filecount#27 -- vbum1=vbum2 - lda __stdio_filecount - sta sp - // (unsigned int)sp | 0x8000 - // [2418] fopen::$30 = (unsigned int)fopen::sp#0 -- vwuz1=_word_vbum2 - sta.z fopen__30 - lda #0 - sta.z fopen__30+1 - // [2419] fopen::stream#0 = fopen::$30 | $8000 -- vwuz1=vwuz1_bor_vwuc1 - lda.z stream - ora #<$8000 - sta.z stream - lda.z stream+1 - ora #>$8000 - sta.z stream+1 - // char pathpos = sp * __STDIO_FILECOUNT - // [2420] fopen::pathpos#0 = fopen::sp#0 << 1 -- vbum1=vbum2_rol_1 - lda sp - asl - sta pathpos - // __logical = 0 - // [2421] ((char *)&__stdio_file+$40)[fopen::sp#0] = 0 -- pbuc1_derefidx_vbum1=vbuc2 - lda #0 - ldy sp - sta __stdio_file+$40,y - // __device = 0 - // [2422] ((char *)&__stdio_file+$42)[fopen::sp#0] = 0 -- pbuc1_derefidx_vbum1=vbuc2 - sta __stdio_file+$42,y - // __channel = 0 - // [2423] ((char *)&__stdio_file+$44)[fopen::sp#0] = 0 -- pbuc1_derefidx_vbum1=vbuc2 - sta __stdio_file+$44,y - // [2424] fopen::pathtoken#22 = fopen::pathtoken#0 -- pbuz1=pbuz2 - lda.z pathtoken - sta.z pathtoken_1 - lda.z pathtoken+1 - sta.z pathtoken_1+1 - // [2425] fopen::pathpos#21 = fopen::pathpos#0 -- vbum1=vbum2 - lda pathpos - sta pathpos_1 - // [2426] phi from fopen to fopen::@8 [phi:fopen->fopen::@8] - // [2426] phi fopen::num#10 = 0 [phi:fopen->fopen::@8#0] -- vbum1=vbuc1 - lda #0 - sta num - // [2426] phi fopen::pathpos#10 = fopen::pathpos#21 [phi:fopen->fopen::@8#1] -- register_copy - // [2426] phi fopen::path#10 = fopen::pathtoken#0 [phi:fopen->fopen::@8#2] -- register_copy - // [2426] phi fopen::pathstep#10 = 0 [phi:fopen->fopen::@8#3] -- vbum1=vbuc1 - sta pathstep - // [2426] phi fopen::pathtoken#10 = fopen::pathtoken#22 [phi:fopen->fopen::@8#4] -- register_copy - // Iterate while path is not \0. - // [2426] phi from fopen::@22 to fopen::@8 [phi:fopen::@22->fopen::@8] - // [2426] phi fopen::num#10 = fopen::num#13 [phi:fopen::@22->fopen::@8#0] -- register_copy - // [2426] phi fopen::pathpos#10 = fopen::pathpos#7 [phi:fopen::@22->fopen::@8#1] -- register_copy - // [2426] phi fopen::path#10 = fopen::path#12 [phi:fopen::@22->fopen::@8#2] -- register_copy - // [2426] phi fopen::pathstep#10 = fopen::pathstep#11 [phi:fopen::@22->fopen::@8#3] -- register_copy - // [2426] phi fopen::pathtoken#10 = fopen::pathtoken#1 [phi:fopen::@22->fopen::@8#4] -- register_copy - // fopen::@8 + adc #2 + sta x_sector + // vera_address_page % VERA_PROGRESS_ROW + // [1680] vera_flash::$18 = vera_flash::vera_address_page#12 & VERA_PROGRESS_ROW-1 -- vduz1=vdum2_band_vduc1 + lda vera_address_page + and #VERA_PROGRESS_ROW-1 + sta.z vera_flash__18+1 + lda vera_address_page+2 + and #>$10 + sta.z vera_flash__18+2 + lda vera_address_page+3 + and #>VERA_PROGRESS_ROW-1>>$10 + sta.z vera_flash__18+3 + // if (!(vera_address_page % VERA_PROGRESS_ROW)) + // [1681] if(0!=vera_flash::$18) goto vera_flash::@1 -- 0_neq_vduz1_then_la1 + lda.z vera_flash__18 + ora.z vera_flash__18+1 + ora.z vera_flash__18+2 + ora.z vera_flash__18+3 + beq !__b1+ + jmp __b1 + !__b1: + // vera_flash::@13 + // y_sector++; + // [1682] vera_flash::y_sector#1 = ++ vera_flash::y_sector#14 -- vbum1=_inc_vbum1 + inc y_sector + // [1655] phi from vera_flash::@13 to vera_flash::@1 [phi:vera_flash::@13->vera_flash::@1] + // [1655] phi vera_flash::vera_bram_ptr#10 = vera_flash::vera_bram_ptr#18 [phi:vera_flash::@13->vera_flash::@1#0] -- register_copy + // [1655] phi vera_flash::vera_bram_bank#11 = vera_flash::vera_bram_bank#14 [phi:vera_flash::@13->vera_flash::@1#1] -- register_copy + // [1655] phi vera_flash::y_sector#14 = vera_flash::y_sector#1 [phi:vera_flash::@13->vera_flash::@1#2] -- register_copy + // [1655] phi vera_flash::x_sector#14 = PROGRESS_X [phi:vera_flash::@13->vera_flash::@1#3] -- vbum1=vbuc1 + lda #PROGRESS_X + sta x_sector + // [1655] phi vera_flash::return#2 = vera_flash::vera_address_page#12 [phi:vera_flash::@13->vera_flash::@1#4] -- register_copy + jmp __b1 + // vera_flash::@6 + __b6: + // display_action_text_flashing(VERA_PROGRESS_PAGE, "VERA", vera_bram_bank, vera_bram_ptr, vera_address) + // [1683] display_action_text_flashing::bram_bank#0 = vera_flash::vera_bram_bank#11 -- vbum1=vbum2 + lda vera_bram_bank + sta display_action_text_flashing.bram_bank + // [1684] display_action_text_flashing::bram_ptr#0 = vera_flash::vera_bram_ptr#13 -- pbuz1=pbuz2 + lda.z vera_bram_ptr + sta.z display_action_text_flashing.bram_ptr + lda.z vera_bram_ptr+1 + sta.z display_action_text_flashing.bram_ptr+1 + // [1685] display_action_text_flashing::address#0 = vera_flash::vera_address#10 -- vdum1=vdum2 + lda vera_address + sta display_action_text_flashing.address + lda vera_address+1 + sta display_action_text_flashing.address+1 + lda vera_address+2 + sta display_action_text_flashing.address+2 + lda vera_address+3 + sta display_action_text_flashing.address+3 + // [1686] call display_action_text_flashing + // [2188] phi from vera_flash::@6 to display_action_text_flashing [phi:vera_flash::@6->display_action_text_flashing] + jsr display_action_text_flashing + // [1687] phi from vera_flash::@6 to vera_flash::@7 [phi:vera_flash::@6->vera_flash::@7] + // [1687] phi vera_flash::i#2 = 0 [phi:vera_flash::@6->vera_flash::@7#0] -- vwum1=vwuc1 + lda #<0 + sta i + sta i+1 + // vera_flash::@7 + __b7: + // for(unsigned int i=0; i<=255; i++) + // [1688] if(vera_flash::i#2<=$ff) goto vera_flash::@8 -- vwum1_le_vbuc1_then_la1 + lda #$ff + cmp i + bcc !+ + lda i+1 + beq __b8 + !: + // vera_flash::@9 + // cputcxy(x,y,'+') + // [1689] cputcxy::x#1 = vera_flash::x_sector#14 -- vbum1=vbum2 + lda x_sector + sta cputcxy.x + // [1690] cputcxy::y#1 = vera_flash::y_sector#14 -- vbum1=vbum2 + lda y_sector + sta cputcxy.y + // [1691] call cputcxy + // [1346] phi from vera_flash::@9 to cputcxy [phi:vera_flash::@9->cputcxy] + // [1346] phi cputcxy::c#15 = '+' [phi:vera_flash::@9->cputcxy#0] -- vbum1=vbuc1 + lda #'+' + sta cputcxy.c + // [1346] phi cputcxy::y#15 = cputcxy::y#1 [phi:vera_flash::@9->cputcxy#1] -- register_copy + // [1346] phi cputcxy::x#15 = cputcxy::x#1 [phi:vera_flash::@9->cputcxy#2] -- register_copy + jsr cputcxy + // vera_flash::@17 + // cputc('+') + // [1692] stackpush(char) = '+' -- _stackpushbyte_=vbuc1 + lda #'+' + pha + // [1693] callexecute cputc -- call_vprc1 + jsr cputc + // sideeffect stackpullpadding(1) -- _stackpullpadding_1 + pla + // vera_bram_ptr += VERA_PROGRESS_PAGE + // [1695] vera_flash::vera_bram_ptr#1 = vera_flash::vera_bram_ptr#13 + VERA_PROGRESS_PAGE -- pbuz1=pbuz1_plus_vwuc1 + lda.z vera_bram_ptr + clc + adc #VERA_PROGRESS_PAGE + sta.z vera_bram_ptr+1 + // vera_address += VERA_PROGRESS_PAGE + // [1696] vera_flash::vera_address#1 = vera_flash::vera_address#10 + VERA_PROGRESS_PAGE -- vdum1=vdum1_plus_vwuc1 + clc + lda vera_address + adc #VERA_PROGRESS_PAGE + sta vera_address+1 + lda vera_address+2 + adc #0 + sta vera_address+2 + lda vera_address+3 + adc #0 + sta vera_address+3 + // vera_address_page += VERA_PROGRESS_PAGE + // [1697] vera_flash::vera_address_page#1 = vera_flash::vera_address_page#12 + VERA_PROGRESS_PAGE -- vdum1=vdum1_plus_vwuc1 + clc + lda vera_address_page + adc #VERA_PROGRESS_PAGE + sta vera_address_page+1 + lda vera_address_page+2 + adc #0 + sta vera_address_page+2 + lda vera_address_page+3 + adc #0 + sta vera_address_page+3 + jmp __b5 + // vera_flash::@8 __b8: - // if (*pathtoken == ',' || *pathtoken == '\0') - // [2427] if(*fopen::pathtoken#10==',') goto fopen::@9 -- _deref_pbuz1_eq_vbuc1_then_la1 - lda #',' - ldy #0 - cmp (pathtoken_1),y - bne !__b9+ - jmp __b9 - !__b9: - // fopen::@33 - // [2428] 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) - // [2429] if(fopen::pathstep#10!=0) goto fopen::@10 -- vbum1_neq_0_then_la1 - lda pathstep - bne __b10 - // fopen::@24 - // __stdio_file.filename[pathpos] = *pathtoken - // [2430] ((char *)&__stdio_file)[fopen::pathpos#10] = *fopen::pathtoken#10 -- pbuc1_derefidx_vbum1=_deref_pbuz2 - lda (pathtoken_1),y - ldy pathpos_1 - sta __stdio_file,y - // pathpos++; - // [2431] fopen::pathpos#1 = ++ fopen::pathpos#10 -- vbum1=_inc_vbum1 - inc pathpos_1 - // [2432] phi from fopen::@12 fopen::@23 fopen::@24 to fopen::@10 [phi:fopen::@12/fopen::@23/fopen::@24->fopen::@10] - // [2432] phi fopen::num#13 = fopen::num#15 [phi:fopen::@12/fopen::@23/fopen::@24->fopen::@10#0] -- register_copy - // [2432] phi fopen::pathpos#7 = fopen::pathpos#10 [phi:fopen::@12/fopen::@23/fopen::@24->fopen::@10#1] -- register_copy - // [2432] phi fopen::path#12 = fopen::path#14 [phi:fopen::@12/fopen::@23/fopen::@24->fopen::@10#2] -- register_copy - // [2432] phi fopen::pathstep#11 = fopen::pathstep#1 [phi:fopen::@12/fopen::@23/fopen::@24->fopen::@10#3] -- register_copy - // fopen::@10 - __b10: - // pathtoken++; - // [2433] fopen::pathtoken#1 = ++ fopen::pathtoken#10 -- pbuz1=_inc_pbuz1 - inc.z pathtoken_1 + // for(unsigned int i=0; i<=255; i++) + // [1698] vera_flash::i#1 = ++ vera_flash::i#2 -- vwum1=_inc_vwum1 + inc i bne !+ - inc.z pathtoken_1+1 + inc i+1 !: - // fopen::@22 - // pathtoken - 1 - // [2434] fopen::$28 = fopen::pathtoken#1 - 1 -- pbuz1=pbuz2_minus_1 - lda.z pathtoken_1 - sec - sbc #1 - sta.z fopen__28 - lda.z pathtoken_1+1 - sbc #0 - sta.z fopen__28+1 - // while (*(pathtoken - 1)) - // [2435] if(0!=*fopen::$28) goto fopen::@8 -- 0_neq__deref_pbuz1_then_la1 - ldy #0 - lda (fopen__28),y - cmp #0 - bne __b8 - // fopen::@26 - // __status = 0 - // [2436] ((char *)&__stdio_file+$46)[fopen::sp#0] = 0 -- pbuc1_derefidx_vbum1=vbuc2 - tya - ldy sp - sta __stdio_file+$46,y - // if(!__logical) - // [2437] if(0!=((char *)&__stdio_file+$40)[fopen::sp#0]) goto fopen::@1 -- 0_neq_pbuc1_derefidx_vbum1_then_la1 - lda __stdio_file+$40,y - cmp #0 - bne __b1 - // fopen::@27 - // __stdio_filecount+1 - // [2438] fopen::$4 = __stdio_filecount#27 + 1 -- vbuz1=vbum2_plus_1 - lda __stdio_filecount - inc - sta.z fopen__4 - // __logical = __stdio_filecount+1 - // [2439] ((char *)&__stdio_file+$40)[fopen::sp#0] = fopen::$4 -- pbuc1_derefidx_vbum1=vbuz2 - sta __stdio_file+$40,y - // fopen::@1 + // [1687] phi from vera_flash::@8 to vera_flash::@7 [phi:vera_flash::@8->vera_flash::@7] + // [1687] phi vera_flash::i#2 = vera_flash::i#1 [phi:vera_flash::@8->vera_flash::@7#0] -- register_copy + jmp __b7 + .segment DataVera + info_text: .text "Flashing ... (-) equal, (+) flashed, (!) error." + .byte 0 + info_text1: .text "Flashing ..." + .byte 0 + chip: .text "VERA" + .byte 0 + vera_page_boundary: .dword 0 + // TODO: ERROR!!! + return: .dword 0 + i: .word 0 + vera_address: .dword 0 + .label vera_address_page = return + vera_bram_bank: .byte 0 + x_sector: .byte 0 + y_sector: .byte 0 +} +.segment Code + // display_info_roms +/** + * @brief Display all the ROM statuses. + * + * @param info_status The status. + * @param info_text The status text. + */ +// void display_info_roms(char info_status, char *info_text) +display_info_roms: { + .label info_text = 0 + // [1700] phi from display_info_roms to display_info_roms::@1 [phi:display_info_roms->display_info_roms::@1] + // [1700] phi display_info_roms::rom_chip#2 = 0 [phi:display_info_roms->display_info_roms::@1#0] -- vbum1=vbuc1 + lda #0 + sta rom_chip + // display_info_roms::@1 __b1: - // if(!__device) - // [2440] if(0!=((char *)&__stdio_file+$42)[fopen::sp#0]) goto fopen::@2 -- 0_neq_pbuc1_derefidx_vbum1_then_la1 - ldy sp - lda __stdio_file+$42,y - cmp #0 - bne __b2 - // fopen::@5 - // __device = 8 - // [2441] ((char *)&__stdio_file+$42)[fopen::sp#0] = 8 -- pbuc1_derefidx_vbum1=vbuc2 - lda #8 - sta __stdio_file+$42,y - // fopen::@2 + // for(unsigned char rom_chip=0; rom_chip<8; rom_chip++) + // [1701] if(display_info_roms::rom_chip#2<8) goto display_info_roms::@2 -- vbum1_lt_vbuc1_then_la1 + lda rom_chip + cmp #8 + bcc __b2 + // display_info_roms::@return + // } + // [1702] return + rts + // display_info_roms::@2 __b2: - // if(!__channel) - // [2442] if(0!=((char *)&__stdio_file+$44)[fopen::sp#0]) goto fopen::@3 -- 0_neq_pbuc1_derefidx_vbum1_then_la1 - ldy sp - lda __stdio_file+$44,y - cmp #0 - bne __b3 - // fopen::@6 - // __stdio_filecount+2 - // [2443] fopen::$9 = __stdio_filecount#27 + 2 -- vbuz1=vbum2_plus_2 - lda __stdio_filecount - clc - adc #2 - sta.z fopen__9 - // __channel = __stdio_filecount+2 - // [2444] ((char *)&__stdio_file+$44)[fopen::sp#0] = fopen::$9 -- pbuc1_derefidx_vbum1=vbuz2 - sta __stdio_file+$44,y - // fopen::@3 - __b3: - // __filename - // [2445] fopen::$11 = (char *)&__stdio_file + fopen::pathpos#0 -- pbuz1=pbuc1_plus_vbum2 - lda pathpos - clc - adc #<__stdio_file - sta.z fopen__11 - lda #>__stdio_file - adc #0 - sta.z fopen__11+1 - // cbm_k_setnam(__filename) - // [2446] fopen::cbm_k_setnam1_filename = fopen::$11 -- pbuz1=pbuz2 - lda.z fopen__11 - sta.z cbm_k_setnam1_filename - lda.z fopen__11+1 - sta.z cbm_k_setnam1_filename+1 - // fopen::cbm_k_setnam1 - // strlen(filename) - // [2447] strlen::str#4 = fopen::cbm_k_setnam1_filename -- pbuz1=pbuz2 - lda.z cbm_k_setnam1_filename - sta.z strlen.str - lda.z cbm_k_setnam1_filename+1 - sta.z strlen.str+1 - // [2448] call strlen - // [2611] phi from fopen::cbm_k_setnam1 to strlen [phi:fopen::cbm_k_setnam1->strlen] - // [2611] phi strlen::str#8 = strlen::str#4 [phi:fopen::cbm_k_setnam1->strlen#0] -- register_copy - jsr strlen - // strlen(filename) - // [2449] strlen::return#11 = strlen::len#2 - // fopen::@31 - // [2450] fopen::cbm_k_setnam1_$0 = strlen::return#11 -- vwuz1=vwum2 - lda strlen.return - sta.z cbm_k_setnam1_fopen__0 - lda strlen.return+1 - sta.z cbm_k_setnam1_fopen__0+1 - // char filename_len = (char)strlen(filename) - // [2451] fopen::cbm_k_setnam1_filename_len = (char)fopen::cbm_k_setnam1_$0 -- vbum1=_byte_vwuz2 - lda.z cbm_k_setnam1_fopen__0 - sta cbm_k_setnam1_filename_len - // asm - // asm { ldafilename_len ldxfilename ldyfilename+1 jsrCBM_SETNAM } - ldx cbm_k_setnam1_filename - ldy cbm_k_setnam1_filename+1 - jsr CBM_SETNAM - // fopen::@28 - // cbm_k_setlfs(__logical, __device, __channel) - // [2453] cbm_k_setlfs::channel = ((char *)&__stdio_file+$40)[fopen::sp#0] -- vbum1=pbuc1_derefidx_vbum2 - ldy sp - lda __stdio_file+$40,y - sta cbm_k_setlfs.channel - // [2454] cbm_k_setlfs::device = ((char *)&__stdio_file+$42)[fopen::sp#0] -- vbum1=pbuc1_derefidx_vbum2 - lda __stdio_file+$42,y - sta cbm_k_setlfs.device - // [2455] cbm_k_setlfs::command = ((char *)&__stdio_file+$44)[fopen::sp#0] -- vbum1=pbuc1_derefidx_vbum2 - lda __stdio_file+$44,y - sta cbm_k_setlfs.command - // [2456] call cbm_k_setlfs - jsr cbm_k_setlfs - // fopen::cbm_k_open1 - // asm - // asm { jsrCBM_OPEN } - jsr CBM_OPEN - // fopen::cbm_k_readst1 - // char status - // [2458] fopen::cbm_k_readst1_status = 0 -- vbum1=vbuc1 - lda #0 - sta cbm_k_readst1_status - // asm - // asm { jsrCBM_READST stastatus } - jsr CBM_READST - sta cbm_k_readst1_status - // return status; - // [2460] fopen::cbm_k_readst1_return#0 = fopen::cbm_k_readst1_status -- vbum1=vbum2 - sta cbm_k_readst1_return - // fopen::cbm_k_readst1_@return + // display_info_rom(rom_chip, info_status, info_text) + // [1703] display_info_rom::rom_chip#1 = display_info_roms::rom_chip#2 -- vbum1=vbum2 + lda rom_chip + sta display_info_rom.rom_chip + // [1704] call display_info_rom + // [1067] phi from display_info_roms::@2 to display_info_rom [phi:display_info_roms::@2->display_info_rom] + // [1067] phi display_info_rom::info_text#10 = display_info_roms::info_text#1 [phi:display_info_roms::@2->display_info_rom#0] -- pbuz1=pbuc1 + lda #info_text + sta.z display_info_rom.info_text+1 + // [1067] phi display_info_rom::rom_chip#10 = display_info_rom::rom_chip#1 [phi:display_info_roms::@2->display_info_rom#1] -- register_copy + // [1067] phi display_info_rom::info_status#10 = STATUS_ERROR [phi:display_info_roms::@2->display_info_rom#2] -- vbum1=vbuc1 + lda #STATUS_ERROR + sta display_info_rom.info_status + jsr display_info_rom + // display_info_roms::@3 + // for(unsigned char rom_chip=0; rom_chip<8; rom_chip++) + // [1705] display_info_roms::rom_chip#1 = ++ display_info_roms::rom_chip#2 -- vbum1=_inc_vbum1 + inc rom_chip + // [1700] phi from display_info_roms::@3 to display_info_roms::@1 [phi:display_info_roms::@3->display_info_roms::@1] + // [1700] phi display_info_roms::rom_chip#2 = display_info_roms::rom_chip#1 [phi:display_info_roms::@3->display_info_roms::@1#0] -- register_copy + jmp __b1 + .segment Data + rom_chip: .byte 0 +} +.segment CodeVera + // spi_deselect +spi_deselect: { + // *vera_reg_SPICtrl &= 0xfe + // [1706] *vera_reg_SPICtrl = *vera_reg_SPICtrl & $fe -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 + /* +.proc spi_deselect + lda Vera::Reg::SPICtrl + and #$fe + sta Vera::Reg::SPICtrl + jsr spi_read + rts +.endproc +*/ + lda #$fe + and vera_reg_SPICtrl + sta vera_reg_SPICtrl + // unsigned char value = spi_read() + // [1707] call spi_read + jsr spi_read + // spi_deselect::@return // } - // [2461] fopen::cbm_k_readst1_return#1 = fopen::cbm_k_readst1_return#0 - // fopen::@29 - // cbm_k_readst() - // [2462] fopen::$15 = fopen::cbm_k_readst1_return#1 -- vbuz1=vbum2 - sta.z fopen__15 - // __status = cbm_k_readst() - // [2463] ((char *)&__stdio_file+$46)[fopen::sp#0] = fopen::$15 -- pbuc1_derefidx_vbum1=vbuz2 - ldy sp - sta __stdio_file+$46,y - // ferror(stream) - // [2464] ferror::stream#0 = (struct $2 *)fopen::stream#0 - // [2465] call ferror - jsr ferror - // [2466] ferror::return#0 = ferror::return#1 - // fopen::@32 - // [2467] fopen::$16 = ferror::return#0 -- vwsz1=vwsm2 - lda ferror.return - sta.z fopen__16 - lda ferror.return+1 - sta.z fopen__16+1 - // if (ferror(stream)) - // [2468] if(0==fopen::$16) goto fopen::@4 -- 0_eq_vwsz1_then_la1 - lda.z fopen__16 - ora.z fopen__16+1 - beq __b4 - // fopen::@7 - // cbm_k_close(__logical) - // [2469] fopen::cbm_k_close1_channel = ((char *)&__stdio_file+$40)[fopen::sp#0] -- vbum1=pbuc1_derefidx_vbum2 - ldy sp - lda __stdio_file+$40,y - sta cbm_k_close1_channel - // fopen::cbm_k_close1 + // [1708] return + rts +} +.segment Code + // cbm_k_getin +/** + * @brief Scan a character from keyboard without pressing enter. + * + * @return char The character read. + */ +cbm_k_getin: { + // __mem unsigned char ch + // [1709] cbm_k_getin::ch = 0 -- vbum1=vbuc1 + lda #0 + sta ch // asm - // asm { ldachannel jsrCBM_CLOSE } - jsr CBM_CLOSE - // [2471] phi from fopen::cbm_k_close1 to fopen::@return [phi:fopen::cbm_k_close1->fopen::@return] - // [2471] phi __stdio_filecount#1 = __stdio_filecount#27 [phi:fopen::cbm_k_close1->fopen::@return#0] -- register_copy - // [2471] phi fopen::return#2 = 0 [phi:fopen::cbm_k_close1->fopen::@return#1] -- pssz1=vbuc1 - lda #<0 - sta.z return - sta.z return+1 - // fopen::@return + // asm { jsrCBM_GETIN stach } + jsr CBM_GETIN + sta ch + // return ch; + // [1711] cbm_k_getin::return#0 = cbm_k_getin::ch -- vbum1=vbum2 + sta return + // cbm_k_getin::@return // } - // [2472] return + // [1712] cbm_k_getin::return#1 = cbm_k_getin::return#0 + // [1713] return rts - // fopen::@4 - __b4: - // __stdio_filecount++; - // [2473] __stdio_filecount#0 = ++ __stdio_filecount#27 -- vbum1=_inc_vbum1 - inc __stdio_filecount - // [2474] fopen::return#10 = (struct $2 *)fopen::stream#0 - // [2471] phi from fopen::@4 to fopen::@return [phi:fopen::@4->fopen::@return] - // [2471] phi __stdio_filecount#1 = __stdio_filecount#0 [phi:fopen::@4->fopen::@return#0] -- register_copy - // [2471] phi fopen::return#2 = fopen::return#10 [phi:fopen::@4->fopen::@return#1] -- register_copy + .segment Data + ch: .byte 0 + return: .byte 0 +} +.segment Code + // insertup +// Insert a new line, and scroll the upper part of the screen up. +// void insertup(char rows) +insertup: { + .label insertup__0 = $32 + .label insertup__4 = $29 + .label insertup__6 = $2a + .label insertup__7 = $29 + // __conio.width+1 + // [1714] insertup::$0 = *((char *)&__conio+6) + 1 -- vbuz1=_deref_pbuc1_plus_1 + lda __conio+6 + inc + sta.z insertup__0 + // unsigned char width = (__conio.width+1) * 2 + // [1715] insertup::width#0 = insertup::$0 << 1 -- vbum1=vbuz2_rol_1 + // {asm{.byte $db}} + asl + sta width + // [1716] phi from insertup to insertup::@1 [phi:insertup->insertup::@1] + // [1716] phi insertup::y#2 = 0 [phi:insertup->insertup::@1#0] -- vbum1=vbuc1 + lda #0 + sta y + // insertup::@1 + __b1: + // for(unsigned char y=0; y<__conio.cursor_y; y++) + // [1717] if(insertup::y#2<*((char *)&__conio+1)) goto insertup::@2 -- vbum1_lt__deref_pbuc1_then_la1 + lda y + cmp __conio+1 + bcc __b2 + // [1718] phi from insertup::@1 to insertup::@3 [phi:insertup::@1->insertup::@3] + // insertup::@3 + // clearline() + // [1719] call clearline + jsr clearline + // insertup::@return + // } + // [1720] return rts - // fopen::@9 - __b9: - // if (pathstep > 0) - // [2475] if(fopen::pathstep#10>0) goto fopen::@11 -- vbum1_gt_0_then_la1 - lda pathstep - bne __b11 - // fopen::@25 - // __stdio_file.filename[pathpos] = '\0' - // [2476] ((char *)&__stdio_file)[fopen::pathpos#10] = '@' -- pbuc1_derefidx_vbum1=vbuc2 - lda #'@' - ldy pathpos_1 - sta __stdio_file,y - // path = pathtoken + 1 - // [2477] fopen::path#0 = fopen::pathtoken#10 + 1 -- pbuz1=pbuz2_plus_1 - clc - lda.z pathtoken_1 - adc #1 - sta.z path - lda.z pathtoken_1+1 - adc #0 - sta.z path+1 - // [2478] 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] - // [2478] phi fopen::num#15 = fopen::num#2 [phi:fopen::@16/fopen::@17/fopen::@18/fopen::@19/fopen::@25->fopen::@12#0] -- register_copy - // [2478] phi fopen::path#14 = fopen::path#17 [phi:fopen::@16/fopen::@17/fopen::@18/fopen::@19/fopen::@25->fopen::@12#1] -- register_copy - // fopen::@12 - __b12: - // pathstep++; - // [2479] fopen::pathstep#1 = ++ fopen::pathstep#10 -- vbum1=_inc_vbum1 - inc pathstep - jmp __b10 - // fopen::@11 - __b11: - // char pathcmp = *path - // [2480] fopen::pathcmp#0 = *fopen::path#10 -- vbum1=_deref_pbuz2 - ldy #0 - lda (path),y - sta pathcmp - // case 'D': - // [2481] if(fopen::pathcmp#0=='D') goto fopen::@13 -- vbum1_eq_vbuc1_then_la1 - lda #'D' - cmp pathcmp - beq __b13 - // fopen::@20 - // case 'L': - // [2482] if(fopen::pathcmp#0=='L') goto fopen::@13 -- vbum1_eq_vbuc1_then_la1 - lda #'L' - cmp pathcmp - beq __b13 - // fopen::@21 - // case 'C': - // num = (char)atoi(path + 1); - // path = pathtoken + 1; - // [2483] if(fopen::pathcmp#0=='C') goto fopen::@13 -- vbum1_eq_vbuc1_then_la1 - lda #'C' - cmp pathcmp - beq __b13 - // [2484] phi from fopen::@21 fopen::@30 to fopen::@14 [phi:fopen::@21/fopen::@30->fopen::@14] - // [2484] phi fopen::path#17 = fopen::path#10 [phi:fopen::@21/fopen::@30->fopen::@14#0] -- register_copy - // [2484] phi fopen::num#2 = fopen::num#10 [phi:fopen::@21/fopen::@30->fopen::@14#1] -- register_copy - // fopen::@14 - __b14: - // case 'L': - // __logical = num; - // break; - // [2485] if(fopen::pathcmp#0=='L') goto fopen::@17 -- vbum1_eq_vbuc1_then_la1 - lda #'L' - cmp pathcmp - beq __b17 - // fopen::@15 - // case 'D': - // __device = num; - // break; - // [2486] if(fopen::pathcmp#0=='D') goto fopen::@18 -- vbum1_eq_vbuc1_then_la1 - lda #'D' - cmp pathcmp - beq __b18 - // fopen::@16 - // case 'C': - // __channel = num; - // break; - // [2487] if(fopen::pathcmp#0!='C') goto fopen::@12 -- vbum1_neq_vbuc1_then_la1 - lda #'C' - cmp pathcmp - bne __b12 - // fopen::@19 - // __channel = num - // [2488] ((char *)&__stdio_file+$44)[fopen::sp#0] = fopen::num#2 -- pbuc1_derefidx_vbum1=vbum2 - lda num - ldy sp - sta __stdio_file+$44,y - jmp __b12 - // fopen::@18 - __b18: - // __device = num - // [2489] ((char *)&__stdio_file+$42)[fopen::sp#0] = fopen::num#2 -- pbuc1_derefidx_vbum1=vbum2 - lda num - ldy sp - sta __stdio_file+$42,y - jmp __b12 - // fopen::@17 - __b17: - // __logical = num - // [2490] ((char *)&__stdio_file+$40)[fopen::sp#0] = fopen::num#2 -- pbuc1_derefidx_vbum1=vbum2 - lda num - ldy sp - sta __stdio_file+$40,y - jmp __b12 - // fopen::@13 - __b13: - // atoi(path + 1) - // [2491] atoi::str#0 = fopen::path#10 + 1 -- pbuz1=pbuz1_plus_1 - inc.z atoi.str - bne !+ - inc.z atoi.str+1 - !: - // [2492] call atoi - // [3278] phi from fopen::@13 to atoi [phi:fopen::@13->atoi] - // [3278] phi atoi::str#2 = atoi::str#0 [phi:fopen::@13->atoi#0] -- register_copy - jsr atoi - // atoi(path + 1) - // [2493] atoi::return#3 = atoi::return#2 - // fopen::@30 - // [2494] fopen::$26 = atoi::return#3 -- vwsz1=vwsm2 - lda atoi.return - sta.z fopen__26 - lda atoi.return+1 - sta.z fopen__26+1 - // num = (char)atoi(path + 1) - // [2495] fopen::num#1 = (char)fopen::$26 -- vbum1=_byte_vwsz2 - lda.z fopen__26 - sta num - // path = pathtoken + 1 - // [2496] fopen::path#1 = fopen::pathtoken#10 + 1 -- pbuz1=pbuz2_plus_1 - clc - lda.z pathtoken_1 - adc #1 - sta.z path - lda.z pathtoken_1+1 - adc #0 - sta.z path+1 - jmp __b14 + // insertup::@2 + __b2: + // y+1 + // [1721] insertup::$4 = insertup::y#2 + 1 -- vbuz1=vbum2_plus_1 + lda y + inc + sta.z insertup__4 + // memcpy8_vram_vram(__conio.mapbase_bank, __conio.offsets[y], __conio.mapbase_bank, __conio.offsets[y+1], width) + // [1722] insertup::$6 = insertup::y#2 << 1 -- vbuz1=vbum2_rol_1 + lda y + asl + sta.z insertup__6 + // [1723] insertup::$7 = insertup::$4 << 1 -- vbuz1=vbuz1_rol_1 + asl.z insertup__7 + // [1724] memcpy8_vram_vram::dbank_vram#0 = *((char *)&__conio+5) -- vbum1=_deref_pbuc1 + lda __conio+5 + sta memcpy8_vram_vram.dbank_vram + // [1725] memcpy8_vram_vram::doffset_vram#0 = ((unsigned int *)&__conio+$15)[insertup::$6] -- vwum1=pwuc1_derefidx_vbuz2 + ldy.z insertup__6 + lda __conio+$15,y + sta memcpy8_vram_vram.doffset_vram + lda __conio+$15+1,y + sta memcpy8_vram_vram.doffset_vram+1 + // [1726] memcpy8_vram_vram::sbank_vram#0 = *((char *)&__conio+5) -- vbum1=_deref_pbuc1 + lda __conio+5 + sta memcpy8_vram_vram.sbank_vram + // [1727] memcpy8_vram_vram::soffset_vram#0 = ((unsigned int *)&__conio+$15)[insertup::$7] -- vwum1=pwuc1_derefidx_vbuz2 + ldy.z insertup__7 + lda __conio+$15,y + sta memcpy8_vram_vram.soffset_vram + lda __conio+$15+1,y + sta memcpy8_vram_vram.soffset_vram+1 + // [1728] memcpy8_vram_vram::num8#1 = insertup::width#0 -- vbum1=vbum2 + lda width + sta memcpy8_vram_vram.num8_1 + // [1729] call memcpy8_vram_vram + jsr memcpy8_vram_vram + // insertup::@4 + // for(unsigned char y=0; y<__conio.cursor_y; y++) + // [1730] insertup::y#1 = ++ insertup::y#2 -- vbum1=_inc_vbum1 + inc y + // [1716] phi from insertup::@4 to insertup::@1 [phi:insertup::@4->insertup::@1] + // [1716] phi insertup::y#2 = insertup::y#1 [phi:insertup::@4->insertup::@1#0] -- register_copy + jmp __b1 .segment Data - cbm_k_setnam1_filename_len: .byte 0 - cbm_k_readst1_status: .byte 0 - cbm_k_close1_channel: .byte 0 - sp: .byte 0 - pathpos: .byte 0 - pathpos_1: .byte 0 - pathcmp: .byte 0 - // Parse path - pathstep: .byte 0 - num: .byte 0 - cbm_k_readst1_return: .byte 0 + width: .byte 0 + y: .byte 0 } .segment Code - // fgets -/** - * @brief Load a file to ram or (banked ram located between address 0xA000 and 0xBFFF), incrementing the banks. - * This function uses the new CX16 macptr kernal API at address $FF44. - * - * @param sptr The pointer between 0xA000 and 0xBFFF in banked ram. - * @param size The amount of bytes to be read. - * @param filename Name of the file to be loaded. - * @return ptr the pointer advanced to the point where the stream ends. - */ -// __mem() unsigned int fgets(__zp($43) char *ptr, __mem() unsigned int size, __zp($6e) struct $2 *stream) -fgets: { - .label fgets__1 = $61 - .label fgets__8 = $3a - .label fgets__9 = $42 - .label fgets__13 = $29 - .label ptr = $43 - .label stream = $6e - // unsigned char sp = (unsigned char)stream - // [2498] fgets::sp#0 = (char)fgets::stream#4 -- vbum1=_byte_pssz2 - lda.z stream - sta sp - // cbm_k_chkin(__logical) - // [2499] fgets::cbm_k_chkin1_channel = ((char *)&__stdio_file+$40)[fgets::sp#0] -- vbum1=pbuc1_derefidx_vbum2 + // clearline +clearline: { + .label clearline__0 = $24 + .label clearline__1 = $25 + .label clearline__2 = $26 + .label clearline__3 = $23 + .label c = $22 + // unsigned int addr = __conio.offsets[__conio.cursor_y] + // [1731] clearline::$3 = *((char *)&__conio+1) << 1 -- vbuz1=_deref_pbuc1_rol_1 + lda __conio+1 + asl + sta.z clearline__3 + // [1732] clearline::addr#0 = ((unsigned int *)&__conio+$15)[clearline::$3] -- vwum1=pwuc1_derefidx_vbuz2 tay - lda __stdio_file+$40,y - sta cbm_k_chkin1_channel - // fgets::cbm_k_chkin1 - // char status - // [2500] fgets::cbm_k_chkin1_status = 0 -- vbum1=vbuc1 - lda #0 - sta cbm_k_chkin1_status - // asm - // asm { ldxchannel jsrCBM_CHKIN stastatus } - ldx cbm_k_chkin1_channel - jsr CBM_CHKIN - sta cbm_k_chkin1_status - // fgets::cbm_k_readst1 - // char status - // [2502] fgets::cbm_k_readst1_status = 0 -- vbum1=vbuc1 - lda #0 - sta cbm_k_readst1_status - // asm - // asm { jsrCBM_READST stastatus } - jsr CBM_READST - sta cbm_k_readst1_status - // return status; - // [2504] fgets::cbm_k_readst1_return#0 = fgets::cbm_k_readst1_status -- vbum1=vbum2 - sta cbm_k_readst1_return - // fgets::cbm_k_readst1_@return - // } - // [2505] fgets::cbm_k_readst1_return#1 = fgets::cbm_k_readst1_return#0 - // fgets::@11 - // cbm_k_readst() - // [2506] fgets::$1 = fgets::cbm_k_readst1_return#1 -- vbuz1=vbum2 - sta.z fgets__1 - // __status = cbm_k_readst() - // [2507] ((char *)&__stdio_file+$46)[fgets::sp#0] = fgets::$1 -- pbuc1_derefidx_vbum1=vbuz2 - ldy sp - sta __stdio_file+$46,y - // if (__status) - // [2508] if(0==((char *)&__stdio_file+$46)[fgets::sp#0]) goto fgets::@1 -- 0_eq_pbuc1_derefidx_vbum1_then_la1 - lda __stdio_file+$46,y - cmp #0 - beq __b1 - // [2509] phi from fgets::@11 fgets::@12 fgets::@5 to fgets::@return [phi:fgets::@11/fgets::@12/fgets::@5->fgets::@return] - __b8: - // [2509] phi fgets::return#1 = 0 [phi:fgets::@11/fgets::@12/fgets::@5->fgets::@return#0] -- vwum1=vbuc1 - lda #<0 - sta return - sta return+1 - // fgets::@return - // } - // [2510] return - rts - // fgets::@1 + lda __conio+$15,y + sta addr + lda __conio+$15+1,y + sta addr+1 + // *VERA_CTRL &= ~VERA_ADDRSEL + // [1733] *VERA_CTRL = *VERA_CTRL & ~VERA_ADDRSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 + lda #VERA_ADDRSEL^$ff + and VERA_CTRL + sta VERA_CTRL + // BYTE0(addr) + // [1734] clearline::$0 = byte0 clearline::addr#0 -- vbuz1=_byte0_vwum2 + lda addr + sta.z clearline__0 + // *VERA_ADDRX_L = BYTE0(addr) + // [1735] *VERA_ADDRX_L = clearline::$0 -- _deref_pbuc1=vbuz1 + sta VERA_ADDRX_L + // BYTE1(addr) + // [1736] clearline::$1 = byte1 clearline::addr#0 -- vbuz1=_byte1_vwum2 + lda addr+1 + sta.z clearline__1 + // *VERA_ADDRX_M = BYTE1(addr) + // [1737] *VERA_ADDRX_M = clearline::$1 -- _deref_pbuc1=vbuz1 + sta VERA_ADDRX_M + // __conio.mapbase_bank | VERA_INC_1 + // [1738] clearline::$2 = *((char *)&__conio+5) | VERA_INC_1 -- vbuz1=_deref_pbuc1_bor_vbuc2 + lda #VERA_INC_1 + ora __conio+5 + sta.z clearline__2 + // *VERA_ADDRX_H = __conio.mapbase_bank | VERA_INC_1 + // [1739] *VERA_ADDRX_H = clearline::$2 -- _deref_pbuc1=vbuz1 + sta VERA_ADDRX_H + // register unsigned char c=__conio.width + // [1740] clearline::c#0 = *((char *)&__conio+6) -- vbuz1=_deref_pbuc1 + lda __conio+6 + sta.z c + // [1741] phi from clearline clearline::@1 to clearline::@1 [phi:clearline/clearline::@1->clearline::@1] + // [1741] phi clearline::c#2 = clearline::c#0 [phi:clearline/clearline::@1->clearline::@1#0] -- register_copy + // clearline::@1 __b1: - // [2511] fgets::remaining#22 = fgets::size#10 -- vwum1=vwum2 - lda size - sta remaining - lda size+1 - sta remaining+1 - // [2512] phi from fgets::@1 to fgets::@2 [phi:fgets::@1->fgets::@2] - // [2512] phi fgets::read#10 = 0 [phi:fgets::@1->fgets::@2#0] -- vwum1=vwuc1 - lda #<0 - sta read - sta read+1 - // [2512] phi fgets::remaining#11 = fgets::remaining#22 [phi:fgets::@1->fgets::@2#1] -- register_copy - // [2512] phi fgets::ptr#11 = fgets::ptr#14 [phi:fgets::@1->fgets::@2#2] -- register_copy - // [2512] phi from fgets::@17 fgets::@18 to fgets::@2 [phi:fgets::@17/fgets::@18->fgets::@2] - // [2512] phi fgets::read#10 = fgets::read#1 [phi:fgets::@17/fgets::@18->fgets::@2#0] -- register_copy - // [2512] phi fgets::remaining#11 = fgets::remaining#1 [phi:fgets::@17/fgets::@18->fgets::@2#1] -- register_copy - // [2512] phi fgets::ptr#11 = fgets::ptr#15 [phi:fgets::@17/fgets::@18->fgets::@2#2] -- register_copy - // fgets::@2 - __b2: - // if (!size) - // [2513] if(0==fgets::size#10) goto fgets::@3 -- 0_eq_vwum1_then_la1 - lda size - ora size+1 - bne !__b3+ - jmp __b3 - !__b3: - // fgets::@8 - // if (remaining >= 512) - // [2514] if(fgets::remaining#11>=$200) goto fgets::@4 -- vwum1_ge_vwuc1_then_la1 - lda remaining+1 - cmp #>$200 - bcc !+ - beq !__b4+ - jmp __b4 - !__b4: - lda remaining - cmp #<$200 - bcc !__b4+ - jmp __b4 - !__b4: - !: - // fgets::@9 - // cx16_k_macptr(remaining, ptr) - // [2515] cx16_k_macptr::bytes = fgets::remaining#11 -- vbum1=vwum2 - lda remaining - sta cx16_k_macptr.bytes - // [2516] cx16_k_macptr::buffer = (void *)fgets::ptr#11 -- pvoz1=pvoz2 - lda.z ptr - sta.z cx16_k_macptr.buffer - lda.z ptr+1 - sta.z cx16_k_macptr.buffer+1 - // [2517] call cx16_k_macptr - jsr cx16_k_macptr - // [2518] cx16_k_macptr::return#4 = cx16_k_macptr::return#1 - // fgets::@15 - __b15: - // bytes = cx16_k_macptr(remaining, ptr) - // [2519] fgets::bytes#3 = cx16_k_macptr::return#4 - // [2520] phi from fgets::@13 fgets::@14 fgets::@15 to fgets::cbm_k_readst2 [phi:fgets::@13/fgets::@14/fgets::@15->fgets::cbm_k_readst2] - // [2520] phi fgets::bytes#10 = fgets::bytes#1 [phi:fgets::@13/fgets::@14/fgets::@15->fgets::cbm_k_readst2#0] -- register_copy - // fgets::cbm_k_readst2 - // char status - // [2521] fgets::cbm_k_readst2_status = 0 -- vbum1=vbuc1 - lda #0 - sta cbm_k_readst2_status - // asm - // asm { jsrCBM_READST stastatus } - jsr CBM_READST - sta cbm_k_readst2_status - // return status; - // [2523] fgets::cbm_k_readst2_return#0 = fgets::cbm_k_readst2_status -- vbum1=vbum2 - sta cbm_k_readst2_return - // fgets::cbm_k_readst2_@return + // *VERA_DATA0 = ' ' + // [1742] *VERA_DATA0 = ' ' -- _deref_pbuc1=vbuc2 + lda #' ' + sta VERA_DATA0 + // *VERA_DATA0 = __conio.color + // [1743] *VERA_DATA0 = *((char *)&__conio+$d) -- _deref_pbuc1=_deref_pbuc2 + lda __conio+$d + sta VERA_DATA0 + // c--; + // [1744] clearline::c#1 = -- clearline::c#2 -- vbuz1=_dec_vbuz1 + dec.z c + // while(c) + // [1745] if(0!=clearline::c#1) goto clearline::@1 -- 0_neq_vbuz1_then_la1 + lda.z c + bne __b1 + // clearline::@return // } - // [2524] fgets::cbm_k_readst2_return#1 = fgets::cbm_k_readst2_return#0 - // fgets::@12 - // cbm_k_readst() - // [2525] fgets::$8 = fgets::cbm_k_readst2_return#1 -- vbuz1=vbum2 - sta.z fgets__8 - // __status = cbm_k_readst() - // [2526] ((char *)&__stdio_file+$46)[fgets::sp#0] = fgets::$8 -- pbuc1_derefidx_vbum1=vbuz2 - ldy sp - sta __stdio_file+$46,y - // __status & 0xBF - // [2527] fgets::$9 = ((char *)&__stdio_file+$46)[fgets::sp#0] & $bf -- vbuz1=pbuc1_derefidx_vbum2_band_vbuc2 - lda #$bf - and __stdio_file+$46,y - sta.z fgets__9 - // if (__status & 0xBF) - // [2528] if(0==fgets::$9) goto fgets::@5 -- 0_eq_vbuz1_then_la1 - beq __b5 - jmp __b8 - // fgets::@5 - __b5: - // if (bytes == 0xFFFF) - // [2529] if(fgets::bytes#10!=$ffff) goto fgets::@6 -- vwum1_neq_vwuc1_then_la1 - lda bytes+1 - cmp #>$ffff - bne __b6 - lda bytes - cmp #<$ffff - bne __b6 - jmp __b8 - // fgets::@6 - __b6: - // read += bytes - // [2530] fgets::read#1 = fgets::read#10 + fgets::bytes#10 -- vwum1=vwum1_plus_vwum2 - clc - lda read - adc bytes - sta read - lda read+1 - adc bytes+1 - sta read+1 - // ptr += bytes - // [2531] fgets::ptr#0 = fgets::ptr#11 + fgets::bytes#10 -- pbuz1=pbuz1_plus_vwum2 - clc - lda.z ptr - adc bytes - sta.z ptr - lda.z ptr+1 - adc bytes+1 - sta.z ptr+1 - // BYTE1(ptr) - // [2532] fgets::$13 = byte1 fgets::ptr#0 -- vbuz1=_byte1_pbuz2 - sta.z fgets__13 - // if (BYTE1(ptr) == 0xC0) - // [2533] if(fgets::$13!=$c0) goto fgets::@7 -- vbuz1_neq_vbuc1_then_la1 - lda #$c0 - cmp.z fgets__13 - bne __b7 - // fgets::@10 - // ptr -= 0x2000 - // [2534] fgets::ptr#1 = fgets::ptr#0 - $2000 -- pbuz1=pbuz1_minus_vwuc1 - lda.z ptr - sec - sbc #<$2000 - sta.z ptr - lda.z ptr+1 - sbc #>$2000 - sta.z ptr+1 - // [2535] phi from fgets::@10 fgets::@6 to fgets::@7 [phi:fgets::@10/fgets::@6->fgets::@7] - // [2535] phi fgets::ptr#15 = fgets::ptr#1 [phi:fgets::@10/fgets::@6->fgets::@7#0] -- register_copy - // fgets::@7 - __b7: - // remaining -= bytes - // [2536] fgets::remaining#1 = fgets::remaining#11 - fgets::bytes#10 -- vwum1=vwum1_minus_vwum2 - lda remaining - sec - sbc bytes - sta remaining - lda remaining+1 - sbc bytes+1 - sta remaining+1 - // while ((__status == 0) && ((size && remaining) || !size)) - // [2537] if(((char *)&__stdio_file+$46)[fgets::sp#0]==0) goto fgets::@16 -- pbuc1_derefidx_vbum1_eq_0_then_la1 - ldy sp - lda __stdio_file+$46,y - cmp #0 - beq __b16 - // [2509] phi from fgets::@17 fgets::@7 to fgets::@return [phi:fgets::@17/fgets::@7->fgets::@return] - // [2509] phi fgets::return#1 = fgets::read#1 [phi:fgets::@17/fgets::@7->fgets::@return#0] -- register_copy - rts - // fgets::@16 - __b16: - // while ((__status == 0) && ((size && remaining) || !size)) - // [2538] if(0==fgets::size#10) goto fgets::@17 -- 0_eq_vwum1_then_la1 - lda size - ora size+1 - beq __b17 - // fgets::@18 - // [2539] if(0!=fgets::remaining#1) goto fgets::@2 -- 0_neq_vwum1_then_la1 - lda remaining - ora remaining+1 - beq !__b2+ - jmp __b2 - !__b2: - // fgets::@17 - __b17: - // [2540] if(0==fgets::size#10) goto fgets::@2 -- 0_eq_vwum1_then_la1 - lda size - ora size+1 - bne !__b2+ - jmp __b2 - !__b2: + // [1746] return rts - // fgets::@4 - __b4: - // cx16_k_macptr(512, ptr) - // [2541] cx16_k_macptr::bytes = $200 -- vbum1=vwuc1 - lda #<$200 - sta cx16_k_macptr.bytes - // [2542] cx16_k_macptr::buffer = (void *)fgets::ptr#11 -- pvoz1=pvoz2 - lda.z ptr - sta.z cx16_k_macptr.buffer - lda.z ptr+1 - sta.z cx16_k_macptr.buffer+1 - // [2543] call cx16_k_macptr - jsr cx16_k_macptr - // [2544] cx16_k_macptr::return#3 = cx16_k_macptr::return#1 - // fgets::@14 - // bytes = cx16_k_macptr(512, ptr) - // [2545] fgets::bytes#2 = cx16_k_macptr::return#3 - jmp __b15 - // fgets::@3 - __b3: - // cx16_k_macptr(0, ptr) - // [2546] cx16_k_macptr::bytes = 0 -- vbum1=vbuc1 - lda #0 - sta cx16_k_macptr.bytes - // [2547] cx16_k_macptr::buffer = (void *)fgets::ptr#11 -- pvoz1=pvoz2 - lda.z ptr - sta.z cx16_k_macptr.buffer - lda.z ptr+1 - sta.z cx16_k_macptr.buffer+1 - // [2548] call cx16_k_macptr - jsr cx16_k_macptr - // [2549] cx16_k_macptr::return#2 = cx16_k_macptr::return#1 - // fgets::@13 - // bytes = cx16_k_macptr(0, ptr) - // [2550] fgets::bytes#1 = cx16_k_macptr::return#2 - jmp __b15 .segment Data - cbm_k_chkin1_channel: .byte 0 - cbm_k_chkin1_status: .byte 0 - cbm_k_readst1_status: .byte 0 - cbm_k_readst2_status: .byte 0 - sp: .byte 0 - cbm_k_readst1_return: .byte 0 - .label return = read - bytes: .word 0 - cbm_k_readst2_return: .byte 0 - read: .word 0 - remaining: .word 0 - size: .word 0 + addr: .word 0 } .segment Code - // fclose + // display_frame_maskxy /** - * @brief Close a file. - * - * @param fp The FILE pointer. - * @return - * - 0x0000: Something is wrong! Kernal Error Code (https://commodore.ca/manuals/pdfs/commodore_error_messages.pdf) - * - other: OK! The last pointer between 0xA000 and 0xBFFF is returned. Note that the last pointer is indicating the first free byte. + * @brief + * + * @param x + * @param y + * @return unsigned char */ -// int fclose(__zp($c3) struct $2 *stream) -fclose: { - .label fclose__1 = $3a - .label fclose__4 = $42 - .label fclose__6 = $29 - .label stream = $c3 - // unsigned char sp = (unsigned char)stream - // [2552] fclose::sp#0 = (char)fclose::stream#3 -- vbum1=_byte_pssz2 - lda.z stream - sta sp - // cbm_k_chkin(__logical) - // [2553] fclose::cbm_k_chkin1_channel = ((char *)&__stdio_file+$40)[fclose::sp#0] -- vbum1=pbuc1_derefidx_vbum2 - tay - lda __stdio_file+$40,y - sta cbm_k_chkin1_channel - // fclose::cbm_k_chkin1 - // char status - // [2554] fclose::cbm_k_chkin1_status = 0 -- vbum1=vbuc1 - lda #0 - sta cbm_k_chkin1_status - // asm - // asm { ldxchannel jsrCBM_CHKIN stastatus } - ldx cbm_k_chkin1_channel - jsr CBM_CHKIN - sta cbm_k_chkin1_status - // fclose::cbm_k_readst1 - // char status - // [2556] fclose::cbm_k_readst1_status = 0 -- vbum1=vbuc1 - lda #0 - sta cbm_k_readst1_status - // asm - // asm { jsrCBM_READST stastatus } - jsr CBM_READST - sta cbm_k_readst1_status - // return status; - // [2558] fclose::cbm_k_readst1_return#0 = fclose::cbm_k_readst1_status -- vbum1=vbum2 - sta cbm_k_readst1_return - // fclose::cbm_k_readst1_@return - // } - // [2559] fclose::cbm_k_readst1_return#1 = fclose::cbm_k_readst1_return#0 - // fclose::@3 - // cbm_k_readst() - // [2560] fclose::$1 = fclose::cbm_k_readst1_return#1 -- vbuz1=vbum2 - sta.z fclose__1 - // __status = cbm_k_readst() - // [2561] ((char *)&__stdio_file+$46)[fclose::sp#0] = fclose::$1 -- pbuc1_derefidx_vbum1=vbuz2 - ldy sp - sta __stdio_file+$46,y - // if (__status) - // [2562] 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 +// __mem() char display_frame_maskxy(__mem() char x, __mem() char y) +display_frame_maskxy: { + .label cpeekcxy1_cpeekc1_display_frame_maskxy__0 = $38 + .label cpeekcxy1_cpeekc1_display_frame_maskxy__1 = $4e + .label cpeekcxy1_cpeekc1_display_frame_maskxy__2 = $3b + // display_frame_maskxy::cpeekcxy1 + // gotoxy(x,y) + // [1748] gotoxy::x#9 = display_frame_maskxy::cpeekcxy1_x#0 -- vbum1=vbum2 + lda cpeekcxy1_x + sta gotoxy.x + // [1749] gotoxy::y#9 = display_frame_maskxy::cpeekcxy1_y#0 -- vbum1=vbum2 + lda cpeekcxy1_y + sta gotoxy.y + // [1750] call gotoxy + // [457] phi from display_frame_maskxy::cpeekcxy1 to gotoxy [phi:display_frame_maskxy::cpeekcxy1->gotoxy] + // [457] phi gotoxy::y#26 = gotoxy::y#9 [phi:display_frame_maskxy::cpeekcxy1->gotoxy#0] -- register_copy + // [457] phi gotoxy::x#26 = gotoxy::x#9 [phi:display_frame_maskxy::cpeekcxy1->gotoxy#1] -- register_copy + jsr gotoxy + // display_frame_maskxy::cpeekcxy1_cpeekc1 + // *VERA_CTRL &= ~VERA_ADDRSEL + // [1751] *VERA_CTRL = *VERA_CTRL & ~VERA_ADDRSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 + lda #VERA_ADDRSEL^$ff + and VERA_CTRL + sta VERA_CTRL + // BYTE0(__conio.offset) + // [1752] display_frame_maskxy::cpeekcxy1_cpeekc1_$0 = byte0 *((unsigned int *)&__conio+$13) -- vbuz1=_byte0__deref_pwuc1 + lda __conio+$13 + sta.z cpeekcxy1_cpeekc1_display_frame_maskxy__0 + // *VERA_ADDRX_L = BYTE0(__conio.offset) + // [1753] *VERA_ADDRX_L = display_frame_maskxy::cpeekcxy1_cpeekc1_$0 -- _deref_pbuc1=vbuz1 + sta VERA_ADDRX_L + // BYTE1(__conio.offset) + // [1754] display_frame_maskxy::cpeekcxy1_cpeekc1_$1 = byte1 *((unsigned int *)&__conio+$13) -- vbuz1=_byte1__deref_pwuc1 + lda __conio+$13+1 + sta.z cpeekcxy1_cpeekc1_display_frame_maskxy__1 + // *VERA_ADDRX_M = BYTE1(__conio.offset) + // [1755] *VERA_ADDRX_M = display_frame_maskxy::cpeekcxy1_cpeekc1_$1 -- _deref_pbuc1=vbuz1 + sta VERA_ADDRX_M + // __conio.mapbase_bank | VERA_INC_0 + // [1756] display_frame_maskxy::cpeekcxy1_cpeekc1_$2 = *((char *)&__conio+5) -- vbuz1=_deref_pbuc1 + lda __conio+5 + sta.z cpeekcxy1_cpeekc1_display_frame_maskxy__2 + // *VERA_ADDRX_H = __conio.mapbase_bank | VERA_INC_0 + // [1757] *VERA_ADDRX_H = display_frame_maskxy::cpeekcxy1_cpeekc1_$2 -- _deref_pbuc1=vbuz1 + sta VERA_ADDRX_H + // return *VERA_DATA0; + // [1758] display_frame_maskxy::c#0 = *VERA_DATA0 -- vbum1=_deref_pbuc1 + lda VERA_DATA0 + sta c + // display_frame_maskxy::@12 + // case 0x70: // DR corner. + // return 0b0110; + // [1759] if(display_frame_maskxy::c#0==$70) goto display_frame_maskxy::@return -- vbum1_eq_vbuc1_then_la1 + lda #$70 + cmp c + beq __b2 + // display_frame_maskxy::@1 + // case 0x6E: // DL corner. + // return 0b0011; + // [1760] if(display_frame_maskxy::c#0==$6e) goto display_frame_maskxy::@return -- vbum1_eq_vbuc1_then_la1 + lda #$6e + cmp c beq __b1 - // [2563] phi from fclose::@2 fclose::@3 fclose::@4 to fclose::@return [phi:fclose::@2/fclose::@3/fclose::@4->fclose::@return] - // [2563] phi __stdio_filecount#2 = __stdio_filecount#3 [phi:fclose::@2/fclose::@3/fclose::@4->fclose::@return#0] -- register_copy - // fclose::@return - // } - // [2564] return + // display_frame_maskxy::@2 + // case 0x6D: // UR corner. + // return 0b1100; + // [1761] if(display_frame_maskxy::c#0==$6d) goto display_frame_maskxy::@return -- vbum1_eq_vbuc1_then_la1 + lda #$6d + cmp c + beq __b3 + // display_frame_maskxy::@3 + // case 0x7D: // UL corner. + // return 0b1001; + // [1762] if(display_frame_maskxy::c#0==$7d) goto display_frame_maskxy::@return -- vbum1_eq_vbuc1_then_la1 + lda #$7d + cmp c + beq __b4 + // display_frame_maskxy::@4 + // case 0x40: // HL line. + // return 0b0101; + // [1763] if(display_frame_maskxy::c#0==$40) goto display_frame_maskxy::@return -- vbum1_eq_vbuc1_then_la1 + lda #$40 + cmp c + beq __b5 + // display_frame_maskxy::@5 + // case 0x5D: // VL line. + // return 0b1010; + // [1764] if(display_frame_maskxy::c#0==$5d) goto display_frame_maskxy::@return -- vbum1_eq_vbuc1_then_la1 + lda #$5d + cmp c + beq __b6 + // display_frame_maskxy::@6 + // case 0x6B: // VR junction. + // return 0b1110; + // [1765] if(display_frame_maskxy::c#0==$6b) goto display_frame_maskxy::@return -- vbum1_eq_vbuc1_then_la1 + lda #$6b + cmp c + beq __b7 + // display_frame_maskxy::@7 + // case 0x73: // VL junction. + // return 0b1011; + // [1766] if(display_frame_maskxy::c#0==$73) goto display_frame_maskxy::@return -- vbum1_eq_vbuc1_then_la1 + lda #$73 + cmp c + beq __b8 + // display_frame_maskxy::@8 + // case 0x72: // HD junction. + // return 0b0111; + // [1767] if(display_frame_maskxy::c#0==$72) goto display_frame_maskxy::@return -- vbum1_eq_vbuc1_then_la1 + lda #$72 + cmp c + beq __b9 + // display_frame_maskxy::@9 + // case 0x71: // HU junction. + // return 0b1101; + // [1768] if(display_frame_maskxy::c#0==$71) goto display_frame_maskxy::@return -- vbum1_eq_vbuc1_then_la1 + lda #$71 + cmp c + beq __b10 + // display_frame_maskxy::@10 + // case 0x5B: // HV junction. + // return 0b1111; + // [1769] if(display_frame_maskxy::c#0==$5b) goto display_frame_maskxy::@11 -- vbum1_eq_vbuc1_then_la1 + lda #$5b + cmp c + beq __b11 + // [1771] phi from display_frame_maskxy::@10 to display_frame_maskxy::@return [phi:display_frame_maskxy::@10->display_frame_maskxy::@return] + // [1771] phi display_frame_maskxy::return#12 = 0 [phi:display_frame_maskxy::@10->display_frame_maskxy::@return#0] -- vbum1=vbuc1 + lda #0 + sta return rts - // fclose::@1 + // [1770] 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: + // [1771] phi from display_frame_maskxy::@11 to display_frame_maskxy::@return [phi:display_frame_maskxy::@11->display_frame_maskxy::@return] + // [1771] phi display_frame_maskxy::return#12 = $f [phi:display_frame_maskxy::@11->display_frame_maskxy::@return#0] -- vbum1=vbuc1 + lda #$f + sta return + rts + // [1771] phi from display_frame_maskxy::@1 to display_frame_maskxy::@return [phi:display_frame_maskxy::@1->display_frame_maskxy::@return] __b1: - // cbm_k_close(__logical) - // [2565] 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 - // asm - // asm { ldachannel jsrCBM_CLOSE } - jsr CBM_CLOSE - // fclose::cbm_k_readst2 - // char status - // [2567] fclose::cbm_k_readst2_status = 0 -- vbum1=vbuc1 - lda #0 - sta cbm_k_readst2_status - // asm - // asm { jsrCBM_READST stastatus } - jsr CBM_READST - sta cbm_k_readst2_status - // return status; - // [2569] fclose::cbm_k_readst2_return#0 = fclose::cbm_k_readst2_status -- vbum1=vbum2 - sta cbm_k_readst2_return - // fclose::cbm_k_readst2_@return + // [1771] phi display_frame_maskxy::return#12 = 3 [phi:display_frame_maskxy::@1->display_frame_maskxy::@return#0] -- vbum1=vbuc1 + lda #3 + sta return + rts + // [1771] phi from display_frame_maskxy::@12 to display_frame_maskxy::@return [phi:display_frame_maskxy::@12->display_frame_maskxy::@return] + __b2: + // [1771] phi display_frame_maskxy::return#12 = 6 [phi:display_frame_maskxy::@12->display_frame_maskxy::@return#0] -- vbum1=vbuc1 + lda #6 + sta return + rts + // [1771] phi from display_frame_maskxy::@2 to display_frame_maskxy::@return [phi:display_frame_maskxy::@2->display_frame_maskxy::@return] + __b3: + // [1771] phi display_frame_maskxy::return#12 = $c [phi:display_frame_maskxy::@2->display_frame_maskxy::@return#0] -- vbum1=vbuc1 + lda #$c + sta return + rts + // [1771] phi from display_frame_maskxy::@3 to display_frame_maskxy::@return [phi:display_frame_maskxy::@3->display_frame_maskxy::@return] + __b4: + // [1771] phi display_frame_maskxy::return#12 = 9 [phi:display_frame_maskxy::@3->display_frame_maskxy::@return#0] -- vbum1=vbuc1 + lda #9 + sta return + rts + // [1771] phi from display_frame_maskxy::@4 to display_frame_maskxy::@return [phi:display_frame_maskxy::@4->display_frame_maskxy::@return] + __b5: + // [1771] phi display_frame_maskxy::return#12 = 5 [phi:display_frame_maskxy::@4->display_frame_maskxy::@return#0] -- vbum1=vbuc1 + lda #5 + sta return + rts + // [1771] phi from display_frame_maskxy::@5 to display_frame_maskxy::@return [phi:display_frame_maskxy::@5->display_frame_maskxy::@return] + __b6: + // [1771] phi display_frame_maskxy::return#12 = $a [phi:display_frame_maskxy::@5->display_frame_maskxy::@return#0] -- vbum1=vbuc1 + lda #$a + sta return + rts + // [1771] phi from display_frame_maskxy::@6 to display_frame_maskxy::@return [phi:display_frame_maskxy::@6->display_frame_maskxy::@return] + __b7: + // [1771] phi display_frame_maskxy::return#12 = $e [phi:display_frame_maskxy::@6->display_frame_maskxy::@return#0] -- vbum1=vbuc1 + lda #$e + sta return + rts + // [1771] phi from display_frame_maskxy::@7 to display_frame_maskxy::@return [phi:display_frame_maskxy::@7->display_frame_maskxy::@return] + __b8: + // [1771] phi display_frame_maskxy::return#12 = $b [phi:display_frame_maskxy::@7->display_frame_maskxy::@return#0] -- vbum1=vbuc1 + lda #$b + sta return + rts + // [1771] phi from display_frame_maskxy::@8 to display_frame_maskxy::@return [phi:display_frame_maskxy::@8->display_frame_maskxy::@return] + __b9: + // [1771] phi display_frame_maskxy::return#12 = 7 [phi:display_frame_maskxy::@8->display_frame_maskxy::@return#0] -- vbum1=vbuc1 + lda #7 + sta return + rts + // [1771] phi from display_frame_maskxy::@9 to display_frame_maskxy::@return [phi:display_frame_maskxy::@9->display_frame_maskxy::@return] + __b10: + // [1771] phi display_frame_maskxy::return#12 = $d [phi:display_frame_maskxy::@9->display_frame_maskxy::@return#0] -- vbum1=vbuc1 + lda #$d + sta return + // display_frame_maskxy::@return // } - // [2570] fclose::cbm_k_readst2_return#1 = fclose::cbm_k_readst2_return#0 - // fclose::@4 - // cbm_k_readst() - // [2571] fclose::$4 = fclose::cbm_k_readst2_return#1 -- vbuz1=vbum2 - sta.z fclose__4 - // __status = cbm_k_readst() - // [2572] ((char *)&__stdio_file+$46)[fclose::sp#0] = fclose::$4 -- pbuc1_derefidx_vbum1=vbuz2 - ldy sp - sta __stdio_file+$46,y - // if (__status) - // [2573] 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 + // [1772] return + rts + .segment Data + cpeekcxy1_x: .byte 0 + cpeekcxy1_y: .byte 0 + c: .byte 0 + // DR corner. + // DL corner. + // UR corner. + // UL corner. + // HL line. + // VL line. + // VR junction. + // VL junction. + // HD junction. + // HU junction. + // HV junction. + return: .byte 0 + .label x = cpeekcxy1_x + .label y = cpeekcxy1_y +} +.segment Code + // display_frame_char +/** + * @brief + * + * @param mask + * @return unsigned char + */ +// __mem() char display_frame_char(__mem() char mask) +display_frame_char: { + // case 0b0110: + // return 0x70; + // [1774] if(display_frame_char::mask#10==6) goto display_frame_char::@return -- vbum1_eq_vbuc1_then_la1 + lda #6 + cmp mask + beq __b1 + // display_frame_char::@1 + // case 0b0011: + // return 0x6E; + // [1775] if(display_frame_char::mask#10==3) goto display_frame_char::@return -- vbum1_eq_vbuc1_then_la1 + // DR corner. + lda #3 + cmp mask beq __b2 + // display_frame_char::@2 + // case 0b1100: + // return 0x6D; + // [1776] if(display_frame_char::mask#10==$c) goto display_frame_char::@return -- vbum1_eq_vbuc1_then_la1 + // DL corner. + lda #$c + cmp mask + beq __b3 + // display_frame_char::@3 + // case 0b1001: + // return 0x7D; + // [1777] if(display_frame_char::mask#10==9) goto display_frame_char::@return -- vbum1_eq_vbuc1_then_la1 + // UR corner. + lda #9 + cmp mask + beq __b4 + // display_frame_char::@4 + // case 0b0101: + // return 0x40; + // [1778] if(display_frame_char::mask#10==5) goto display_frame_char::@return -- vbum1_eq_vbuc1_then_la1 + // UL corner. + lda #5 + cmp mask + beq __b5 + // display_frame_char::@5 + // case 0b1010: + // return 0x5D; + // [1779] if(display_frame_char::mask#10==$a) goto display_frame_char::@return -- vbum1_eq_vbuc1_then_la1 + // HL line. + lda #$a + cmp mask + beq __b6 + // display_frame_char::@6 + // case 0b1110: + // return 0x6B; + // [1780] if(display_frame_char::mask#10==$e) goto display_frame_char::@return -- vbum1_eq_vbuc1_then_la1 + // VL line. + lda #$e + cmp mask + beq __b7 + // display_frame_char::@7 + // case 0b1011: + // return 0x73; + // [1781] if(display_frame_char::mask#10==$b) goto display_frame_char::@return -- vbum1_eq_vbuc1_then_la1 + // VR junction. + lda #$b + cmp mask + beq __b8 + // display_frame_char::@8 + // case 0b0111: + // return 0x72; + // [1782] if(display_frame_char::mask#10==7) goto display_frame_char::@return -- vbum1_eq_vbuc1_then_la1 + // VL junction. + lda #7 + cmp mask + beq __b9 + // display_frame_char::@9 + // case 0b1101: + // return 0x71; + // [1783] if(display_frame_char::mask#10==$d) goto display_frame_char::@return -- vbum1_eq_vbuc1_then_la1 + // HD junction. + lda #$d + cmp mask + beq __b10 + // display_frame_char::@10 + // case 0b1111: + // return 0x5B; + // [1784] if(display_frame_char::mask#10==$f) goto display_frame_char::@11 -- vbum1_eq_vbuc1_then_la1 + // HU junction. + lda #$f + cmp mask + beq __b11 + // [1786] phi from display_frame_char::@10 to display_frame_char::@return [phi:display_frame_char::@10->display_frame_char::@return] + // [1786] phi display_frame_char::return#12 = $20 [phi:display_frame_char::@10->display_frame_char::@return#0] -- vbum1=vbuc1 + lda #$20 + sta return rts - // fclose::@2 + // [1785] 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: + // [1786] phi from display_frame_char::@11 to display_frame_char::@return [phi:display_frame_char::@11->display_frame_char::@return] + // [1786] phi display_frame_char::return#12 = $5b [phi:display_frame_char::@11->display_frame_char::@return#0] -- vbum1=vbuc1 + lda #$5b + sta return + rts + // [1786] phi from display_frame_char to display_frame_char::@return [phi:display_frame_char->display_frame_char::@return] + __b1: + // [1786] phi display_frame_char::return#12 = $70 [phi:display_frame_char->display_frame_char::@return#0] -- vbum1=vbuc1 + lda #$70 + sta return + rts + // [1786] phi from display_frame_char::@1 to display_frame_char::@return [phi:display_frame_char::@1->display_frame_char::@return] __b2: - // __logical = 0 - // [2574] ((char *)&__stdio_file+$40)[fclose::sp#0] = 0 -- pbuc1_derefidx_vbum1=vbuc2 - lda #0 - ldy sp - sta __stdio_file+$40,y - // __device = 0 - // [2575] ((char *)&__stdio_file+$42)[fclose::sp#0] = 0 -- pbuc1_derefidx_vbum1=vbuc2 - sta __stdio_file+$42,y - // __channel = 0 - // [2576] ((char *)&__stdio_file+$44)[fclose::sp#0] = 0 -- pbuc1_derefidx_vbum1=vbuc2 - sta __stdio_file+$44,y - // __filename - // [2577] fclose::$6 = fclose::sp#0 << 1 -- vbuz1=vbum2_rol_1 - tya - asl - sta.z fclose__6 - // *__filename = '\0' - // [2578] ((char *)&__stdio_file)[fclose::$6] = '@' -- pbuc1_derefidx_vbuz1=vbuc2 - lda #'@' - ldy.z fclose__6 - sta __stdio_file,y - // __stdio_filecount--; - // [2579] __stdio_filecount#3 = -- __stdio_filecount#1 -- vbum1=_dec_vbum1 - dec __stdio_filecount + // [1786] phi display_frame_char::return#12 = $6e [phi:display_frame_char::@1->display_frame_char::@return#0] -- vbum1=vbuc1 + lda #$6e + sta return + rts + // [1786] phi from display_frame_char::@2 to display_frame_char::@return [phi:display_frame_char::@2->display_frame_char::@return] + __b3: + // [1786] phi display_frame_char::return#12 = $6d [phi:display_frame_char::@2->display_frame_char::@return#0] -- vbum1=vbuc1 + lda #$6d + sta return + rts + // [1786] phi from display_frame_char::@3 to display_frame_char::@return [phi:display_frame_char::@3->display_frame_char::@return] + __b4: + // [1786] phi display_frame_char::return#12 = $7d [phi:display_frame_char::@3->display_frame_char::@return#0] -- vbum1=vbuc1 + lda #$7d + sta return + rts + // [1786] phi from display_frame_char::@4 to display_frame_char::@return [phi:display_frame_char::@4->display_frame_char::@return] + __b5: + // [1786] phi display_frame_char::return#12 = $40 [phi:display_frame_char::@4->display_frame_char::@return#0] -- vbum1=vbuc1 + lda #$40 + sta return + rts + // [1786] phi from display_frame_char::@5 to display_frame_char::@return [phi:display_frame_char::@5->display_frame_char::@return] + __b6: + // [1786] phi display_frame_char::return#12 = $5d [phi:display_frame_char::@5->display_frame_char::@return#0] -- vbum1=vbuc1 + lda #$5d + sta return + rts + // [1786] phi from display_frame_char::@6 to display_frame_char::@return [phi:display_frame_char::@6->display_frame_char::@return] + __b7: + // [1786] phi display_frame_char::return#12 = $6b [phi:display_frame_char::@6->display_frame_char::@return#0] -- vbum1=vbuc1 + lda #$6b + sta return + rts + // [1786] phi from display_frame_char::@7 to display_frame_char::@return [phi:display_frame_char::@7->display_frame_char::@return] + __b8: + // [1786] phi display_frame_char::return#12 = $73 [phi:display_frame_char::@7->display_frame_char::@return#0] -- vbum1=vbuc1 + lda #$73 + sta return + rts + // [1786] phi from display_frame_char::@8 to display_frame_char::@return [phi:display_frame_char::@8->display_frame_char::@return] + __b9: + // [1786] phi display_frame_char::return#12 = $72 [phi:display_frame_char::@8->display_frame_char::@return#0] -- vbum1=vbuc1 + lda #$72 + sta return + rts + // [1786] phi from display_frame_char::@9 to display_frame_char::@return [phi:display_frame_char::@9->display_frame_char::@return] + __b10: + // [1786] phi display_frame_char::return#12 = $71 [phi:display_frame_char::@9->display_frame_char::@return#0] -- vbum1=vbuc1 + lda #$71 + sta return + // display_frame_char::@return + // } + // [1787] return rts .segment Data - cbm_k_chkin1_channel: .byte 0 - cbm_k_chkin1_status: .byte 0 - cbm_k_readst1_status: .byte 0 - cbm_k_close1_channel: .byte 0 - cbm_k_readst2_status: .byte 0 - sp: .byte 0 - cbm_k_readst1_return: .byte 0 - cbm_k_readst2_return: .byte 0 -} -.segment Code - // display_action_text_reading -// void display_action_text_reading(__zp($50) char *action, __zp($70) char *file, __mem() unsigned long bytes, __mem() unsigned long size, __mem() char bram_bank, __zp($72) char *bram_ptr) -display_action_text_reading: { - .label action = $50 - .label bram_ptr = $72 - .label file = $70 - // sprintf(info_text, "%s %s:%05x/%05x -> RAM:%02x:%04p ...", action, file, bytes, size, bram_bank, bram_ptr) - // [2581] call snprintf_init - // [1205] phi from display_action_text_reading to snprintf_init [phi:display_action_text_reading->snprintf_init] - // [1205] phi snprintf_init::s#31 = info_text [phi:display_action_text_reading->snprintf_init#0] -- pbuz1=pbuc1 - lda #info_text - sta.z snprintf_init.s+1 - jsr snprintf_init - // display_action_text_reading::@1 - // sprintf(info_text, "%s %s:%05x/%05x -> RAM:%02x:%04p ...", action, file, bytes, size, bram_bank, bram_ptr) - // [2582] printf_string::str#14 = display_action_text_reading::action#3 - // [2583] call printf_string - // [1219] phi from display_action_text_reading::@1 to printf_string [phi:display_action_text_reading::@1->printf_string] - // [1219] phi printf_string::putc#26 = &snputc [phi:display_action_text_reading::@1->printf_string#0] -- pprz1=pprc1 - lda #snputc - sta.z printf_string.putc+1 - // [1219] phi printf_string::str#26 = printf_string::str#14 [phi:display_action_text_reading::@1->printf_string#1] -- register_copy - // [1219] phi printf_string::format_justify_left#26 = 0 [phi:display_action_text_reading::@1->printf_string#2] -- vbum1=vbuc1 - lda #0 - sta printf_string.format_justify_left - // [1219] phi printf_string::format_min_length#26 = 0 [phi:display_action_text_reading::@1->printf_string#3] -- vbum1=vbuc1 - sta printf_string.format_min_length - jsr printf_string - // [2584] phi from display_action_text_reading::@1 to display_action_text_reading::@2 [phi:display_action_text_reading::@1->display_action_text_reading::@2] - // display_action_text_reading::@2 - // sprintf(info_text, "%s %s:%05x/%05x -> RAM:%02x:%04p ...", action, file, bytes, size, bram_bank, bram_ptr) - // [2585] call printf_str - // [1210] phi from display_action_text_reading::@2 to printf_str [phi:display_action_text_reading::@2->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:display_action_text_reading::@2->printf_str#0] -- pprz1=pprc1 - lda #snputc - sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = s4 [phi:display_action_text_reading::@2->printf_str#1] -- pbuz1=pbuc1 - lda #s4 - sta.z printf_str.s+1 - jsr printf_str - // display_action_text_reading::@3 - // sprintf(info_text, "%s %s:%05x/%05x -> RAM:%02x:%04p ...", action, file, bytes, size, bram_bank, bram_ptr) - // [2586] printf_string::str#15 = display_action_text_reading::file#3 -- pbuz1=pbuz2 - lda.z file - sta.z printf_string.str - lda.z file+1 - sta.z printf_string.str+1 - // [2587] call printf_string - // [1219] phi from display_action_text_reading::@3 to printf_string [phi:display_action_text_reading::@3->printf_string] - // [1219] phi printf_string::putc#26 = &snputc [phi:display_action_text_reading::@3->printf_string#0] -- pprz1=pprc1 - lda #snputc - sta.z printf_string.putc+1 - // [1219] phi printf_string::str#26 = printf_string::str#15 [phi:display_action_text_reading::@3->printf_string#1] -- register_copy - // [1219] phi printf_string::format_justify_left#26 = 0 [phi:display_action_text_reading::@3->printf_string#2] -- vbum1=vbuc1 - lda #0 - sta printf_string.format_justify_left - // [1219] phi printf_string::format_min_length#26 = 0 [phi:display_action_text_reading::@3->printf_string#3] -- vbum1=vbuc1 - sta printf_string.format_min_length - jsr printf_string - // [2588] phi from display_action_text_reading::@3 to display_action_text_reading::@4 [phi:display_action_text_reading::@3->display_action_text_reading::@4] - // display_action_text_reading::@4 - // sprintf(info_text, "%s %s:%05x/%05x -> RAM:%02x:%04p ...", action, file, bytes, size, bram_bank, bram_ptr) - // [2589] call printf_str - // [1210] phi from display_action_text_reading::@4 to printf_str [phi:display_action_text_reading::@4->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:display_action_text_reading::@4->printf_str#0] -- pprz1=pprc1 - lda #snputc - sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = s2 [phi:display_action_text_reading::@4->printf_str#1] -- pbuz1=pbuc1 - lda #<@s2 - sta.z printf_str.s - lda #>@s2 - sta.z printf_str.s+1 - jsr printf_str - // display_action_text_reading::@5 - // sprintf(info_text, "%s %s:%05x/%05x -> RAM:%02x:%04p ...", action, file, bytes, size, bram_bank, bram_ptr) - // [2590] printf_ulong::uvalue#5 = display_action_text_reading::bytes#3 - // [2591] call printf_ulong - // [1741] phi from display_action_text_reading::@5 to printf_ulong [phi:display_action_text_reading::@5->printf_ulong] - // [1741] phi printf_ulong::format_zero_padding#15 = 1 [phi:display_action_text_reading::@5->printf_ulong#0] -- vbum1=vbuc1 - lda #1 - sta printf_ulong.format_zero_padding - // [1741] phi printf_ulong::format_min_length#15 = 5 [phi:display_action_text_reading::@5->printf_ulong#1] -- vbum1=vbuc1 - lda #5 - sta printf_ulong.format_min_length - // [1741] phi printf_ulong::format_radix#15 = HEXADECIMAL [phi:display_action_text_reading::@5->printf_ulong#2] -- vbum1=vbuc1 - lda #HEXADECIMAL - sta printf_ulong.format_radix - // [1741] phi printf_ulong::uvalue#15 = printf_ulong::uvalue#5 [phi:display_action_text_reading::@5->printf_ulong#3] -- register_copy - jsr printf_ulong - // [2592] phi from display_action_text_reading::@5 to display_action_text_reading::@6 [phi:display_action_text_reading::@5->display_action_text_reading::@6] - // display_action_text_reading::@6 - // sprintf(info_text, "%s %s:%05x/%05x -> RAM:%02x:%04p ...", action, file, bytes, size, bram_bank, bram_ptr) - // [2593] call printf_str - // [1210] phi from display_action_text_reading::@6 to printf_str [phi:display_action_text_reading::@6->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:display_action_text_reading::@6->printf_str#0] -- pprz1=pprc1 - lda #snputc - sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = display_action_text_reading::s2 [phi:display_action_text_reading::@6->printf_str#1] -- pbuz1=pbuc1 - lda #s2 - sta.z printf_str.s+1 - jsr printf_str - // display_action_text_reading::@7 - // sprintf(info_text, "%s %s:%05x/%05x -> RAM:%02x:%04p ...", action, file, bytes, size, bram_bank, bram_ptr) - // [2594] printf_ulong::uvalue#6 = display_action_text_reading::size#10 -- vdum1=vdum2 - lda size - sta printf_ulong.uvalue - lda size+1 - sta printf_ulong.uvalue+1 - lda size+2 - sta printf_ulong.uvalue+2 - lda size+3 - sta printf_ulong.uvalue+3 - // [2595] call printf_ulong - // [1741] phi from display_action_text_reading::@7 to printf_ulong [phi:display_action_text_reading::@7->printf_ulong] - // [1741] phi printf_ulong::format_zero_padding#15 = 1 [phi:display_action_text_reading::@7->printf_ulong#0] -- vbum1=vbuc1 - lda #1 - sta printf_ulong.format_zero_padding - // [1741] phi printf_ulong::format_min_length#15 = 5 [phi:display_action_text_reading::@7->printf_ulong#1] -- vbum1=vbuc1 - lda #5 - sta printf_ulong.format_min_length - // [1741] phi printf_ulong::format_radix#15 = HEXADECIMAL [phi:display_action_text_reading::@7->printf_ulong#2] -- vbum1=vbuc1 - lda #HEXADECIMAL - sta printf_ulong.format_radix - // [1741] phi printf_ulong::uvalue#15 = printf_ulong::uvalue#6 [phi:display_action_text_reading::@7->printf_ulong#3] -- register_copy - jsr printf_ulong - // [2596] phi from display_action_text_reading::@7 to display_action_text_reading::@8 [phi:display_action_text_reading::@7->display_action_text_reading::@8] - // display_action_text_reading::@8 - // sprintf(info_text, "%s %s:%05x/%05x -> RAM:%02x:%04p ...", action, file, bytes, size, bram_bank, bram_ptr) - // [2597] call printf_str - // [1210] phi from display_action_text_reading::@8 to printf_str [phi:display_action_text_reading::@8->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:display_action_text_reading::@8->printf_str#0] -- pprz1=pprc1 - lda #snputc - sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = display_action_text_reading::s3 [phi:display_action_text_reading::@8->printf_str#1] -- pbuz1=pbuc1 - lda #s3 - sta.z printf_str.s+1 - jsr printf_str - // display_action_text_reading::@9 - // sprintf(info_text, "%s %s:%05x/%05x -> RAM:%02x:%04p ...", action, file, bytes, size, bram_bank, bram_ptr) - // [2598] printf_uchar::uvalue#6 = display_action_text_reading::bram_bank#10 -- vbum1=vbum2 - lda bram_bank - sta printf_uchar.uvalue - // [2599] call printf_uchar - // [1346] phi from display_action_text_reading::@9 to printf_uchar [phi:display_action_text_reading::@9->printf_uchar] - // [1346] phi printf_uchar::format_zero_padding#18 = 1 [phi:display_action_text_reading::@9->printf_uchar#0] -- vbum1=vbuc1 - lda #1 - sta printf_uchar.format_zero_padding - // [1346] phi printf_uchar::format_min_length#18 = 2 [phi:display_action_text_reading::@9->printf_uchar#1] -- vbum1=vbuc1 - lda #2 - sta printf_uchar.format_min_length - // [1346] phi printf_uchar::putc#18 = &snputc [phi:display_action_text_reading::@9->printf_uchar#2] -- pprz1=pprc1 - lda #snputc - sta.z printf_uchar.putc+1 - // [1346] phi printf_uchar::format_radix#18 = HEXADECIMAL [phi:display_action_text_reading::@9->printf_uchar#3] -- vbum1=vbuc1 - lda #HEXADECIMAL - sta printf_uchar.format_radix - // [1346] phi printf_uchar::uvalue#18 = printf_uchar::uvalue#6 [phi:display_action_text_reading::@9->printf_uchar#4] -- register_copy - jsr printf_uchar - // [2600] phi from display_action_text_reading::@9 to display_action_text_reading::@10 [phi:display_action_text_reading::@9->display_action_text_reading::@10] - // display_action_text_reading::@10 - // sprintf(info_text, "%s %s:%05x/%05x -> RAM:%02x:%04p ...", action, file, bytes, size, bram_bank, bram_ptr) - // [2601] call printf_str - // [1210] phi from display_action_text_reading::@10 to printf_str [phi:display_action_text_reading::@10->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:display_action_text_reading::@10->printf_str#0] -- pprz1=pprc1 - lda #snputc - sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = s2 [phi:display_action_text_reading::@10->printf_str#1] -- pbuz1=pbuc1 - lda #<@s2 - sta.z printf_str.s - lda #>@s2 - sta.z printf_str.s+1 - jsr printf_str - // display_action_text_reading::@11 - // sprintf(info_text, "%s %s:%05x/%05x -> RAM:%02x:%04p ...", action, file, bytes, size, bram_bank, bram_ptr) - // [2602] printf_uint::uvalue#3 = (unsigned int)display_action_text_reading::bram_ptr#10 -- vwum1=vwuz2 - lda.z bram_ptr - sta printf_uint.uvalue - lda.z bram_ptr+1 - sta printf_uint.uvalue+1 - // [2603] call printf_uint - // [2086] phi from display_action_text_reading::@11 to printf_uint [phi:display_action_text_reading::@11->printf_uint] - // [2086] phi printf_uint::format_zero_padding#10 = 1 [phi:display_action_text_reading::@11->printf_uint#0] -- vbum1=vbuc1 - lda #1 - sta printf_uint.format_zero_padding - // [2086] phi printf_uint::format_min_length#10 = 4 [phi:display_action_text_reading::@11->printf_uint#1] -- vbum1=vbuc1 - lda #4 - sta printf_uint.format_min_length - // [2086] phi printf_uint::putc#10 = &snputc [phi:display_action_text_reading::@11->printf_uint#2] -- pprz1=pprc1 - lda #snputc - sta.z printf_uint.putc+1 - // [2086] phi printf_uint::format_radix#10 = HEXADECIMAL [phi:display_action_text_reading::@11->printf_uint#3] -- vbum1=vbuc1 - lda #HEXADECIMAL - sta printf_uint.format_radix - // [2086] phi printf_uint::uvalue#10 = printf_uint::uvalue#3 [phi:display_action_text_reading::@11->printf_uint#4] -- register_copy - jsr printf_uint - // [2604] phi from display_action_text_reading::@11 to display_action_text_reading::@12 [phi:display_action_text_reading::@11->display_action_text_reading::@12] - // display_action_text_reading::@12 - // sprintf(info_text, "%s %s:%05x/%05x -> RAM:%02x:%04p ...", action, file, bytes, size, bram_bank, bram_ptr) - // [2605] call printf_str - // [1210] phi from display_action_text_reading::@12 to printf_str [phi:display_action_text_reading::@12->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:display_action_text_reading::@12->printf_str#0] -- pprz1=pprc1 - lda #snputc - sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = s6 [phi:display_action_text_reading::@12->printf_str#1] -- pbuz1=pbuc1 - lda #s6 - sta.z printf_str.s+1 - jsr printf_str - // display_action_text_reading::@13 - // sprintf(info_text, "%s %s:%05x/%05x -> RAM:%02x:%04p ...", action, file, bytes, size, bram_bank, bram_ptr) - // [2606] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 - lda #0 - pha - // [2607] callexecute snputc -- call_vprc1 - jsr snputc - // sideeffect stackpullpadding(1) -- _stackpullpadding_1 - pla - // display_action_text(info_text) - // [2609] call display_action_text - // [1357] phi from display_action_text_reading::@13 to display_action_text [phi:display_action_text_reading::@13->display_action_text] - // [1357] phi display_action_text::info_text#25 = info_text [phi:display_action_text_reading::@13->display_action_text#0] -- pbuz1=pbuc1 - lda #info_text - sta.z display_action_text.info_text+1 - jsr display_action_text - // display_action_text_reading::@return - // } - // [2610] return - rts - .segment Data - s2: .text "/" - .byte 0 - s3: .text " -> RAM:" - .byte 0 - .label bytes = printf_ulong.uvalue - bram_bank: .byte 0 - size: .dword 0 + .label return = cputcxy.c + .label mask = display_frame_maskxy.return } .segment Code // strlen // Computes the length of the string str up to but not including the terminating null character. -// __mem() unsigned int strlen(__zp($31) char *str) +// __mem() unsigned int strlen(__zp($2d) char *str) strlen: { - .label str = $31 - // [2612] phi from strlen to strlen::@1 [phi:strlen->strlen::@1] - // [2612] phi strlen::len#2 = 0 [phi:strlen->strlen::@1#0] -- vwum1=vwuc1 + .label str = $2d + // [1789] phi from strlen to strlen::@1 [phi:strlen->strlen::@1] + // [1789] phi strlen::len#2 = 0 [phi:strlen->strlen::@1#0] -- vwum1=vwuc1 lda #<0 sta len sta len+1 - // [2612] phi strlen::str#6 = strlen::str#8 [phi:strlen->strlen::@1#1] -- register_copy + // [1789] phi strlen::str#6 = strlen::str#8 [phi:strlen->strlen::@1#1] -- register_copy // strlen::@1 __b1: // while(*str) - // [2613] if(0!=*strlen::str#6) goto strlen::@2 -- 0_neq__deref_pbuz1_then_la1 + // [1790] if(0!=*strlen::str#6) goto strlen::@2 -- 0_neq__deref_pbuz1_then_la1 ldy #0 lda (str),y cmp #0 bne __b2 // strlen::@return // } - // [2614] return + // [1791] return rts // strlen::@2 __b2: // len++; - // [2615] strlen::len#1 = ++ strlen::len#2 -- vwum1=_inc_vwum1 + // [1792] strlen::len#1 = ++ strlen::len#2 -- vwum1=_inc_vwum1 inc len bne !+ inc len+1 !: // str++; - // [2616] strlen::str#1 = ++ strlen::str#6 -- pbuz1=_inc_pbuz1 + // [1793] strlen::str#1 = ++ strlen::str#6 -- pbuz1=_inc_pbuz1 inc.z str bne !+ inc.z str+1 !: - // [2612] phi from strlen::@2 to strlen::@1 [phi:strlen::@2->strlen::@1] - // [2612] phi strlen::len#2 = strlen::len#1 [phi:strlen::@2->strlen::@1#0] -- register_copy - // [2612] phi strlen::str#6 = strlen::str#1 [phi:strlen::@2->strlen::@1#1] -- register_copy + // [1789] phi from strlen::@2 to strlen::@1 [phi:strlen::@2->strlen::@1] + // [1789] phi strlen::len#2 = strlen::len#1 [phi:strlen::@2->strlen::@1#0] -- register_copy + // [1789] phi strlen::str#6 = strlen::str#1 [phi:strlen::@2->strlen::@1#1] -- register_copy jmp __b1 .segment Data .label return = len @@ -17163,2157 +11353,2106 @@ strlen: { .segment Code // printf_padding // Print a padding char a number of times -// void printf_padding(__zp($31) void (*putc)(char), __mem() char pad, __mem() char length) +// void printf_padding(__zp($2d) void (*putc)(char), __mem() char pad, __mem() char length) printf_padding: { - .label putc = $31 - // [2618] phi from printf_padding to printf_padding::@1 [phi:printf_padding->printf_padding::@1] - // [2618] phi printf_padding::i#2 = 0 [phi:printf_padding->printf_padding::@1#0] -- vbum1=vbuc1 + .label putc = $2d + // [1795] phi from printf_padding to printf_padding::@1 [phi:printf_padding->printf_padding::@1] + // [1795] phi printf_padding::i#2 = 0 [phi:printf_padding->printf_padding::@1#0] -- vbum1=vbuc1 lda #0 sta i // printf_padding::@1 __b1: // for(char i=0;iprintf_padding::@1] - // [2618] phi printf_padding::i#2 = printf_padding::i#1 [phi:printf_padding::@3->printf_padding::@1#0] -- register_copy + // [1795] phi from printf_padding::@3 to printf_padding::@1 [phi:printf_padding::@3->printf_padding::@1] + // [1795] phi printf_padding::i#2 = printf_padding::i#1 [phi:printf_padding::@3->printf_padding::@1#0] -- register_copy jmp __b1 // Outside Flow - icall38: + icall19: jmp (putc) .segment Data i: .byte 0 length: .byte 0 pad: .byte 0 } -.segment CodeVera - // vera_read -// __mem() unsigned long vera_read(__mem() char info_status) -vera_read: { - .const bank_set_brom1_bank = 0 - .label fp = $c8 - // We start for VERA from 0x1:0xA000. - .label vera_bram_ptr = $a9 - .label vera_action_text = $64 - // vera_read::bank_set_bram1 - // BRAM = bank - // [2626] BRAM = 1 -- vbuz1=vbuc1 - lda #1 - sta.z BRAM - // vera_read::@16 - // if(info_status == STATUS_READING) - // [2627] if(vera_read::info_status#12==STATUS_READING) goto vera_read::@1 -- vbum1_eq_vbuc1_then_la1 - lda #STATUS_READING - cmp info_status - beq __b1 - // [2629] phi from vera_read::@16 to vera_read::@2 [phi:vera_read::@16->vera_read::@2] - // [2629] phi vera_read::vera_bram_bank#14 = 0 [phi:vera_read::@16->vera_read::@2#0] -- vbum1=vbuc1 - lda #0 - sta vera_bram_bank - // [2629] phi vera_read::vera_action_text#10 = smc_action_text#2 [phi:vera_read::@16->vera_read::@2#1] -- pbuz1=pbuc1 - lda #smc_action_text_1 - sta.z vera_action_text+1 - jmp __b2 - // [2628] phi from vera_read::@16 to vera_read::@1 [phi:vera_read::@16->vera_read::@1] - // vera_read::@1 +.segment Code + // display_chip_led +/** + * @brief Print the colored led of a chip figure. + * + * @param x Start X + * @param y Start Y + * @param w width + * @param tc Fore color + * @param bc Back color + */ +// void display_chip_led(__mem() char x, char y, __mem() char w, __mem() char tc, char bc) +display_chip_led: { + // textcolor(tc) + // [1803] textcolor::color#11 = display_chip_led::tc#3 -- vbum1=vbum2 + lda tc + sta textcolor.color + // [1804] call textcolor + // [439] phi from display_chip_led to textcolor [phi:display_chip_led->textcolor] + // [439] phi textcolor::color#21 = textcolor::color#11 [phi:display_chip_led->textcolor#0] -- register_copy + jsr textcolor + // [1805] phi from display_chip_led to display_chip_led::@3 [phi:display_chip_led->display_chip_led::@3] + // display_chip_led::@3 + // bgcolor(bc) + // [1806] call bgcolor + // [444] phi from display_chip_led::@3 to bgcolor [phi:display_chip_led::@3->bgcolor] + // [444] phi bgcolor::color#15 = BLUE [phi:display_chip_led::@3->bgcolor#0] -- vbum1=vbuc1 + lda #BLUE + sta bgcolor.color + jsr bgcolor + // [1807] 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] + // [1807] 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 + // [1807] phi display_chip_led::x#4 = display_chip_led::x#7 [phi:display_chip_led::@3/display_chip_led::@5->display_chip_led::@1#1] -- register_copy + // display_chip_led::@1 __b1: - // [2629] phi from vera_read::@1 to vera_read::@2 [phi:vera_read::@1->vera_read::@2] - // [2629] phi vera_read::vera_bram_bank#14 = 1 [phi:vera_read::@1->vera_read::@2#0] -- vbum1=vbuc1 - lda #1 - sta vera_bram_bank - // [2629] phi vera_read::vera_action_text#10 = smc_action_text#1 [phi:vera_read::@1->vera_read::@2#1] -- pbuz1=pbuc1 - lda #smc_action_text - sta.z vera_action_text+1 - // vera_read::@2 - __b2: - // vera_read::bank_set_brom1 - // BROM = bank - // [2630] BROM = vera_read::bank_set_brom1_bank#0 -- vbuz1=vbuc1 - lda #bank_set_brom1_bank - sta.z BROM - // [2631] phi from vera_read::bank_set_brom1 to vera_read::@17 [phi:vera_read::bank_set_brom1->vera_read::@17] - // vera_read::@17 - // display_action_text("Opening VERA.BIN from SD card ...") - // [2632] call display_action_text - // [1357] phi from vera_read::@17 to display_action_text [phi:vera_read::@17->display_action_text] - // [1357] phi display_action_text::info_text#25 = vera_read::info_text [phi:vera_read::@17->display_action_text#0] -- pbuz1=pbuc1 - lda #info_text - sta.z display_action_text.info_text+1 - jsr display_action_text - // [2633] phi from vera_read::@17 to vera_read::@19 [phi:vera_read::@17->vera_read::@19] - // vera_read::@19 - // FILE *fp = fopen("VERA.BIN", "r") - // [2634] call fopen - // [2416] phi from vera_read::@19 to fopen [phi:vera_read::@19->fopen] - // [2416] phi __errno#473 = __errno#100 [phi:vera_read::@19->fopen#0] -- register_copy - // [2416] phi fopen::pathtoken#0 = vera_read::path [phi:vera_read::@19->fopen#1] -- pbuz1=pbuc1 - lda #path - sta.z fopen.pathtoken+1 - // [2416] phi __stdio_filecount#27 = __stdio_filecount#123 [phi:vera_read::@19->fopen#2] -- register_copy - jsr fopen - // FILE *fp = fopen("VERA.BIN", "r") - // [2635] fopen::return#3 = fopen::return#2 - // vera_read::@20 - // [2636] vera_read::fp#0 = fopen::return#3 -- pssz1=pssz2 - lda.z fopen.return - sta.z fp - lda.z fopen.return+1 - sta.z fp+1 - // if (fp) - // [2637] if((struct $2 *)0==vera_read::fp#0) goto vera_read::@3 -- pssc1_eq_pssz1_then_la1 - lda.z fp - cmp #<0 - bne !+ - lda.z fp+1 - cmp #>0 - beq __b4 - !: - // [2638] phi from vera_read::@20 to vera_read::@4 [phi:vera_read::@20->vera_read::@4] - // vera_read::@4 - // gotoxy(x, y) - // [2639] call gotoxy - // [802] phi from vera_read::@4 to gotoxy [phi:vera_read::@4->gotoxy] - // [802] phi gotoxy::y#37 = PROGRESS_Y [phi:vera_read::@4->gotoxy#0] -- vbum1=vbuc1 - lda #PROGRESS_Y - sta gotoxy.y - // [802] phi gotoxy::x#37 = PROGRESS_X [phi:vera_read::@4->gotoxy#1] -- vbum1=vbuc1 - lda #PROGRESS_X - sta gotoxy.x - jsr gotoxy - // [2640] phi from vera_read::@4 to vera_read::@5 [phi:vera_read::@4->vera_read::@5] - // [2640] phi vera_read::y#11 = PROGRESS_Y [phi:vera_read::@4->vera_read::@5#0] -- vbum1=vbuc1 - lda #PROGRESS_Y - sta y - // [2640] phi vera_read::progress_row_current#10 = 0 [phi:vera_read::@4->vera_read::@5#1] -- vwum1=vwuc1 - lda #<0 - sta progress_row_current - sta progress_row_current+1 - // [2640] phi vera_read::vera_bram_ptr#13 = (char *)$a000 [phi:vera_read::@4->vera_read::@5#2] -- pbuz1=pbuc1 - lda #<$a000 - sta.z vera_bram_ptr - lda #>$a000 - sta.z vera_bram_ptr+1 - // [2640] phi vera_read::vera_bram_bank#10 = vera_read::vera_bram_bank#14 [phi:vera_read::@4->vera_read::@5#3] -- register_copy - // [2640] phi vera_read::vera_file_size#11 = 0 [phi:vera_read::@4->vera_read::@5#4] -- vdum1=vduc1 - lda #<0 - sta vera_file_size - sta vera_file_size+1 - lda #<0>>$10 - sta vera_file_size+2 - lda #>0>>$10 - sta vera_file_size+3 - // vera_read::@5 - __b5: - // while (vera_file_size < vera_size) - // [2641] if(vera_read::vera_file_size#11vera_size>>$10 - bcc __b6 - bne !+ - lda vera_file_size+2 - cmp #>$10 - bcc __b6 - bne !+ - lda vera_file_size+1 - cmp #>vera_size - bcc __b6 - bne !+ - lda vera_file_size - cmp #fclose] - // [2551] phi fclose::stream#3 = fclose::stream#0 [phi:vera_read::@9->fclose#0] -- register_copy - jsr fclose - // [2644] phi from vera_read::@9 to vera_read::@3 [phi:vera_read::@9->vera_read::@3] - // [2644] phi __stdio_filecount#36 = __stdio_filecount#2 [phi:vera_read::@9->vera_read::@3#0] -- register_copy - // [2644] phi vera_read::return#0 = vera_read::vera_file_size#11 [phi:vera_read::@9->vera_read::@3#1] -- register_copy - rts - // [2644] phi from vera_read::@20 to vera_read::@3 [phi:vera_read::@20->vera_read::@3] - __b4: - // [2644] phi __stdio_filecount#36 = __stdio_filecount#1 [phi:vera_read::@20->vera_read::@3#0] -- register_copy - // [2644] phi vera_read::return#0 = 0 [phi:vera_read::@20->vera_read::@3#1] -- vdum1=vduc1 - lda #<0 - sta return - sta return+1 - lda #<0>>$10 - sta return+2 - lda #>0>>$10 - sta return+3 - // vera_read::@3 - // vera_read::@return + // cputcxy(x, y, 0x6F) + // [1808] cputcxy::x#11 = display_chip_led::x#4 -- vbum1=vbum2 + lda x + sta cputcxy.x + // [1809] call cputcxy + // [1346] phi from display_chip_led::@1 to cputcxy [phi:display_chip_led::@1->cputcxy] + // [1346] phi cputcxy::c#15 = $6f [phi:display_chip_led::@1->cputcxy#0] -- vbum1=vbuc1 + lda #$6f + sta cputcxy.c + // [1346] phi cputcxy::y#15 = 3 [phi:display_chip_led::@1->cputcxy#1] -- vbum1=vbuc1 + lda #3 + sta cputcxy.y + // [1346] phi cputcxy::x#15 = cputcxy::x#11 [phi:display_chip_led::@1->cputcxy#2] -- register_copy + jsr cputcxy + // display_chip_led::@4 + // cputcxy(x, y+1, 0x77) + // [1810] cputcxy::x#12 = display_chip_led::x#4 -- vbum1=vbum2 + lda x + sta cputcxy.x + // [1811] call cputcxy + // [1346] phi from display_chip_led::@4 to cputcxy [phi:display_chip_led::@4->cputcxy] + // [1346] phi cputcxy::c#15 = $77 [phi:display_chip_led::@4->cputcxy#0] -- vbum1=vbuc1 + lda #$77 + sta cputcxy.c + // [1346] phi cputcxy::y#15 = 3+1 [phi:display_chip_led::@4->cputcxy#1] -- vbum1=vbuc1 + lda #3+1 + sta cputcxy.y + // [1346] phi cputcxy::x#15 = cputcxy::x#12 [phi:display_chip_led::@4->cputcxy#2] -- register_copy + jsr cputcxy + // display_chip_led::@5 + // x++; + // [1812] display_chip_led::x#0 = ++ display_chip_led::x#4 -- vbum1=_inc_vbum1 + inc x + // while(--w) + // [1813] display_chip_led::w#0 = -- display_chip_led::w#4 -- vbum1=_dec_vbum1 + dec w + // [1814] if(0!=display_chip_led::w#0) goto display_chip_led::@1 -- 0_neq_vbum1_then_la1 + lda w + bne __b1 + // [1815] phi from display_chip_led::@5 to display_chip_led::@2 [phi:display_chip_led::@5->display_chip_led::@2] + // display_chip_led::@2 + // textcolor(WHITE) + // [1816] call textcolor + // [439] phi from display_chip_led::@2 to textcolor [phi:display_chip_led::@2->textcolor] + // [439] phi textcolor::color#21 = WHITE [phi:display_chip_led::@2->textcolor#0] -- vbum1=vbuc1 + lda #WHITE + sta textcolor.color + jsr textcolor + // [1817] 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) + // [1818] call bgcolor + // [444] phi from display_chip_led::@6 to bgcolor [phi:display_chip_led::@6->bgcolor] + // [444] phi bgcolor::color#15 = BLUE [phi:display_chip_led::@6->bgcolor#0] -- vbum1=vbuc1 + lda #BLUE + sta bgcolor.color + jsr bgcolor + // display_chip_led::@return // } - // [2645] return + // [1819] return rts - // vera_read::@6 - __b6: - // if(info_status == STATUS_CHECKING) - // [2646] if(vera_read::info_status#12!=STATUS_CHECKING) goto vera_read::@23 -- vbum1_neq_vbuc1_then_la1 - lda #STATUS_CHECKING - cmp info_status - bne __b7 - // [2648] phi from vera_read::@6 to vera_read::@7 [phi:vera_read::@6->vera_read::@7] - // [2648] phi vera_read::vera_bram_ptr#10 = (char *) 1024 [phi:vera_read::@6->vera_read::@7#0] -- pbuz1=pbuc1 - lda #<$400 - sta.z vera_bram_ptr - lda #>$400 - sta.z vera_bram_ptr+1 - // [2647] phi from vera_read::@6 to vera_read::@23 [phi:vera_read::@6->vera_read::@23] - // vera_read::@23 - // [2648] phi from vera_read::@23 to vera_read::@7 [phi:vera_read::@23->vera_read::@7] - // [2648] phi vera_read::vera_bram_ptr#10 = vera_read::vera_bram_ptr#13 [phi:vera_read::@23->vera_read::@7#0] -- register_copy - // vera_read::@7 - __b7: - // display_action_text_reading(vera_action_text, "VERA.BIN", vera_file_size, vera_size, vera_bram_bank, vera_bram_ptr) - // [2649] display_action_text_reading::action#0 = vera_read::vera_action_text#10 -- pbuz1=pbuz2 - lda.z vera_action_text - sta.z display_action_text_reading.action - lda.z vera_action_text+1 - sta.z display_action_text_reading.action+1 - // [2650] display_action_text_reading::bytes#0 = vera_read::vera_file_size#11 -- vdum1=vdum2 - lda vera_file_size - sta display_action_text_reading.bytes - lda vera_file_size+1 - sta display_action_text_reading.bytes+1 - lda vera_file_size+2 - sta display_action_text_reading.bytes+2 - lda vera_file_size+3 - sta display_action_text_reading.bytes+3 - // [2651] display_action_text_reading::bram_bank#0 = vera_read::vera_bram_bank#10 -- vbum1=vbum2 - lda vera_bram_bank - sta display_action_text_reading.bram_bank - // [2652] display_action_text_reading::bram_ptr#0 = vera_read::vera_bram_ptr#10 -- pbuz1=pbuz2 - lda.z vera_bram_ptr - sta.z display_action_text_reading.bram_ptr - lda.z vera_bram_ptr+1 - sta.z display_action_text_reading.bram_ptr+1 - // [2653] call display_action_text_reading - // [2580] phi from vera_read::@7 to display_action_text_reading [phi:vera_read::@7->display_action_text_reading] - // [2580] phi display_action_text_reading::bram_ptr#10 = display_action_text_reading::bram_ptr#0 [phi:vera_read::@7->display_action_text_reading#0] -- register_copy - // [2580] phi display_action_text_reading::bram_bank#10 = display_action_text_reading::bram_bank#0 [phi:vera_read::@7->display_action_text_reading#1] -- register_copy - // [2580] phi display_action_text_reading::size#10 = vera_size [phi:vera_read::@7->display_action_text_reading#2] -- vdum1=vduc1 - lda #vera_size - sta display_action_text_reading.size+1 - lda #>$10 - sta display_action_text_reading.size+2 - lda #>vera_size>>$10 - sta display_action_text_reading.size+3 - // [2580] phi display_action_text_reading::bytes#3 = display_action_text_reading::bytes#0 [phi:vera_read::@7->display_action_text_reading#3] -- register_copy - // [2580] phi display_action_text_reading::file#3 = vera_read::path [phi:vera_read::@7->display_action_text_reading#4] -- pbuz1=pbuc1 - lda #path - sta.z display_action_text_reading.file+1 - // [2580] phi display_action_text_reading::action#3 = display_action_text_reading::action#0 [phi:vera_read::@7->display_action_text_reading#5] -- register_copy - jsr display_action_text_reading - // vera_read::bank_set_bram2 - // BRAM = bank - // [2654] BRAM = vera_read::vera_bram_bank#10 -- vbuz1=vbum2 - lda vera_bram_bank - sta.z BRAM - // vera_read::@18 - // unsigned int vera_package_read = fgets(vera_bram_ptr, VERA_PROGRESS_CELL, fp) - // [2655] fgets::ptr#2 = vera_read::vera_bram_ptr#10 -- pbuz1=pbuz2 - lda.z vera_bram_ptr - sta.z fgets.ptr - lda.z vera_bram_ptr+1 - sta.z fgets.ptr+1 - // [2656] fgets::stream#0 = vera_read::fp#0 -- pssz1=pssz2 - lda.z fp - sta.z fgets.stream - lda.z fp+1 - sta.z fgets.stream+1 - // [2657] call fgets - // [2497] phi from vera_read::@18 to fgets [phi:vera_read::@18->fgets] - // [2497] phi fgets::ptr#14 = fgets::ptr#2 [phi:vera_read::@18->fgets#0] -- register_copy - // [2497] phi fgets::size#10 = VERA_PROGRESS_CELL [phi:vera_read::@18->fgets#1] -- vwum1=vbuc1 - lda #VERA_PROGRESS_CELL - sta fgets.size+1 - // [2497] phi fgets::stream#4 = fgets::stream#0 [phi:vera_read::@18->fgets#2] -- register_copy - jsr fgets - // unsigned int vera_package_read = fgets(vera_bram_ptr, VERA_PROGRESS_CELL, fp) - // [2658] fgets::return#10 = fgets::return#1 - // vera_read::@21 - // [2659] vera_read::vera_package_read#0 = fgets::return#10 -- vwum1=vwum2 - lda fgets.return - sta vera_package_read - lda fgets.return+1 - sta vera_package_read+1 - // if (!vera_package_read) - // [2660] if(0!=vera_read::vera_package_read#0) goto vera_read::@8 -- 0_neq_vwum1_then_la1 - lda vera_package_read - ora vera_package_read+1 - bne __b8 - jmp __b9 - // vera_read::@8 - __b8: - // if (progress_row_current == VERA_PROGRESS_ROW) - // [2661] if(vera_read::progress_row_current#10!=VERA_PROGRESS_ROW) goto vera_read::@10 -- vwum1_neq_vwuc1_then_la1 - lda progress_row_current+1 - cmp #>VERA_PROGRESS_ROW - bne __b10 - lda progress_row_current - cmp #gotoxy] - // [802] phi gotoxy::y#37 = gotoxy::y#6 [phi:vera_read::@13->gotoxy#0] -- register_copy - // [802] phi gotoxy::x#37 = PROGRESS_X [phi:vera_read::@13->gotoxy#1] -- vbum1=vbuc1 - lda #PROGRESS_X - sta gotoxy.x + // [1823] call gotoxy + // [457] phi from display_chip_line to gotoxy [phi:display_chip_line->gotoxy] + // [457] phi gotoxy::y#26 = gotoxy::y#11 [phi:display_chip_line->gotoxy#0] -- register_copy + // [457] phi gotoxy::x#26 = gotoxy::x#11 [phi:display_chip_line->gotoxy#1] -- register_copy jsr gotoxy - // [2665] phi from vera_read::@13 to vera_read::@10 [phi:vera_read::@13->vera_read::@10] - // [2665] phi vera_read::y#22 = vera_read::y#1 [phi:vera_read::@13->vera_read::@10#0] -- register_copy - // [2665] phi vera_read::progress_row_current#4 = 0 [phi:vera_read::@13->vera_read::@10#1] -- vwum1=vbuc1 - lda #<0 - sta progress_row_current - sta progress_row_current+1 - // [2665] phi from vera_read::@8 to vera_read::@10 [phi:vera_read::@8->vera_read::@10] - // [2665] phi vera_read::y#22 = vera_read::y#11 [phi:vera_read::@8->vera_read::@10#0] -- register_copy - // [2665] phi vera_read::progress_row_current#4 = vera_read::progress_row_current#10 [phi:vera_read::@8->vera_read::@10#1] -- register_copy - // vera_read::@10 - __b10: - // if(info_status == STATUS_READING) - // [2666] if(vera_read::info_status#12!=STATUS_READING) goto vera_read::@11 -- vbum1_neq_vbuc1_then_la1 - lda #STATUS_READING - cmp info_status - bne __b11 - // vera_read::@14 - // cputc('.') - // [2667] stackpush(char) = '.' -- _stackpushbyte_=vbuc1 - lda #'.' + // [1824] phi from display_chip_line to display_chip_line::@4 [phi:display_chip_line->display_chip_line::@4] + // display_chip_line::@4 + // textcolor(GREY) + // [1825] call textcolor + // [439] phi from display_chip_line::@4 to textcolor [phi:display_chip_line::@4->textcolor] + // [439] phi textcolor::color#21 = GREY [phi:display_chip_line::@4->textcolor#0] -- vbum1=vbuc1 + lda #GREY + sta textcolor.color + jsr textcolor + // [1826] 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) + // [1827] call bgcolor + // [444] phi from display_chip_line::@5 to bgcolor [phi:display_chip_line::@5->bgcolor] + // [444] phi bgcolor::color#15 = BLUE [phi:display_chip_line::@5->bgcolor#0] -- vbum1=vbuc1 + lda #BLUE + sta bgcolor.color + jsr bgcolor + // display_chip_line::@6 + // cputc(VERA_CHR_UR) + // [1828] stackpush(char) = $7c -- _stackpushbyte_=vbuc1 + lda #$7c pha - // [2668] callexecute cputc -- call_vprc1 + // [1829] callexecute cputc -- call_vprc1 jsr cputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla - // vera_read::@11 - __b11: - // vera_bram_ptr += vera_package_read - // [2670] vera_read::vera_bram_ptr#2 = vera_read::vera_bram_ptr#10 + vera_read::vera_package_read#0 -- pbuz1=pbuz1_plus_vwum2 + // textcolor(WHITE) + // [1831] call textcolor + // [439] phi from display_chip_line::@6 to textcolor [phi:display_chip_line::@6->textcolor] + // [439] phi textcolor::color#21 = WHITE [phi:display_chip_line::@6->textcolor#0] -- vbum1=vbuc1 + lda #WHITE + sta textcolor.color + jsr textcolor + // [1832] 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) + // [1833] call bgcolor + // [444] phi from display_chip_line::@7 to bgcolor [phi:display_chip_line::@7->bgcolor] + // [444] phi bgcolor::color#15 = BLACK [phi:display_chip_line::@7->bgcolor#0] -- vbum1=vbuc1 + lda #BLACK + sta bgcolor.color + jsr bgcolor + // [1834] phi from display_chip_line::@7 to display_chip_line::@1 [phi:display_chip_line::@7->display_chip_line::@1] + // [1834] phi display_chip_line::i#2 = 0 [phi:display_chip_line::@7->display_chip_line::@1#0] -- vbum1=vbuc1 + lda #0 + sta i + // display_chip_line::@1 + __b1: + // for(char i=0; idisplay_chip_line::@3] + // display_chip_line::@3 + // textcolor(GREY) + // [1837] call textcolor + // [439] phi from display_chip_line::@3 to textcolor [phi:display_chip_line::@3->textcolor] + // [439] phi textcolor::color#21 = GREY [phi:display_chip_line::@3->textcolor#0] -- vbum1=vbuc1 + lda #GREY + sta textcolor.color + jsr textcolor + // [1838] 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) + // [1839] call bgcolor + // [444] phi from display_chip_line::@8 to bgcolor [phi:display_chip_line::@8->bgcolor] + // [444] phi bgcolor::color#15 = BLUE [phi:display_chip_line::@8->bgcolor#0] -- vbum1=vbuc1 + lda #BLUE + sta bgcolor.color + jsr bgcolor + // display_chip_line::@9 + // cputc(VERA_CHR_UL) + // [1840] stackpush(char) = $7e -- _stackpushbyte_=vbuc1 + lda #$7e + pha + // [1841] callexecute cputc -- call_vprc1 + jsr cputc + // sideeffect stackpullpadding(1) -- _stackpullpadding_1 + pla + // textcolor(WHITE) + // [1843] call textcolor + // [439] phi from display_chip_line::@9 to textcolor [phi:display_chip_line::@9->textcolor] + // [439] phi textcolor::color#21 = WHITE [phi:display_chip_line::@9->textcolor#0] -- vbum1=vbuc1 + lda #WHITE + sta textcolor.color + jsr textcolor + // [1844] 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) + // [1845] call bgcolor + // [444] phi from display_chip_line::@10 to bgcolor [phi:display_chip_line::@10->bgcolor] + // [444] phi bgcolor::color#15 = BLACK [phi:display_chip_line::@10->bgcolor#0] -- vbum1=vbuc1 + lda #BLACK + sta bgcolor.color + jsr bgcolor + // display_chip_line::@11 + // cputcxy(x+2, y, c) + // [1846] cputcxy::x#10 = display_chip_line::x#16 + 2 -- vbum1=vbum2_plus_2 + lda x clc - lda.z vera_bram_ptr - adc vera_package_read - sta.z vera_bram_ptr - lda.z vera_bram_ptr+1 - adc vera_package_read+1 - sta.z vera_bram_ptr+1 - // vera_file_size += vera_package_read - // [2671] vera_read::vera_file_size#1 = vera_read::vera_file_size#11 + vera_read::vera_package_read#0 -- vdum1=vdum1_plus_vwum2 - lda vera_file_size - clc - adc vera_package_read - sta vera_file_size - lda vera_file_size+1 - adc vera_package_read+1 - sta vera_file_size+1 - lda vera_file_size+2 - adc #0 - sta vera_file_size+2 - lda vera_file_size+3 - adc #0 - sta vera_file_size+3 - // progress_row_current += vera_package_read - // [2672] vera_read::progress_row_current#15 = vera_read::progress_row_current#4 + vera_read::vera_package_read#0 -- vwum1=vwum1_plus_vwum2 - clc - lda progress_row_current - adc vera_package_read - sta progress_row_current - lda progress_row_current+1 - adc vera_package_read+1 - sta progress_row_current+1 - // if (vera_bram_ptr == (bram_ptr_t)BRAM_HIGH) - // [2673] if(vera_read::vera_bram_ptr#2!=(char *)$c000) goto vera_read::@12 -- pbuz1_neq_pbuc1_then_la1 - lda.z vera_bram_ptr+1 - cmp #>$c000 - bne __b12 - lda.z vera_bram_ptr - cmp #<$c000 - bne __b12 - // vera_read::@15 - // vera_bram_bank++; - // [2674] vera_read::vera_bram_bank#2 = ++ vera_read::vera_bram_bank#10 -- vbum1=_inc_vbum1 - inc vera_bram_bank - // [2675] phi from vera_read::@15 to vera_read::@12 [phi:vera_read::@15->vera_read::@12] - // [2675] phi vera_read::vera_bram_bank#13 = vera_read::vera_bram_bank#2 [phi:vera_read::@15->vera_read::@12#0] -- register_copy - // [2675] phi vera_read::vera_bram_ptr#8 = (char *)$a000 [phi:vera_read::@15->vera_read::@12#1] -- pbuz1=pbuc1 - lda #<$a000 - sta.z vera_bram_ptr - lda #>$a000 - sta.z vera_bram_ptr+1 - // [2675] phi from vera_read::@11 to vera_read::@12 [phi:vera_read::@11->vera_read::@12] - // [2675] phi vera_read::vera_bram_bank#13 = vera_read::vera_bram_bank#10 [phi:vera_read::@11->vera_read::@12#0] -- register_copy - // [2675] phi vera_read::vera_bram_ptr#8 = vera_read::vera_bram_ptr#2 [phi:vera_read::@11->vera_read::@12#1] -- register_copy - // vera_read::@12 - __b12: - // if (vera_bram_ptr == (bram_ptr_t)RAM_HIGH) - // [2676] if(vera_read::vera_bram_ptr#8!=(char *)$9800) goto vera_read::@22 -- pbuz1_neq_pbuc1_then_la1 - lda.z vera_bram_ptr+1 - cmp #>$9800 - beq !__b5+ - jmp __b5 - !__b5: - lda.z vera_bram_ptr - cmp #<$9800 - beq !__b5+ - jmp __b5 - !__b5: - // [2640] phi from vera_read::@12 to vera_read::@5 [phi:vera_read::@12->vera_read::@5] - // [2640] phi vera_read::y#11 = vera_read::y#22 [phi:vera_read::@12->vera_read::@5#0] -- register_copy - // [2640] phi vera_read::progress_row_current#10 = vera_read::progress_row_current#15 [phi:vera_read::@12->vera_read::@5#1] -- register_copy - // [2640] phi vera_read::vera_bram_ptr#13 = (char *)$a000 [phi:vera_read::@12->vera_read::@5#2] -- pbuz1=pbuc1 - lda #<$a000 - sta.z vera_bram_ptr - lda #>$a000 - sta.z vera_bram_ptr+1 - // [2640] phi vera_read::vera_bram_bank#10 = 1 [phi:vera_read::@12->vera_read::@5#3] -- vbum1=vbuc1 - lda #1 - sta vera_bram_bank - // [2640] phi vera_read::vera_file_size#11 = vera_read::vera_file_size#1 [phi:vera_read::@12->vera_read::@5#4] -- register_copy - jmp __b5 - // [2677] phi from vera_read::@12 to vera_read::@22 [phi:vera_read::@12->vera_read::@22] - // vera_read::@22 - // [2640] phi from vera_read::@22 to vera_read::@5 [phi:vera_read::@22->vera_read::@5] - // [2640] phi vera_read::y#11 = vera_read::y#22 [phi:vera_read::@22->vera_read::@5#0] -- register_copy - // [2640] phi vera_read::progress_row_current#10 = vera_read::progress_row_current#15 [phi:vera_read::@22->vera_read::@5#1] -- register_copy - // [2640] phi vera_read::vera_bram_ptr#13 = vera_read::vera_bram_ptr#8 [phi:vera_read::@22->vera_read::@5#2] -- register_copy - // [2640] phi vera_read::vera_bram_bank#10 = vera_read::vera_bram_bank#13 [phi:vera_read::@22->vera_read::@5#3] -- register_copy - // [2640] phi vera_read::vera_file_size#11 = vera_read::vera_file_size#1 [phi:vera_read::@22->vera_read::@5#4] -- register_copy - .segment DataVera - info_text: .text "Opening VERA.BIN from SD card ..." - .byte 0 - path: .text "VERA.BIN" - .byte 0 - return: .dword 0 - vera_package_read: .word 0 + adc #2 + sta cputcxy.x + // [1847] cputcxy::y#10 = display_chip_line::y#16 -- vbum1=vbum2 + lda y + sta cputcxy.y + // [1848] cputcxy::c#10 = display_chip_line::c#15 -- vbum1=vbum2 + lda c + sta cputcxy.c + // [1849] call cputcxy + // [1346] phi from display_chip_line::@11 to cputcxy [phi:display_chip_line::@11->cputcxy] + // [1346] phi cputcxy::c#15 = cputcxy::c#10 [phi:display_chip_line::@11->cputcxy#0] -- register_copy + // [1346] phi cputcxy::y#15 = cputcxy::y#10 [phi:display_chip_line::@11->cputcxy#1] -- register_copy + // [1346] phi cputcxy::x#15 = cputcxy::x#10 [phi:display_chip_line::@11->cputcxy#2] -- register_copy + jsr cputcxy + // display_chip_line::@return + // } + // [1850] return + rts + // display_chip_line::@2 + __b2: + // cputc(VERA_CHR_SPACE) + // [1851] stackpush(char) = $20 -- _stackpushbyte_=vbuc1 + lda #$20 + pha + // [1852] callexecute cputc -- call_vprc1 + jsr cputc + // sideeffect stackpullpadding(1) -- _stackpullpadding_1 + pla + // for(char i=0; idisplay_chip_line::@1] + // [1834] 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 + i: .byte 0 + x: .byte 0 + w: .byte 0 + c: .byte 0 y: .byte 0 - .label vera_file_size = return - vera_bram_bank: .byte 0 - progress_row_current: .word 0 - info_status: .byte 0 } .segment Code - // uctoa + // display_chip_end +/** + * @brief Print last line of a chip figure. + * + * @param x Start X + * @param y Start Y + * @param w Width + */ +// void display_chip_end(__mem() char x, char y, __mem() char w) +display_chip_end: { + // gotoxy(x, y) + // [1855] gotoxy::x#12 = display_chip_end::x#0 -- vbum1=vbum2 + lda x + sta gotoxy.x + // [1856] call gotoxy + // [457] phi from display_chip_end to gotoxy [phi:display_chip_end->gotoxy] + // [457] phi gotoxy::y#26 = display_print_chip::y#21 [phi:display_chip_end->gotoxy#0] -- vbum1=vbuc1 + lda #display_print_chip.y + sta gotoxy.y + // [457] phi gotoxy::x#26 = gotoxy::x#12 [phi:display_chip_end->gotoxy#1] -- register_copy + jsr gotoxy + // [1857] phi from display_chip_end to display_chip_end::@4 [phi:display_chip_end->display_chip_end::@4] + // display_chip_end::@4 + // textcolor(GREY) + // [1858] call textcolor + // [439] phi from display_chip_end::@4 to textcolor [phi:display_chip_end::@4->textcolor] + // [439] phi textcolor::color#21 = GREY [phi:display_chip_end::@4->textcolor#0] -- vbum1=vbuc1 + lda #GREY + sta textcolor.color + jsr textcolor + // [1859] 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) + // [1860] call bgcolor + // [444] phi from display_chip_end::@5 to bgcolor [phi:display_chip_end::@5->bgcolor] + // [444] phi bgcolor::color#15 = BLUE [phi:display_chip_end::@5->bgcolor#0] -- vbum1=vbuc1 + lda #BLUE + sta bgcolor.color + jsr bgcolor + // display_chip_end::@6 + // cputc(VERA_CHR_UR) + // [1861] stackpush(char) = $7c -- _stackpushbyte_=vbuc1 + lda #$7c + pha + // [1862] callexecute cputc -- call_vprc1 + jsr cputc + // sideeffect stackpullpadding(1) -- _stackpullpadding_1 + pla + // textcolor(BLUE) + // [1864] call textcolor + // [439] phi from display_chip_end::@6 to textcolor [phi:display_chip_end::@6->textcolor] + // [439] phi textcolor::color#21 = BLUE [phi:display_chip_end::@6->textcolor#0] -- vbum1=vbuc1 + lda #BLUE + sta textcolor.color + jsr textcolor + // [1865] 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) + // [1866] call bgcolor + // [444] phi from display_chip_end::@7 to bgcolor [phi:display_chip_end::@7->bgcolor] + // [444] phi bgcolor::color#15 = BLACK [phi:display_chip_end::@7->bgcolor#0] -- vbum1=vbuc1 + lda #BLACK + sta bgcolor.color + jsr bgcolor + // [1867] phi from display_chip_end::@7 to display_chip_end::@1 [phi:display_chip_end::@7->display_chip_end::@1] + // [1867] phi display_chip_end::i#2 = 0 [phi:display_chip_end::@7->display_chip_end::@1#0] -- vbum1=vbuc1 + lda #0 + sta i + // display_chip_end::@1 + __b1: + // for(char i=0; idisplay_chip_end::@3] + // display_chip_end::@3 + // textcolor(GREY) + // [1870] call textcolor + // [439] phi from display_chip_end::@3 to textcolor [phi:display_chip_end::@3->textcolor] + // [439] phi textcolor::color#21 = GREY [phi:display_chip_end::@3->textcolor#0] -- vbum1=vbuc1 + lda #GREY + sta textcolor.color + jsr textcolor + // [1871] 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) + // [1872] call bgcolor + // [444] phi from display_chip_end::@8 to bgcolor [phi:display_chip_end::@8->bgcolor] + // [444] phi bgcolor::color#15 = BLUE [phi:display_chip_end::@8->bgcolor#0] -- vbum1=vbuc1 + lda #BLUE + sta bgcolor.color + jsr bgcolor + // display_chip_end::@9 + // cputc(VERA_CHR_UL) + // [1873] stackpush(char) = $7e -- _stackpushbyte_=vbuc1 + lda #$7e + pha + // [1874] callexecute cputc -- call_vprc1 + jsr cputc + // sideeffect stackpullpadding(1) -- _stackpullpadding_1 + pla + // display_chip_end::@return + // } + // [1876] return + rts + // display_chip_end::@2 + __b2: + // cputc(VERA_CHR_HL) + // [1877] stackpush(char) = $62 -- _stackpushbyte_=vbuc1 + lda #$62 + pha + // [1878] callexecute cputc -- call_vprc1 + jsr cputc + // sideeffect stackpullpadding(1) -- _stackpullpadding_1 + pla + // for(char i=0; idisplay_chip_end::@1] + // [1867] 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 + i: .byte 0 + .label x = display_print_chip.x + w: .byte 0 +} +.segment Code + // utoa // Converts unsigned number value to a string representing it in RADIX format. // If the leading digits are zero they are not included in the string. // - value : The number to be converted to RADIX // - buffer : receives the string representing the number and zero-termination. // - radix : The radix to convert the number to (from the enum RADIX) -// void uctoa(__mem() char value, __zp($38) char *buffer, __mem() char radix) -uctoa: { - .label uctoa__4 = $29 - .label buffer = $38 - .label digit_values = $4a +// void utoa(__mem() unsigned int value, __zp($36) char *buffer, __mem() char radix) +utoa: { + .label utoa__4 = $3b + .label utoa__10 = $38 + .label utoa__11 = $4e + .label buffer = $36 + .label digit_values = $3c // if(radix==DECIMAL) - // [2678] if(uctoa::radix#0==DECIMAL) goto uctoa::@1 -- vbum1_eq_vbuc1_then_la1 + // [1881] if(utoa::radix#0==DECIMAL) goto utoa::@1 -- vbum1_eq_vbuc1_then_la1 lda #DECIMAL cmp radix beq __b2 - // uctoa::@2 + // utoa::@2 // if(radix==HEXADECIMAL) - // [2679] if(uctoa::radix#0==HEXADECIMAL) goto uctoa::@1 -- vbum1_eq_vbuc1_then_la1 + // [1882] if(utoa::radix#0==HEXADECIMAL) goto utoa::@1 -- vbum1_eq_vbuc1_then_la1 lda #HEXADECIMAL cmp radix beq __b3 - // uctoa::@3 + // utoa::@3 // if(radix==OCTAL) - // [2680] if(uctoa::radix#0==OCTAL) goto uctoa::@1 -- vbum1_eq_vbuc1_then_la1 + // [1883] if(utoa::radix#0==OCTAL) goto utoa::@1 -- vbum1_eq_vbuc1_then_la1 lda #OCTAL cmp radix beq __b4 - // uctoa::@4 + // utoa::@4 // if(radix==BINARY) - // [2681] if(uctoa::radix#0==BINARY) goto uctoa::@1 -- vbum1_eq_vbuc1_then_la1 + // [1884] if(utoa::radix#0==BINARY) goto utoa::@1 -- vbum1_eq_vbuc1_then_la1 lda #BINARY cmp radix beq __b5 - // uctoa::@5 + // utoa::@5 // *buffer++ = 'e' - // [2682] *((char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS) = 'e' -- _deref_pbuc1=vbuc2 + // [1885] *((char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS) = 'e' -- _deref_pbuc1=vbuc2 // Unknown radix lda #'e' sta printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS // *buffer++ = 'r' - // [2683] *((char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+1) = 'r' -- _deref_pbuc1=vbuc2 + // [1886] *((char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+1) = 'r' -- _deref_pbuc1=vbuc2 lda #'r' sta printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+1 - // [2684] *((char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+2) = 'r' -- _deref_pbuc1=vbuc2 + // [1887] *((char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+2) = 'r' -- _deref_pbuc1=vbuc2 sta printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+2 // *buffer = 0 - // [2685] *((char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+3) = 0 -- _deref_pbuc1=vbuc2 + // [1888] *((char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+3) = 0 -- _deref_pbuc1=vbuc2 lda #0 sta printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+3 - // uctoa::@return + // utoa::@return // } - // [2686] return + // [1889] return rts - // [2687] phi from uctoa to uctoa::@1 [phi:uctoa->uctoa::@1] + // [1890] phi from utoa to utoa::@1 [phi:utoa->utoa::@1] __b2: - // [2687] phi uctoa::digit_values#8 = RADIX_DECIMAL_VALUES_CHAR [phi:uctoa->uctoa::@1#0] -- pbuz1=pbuc1 - lda #utoa::@1#0] -- pwuz1=pwuc1 + lda #RADIX_DECIMAL_VALUES_CHAR + lda #>RADIX_DECIMAL_VALUES sta.z digit_values+1 - // [2687] phi uctoa::max_digits#7 = 3 [phi:uctoa->uctoa::@1#1] -- vbum1=vbuc1 - lda #3 + // [1890] phi utoa::max_digits#7 = 5 [phi:utoa->utoa::@1#1] -- vbum1=vbuc1 + lda #5 sta max_digits jmp __b1 - // [2687] phi from uctoa::@2 to uctoa::@1 [phi:uctoa::@2->uctoa::@1] + // [1890] phi from utoa::@2 to utoa::@1 [phi:utoa::@2->utoa::@1] __b3: - // [2687] phi uctoa::digit_values#8 = RADIX_HEXADECIMAL_VALUES_CHAR [phi:uctoa::@2->uctoa::@1#0] -- pbuz1=pbuc1 - lda #utoa::@1#0] -- pwuz1=pwuc1 + lda #RADIX_HEXADECIMAL_VALUES_CHAR + lda #>RADIX_HEXADECIMAL_VALUES sta.z digit_values+1 - // [2687] phi uctoa::max_digits#7 = 2 [phi:uctoa::@2->uctoa::@1#1] -- vbum1=vbuc1 - lda #2 + // [1890] phi utoa::max_digits#7 = 4 [phi:utoa::@2->utoa::@1#1] -- vbum1=vbuc1 + lda #4 sta max_digits jmp __b1 - // [2687] phi from uctoa::@3 to uctoa::@1 [phi:uctoa::@3->uctoa::@1] + // [1890] phi from utoa::@3 to utoa::@1 [phi:utoa::@3->utoa::@1] __b4: - // [2687] phi uctoa::digit_values#8 = RADIX_OCTAL_VALUES_CHAR [phi:uctoa::@3->uctoa::@1#0] -- pbuz1=pbuc1 - lda #utoa::@1#0] -- pwuz1=pwuc1 + lda #RADIX_OCTAL_VALUES_CHAR + lda #>RADIX_OCTAL_VALUES sta.z digit_values+1 - // [2687] phi uctoa::max_digits#7 = 3 [phi:uctoa::@3->uctoa::@1#1] -- vbum1=vbuc1 - lda #3 + // [1890] phi utoa::max_digits#7 = 6 [phi:utoa::@3->utoa::@1#1] -- vbum1=vbuc1 + lda #6 sta max_digits jmp __b1 - // [2687] phi from uctoa::@4 to uctoa::@1 [phi:uctoa::@4->uctoa::@1] + // [1890] phi from utoa::@4 to utoa::@1 [phi:utoa::@4->utoa::@1] __b5: - // [2687] phi uctoa::digit_values#8 = RADIX_BINARY_VALUES_CHAR [phi:uctoa::@4->uctoa::@1#0] -- pbuz1=pbuc1 - lda #utoa::@1#0] -- pwuz1=pwuc1 + lda #RADIX_BINARY_VALUES_CHAR + lda #>RADIX_BINARY_VALUES sta.z digit_values+1 - // [2687] phi uctoa::max_digits#7 = 8 [phi:uctoa::@4->uctoa::@1#1] -- vbum1=vbuc1 - lda #8 + // [1890] phi utoa::max_digits#7 = $10 [phi:utoa::@4->utoa::@1#1] -- vbum1=vbuc1 + lda #$10 sta max_digits - // uctoa::@1 + // utoa::@1 __b1: - // [2688] phi from uctoa::@1 to uctoa::@6 [phi:uctoa::@1->uctoa::@6] - // [2688] phi uctoa::buffer#11 = (char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS [phi:uctoa::@1->uctoa::@6#0] -- pbuz1=pbuc1 + // [1891] phi from utoa::@1 to utoa::@6 [phi:utoa::@1->utoa::@6] + // [1891] phi utoa::buffer#11 = (char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS [phi:utoa::@1->utoa::@6#0] -- pbuz1=pbuc1 lda #printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS sta.z buffer+1 - // [2688] phi uctoa::started#2 = 0 [phi:uctoa::@1->uctoa::@6#1] -- vbum1=vbuc1 + // [1891] phi utoa::started#2 = 0 [phi:utoa::@1->utoa::@6#1] -- vbum1=vbuc1 lda #0 sta started - // [2688] phi uctoa::value#2 = uctoa::value#1 [phi:uctoa::@1->uctoa::@6#2] -- register_copy - // [2688] phi uctoa::digit#2 = 0 [phi:uctoa::@1->uctoa::@6#3] -- vbum1=vbuc1 + // [1891] phi utoa::value#2 = utoa::value#1 [phi:utoa::@1->utoa::@6#2] -- register_copy + // [1891] phi utoa::digit#2 = 0 [phi:utoa::@1->utoa::@6#3] -- vbum1=vbuc1 sta digit - // uctoa::@6 + // utoa::@6 __b6: // max_digits-1 - // [2689] uctoa::$4 = uctoa::max_digits#7 - 1 -- vbuz1=vbum2_minus_1 + // [1892] utoa::$4 = utoa::max_digits#7 - 1 -- vbuz1=vbum2_minus_1 ldx max_digits dex - stx.z uctoa__4 + stx.z utoa__4 // for( char digit=0; digit= digit_value) - // [2695] if(0!=uctoa::started#2) goto uctoa::@10 -- 0_neq_vbum1_then_la1 + // [1900] if(0!=utoa::started#2) goto utoa::@10 -- 0_neq_vbum1_then_la1 lda started bne __b10 - // uctoa::@12 - // [2696] if(uctoa::value#2>=uctoa::digit_value#0) goto uctoa::@10 -- vbum1_ge_vbum2_then_la1 - lda value - cmp digit_value - bcs __b10 - // [2697] phi from uctoa::@12 to uctoa::@9 [phi:uctoa::@12->uctoa::@9] - // [2697] phi uctoa::buffer#14 = uctoa::buffer#11 [phi:uctoa::@12->uctoa::@9#0] -- register_copy - // [2697] phi uctoa::started#4 = uctoa::started#2 [phi:uctoa::@12->uctoa::@9#1] -- register_copy - // [2697] phi uctoa::value#6 = uctoa::value#2 [phi:uctoa::@12->uctoa::@9#2] -- register_copy - // uctoa::@9 - __b9: - // for( char digit=0; digit=utoa::digit_value#0) goto utoa::@10 -- vwum1_ge_vwum2_then_la1 + lda digit_value+1 + cmp value+1 + bne !+ + lda digit_value + cmp value + beq __b10 + !: + bcc __b10 + // [1902] phi from utoa::@12 to utoa::@9 [phi:utoa::@12->utoa::@9] + // [1902] phi utoa::buffer#14 = utoa::buffer#11 [phi:utoa::@12->utoa::@9#0] -- register_copy + // [1902] phi utoa::started#4 = utoa::started#2 [phi:utoa::@12->utoa::@9#1] -- register_copy + // [1902] phi utoa::value#6 = utoa::value#2 [phi:utoa::@12->utoa::@9#2] -- register_copy + // utoa::@9 + __b9: + // for( char digit=0; digituctoa::@6] - // [2688] phi uctoa::buffer#11 = uctoa::buffer#14 [phi:uctoa::@9->uctoa::@6#0] -- register_copy - // [2688] phi uctoa::started#2 = uctoa::started#4 [phi:uctoa::@9->uctoa::@6#1] -- register_copy - // [2688] phi uctoa::value#2 = uctoa::value#6 [phi:uctoa::@9->uctoa::@6#2] -- register_copy - // [2688] phi uctoa::digit#2 = uctoa::digit#1 [phi:uctoa::@9->uctoa::@6#3] -- register_copy + // [1891] phi from utoa::@9 to utoa::@6 [phi:utoa::@9->utoa::@6] + // [1891] phi utoa::buffer#11 = utoa::buffer#14 [phi:utoa::@9->utoa::@6#0] -- register_copy + // [1891] phi utoa::started#2 = utoa::started#4 [phi:utoa::@9->utoa::@6#1] -- register_copy + // [1891] phi utoa::value#2 = utoa::value#6 [phi:utoa::@9->utoa::@6#2] -- register_copy + // [1891] phi utoa::digit#2 = utoa::digit#1 [phi:utoa::@9->utoa::@6#3] -- register_copy jmp __b6 - // uctoa::@10 + // utoa::@10 __b10: - // uctoa_append(buffer++, value, digit_value) - // [2699] uctoa_append::buffer#0 = uctoa::buffer#11 -- pbuz1=pbuz2 + // utoa_append(buffer++, value, digit_value) + // [1904] utoa_append::buffer#0 = utoa::buffer#11 -- pbuz1=pbuz2 lda.z buffer - sta.z uctoa_append.buffer + sta.z utoa_append.buffer lda.z buffer+1 - sta.z uctoa_append.buffer+1 - // [2700] uctoa_append::value#0 = uctoa::value#2 - // [2701] uctoa_append::sub#0 = uctoa::digit_value#0 - // [2702] call uctoa_append - // [3299] phi from uctoa::@10 to uctoa_append [phi:uctoa::@10->uctoa_append] - jsr uctoa_append - // uctoa_append(buffer++, value, digit_value) - // [2703] uctoa_append::return#0 = uctoa_append::value#2 - // uctoa::@11 - // value = uctoa_append(buffer++, value, digit_value) - // [2704] uctoa::value#0 = uctoa_append::return#0 - // value = uctoa_append(buffer++, value, digit_value); - // [2705] uctoa::buffer#4 = ++ uctoa::buffer#11 -- pbuz1=_inc_pbuz1 + sta.z utoa_append.buffer+1 + // [1905] utoa_append::value#0 = utoa::value#2 + // [1906] utoa_append::sub#0 = utoa::digit_value#0 + // [1907] call utoa_append + // [2242] phi from utoa::@10 to utoa_append [phi:utoa::@10->utoa_append] + jsr utoa_append + // utoa_append(buffer++, value, digit_value) + // [1908] utoa_append::return#0 = utoa_append::value#2 + // utoa::@11 + // value = utoa_append(buffer++, value, digit_value) + // [1909] utoa::value#0 = utoa_append::return#0 + // value = utoa_append(buffer++, value, digit_value); + // [1910] utoa::buffer#4 = ++ utoa::buffer#11 -- pbuz1=_inc_pbuz1 inc.z buffer bne !+ inc.z buffer+1 !: - // [2697] phi from uctoa::@11 to uctoa::@9 [phi:uctoa::@11->uctoa::@9] - // [2697] phi uctoa::buffer#14 = uctoa::buffer#4 [phi:uctoa::@11->uctoa::@9#0] -- register_copy - // [2697] phi uctoa::started#4 = 1 [phi:uctoa::@11->uctoa::@9#1] -- vbum1=vbuc1 + // [1902] phi from utoa::@11 to utoa::@9 [phi:utoa::@11->utoa::@9] + // [1902] phi utoa::buffer#14 = utoa::buffer#4 [phi:utoa::@11->utoa::@9#0] -- register_copy + // [1902] phi utoa::started#4 = 1 [phi:utoa::@11->utoa::@9#1] -- vbum1=vbuc1 lda #1 sta started - // [2697] phi uctoa::value#6 = uctoa::value#0 [phi:uctoa::@11->uctoa::@9#2] -- register_copy + // [1902] phi utoa::value#6 = utoa::value#0 [phi:utoa::@11->utoa::@9#2] -- register_copy jmp __b9 .segment Data - digit_value: .byte 0 + digit_value: .word 0 digit: .byte 0 - .label value = smc_get_version_text.release - .label radix = printf_uchar.format_radix + .label value = printf_uint.uvalue + .label radix = printf_uint.format_radix started: .byte 0 max_digits: .byte 0 } +.segment CodeVera + // spi_get_jedec +spi_get_jedec: { + // spi_fast() + // [1912] call spi_fast + /* +; Returns +; .X = Vendor ID +; .Y = Memory Type +; .A = Memory Capacity +.proc spi_get_jedec + jsr spi_fast + + jsr spi_select + lda #$9F + jsr spi_write + jsr spi_read + tax + jsr spi_read + tay + jsr spi_read + rts +.endproc + */ + jsr spi_fast + // [1913] phi from spi_get_jedec to spi_get_jedec::@1 [phi:spi_get_jedec->spi_get_jedec::@1] + // spi_get_jedec::@1 + // spi_select() + // [1914] call spi_select + // [2251] phi from spi_get_jedec::@1 to spi_select [phi:spi_get_jedec::@1->spi_select] + jsr spi_select + // spi_get_jedec::@2 + // spi_write(0x9F) + // [1915] spi_write::data = $9f -- vbum1=vbuc1 + lda #$9f + sta spi_write.data + // [1916] call spi_write + jsr spi_write + // [1917] phi from spi_get_jedec::@2 to spi_get_jedec::@3 [phi:spi_get_jedec::@2->spi_get_jedec::@3] + // spi_get_jedec::@3 + // spi_read() + // [1918] call spi_read + jsr spi_read + // [1919] spi_read::return#0 = spi_read::return#4 -- vbum1=vbum2 + lda spi_read.return_3 + sta spi_read.return + // [1920] phi from spi_get_jedec::@3 to spi_get_jedec::@4 [phi:spi_get_jedec::@3->spi_get_jedec::@4] + // spi_get_jedec::@4 + // spi_read() + // [1921] call spi_read + jsr spi_read + // [1922] spi_read::return#1 = spi_read::return#4 -- vbum1=vbum2 + lda spi_read.return_3 + sta spi_read.return_1 + // [1923] phi from spi_get_jedec::@4 to spi_get_jedec::@5 [phi:spi_get_jedec::@4->spi_get_jedec::@5] + // spi_get_jedec::@5 + // spi_read() + // [1924] call spi_read + jsr spi_read + // [1925] spi_read::return#2 = spi_read::return#4 -- vbum1=vbum2 + lda spi_read.return_3 + sta spi_read.return_2 + // spi_get_jedec::@return + // } + // [1926] return + rts +} .segment Code - // printf_number_buffer -// Print the contents of the number buffer using a specific format. -// This handles minimum length, zero-filling, and left/right justification from the format -// void printf_number_buffer(__zp($3b) void (*putc)(char), __mem() char buffer_sign, char *buffer_digits, __mem() char format_min_length, char format_justify_left, char format_sign_always, __mem() char format_zero_padding, char format_upper_case, char format_radix) -printf_number_buffer: { - .label printf_number_buffer__19 = $4a - .label putc = $3b - // if(format.min_length) - // [2707] if(0==printf_number_buffer::format_min_length#3) goto printf_number_buffer::@1 -- 0_eq_vbum1_then_la1 - lda format_min_length - beq __b5 - // [2708] phi from printf_number_buffer to printf_number_buffer::@5 [phi:printf_number_buffer->printf_number_buffer::@5] - // printf_number_buffer::@5 - // strlen(buffer.digits) - // [2709] call strlen - // [2611] phi from printf_number_buffer::@5 to strlen [phi:printf_number_buffer::@5->strlen] - // [2611] phi strlen::str#8 = (char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS [phi:printf_number_buffer::@5->strlen#0] -- pbuz1=pbuc1 - lda #printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS - sta.z strlen.str+1 - jsr strlen - // strlen(buffer.digits) - // [2710] strlen::return#3 = strlen::len#2 - // printf_number_buffer::@11 - // [2711] printf_number_buffer::$19 = strlen::return#3 -- vwuz1=vwum2 - lda strlen.return - sta.z printf_number_buffer__19 - lda strlen.return+1 - sta.z printf_number_buffer__19+1 - // signed char len = (signed char)strlen(buffer.digits) - // [2712] printf_number_buffer::len#0 = (signed char)printf_number_buffer::$19 -- vbsm1=_sbyte_vwuz2 - // There is a minimum length - work out the padding - lda.z printf_number_buffer__19 - sta len - // if(buffer.sign) - // [2713] if(0==printf_number_buffer::buffer_sign#10) goto printf_number_buffer::@10 -- 0_eq_vbum1_then_la1 - lda buffer_sign - beq __b10 - // printf_number_buffer::@6 - // len++; - // [2714] printf_number_buffer::len#1 = ++ printf_number_buffer::len#0 -- vbsm1=_inc_vbsm1 - inc len - // [2715] 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] - // [2715] 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 + // fopen +/** + * @brief Load a file to banked ram located between address 0xA000 and 0xBFFF incrementing the banks. + * + * @param channel Input channel. + * @param device Input device. + * @param secondary Secondary channel. + * @param filename Name of the file to be loaded. + * @return + * - 0x0000: Something is wrong! Kernal Error Code (https://commodore.ca/manuals/pdfs/commodore_error_messages.pdf) + * - other: OK! The last pointer between 0xA000 and 0xBFFF is returned. Note that the last pointer is indicating the first free byte. + */ +// __zp($40) struct $2 * fopen(__zp($49) const char *path, const char *mode) +fopen: { + .label fopen__4 = $4e + .label fopen__9 = $38 + .label fopen__11 = $3e + .label fopen__15 = $3b + .label fopen__16 = $59 + .label fopen__26 = $5f + .label fopen__28 = $51 + .label fopen__30 = $40 + .label cbm_k_setnam1_filename = $78 + .label cbm_k_setnam1_fopen__0 = $3c + .label stream = $40 + .label pathtoken = $36 + .label path = $49 + .label return = $40 + // unsigned char sp = __stdio_filecount + // [1927] fopen::sp#0 = __stdio_filecount#105 -- vbum1=vbum2 + lda __stdio_filecount + sta sp + // (unsigned int)sp | 0x8000 + // [1928] fopen::$30 = (unsigned int)fopen::sp#0 -- vwuz1=_word_vbum2 + sta.z fopen__30 + lda #0 + sta.z fopen__30+1 + // [1929] fopen::stream#0 = fopen::$30 | $8000 -- vwuz1=vwuz1_bor_vwuc1 + lda.z stream + ora #<$8000 + sta.z stream + lda.z stream+1 + ora #>$8000 + sta.z stream+1 + // char pathpos = sp * __STDIO_FILECOUNT + // [1930] fopen::pathpos#0 = fopen::sp#0 << 1 -- vbum1=vbum2_rol_1 + lda sp + asl + sta pathpos + // __logical = 0 + // [1931] ((char *)&__stdio_file+$40)[fopen::sp#0] = 0 -- pbuc1_derefidx_vbum1=vbuc2 + lda #0 + ldy sp + sta __stdio_file+$40,y + // __device = 0 + // [1932] ((char *)&__stdio_file+$42)[fopen::sp#0] = 0 -- pbuc1_derefidx_vbum1=vbuc2 + sta __stdio_file+$42,y + // __channel = 0 + // [1933] ((char *)&__stdio_file+$44)[fopen::sp#0] = 0 -- pbuc1_derefidx_vbum1=vbuc2 + sta __stdio_file+$44,y + // [1934] fopen::pathpos#21 = fopen::pathpos#0 -- vbum1=vbum2 + lda pathpos + sta pathpos_1 + // [1935] phi from fopen to fopen::@8 [phi:fopen->fopen::@8] + // [1935] phi fopen::num#10 = 0 [phi:fopen->fopen::@8#0] -- vbum1=vbuc1 + lda #0 + sta num + // [1935] phi fopen::pathpos#10 = fopen::pathpos#21 [phi:fopen->fopen::@8#1] -- register_copy + // [1935] phi fopen::path#13 = vera_read::path [phi:fopen->fopen::@8#2] -- pbuz1=pbuc1 + lda #vera_read.path + sta.z path+1 + // [1935] phi fopen::pathstep#10 = 0 [phi:fopen->fopen::@8#3] -- vbum1=vbuc1 + lda #0 + sta pathstep + // [1935] phi fopen::pathtoken#10 = vera_read::path [phi:fopen->fopen::@8#4] -- pbuz1=pbuc1 + lda #vera_read.path + sta.z pathtoken+1 + // Iterate while path is not \0. + // [1935] phi from fopen::@22 to fopen::@8 [phi:fopen::@22->fopen::@8] + // [1935] phi fopen::num#10 = fopen::num#13 [phi:fopen::@22->fopen::@8#0] -- register_copy + // [1935] phi fopen::pathpos#10 = fopen::pathpos#7 [phi:fopen::@22->fopen::@8#1] -- register_copy + // [1935] phi fopen::path#13 = fopen::path#10 [phi:fopen::@22->fopen::@8#2] -- register_copy + // [1935] phi fopen::pathstep#10 = fopen::pathstep#11 [phi:fopen::@22->fopen::@8#3] -- register_copy + // [1935] phi fopen::pathtoken#10 = fopen::pathtoken#1 [phi:fopen::@22->fopen::@8#4] -- register_copy + // fopen::@8 + __b8: + // if (*pathtoken == ',' || *pathtoken == '\0') + // [1936] if(*fopen::pathtoken#10==',') goto fopen::@9 -- _deref_pbuz1_eq_vbuc1_then_la1 + lda #',' + ldy #0 + cmp (pathtoken),y + bne !__b9+ + jmp __b9 + !__b9: + // fopen::@33 + // [1937] if(*fopen::pathtoken#10=='@') goto fopen::@9 -- _deref_pbuz1_eq_vbuc1_then_la1 + lda #'@' + cmp (pathtoken),y + bne !__b9+ + jmp __b9 + !__b9: + // fopen::@23 + // if (pathstep == 0) + // [1938] if(fopen::pathstep#10!=0) goto fopen::@10 -- vbum1_neq_0_then_la1 + lda pathstep + bne __b10 + // fopen::@24 + // __stdio_file.filename[pathpos] = *pathtoken + // [1939] ((char *)&__stdio_file)[fopen::pathpos#10] = *fopen::pathtoken#10 -- pbuc1_derefidx_vbum1=_deref_pbuz2 + lda (pathtoken),y + ldy pathpos_1 + sta __stdio_file,y + // pathpos++; + // [1940] fopen::pathpos#1 = ++ fopen::pathpos#10 -- vbum1=_inc_vbum1 + inc pathpos_1 + // [1941] phi from fopen::@12 fopen::@23 fopen::@24 to fopen::@10 [phi:fopen::@12/fopen::@23/fopen::@24->fopen::@10] + // [1941] phi fopen::num#13 = fopen::num#15 [phi:fopen::@12/fopen::@23/fopen::@24->fopen::@10#0] -- register_copy + // [1941] phi fopen::pathpos#7 = fopen::pathpos#10 [phi:fopen::@12/fopen::@23/fopen::@24->fopen::@10#1] -- register_copy + // [1941] phi fopen::path#10 = fopen::path#12 [phi:fopen::@12/fopen::@23/fopen::@24->fopen::@10#2] -- register_copy + // [1941] phi fopen::pathstep#11 = fopen::pathstep#1 [phi:fopen::@12/fopen::@23/fopen::@24->fopen::@10#3] -- register_copy + // fopen::@10 __b10: - // padding = (signed char)format.min_length - len - // [2716] printf_number_buffer::padding#1 = (signed char)printf_number_buffer::format_min_length#3 - printf_number_buffer::len#2 -- vbsm1=vbsm2_minus_vbsm1 - lda format_min_length + // pathtoken++; + // [1942] fopen::pathtoken#1 = ++ fopen::pathtoken#10 -- pbuz1=_inc_pbuz1 + inc.z pathtoken + bne !+ + inc.z pathtoken+1 + !: + // fopen::@22 + // pathtoken - 1 + // [1943] fopen::$28 = fopen::pathtoken#1 - 1 -- pbuz1=pbuz2_minus_1 + lda.z pathtoken sec - sbc padding - sta padding - // if(padding<0) - // [2717] if(printf_number_buffer::padding#1>=0) goto printf_number_buffer::@15 -- vbsm1_ge_0_then_la1 + sbc #1 + sta.z fopen__28 + lda.z pathtoken+1 + sbc #0 + sta.z fopen__28+1 + // while (*(pathtoken - 1)) + // [1944] if(0!=*fopen::$28) goto fopen::@8 -- 0_neq__deref_pbuz1_then_la1 + ldy #0 + lda (fopen__28),y cmp #0 - bpl __b1 - // [2719] phi from printf_number_buffer printf_number_buffer::@10 to printf_number_buffer::@1 [phi:printf_number_buffer/printf_number_buffer::@10->printf_number_buffer::@1] - __b5: - // [2719] phi printf_number_buffer::padding#10 = 0 [phi:printf_number_buffer/printf_number_buffer::@10->printf_number_buffer::@1#0] -- vbsm1=vbsc1 - lda #0 - sta padding - // [2718] phi from printf_number_buffer::@10 to printf_number_buffer::@15 [phi:printf_number_buffer::@10->printf_number_buffer::@15] - // printf_number_buffer::@15 - // [2719] phi from printf_number_buffer::@15 to printf_number_buffer::@1 [phi:printf_number_buffer::@15->printf_number_buffer::@1] - // [2719] phi printf_number_buffer::padding#10 = printf_number_buffer::padding#1 [phi:printf_number_buffer::@15->printf_number_buffer::@1#0] -- register_copy - // printf_number_buffer::@1 + bne __b8 + // fopen::@26 + // __status = 0 + // [1945] ((char *)&__stdio_file+$46)[fopen::sp#0] = 0 -- pbuc1_derefidx_vbum1=vbuc2 + tya + ldy sp + sta __stdio_file+$46,y + // if(!__logical) + // [1946] if(0!=((char *)&__stdio_file+$40)[fopen::sp#0]) goto fopen::@1 -- 0_neq_pbuc1_derefidx_vbum1_then_la1 + lda __stdio_file+$40,y + cmp #0 + bne __b1 + // fopen::@27 + // __stdio_filecount+1 + // [1947] fopen::$4 = __stdio_filecount#105 + 1 -- vbuz1=vbum2_plus_1 + lda __stdio_filecount + inc + sta.z fopen__4 + // __logical = __stdio_filecount+1 + // [1948] ((char *)&__stdio_file+$40)[fopen::sp#0] = fopen::$4 -- pbuc1_derefidx_vbum1=vbuz2 + sta __stdio_file+$40,y + // fopen::@1 __b1: - // printf_number_buffer::@13 - // if(!format.justify_left && !format.zero_padding && padding) - // [2720] if(0!=printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@2 -- 0_neq_vbum1_then_la1 - lda format_zero_padding + // if(!__device) + // [1949] if(0!=((char *)&__stdio_file+$42)[fopen::sp#0]) goto fopen::@2 -- 0_neq_pbuc1_derefidx_vbum1_then_la1 + ldy sp + lda __stdio_file+$42,y + cmp #0 bne __b2 - // printf_number_buffer::@12 - // [2721] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@7 -- 0_neq_vbsm1_then_la1 - lda padding + // fopen::@5 + // __device = 8 + // [1950] ((char *)&__stdio_file+$42)[fopen::sp#0] = 8 -- pbuc1_derefidx_vbum1=vbuc2 + lda #8 + sta __stdio_file+$42,y + // fopen::@2 + __b2: + // if(!__channel) + // [1951] if(0!=((char *)&__stdio_file+$44)[fopen::sp#0]) goto fopen::@3 -- 0_neq_pbuc1_derefidx_vbum1_then_la1 + ldy sp + lda __stdio_file+$44,y cmp #0 - bne __b7 - jmp __b2 - // printf_number_buffer::@7 - __b7: - // printf_padding(putc, ' ',(char)padding) - // [2722] printf_padding::putc#0 = printf_number_buffer::putc#10 -- pprz1=pprz2 - lda.z putc - sta.z printf_padding.putc - lda.z putc+1 - sta.z printf_padding.putc+1 - // [2723] printf_padding::length#0 = (char)printf_number_buffer::padding#10 -- vbum1=vbum2 - lda padding - sta printf_padding.length - // [2724] call printf_padding - // [2617] phi from printf_number_buffer::@7 to printf_padding [phi:printf_number_buffer::@7->printf_padding] - // [2617] phi printf_padding::putc#7 = printf_padding::putc#0 [phi:printf_number_buffer::@7->printf_padding#0] -- register_copy - // [2617] phi printf_padding::pad#7 = ' ' [phi:printf_number_buffer::@7->printf_padding#1] -- vbum1=vbuc1 - lda #' ' - sta printf_padding.pad - // [2617] phi printf_padding::length#6 = printf_padding::length#0 [phi:printf_number_buffer::@7->printf_padding#2] -- register_copy - jsr printf_padding - // printf_number_buffer::@2 - __b2: - // if(buffer.sign) - // [2725] if(0==printf_number_buffer::buffer_sign#10) goto printf_number_buffer::@3 -- 0_eq_vbum1_then_la1 - lda buffer_sign - beq __b3 - // printf_number_buffer::@8 - // putc(buffer.sign) - // [2726] stackpush(char) = printf_number_buffer::buffer_sign#10 -- _stackpushbyte_=vbum1 - pha - // [2727] callexecute *printf_number_buffer::putc#10 -- call__deref_pprz1 - jsr icall40 - // sideeffect stackpullpadding(1) -- _stackpullpadding_1 - pla - // printf_number_buffer::@3 + bne __b3 + // fopen::@6 + // __stdio_filecount+2 + // [1952] fopen::$9 = __stdio_filecount#105 + 2 -- vbuz1=vbum2_plus_2 + lda __stdio_filecount + clc + adc #2 + sta.z fopen__9 + // __channel = __stdio_filecount+2 + // [1953] ((char *)&__stdio_file+$44)[fopen::sp#0] = fopen::$9 -- pbuc1_derefidx_vbum1=vbuz2 + sta __stdio_file+$44,y + // fopen::@3 __b3: - // if(format.zero_padding && padding) - // [2729] if(0==printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@4 -- 0_eq_vbum1_then_la1 - lda format_zero_padding - beq __b4 - // printf_number_buffer::@14 - // [2730] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@9 -- 0_neq_vbsm1_then_la1 - lda padding - cmp #0 - bne __b9 - jmp __b4 - // printf_number_buffer::@9 - __b9: - // printf_padding(putc, '0',(char)padding) - // [2731] printf_padding::putc#1 = printf_number_buffer::putc#10 -- pprz1=pprz2 - lda.z putc - sta.z printf_padding.putc - lda.z putc+1 - sta.z printf_padding.putc+1 - // [2732] printf_padding::length#1 = (char)printf_number_buffer::padding#10 -- vbum1=vbum2 - lda padding - sta printf_padding.length - // [2733] call printf_padding - // [2617] phi from printf_number_buffer::@9 to printf_padding [phi:printf_number_buffer::@9->printf_padding] - // [2617] phi printf_padding::putc#7 = printf_padding::putc#1 [phi:printf_number_buffer::@9->printf_padding#0] -- register_copy - // [2617] phi printf_padding::pad#7 = '0' [phi:printf_number_buffer::@9->printf_padding#1] -- vbum1=vbuc1 - lda #'0' - sta printf_padding.pad - // [2617] phi printf_padding::length#6 = printf_padding::length#1 [phi:printf_number_buffer::@9->printf_padding#2] -- register_copy - jsr printf_padding - // printf_number_buffer::@4 - __b4: - // printf_str(putc, buffer.digits) - // [2734] printf_str::putc#0 = printf_number_buffer::putc#10 - // [2735] call printf_str - // [1210] phi from printf_number_buffer::@4 to printf_str [phi:printf_number_buffer::@4->printf_str] - // [1210] phi printf_str::putc#84 = printf_str::putc#0 [phi:printf_number_buffer::@4->printf_str#0] -- register_copy - // [1210] phi printf_str::s#84 = (char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS [phi:printf_number_buffer::@4->printf_str#1] -- pbuz1=pbuc1 - lda #printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS - sta.z printf_str.s+1 - jsr printf_str - // printf_number_buffer::@return + // __filename + // [1954] fopen::$11 = (char *)&__stdio_file + fopen::pathpos#0 -- pbuz1=pbuc1_plus_vbum2 + lda pathpos + clc + adc #<__stdio_file + sta.z fopen__11 + lda #>__stdio_file + adc #0 + sta.z fopen__11+1 + // cbm_k_setnam(__filename) + // [1955] fopen::cbm_k_setnam1_filename = fopen::$11 -- pbuz1=pbuz2 + lda.z fopen__11 + sta.z cbm_k_setnam1_filename + lda.z fopen__11+1 + sta.z cbm_k_setnam1_filename+1 + // fopen::cbm_k_setnam1 + // strlen(filename) + // [1956] strlen::str#4 = fopen::cbm_k_setnam1_filename -- pbuz1=pbuz2 + lda.z cbm_k_setnam1_filename + sta.z strlen.str + lda.z cbm_k_setnam1_filename+1 + sta.z strlen.str+1 + // [1957] call strlen + // [1788] phi from fopen::cbm_k_setnam1 to strlen [phi:fopen::cbm_k_setnam1->strlen] + // [1788] phi strlen::str#8 = strlen::str#4 [phi:fopen::cbm_k_setnam1->strlen#0] -- register_copy + jsr strlen + // strlen(filename) + // [1958] strlen::return#11 = strlen::len#2 + // fopen::@31 + // [1959] fopen::cbm_k_setnam1_$0 = strlen::return#11 -- vwuz1=vwum2 + lda strlen.return + sta.z cbm_k_setnam1_fopen__0 + lda strlen.return+1 + sta.z cbm_k_setnam1_fopen__0+1 + // char filename_len = (char)strlen(filename) + // [1960] fopen::cbm_k_setnam1_filename_len = (char)fopen::cbm_k_setnam1_$0 -- vbum1=_byte_vwuz2 + lda.z cbm_k_setnam1_fopen__0 + sta cbm_k_setnam1_filename_len + // asm + // asm { ldafilename_len ldxfilename ldyfilename+1 jsrCBM_SETNAM } + ldx cbm_k_setnam1_filename + ldy cbm_k_setnam1_filename+1 + jsr CBM_SETNAM + // fopen::@28 + // cbm_k_setlfs(__logical, __device, __channel) + // [1962] cbm_k_setlfs::channel = ((char *)&__stdio_file+$40)[fopen::sp#0] -- vbum1=pbuc1_derefidx_vbum2 + ldy sp + lda __stdio_file+$40,y + sta cbm_k_setlfs.channel + // [1963] cbm_k_setlfs::device = ((char *)&__stdio_file+$42)[fopen::sp#0] -- vbum1=pbuc1_derefidx_vbum2 + lda __stdio_file+$42,y + sta cbm_k_setlfs.device + // [1964] cbm_k_setlfs::command = ((char *)&__stdio_file+$44)[fopen::sp#0] -- vbum1=pbuc1_derefidx_vbum2 + lda __stdio_file+$44,y + sta cbm_k_setlfs.command + // [1965] call cbm_k_setlfs + jsr cbm_k_setlfs + // fopen::cbm_k_open1 + // asm + // asm { jsrCBM_OPEN } + jsr CBM_OPEN + // fopen::cbm_k_readst1 + // char status + // [1967] fopen::cbm_k_readst1_status = 0 -- vbum1=vbuc1 + lda #0 + sta cbm_k_readst1_status + // asm + // asm { jsrCBM_READST stastatus } + jsr CBM_READST + sta cbm_k_readst1_status + // return status; + // [1969] fopen::cbm_k_readst1_return#0 = fopen::cbm_k_readst1_status -- vbum1=vbum2 + sta cbm_k_readst1_return + // fopen::cbm_k_readst1_@return // } - // [2736] return - rts - // Outside Flow - icall40: - jmp (putc) - .segment Data - buffer_sign: .byte 0 - .label format_min_length = printf_uchar.format_min_length - .label format_zero_padding = printf_uchar.format_zero_padding - len: .byte 0 - .label padding = len -} -.segment CodeVera - // vera_verify -vera_verify: { - .label vera_verify__16 = $a9 - .label vera_bram_ptr = $c0 - // vera_verify::bank_set_bram1 - // BRAM = bank - // [2738] BRAM = 1 -- vbuz1=vbuc1 - lda #1 - sta.z BRAM - // vera_verify::@11 - // unsigned long vera_boundary = vera_file_size - // [2739] vera_verify::vera_boundary#0 = vera_file_size#1 -- vdum1=vdum2 - lda vera_file_size - sta vera_boundary - lda vera_file_size+1 - sta vera_boundary+1 - lda vera_file_size+2 - sta vera_boundary+2 - lda vera_file_size+3 - sta vera_boundary+3 - // [2740] spi_manufacturer#597 = spi_read::return#0 -- vbum1=vbum2 - lda spi_read.return - sta spi_manufacturer - // [2741] spi_memory_type#598 = spi_read::return#1 -- vbum1=vbum2 - lda spi_read.return_1 - sta spi_memory_type - // [2742] spi_memory_capacity#599 = spi_read::return#2 -- vbum1=vbum2 - lda spi_read.return_2 - sta spi_memory_capacity - // display_info_vera(STATUS_COMPARING, "Comparing VERA ...") - // [2743] call display_info_vera - // [998] phi from vera_verify::@11 to display_info_vera [phi:vera_verify::@11->display_info_vera] - // [998] phi display_info_vera::info_text#19 = vera_verify::info_text [phi:vera_verify::@11->display_info_vera#0] -- pbuz1=pbuc1 - lda #info_text - sta.z display_info_vera.info_text+1 - // [998] phi spi_memory_capacity#106 = spi_memory_capacity#599 [phi:vera_verify::@11->display_info_vera#1] -- register_copy - // [998] phi spi_memory_type#107 = spi_memory_type#598 [phi:vera_verify::@11->display_info_vera#2] -- register_copy - // [998] phi spi_manufacturer#108 = spi_manufacturer#597 [phi:vera_verify::@11->display_info_vera#3] -- register_copy - // [998] phi display_info_vera::info_status#19 = STATUS_COMPARING [phi:vera_verify::@11->display_info_vera#4] -- vbum1=vbuc1 - lda #STATUS_COMPARING - sta display_info_vera.info_status - jsr display_info_vera - // [2744] phi from vera_verify::@11 to vera_verify::@12 [phi:vera_verify::@11->vera_verify::@12] - // vera_verify::@12 - // gotoxy(x, y) - // [2745] call gotoxy - // [802] phi from vera_verify::@12 to gotoxy [phi:vera_verify::@12->gotoxy] - // [802] phi gotoxy::y#37 = PROGRESS_Y [phi:vera_verify::@12->gotoxy#0] -- vbum1=vbuc1 - lda #PROGRESS_Y - sta gotoxy.y - // [802] phi gotoxy::x#37 = PROGRESS_X [phi:vera_verify::@12->gotoxy#1] -- vbum1=vbuc1 - lda #PROGRESS_X - sta gotoxy.x - jsr gotoxy - // [2746] phi from vera_verify::@12 to vera_verify::@13 [phi:vera_verify::@12->vera_verify::@13] - // vera_verify::@13 - // spi_read_flash(0UL) - // [2747] call spi_read_flash - // [3306] phi from vera_verify::@13 to spi_read_flash [phi:vera_verify::@13->spi_read_flash] - jsr spi_read_flash - // [2748] phi from vera_verify::@13 to vera_verify::@1 [phi:vera_verify::@13->vera_verify::@1] - // [2748] phi vera_verify::y#3 = PROGRESS_Y [phi:vera_verify::@13->vera_verify::@1#0] -- vbum1=vbuc1 - lda #PROGRESS_Y - sta y - // [2748] phi vera_verify::progress_row_current#3 = 0 [phi:vera_verify::@13->vera_verify::@1#1] -- vwum1=vwuc1 - lda #<0 - sta progress_row_current - sta progress_row_current+1 - // [2748] phi vera_verify::vera_different_bytes#11 = 0 [phi:vera_verify::@13->vera_verify::@1#2] -- vdum1=vduc1 - sta vera_different_bytes - sta vera_different_bytes+1 - lda #<0>>$10 - sta vera_different_bytes+2 - lda #>0>>$10 - sta vera_different_bytes+3 - // [2748] phi vera_verify::vera_bram_ptr#10 = (char *)$a000 [phi:vera_verify::@13->vera_verify::@1#3] -- pbuz1=pbuc1 - lda #<$a000 - sta.z vera_bram_ptr - lda #>$a000 - sta.z vera_bram_ptr+1 - // [2748] phi vera_verify::vera_bram_bank#11 = 1 [phi:vera_verify::@13->vera_verify::@1#4] -- vbum1=vbuc1 - lda #1 - sta vera_bram_bank - // [2748] phi vera_verify::vera_address#11 = 0 [phi:vera_verify::@13->vera_verify::@1#5] -- vdum1=vduc1 + // [1970] fopen::cbm_k_readst1_return#1 = fopen::cbm_k_readst1_return#0 + // fopen::@29 + // cbm_k_readst() + // [1971] fopen::$15 = fopen::cbm_k_readst1_return#1 -- vbuz1=vbum2 + sta.z fopen__15 + // __status = cbm_k_readst() + // [1972] ((char *)&__stdio_file+$46)[fopen::sp#0] = fopen::$15 -- pbuc1_derefidx_vbum1=vbuz2 + ldy sp + sta __stdio_file+$46,y + // ferror(stream) + // [1973] ferror::stream#0 = (struct $2 *)fopen::stream#0 + // [1974] call ferror + jsr ferror + // [1975] ferror::return#0 = ferror::return#1 + // fopen::@32 + // [1976] fopen::$16 = ferror::return#0 -- vwsz1=vwsm2 + lda ferror.return + sta.z fopen__16 + lda ferror.return+1 + sta.z fopen__16+1 + // if (ferror(stream)) + // [1977] if(0==fopen::$16) goto fopen::@4 -- 0_eq_vwsz1_then_la1 + lda.z fopen__16 + ora.z fopen__16+1 + beq __b4 + // fopen::@7 + // cbm_k_close(__logical) + // [1978] fopen::cbm_k_close1_channel = ((char *)&__stdio_file+$40)[fopen::sp#0] -- vbum1=pbuc1_derefidx_vbum2 + ldy sp + lda __stdio_file+$40,y + sta cbm_k_close1_channel + // fopen::cbm_k_close1 + // asm + // asm { ldachannel jsrCBM_CLOSE } + jsr CBM_CLOSE + // [1980] phi from fopen::cbm_k_close1 to fopen::@return [phi:fopen::cbm_k_close1->fopen::@return] + // [1980] phi __stdio_filecount#1 = __stdio_filecount#105 [phi:fopen::cbm_k_close1->fopen::@return#0] -- register_copy + // [1980] phi fopen::return#2 = 0 [phi:fopen::cbm_k_close1->fopen::@return#1] -- pssz1=vbuc1 lda #<0 - sta vera_address - sta vera_address+1 - lda #<0>>$10 - sta vera_address+2 - lda #>0>>$10 - sta vera_address+3 - // vera_verify::@1 - __b1: - // while (vera_address < vera_boundary) - // [2749] if(vera_verify::vera_address#11vera_compare] - jsr vera_compare - // unsigned int equal_bytes = vera_compare(vera_bram_bank, (bram_ptr_t)vera_bram_ptr, VERA_PROGRESS_CELL) - // [2754] vera_compare::return#0 = vera_compare::equal_bytes#2 - // vera_verify::@14 - // [2755] vera_verify::equal_bytes#0 = vera_compare::return#0 - // if (progress_row_current == VERA_PROGRESS_ROW) - // [2756] if(vera_verify::progress_row_current#3!=VERA_PROGRESS_ROW) goto vera_verify::@3 -- vwum1_neq_vwuc1_then_la1 - lda progress_row_current+1 - cmp #>VERA_PROGRESS_ROW - bne __b3 - lda progress_row_current - cmp #gotoxy] - // [802] phi gotoxy::y#37 = gotoxy::y#8 [phi:vera_verify::@8->gotoxy#0] -- register_copy - // [802] phi gotoxy::x#37 = PROGRESS_X [phi:vera_verify::@8->gotoxy#1] -- vbum1=vbuc1 - lda #PROGRESS_X - sta gotoxy.x - jsr gotoxy - // [2760] phi from vera_verify::@8 to vera_verify::@3 [phi:vera_verify::@8->vera_verify::@3] - // [2760] phi vera_verify::y#10 = vera_verify::y#1 [phi:vera_verify::@8->vera_verify::@3#0] -- register_copy - // [2760] phi vera_verify::progress_row_current#4 = 0 [phi:vera_verify::@8->vera_verify::@3#1] -- vwum1=vbuc1 - lda #<0 - sta progress_row_current - sta progress_row_current+1 - // [2760] phi from vera_verify::@14 to vera_verify::@3 [phi:vera_verify::@14->vera_verify::@3] - // [2760] phi vera_verify::y#10 = vera_verify::y#3 [phi:vera_verify::@14->vera_verify::@3#0] -- register_copy - // [2760] phi vera_verify::progress_row_current#4 = vera_verify::progress_row_current#3 [phi:vera_verify::@14->vera_verify::@3#1] -- register_copy - // vera_verify::@3 - __b3: - // if (equal_bytes != VERA_PROGRESS_CELL) - // [2761] if(vera_verify::equal_bytes#0!=VERA_PROGRESS_CELL) goto vera_verify::@4 -- vwum1_neq_vbuc1_then_la1 - lda equal_bytes+1 - beq !__b4+ - jmp __b4 - !__b4: - lda equal_bytes - cmp #VERA_PROGRESS_CELL - beq !__b4+ - jmp __b4 - !__b4: - // vera_verify::@9 - // cputc('=') - // [2762] stackpush(char) = '=' -- _stackpushbyte_=vbuc1 - lda #'=' - pha - // [2763] callexecute cputc -- call_vprc1 - jsr cputc - // sideeffect stackpullpadding(1) -- _stackpullpadding_1 - pla - // vera_verify::@5 - __b5: - // vera_bram_ptr += VERA_PROGRESS_CELL - // [2765] vera_verify::vera_bram_ptr#1 = vera_verify::vera_bram_ptr#10 + VERA_PROGRESS_CELL -- pbuz1=pbuz1_plus_vbuc1 - lda #VERA_PROGRESS_CELL - clc - adc.z vera_bram_ptr - sta.z vera_bram_ptr - bcc !+ - inc.z vera_bram_ptr+1 - !: - // vera_address += VERA_PROGRESS_CELL - // [2766] vera_verify::vera_address#1 = vera_verify::vera_address#11 + VERA_PROGRESS_CELL -- vdum1=vdum1_plus_vbuc1 - lda vera_address + // fopen::@4 + __b4: + // __stdio_filecount++; + // [1982] __stdio_filecount#0 = ++ __stdio_filecount#105 -- vbum1=_inc_vbum1 + inc __stdio_filecount + // [1983] fopen::return#6 = (struct $2 *)fopen::stream#0 + // [1980] phi from fopen::@4 to fopen::@return [phi:fopen::@4->fopen::@return] + // [1980] phi __stdio_filecount#1 = __stdio_filecount#0 [phi:fopen::@4->fopen::@return#0] -- register_copy + // [1980] phi fopen::return#2 = fopen::return#6 [phi:fopen::@4->fopen::@return#1] -- register_copy + rts + // fopen::@9 + __b9: + // if (pathstep > 0) + // [1984] if(fopen::pathstep#10>0) goto fopen::@11 -- vbum1_gt_0_then_la1 + lda pathstep + bne __b11 + // fopen::@25 + // __stdio_file.filename[pathpos] = '\0' + // [1985] ((char *)&__stdio_file)[fopen::pathpos#10] = '@' -- pbuc1_derefidx_vbum1=vbuc2 + lda #'@' + ldy pathpos_1 + sta __stdio_file,y + // path = pathtoken + 1 + // [1986] fopen::path#0 = fopen::pathtoken#10 + 1 -- pbuz1=pbuz2_plus_1 clc - adc #VERA_PROGRESS_CELL - sta vera_address - bcc !+ - inc vera_address+1 - bne !+ - inc vera_address+2 + lda.z pathtoken + adc #1 + sta.z path + lda.z pathtoken+1 + adc #0 + sta.z path+1 + // [1987] 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] + // [1987] phi fopen::num#15 = fopen::num#2 [phi:fopen::@16/fopen::@17/fopen::@18/fopen::@19/fopen::@25->fopen::@12#0] -- register_copy + // [1987] phi fopen::path#12 = fopen::path#15 [phi:fopen::@16/fopen::@17/fopen::@18/fopen::@19/fopen::@25->fopen::@12#1] -- register_copy + // fopen::@12 + __b12: + // pathstep++; + // [1988] fopen::pathstep#1 = ++ fopen::pathstep#10 -- vbum1=_inc_vbum1 + inc pathstep + jmp __b10 + // fopen::@11 + __b11: + // char pathcmp = *path + // [1989] fopen::pathcmp#0 = *fopen::path#13 -- vbum1=_deref_pbuz2 + ldy #0 + lda (path),y + sta pathcmp + // case 'D': + // [1990] if(fopen::pathcmp#0=='D') goto fopen::@13 -- vbum1_eq_vbuc1_then_la1 + lda #'D' + cmp pathcmp + beq __b13 + // fopen::@20 + // case 'L': + // [1991] if(fopen::pathcmp#0=='L') goto fopen::@13 -- vbum1_eq_vbuc1_then_la1 + lda #'L' + cmp pathcmp + beq __b13 + // fopen::@21 + // case 'C': + // num = (char)atoi(path + 1); + // path = pathtoken + 1; + // [1992] if(fopen::pathcmp#0=='C') goto fopen::@13 -- vbum1_eq_vbuc1_then_la1 + lda #'C' + cmp pathcmp + beq __b13 + // [1993] phi from fopen::@21 fopen::@30 to fopen::@14 [phi:fopen::@21/fopen::@30->fopen::@14] + // [1993] phi fopen::path#15 = fopen::path#13 [phi:fopen::@21/fopen::@30->fopen::@14#0] -- register_copy + // [1993] phi fopen::num#2 = fopen::num#10 [phi:fopen::@21/fopen::@30->fopen::@14#1] -- register_copy + // fopen::@14 + __b14: + // case 'L': + // __logical = num; + // break; + // [1994] if(fopen::pathcmp#0=='L') goto fopen::@17 -- vbum1_eq_vbuc1_then_la1 + lda #'L' + cmp pathcmp + beq __b17 + // fopen::@15 + // case 'D': + // __device = num; + // break; + // [1995] if(fopen::pathcmp#0=='D') goto fopen::@18 -- vbum1_eq_vbuc1_then_la1 + lda #'D' + cmp pathcmp + beq __b18 + // fopen::@16 + // case 'C': + // __channel = num; + // break; + // [1996] if(fopen::pathcmp#0!='C') goto fopen::@12 -- vbum1_neq_vbuc1_then_la1 + lda #'C' + cmp pathcmp + bne __b12 + // fopen::@19 + // __channel = num + // [1997] ((char *)&__stdio_file+$44)[fopen::sp#0] = fopen::num#2 -- pbuc1_derefidx_vbum1=vbum2 + lda num + ldy sp + sta __stdio_file+$44,y + jmp __b12 + // fopen::@18 + __b18: + // __device = num + // [1998] ((char *)&__stdio_file+$42)[fopen::sp#0] = fopen::num#2 -- pbuc1_derefidx_vbum1=vbum2 + lda num + ldy sp + sta __stdio_file+$42,y + jmp __b12 + // fopen::@17 + __b17: + // __logical = num + // [1999] ((char *)&__stdio_file+$40)[fopen::sp#0] = fopen::num#2 -- pbuc1_derefidx_vbum1=vbum2 + lda num + ldy sp + sta __stdio_file+$40,y + jmp __b12 + // fopen::@13 + __b13: + // atoi(path + 1) + // [2000] atoi::str#0 = fopen::path#13 + 1 -- pbuz1=pbuz1_plus_1 + inc.z atoi.str bne !+ - inc vera_address+3 - !: - // progress_row_current += VERA_PROGRESS_CELL - // [2767] vera_verify::progress_row_current#11 = vera_verify::progress_row_current#4 + VERA_PROGRESS_CELL -- vwum1=vwum1_plus_vbuc1 - lda #VERA_PROGRESS_CELL - clc - adc progress_row_current - sta progress_row_current - bcc !+ - inc progress_row_current+1 + inc.z atoi.str+1 !: - // if (vera_bram_ptr == BRAM_HIGH) - // [2768] if(vera_verify::vera_bram_ptr#1!=$c000) goto vera_verify::@6 -- pbuz1_neq_vwuc1_then_la1 - lda.z vera_bram_ptr+1 - cmp #>$c000 - bne __b6 - lda.z vera_bram_ptr - cmp #<$c000 - bne __b6 - // vera_verify::@10 - // vera_bram_bank++; - // [2769] vera_verify::vera_bram_bank#1 = ++ vera_verify::vera_bram_bank#11 -- vbum1=_inc_vbum1 - inc vera_bram_bank - // [2770] phi from vera_verify::@10 to vera_verify::@6 [phi:vera_verify::@10->vera_verify::@6] - // [2770] phi vera_verify::vera_bram_bank#25 = vera_verify::vera_bram_bank#1 [phi:vera_verify::@10->vera_verify::@6#0] -- register_copy - // [2770] phi vera_verify::vera_bram_ptr#6 = (char *)$a000 [phi:vera_verify::@10->vera_verify::@6#1] -- pbuz1=pbuc1 - lda #<$a000 - sta.z vera_bram_ptr - lda #>$a000 - sta.z vera_bram_ptr+1 - // [2770] phi from vera_verify::@5 to vera_verify::@6 [phi:vera_verify::@5->vera_verify::@6] - // [2770] phi vera_verify::vera_bram_bank#25 = vera_verify::vera_bram_bank#11 [phi:vera_verify::@5->vera_verify::@6#0] -- register_copy - // [2770] phi vera_verify::vera_bram_ptr#6 = vera_verify::vera_bram_ptr#1 [phi:vera_verify::@5->vera_verify::@6#1] -- register_copy - // vera_verify::@6 - __b6: - // if (vera_bram_ptr == RAM_HIGH) - // [2771] if(vera_verify::vera_bram_ptr#6!=$9800) goto vera_verify::@24 -- pbuz1_neq_vwuc1_then_la1 - lda.z vera_bram_ptr+1 - cmp #>$9800 - bne __b7 - lda.z vera_bram_ptr - cmp #<$9800 - bne __b7 - // [2773] phi from vera_verify::@6 to vera_verify::@7 [phi:vera_verify::@6->vera_verify::@7] - // [2773] phi vera_verify::vera_bram_ptr#11 = (char *)$a000 [phi:vera_verify::@6->vera_verify::@7#0] -- pbuz1=pbuc1 - lda #<$a000 - sta.z vera_bram_ptr - lda #>$a000 - sta.z vera_bram_ptr+1 - // [2773] phi vera_verify::vera_bram_bank#10 = 1 [phi:vera_verify::@6->vera_verify::@7#1] -- vbum1=vbuc1 - lda #1 - sta vera_bram_bank - // [2772] phi from vera_verify::@6 to vera_verify::@24 [phi:vera_verify::@6->vera_verify::@24] - // vera_verify::@24 - // [2773] phi from vera_verify::@24 to vera_verify::@7 [phi:vera_verify::@24->vera_verify::@7] - // [2773] phi vera_verify::vera_bram_ptr#11 = vera_verify::vera_bram_ptr#6 [phi:vera_verify::@24->vera_verify::@7#0] -- register_copy - // [2773] phi vera_verify::vera_bram_bank#10 = vera_verify::vera_bram_bank#25 [phi:vera_verify::@24->vera_verify::@7#1] -- register_copy - // vera_verify::@7 - __b7: - // VERA_PROGRESS_CELL - equal_bytes - // [2774] vera_verify::$16 = VERA_PROGRESS_CELL - vera_verify::equal_bytes#0 -- vwuz1=vwuc1_minus_vwum2 - sec - lda #VERA_PROGRESS_CELL - sbc equal_bytes+1 - sta.z vera_verify__16+1 - // vera_different_bytes += (VERA_PROGRESS_CELL - equal_bytes) - // [2775] vera_verify::vera_different_bytes#1 = vera_verify::vera_different_bytes#11 + vera_verify::$16 -- vdum1=vdum1_plus_vwuz2 - lda vera_different_bytes + // [2001] call atoi + // [2311] phi from fopen::@13 to atoi [phi:fopen::@13->atoi] + // [2311] phi atoi::str#2 = atoi::str#0 [phi:fopen::@13->atoi#0] -- register_copy + jsr atoi + // atoi(path + 1) + // [2002] atoi::return#3 = atoi::return#2 + // fopen::@30 + // [2003] fopen::$26 = atoi::return#3 -- vwsz1=vwsm2 + lda atoi.return + sta.z fopen__26 + lda atoi.return+1 + sta.z fopen__26+1 + // num = (char)atoi(path + 1) + // [2004] fopen::num#1 = (char)fopen::$26 -- vbum1=_byte_vwsz2 + lda.z fopen__26 + sta num + // path = pathtoken + 1 + // [2005] fopen::path#1 = fopen::pathtoken#10 + 1 -- pbuz1=pbuz2_plus_1 clc - adc.z vera_verify__16 - sta vera_different_bytes - lda vera_different_bytes+1 - adc.z vera_verify__16+1 - sta vera_different_bytes+1 - lda vera_different_bytes+2 - adc #0 - sta vera_different_bytes+2 - lda vera_different_bytes+3 + lda.z pathtoken + adc #1 + sta.z path + lda.z pathtoken+1 adc #0 - sta vera_different_bytes+3 - // sprintf(info_text, "Comparing: %05x differences between RAM:%02x:%04p <-> ROM:%05x", vera_different_bytes, vera_bram_bank, vera_bram_ptr, vera_address) - // [2776] call snprintf_init - // [1205] phi from vera_verify::@7 to snprintf_init [phi:vera_verify::@7->snprintf_init] - // [1205] phi snprintf_init::s#31 = info_text [phi:vera_verify::@7->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 - // [2777] phi from vera_verify::@7 to vera_verify::@15 [phi:vera_verify::@7->vera_verify::@15] - // vera_verify::@15 - // sprintf(info_text, "Comparing: %05x differences between RAM:%02x:%04p <-> ROM:%05x", vera_different_bytes, vera_bram_bank, vera_bram_ptr, vera_address) - // [2778] call printf_str - // [1210] phi from vera_verify::@15 to printf_str [phi:vera_verify::@15->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:vera_verify::@15->printf_str#0] -- pprz1=pprc1 - lda #snputc - sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = s [phi:vera_verify::@15->printf_str#1] -- pbuz1=pbuc1 - lda #s - sta.z printf_str.s+1 - jsr printf_str - // vera_verify::@16 - // sprintf(info_text, "Comparing: %05x differences between RAM:%02x:%04p <-> ROM:%05x", vera_different_bytes, vera_bram_bank, vera_bram_ptr, vera_address) - // [2779] printf_ulong::uvalue#0 = vera_verify::vera_different_bytes#1 -- vdum1=vdum2 - lda vera_different_bytes - sta printf_ulong.uvalue - lda vera_different_bytes+1 - sta printf_ulong.uvalue+1 - lda vera_different_bytes+2 - sta printf_ulong.uvalue+2 - lda vera_different_bytes+3 - sta printf_ulong.uvalue+3 - // [2780] call printf_ulong - // [1741] phi from vera_verify::@16 to printf_ulong [phi:vera_verify::@16->printf_ulong] - // [1741] phi printf_ulong::format_zero_padding#15 = 1 [phi:vera_verify::@16->printf_ulong#0] -- vbum1=vbuc1 - lda #1 - sta printf_ulong.format_zero_padding - // [1741] phi printf_ulong::format_min_length#15 = 5 [phi:vera_verify::@16->printf_ulong#1] -- vbum1=vbuc1 - lda #5 - sta printf_ulong.format_min_length - // [1741] phi printf_ulong::format_radix#15 = HEXADECIMAL [phi:vera_verify::@16->printf_ulong#2] -- vbum1=vbuc1 - lda #HEXADECIMAL - sta printf_ulong.format_radix - // [1741] phi printf_ulong::uvalue#15 = printf_ulong::uvalue#0 [phi:vera_verify::@16->printf_ulong#3] -- register_copy - jsr printf_ulong - // [2781] phi from vera_verify::@16 to vera_verify::@17 [phi:vera_verify::@16->vera_verify::@17] - // vera_verify::@17 - // sprintf(info_text, "Comparing: %05x differences between RAM:%02x:%04p <-> ROM:%05x", vera_different_bytes, vera_bram_bank, vera_bram_ptr, vera_address) - // [2782] call printf_str - // [1210] phi from vera_verify::@17 to printf_str [phi:vera_verify::@17->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:vera_verify::@17->printf_str#0] -- pprz1=pprc1 + sta.z path+1 + jmp __b14 + .segment Data + cbm_k_setnam1_filename_len: .byte 0 + cbm_k_readst1_status: .byte 0 + cbm_k_close1_channel: .byte 0 + sp: .byte 0 + pathpos: .byte 0 + pathpos_1: .byte 0 + pathcmp: .byte 0 + // Parse path + pathstep: .byte 0 + num: .byte 0 + cbm_k_readst1_return: .byte 0 +} +.segment Code + // fclose +/** + * @brief Close a file. + * + * @param fp The FILE pointer. + * @return + * - 0x0000: Something is wrong! Kernal Error Code (https://commodore.ca/manuals/pdfs/commodore_error_messages.pdf) + * - other: OK! The last pointer between 0xA000 and 0xBFFF is returned. Note that the last pointer is indicating the first free byte. + */ +// int fclose(__zp($4f) struct $2 *stream) +fclose: { + .label fclose__1 = $3b + .label fclose__4 = $38 + .label fclose__6 = $39 + .label stream = $4f + // unsigned char sp = (unsigned char)stream + // [2006] fclose::sp#0 = (char)fclose::stream#0 -- vbum1=_byte_pssz2 + lda.z stream + sta sp + // cbm_k_chkin(__logical) + // [2007] fclose::cbm_k_chkin1_channel = ((char *)&__stdio_file+$40)[fclose::sp#0] -- vbum1=pbuc1_derefidx_vbum2 + tay + lda __stdio_file+$40,y + sta cbm_k_chkin1_channel + // fclose::cbm_k_chkin1 + // char status + // [2008] fclose::cbm_k_chkin1_status = 0 -- vbum1=vbuc1 + lda #0 + sta cbm_k_chkin1_status + // asm + // asm { ldxchannel jsrCBM_CHKIN stastatus } + ldx cbm_k_chkin1_channel + jsr CBM_CHKIN + sta cbm_k_chkin1_status + // fclose::cbm_k_readst1 + // char status + // [2010] fclose::cbm_k_readst1_status = 0 -- vbum1=vbuc1 + lda #0 + sta cbm_k_readst1_status + // asm + // asm { jsrCBM_READST stastatus } + jsr CBM_READST + sta cbm_k_readst1_status + // return status; + // [2012] fclose::cbm_k_readst1_return#0 = fclose::cbm_k_readst1_status -- vbum1=vbum2 + sta cbm_k_readst1_return + // fclose::cbm_k_readst1_@return + // } + // [2013] fclose::cbm_k_readst1_return#1 = fclose::cbm_k_readst1_return#0 + // fclose::@3 + // cbm_k_readst() + // [2014] fclose::$1 = fclose::cbm_k_readst1_return#1 -- vbuz1=vbum2 + sta.z fclose__1 + // __status = cbm_k_readst() + // [2015] ((char *)&__stdio_file+$46)[fclose::sp#0] = fclose::$1 -- pbuc1_derefidx_vbum1=vbuz2 + ldy sp + sta __stdio_file+$46,y + // if (__status) + // [2016] 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 + // [2017] phi from fclose::@2 fclose::@3 fclose::@4 to fclose::@return [phi:fclose::@2/fclose::@3/fclose::@4->fclose::@return] + // [2017] phi __stdio_filecount#2 = __stdio_filecount#3 [phi:fclose::@2/fclose::@3/fclose::@4->fclose::@return#0] -- register_copy + // fclose::@return + // } + // [2018] return + rts + // fclose::@1 + __b1: + // cbm_k_close(__logical) + // [2019] 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 + // asm + // asm { ldachannel jsrCBM_CLOSE } + jsr CBM_CLOSE + // fclose::cbm_k_readst2 + // char status + // [2021] fclose::cbm_k_readst2_status = 0 -- vbum1=vbuc1 + lda #0 + sta cbm_k_readst2_status + // asm + // asm { jsrCBM_READST stastatus } + jsr CBM_READST + sta cbm_k_readst2_status + // return status; + // [2023] fclose::cbm_k_readst2_return#0 = fclose::cbm_k_readst2_status -- vbum1=vbum2 + sta cbm_k_readst2_return + // fclose::cbm_k_readst2_@return + // } + // [2024] fclose::cbm_k_readst2_return#1 = fclose::cbm_k_readst2_return#0 + // fclose::@4 + // cbm_k_readst() + // [2025] fclose::$4 = fclose::cbm_k_readst2_return#1 -- vbuz1=vbum2 + sta.z fclose__4 + // __status = cbm_k_readst() + // [2026] ((char *)&__stdio_file+$46)[fclose::sp#0] = fclose::$4 -- pbuc1_derefidx_vbum1=vbuz2 + ldy sp + sta __stdio_file+$46,y + // if (__status) + // [2027] 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 + rts + // fclose::@2 + __b2: + // __logical = 0 + // [2028] ((char *)&__stdio_file+$40)[fclose::sp#0] = 0 -- pbuc1_derefidx_vbum1=vbuc2 + lda #0 + ldy sp + sta __stdio_file+$40,y + // __device = 0 + // [2029] ((char *)&__stdio_file+$42)[fclose::sp#0] = 0 -- pbuc1_derefidx_vbum1=vbuc2 + sta __stdio_file+$42,y + // __channel = 0 + // [2030] ((char *)&__stdio_file+$44)[fclose::sp#0] = 0 -- pbuc1_derefidx_vbum1=vbuc2 + sta __stdio_file+$44,y + // __filename + // [2031] fclose::$6 = fclose::sp#0 << 1 -- vbuz1=vbum2_rol_1 + tya + asl + sta.z fclose__6 + // *__filename = '\0' + // [2032] ((char *)&__stdio_file)[fclose::$6] = '@' -- pbuc1_derefidx_vbuz1=vbuc2 + lda #'@' + ldy.z fclose__6 + sta __stdio_file,y + // __stdio_filecount--; + // [2033] __stdio_filecount#3 = -- __stdio_filecount#1 -- vbum1=_dec_vbum1 + dec __stdio_filecount + rts + .segment Data + cbm_k_chkin1_channel: .byte 0 + cbm_k_chkin1_status: .byte 0 + cbm_k_readst1_status: .byte 0 + cbm_k_close1_channel: .byte 0 + cbm_k_readst2_status: .byte 0 + sp: .byte 0 + cbm_k_readst1_return: .byte 0 + cbm_k_readst2_return: .byte 0 +} +.segment Code + // display_action_text_reading +// void display_action_text_reading(__zp($42) char *action, char *file, __mem() unsigned long bytes, unsigned long size, __mem() char bram_bank, __zp($6c) char *bram_ptr) +display_action_text_reading: { + .label action = $42 + .label bram_ptr = $6c + // sprintf(info_text, "%s %s:%05x/%05x -> RAM:%02x:%04p ...", action, file, bytes, size, bram_bank, bram_ptr) + // [2035] call snprintf_init + jsr snprintf_init + // display_action_text_reading::@1 + // [2036] printf_string::str#14 = display_action_text_reading::action#0 + // [2037] call printf_string + // [1308] phi from display_action_text_reading::@1 to printf_string [phi:display_action_text_reading::@1->printf_string] + // [1308] phi printf_string::putc#17 = &snputc [phi:display_action_text_reading::@1->printf_string#0] -- pprz1=pprc1 + lda #snputc + sta.z printf_string.putc+1 + // [1308] phi printf_string::str#17 = printf_string::str#14 [phi:display_action_text_reading::@1->printf_string#1] -- register_copy + // [1308] phi printf_string::format_justify_left#17 = 0 [phi:display_action_text_reading::@1->printf_string#2] -- vbum1=vbuc1 + lda #0 + sta printf_string.format_justify_left + // [1308] phi printf_string::format_min_length#17 = 0 [phi:display_action_text_reading::@1->printf_string#3] -- vbum1=vbuc1 + sta printf_string.format_min_length + jsr printf_string + // [2038] phi from display_action_text_reading::@1 to display_action_text_reading::@2 [phi:display_action_text_reading::@1->display_action_text_reading::@2] + // display_action_text_reading::@2 + // sprintf(info_text, "%s %s:%05x/%05x -> RAM:%02x:%04p ...", action, file, bytes, size, bram_bank, bram_ptr) + // [2039] call printf_str + // [785] phi from display_action_text_reading::@2 to printf_str [phi:display_action_text_reading::@2->printf_str] + // [785] phi printf_str::putc#53 = &snputc [phi:display_action_text_reading::@2->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = s1 [phi:vera_verify::@17->printf_str#1] -- pbuz1=pbuc1 - lda #printf_str#1] -- pbuz1=pbuc1 + lda #s1 + lda #>s sta.z printf_str.s+1 jsr printf_str - // vera_verify::@18 - // sprintf(info_text, "Comparing: %05x differences between RAM:%02x:%04p <-> ROM:%05x", vera_different_bytes, vera_bram_bank, vera_bram_ptr, vera_address) - // [2783] printf_uchar::uvalue#0 = vera_verify::vera_bram_bank#10 -- vbum1=vbum2 - lda vera_bram_bank - sta printf_uchar.uvalue - // [2784] call printf_uchar - // [1346] phi from vera_verify::@18 to printf_uchar [phi:vera_verify::@18->printf_uchar] - // [1346] phi printf_uchar::format_zero_padding#18 = 1 [phi:vera_verify::@18->printf_uchar#0] -- vbum1=vbuc1 + // [2040] phi from display_action_text_reading::@2 to display_action_text_reading::@3 [phi:display_action_text_reading::@2->display_action_text_reading::@3] + // display_action_text_reading::@3 + // sprintf(info_text, "%s %s:%05x/%05x -> RAM:%02x:%04p ...", action, file, bytes, size, bram_bank, bram_ptr) + // [2041] call printf_string + // [1308] phi from display_action_text_reading::@3 to printf_string [phi:display_action_text_reading::@3->printf_string] + // [1308] phi printf_string::putc#17 = &snputc [phi:display_action_text_reading::@3->printf_string#0] -- pprz1=pprc1 + lda #snputc + sta.z printf_string.putc+1 + // [1308] phi printf_string::str#17 = vera_read::path [phi:display_action_text_reading::@3->printf_string#1] -- pbuz1=pbuc1 + lda #vera_read.path + sta.z printf_string.str+1 + // [1308] phi printf_string::format_justify_left#17 = 0 [phi:display_action_text_reading::@3->printf_string#2] -- vbum1=vbuc1 + lda #0 + sta printf_string.format_justify_left + // [1308] phi printf_string::format_min_length#17 = 0 [phi:display_action_text_reading::@3->printf_string#3] -- vbum1=vbuc1 + sta printf_string.format_min_length + jsr printf_string + // [2042] phi from display_action_text_reading::@3 to display_action_text_reading::@4 [phi:display_action_text_reading::@3->display_action_text_reading::@4] + // display_action_text_reading::@4 + // sprintf(info_text, "%s %s:%05x/%05x -> RAM:%02x:%04p ...", action, file, bytes, size, bram_bank, bram_ptr) + // [2043] call printf_str + // [785] phi from display_action_text_reading::@4 to printf_str [phi:display_action_text_reading::@4->printf_str] + // [785] phi printf_str::putc#53 = &snputc [phi:display_action_text_reading::@4->printf_str#0] -- pprz1=pprc1 + lda #snputc + sta.z printf_str.putc+1 + // [785] phi printf_str::s#53 = s2 [phi:display_action_text_reading::@4->printf_str#1] -- pbuz1=pbuc1 + lda #<@s2 + sta.z printf_str.s + lda #>@s2 + sta.z printf_str.s+1 + jsr printf_str + // display_action_text_reading::@5 + // sprintf(info_text, "%s %s:%05x/%05x -> RAM:%02x:%04p ...", action, file, bytes, size, bram_bank, bram_ptr) + // [2044] printf_ulong::uvalue#5 = display_action_text_reading::bytes#0 + // [2045] call printf_ulong + // [1633] phi from display_action_text_reading::@5 to printf_ulong [phi:display_action_text_reading::@5->printf_ulong] + // [1633] phi printf_ulong::format_zero_padding#10 = 1 [phi:display_action_text_reading::@5->printf_ulong#0] -- vbum1=vbuc1 + lda #1 + sta printf_ulong.format_zero_padding + // [1633] phi printf_ulong::format_min_length#10 = 5 [phi:display_action_text_reading::@5->printf_ulong#1] -- vbum1=vbuc1 + lda #5 + sta printf_ulong.format_min_length + // [1633] phi printf_ulong::format_radix#10 = HEXADECIMAL [phi:display_action_text_reading::@5->printf_ulong#2] -- vbum1=vbuc1 + lda #HEXADECIMAL + sta printf_ulong.format_radix + // [1633] phi printf_ulong::uvalue#10 = printf_ulong::uvalue#5 [phi:display_action_text_reading::@5->printf_ulong#3] -- register_copy + jsr printf_ulong + // [2046] phi from display_action_text_reading::@5 to display_action_text_reading::@6 [phi:display_action_text_reading::@5->display_action_text_reading::@6] + // display_action_text_reading::@6 + // sprintf(info_text, "%s %s:%05x/%05x -> RAM:%02x:%04p ...", action, file, bytes, size, bram_bank, bram_ptr) + // [2047] call printf_str + // [785] phi from display_action_text_reading::@6 to printf_str [phi:display_action_text_reading::@6->printf_str] + // [785] phi printf_str::putc#53 = &snputc [phi:display_action_text_reading::@6->printf_str#0] -- pprz1=pprc1 + lda #snputc + sta.z printf_str.putc+1 + // [785] phi printf_str::s#53 = display_action_text_reading::s2 [phi:display_action_text_reading::@6->printf_str#1] -- pbuz1=pbuc1 + lda #s2 + sta.z printf_str.s+1 + jsr printf_str + // [2048] phi from display_action_text_reading::@6 to display_action_text_reading::@7 [phi:display_action_text_reading::@6->display_action_text_reading::@7] + // display_action_text_reading::@7 + // sprintf(info_text, "%s %s:%05x/%05x -> RAM:%02x:%04p ...", action, file, bytes, size, bram_bank, bram_ptr) + // [2049] call printf_ulong + // [1633] phi from display_action_text_reading::@7 to printf_ulong [phi:display_action_text_reading::@7->printf_ulong] + // [1633] phi printf_ulong::format_zero_padding#10 = 1 [phi:display_action_text_reading::@7->printf_ulong#0] -- vbum1=vbuc1 + lda #1 + sta printf_ulong.format_zero_padding + // [1633] phi printf_ulong::format_min_length#10 = 5 [phi:display_action_text_reading::@7->printf_ulong#1] -- vbum1=vbuc1 + lda #5 + sta printf_ulong.format_min_length + // [1633] phi printf_ulong::format_radix#10 = HEXADECIMAL [phi:display_action_text_reading::@7->printf_ulong#2] -- vbum1=vbuc1 + lda #HEXADECIMAL + sta printf_ulong.format_radix + // [1633] phi printf_ulong::uvalue#10 = vera_size [phi:display_action_text_reading::@7->printf_ulong#3] -- vdum1=vduc1 + lda #vera_size + sta printf_ulong.uvalue+1 + lda #>$10 + sta printf_ulong.uvalue+2 + lda #>vera_size>>$10 + sta printf_ulong.uvalue+3 + jsr printf_ulong + // [2050] phi from display_action_text_reading::@7 to display_action_text_reading::@8 [phi:display_action_text_reading::@7->display_action_text_reading::@8] + // display_action_text_reading::@8 + // sprintf(info_text, "%s %s:%05x/%05x -> RAM:%02x:%04p ...", action, file, bytes, size, bram_bank, bram_ptr) + // [2051] call printf_str + // [785] phi from display_action_text_reading::@8 to printf_str [phi:display_action_text_reading::@8->printf_str] + // [785] phi printf_str::putc#53 = &snputc [phi:display_action_text_reading::@8->printf_str#0] -- pprz1=pprc1 + lda #snputc + sta.z printf_str.putc+1 + // [785] phi printf_str::s#53 = display_action_text_reading::s3 [phi:display_action_text_reading::@8->printf_str#1] -- pbuz1=pbuc1 + lda #s3 + sta.z printf_str.s+1 + jsr printf_str + // display_action_text_reading::@9 + // sprintf(info_text, "%s %s:%05x/%05x -> RAM:%02x:%04p ...", action, file, bytes, size, bram_bank, bram_ptr) + // [2052] printf_uchar::uvalue#6 = display_action_text_reading::bram_bank#0 + // [2053] call printf_uchar + // [834] phi from display_action_text_reading::@9 to printf_uchar [phi:display_action_text_reading::@9->printf_uchar] + // [834] phi printf_uchar::format_zero_padding#10 = 1 [phi:display_action_text_reading::@9->printf_uchar#0] -- vbum1=vbuc1 lda #1 sta printf_uchar.format_zero_padding - // [1346] phi printf_uchar::format_min_length#18 = 2 [phi:vera_verify::@18->printf_uchar#1] -- vbum1=vbuc1 + // [834] phi printf_uchar::format_min_length#10 = 2 [phi:display_action_text_reading::@9->printf_uchar#1] -- vbum1=vbuc1 lda #2 sta printf_uchar.format_min_length - // [1346] phi printf_uchar::putc#18 = &snputc [phi:vera_verify::@18->printf_uchar#2] -- pprz1=pprc1 + // [834] phi printf_uchar::putc#10 = &snputc [phi:display_action_text_reading::@9->printf_uchar#2] -- pprz1=pprc1 lda #snputc sta.z printf_uchar.putc+1 - // [1346] phi printf_uchar::format_radix#18 = HEXADECIMAL [phi:vera_verify::@18->printf_uchar#3] -- vbum1=vbuc1 + // [834] phi printf_uchar::format_radix#10 = HEXADECIMAL [phi:display_action_text_reading::@9->printf_uchar#3] -- vbum1=vbuc1 lda #HEXADECIMAL sta printf_uchar.format_radix - // [1346] phi printf_uchar::uvalue#18 = printf_uchar::uvalue#0 [phi:vera_verify::@18->printf_uchar#4] -- register_copy + // [834] phi printf_uchar::uvalue#10 = printf_uchar::uvalue#6 [phi:display_action_text_reading::@9->printf_uchar#4] -- register_copy jsr printf_uchar - // [2785] phi from vera_verify::@18 to vera_verify::@19 [phi:vera_verify::@18->vera_verify::@19] - // vera_verify::@19 - // sprintf(info_text, "Comparing: %05x differences between RAM:%02x:%04p <-> ROM:%05x", vera_different_bytes, vera_bram_bank, vera_bram_ptr, vera_address) - // [2786] call printf_str - // [1210] phi from vera_verify::@19 to printf_str [phi:vera_verify::@19->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:vera_verify::@19->printf_str#0] -- pprz1=pprc1 + // [2054] phi from display_action_text_reading::@9 to display_action_text_reading::@10 [phi:display_action_text_reading::@9->display_action_text_reading::@10] + // display_action_text_reading::@10 + // sprintf(info_text, "%s %s:%05x/%05x -> RAM:%02x:%04p ...", action, file, bytes, size, bram_bank, bram_ptr) + // [2055] call printf_str + // [785] phi from display_action_text_reading::@10 to printf_str [phi:display_action_text_reading::@10->printf_str] + // [785] phi printf_str::putc#53 = &snputc [phi:display_action_text_reading::@10->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = s2 [phi:vera_verify::@19->printf_str#1] -- pbuz1=pbuc1 - lda #printf_str#1] -- pbuz1=pbuc1 + lda #<@s2 sta.z printf_str.s - lda #>s2 + lda #>@s2 sta.z printf_str.s+1 jsr printf_str - // vera_verify::@20 - // sprintf(info_text, "Comparing: %05x differences between RAM:%02x:%04p <-> ROM:%05x", vera_different_bytes, vera_bram_bank, vera_bram_ptr, vera_address) - // [2787] printf_uint::uvalue#0 = (unsigned int)vera_verify::vera_bram_ptr#11 -- vwum1=vwuz2 - lda.z vera_bram_ptr + // display_action_text_reading::@11 + // sprintf(info_text, "%s %s:%05x/%05x -> RAM:%02x:%04p ...", action, file, bytes, size, bram_bank, bram_ptr) + // [2056] printf_uint::uvalue#3 = (unsigned int)display_action_text_reading::bram_ptr#0 -- vwum1=vwuz2 + lda.z bram_ptr sta printf_uint.uvalue - lda.z vera_bram_ptr+1 + lda.z bram_ptr+1 sta printf_uint.uvalue+1 - // [2788] call printf_uint - // [2086] phi from vera_verify::@20 to printf_uint [phi:vera_verify::@20->printf_uint] - // [2086] phi printf_uint::format_zero_padding#10 = 1 [phi:vera_verify::@20->printf_uint#0] -- vbum1=vbuc1 + // [2057] call printf_uint + // [1433] phi from display_action_text_reading::@11 to printf_uint [phi:display_action_text_reading::@11->printf_uint] + // [1433] phi printf_uint::format_zero_padding#4 = 1 [phi:display_action_text_reading::@11->printf_uint#0] -- vbum1=vbuc1 lda #1 sta printf_uint.format_zero_padding - // [2086] phi printf_uint::format_min_length#10 = 4 [phi:vera_verify::@20->printf_uint#1] -- vbum1=vbuc1 + // [1433] phi printf_uint::format_min_length#4 = 4 [phi:display_action_text_reading::@11->printf_uint#1] -- vbum1=vbuc1 lda #4 sta printf_uint.format_min_length - // [2086] phi printf_uint::putc#10 = &snputc [phi:vera_verify::@20->printf_uint#2] -- pprz1=pprc1 + // [1433] phi printf_uint::putc#4 = &snputc [phi:display_action_text_reading::@11->printf_uint#2] -- pprz1=pprc1 lda #snputc sta.z printf_uint.putc+1 - // [2086] phi printf_uint::format_radix#10 = HEXADECIMAL [phi:vera_verify::@20->printf_uint#3] -- vbum1=vbuc1 + // [1433] phi printf_uint::format_radix#4 = HEXADECIMAL [phi:display_action_text_reading::@11->printf_uint#3] -- vbum1=vbuc1 lda #HEXADECIMAL sta printf_uint.format_radix - // [2086] phi printf_uint::uvalue#10 = printf_uint::uvalue#0 [phi:vera_verify::@20->printf_uint#4] -- register_copy + // [1433] phi printf_uint::uvalue#4 = printf_uint::uvalue#3 [phi:display_action_text_reading::@11->printf_uint#4] -- register_copy jsr printf_uint - // [2789] phi from vera_verify::@20 to vera_verify::@21 [phi:vera_verify::@20->vera_verify::@21] - // vera_verify::@21 - // sprintf(info_text, "Comparing: %05x differences between RAM:%02x:%04p <-> ROM:%05x", vera_different_bytes, vera_bram_bank, vera_bram_ptr, vera_address) - // [2790] call printf_str - // [1210] phi from vera_verify::@21 to printf_str [phi:vera_verify::@21->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:vera_verify::@21->printf_str#0] -- pprz1=pprc1 + // [2058] phi from display_action_text_reading::@11 to display_action_text_reading::@12 [phi:display_action_text_reading::@11->display_action_text_reading::@12] + // display_action_text_reading::@12 + // sprintf(info_text, "%s %s:%05x/%05x -> RAM:%02x:%04p ...", action, file, bytes, size, bram_bank, bram_ptr) + // [2059] call printf_str + // [785] phi from display_action_text_reading::@12 to printf_str [phi:display_action_text_reading::@12->printf_str] + // [785] phi printf_str::putc#53 = &snputc [phi:display_action_text_reading::@12->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = s3 [phi:vera_verify::@21->printf_str#1] -- pbuz1=pbuc1 - lda #printf_str#1] -- pbuz1=pbuc1 + lda #s3 + lda #>s5 sta.z printf_str.s+1 jsr printf_str - // vera_verify::@22 - // sprintf(info_text, "Comparing: %05x differences between RAM:%02x:%04p <-> ROM:%05x", vera_different_bytes, vera_bram_bank, vera_bram_ptr, vera_address) - // [2791] printf_ulong::uvalue#1 = vera_verify::vera_address#1 -- vdum1=vdum2 - lda vera_address - sta printf_ulong.uvalue - lda vera_address+1 - sta printf_ulong.uvalue+1 - lda vera_address+2 - sta printf_ulong.uvalue+2 - lda vera_address+3 - sta printf_ulong.uvalue+3 - // [2792] call printf_ulong - // [1741] phi from vera_verify::@22 to printf_ulong [phi:vera_verify::@22->printf_ulong] - // [1741] phi printf_ulong::format_zero_padding#15 = 1 [phi:vera_verify::@22->printf_ulong#0] -- vbum1=vbuc1 - lda #1 - sta printf_ulong.format_zero_padding - // [1741] phi printf_ulong::format_min_length#15 = 5 [phi:vera_verify::@22->printf_ulong#1] -- vbum1=vbuc1 - lda #5 - sta printf_ulong.format_min_length - // [1741] phi printf_ulong::format_radix#15 = HEXADECIMAL [phi:vera_verify::@22->printf_ulong#2] -- vbum1=vbuc1 - lda #HEXADECIMAL - sta printf_ulong.format_radix - // [1741] phi printf_ulong::uvalue#15 = printf_ulong::uvalue#1 [phi:vera_verify::@22->printf_ulong#3] -- register_copy - jsr printf_ulong - // vera_verify::@23 - // sprintf(info_text, "Comparing: %05x differences between RAM:%02x:%04p <-> ROM:%05x", vera_different_bytes, vera_bram_bank, vera_bram_ptr, vera_address) - // [2793] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 + // display_action_text_reading::@13 + // sprintf(info_text, "%s %s:%05x/%05x -> RAM:%02x:%04p ...", action, file, bytes, size, bram_bank, bram_ptr) + // [2060] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 lda #0 pha - // [2794] callexecute snputc -- call_vprc1 + // [2061] callexecute snputc -- call_vprc1 jsr snputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla // display_action_text(info_text) - // [2796] call display_action_text - // [1357] phi from vera_verify::@23 to display_action_text [phi:vera_verify::@23->display_action_text] - // [1357] phi display_action_text::info_text#25 = info_text [phi:vera_verify::@23->display_action_text#0] -- pbuz1=pbuc1 - lda #<@info_text + // [2063] call display_action_text + // [845] phi from display_action_text_reading::@13 to display_action_text [phi:display_action_text_reading::@13->display_action_text] + // [845] phi display_action_text::info_text#17 = info_text [phi:display_action_text_reading::@13->display_action_text#0] -- pbuz1=pbuc1 + lda #@info_text + lda #>info_text sta.z display_action_text.info_text+1 jsr display_action_text - // [2748] phi from vera_verify::@23 to vera_verify::@1 [phi:vera_verify::@23->vera_verify::@1] - // [2748] phi vera_verify::y#3 = vera_verify::y#10 [phi:vera_verify::@23->vera_verify::@1#0] -- register_copy - // [2748] phi vera_verify::progress_row_current#3 = vera_verify::progress_row_current#11 [phi:vera_verify::@23->vera_verify::@1#1] -- register_copy - // [2748] phi vera_verify::vera_different_bytes#11 = vera_verify::vera_different_bytes#1 [phi:vera_verify::@23->vera_verify::@1#2] -- register_copy - // [2748] phi vera_verify::vera_bram_ptr#10 = vera_verify::vera_bram_ptr#11 [phi:vera_verify::@23->vera_verify::@1#3] -- register_copy - // [2748] phi vera_verify::vera_bram_bank#11 = vera_verify::vera_bram_bank#10 [phi:vera_verify::@23->vera_verify::@1#4] -- register_copy - // [2748] phi vera_verify::vera_address#11 = vera_verify::vera_address#1 [phi:vera_verify::@23->vera_verify::@1#5] -- register_copy - jmp __b1 - // vera_verify::@4 - __b4: - // cputc('*') - // [2797] stackpush(char) = '*' -- _stackpushbyte_=vbuc1 - lda #'*' - pha - // [2798] callexecute cputc -- call_vprc1 - jsr cputc - // sideeffect stackpullpadding(1) -- _stackpullpadding_1 - pla - jmp __b5 - .segment DataVera - info_text: .text "Comparing VERA ..." + // display_action_text_reading::@return + // } + // [2064] return + rts + .segment Data + s2: .text "/" .byte 0 - vera_boundary: .dword 0 - .label equal_bytes = vera_compare.equal_bytes - y: .byte 0 - vera_address: .dword 0 - vera_bram_bank: .byte 0 - vera_different_bytes: .dword 0 - .label return = vera_different_bytes - progress_row_current: .word 0 + s3: .text " -> RAM:" + .byte 0 + s5: .text " ..." + .byte 0 + .label bytes = printf_ulong.uvalue + .label bram_bank = printf_uchar.uvalue } -.segment CodeVera - // vera_erase -vera_erase: { - .label vera_erase__0 = $cc - // BYTE2(vera_file_size) - // [2800] vera_erase::$0 = byte2 vera_file_size#1 -- vbuz1=_byte2_vdum2 - lda vera_file_size+2 - sta.z vera_erase__0 - // unsigned char vera_total_64k_blocks = BYTE2(vera_file_size)+1 - // [2801] vera_erase::vera_total_64k_blocks#0 = vera_erase::$0 + 1 -- vbum1=vbuz2_plus_1 - inc - sta vera_total_64k_blocks - // [2802] phi from vera_erase to vera_erase::@1 [phi:vera_erase->vera_erase::@1] - // [2802] phi vera_erase::vera_current_64k_block#2 = 0 [phi:vera_erase->vera_erase::@1#0] -- vbum1=vbuc1 +.segment Code + // fgets +/** + * @brief Load a file to ram or (banked ram located between address 0xA000 and 0xBFFF), incrementing the banks. + * This function uses the new CX16 macptr kernal API at address $FF44. + * + * @param sptr The pointer between 0xA000 and 0xBFFF in banked ram. + * @param size The amount of bytes to be read. + * @param filename Name of the file to be loaded. + * @return ptr the pointer advanced to the point where the stream ends. + */ +// __mem() unsigned int fgets(__zp($49) char *ptr, unsigned int size, __zp($4b) struct $2 *stream) +fgets: { + .label fgets__1 = $38 + .label fgets__8 = $39 + .label fgets__9 = $3a + .label fgets__13 = $4d + .label ptr = $49 + .label stream = $4b + // unsigned char sp = (unsigned char)stream + // [2065] fgets::sp#0 = (char)fgets::stream#0 -- vbum1=_byte_pssz2 + lda.z stream + sta sp + // cbm_k_chkin(__logical) + // [2066] fgets::cbm_k_chkin1_channel = ((char *)&__stdio_file+$40)[fgets::sp#0] -- vbum1=pbuc1_derefidx_vbum2 + tay + lda __stdio_file+$40,y + sta cbm_k_chkin1_channel + // fgets::cbm_k_chkin1 + // char status + // [2067] fgets::cbm_k_chkin1_status = 0 -- vbum1=vbuc1 lda #0 - sta vera_current_64k_block - // vera_erase::@1 - __b1: - // while(vera_current_64k_block < vera_total_64k_blocks) - // [2803] if(vera_erase::vera_current_64k_block#2vera_erase::@1] - // [2802] phi vera_erase::vera_current_64k_block#2 = vera_erase::vera_current_64k_block#1 [phi:vera_erase::@2->vera_erase::@1#0] -- register_copy - jmp __b1 - .segment DataVera - vera_total_64k_blocks: .byte 0 - vera_current_64k_block: .byte 0 -} -.segment CodeVera - // vera_flash -vera_flash: { - .label vera_flash__18 = $ac - .label vera_bram_ptr = $7d - // display_action_progress("Flashing ... (-) equal, (+) flashed, (!) error.") - // [2807] call display_action_progress - // Now we compare the RAM with the actual ROM contents. - // [904] phi from vera_flash to display_action_progress [phi:vera_flash->display_action_progress] - // [904] phi display_action_progress::info_text#27 = string_0 [phi:vera_flash->display_action_progress#0] -- pbuz1=pbuc1 - lda #string_0 - sta.z display_action_progress.info_text+1 - jsr display_action_progress - // vera_flash::@14 - // [2808] spi_manufacturer#596 = spi_read::return#0 -- vbum1=vbum2 - lda spi_read.return - sta spi_manufacturer - // [2809] spi_memory_type#597 = spi_read::return#1 -- vbum1=vbum2 - lda spi_read.return_1 - sta spi_memory_type - // [2810] spi_memory_capacity#598 = spi_read::return#2 -- vbum1=vbum2 - lda spi_read.return_2 - sta spi_memory_capacity - // display_info_vera(STATUS_FLASHING, "Flashing ...") - // [2811] call display_info_vera - // [998] phi from vera_flash::@14 to display_info_vera [phi:vera_flash::@14->display_info_vera] - // [998] phi display_info_vera::info_text#19 = info_text1 [phi:vera_flash::@14->display_info_vera#0] -- pbuz1=pbuc1 - lda #info_text1 - sta.z display_info_vera.info_text+1 - // [998] phi spi_memory_capacity#106 = spi_memory_capacity#598 [phi:vera_flash::@14->display_info_vera#1] -- register_copy - // [998] phi spi_memory_type#107 = spi_memory_type#597 [phi:vera_flash::@14->display_info_vera#2] -- register_copy - // [998] phi spi_manufacturer#108 = spi_manufacturer#596 [phi:vera_flash::@14->display_info_vera#3] -- register_copy - // [998] phi display_info_vera::info_status#19 = STATUS_FLASHING [phi:vera_flash::@14->display_info_vera#4] -- vbum1=vbuc1 - lda #STATUS_FLASHING - sta display_info_vera.info_status - jsr display_info_vera - // [2812] phi from vera_flash::@14 to vera_flash::@1 [phi:vera_flash::@14->vera_flash::@1] - // [2812] phi vera_flash::vera_bram_ptr#10 = (char *)$a000 [phi:vera_flash::@14->vera_flash::@1#0] -- pbuz1=pbuc1 - lda #<$a000 - sta.z vera_bram_ptr - lda #>$a000 - sta.z vera_bram_ptr+1 - // [2812] phi vera_flash::vera_bram_bank#11 = 1 [phi:vera_flash::@14->vera_flash::@1#1] -- vbum1=vbuc1 - lda #1 - sta vera_bram_bank - // [2812] phi vera_flash::y_sector#14 = PROGRESS_Y [phi:vera_flash::@14->vera_flash::@1#2] -- vbum1=vbuc1 - lda #PROGRESS_Y - sta y_sector - // [2812] phi vera_flash::x_sector#14 = PROGRESS_X [phi:vera_flash::@14->vera_flash::@1#3] -- vbum1=vbuc1 - lda #PROGRESS_X - sta x_sector - // [2812] phi vera_flash::return#2 = 0 [phi:vera_flash::@14->vera_flash::@1#4] -- vdum1=vduc1 + // [2072] fgets::cbm_k_readst1_return#1 = fgets::cbm_k_readst1_return#0 + // fgets::@9 + // cbm_k_readst() + // [2073] fgets::$1 = fgets::cbm_k_readst1_return#1 -- vbuz1=vbum2 + sta.z fgets__1 + // __status = cbm_k_readst() + // [2074] ((char *)&__stdio_file+$46)[fgets::sp#0] = fgets::$1 -- pbuc1_derefidx_vbum1=vbuz2 + ldy sp + sta __stdio_file+$46,y + // if (__status) + // [2075] if(0==((char *)&__stdio_file+$46)[fgets::sp#0]) goto fgets::@1 -- 0_eq_pbuc1_derefidx_vbum1_then_la1 + lda __stdio_file+$46,y + cmp #0 + beq __b8 + // [2076] phi from fgets::@10 fgets::@3 fgets::@9 to fgets::@return [phi:fgets::@10/fgets::@3/fgets::@9->fgets::@return] + __b1: + // [2076] phi fgets::return#1 = 0 [phi:fgets::@10/fgets::@3/fgets::@9->fgets::@return#0] -- vwum1=vbuc1 lda #<0 sta return sta return+1 - lda #<0>>$10 - sta return+2 - lda #>0>>$10 - sta return+3 - // [2812] phi from vera_flash::@11 to vera_flash::@1 [phi:vera_flash::@11->vera_flash::@1] - // [2812] phi vera_flash::vera_bram_ptr#10 = vera_flash::vera_bram_ptr#18 [phi:vera_flash::@11->vera_flash::@1#0] -- register_copy - // [2812] phi vera_flash::vera_bram_bank#11 = vera_flash::vera_bram_bank#14 [phi:vera_flash::@11->vera_flash::@1#1] -- register_copy - // [2812] phi vera_flash::y_sector#14 = vera_flash::y_sector#14 [phi:vera_flash::@11->vera_flash::@1#2] -- register_copy - // [2812] phi vera_flash::x_sector#14 = vera_flash::x_sector#1 [phi:vera_flash::@11->vera_flash::@1#3] -- register_copy - // [2812] phi vera_flash::return#2 = vera_flash::vera_address_page#12 [phi:vera_flash::@11->vera_flash::@1#4] -- register_copy - // vera_flash::@1 - __b1: - // while (vera_address_page < vera_file_size) - // [2813] if(vera_flash::return#2display_action_text_flashed] - // [2926] phi display_action_text_flashed::chip#3 = vera_flash::chip [phi:vera_flash::@3->display_action_text_flashed#0] -- pbuz1=pbuc1 - lda #chip - sta.z display_action_text_flashed.chip+1 - // [2926] phi display_action_text_flashed::bytes#3 = display_action_text_flashed::bytes#0 [phi:vera_flash::@3->display_action_text_flashed#1] -- register_copy - jsr display_action_text_flashed - // [2816] phi from vera_flash::@3 to vera_flash::@16 [phi:vera_flash::@3->vera_flash::@16] - // vera_flash::@16 - // wait_moment(32) - // [2817] call wait_moment - // [1310] phi from vera_flash::@16 to wait_moment [phi:vera_flash::@16->wait_moment] - // [1310] phi wait_moment::w#13 = $20 [phi:vera_flash::@16->wait_moment#0] -- vbum1=vbuc1 - lda #$20 - sta wait_moment.w - jsr wait_moment - // vera_flash::@return + // fgets::@return // } - // [2818] return + // [2077] return rts - // vera_flash::@2 - __b2: - // unsigned long vera_page_boundary = vera_address_page + VERA_PROGRESS_PAGE - // [2819] vera_flash::vera_page_boundary#0 = vera_flash::return#2 + VERA_PROGRESS_PAGE -- vdum1=vdum2_plus_vwuc1 - // {asm{.byte $db}} - clc - lda return - adc #VERA_PROGRESS_PAGE - sta vera_page_boundary+1 - lda return+2 - adc #0 - sta vera_page_boundary+2 - lda return+3 - adc #0 - sta vera_page_boundary+3 - // cputcxy(x,y,'.') - // [2820] cputcxy::x#0 = vera_flash::x_sector#14 -- vbum1=vbum2 - lda x_sector - sta cputcxy.x - // [2821] cputcxy::y#0 = vera_flash::y_sector#14 -- vbum1=vbum2 - lda y_sector - sta cputcxy.y - // [2822] call cputcxy - // [2293] phi from vera_flash::@2 to cputcxy [phi:vera_flash::@2->cputcxy] - // [2293] phi cputcxy::c#17 = '.' [phi:vera_flash::@2->cputcxy#0] -- vbum1=vbuc1 - lda #'.' - sta cputcxy.c - // [2293] phi cputcxy::y#17 = cputcxy::y#0 [phi:vera_flash::@2->cputcxy#1] -- register_copy - // [2293] phi cputcxy::x#17 = cputcxy::x#0 [phi:vera_flash::@2->cputcxy#2] -- register_copy - jsr cputcxy - // vera_flash::@15 - // cputc('.') - // [2823] stackpush(char) = '.' -- _stackpushbyte_=vbuc1 - lda #'.' - pha - // [2824] callexecute cputc -- call_vprc1 - jsr cputc - // sideeffect stackpullpadding(1) -- _stackpullpadding_1 - pla - // vera_flash::bank_set_bram1 - // BRAM = bank - // [2826] BRAM = vera_flash::vera_bram_bank#11 -- vbuz1=vbum2 - lda vera_bram_bank - sta.z BRAM - // [2827] vera_flash::vera_address#13 = vera_flash::return#2 -- vdum1=vdum2 - lda return - sta vera_address - lda return+1 - sta vera_address+1 - lda return+2 - sta vera_address+2 - lda return+3 - sta vera_address+3 - // [2828] phi from vera_flash::@17 vera_flash::bank_set_bram1 to vera_flash::@5 [phi:vera_flash::@17/vera_flash::bank_set_bram1->vera_flash::@5] - // [2828] phi vera_flash::vera_address_page#12 = vera_flash::vera_address_page#1 [phi:vera_flash::@17/vera_flash::bank_set_bram1->vera_flash::@5#0] -- register_copy - // [2828] phi vera_flash::vera_bram_ptr#13 = vera_flash::vera_bram_ptr#1 [phi:vera_flash::@17/vera_flash::bank_set_bram1->vera_flash::@5#1] -- register_copy - // [2828] phi vera_flash::vera_address#10 = vera_flash::vera_address#1 [phi:vera_flash::@17/vera_flash::bank_set_bram1->vera_flash::@5#2] -- register_copy - // vera_flash::@5 - __b5: - // while (vera_address < vera_page_boundary) - // [2829] if(vera_flash::vera_address#10$c000 - bne __b10 - lda.z vera_bram_ptr - cmp #<$c000 - bne __b10 - // vera_flash::@12 - // vera_bram_bank++; - // [2831] vera_flash::vera_bram_bank#1 = ++ vera_flash::vera_bram_bank#11 -- vbum1=_inc_vbum1 - inc vera_bram_bank - // [2832] phi from vera_flash::@12 to vera_flash::@10 [phi:vera_flash::@12->vera_flash::@10] - // [2832] phi vera_flash::vera_bram_bank#21 = vera_flash::vera_bram_bank#1 [phi:vera_flash::@12->vera_flash::@10#0] -- register_copy - // [2832] phi vera_flash::vera_bram_ptr#7 = (char *)$a000 [phi:vera_flash::@12->vera_flash::@10#1] -- pbuz1=pbuc1 - lda #<$a000 - sta.z vera_bram_ptr - lda #>$a000 - sta.z vera_bram_ptr+1 - // [2832] phi from vera_flash::@4 to vera_flash::@10 [phi:vera_flash::@4->vera_flash::@10] - // [2832] phi vera_flash::vera_bram_bank#21 = vera_flash::vera_bram_bank#11 [phi:vera_flash::@4->vera_flash::@10#0] -- register_copy - // [2832] phi vera_flash::vera_bram_ptr#7 = vera_flash::vera_bram_ptr#13 [phi:vera_flash::@4->vera_flash::@10#1] -- register_copy - // vera_flash::@10 - __b10: - // if (vera_bram_ptr == RAM_HIGH) - // [2833] if(vera_flash::vera_bram_ptr#7!=$9800) goto vera_flash::@18 -- pbuz1_neq_vwuc1_then_la1 - lda.z vera_bram_ptr+1 - cmp #>$9800 - bne __b11 - lda.z vera_bram_ptr - cmp #<$9800 - bne __b11 - // [2835] phi from vera_flash::@10 to vera_flash::@11 [phi:vera_flash::@10->vera_flash::@11] - // [2835] phi vera_flash::vera_bram_ptr#18 = (char *)$a000 [phi:vera_flash::@10->vera_flash::@11#0] -- pbuz1=pbuc1 - lda #<$a000 - sta.z vera_bram_ptr - lda #>$a000 - sta.z vera_bram_ptr+1 - // [2835] phi vera_flash::vera_bram_bank#14 = 1 [phi:vera_flash::@10->vera_flash::@11#1] -- vbum1=vbuc1 - lda #1 - sta vera_bram_bank - // [2834] phi from vera_flash::@10 to vera_flash::@18 [phi:vera_flash::@10->vera_flash::@18] - // vera_flash::@18 - // [2835] phi from vera_flash::@18 to vera_flash::@11 [phi:vera_flash::@18->vera_flash::@11] - // [2835] phi vera_flash::vera_bram_ptr#18 = vera_flash::vera_bram_ptr#7 [phi:vera_flash::@18->vera_flash::@11#0] -- register_copy - // [2835] phi vera_flash::vera_bram_bank#14 = vera_flash::vera_bram_bank#21 [phi:vera_flash::@18->vera_flash::@11#1] -- register_copy - // vera_flash::@11 - __b11: - // x_sector += 2 - // [2836] vera_flash::x_sector#1 = vera_flash::x_sector#14 + 2 -- vbum1=vbum1_plus_2 - lda x_sector - clc - adc #2 - sta x_sector - // vera_address_page % VERA_PROGRESS_ROW - // [2837] vera_flash::$18 = vera_flash::vera_address_page#12 & VERA_PROGRESS_ROW-1 -- vduz1=vdum2_band_vduc1 - lda vera_address_page - and #VERA_PROGRESS_ROW-1 - sta.z vera_flash__18+1 - lda vera_address_page+2 - and #>$10 - sta.z vera_flash__18+2 - lda vera_address_page+3 - and #>VERA_PROGRESS_ROW-1>>$10 - sta.z vera_flash__18+3 - // if (!(vera_address_page % VERA_PROGRESS_ROW)) - // [2838] if(0!=vera_flash::$18) goto vera_flash::@1 -- 0_neq_vduz1_then_la1 - lda.z vera_flash__18 - ora.z vera_flash__18+1 - ora.z vera_flash__18+2 - ora.z vera_flash__18+3 - beq !__b1+ - jmp __b1 - !__b1: - // vera_flash::@13 - // y_sector++; - // [2839] vera_flash::y_sector#1 = ++ vera_flash::y_sector#14 -- vbum1=_inc_vbum1 - inc y_sector - // [2812] phi from vera_flash::@13 to vera_flash::@1 [phi:vera_flash::@13->vera_flash::@1] - // [2812] phi vera_flash::vera_bram_ptr#10 = vera_flash::vera_bram_ptr#18 [phi:vera_flash::@13->vera_flash::@1#0] -- register_copy - // [2812] phi vera_flash::vera_bram_bank#11 = vera_flash::vera_bram_bank#14 [phi:vera_flash::@13->vera_flash::@1#1] -- register_copy - // [2812] phi vera_flash::y_sector#14 = vera_flash::y_sector#1 [phi:vera_flash::@13->vera_flash::@1#2] -- register_copy - // [2812] phi vera_flash::x_sector#14 = PROGRESS_X [phi:vera_flash::@13->vera_flash::@1#3] -- vbum1=vbuc1 - lda #PROGRESS_X - sta x_sector - // [2812] phi vera_flash::return#2 = vera_flash::vera_address_page#12 [phi:vera_flash::@13->vera_flash::@1#4] -- register_copy - jmp __b1 - // vera_flash::@6 - __b6: - // display_action_text_flashing(VERA_PROGRESS_PAGE, "VERA", vera_bram_bank, vera_bram_ptr, vera_address) - // [2840] display_action_text_flashing::bram_bank#0 = vera_flash::vera_bram_bank#11 -- vbum1=vbum2 - lda vera_bram_bank - sta display_action_text_flashing.bram_bank - // [2841] display_action_text_flashing::bram_ptr#0 = vera_flash::vera_bram_ptr#13 -- pbuz1=pbuz2 - lda.z vera_bram_ptr - sta.z display_action_text_flashing.bram_ptr - lda.z vera_bram_ptr+1 - sta.z display_action_text_flashing.bram_ptr+1 - // [2842] display_action_text_flashing::address#0 = vera_flash::vera_address#10 -- vdum1=vdum2 - lda vera_address - sta display_action_text_flashing.address - lda vera_address+1 - sta display_action_text_flashing.address+1 - lda vera_address+2 - sta display_action_text_flashing.address+2 - lda vera_address+3 - sta display_action_text_flashing.address+3 - // [2843] call display_action_text_flashing - // [2955] phi from vera_flash::@6 to display_action_text_flashing [phi:vera_flash::@6->display_action_text_flashing] - // [2955] phi display_action_text_flashing::address#10 = display_action_text_flashing::address#0 [phi:vera_flash::@6->display_action_text_flashing#0] -- register_copy - // [2955] phi display_action_text_flashing::chip#10 = vera_flash::chip [phi:vera_flash::@6->display_action_text_flashing#1] -- pbuz1=pbuc1 - lda #chip - sta.z display_action_text_flashing.chip+1 - // [2955] phi display_action_text_flashing::bram_ptr#3 = display_action_text_flashing::bram_ptr#0 [phi:vera_flash::@6->display_action_text_flashing#2] -- register_copy - // [2955] phi display_action_text_flashing::bram_bank#3 = display_action_text_flashing::bram_bank#0 [phi:vera_flash::@6->display_action_text_flashing#3] -- register_copy - // [2955] phi display_action_text_flashing::bytes#3 = VERA_PROGRESS_PAGE [phi:vera_flash::@6->display_action_text_flashing#4] -- vdum1=vduc1 - lda #VERA_PROGRESS_PAGE - sta display_action_text_flashing.bytes+1 - lda #>$10 - sta display_action_text_flashing.bytes+2 - lda #>VERA_PROGRESS_PAGE>>$10 - sta display_action_text_flashing.bytes+3 - jsr display_action_text_flashing - // [2844] phi from vera_flash::@6 to vera_flash::@7 [phi:vera_flash::@6->vera_flash::@7] - // [2844] phi vera_flash::i#2 = 0 [phi:vera_flash::@6->vera_flash::@7#0] -- vwum1=vwuc1 + // [2078] phi from fgets::@13 to fgets::@1 [phi:fgets::@13->fgets::@1] + // [2078] phi fgets::read#10 = fgets::read#1 [phi:fgets::@13->fgets::@1#0] -- register_copy + // [2078] phi fgets::remaining#11 = fgets::remaining#1 [phi:fgets::@13->fgets::@1#1] -- register_copy + // [2078] phi fgets::ptr#10 = fgets::ptr#12 [phi:fgets::@13->fgets::@1#2] -- register_copy + // [2078] phi from fgets::@9 to fgets::@1 [phi:fgets::@9->fgets::@1] + __b8: + // [2078] phi fgets::read#10 = 0 [phi:fgets::@9->fgets::@1#0] -- vwum1=vwuc1 lda #<0 - sta i - sta i+1 - // vera_flash::@7 - __b7: - // for(unsigned int i=0; i<=255; i++) - // [2845] if(vera_flash::i#2<=$ff) goto vera_flash::@8 -- vwum1_le_vbuc1_then_la1 - lda #$ff - cmp i + sta read + sta read+1 + // [2078] phi fgets::remaining#11 = VERA_PROGRESS_CELL [phi:fgets::@9->fgets::@1#1] -- vwum1=vbuc1 + lda #VERA_PROGRESS_CELL + sta remaining+1 + // [2078] phi fgets::ptr#10 = fgets::ptr#2 [phi:fgets::@9->fgets::@1#2] -- register_copy + // fgets::@1 + // fgets::@6 + __b6: + // if (remaining >= 512) + // [2079] if(fgets::remaining#11>=$200) goto fgets::@2 -- vwum1_ge_vwuc1_then_la1 + lda remaining+1 + cmp #>$200 bcc !+ - lda i+1 - beq __b8 - !: - // vera_flash::@9 - // cputcxy(x,y,'+') - // [2846] cputcxy::x#1 = vera_flash::x_sector#14 -- vbum1=vbum2 - lda x_sector - sta cputcxy.x - // [2847] cputcxy::y#1 = vera_flash::y_sector#14 -- vbum1=vbum2 - lda y_sector - sta cputcxy.y - // [2848] call cputcxy - // [2293] phi from vera_flash::@9 to cputcxy [phi:vera_flash::@9->cputcxy] - // [2293] phi cputcxy::c#17 = '+' [phi:vera_flash::@9->cputcxy#0] -- vbum1=vbuc1 - lda #'+' - sta cputcxy.c - // [2293] phi cputcxy::y#17 = cputcxy::y#1 [phi:vera_flash::@9->cputcxy#1] -- register_copy - // [2293] phi cputcxy::x#17 = cputcxy::x#1 [phi:vera_flash::@9->cputcxy#2] -- register_copy - jsr cputcxy - // vera_flash::@17 - // cputc('+') - // [2849] stackpush(char) = '+' -- _stackpushbyte_=vbuc1 - lda #'+' - pha - // [2850] callexecute cputc -- call_vprc1 - jsr cputc - // sideeffect stackpullpadding(1) -- _stackpullpadding_1 - pla - // vera_bram_ptr += VERA_PROGRESS_PAGE - // [2852] vera_flash::vera_bram_ptr#1 = vera_flash::vera_bram_ptr#13 + VERA_PROGRESS_PAGE -- pbuz1=pbuz1_plus_vwuc1 - lda.z vera_bram_ptr - clc - adc #VERA_PROGRESS_PAGE - sta.z vera_bram_ptr+1 - // vera_address += VERA_PROGRESS_PAGE - // [2853] vera_flash::vera_address#1 = vera_flash::vera_address#10 + VERA_PROGRESS_PAGE -- vdum1=vdum1_plus_vwuc1 - clc - lda vera_address - adc #VERA_PROGRESS_PAGE - sta vera_address+1 - lda vera_address+2 - adc #0 - sta vera_address+2 - lda vera_address+3 - adc #0 - sta vera_address+3 - // vera_address_page += VERA_PROGRESS_PAGE - // [2854] vera_flash::vera_address_page#1 = vera_flash::vera_address_page#12 + VERA_PROGRESS_PAGE -- vdum1=vdum1_plus_vwuc1 - clc - lda vera_address_page - adc #VERA_PROGRESS_PAGE - sta vera_address_page+1 - lda vera_address_page+2 - adc #0 - sta vera_address_page+2 - lda vera_address_page+3 - adc #0 - sta vera_address_page+3 - jmp __b5 - // vera_flash::@8 - __b8: - // for(unsigned int i=0; i<=255; i++) - // [2855] vera_flash::i#1 = ++ vera_flash::i#2 -- vwum1=_inc_vwum1 - inc i - bne !+ - inc i+1 + beq !__b2+ + jmp __b2 + !__b2: + lda remaining + cmp #<$200 + bcc !__b2+ + jmp __b2 + !__b2: !: - // [2844] phi from vera_flash::@8 to vera_flash::@7 [phi:vera_flash::@8->vera_flash::@7] - // [2844] phi vera_flash::i#2 = vera_flash::i#1 [phi:vera_flash::@8->vera_flash::@7#0] -- register_copy - jmp __b7 - .segment DataVera - chip: .text "VERA" - .byte 0 - vera_page_boundary: .dword 0 - // TODO: ERROR!!! - return: .dword 0 - i: .word 0 - vera_address: .dword 0 - .label vera_address_page = return - vera_bram_bank: .byte 0 - x_sector: .byte 0 - y_sector: .byte 0 -} -.segment Code - // display_info_roms -/** - * @brief Display all the ROM statuses. - * - * @param info_status The status. - * @param info_text The status text. - */ -// void display_info_roms(char info_status, char *info_text) -display_info_roms: { - .label info_text = 0 - // [2857] phi from display_info_roms to display_info_roms::@1 [phi:display_info_roms->display_info_roms::@1] - // [2857] phi display_info_roms::rom_chip#2 = 0 [phi:display_info_roms->display_info_roms::@1#0] -- vbum1=vbuc1 + // fgets::@7 + // cx16_k_macptr(remaining, ptr) + // [2080] cx16_k_macptr::bytes = fgets::remaining#11 -- vbum1=vwum2 + lda remaining + sta cx16_k_macptr.bytes + // [2081] cx16_k_macptr::buffer = (void *)fgets::ptr#10 -- pvoz1=pvoz2 + lda.z ptr + sta.z cx16_k_macptr.buffer + lda.z ptr+1 + sta.z cx16_k_macptr.buffer+1 + // [2082] call cx16_k_macptr + jsr cx16_k_macptr + // [2083] cx16_k_macptr::return#4 = cx16_k_macptr::return#1 + // fgets::@12 + __b12: + // bytes = cx16_k_macptr(remaining, ptr) + // [2084] fgets::bytes#3 = cx16_k_macptr::return#4 + // [2085] phi from fgets::@11 fgets::@12 to fgets::cbm_k_readst2 [phi:fgets::@11/fgets::@12->fgets::cbm_k_readst2] + // [2085] phi fgets::bytes#10 = fgets::bytes#2 [phi:fgets::@11/fgets::@12->fgets::cbm_k_readst2#0] -- register_copy + // fgets::cbm_k_readst2 + // char status + // [2086] fgets::cbm_k_readst2_status = 0 -- vbum1=vbuc1 lda #0 - sta rom_chip - // display_info_roms::@1 - __b1: - // for(unsigned char rom_chip=0; rom_chip<8; rom_chip++) - // [2858] if(display_info_roms::rom_chip#2<8) goto display_info_roms::@2 -- vbum1_lt_vbuc1_then_la1 - lda rom_chip - cmp #8 - bcc __b2 - // display_info_roms::@return + sta cbm_k_readst2_status + // asm + // asm { jsrCBM_READST stastatus } + jsr CBM_READST + sta cbm_k_readst2_status + // return status; + // [2088] fgets::cbm_k_readst2_return#0 = fgets::cbm_k_readst2_status -- vbum1=vbum2 + sta cbm_k_readst2_return + // fgets::cbm_k_readst2_@return // } - // [2859] return - rts - // display_info_roms::@2 - __b2: - // display_info_rom(rom_chip, info_status, info_text) - // [2860] display_info_rom::rom_chip#4 = display_info_roms::rom_chip#2 -- vbum1=vbum2 - lda rom_chip - sta display_info_rom.rom_chip - // [2861] call display_info_rom - // [1546] phi from display_info_roms::@2 to display_info_rom [phi:display_info_roms::@2->display_info_rom] - // [1546] phi display_info_rom::info_text#17 = display_info_roms::info_text#1 [phi:display_info_roms::@2->display_info_rom#0] -- pbuz1=pbuc1 - lda #info_text - sta.z display_info_rom.info_text+1 - // [1546] phi display_info_rom::rom_chip#17 = display_info_rom::rom_chip#4 [phi:display_info_roms::@2->display_info_rom#1] -- register_copy - // [1546] phi display_info_rom::info_status#17 = STATUS_ERROR [phi:display_info_roms::@2->display_info_rom#2] -- vbum1=vbuc1 - lda #STATUS_ERROR - sta display_info_rom.info_status - jsr display_info_rom - // display_info_roms::@3 - // for(unsigned char rom_chip=0; rom_chip<8; rom_chip++) - // [2862] display_info_roms::rom_chip#1 = ++ display_info_roms::rom_chip#2 -- vbum1=_inc_vbum1 - inc rom_chip - // [2857] phi from display_info_roms::@3 to display_info_roms::@1 [phi:display_info_roms::@3->display_info_roms::@1] - // [2857] phi display_info_roms::rom_chip#2 = display_info_roms::rom_chip#1 [phi:display_info_roms::@3->display_info_roms::@1#0] -- register_copy + // [2089] fgets::cbm_k_readst2_return#1 = fgets::cbm_k_readst2_return#0 + // fgets::@10 + // cbm_k_readst() + // [2090] fgets::$8 = fgets::cbm_k_readst2_return#1 -- vbuz1=vbum2 + sta.z fgets__8 + // __status = cbm_k_readst() + // [2091] ((char *)&__stdio_file+$46)[fgets::sp#0] = fgets::$8 -- pbuc1_derefidx_vbum1=vbuz2 + ldy sp + sta __stdio_file+$46,y + // __status & 0xBF + // [2092] fgets::$9 = ((char *)&__stdio_file+$46)[fgets::sp#0] & $bf -- vbuz1=pbuc1_derefidx_vbum2_band_vbuc2 + lda #$bf + and __stdio_file+$46,y + sta.z fgets__9 + // if (__status & 0xBF) + // [2093] if(0==fgets::$9) goto fgets::@3 -- 0_eq_vbuz1_then_la1 + beq __b3 + jmp __b1 + // fgets::@3 + __b3: + // if (bytes == 0xFFFF) + // [2094] if(fgets::bytes#10!=$ffff) goto fgets::@4 -- vwum1_neq_vwuc1_then_la1 + lda bytes+1 + cmp #>$ffff + bne __b4 + lda bytes + cmp #<$ffff + bne __b4 jmp __b1 + // fgets::@4 + __b4: + // read += bytes + // [2095] fgets::read#1 = fgets::read#10 + fgets::bytes#10 -- vwum1=vwum1_plus_vwum2 + clc + lda read + adc bytes + sta read + lda read+1 + adc bytes+1 + sta read+1 + // ptr += bytes + // [2096] fgets::ptr#0 = fgets::ptr#10 + fgets::bytes#10 -- pbuz1=pbuz1_plus_vwum2 + clc + lda.z ptr + adc bytes + sta.z ptr + lda.z ptr+1 + adc bytes+1 + sta.z ptr+1 + // BYTE1(ptr) + // [2097] fgets::$13 = byte1 fgets::ptr#0 -- vbuz1=_byte1_pbuz2 + sta.z fgets__13 + // if (BYTE1(ptr) == 0xC0) + // [2098] if(fgets::$13!=$c0) goto fgets::@5 -- vbuz1_neq_vbuc1_then_la1 + lda #$c0 + cmp.z fgets__13 + bne __b5 + // fgets::@8 + // ptr -= 0x2000 + // [2099] fgets::ptr#1 = fgets::ptr#0 - $2000 -- pbuz1=pbuz1_minus_vwuc1 + lda.z ptr + sec + sbc #<$2000 + sta.z ptr + lda.z ptr+1 + sbc #>$2000 + sta.z ptr+1 + // [2100] phi from fgets::@4 fgets::@8 to fgets::@5 [phi:fgets::@4/fgets::@8->fgets::@5] + // [2100] phi fgets::ptr#12 = fgets::ptr#0 [phi:fgets::@4/fgets::@8->fgets::@5#0] -- register_copy + // fgets::@5 + __b5: + // remaining -= bytes + // [2101] fgets::remaining#1 = fgets::remaining#11 - fgets::bytes#10 -- vwum1=vwum1_minus_vwum2 + lda remaining + sec + sbc bytes + sta remaining + lda remaining+1 + sbc bytes+1 + sta remaining+1 + // while ((__status == 0) && ((size && remaining) || !size)) + // [2102] if(((char *)&__stdio_file+$46)[fgets::sp#0]==0) goto fgets::@13 -- pbuc1_derefidx_vbum1_eq_0_then_la1 + ldy sp + lda __stdio_file+$46,y + cmp #0 + beq __b13 + // [2076] phi from fgets::@13 fgets::@5 to fgets::@return [phi:fgets::@13/fgets::@5->fgets::@return] + // [2076] phi fgets::return#1 = fgets::read#1 [phi:fgets::@13/fgets::@5->fgets::@return#0] -- register_copy + rts + // fgets::@13 + __b13: + // while ((__status == 0) && ((size && remaining) || !size)) + // [2103] if(0!=fgets::remaining#1) goto fgets::@1 -- 0_neq_vwum1_then_la1 + lda remaining + ora remaining+1 + beq !__b6+ + jmp __b6 + !__b6: + rts + // fgets::@2 + __b2: + // cx16_k_macptr(512, ptr) + // [2104] cx16_k_macptr::bytes = $200 -- vbum1=vwuc1 + lda #<$200 + sta cx16_k_macptr.bytes + // [2105] cx16_k_macptr::buffer = (void *)fgets::ptr#10 -- pvoz1=pvoz2 + lda.z ptr + sta.z cx16_k_macptr.buffer + lda.z ptr+1 + sta.z cx16_k_macptr.buffer+1 + // [2106] call cx16_k_macptr + jsr cx16_k_macptr + // [2107] cx16_k_macptr::return#3 = cx16_k_macptr::return#1 + // fgets::@11 + // bytes = cx16_k_macptr(512, ptr) + // [2108] fgets::bytes#2 = cx16_k_macptr::return#3 + jmp __b12 .segment Data - rom_chip: .byte 0 + cbm_k_chkin1_channel: .byte 0 + cbm_k_chkin1_status: .byte 0 + cbm_k_readst1_status: .byte 0 + cbm_k_readst2_status: .byte 0 + sp: .byte 0 + cbm_k_readst1_return: .byte 0 + .label return = read + bytes: .word 0 + cbm_k_readst2_return: .byte 0 + read: .word 0 + remaining: .word 0 } -.segment CodeVera - // spi_deselect -spi_deselect: { - // *vera_reg_SPICtrl &= 0xfe - // [2863] *vera_reg_SPICtrl = *vera_reg_SPICtrl & $fe -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 - /* -.proc spi_deselect - lda Vera::Reg::SPICtrl - and #$fe - sta Vera::Reg::SPICtrl - jsr spi_read - rts -.endproc -*/ - lda #$fe - and vera_reg_SPICtrl - sta vera_reg_SPICtrl - // unsigned char value = spi_read() - // [2864] call spi_read - jsr spi_read - // spi_deselect::@return +.segment Code + // uctoa_append +// Used to convert a single digit of an unsigned number value to a string representation +// Counts a single digit up from '0' as long as the value is larger than sub. +// Each time the digit is increased sub is subtracted from value. +// - buffer : pointer to the char that receives the digit +// - value : The value where the digit will be derived from +// - sub : the value of a '1' in the digit. Subtracted continually while the digit is increased. +// (For decimal the subs used are 10000, 1000, 100, 10, 1) +// returns : the value reduced by sub * digit so that it is less than sub. +// __mem() char uctoa_append(__zp($45) char *buffer, __mem() char value, __mem() char sub) +uctoa_append: { + .label buffer = $45 + // [2110] phi from uctoa_append to uctoa_append::@1 [phi:uctoa_append->uctoa_append::@1] + // [2110] phi uctoa_append::digit#2 = 0 [phi:uctoa_append->uctoa_append::@1#0] -- vbum1=vbuc1 + lda #0 + sta digit + // [2110] 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) + // [2111] if(uctoa_append::value#2>=uctoa_append::sub#0) goto uctoa_append::@2 -- vbum1_ge_vbum2_then_la1 + lda value + cmp sub + bcs __b2 + // uctoa_append::@3 + // *buffer = DIGITS[digit] + // [2112] *uctoa_append::buffer#0 = DIGITS[uctoa_append::digit#2] -- _deref_pbuz1=pbuc1_derefidx_vbum2 + ldy digit + lda DIGITS,y + ldy #0 + sta (buffer),y + // uctoa_append::@return // } - // [2865] return + // [2113] return rts + // uctoa_append::@2 + __b2: + // digit++; + // [2114] uctoa_append::digit#1 = ++ uctoa_append::digit#2 -- vbum1=_inc_vbum1 + inc digit + // value -= sub + // [2115] uctoa_append::value#1 = uctoa_append::value#2 - uctoa_append::sub#0 -- vbum1=vbum1_minus_vbum2 + lda value + sec + sbc sub + sta value + // [2110] phi from uctoa_append::@2 to uctoa_append::@1 [phi:uctoa_append::@2->uctoa_append::@1] + // [2110] phi uctoa_append::digit#2 = uctoa_append::digit#1 [phi:uctoa_append::@2->uctoa_append::@1#0] -- register_copy + // [2110] phi uctoa_append::value#2 = uctoa_append::value#1 [phi:uctoa_append::@2->uctoa_append::@1#1] -- register_copy + jmp __b1 + .segment Data + .label value = printf_uchar.uvalue + .label sub = uctoa.digit_value + .label return = printf_uchar.uvalue + digit: .byte 0 } -.segment Code - // rom_address_from_bank -/** - * @brief Calculates the 22 bit ROM address from the 8 bit ROM bank. - * The ROM bank number is calcuated by taking the 8 bits and shifing those 14 bits to the left (bit 21-14). - * - * @param rom_bank The 8 bit ROM address. - * @return unsigned long The 22 bit ROM address. +.segment CodeVera + // spi_read_flash +// void spi_read_flash(unsigned long spi_data) +spi_read_flash: { + // spi_select() + // [2117] call spi_select + /* +; .X [7:0] +; .Y [15:8] +; .A [23:16] +.proc spi_read_flash + pha + + jsr spi_select + lda #$03 + jsr spi_write + pla + jsr spi_write + tya + jsr spi_write + txa + jsr spi_write + + rts +.endproc */ -/* inline */ -// __mem() unsigned long rom_address_from_bank(__mem() char rom_bank) -rom_address_from_bank: { - .label rom_address_from_bank__1 = $bc - // ((unsigned long)(rom_bank)) << 14 - // [2867] rom_address_from_bank::$1 = (unsigned long)rom_address_from_bank::rom_bank#3 -- vduz1=_dword_vbum2 - lda rom_bank - sta.z rom_address_from_bank__1 + // [2251] phi from spi_read_flash to spi_select [phi:spi_read_flash->spi_select] + jsr spi_select + // spi_read_flash::@1 + // spi_write(0x03) + // [2118] spi_write::data = 3 -- vbum1=vbuc1 + lda #3 + sta spi_write.data + // [2119] call spi_write + jsr spi_write + // spi_read_flash::@2 + // spi_write(BYTE2(spi_data)) + // [2120] spi_write::data = 0 -- vbum1=vbuc1 lda #0 - sta.z rom_address_from_bank__1+1 - sta.z rom_address_from_bank__1+2 - sta.z rom_address_from_bank__1+3 - // [2868] rom_address_from_bank::return#0 = rom_address_from_bank::$1 << $e -- vdum1=vduz2_rol_vbuc1 - ldy #$e - lda.z rom_address_from_bank__1 - sta return - lda.z rom_address_from_bank__1+1 - sta return+1 - lda.z rom_address_from_bank__1+2 - sta return+2 - lda.z rom_address_from_bank__1+3 - sta return+3 - cpy #0 - beq !e+ - !: - asl return - rol return+1 - rol return+2 - rol return+3 - dey - bne !- - !e: - // rom_address_from_bank::@return + sta spi_write.data + // [2121] call spi_write + jsr spi_write + // spi_read_flash::@3 + // spi_write(BYTE1(spi_data)) + // [2122] spi_write::data = 0 -- vbum1=vbuc1 + lda #0 + sta spi_write.data + // [2123] call spi_write + jsr spi_write + // spi_read_flash::@4 + // spi_write(BYTE0(spi_data)) + // [2124] spi_write::data = 0 -- vbum1=vbuc1 + lda #0 + sta spi_write.data + // [2125] call spi_write + jsr spi_write + // spi_read_flash::@return // } - // [2869] return + // [2126] return rts - .segment Data - .label return = rom_read.rom_address - rom_bank: .byte 0 - .label return_1 = rom_verify.rom_address - .label return_2 = rom_flash.rom_address_sector } -.segment Code - // rom_compare -// __mem() unsigned int rom_compare(__mem() char bank_ram, __zp($56) char *ptr_ram, __mem() unsigned long rom_compare_address, __mem() unsigned int rom_compare_size) -rom_compare: { - .label rom_compare__5 = $41 - .label rom_bank1_rom_compare__0 = $29 - .label rom_bank1_rom_compare__1 = $42 - .label rom_bank1_rom_compare__2 = $50 - .label rom_ptr1_rom_compare__0 = $4c - .label rom_ptr1_rom_compare__2 = $4c - .label rom_ptr1_return = $4c - .label ptr_rom = $4c - .label ptr_ram = $56 - // rom_compare::bank_set_bram1 + // vera_compare +// __mem() unsigned int vera_compare(__mem() char bank_ram, __zp($5b) char *bram_ptr, unsigned int vera_compare_size) +vera_compare: { + .label bram_ptr = $5b + // vera_compare::bank_set_bram1 // BRAM = bank - // [2871] BRAM = rom_compare::bank_set_bram1_bank#0 -- vbuz1=vbum2 - lda bank_set_bram1_bank + // [2128] BRAM = vera_compare::bank_ram#0 -- vbuz1=vbum2 + lda bank_ram sta.z BRAM - // rom_compare::rom_bank1 - // BYTE2(address) - // [2872] rom_compare::rom_bank1_$0 = byte2 rom_compare::rom_compare_address#3 -- vbuz1=_byte2_vdum2 - lda rom_compare_address+2 - sta.z rom_bank1_rom_compare__0 - // BYTE1(address) - // [2873] rom_compare::rom_bank1_$1 = byte1 rom_compare::rom_compare_address#3 -- vbuz1=_byte1_vdum2 - lda rom_compare_address+1 - sta.z rom_bank1_rom_compare__1 - // MAKEWORD(BYTE2(address),BYTE1(address)) - // [2874] rom_compare::rom_bank1_$2 = rom_compare::rom_bank1_$0 w= rom_compare::rom_bank1_$1 -- vwuz1=vbuz2_word_vbuz3 - lda.z rom_bank1_rom_compare__0 - sta.z rom_bank1_rom_compare__2+1 - lda.z rom_bank1_rom_compare__1 - sta.z rom_bank1_rom_compare__2 - // unsigned int bank_unshifted = MAKEWORD(BYTE2(address),BYTE1(address)) << 2 - // [2875] rom_compare::rom_bank1_bank_unshifted#0 = rom_compare::rom_bank1_$2 << 2 -- vwum1=vwuz2_rol_2 - asl - sta rom_bank1_bank_unshifted - lda.z rom_bank1_rom_compare__2+1 - rol - sta rom_bank1_bank_unshifted+1 - asl rom_bank1_bank_unshifted - rol rom_bank1_bank_unshifted+1 - // unsigned char bank = BYTE1(bank_unshifted) - // [2876] rom_compare::rom_bank1_return#0 = byte1 rom_compare::rom_bank1_bank_unshifted#0 -- vbum1=_byte1_vwum2 - lda rom_bank1_bank_unshifted+1 - sta rom_bank1_return - // rom_compare::rom_ptr1 - // (unsigned int)(address) & ROM_PTR_MASK - // [2877] rom_compare::rom_ptr1_$2 = (unsigned int)rom_compare::rom_compare_address#3 -- vwuz1=_word_vdum2 - lda rom_compare_address - sta.z rom_ptr1_rom_compare__2 - lda rom_compare_address+1 - sta.z rom_ptr1_rom_compare__2+1 - // [2878] rom_compare::rom_ptr1_$0 = rom_compare::rom_ptr1_$2 & $3fff -- vwuz1=vwuz1_band_vwuc1 - lda.z rom_ptr1_rom_compare__0 - and #<$3fff - sta.z rom_ptr1_rom_compare__0 - lda.z rom_ptr1_rom_compare__0+1 - and #>$3fff - sta.z rom_ptr1_rom_compare__0+1 - // ((unsigned int)(address) & ROM_PTR_MASK) + ROM_BASE - // [2879] rom_compare::rom_ptr1_return#0 = rom_compare::rom_ptr1_$0 + $c000 -- vwuz1=vwuz1_plus_vwuc1 - lda.z rom_ptr1_return - clc - adc #<$c000 - sta.z rom_ptr1_return - lda.z rom_ptr1_return+1 - adc #>$c000 - sta.z rom_ptr1_return+1 - // rom_compare::bank_set_brom1 - // BROM = bank - // [2880] BROM = rom_compare::rom_bank1_return#0 -- vbuz1=vbum2 - lda rom_bank1_return - sta.z BROM - // [2881] rom_compare::ptr_rom#9 = (char *)rom_compare::rom_ptr1_return#0 - // [2882] phi from rom_compare::bank_set_brom1 to rom_compare::@1 [phi:rom_compare::bank_set_brom1->rom_compare::@1] - // [2882] phi rom_compare::equal_bytes#2 = 0 [phi:rom_compare::bank_set_brom1->rom_compare::@1#0] -- vwum1=vwuc1 + // [2129] phi from vera_compare::bank_set_bram1 to vera_compare::@1 [phi:vera_compare::bank_set_bram1->vera_compare::@1] + // [2129] phi vera_compare::bram_ptr#2 = vera_compare::bram_ptr#0 [phi:vera_compare::bank_set_bram1->vera_compare::@1#0] -- register_copy + // [2129] phi vera_compare::equal_bytes#2 = 0 [phi:vera_compare::bank_set_bram1->vera_compare::@1#1] -- vwum1=vwuc1 lda #<0 sta equal_bytes sta equal_bytes+1 - // [2882] phi rom_compare::ptr_ram#4 = rom_compare::ptr_ram#10 [phi:rom_compare::bank_set_brom1->rom_compare::@1#1] -- register_copy - // [2882] phi rom_compare::ptr_rom#2 = rom_compare::ptr_rom#9 [phi:rom_compare::bank_set_brom1->rom_compare::@1#2] -- register_copy - // [2882] phi rom_compare::compared_bytes#2 = 0 [phi:rom_compare::bank_set_brom1->rom_compare::@1#3] -- vwum1=vwuc1 + // [2129] phi vera_compare::compared_bytes#2 = 0 [phi:vera_compare::bank_set_bram1->vera_compare::@1#2] -- vwum1=vwuc1 sta compared_bytes sta compared_bytes+1 - // rom_compare::@1 + // vera_compare::@1 __b1: - // while (compared_bytes < rom_compare_size) - // [2883] if(rom_compare::compared_bytes#2vera_compare::@2] + // vera_compare::@2 __b2: - // rom_byte_compare(ptr_rom, *ptr_ram) - // [2885] rom_byte_compare::ptr_rom#0 = rom_compare::ptr_rom#2 - // [2886] rom_byte_compare::value#0 = *rom_compare::ptr_ram#4 -- vbum1=_deref_pbuz2 + // unsigned char vera_byte = spi_read() + // [2133] call spi_read + jsr spi_read + // [2134] spi_read::return#12 = spi_read::return#4 + // vera_compare::@5 + // [2135] vera_compare::vera_byte#0 = spi_read::return#12 + // if (vera_byte == *bram_ptr) + // [2136] if(vera_compare::vera_byte#0!=*vera_compare::bram_ptr#2) goto vera_compare::@3 -- vbum1_neq__deref_pbuz2_then_la1 ldy #0 - lda (ptr_ram),y - sta rom_byte_compare.value - // [2887] call rom_byte_compare - jsr rom_byte_compare - // [2888] rom_byte_compare::return#2 = rom_byte_compare::return#0 - // rom_compare::@5 - // [2889] rom_compare::$5 = rom_byte_compare::return#2 -- vbuz1=vbum2 - lda rom_byte_compare.return - sta.z rom_compare__5 - // if (rom_byte_compare(ptr_rom, *ptr_ram)) - // [2890] if(0==rom_compare::$5) goto rom_compare::@3 -- 0_eq_vbuz1_then_la1 - beq __b3 - // rom_compare::@4 + lda (bram_ptr),y + cmp vera_byte + bne __b3 + // vera_compare::@4 // equal_bytes++; - // [2891] rom_compare::equal_bytes#1 = ++ rom_compare::equal_bytes#2 -- vwum1=_inc_vwum1 + // [2137] vera_compare::equal_bytes#1 = ++ vera_compare::equal_bytes#2 -- vwum1=_inc_vwum1 inc equal_bytes bne !+ inc equal_bytes+1 !: - // [2892] phi from rom_compare::@4 rom_compare::@5 to rom_compare::@3 [phi:rom_compare::@4/rom_compare::@5->rom_compare::@3] - // [2892] phi rom_compare::equal_bytes#6 = rom_compare::equal_bytes#1 [phi:rom_compare::@4/rom_compare::@5->rom_compare::@3#0] -- register_copy - // rom_compare::@3 + // [2138] phi from vera_compare::@4 vera_compare::@5 to vera_compare::@3 [phi:vera_compare::@4/vera_compare::@5->vera_compare::@3] + // [2138] phi vera_compare::equal_bytes#6 = vera_compare::equal_bytes#1 [phi:vera_compare::@4/vera_compare::@5->vera_compare::@3#0] -- register_copy + // vera_compare::@3 __b3: - // ptr_rom++; - // [2893] rom_compare::ptr_rom#1 = ++ rom_compare::ptr_rom#2 -- pbuz1=_inc_pbuz1 - inc.z ptr_rom + // bram_ptr++; + // [2139] vera_compare::bram_ptr#1 = ++ vera_compare::bram_ptr#2 -- pbuz1=_inc_pbuz1 + inc.z bram_ptr bne !+ - inc.z ptr_rom+1 - !: - // ptr_ram++; - // [2894] rom_compare::ptr_ram#0 = ++ rom_compare::ptr_ram#4 -- pbuz1=_inc_pbuz1 - inc.z ptr_ram - bne !+ - inc.z ptr_ram+1 + inc.z bram_ptr+1 !: // compared_bytes++; - // [2895] rom_compare::compared_bytes#1 = ++ rom_compare::compared_bytes#2 -- vwum1=_inc_vwum1 + // [2140] vera_compare::compared_bytes#1 = ++ vera_compare::compared_bytes#2 -- vwum1=_inc_vwum1 inc compared_bytes bne !+ inc compared_bytes+1 !: - // [2882] phi from rom_compare::@3 to rom_compare::@1 [phi:rom_compare::@3->rom_compare::@1] - // [2882] phi rom_compare::equal_bytes#2 = rom_compare::equal_bytes#6 [phi:rom_compare::@3->rom_compare::@1#0] -- register_copy - // [2882] phi rom_compare::ptr_ram#4 = rom_compare::ptr_ram#0 [phi:rom_compare::@3->rom_compare::@1#1] -- register_copy - // [2882] phi rom_compare::ptr_rom#2 = rom_compare::ptr_rom#1 [phi:rom_compare::@3->rom_compare::@1#2] -- register_copy - // [2882] phi rom_compare::compared_bytes#2 = rom_compare::compared_bytes#1 [phi:rom_compare::@3->rom_compare::@1#3] -- register_copy + // [2129] phi from vera_compare::@3 to vera_compare::@1 [phi:vera_compare::@3->vera_compare::@1] + // [2129] phi vera_compare::bram_ptr#2 = vera_compare::bram_ptr#1 [phi:vera_compare::@3->vera_compare::@1#0] -- register_copy + // [2129] phi vera_compare::equal_bytes#2 = vera_compare::equal_bytes#6 [phi:vera_compare::@3->vera_compare::@1#1] -- register_copy + // [2129] phi vera_compare::compared_bytes#2 = vera_compare::compared_bytes#1 [phi:vera_compare::@3->vera_compare::@1#2] -- register_copy jmp __b1 - .segment Data - bank_set_bram1_bank: .byte 0 - rom_bank1_bank_unshifted: .word 0 - rom_bank1_return: .byte 0 + .segment DataVera + bank_ram: .byte 0 + .label return = equal_bytes + .label vera_byte = spi_read.return_3 compared_bytes: .word 0 - /// Holds the amount of bytes actually verified between the ROM and the RAM. + /// Holds the amount of bytes actually verified between the VERA and the RAM. equal_bytes: .word 0 - .label bank_ram = bank_set_bram1_bank - rom_compare_address: .dword 0 - .label return = equal_bytes - rom_compare_size: .word 0 } .segment Code // ultoa @@ -19322,143 +13461,143 @@ 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(__mem() unsigned long value, __zp($38) char *buffer, __mem() char radix) +// void ultoa(__mem() unsigned long value, __zp($34) char *buffer, __mem() char radix) ultoa: { - .label ultoa__4 = $42 - .label ultoa__10 = $3a - .label ultoa__11 = $41 - .label buffer = $38 - .label digit_values = $4a + .label ultoa__4 = $3a + .label ultoa__10 = $39 + .label ultoa__11 = $4d + .label buffer = $34 + .label digit_values = $40 // if(radix==DECIMAL) - // [2896] if(ultoa::radix#0==DECIMAL) goto ultoa::@1 -- vbum1_eq_vbuc1_then_la1 + // [2141] if(ultoa::radix#0==DECIMAL) goto ultoa::@1 -- vbum1_eq_vbuc1_then_la1 lda #DECIMAL cmp radix beq __b2 // ultoa::@2 // if(radix==HEXADECIMAL) - // [2897] if(ultoa::radix#0==HEXADECIMAL) goto ultoa::@1 -- vbum1_eq_vbuc1_then_la1 + // [2142] if(ultoa::radix#0==HEXADECIMAL) goto ultoa::@1 -- vbum1_eq_vbuc1_then_la1 lda #HEXADECIMAL cmp radix beq __b3 // ultoa::@3 // if(radix==OCTAL) - // [2898] if(ultoa::radix#0==OCTAL) goto ultoa::@1 -- vbum1_eq_vbuc1_then_la1 + // [2143] if(ultoa::radix#0==OCTAL) goto ultoa::@1 -- vbum1_eq_vbuc1_then_la1 lda #OCTAL cmp radix beq __b4 // ultoa::@4 // if(radix==BINARY) - // [2899] if(ultoa::radix#0==BINARY) goto ultoa::@1 -- vbum1_eq_vbuc1_then_la1 + // [2144] if(ultoa::radix#0==BINARY) goto ultoa::@1 -- vbum1_eq_vbuc1_then_la1 lda #BINARY cmp radix beq __b5 // ultoa::@5 // *buffer++ = 'e' - // [2900] *((char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS) = 'e' -- _deref_pbuc1=vbuc2 + // [2145] *((char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS) = 'e' -- _deref_pbuc1=vbuc2 // Unknown radix lda #'e' sta printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS // *buffer++ = 'r' - // [2901] *((char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+1) = 'r' -- _deref_pbuc1=vbuc2 + // [2146] *((char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+1) = 'r' -- _deref_pbuc1=vbuc2 lda #'r' sta printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+1 - // [2902] *((char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+2) = 'r' -- _deref_pbuc1=vbuc2 + // [2147] *((char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+2) = 'r' -- _deref_pbuc1=vbuc2 sta printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+2 // *buffer = 0 - // [2903] *((char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+3) = 0 -- _deref_pbuc1=vbuc2 + // [2148] *((char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+3) = 0 -- _deref_pbuc1=vbuc2 lda #0 sta printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+3 // ultoa::@return // } - // [2904] return + // [2149] return rts - // [2905] phi from ultoa to ultoa::@1 [phi:ultoa->ultoa::@1] + // [2150] phi from ultoa to ultoa::@1 [phi:ultoa->ultoa::@1] __b2: - // [2905] phi ultoa::digit_values#8 = RADIX_DECIMAL_VALUES_LONG [phi:ultoa->ultoa::@1#0] -- pduz1=pduc1 + // [2150] phi ultoa::digit_values#8 = RADIX_DECIMAL_VALUES_LONG [phi:ultoa->ultoa::@1#0] -- pduz1=pduc1 lda #RADIX_DECIMAL_VALUES_LONG sta.z digit_values+1 - // [2905] phi ultoa::max_digits#7 = $a [phi:ultoa->ultoa::@1#1] -- vbum1=vbuc1 + // [2150] phi ultoa::max_digits#7 = $a [phi:ultoa->ultoa::@1#1] -- vbum1=vbuc1 lda #$a sta max_digits jmp __b1 - // [2905] phi from ultoa::@2 to ultoa::@1 [phi:ultoa::@2->ultoa::@1] + // [2150] phi from ultoa::@2 to ultoa::@1 [phi:ultoa::@2->ultoa::@1] __b3: - // [2905] phi ultoa::digit_values#8 = RADIX_HEXADECIMAL_VALUES_LONG [phi:ultoa::@2->ultoa::@1#0] -- pduz1=pduc1 + // [2150] phi ultoa::digit_values#8 = RADIX_HEXADECIMAL_VALUES_LONG [phi:ultoa::@2->ultoa::@1#0] -- pduz1=pduc1 lda #RADIX_HEXADECIMAL_VALUES_LONG sta.z digit_values+1 - // [2905] phi ultoa::max_digits#7 = 8 [phi:ultoa::@2->ultoa::@1#1] -- vbum1=vbuc1 + // [2150] phi ultoa::max_digits#7 = 8 [phi:ultoa::@2->ultoa::@1#1] -- vbum1=vbuc1 lda #8 sta max_digits jmp __b1 - // [2905] phi from ultoa::@3 to ultoa::@1 [phi:ultoa::@3->ultoa::@1] + // [2150] phi from ultoa::@3 to ultoa::@1 [phi:ultoa::@3->ultoa::@1] __b4: - // [2905] phi ultoa::digit_values#8 = RADIX_OCTAL_VALUES_LONG [phi:ultoa::@3->ultoa::@1#0] -- pduz1=pduc1 + // [2150] phi ultoa::digit_values#8 = RADIX_OCTAL_VALUES_LONG [phi:ultoa::@3->ultoa::@1#0] -- pduz1=pduc1 lda #RADIX_OCTAL_VALUES_LONG sta.z digit_values+1 - // [2905] phi ultoa::max_digits#7 = $b [phi:ultoa::@3->ultoa::@1#1] -- vbum1=vbuc1 + // [2150] phi ultoa::max_digits#7 = $b [phi:ultoa::@3->ultoa::@1#1] -- vbum1=vbuc1 lda #$b sta max_digits jmp __b1 - // [2905] phi from ultoa::@4 to ultoa::@1 [phi:ultoa::@4->ultoa::@1] + // [2150] phi from ultoa::@4 to ultoa::@1 [phi:ultoa::@4->ultoa::@1] __b5: - // [2905] phi ultoa::digit_values#8 = RADIX_BINARY_VALUES_LONG [phi:ultoa::@4->ultoa::@1#0] -- pduz1=pduc1 + // [2150] phi ultoa::digit_values#8 = RADIX_BINARY_VALUES_LONG [phi:ultoa::@4->ultoa::@1#0] -- pduz1=pduc1 lda #RADIX_BINARY_VALUES_LONG sta.z digit_values+1 - // [2905] phi ultoa::max_digits#7 = $20 [phi:ultoa::@4->ultoa::@1#1] -- vbum1=vbuc1 + // [2150] phi ultoa::max_digits#7 = $20 [phi:ultoa::@4->ultoa::@1#1] -- vbum1=vbuc1 lda #$20 sta max_digits // ultoa::@1 __b1: - // [2906] phi from ultoa::@1 to ultoa::@6 [phi:ultoa::@1->ultoa::@6] - // [2906] phi ultoa::buffer#11 = (char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS [phi:ultoa::@1->ultoa::@6#0] -- pbuz1=pbuc1 + // [2151] phi from ultoa::@1 to ultoa::@6 [phi:ultoa::@1->ultoa::@6] + // [2151] phi ultoa::buffer#11 = (char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS [phi:ultoa::@1->ultoa::@6#0] -- pbuz1=pbuc1 lda #printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS sta.z buffer+1 - // [2906] phi ultoa::started#2 = 0 [phi:ultoa::@1->ultoa::@6#1] -- vbum1=vbuc1 + // [2151] phi ultoa::started#2 = 0 [phi:ultoa::@1->ultoa::@6#1] -- vbum1=vbuc1 lda #0 sta started - // [2906] phi ultoa::value#2 = ultoa::value#1 [phi:ultoa::@1->ultoa::@6#2] -- register_copy - // [2906] phi ultoa::digit#2 = 0 [phi:ultoa::@1->ultoa::@6#3] -- vbum1=vbuc1 + // [2151] phi ultoa::value#2 = ultoa::value#1 [phi:ultoa::@1->ultoa::@6#2] -- register_copy + // [2151] phi ultoa::digit#2 = 0 [phi:ultoa::@1->ultoa::@6#3] -- vbum1=vbuc1 sta digit // ultoa::@6 __b6: // max_digits-1 - // [2907] ultoa::$4 = ultoa::max_digits#7 - 1 -- vbuz1=vbum2_minus_1 + // [2152] ultoa::$4 = ultoa::max_digits#7 - 1 -- vbuz1=vbum2_minus_1 ldx max_digits dex stx.z ultoa__4 // for( char digit=0; digit= digit_value) - // [2915] if(0!=ultoa::started#2) goto ultoa::@10 -- 0_neq_vbum1_then_la1 + // [2160] if(0!=ultoa::started#2) goto ultoa::@10 -- 0_neq_vbum1_then_la1 lda started bne __b10 // ultoa::@12 - // [2916] if(ultoa::value#2>=ultoa::digit_value#0) goto ultoa::@10 -- vdum1_ge_vdum2_then_la1 + // [2161] if(ultoa::value#2>=ultoa::digit_value#0) goto ultoa::@10 -- vdum1_ge_vdum2_then_la1 lda value+3 cmp digit_value+3 bcc !+ @@ -19506,51 +13645,51 @@ ultoa: { cmp digit_value bcs __b10 !: - // [2917] phi from ultoa::@12 to ultoa::@9 [phi:ultoa::@12->ultoa::@9] - // [2917] phi ultoa::buffer#14 = ultoa::buffer#11 [phi:ultoa::@12->ultoa::@9#0] -- register_copy - // [2917] phi ultoa::started#4 = ultoa::started#2 [phi:ultoa::@12->ultoa::@9#1] -- register_copy - // [2917] phi ultoa::value#6 = ultoa::value#2 [phi:ultoa::@12->ultoa::@9#2] -- register_copy + // [2162] phi from ultoa::@12 to ultoa::@9 [phi:ultoa::@12->ultoa::@9] + // [2162] phi ultoa::buffer#14 = ultoa::buffer#11 [phi:ultoa::@12->ultoa::@9#0] -- register_copy + // [2162] phi ultoa::started#4 = ultoa::started#2 [phi:ultoa::@12->ultoa::@9#1] -- register_copy + // [2162] phi ultoa::value#6 = ultoa::value#2 [phi:ultoa::@12->ultoa::@9#2] -- register_copy // ultoa::@9 __b9: // for( char digit=0; digitultoa::@6] - // [2906] phi ultoa::buffer#11 = ultoa::buffer#14 [phi:ultoa::@9->ultoa::@6#0] -- register_copy - // [2906] phi ultoa::started#2 = ultoa::started#4 [phi:ultoa::@9->ultoa::@6#1] -- register_copy - // [2906] phi ultoa::value#2 = ultoa::value#6 [phi:ultoa::@9->ultoa::@6#2] -- register_copy - // [2906] phi ultoa::digit#2 = ultoa::digit#1 [phi:ultoa::@9->ultoa::@6#3] -- register_copy + // [2151] phi from ultoa::@9 to ultoa::@6 [phi:ultoa::@9->ultoa::@6] + // [2151] phi ultoa::buffer#11 = ultoa::buffer#14 [phi:ultoa::@9->ultoa::@6#0] -- register_copy + // [2151] phi ultoa::started#2 = ultoa::started#4 [phi:ultoa::@9->ultoa::@6#1] -- register_copy + // [2151] phi ultoa::value#2 = ultoa::value#6 [phi:ultoa::@9->ultoa::@6#2] -- register_copy + // [2151] phi ultoa::digit#2 = ultoa::digit#1 [phi:ultoa::@9->ultoa::@6#3] -- register_copy jmp __b6 // ultoa::@10 __b10: // ultoa_append(buffer++, value, digit_value) - // [2919] ultoa_append::buffer#0 = ultoa::buffer#11 -- pbuz1=pbuz2 + // [2164] ultoa_append::buffer#0 = ultoa::buffer#11 -- pbuz1=pbuz2 lda.z buffer sta.z ultoa_append.buffer lda.z buffer+1 sta.z ultoa_append.buffer+1 - // [2920] ultoa_append::value#0 = ultoa::value#2 - // [2921] ultoa_append::sub#0 = ultoa::digit_value#0 - // [2922] call ultoa_append - // [3340] phi from ultoa::@10 to ultoa_append [phi:ultoa::@10->ultoa_append] + // [2165] ultoa_append::value#0 = ultoa::value#2 + // [2166] ultoa_append::sub#0 = ultoa::digit_value#0 + // [2167] call ultoa_append + // [2332] phi from ultoa::@10 to ultoa_append [phi:ultoa::@10->ultoa_append] jsr ultoa_append // ultoa_append(buffer++, value, digit_value) - // [2923] ultoa_append::return#0 = ultoa_append::value#2 + // [2168] ultoa_append::return#0 = ultoa_append::value#2 // ultoa::@11 // value = ultoa_append(buffer++, value, digit_value) - // [2924] ultoa::value#0 = ultoa_append::return#0 + // [2169] ultoa::value#0 = ultoa_append::return#0 // value = ultoa_append(buffer++, value, digit_value); - // [2925] ultoa::buffer#4 = ++ ultoa::buffer#11 -- pbuz1=_inc_pbuz1 + // [2170] ultoa::buffer#4 = ++ ultoa::buffer#11 -- pbuz1=_inc_pbuz1 inc.z buffer bne !+ inc.z buffer+1 !: - // [2917] phi from ultoa::@11 to ultoa::@9 [phi:ultoa::@11->ultoa::@9] - // [2917] phi ultoa::buffer#14 = ultoa::buffer#4 [phi:ultoa::@11->ultoa::@9#0] -- register_copy - // [2917] phi ultoa::started#4 = 1 [phi:ultoa::@11->ultoa::@9#1] -- vbum1=vbuc1 + // [2162] phi from ultoa::@11 to ultoa::@9 [phi:ultoa::@11->ultoa::@9] + // [2162] phi ultoa::buffer#14 = ultoa::buffer#4 [phi:ultoa::@11->ultoa::@9#0] -- register_copy + // [2162] phi ultoa::started#4 = 1 [phi:ultoa::@11->ultoa::@9#1] -- vbum1=vbuc1 lda #1 sta started - // [2917] phi ultoa::value#6 = ultoa::value#0 [phi:ultoa::@11->ultoa::@9#2] -- register_copy + // [2162] phi ultoa::value#6 = ultoa::value#0 [phi:ultoa::@11->ultoa::@9#2] -- register_copy jmp __b9 .segment Data digit_value: .dword 0 @@ -19562,29 +13701,22 @@ ultoa: { } .segment Code // display_action_text_flashed -// void display_action_text_flashed(__mem() unsigned long bytes, __zp($4e) char *chip) +// void display_action_text_flashed(__mem() unsigned long bytes, char *chip) display_action_text_flashed: { - .label chip = $4e // sprintf(info_text, "Flashed %u bytes from RAM -> %s ... ", bytes, chip) - // [2927] call snprintf_init - // [1205] phi from display_action_text_flashed to snprintf_init [phi:display_action_text_flashed->snprintf_init] - // [1205] phi snprintf_init::s#31 = info_text [phi:display_action_text_flashed->snprintf_init#0] -- pbuz1=pbuc1 - lda #info_text - sta.z snprintf_init.s+1 + // [2172] call snprintf_init jsr snprintf_init - // [2928] phi from display_action_text_flashed to display_action_text_flashed::@1 [phi:display_action_text_flashed->display_action_text_flashed::@1] + // [2173] phi from display_action_text_flashed to display_action_text_flashed::@1 [phi:display_action_text_flashed->display_action_text_flashed::@1] // display_action_text_flashed::@1 // sprintf(info_text, "Flashed %u bytes from RAM -> %s ... ", bytes, chip) - // [2929] call printf_str - // [1210] phi from display_action_text_flashed::@1 to printf_str [phi:display_action_text_flashed::@1->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:display_action_text_flashed::@1->printf_str#0] -- pprz1=pprc1 + // [2174] call printf_str + // [785] phi from display_action_text_flashed::@1 to printf_str [phi:display_action_text_flashed::@1->printf_str] + // [785] phi printf_str::putc#53 = &snputc [phi:display_action_text_flashed::@1->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = display_action_text_flashed::s [phi:display_action_text_flashed::@1->printf_str#1] -- pbuz1=pbuc1 + // [785] phi printf_str::s#53 = display_action_text_flashed::s [phi:display_action_text_flashed::@1->printf_str#1] -- pbuz1=pbuc1 lda #s @@ -19592,7 +13724,7 @@ display_action_text_flashed: { jsr printf_str // display_action_text_flashed::@2 // sprintf(info_text, "Flashed %u bytes from RAM -> %s ... ", bytes, chip) - // [2930] printf_ulong::uvalue#4 = display_action_text_flashed::bytes#3 -- vdum1=vdum2 + // [2175] printf_ulong::uvalue#4 = display_action_text_flashed::bytes#0 -- vdum1=vdum2 lda bytes sta printf_ulong.uvalue lda bytes+1 @@ -19601,66 +13733,66 @@ display_action_text_flashed: { sta printf_ulong.uvalue+2 lda bytes+3 sta printf_ulong.uvalue+3 - // [2931] call printf_ulong - // [1741] phi from display_action_text_flashed::@2 to printf_ulong [phi:display_action_text_flashed::@2->printf_ulong] - // [1741] phi printf_ulong::format_zero_padding#15 = 0 [phi:display_action_text_flashed::@2->printf_ulong#0] -- vbum1=vbuc1 + // [2176] call printf_ulong + // [1633] phi from display_action_text_flashed::@2 to printf_ulong [phi:display_action_text_flashed::@2->printf_ulong] + // [1633] phi printf_ulong::format_zero_padding#10 = 0 [phi:display_action_text_flashed::@2->printf_ulong#0] -- vbum1=vbuc1 lda #0 sta printf_ulong.format_zero_padding - // [1741] phi printf_ulong::format_min_length#15 = 0 [phi:display_action_text_flashed::@2->printf_ulong#1] -- vbum1=vbuc1 + // [1633] phi printf_ulong::format_min_length#10 = 0 [phi:display_action_text_flashed::@2->printf_ulong#1] -- vbum1=vbuc1 sta printf_ulong.format_min_length - // [1741] phi printf_ulong::format_radix#15 = DECIMAL [phi:display_action_text_flashed::@2->printf_ulong#2] -- vbum1=vbuc1 + // [1633] phi printf_ulong::format_radix#10 = DECIMAL [phi:display_action_text_flashed::@2->printf_ulong#2] -- vbum1=vbuc1 lda #DECIMAL sta printf_ulong.format_radix - // [1741] phi printf_ulong::uvalue#15 = printf_ulong::uvalue#4 [phi:display_action_text_flashed::@2->printf_ulong#3] -- register_copy + // [1633] phi printf_ulong::uvalue#10 = printf_ulong::uvalue#4 [phi:display_action_text_flashed::@2->printf_ulong#3] -- register_copy jsr printf_ulong - // [2932] phi from display_action_text_flashed::@2 to display_action_text_flashed::@3 [phi:display_action_text_flashed::@2->display_action_text_flashed::@3] + // [2177] phi from display_action_text_flashed::@2 to display_action_text_flashed::@3 [phi:display_action_text_flashed::@2->display_action_text_flashed::@3] // display_action_text_flashed::@3 // sprintf(info_text, "Flashed %u bytes from RAM -> %s ... ", bytes, chip) - // [2933] call printf_str - // [1210] phi from display_action_text_flashed::@3 to printf_str [phi:display_action_text_flashed::@3->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:display_action_text_flashed::@3->printf_str#0] -- pprz1=pprc1 + // [2178] call printf_str + // [785] phi from display_action_text_flashed::@3 to printf_str [phi:display_action_text_flashed::@3->printf_str] + // [785] phi printf_str::putc#53 = &snputc [phi:display_action_text_flashed::@3->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = display_action_text_flashed::s1 [phi:display_action_text_flashed::@3->printf_str#1] -- pbuz1=pbuc1 + // [785] phi printf_str::s#53 = display_action_text_flashed::s1 [phi:display_action_text_flashed::@3->printf_str#1] -- pbuz1=pbuc1 lda #s1 sta.z printf_str.s+1 jsr printf_str + // [2179] phi from display_action_text_flashed::@3 to display_action_text_flashed::@4 [phi:display_action_text_flashed::@3->display_action_text_flashed::@4] // display_action_text_flashed::@4 // sprintf(info_text, "Flashed %u bytes from RAM -> %s ... ", bytes, chip) - // [2934] printf_string::str#13 = display_action_text_flashed::chip#3 -- pbuz1=pbuz2 - lda.z chip - sta.z printf_string.str - lda.z chip+1 - sta.z printf_string.str+1 - // [2935] call printf_string - // [1219] phi from display_action_text_flashed::@4 to printf_string [phi:display_action_text_flashed::@4->printf_string] - // [1219] phi printf_string::putc#26 = &snputc [phi:display_action_text_flashed::@4->printf_string#0] -- pprz1=pprc1 + // [2180] call printf_string + // [1308] phi from display_action_text_flashed::@4 to printf_string [phi:display_action_text_flashed::@4->printf_string] + // [1308] phi printf_string::putc#17 = &snputc [phi:display_action_text_flashed::@4->printf_string#0] -- pprz1=pprc1 lda #snputc sta.z printf_string.putc+1 - // [1219] phi printf_string::str#26 = printf_string::str#13 [phi:display_action_text_flashed::@4->printf_string#1] -- register_copy - // [1219] phi printf_string::format_justify_left#26 = 0 [phi:display_action_text_flashed::@4->printf_string#2] -- vbum1=vbuc1 + // [1308] phi printf_string::str#17 = vera_flash::chip [phi:display_action_text_flashed::@4->printf_string#1] -- pbuz1=pbuc1 + lda #vera_flash.chip + sta.z printf_string.str+1 + // [1308] phi printf_string::format_justify_left#17 = 0 [phi:display_action_text_flashed::@4->printf_string#2] -- vbum1=vbuc1 lda #0 sta printf_string.format_justify_left - // [1219] phi printf_string::format_min_length#26 = 0 [phi:display_action_text_flashed::@4->printf_string#3] -- vbum1=vbuc1 + // [1308] phi printf_string::format_min_length#17 = 0 [phi:display_action_text_flashed::@4->printf_string#3] -- vbum1=vbuc1 sta printf_string.format_min_length jsr printf_string - // [2936] phi from display_action_text_flashed::@4 to display_action_text_flashed::@5 [phi:display_action_text_flashed::@4->display_action_text_flashed::@5] + // [2181] phi from display_action_text_flashed::@4 to display_action_text_flashed::@5 [phi:display_action_text_flashed::@4->display_action_text_flashed::@5] // display_action_text_flashed::@5 // sprintf(info_text, "Flashed %u bytes from RAM -> %s ... ", bytes, chip) - // [2937] call printf_str - // [1210] phi from display_action_text_flashed::@5 to printf_str [phi:display_action_text_flashed::@5->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:display_action_text_flashed::@5->printf_str#0] -- pprz1=pprc1 + // [2182] call printf_str + // [785] phi from display_action_text_flashed::@5 to printf_str [phi:display_action_text_flashed::@5->printf_str] + // [785] phi printf_str::putc#53 = &snputc [phi:display_action_text_flashed::@5->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = s5 [phi:display_action_text_flashed::@5->printf_str#1] -- pbuz1=pbuc1 + // [785] phi printf_str::s#53 = s5 [phi:display_action_text_flashed::@5->printf_str#1] -- pbuz1=pbuc1 lda #s5 @@ -19668,17 +13800,17 @@ display_action_text_flashed: { jsr printf_str // display_action_text_flashed::@6 // sprintf(info_text, "Flashed %u bytes from RAM -> %s ... ", bytes, chip) - // [2938] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 + // [2183] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 lda #0 pha - // [2939] callexecute snputc -- call_vprc1 + // [2184] callexecute snputc -- call_vprc1 jsr snputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla // display_action_text(info_text) - // [2941] call display_action_text - // [1357] phi from display_action_text_flashed::@6 to display_action_text [phi:display_action_text_flashed::@6->display_action_text] - // [1357] phi display_action_text::info_text#25 = info_text [phi:display_action_text_flashed::@6->display_action_text#0] -- pbuz1=pbuc1 + // [2186] call display_action_text + // [845] phi from display_action_text_flashed::@6 to display_action_text [phi:display_action_text_flashed::@6->display_action_text] + // [845] phi display_action_text::info_text#17 = info_text [phi:display_action_text_flashed::@6->display_action_text#0] -- pbuz1=pbuc1 lda #info_text @@ -19686,7 +13818,7 @@ display_action_text_flashed: { jsr display_action_text // display_action_text_flashed::@return // } - // [2942] return + // [2187] return rts .segment Data s: .text "Flashed " @@ -19695,200 +13827,64 @@ display_action_text_flashed: { .byte 0 bytes: .dword 0 } -.segment Code - // rom_sector_erase -/** - * @brief Erases a 1KB sector of the ROM using the 22 bit address. - * This is required before any new bytes can be flashed into the ROM. - * Erasing a sector of the ROM requires an erase sector sequence to be initiated, which has the following steps: - * - * 1. Write byte $AA into ROM address $005555. - * 2. Write byte $55 into ROM address $002AAA. - * 3. Write byte $80 into ROM address $005555. - * 4. Write byte $AA into ROM address $005555. - * 5. Write byte $55 into ROM address $002AAA. - * - * Once this write sequence is finished, the ROM sector is erased by writing byte $30 into the 22 bit ROM sector address. - * Then it waits until the chip has correctly flashed the ROM erasure. - * - * Note that a ROM sector is 1KB (not 4KB), so the most 7 significant bits (18-12) are used. - * The remainder 12 low bits are ignored. - * - * +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ - * | 2 | 2 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | - * | 1 | 0 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | - * +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ - * SECTOR 0x37F000 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | - * +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ - * IGNORED 0x000FFF | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | - * +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ - * - * @param address The 22 bit ROM address. - */ -/* inline */ -// void rom_sector_erase(__mem() unsigned long address) -rom_sector_erase: { - .label rom_ptr1_rom_sector_erase__0 = $2d - .label rom_ptr1_rom_sector_erase__2 = $2d - .label rom_ptr1_return = $2d - // rom_sector_erase::rom_ptr1 - // (unsigned int)(address) & ROM_PTR_MASK - // [2944] rom_sector_erase::rom_ptr1_$2 = (unsigned int)rom_sector_erase::address#0 -- vwuz1=_word_vdum2 - lda address - sta.z rom_ptr1_rom_sector_erase__2 - lda address+1 - sta.z rom_ptr1_rom_sector_erase__2+1 - // [2945] rom_sector_erase::rom_ptr1_$0 = rom_sector_erase::rom_ptr1_$2 & $3fff -- vwuz1=vwuz1_band_vwuc1 - lda.z rom_ptr1_rom_sector_erase__0 - and #<$3fff - sta.z rom_ptr1_rom_sector_erase__0 - lda.z rom_ptr1_rom_sector_erase__0+1 - and #>$3fff - sta.z rom_ptr1_rom_sector_erase__0+1 - // ((unsigned int)(address) & ROM_PTR_MASK) + ROM_BASE - // [2946] rom_sector_erase::rom_ptr1_return#0 = rom_sector_erase::rom_ptr1_$0 + $c000 -- vwuz1=vwuz1_plus_vwuc1 - lda.z rom_ptr1_return - clc - adc #<$c000 - sta.z rom_ptr1_return - lda.z rom_ptr1_return+1 - adc #>$c000 - sta.z rom_ptr1_return+1 - // rom_sector_erase::@1 - // unsigned long rom_chip_address = address & ROM_CHIP_MASK - // [2947] rom_sector_erase::rom_chip_address#0 = rom_sector_erase::address#0 & $380000 -- vdum1=vdum2_band_vduc1 - lda address - and #<$380000 - sta rom_chip_address - lda address+1 - and #>$380000 - sta rom_chip_address+1 - lda address+2 - and #<$380000>>$10 - sta rom_chip_address+2 - lda address+3 - and #>$380000>>$10 - sta rom_chip_address+3 - // rom_unlock(rom_chip_address + 0x05555, 0x80) - // [2948] rom_unlock::address#0 = rom_sector_erase::rom_chip_address#0 + $5555 -- vdum1=vdum1_plus_vwuc1 - clc - lda rom_unlock.address - adc #<$5555 - sta rom_unlock.address - lda rom_unlock.address+1 - adc #>$5555 - sta rom_unlock.address+1 - lda rom_unlock.address+2 - adc #0 - sta rom_unlock.address+2 - lda rom_unlock.address+3 - adc #0 - sta rom_unlock.address+3 - // [2949] call rom_unlock - // [2394] phi from rom_sector_erase::@1 to rom_unlock [phi:rom_sector_erase::@1->rom_unlock] - // [2394] phi rom_unlock::unlock_code#5 = $80 [phi:rom_sector_erase::@1->rom_unlock#0] -- vbum1=vbuc1 - lda #$80 - sta rom_unlock.unlock_code - // [2394] 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) - // [2950] rom_unlock::address#1 = rom_sector_erase::address#0 -- vdum1=vdum2 - lda address - sta rom_unlock.address - lda address+1 - sta rom_unlock.address+1 - lda address+2 - sta rom_unlock.address+2 - lda address+3 - sta rom_unlock.address+3 - // [2951] call rom_unlock - // [2394] phi from rom_sector_erase::@2 to rom_unlock [phi:rom_sector_erase::@2->rom_unlock] - // [2394] phi rom_unlock::unlock_code#5 = $30 [phi:rom_sector_erase::@2->rom_unlock#0] -- vbum1=vbuc1 - lda #$30 - sta rom_unlock.unlock_code - // [2394] 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) - // [2952] rom_wait::ptr_rom#0 = (char *)rom_sector_erase::rom_ptr1_return#0 - // [2953] call rom_wait - // [3347] phi from rom_sector_erase::@3 to rom_wait [phi:rom_sector_erase::@3->rom_wait] - // [3347] phi rom_wait::ptr_rom#3 = rom_wait::ptr_rom#0 [phi:rom_sector_erase::@3->rom_wait#0] -- register_copy - jsr rom_wait - // rom_sector_erase::@return - // } - // [2954] return - rts - .segment Data - .label rom_chip_address = rom_unlock.address - address: .dword 0 -} .segment Code // display_action_text_flashing -// void display_action_text_flashing(__mem() unsigned long bytes, __zp($69) char *chip, __mem() char bram_bank, __zp($66) char *bram_ptr, __mem() unsigned long address) +// void display_action_text_flashing(unsigned long bytes, char *chip, __mem() char bram_bank, __zp($51) char *bram_ptr, __mem() unsigned long address) display_action_text_flashing: { - .label bram_ptr = $66 - .label chip = $69 + .label bram_ptr = $51 // sprintf(info_text, "Flashing %u bytes from RAM:%02x:%04p -> %s:%05x ... ", bytes, bram_bank, bram_ptr, chip, address) - // [2956] call snprintf_init - // [1205] phi from display_action_text_flashing to snprintf_init [phi:display_action_text_flashing->snprintf_init] - // [1205] phi snprintf_init::s#31 = info_text [phi:display_action_text_flashing->snprintf_init#0] -- pbuz1=pbuc1 - lda #info_text - sta.z snprintf_init.s+1 + // [2189] call snprintf_init jsr snprintf_init - // [2957] phi from display_action_text_flashing to display_action_text_flashing::@1 [phi:display_action_text_flashing->display_action_text_flashing::@1] + // [2190] phi from display_action_text_flashing to display_action_text_flashing::@1 [phi:display_action_text_flashing->display_action_text_flashing::@1] // display_action_text_flashing::@1 // sprintf(info_text, "Flashing %u bytes from RAM:%02x:%04p -> %s:%05x ... ", bytes, bram_bank, bram_ptr, chip, address) - // [2958] call printf_str - // [1210] phi from display_action_text_flashing::@1 to printf_str [phi:display_action_text_flashing::@1->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:display_action_text_flashing::@1->printf_str#0] -- pprz1=pprc1 + // [2191] call printf_str + // [785] phi from display_action_text_flashing::@1 to printf_str [phi:display_action_text_flashing::@1->printf_str] + // [785] phi printf_str::putc#53 = &snputc [phi:display_action_text_flashing::@1->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = display_action_text_flashing::s [phi:display_action_text_flashing::@1->printf_str#1] -- pbuz1=pbuc1 + // [785] phi printf_str::s#53 = display_action_text_flashing::s [phi:display_action_text_flashing::@1->printf_str#1] -- pbuz1=pbuc1 lda #s sta.z printf_str.s+1 jsr printf_str + // [2192] phi from display_action_text_flashing::@1 to display_action_text_flashing::@2 [phi:display_action_text_flashing::@1->display_action_text_flashing::@2] // display_action_text_flashing::@2 // sprintf(info_text, "Flashing %u bytes from RAM:%02x:%04p -> %s:%05x ... ", bytes, bram_bank, bram_ptr, chip, address) - // [2959] printf_ulong::uvalue#2 = display_action_text_flashing::bytes#3 -- vdum1=vdum2 - lda bytes - sta printf_ulong.uvalue - lda bytes+1 - sta printf_ulong.uvalue+1 - lda bytes+2 - sta printf_ulong.uvalue+2 - lda bytes+3 - sta printf_ulong.uvalue+3 - // [2960] call printf_ulong - // [1741] phi from display_action_text_flashing::@2 to printf_ulong [phi:display_action_text_flashing::@2->printf_ulong] - // [1741] phi printf_ulong::format_zero_padding#15 = 0 [phi:display_action_text_flashing::@2->printf_ulong#0] -- vbum1=vbuc1 + // [2193] call printf_ulong + // [1633] phi from display_action_text_flashing::@2 to printf_ulong [phi:display_action_text_flashing::@2->printf_ulong] + // [1633] phi printf_ulong::format_zero_padding#10 = 0 [phi:display_action_text_flashing::@2->printf_ulong#0] -- vbum1=vbuc1 lda #0 sta printf_ulong.format_zero_padding - // [1741] phi printf_ulong::format_min_length#15 = 0 [phi:display_action_text_flashing::@2->printf_ulong#1] -- vbum1=vbuc1 + // [1633] phi printf_ulong::format_min_length#10 = 0 [phi:display_action_text_flashing::@2->printf_ulong#1] -- vbum1=vbuc1 sta printf_ulong.format_min_length - // [1741] phi printf_ulong::format_radix#15 = DECIMAL [phi:display_action_text_flashing::@2->printf_ulong#2] -- vbum1=vbuc1 + // [1633] phi printf_ulong::format_radix#10 = DECIMAL [phi:display_action_text_flashing::@2->printf_ulong#2] -- vbum1=vbuc1 lda #DECIMAL sta printf_ulong.format_radix - // [1741] phi printf_ulong::uvalue#15 = printf_ulong::uvalue#2 [phi:display_action_text_flashing::@2->printf_ulong#3] -- register_copy + // [1633] phi printf_ulong::uvalue#10 = VERA_PROGRESS_PAGE [phi:display_action_text_flashing::@2->printf_ulong#3] -- vdum1=vduc1 + lda #VERA_PROGRESS_PAGE + sta printf_ulong.uvalue+1 + lda #>$10 + sta printf_ulong.uvalue+2 + lda #>VERA_PROGRESS_PAGE>>$10 + sta printf_ulong.uvalue+3 jsr printf_ulong - // [2961] phi from display_action_text_flashing::@2 to display_action_text_flashing::@3 [phi:display_action_text_flashing::@2->display_action_text_flashing::@3] + // [2194] phi from display_action_text_flashing::@2 to display_action_text_flashing::@3 [phi:display_action_text_flashing::@2->display_action_text_flashing::@3] // display_action_text_flashing::@3 // sprintf(info_text, "Flashing %u bytes from RAM:%02x:%04p -> %s:%05x ... ", bytes, bram_bank, bram_ptr, chip, address) - // [2962] call printf_str - // [1210] phi from display_action_text_flashing::@3 to printf_str [phi:display_action_text_flashing::@3->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:display_action_text_flashing::@3->printf_str#0] -- pprz1=pprc1 + // [2195] call printf_str + // [785] phi from display_action_text_flashing::@3 to printf_str [phi:display_action_text_flashing::@3->printf_str] + // [785] phi printf_str::putc#53 = &snputc [phi:display_action_text_flashing::@3->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = display_action_text_flashing::s1 [phi:display_action_text_flashing::@3->printf_str#1] -- pbuz1=pbuc1 + // [785] phi printf_str::s#53 = display_action_text_flashing::s1 [phi:display_action_text_flashing::@3->printf_str#1] -- pbuz1=pbuc1 lda #s1 @@ -19896,38 +13892,38 @@ display_action_text_flashing: { jsr printf_str // display_action_text_flashing::@4 // sprintf(info_text, "Flashing %u bytes from RAM:%02x:%04p -> %s:%05x ... ", bytes, bram_bank, bram_ptr, chip, address) - // [2963] printf_uchar::uvalue#5 = display_action_text_flashing::bram_bank#3 -- vbum1=vbum2 + // [2196] printf_uchar::uvalue#5 = display_action_text_flashing::bram_bank#0 -- vbum1=vbum2 lda bram_bank sta printf_uchar.uvalue - // [2964] call printf_uchar - // [1346] phi from display_action_text_flashing::@4 to printf_uchar [phi:display_action_text_flashing::@4->printf_uchar] - // [1346] phi printf_uchar::format_zero_padding#18 = 1 [phi:display_action_text_flashing::@4->printf_uchar#0] -- vbum1=vbuc1 + // [2197] call printf_uchar + // [834] phi from display_action_text_flashing::@4 to printf_uchar [phi:display_action_text_flashing::@4->printf_uchar] + // [834] phi printf_uchar::format_zero_padding#10 = 1 [phi:display_action_text_flashing::@4->printf_uchar#0] -- vbum1=vbuc1 lda #1 sta printf_uchar.format_zero_padding - // [1346] phi printf_uchar::format_min_length#18 = 2 [phi:display_action_text_flashing::@4->printf_uchar#1] -- vbum1=vbuc1 + // [834] phi printf_uchar::format_min_length#10 = 2 [phi:display_action_text_flashing::@4->printf_uchar#1] -- vbum1=vbuc1 lda #2 sta printf_uchar.format_min_length - // [1346] phi printf_uchar::putc#18 = &snputc [phi:display_action_text_flashing::@4->printf_uchar#2] -- pprz1=pprc1 + // [834] phi printf_uchar::putc#10 = &snputc [phi:display_action_text_flashing::@4->printf_uchar#2] -- pprz1=pprc1 lda #snputc sta.z printf_uchar.putc+1 - // [1346] phi printf_uchar::format_radix#18 = HEXADECIMAL [phi:display_action_text_flashing::@4->printf_uchar#3] -- vbum1=vbuc1 + // [834] phi printf_uchar::format_radix#10 = HEXADECIMAL [phi:display_action_text_flashing::@4->printf_uchar#3] -- vbum1=vbuc1 lda #HEXADECIMAL sta printf_uchar.format_radix - // [1346] phi printf_uchar::uvalue#18 = printf_uchar::uvalue#5 [phi:display_action_text_flashing::@4->printf_uchar#4] -- register_copy + // [834] phi printf_uchar::uvalue#10 = printf_uchar::uvalue#5 [phi:display_action_text_flashing::@4->printf_uchar#4] -- register_copy jsr printf_uchar - // [2965] phi from display_action_text_flashing::@4 to display_action_text_flashing::@5 [phi:display_action_text_flashing::@4->display_action_text_flashing::@5] + // [2198] phi from display_action_text_flashing::@4 to display_action_text_flashing::@5 [phi:display_action_text_flashing::@4->display_action_text_flashing::@5] // display_action_text_flashing::@5 // sprintf(info_text, "Flashing %u bytes from RAM:%02x:%04p -> %s:%05x ... ", bytes, bram_bank, bram_ptr, chip, address) - // [2966] call printf_str - // [1210] phi from display_action_text_flashing::@5 to printf_str [phi:display_action_text_flashing::@5->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:display_action_text_flashing::@5->printf_str#0] -- pprz1=pprc1 + // [2199] call printf_str + // [785] phi from display_action_text_flashing::@5 to printf_str [phi:display_action_text_flashing::@5->printf_str] + // [785] phi printf_str::putc#53 = &snputc [phi:display_action_text_flashing::@5->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = s2 [phi:display_action_text_flashing::@5->printf_str#1] -- pbuz1=pbuc1 + // [785] phi printf_str::s#53 = s2 [phi:display_action_text_flashing::@5->printf_str#1] -- pbuz1=pbuc1 lda #s2 @@ -19935,77 +13931,77 @@ display_action_text_flashing: { jsr printf_str // display_action_text_flashing::@6 // sprintf(info_text, "Flashing %u bytes from RAM:%02x:%04p -> %s:%05x ... ", bytes, bram_bank, bram_ptr, chip, address) - // [2967] printf_uint::uvalue#2 = (unsigned int)display_action_text_flashing::bram_ptr#3 -- vwum1=vwuz2 + // [2200] printf_uint::uvalue#2 = (unsigned int)display_action_text_flashing::bram_ptr#0 -- vwum1=vwuz2 lda.z bram_ptr sta printf_uint.uvalue lda.z bram_ptr+1 sta printf_uint.uvalue+1 - // [2968] call printf_uint - // [2086] phi from display_action_text_flashing::@6 to printf_uint [phi:display_action_text_flashing::@6->printf_uint] - // [2086] phi printf_uint::format_zero_padding#10 = 1 [phi:display_action_text_flashing::@6->printf_uint#0] -- vbum1=vbuc1 + // [2201] call printf_uint + // [1433] phi from display_action_text_flashing::@6 to printf_uint [phi:display_action_text_flashing::@6->printf_uint] + // [1433] phi printf_uint::format_zero_padding#4 = 1 [phi:display_action_text_flashing::@6->printf_uint#0] -- vbum1=vbuc1 lda #1 sta printf_uint.format_zero_padding - // [2086] phi printf_uint::format_min_length#10 = 4 [phi:display_action_text_flashing::@6->printf_uint#1] -- vbum1=vbuc1 + // [1433] phi printf_uint::format_min_length#4 = 4 [phi:display_action_text_flashing::@6->printf_uint#1] -- vbum1=vbuc1 lda #4 sta printf_uint.format_min_length - // [2086] phi printf_uint::putc#10 = &snputc [phi:display_action_text_flashing::@6->printf_uint#2] -- pprz1=pprc1 + // [1433] phi printf_uint::putc#4 = &snputc [phi:display_action_text_flashing::@6->printf_uint#2] -- pprz1=pprc1 lda #snputc sta.z printf_uint.putc+1 - // [2086] phi printf_uint::format_radix#10 = HEXADECIMAL [phi:display_action_text_flashing::@6->printf_uint#3] -- vbum1=vbuc1 + // [1433] phi printf_uint::format_radix#4 = HEXADECIMAL [phi:display_action_text_flashing::@6->printf_uint#3] -- vbum1=vbuc1 lda #HEXADECIMAL sta printf_uint.format_radix - // [2086] phi printf_uint::uvalue#10 = printf_uint::uvalue#2 [phi:display_action_text_flashing::@6->printf_uint#4] -- register_copy + // [1433] phi printf_uint::uvalue#4 = printf_uint::uvalue#2 [phi:display_action_text_flashing::@6->printf_uint#4] -- register_copy jsr printf_uint - // [2969] phi from display_action_text_flashing::@6 to display_action_text_flashing::@7 [phi:display_action_text_flashing::@6->display_action_text_flashing::@7] + // [2202] phi from display_action_text_flashing::@6 to display_action_text_flashing::@7 [phi:display_action_text_flashing::@6->display_action_text_flashing::@7] // display_action_text_flashing::@7 // sprintf(info_text, "Flashing %u bytes from RAM:%02x:%04p -> %s:%05x ... ", bytes, bram_bank, bram_ptr, chip, address) - // [2970] call printf_str - // [1210] phi from display_action_text_flashing::@7 to printf_str [phi:display_action_text_flashing::@7->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:display_action_text_flashing::@7->printf_str#0] -- pprz1=pprc1 + // [2203] call printf_str + // [785] phi from display_action_text_flashing::@7 to printf_str [phi:display_action_text_flashing::@7->printf_str] + // [785] phi printf_str::putc#53 = &snputc [phi:display_action_text_flashing::@7->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = display_action_text_flashing::s3 [phi:display_action_text_flashing::@7->printf_str#1] -- pbuz1=pbuc1 + // [785] phi printf_str::s#53 = display_action_text_flashing::s3 [phi:display_action_text_flashing::@7->printf_str#1] -- pbuz1=pbuc1 lda #s3 sta.z printf_str.s+1 jsr printf_str + // [2204] phi from display_action_text_flashing::@7 to display_action_text_flashing::@8 [phi:display_action_text_flashing::@7->display_action_text_flashing::@8] // display_action_text_flashing::@8 // sprintf(info_text, "Flashing %u bytes from RAM:%02x:%04p -> %s:%05x ... ", bytes, bram_bank, bram_ptr, chip, address) - // [2971] printf_string::str#12 = display_action_text_flashing::chip#10 -- pbuz1=pbuz2 - lda.z chip - sta.z printf_string.str - lda.z chip+1 - sta.z printf_string.str+1 - // [2972] call printf_string - // [1219] phi from display_action_text_flashing::@8 to printf_string [phi:display_action_text_flashing::@8->printf_string] - // [1219] phi printf_string::putc#26 = &snputc [phi:display_action_text_flashing::@8->printf_string#0] -- pprz1=pprc1 + // [2205] call printf_string + // [1308] phi from display_action_text_flashing::@8 to printf_string [phi:display_action_text_flashing::@8->printf_string] + // [1308] phi printf_string::putc#17 = &snputc [phi:display_action_text_flashing::@8->printf_string#0] -- pprz1=pprc1 lda #snputc sta.z printf_string.putc+1 - // [1219] phi printf_string::str#26 = printf_string::str#12 [phi:display_action_text_flashing::@8->printf_string#1] -- register_copy - // [1219] phi printf_string::format_justify_left#26 = 0 [phi:display_action_text_flashing::@8->printf_string#2] -- vbum1=vbuc1 + // [1308] phi printf_string::str#17 = vera_flash::chip [phi:display_action_text_flashing::@8->printf_string#1] -- pbuz1=pbuc1 + lda #vera_flash.chip + sta.z printf_string.str+1 + // [1308] phi printf_string::format_justify_left#17 = 0 [phi:display_action_text_flashing::@8->printf_string#2] -- vbum1=vbuc1 lda #0 sta printf_string.format_justify_left - // [1219] phi printf_string::format_min_length#26 = 0 [phi:display_action_text_flashing::@8->printf_string#3] -- vbum1=vbuc1 + // [1308] phi printf_string::format_min_length#17 = 0 [phi:display_action_text_flashing::@8->printf_string#3] -- vbum1=vbuc1 sta printf_string.format_min_length jsr printf_string - // [2973] phi from display_action_text_flashing::@8 to display_action_text_flashing::@9 [phi:display_action_text_flashing::@8->display_action_text_flashing::@9] + // [2206] phi from display_action_text_flashing::@8 to display_action_text_flashing::@9 [phi:display_action_text_flashing::@8->display_action_text_flashing::@9] // display_action_text_flashing::@9 // sprintf(info_text, "Flashing %u bytes from RAM:%02x:%04p -> %s:%05x ... ", bytes, bram_bank, bram_ptr, chip, address) - // [2974] call printf_str - // [1210] phi from display_action_text_flashing::@9 to printf_str [phi:display_action_text_flashing::@9->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:display_action_text_flashing::@9->printf_str#0] -- pprz1=pprc1 + // [2207] call printf_str + // [785] phi from display_action_text_flashing::@9 to printf_str [phi:display_action_text_flashing::@9->printf_str] + // [785] phi printf_str::putc#53 = &snputc [phi:display_action_text_flashing::@9->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = s2 [phi:display_action_text_flashing::@9->printf_str#1] -- pbuz1=pbuc1 + // [785] phi printf_str::s#53 = s2 [phi:display_action_text_flashing::@9->printf_str#1] -- pbuz1=pbuc1 lda #s2 @@ -20013,7 +14009,7 @@ display_action_text_flashing: { jsr printf_str // display_action_text_flashing::@10 // sprintf(info_text, "Flashing %u bytes from RAM:%02x:%04p -> %s:%05x ... ", bytes, bram_bank, bram_ptr, chip, address) - // [2975] printf_ulong::uvalue#3 = display_action_text_flashing::address#10 -- vdum1=vdum2 + // [2208] printf_ulong::uvalue#3 = display_action_text_flashing::address#0 -- vdum1=vdum2 lda address sta printf_ulong.uvalue lda address+1 @@ -20022,1672 +14018,359 @@ display_action_text_flashing: { sta printf_ulong.uvalue+2 lda address+3 sta printf_ulong.uvalue+3 - // [2976] call printf_ulong - // [1741] phi from display_action_text_flashing::@10 to printf_ulong [phi:display_action_text_flashing::@10->printf_ulong] - // [1741] phi printf_ulong::format_zero_padding#15 = 1 [phi:display_action_text_flashing::@10->printf_ulong#0] -- vbum1=vbuc1 + // [2209] call printf_ulong + // [1633] phi from display_action_text_flashing::@10 to printf_ulong [phi:display_action_text_flashing::@10->printf_ulong] + // [1633] phi printf_ulong::format_zero_padding#10 = 1 [phi:display_action_text_flashing::@10->printf_ulong#0] -- vbum1=vbuc1 lda #1 sta printf_ulong.format_zero_padding - // [1741] phi printf_ulong::format_min_length#15 = 5 [phi:display_action_text_flashing::@10->printf_ulong#1] -- vbum1=vbuc1 + // [1633] phi printf_ulong::format_min_length#10 = 5 [phi:display_action_text_flashing::@10->printf_ulong#1] -- vbum1=vbuc1 lda #5 sta printf_ulong.format_min_length - // [1741] phi printf_ulong::format_radix#15 = HEXADECIMAL [phi:display_action_text_flashing::@10->printf_ulong#2] -- vbum1=vbuc1 + // [1633] phi printf_ulong::format_radix#10 = HEXADECIMAL [phi:display_action_text_flashing::@10->printf_ulong#2] -- vbum1=vbuc1 lda #HEXADECIMAL sta printf_ulong.format_radix - // [1741] phi printf_ulong::uvalue#15 = printf_ulong::uvalue#3 [phi:display_action_text_flashing::@10->printf_ulong#3] -- register_copy + // [1633] phi printf_ulong::uvalue#10 = printf_ulong::uvalue#3 [phi:display_action_text_flashing::@10->printf_ulong#3] -- register_copy jsr printf_ulong - // [2977] phi from display_action_text_flashing::@10 to display_action_text_flashing::@11 [phi:display_action_text_flashing::@10->display_action_text_flashing::@11] + // [2210] phi from display_action_text_flashing::@10 to display_action_text_flashing::@11 [phi:display_action_text_flashing::@10->display_action_text_flashing::@11] // display_action_text_flashing::@11 // sprintf(info_text, "Flashing %u bytes from RAM:%02x:%04p -> %s:%05x ... ", bytes, bram_bank, bram_ptr, chip, address) - // [2978] call printf_str - // [1210] phi from display_action_text_flashing::@11 to printf_str [phi:display_action_text_flashing::@11->printf_str] - // [1210] phi printf_str::putc#84 = &snputc [phi:display_action_text_flashing::@11->printf_str#0] -- pprz1=pprc1 + // [2211] call printf_str + // [785] phi from display_action_text_flashing::@11 to printf_str [phi:display_action_text_flashing::@11->printf_str] + // [785] phi printf_str::putc#53 = &snputc [phi:display_action_text_flashing::@11->printf_str#0] -- pprz1=pprc1 lda #snputc - sta.z printf_str.putc+1 - // [1210] phi printf_str::s#84 = s5 [phi:display_action_text_flashing::@11->printf_str#1] -- pbuz1=pbuc1 - lda #s5 - sta.z printf_str.s+1 - jsr printf_str - // display_action_text_flashing::@12 - // sprintf(info_text, "Flashing %u bytes from RAM:%02x:%04p -> %s:%05x ... ", bytes, bram_bank, bram_ptr, chip, address) - // [2979] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 - lda #0 - pha - // [2980] callexecute snputc -- call_vprc1 - jsr snputc - // sideeffect stackpullpadding(1) -- _stackpullpadding_1 - pla - // display_action_text(info_text) - // [2982] call display_action_text - // [1357] phi from display_action_text_flashing::@12 to display_action_text [phi:display_action_text_flashing::@12->display_action_text] - // [1357] phi display_action_text::info_text#25 = info_text [phi:display_action_text_flashing::@12->display_action_text#0] -- pbuz1=pbuc1 - lda #info_text - sta.z display_action_text.info_text+1 - jsr display_action_text - // display_action_text_flashing::@return - // } - // [2983] return - rts - .segment Data - s: .text "Flashing " - .byte 0 - s1: .text " bytes from RAM:" - .byte 0 - s3: .text " -> " - .byte 0 - bram_bank: .byte 0 - address: .dword 0 - bytes: .dword 0 -} -.segment Code - // rom_write -/* inline */ -// unsigned long rom_write(__mem() char flash_ram_bank, __zp($54) char *flash_ram_address, __mem() unsigned long flash_rom_address, unsigned int flash_rom_size) -rom_write: { - .label flash_ram_address = $54 - // unsigned long rom_chip_address = flash_rom_address & ROM_CHIP_MASK - // [2984] rom_write::rom_chip_address#0 = rom_write::flash_rom_address#1 & $380000 -- vdum1=vdum2_band_vduc1 - /// Holds the amount of bytes actually flashed in the ROM. - lda flash_rom_address - and #<$380000 - sta rom_chip_address - lda flash_rom_address+1 - and #>$380000 - sta rom_chip_address+1 - lda flash_rom_address+2 - and #<$380000>>$10 - sta rom_chip_address+2 - lda flash_rom_address+3 - and #>$380000>>$10 - sta rom_chip_address+3 - // rom_write::bank_set_bram1 - // BRAM = bank - // [2985] BRAM = rom_write::flash_ram_bank#0 -- vbuz1=vbum2 - lda flash_ram_bank - sta.z BRAM - // [2986] phi from rom_write::bank_set_bram1 to rom_write::@1 [phi:rom_write::bank_set_bram1->rom_write::@1] - // [2986] 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 - // [2986] 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 - // [2986] phi rom_write::flashed_bytes#2 = 0 [phi:rom_write::bank_set_bram1->rom_write::@1#2] -- vdum1=vduc1 - lda #<0 - sta flashed_bytes - sta flashed_bytes+1 - lda #<0>>$10 - sta flashed_bytes+2 - lda #>0>>$10 - sta flashed_bytes+3 - // rom_write::@1 - __b1: - // while (flashed_bytes < flash_rom_size) - // [2987] if(rom_write::flashed_bytes#2ROM_PROGRESS_CELL>>$10 - bcc __b2 - bne !+ - lda flashed_bytes+2 - cmp #>$10 - bcc __b2 - bne !+ - lda flashed_bytes+1 - cmp #>ROM_PROGRESS_CELL - bcc __b2 - bne !+ - lda flashed_bytes - cmp #$5555 - sta rom_unlock.address+1 - lda rom_chip_address+2 - adc #0 - sta rom_unlock.address+2 - lda rom_chip_address+3 - adc #0 - sta rom_unlock.address+3 - // [2990] call rom_unlock - // [2394] phi from rom_write::@2 to rom_unlock [phi:rom_write::@2->rom_unlock] - // [2394] phi rom_unlock::unlock_code#5 = $a0 [phi:rom_write::@2->rom_unlock#0] -- vbum1=vbuc1 - lda #$a0 - sta rom_unlock.unlock_code - // [2394] 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) - // [2991] rom_byte_program::address#0 = rom_write::flash_rom_address#3 -- vdum1=vdum2 - lda flash_rom_address - sta rom_byte_program.address - lda flash_rom_address+1 - sta rom_byte_program.address+1 - lda flash_rom_address+2 - sta rom_byte_program.address+2 - lda flash_rom_address+3 - sta rom_byte_program.address+3 - // [2992] rom_byte_program::value#0 = *rom_write::flash_ram_address#2 -- vbum1=_deref_pbuz2 - ldy #0 - lda (flash_ram_address),y - sta rom_byte_program.value - // [2993] call rom_byte_program - // [3354] phi from rom_write::@3 to rom_byte_program [phi:rom_write::@3->rom_byte_program] - jsr rom_byte_program - // rom_write::@4 - // flash_rom_address++; - // [2994] rom_write::flash_rom_address#0 = ++ rom_write::flash_rom_address#3 -- vdum1=_inc_vdum1 - inc flash_rom_address - bne !+ - inc flash_rom_address+1 - bne !+ - inc flash_rom_address+2 - bne !+ - inc flash_rom_address+3 - !: - // flash_ram_address++; - // [2995] rom_write::flash_ram_address#0 = ++ rom_write::flash_ram_address#2 -- pbuz1=_inc_pbuz1 - inc.z flash_ram_address - bne !+ - inc.z flash_ram_address+1 - !: - // flashed_bytes++; - // [2996] rom_write::flashed_bytes#1 = ++ rom_write::flashed_bytes#2 -- vdum1=_inc_vdum1 - inc flashed_bytes - bne !+ - inc flashed_bytes+1 - bne !+ - inc flashed_bytes+2 - bne !+ - inc flashed_bytes+3 - !: - // [2986] phi from rom_write::@4 to rom_write::@1 [phi:rom_write::@4->rom_write::@1] - // [2986] phi rom_write::flash_ram_address#2 = rom_write::flash_ram_address#0 [phi:rom_write::@4->rom_write::@1#0] -- register_copy - // [2986] phi rom_write::flash_rom_address#3 = rom_write::flash_rom_address#0 [phi:rom_write::@4->rom_write::@1#1] -- register_copy - // [2986] phi rom_write::flashed_bytes#2 = rom_write::flashed_bytes#1 [phi:rom_write::@4->rom_write::@1#2] -- register_copy - jmp __b1 - .segment Data - rom_chip_address: .dword 0 - flash_rom_address: .dword 0 - flashed_bytes: .dword 0 - flash_ram_bank: .byte 0 -} -.segment Code - // cbm_k_getin -/** - * @brief Scan a character from keyboard without pressing enter. - * - * @return char The character read. - */ -cbm_k_getin: { - // __mem unsigned char ch - // [2997] cbm_k_getin::ch = 0 -- vbum1=vbuc1 - lda #0 - sta ch - // asm - // asm { jsrCBM_GETIN stach } - jsr CBM_GETIN - sta ch - // return ch; - // [2999] cbm_k_getin::return#0 = cbm_k_getin::ch -- vbum1=vbum2 - sta return - // cbm_k_getin::@return - // } - // [3000] cbm_k_getin::return#1 = cbm_k_getin::return#0 - // [3001] return - rts - .segment Data - ch: .byte 0 - return: .byte 0 -} -.segment Code - // strncpy -/// Copies up to n characters from the string pointed to, by src to dst. -/// In a case where the length of src is less than that of n, the remainder of dst will be padded with null bytes. -/// @param dst ? This is the pointer to the destination array where the content is to be copied. -/// @param src ? This is the string to be copied. -/// @param n ? The number of characters to be copied from source. -/// @return The destination -// char * strncpy(__zp($47) char *dst, __zp($3f) const char *src, __mem() unsigned int n) -strncpy: { - .label dst = $47 - .label src = $3f - // [3003] phi from strncpy to strncpy::@1 [phi:strncpy->strncpy::@1] - // [3003] phi strncpy::dst#3 = strncpy::dst#8 [phi:strncpy->strncpy::@1#0] -- register_copy - // [3003] phi strncpy::src#3 = strncpy::src#6 [phi:strncpy->strncpy::@1#1] -- register_copy - // [3003] phi strncpy::i#2 = 0 [phi:strncpy->strncpy::@1#2] -- vwum1=vwuc1 - lda #<0 - sta i - sta i+1 - // strncpy::@1 - __b1: - // for(size_t i = 0;istrncpy::@3] - // [3009] phi strncpy::src#7 = strncpy::src#3 [phi:strncpy::@2/strncpy::@4->strncpy::@3#0] -- register_copy - // strncpy::@3 - __b3: - // *dst++ = c - // [3010] *strncpy::dst#3 = strncpy::c#0 -- _deref_pbuz1=vbum2 - lda c - ldy #0 - sta (dst),y - // *dst++ = c; - // [3011] strncpy::dst#0 = ++ strncpy::dst#3 -- pbuz1=_inc_pbuz1 - inc.z dst - bne !+ - inc.z dst+1 - !: - // for(size_t i = 0;istrncpy::@1] - // [3003] phi strncpy::dst#3 = strncpy::dst#0 [phi:strncpy::@3->strncpy::@1#0] -- register_copy - // [3003] phi strncpy::src#3 = strncpy::src#7 [phi:strncpy::@3->strncpy::@1#1] -- register_copy - // [3003] phi strncpy::i#2 = strncpy::i#1 [phi:strncpy::@3->strncpy::@1#2] -- register_copy - jmp __b1 - .segment Data - c: .byte 0 - i: .word 0 - n: .word 0 -} -.segment Code - // utoa -// Converts unsigned number value to a string representing it in RADIX format. -// If the leading digits are zero they are not included in the string. -// - value : The number to be converted to RADIX -// - buffer : receives the string representing the number and zero-termination. -// - radix : The radix to convert the number to (from the enum RADIX) -// void utoa(__mem() unsigned int value, __zp($3d) char *buffer, __mem() char radix) -utoa: { - .label utoa__4 = $3a - .label utoa__10 = $41 - .label utoa__11 = $42 - .label buffer = $3d - .label digit_values = $4e - // if(radix==DECIMAL) - // [3013] if(utoa::radix#0==DECIMAL) goto utoa::@1 -- vbum1_eq_vbuc1_then_la1 - lda #DECIMAL - cmp radix - beq __b2 - // utoa::@2 - // if(radix==HEXADECIMAL) - // [3014] if(utoa::radix#0==HEXADECIMAL) goto utoa::@1 -- vbum1_eq_vbuc1_then_la1 - lda #HEXADECIMAL - cmp radix - beq __b3 - // utoa::@3 - // if(radix==OCTAL) - // [3015] if(utoa::radix#0==OCTAL) goto utoa::@1 -- vbum1_eq_vbuc1_then_la1 - lda #OCTAL - cmp radix - beq __b4 - // utoa::@4 - // if(radix==BINARY) - // [3016] if(utoa::radix#0==BINARY) goto utoa::@1 -- vbum1_eq_vbuc1_then_la1 - lda #BINARY - cmp radix - beq __b5 - // utoa::@5 - // *buffer++ = 'e' - // [3017] *((char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS) = 'e' -- _deref_pbuc1=vbuc2 - // Unknown radix - lda #'e' - sta printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS - // *buffer++ = 'r' - // [3018] *((char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+1) = 'r' -- _deref_pbuc1=vbuc2 - lda #'r' - sta printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+1 - // [3019] *((char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+2) = 'r' -- _deref_pbuc1=vbuc2 - sta printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+2 - // *buffer = 0 - // [3020] *((char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+3) = 0 -- _deref_pbuc1=vbuc2 - lda #0 - sta printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+3 - // utoa::@return - // } - // [3021] return - rts - // [3022] phi from utoa to utoa::@1 [phi:utoa->utoa::@1] - __b2: - // [3022] phi utoa::digit_values#8 = RADIX_DECIMAL_VALUES [phi:utoa->utoa::@1#0] -- pwuz1=pwuc1 - lda #RADIX_DECIMAL_VALUES - sta.z digit_values+1 - // [3022] phi utoa::max_digits#7 = 5 [phi:utoa->utoa::@1#1] -- vbum1=vbuc1 - lda #5 - sta max_digits - jmp __b1 - // [3022] phi from utoa::@2 to utoa::@1 [phi:utoa::@2->utoa::@1] - __b3: - // [3022] phi utoa::digit_values#8 = RADIX_HEXADECIMAL_VALUES [phi:utoa::@2->utoa::@1#0] -- pwuz1=pwuc1 - lda #RADIX_HEXADECIMAL_VALUES - sta.z digit_values+1 - // [3022] phi utoa::max_digits#7 = 4 [phi:utoa::@2->utoa::@1#1] -- vbum1=vbuc1 - lda #4 - sta max_digits - jmp __b1 - // [3022] phi from utoa::@3 to utoa::@1 [phi:utoa::@3->utoa::@1] - __b4: - // [3022] phi utoa::digit_values#8 = RADIX_OCTAL_VALUES [phi:utoa::@3->utoa::@1#0] -- pwuz1=pwuc1 - lda #RADIX_OCTAL_VALUES - sta.z digit_values+1 - // [3022] phi utoa::max_digits#7 = 6 [phi:utoa::@3->utoa::@1#1] -- vbum1=vbuc1 - lda #6 - sta max_digits - jmp __b1 - // [3022] phi from utoa::@4 to utoa::@1 [phi:utoa::@4->utoa::@1] - __b5: - // [3022] phi utoa::digit_values#8 = RADIX_BINARY_VALUES [phi:utoa::@4->utoa::@1#0] -- pwuz1=pwuc1 - lda #RADIX_BINARY_VALUES - sta.z digit_values+1 - // [3022] phi utoa::max_digits#7 = $10 [phi:utoa::@4->utoa::@1#1] -- vbum1=vbuc1 - lda #$10 - sta max_digits - // utoa::@1 - __b1: - // [3023] phi from utoa::@1 to utoa::@6 [phi:utoa::@1->utoa::@6] - // [3023] phi utoa::buffer#11 = (char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS [phi:utoa::@1->utoa::@6#0] -- pbuz1=pbuc1 - lda #printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS - sta.z buffer+1 - // [3023] phi utoa::started#2 = 0 [phi:utoa::@1->utoa::@6#1] -- vbum1=vbuc1 - lda #0 - sta started - // [3023] phi utoa::value#2 = utoa::value#1 [phi:utoa::@1->utoa::@6#2] -- register_copy - // [3023] phi utoa::digit#2 = 0 [phi:utoa::@1->utoa::@6#3] -- vbum1=vbuc1 - sta digit - // utoa::@6 - __b6: - // max_digits-1 - // [3024] utoa::$4 = utoa::max_digits#7 - 1 -- vbuz1=vbum2_minus_1 - ldx max_digits - dex - stx.z utoa__4 - // for( char digit=0; digit= digit_value) - // [3032] if(0!=utoa::started#2) goto utoa::@10 -- 0_neq_vbum1_then_la1 - lda started - bne __b10 - // utoa::@12 - // [3033] if(utoa::value#2>=utoa::digit_value#0) goto utoa::@10 -- vwum1_ge_vwum2_then_la1 - lda digit_value+1 - cmp value+1 - bne !+ - lda digit_value - cmp value - beq __b10 - !: - bcc __b10 - // [3034] phi from utoa::@12 to utoa::@9 [phi:utoa::@12->utoa::@9] - // [3034] phi utoa::buffer#14 = utoa::buffer#11 [phi:utoa::@12->utoa::@9#0] -- register_copy - // [3034] phi utoa::started#4 = utoa::started#2 [phi:utoa::@12->utoa::@9#1] -- register_copy - // [3034] phi utoa::value#6 = utoa::value#2 [phi:utoa::@12->utoa::@9#2] -- register_copy - // utoa::@9 - __b9: - // for( char digit=0; digitutoa::@6] - // [3023] phi utoa::buffer#11 = utoa::buffer#14 [phi:utoa::@9->utoa::@6#0] -- register_copy - // [3023] phi utoa::started#2 = utoa::started#4 [phi:utoa::@9->utoa::@6#1] -- register_copy - // [3023] phi utoa::value#2 = utoa::value#6 [phi:utoa::@9->utoa::@6#2] -- register_copy - // [3023] phi utoa::digit#2 = utoa::digit#1 [phi:utoa::@9->utoa::@6#3] -- register_copy - jmp __b6 - // utoa::@10 - __b10: - // utoa_append(buffer++, value, digit_value) - // [3036] utoa_append::buffer#0 = utoa::buffer#11 -- pbuz1=pbuz2 - lda.z buffer - sta.z utoa_append.buffer - lda.z buffer+1 - sta.z utoa_append.buffer+1 - // [3037] utoa_append::value#0 = utoa::value#2 - // [3038] utoa_append::sub#0 = utoa::digit_value#0 - // [3039] call utoa_append - // [3364] phi from utoa::@10 to utoa_append [phi:utoa::@10->utoa_append] - jsr utoa_append - // utoa_append(buffer++, value, digit_value) - // [3040] utoa_append::return#0 = utoa_append::value#2 - // utoa::@11 - // value = utoa_append(buffer++, value, digit_value) - // [3041] utoa::value#0 = utoa_append::return#0 - // value = utoa_append(buffer++, value, digit_value); - // [3042] utoa::buffer#4 = ++ utoa::buffer#11 -- pbuz1=_inc_pbuz1 - inc.z buffer - bne !+ - inc.z buffer+1 - !: - // [3034] phi from utoa::@11 to utoa::@9 [phi:utoa::@11->utoa::@9] - // [3034] phi utoa::buffer#14 = utoa::buffer#4 [phi:utoa::@11->utoa::@9#0] -- register_copy - // [3034] phi utoa::started#4 = 1 [phi:utoa::@11->utoa::@9#1] -- vbum1=vbuc1 - lda #1 - sta started - // [3034] phi utoa::value#6 = utoa::value#0 [phi:utoa::@11->utoa::@9#2] -- register_copy - jmp __b9 - .segment Data - digit_value: .word 0 - digit: .byte 0 - .label value = smc_detect.return - .label radix = printf_uint.format_radix - started: .byte 0 - max_digits: .byte 0 -} -.segment Code - // insertup -// Insert a new line, and scroll the upper part of the screen up. -// void insertup(char rows) -insertup: { - .label insertup__0 = $36 - .label insertup__4 = $2a - .label insertup__6 = $2c - .label insertup__7 = $2a - // __conio.width+1 - // [3043] insertup::$0 = *((char *)&__conio+6) + 1 -- vbuz1=_deref_pbuc1_plus_1 - lda __conio+6 - inc - sta.z insertup__0 - // unsigned char width = (__conio.width+1) * 2 - // [3044] insertup::width#0 = insertup::$0 << 1 -- vbum1=vbuz2_rol_1 - // {asm{.byte $db}} - asl - sta width - // [3045] phi from insertup to insertup::@1 [phi:insertup->insertup::@1] - // [3045] phi insertup::y#2 = 0 [phi:insertup->insertup::@1#0] -- vbum1=vbuc1 - lda #0 - sta y - // insertup::@1 - __b1: - // for(unsigned char y=0; y<__conio.cursor_y; y++) - // [3046] if(insertup::y#2<*((char *)&__conio+1)) goto insertup::@2 -- vbum1_lt__deref_pbuc1_then_la1 - lda y - cmp __conio+1 - bcc __b2 - // [3047] phi from insertup::@1 to insertup::@3 [phi:insertup::@1->insertup::@3] - // insertup::@3 - // clearline() - // [3048] call clearline - jsr clearline - // insertup::@return - // } - // [3049] return - rts - // insertup::@2 - __b2: - // y+1 - // [3050] insertup::$4 = insertup::y#2 + 1 -- vbuz1=vbum2_plus_1 - lda y - inc - sta.z insertup__4 - // memcpy8_vram_vram(__conio.mapbase_bank, __conio.offsets[y], __conio.mapbase_bank, __conio.offsets[y+1], width) - // [3051] insertup::$6 = insertup::y#2 << 1 -- vbuz1=vbum2_rol_1 - lda y - asl - sta.z insertup__6 - // [3052] insertup::$7 = insertup::$4 << 1 -- vbuz1=vbuz1_rol_1 - asl.z insertup__7 - // [3053] memcpy8_vram_vram::dbank_vram#0 = *((char *)&__conio+5) -- vbum1=_deref_pbuc1 - lda __conio+5 - sta memcpy8_vram_vram.dbank_vram - // [3054] memcpy8_vram_vram::doffset_vram#0 = ((unsigned int *)&__conio+$15)[insertup::$6] -- vwum1=pwuc1_derefidx_vbuz2 - ldy.z insertup__6 - lda __conio+$15,y - sta memcpy8_vram_vram.doffset_vram - lda __conio+$15+1,y - sta memcpy8_vram_vram.doffset_vram+1 - // [3055] memcpy8_vram_vram::sbank_vram#0 = *((char *)&__conio+5) -- vbum1=_deref_pbuc1 - lda __conio+5 - sta memcpy8_vram_vram.sbank_vram - // [3056] memcpy8_vram_vram::soffset_vram#0 = ((unsigned int *)&__conio+$15)[insertup::$7] -- vwum1=pwuc1_derefidx_vbuz2 - ldy.z insertup__7 - lda __conio+$15,y - sta memcpy8_vram_vram.soffset_vram - lda __conio+$15+1,y - sta memcpy8_vram_vram.soffset_vram+1 - // [3057] memcpy8_vram_vram::num8#1 = insertup::width#0 -- vbum1=vbum2 - lda width - sta memcpy8_vram_vram.num8_1 - // [3058] call memcpy8_vram_vram - jsr memcpy8_vram_vram - // insertup::@4 - // for(unsigned char y=0; y<__conio.cursor_y; y++) - // [3059] insertup::y#1 = ++ insertup::y#2 -- vbum1=_inc_vbum1 - inc y - // [3045] phi from insertup::@4 to insertup::@1 [phi:insertup::@4->insertup::@1] - // [3045] phi insertup::y#2 = insertup::y#1 [phi:insertup::@4->insertup::@1#0] -- register_copy - jmp __b1 - .segment Data - width: .byte 0 - y: .byte 0 -} -.segment Code - // clearline -clearline: { - .label clearline__0 = $24 - .label clearline__1 = $25 - .label clearline__2 = $26 - .label clearline__3 = $23 - .label c = $22 - // unsigned int addr = __conio.offsets[__conio.cursor_y] - // [3060] clearline::$3 = *((char *)&__conio+1) << 1 -- vbuz1=_deref_pbuc1_rol_1 - lda __conio+1 - asl - sta.z clearline__3 - // [3061] clearline::addr#0 = ((unsigned int *)&__conio+$15)[clearline::$3] -- vwum1=pwuc1_derefidx_vbuz2 - tay - lda __conio+$15,y - sta addr - lda __conio+$15+1,y - sta addr+1 - // *VERA_CTRL &= ~VERA_ADDRSEL - // [3062] *VERA_CTRL = *VERA_CTRL & ~VERA_ADDRSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 - lda #VERA_ADDRSEL^$ff - and VERA_CTRL - sta VERA_CTRL - // BYTE0(addr) - // [3063] clearline::$0 = byte0 clearline::addr#0 -- vbuz1=_byte0_vwum2 - lda addr - sta.z clearline__0 - // *VERA_ADDRX_L = BYTE0(addr) - // [3064] *VERA_ADDRX_L = clearline::$0 -- _deref_pbuc1=vbuz1 - sta VERA_ADDRX_L - // BYTE1(addr) - // [3065] clearline::$1 = byte1 clearline::addr#0 -- vbuz1=_byte1_vwum2 - lda addr+1 - sta.z clearline__1 - // *VERA_ADDRX_M = BYTE1(addr) - // [3066] *VERA_ADDRX_M = clearline::$1 -- _deref_pbuc1=vbuz1 - sta VERA_ADDRX_M - // __conio.mapbase_bank | VERA_INC_1 - // [3067] clearline::$2 = *((char *)&__conio+5) | VERA_INC_1 -- vbuz1=_deref_pbuc1_bor_vbuc2 - lda #VERA_INC_1 - ora __conio+5 - sta.z clearline__2 - // *VERA_ADDRX_H = __conio.mapbase_bank | VERA_INC_1 - // [3068] *VERA_ADDRX_H = clearline::$2 -- _deref_pbuc1=vbuz1 - sta VERA_ADDRX_H - // register unsigned char c=__conio.width - // [3069] clearline::c#0 = *((char *)&__conio+6) -- vbuz1=_deref_pbuc1 - lda __conio+6 - sta.z c - // [3070] phi from clearline clearline::@1 to clearline::@1 [phi:clearline/clearline::@1->clearline::@1] - // [3070] phi clearline::c#2 = clearline::c#0 [phi:clearline/clearline::@1->clearline::@1#0] -- register_copy - // clearline::@1 - __b1: - // *VERA_DATA0 = ' ' - // [3071] *VERA_DATA0 = ' ' -- _deref_pbuc1=vbuc2 - lda #' ' - sta VERA_DATA0 - // *VERA_DATA0 = __conio.color - // [3072] *VERA_DATA0 = *((char *)&__conio+$d) -- _deref_pbuc1=_deref_pbuc2 - lda __conio+$d - sta VERA_DATA0 - // c--; - // [3073] clearline::c#1 = -- clearline::c#2 -- vbuz1=_dec_vbuz1 - dec.z c - // while(c) - // [3074] if(0!=clearline::c#1) goto clearline::@1 -- 0_neq_vbuz1_then_la1 - lda.z c - bne __b1 - // clearline::@return - // } - // [3075] return - rts - .segment Data - addr: .word 0 -} -.segment Code - // display_frame_maskxy -/** - * @brief - * - * @param x - * @param y - * @return unsigned char - */ -// __mem() char display_frame_maskxy(__mem() char x, __mem() char y) -display_frame_maskxy: { - .label cpeekcxy1_cpeekc1_display_frame_maskxy__0 = $42 - .label cpeekcxy1_cpeekc1_display_frame_maskxy__1 = $41 - .label cpeekcxy1_cpeekc1_display_frame_maskxy__2 = $3a - // display_frame_maskxy::cpeekcxy1 - // gotoxy(x,y) - // [3077] gotoxy::x#9 = display_frame_maskxy::cpeekcxy1_x#0 -- vbum1=vbum2 - lda cpeekcxy1_x - sta gotoxy.x - // [3078] gotoxy::y#9 = display_frame_maskxy::cpeekcxy1_y#0 -- vbum1=vbum2 - lda cpeekcxy1_y - sta gotoxy.y - // [3079] call gotoxy - // [802] phi from display_frame_maskxy::cpeekcxy1 to gotoxy [phi:display_frame_maskxy::cpeekcxy1->gotoxy] - // [802] phi gotoxy::y#37 = gotoxy::y#9 [phi:display_frame_maskxy::cpeekcxy1->gotoxy#0] -- register_copy - // [802] phi gotoxy::x#37 = gotoxy::x#9 [phi:display_frame_maskxy::cpeekcxy1->gotoxy#1] -- register_copy - jsr gotoxy - // display_frame_maskxy::cpeekcxy1_cpeekc1 - // *VERA_CTRL &= ~VERA_ADDRSEL - // [3080] *VERA_CTRL = *VERA_CTRL & ~VERA_ADDRSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 - lda #VERA_ADDRSEL^$ff - and VERA_CTRL - sta VERA_CTRL - // BYTE0(__conio.offset) - // [3081] display_frame_maskxy::cpeekcxy1_cpeekc1_$0 = byte0 *((unsigned int *)&__conio+$13) -- vbuz1=_byte0__deref_pwuc1 - lda __conio+$13 - sta.z cpeekcxy1_cpeekc1_display_frame_maskxy__0 - // *VERA_ADDRX_L = BYTE0(__conio.offset) - // [3082] *VERA_ADDRX_L = display_frame_maskxy::cpeekcxy1_cpeekc1_$0 -- _deref_pbuc1=vbuz1 - sta VERA_ADDRX_L - // BYTE1(__conio.offset) - // [3083] display_frame_maskxy::cpeekcxy1_cpeekc1_$1 = byte1 *((unsigned int *)&__conio+$13) -- vbuz1=_byte1__deref_pwuc1 - lda __conio+$13+1 - sta.z cpeekcxy1_cpeekc1_display_frame_maskxy__1 - // *VERA_ADDRX_M = BYTE1(__conio.offset) - // [3084] *VERA_ADDRX_M = display_frame_maskxy::cpeekcxy1_cpeekc1_$1 -- _deref_pbuc1=vbuz1 - sta VERA_ADDRX_M - // __conio.mapbase_bank | VERA_INC_0 - // [3085] display_frame_maskxy::cpeekcxy1_cpeekc1_$2 = *((char *)&__conio+5) -- vbuz1=_deref_pbuc1 - lda __conio+5 - sta.z cpeekcxy1_cpeekc1_display_frame_maskxy__2 - // *VERA_ADDRX_H = __conio.mapbase_bank | VERA_INC_0 - // [3086] *VERA_ADDRX_H = display_frame_maskxy::cpeekcxy1_cpeekc1_$2 -- _deref_pbuc1=vbuz1 - sta VERA_ADDRX_H - // return *VERA_DATA0; - // [3087] display_frame_maskxy::c#0 = *VERA_DATA0 -- vbum1=_deref_pbuc1 - lda VERA_DATA0 - sta c - // display_frame_maskxy::@12 - // case 0x70: // DR corner. - // return 0b0110; - // [3088] if(display_frame_maskxy::c#0==$70) goto display_frame_maskxy::@return -- vbum1_eq_vbuc1_then_la1 - lda #$70 - cmp c - beq __b2 - // display_frame_maskxy::@1 - // case 0x6E: // DL corner. - // return 0b0011; - // [3089] if(display_frame_maskxy::c#0==$6e) goto display_frame_maskxy::@return -- vbum1_eq_vbuc1_then_la1 - lda #$6e - cmp c - beq __b1 - // display_frame_maskxy::@2 - // case 0x6D: // UR corner. - // return 0b1100; - // [3090] if(display_frame_maskxy::c#0==$6d) goto display_frame_maskxy::@return -- vbum1_eq_vbuc1_then_la1 - lda #$6d - cmp c - beq __b3 - // display_frame_maskxy::@3 - // case 0x7D: // UL corner. - // return 0b1001; - // [3091] if(display_frame_maskxy::c#0==$7d) goto display_frame_maskxy::@return -- vbum1_eq_vbuc1_then_la1 - lda #$7d - cmp c - beq __b4 - // display_frame_maskxy::@4 - // case 0x40: // HL line. - // return 0b0101; - // [3092] if(display_frame_maskxy::c#0==$40) goto display_frame_maskxy::@return -- vbum1_eq_vbuc1_then_la1 - lda #$40 - cmp c - beq __b5 - // display_frame_maskxy::@5 - // case 0x5D: // VL line. - // return 0b1010; - // [3093] if(display_frame_maskxy::c#0==$5d) goto display_frame_maskxy::@return -- vbum1_eq_vbuc1_then_la1 - lda #$5d - cmp c - beq __b6 - // display_frame_maskxy::@6 - // case 0x6B: // VR junction. - // return 0b1110; - // [3094] if(display_frame_maskxy::c#0==$6b) goto display_frame_maskxy::@return -- vbum1_eq_vbuc1_then_la1 - lda #$6b - cmp c - beq __b7 - // display_frame_maskxy::@7 - // case 0x73: // VL junction. - // return 0b1011; - // [3095] if(display_frame_maskxy::c#0==$73) goto display_frame_maskxy::@return -- vbum1_eq_vbuc1_then_la1 - lda #$73 - cmp c - beq __b8 - // display_frame_maskxy::@8 - // case 0x72: // HD junction. - // return 0b0111; - // [3096] if(display_frame_maskxy::c#0==$72) goto display_frame_maskxy::@return -- vbum1_eq_vbuc1_then_la1 - lda #$72 - cmp c - beq __b9 - // display_frame_maskxy::@9 - // case 0x71: // HU junction. - // return 0b1101; - // [3097] if(display_frame_maskxy::c#0==$71) goto display_frame_maskxy::@return -- vbum1_eq_vbuc1_then_la1 - lda #$71 - cmp c - beq __b10 - // display_frame_maskxy::@10 - // case 0x5B: // HV junction. - // return 0b1111; - // [3098] if(display_frame_maskxy::c#0==$5b) goto display_frame_maskxy::@11 -- vbum1_eq_vbuc1_then_la1 - lda #$5b - cmp c - beq __b11 - // [3100] phi from display_frame_maskxy::@10 to display_frame_maskxy::@return [phi:display_frame_maskxy::@10->display_frame_maskxy::@return] - // [3100] phi display_frame_maskxy::return#12 = 0 [phi:display_frame_maskxy::@10->display_frame_maskxy::@return#0] -- vbum1=vbuc1 - lda #0 - sta return - rts - // [3099] 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: - // [3100] phi from display_frame_maskxy::@11 to display_frame_maskxy::@return [phi:display_frame_maskxy::@11->display_frame_maskxy::@return] - // [3100] phi display_frame_maskxy::return#12 = $f [phi:display_frame_maskxy::@11->display_frame_maskxy::@return#0] -- vbum1=vbuc1 - lda #$f - sta return - rts - // [3100] phi from display_frame_maskxy::@1 to display_frame_maskxy::@return [phi:display_frame_maskxy::@1->display_frame_maskxy::@return] - __b1: - // [3100] phi display_frame_maskxy::return#12 = 3 [phi:display_frame_maskxy::@1->display_frame_maskxy::@return#0] -- vbum1=vbuc1 - lda #3 - sta return - rts - // [3100] phi from display_frame_maskxy::@12 to display_frame_maskxy::@return [phi:display_frame_maskxy::@12->display_frame_maskxy::@return] - __b2: - // [3100] phi display_frame_maskxy::return#12 = 6 [phi:display_frame_maskxy::@12->display_frame_maskxy::@return#0] -- vbum1=vbuc1 - lda #6 - sta return - rts - // [3100] phi from display_frame_maskxy::@2 to display_frame_maskxy::@return [phi:display_frame_maskxy::@2->display_frame_maskxy::@return] - __b3: - // [3100] phi display_frame_maskxy::return#12 = $c [phi:display_frame_maskxy::@2->display_frame_maskxy::@return#0] -- vbum1=vbuc1 - lda #$c - sta return - rts - // [3100] phi from display_frame_maskxy::@3 to display_frame_maskxy::@return [phi:display_frame_maskxy::@3->display_frame_maskxy::@return] - __b4: - // [3100] phi display_frame_maskxy::return#12 = 9 [phi:display_frame_maskxy::@3->display_frame_maskxy::@return#0] -- vbum1=vbuc1 - lda #9 - sta return - rts - // [3100] phi from display_frame_maskxy::@4 to display_frame_maskxy::@return [phi:display_frame_maskxy::@4->display_frame_maskxy::@return] - __b5: - // [3100] phi display_frame_maskxy::return#12 = 5 [phi:display_frame_maskxy::@4->display_frame_maskxy::@return#0] -- vbum1=vbuc1 - lda #5 - sta return - rts - // [3100] phi from display_frame_maskxy::@5 to display_frame_maskxy::@return [phi:display_frame_maskxy::@5->display_frame_maskxy::@return] - __b6: - // [3100] phi display_frame_maskxy::return#12 = $a [phi:display_frame_maskxy::@5->display_frame_maskxy::@return#0] -- vbum1=vbuc1 - lda #$a - sta return - rts - // [3100] phi from display_frame_maskxy::@6 to display_frame_maskxy::@return [phi:display_frame_maskxy::@6->display_frame_maskxy::@return] - __b7: - // [3100] phi display_frame_maskxy::return#12 = $e [phi:display_frame_maskxy::@6->display_frame_maskxy::@return#0] -- vbum1=vbuc1 - lda #$e - sta return - rts - // [3100] phi from display_frame_maskxy::@7 to display_frame_maskxy::@return [phi:display_frame_maskxy::@7->display_frame_maskxy::@return] - __b8: - // [3100] phi display_frame_maskxy::return#12 = $b [phi:display_frame_maskxy::@7->display_frame_maskxy::@return#0] -- vbum1=vbuc1 - lda #$b - sta return - rts - // [3100] phi from display_frame_maskxy::@8 to display_frame_maskxy::@return [phi:display_frame_maskxy::@8->display_frame_maskxy::@return] - __b9: - // [3100] phi display_frame_maskxy::return#12 = 7 [phi:display_frame_maskxy::@8->display_frame_maskxy::@return#0] -- vbum1=vbuc1 - lda #7 - sta return - rts - // [3100] phi from display_frame_maskxy::@9 to display_frame_maskxy::@return [phi:display_frame_maskxy::@9->display_frame_maskxy::@return] - __b10: - // [3100] phi display_frame_maskxy::return#12 = $d [phi:display_frame_maskxy::@9->display_frame_maskxy::@return#0] -- vbum1=vbuc1 - lda #$d - sta return - // display_frame_maskxy::@return - // } - // [3101] return - rts - .segment Data - cpeekcxy1_x: .byte 0 - cpeekcxy1_y: .byte 0 - c: .byte 0 - // DR corner. - // DL corner. - // UR corner. - // UL corner. - // HL line. - // VL line. - // VR junction. - // VL junction. - // HD junction. - // HU junction. - // HV junction. - return: .byte 0 - .label x = cpeekcxy1_x - .label y = cpeekcxy1_y -} -.segment Code - // display_frame_char -/** - * @brief - * - * @param mask - * @return unsigned char - */ -// __mem() char display_frame_char(__mem() char mask) -display_frame_char: { - // case 0b0110: - // return 0x70; - // [3103] if(display_frame_char::mask#10==6) goto display_frame_char::@return -- vbum1_eq_vbuc1_then_la1 - lda #6 - cmp mask - beq __b1 - // display_frame_char::@1 - // case 0b0011: - // return 0x6E; - // [3104] if(display_frame_char::mask#10==3) goto display_frame_char::@return -- vbum1_eq_vbuc1_then_la1 - // DR corner. - lda #3 - cmp mask - beq __b2 - // display_frame_char::@2 - // case 0b1100: - // return 0x6D; - // [3105] if(display_frame_char::mask#10==$c) goto display_frame_char::@return -- vbum1_eq_vbuc1_then_la1 - // DL corner. - lda #$c - cmp mask - beq __b3 - // display_frame_char::@3 - // case 0b1001: - // return 0x7D; - // [3106] if(display_frame_char::mask#10==9) goto display_frame_char::@return -- vbum1_eq_vbuc1_then_la1 - // UR corner. - lda #9 - cmp mask - beq __b4 - // display_frame_char::@4 - // case 0b0101: - // return 0x40; - // [3107] if(display_frame_char::mask#10==5) goto display_frame_char::@return -- vbum1_eq_vbuc1_then_la1 - // UL corner. - lda #5 - cmp mask - beq __b5 - // display_frame_char::@5 - // case 0b1010: - // return 0x5D; - // [3108] if(display_frame_char::mask#10==$a) goto display_frame_char::@return -- vbum1_eq_vbuc1_then_la1 - // HL line. - lda #$a - cmp mask - beq __b6 - // display_frame_char::@6 - // case 0b1110: - // return 0x6B; - // [3109] if(display_frame_char::mask#10==$e) goto display_frame_char::@return -- vbum1_eq_vbuc1_then_la1 - // VL line. - lda #$e - cmp mask - beq __b7 - // display_frame_char::@7 - // case 0b1011: - // return 0x73; - // [3110] if(display_frame_char::mask#10==$b) goto display_frame_char::@return -- vbum1_eq_vbuc1_then_la1 - // VR junction. - lda #$b - cmp mask - beq __b8 - // display_frame_char::@8 - // case 0b0111: - // return 0x72; - // [3111] if(display_frame_char::mask#10==7) goto display_frame_char::@return -- vbum1_eq_vbuc1_then_la1 - // VL junction. - lda #7 - cmp mask - beq __b9 - // display_frame_char::@9 - // case 0b1101: - // return 0x71; - // [3112] if(display_frame_char::mask#10==$d) goto display_frame_char::@return -- vbum1_eq_vbuc1_then_la1 - // HD junction. - lda #$d - cmp mask - beq __b10 - // display_frame_char::@10 - // case 0b1111: - // return 0x5B; - // [3113] if(display_frame_char::mask#10==$f) goto display_frame_char::@11 -- vbum1_eq_vbuc1_then_la1 - // HU junction. - lda #$f - cmp mask - beq __b11 - // [3115] phi from display_frame_char::@10 to display_frame_char::@return [phi:display_frame_char::@10->display_frame_char::@return] - // [3115] phi display_frame_char::return#12 = $20 [phi:display_frame_char::@10->display_frame_char::@return#0] -- vbum1=vbuc1 - lda #$20 - sta return - rts - // [3114] 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: - // [3115] phi from display_frame_char::@11 to display_frame_char::@return [phi:display_frame_char::@11->display_frame_char::@return] - // [3115] phi display_frame_char::return#12 = $5b [phi:display_frame_char::@11->display_frame_char::@return#0] -- vbum1=vbuc1 - lda #$5b - sta return - rts - // [3115] phi from display_frame_char to display_frame_char::@return [phi:display_frame_char->display_frame_char::@return] - __b1: - // [3115] phi display_frame_char::return#12 = $70 [phi:display_frame_char->display_frame_char::@return#0] -- vbum1=vbuc1 - lda #$70 - sta return - rts - // [3115] phi from display_frame_char::@1 to display_frame_char::@return [phi:display_frame_char::@1->display_frame_char::@return] - __b2: - // [3115] phi display_frame_char::return#12 = $6e [phi:display_frame_char::@1->display_frame_char::@return#0] -- vbum1=vbuc1 - lda #$6e - sta return - rts - // [3115] phi from display_frame_char::@2 to display_frame_char::@return [phi:display_frame_char::@2->display_frame_char::@return] - __b3: - // [3115] phi display_frame_char::return#12 = $6d [phi:display_frame_char::@2->display_frame_char::@return#0] -- vbum1=vbuc1 - lda #$6d - sta return - rts - // [3115] phi from display_frame_char::@3 to display_frame_char::@return [phi:display_frame_char::@3->display_frame_char::@return] - __b4: - // [3115] phi display_frame_char::return#12 = $7d [phi:display_frame_char::@3->display_frame_char::@return#0] -- vbum1=vbuc1 - lda #$7d - sta return - rts - // [3115] phi from display_frame_char::@4 to display_frame_char::@return [phi:display_frame_char::@4->display_frame_char::@return] - __b5: - // [3115] phi display_frame_char::return#12 = $40 [phi:display_frame_char::@4->display_frame_char::@return#0] -- vbum1=vbuc1 - lda #$40 - sta return - rts - // [3115] phi from display_frame_char::@5 to display_frame_char::@return [phi:display_frame_char::@5->display_frame_char::@return] - __b6: - // [3115] phi display_frame_char::return#12 = $5d [phi:display_frame_char::@5->display_frame_char::@return#0] -- vbum1=vbuc1 - lda #$5d - sta return - rts - // [3115] phi from display_frame_char::@6 to display_frame_char::@return [phi:display_frame_char::@6->display_frame_char::@return] - __b7: - // [3115] phi display_frame_char::return#12 = $6b [phi:display_frame_char::@6->display_frame_char::@return#0] -- vbum1=vbuc1 - lda #$6b - sta return - rts - // [3115] phi from display_frame_char::@7 to display_frame_char::@return [phi:display_frame_char::@7->display_frame_char::@return] - __b8: - // [3115] phi display_frame_char::return#12 = $73 [phi:display_frame_char::@7->display_frame_char::@return#0] -- vbum1=vbuc1 - lda #$73 - sta return - rts - // [3115] phi from display_frame_char::@8 to display_frame_char::@return [phi:display_frame_char::@8->display_frame_char::@return] - __b9: - // [3115] phi display_frame_char::return#12 = $72 [phi:display_frame_char::@8->display_frame_char::@return#0] -- vbum1=vbuc1 - lda #$72 - sta return - rts - // [3115] phi from display_frame_char::@9 to display_frame_char::@return [phi:display_frame_char::@9->display_frame_char::@return] - __b10: - // [3115] phi display_frame_char::return#12 = $71 [phi:display_frame_char::@9->display_frame_char::@return#0] -- vbum1=vbuc1 - lda #$71 - sta return - // display_frame_char::@return + sta.z printf_str.putc + lda #>snputc + sta.z printf_str.putc+1 + // [785] phi printf_str::s#53 = s5 [phi:display_action_text_flashing::@11->printf_str#1] -- pbuz1=pbuc1 + lda #s5 + sta.z printf_str.s+1 + jsr printf_str + // display_action_text_flashing::@12 + // sprintf(info_text, "Flashing %u bytes from RAM:%02x:%04p -> %s:%05x ... ", bytes, bram_bank, bram_ptr, chip, address) + // [2212] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 + lda #0 + pha + // [2213] callexecute snputc -- call_vprc1 + jsr snputc + // sideeffect stackpullpadding(1) -- _stackpullpadding_1 + pla + // display_action_text(info_text) + // [2215] call display_action_text + // [845] phi from display_action_text_flashing::@12 to display_action_text [phi:display_action_text_flashing::@12->display_action_text] + // [845] phi display_action_text::info_text#17 = info_text [phi:display_action_text_flashing::@12->display_action_text#0] -- pbuz1=pbuc1 + lda #info_text + sta.z display_action_text.info_text+1 + jsr display_action_text + // display_action_text_flashing::@return // } - // [3116] return + // [2216] return rts .segment Data - .label return = cputcxy.c - .label mask = display_frame_maskxy.return + s: .text "Flashing " + .byte 0 + s1: .text " bytes from RAM:" + .byte 0 + s3: .text " -> " + .byte 0 + bram_bank: .byte 0 + address: .dword 0 } -.segment Code - // display_chip_led -/** - * @brief Print the colored led of a chip figure. - * - * @param x Start X - * @param y Start Y - * @param w width - * @param tc Fore color - * @param bc Back color - */ -// void display_chip_led(__mem() char x, char y, __mem() char w, __mem() char tc, char bc) -display_chip_led: { - // textcolor(tc) - // [3118] textcolor::color#11 = display_chip_led::tc#3 -- vbum1=vbum2 - lda tc - sta textcolor.color - // [3119] call textcolor - // [784] phi from display_chip_led to textcolor [phi:display_chip_led->textcolor] - // [784] phi textcolor::color#23 = textcolor::color#11 [phi:display_chip_led->textcolor#0] -- register_copy - jsr textcolor - // [3120] phi from display_chip_led to display_chip_led::@3 [phi:display_chip_led->display_chip_led::@3] - // display_chip_led::@3 - // bgcolor(bc) - // [3121] call bgcolor - // [789] phi from display_chip_led::@3 to bgcolor [phi:display_chip_led::@3->bgcolor] - // [789] phi bgcolor::color#15 = BLUE [phi:display_chip_led::@3->bgcolor#0] -- vbum1=vbuc1 - lda #BLUE - sta bgcolor.color - jsr bgcolor - // [3122] 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] - // [3122] 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 - // [3122] phi display_chip_led::x#4 = display_chip_led::x#7 [phi:display_chip_led::@3/display_chip_led::@5->display_chip_led::@1#1] -- register_copy - // display_chip_led::@1 - __b1: - // cputcxy(x, y, 0x6F) - // [3123] cputcxy::x#11 = display_chip_led::x#4 -- vbum1=vbum2 - lda x - sta cputcxy.x - // [3124] call cputcxy - // [2293] phi from display_chip_led::@1 to cputcxy [phi:display_chip_led::@1->cputcxy] - // [2293] phi cputcxy::c#17 = $6f [phi:display_chip_led::@1->cputcxy#0] -- vbum1=vbuc1 - lda #$6f - sta cputcxy.c - // [2293] phi cputcxy::y#17 = 3 [phi:display_chip_led::@1->cputcxy#1] -- vbum1=vbuc1 - lda #3 - sta cputcxy.y - // [2293] phi cputcxy::x#17 = cputcxy::x#11 [phi:display_chip_led::@1->cputcxy#2] -- register_copy - jsr cputcxy - // display_chip_led::@4 - // cputcxy(x, y+1, 0x77) - // [3125] cputcxy::x#12 = display_chip_led::x#4 -- vbum1=vbum2 - lda x - sta cputcxy.x - // [3126] call cputcxy - // [2293] phi from display_chip_led::@4 to cputcxy [phi:display_chip_led::@4->cputcxy] - // [2293] phi cputcxy::c#17 = $77 [phi:display_chip_led::@4->cputcxy#0] -- vbum1=vbuc1 - lda #$77 - sta cputcxy.c - // [2293] phi cputcxy::y#17 = 3+1 [phi:display_chip_led::@4->cputcxy#1] -- vbum1=vbuc1 - lda #3+1 - sta cputcxy.y - // [2293] phi cputcxy::x#17 = cputcxy::x#12 [phi:display_chip_led::@4->cputcxy#2] -- register_copy - jsr cputcxy - // display_chip_led::@5 - // x++; - // [3127] display_chip_led::x#0 = ++ display_chip_led::x#4 -- vbum1=_inc_vbum1 - inc x - // while(--w) - // [3128] display_chip_led::w#0 = -- display_chip_led::w#4 -- vbum1=_dec_vbum1 - dec w - // [3129] if(0!=display_chip_led::w#0) goto display_chip_led::@1 -- 0_neq_vbum1_then_la1 - lda w - bne __b1 - // [3130] phi from display_chip_led::@5 to display_chip_led::@2 [phi:display_chip_led::@5->display_chip_led::@2] - // display_chip_led::@2 - // textcolor(WHITE) - // [3131] call textcolor - // [784] phi from display_chip_led::@2 to textcolor [phi:display_chip_led::@2->textcolor] - // [784] phi textcolor::color#23 = WHITE [phi:display_chip_led::@2->textcolor#0] -- vbum1=vbuc1 - lda #WHITE - sta textcolor.color - jsr textcolor - // [3132] 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) - // [3133] call bgcolor - // [789] phi from display_chip_led::@6 to bgcolor [phi:display_chip_led::@6->bgcolor] - // [789] phi bgcolor::color#15 = BLUE [phi:display_chip_led::@6->bgcolor#0] -- vbum1=vbuc1 - lda #BLUE - sta bgcolor.color - jsr bgcolor - // display_chip_led::@return +.segment CodeVera + // spi_read +spi_read: { + // unsigned char SPIData + // [2217] spi_read::SPIData = 0 -- vbum1=vbuc1 + /* + .proc spi_read + stz Vera::Reg::SPIData +@1: bit Vera::Reg::SPICtrl + bmi @1 + lda Vera::Reg::SPIData + rts +.endproc +*/ + lda #0 + sta SPIData + // asm + // asm { stzvera_reg_SPIData !: bitvera_reg_SPICtrl bmi!- ldavera_reg_SPIData staSPIData } + stz vera_reg_SPIData + !: + bit vera_reg_SPICtrl + bmi !- + lda vera_reg_SPIData + sta SPIData + // return SPIData; + // [2219] spi_read::return#3 = spi_read::SPIData -- vbum1=vbum2 + sta return_3 + // spi_read::@return // } - // [3134] return + // [2220] spi_read::return#4 = spi_read::return#3 + // [2221] return rts - .segment Data - x: .byte 0 - w: .byte 0 - tc: .byte 0 + .segment DataVera + SPIData: .byte 0 + return: .byte 0 + return_1: .byte 0 + return_2: .byte 0 + return_3: .byte 0 } .segment Code - // display_chip_line + // memcpy8_vram_vram /** - * @brief Print one line of a chip figure. - * - * @param x Start X - * @param y Start Y - * @param w Width - * @param c Fore color + * @brief Copy a block of memory in VRAM from a source to a target destination. + * This function is designed to copy maximum 255 bytes of memory in one step. + * If more than 255 bytes need to be copied, use the memcpy_vram_vram function. + * + * @see memcpy_vram_vram + * + * @param dbank_vram Bank of the destination location in vram. + * @param doffset_vram Offset of the destination location in vram. + * @param sbank_vram Bank of the source location in vram. + * @param soffset_vram Offset of the source location in vram. + * @param num16 Specified the amount of bytes to be copied. */ -// void display_chip_line(__mem() char x, __mem() char y, __mem() char w, __mem() char c) -display_chip_line: { - // gotoxy(x, y) - // [3136] gotoxy::x#11 = display_chip_line::x#16 -- vbum1=vbum2 - lda x - sta gotoxy.x - // [3137] gotoxy::y#11 = display_chip_line::y#16 -- vbum1=vbum2 - lda y - sta gotoxy.y - // [3138] call gotoxy - // [802] phi from display_chip_line to gotoxy [phi:display_chip_line->gotoxy] - // [802] phi gotoxy::y#37 = gotoxy::y#11 [phi:display_chip_line->gotoxy#0] -- register_copy - // [802] phi gotoxy::x#37 = gotoxy::x#11 [phi:display_chip_line->gotoxy#1] -- register_copy - jsr gotoxy - // [3139] phi from display_chip_line to display_chip_line::@4 [phi:display_chip_line->display_chip_line::@4] - // display_chip_line::@4 - // textcolor(GREY) - // [3140] call textcolor - // [784] phi from display_chip_line::@4 to textcolor [phi:display_chip_line::@4->textcolor] - // [784] phi textcolor::color#23 = GREY [phi:display_chip_line::@4->textcolor#0] -- vbum1=vbuc1 - lda #GREY - sta textcolor.color - jsr textcolor - // [3141] 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) - // [3142] call bgcolor - // [789] phi from display_chip_line::@5 to bgcolor [phi:display_chip_line::@5->bgcolor] - // [789] phi bgcolor::color#15 = BLUE [phi:display_chip_line::@5->bgcolor#0] -- vbum1=vbuc1 - lda #BLUE - sta bgcolor.color - jsr bgcolor - // display_chip_line::@6 - // cputc(VERA_CHR_UR) - // [3143] stackpush(char) = $7c -- _stackpushbyte_=vbuc1 - lda #$7c - pha - // [3144] callexecute cputc -- call_vprc1 - jsr cputc - // sideeffect stackpullpadding(1) -- _stackpullpadding_1 - pla - // textcolor(WHITE) - // [3146] call textcolor - // [784] phi from display_chip_line::@6 to textcolor [phi:display_chip_line::@6->textcolor] - // [784] phi textcolor::color#23 = WHITE [phi:display_chip_line::@6->textcolor#0] -- vbum1=vbuc1 - lda #WHITE - sta textcolor.color - jsr textcolor - // [3147] 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) - // [3148] call bgcolor - // [789] phi from display_chip_line::@7 to bgcolor [phi:display_chip_line::@7->bgcolor] - // [789] phi bgcolor::color#15 = BLACK [phi:display_chip_line::@7->bgcolor#0] -- vbum1=vbuc1 - lda #BLACK - sta bgcolor.color - jsr bgcolor - // [3149] phi from display_chip_line::@7 to display_chip_line::@1 [phi:display_chip_line::@7->display_chip_line::@1] - // [3149] phi display_chip_line::i#2 = 0 [phi:display_chip_line::@7->display_chip_line::@1#0] -- vbum1=vbuc1 - lda #0 - sta i - // display_chip_line::@1 - __b1: - // for(char i=0; idisplay_chip_line::@3] - // display_chip_line::@3 - // textcolor(GREY) - // [3152] call textcolor - // [784] phi from display_chip_line::@3 to textcolor [phi:display_chip_line::@3->textcolor] - // [784] phi textcolor::color#23 = GREY [phi:display_chip_line::@3->textcolor#0] -- vbum1=vbuc1 - lda #GREY - sta textcolor.color - jsr textcolor - // [3153] 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) - // [3154] call bgcolor - // [789] phi from display_chip_line::@8 to bgcolor [phi:display_chip_line::@8->bgcolor] - // [789] phi bgcolor::color#15 = BLUE [phi:display_chip_line::@8->bgcolor#0] -- vbum1=vbuc1 - lda #BLUE - sta bgcolor.color - jsr bgcolor - // display_chip_line::@9 - // cputc(VERA_CHR_UL) - // [3155] stackpush(char) = $7e -- _stackpushbyte_=vbuc1 - lda #$7e - pha - // [3156] callexecute cputc -- call_vprc1 - jsr cputc - // sideeffect stackpullpadding(1) -- _stackpullpadding_1 - pla - // textcolor(WHITE) - // [3158] call textcolor - // [784] phi from display_chip_line::@9 to textcolor [phi:display_chip_line::@9->textcolor] - // [784] phi textcolor::color#23 = WHITE [phi:display_chip_line::@9->textcolor#0] -- vbum1=vbuc1 - lda #WHITE - sta textcolor.color - jsr textcolor - // [3159] 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) - // [3160] call bgcolor - // [789] phi from display_chip_line::@10 to bgcolor [phi:display_chip_line::@10->bgcolor] - // [789] phi bgcolor::color#15 = BLACK [phi:display_chip_line::@10->bgcolor#0] -- vbum1=vbuc1 - lda #BLACK - sta bgcolor.color - jsr bgcolor - // display_chip_line::@11 - // cputcxy(x+2, y, c) - // [3161] cputcxy::x#10 = display_chip_line::x#16 + 2 -- vbum1=vbum2_plus_2 - lda x - clc - adc #2 - sta cputcxy.x - // [3162] cputcxy::y#10 = display_chip_line::y#16 -- vbum1=vbum2 - lda y - sta cputcxy.y - // [3163] cputcxy::c#10 = display_chip_line::c#15 -- vbum1=vbum2 - lda c - sta cputcxy.c - // [3164] call cputcxy - // [2293] phi from display_chip_line::@11 to cputcxy [phi:display_chip_line::@11->cputcxy] - // [2293] phi cputcxy::c#17 = cputcxy::c#10 [phi:display_chip_line::@11->cputcxy#0] -- register_copy - // [2293] phi cputcxy::y#17 = cputcxy::y#10 [phi:display_chip_line::@11->cputcxy#1] -- register_copy - // [2293] phi cputcxy::x#17 = cputcxy::x#10 [phi:display_chip_line::@11->cputcxy#2] -- register_copy - jsr cputcxy - // display_chip_line::@return +// void memcpy8_vram_vram(__mem() char dbank_vram, __mem() unsigned int doffset_vram, __mem() char sbank_vram, __mem() unsigned int soffset_vram, __mem() char num8) +memcpy8_vram_vram: { + .label memcpy8_vram_vram__0 = $23 + .label memcpy8_vram_vram__1 = $24 + .label memcpy8_vram_vram__2 = $25 + .label memcpy8_vram_vram__3 = $26 + .label memcpy8_vram_vram__4 = $27 + .label memcpy8_vram_vram__5 = $28 + // *VERA_CTRL &= ~VERA_ADDRSEL + // [2222] *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) + // [2223] memcpy8_vram_vram::$0 = byte0 memcpy8_vram_vram::soffset_vram#0 -- vbuz1=_byte0_vwum2 + lda soffset_vram + sta.z memcpy8_vram_vram__0 + // *VERA_ADDRX_L = BYTE0(soffset_vram) + // [2224] *VERA_ADDRX_L = memcpy8_vram_vram::$0 -- _deref_pbuc1=vbuz1 + sta VERA_ADDRX_L + // BYTE1(soffset_vram) + // [2225] memcpy8_vram_vram::$1 = byte1 memcpy8_vram_vram::soffset_vram#0 -- vbuz1=_byte1_vwum2 + lda soffset_vram+1 + sta.z memcpy8_vram_vram__1 + // *VERA_ADDRX_M = BYTE1(soffset_vram) + // [2226] *VERA_ADDRX_M = memcpy8_vram_vram::$1 -- _deref_pbuc1=vbuz1 + sta VERA_ADDRX_M + // sbank_vram | VERA_INC_1 + // [2227] memcpy8_vram_vram::$2 = memcpy8_vram_vram::sbank_vram#0 | VERA_INC_1 -- vbuz1=vbum2_bor_vbuc1 + lda #VERA_INC_1 + ora sbank_vram + sta.z memcpy8_vram_vram__2 + // *VERA_ADDRX_H = sbank_vram | VERA_INC_1 + // [2228] *VERA_ADDRX_H = memcpy8_vram_vram::$2 -- _deref_pbuc1=vbuz1 + sta VERA_ADDRX_H + // *VERA_CTRL |= VERA_ADDRSEL + // [2229] *VERA_CTRL = *VERA_CTRL | VERA_ADDRSEL -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2 + lda #VERA_ADDRSEL + ora VERA_CTRL + sta VERA_CTRL + // BYTE0(doffset_vram) + // [2230] memcpy8_vram_vram::$3 = byte0 memcpy8_vram_vram::doffset_vram#0 -- vbuz1=_byte0_vwum2 + lda doffset_vram + sta.z memcpy8_vram_vram__3 + // *VERA_ADDRX_L = BYTE0(doffset_vram) + // [2231] *VERA_ADDRX_L = memcpy8_vram_vram::$3 -- _deref_pbuc1=vbuz1 + sta VERA_ADDRX_L + // BYTE1(doffset_vram) + // [2232] memcpy8_vram_vram::$4 = byte1 memcpy8_vram_vram::doffset_vram#0 -- vbuz1=_byte1_vwum2 + lda doffset_vram+1 + sta.z memcpy8_vram_vram__4 + // *VERA_ADDRX_M = BYTE1(doffset_vram) + // [2233] *VERA_ADDRX_M = memcpy8_vram_vram::$4 -- _deref_pbuc1=vbuz1 + sta VERA_ADDRX_M + // dbank_vram | VERA_INC_1 + // [2234] memcpy8_vram_vram::$5 = memcpy8_vram_vram::dbank_vram#0 | VERA_INC_1 -- vbuz1=vbum2_bor_vbuc1 + lda #VERA_INC_1 + ora dbank_vram + sta.z memcpy8_vram_vram__5 + // *VERA_ADDRX_H = dbank_vram | VERA_INC_1 + // [2235] *VERA_ADDRX_H = memcpy8_vram_vram::$5 -- _deref_pbuc1=vbuz1 + sta VERA_ADDRX_H + // [2236] 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: + // [2236] phi memcpy8_vram_vram::num8#2 = memcpy8_vram_vram::num8#1 [phi:memcpy8_vram_vram/memcpy8_vram_vram::@2->memcpy8_vram_vram::@1#0] -- register_copy + // the size is only a byte, this is the fastest loop! + // memcpy8_vram_vram::@1 + // while (num8--) + // [2237] memcpy8_vram_vram::num8#0 = -- memcpy8_vram_vram::num8#2 -- vbum1=_dec_vbum2 + ldy num8_1 + dey + sty num8 + // [2238] if(0!=memcpy8_vram_vram::num8#2) goto memcpy8_vram_vram::@2 -- 0_neq_vbum1_then_la1 + lda num8_1 + bne __b2 + // memcpy8_vram_vram::@return // } - // [3165] return + // [2239] return rts - // display_chip_line::@2 + // memcpy8_vram_vram::@2 __b2: - // cputc(VERA_CHR_SPACE) - // [3166] stackpush(char) = $20 -- _stackpushbyte_=vbuc1 - lda #$20 - pha - // [3167] callexecute cputc -- call_vprc1 - jsr cputc - // sideeffect stackpullpadding(1) -- _stackpullpadding_1 - pla - // for(char i=0; idisplay_chip_line::@1] - // [3149] phi display_chip_line::i#2 = display_chip_line::i#1 [phi:display_chip_line::@2->display_chip_line::@1#0] -- register_copy + // *VERA_DATA1 = *VERA_DATA0 + // [2240] *VERA_DATA1 = *VERA_DATA0 -- _deref_pbuc1=_deref_pbuc2 + lda VERA_DATA0 + sta VERA_DATA1 + // [2241] memcpy8_vram_vram::num8#6 = memcpy8_vram_vram::num8#0 -- vbum1=vbum2 + lda num8 + sta num8_1 jmp __b1 .segment Data - i: .byte 0 - x: .byte 0 - w: .byte 0 - c: .byte 0 - y: .byte 0 + num8: .byte 0 + dbank_vram: .byte 0 + doffset_vram: .word 0 + sbank_vram: .byte 0 + soffset_vram: .word 0 + num8_1: .byte 0 } .segment Code - // display_chip_end -/** - * @brief Print last line of a chip figure. - * - * @param x Start X - * @param y Start Y - * @param w Width - */ -// void display_chip_end(__mem() char x, char y, __mem() char w) -display_chip_end: { - // gotoxy(x, y) - // [3170] gotoxy::x#12 = display_chip_end::x#0 -- vbum1=vbum2 - lda x - sta gotoxy.x - // [3171] call gotoxy - // [802] phi from display_chip_end to gotoxy [phi:display_chip_end->gotoxy] - // [802] phi gotoxy::y#37 = display_print_chip::y#21 [phi:display_chip_end->gotoxy#0] -- vbum1=vbuc1 - lda #display_print_chip.y - sta gotoxy.y - // [802] phi gotoxy::x#37 = gotoxy::x#12 [phi:display_chip_end->gotoxy#1] -- register_copy - jsr gotoxy - // [3172] phi from display_chip_end to display_chip_end::@4 [phi:display_chip_end->display_chip_end::@4] - // display_chip_end::@4 - // textcolor(GREY) - // [3173] call textcolor - // [784] phi from display_chip_end::@4 to textcolor [phi:display_chip_end::@4->textcolor] - // [784] phi textcolor::color#23 = GREY [phi:display_chip_end::@4->textcolor#0] -- vbum1=vbuc1 - lda #GREY - sta textcolor.color - jsr textcolor - // [3174] 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) - // [3175] call bgcolor - // [789] phi from display_chip_end::@5 to bgcolor [phi:display_chip_end::@5->bgcolor] - // [789] phi bgcolor::color#15 = BLUE [phi:display_chip_end::@5->bgcolor#0] -- vbum1=vbuc1 - lda #BLUE - sta bgcolor.color - jsr bgcolor - // display_chip_end::@6 - // cputc(VERA_CHR_UR) - // [3176] stackpush(char) = $7c -- _stackpushbyte_=vbuc1 - lda #$7c - pha - // [3177] callexecute cputc -- call_vprc1 - jsr cputc - // sideeffect stackpullpadding(1) -- _stackpullpadding_1 - pla - // textcolor(BLUE) - // [3179] call textcolor - // [784] phi from display_chip_end::@6 to textcolor [phi:display_chip_end::@6->textcolor] - // [784] phi textcolor::color#23 = BLUE [phi:display_chip_end::@6->textcolor#0] -- vbum1=vbuc1 - lda #BLUE - sta textcolor.color - jsr textcolor - // [3180] 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) - // [3181] call bgcolor - // [789] phi from display_chip_end::@7 to bgcolor [phi:display_chip_end::@7->bgcolor] - // [789] phi bgcolor::color#15 = BLACK [phi:display_chip_end::@7->bgcolor#0] -- vbum1=vbuc1 - lda #BLACK - sta bgcolor.color - jsr bgcolor - // [3182] phi from display_chip_end::@7 to display_chip_end::@1 [phi:display_chip_end::@7->display_chip_end::@1] - // [3182] phi display_chip_end::i#2 = 0 [phi:display_chip_end::@7->display_chip_end::@1#0] -- vbum1=vbuc1 + // utoa_append +// Used to convert a single digit of an unsigned number value to a string representation +// Counts a single digit up from '0' as long as the value is larger than sub. +// Each time the digit is increased sub is subtracted from value. +// - buffer : pointer to the char that receives the digit +// - value : The value where the digit will be derived from +// - sub : the value of a '1' in the digit. Subtracted continually while the digit is increased. +// (For decimal the subs used are 10000, 1000, 100, 10, 1) +// returns : the value reduced by sub * digit so that it is less than sub. +// __mem() unsigned int utoa_append(__zp($3e) char *buffer, __mem() unsigned int value, __mem() unsigned int sub) +utoa_append: { + .label buffer = $3e + // [2243] phi from utoa_append to utoa_append::@1 [phi:utoa_append->utoa_append::@1] + // [2243] phi utoa_append::digit#2 = 0 [phi:utoa_append->utoa_append::@1#0] -- vbum1=vbuc1 lda #0 - sta i - // display_chip_end::@1 + sta digit + // [2243] phi utoa_append::value#2 = utoa_append::value#0 [phi:utoa_append->utoa_append::@1#1] -- register_copy + // utoa_append::@1 __b1: - // for(char i=0; i= sub) + // [2244] if(utoa_append::value#2>=utoa_append::sub#0) goto utoa_append::@2 -- vwum1_ge_vwum2_then_la1 + lda sub+1 + cmp value+1 + bne !+ + lda sub + cmp value + beq __b2 + !: bcc __b2 - // [3184] phi from display_chip_end::@1 to display_chip_end::@3 [phi:display_chip_end::@1->display_chip_end::@3] - // display_chip_end::@3 - // textcolor(GREY) - // [3185] call textcolor - // [784] phi from display_chip_end::@3 to textcolor [phi:display_chip_end::@3->textcolor] - // [784] phi textcolor::color#23 = GREY [phi:display_chip_end::@3->textcolor#0] -- vbum1=vbuc1 - lda #GREY - sta textcolor.color - jsr textcolor - // [3186] 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) - // [3187] call bgcolor - // [789] phi from display_chip_end::@8 to bgcolor [phi:display_chip_end::@8->bgcolor] - // [789] phi bgcolor::color#15 = BLUE [phi:display_chip_end::@8->bgcolor#0] -- vbum1=vbuc1 - lda #BLUE - sta bgcolor.color - jsr bgcolor - // display_chip_end::@9 - // cputc(VERA_CHR_UL) - // [3188] stackpush(char) = $7e -- _stackpushbyte_=vbuc1 - lda #$7e - pha - // [3189] callexecute cputc -- call_vprc1 - jsr cputc - // sideeffect stackpullpadding(1) -- _stackpullpadding_1 - pla - // display_chip_end::@return + // utoa_append::@3 + // *buffer = DIGITS[digit] + // [2245] *utoa_append::buffer#0 = DIGITS[utoa_append::digit#2] -- _deref_pbuz1=pbuc1_derefidx_vbum2 + ldy digit + lda DIGITS,y + ldy #0 + sta (buffer),y + // utoa_append::@return // } - // [3191] return + // [2246] return rts - // display_chip_end::@2 + // utoa_append::@2 __b2: - // cputc(VERA_CHR_HL) - // [3192] stackpush(char) = $62 -- _stackpushbyte_=vbuc1 - lda #$62 - pha - // [3193] callexecute cputc -- call_vprc1 - jsr cputc - // sideeffect stackpullpadding(1) -- _stackpullpadding_1 - pla - // for(char i=0; idisplay_chip_end::@1] - // [3182] phi display_chip_end::i#2 = display_chip_end::i#1 [phi:display_chip_end::@2->display_chip_end::@1#0] -- register_copy + // digit++; + // [2247] utoa_append::digit#1 = ++ utoa_append::digit#2 -- vbum1=_inc_vbum1 + inc digit + // value -= sub + // [2248] utoa_append::value#1 = utoa_append::value#2 - utoa_append::sub#0 -- vwum1=vwum1_minus_vwum2 + lda value + sec + sbc sub + sta value + lda value+1 + sbc sub+1 + sta value+1 + // [2243] phi from utoa_append::@2 to utoa_append::@1 [phi:utoa_append::@2->utoa_append::@1] + // [2243] phi utoa_append::digit#2 = utoa_append::digit#1 [phi:utoa_append::@2->utoa_append::@1#0] -- register_copy + // [2243] phi utoa_append::value#2 = utoa_append::value#1 [phi:utoa_append::@2->utoa_append::@1#1] -- register_copy jmp __b1 .segment Data - i: .byte 0 - .label x = display_print_chip.x - w: .byte 0 + .label value = printf_uint.uvalue + .label sub = utoa.digit_value + .label return = printf_uint.uvalue + digit: .byte 0 } .segment CodeVera - // spi_get_jedec -spi_get_jedec: { - // spi_fast() - // [3197] call spi_fast - /* -; Returns -; .X = Vendor ID -; .Y = Memory Type -; .A = Memory Capacity -.proc spi_get_jedec - jsr spi_fast - - jsr spi_select - lda #$9F - jsr spi_write - jsr spi_read - tax - jsr spi_read - tay - jsr spi_read + // spi_fast +spi_fast: { + // asm + // asm { ldavera_reg_SPICtrl and#%11111101 stavera_reg_SPICtrl } + /* +.proc spi_fast + lda Vera::Reg::SPICtrl + and #%11111101 + sta Vera::Reg::SPICtrl + rts +.endproc +*/ + lda vera_reg_SPICtrl + and #$fd + sta vera_reg_SPICtrl + // spi_fast::@return + // } + // [2250] return rts +} + // spi_select +spi_select: { + // spi_deselect() + // [2252] call spi_deselect + /* +.proc spi_select + jsr spi_deselect + + lda Vera::Reg::SPICtrl + ora #$01 + sta Vera::Reg::SPICtrl + rts .endproc - */ - jsr spi_fast - // [3198] phi from spi_get_jedec to spi_get_jedec::@1 [phi:spi_get_jedec->spi_get_jedec::@1] - // spi_get_jedec::@1 - // spi_select() - // [3199] call spi_select - // [3393] phi from spi_get_jedec::@1 to spi_select [phi:spi_get_jedec::@1->spi_select] - jsr spi_select - // spi_get_jedec::@2 - // spi_write(0x9F) - // [3200] spi_write::data = $9f -- vbum1=vbuc1 - lda #$9f - sta spi_write.data - // [3201] call spi_write - jsr spi_write - // [3202] phi from spi_get_jedec::@2 to spi_get_jedec::@3 [phi:spi_get_jedec::@2->spi_get_jedec::@3] - // spi_get_jedec::@3 - // spi_read() - // [3203] call spi_read - jsr spi_read - // [3204] spi_read::return#0 = spi_read::return#4 -- vbum1=vbum2 - lda spi_read.return_3 - sta spi_read.return - // [3205] phi from spi_get_jedec::@3 to spi_get_jedec::@4 [phi:spi_get_jedec::@3->spi_get_jedec::@4] - // spi_get_jedec::@4 - // spi_read() - // [3206] call spi_read - jsr spi_read - // [3207] spi_read::return#1 = spi_read::return#4 -- vbum1=vbum2 - lda spi_read.return_3 - sta spi_read.return_1 - // [3208] phi from spi_get_jedec::@4 to spi_get_jedec::@5 [phi:spi_get_jedec::@4->spi_get_jedec::@5] - // spi_get_jedec::@5 - // spi_read() - // [3209] call spi_read - jsr spi_read - // [3210] spi_read::return#2 = spi_read::return#4 -- vbum1=vbum2 - lda spi_read.return_3 - sta spi_read.return_2 - // spi_get_jedec::@return +*/ + jsr spi_deselect + // spi_select::@1 + // *vera_reg_SPICtrl |= 1 + // [2253] *vera_reg_SPICtrl = *vera_reg_SPICtrl | 1 -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2 + lda #1 + ora vera_reg_SPICtrl + sta vera_reg_SPICtrl + // spi_select::@return // } - // [3211] return + // [2254] return rts } -.segment Code - // rom_write_byte + // spi_write /** - * @brief Write a byte to the ROM using the 22 bit address. - * The lower 14 bits of the 22 bit ROM address are transformed into the **ptr_rom** 16 bit ROM address. - * The higher 8 bits of the 22 bit ROM address are transformed into the **bank_rom** 8 bit bank number. - * **bank_ptr* is used to set the bank using ZP $01. **ptr_rom** is used to write the byte into the ROM. - * - * @param address The 22 bit ROM address. - * @param value The byte value to be written. + * @brief + * + * */ -// void rom_write_byte(__mem() unsigned long address, __mem() char value) -rom_write_byte: { - .label rom_bank1_rom_write_byte__0 = $3a - .label rom_bank1_rom_write_byte__1 = $29 - .label rom_bank1_rom_write_byte__2 = $3f - .label rom_ptr1_rom_write_byte__0 = $3b - .label rom_ptr1_rom_write_byte__2 = $3b - .label rom_ptr1_return = $3b - // rom_write_byte::rom_bank1 - // BYTE2(address) - // [3213] rom_write_byte::rom_bank1_$0 = byte2 rom_write_byte::address#4 -- vbuz1=_byte2_vdum2 - lda address+2 - sta.z rom_bank1_rom_write_byte__0 - // BYTE1(address) - // [3214] rom_write_byte::rom_bank1_$1 = byte1 rom_write_byte::address#4 -- vbuz1=_byte1_vdum2 - lda address+1 - sta.z rom_bank1_rom_write_byte__1 - // MAKEWORD(BYTE2(address),BYTE1(address)) - // [3215] 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 - 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 - // unsigned int bank_unshifted = MAKEWORD(BYTE2(address),BYTE1(address)) << 2 - // [3216] rom_write_byte::rom_bank1_bank_unshifted#0 = rom_write_byte::rom_bank1_$2 << 2 -- vwum1=vwuz2_rol_2 - asl - sta rom_bank1_bank_unshifted - lda.z rom_bank1_rom_write_byte__2+1 - rol - sta rom_bank1_bank_unshifted+1 - asl rom_bank1_bank_unshifted - rol rom_bank1_bank_unshifted+1 - // unsigned char bank = BYTE1(bank_unshifted) - // [3217] rom_write_byte::rom_bank1_return#0 = byte1 rom_write_byte::rom_bank1_bank_unshifted#0 -- vbum1=_byte1_vwum2 - lda rom_bank1_bank_unshifted+1 - sta rom_bank1_return - // rom_write_byte::rom_ptr1 - // (unsigned int)(address) & ROM_PTR_MASK - // [3218] rom_write_byte::rom_ptr1_$2 = (unsigned int)rom_write_byte::address#4 -- vwuz1=_word_vdum2 - lda address - sta.z rom_ptr1_rom_write_byte__2 - lda address+1 - sta.z rom_ptr1_rom_write_byte__2+1 - // [3219] rom_write_byte::rom_ptr1_$0 = rom_write_byte::rom_ptr1_$2 & $3fff -- vwuz1=vwuz1_band_vwuc1 - lda.z rom_ptr1_rom_write_byte__0 - and #<$3fff - sta.z rom_ptr1_rom_write_byte__0 - lda.z rom_ptr1_rom_write_byte__0+1 - and #>$3fff - sta.z rom_ptr1_rom_write_byte__0+1 - // ((unsigned int)(address) & ROM_PTR_MASK) + ROM_BASE - // [3220] rom_write_byte::rom_ptr1_return#0 = rom_write_byte::rom_ptr1_$0 + $c000 -- vwuz1=vwuz1_plus_vwuc1 - lda.z rom_ptr1_return - clc - adc #<$c000 - sta.z rom_ptr1_return - lda.z rom_ptr1_return+1 - adc #>$c000 - sta.z rom_ptr1_return+1 - // rom_write_byte::bank_set_brom1 - // BROM = bank - // [3221] BROM = rom_write_byte::rom_bank1_return#0 -- vbuz1=vbum2 - lda rom_bank1_return - sta.z BROM - // rom_write_byte::@1 - // *ptr_rom = value - // [3222] *((char *)rom_write_byte::rom_ptr1_return#0) = rom_write_byte::value#10 -- _deref_pbuz1=vbum2 - lda value - ldy #0 - sta (rom_ptr1_return),y - // rom_write_byte::@return +// void spi_write(__mem() volatile char data) +spi_write: { + // asm + // asm { ldadata stavera_reg_SPIData !: bitvera_reg_SPICtrl bmi!- } + /* +.proc spi_write + sta Vera::Reg::SPIData +@1: bit Vera::Reg::SPICtrl + bmi @1 + rts +.endproc +*/ + lda data + sta vera_reg_SPIData + !: + bit vera_reg_SPICtrl + bmi !- + // spi_write::@return // } - // [3223] return + // [2256] return rts - .segment Data - rom_bank1_bank_unshifted: .word 0 - rom_bank1_return: .byte 0 - address: .dword 0 - value: .byte 0 + .segment DataVera + data: .byte 0 } .segment Code // cbm_k_setlfs @@ -21708,7 +14391,7 @@ cbm_k_setlfs: { jsr CBM_SETLFS // cbm_k_setlfs::@return // } - // [3225] return + // [2258] return rts .segment Data channel: .byte 0 @@ -21726,58 +14409,58 @@ cbm_k_setlfs: { * @param stream FILE* stream. * @return int Contains a non-zero value if there is an error. */ -// __mem() int ferror(__zp($3d) struct $2 *stream) +// __mem() int ferror(__zp($40) struct $2 *stream) ferror: { - .label ferror__6 = $29 - .label ferror__15 = $2b - .label cbm_k_setnam1_filename = $b8 - .label cbm_k_setnam1_ferror__0 = $3b - .label stream = $3d - .label errno_len = $6b + .label ferror__6 = $39 + .label ferror__15 = $3a + .label cbm_k_setnam1_filename = $72 + .label cbm_k_setnam1_ferror__0 = $6c + .label stream = $40 + .label errno_len = $63 // unsigned char sp = (unsigned char)stream - // [3226] ferror::sp#0 = (char)ferror::stream#0 -- vbum1=_byte_pssz2 + // [2259] ferror::sp#0 = (char)ferror::stream#0 -- vbum1=_byte_pssz2 lda.z stream sta sp // cbm_k_setlfs(15, 8, 15) - // [3227] cbm_k_setlfs::channel = $f -- vbum1=vbuc1 + // [2260] cbm_k_setlfs::channel = $f -- vbum1=vbuc1 lda #$f sta cbm_k_setlfs.channel - // [3228] cbm_k_setlfs::device = 8 -- vbum1=vbuc1 + // [2261] cbm_k_setlfs::device = 8 -- vbum1=vbuc1 lda #8 sta cbm_k_setlfs.device - // [3229] cbm_k_setlfs::command = $f -- vbum1=vbuc1 + // [2262] cbm_k_setlfs::command = $f -- vbum1=vbuc1 lda #$f sta cbm_k_setlfs.command - // [3230] call cbm_k_setlfs + // [2263] call cbm_k_setlfs jsr cbm_k_setlfs // ferror::@11 // cbm_k_setnam("") - // [3231] ferror::cbm_k_setnam1_filename = str -- pbuz1=pbuc1 + // [2264] ferror::cbm_k_setnam1_filename = str -- pbuz1=pbuc1 lda #str sta.z cbm_k_setnam1_filename+1 // ferror::cbm_k_setnam1 // strlen(filename) - // [3232] strlen::str#5 = ferror::cbm_k_setnam1_filename -- pbuz1=pbuz2 + // [2265] strlen::str#5 = ferror::cbm_k_setnam1_filename -- pbuz1=pbuz2 lda.z cbm_k_setnam1_filename sta.z strlen.str lda.z cbm_k_setnam1_filename+1 sta.z strlen.str+1 - // [3233] call strlen - // [2611] phi from ferror::cbm_k_setnam1 to strlen [phi:ferror::cbm_k_setnam1->strlen] - // [2611] phi strlen::str#8 = strlen::str#5 [phi:ferror::cbm_k_setnam1->strlen#0] -- register_copy + // [2266] call strlen + // [1788] phi from ferror::cbm_k_setnam1 to strlen [phi:ferror::cbm_k_setnam1->strlen] + // [1788] phi strlen::str#8 = strlen::str#5 [phi:ferror::cbm_k_setnam1->strlen#0] -- register_copy jsr strlen // strlen(filename) - // [3234] strlen::return#12 = strlen::len#2 + // [2267] strlen::return#12 = strlen::len#2 // ferror::@12 - // [3235] ferror::cbm_k_setnam1_$0 = strlen::return#12 -- vwuz1=vwum2 + // [2268] ferror::cbm_k_setnam1_$0 = strlen::return#12 -- vwuz1=vwum2 lda strlen.return sta.z cbm_k_setnam1_ferror__0 lda strlen.return+1 sta.z cbm_k_setnam1_ferror__0+1 // char filename_len = (char)strlen(filename) - // [3236] ferror::cbm_k_setnam1_filename_len = (char)ferror::cbm_k_setnam1_$0 -- vbum1=_byte_vwuz2 + // [2269] ferror::cbm_k_setnam1_filename_len = (char)ferror::cbm_k_setnam1_$0 -- vbum1=_byte_vwuz2 lda.z cbm_k_setnam1_ferror__0 sta cbm_k_setnam1_filename_len // asm @@ -21790,12 +14473,12 @@ ferror: { jsr CBM_OPEN // ferror::@6 // cbm_k_chkin(15) - // [3239] ferror::cbm_k_chkin1_channel = $f -- vbum1=vbuc1 + // [2272] ferror::cbm_k_chkin1_channel = $f -- vbum1=vbuc1 lda #$f sta cbm_k_chkin1_channel // ferror::cbm_k_chkin1 // char status - // [3240] ferror::cbm_k_chkin1_status = 0 -- vbum1=vbuc1 + // [2273] ferror::cbm_k_chkin1_status = 0 -- vbum1=vbuc1 lda #0 sta cbm_k_chkin1_status // asm @@ -21805,7 +14488,7 @@ ferror: { sta cbm_k_chkin1_status // ferror::cbm_k_chrin1 // char ch - // [3242] ferror::cbm_k_chrin1_ch = 0 -- vbum1=vbuc1 + // [2275] ferror::cbm_k_chrin1_ch = 0 -- vbum1=vbuc1 lda #0 sta cbm_k_chrin1_ch // asm @@ -21813,26 +14496,26 @@ ferror: { jsr CBM_CHRIN sta cbm_k_chrin1_ch // return ch; - // [3244] ferror::cbm_k_chrin1_return#0 = ferror::cbm_k_chrin1_ch -- vbum1=vbum2 + // [2277] ferror::cbm_k_chrin1_return#0 = ferror::cbm_k_chrin1_ch -- vbum1=vbum2 sta cbm_k_chrin1_return // ferror::cbm_k_chrin1_@return // } - // [3245] ferror::cbm_k_chrin1_return#1 = ferror::cbm_k_chrin1_return#0 + // [2278] ferror::cbm_k_chrin1_return#1 = ferror::cbm_k_chrin1_return#0 // ferror::@7 // char ch = cbm_k_chrin() - // [3246] ferror::ch#0 = ferror::cbm_k_chrin1_return#1 - // [3247] phi from ferror::@7 to ferror::cbm_k_readst1 [phi:ferror::@7->ferror::cbm_k_readst1] - // [3247] phi __errno#123 = __errno#473 [phi:ferror::@7->ferror::cbm_k_readst1#0] -- register_copy - // [3247] phi ferror::errno_len#10 = 0 [phi:ferror::@7->ferror::cbm_k_readst1#1] -- vbuz1=vbuc1 + // [2279] ferror::ch#0 = ferror::cbm_k_chrin1_return#1 + // [2280] phi from ferror::@7 to ferror::cbm_k_readst1 [phi:ferror::@7->ferror::cbm_k_readst1] + // [2280] phi __errno#18 = __errno#118 [phi:ferror::@7->ferror::cbm_k_readst1#0] -- register_copy + // [2280] phi ferror::errno_len#10 = 0 [phi:ferror::@7->ferror::cbm_k_readst1#1] -- vbuz1=vbuc1 lda #0 sta.z errno_len - // [3247] phi ferror::ch#10 = ferror::ch#0 [phi:ferror::@7->ferror::cbm_k_readst1#2] -- register_copy - // [3247] phi ferror::errno_parsed#2 = 0 [phi:ferror::@7->ferror::cbm_k_readst1#3] -- vbum1=vbuc1 + // [2280] phi ferror::ch#10 = ferror::ch#0 [phi:ferror::@7->ferror::cbm_k_readst1#2] -- register_copy + // [2280] phi ferror::errno_parsed#2 = 0 [phi:ferror::@7->ferror::cbm_k_readst1#3] -- vbum1=vbuc1 sta errno_parsed // ferror::cbm_k_readst1 cbm_k_readst1: // char status - // [3248] ferror::cbm_k_readst1_status = 0 -- vbum1=vbuc1 + // [2281] ferror::cbm_k_readst1_status = 0 -- vbum1=vbuc1 lda #0 sta cbm_k_readst1_status // asm @@ -21840,629 +14523,337 @@ ferror: { jsr CBM_READST sta cbm_k_readst1_status // return status; - // [3250] ferror::cbm_k_readst1_return#0 = ferror::cbm_k_readst1_status -- vbum1=vbum2 + // [2283] ferror::cbm_k_readst1_return#0 = ferror::cbm_k_readst1_status -- vbum1=vbum2 sta cbm_k_readst1_return // ferror::cbm_k_readst1_@return // } - // [3251] ferror::cbm_k_readst1_return#1 = ferror::cbm_k_readst1_return#0 + // [2284] ferror::cbm_k_readst1_return#1 = ferror::cbm_k_readst1_return#0 // ferror::@8 // cbm_k_readst() - // [3252] ferror::$6 = ferror::cbm_k_readst1_return#1 -- vbuz1=vbum2 + // [2285] ferror::$6 = ferror::cbm_k_readst1_return#1 -- vbuz1=vbum2 sta.z ferror__6 // st = cbm_k_readst() - // [3253] ferror::st#1 = ferror::$6 -- vbum1=vbuz2 + // [2286] ferror::st#1 = ferror::$6 -- vbum1=vbuz2 sta st // while (!(st = cbm_k_readst())) - // [3254] if(0==ferror::st#1) goto ferror::@1 -- 0_eq_vbum1_then_la1 + // [2287] if(0==ferror::st#1) goto ferror::@1 -- 0_eq_vbum1_then_la1 beq __b1 // ferror::@2 // __status = st - // [3255] ((char *)&__stdio_file+$46)[ferror::sp#0] = ferror::st#1 -- pbuc1_derefidx_vbum1=vbum2 + // [2288] ((char *)&__stdio_file+$46)[ferror::sp#0] = ferror::st#1 -- pbuc1_derefidx_vbum1=vbum2 ldy sp sta __stdio_file+$46,y - // cbm_k_close(15) - // [3256] ferror::cbm_k_close1_channel = $f -- vbum1=vbuc1 - lda #$f - sta cbm_k_close1_channel - // ferror::cbm_k_close1 - // asm - // asm { ldachannel jsrCBM_CLOSE } - jsr CBM_CLOSE - // ferror::@9 - // return __errno; - // [3258] ferror::return#1 = __errno#123 -- vwsm1=vwsm2 - lda __errno - sta return - lda __errno+1 - sta return+1 - // ferror::@return - // } - // [3259] return - rts - // ferror::@1 - __b1: - // if (!errno_parsed) - // [3260] if(0!=ferror::errno_parsed#2) goto ferror::@3 -- 0_neq_vbum1_then_la1 - lda errno_parsed - bne __b3 - // ferror::@4 - // if (ch == ',') - // [3261] if(ferror::ch#10!=',') goto ferror::@3 -- vbum1_neq_vbuc1_then_la1 - lda #',' - cmp ch - bne __b3 - // ferror::@5 - // errno_parsed++; - // [3262] ferror::errno_parsed#1 = ++ ferror::errno_parsed#2 -- vbum1=_inc_vbum1 - inc errno_parsed - // strncpy(temp, __errno_error, errno_len+1) - // [3263] strncpy::n#0 = ferror::errno_len#10 + 1 -- vwum1=vbuz2_plus_1 - lda.z errno_len - clc - adc #1 - sta strncpy.n - lda #0 - adc #0 - sta strncpy.n+1 - // [3264] call strncpy - // [3002] phi from ferror::@5 to strncpy [phi:ferror::@5->strncpy] - // [3002] phi strncpy::dst#8 = ferror::temp [phi:ferror::@5->strncpy#0] -- pbuz1=pbuc1 - lda #temp - sta.z strncpy.dst+1 - // [3002] phi strncpy::src#6 = __errno_error [phi:ferror::@5->strncpy#1] -- pbuz1=pbuc1 - lda #<__errno_error - sta.z strncpy.src - lda #>__errno_error - sta.z strncpy.src+1 - // [3002] phi strncpy::n#3 = strncpy::n#0 [phi:ferror::@5->strncpy#2] -- register_copy - jsr strncpy - // [3265] phi from ferror::@5 to ferror::@13 [phi:ferror::@5->ferror::@13] - // ferror::@13 - // atoi(temp) - // [3266] call atoi - // [3278] phi from ferror::@13 to atoi [phi:ferror::@13->atoi] - // [3278] phi atoi::str#2 = ferror::temp [phi:ferror::@13->atoi#0] -- pbuz1=pbuc1 - lda #temp - sta.z atoi.str+1 - jsr atoi - // atoi(temp) - // [3267] atoi::return#4 = atoi::return#2 - // ferror::@14 - // __errno = atoi(temp) - // [3268] __errno#2 = atoi::return#4 -- vwsm1=vwsm2 - lda atoi.return - sta __errno - lda atoi.return+1 - sta __errno+1 - // [3269] phi from ferror::@1 ferror::@14 ferror::@4 to ferror::@3 [phi:ferror::@1/ferror::@14/ferror::@4->ferror::@3] - // [3269] phi __errno#178 = __errno#123 [phi:ferror::@1/ferror::@14/ferror::@4->ferror::@3#0] -- register_copy - // [3269] phi ferror::errno_parsed#11 = ferror::errno_parsed#2 [phi:ferror::@1/ferror::@14/ferror::@4->ferror::@3#1] -- register_copy - // ferror::@3 - __b3: - // __errno_error[errno_len] = ch - // [3270] __errno_error[ferror::errno_len#10] = ferror::ch#10 -- pbuc1_derefidx_vbuz1=vbum2 - lda ch - ldy.z errno_len - sta __errno_error,y - // errno_len++; - // [3271] ferror::errno_len#1 = ++ ferror::errno_len#10 -- vbuz1=_inc_vbuz1 - inc.z errno_len - // ferror::cbm_k_chrin2 - // char ch - // [3272] ferror::cbm_k_chrin2_ch = 0 -- vbum1=vbuc1 - lda #0 - sta cbm_k_chrin2_ch - // asm - // asm { jsrCBM_CHRIN stach } - jsr CBM_CHRIN - sta cbm_k_chrin2_ch - // return ch; - // [3274] ferror::cbm_k_chrin2_return#0 = ferror::cbm_k_chrin2_ch -- vbum1=vbum2 - sta cbm_k_chrin2_return - // ferror::cbm_k_chrin2_@return - // } - // [3275] ferror::cbm_k_chrin2_return#1 = ferror::cbm_k_chrin2_return#0 - // ferror::@10 - // cbm_k_chrin() - // [3276] ferror::$15 = ferror::cbm_k_chrin2_return#1 -- vbuz1=vbum2 - sta.z ferror__15 - // ch = cbm_k_chrin() - // [3277] ferror::ch#1 = ferror::$15 -- vbum1=vbuz2 - sta ch - // [3247] phi from ferror::@10 to ferror::cbm_k_readst1 [phi:ferror::@10->ferror::cbm_k_readst1] - // [3247] phi __errno#123 = __errno#178 [phi:ferror::@10->ferror::cbm_k_readst1#0] -- register_copy - // [3247] phi ferror::errno_len#10 = ferror::errno_len#1 [phi:ferror::@10->ferror::cbm_k_readst1#1] -- register_copy - // [3247] phi ferror::ch#10 = ferror::ch#1 [phi:ferror::@10->ferror::cbm_k_readst1#2] -- register_copy - // [3247] phi ferror::errno_parsed#2 = ferror::errno_parsed#11 [phi:ferror::@10->ferror::cbm_k_readst1#3] -- register_copy - jmp cbm_k_readst1 - .segment Data - temp: .fill 4, 0 - cbm_k_setnam1_filename_len: .byte 0 - cbm_k_chkin1_channel: .byte 0 - cbm_k_chkin1_status: .byte 0 - cbm_k_chrin1_ch: .byte 0 - cbm_k_readst1_status: .byte 0 - cbm_k_close1_channel: .byte 0 - cbm_k_chrin2_ch: .byte 0 - return: .word 0 - sp: .byte 0 - .label cbm_k_chrin1_return = ch - ch: .byte 0 - cbm_k_readst1_return: .byte 0 - st: .byte 0 - cbm_k_chrin2_return: .byte 0 - errno_parsed: .byte 0 -} -.segment Code - // atoi -// Converts the string argument str to an integer. -// __mem() int atoi(__zp($5a) const char *str) -atoi: { - .label atoi__6 = $47 - .label atoi__7 = $47 - .label str = $5a - .label atoi__10 = $47 - .label atoi__11 = $47 - // if (str[i] == '-') - // [3279] if(*atoi::str#2!='-') goto atoi::@3 -- _deref_pbuz1_neq_vbuc1_then_la1 - ldy #0 - lda (str),y - cmp #'-' - bne __b2 - // [3280] phi from atoi to atoi::@2 [phi:atoi->atoi::@2] - // atoi::@2 - // [3281] phi from atoi::@2 to atoi::@3 [phi:atoi::@2->atoi::@3] - // [3281] phi atoi::negative#2 = 1 [phi:atoi::@2->atoi::@3#0] -- vbum1=vbuc1 - lda #1 - sta negative - // [3281] phi atoi::res#2 = 0 [phi:atoi::@2->atoi::@3#1] -- vwsm1=vwsc1 - tya - sta res - sta res+1 - // [3281] phi atoi::i#4 = 1 [phi:atoi::@2->atoi::@3#2] -- vbum1=vbuc1 - lda #1 - sta i - jmp __b3 - // Iterate through all digits and update the result - // [3281] phi from atoi to atoi::@3 [phi:atoi->atoi::@3] - __b2: - // [3281] phi atoi::negative#2 = 0 [phi:atoi->atoi::@3#0] -- vbum1=vbuc1 - lda #0 - sta negative - // [3281] phi atoi::res#2 = 0 [phi:atoi->atoi::@3#1] -- vwsm1=vwsc1 - sta res - sta res+1 - // [3281] phi atoi::i#4 = 0 [phi:atoi->atoi::@3#2] -- vbum1=vbuc1 - sta i - // atoi::@3 - __b3: - // for (; str[i]>='0' && str[i]<='9'; ++i) - // [3282] if(atoi::str#2[atoi::i#4]<'0') goto atoi::@5 -- pbuz1_derefidx_vbum2_lt_vbuc1_then_la1 - ldy i - lda (str),y - cmp #'0' - bcc __b5 - // atoi::@6 - // [3283] if(atoi::str#2[atoi::i#4]<='9') goto atoi::@4 -- pbuz1_derefidx_vbum2_le_vbuc1_then_la1 - lda (str),y - cmp #'9' - bcc __b4 - beq __b4 - // atoi::@5 - __b5: - // if(negative) - // [3284] if(0!=atoi::negative#2) goto atoi::@1 -- 0_neq_vbum1_then_la1 - // Return result with sign - lda negative - bne __b1 - // [3286] phi from atoi::@1 atoi::@5 to atoi::@return [phi:atoi::@1/atoi::@5->atoi::@return] - // [3286] phi atoi::return#2 = atoi::return#0 [phi:atoi::@1/atoi::@5->atoi::@return#0] -- register_copy - rts - // atoi::@1 - __b1: - // return -res; - // [3285] atoi::return#0 = - atoi::res#2 -- vwsm1=_neg_vwsm1 - lda #0 - sec - sbc return - sta return - lda #0 - sbc return+1 - sta return+1 - // atoi::@return - // } - // [3287] return - rts - // atoi::@4 - __b4: - // res * 10 - // [3288] atoi::$10 = atoi::res#2 << 2 -- vwsz1=vwsm2_rol_2 - lda res - asl - sta.z atoi__10 - lda res+1 - rol - sta.z atoi__10+1 - asl.z atoi__10 - rol.z atoi__10+1 - // [3289] atoi::$11 = atoi::$10 + atoi::res#2 -- vwsz1=vwsz1_plus_vwsm2 - clc - lda.z atoi__11 - adc res - sta.z atoi__11 - lda.z atoi__11+1 - adc res+1 - sta.z atoi__11+1 - // [3290] atoi::$6 = atoi::$11 << 1 -- vwsz1=vwsz1_rol_1 - asl.z atoi__6 - rol.z atoi__6+1 - // res * 10 + str[i] - // [3291] atoi::$7 = atoi::$6 + atoi::str#2[atoi::i#4] -- vwsz1=vwsz1_plus_pbuz2_derefidx_vbum3 - ldy i - lda.z atoi__7 - clc - adc (str),y - sta.z atoi__7 - bcc !+ - inc.z atoi__7+1 - !: - // res = res * 10 + str[i] - '0' - // [3292] atoi::res#1 = atoi::$7 - '0' -- vwsm1=vwsz2_minus_vbuc1 - lda.z atoi__7 - sec - sbc #'0' - sta res - lda.z atoi__7+1 - sbc #0 - sta res+1 - // for (; str[i]>='0' && str[i]<='9'; ++i) - // [3293] atoi::i#2 = ++ atoi::i#4 -- vbum1=_inc_vbum1 - inc i - // [3281] phi from atoi::@4 to atoi::@3 [phi:atoi::@4->atoi::@3] - // [3281] phi atoi::negative#2 = atoi::negative#2 [phi:atoi::@4->atoi::@3#0] -- register_copy - // [3281] phi atoi::res#2 = atoi::res#1 [phi:atoi::@4->atoi::@3#1] -- register_copy - // [3281] phi atoi::i#4 = atoi::i#2 [phi:atoi::@4->atoi::@3#2] -- register_copy - jmp __b3 - .segment Data - .label res = return - // Initialize sign as positive - i: .byte 0 - return: .word 0 - // Initialize result - negative: .byte 0 -} -.segment Code - // cx16_k_macptr -/** - * @brief Read a number of bytes from the sdcard using kernal macptr call. - * BRAM bank needs to be set properly before the load between adressed A000 and BFFF. - * - * @return x the size of bytes read - * @return y the size of bytes read - * @return if carry is set there is an error - */ -// __mem() unsigned int cx16_k_macptr(__mem() volatile char bytes, __zp($58) void * volatile buffer) -cx16_k_macptr: { - .label buffer = $58 - // unsigned int bytes_read - // [3294] cx16_k_macptr::bytes_read = 0 -- vwum1=vwuc1 - lda #<0 - sta bytes_read - sta bytes_read+1 + // cbm_k_close(15) + // [2289] ferror::cbm_k_close1_channel = $f -- vbum1=vbuc1 + lda #$f + sta cbm_k_close1_channel + // ferror::cbm_k_close1 // asm - // asm { ldabytes ldxbuffer ldybuffer+1 clc jsrCX16_MACPTR stxbytes_read stybytes_read+1 bcc!+ lda#$FF stabytes_read stabytes_read+1 !: } - lda bytes - ldx buffer - ldy buffer+1 - clc - jsr CX16_MACPTR - stx bytes_read - sty bytes_read+1 - bcc !+ - lda #$ff - sta bytes_read - sta bytes_read+1 - !: - // return bytes_read; - // [3296] cx16_k_macptr::return#0 = cx16_k_macptr::bytes_read -- vwum1=vwum2 - lda bytes_read + // asm { ldachannel jsrCBM_CLOSE } + jsr CBM_CLOSE + // ferror::@9 + // return __errno; + // [2291] ferror::return#1 = __errno#18 -- vwsm1=vwsm2 + lda __errno sta return - lda bytes_read+1 + lda __errno+1 sta return+1 - // cx16_k_macptr::@return + // ferror::@return // } - // [3297] cx16_k_macptr::return#1 = cx16_k_macptr::return#0 - // [3298] return + // [2292] return rts - .segment Data - bytes: .byte 0 - bytes_read: .word 0 - .label return = fgets.bytes -} -.segment Code - // uctoa_append -// Used to convert a single digit of an unsigned number value to a string representation -// Counts a single digit up from '0' as long as the value is larger than sub. -// Each time the digit is increased sub is subtracted from value. -// - buffer : pointer to the char that receives the digit -// - value : The value where the digit will be derived from -// - sub : the value of a '1' in the digit. Subtracted continually while the digit is increased. -// (For decimal the subs used are 10000, 1000, 100, 10, 1) -// returns : the value reduced by sub * digit so that it is less than sub. -// __mem() char uctoa_append(__zp($43) char *buffer, __mem() char value, __mem() char sub) -uctoa_append: { - .label buffer = $43 - // [3300] phi from uctoa_append to uctoa_append::@1 [phi:uctoa_append->uctoa_append::@1] - // [3300] phi uctoa_append::digit#2 = 0 [phi:uctoa_append->uctoa_append::@1#0] -- vbum1=vbuc1 - lda #0 - sta digit - // [3300] phi uctoa_append::value#2 = uctoa_append::value#0 [phi:uctoa_append->uctoa_append::@1#1] -- register_copy - // uctoa_append::@1 + // ferror::@1 __b1: - // while (value >= sub) - // [3301] if(uctoa_append::value#2>=uctoa_append::sub#0) goto uctoa_append::@2 -- vbum1_ge_vbum2_then_la1 - lda value - cmp sub - bcs __b2 - // uctoa_append::@3 - // *buffer = DIGITS[digit] - // [3302] *uctoa_append::buffer#0 = DIGITS[uctoa_append::digit#2] -- _deref_pbuz1=pbuc1_derefidx_vbum2 - ldy digit - lda DIGITS,y - ldy #0 - sta (buffer),y - // uctoa_append::@return - // } - // [3303] return - rts - // uctoa_append::@2 - __b2: - // digit++; - // [3304] uctoa_append::digit#1 = ++ uctoa_append::digit#2 -- vbum1=_inc_vbum1 - inc digit - // value -= sub - // [3305] uctoa_append::value#1 = uctoa_append::value#2 - uctoa_append::sub#0 -- vbum1=vbum1_minus_vbum2 - lda value - sec - sbc sub - sta value - // [3300] phi from uctoa_append::@2 to uctoa_append::@1 [phi:uctoa_append::@2->uctoa_append::@1] - // [3300] phi uctoa_append::digit#2 = uctoa_append::digit#1 [phi:uctoa_append::@2->uctoa_append::@1#0] -- register_copy - // [3300] phi uctoa_append::value#2 = uctoa_append::value#1 [phi:uctoa_append::@2->uctoa_append::@1#1] -- register_copy - jmp __b1 - .segment Data - .label value = smc_get_version_text.release - .label sub = uctoa.digit_value - .label return = smc_get_version_text.release - digit: .byte 0 -} -.segment CodeVera - // spi_read_flash -// void spi_read_flash(unsigned long spi_data) -spi_read_flash: { - // spi_select() - // [3307] call spi_select - /* -; .X [7:0] -; .Y [15:8] -; .A [23:16] -.proc spi_read_flash - pha - - jsr spi_select - lda #$03 - jsr spi_write - pla - jsr spi_write - tya - jsr spi_write - txa - jsr spi_write - - rts -.endproc - */ - // [3393] phi from spi_read_flash to spi_select [phi:spi_read_flash->spi_select] - jsr spi_select - // spi_read_flash::@1 - // spi_write(0x03) - // [3308] spi_write::data = 3 -- vbum1=vbuc1 - lda #3 - sta spi_write.data - // [3309] call spi_write - jsr spi_write - // spi_read_flash::@2 - // spi_write(BYTE2(spi_data)) - // [3310] spi_write::data = 0 -- vbum1=vbuc1 - lda #0 - sta spi_write.data - // [3311] call spi_write - jsr spi_write - // spi_read_flash::@3 - // spi_write(BYTE1(spi_data)) - // [3312] spi_write::data = 0 -- vbum1=vbuc1 + // if (!errno_parsed) + // [2293] if(0!=ferror::errno_parsed#2) goto ferror::@3 -- 0_neq_vbum1_then_la1 + lda errno_parsed + bne __b3 + // ferror::@4 + // if (ch == ',') + // [2294] if(ferror::ch#10!=',') goto ferror::@3 -- vbum1_neq_vbuc1_then_la1 + lda #',' + cmp ch + bne __b3 + // ferror::@5 + // errno_parsed++; + // [2295] ferror::errno_parsed#1 = ++ ferror::errno_parsed#2 -- vbum1=_inc_vbum1 + inc errno_parsed + // strncpy(temp, __errno_error, errno_len+1) + // [2296] strncpy::n#0 = ferror::errno_len#10 + 1 -- vwum1=vbuz2_plus_1 + lda.z errno_len + clc + adc #1 + sta strncpy.n lda #0 - sta spi_write.data - // [3313] call spi_write - jsr spi_write - // spi_read_flash::@4 - // spi_write(BYTE0(spi_data)) - // [3314] spi_write::data = 0 -- vbum1=vbuc1 + adc #0 + sta strncpy.n+1 + // [2297] call strncpy + // [2339] phi from ferror::@5 to strncpy [phi:ferror::@5->strncpy] + jsr strncpy + // [2298] phi from ferror::@5 to ferror::@13 [phi:ferror::@5->ferror::@13] + // ferror::@13 + // atoi(temp) + // [2299] call atoi + // [2311] phi from ferror::@13 to atoi [phi:ferror::@13->atoi] + // [2311] phi atoi::str#2 = ferror::temp [phi:ferror::@13->atoi#0] -- pbuz1=pbuc1 + lda #temp + sta.z atoi.str+1 + jsr atoi + // atoi(temp) + // [2300] atoi::return#4 = atoi::return#2 + // ferror::@14 + // __errno = atoi(temp) + // [2301] __errno#2 = atoi::return#4 -- vwsm1=vwsm2 + lda atoi.return + sta __errno + lda atoi.return+1 + sta __errno+1 + // [2302] phi from ferror::@1 ferror::@14 ferror::@4 to ferror::@3 [phi:ferror::@1/ferror::@14/ferror::@4->ferror::@3] + // [2302] phi __errno#116 = __errno#18 [phi:ferror::@1/ferror::@14/ferror::@4->ferror::@3#0] -- register_copy + // [2302] phi ferror::errno_parsed#11 = ferror::errno_parsed#2 [phi:ferror::@1/ferror::@14/ferror::@4->ferror::@3#1] -- register_copy + // ferror::@3 + __b3: + // __errno_error[errno_len] = ch + // [2303] __errno_error[ferror::errno_len#10] = ferror::ch#10 -- pbuc1_derefidx_vbuz1=vbum2 + lda ch + ldy.z errno_len + sta __errno_error,y + // errno_len++; + // [2304] ferror::errno_len#1 = ++ ferror::errno_len#10 -- vbuz1=_inc_vbuz1 + inc.z errno_len + // ferror::cbm_k_chrin2 + // char ch + // [2305] ferror::cbm_k_chrin2_ch = 0 -- vbum1=vbuc1 lda #0 - sta spi_write.data - // [3315] call spi_write - jsr spi_write - // spi_read_flash::@return + sta cbm_k_chrin2_ch + // asm + // asm { jsrCBM_CHRIN stach } + jsr CBM_CHRIN + sta cbm_k_chrin2_ch + // return ch; + // [2307] ferror::cbm_k_chrin2_return#0 = ferror::cbm_k_chrin2_ch -- vbum1=vbum2 + sta cbm_k_chrin2_return + // ferror::cbm_k_chrin2_@return // } - // [3316] return - rts + // [2308] ferror::cbm_k_chrin2_return#1 = ferror::cbm_k_chrin2_return#0 + // ferror::@10 + // cbm_k_chrin() + // [2309] ferror::$15 = ferror::cbm_k_chrin2_return#1 -- vbuz1=vbum2 + sta.z ferror__15 + // ch = cbm_k_chrin() + // [2310] ferror::ch#1 = ferror::$15 -- vbum1=vbuz2 + sta ch + // [2280] phi from ferror::@10 to ferror::cbm_k_readst1 [phi:ferror::@10->ferror::cbm_k_readst1] + // [2280] phi __errno#18 = __errno#116 [phi:ferror::@10->ferror::cbm_k_readst1#0] -- register_copy + // [2280] phi ferror::errno_len#10 = ferror::errno_len#1 [phi:ferror::@10->ferror::cbm_k_readst1#1] -- register_copy + // [2280] phi ferror::ch#10 = ferror::ch#1 [phi:ferror::@10->ferror::cbm_k_readst1#2] -- register_copy + // [2280] phi ferror::errno_parsed#2 = ferror::errno_parsed#11 [phi:ferror::@10->ferror::cbm_k_readst1#3] -- register_copy + jmp cbm_k_readst1 + .segment Data + temp: .fill 4, 0 + cbm_k_setnam1_filename_len: .byte 0 + cbm_k_chkin1_channel: .byte 0 + cbm_k_chkin1_status: .byte 0 + cbm_k_chrin1_ch: .byte 0 + cbm_k_readst1_status: .byte 0 + cbm_k_close1_channel: .byte 0 + cbm_k_chrin2_ch: .byte 0 + return: .word 0 + sp: .byte 0 + .label cbm_k_chrin1_return = ch + ch: .byte 0 + cbm_k_readst1_return: .byte 0 + st: .byte 0 + cbm_k_chrin2_return: .byte 0 + errno_parsed: .byte 0 } - // vera_compare -// __mem() unsigned int vera_compare(__mem() char bank_ram, __zp($64) char *bram_ptr, unsigned int vera_compare_size) -vera_compare: { - .label bram_ptr = $64 - // vera_compare::bank_set_bram1 - // BRAM = bank - // [3318] BRAM = vera_compare::bank_ram#0 -- vbuz1=vbum2 - lda bank_ram - sta.z BRAM - // [3319] phi from vera_compare::bank_set_bram1 to vera_compare::@1 [phi:vera_compare::bank_set_bram1->vera_compare::@1] - // [3319] phi vera_compare::bram_ptr#2 = vera_compare::bram_ptr#0 [phi:vera_compare::bank_set_bram1->vera_compare::@1#0] -- register_copy - // [3319] phi vera_compare::equal_bytes#2 = 0 [phi:vera_compare::bank_set_bram1->vera_compare::@1#1] -- vwum1=vwuc1 - lda #<0 - sta equal_bytes - sta equal_bytes+1 - // [3319] phi vera_compare::compared_bytes#2 = 0 [phi:vera_compare::bank_set_bram1->vera_compare::@1#2] -- vwum1=vwuc1 - sta compared_bytes - sta compared_bytes+1 - // vera_compare::@1 - __b1: - // while (compared_bytes < vera_compare_size) - // [3320] if(vera_compare::compared_bytes#2vera_compare::@2] - // vera_compare::@2 - __b2: - // unsigned char vera_byte = spi_read() - // [3323] call spi_read - jsr spi_read - // [3324] spi_read::return#12 = spi_read::return#4 - // vera_compare::@5 - // [3325] vera_compare::vera_byte#0 = spi_read::return#12 - // if (vera_byte == *bram_ptr) - // [3326] if(vera_compare::vera_byte#0!=*vera_compare::bram_ptr#2) goto vera_compare::@3 -- vbum1_neq__deref_pbuz2_then_la1 +.segment Code + // atoi +// Converts the string argument str to an integer. +// __mem() int atoi(__zp($49) const char *str) +atoi: { + .label atoi__6 = $4b + .label atoi__7 = $4b + .label str = $49 + .label atoi__10 = $4b + .label atoi__11 = $4b + // if (str[i] == '-') + // [2312] if(*atoi::str#2!='-') goto atoi::@3 -- _deref_pbuz1_neq_vbuc1_then_la1 ldy #0 - lda (bram_ptr),y - cmp vera_byte - bne __b3 - // vera_compare::@4 - // equal_bytes++; - // [3327] vera_compare::equal_bytes#1 = ++ vera_compare::equal_bytes#2 -- vwum1=_inc_vwum1 - inc equal_bytes - bne !+ - inc equal_bytes+1 - !: - // [3328] phi from vera_compare::@4 vera_compare::@5 to vera_compare::@3 [phi:vera_compare::@4/vera_compare::@5->vera_compare::@3] - // [3328] phi vera_compare::equal_bytes#6 = vera_compare::equal_bytes#1 [phi:vera_compare::@4/vera_compare::@5->vera_compare::@3#0] -- register_copy - // vera_compare::@3 + lda (str),y + cmp #'-' + bne __b2 + // [2313] phi from atoi to atoi::@2 [phi:atoi->atoi::@2] + // atoi::@2 + // [2314] phi from atoi::@2 to atoi::@3 [phi:atoi::@2->atoi::@3] + // [2314] phi atoi::negative#2 = 1 [phi:atoi::@2->atoi::@3#0] -- vbum1=vbuc1 + lda #1 + sta negative + // [2314] phi atoi::res#2 = 0 [phi:atoi::@2->atoi::@3#1] -- vwsm1=vwsc1 + tya + sta res + sta res+1 + // [2314] phi atoi::i#4 = 1 [phi:atoi::@2->atoi::@3#2] -- vbum1=vbuc1 + lda #1 + sta i + jmp __b3 + // Iterate through all digits and update the result + // [2314] phi from atoi to atoi::@3 [phi:atoi->atoi::@3] + __b2: + // [2314] phi atoi::negative#2 = 0 [phi:atoi->atoi::@3#0] -- vbum1=vbuc1 + lda #0 + sta negative + // [2314] phi atoi::res#2 = 0 [phi:atoi->atoi::@3#1] -- vwsm1=vwsc1 + sta res + sta res+1 + // [2314] phi atoi::i#4 = 0 [phi:atoi->atoi::@3#2] -- vbum1=vbuc1 + sta i + // atoi::@3 __b3: - // bram_ptr++; - // [3329] vera_compare::bram_ptr#1 = ++ vera_compare::bram_ptr#2 -- pbuz1=_inc_pbuz1 - inc.z bram_ptr - bne !+ - inc.z bram_ptr+1 - !: - // compared_bytes++; - // [3330] vera_compare::compared_bytes#1 = ++ vera_compare::compared_bytes#2 -- vwum1=_inc_vwum1 - inc compared_bytes - bne !+ - inc compared_bytes+1 - !: - // [3319] phi from vera_compare::@3 to vera_compare::@1 [phi:vera_compare::@3->vera_compare::@1] - // [3319] phi vera_compare::bram_ptr#2 = vera_compare::bram_ptr#1 [phi:vera_compare::@3->vera_compare::@1#0] -- register_copy - // [3319] phi vera_compare::equal_bytes#2 = vera_compare::equal_bytes#6 [phi:vera_compare::@3->vera_compare::@1#1] -- register_copy - // [3319] phi vera_compare::compared_bytes#2 = vera_compare::compared_bytes#1 [phi:vera_compare::@3->vera_compare::@1#2] -- register_copy - jmp __b1 - .segment DataVera - bank_ram: .byte 0 - .label return = equal_bytes - .label vera_byte = spi_read.return_3 - compared_bytes: .word 0 - /// Holds the amount of bytes actually verified between the VERA and the RAM. - equal_bytes: .word 0 -} -.segment CodeVera - // spi_read -spi_read: { - // unsigned char SPIData - // [3331] spi_read::SPIData = 0 -- vbum1=vbuc1 - /* - .proc spi_read - stz Vera::Reg::SPIData -@1: bit Vera::Reg::SPICtrl - bmi @1 - lda Vera::Reg::SPIData - rts -.endproc -*/ + // for (; str[i]>='0' && str[i]<='9'; ++i) + // [2315] if(atoi::str#2[atoi::i#4]<'0') goto atoi::@5 -- pbuz1_derefidx_vbum2_lt_vbuc1_then_la1 + ldy i + lda (str),y + cmp #'0' + bcc __b5 + // atoi::@6 + // [2316] if(atoi::str#2[atoi::i#4]<='9') goto atoi::@4 -- pbuz1_derefidx_vbum2_le_vbuc1_then_la1 + lda (str),y + cmp #'9' + bcc __b4 + beq __b4 + // atoi::@5 + __b5: + // if(negative) + // [2317] if(0!=atoi::negative#2) goto atoi::@1 -- 0_neq_vbum1_then_la1 + // Return result with sign + lda negative + bne __b1 + // [2319] phi from atoi::@1 atoi::@5 to atoi::@return [phi:atoi::@1/atoi::@5->atoi::@return] + // [2319] phi atoi::return#2 = atoi::return#0 [phi:atoi::@1/atoi::@5->atoi::@return#0] -- register_copy + rts + // atoi::@1 + __b1: + // return -res; + // [2318] atoi::return#0 = - atoi::res#2 -- vwsm1=_neg_vwsm1 lda #0 - sta SPIData - // asm - // asm { stzvera_reg_SPIData !: bitvera_reg_SPICtrl bmi!- ldavera_reg_SPIData staSPIData } - stz vera_reg_SPIData - !: - bit vera_reg_SPICtrl - bmi !- - lda vera_reg_SPIData - sta SPIData - // return SPIData; - // [3333] spi_read::return#3 = spi_read::SPIData -- vbum1=vbum2 - sta return_3 - // spi_read::@return + sec + sbc return + sta return + lda #0 + sbc return+1 + sta return+1 + // atoi::@return // } - // [3334] spi_read::return#4 = spi_read::return#3 - // [3335] return + // [2320] return rts - .segment DataVera - SPIData: .byte 0 - return: .byte 0 - return_1: .byte 0 - return_2: .byte 0 - return_3: .byte 0 + // atoi::@4 + __b4: + // res * 10 + // [2321] atoi::$10 = atoi::res#2 << 2 -- vwsz1=vwsm2_rol_2 + lda res + asl + sta.z atoi__10 + lda res+1 + rol + sta.z atoi__10+1 + asl.z atoi__10 + rol.z atoi__10+1 + // [2322] atoi::$11 = atoi::$10 + atoi::res#2 -- vwsz1=vwsz1_plus_vwsm2 + clc + lda.z atoi__11 + adc res + sta.z atoi__11 + lda.z atoi__11+1 + adc res+1 + sta.z atoi__11+1 + // [2323] atoi::$6 = atoi::$11 << 1 -- vwsz1=vwsz1_rol_1 + asl.z atoi__6 + rol.z atoi__6+1 + // res * 10 + str[i] + // [2324] atoi::$7 = atoi::$6 + atoi::str#2[atoi::i#4] -- vwsz1=vwsz1_plus_pbuz2_derefidx_vbum3 + ldy i + lda.z atoi__7 + clc + adc (str),y + sta.z atoi__7 + bcc !+ + inc.z atoi__7+1 + !: + // res = res * 10 + str[i] - '0' + // [2325] atoi::res#1 = atoi::$7 - '0' -- vwsm1=vwsz2_minus_vbuc1 + lda.z atoi__7 + sec + sbc #'0' + sta res + lda.z atoi__7+1 + sbc #0 + sta res+1 + // for (; str[i]>='0' && str[i]<='9'; ++i) + // [2326] atoi::i#2 = ++ atoi::i#4 -- vbum1=_inc_vbum1 + inc i + // [2314] phi from atoi::@4 to atoi::@3 [phi:atoi::@4->atoi::@3] + // [2314] phi atoi::negative#2 = atoi::negative#2 [phi:atoi::@4->atoi::@3#0] -- register_copy + // [2314] phi atoi::res#2 = atoi::res#1 [phi:atoi::@4->atoi::@3#1] -- register_copy + // [2314] phi atoi::i#4 = atoi::i#2 [phi:atoi::@4->atoi::@3#2] -- register_copy + jmp __b3 + .segment Data + .label res = return + // Initialize sign as positive + i: .byte 0 + return: .word 0 + // Initialize result + negative: .byte 0 } .segment Code - // rom_byte_compare + // cx16_k_macptr /** - * @brief Verify a byte with the flashed ROM using the 22 bit rom address. - * The lower 14 bits of the 22 bit ROM address are transformed into the **ptr_rom** 16 bit ROM address. - * The higher 8 bits of the 22 bit ROM address are transformed into the **bank_rom** 8 bit bank number. - * **bank_ptr* is used to set the bank using ZP $01. **ptr_rom** is used to write the byte into the ROM. + * @brief Read a number of bytes from the sdcard using kernal macptr call. + * BRAM bank needs to be set properly before the load between adressed A000 and BFFF. * - * @param address The 22 bit ROM address. - * @param value The byte value to be written. + * @return x the size of bytes read + * @return y the size of bytes read + * @return if carry is set there is an error */ -// __mem() char rom_byte_compare(__zp($4c) char *ptr_rom, __mem() char value) -rom_byte_compare: { - .label ptr_rom = $4c - // if (*ptr_rom != value) - // [3336] if(*rom_byte_compare::ptr_rom#0==rom_byte_compare::value#0) goto rom_byte_compare::@1 -- _deref_pbuz1_eq_vbum2_then_la1 - lda value - ldy #0 - cmp (ptr_rom),y - beq __b2 - // [3337] phi from rom_byte_compare to rom_byte_compare::@2 [phi:rom_byte_compare->rom_byte_compare::@2] - // rom_byte_compare::@2 - // [3338] phi from rom_byte_compare::@2 to rom_byte_compare::@1 [phi:rom_byte_compare::@2->rom_byte_compare::@1] - // [3338] phi rom_byte_compare::return#0 = 0 [phi:rom_byte_compare::@2->rom_byte_compare::@1#0] -- vbum1=vbuc1 - tya - sta return - rts - // [3338] phi from rom_byte_compare to rom_byte_compare::@1 [phi:rom_byte_compare->rom_byte_compare::@1] - __b2: - // [3338] phi rom_byte_compare::return#0 = 1 [phi:rom_byte_compare->rom_byte_compare::@1#0] -- vbum1=vbuc1 - lda #1 +// __mem() unsigned int cx16_k_macptr(__mem() volatile char bytes, __zp($56) void * volatile buffer) +cx16_k_macptr: { + .label buffer = $56 + // unsigned int bytes_read + // [2327] cx16_k_macptr::bytes_read = 0 -- vwum1=vwuc1 + lda #<0 + sta bytes_read + sta bytes_read+1 + // asm + // asm { ldabytes ldxbuffer ldybuffer+1 clc jsrCX16_MACPTR stxbytes_read stybytes_read+1 bcc!+ lda#$FF stabytes_read stabytes_read+1 !: } + lda bytes + ldx buffer + ldy buffer+1 + clc + jsr CX16_MACPTR + stx bytes_read + sty bytes_read+1 + bcc !+ + lda #$ff + sta bytes_read + sta bytes_read+1 + !: + // return bytes_read; + // [2329] cx16_k_macptr::return#0 = cx16_k_macptr::bytes_read -- vwum1=vwum2 + lda bytes_read sta return - // rom_byte_compare::@1 - // rom_byte_compare::@return + lda bytes_read+1 + sta return+1 + // cx16_k_macptr::@return // } - // [3339] return + // [2330] cx16_k_macptr::return#1 = cx16_k_macptr::return#0 + // [2331] return rts .segment Data - return: .byte 0 - value: .byte 0 + bytes: .byte 0 + bytes_read: .word 0 + .label return = fgets.bytes } .segment Code // ultoa_append @@ -22474,18 +14865,18 @@ rom_byte_compare: { // - sub : the value of a '1' in the digit. Subtracted continually while the digit is increased. // (For decimal the subs used are 10000, 1000, 100, 10, 1) // returns : the value reduced by sub * digit so that it is less than sub. -// __mem() unsigned long ultoa_append(__zp($45) char *buffer, __mem() unsigned long value, __mem() unsigned long sub) +// __mem() unsigned long ultoa_append(__zp($3c) char *buffer, __mem() unsigned long value, __mem() unsigned long sub) ultoa_append: { - .label buffer = $45 - // [3341] phi from ultoa_append to ultoa_append::@1 [phi:ultoa_append->ultoa_append::@1] - // [3341] phi ultoa_append::digit#2 = 0 [phi:ultoa_append->ultoa_append::@1#0] -- vbum1=vbuc1 + .label buffer = $3c + // [2333] phi from ultoa_append to ultoa_append::@1 [phi:ultoa_append->ultoa_append::@1] + // [2333] phi ultoa_append::digit#2 = 0 [phi:ultoa_append->ultoa_append::@1#0] -- vbum1=vbuc1 lda #0 sta digit - // [3341] phi ultoa_append::value#2 = ultoa_append::value#0 [phi:ultoa_append->ultoa_append::@1#1] -- register_copy + // [2333] phi ultoa_append::value#2 = ultoa_append::value#0 [phi:ultoa_append->ultoa_append::@1#1] -- register_copy // ultoa_append::@1 __b1: // while (value >= sub) - // [3342] if(ultoa_append::value#2>=ultoa_append::sub#0) goto ultoa_append::@2 -- vdum1_ge_vdum2_then_la1 + // [2334] if(ultoa_append::value#2>=ultoa_append::sub#0) goto ultoa_append::@2 -- vdum1_ge_vdum2_then_la1 lda value+3 cmp sub+3 bcc !+ @@ -22501,215 +14892,25 @@ ultoa_append: { lda value cmp sub bcs __b2 - !: - // ultoa_append::@3 - // *buffer = DIGITS[digit] - // [3343] *ultoa_append::buffer#0 = DIGITS[ultoa_append::digit#2] -- _deref_pbuz1=pbuc1_derefidx_vbum2 - ldy digit - lda DIGITS,y - ldy #0 - sta (buffer),y - // ultoa_append::@return - // } - // [3344] return - rts - // ultoa_append::@2 - __b2: - // digit++; - // [3345] ultoa_append::digit#1 = ++ ultoa_append::digit#2 -- vbum1=_inc_vbum1 - inc digit - // value -= sub - // [3346] ultoa_append::value#1 = ultoa_append::value#2 - ultoa_append::sub#0 -- vdum1=vdum1_minus_vdum2 - lda value - sec - sbc sub - sta value - lda value+1 - sbc sub+1 - sta value+1 - lda value+2 - sbc sub+2 - sta value+2 - lda value+3 - sbc sub+3 - sta value+3 - // [3341] phi from ultoa_append::@2 to ultoa_append::@1 [phi:ultoa_append::@2->ultoa_append::@1] - // [3341] phi ultoa_append::digit#2 = ultoa_append::digit#1 [phi:ultoa_append::@2->ultoa_append::@1#0] -- register_copy - // [3341] phi ultoa_append::value#2 = ultoa_append::value#1 [phi:ultoa_append::@2->ultoa_append::@1#1] -- register_copy - jmp __b1 - .segment Data - .label value = printf_ulong.uvalue - .label sub = ultoa.digit_value - .label return = printf_ulong.uvalue - digit: .byte 0 -} -.segment Code - // rom_wait -/** - * @brief Wait for the required time to allow the chip to flash the byte into the ROM. - * This is a core wait routine which is the most important routine in this whole program. - * Once a byte is flashed into the ROM, it takes time for the chip to actually flash the byte. - * The chip has implemented a loop mechanism to guarantee correct flashing of the written byte. - * It does this by requiring the execution of two sequential reads from the previously written ROM address. - * And loop those sequential reads until bit 6 of the 2 read bytes are equal. - * Once those two bits are equal, the chip has successfully flashed the byte into the ROM. - * - * - * @param ptr_rom The 16 bit pointer where the byte was written. This pointer is used for the sequence reads to verify bit 6. - */ -/* inline */ -// void rom_wait(__zp($2d) char *ptr_rom) -rom_wait: { - .label rom_wait__0 = $2b - .label rom_wait__1 = $29 - .label ptr_rom = $2d - // rom_wait::@1 - __b1: - // test1 = *((brom_ptr_t)ptr_rom) - // [3348] rom_wait::test1#1 = *rom_wait::ptr_rom#3 -- vbum1=_deref_pbuz2 - ldy #0 - lda (ptr_rom),y - sta test1 - // test2 = *((brom_ptr_t)ptr_rom) - // [3349] rom_wait::test2#1 = *rom_wait::ptr_rom#3 -- vbum1=_deref_pbuz2 - lda (ptr_rom),y - sta test2 - // test1 & 0x40 - // [3350] rom_wait::$0 = rom_wait::test1#1 & $40 -- vbuz1=vbum2_band_vbuc1 - lda #$40 - and test1 - sta.z rom_wait__0 - // test2 & 0x40 - // [3351] rom_wait::$1 = rom_wait::test2#1 & $40 -- vbuz1=vbum2_band_vbuc1 - lda #$40 - and test2 - sta.z rom_wait__1 - // while ((test1 & 0x40) != (test2 & 0x40)) - // [3352] 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 - bne __b1 - // rom_wait::@return - // } - // [3353] return - rts - .segment Data - test1: .byte 0 - test2: .byte 0 -} -.segment Code - // rom_byte_program -/** - * @brief Write a byte and wait until the byte has been successfully flashed into the ROM. - * - * @param address The 22 bit ROM address. - * @param value The byte value to be written. - */ -/* inline */ -// void rom_byte_program(__mem() unsigned long address, __mem() char value) -rom_byte_program: { - .label rom_ptr1_rom_byte_program__0 = $47 - .label rom_ptr1_rom_byte_program__2 = $47 - .label rom_ptr1_return = $47 - // rom_byte_program::rom_ptr1 - // (unsigned int)(address) & ROM_PTR_MASK - // [3355] rom_byte_program::rom_ptr1_$2 = (unsigned int)rom_byte_program::address#0 -- vwuz1=_word_vdum2 - lda address - sta.z rom_ptr1_rom_byte_program__2 - lda address+1 - sta.z rom_ptr1_rom_byte_program__2+1 - // [3356] rom_byte_program::rom_ptr1_$0 = rom_byte_program::rom_ptr1_$2 & $3fff -- vwuz1=vwuz1_band_vwuc1 - lda.z rom_ptr1_rom_byte_program__0 - and #<$3fff - sta.z rom_ptr1_rom_byte_program__0 - lda.z rom_ptr1_rom_byte_program__0+1 - and #>$3fff - sta.z rom_ptr1_rom_byte_program__0+1 - // ((unsigned int)(address) & ROM_PTR_MASK) + ROM_BASE - // [3357] rom_byte_program::rom_ptr1_return#0 = rom_byte_program::rom_ptr1_$0 + $c000 -- vwuz1=vwuz1_plus_vwuc1 - lda.z rom_ptr1_return - clc - adc #<$c000 - sta.z rom_ptr1_return - lda.z rom_ptr1_return+1 - adc #>$c000 - sta.z rom_ptr1_return+1 - // rom_byte_program::@1 - // rom_write_byte(address, value) - // [3358] rom_write_byte::address#3 = rom_byte_program::address#0 - // [3359] rom_write_byte::value#3 = rom_byte_program::value#0 - // [3360] call rom_write_byte - // [3212] phi from rom_byte_program::@1 to rom_write_byte [phi:rom_byte_program::@1->rom_write_byte] - // [3212] phi rom_write_byte::value#10 = rom_write_byte::value#3 [phi:rom_byte_program::@1->rom_write_byte#0] -- register_copy - // [3212] phi rom_write_byte::address#4 = rom_write_byte::address#3 [phi:rom_byte_program::@1->rom_write_byte#1] -- register_copy - jsr rom_write_byte - // rom_byte_program::@2 - // rom_wait(ptr_rom) - // [3361] rom_wait::ptr_rom#1 = (char *)rom_byte_program::rom_ptr1_return#0 -- pbuz1=pbuz2 - lda.z rom_ptr1_return - sta.z rom_wait.ptr_rom - lda.z rom_ptr1_return+1 - sta.z rom_wait.ptr_rom+1 - // [3362] call rom_wait - // [3347] phi from rom_byte_program::@2 to rom_wait [phi:rom_byte_program::@2->rom_wait] - // [3347] phi rom_wait::ptr_rom#3 = rom_wait::ptr_rom#1 [phi:rom_byte_program::@2->rom_wait#0] -- register_copy - jsr rom_wait - // rom_byte_program::@return - // } - // [3363] return - rts - .segment Data - .label address = rom_write_byte.address - .label value = rom_write_byte.value -} -.segment Code - // utoa_append -// Used to convert a single digit of an unsigned number value to a string representation -// Counts a single digit up from '0' as long as the value is larger than sub. -// Each time the digit is increased sub is subtracted from value. -// - buffer : pointer to the char that receives the digit -// - value : The value where the digit will be derived from -// - sub : the value of a '1' in the digit. Subtracted continually while the digit is increased. -// (For decimal the subs used are 10000, 1000, 100, 10, 1) -// returns : the value reduced by sub * digit so that it is less than sub. -// __mem() unsigned int utoa_append(__zp($3f) char *buffer, __mem() unsigned int value, __mem() unsigned int sub) -utoa_append: { - .label buffer = $3f - // [3365] phi from utoa_append to utoa_append::@1 [phi:utoa_append->utoa_append::@1] - // [3365] phi utoa_append::digit#2 = 0 [phi:utoa_append->utoa_append::@1#0] -- vbum1=vbuc1 - lda #0 - sta digit - // [3365] phi utoa_append::value#2 = utoa_append::value#0 [phi:utoa_append->utoa_append::@1#1] -- register_copy - // utoa_append::@1 - __b1: - // while (value >= sub) - // [3366] if(utoa_append::value#2>=utoa_append::sub#0) goto utoa_append::@2 -- vwum1_ge_vwum2_then_la1 - lda sub+1 - cmp value+1 - bne !+ - lda sub - cmp value - beq __b2 - !: - bcc __b2 - // utoa_append::@3 + !: + // ultoa_append::@3 // *buffer = DIGITS[digit] - // [3367] *utoa_append::buffer#0 = DIGITS[utoa_append::digit#2] -- _deref_pbuz1=pbuc1_derefidx_vbum2 + // [2335] *ultoa_append::buffer#0 = DIGITS[ultoa_append::digit#2] -- _deref_pbuz1=pbuc1_derefidx_vbum2 ldy digit lda DIGITS,y ldy #0 sta (buffer),y - // utoa_append::@return + // ultoa_append::@return // } - // [3368] return + // [2336] return rts - // utoa_append::@2 + // ultoa_append::@2 __b2: // digit++; - // [3369] utoa_append::digit#1 = ++ utoa_append::digit#2 -- vbum1=_inc_vbum1 + // [2337] ultoa_append::digit#1 = ++ ultoa_append::digit#2 -- vbum1=_inc_vbum1 inc digit // value -= sub - // [3370] utoa_append::value#1 = utoa_append::value#2 - utoa_append::sub#0 -- vwum1=vwum1_minus_vwum2 + // [2338] ultoa_append::value#1 = ultoa_append::value#2 - ultoa_append::sub#0 -- vdum1=vdum1_minus_vdum2 lda value sec sbc sub @@ -22717,207 +14918,114 @@ utoa_append: { lda value+1 sbc sub+1 sta value+1 - // [3365] phi from utoa_append::@2 to utoa_append::@1 [phi:utoa_append::@2->utoa_append::@1] - // [3365] phi utoa_append::digit#2 = utoa_append::digit#1 [phi:utoa_append::@2->utoa_append::@1#0] -- register_copy - // [3365] phi utoa_append::value#2 = utoa_append::value#1 [phi:utoa_append::@2->utoa_append::@1#1] -- register_copy + lda value+2 + sbc sub+2 + sta value+2 + lda value+3 + sbc sub+3 + sta value+3 + // [2333] phi from ultoa_append::@2 to ultoa_append::@1 [phi:ultoa_append::@2->ultoa_append::@1] + // [2333] phi ultoa_append::digit#2 = ultoa_append::digit#1 [phi:ultoa_append::@2->ultoa_append::@1#0] -- register_copy + // [2333] phi ultoa_append::value#2 = ultoa_append::value#1 [phi:ultoa_append::@2->ultoa_append::@1#1] -- register_copy jmp __b1 .segment Data - .label value = smc_detect.return - .label sub = utoa.digit_value - .label return = smc_detect.return + .label value = printf_ulong.uvalue + .label sub = ultoa.digit_value + .label return = printf_ulong.uvalue digit: .byte 0 } .segment Code - // memcpy8_vram_vram -/** - * @brief Copy a block of memory in VRAM from a source to a target destination. - * This function is designed to copy maximum 255 bytes of memory in one step. - * If more than 255 bytes need to be copied, use the memcpy_vram_vram function. - * - * @see memcpy_vram_vram - * - * @param dbank_vram Bank of the destination location in vram. - * @param doffset_vram Offset of the destination location in vram. - * @param sbank_vram Bank of the source location in vram. - * @param soffset_vram Offset of the source location in vram. - * @param num16 Specified the amount of bytes to be copied. - */ -// void memcpy8_vram_vram(__mem() char dbank_vram, __mem() unsigned int doffset_vram, __mem() char sbank_vram, __mem() unsigned int soffset_vram, __mem() char num8) -memcpy8_vram_vram: { - .label memcpy8_vram_vram__0 = $23 - .label memcpy8_vram_vram__1 = $24 - .label memcpy8_vram_vram__2 = $25 - .label memcpy8_vram_vram__3 = $26 - .label memcpy8_vram_vram__4 = $27 - .label memcpy8_vram_vram__5 = $28 - // *VERA_CTRL &= ~VERA_ADDRSEL - // [3371] *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) - // [3372] memcpy8_vram_vram::$0 = byte0 memcpy8_vram_vram::soffset_vram#0 -- vbuz1=_byte0_vwum2 - lda soffset_vram - sta.z memcpy8_vram_vram__0 - // *VERA_ADDRX_L = BYTE0(soffset_vram) - // [3373] *VERA_ADDRX_L = memcpy8_vram_vram::$0 -- _deref_pbuc1=vbuz1 - sta VERA_ADDRX_L - // BYTE1(soffset_vram) - // [3374] memcpy8_vram_vram::$1 = byte1 memcpy8_vram_vram::soffset_vram#0 -- vbuz1=_byte1_vwum2 - lda soffset_vram+1 - sta.z memcpy8_vram_vram__1 - // *VERA_ADDRX_M = BYTE1(soffset_vram) - // [3375] *VERA_ADDRX_M = memcpy8_vram_vram::$1 -- _deref_pbuc1=vbuz1 - sta VERA_ADDRX_M - // sbank_vram | VERA_INC_1 - // [3376] memcpy8_vram_vram::$2 = memcpy8_vram_vram::sbank_vram#0 | VERA_INC_1 -- vbuz1=vbum2_bor_vbuc1 - lda #VERA_INC_1 - ora sbank_vram - sta.z memcpy8_vram_vram__2 - // *VERA_ADDRX_H = sbank_vram | VERA_INC_1 - // [3377] *VERA_ADDRX_H = memcpy8_vram_vram::$2 -- _deref_pbuc1=vbuz1 - sta VERA_ADDRX_H - // *VERA_CTRL |= VERA_ADDRSEL - // [3378] *VERA_CTRL = *VERA_CTRL | VERA_ADDRSEL -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2 - lda #VERA_ADDRSEL - ora VERA_CTRL - sta VERA_CTRL - // BYTE0(doffset_vram) - // [3379] memcpy8_vram_vram::$3 = byte0 memcpy8_vram_vram::doffset_vram#0 -- vbuz1=_byte0_vwum2 - lda doffset_vram - sta.z memcpy8_vram_vram__3 - // *VERA_ADDRX_L = BYTE0(doffset_vram) - // [3380] *VERA_ADDRX_L = memcpy8_vram_vram::$3 -- _deref_pbuc1=vbuz1 - sta VERA_ADDRX_L - // BYTE1(doffset_vram) - // [3381] memcpy8_vram_vram::$4 = byte1 memcpy8_vram_vram::doffset_vram#0 -- vbuz1=_byte1_vwum2 - lda doffset_vram+1 - sta.z memcpy8_vram_vram__4 - // *VERA_ADDRX_M = BYTE1(doffset_vram) - // [3382] *VERA_ADDRX_M = memcpy8_vram_vram::$4 -- _deref_pbuc1=vbuz1 - sta VERA_ADDRX_M - // dbank_vram | VERA_INC_1 - // [3383] memcpy8_vram_vram::$5 = memcpy8_vram_vram::dbank_vram#0 | VERA_INC_1 -- vbuz1=vbum2_bor_vbuc1 - lda #VERA_INC_1 - ora dbank_vram - sta.z memcpy8_vram_vram__5 - // *VERA_ADDRX_H = dbank_vram | VERA_INC_1 - // [3384] *VERA_ADDRX_H = memcpy8_vram_vram::$5 -- _deref_pbuc1=vbuz1 - sta VERA_ADDRX_H - // [3385] 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] + // strncpy +/// Copies up to n characters from the string pointed to, by src to dst. +/// In a case where the length of src is less than that of n, the remainder of dst will be padded with null bytes. +/// @param dst ? This is the pointer to the destination array where the content is to be copied. +/// @param src ? This is the string to be copied. +/// @param n ? The number of characters to be copied from source. +/// @return The destination +// char * strncpy(__zp($4f) char *dst, __zp($34) const char *src, __mem() unsigned int n) +strncpy: { + .label dst = $4f + .label src = $34 + // [2340] phi from strncpy to strncpy::@1 [phi:strncpy->strncpy::@1] + // [2340] phi strncpy::dst#2 = ferror::temp [phi:strncpy->strncpy::@1#0] -- pbuz1=pbuc1 + lda #ferror.temp + sta.z dst+1 + // [2340] phi strncpy::src#2 = __errno_error [phi:strncpy->strncpy::@1#1] -- pbuz1=pbuc1 + lda #<__errno_error + sta.z src + lda #>__errno_error + sta.z src+1 + // [2340] phi strncpy::i#2 = 0 [phi:strncpy->strncpy::@1#2] -- vwum1=vwuc1 + lda #<0 + sta i + sta i+1 + // strncpy::@1 __b1: - // [3385] phi memcpy8_vram_vram::num8#2 = memcpy8_vram_vram::num8#1 [phi:memcpy8_vram_vram/memcpy8_vram_vram::@2->memcpy8_vram_vram::@1#0] -- register_copy - // the size is only a byte, this is the fastest loop! - // memcpy8_vram_vram::@1 - // while (num8--) - // [3386] memcpy8_vram_vram::num8#0 = -- memcpy8_vram_vram::num8#2 -- vbum1=_dec_vbum2 - ldy num8_1 - dey - sty num8 - // [3387] if(0!=memcpy8_vram_vram::num8#2) goto memcpy8_vram_vram::@2 -- 0_neq_vbum1_then_la1 - lda num8_1 - bne __b2 - // memcpy8_vram_vram::@return + // for(size_t i = 0;istrncpy::@3] + // [2346] phi strncpy::src#6 = strncpy::src#2 [phi:strncpy::@2/strncpy::@4->strncpy::@3#0] -- register_copy + // strncpy::@3 + __b3: + // *dst++ = c + // [2347] *strncpy::dst#2 = strncpy::c#0 -- _deref_pbuz1=vbum2 + lda c + ldy #0 + sta (dst),y + // *dst++ = c; + // [2348] strncpy::dst#0 = ++ strncpy::dst#2 -- pbuz1=_inc_pbuz1 + inc.z dst + bne !+ + inc.z dst+1 + !: + // for(size_t i = 0;istrncpy::@1] + // [2340] phi strncpy::dst#2 = strncpy::dst#0 [phi:strncpy::@3->strncpy::@1#0] -- register_copy + // [2340] phi strncpy::src#2 = strncpy::src#6 [phi:strncpy::@3->strncpy::@1#1] -- register_copy + // [2340] phi strncpy::i#2 = strncpy::i#1 [phi:strncpy::@3->strncpy::@1#2] -- register_copy jmp __b1 .segment Data - num8: .byte 0 - dbank_vram: .byte 0 - doffset_vram: .word 0 - sbank_vram: .byte 0 - soffset_vram: .word 0 - num8_1: .byte 0 -} -.segment CodeVera - // spi_fast -spi_fast: { - // asm - // asm { ldavera_reg_SPICtrl and#%11111101 stavera_reg_SPICtrl } - /* -.proc spi_fast - lda Vera::Reg::SPICtrl - and #%11111101 - sta Vera::Reg::SPICtrl - rts -.endproc -*/ - lda vera_reg_SPICtrl - and #$fd - sta vera_reg_SPICtrl - // spi_fast::@return - // } - // [3392] return - rts -} - // spi_select -spi_select: { - // spi_deselect() - // [3394] call spi_deselect - /* -.proc spi_select - jsr spi_deselect - - lda Vera::Reg::SPICtrl - ora #$01 - sta Vera::Reg::SPICtrl - rts -.endproc -*/ - jsr spi_deselect - // spi_select::@1 - // *vera_reg_SPICtrl |= 1 - // [3395] *vera_reg_SPICtrl = *vera_reg_SPICtrl | 1 -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2 - lda #1 - ora vera_reg_SPICtrl - sta vera_reg_SPICtrl - // spi_select::@return - // } - // [3396] return - rts -} - // spi_write -/** - * @brief - * - * - */ -// void spi_write(__mem() volatile char data) -spi_write: { - // asm - // asm { ldadata stavera_reg_SPIData !: bitvera_reg_SPICtrl bmi!- } - /* -.proc spi_write - sta Vera::Reg::SPIData -@1: bit Vera::Reg::SPICtrl - bmi @1 - rts -.endproc -*/ - lda data - sta vera_reg_SPIData - !: - bit vera_reg_SPICtrl - bmi !- - // spi_write::@return - // } - // [3398] return - rts - .segment DataVera - data: .byte 0 + c: .byte 0 + i: .word 0 + n: .word 0 } // File Data -.segment Data /** * @file errno.c * @author Sven Van de Velde (sven.van.de.velde@telenet.be) @@ -22961,36 +15069,22 @@ spi_write: { .segment DataVera display_jp1_spi_vera_text: .word __34, str, __36, __37, __38, __39, __40, str, __42, __43, str, __45, __46, __47, str, __49 .segment Data - display_no_valid_smc_bootloader_text: .word __50, str, __52, __53, str, __55, __56, __57, __58 - display_smc_rom_issue_text: .word __59, str, __69, __62, str, __64, __65, __66 - display_smc_unsupported_rom_text: .word __67, str, __69, __70, str, __72, __73 - display_debriefing_text_smc: .word __88, str, main.text, str, __78, __79, __80, str, __82, str, __84, __85, __86, __87 - display_debriefing_text_rom: .word __88, str, __90, __91 + display_smc_rom_issue_text: .word __50, str, __60, __53, str, __55, __56, __57 + display_smc_unsupported_rom_text: .word __58, str, __60, __61, str, __63, __64 + display_debriefing_text_smc: .word __79, str, main.text, str, __69, __70, __71, str, __73, str, __75, __76, __77, __78 + display_debriefing_text_rom: .word __79, str, __81, __82 smc_file_header: .fill $20, 0 smc_version_text: .fill $10, 0 - // Globals - rom_device_ids: .byte 0 - .fill 7, 0 rom_device_names: .word 0 .fill 2*7, 0 rom_size_strings: .word 0 .fill 2*7, 0 rom_release_text: .fill 8*$d, 0 rom_release: .fill 8, 0 - rom_prefix: .fill 8, 0 - rom_github: .fill 8*8, 0 - rom_manufacturer_ids: .byte 0 - .fill 7, 0 - rom_sizes: .dword 0 - .fill 4*7, 0 - file_sizes: .dword 0 - .fill 4*7, 0 - rom_file_github: .fill 8*8, 0 - rom_file_release: .fill 8, 0 status_rom: .byte 0 .fill 7, 0 info_text: .fill $50, 0 - status_text: .word __92, __93, __94, smc_action_text_1, smc_action_text, __97, __98, __99, __100, __101, __102, __103 + status_text: .word __83, __84, __85, vera_read.vera_action_text_2, vera_read.vera_action_text_1, __88, __89, __90, __91, __92, __93, __94 status_color: .byte BLACK, GREY, WHITE, CYAN, PURPLE, CYAN, PURPLE, PURPLE, GREEN, YELLOW, RED, PINK __3: .text "Welcome to the CX16 update tool! This program updates the" .byte 0 @@ -23068,114 +15162,78 @@ spi_write: { .byte 0 __49: .text "The program continues once the JP1 pins are opened/closed." .byte 0 - __50: .text "The SMC chip in your CX16 doesn't have a valid bootloader." - .byte 0 - __52: .text "A valid bootloader is needed to update the SMC chip." - .byte 0 - __53: .text "Unfortunately, your SMC chip cannot be updated using this tool!" - .byte 0 - __55: .text "A bootloader can be installed onto the SMC chip using an" - .byte 0 - __56: .text "an Arduino or an AVR ISP device." - .byte 0 - __57: .text "Alternatively a new SMC chip with a valid bootloader can be" - .byte 0 - __58: .text "ordered from TexElec." - .byte 0 - __59: .text "There is an issue with the CX16 SMC or ROM flash readiness." + __50: .text "There is an issue with the CX16 SMC or ROM flash readiness." .byte 0 - __62: .text "to avoid possible conflicts of firmware, bricking your CX16." + __53: .text "to avoid possible conflicts of firmware, bricking your CX16." .byte 0 - __64: .text "Therefore, ensure you have the correct SMC.BIN and ROM.BIN" + __55: .text "Therefore, ensure you have the correct SMC.BIN and ROM.BIN" .byte 0 - __65: .text "files placed on your SDcard. Also ensure that the" + __56: .text "files placed on your SDcard. Also ensure that the" .byte 0 - __66: .text "J1 jumper pins on the CX16 board are closed." + __57: .text "J1 jumper pins on the CX16 board are closed." .byte 0 - __67: .text "There is an issue with the CX16 SMC or ROM flash versions." + __58: .text "There is an issue with the CX16 SMC or ROM flash versions." .byte 0 - __69: .text "Both the SMC and the main ROM must be updated together," + __60: .text "Both the SMC and the main ROM must be updated together," .byte 0 - __70: .text "to avoid possible conflicts, risking bricking your CX16." + __61: .text "to avoid possible conflicts, risking bricking your CX16." .byte 0 - __72: .text "The SMC.BIN and ROM.BIN found on your SDCard may not be" + __63: .text "The SMC.BIN and ROM.BIN found on your SDCard may not be" .byte 0 - __73: .text "mutually compatible. Update the CX16 at your own risk!" + __64: .text "mutually compatible. Update the CX16 at your own risk!" .byte 0 - __78: .text "Because your SMC chipset has been updated," + __69: .text "Because your SMC chipset has been updated," .byte 0 - __79: .text "the restart process differs, depending on the" + __70: .text "the restart process differs, depending on the" .byte 0 - __80: .text "SMC boootloader version installed on your CX16 board:" + __71: .text "SMC boootloader version installed on your CX16 board:" .byte 0 - __82: .text "- SMC bootloader v2.0: your CX16 will automatically shut down." + __73: .text "- SMC bootloader v2.0: your CX16 will automatically shut down." .byte 0 - __84: .text "- SMC bootloader v1.0: you need to " + __75: .text "- SMC bootloader v1.0: you need to " .byte 0 - __85: .text " COMPLETELY DISCONNECT your CX16 from the power source!" + __76: .text " COMPLETELY DISCONNECT your CX16 from the power source!" .byte 0 - __86: .text " The power-off button won't work!" + __77: .text " The power-off button won't work!" .byte 0 - __87: .text " Then, reconnect and start the CX16 normally." + __78: .text " Then, reconnect and start the CX16 normally." .byte 0 - __88: .text "Your CX16 system has been successfully updated!" + __79: .text "Your CX16 system has been successfully updated!" .byte 0 - __90: .text "Since your CX16 system SMC chip has not been updated" + __81: .text "Since your CX16 system SMC chip has not been updated" .byte 0 - __91: .text "your CX16 will just reset automatically after count down." + __82: .text "your CX16 will just reset automatically after count down." .byte 0 - __92: .text "None" + __83: .text "None" .byte 0 - __93: .text "Skip" + __84: .text "Skip" .byte 0 - __94: .text "Detected" + __85: .text "Detected" .byte 0 - __97: .text "Comparing" + __88: .text "Comparing" .byte 0 - __98: .text "Update" + __89: .text "Update" .byte 0 - __99: .text "Updating" + __90: .text "Updating" .byte 0 - __100: .text "Updated" + __91: .text "Updated" .byte 0 - __101: .text "Issue" + __92: .text "Issue" .byte 0 - __102: .text "Error" + __93: .text "Error" .byte 0 - __103: .text "Waiting" - .byte 0 - s: .text "Comparing: " - .byte 0 - s1: .text " differences between RAM:" + __94: .text "Waiting" .byte 0 s2: .text ":" .byte 0 - s3: .text " <-> ROM:" - .byte 0 - string_0: .text "Flashing ... (-) equal, (+) flashed, (!) error." - .byte 0 - info_text1: .text "Flashing ..." - .byte 0 - s4: .text " " - .byte 0 - chip: .text "ROM" + s: .text " " .byte 0 s5: .text " ... " .byte 0 - s6: .text " ..." - .byte 0 - s21: .text "[" - .byte 0 - info_text6: .text "No update required" - .byte 0 - s13: .text " differences!" - .byte 0 - smc_action_text: .text "Reading" - .byte 0 - smc_action_text_1: .text "Checking" - .byte 0 +.segment DataVera str: .text "" .byte 0 +.segment Data isr_vsync: .word $314 __conio: .fill SIZEOF_STRUCT___1, 0 // Buffer used for stringified number being printed @@ -23194,18 +15252,6 @@ spi_write: { .segment DataVera vera_file_size: .dword 0 .segment Data - // Globals (to save zeropage and code overhead with parameter passing.) - smc_bootloader: .word 0 - smc_release: .byte 0 - smc_major: .byte 0 - smc_minor: .byte 0 - smc_file_size: .word 0 - smc_file_release: .byte 0 - smc_file_major: .byte 0 - smc_file_minor: .byte 0 - smc_file_size_1: .word 0 - // Globals (to save zeropage and code overhead with parameter passing.) - smc_bootloader_1: .word 0 status_vera: .byte 0 .segment DataVera spi_manufacturer: .byte 0 diff --git a/target/src/cx16-update.klog b/target/src/cx16-update.klog index d7efce7..40c6ca1 100644 --- a/target/src/cx16-update.klog +++ b/target/src/cx16-update.klog @@ -15,22 +15,22 @@ Basic-segment: $0801-$080c Basic Code-segment: - $080d-$58a7 Code + $080d-$3478 Code Data-segment: - $58a8-$772f Data + $3479-$4b60 Data CodeIntro-segment: - $7730-$7780 CodeIntro + $4b61-$4bb1 CodeIntro CodeVera-segment: - $7781-$84c8 CodeVera + $4bb2-$585b CodeVera DataIntro-segment: - $84c9-$8506 DataIntro + $585c-$5899 DataIntro DataVera-segment: - $8507-$87ce DataVera + $589a-$5bf9 DataVera Writing Vice symbol file: cx16-update.vs Writing Symbol file: cx16-update.sym