* vrc7: Add sound save states * Try to fix some save state issues try to fix big-endian related save problems * vrc7: fix crash in some cases when loading states
This commit is contained in:
committed by
hizzlekizzle
parent
25fdf55f8f
commit
e3cf3efc69
@@ -174,6 +174,7 @@ static void VRC7IRQHook(int a) {
|
||||
|
||||
static void StateRestore(int version) {
|
||||
Sync();
|
||||
OPLL_forceRefresh(VRC7Sound);
|
||||
}
|
||||
|
||||
void Mapper85_Init(CartInfo *info) {
|
||||
@@ -191,6 +192,28 @@ void Mapper85_Init(CartInfo *info) {
|
||||
GameStateRestore = StateRestore;
|
||||
VRC7_ESI();
|
||||
AddExState(&StateRegs, ~0, 0, 0);
|
||||
|
||||
/* Sound states */
|
||||
AddExState(&VRC7Sound->adr, sizeof(VRC7Sound->adr), 0, "ADDR");
|
||||
AddExState(&VRC7Sound->out, sizeof(VRC7Sound->out), 0, "OUT0");
|
||||
AddExState(&VRC7Sound->realstep, sizeof(VRC7Sound->realstep), 0, "RTIM");
|
||||
AddExState(&VRC7Sound->oplltime, sizeof(VRC7Sound->oplltime), 0, "TIME");
|
||||
AddExState(&VRC7Sound->opllstep, sizeof(VRC7Sound->opllstep), 0, "STEP");
|
||||
AddExState(&VRC7Sound->prev, sizeof(VRC7Sound->prev), 0, "PREV");
|
||||
AddExState(&VRC7Sound->next, sizeof(VRC7Sound->next), 0, "NEXT");
|
||||
AddExState(&VRC7Sound->LowFreq, sizeof(VRC7Sound->LowFreq), 0, "LFQ0");
|
||||
AddExState(&VRC7Sound->HiFreq, sizeof(VRC7Sound->HiFreq), 0, "HFQ0");
|
||||
AddExState(&VRC7Sound->InstVol, sizeof(VRC7Sound->InstVol), 0, "VOLI");
|
||||
AddExState(&VRC7Sound->CustInst, sizeof(VRC7Sound->CustInst), 0, "CUSI");
|
||||
AddExState(&VRC7Sound->slot_on_flag, sizeof(VRC7Sound->slot_on_flag), 0, "FLAG");
|
||||
AddExState(&VRC7Sound->pm_phase, sizeof(VRC7Sound->pm_phase), 0, "PMPH");
|
||||
AddExState(&VRC7Sound->lfo_pm, sizeof(VRC7Sound->lfo_pm), 0, "PLFO");
|
||||
AddExState(&VRC7Sound->am_phase, sizeof(VRC7Sound->am_phase), 0, "AMPH");
|
||||
AddExState(&VRC7Sound->lfo_am, sizeof(VRC7Sound->lfo_am), 0, "ALFO");
|
||||
AddExState(&VRC7Sound->patch_number, sizeof(VRC7Sound->patch_number), 0, "PNUM");
|
||||
AddExState(&VRC7Sound->key_status, sizeof(VRC7Sound->key_status), 0, "KET");
|
||||
AddExState(&VRC7Sound->mask, sizeof(VRC7Sound->mask), 0, "MASK");
|
||||
AddExState((uint8 *)VRC7Sound->slot, sizeof(VRC7Sound->slot), 0, "SLOT");
|
||||
}
|
||||
|
||||
void NSFVRC7_Init(void) {
|
||||
|
||||
Reference in New Issue
Block a user