From 5f157440e7cb57f075b4a24fe1c07a68e2b8900a Mon Sep 17 00:00:00 2001 From: Gwenhael Le Moine Date: Sat, 19 Oct 2024 09:52:10 +0200 Subject: [PATCH] runtime --implement-BUSCC param, remove accidental trigraph ??> --- src/cpu.c | 29 ++++++++++++++--------------- src/ui4x/config.c | 7 +++++++ src/ui4x/config.h | 1 + 3 files changed, 22 insertions(+), 15 deletions(-) diff --git a/src/cpu.c b/src/cpu.c index 8cf06d2..8258140 100644 --- a/src/cpu.c +++ b/src/cpu.c @@ -1920,7 +1920,7 @@ static void ExecGroup_80B0( void ) case 0xe: case 0xf: cpu_status.PC--; - debug1( CPU_CHF_MODULE_ID, DEBUG_C_IMPLEMENTATION, CPU_I_CALLED, "Not implemented: " ); + debug1( CPU_CHF_MODULE_ID, DEBUG_C_IMPLEMENTATION, CPU_I_CALLED, "Not implemented: < ?opcode? >" ); break; default: @@ -1969,7 +1969,7 @@ static void ExecGroup_80B1( void ) case 0xe: case 0xf: cpu_status.PC--; - debug1( CPU_CHF_MODULE_ID, DEBUG_C_IMPLEMENTATION, CPU_I_CALLED, "Not implemented: " ); + debug1( CPU_CHF_MODULE_ID, DEBUG_C_IMPLEMENTATION, CPU_I_CALLED, "Not implemented: < ?opcode? >" ); break; default: @@ -2021,7 +2021,7 @@ static void ExecGroup_80B2( void ) case 0xd: case 0xf: cpu_status.PC--; - debug1( CPU_CHF_MODULE_ID, DEBUG_C_IMPLEMENTATION, CPU_I_CALLED, "Not implemented: " ); + debug1( CPU_CHF_MODULE_ID, DEBUG_C_IMPLEMENTATION, CPU_I_CALLED, "Not implemented: < ?opcode? >" ); break; default: @@ -2075,7 +2075,7 @@ static void ExecGroup_80B3( void ) case 0xe: case 0xf: cpu_status.PC--; - debug1( CPU_CHF_MODULE_ID, DEBUG_C_IMPLEMENTATION, CPU_I_CALLED, "Not implemented: " ); + debug1( CPU_CHF_MODULE_ID, DEBUG_C_IMPLEMENTATION, CPU_I_CALLED, "Not implemented: < ?opcode? >" ); break; default: @@ -2118,7 +2118,7 @@ static void ExecGroup_80B4( void ) case 0xe: case 0xf: cpu_status.PC--; - debug1( CPU_CHF_MODULE_ID, DEBUG_C_IMPLEMENTATION, CPU_I_CALLED, "Not implemented: " ); + debug1( CPU_CHF_MODULE_ID, DEBUG_C_IMPLEMENTATION, CPU_I_CALLED, "Not implemented: < ?opcode? >" ); break; default: @@ -2161,7 +2161,7 @@ static void ExecGroup_80B5( void ) case 0xe: case 0xf: cpu_status.PC--; - debug1( CPU_CHF_MODULE_ID, DEBUG_C_IMPLEMENTATION, CPU_I_CALLED, "Not implemented: " ); + debug1( CPU_CHF_MODULE_ID, DEBUG_C_IMPLEMENTATION, CPU_I_CALLED, "Not implemented: < ?opcode? >" ); break; default: @@ -2204,7 +2204,7 @@ static void ExecGroup_80B6( void ) case 0xe: case 0xf: cpu_status.PC--; - debug1( CPU_CHF_MODULE_ID, DEBUG_C_IMPLEMENTATION, CPU_I_CALLED, "Not implemented: " ); + debug1( CPU_CHF_MODULE_ID, DEBUG_C_IMPLEMENTATION, CPU_I_CALLED, "Not implemented: < ?opcode? >" ); break; default: @@ -2243,7 +2243,7 @@ static void ExecGroup_80B7( void ) case 0xd: case 0xe: cpu_status.PC--; - debug1( CPU_CHF_MODULE_ID, DEBUG_C_IMPLEMENTATION, CPU_I_CALLED, "Not implemented: " ); + debug1( CPU_CHF_MODULE_ID, DEBUG_C_IMPLEMENTATION, CPU_I_CALLED, "Not implemented: < ?opcode? >" ); break; default: @@ -2300,7 +2300,7 @@ static void ExecGroup_80B8( void ) case 0xe: case 0xf: cpu_status.PC--; - debug1( CPU_CHF_MODULE_ID, DEBUG_C_IMPLEMENTATION, CPU_I_CALLED, "Not implemented: " ); + debug1( CPU_CHF_MODULE_ID, DEBUG_C_IMPLEMENTATION, CPU_I_CALLED, "Not implemented: < ?opcode? >" ); break; default: @@ -2337,7 +2337,7 @@ static void ExecGroup_80B9( void ) case 0xe: case 0xf: cpu_status.PC--; - debug1( CPU_CHF_MODULE_ID, DEBUG_C_IMPLEMENTATION, CPU_I_CALLED, "Not implemented: " ); + debug1( CPU_CHF_MODULE_ID, DEBUG_C_IMPLEMENTATION, CPU_I_CALLED, "Not implemented: < ?opcode? >" ); break; default: @@ -2376,7 +2376,7 @@ static void ExecGroup_80BE( void ) case 0xc: case 0xd: cpu_status.PC--; - debug1( CPU_CHF_MODULE_ID, DEBUG_C_IMPLEMENTATION, CPU_I_CALLED, "Not implemented: " ); + debug1( CPU_CHF_MODULE_ID, DEBUG_C_IMPLEMENTATION, CPU_I_CALLED, "Not implemented: < ?opcode? >" ); break; default: @@ -2413,7 +2413,7 @@ static void ExecGroup_80BF( void ) case 0xd: case 0xe: cpu_status.PC--; - debug1( CPU_CHF_MODULE_ID, DEBUG_C_IMPLEMENTATION, CPU_I_CALLED, "Not implemented: " ); + debug1( CPU_CHF_MODULE_ID, DEBUG_C_IMPLEMENTATION, CPU_I_CALLED, "Not implemented: < ?opcode? >" ); break; default: @@ -2426,8 +2426,7 @@ static void ExecGroup_80BF( void ) static void ExecGroup_80B( void ) { - bool enable_BUSCC = false; - if ( enable_BUSCC ) { + if ( config.implement_BUSCC ) { Nibble n = FetchNibble( cpu_status.PC++ ); debug1( CPU_CHF_MODULE_ID, DEBUG_C_TRACE, CPU_I_CALLED, "ExecGroup_80B" ); @@ -2474,7 +2473,7 @@ static void ExecGroup_80B( void ) case 0xC: case 0xD: cpu_status.PC--; - debug1( CPU_CHF_MODULE_ID, DEBUG_C_IMPLEMENTATION, CPU_I_CALLED, "Not implemented: " ); + debug1( CPU_CHF_MODULE_ID, DEBUG_C_IMPLEMENTATION, CPU_I_CALLED, "Not implemented: < ?opcode? >" ); break; default: diff --git a/src/ui4x/config.c b/src/ui4x/config.c index 49cca55..b362558 100644 --- a/src/ui4x/config.c +++ b/src/ui4x/config.c @@ -51,6 +51,7 @@ static config_t config = { .state_dir_path = ( char* )".", .debug_level = DEBUG_C_NONE, + .implement_BUSCC = false, }; lua_State* config_lua_values; @@ -223,6 +224,8 @@ config_t* config_init( int argc, char* argv[] ) int clopt_reset = -1; int clopt_monitor = -1; /* int clopt_batchXfer = -1; */ + int clopt_implement_BUSCC = -1; + char* clopt_state_dir_path = ( char* )"."; const char* optstring = "h"; @@ -272,6 +275,8 @@ config_t* config_init( int argc, char* argv[] ) {"debug-modules", no_argument, NULL, 38611 }, {"debug-trace", no_argument, NULL, 38612 }, + {"implement-BUSCC", no_argument, &clopt_implement_BUSCC, true }, + {0, 0, 0, 0 } }; @@ -512,6 +517,8 @@ config_t* config_init( int argc, char* argv[] ) config.monitor = clopt_monitor; /* if ( clopt_batchXfer != -1 ) */ /* config.batchXfer = clopt_batchXfer; */ + if ( clopt_implement_BUSCC != -1 ) + config.implement_BUSCC = clopt_implement_BUSCC; if ( config.model == MODEL_49G ) config.black_lcd = true; diff --git a/src/ui4x/config.h b/src/ui4x/config.h index dc16ea8..aa63d88 100644 --- a/src/ui4x/config.h +++ b/src/ui4x/config.h @@ -51,6 +51,7 @@ typedef struct { char* port_2_file_name; int debug_level; + bool implement_BUSCC; } config_t; /*************/