(PSP) Seems to finally link when libretro ports are passed -G0

to CFLAGS/CXXFLAGS as well
This commit is contained in:
twinaphex 2012-11-24 04:23:20 +01:00
parent 414a5de737
commit a783819b22
5 changed files with 100 additions and 9 deletions

View File

@ -1,11 +1,9 @@
RARCH_VERSION = "0.9.8-beta2"
TARGET = retroarch_psp
OBJS = console/griffin/griffin.o
TARGET = retroarchpsp
INCDIR =
CFLAGS = -O2 -G0 -Wall -std=gnu99
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
CFLAGS = -O2 -G0 -Wall -g -std=gnu99 -ffast-math
ASFLAGS = $(CFLAGS)
RARCH_DEFINES = -DPSP -DHAVE_DEFAULT_RETROPAD_INPUT -DRARCH_CONSOLE -DHAVE_GETOPT_LONG -DHAVE_FILEBROWSER -DHAVE_RARCH_MAIN_WRAP -DHAVE_ZLIB -DWANT_RZLIB -DHAVE_CONFIGFILE=1 -DHAVE_GRIFFIN=1 -DPACKAGE_VERSION=\"$(RARCH_VERSION)\" -Dmain=rarch_main
@ -13,10 +11,14 @@ CFLAGS += $(RARCH_DEFINES)
LIBDIR =
LDFLAGS =
#LIBS = -lpspaudiolib -lpspaudio
LIBS = -lpspgu -lpspgum -lretro_psp1 -lm
LIBS = -lretro_psp1 -lstdc++ -lpspgu -lpspgum -lm
#EXTRA_TARGETS = EBOOT.PBP
#PSP_EBOOT_TITLE = RetroArch PSP1
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = RetroArch PSP1
PSP_OBJECTS = console/griffin/griffin.o
OBJS = $(PSP_OBJECTS)
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak

View File

@ -329,6 +329,8 @@ MAIN
#include "../../gx/frontend/main.c"
#elif defined(__CELLOS_LV2__)
#include "../../ps3/frontend/main.c"
#elif defined(PSP)
#include "../../psp/frontend/main.c"
#elif defined(ANDROID)
#include "../../android/native/jni/main.c"
#endif

View File

@ -145,6 +145,8 @@ int rarch_extract_zipfile(const char *zip_path, const char *current_dir, char *f
unzFile uf = unzOpen(zip_path);
unz_global_info gi;
memset(&gi, 0, sizeof(unz_global_info));
int ret = unzGetGlobalInfo(uf, &gi);
if(ret != UNZ_OK)
RARCH_ERR("Error %d while trying to get ZIP file global info.\n", ret);

84
psp/frontend/main.c Normal file
View File

@ -0,0 +1,84 @@
/* 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);
sceDisplayWaitVblankStart();
pspDebugScreenClear();
pspDebugScreenSetXY(0, 0);
printf("RetroArch PSP test.\n");
rarch_sleep(20);
sceKernelExitGame();
return 1;
}

View File

@ -134,7 +134,8 @@ static bool psp_gfx_frame(void *data, const void *frame,
sceGuFinish();
sceDisplayWaitVblankStart();
DisplaySetFrameBuf(frame, pitch,
void *frame_ptr = &frame;
DisplaySetFrameBuf(frame_ptr, pitch,
vid->rgb32 ? PSP_DISPLAY_PIXEL_FORMAT_8888 : PSP_DISPLAY_PIXEL_FORMAT_565,
PSP_DISPLAY_SETBUF_IMMEDIATE);