From 9b994d559aea3d9e7c33766b199ed1665c91eba8 Mon Sep 17 00:00:00 2001 From: pagefault <> Date: Mon, 3 Dec 2001 18:59:53 +0000 Subject: [PATCH] Fixed bug in H-DMA code --- zsnes/src/cpu/dma.asm | 5 +++-- zsnes/src/init.asm | 42 ------------------------------------------ 2 files changed, 3 insertions(+), 44 deletions(-) diff --git a/zsnes/src/cpu/dma.asm b/zsnes/src/cpu/dma.asm index bb72948f..9a2834c5 100644 --- a/zsnes/src/cpu/dma.asm +++ b/zsnes/src/cpu/dma.asm @@ -23,7 +23,7 @@ EXTSYM memtablew8,regptr EXTSYM dmadata EXTSYM hdmatype EXTSYM nexthdma -EXTSYM curhdma,curypos,disablehdma,hdmadata,hdmadelay,hdmaearlstart +EXTSYM curhdma,curypos,pdh,cycphb,hdmadata,hdmadelay,hdmaearlstart EXTSYM resolutn EXTSYM memtabler16 @@ -778,7 +778,8 @@ NEWSYM reg420Cw mov bx,[resolutn] cmp word[curypos],bx jae near .nohdma - cmp byte[disablehdma],0 + mov dh,[pdh] + cmp dh,[cycphb] jne near .nohdma ; jmp starthdma mov al,[curhdma] diff --git a/zsnes/src/init.asm b/zsnes/src/init.asm index 437c0a39..865a63c8 100644 --- a/zsnes/src/init.asm +++ b/zsnes/src/init.asm @@ -1320,7 +1320,6 @@ NEWSYM StoreBuffer, times 128*32 db 0 SECTION .data NEWSYM execatzerovirq, db 0 -NEWSYM disablehdma, db 0 NEWSYM disableeffects, db 0 NEWSYM hdmaearlstart, db 0 NEWSYM hdmadelay, db 0 @@ -1452,7 +1451,6 @@ headerhack2: .mmx2head db 50,58,56,62,50,62,49,95,39,77,95,95,95,95,95,95,95,95,95,95 NEWSYM headerhack - mov byte[disablehdma],0 mov byte[Offby1line],0 mov byte[CacheCheckSkip],0 mov word[IRQHack],0 @@ -1618,30 +1616,6 @@ NEWSYM headerhack mov byte[opexec358],187 .notds9 - mov esi,[romdata] - add esi,0FFC0h - cmp dword[esi],'Baha' - jne .notbahamutlagoon - cmp dword[esi+4],'mut ' - jne .notbahamutlagoon - cmp dword[esi+8],'Lago' - jne .notbahamutlagoon - mov byte[disablehdma],1 -.notbahamutlagoon - - mov esi,[romdata] - add esi,07FC0h - cmp dword[esi],'MORT' - jne .notmk - cmp dword[esi+4],'AL K' - jne .notmk - cmp dword[esi+8],'OMBA' - jne .notmk - cmp dword[esi+12],'T ' - jne .notmk - mov byte[disablehdma],1 -.notmk - mov esi,[romdata] add esi,0FFC0h cmp dword[esi],'CLOC' @@ -1718,11 +1692,6 @@ NEWSYM headerhack mov byte[cycpblt],75 .nottuffenuff - cmp byte[DSP1Type],0 - je .notdis - mov byte[disablehdma],1 -.notdis - ; Here are the individual game hacks. Some of these probably can ; be removed since many of them were created very early in ZSNES ; development. @@ -1848,16 +1817,6 @@ NEWSYM headerhack mov byte[opexec358cph],44 .noromhead5 - ; PunchOut - Disable HDMA start in middle of screen - mov esi,[romdata] - add esi,07FC0h - mov edi,.pouthead - call Checkheadersame - cmp al,0 - jne .noromhead7 - mov byte[disablehdma],1 -.noromhead7 - ; Front Mission - -p 140 mov esi,[romdata] add esi,0FFC0h @@ -2069,7 +2028,6 @@ NEWSYM init65816 mov byte[prevoamptr],0FFh mov byte[execatzerovirq],0 - mov byte[disablehdma],0 mov byte[disableeffects],0 mov byte[dracxhack],0 mov al,[opexec268b]