inline main#mainLoop
This commit is contained in:
parent
e0a789eef4
commit
98655a906f
1 changed files with 21 additions and 25 deletions
22
src/main.c
22
src/main.c
|
@ -18,10 +18,16 @@ unsigned int delay_timer1 = 16384;
|
||||||
unsigned int lastTime_timer5 = 0;
|
unsigned int lastTime_timer5 = 0;
|
||||||
unsigned int delay_timer5 = 64; // fps
|
unsigned int delay_timer5 = 64; // fps
|
||||||
|
|
||||||
static inline void mainloop()
|
int main( int argc, char* argv[] )
|
||||||
{
|
{
|
||||||
|
parse_args( argc, argv );
|
||||||
|
|
||||||
|
gui_init();
|
||||||
|
emulator_init( "rom", "ram", "port1", "port2" );
|
||||||
|
|
||||||
|
while ( !please_exit ) {
|
||||||
if ( please_exit || !SDL_ready )
|
if ( please_exit || !SDL_ready )
|
||||||
return;
|
break;
|
||||||
|
|
||||||
currentTime = SDL_GetTicks();
|
currentTime = SDL_GetTicks();
|
||||||
|
|
||||||
|
@ -38,19 +44,9 @@ static inline void mainloop()
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !gui_events() )
|
if ( !gui_events() )
|
||||||
return;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main( int argc, char* argv[] )
|
|
||||||
{
|
|
||||||
parse_args( argc, argv );
|
|
||||||
|
|
||||||
gui_init();
|
|
||||||
emulator_init( "rom", "ram", "port1", "port2" );
|
|
||||||
|
|
||||||
while ( !please_exit )
|
|
||||||
mainloop();
|
|
||||||
|
|
||||||
emulator_exit( "rom", "ram", "port1", "port2" );
|
emulator_exit( "rom", "ram", "port1", "port2" );
|
||||||
gui_exit();
|
gui_exit();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue