Merge branch 'master' of github.com:Themaister/SSNES
This commit is contained in:
commit
ec5612a12b
12
ps3/main.c
12
ps3/main.c
|
@ -225,6 +225,8 @@ static void ingame_menu(void)
|
||||||
uint32_t menuitem_colors[MENU_ITEM_LAST];
|
uint32_t menuitem_colors[MENU_ITEM_LAST];
|
||||||
char comment[256], msg_temp[256];
|
char comment[256], msg_temp[256];
|
||||||
|
|
||||||
|
ps3_block_swap();
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
uint64_t state = cell_pad_input_poll_device(0);
|
uint64_t state = cell_pad_input_poll_device(0);
|
||||||
|
@ -481,9 +483,10 @@ static void ingame_menu(void)
|
||||||
old_state = state;
|
old_state = state;
|
||||||
cellSysutilCheckCallback();
|
cellSysutilCheckCallback();
|
||||||
}while(g_console.in_game_menu);
|
}while(g_console.in_game_menu);
|
||||||
|
|
||||||
|
ps3_unblock_swap();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Temporary, a more sane implementation should go here.
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
// Initialize 6 SPUs but reserve 1 SPU as a raw SPU for PSGL
|
// Initialize 6 SPUs but reserve 1 SPU as a raw SPU for PSGL
|
||||||
|
@ -492,9 +495,10 @@ int main(int argc, char *argv[])
|
||||||
cellSysmoduleLoadModule(CELL_SYSMODULE_FS);
|
cellSysmoduleLoadModule(CELL_SYSMODULE_FS);
|
||||||
cellSysmoduleLoadModule(CELL_SYSMODULE_SYSUTIL_GAME);
|
cellSysmoduleLoadModule(CELL_SYSMODULE_SYSUTIL_GAME);
|
||||||
|
|
||||||
memset(&g_extern, 0, sizeof(g_extern));
|
ssnes_main_clear_state();
|
||||||
memset(&g_settings, 0, sizeof(g_settings));
|
|
||||||
memset(&g_console, 0, sizeof(g_console));
|
g_console.block_config_read = true;
|
||||||
|
config_set_defaults();
|
||||||
|
|
||||||
SSNES_LOG("Registering Callback\n");
|
SSNES_LOG("Registering Callback\n");
|
||||||
cellSysutilRegisterCallback(0, callback_sysutil_exit, NULL);
|
cellSysutilRegisterCallback(0, callback_sysutil_exit, NULL);
|
||||||
|
|
|
@ -93,6 +93,7 @@ typedef struct gl
|
||||||
PSGLdevice* gl_device;
|
PSGLdevice* gl_device;
|
||||||
PSGLcontext* gl_context;
|
PSGLcontext* gl_context;
|
||||||
bool vsync;
|
bool vsync;
|
||||||
|
bool block_swap;
|
||||||
GLuint texture[TEXTURES];
|
GLuint texture[TEXTURES];
|
||||||
unsigned tex_index; // For use with PREV.
|
unsigned tex_index; // For use with PREV.
|
||||||
struct gl_tex_info prev_info[TEXTURES];
|
struct gl_tex_info prev_info[TEXTURES];
|
||||||
|
@ -723,6 +724,7 @@ static bool gl_frame(void *data, const void *frame, unsigned width, unsigned hei
|
||||||
cellDbgFontDraw();
|
cellDbgFontDraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!gl->block_swap)
|
||||||
psglSwap();
|
psglSwap();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1094,6 +1096,20 @@ const char * ps3_get_resolution_label(uint32_t resolution)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ps3_block_swap (void)
|
||||||
|
{
|
||||||
|
gl_t *gl = g_gl;
|
||||||
|
gl->block_swap = true;
|
||||||
|
SSNES_LOG("Swap is set to blocked\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
void ps3_unblock_swap (void)
|
||||||
|
{
|
||||||
|
gl_t *gl = g_gl;
|
||||||
|
gl->block_swap = false;
|
||||||
|
SSNES_LOG("Swap is set to non-blocked\n");
|
||||||
|
}
|
||||||
|
|
||||||
// PS3 needs a working graphics stack before SSNES even starts.
|
// PS3 needs a working graphics stack before SSNES even starts.
|
||||||
// To deal with this main.c,
|
// To deal with this main.c,
|
||||||
// the top level module owns the instance, and is created beforehand.
|
// the top level module owns the instance, and is created beforehand.
|
||||||
|
|
|
@ -31,6 +31,8 @@ void ps3_next_resolution (void);
|
||||||
void ps3_previous_resolution (void);
|
void ps3_previous_resolution (void);
|
||||||
const char * ps3_get_resolution_label(uint32_t resolution);
|
const char * ps3_get_resolution_label(uint32_t resolution);
|
||||||
int ps3_check_resolution(uint32_t resolution_id);
|
int ps3_check_resolution(uint32_t resolution_id);
|
||||||
|
void ps3_block_swap (void);
|
||||||
|
void ps3_unblock_swap (void);
|
||||||
|
|
||||||
extern void *g_gl;
|
extern void *g_gl;
|
||||||
|
|
||||||
|
|
3
ssnes.c
3
ssnes.c
|
@ -2065,6 +2065,9 @@ void ssnes_main_clear_state(void)
|
||||||
{
|
{
|
||||||
memset(&g_settings, 0, sizeof(g_settings));
|
memset(&g_settings, 0, sizeof(g_settings));
|
||||||
memset(&g_extern, 0, sizeof(g_extern));
|
memset(&g_extern, 0, sizeof(g_extern));
|
||||||
|
#ifdef SSNES_CONSOLE
|
||||||
|
memset(&g_console, 0, sizeof(g_console));
|
||||||
|
#endif
|
||||||
init_state();
|
init_state();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue