update core

This commit is contained in:
Logan McNaughton committed 2022-10-10 12:00:43 -06:00
1 parent 52ae1e9619
commit 3e1e785bd7
3 files changed
+27

No files matched your search

Binary file not shown.
Binary file not shown.
+27
View File
@@ -1462,6 +1462,22 @@ void main_change_gb_cart(int control_id)
}
}
static const char* get_pif_path(m64p_system_type systemtype)
{
const char *filename;
switch(systemtype)
{
case SYSTEM_PAL:
filename = "pifdata_pal.bin";
break;
case SYSTEM_MPAL:
case SYSTEM_NTSC:
default:
filename = "pifdata_ntsc.bin";
break;
}
return ConfigGetSharedDataFilepath(filename);
}
/*********************************************************************************************************
* emulation thread - runs the core
@@ -1504,6 +1520,17 @@ m64p_error main_run(void)
break;
}
/* Load PIF */
FILE* PifFile = fopen(get_pif_path(ROM_PARAMS.systemtype), "rb");
if (PifFile != NULL)
{
unsigned char* pif_buffer = malloc(2048);
size_t file_size = fread(pif_buffer, 1, 2048, PifFile);
fclose(PifFile);
open_pif(pif_buffer, file_size);
free(pif_buffer);
}
/* Seed MPK ID gen using current time */
uint64_t mpk_seed = !netplay_is_init() ? (uint64_t)time(NULL) : 0;
l_mpk_idgen = xoshiro256pp_seed(mpk_seed);