Some optimization.

This commit is contained in:
n-a-c-h
2005-02-27 02:25:07 +00:00
parent b080385896
commit 142536770e
2 changed files with 207 additions and 212 deletions

View File

@@ -2061,8 +2061,6 @@ void InitDSP4()
} }
void DSP4SetByte() void DSP4SetByte()
{
if ((dsp4_address & 0xf000) == 0x6000 || (dsp4_address >= 0x8000 && dsp4_address < 0xc000))
{ {
// clear pending read // clear pending read
if (DSP4.out_index < DSP4.out_count) if (DSP4.out_index < DSP4.out_count)
@@ -2260,11 +2258,8 @@ void DSP4SetByte()
} }
} }
} }
}
void DSP4GetByte() void DSP4GetByte()
{
if ((dsp4_address & 0xf000) == 0x6000 || (dsp4_address >= 0x8000 && dsp4_address < 0xc000))
{ {
if (DSP4.out_count) if (DSP4.out_count)
{ {
@@ -2278,8 +2273,3 @@ void DSP4GetByte()
dsp4_byte = 0xff; dsp4_byte = 0xff;
} }
} }
else
{
dsp4_byte = 0x80;
}
}

View File

@@ -25,11 +25,25 @@ EXTSYM regaccessbankr16,regaccessbankr8,regaccessbankw16,regaccessbankw8
SECTION .text SECTION .text
NEWSYM DSP4Read8b %macro RouteAccess 1
test ecx,8000h test ecx,08000h
jnz .dsp4area jnz .dsp4area
jmp regaccessbankr8 jmp %1
.dsp4area .dsp4area
mov dx,cx
and dx,0C000h
cmp dx,08000h
je .dsp4continue
mov dx,cx
and dx,0F000h
cmp dx,06000h
je .dsp4continue
ret
.dsp4continue
%endmacro
NEWSYM DSP4Read8b
RouteAccess regaccessbankr8
mov word[dsp4_address],cx mov word[dsp4_address],cx
pushad pushad
call DSP4GetByte call DSP4GetByte
@@ -38,10 +52,7 @@ NEWSYM DSP4Read8b
ret ret
NEWSYM DSP4Write8b NEWSYM DSP4Write8b
test ecx,8000h RouteAccess regaccessbankw8
jnz .dsp4area
jmp regaccessbankw8
.dsp4area
mov word[dsp4_address],cx mov word[dsp4_address],cx
mov byte[dsp4_byte],al mov byte[dsp4_byte],al
pushad pushad
@@ -50,10 +61,7 @@ NEWSYM DSP4Write8b
ret ret
NEWSYM DSP4Read16b NEWSYM DSP4Read16b
test ecx,8000h RouteAccess regaccessbankr16
jnz .dsp4area
jmp regaccessbankr16
.dsp4area
mov word[dsp4_address],cx mov word[dsp4_address],cx
pushad pushad
call DSP4GetByte call DSP4GetByte
@@ -67,10 +75,7 @@ NEWSYM DSP4Read16b
ret ret
NEWSYM DSP4Write16b NEWSYM DSP4Write16b
test ecx,8000h RouteAccess regaccessbankw16
jnz .dsp4area
jmp regaccessbankw16
.dsp4area
mov word[dsp4_address],cx mov word[dsp4_address],cx
mov byte[dsp4_byte],al mov byte[dsp4_byte],al
mov byte[dsp4temp],ah mov byte[dsp4temp],ah