diff --git a/zsnes/src/cpu/execute.asm b/zsnes/src/cpu/execute.asm index c402f8dd..6da92ace 100644 --- a/zsnes/src/cpu/execute.asm +++ b/zsnes/src/cpu/execute.asm @@ -20,7 +20,7 @@ %include "macros.mac" -EXTSYM KeyRewind,statesaver,timer2upd,Voice0Status,UpdateDPage +EXTSYM KeyRewind,statesaver,Voice0Status,UpdateDPage EXTSYM StartGUI,debuggeron,romdata,initvideo EXTSYM vidbufferofsa,disable65816sh,GUISaveVars,virqnodisable EXTSYM KeySaveState,KeyLoadState,KeyQuickExit,KeyQuickLoad,KeyQuickRst @@ -33,7 +33,7 @@ EXTSYM SetupPreGame,memtablew8,regaccessbankr8,showmenu,snesmap2,snesmmap EXTSYM DeInitPostGame,spcPCRam,startdebugger,xp,xpb,xpc,tablead,tableadb EXTSYM tableadc,SA1UpdateDPage,Makemode7Table,nextmenupopup,MovieProcessing EXTSYM OSExit,DosExit,InitDir,InitDrive,createnewcfg,sfxramdata,deinitvideo -EXTSYM SFXEnable,wramdata,cycpbl,cycpblt,irqon,spcnumread,spcon +EXTSYM SFXEnable,wramdata,cycpbl,cycpblt,irqon,spcon EXTSYM multchange,romispal,scrndis,sprlefttot,sprleftpr,processsprites EXTSYM cachesprites,NextLineStart,FlipWait,LastLineStart,opcjmptab,CheatOn EXTSYM INTEnab,JoyCRead,NMIEnab,NumCheats,CurrentExecSA1,ReadInputDevice @@ -71,21 +71,6 @@ NEWSYM BackState, db 1 NEWSYM BackStateSize, dd 6 SECTION .text -NEWSYM ResetExecStuff - mov dword[soundcycleft],0 - mov dword[curexecstate],0 - mov dword[nmiprevaddrl],0 - mov dword[nmiprevaddrh],0 - mov dword[nmirept],0 - mov dword[nmiprevline],224 - mov dword[nmistatus],0 - mov byte[NextLineCache],0 - mov byte[spcnumread],0 - mov dword[timer2upd],0 - mov dword[HIRQCycNext],0 - mov byte[HIRQNextExe],0 - ret - NEWSYM ProcessRewind mov eax,[KeyRewind] cmp byte[pressed+eax],1 diff --git a/zsnes/src/gblvars.h b/zsnes/src/gblvars.h index 8a9e8815..4450b85e 100644 --- a/zsnes/src/gblvars.h +++ b/zsnes/src/gblvars.h @@ -29,13 +29,14 @@ extern unsigned int cycpbl, PH65816regsize; extern unsigned int *wramdata, *vram, PHspcsave, PHdspsave, *C4Ram, *sfxramdata; extern unsigned int PHnum2writesa1reg, SA1Mode, prevedi, SA1xpc, sa1dmaptr; extern unsigned int soundcycleft, spc700read, timer2upd, xa, PHnum2writesfxreg; -extern unsigned int opcd, HIRQCycNext, oamaddr; -extern unsigned int SfxR0, *setaramdata, ramsize, *sram; +extern unsigned int opcd, HIRQCycNext, oamaddr, curexecstate, nmiprevaddrl; +extern unsigned int nmirept, nmiprevline, nmistatus, joycontren; +extern unsigned int SfxR0, *setaramdata, ramsize, *sram, nmiprevaddrh; extern unsigned int tempesi, tempedi, tempedx, tempebp; extern unsigned int SPCMultA, PHnum2writespc7110reg, PHdspsave2; extern unsigned char sndrot, SPCRAM[65472], DSPMem[256], SA1Status, *SA1RAMArea; extern unsigned char DSP1Type, DSP1COp, prevoamptr, BRRBuffer[32], *romdata; -extern unsigned char curcyc, echoon0, spcnumread; +extern unsigned char curcyc, echoon0, spcnumread, NextLineCache, HIRQNextExe; extern unsigned char vidmemch4[4096], vidmemch8[4096], vidmemch2[4096]; extern bool C4Enable, SFXEnable, SA1Enable, SPC7110Enable, SETAEnable, spcon; diff --git a/zsnes/src/init.asm b/zsnes/src/init.asm index b48f8886..884dcd33 100644 --- a/zsnes/src/init.asm +++ b/zsnes/src/init.asm @@ -997,7 +997,6 @@ NEWSYM disablehdma, db 0 NEWSYM disableeffects, db 0 NEWSYM hdmaearlstart, db 0 NEWSYM hdmadelay, db 0 -NEWSYM dracxhack, db 0 NEWSYM disable65816sh, db 0 NEWSYM disablespcclr, db 0 NEWSYM virqnodisable, db 0 @@ -1138,7 +1137,6 @@ NEWSYM init65816 mov byte[prevoamptr],0FFh mov byte[disablehdma],0 mov byte[disableeffects],0 - mov byte[dracxhack],0 mov al,[opexec268b] mov [opexec268],al mov al,[opexec358b] diff --git a/zsnes/src/zstate.c b/zsnes/src/zstate.c index dc07ea01..80961834 100755 --- a/zsnes/src/zstate.c +++ b/zsnes/src/zstate.c @@ -68,13 +68,22 @@ static void copy_spc_data(unsigned char **buffer, void (*copy_func)(unsigned cha static void copy_extra_data(unsigned char **buffer, void (*copy_func)(unsigned char **, void *, size_t)) { - copy_func(buffer, &soundcycleft, 33); + copy_func(buffer, &soundcycleft, 4); + copy_func(buffer, &curexecstate, 4); + copy_func(buffer, &nmiprevaddrl, 4); + copy_func(buffer, &nmiprevaddrh, 4); + copy_func(buffer, &nmirept, 4); + copy_func(buffer, &nmiprevline, 4); + copy_func(buffer, &nmistatus, 4); + copy_func(buffer, &joycontren, 4); + copy_func(buffer, &NextLineCache, 1); copy_func(buffer, &spc700read, 10*4); - copy_func(buffer, &timer2upd, 1*4); + copy_func(buffer, &timer2upd, 4); copy_func(buffer, &xa, 14*4); copy_func(buffer, &spcnumread, 1); copy_func(buffer, &opcd, 6*4); - copy_func(buffer, &HIRQCycNext, 5); + copy_func(buffer, &HIRQCycNext, 4); + copy_func(buffer, &HIRQNextExe, 1); copy_func(buffer, &oamaddr, 14*4); copy_func(buffer, &prevoamptr, 1); }