99 lines
2.3 KiB
C
Raw Normal View History

/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2012 - Hans-Kristian Arntzen
* Copyright (C) 2011-2012 - Daniel De Matteis
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include <pspkernel.h>
#include <pspdebug.h>
#include <stdint.h>
#include "../../boolean.h"
#include <stddef.h>
#include <string.h>
#undef main
#include "../sdk_defines.h"
PSP_MODULE_INFO("RetroArch PSP", 0, 1, 1);
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER);
PSP_HEAP_SIZE_MAX();
int rarch_main(int argc, char *argv[]);
static int exit_callback(int arg1, int arg2, void *common)
{
return 0;
}
static void get_environment_settings(int argc, char *argv[])
{
g_extern.verbose = true;
g_extern.verbose = false;
}
int callback_thread(SceSize args, void *argp)
{
int cbid = sceKernelCreateCallback("Exit callback", exit_callback, NULL);
sceKernelRegisterExitCallback(cbid);
sceKernelSleepThreadCB();
return 0;
}
static int setup_callback(void)
{
int thread_id = sceKernelCreateThread("update_thread", callback_thread, 0x11, 0xFA0, 0, 0);
if (thread_id >= 0)
sceKernelStartThread(thread_id, 0, 0);
return thread_id;
}
int main(int argc, char *argv[])
{
//initialize debug screen
pspDebugScreenInit();
pspDebugScreenClear();
setup_callback();
get_environment_settings(argc, argv);
2012-11-26 02:59:29 +01:00
#ifdef HAVE_FILE_LOGGER
log_fp = fopen("ms0:/retroarch-log.txt", "w");
#endif
g_extern.verbose = true;
RARCH_LOG("TEST...\n");
sceDisplayWaitVblankStart();
pspDebugScreenClear();
pspDebugScreenSetXY(0, 0);
2012-11-26 02:59:29 +01:00
RARCH_LOG("RetroArch PSP test.\n");
rarch_sleep(20);
2012-11-26 02:59:29 +01:00
g_extern.verbose = false;
#ifdef HAVE_FILE_LOGGER
fclose(log_fp);
#endif
sceKernelExitGame();
return 1;
}