Move to HAVE_SSNES_MAIN_WRAP for Wii

This commit is contained in:
Twinaphex 2012-04-13 23:16:51 +02:00
parent 1193d41360
commit 6fb2f9b161
3 changed files with 15 additions and 5 deletions

View File

@ -37,7 +37,7 @@ ifeq ($(HAVE_FILE_LOGGER), 1)
CFLAGS += -DHAVE_FILE_LOGGER
endif
CFLAGS += -std=gnu99 -DSSNES_CONSOLE -DHAVE_CONFIGFILE=1 -DGEKKO -DHW_RVL -DHAVE_ZLIB -DHAVE_GETOPT_LONG -DHAVE_FREETYPE -DPACKAGE_VERSION=\"0.9.5\" -Dmain=ssnes_main -Wno-char-subscripts -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT)
CFLAGS += -std=gnu99 -DSSNES_CONSOLE -DHAVE_CONFIGFILE=1 -DGEKKO -DHW_RVL -DHAVE_ZLIB -DHAVE_SSNES_MAIN_WRAP -DHAVE_GETOPT_LONG -DHAVE_FREETYPE -DPACKAGE_VERSION=\"0.9.5\" -Dmain=ssnes_main -Wno-char-subscripts -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT)
ifeq ($(DEBUG), 1)
CFLAGS += -O0 -g

View File

@ -609,6 +609,7 @@ void ssnes_startup (const char * config_path)
#endif
int init_ret = ssnes_main_init_wrap(&args);
(void)init_ret;
g_console.emulator_initialized = 1;
g_console.initialize_ssnes_enable = 0;
}

View File

@ -145,12 +145,21 @@ int main(void)
int ret = 0;
while ((rom_path = get_rom_path(sgui)) && ret == 0)
{
char *argv[] = { strdup("ssnes"), strdup(rom_path), NULL };
ret = ssnes_main(sizeof(argv) / sizeof(argv[0]) - 1, argv);
free(argv[0]);
free(argv[1]);
g_console.initialize_ssnes_enable = true;
strlcpy(g_console.rom_path, rom_path, sizeof(g_console.rom_path));
ssnes_startup(NULL);
bool repeat = false;
input_wii.poll(NULL);
do{
repeat = ssnes_main_iterate();
}while(repeat && !g_console.frame_advance_enable);
}
if(g_console.emulator_initialized)
ssnes_main_deinit();
wii_input_deinit();
wii_video_deinit();