Reverted to revision 2 of GB.cpp, on advice from Dwedit
git-svn-id: https://svn.code.sf.net/p/vbam/code/trunk@12 a31d4220-a93d-0410-bf67-fe4944624d44
This commit is contained in:
parent
0293de0a27
commit
615f4270be
|
@ -586,17 +586,12 @@ bool gbIsGameboyRom(char * file)
|
|||
|
||||
void gbCopyMemory(u16 d, u16 s, int count)
|
||||
{
|
||||
if (s>=0xE000 && s<0xFE00)
|
||||
{
|
||||
s-=0x2000;
|
||||
}
|
||||
while(count)
|
||||
{
|
||||
gbMemoryMap[d>>12][d & 0x0fff] = gbMemoryMap[s>>12][s & 0x0fff];
|
||||
s++;
|
||||
d++;
|
||||
count--;
|
||||
}
|
||||
while(count) {
|
||||
gbMemoryMap[d>>12][d & 0x0fff] = gbMemoryMap[s>>12][s & 0x0fff];
|
||||
s++;
|
||||
d++;
|
||||
count--;
|
||||
}
|
||||
}
|
||||
|
||||
void gbDoHdma()
|
||||
|
@ -674,16 +669,10 @@ void gbWriteMemory(register u16 address, register u8 value)
|
|||
return;
|
||||
}
|
||||
|
||||
if (address<0xE000)
|
||||
{
|
||||
gbMemoryMap[address>>12][address & 0x0fff] = value;
|
||||
return;
|
||||
}
|
||||
if(address < 0xfe00)
|
||||
{
|
||||
gbMemoryMap[(address-0x2000)>>12][address & 0x0fff] = value;
|
||||
return;
|
||||
}
|
||||
if(address < 0xfe00) {
|
||||
gbMemoryMap[address>>12][address & 0x0fff] = value;
|
||||
return;
|
||||
}
|
||||
|
||||
if(address < 0xff00) {
|
||||
gbMemory[address] = value;
|
||||
|
@ -1166,7 +1155,7 @@ u8 gbReadOpcode(register u16 address)
|
|||
if(gbCheatMap[address])
|
||||
return gbCheatRead(address);
|
||||
|
||||
switch((address>>12) & 0x000f) {
|
||||
switch(address & 0xf000) {
|
||||
case 0x0a:
|
||||
case 0x0b:
|
||||
if(mapperReadRAM)
|
||||
|
@ -1226,10 +1215,6 @@ u8 gbReadOpcode(register u16 address)
|
|||
}
|
||||
}
|
||||
break;
|
||||
if (address>=0xE000 && address<0xFE00)
|
||||
{
|
||||
return gbMemoryMap[(address-0x2000)>>12][address & 0x0fff];
|
||||
}
|
||||
}
|
||||
return gbMemoryMap[address>>12][address & 0x0fff];
|
||||
}
|
||||
|
@ -1395,11 +1380,8 @@ u8 gbReadMemory(register u16 address)
|
|||
case 0xff:
|
||||
return register_IE;
|
||||
}
|
||||
if (address>=0xE000 && address<0xFE00)
|
||||
{
|
||||
return gbMemoryMap[(address-0x2000)>>12][address & 0x0fff];
|
||||
}
|
||||
}
|
||||
|
||||
return gbMemoryMap[address>>12][address & 0x0fff];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue