Calblack put in video_psgl.c - not sure how to use it there

This commit is contained in:
TwinAphex51224 2011-12-02 02:46:47 +01:00
parent 1356d0ab4c
commit 1cb2c60ccc
2 changed files with 37 additions and 1 deletions

View File

@ -1,12 +1,31 @@
#include <sys/process.h>
int ssnes_main(int argc, char *argv[]);
#include <sysutil/sysutil_common.h>
#include <sys/spu_initialize.h>
#include <stddef.h>
int ssnes_main(int argc, char *argv[]);
SYS_PROCESS_PARAM(1001, 0x100000)
void callback_sysutil_exit(uint64_t status, uint64_t param, void *userdata)
{
(void) param;
(void) userdata;
switch (status)
{
case CELL_SYSUTIL_REQUEST_EXITGAME:
break;
default:
break;
}
}
#undef main
// Temporary, a more sane implementation should go here.
int main(int argc, char *argv[])
{
sys_spu_initialize(4, 3);
char arg1[] = "ssnes";
char arg2[] = "/dev_hdd0/game/SNES90000/USRDIR/main.sfc";
char arg3[] = "-v";

View File

@ -1205,6 +1205,20 @@ static bool psgl_init_device(gl_t * gl, const video_info_t *video, uint32_t reso
return true;
}
void callback_sysutil_exit(uint64_t status, uint64_t param, void *userdata)
{
(void) param;
(void) userdata;
switch (status)
{
case CELL_SYSUTIL_REQUEST_EXITGAME:
gl->quitting = true;
break;
default:
break;
}
}
static void *gl_init(const video_info_t *video, const input_driver_t **input, void **input_data)
{
@ -1233,6 +1247,9 @@ static void *gl_init(const video_info_t *video, const input_driver_t **input, vo
SSNES_LOG("GL: Using resolution %ux%u\n", gl->win_width, gl->win_height);
SSNES_LOG("Registering Callback\n";
cellSysutilRegisterCallback(0, callback_sysutil_exit, NULL);
if (!gl_shader_init())
{
SSNES_ERR("Shader init failed.\n");