All pastes #473131 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-05-06 01:51 UTC
rendered paste body
Index: Makefile.in
===================================================================
--- Makefile.in	(revision 4995)
+++ Makefile.in	(working copy)
@@ -28,6 +28,7 @@
 TOOL_D=tools
 VID_D=video
 ZIP_D=zip
+SPC_D=zspc-0.9.0
 
 PSR=parsegen
 PSR_H=cfg.h md.h input.h
@@ -43,9 +44,9 @@
 	$(CHIP_D)/seta10.o $(CHIP_D)/seta11.o
 
 CPU_AO=$(CPU_D)/dma.o $(CPU_D)/execute.o $(CPU_D)/irq.o $(CPU_D)/memory.o\
-	$(CPU_D)/spc700.o $(CPU_D)/stable.o $(CPU_D)/table.o $(CPU_D)/tablec.o
-CPU_CO=$(CPU_D)/dsp.o $(CPU_D)/dspwrap.o $(CPU_D)/executec.o $(CPU_D)/memtable.o\
-	$(CPU_D)/spc.o $(CPU_D)/spc_cpu.o
+	$(CPU_D)/stable.o $(CPU_D)/table.o $(CPU_D)/tablec.o
+CPU_CO=$(CPU_D)/dspwrap.o $(CPU_D)/executec.o $(CPU_D)/memtable.o\
+	$(SPC_D)/SPC_DSP.o $(SPC_D)/zspc.o
 
 DEBUG_AO=@DEBUGGER_A@
 DEBUG_CO=@DEBUGGER_C@
@@ -106,9 +107,6 @@
 	@ZC@ -o @ZSNESEXE@ $(Z_OBJS) @ZCFLAGS@ @LDFLAGS@
 	rm -f version.o
 
-playspc: playspc.o $(CPU_D)/dsp.o $(CPU_D)/dspwrap.o $(CPU_D)/spc700.o
-	@CC@ -lao -o $@ $^
-
 $(PSR): parsegen.cpp
 	@CXX@ @CXXFLAGS@ -o $@ $< -lz
 
@@ -160,7 +158,7 @@
 	rm -f @bindir@/$(notdir @ZSNESEXE@) @mandir@/man1/zsnes.1
 
 clean:
-	rm -f makefile.dep $(Z_OBJS) $(PSR) $(PSR_H) @ZSNESEXE@ playspc
+	rm -f makefile.dep $(Z_OBJS) $(PSR) $(PSR_H) @ZSNESEXE@
 cclean:
 	rm -f $(Z_COBJS) $(PSR) $(PSR_H) @ZSNESEXE@
 tclean:
Index: cpu/regsw.inc
===================================================================
--- cpu/regsw.inc	(revision 4995)
+++ cpu/regsw.inc	(working copy)
@@ -21,7 +21,7 @@
 
 EXTSYM initsfxregsw,reg420Bw,reg420Cw,regptw,initSA1regsw,SDD1Reset
 EXTSYM SPC7110Reset,RTCReset2,NextLineCache,vidmemch2,vidmemch4
-EXTSYM vidmemch8,vrama,nmirept,SPCRAM,HIRQCycNext,HIRQNextExe,tableadc
+EXTSYM vidmemch8,vrama,nmirept,HIRQCycNext,HIRQNextExe,tableadc
 EXTSYM cycpb268,cycpb358,cycpbl,cycpblt,opexec268,opexec268cph,opexec358
 EXTSYM opexec358cph
 
@@ -1224,9 +1224,9 @@
     jne .n
     mov byte[nmirept],0
 .n
-    mov [SPCRAM+0F4h],al
-    inc dword[SPC700write]
-    reenablespc
+    ;mov [SPCRAM+0F4h],al
+    ;inc dword[SPC700write]
+    ;reenablespc
     ret
 ;    cmp dword[cycpbl],0FFFFh
 ;    ja .spcreset
@@ -1241,9 +1241,9 @@
 %ifndef NO_DEBUGGER
     mov byte[sndwrit],1
 %endif
-    mov [SPCRAM+0F5h],al
-    inc dword[SPC700write]
-    reenablespc
+    ;mov [SPCRAM+0F5h],al
+    ;inc dword[SPC700write]
+    ;reenablespc
     ret
 ;    cmp dword[cycpbl],0FFFFh
 ;    ja .spcreset
@@ -1258,9 +1258,9 @@
 %ifndef NO_DEBUGGER
     mov byte[sndwrit],1
 %endif
-    mov [SPCRAM+0F6h],al
-    inc dword[SPC700write]
-    reenablespc
+    ;mov [SPCRAM+0F6h],al
+    ;inc dword[SPC700write]
+    ;reenablespc
     ret
 ;    cmp dword[cycpbl],0FFFFh
 ;    ja .spcreset
@@ -1275,9 +1275,9 @@
 %ifndef NO_DEBUGGER
     mov byte[sndwrit],1
 %endif
-    mov [SPCRAM+0F7h],al
-    inc dword[SPC700write]
-    reenablespc
+    ;mov [SPCRAM+0F7h],al
+    ;inc dword[SPC700write]
+    ;reenablespc
     ret
 ;    cmp dword[cycpbl],0FFFFh
 ;    ja .spcreset
Index: cpu/execute.asm
===================================================================
--- cpu/execute.asm	(revision 4995)
+++ cpu/execute.asm	(working copy)
@@ -35,7 +35,7 @@
 EXTSYM StartDrawNewGfx,VIRQLoc,cachevideo,cfield,cheatdata,curblank,curnmi
 EXTSYM curypos,cycpl,doirqnext,drawline,exechdma,hdmadelay,intrset,newengen
 EXTSYM oamaddr,oamaddrs,resolutn,showvideo,starthdma,switchtonmi,switchtovirq
-EXTSYM totlines,updatetimer,SA1Swap,SA1DoIRQ,JoyAOrig,JoyANow,JoyBOrig,JoyBNow
+EXTSYM totlines,SA1Swap,SA1DoIRQ,JoyAOrig,JoyANow,JoyBOrig,JoyBNow
 EXTSYM JoyCOrig,JoyCNow,JoyDOrig,JoyDNow,JoyEOrig,JoyENow,SA1Message
 EXTSYM MultiTapStat,SA1Control,SA1Enable,SA1IRQEnable,SPC700read
 EXTSYM SPC700write,SA1IRQExec,ForceNewGfxOff,LethEnData
@@ -1016,10 +1016,10 @@
     jae near .overy
     cmp byte[spcon],0
     je .nosound
-    call updatetimer
-    pushad
-    call catchup
-    popad
+    ;call updatetimer
+    ;pushad
+    ;call catchup
+    ;popad
 .nosound
     mov ax,[resolutn]
     inc ax
@@ -1449,13 +1449,13 @@
     inc esi
     jmp execloop.startagain
 .overy
-    add dword[spc_scantime], 33
-    push dword[spc_scantime]
-    pop dword[spc_time]
-    call catchup
-    pushad
-    call dsp_run_wrap
-    popad
+;    add dword[spc_scantime], 33
+;    push dword[spc_scantime]
+;    pop dword[spc_time]
+;    call catchup
+;    pushad
+;    call dsp_run_wrap
+;    popad
     mov dh,80
 %ifdef __MSDOS__
     cmp byte[smallscreenon],1
@@ -1890,7 +1890,7 @@
     test byte[curexecstate],2
     jz .nosoundb
 
-    catchupspc
+;    catchupspc
 
 .skipallspc
 .nosoundb
@@ -1942,7 +1942,7 @@
 
     cmp byte[spcon],0
     je .nosound
-    call updatetimer
+    ;call updatetimer
 ;    call catchup
 ;    pushad
 ;    call dsp_run_wrap
Index: cpu/regsw.mac
===================================================================
--- cpu/regsw.mac	(revision 4995)
+++ cpu/regsw.mac	(working copy)
@@ -38,11 +38,11 @@
     div bl
     xor ah,ah
 
-    add eax, [spc_scantime]
-    cmp eax, [spc_time]
+    ;add eax, [spc_scantime]
+    ;cmp eax, [spc_time]
     js %%backwards
-    mov [spc_time], eax
-    call catchup
+    ;mov [spc_time], eax
+    ;call catchup
 %%backwards
     popad
 %endmacro
Index: cpu/dspwrap.c
===================================================================
--- cpu/dspwrap.c	(revision 4995)
+++ cpu/dspwrap.c	(working copy)
@@ -28,12 +28,19 @@
 #include "dsp.h"
 #include "../asm_call.h"
 
+#include "../zspc-0.9.0/zspc.h"
 //C++ style code in C
 #define true 1
 #define false 0
 
 void InitSPC()
 {
+
+  puts("Calling zspc_init()");
+        zspc_init();
+        zspc_end_frame( 10 );
+
+/*
   void InitSPCRegs();
   extern unsigned char SPCRAM[0x10000];
   extern bool romispal;
@@ -42,26 +49,27 @@
   dsp_init(SPCRAM);
   dsp_reset();
   InitDSPControl(romispal);
+*/
 }
 
 int DSP_reg, DSP_val;
 
 void dsp_read_wrap()
 {
-  DSP_val = dsp_read(DSP_reg);
+  //DSP_val = dsp_read(DSP_reg);
 }
 
 void dsp_write_wrap()
 {
-  dsp_write(DSP_reg, DSP_val);
+  //dsp_write(DSP_reg, DSP_val);
 }
 
 #ifdef __LIBAO__
 void SoundWrite_ao();
 #endif
 void write_audio(short *sample_buffer, size_t sample_count);
-extern unsigned char cycpbl;
-extern unsigned int spcCycle;
+//extern unsigned char cycpbl;
+//extern unsigned int spcCycle;
 
 short dsp_samples_buffer[1280*5]; //Buffer 5 frames for even PAL
 const size_t dsp_buffer_size = sizeof(dsp_samples_buffer)/sizeof(short);
@@ -95,7 +103,7 @@
   sample_control.balance = sample_control.hi;
   memset(dsp_samples_buffer, 0, sizeof(dsp_samples_buffer));
   mid_samples = next_samples = dsp_sample_count = lastCycle = cycles_remaining = 0;
-  lastCycle = spcCycle = 32;
+  //lastCycle = spcCycle = 32;
 }
 
 void dsp_samples_push(short *buffer, size_t amount)
@@ -135,6 +143,7 @@
 
 void dsp_run_wrap()
 {
+/*
   short buffer[1280*2]; //Big enough for two PAL frames
 
   int i = cycles_remaining+spcCycle-lastCycle, samples = i >> 5;
@@ -149,4 +158,5 @@
     dsp_samples_push(buffer, samples*2);
   }
   lastCycle = spcCycle;
+*/
 }
Index: cpu/65816dc.inc
===================================================================
--- cpu/65816dc.inc	(revision 4995)
+++ cpu/65816dc.inc	(working copy)
@@ -26,8 +26,6 @@
 ;*******************************************************
 EXTSYM clocktable,spcCycle
 
-%include "cpu/spccycle.inc"
-
 %macro endloop 0
     xor ebx,ebx
     mov bl,[esi]
Index: cpu/regs.inc
===================================================================
--- cpu/regs.inc	(revision 4995)
+++ cpu/regs.inc	(working copy)
@@ -21,9 +21,7 @@
 
 EXTSYM SFXEnable,regptr,initsfxregsr,initSA1regs,SA1Enable,initSDD1regs
 EXTSYM SPC7110Enable,initSPC7110regs,RTCEnable,RTCReset,curypos,cycpl
-EXTSYM pdh,vram,romispal,reg1read,spcnumread,spcon,reg2read,reg3read
-EXTSYM reg4read,JoyEOrig,JoyENow,device2,cycphb,joycontren,totlines
-EXTSYM spc_scantime,spc_time
+EXTSYM pdh,vram,romispal,JoyEOrig,JoyENow,device2,cycphb,joycontren,totlines
 
 %ifndef NO_DEBUGGER
 EXTSYM debuggeron
@@ -787,144 +785,21 @@
 ; Sound Reg #1
 reg2140r:
 %ifdef __BLARGG_SPC__
-%else
-    cmp byte[spcon],0
-    je .nosound
-    inc dword[SPC700read]
-    catchupspc
-    mov al,[reg1read]
-    mov byte[spcnumread],0
-
-    ret
-.nosound
-    ; Find for D0
-    mov ebx,esi
-    cmp word[ebx],0FB10h
-    jne .noret
-    mov word[ebx],0EAEAh
-.noret
-    mov al,5
-.tryagain
-    cmp byte[ebx],0D0h
-    je .foundit
-    inc ebx
-    dec al
-    jnz .tryagain
-    jmp .notfound
-.foundit
-    mov byte[ebx],0EAh
-    mov byte[ebx+1],0EAh
-.notfound
-    inc byte[sndrot2]
-    cmp byte[sndrot2],3
-    jne .a
-    mov byte[sndrot2],0
-.a
-    xor al,al
-    test byte[sndrot2],01h
-    jz .n
-    mov al,[xa]
-.n
-    ret
 %endif
 
 ; Sound Reg #2
 reg2141r:
 %ifdef __BLARGG_SPC__
-%else
-    cmp byte[spcon],0
-    je .nosound
-    inc dword[SPC700read]
-    catchupspc
-    mov al,[reg2read]
-    mov byte[spcnumread],0
-    ret
-.nosound
-    ; Find for D0
-    mov ebx,esi
-    mov al,3
-.tryagain
-    cmp byte[ebx],0D0h
-    je .foundit
-    inc ebx
-    dec al
-    jnz .tryagain
-    jmp .notfound
-.foundit
-    mov byte[ebx],0EAh
-    mov byte[ebx+1],0EAh
-.notfound
-    xor byte[sndrot],01h
-    mov al,[xa+1]
-    test byte[sndrot],01h
-    jz .n
-    mov al,[xa]
-.n
-    ret
 %endif
 
 ; Sound Reg #3
 reg2142r:
 %ifdef __BLARGG_SPC__
-%else
-    cmp byte[spcon],0
-    je .nosound
-    inc dword[SPC700read]
-    catchupspc
-    mov al,[reg3read]
-    mov byte[spcnumread],0
-    ret
-.nosound
-    ; Find for D0
-    mov ebx,esi
-    mov al,3
-.tryagain
-    cmp byte[ebx],0D0h
-    je .foundit
-    inc ebx
-    dec al
-    jnz .tryagain
-    jmp .notfound
-.foundit
-    mov byte[ebx],0EAh
-    mov byte[ebx+1],0EAh
-.notfound
-    mov al,[xa]
-    test byte[sndrot],01h
-    jz .n
-    mov al,[xa+1]
-.n
-    ret
 %endif
 
 ; Sound Reg #4
 reg2143r:
 %ifdef __BLARGG_SPC__
-%else
-    cmp byte[spcon],0
-    je .nosound
-    inc dword[SPC700read]
-    catchupspc
-    mov al,[reg4read]
-    mov byte[spcnumread],0
-    ret
-.nosound
-    ; Find for D0
-    mov ebx,esi
-    mov al,3
-.tryagain
-    cmp byte[ebx],0D0h
-    je .foundit
-    inc ebx
-    dec al
-    jnz .tryagain
-    jmp .notfound
-.foundit
-    mov byte[ebx],0EAh
-    mov byte[ebx+1],0EAh
-.notfound
-    mov al,[xa+1]
-    ret
 %endif
 
 reg2144r:
Index: cpu/dsp.h
===================================================================
--- cpu/dsp.h	(revision 4995)
+++ cpu/dsp.h	(working copy)
@@ -48,11 +48,11 @@
 
 //// private
 
-extern uint8_t m_dsp_regs [dsp_register_count];
+//extern uint8_t m_dsp_regs [dsp_register_count];
 INLINE int dsp_read( int addr )
 {
 	assert( (unsigned) addr < dsp_register_count );
-	return m_dsp_regs [addr];
+	//return m_dsp_regs [addr];
 }
 
 #endif
Index: gui/guimisc.inc
===================================================================
--- gui/guimisc.inc	(revision 4995)
+++ gui/guimisc.inc	(working copy)
@@ -480,21 +480,21 @@
     call init65816
     pushad
     call procexecloop
-    call dsp_reset
+    ;call dsp_reset
     popad
 
-    xor eax,eax
-    mov edx,SPCRAM
-    mov ax,0FFC0h
-    add edx,eax
-    mov [spcPCRam],edx
-    mov dword[spcS],1EFh
-    mov dword[spcRamDP],SPCRAM
-    mov byte[spcA],0
-    mov byte[spcX],0
-    mov byte[spcY],0
-    mov byte[spcP],0
-    mov byte[spcNZ],0
+    ;xor eax,eax
+    ;mov edx,SPCRAM
+    ;mov ax,0FFC0h
+    ;add edx,eax
+    ;mov [spcPCRam],edx
+    ;mov dword[spcS],1EFh
+    ;mov dword[spcRamDP],SPCRAM
+    ;mov byte[spcA],0
+    ;mov byte[spcX],0
+    ;mov byte[spcY],0
+    ;mov byte[spcP],0
+    ;mov byte[spcNZ],0
 ;    mov byte[Voice0Status],0
 ;    mov byte[Voice1Status],0
 ;    mov byte[Voice2Status],0
Index: configure.in
===================================================================
--- configure.in	(revision 4995)
+++ configure.in	(working copy)
@@ -329,6 +329,7 @@
   JMA_FILES=""
   ZC="$CC"
   ZCFLAGS="$CFLAGS"
+  CXXFLAGS+=" -fno-exceptions"
 fi
 
 dnl - Check for header files
Index: initc.c
===================================================================
--- initc.c	(revision 4995)
+++ initc.c	(working copy)
@@ -1410,7 +1410,7 @@
 extern uint8_t pal16bcl[1024];
 extern uint8_t pal16bclha[1024];
 extern uint8_t pal16bxcl[256];
-extern uint8_t SPCRAM[65472];
+//extern uint8_t SPCRAM[65472];
 
 extern uint8_t *vidbuffer;
 extern uint8_t *vram;
@@ -1418,6 +1418,7 @@
 extern uint8_t *vcache4b;
 extern uint8_t *vcache8b;
 
+#if 0
 void clearSPCRAM()
 {
   /*
@@ -1440,11 +1441,12 @@
     memset(SPCRAM+i+0x20, 0xFF, 0x20);
   }
 }
+#endif
 
 void clearmem2()
 {
   memset(sram, 0xFF, 65536);
-  clearSPCRAM();
+  //clearSPCRAM();
 }
 
 void clearmem()
@@ -1823,7 +1825,7 @@
 }
 
 extern uint32_t nmiprevaddrl, nmiprevaddrh, nmirept, nmiprevline, nmistatus;
-extern uint8_t spcnumread, yesoutofmemory;
+extern uint8_t yesoutofmemory;
 extern uint8_t NextLineCache, sramsavedis, sndrot, regsbackup[3019];
 /*
 extern uint32_t Voice0Freq, Voice1Freq, Voice2Freq, Voice3Freq;
@@ -2588,7 +2590,7 @@
   nmirept = 0;
   nmiprevline = 224;
   nmistatus = 0;
-  spcnumread = 0;
+  //spcnumread = 0;
   NextLineCache = 0;
   curexecstate = 1;
 
@@ -2626,7 +2628,7 @@
 }
 
 extern uint8_t osm2dis, ReturnFromSPCStall, SPCStallSetting, prevoamptr;
-extern uint8_t reg1read, reg2read, reg3read, reg4read, NMIEnab, INTEnab;
+extern uint8_t NMIEnab, INTEnab;
 extern uint8_t doirqnext, vidbright, forceblnk, timeron, spcP, JoyAPos, JoyBPos;
 extern uint8_t coladdr, coladdg, coladdb;
 extern uint8_t SDD1BankA,SDD1BankB, SDD1BankC, SDD1BankD;
@@ -2634,7 +2636,7 @@
 extern uint32_t numspcvblleft, SPC700read, SPC700write, spc700idle;
 extern uint32_t xa, xdb, xpb, xs, xd, xx, xy, scrndis;
 extern uint16_t VIRQLoc, resolutn, xpc;
-extern uint8_t spcextraram[64], SPCROM[64];
+//extern uint8_t spcextraram[64], SPCROM[64];
 extern uint32_t tableD[256];
 uint8_t SPCSkipXtraROM, bgfixer2 = 0, disableeffects = 0;
 //This is saved in states
@@ -2748,12 +2750,12 @@
 
     for(i = 0;i<0x40;i++)
     {
-      spcextraram[i] = 0xFF;
-      SPCRAM[0xFFC0+i] = SPCROM[i];
+      //spcextraram[i] = 0xFF;
+      //SPCRAM[0xFFC0+i] = SPCROM[i];
     }
 
     // Clear SPC Memory
-    clearSPCRAM();
+    //clearSPCRAM();
     clearvidsound();
 
     prevoamptr = 0xFF;
@@ -2775,25 +2777,25 @@
 
 
     // What the hell is this?
-    SPCRAM[0xF4] = 0;
-    SPCRAM[0xF5] = 0;
-    SPCRAM[0xF6] = 0;
-    SPCRAM[0xF7] = 0;
+    //SPCRAM[0xF4] = 0;
+    //SPCRAM[0xF5] = 0;
+    //SPCRAM[0xF6] = 0;
+    //SPCRAM[0xF7] = 0;
 
-    reg1read = 0;
-    reg2read = 0;
-    reg3read = 0;
-    reg4read = 0;
+    //reg1read = 0;
+    //reg2read = 0;
+    //reg3read = 0;
+    //reg4read = 0;
     cycpbl = 0;
-    spcnumread = 0;
+    //spcnumread = 0;
     NMIEnab = 1;
     VIRQLoc = 0;
     doirqnext = 0;
     resolutn = 224;
     vidbright = 0;
     forceblnk = 0;
-    spcP = 0;
-    timeron = 0;
+    //spcP = 0;
+    //timeron = 0;
     JoyAPos = 0;
     JoyBPos = 0;
     coladdr = 0;
Index: zmovie.c
===================================================================
--- zmovie.c	(revision 4995)
+++ zmovie.c	(working copy)
@@ -2663,14 +2663,14 @@
 
   if (RecData[2] == 1)
   {
-    timer2upd = bytes_to_uint32(RecData+3);
+    //timer2upd = bytes_to_uint32(RecData+3);
     curexecstate = bytes_to_uint32(RecData+7);
     nmiprevaddrl = 0;
     nmiprevaddrh = 0;
     nmirept = 0;
     nmiprevline = 224;
     nmistatus = 0;
-    spcnumread = 0;
+    //spcnumread = 0;
     NextLineCache = 0;
   }
 
Index: makefile.ms
===================================================================
--- makefile.ms	(revision 4995)
+++ makefile.ms	(working copy)
@@ -47,6 +47,7 @@
 NTSC_D=video/snes_ntsc
 WIN_D=win
 ZIP_D=zip
+SPC_D=zspc-0.9.0
 
 DELETECOMMAND=rm -f
 DELPRE=rm -f
@@ -177,6 +178,7 @@
 ifeq (${JMA},no)
   CFLAGSORIG+= -DNO_JMA
   ASMFLAGSORIG+= -DNO_JMA
+  CXXFLAGSORIG+= -fno-exceptions
   ifeq (${OS},__MSDOS__)
     LINK=${CC}
   endif
@@ -203,7 +205,8 @@
 CPUOBJ=${CPU_D}/dma${OE} ${CPU_D}/execute${OE} ${CPU_D}/executec${OE}\
 	${CPU_D}/irq${OE} ${CPU_D}/memory${OE} ${CPU_D}/memtable${OE}\
 	${CPU_D}/stable${OE} ${CPU_D}/table${OE}\
-	${CPU_D}/tablec${OE} ${CPU_D}/dsp${OE} ${CPU_D}/dspwrap${OE}
+	${CPU_D}/tablec${OE} ${CPU_D}/dspwrap${OE} \
+	$(SPC_D)/SPC_DSP${OE} $(SPC_D)/zspc${OE}
 
 EFFECTSOBJ=${EFF_D}/burn${OE} ${EFF_D}/water${OE} ${EFF_D}/smoke${OE}
 
@@ -372,15 +375,14 @@
 ${CHIP_D}/st11proc${OE}: ${CHIP_D}/st11proc.asm macros.mac
 
 ${CPU_D}/dma${OE}: ${CPU_D}/dma.asm macros.mac
-${CPU_D}/dsp${OE}: ${CPU_D}/dsp.c ${CPU_D}/dsp.h
-${CPU_D}/execute${OE}: ${CPU_D}/execute.asm macros.mac ${CPU_D}/spccycle.inc
+${CPU_D}/execute${OE}: ${CPU_D}/execute.asm macros.mac
 ${CPU_D}/executec${OE}: ${CPU_D}/executec.c gblvars.h
 ${CPU_D}/irq${OE}: ${CPU_D}/irq.asm macros.mac
 ${CPU_D}/memory${OE}: ${CPU_D}/memory.asm macros.mac
 ${CPU_D}/memtable${OE}: ${CPU_D}/memtable.c gblvars.h ${CPU_D}/memtable.h
 ${CPU_D}/dspwrap${OE}: ${CPU_D}/dspwrap.c asm_call.h ${CPU_D}/dsp.h ${CPU_D}/dspwrap.h
 ${CPU_D}/spc700${OE}: ${CPU_D}/spc700.asm macros.mac ${CPU_D}/regsw.mac \
-	${CPU_D}/spcaddr.inc ${CPU_D}/spccycle.inc ${CPU_D}/spcdef.inc
+	${CPU_D}/spcaddr.inc ${CPU_D}/spcdef.inc
 ${CPU_D}/stable${OE}: ${CPU_D}/stable.asm macros.mac ${CPU_D}/s65816d.inc \
 	${CPU_D}/saddress.inc ${CPU_D}/saddrni.inc ${CPU_D}/se65816.inc
 ${CPU_D}/table${OE}: ${CPU_D}/table.asm macros.mac ${CPU_D}/65816d.inc \
@@ -388,8 +390,7 @@
 	${CPU_D}/regs.inc ${CPU_D}/regs.mac ${CPU_D}/regsw.inc \
 	${CPU_D}/regsw.mac
 ${CPU_D}/tablec${OE}: ${CPU_D}/tablec.asm macros.mac ${CPU_D}/65816dc.inc \
-	${CPU_D}/address.inc ${CPU_D}/addrni.inc ${CPU_D}/e65816c.inc \
-	${CPU_D}/spccycle.inc
+	${CPU_D}/address.inc ${CPU_D}/addrni.inc ${CPU_D}/e65816c.inc
 
 ${DOS_D}/dosintrf${OE}: ${DOS_D}/dosintrf.asm macros.mac
 ${DOS_D}/gppro${OE}: ${DOS_D}/gppro.asm macros.mac
Index: zstate.c
===================================================================
--- zstate.c	(revision 4995)
+++ zstate.c	(working copy)
@@ -79,7 +79,7 @@
   copy_func(buffer, &intrset, 1);
   copy_func(buffer, &cycpl, 1);
   copy_func(buffer, &cycphb, 1);
-  copy_func(buffer, &spcon, 1);
+  //copy_func(buffer, &spcon, 1);
   copy_func(buffer, &stackand, 2);
   copy_func(buffer, &stackor, 2);
   copy_func(buffer, &xat, 2);
@@ -97,16 +97,16 @@
   copy_func(buffer, &Curtableaddr, 4);
   copy_func(buffer, &curnmi, 1);
   //SPC Timers
-  copy_func(buffer, &cycpbl, 4);
-  copy_func(buffer, &cycpblt, 4);
+  //copy_func(buffer, &cycpbl, 4);
+  //copy_func(buffer, &cycpblt, 4);
   //SNES PPU Register status
-  copy_func(buffer, &sndrot, 3019);
+  //copy_func(buffer, &sndrot, 3019);
 }
 
 static void copy_spc_data(uint8_t **buffer, void (*copy_func)(uint8_t **, void *, size_t))
 {
   //SPC stuff, DSP stuff
-  copy_func(buffer, SPCRAM, PHspcsave);
+  //copy_func(buffer, SPCRAM, PHspcsave);
 //  copy_func(buffer, &BRRBuffer, PHdspsave);
 //  copy_func(buffer, &DSPMem, sizeof(DSPMem));
 }
@@ -122,10 +122,10 @@
   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, 4);
+  //copy_func(buffer, &spc700read, 10*4);
+  //copy_func(buffer, &timer2upd, 4);
   copy_func(buffer, &xa, 14*4);
-  copy_func(buffer, &spcnumread, 1);
+  //copy_func(buffer, &spcnumread, 1);
   copy_func(buffer, &opcd, 6*4);
   copy_func(buffer, &HIRQCycNext, 4);
   copy_func(buffer, &HIRQNextExe, 1);
@@ -153,7 +153,7 @@
 
   if (spcon)
   {
-    copy_spc_data(&buffer, copy_func);
+    //copy_spc_data(&buffer, copy_func);
     /*
     if (buffer) //Rewind stuff
     {
@@ -545,12 +545,12 @@
 extern uintptr_t Voice0BufPtr, Voice1BufPtr, Voice2BufPtr, Voice3BufPtr;
 extern uintptr_t Voice4BufPtr, Voice5BufPtr, Voice6BufPtr, Voice7BufPtr;
 */
-extern uintptr_t spcPCRam, spcRamDP;
+//extern uintptr_t spcPCRam, spcRamDP;
 
 void PrepareSaveState()
 {
-  spcPCRam -= (uintptr_t)SPCRAM;
-  spcRamDP -= (uintptr_t)SPCRAM;
+  //spcPCRam -= (uintptr_t)SPCRAM;
+  //spcRamDP -= (uintptr_t)SPCRAM;
 
 /*  Voice0BufPtr -= spcBuffera;
   Voice1BufPtr -= spcBuffera;
@@ -616,8 +616,8 @@
 
 void ResetState()
 {
-  spcPCRam += (uintptr_t)SPCRAM;
-  spcRamDP += (uintptr_t)SPCRAM;
+  //spcPCRam += (uintptr_t)SPCRAM;
+  //spcRamDP += (uintptr_t)SPCRAM;
 
 /*  ResState(Voice0BufPtr);
   ResState(Voice1BufPtr);
@@ -1037,7 +1037,7 @@
   {
     prevoamptr = 0xFF;
     ioportval = 0xFF;
-    spcnumread = 0;
+    //spcnumread = 0;
   }
 
   if (MovieProcessing != MOVIE_RECORD)
@@ -1065,7 +1065,7 @@
 void zst_sram_load(FILE *fp)
 {
   fseek(fp, sizeof(zst_header_cur)-1 + PH65816regsize + 199635, SEEK_CUR);
-  if (spcon) { fseek(fp, PHspcsave /*+ PHdspsave + sizeof(DSPMem)*/, SEEK_CUR); }
+  //if (spcon) { fseek(fp, PHspcsave /*+ PHdspsave + sizeof(DSPMem)*/, SEEK_CUR); }
   if (C4Enable) { fseek(fp, 8192, SEEK_CUR); }
   if (SFXEnable) { fseek(fp, PHnum2writesfxreg + 131072, SEEK_CUR); }
   if (SA1Enable)
@@ -1104,7 +1104,7 @@
         if (uncompress(buffer, &data_size, compressed_buffer, compressed_size) == Z_OK)
         {
           uint8_t *data = buffer + PH65816regsize + 199635;
-          if (spcon)  { data += PHspcsave /*+ PHdspsave + sizeof(DSPMem)*/; }
+          //if (spcon)  { data += PHspcsave /*+ PHdspsave + sizeof(DSPMem)*/; }
           if (C4Enable) { data += 8192; }
           if (SFXEnable)  { data += PHnum2writesfxreg + 131072; }
           if (SA1Enable)
@@ -1373,8 +1373,8 @@
 10100h-101FFh - DSPRam (256 bytes)
 */
 
-extern uint8_t spcextraram[64];
-extern uint8_t spcP, spcA, spcX, spcY, spcS, spcNZ;
+//extern uint8_t spcextraram[64];
+//extern uint8_t spcP, spcA, spcX, spcY, spcS, spcNZ;
 extern uint32_t infoloc;
 
 char spcsaved[16];
@@ -1408,6 +1408,7 @@
       struct tm *lt = localtime(&t);
 
       //Assemble N/Z flags into P
+/*
       spcP &= 0xFD;
       if (!spcNZ)
       {
@@ -1418,16 +1419,17 @@
       {
         spcP |= 0x80;
       }
+*/
 
       strcpy((char *)ssdatst, "SNES-SPC700 Sound File Data v0.30"); //00000h - File Header : SNES-SPC700 Sound File Data v0.00
       ssdatst[0x21] = ssdatst[0x22] = ssdatst[0x23] = 0x1a; //00021h - 0x1a,0x1a,0x1a
       ssdatst[0x24] = 10;   //00024h - 10
-      *((uint16_t *)(ssdatst+0x25)) = spcPCRam-(uint32_t)SPCRAM; //00025h - PC Register value (1 Word)
-      ssdatst[0x27] = spcA; //00027h - A Register Value (1 byte)
-      ssdatst[0x28] = spcX; //00028h - X Register Value (1 byte)
-      ssdatst[0x29] = spcY; //00029h - Y Register Value (1 byte)
-      ssdatst[0x2A] = spcP; //0002Ah - Status Flags Value (1 byte)
-      ssdatst[0x2B] = spcS; //0002Bh - Stack Register Value (1 byte)
+      //*((uint16_t *)(ssdatst+0x25)) = spcPCRam-(uint32_t)SPCRAM; //00025h - PC Register value (1 Word)
+      //ssdatst[0x27] = spcA; //00027h - A Register Value (1 byte)
+      //ssdatst[0x28] = spcX; //00028h - X Register Value (1 byte)
+      //ssdatst[0x29] = spcY; //00029h - Y Register Value (1 byte)
+      //ssdatst[0x2A] = spcP; //0002Ah - Status Flags Value (1 byte)
+      //ssdatst[0x2B] = spcS; //0002Bh - Stack Register Value (1 byte)
 
       ssdatst[0x2C] = 0; //0002Ch - Reserved
       ssdatst[0x2D] = 0; //0002Dh - Reserved
@@ -1466,7 +1468,7 @@
       memset(ssdatst+0xD2, 0, 46); //000D2h-000FFh - Reserved
 
       fwrite(ssdatst, 1, sizeof(ssdatst), fp);
-      fwrite(SPCRAM, 1, 65536, fp); //00100h-100FFh - SPCRam
+      //fwrite(SPCRAM, 1, 65536, fp); //00100h-100FFh - SPCRam
 
       for (i = 0; i < 128; i++) //10100h-1017Fh - DSPRam
       {
@@ -1475,7 +1477,7 @@
 
       memset(ssdatst, 0, 64);
       fwrite(ssdatst, 64, 1, fp); //10180h-101BFh - Reserved
-      fwrite(spcextraram, 1, 64, fp); //101C0h-101FFh - IPL ROM image?
+      //fwrite(spcextraram, 1, 64, fp); //101C0h-101FFh - IPL ROM image?
       fclose(fp);
 
       ResetState();