Fixes for DMA, so we can have the recent improvements without breaking tons of other game. (SSF2, SFA2, FFMQ, TOP, CT, YI, Probably others). [pagefault]

This commit is contained in:
n-a-c-h
2005-11-05 18:16:34 +00:00
parent 71ef4571ba
commit b6b65849f1
5 changed files with 6616 additions and 6603 deletions

View File

@@ -22,7 +22,8 @@
EXTSYM memtabler8,regptw,snesmap2,snesmmap,memtablew8,regptr,memtabler16
EXTSYM dmadata,hdmatype,nexthdma,resolutn
EXTSYM curhdma,curypos,disablehdma,hdmadata,hdmadelay
EXTSYM curhdma,curypos,disablehdma,hdmadata,hdmadelay,hdmastartsc,hdmarestart
EXTSYM nohdmaframe
;*******************************************************
; Transfer DMA Inits & Transfers DMA
@@ -778,23 +779,16 @@ section .data
dw 0,1,2,3
.addrnumt db 1,2,2,4,4,4,4,4
section .bss
NEWSYM hdmastartsc, resb 1
NEWSYM hdmarestart, resb 1
section .text
NEWSYM reg420Cw
mov [curhdma],al
mov bx,[resolutn]
cmp word[curypos],bx
jae near .nohdma
mov al,[curhdma]
cmp byte[disablehdma],0
jne near .nohdma
; jmp starthdma
mov al,[curhdma]
mov [nexthdma],al
cmp al,0
je near .nohdma
@@ -859,8 +853,6 @@ NEWSYM reg420Cw
jz .notransh
call setuphdma
.notransh
mov bl,1
mov [hdmadelay],bl
pop edx
pop ecx
pop edi
@@ -869,6 +861,11 @@ NEWSYM reg420Cw
; call exechdma
; call exechdma
.nohdma
cmp byte[nohdmaframe],1
jne .notframe
inc byte[hdmadelay]
.notframe
mov byte[hdmarestart],0
ret

View File

@@ -1553,6 +1553,9 @@ NEWSYM cpuover
mov ax,[resolutn]
cmp word[curypos],ax
jnb .nodrawline
cmp byte[hdmadelay],1
jne .virqstuff
.virqstuff
cmp byte[hdmadelay],0
je .dohdma2
dec byte[hdmadelay]

View File

@@ -406,9 +406,12 @@ NEWSYM poamaddrs, dw 0
NEWSYM ioportval, db 255
NEWSYM iohvlatch, db 0
NEWSYM ppustatus, db 0
NEWSYM hdmastartsc, db 0
NEWSYM hdmarestart, db 0
NEWSYM hdmadelay, db 0
NEWSYM nohdmaframe, db 0 ; no hdma for current frame
NEWSYM tempdat, times 477 db 0 ; expandable area
NEWSYM tempdat, times 474 db 0 ; expandable area
num2writeppureg equ $-sndrot
; pharos equ hack *sigh*
@@ -479,6 +482,10 @@ NEWSYM ClearRegs
mov word[bg3objptr],0
mov word[bg4objptr],0
mov byte[ioportval],0FFh
mov byte[hdmastartsc],0
mov byte[hdmarestart],0
mov byte[nohdmaframe],0
mov byte[hdmadelay],0
ret
reg2100r:

View File

@@ -24,7 +24,7 @@ EXTSYM initsfxregsw,reg420Bw,reg420Cw,regptw,initSA1regsw,SDD1Reset
EXTSYM SPC7110Reset,RTCReset2,debstop,NextLineCache,vidmemch2,vidmemch4
EXTSYM vidmemch8,vrama,nmirept,sndwrit,SPCRAM,HIRQCycNext,HIRQNextExe,HIRQSkip
EXTSYM cycpb268,cycpb358,cycpbl,cycpblt,opexec268,opexec268cph,opexec358
EXTSYM opexec358cph,hdmarestart,printhex8
EXTSYM opexec358cph,printhex8
SECTION .bss
NEWSYM testgfxv1, resb 1
@@ -1675,10 +1675,17 @@ reg43x9w:
; Number of lines for HDMA transfer
reg43XAw:
mov byte[nohdmaframe],0
xor ebx,ebx
mov bx,cx
sub bx,4300h
mov [dmadata+ebx],al
mov bx,[resolutn]
cmp word[curypos],bx
jb .nodma
mov byte[nohdmaframe],1
inc byte[hdmadelay]
.nodma
ret
regINVALIDw: ; Invalid Register

View File

@@ -996,7 +996,6 @@ SECTION .data
NEWSYM disablehdma, db 0
NEWSYM disableeffects, db 0
NEWSYM hdmaearlstart, db 0
NEWSYM hdmadelay, db 0
NEWSYM disable65816sh, db 0
NEWSYM disablespcclr, db 0
NEWSYM virqnodisable, db 0