int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow) { emu_ReadConfig(0, 0); giz_init(hInstance, hPrevInstance); emu_Init(); menu_init(); engineState = PGS_Menu; for (;;) { switch (engineState) { case PGS_Menu: menu_loop(); break; case PGS_ReloadRom: if (emu_ReloadRom()) engineState = PGS_Running; else { lprintf("PGS_ReloadRom == 0\n"); engineState = PGS_Menu; } break; case PGS_RestartRun: engineState = PGS_Running; case PGS_Running: emu_Loop(); break; case PGS_Quit: goto endloop; default: lprintf("engine got into unknown state (%i), exitting\n", engineState); goto endloop; } } endloop: emu_Deinit(); giz_deinit(); return 0; }
int main(int argc, char *argv[]) { g_argv = argv; emu_ReadConfig(0, 0); gp2x_init(); if (currentConfig.EmuOpt&0x10) { int ret = mmuhack(); printf("squidge hack code finished and returned %i\n", ret); fflush(stdout); mmuhack_status = ret; } cpuctrl_init(); // Reset940(1); // Pause940(1); if (currentConfig.EmuOpt&0x100) { printf("setting RAM timings.. "); fflush(stdout); // craigix: --trc 6 --tras 4 --twr 1 --tmrd 1 --trfc 1 --trp 2 --trcd 2 set_RAM_Timings(6, 4, 1, 1, 1, 2, 2); printf("done.\n"); fflush(stdout); } emu_Init(); menu_init(); engineState = PGS_Menu; if (argc > 1) parse_cmd_line(argc, argv); for (;;) { switch (engineState) { case PGS_Menu: menu_loop(); break; case PGS_ReloadRom: if (emu_ReloadRom()) engineState = PGS_Running; else { printf("PGS_ReloadRom == 0\n"); engineState = PGS_Menu; } break; case PGS_RestartRun: engineState = PGS_Running; case PGS_Running: emu_Loop(); break; case PGS_Quit: goto endloop; default: printf("engine got into unknown state (%i), exitting\n", engineState); goto endloop; } } endloop: emu_Deinit(); cpuctrl_deinit(); gp2x_deinit(); if(mmuhack_status) mmuunhack(); return 0; }