diff --git a/CMakeLists.txt b/CMakeLists.txt index 0e8e3e7..00ecbca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,7 +30,7 @@ set(PROJECT_NAME usbsidpico) set(PROJECT_MANUFACTURER "LouD") set(PRODUCT_STRING "USBSID-Pico") string(TIMESTAMP MAGIC_SMOKE "%Y%m%d") # Auto generate dated version -set(PROJECT_VERSION "0.6.1-BETA.${MAGIC_SMOKE}") # Generate compile version +set(PROJECT_VERSION "0.6.2-BETA.${MAGIC_SMOKE}") # Generate compile version ### Want a cookie? # NOTICE: ENABLING THESE DEBUGGING DEFINITIONS WILL HAVE SIGNIFICANT IMPACT AND WILL DELAY PLAYING! @@ -99,11 +99,11 @@ endif() # remember that enabling debugging and disabling optimizations # will weird out tune playing and reading from and writing to # SKPico will stop functioning -# *3 is required for onboard siplayer but can cause desync +# *3 is required for onboard siplayer but could cause desync # with DMA read_address and chain_to() set(DEBUG_SYMBOLS 0) # 0 default, 1 debug symbols & debug build enabled set(DEBUGGING 0) # 0 default, 1~3 equals -g1~3 -set(OPTIMIZATIONS 3) # 2 default, 2 ~ -O1 for debugging +set(OPTIMIZATIONS 3) # 3 default, 3 ~ -O1 for debugging set(WARNINGS_ONLY 0) # 0 default, 0 error on warnings set(TUSB_DEBUG 0) # 0 default, 0~3 non verbose to very verbose set(ANALYSE_STACKUSAGE 0) # 0 default, 1 enabled, 0 disabled diff --git a/examples/config-tool/cfg_usbsid b/examples/config-tool/cfg_usbsid index fb69c88..1205770 100755 Binary files a/examples/config-tool/cfg_usbsid and b/examples/config-tool/cfg_usbsid differ diff --git a/examples/config-tool/cfg_usbsid.c b/examples/config-tool/cfg_usbsid.c index f725c47..1f481c4 100644 --- a/examples/config-tool/cfg_usbsid.c +++ b/examples/config-tool/cfg_usbsid.c @@ -1438,6 +1438,7 @@ void print_help(void) printf(" -defaults,--config-defaults : Reset USBSID-Pico config to defaults\n"); printf(" Add optional positional argument `1` to reboot USBSID-Pico afterwards\n"); printf("--[PRESETS]---------------------------------------------------------------------------------------------------------\n"); + printf(" -flip, --flip-sockets : Flip sockets SocketOne becomes SocketTwo, SocketTwo becomes SocketOne\n"); printf(" (add '-q' before any of the preset commands for a quick change and apply the config without saving and rebooting)\n"); printf(" -single, --single-sid : Socket 1 enabled @ single SID, Socket 2 disabled\n"); printf(" -single2, --single-sid-s2 : Socket 1 disabled, Socket 2 enabled @ single SID\n"); @@ -1630,6 +1631,11 @@ void config_usbsidpico(int argc, char **argv) write_config_command(MIRRORED_SID, quickchange, 0 ,0 ,0); goto exit; } + if (!strcmp(argv[param_count], "-flip") || !strcmp(argv[param_count], "--flip-sockets")) { + printf("Set USBSID-Pico config to flip sockets One <-> Two\n"); + write_config_command(FLIP_SOCKETS, 0, 0 ,0 ,0); + goto exit; + } if (!strcmp(argv[param_count], "-r") || !strcmp(argv[param_count], "--read-config")) { if (debug == 1) { diff --git a/examples/config-tool/cfg_usbsid.h b/examples/config-tool/cfg_usbsid.h index 3400980..a267c13 100644 --- a/examples/config-tool/cfg_usbsid.h +++ b/examples/config-tool/cfg_usbsid.h @@ -85,6 +85,7 @@ enum MIRRORED_SID = 0x45, /* Socket Two is linked to Socket One */ DUAL_SOCKET1 = 0x46, /* Two SID's in socket One, Socket Two disabled */ DUAL_SOCKET2 = 0x47, /* Two SID's in socket Two, Socket One disabled */ + FLIP_SOCKETS = 0x48, /* Socket Two is Socket One and vice versa */ SET_CLOCK = 0x50, /* Change SID clock frequency by array id */ DETECT_SIDS = 0x51, /* Try to detect the SID types per socket */ diff --git a/src/config_logging.c b/src/config_logging.c index ccc6a82..869c955 100644 --- a/src/config_logging.c +++ b/src/config_logging.c @@ -94,7 +94,7 @@ void print_cfg_addr(void) void print_pico_features(void) { - usCFG("\n[START PRINT PICO DEFAULT FEATURES]\n"); + usCFG("[START PRINT PICO DEFAULT FEATURES]\n"); usCFG("PICO_PIO_VERSION = %d\n", PICO_PIO_VERSION); /* pio.h */ #if defined(PICO_DEFAULT_LED_PIN) diff --git a/src/config_socket.c b/src/config_socket.c index b1ced6b..aeb1fc9 100644 --- a/src/config_socket.c +++ b/src/config_socket.c @@ -32,15 +32,18 @@ #include "logging.h" -/* Config */ +/* config. */ extern void save_load_apply_config(bool at_boot, bool print_cfg); extern Config usbsid_config; extern RuntimeCFG cfg; -/* Config bus */ +/* config_bus.c */ extern void apply_bus_config(bool quiet); extern uint8_t sidaddr_default[4]; +/* sid.c */ +extern void reset_sid_registers(void); + /* Pre declarations */ void apply_socket_change(bool quiet); @@ -330,6 +333,8 @@ void flip_sockets(void) usbsid_config.socketTwo.sid2.addr = sidaddr_default[ids[1]]; extern void apply_bus_config(bool quiet); apply_bus_config(false); + /* Reset SID registers after fiddling with the socket configuration */ + reset_sid_registers(); return; } @@ -423,6 +428,8 @@ void set_socket_config(uint8_t cmd, bool s1en, bool s1dual, uint8_t s1chip, bool } else if (cmd == 1) { apply_socket_change(false); } + /* Reset SID registers after fiddling with the socket configuration */ + reset_sid_registers(); return; }