reduce divergence between x11 and sdl1 in emulate.c
This commit is contained in:
parent
bfd5ef7703
commit
2b78fb7b28
1 changed files with 5 additions and 52 deletions
|
@ -2416,13 +2416,13 @@ int emulate() {
|
|||
do {
|
||||
step_instruction();
|
||||
|
||||
#if defined( GUI_IS_X11 )
|
||||
{
|
||||
int i;
|
||||
for ( i = 0; i < ( int )( sizeof( saturn.keybuf.rows ) /
|
||||
sizeof( saturn.keybuf.rows[ 0 ] ) );
|
||||
i++ ) {
|
||||
if ( saturn.keybuf.rows[ i ] || throttle ) {
|
||||
#if defined( GUI_IS_X11 )
|
||||
gettimeofday( &tv, &tz );
|
||||
while ( ( tv.tv_sec == tv2.tv_sec ) &&
|
||||
( ( tv.tv_usec - tv2.tv_usec ) < 2 ) ) {
|
||||
|
@ -2432,6 +2432,9 @@ int emulate() {
|
|||
tv2.tv_usec = tv.tv_usec;
|
||||
tv2.tv_sec = tv.tv_sec;
|
||||
break;
|
||||
#elif defined( GUI_IS_SDL1 )
|
||||
gettimeofday( &tv, NULL );
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2446,56 +2449,6 @@ int emulate() {
|
|||
schedule();
|
||||
}
|
||||
} while ( !enter_debugger );
|
||||
#endif
|
||||
#if defined( GUI_IS_SDL1 )
|
||||
int i;
|
||||
for ( i = 0;
|
||||
i < sizeof( saturn.keybuf.rows ) / sizeof( saturn.keybuf.rows[ 0 ] );
|
||||
i++ ) {
|
||||
if ( saturn.keybuf.rows[ i ] || throttle ) {
|
||||
|
||||
gettimeofday( &tv, NULL );
|
||||
|
||||
// while ((tv.tv_sec == tv2.tv_sec) && ((tv.tv_usec -
|
||||
// tv2.tv_usec) < 2))
|
||||
/*while ((tv.tv_sec == tv2.tv_sec) && ((tv.tv_usec -
|
||||
tv2.tv_usec) < 1))
|
||||
{
|
||||
gettimeofday(&tv, &tz);
|
||||
}
|
||||
tv2.tv_usec = tv.tv_usec;
|
||||
tv2.tv_sec = tv.tv_sec;*/
|
||||
|
||||
// usleep(1);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( schedule_event < 0 ) {
|
||||
// puts("bug");
|
||||
// schedule_event = 0;
|
||||
}
|
||||
if ( schedule_event-- <= 0 ) {
|
||||
schedule();
|
||||
}
|
||||
}
|
||||
while ( !enter_debugger )
|
||||
;
|
||||
|
||||
printf( "emulate: returning\n" );
|
||||
|
||||
// Version from android:
|
||||
/*
|
||||
do {
|
||||
step_instruction();
|
||||
if (schedule_event-- == 0)
|
||||
{
|
||||
schedule();
|
||||
}
|
||||
} while (!enter_debugger); // exit_state
|
||||
*/
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue