inline DEBUG_print_cpu_instruction()

This commit is contained in:
Gwenhael Le Moine 2024-10-20 15:16:00 +02:00
parent 0c2d2fd050
commit feac83a2aa
No known key found for this signature in database
GPG key ID: FDFE3669426707A7
4 changed files with 9 additions and 20 deletions

View file

@ -3240,17 +3240,6 @@ void DumpCpuStatus( char ob[ DUMP_CPU_STATUS_OB_SIZE ] )
ob += strlen( ob );
}
void DEBUG_print_cpu_instruction( void )
{
if ( config.debug_level > 0 && config.debug_level & DEBUG_C_OPCODES ) {
char dob[ DISASSEMBLE_OB_SIZE ];
/* Dump PC and current instruction */
( void )Disassemble( cpu_status.PC, dob );
fprintf( stderr, "%s\n", dob );
}
}
/* .+
.title : OneStep
@ -3279,13 +3268,18 @@ void DEBUG_print_cpu_instruction( void )
void OneStep( void )
{
debug1( CPU_CHF_MODULE_ID, DEBUG_C_TRACE, CPU_I_EXECUTING, cpu_status.PC );
DEBUG_print_cpu_instruction();
Nibble n;
if ( config.debug_level > 0 && config.debug_level & DEBUG_C_OPCODES ) {
char dob[ DISASSEMBLE_OB_SIZE ];
/* Dump PC and current instruction */
( void )Disassemble( cpu_status.PC, dob );
fprintf( stderr, "%s\n", dob );
}
Address offset;
/* Get first instruction nibble */
n = FetchNibble( cpu_status.PC++ );
Nibble n = FetchNibble( cpu_status.PC++ );
switch ( n ) {
case 0x0: /* Group_0 */

View file

@ -337,6 +337,5 @@ bool CpuHaltAllowed( void ); /* 3.13 */
Address Disassemble( Address pc, char ob[ DISASSEMBLE_OB_SIZE ] ); /* dis.c */
void DumpCpuStatus( char ob[ DUMP_CPU_STATUS_OB_SIZE ] );
void DEBUG_print_cpu_instruction( void );
#endif /*!_CPU_H*/

View file

@ -1246,8 +1246,6 @@ 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();
ChfGenerate( MOD_CHF_MODULE_ID, __FILE__, __LINE__, MOD_W_BAD_CONFIG, CHF_WARNING, config_info );
ChfSignal( MOD_CHF_MODULE_ID );
} else {

View file

@ -230,8 +230,6 @@ 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();
ChfGenerate( MOD_CHF_MODULE_ID, __FILE__, __LINE__, MOD_E_ROM_WRITE, CHF_ERROR, rel_address, datum );
ChfSignal( MOD_CHF_MODULE_ID );
}