--debug-opcodes actually prints out all instructions executed

This commit is contained in:
Gwenhael Le Moine 2024-10-10 16:28:18 +02:00
parent 90b23a8613
commit 2076cfd1c9
No known key found for this signature in database
GPG key ID: FDFE3669426707A7
4 changed files with 8 additions and 10 deletions

View file

@ -2057,7 +2057,7 @@ static void ExecGroup_80( void )
case 0xB: /* BUSCC */
debug1( CPU_CHF_MODULE_ID, DEBUG_C_TRACE, CPU_I_CALLED, "ExecBUSCC" );
// FIXME: 49g bugs here on display change
DEBUG_print_cpu_instruction();
// DEBUG_print_cpu_instruction();
ChfGenerate( CPU_CHF_MODULE_ID, __FILE__, __LINE__, CPU_F_INTERR, CHF_WARNING, "BUSCC" );
ChfSignal( CPU_CHF_MODULE_ID );
@ -2818,7 +2818,7 @@ void DEBUG_print_cpu_instruction( void )
/* Dump PC and current instruction */
( void )Disassemble( cpu_status.PC, dob );
fprintf( stderr, "\n%s\n\n", dob );
fprintf( stderr, "%s\n", dob );
}
}
@ -2853,6 +2853,7 @@ void OneStep( void )
Address offset;
debug1( CPU_CHF_MODULE_ID, DEBUG_C_TRACE, CPU_I_EXECUTING, cpu_status.PC );
DEBUG_print_cpu_instruction();
/* Get first instruction nibble */
n = GetNibble( cpu_status.PC++ );

View file

@ -201,9 +201,8 @@ void ModSelectDescription( int model )
ModRegisterDescription( hw49_description );
break;
default:
/* ChfGenerate( MOD_CHF_MODULE_ID, __FILE__, __LINE__, MOD_E_NO_MATCH, CHF_ERROR, config.hw ); */
/* ChfSignal( MOD_CHF_MODULE_ID ); */
fprintf( stderr, "Error: Unknown model %i\n", model );
ChfGenerate( MOD_CHF_MODULE_ID, __FILE__, __LINE__, MOD_E_NO_MATCH, CHF_ERROR, "Unknown model" );
ChfSignal( MOD_CHF_MODULE_ID );
exit( EXIT_FAILURE );
}
}

View file

@ -1251,7 +1251,7 @@ void ModConfig( Address config_info )
if ( mod == N_MOD ) {
/* All modules are configured - Signal a warning */
// FIXME: 48gx bugs here when running VERSION
DEBUG_print_cpu_instruction();
// DEBUG_print_cpu_instruction();
ChfGenerate( MOD_CHF_MODULE_ID, __FILE__, __LINE__, MOD_W_BAD_CONFIG, CHF_WARNING, config_info );
ChfSignal( MOD_CHF_MODULE_ID );

View file

@ -144,9 +144,7 @@ void RomInit( void )
}
if ( ReadNibblesFromFile( config.rom_file_name, N_ROM_SIZE, mod_status_rom ) ) {
/* ChfGenerate( MOD_CHF_MODULE_ID, __FILE__, __LINE__, MOD_F_ROM_INIT, CHF_FATAL ); */
/* ChfSignal( MOD_CHF_MODULE_ID ); */
// HACK: To load 48SX ROM, try again with half the size this time.
// To load 48SX ROM, try again with half the size this time.
if ( ReadNibblesFromFile( config.rom_file_name, N_ROM_SIZE / 2, mod_status_rom ) ) {
ChfGenerate( MOD_CHF_MODULE_ID, __FILE__, __LINE__, MOD_F_ROM_INIT, CHF_FATAL );
ChfSignal( MOD_CHF_MODULE_ID );
@ -233,7 +231,7 @@ void RomWrite( Address rel_address, Nibble datum )
debug1( MOD_CHF_MODULE_ID, DEBUG_C_TRACE, MOD_I_CALLED, "RomWrite" );
// FIXME: 48gx: saturn48gx-Mid <12>d (src/romram.c,235)-E-Write into ROM A[1B632] D[9]
DEBUG_print_cpu_instruction();
// DEBUG_print_cpu_instruction();
ChfGenerate( MOD_CHF_MODULE_ID, __FILE__, __LINE__, MOD_E_ROM_WRITE, CHF_ERROR, rel_address, datum );
ChfSignal( MOD_CHF_MODULE_ID );