fix a goof I made with the last commit, this should fix it

This commit is contained in:
thibeaz 2013-09-21 02:16:27 +00:00
parent ed00ced891
commit 6fccc53080
3 changed files with 26 additions and 14 deletions

View File

@ -234,7 +234,7 @@ void gbRenderLine()
if(y >= inUseRegister_WY) { if(y >= inUseRegister_WY) {
if (gbWindowLine>143) if ((gbWindowLine == -1) || (gbWindowLine>144))
gbWindowLine = 0; gbWindowLine = 0;
int wx = register_WX; int wx = register_WX;

View File

@ -119,9 +119,15 @@ static inline u32 CPUReadMemory(u32 address)
return eepromRead(address); return eepromRead(address);
goto unreadable; goto unreadable;
case 14: case 14:
case 15:
if(cpuFlashEnabled | cpuSramEnabled) if(cpuFlashEnabled | cpuSramEnabled)
// no need to swap this { // no need to swap this
#ifdef __libretro__
return flashRead(address); return flashRead(address);
#else
value = flashRead(address) * 0x01010101;
#endif
break
// default // default
default: default:
unreadable: unreadable:
@ -266,9 +272,16 @@ static inline u32 CPUReadHalfWord(u32 address)
return eepromRead(address); return eepromRead(address);
goto unreadable; goto unreadable;
case 14: case 14:
case 15:
if(cpuFlashEnabled | cpuSramEnabled) if(cpuFlashEnabled | cpuSramEnabled)
// no need to swap this // no need to swap this
{
#ifdef __libretro__
return flashRead(address); return flashRead(address);
#else
value = flashRead(address) * 0x0101;
#endif
}
// default // default
default: default:
unreadable: unreadable:
@ -305,22 +318,17 @@ unreadable:
static inline s16 CPUReadHalfWordSigned(u32 address) static inline s16 CPUReadHalfWordSigned(u32 address)
{ {
u32 oldAddress = address; s32 value = (s32)CPUReadHalfWord(address);
if(address & 1) { if((address & 1))
address &= ~0x01;
}
s16 value = (s16)CPUReadHalfWord(address);
if((oldAddress & 1))
{ {
value = (s8)value;
#ifdef GBA_LOGGING #ifdef GBA_LOGGING
if(systemVerbose & VERBOSE_UNALIGNED_MEMORY) { if(systemVerbose & VERBOSE_UNALIGNED_MEMORY) {
log("Unaligned signed halfword read from: %08x at %08x (%08x)\n", oldAddress, armMode ? log("Unaligned signed halfword read from: %08x at %08x (%08x)\n", address, armMode ?
armNextPC - 4 : armNextPC - 2, value); armNextPC - 4 : armNextPC - 2, value);
} }
#endif #endif
} }
return value; return (s16)value;
} }
static inline u8 CPUReadByte(u32 address) static inline u8 CPUReadByte(u32 address)
@ -369,6 +377,7 @@ static inline u8 CPUReadByte(u32 address)
return eepromRead(address); return eepromRead(address);
goto unreadable; goto unreadable;
case 14: case 14:
case 15:
if(cpuSramEnabled | cpuFlashEnabled) if(cpuSramEnabled | cpuFlashEnabled)
return flashRead(address); return flashRead(address);
if(cpuEEPROMSensorEnabled) { if(cpuEEPROMSensorEnabled) {
@ -486,6 +495,7 @@ static inline void CPUWriteMemory(u32 address, u32 value)
} }
goto unwritable; goto unwritable;
case 0x0E: case 0x0E:
case 0x0F:
if((!eepromInUse) | cpuSramEnabled | cpuFlashEnabled) { if((!eepromInUse) | cpuSramEnabled | cpuFlashEnabled) {
(*cpuSaveGameFunc)(address, (u8)value); (*cpuSaveGameFunc)(address, (u8)value);
break; break;
@ -590,6 +600,7 @@ static inline void CPUWriteHalfWord(u32 address, u16 value)
} }
goto unwritable; goto unwritable;
case 14: case 14:
case 15:
if((!eepromInUse) | cpuSramEnabled | cpuFlashEnabled) { if((!eepromInUse) | cpuSramEnabled | cpuFlashEnabled) {
(*cpuSaveGameFunc)(address, (u8)value); (*cpuSaveGameFunc)(address, (u8)value);
break; break;
@ -726,6 +737,7 @@ static inline void CPUWriteByte(u32 address, u8 b)
} }
goto unwritable; goto unwritable;
case 14: case 14:
case 15:
if ((saveType != 5) && ((!eepromInUse) | cpuSramEnabled | cpuFlashEnabled)) { if ((saveType != 5) && ((!eepromInUse) | cpuSramEnabled | cpuFlashEnabled)) {
//if(!cpuEEPROMEnabled && (cpuSramEnabled | cpuFlashEnabled)) { //if(!cpuEEPROMEnabled && (cpuSramEnabled | cpuFlashEnabled)) {

View File

@ -345,9 +345,9 @@ bool OpenGLDisplay::initialize()
cpu_mmx = 0; cpu_mmx = 0;
#endif #endif
systemRedShift = 3; systemRedShift = 19;
systemGreenShift = 11; systemGreenShift = 11;
systemBlueShift = 19; systemBlueShift = 3;
systemColorDepth = 32; systemColorDepth = 32;
theApp.fsColorDepth = 32; theApp.fsColorDepth = 32;
@ -401,7 +401,7 @@ void OpenGLDisplay::render()
} else { } else {
glPixelStorei( GL_UNPACK_ROW_LENGTH, theApp.sizeX + 1 ); glPixelStorei( GL_UNPACK_ROW_LENGTH, theApp.sizeX + 1 );
} }
glTexSubImage2D(GL_TEXTURE_2D,0,0,0,width,height,GL_RGBA,GL_UNSIGNED_BYTE,data ); glTexSubImage2D(GL_TEXTURE_2D,0,0,0,width,height,GL_BGRA,GL_UNSIGNED_BYTE,data );
glBegin( GL_QUADS ); glBegin( GL_QUADS );