From 1f768cca2bb6f7ec4e13f0660e2cbc9b3d78710c Mon Sep 17 00:00:00 2001 From: Diego Parrilla Date: Wed, 13 Sep 2023 13:46:32 +0200 Subject: [PATCH 1/6] Refactor to include folder --- configurator/src/commands.h | 13 --- configurator/src/helper.h | 55 ------------ configurator/src/include/commands.h | 20 +++++ configurator/src/{ => include}/config.h | 2 +- configurator/src/include/helper.h | 92 ++++++++++++++++++++ configurator/src/{ => include}/reset.h | 2 + configurator/src/{ => include}/romselector.h | 5 +- configurator/src/{ => include}/screen.h | 0 8 files changed, 118 insertions(+), 71 deletions(-) delete mode 100644 configurator/src/commands.h delete mode 100644 configurator/src/helper.h create mode 100644 configurator/src/include/commands.h rename configurator/src/{ => include}/config.h (98%) create mode 100644 configurator/src/include/helper.h rename configurator/src/{ => include}/reset.h (88%) rename configurator/src/{ => include}/romselector.h (91%) rename configurator/src/{ => include}/screen.h (100%) diff --git a/configurator/src/commands.h b/configurator/src/commands.h deleted file mode 100644 index 1cd06f3..0000000 --- a/configurator/src/commands.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef COMMANDS_H_ -#define COMMANDS_H_ - -#define LOAD_ROM 1 // Load a ROM from the SD card -#define LIST_ROMS 2 // List the ROMs in the SD card -#define GET_CONFIG 3 // Get the configuration of the device -#define PUT_CONFIG_STRING 4 // Put a configuration string parameter in the device -#define PUT_CONFIG_INTEGER 5 // Put a configuration integer parameter in the device -#define PUT_CONFIG_BOOL 6 // Put a configuration boolean parameter in the device -#define SAVE_CONFIG 7 // Persist the configuration in the FLASH of the device -#define RESET_DEVICE 8 // Reset the device to the default configuration - -#endif // COMMANDS_H_ \ No newline at end of file diff --git a/configurator/src/helper.h b/configurator/src/helper.h deleted file mode 100644 index 9eacd31..0000000 --- a/configurator/src/helper.h +++ /dev/null @@ -1,55 +0,0 @@ -#ifndef HELPER_H_ -#define HELPER_H_ - -#include -#include -#include - -#include "config.h" - -#ifdef _DEBUG -static char file_list_example[] = { - 'd', 'o', 'c', 'u', 'm', 'e', 'n', 't', '.', 't', 'x', 't', 0, - 'i', 'm', 'a', 'g', 'e', '.', 'j', 'p', 'g', 0, - 'n', 'o', 't', 'e', 's', '.', 'd', 'o', 'c', 'x', 0, - 'm', 'u', 's', 'i', 'c', '.', 'm', 'p', '3', 0, - 'p', 'r', 'e', 's', 'e', 'n', 't', 'a', 't', 'i', 'o', 'n', '.', 'p', 'p', 't', 'x', 0, - 's', 'p', 'r', 'e', 'a', 'd', 's', 'h', 'e', 'e', 't', '.', 'x', 'l', 's', 'x', 0, - 0, 0, 0, 0, 0, 0 // Two consecutive zeroes at the end -}; -static __uint16_t protocol_example[] = { - 0x1234, - 0x5678, - 0x9ABC, - 0xDEF0, -}; -#define ROM4_MEMORY_START &protocol_example[0] -#define ROM3_MEMORY_START &protocol_example[0] -#define FILE_LIST_START_ADDRESS &file_list_example[0] -#define CONFIG_START_ADDRESS &config_data_example -#define PROTOCOL_HEADER 0x0000 -#define WAIT_TIME 0 -#else -#define ROM4_MEMORY_START 0xFA0000 -#define ROM3_MEMORY_START 0xFB0000 -#define FILE_LIST_START_ADDRESS (ROM3_MEMORY_START - 4096) -#define CONFIG_START_ADDRESS (ROM3_MEMORY_START - 4096) -#define PROTOCOL_HEADER 0xABCD -#define WAIT_TIME 2 -#endif - -#define PRINT_APP_HEADER(version) \ - do \ - { \ - clearHome(); \ - locate(0, 0); \ - printf("\033pATARI ST SIDECART CONFIGURATOR. V%s - (C)2023 Diego Parrilla / @sidecartridge\033q\r\n", version); \ - } while (0) - -int get_number_within_range(char *prompt, __uint8_t num_items, __uint8_t first_value, char cancel_char, char save_char); -int send_command(__uint16_t command, void *payload, __uint16_t payload_size); -void please_wait(char *message, __uint8_t seconds); -void sleep_seconds(__uint8_t seconds); -void spinner(__uint16_t spinner_update_frequency); - -#endif /* HELPER_H_ */ \ No newline at end of file diff --git a/configurator/src/include/commands.h b/configurator/src/include/commands.h new file mode 100644 index 0000000..6d597b5 --- /dev/null +++ b/configurator/src/include/commands.h @@ -0,0 +1,20 @@ +#ifndef COMMANDS_H_ +#define COMMANDS_H_ + +#define DOWNLOAD_ROM 0 // Download a ROM from the URL +#define LOAD_ROM 1 // Load a ROM from the SD card +#define LIST_ROMS 2 // List the ROMs in the SD card +#define GET_CONFIG 3 // Get the configuration of the device +#define PUT_CONFIG_STRING 4 // Put a configuration string parameter in the device +#define PUT_CONFIG_INTEGER 5 // Put a configuration integer parameter in the device +#define PUT_CONFIG_BOOL 6 // Put a configuration boolean parameter in the device +#define SAVE_CONFIG 7 // Persist the configuration in the FLASH of the device +#define RESET_DEVICE 8 // Reset the device to the default configuration +#define LAUNCH_SCAN_NETWORKS 9 // Launch the scan the networks. No results should return here +#define GET_SCANNED_NETWORKS 10 // Read the result of the scanned networks +#define CONNECT_NETWORK 11 // Connect to a network. Needs the SSID, password and auth method +#define GET_IP_DATA 12 // Get the IP, mask and gateway of the device +#define DISCONNECT_NETWORK 13 // Disconnect from the network +#define GET_ROMS_JSON_FILE 14 // Download the JSON file of ROMs from the URL + +#endif // COMMANDS_H_ \ No newline at end of file diff --git a/configurator/src/config.h b/configurator/src/include/config.h similarity index 98% rename from configurator/src/config.h rename to configurator/src/include/config.h index 07d07e8..2ada04d 100644 --- a/configurator/src/config.h +++ b/configurator/src/include/config.h @@ -10,7 +10,7 @@ #include "screen.h" #include "commands.h" -#define MAX_ENTRIES 5 +#define MAX_ENTRIES 20 #define MAX_KEY_LENGTH 20 #define MAX_STRING_VALUE_LENGTH 64 diff --git a/configurator/src/include/helper.h b/configurator/src/include/helper.h new file mode 100644 index 0000000..f4ad740 --- /dev/null +++ b/configurator/src/include/helper.h @@ -0,0 +1,92 @@ +#ifndef HELPER_H_ +#define HELPER_H_ + +#include +#include +#include + +#include "config.h" + +#define EXCHANGE_BUFFER_SIZE 4096 +#ifdef _DEBUG +static char file_list_example[] = { + 'd', 'o', 'c', 'u', 'm', 'e', 'n', 't', '.', 't', 'x', 't', 0, + 'i', 'm', 'a', 'g', 'e', '.', 'j', 'p', 'g', 0, + 'n', 'o', 't', 'e', 's', '.', 'd', 'o', 'c', 'x', 0, + 'm', 'u', 's', 'i', 'c', '.', 'm', 'p', '3', 0, + 'p', 'r', 'e', 's', 'e', 'n', 't', 'a', 't', 'i', 'o', 'n', '.', 'p', 'p', 't', 'x', 0, + 's', 'p', 'r', 'e', 'a', 'd', 's', 'h', 'e', 'e', 't', '.', 'x', 'l', 's', 'x', 0, + 0, 0, 0, 0, 0, 0 // Two consecutive zeroes at the end +}; + +static char network_file_list_example[] = { + 'D', 'o', 'c', 'u', 'm', 'e', 'n', 't', ' ', '1', 0, + 'i', 'm', 'a', 'g', 'e', 'F', 'i', 'l', 'e', 0, + 'N', 'o', 't', 'e', 's', ' ', 'A', 'B', 'C', 0, + 'M', 'y', ' ', 'M', 'u', 's', 'i', 'c', 0, + 'P', 'o', 'w', 'e', 'r', ' ', 'P', 'r', 'e', 's', 'e', 'n', 't', 'a', 't', 'i', 'o', 'n', 0, + 'E', 'x', 'c', 'e', 'l', ' ', 'S', 'h', 'e', 'e', 't', 0, + 0, 0 // A double zero at the end to indicate the end of the list +}; + +static __uint16_t protocol_example[] = { + 0x1234, + 0x5678, + 0x9ABC, + 0xDEF0, +}; +#define ROM4_MEMORY_START &protocol_example[0] +#define ROM3_MEMORY_START &protocol_example[0] +#define FILE_LIST_START_ADDRESS &file_list_example[0] +#define NETWORK_FILE_LIST_START_ADDRESS &network_file_list_example[0] +#define CONFIG_START_ADDRESS &config_data_example +#define NETWORK_START_ADDRESS &wifi_scan_data_example +#define CONNECTION_STATUS_START_ADDRESS &connection_data_example +#define PROTOCOL_HEADER 0x0000 +#define WAIT_TIME 0 +#define NETWORK_WAIT_TIME 2 +#define ROMS_JSON_WAIT_TIME 2 +#define ELEMENTS_PER_PAGE 10 +#else +#define ROM4_MEMORY_START 0xFA0000 +#define ROM3_MEMORY_START 0xFB0000 +#define FILE_LIST_START_ADDRESS (ROM3_MEMORY_START - EXCHANGE_BUFFER_SIZE) +#define NETWORK_FILE_LIST_START_ADDRESS (ROM3_MEMORY_START - EXCHANGE_BUFFER_SIZE) +#define CONFIG_START_ADDRESS (ROM3_MEMORY_START - EXCHANGE_BUFFER_SIZE) +#define NETWORK_START_ADDRESS (ROM3_MEMORY_START - EXCHANGE_BUFFER_SIZE) +#define CONNECTION_STATUS_START_ADDRESS (ROM3_MEMORY_START - EXCHANGE_BUFFER_SIZE) +#define PROTOCOL_HEADER 0xABCD +#define WAIT_TIME 2 +#define NETWORK_WAIT_TIME 10 +#define ROMS_JSON_WAIT_TIME 5 +#define ELEMENTS_PER_PAGE 17 +#endif + +#define KEY_UP_ARROW 0x480000 +#define KEY_DOWN_ARROW 0x500000 +#define KEY_LEFT_ARROW 0x4B0000 +#define KEY_RIGHT_ARROW 0x4D0000 +#define KEY_ENTER 0x1C000D +#define KEY_ESC 0x1001B + +#define PRINT_APP_HEADER(version) \ + do \ + { \ + clearHome(); \ + locate(0, 0); \ + printf("\033pATARI ST SIDECART CONFIGURATOR. V%s - (C)2023 Diego Parrilla / @sidecartridge\033q\r\n", version); \ + } while (0) + +int get_number_within_range(char *prompt, __uint8_t num_items, __uint8_t first_value, char cancel_char, char save_char); +int send_command(__uint16_t command, void *payload, __uint16_t payload_size); +void please_wait(char *message, __uint8_t seconds); +void please_wait_silent(__uint8_t seconds); +void sleep_seconds(__uint8_t seconds, bool silent); +void spinner(__uint16_t spinner_update_frequency); +char *read_files_from_memory(__uint8_t *memory_location); +__uint8_t get_file_count(char *file_array); +char *print_file_at_index(char *current_ptr, __uint8_t index, int num_columns); +int display_paginated_content(char *file_array, int num_files, int page_size, char *item_name); +void print_centered(const char *str, int screen_width); + +#endif /* HELPER_H_ */ \ No newline at end of file diff --git a/configurator/src/reset.h b/configurator/src/include/reset.h similarity index 88% rename from configurator/src/reset.h rename to configurator/src/include/reset.h index 669f8ec..4ceb0d0 100644 --- a/configurator/src/reset.h +++ b/configurator/src/include/reset.h @@ -8,4 +8,6 @@ #include "screen.h" #include "commands.h" +__uint8_t reset(); + #endif /*RESET_H_*/ \ No newline at end of file diff --git a/configurator/src/romselector.h b/configurator/src/include/romselector.h similarity index 91% rename from configurator/src/romselector.h rename to configurator/src/include/romselector.h index 6adb222..7869e70 100644 --- a/configurator/src/romselector.h +++ b/configurator/src/include/romselector.h @@ -3,10 +3,11 @@ #include #include +#include -#include "helper.h" -#include "screen.h" #include "commands.h" +#include "screen.h" +#include "helper.h" __uint8_t rom_selector(); diff --git a/configurator/src/screen.h b/configurator/src/include/screen.h similarity index 100% rename from configurator/src/screen.h rename to configurator/src/include/screen.h From 5f1cce9900fa995b61326ab75e577d4d16a8db9a Mon Sep 17 00:00:00 2001 From: Diego Parrilla Date: Wed, 13 Sep 2023 13:47:18 +0200 Subject: [PATCH 2/6] Refector includes to include folder --- configurator/src/config.c | 8 ++++++-- configurator/src/reset.c | 2 +- configurator/src/screen.c | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/configurator/src/config.c b/configurator/src/config.c index 7ebb7cc..39a5369 100644 --- a/configurator/src/config.c +++ b/configurator/src/config.c @@ -1,4 +1,4 @@ -#include "config.h" +#include "include/config.h" static void print_table(ConfigData *configData) { @@ -54,7 +54,7 @@ ConfigData load_all_entries() .count = 0, }; currentAddress += sizeof(__uint32_t); - while (configData.count < MAX_ENTRIES) + while (1) { ConfigEntry entry; memcpy(&entry, (void *)currentAddress, sizeof(ConfigEntry)); @@ -172,6 +172,8 @@ __uint8_t configuration() please_wait("Loading configuration...", WAIT_TIME); + printf("\r\n"); + ConfigData configData = load_all_entries(); while (1) @@ -195,6 +197,7 @@ __uint8_t configuration() // Save the stuff to the flash send_command(SAVE_CONFIG, NULL, 0); please_wait("Saving configuration...", WAIT_TIME); + printf("\r\n"); return 1; // Positive is OK } @@ -223,6 +226,7 @@ __uint8_t configuration() break; } please_wait("Saving configuration...", WAIT_TIME); + printf("\r\n"); free(input); } diff --git a/configurator/src/reset.c b/configurator/src/reset.c index b1debfc..98d5ca0 100644 --- a/configurator/src/reset.c +++ b/configurator/src/reset.c @@ -1,4 +1,4 @@ -#include "reset.h" +#include "include/reset.h" __uint8_t reset() { diff --git a/configurator/src/screen.c b/configurator/src/screen.c index 385d180..81b1e71 100644 --- a/configurator/src/screen.c +++ b/configurator/src/screen.c @@ -1,5 +1,5 @@ #include -#include "screen.h" +#include "include/screen.h" void initScreenContext(ScreenContext *screenContext) { From 6be22512082b4f7f15c49a716b55394e16e6a9d3 Mon Sep 17 00:00:00 2001 From: Diego Parrilla Date: Wed, 13 Sep 2023 13:48:10 +0200 Subject: [PATCH 3/6] Refactor read files from mem to helper --- configurator/src/helper.c | 296 ++++++++++++++++++++++++++++++++- configurator/src/romselector.c | 137 ++------------- 2 files changed, 299 insertions(+), 134 deletions(-) diff --git a/configurator/src/helper.c b/configurator/src/helper.c index 2a4b8d8..7ed10ed 100644 --- a/configurator/src/helper.c +++ b/configurator/src/helper.c @@ -1,8 +1,33 @@ -#include "helper.h" +#include "include/helper.h" static __uint16_t spinner_loop = 0; static char spinner_chars[] = {'\\', '|', '/', '-'}; +#ifdef _DEBUG +#include + +void dump_hex(const void *data, size_t size) +{ + locate(0, 24); + const unsigned char *byte_data = data; + // Print hex values + for (size_t i = 0; i < size; i++) + { + printf("%02x ", byte_data[i]); + } + + printf(" "); // Some space between hex and chars + + // Print characters + for (size_t i = 0; i < size; i++) + { + // Check if the character is printable; if not, print a dot + char ch = isprint(byte_data[i]) ? byte_data[i] : '.'; + printf("%c", ch); + } +} +#endif + // Function to convert a character to lowercase char to_lowercase(char c) { @@ -97,24 +122,29 @@ int send_command(__uint16_t command, void *payload, __uint16_t payload_size) printf("Command payload size: 0x%02X\r\n", command_payload_size); #endif - for (__uint8_t i = 0; i < payload_size; i += 2) + if ((payload_size > 0) && (payload != NULL)) { - __uint8_t value = *((volatile __uint8_t *)(rom3_address + *((__uint16_t *)(payload + i)))); + + for (__uint8_t i = 0; i < payload_size; i += 2) + { + __uint8_t value = *((volatile __uint8_t *)(rom3_address + *((__uint16_t *)(payload + i)))); #ifdef _DEBUG - printf("Payload[%i]: 0x%02X\r\n", i, value); + printf("Payload[%i]: 0x%04X / 0x%02X\r\n", i, *((__uint16_t *)(payload + i)), value); #endif + } } return 0; } -void sleep_seconds(__uint8_t seconds) +void sleep_seconds(__uint8_t seconds, bool silent) { for (__uint8_t j = 0; j < seconds; j++) { // Assuming PAL system; for NTSC, use 60. for (__uint8_t i = 0; i < 50; i++) { - spinner(1); + if (!silent) + spinner(1); Vsync(); // Wait for VBL interrupt } } @@ -133,6 +163,256 @@ void please_wait(char *message, __uint8_t seconds) { printf(message); // Show the message printf(" "); // Leave a space for the spinner - sleep_seconds(seconds); - printf("\r\n"); + sleep_seconds(seconds, false); +} + +void please_wait_silent(__uint8_t seconds) +{ + sleep_seconds(seconds, true); +} + +char *read_files_from_memory(__uint8_t *memory_location) +{ + __uint8_t *current_ptr = memory_location; + __uint16_t total_size = 0; + + // Calculate total size required + while (1) + { + // If we encounter two consecutive 0x00 bytes, it means we're at the end of the list + if (*current_ptr == 0x00 && *(current_ptr + 1) == 0x00) + { + total_size += 2; // For two consecutive null characters + break; + } + + total_size++; + current_ptr++; + } + + // Allocate memory for the file list + char *output_array = (char *)malloc(total_size * sizeof(char)); + if (!output_array) + { + // Allocation failed + return NULL; + } + + // Copy the memory content to the output array + for (int i = 0; i < total_size; i++) + { + output_array[i] = memory_location[i]; + } + + return output_array; +} + +__uint8_t get_file_count(char *file_array) +{ + __uint8_t count = 0; + char *current_ptr = file_array; + + while (*current_ptr) + { // as long as we don't hit the double null terminator + count++; + + // skip past the current filename to the next + while (*current_ptr) + current_ptr++; + current_ptr++; // skip the null terminator for the current filename + } + + return count; +} + +char *print_file_at_index(char *current_ptr, __uint8_t index, int num_columns) +{ + + __uint8_t current_index = 0; + while (*current_ptr) + { // As long as we don't hit the double null terminator + if (current_index == index) + { + int chars_printed = 0; // To keep track of how many characters are printed + + while (*current_ptr) + { + putchar(*current_ptr); + current_ptr++; + chars_printed++; + } + + // If num_columns is provided, fill the rest of the line with spaces + if (num_columns > 0) + { + for (; chars_printed < num_columns; chars_printed++) + { + putchar(' '); + } + } + + putchar('\r'); + putchar('\n'); + return current_ptr; + } + + // Skip past the current filename to the next + while (*current_ptr) + current_ptr++; + current_ptr++; // Skip the null terminator for the current filename + + current_index++; + } + + printf("No file found at index %d\r\n", index); + return current_ptr; +} + +int display_paginated_content(char *file_array, int num_files, int page_size, char *item_name) +{ + void highlight_and_print(char *file_array, __uint8_t index, __uint8_t offset, int current_line, int num_columns, bool highlight) + { + locate(0, current_line + 2 + index - offset); + if (highlight) + printf("\033p"); // Enter reverse video mode (VT52) + printf("\033K"); // Erase to end of line (VT52) + print_file_at_index(file_array, index, num_columns); + if (highlight) + printf("\033q"); // Exit reverse video mode (VT52) + } + + int selected_rom = -1; + int page_number = 0; // Page number starts at 0 + int current_index = 0; + locate(0, 22); + printf("Use [UP] and [DOWN] arrows to select. [LEFT] and [RIGHT] to paginate.\r\n"); + printf("Press [ENTER] to load it. [ESC] to return to main menu."); + + while (selected_rom < 0) + { + int start_index = page_number * page_size; + int end_index = start_index + page_size - 1; + int max_page = (num_files / page_size); + + if (start_index >= num_files) + { + printf("No content for this page number!\r\n"); + return -1; + } + + if (end_index >= num_files) + { + end_index = num_files - 1; + } + + char *current_ptr = file_array; + int index = 0; + int current_line = 2; + locate(0, current_line); + printf("\033K"); // Erase to end of line (VT52) + printf("%s found: %d. ", item_name, num_files); + printf("Page %d of %d\r\n", page_number + 1, max_page + 1); + locate(0, current_line + 1); + printf("\033K"); // Erase to end of line (VT52) + while (index <= num_files) + { + if ((start_index <= index) && (index <= end_index)) + { + // Print the index number + locate(0, current_line + 2 + index - page_size * page_number); + current_ptr = print_file_at_index(file_array, index, 80); + index++; + } + else + { + // Skip past the current filename to the next + while (*current_ptr != 0x00) + current_ptr++; + current_ptr++; // skip the null terminator for the current filename + index++; + } + } + for (int i = index; i <= page_size * (page_number + 1); i++) + { + // THe -1 at the begining it's because of the previous increment + locate(0, -1 + current_line + 2 + i - (page_size * page_number)); + printf("\033K"); // Erase to end of line (VT52) + } + + long key; + bool change_page = false; + while ((selected_rom < 0) && (!change_page)) + { + highlight_and_print(file_array, current_index, page_size * page_number, current_line, 80, true); + key = Crawcin(); + switch (key) + { + case KEY_UP_ARROW: + if (current_index > start_index) + { + highlight_and_print(file_array, current_index, page_size * page_number, current_line, 80, false); + current_index = current_index - 1; + } + break; + + case KEY_DOWN_ARROW: + if (current_index < end_index) + { + highlight_and_print(file_array, current_index, page_size * page_number, current_line, 80, false); + current_index = current_index + 1; + } + break; + case KEY_LEFT_ARROW: + if (page_number > 0) + { + page_number--; + current_index = page_number * page_size; + change_page = true; + } + break; + case KEY_RIGHT_ARROW: + if (page_number < max_page) + { + page_number++; + current_index = page_number * page_size; + change_page = true; + } + break; + case KEY_ENTER: + selected_rom = current_index + 1; + return selected_rom; + case KEY_ESC: + printf("KEY PRESSED"); + return -1; + default: + // Handle other keys + break; + } + +#ifdef _DEBUG + locate(0, 20); + printf("Key pressed: 0x%04X\r\n", key); + locate(0, 21); + printf("Current index: %d\r\n", current_index); +#endif + } + } +} + +void print_centered(const char *str, int screen_width) +{ + int len = strlen(str); + if (len >= screen_width) + { + printf("%s", str); + } + else + { + int padding = (screen_width - len) / 2; // calculate padding needed + for (int i = 0; i < padding; i++) + { + printf(" "); // print padding + } + printf("%s", str); + } } \ No newline at end of file diff --git a/configurator/src/romselector.c b/configurator/src/romselector.c index faab825..00b9964 100644 --- a/configurator/src/romselector.c +++ b/configurator/src/romselector.c @@ -1,93 +1,8 @@ -#include "romselector.h" +#include "include/romselector.h" //================================================================ // ROM selector -static char * -read_files_from_memory(__uint8_t *memory_location) -{ - __uint8_t *current_ptr = memory_location; - __uint16_t total_size = 0; - - // Calculate total size required - while (1) - { - // If we encounter two consecutive 0x00 bytes, it means we're at the end of the list - if (*current_ptr == 0x00 && *(current_ptr + 1) == 0x00) - { - total_size += 2; // For two consecutive null characters - break; - } - - total_size++; - current_ptr++; - } - - // Allocate memory for the file list - char *output_array = (char *)malloc(total_size * sizeof(char)); - if (!output_array) - { - // Allocation failed - return NULL; - } - - // Copy the memory content to the output array - for (int i = 0; i < total_size; i++) - { - output_array[i] = memory_location[i]; - } - - return output_array; -} - -static __uint8_t get_file_count(char *file_array) -{ - __uint8_t count = 0; - char *current_ptr = file_array; - - while (*current_ptr) - { // as long as we don't hit the double null terminator - count++; - - // skip past the current filename to the next - while (*current_ptr) - current_ptr++; - current_ptr++; // skip the null terminator for the current filename - } - - return count; -} - -static void print_file_at_index(char *file_array, __uint8_t index) -{ - __uint8_t current_index = 0; - char *current_ptr = file_array; - - while (*current_ptr) - { // As long as we don't hit the double null terminator - if (current_index == index) - { - while (*current_ptr) - { - putchar(*current_ptr); - current_ptr++; - } - putchar('\r'); - putchar('\n'); - return; - } - - // Skip past the current filename to the next - while (*current_ptr) - current_ptr++; - current_ptr++; // Skip the null terminator for the current filename - - current_index++; - } - - printf("No file found at index %d\r\n", index); -} - __uint8_t rom_selector() { PRINT_APP_HEADER(VERSION); @@ -98,6 +13,8 @@ __uint8_t rom_selector() please_wait("Loading available ROM images...", WAIT_TIME); + printf("\r\n"); + int num_files = -1; __uint32_t file_list_mem = FILE_LIST_START_ADDRESS; @@ -110,41 +27,10 @@ __uint8_t rom_selector() { printf("No files found. Check if you have ROMS copied in your microSD card!\r\n"); printf("Press any key to exit...\r\n"); + // Back to main menu + return 0; // 0 is go to menu } - else - { - - num_files = get_file_count(file_array); - printf("Number of ROM files found: %d\r\n\r\n", num_files); - - int index = 1; // Index counter - char *current_ptr = file_array; - - while (index <= num_files) - { - // Print the index number - printf("%d. ", index++); - - // Print the current filename - while (*current_ptr != 0x00) - { - putchar(*current_ptr); - current_ptr++; - } - - // Move past the 0x00 byte to the next filename - current_ptr++; - - // Print a newline for the next filename - putchar('\r'); - putchar('\n'); - } - } - - char *prompt; - asprintf(&prompt, "Enter the ROM to load (1 to %d): ", num_files); - - __int16_t rom_number = (__int16_t)get_number_within_range(prompt, num_files, 1, '\0', '\0'); + __int16_t rom_number = display_paginated_content(file_array, get_file_count(file_array), ELEMENTS_PER_PAGE, "ROM images"); if (rom_number <= 0) { @@ -152,16 +38,15 @@ __uint8_t rom_selector() return 0; // 0 is go to menu } - printf("\r\n"); - printf("\r\n"); + locate(0, 22); - printf("Selected the ROM file: %d. ", rom_number); + printf("\033KSelected the ROM file: %d. ", rom_number); - print_file_at_index(file_array, rom_number - 1); + print_file_at_index(file_array, rom_number - 1, 0); send_command(LOAD_ROM, &rom_number, 2); - printf("ROM file loaded. "); + printf("\033KROM file loaded. "); return 1; // Positive is OK -} \ No newline at end of file +} From 135aff0d219dbf7fa75da20f49a9e303fdb18902 Mon Sep 17 00:00:00 2001 From: Diego Parrilla Date: Wed, 13 Sep 2023 13:48:45 +0200 Subject: [PATCH 4/6] New wifi features --- configurator/src/include/network.h | 118 +++++++++++++ configurator/src/main.c | 152 ++++++++++++---- configurator/src/network.c | 269 +++++++++++++++++++++++++++++ 3 files changed, 503 insertions(+), 36 deletions(-) create mode 100644 configurator/src/include/network.h create mode 100644 configurator/src/network.c diff --git a/configurator/src/include/network.h b/configurator/src/include/network.h new file mode 100644 index 0000000..0570da4 --- /dev/null +++ b/configurator/src/include/network.h @@ -0,0 +1,118 @@ +#ifndef NETWORK_H +#define NETWORK_H + +#include +#include +#include +#include + +#include "helper.h" +#include "screen.h" +#include "commands.h" + +#define MAX_NETWORKS 100 +#define MAX_SSID_LENGTH 34 +#define MAX_BSSID_LENGTH 20 +#define IPV4_ADDRESS_LENGTH 16 +#define IPV6_ADDRESS_LENGTH 40 +typedef enum +{ + DISCONNECTED, + CONNECTING, + CONNECTED_WIFI, + CONNECTED_WIFI_NO_IP, + CONNECTED_WIFI_IP, + TIMEOUT_ERROR, + GENERIC_ERROR, + NO_DATA_ERROR, + NOT_PERMITTED_ERROR, + INVALID_ARG_ERROR, + IO_ERROR, + BADAUTH_ERROR, + CONNECT_FAILED_ERROR, + INSUFFICIENT_RESOURCES_ERROR, + NOT_SUPPORTED +} ConnectionStatus; + +typedef struct +{ + char ssid[MAX_SSID_LENGTH]; // SSID can have up to 32 characters + null terminator + char bssid[MAX_BSSID_LENGTH]; // BSSID in the format xx:xx:xx:xx:xx:xx + null terminator + __uint16_t auth_mode; // MSB is not used, the data is in the LSB +} WifiNetworkInfo; + +typedef struct +{ + char ssid[MAX_SSID_LENGTH]; // SSID to connect + char password[MAX_SSID_LENGTH]; // Password + __uint16_t auth_mode; // auth mode +} WifiNetworkAuthInfo; + +typedef struct +{ + __uint32_t magic; // Some magic value for identification/validation + WifiNetworkInfo networks[MAX_NETWORKS]; + __uint16_t count; // The number of networks found/stored +} WifiScanData; + +typedef struct connection_data +{ + char ssid[MAX_SSID_LENGTH]; // SSID to connect + char ipv4_address[IPV4_ADDRESS_LENGTH]; // IP address + char ipv6_address[IPV6_ADDRESS_LENGTH]; // IPv6 address + __uint16_t status; // connection status +} ConnectionData; + +extern ConnectionStatus connection_status; +extern WifiScanData *wifiScanData; +extern ConnectionData *connection_data; +extern __uint16_t previous_connection_status; // Keep track of the previous connection status + +#ifdef _DEBUG +static WifiScanData wifi_scan_data_example = { + .magic = 0x12345678, + .count = 6, + .networks = { + { + .ssid = "HOME_NETWORK", + .bssid = "00:11:22:33:44:55", + .auth_mode = 0x0001, + }, + { + .ssid = "OFFICE_NET", + .bssid = "AA:BB:CC:DD:EE:FF", + .auth_mode = 0x0002, + }, + { + .ssid = "GUEST_WIFI", + .bssid = "FF:EE:DD:CC:BB:AA", + .auth_mode = 0x0003, + }, + { + .ssid = "COFFE_SHOP", + .bssid = "11:22:33:44:55:66", + .auth_mode = 0x0, + }, + { + .ssid = "MOBILE_HOSTSPOT", + .bssid = "66:55:44:33:22:11", + .auth_mode = 0x0005, + }, + { + .ssid = "LIBARY_WIFI", + .bssid = "11:22:33:44:55:66", + .auth_mode = 0x0006, + }}, +}; +static ConnectionData connection_data_example = { + .ssid = "HOME_NETWORK", + .ipv4_address = "1.2.3.4", + .ipv6_address = "UNKNOWN", + .status = CONNECTED_WIFI_IP}; +#endif + +__uint8_t network_selector(); +__uint16_t get_connection_status(bool show_bar); +__uint8_t roms_from_network_selector(); + +#endif // NETWORK_H diff --git a/configurator/src/main.c b/configurator/src/main.c index d89f3ef..b64ad68 100644 --- a/configurator/src/main.c +++ b/configurator/src/main.c @@ -1,35 +1,116 @@ - #include -#include "screen.h" -#include "helper.h" -#include "romselector.h" -#include "config.h" +#include "include/screen.h" +#include "include/helper.h" +#include "include/romselector.h" +#include "include/config.h" +#include "include/network.h" +#include "include/reset.h" + +#define EXIT_OPTION 0 +#define ROM_MICROSD_SELECTOR_OPTION 1 +#define ROM_NETWORK_SELECTOR_OPTION 2 +#define NETWORK_SELECTOR_OPTION 3 +#define CONFIGURATION_OPTION 4 +#define RESET_OPTION 5 +#define LAST_OPTION RESET_OPTION +#define MENU_ALIGN_X 10 +#define MENU_ALIGN_Y 4 +#define PROMT_ALIGN_X 7 +#define PROMT_ALIGN_Y 20 +#define MENU_CALLBACK_INTERVAL 10 // Every 10 seconds poll for the connection status + +typedef struct +{ + int option; + int line; + bool connection; // Connection needed? + bool networking; // Networking needed? + const char *description; +} MenuItem; + +typedef void (*CallbackFunction)(); + +// Option index, line, connection needed?, networking needed? description +static const MenuItem menuItems[] = { + {ROM_MICROSD_SELECTOR_OPTION, ROM_MICROSD_SELECTOR_OPTION, false, false, "Emulate ROM image from microSD card"}, + {ROM_NETWORK_SELECTOR_OPTION, ROM_NETWORK_SELECTOR_OPTION, true, true, "Emulate ROM image from Wi-Fi"}, + {NETWORK_SELECTOR_OPTION, NETWORK_SELECTOR_OPTION, false, true, "Wi-Fi configuration"}, + {CONFIGURATION_OPTION, CONFIGURATION_OPTION, false, false, "SidecarT configuration"}, + {RESET_OPTION, RESET_OPTION, false, false, "Reset to default configuration"}, + {EXIT_OPTION, 7, false, false, "Exit"}}; + +static __int8_t get_number_active_wait(CallbackFunction callback) +{ + __uint16_t callback_interval = 0; + bool first_display = true; + while (1) + { + char key = '\0'; + if (Cconis()) + { + key = Crawcin(); + if (key == '0') + { + return EXIT_OPTION; + } + __int8_t feature = key - '0'; + if ((feature > 0) && (feature <= LAST_OPTION)) + { + printf("%c", key); + return feature; + } + } + if (callback != NULL) + { + if (callback_interval <= 0) + { + callback(true); + if ((first_display) || (previous_connection_status != connection_data->status)) + { + first_display = false; + for (int i = 0; i < sizeof(menuItems) / sizeof(MenuItem); i++) + { + if (!(menuItems[i].networking) || !(menuItems[i].connection) || (connection_data->status == CONNECTED_WIFI_IP)) + { + locate(MENU_ALIGN_X, MENU_ALIGN_Y + menuItems[i].line); + printf("%i. %s", menuItems[i].option, menuItems[i].description); + } + } + } + fflush(stdout); + callback_interval = MENU_CALLBACK_INTERVAL; + } + else + { + please_wait_silent(1); + callback_interval--; + } + } + } +} static __int8_t menu() { PRINT_APP_HEADER(VERSION); - int num_options = 0; - locate(10, 5); - printf("%i. Emulate ROM image from microSD card", ++num_options); - locate(10, 6); - // printf("%i. Emulate Floppy image from microSD card in drive A", num_options++); - // locate(10, 7); - // printf("%i. Emulate Floppy image from microSD card in drive B", num_options++); - // locate(10, 8); - printf("%i. SidecarT configuration", ++num_options); - locate(10, 7); - printf("%i. Reset to default configuration", ++num_options); - // locate(10, 9); - // printf("%i. Wi-Fi configuration", num_options); - locate(10, 11); - printf("0. Exit"); - - locate(7, 20); + // locate(MENU_ALIGN_X, MENU_ALIGN_Y + ROM_MICROSD_SELECTOR_OPTION); + // printf("%i. Emulate ROM image from microSD card", ROM_MICROSD_SELECTOR_OPTION); + // locate(MENU_ALIGN_X, MENU_ALIGN_Y + NETWORK_SELECTOR_OPTION); + // printf("%i. Wi-Fi configuration", NETWORK_SELECTOR_OPTION); + // locate(MENU_ALIGN_X, MENU_ALIGN_Y + CONFIGURATION_OPTION); + // printf("%i. SidecarT configuration", CONFIGURATION_OPTION); + // locate(MENU_ALIGN_X, MENU_ALIGN_Y + RESET_OPTION); + // printf("%i. Reset to default configuration", RESET_OPTION); + // locate(MENU_ALIGN_X, MENU_ALIGN_Y + 7); + // printf("%i. Exit", EXIT_OPTION); + + locate(PROMT_ALIGN_X, PROMT_ALIGN_Y); char *prompt; - asprintf(&prompt, "Choose the feature (1 to %d), or press 0 to exit: ", num_options); + asprintf(&prompt, "Choose the feature (1 to %d), or press 0 to exit: ", LAST_OPTION); + + get_connection_status(true); - __int8_t feature = (__int8_t)get_number_within_range(prompt, num_options, 0, '\0', '\0'); + __int8_t feature = get_number_active_wait(get_connection_status); if (feature <= 0) feature = -1; @@ -58,30 +139,29 @@ static int run() while (feature == 0) { feature = menu(); - switch (feature) { - case 1: + case ROM_MICROSD_SELECTOR_OPTION: feature = rom_selector(); break; - case 2: - feature = configuration(); + case ROM_NETWORK_SELECTOR_OPTION: + feature = roms_from_network_selector(); break; - case 3: - feature = reset(); + case NETWORK_SELECTOR_OPTION: + feature = network_selector(); break; - case 4: - rom_selector(); + case CONFIGURATION_OPTION: + feature = configuration(); break; - case 5: - rom_selector(); + case RESET_OPTION: + feature = reset(); break; default: break; } } - - printf("Now you can reset or power cycle your Atari ST computer.\r\n"); + locate(0, 24); + printf("\033KNow you can reset or power cycle your Atari ST computer.\r\n"); #ifdef _DEBUG getchar(); diff --git a/configurator/src/network.c b/configurator/src/network.c new file mode 100644 index 0000000..97e5dd1 --- /dev/null +++ b/configurator/src/network.c @@ -0,0 +1,269 @@ +#include "include/network.h" + +ConnectionStatus connection_status = DISCONNECTED; +WifiScanData *wifiScanData = NULL; +ConnectionData *connection_data = CONNECTION_STATUS_START_ADDRESS; +__uint16_t previous_connection_status = NOT_SUPPORTED; // Assuming first status is no hardware found for networking +; + +static void read_networks_from_memory(char *ssids, WifiNetworkInfo networks[], __uint16_t total_size) +{ + char *current_ssid_position = ssids; + + for (__uint16_t i = 0; i < total_size; i++) + { + size_t ssid_len = strlen(networks[i].ssid); + memcpy(current_ssid_position, networks[i].ssid, ssid_len); + current_ssid_position[ssid_len] = '\0'; // Null terminate the copied string + current_ssid_position += ssid_len + 1; // Move to the next position, taking into account the null terminator + } + current_ssid_position[0] = '\0'; // Null terminate the list of ssids +} + +static __uint8_t get_network_count(char *file_array) +{ + __uint8_t count = 0; + char *current_ptr = file_array; + + while (*current_ptr) + { // as long as we don't hit the double null terminator + count++; + + // skip past the current filename to the next + while (*current_ptr) + current_ptr++; + current_ptr++; // skip the null terminator for the current filename + } + + return count; +} + +__uint16_t get_connection_status(bool show_bar) +{ + if (connection_data != NULL) + { + previous_connection_status = connection_data->status; + } + send_command(GET_IP_DATA, NULL, (__uint16_t)0); + + locate(0, 24); + please_wait_silent(1); + locate(0, 24); + + if (show_bar && (connection_data->status != NOT_SUPPORTED)) + { + char buffer[128]; + char *status_str = "Disconnected"; + switch (connection_data->status) + { + case DISCONNECTED: + status_str = "Disconnected"; + break; + case CONNECTING: + status_str = "Connecting..."; + break; + case CONNECTED_WIFI: + status_str = "Wi-Fi only, no IP"; + break; + case CONNECTED_WIFI_NO_IP: + status_str = "Wi-Fi only, no IP"; + break; + case CONNECTED_WIFI_IP: + status_str = "Connected"; + break; + case TIMEOUT_ERROR: + status_str = "Timeout!"; + break; + case GENERIC_ERROR: + status_str = "Error!"; + break; + case NO_DATA_ERROR: + status_str = "No data!"; + break; + case NOT_PERMITTED_ERROR: + status_str = "Not permitted!"; + break; + case INVALID_ARG_ERROR: + status_str = "Invalid args!"; + break; + case IO_ERROR: + status_str = "IO error!"; + break; + case BADAUTH_ERROR: + status_str = "Bad auth!"; + break; + case CONNECT_FAILED_ERROR: + status_str = "Connect failed!"; + break; + case INSUFFICIENT_RESOURCES_ERROR: + status_str = "No resources!"; + break; + case NOT_SUPPORTED: + status_str = "Networking not supported!"; + break; + } + bool conn_state_changed = !(previous_connection_status == connection_data->status); + if (conn_state_changed) + { + sprintf(buffer, "IP: %s | SSID: %s | Status: %s", + connection_data->ipv4_address, connection_data->ssid, + status_str); + printf("\033p"); + for (int i = 0; i < (80 - strlen(buffer)) / 2; i++) + { + printf(" "); + } + printf(buffer); + for (int i = 0; i < (80 - strlen(buffer)) / 2; i++) + { + printf(" "); + } + printf("\033q"); + } + } + return connection_data->status; +} + +__uint8_t network_selector() +{ + PRINT_APP_HEADER(VERSION); + + printf("\r\n"); + + send_command(LAUNCH_SCAN_NETWORKS, NULL, (__uint16_t)0); + + please_wait("Scanning the network...", NETWORK_WAIT_TIME); + + send_command(GET_SCANNED_NETWORKS, NULL, (__uint16_t)0); + + please_wait("\n\033KRetrieving networks...", WAIT_TIME); + + printf("\r\n"); + + int num_networks = -1; + __uint32_t network_list_mem = NETWORK_START_ADDRESS; + +#ifdef _DEBUG + printf("Reading network list from memory address: 0x%08X\r\n", network_list_mem); +#endif + WifiScanData *wifiScanDataBuff = network_list_mem; + char *network_array = malloc(MAX_SSID_LENGTH * wifiScanDataBuff->count + 1); + read_networks_from_memory(network_array, wifiScanDataBuff->networks, wifiScanDataBuff->count); + + if (!network_array) + { + printf("No networks found!\r\n"); + printf("Press any key to exit...\r\n"); + // Back to main menu + return 0; // 0 is go to menu + } + + __int16_t network_number = display_paginated_content(network_array, get_network_count(network_array), ELEMENTS_PER_PAGE, "Networks"); + + if (network_number <= 0) + { + // Back to main menu + return 0; // 0 is go to menu + } + + locate(0, 22); + + printf("\033KSelected network: %s\r\n", wifiScanDataBuff->networks[network_number - 1].ssid); + printf("\033KPlease enter the password of the network:"); + + char password[MAX_SSID_LENGTH] = {0}; + + if (wifiScanDataBuff->networks[network_number - 1].auth_mode > 0) + { + // Read the password + scanf("%31s", password); // Read up to 31 characters, leaving room for the null terminator + printf("\033KPassword:%s", password); + } + + // NOT WORKING. NEED TO FIX + WifiNetworkAuthInfo network_auth_info; + // Copy ssid and auth_mode from the selected network + strcpy(network_auth_info.ssid, wifiScanDataBuff->networks[network_number - 1].ssid); + network_auth_info.auth_mode = wifiScanDataBuff->networks[network_number - 1].auth_mode; + strcpy(network_auth_info.password, password); + + send_command(CONNECT_NETWORK, &network_auth_info, sizeof(network_auth_info)); + + printf("\r\n\033KROM network loaded. "); + + free(network_array); + + return 1; // Positive is OK +} + +__uint8_t roms_from_network_selector() +{ + PRINT_APP_HEADER(VERSION); + + printf("\r\n"); + + int retries = 5; // for example + bool command_executed = false; + int num_files = -1; + __uint16_t *ptr; + __uint16_t *network_file_list_mem = (__uint16_t *)NETWORK_FILE_LIST_START_ADDRESS; + + while (!command_executed && retries > 0) + { + send_command(GET_ROMS_JSON_FILE, NULL, (__uint16_t)0); + please_wait("Getting ROMs list...", ROMS_JSON_WAIT_TIME); + + __uint32_t sum = 0; + ptr = network_file_list_mem; + for (int i = 0; i < EXCHANGE_BUFFER_SIZE / 2; i++) + { + sum += *ptr++; + } + + command_executed = (sum != 0); + retries--; + } + + printf("\r\n"); + + if (!command_executed) + { + printf("All values are zero. Command not executed!\r\n"); + } + else if (retries == 0) + { + printf("Max retries reached without success.\r\n"); + } + +#ifdef _DEBUG + printf("Reading file list from memory address: 0x%08X\r\n", network_file_list_mem); +#endif + char *file_array = read_files_from_memory((__uint8_t *)network_file_list_mem); + + if ((!file_array) || (!command_executed) || (retries == 0)) + { + printf("No files found. Check if your network connection is working!\r\n"); + printf("Press any key to exit...\r\n"); + // Back to main menu + return 0; // 0 is go to menu + } + __int16_t rom_number = display_paginated_content(file_array, get_file_count(file_array), ELEMENTS_PER_PAGE, "ROM images"); + + if (rom_number <= 0) + { + // Back to main menu + return 0; // 0 is go to menu + } + + locate(0, 22); + + printf("\033KSelected the ROM file: %d. ", rom_number); + + print_file_at_index(file_array, rom_number - 1, 0); + + send_command(DOWNLOAD_ROM, &rom_number, 2); + + printf("\033KROM file downloaded. "); + + return 1; // Positive is OK +} \ No newline at end of file From ce4d3a3787f5db138ae73ced766648614d3ef096 Mon Sep 17 00:00:00 2001 From: Diego Parrilla Date: Wed, 13 Sep 2023 13:49:02 +0200 Subject: [PATCH 5/6] Rename to SIDECART.TOS --- configurator/Makefile | 18 +++++++++++------- src/main.s | 6 +++--- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/configurator/Makefile b/configurator/Makefile index 208b7f2..e74fea1 100644 --- a/configurator/Makefile +++ b/configurator/Makefile @@ -6,7 +6,7 @@ ODIR = ./obj SOURCES_DIR = ./src BUILD_DIR = ./build DIST_DIR = ./dist -EXE = ROMLOAD.TOS +EXE = SIDECART.TOS # VASM PARAMETERS # _DEBUG: 1 to enable debug, 0 to disable them @@ -52,12 +52,12 @@ prepare: clean clean-compile : clean main.o screen.o # All C files -main.o: prepare - $(CC) $(CFLAGS) $(SOURCES_DIR)/main.c -o $(BUILD_DIR)/main.o - screen.o: prepare $(CC) $(CFLAGS) $(SOURCES_DIR)/screen.c -o $(BUILD_DIR)/screen.o +helper.o: prepare + $(CC) $(CFLAGS) $(SOURCES_DIR)/helper.c -o $(BUILD_DIR)/helper.o + romselector.o: prepare $(CC) $(CFLAGS) $(SOURCES_DIR)/romselector.c -o $(BUILD_DIR)/romselector.o @@ -67,16 +67,20 @@ config.o: prepare reset.o: prepare $(CC) $(CFLAGS) $(SOURCES_DIR)/reset.c -o $(BUILD_DIR)/reset.o -helper.o: prepare - $(CC) $(CFLAGS) $(SOURCES_DIR)/helper.c -o $(BUILD_DIR)/helper.o +network.o: prepare + $(CC) $(CFLAGS) $(SOURCES_DIR)/network.c -o $(BUILD_DIR)/network.o + +main.o: prepare + $(CC) $(CFLAGS) $(SOURCES_DIR)/main.c -o $(BUILD_DIR)/main.o -main: main.o screen.o romselector.o config.o reset.o helper.o +main: screen.o helper.o network.o config.o reset.o romselector.o main.o $(CC) $(LIBCMINI)/lib/crt0.o \ $(BUILD_DIR)/screen.o \ $(BUILD_DIR)/romselector.o \ $(BUILD_DIR)/config.o \ $(BUILD_DIR)/reset.o \ $(BUILD_DIR)/helper.o \ + $(BUILD_DIR)/network.o \ $(BUILD_DIR)/main.o \ -o $(BUILD_DIR)/$(EXE) $(LINKFLAGS); diff --git a/src/main.s b/src/main.s index 7233522..3e7b35d 100644 --- a/src/main.s +++ b/src/main.s @@ -36,7 +36,7 @@ first: dc.w GEMDOS_TIME ;time dc.w GEMDOS_DATE ;date dc.l run_configurator - pre_auto - dc.b "AUTOFIRM",0 + dc.b "AUTO",0 even second: @@ -46,7 +46,7 @@ second: dc.w GEMDOS_TIME ;time dc.w GEMDOS_DATE ;date dc.l end_configurator - configurator - dc.b "ROMLOAD.TOS",0 + dc.b "SIDECART.TOS",0 even @@ -183,7 +183,7 @@ run_configurator: even configurator: - incbin configurator/dist/ROMLOAD.TOS + incbin configurator/dist/SIDECART.TOS even end_configurator: From 5637675aaa08d76d8b50c31847e5490a9babf279 Mon Sep 17 00:00:00 2001 From: Diego Parrilla Date: Wed, 13 Sep 2023 13:49:12 +0200 Subject: [PATCH 6/6] Bump to version 0.0.8 --- version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.txt b/version.txt index 5a5831a..d169b2f 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.0.7 +0.0.8