SPC700 fixes [pagefault]. DMA fix [pagefault]. cleanup [Nach].
This commit is contained in:
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
EXTSYM memtabler8,regptw,snesmap2,snesmmap,memtablew8,regptr,memtabler16
|
EXTSYM memtabler8,regptw,snesmap2,snesmmap,memtablew8,regptr,memtabler16
|
||||||
EXTSYM dmadata,hdmatype,nexthdma,resolutn
|
EXTSYM dmadata,hdmatype,nexthdma,resolutn
|
||||||
EXTSYM curhdma,curypos,disablehdma,hdmadata,hdmadelay,hdmaearlstart
|
EXTSYM curhdma,curypos,disablehdma,hdmadata,hdmadelay
|
||||||
|
|
||||||
;*******************************************************
|
;*******************************************************
|
||||||
; Transfer DMA Inits & Transfers DMA
|
; Transfer DMA Inits & Transfers DMA
|
||||||
@@ -859,7 +859,7 @@ NEWSYM reg420Cw
|
|||||||
jz .notransh
|
jz .notransh
|
||||||
call setuphdma
|
call setuphdma
|
||||||
.notransh
|
.notransh
|
||||||
mov bl,[hdmaearlstart]
|
mov bl,1
|
||||||
mov [hdmadelay],bl
|
mov [hdmadelay],bl
|
||||||
pop edx
|
pop edx
|
||||||
pop ecx
|
pop ecx
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ EXTSYM SetupPreGame,memtablew8,regaccessbankr8,showmenu,snesmap2,snesmmap
|
|||||||
EXTSYM DeInitPostGame,spcPCRam,startdebugger,xp,xpb,xpc,tablead,tableadb
|
EXTSYM DeInitPostGame,spcPCRam,startdebugger,xp,xpb,xpc,tablead,tableadb
|
||||||
EXTSYM tableadc,SA1UpdateDPage,Makemode7Table,nextmenupopup,MovieProcessing
|
EXTSYM tableadc,SA1UpdateDPage,Makemode7Table,nextmenupopup,MovieProcessing
|
||||||
EXTSYM OSExit,DosExit,InitDir,InitDrive,createnewcfg,sfxramdata,deinitvideo
|
EXTSYM OSExit,DosExit,InitDir,InitDrive,createnewcfg,sfxramdata,deinitvideo
|
||||||
EXTSYM SFXEnable,wramdata,cycpbl,cycpblt,irqon,spcnumread,spchalted,spcon
|
EXTSYM SFXEnable,wramdata,cycpbl,cycpblt,irqon,spcnumread,spcon
|
||||||
EXTSYM multchange,romispal,scrndis,sprlefttot,sprleftpr,processsprites
|
EXTSYM multchange,romispal,scrndis,sprlefttot,sprleftpr,processsprites
|
||||||
EXTSYM cachesprites,NextLineStart,FlipWait,LastLineStart,opcjmptab,CheatOn
|
EXTSYM cachesprites,NextLineStart,FlipWait,LastLineStart,opcjmptab,CheatOn
|
||||||
EXTSYM INTEnab,JoyCRead,NMIEnab,NumCheats,CurrentExecSA1,ReadInputDevice
|
EXTSYM INTEnab,JoyCRead,NMIEnab,NumCheats,CurrentExecSA1,ReadInputDevice
|
||||||
@@ -80,8 +80,7 @@ NEWSYM ResetExecStuff
|
|||||||
mov dword[nmiprevline],224
|
mov dword[nmiprevline],224
|
||||||
mov dword[nmistatus],0
|
mov dword[nmistatus],0
|
||||||
mov byte[NextLineCache],0
|
mov byte[NextLineCache],0
|
||||||
mov dword[spcnumread],0
|
mov byte[spcnumread],0
|
||||||
mov dword[spchalted],-1
|
|
||||||
mov dword[timer2upd],0
|
mov dword[timer2upd],0
|
||||||
mov dword[HIRQCycNext],0
|
mov dword[HIRQCycNext],0
|
||||||
mov byte[HIRQNextExe],0
|
mov byte[HIRQNextExe],0
|
||||||
|
|||||||
@@ -746,8 +746,7 @@ reg2140r:
|
|||||||
je .nosound
|
je .nosound
|
||||||
inc dword[SPC700read]
|
inc dword[SPC700read]
|
||||||
mov al,[reg1read]
|
mov al,[reg1read]
|
||||||
mov dword[spcnumread],0
|
mov byte[spcnumread],0
|
||||||
; mov dword[spchalted],-1
|
|
||||||
ret
|
ret
|
||||||
.nosound
|
.nosound
|
||||||
; Find for D0
|
; Find for D0
|
||||||
@@ -786,8 +785,7 @@ reg2141r:
|
|||||||
je .nosound
|
je .nosound
|
||||||
inc dword[SPC700read]
|
inc dword[SPC700read]
|
||||||
mov al,[reg2read]
|
mov al,[reg2read]
|
||||||
mov dword[spcnumread],0
|
mov byte[spcnumread],0
|
||||||
; mov dword[spchalted],-1
|
|
||||||
ret
|
ret
|
||||||
.nosound
|
.nosound
|
||||||
; Find for D0
|
; Find for D0
|
||||||
@@ -818,8 +816,7 @@ reg2142r:
|
|||||||
je .nosound
|
je .nosound
|
||||||
inc dword[SPC700read]
|
inc dword[SPC700read]
|
||||||
mov al,[reg3read]
|
mov al,[reg3read]
|
||||||
mov dword[spcnumread],0
|
mov byte[spcnumread],0
|
||||||
; mov dword[spchalted],-1
|
|
||||||
ret
|
ret
|
||||||
.nosound
|
.nosound
|
||||||
; Find for D0
|
; Find for D0
|
||||||
@@ -849,8 +846,7 @@ reg2143r:
|
|||||||
je .nosound
|
je .nosound
|
||||||
inc dword[SPC700read]
|
inc dword[SPC700read]
|
||||||
mov al,[reg4read]
|
mov al,[reg4read]
|
||||||
mov dword[spcnumread],0
|
mov byte[spcnumread],0
|
||||||
; mov dword[spchalted],-1
|
|
||||||
ret
|
ret
|
||||||
.nosound
|
.nosound
|
||||||
; Find for D0
|
; Find for D0
|
||||||
|
|||||||
@@ -22,8 +22,8 @@
|
|||||||
|
|
||||||
%include "macros.mac"
|
%include "macros.mac"
|
||||||
|
|
||||||
EXTSYM DSPMem,spcWptr,disablespcclr,SPCSkipXtraROM,SPC700sh,cycpbl,spcRptr
|
EXTSYM DSPMem,spcWptr,disablespcclr,SPCSkipXtraROM,cycpbl,spcRptr
|
||||||
EXTSYM spc700read,dspWptr,curexecstate,tableadb
|
EXTSYM spc700read,dspWptr,curexecstate
|
||||||
|
|
||||||
%include "cpu/regsw.mac"
|
%include "cpu/regsw.mac"
|
||||||
%include "cpu/spcdef.inc"
|
%include "cpu/spcdef.inc"
|
||||||
@@ -224,8 +224,6 @@ NEWSYM updatetimer
|
|||||||
mov [timinl0],al
|
mov [timinl0],al
|
||||||
cmp byte[SPCRAM+0FDh],1
|
cmp byte[SPCRAM+0FDh],1
|
||||||
jne .noin0
|
jne .noin0
|
||||||
; cmp byte[spchalted],0
|
|
||||||
; jz .noin0
|
|
||||||
reenablespc
|
reenablespc
|
||||||
mov dword[cycpbl],0
|
mov dword[cycpbl],0
|
||||||
.noin0
|
.noin0
|
||||||
@@ -238,8 +236,6 @@ NEWSYM updatetimer
|
|||||||
mov [timinl1],al
|
mov [timinl1],al
|
||||||
cmp byte[SPCRAM+0FEh],1
|
cmp byte[SPCRAM+0FEh],1
|
||||||
jne .noin1
|
jne .noin1
|
||||||
; cmp byte[spchalted+1],0
|
|
||||||
; jz .noin1
|
|
||||||
reenablespc
|
reenablespc
|
||||||
mov dword[cycpbl],0
|
mov dword[cycpbl],0
|
||||||
.noin1
|
.noin1
|
||||||
@@ -253,8 +249,6 @@ NEWSYM updatetimer
|
|||||||
mov [timinl2],al
|
mov [timinl2],al
|
||||||
cmp byte[SPCRAM+0FFh],1
|
cmp byte[SPCRAM+0FFh],1
|
||||||
jne .noin2
|
jne .noin2
|
||||||
; cmp byte[spchalted+2],0
|
|
||||||
; jz .noin2
|
|
||||||
reenablespc
|
reenablespc
|
||||||
mov dword[cycpbl],0
|
mov dword[cycpbl],0
|
||||||
.noin2
|
.noin2
|
||||||
@@ -265,8 +259,6 @@ NEWSYM updatetimer
|
|||||||
mov [timinl2],al
|
mov [timinl2],al
|
||||||
cmp byte[SPCRAM+0FFh],1
|
cmp byte[SPCRAM+0FFh],1
|
||||||
jne .noin2b
|
jne .noin2b
|
||||||
; cmp byte[spchalted+2],0
|
|
||||||
; jz .noin2b
|
|
||||||
reenablespc
|
reenablespc
|
||||||
mov dword[cycpbl],0
|
mov dword[cycpbl],0
|
||||||
.noin2b
|
.noin2b
|
||||||
@@ -277,8 +269,6 @@ NEWSYM updatetimer
|
|||||||
mov [timinl2],al
|
mov [timinl2],al
|
||||||
cmp byte[SPCRAM+0FFh],1
|
cmp byte[SPCRAM+0FFh],1
|
||||||
jne .noin2c
|
jne .noin2c
|
||||||
; cmp byte[spchalted+2],0
|
|
||||||
; jz .noin2c
|
|
||||||
reenablespc
|
reenablespc
|
||||||
mov dword[cycpbl],0
|
mov dword[cycpbl],0
|
||||||
.noin2c
|
.noin2c
|
||||||
@@ -289,8 +279,6 @@ NEWSYM updatetimer
|
|||||||
mov [timinl2],al
|
mov [timinl2],al
|
||||||
cmp byte[SPCRAM+0FFh],1
|
cmp byte[SPCRAM+0FFh],1
|
||||||
jne .noin2d
|
jne .noin2d
|
||||||
; cmp byte[spchalted+2],0
|
|
||||||
; jz .noin2d
|
|
||||||
reenablespc
|
reenablespc
|
||||||
mov dword[cycpbl],0
|
mov dword[cycpbl],0
|
||||||
.noin2d
|
.noin2d
|
||||||
@@ -479,75 +467,29 @@ NEWSYM RSPCRegFC
|
|||||||
mov al,[SPCRAM+0fch]
|
mov al,[SPCRAM+0fch]
|
||||||
ret
|
ret
|
||||||
|
|
||||||
%macro skipmacro 1
|
|
||||||
.spcnextskip
|
|
||||||
test byte[timeron],1<<%1
|
|
||||||
je .ret
|
|
||||||
cmp byte[timincr0+%1],0
|
|
||||||
je .ret
|
|
||||||
;cmp byte[SpeedHack],0
|
|
||||||
;je .ret
|
|
||||||
inc byte[spcnumread+%1]
|
|
||||||
cmp byte[spcnumread+%1],8h
|
|
||||||
je near haltspc
|
|
||||||
.ret
|
|
||||||
ret
|
|
||||||
%endmacro
|
|
||||||
|
|
||||||
ALIGN16
|
|
||||||
NEWSYM haltspc
|
|
||||||
cmp byte[SPC700sh],1
|
|
||||||
je .nochangestate
|
|
||||||
mov dword[cycpbl],0FFFFFFFFh
|
|
||||||
test byte[curexecstate],02h
|
|
||||||
jz .nochangestate
|
|
||||||
and byte[curexecstate],0FDh
|
|
||||||
push ebx
|
|
||||||
|
|
||||||
mov ebx,[spcnumread]
|
|
||||||
mov [spchalted],ebx
|
|
||||||
|
|
||||||
xor ebx,ebx
|
|
||||||
mov bl,dl
|
|
||||||
mov edi,[tableadb+ebx*4]
|
|
||||||
pop ebx
|
|
||||||
.nochangestate
|
|
||||||
mov dword[spcnumread],0
|
|
||||||
ret
|
|
||||||
|
|
||||||
NEWSYM RSPCRegFD
|
NEWSYM RSPCRegFD
|
||||||
mov al,[SPCRAM+0fdh]
|
mov al,[SPCRAM+0fdh]
|
||||||
and al,0Fh
|
and al,0Fh
|
||||||
cmp byte[SPCRAM+0fdh],0
|
|
||||||
je .spcnextskip
|
|
||||||
mov byte[SPCRAM+0fdh],0
|
mov byte[SPCRAM+0fdh],0
|
||||||
mov byte[spcnumread],0
|
mov byte[spcnumread],0
|
||||||
ret
|
ret
|
||||||
skipmacro 0
|
|
||||||
|
|
||||||
NEWSYM RSPCRegFE
|
NEWSYM RSPCRegFE
|
||||||
mov al,[SPCRAM+0feh]
|
mov al,[SPCRAM+0feh]
|
||||||
and al,0Fh
|
and al,0Fh
|
||||||
cmp byte[SPCRAM+0feh],0
|
|
||||||
je .spcnextskip
|
|
||||||
mov byte[SPCRAM+0feh],0
|
mov byte[SPCRAM+0feh],0
|
||||||
mov byte[spcnumread],0
|
mov byte[spcnumread],0
|
||||||
ret
|
ret
|
||||||
skipmacro 1
|
|
||||||
|
|
||||||
NEWSYM RSPCRegFF
|
NEWSYM RSPCRegFF
|
||||||
mov al,[SPCRAM+0ffh]
|
mov al,[SPCRAM+0ffh]
|
||||||
and al,0Fh
|
and al,0Fh
|
||||||
cmp byte[SPCRAM+0ffh],0
|
|
||||||
je .spcnextskip
|
|
||||||
mov byte[SPCRAM+0ffh],0
|
mov byte[SPCRAM+0ffh],0
|
||||||
mov byte[spcnumread],0
|
mov byte[spcnumread],0
|
||||||
ret
|
ret
|
||||||
skipmacro 2
|
|
||||||
|
|
||||||
SECTION .data
|
SECTION .data
|
||||||
NEWSYM spcnumread, dd 0
|
NEWSYM spcnumread, db 0
|
||||||
NEWSYM spchalted, dd 0
|
|
||||||
SECTION .text
|
SECTION .text
|
||||||
|
|
||||||
%macro SPCSetFlagnzc 0
|
%macro SPCSetFlagnzc 0
|
||||||
|
|||||||
Reference in New Issue
Block a user