diff --git a/src/x49gpng/main.c b/src/x49gpng/main.c index 21c1df0..6e6803d 100644 --- a/src/x49gpng/main.c +++ b/src/x49gpng/main.c @@ -129,7 +129,6 @@ uint32_t do_arm_semihosting( CPUState* env ) env->regs[ 1 ], env->regs[ 2 ], env->regs[ 3 ], env->regs[ 4 ], env->regs[ 5 ], env->regs[ 6 ], env->regs[ 7 ] ); #endif -#if 1 switch ( env->regs[ 0 ] ) { case 305: /* Beep */ printf( "%s: BEEP: frequency %u, time %u, override %u\n", __FUNCTION__, env->regs[ 1 ], env->regs[ 2 ], @@ -150,7 +149,6 @@ uint32_t do_arm_semihosting( CPUState* env ) default: break; } -#endif break; default: @@ -193,8 +191,13 @@ static void arm_sighnd( int sig ) void x49gp_gtk_timer( void* data ) { +#if GTK_MAJOR_VERSION == 4 + while ( g_main_context_pending( NULL ) ) + g_main_context_iteration( NULL, false ); +#else while ( gtk_events_pending() ) gtk_main_iteration_do( false ); +#endif x49gp_mod_timer( x49gp->gtk_timer, x49gp_get_clock() + X49GP_GTK_REFRESH_INTERVAL ); } @@ -230,7 +233,11 @@ int main( int argc, char** argv ) char* progname = g_path_get_basename( argv[ 0 ] ); char* progpath = g_path_get_dirname( argv[ 0 ] ); +#if GTK_MAJOR_VERSION == 4 + gtk_init(); +#else gtk_init( &argc, &argv ); +#endif config_init( progname, argc, argv );