mirror of
https://github.com/Rosalie241/RMG.git
synced 2026-07-11 01:24:01 +02:00
3rdParty: include rsp state in save states in mupen64plus-core
This commit is contained in:
+14
-7
@@ -63,7 +63,7 @@ enum { GB_CART_FINGERPRINT_OFFSET = 0x134 };
|
||||
enum { DD_DISK_ID_OFFSET = 0x43670 };
|
||||
|
||||
static const char* savestate_magic = "M64+SAVE";
|
||||
static const int savestate_latest_version = 0x00010900; /* 1.9 */
|
||||
static const int savestate_latest_version = 0x00020000; /* 2.0 */
|
||||
static const unsigned char pj64_magic[4] = { 0xC8, 0xA6, 0xD8, 0x23 };
|
||||
|
||||
static savestates_job job = savestates_job_nothing;
|
||||
@@ -887,6 +887,14 @@ static int savestates_load_m64p(struct device* dev, char *filepath)
|
||||
*r4300_cp0_latch(&dev->r4300.cp0) = GETDATA(curr, uint64_t);
|
||||
*r4300_cp2_latch(&dev->r4300.cp2) = GETDATA(curr, uint64_t);
|
||||
}
|
||||
|
||||
if (version >= 0x00020000)
|
||||
{
|
||||
/* extra rsp state */
|
||||
dev->sp.rsp_status = GETDATA(curr, uint32_t);
|
||||
dev->sp.first_run = GETDATA(curr, uint32_t);
|
||||
dev->sp.rsp_wait = GETDATA(curr, uint32_t);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -958,9 +966,6 @@ static int savestates_load_m64p(struct device* dev, char *filepath)
|
||||
/* reset fb state */
|
||||
poweron_fb(&dev->dp.fb);
|
||||
|
||||
dev->sp.rsp_status = 0;
|
||||
dev->sp.rsp_wait = 0;
|
||||
dev->sp.first_run = 1;
|
||||
dev->r4300.cp0.interrupt_unsafe_state = 0;
|
||||
|
||||
*r4300_cp0_last_addr(&dev->r4300.cp0) = *r4300_pc(&dev->r4300);
|
||||
@@ -1264,9 +1269,6 @@ static int savestates_load_pj64(struct device* dev,
|
||||
// No flashram info in pj64 savestate.
|
||||
poweron_flashram(&dev->cart.flashram);
|
||||
|
||||
dev->sp.rsp_status = 0;
|
||||
dev->sp.rsp_wait = 0;
|
||||
dev->sp.first_run = 1;
|
||||
dev->r4300.cp0.interrupt_unsafe_state = 0;
|
||||
|
||||
/* extra fb state */
|
||||
@@ -1928,6 +1930,11 @@ static int savestates_save_m64p(const struct device* dev, char *filepath)
|
||||
PUTDATA(curr, uint64_t, *r4300_cp0_latch((struct cp0*)&dev->r4300.cp0));
|
||||
PUTDATA(curr, uint64_t, *r4300_cp2_latch((struct cp2*)&dev->r4300.cp2));
|
||||
|
||||
/* rsp state (since 2.0) */
|
||||
PUTDATA(curr, uint32_t, dev->sp.rsp_status);
|
||||
PUTDATA(curr, uint32_t, dev->sp.first_run);
|
||||
PUTDATA(curr, uint32_t, dev->sp.rsp_wait);
|
||||
|
||||
init_work(&save->work, savestates_save_m64p_work);
|
||||
queue_work(&save->work);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user