X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=psp%2Fmain.c;h=dbe20b7c122d2b6c1352f760a2ceb07a1724e785;hb=426ecc582f3f6f3d04f7b7ae25b548be7178c4fd;hp=4f515169c32574fd0b67f49e18e20744323d5458;hpb=a6df06b7633a061862258ec47fa0f6b0efcbe26f;p=libpicofe.git diff --git a/psp/main.c b/psp/main.c index 4f51516..dbe20b7 100644 --- a/psp/main.c +++ b/psp/main.c @@ -1,3 +1,9 @@ +// (c) Copyright 2007 notaz, All rights reserved. +// Free for non-commercial use. + +// For commercial use, separate licencing terms must be obtained. + +#include #include "psp.h" #include "emu.h" #include "menu.h" @@ -7,17 +13,31 @@ #include "../common/lprintf.h" #include "version.h" -int main() +#ifdef GPROF +#include +#endif + +#ifdef GCOV +#include +#include + +void dummy(void) { - int mp3_ret; + engineState = atoi(romFileName); + setbuf(NULL, NULL); + getenv(NULL); +} +#endif +int pico_main(void) +{ lprintf("\nPicoDrive v" VERSION " " __DATE__ " " __TIME__ "\n"); psp_init(); - emu_ReadConfig(0, 0); emu_Init(); menu_init(); - mp3_ret = mp3_init(); + // moved to emu_Loop(), after CPU clock change.. + //mp3_init(); engineState = PGS_Menu; @@ -26,7 +46,12 @@ int main() switch (engineState) { case PGS_Menu: +#ifndef GPROF menu_loop(); +#else + strcpy(romFileName, currentConfig.lastRomFile); + engineState = PGS_ReloadRom; +#endif break; case PGS_ReloadRom: @@ -40,11 +65,18 @@ int main() } break; + case PGS_Suspending: + psp_wait_suspend(); + break; + case PGS_RestartRun: engineState = PGS_Running; case PGS_Running: emu_Loop(); +#ifdef GPROF + goto endloop; +#endif break; case PGS_Quit: @@ -58,9 +90,14 @@ int main() endloop: - if (mp3_ret == 0) mp3_deinit(); + mp3_deinit(); emu_Deinit(); +#ifdef GPROF + gprof_cleanup(); +#endif +#ifndef GCOV psp_finish(); +#endif return 0; }