DSP-4 Support (Quite buggy at the moment).

This commit is contained in:
n-a-c-h
2005-02-24 12:29:48 +00:00
parent 34446f2c33
commit 6a144dd8a2
5 changed files with 2372 additions and 4 deletions

View File

@@ -34,7 +34,8 @@ CHIPSOBJ=${CHIPDIR}/sfxproc.o ${CHIPDIR}/fxemu2.o ${CHIPDIR}/dsp1proc.o\
${CHIPDIR}/fxemu2b.o ${CHIPDIR}/fxemu2c.o ${CHIPDIR}/fxtable.o\ ${CHIPDIR}/fxemu2b.o ${CHIPDIR}/fxemu2c.o ${CHIPDIR}/fxtable.o\
${CHIPDIR}/sa1proc.o ${CHIPDIR}/sa1regs.o ${CHIPDIR}/dsp1emu.o\ ${CHIPDIR}/sa1proc.o ${CHIPDIR}/sa1regs.o ${CHIPDIR}/dsp1emu.o\
${CHIPDIR}/st10proc.o ${CHIPDIR}/seta10.o ${CHIPDIR}/dsp2proc.o\ ${CHIPDIR}/st10proc.o ${CHIPDIR}/seta10.o ${CHIPDIR}/dsp2proc.o\
${CHIPDIR}/sdd1emu.o ${CHIPDIR}/c4emu.o ${CHIPDIR}/sdd1emu.o ${CHIPDIR}/c4emu.o ${CHIPDIR}/dsp4proc.o\
${CHIPDIR}/dsp4emu.o
CPUOBJ=${CPUDIR}/addrni.o ${CPUDIR}/dma.o ${CPUDIR}/dsp.o ${CPUDIR}/dspproc.o\ CPUOBJ=${CPUDIR}/addrni.o ${CPUDIR}/dma.o ${CPUDIR}/dsp.o ${CPUDIR}/dspproc.o\
${CPUDIR}/execute.o ${CPUDIR}/irq.o ${CPUDIR}/memory.o\ ${CPUDIR}/execute.o ${CPUDIR}/irq.o ${CPUDIR}/memory.o\
@@ -115,6 +116,9 @@ ${CHIPDIR}/sfxproc.o: ${CHIPDIR}/sfxproc.asm macros.mac\
${CHIPDIR}/st10proc.o: ${CHIPDIR}/st10proc.asm macros.mac ${CHIPDIR}/st10proc.o: ${CHIPDIR}/st10proc.asm macros.mac
${CHIPDIR}/seta10.o: ${CHIPDIR}/seta10.c ${CHIPDIR}/seta10.o: ${CHIPDIR}/seta10.c
${CHIPDIR}/dsp1emu.o: ${CHIPDIR}/dsp1emu.c ${CHIPDIR}/dsp1emu.o: ${CHIPDIR}/dsp1emu.c
${CHIPDIR}/dsp4proc.o: ${CHIPDIR}/dsp4proc.asm macros.mac
${CHIPDIR}/dsp4emu.o: ${CHIPDIR}/dsp4emu.c
ui.o: ui.asm macros.mac ui.o: ui.asm macros.mac
cfgload.o:cfgload.c macros.mac cfgload.o:cfgload.c macros.mac
init.o:init.asm macros.mac init.o:init.asm macros.mac

2284
zsnes/src/chips/dsp4emu.c Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,62 @@
;Copyright (C) 1997-2005 ZSNES Team ( zsKnight, _Demo_, pagefault, Nach )
;
;http://www.zsnes.com
;http://sourceforge.net/projects/zsnes
;
;This program is free software; you can redistribute it and/or
;modify it under the terms of the GNU General Public License
;as published by the Free Software Foundation; either
;version 2 of the License, or (at your option) any later
;version.
;
;This program is distributed in the hope that it will be useful,
;but WITHOUT ANY WARRANTY; without even the implied warranty of
;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;GNU General Public License for more details.
;
;You should have received a copy of the GNU General Public License
;along with this program; if not, write to the Free Software
;Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
%include "macros.mac"
EXTSYM dsp4_address,dsp4_byte,DSP4GetByte,DSP4SetByte
NEWSYM DSP4Read8b
mov word[dsp4_address],cx
pushad
call DSP4GetByte
popad
mov al,byte[dsp4_byte]
ret
NEWSYM DSP4Write8b
mov word[dsp4_address],cx
mov byte[dsp4_byte],al
pushad
call DSP4SetByte
popad
ret
NEWSYM DSP4Read16b
mov word[dsp4_address],cx
pushad
call DSP4GetByte
popad
mov al,byte[dsp4_byte]
pushad
call DSP4GetByte
popad
mov ah,byte[dsp4_byte]
ret
;
NEWSYM DSP4Write16b
mov word[dsp4_address],cx
mov byte[dsp4_byte],al
pushad
call DSP4SetByte
mov byte[dsp4_byte],ah
call DSP4SetByte
popad
ret

View File

@@ -140,6 +140,8 @@ EXTSYM setaaccessbankr16,setaaccessbankw16,setaaccessbankr16a,setaaccessbankw16a
EXTSYM DSP2Read8b,DSP2Read16b,DSP2Write8b,DSP2Write16b,InitDSP2 EXTSYM DSP2Read8b,DSP2Read16b,DSP2Write8b,DSP2Write16b,InitDSP2
EXTSYM DSP4Read8b,DSP4Read16b,DSP4Write8b,DSP4Write16b,InitDSP4
%ifdef __LINUX__ %ifdef __LINUX__
EXTSYM LoadDir, popdir, pushdir EXTSYM LoadDir, popdir, pushdir
%endif %endif
@@ -3083,13 +3085,25 @@ NEWSYM CheckROMType
cmp byte[DSP3Enable],1 cmp byte[DSP3Enable],1
je .initdsp je .initdsp
cmp byte[DSP4Enable],1 cmp byte[DSP4Enable],1
je .initdsp pushad
; call InitDSP4 call InitDSP4
popad
xor ecx,ecx
.dsp4loop
mov dword[memtabler8+30h*4+ecx],DSP4Read8b
mov dword[memtablew8+30h*4+ecx],DSP4Write8b
mov dword[memtabler16+30h*4+ecx],DSP4Read16b
mov dword[memtablew16+30h*4+ecx],DSP4Write16b
add ecx,4
cmp ecx,16*4
jne .dsp4loop
jmp .notDSP1Hi jmp .notDSP1Hi
.initdsp2 .initdsp2
call InitDSP2 call InitDSP2
.initdsp .initdsp
pushad
call InitDSP call InitDSP
popad
mov byte[DSP1Type],1 mov byte[DSP1Type],1
cmp byte[romtype],2 cmp byte[romtype],2
jne .notDSP1Hi jne .notDSP1Hi

View File

@@ -147,7 +147,8 @@ CHIPSOBJ=${CHIPDIR}/dsp1emu${OE} ${CHIPDIR}/fxemu2${OE} ${CHIPDIR}/sfxproc${OE}\
${CHIPDIR}/fxemu2b${OE} ${CHIPDIR}/fxemu2c${OE} ${CHIPDIR}/fxtable${OE}\ ${CHIPDIR}/fxemu2b${OE} ${CHIPDIR}/fxemu2c${OE} ${CHIPDIR}/fxtable${OE}\
${CHIPDIR}/sa1proc${OE} ${CHIPDIR}/sa1regs${OE} ${CHIPDIR}/dsp1proc${OE}\ ${CHIPDIR}/sa1proc${OE} ${CHIPDIR}/sa1regs${OE} ${CHIPDIR}/dsp1proc${OE}\
${CHIPDIR}/st10proc${OE} ${CHIPDIR}/seta10${OE} ${CHIPDIR}/dsp2proc${OE}\ ${CHIPDIR}/st10proc${OE} ${CHIPDIR}/seta10${OE} ${CHIPDIR}/dsp2proc${OE}\
${CHIPDIR}/sdd1emu${OE} ${CHIPDIR}/c4emu${OE} ${CHIPDIR}/sdd1emu${OE} ${CHIPDIR}/c4emu${OE} ${CHIPDIR}/dsp4proc${OE}\
${CHIPDIR}/dsp4emu${OE}
CPUOBJ=${CPUDIR}/dma${OE} ${CPUDIR}/dsp${OE} ${CPUDIR}/dspproc${OE}\ CPUOBJ=${CPUDIR}/dma${OE} ${CPUDIR}/dsp${OE} ${CPUDIR}/dspproc${OE}\
${CPUDIR}/execute${OE} ${CPUDIR}/irq${OE} ${CPUDIR}/memory${OE}\ ${CPUDIR}/execute${OE} ${CPUDIR}/irq${OE} ${CPUDIR}/memory${OE}\
@@ -309,6 +310,9 @@ ${CHIPDIR}/fxemu2b${OE}: $< ${CHIPDIR}/fxemu2.mac ${CHIPDIR}/fxemu2b.mac
${CHIPDIR}/fxemu2c${OE}: $< macros.mac ${CHIPDIR}/fxemu2.mac ${CHIPDIR}/fxemu2b.mac ${CHIPDIR}/fxemu2c.mac ${CHIPDIR}/fxemu2c${OE}: $< macros.mac ${CHIPDIR}/fxemu2.mac ${CHIPDIR}/fxemu2b.mac ${CHIPDIR}/fxemu2c.mac
${CHIPDIR}/fxtable${OE}: $< macros.mac ${CHIPDIR}/fxtable${OE}: $< macros.mac
${CHIPDIR}/sa1proc${OE}: $< macros.mac ${CHIPDIR}/sa1proc${OE}: $< macros.mac
${CHIPDIR}/dsp4proc${OE}: $< macros.mac
${CHIPDIR}/dsp4emu${OE}: $<
${GUIDIR}/gui${OE}: $< ${GUIDIR}/guitools.inc\ ${GUIDIR}/gui${OE}: $< ${GUIDIR}/guitools.inc\
${GUIDIR}/guimisc.inc ${GUIDIR}/guimouse.inc ${GUIDIR}/guiwindp.inc\ ${GUIDIR}/guimisc.inc ${GUIDIR}/guimouse.inc ${GUIDIR}/guiwindp.inc\