Code cleanup, fixed jumps.

This commit is contained in:
n-a-c-h
2004-12-10 08:06:07 +00:00
parent 50e83650f7
commit 9ae1b814d3
5 changed files with 29 additions and 41 deletions

View File

@@ -138,7 +138,7 @@ SECTION .text
;*******************************************************
%macro CommandJmp 2
cmp al,%1
je %2
je near %2
%endmacro
%macro DevWriteX 1
@@ -246,7 +246,7 @@ NEWSYM DSP2Write8b
.enter
; Tests halt flag
test byte[dsp2state],DSP2F_HALT
jnz .halt
jnz near .halt
; *** Locates current predicator store
mov byte[dsp2input],al
@@ -263,7 +263,7 @@ NEWSYM DSP2Write8b
jnz .noaddrchk
; *** Tests whether cx points expected address
cmp [dsp2enforcer+4],cx
jne .gohalt
jne near .gohalt
.noaddrchk
; *** Reads next inside command should be proceeded
mov al,[dsp2enforcer]
@@ -300,7 +300,7 @@ NEWSYM DSP2Write8b
mov byte[dsp2f0dSizeNew],al
test al,al
jz .gohalt
jz near .gohalt
xor ecx,ecx
xor eax,eax
@@ -332,7 +332,7 @@ NEWSYM DSP2Write8b
mov byte[dsp2f0dSizeOrg],al
test al,al
jz .gohalt
jz near .gohalt
mov dword[dsp2enforcer+0],0Ah
mov dword[dsp2enforcer+4],8000h
@@ -374,7 +374,7 @@ NEWSYM DSP2Write8b
EnterInsideCommand 6
cmp byte[dsp2input],0
je .gohalt
je near .gohalt
xor eax,eax
xor ecx,ecx
@@ -435,7 +435,7 @@ NEWSYM DSP2Write8b
EnterInsideCommand 3
cmp byte[dsp2input],0
je .gohalt
je near .gohalt
xor eax,eax
.w03aloop

View File

@@ -1609,9 +1609,9 @@ SECTION .text
GUIPathKeys:
cmp dh,0
je .nokeypressed
je near .nokeypressed
cmp dword[GUIInputBox],0
je .nokeypressed
je near .nokeypressed
cmp dword[GUIInputBox],1
jne .notBox1

View File

@@ -2194,7 +2194,7 @@ DisplayGUIInputClick:
mov eax,dword[keycontrolval]
cmp dword[eax],0
pop eax
je .lockInputChange
je near .lockInputChange
DGOptnsProcBox 45,150,[edi]
DGOptnsProcBox 45,140,[edi+4]

View File

@@ -5621,7 +5621,7 @@ SECTION .text
call BlinkCursorCheck
cmp ebx,%4
pop ebx
jne %%fixreg
jne near %%fixreg
cmp byte[GUIBlinkCursor],' '
je %%three
mov byte[GUIBlinkCursor],' '

View File

@@ -167,22 +167,26 @@ void CheckIntl1(unsigned char *ROM)
}
}
void SwapData(unsigned int *loc1, unsigned int *loc2, unsigned int amount)
{
unsigned int temp, i;
for (i = 0; i < amount; i++)
{
temp = loc1[i];
loc1[i] = loc2[i];
loc2[i] = temp;
}
}
void CheckIntlEHi(unsigned char *ROM)
{
if (EHiHeader(ROM, Lo))
{
unsigned int temp, i, oldNumBanks = NumofBanks,
*loc1 = romdata,
*loc2 = romdata + ((NumofBytes - 0x400000)/4);
unsigned int oldNumBanks = NumofBanks;
//Swap 4MB ROM with the other one
for (i = 0; i < 0x100000; i++)
{
temp = loc1[i];
loc1[i] = loc2[i];
loc2[i] = temp;
}
SwapData(romdata, romdata+((NumofBytes-0x400000)/4), 0x100000);
//Deinterleave the 4MB ROM first
NumofBanks = 128;
deintlv1();
@@ -216,24 +220,8 @@ void intlv1()
//This is a mess, I wish we didn't need this, but it kicks the old asm code
void IntlEHi()
{
unsigned int temp, i,
*loc1 = romdata,
*loc2 = romdata + 0x100000;
for (i = 0; i < 0x80000; i++)
{
temp = loc1[i];
loc1[i] = loc2[i];
loc2[i] = temp;
}
loc1 = romdata + 0x80000;
loc2 = romdata + 0x100000;
for (i = 0; i < 0x80000; i++)
{
temp = loc1[i];
loc1[i] = loc2[i];
loc2[i] = temp;
}
SwapData(romdata, romdata + 0x100000, 0x80000);
SwapData(romdata + 0x80000, romdata + 0x100000, 0x80000);
NumofBanks = 64;
intlv1();
@@ -1467,7 +1455,7 @@ void SPC7_Convert_Upper()
char *i = SPC7110filep;
while (*i)
{
if (islower(*i)) { *i = toupper(*i); } //To make extension Upper case
*i = toupper(*i); //To make extension Upper case
i++;
}
}
@@ -1477,7 +1465,7 @@ void SPC7_Convert_Lower()
char *i = SPC7110filep;
while (*i)
{
if (isupper(*i)) { *i = tolower(*i); } //To make everything Lower case
*i = tolower(*i); //To make everything Lower case
i++;
}
}