Okay, this stuff looks strange, but it is here to encourage people who * port UAE to re-use as much of this code as possible. Functions that you * should be using are do_start_program () and do_leave_program (), as well * as real_main (). Some OSes don't call main () (which is braindamaged IMHO, * but unfortunately very common), so you need to call real_main () from * whatever entry point you have
| 1541 | * Add #ifdefs around these as appropriate. |
| 1542 | */ |
| 1543 | static void do_start_program () |
| 1544 | { |
| 1545 | if (quit_program == -UAE_QUIT) |
| 1546 | return; |
| 1547 | /* Do a reset on startup. Whether this is elegant is debatable. */ |
| 1548 | inputdevice_updateconfig (&changed_prefs, &currprefs); |
| 1549 | if (quit_program >= 0) |
| 1550 | quit_program = UAE_RESET; |
| 1551 | #ifdef WITH_LUA |
| 1552 | uae_lua_loadall (); |
| 1553 | #endif |
| 1554 | try |
| 1555 | { |
| 1556 | emulating = 1; |
| 1557 | m68k_go (1); |
| 1558 | } |
| 1559 | catch (...) |
| 1560 | { |
| 1561 | write_log("An exception was thrown while running m68k_go!\n"); |
| 1562 | } |
| 1563 | } |
| 1564 | |
| 1565 | static void start_program () |
| 1566 | { |
no test coverage detected