/** fMSX: portable MSX emulator ******************************/ /** **/ /** fMSX.c **/ /** **/ /** This is the startup module that initializes PSP **/ /** libraries and starts MSX emulation **/ /** **/ /** Copyright (C) Akop Karapetyan 2007 **/ /** You are not allowed to distribute this software **/ /** commercially. Please, notify me, if you make any **/ /** changes to this file. **/ /*************************************************************/ #include #include #include #include #include "adhoc.h" #include "audio.h" #include "video.h" #include "psp.h" #include "ctrl.h" #include "file.h" #include "MSX.h" #include "MenuPsp.h" #include "Sound.h" #if (_PSP_FW_VERSION == 150) /* Kernel mode */ PSP_MODULE_INFO(PSP_APP_NAME, 0x1000, 1, 1); PSP_MAIN_THREAD_ATTR(0); #else /* User mode */ PSP_MODULE_INFO(PSP_APP_NAME, 0, 1, 1); PSP_MAIN_THREAD_ATTR(PSP_THREAD_ATTR_USER); #endif static char app_path[PSP_FILE_MAX_PATH_LEN]; static void ExitCallback(void* arg) { ExitNow = 1; ExitPSP = 1; } int user_main() { /* Initialize PSP */ pspInit(app_path); pspAudioInit(SND_BUFSIZE, 0); pspCtrlInit(); pspVideoInit(); /* Initialize callbacks */ pspRegisterCallback(PSP_EXIT_CALLBACK, ExitCallback, NULL); pspStartCallbackThread(); int i; /* MSX settings */ Verbose=0; UPeriod=100; /* Init joystick */ SETJOYTYPE(0,1&0x03); /* Init cartridges */ for (i=0; i