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 (gbWindowLine>143)
if ((gbWindowLine == -1) || (gbWindowLine>144))
gbWindowLine = 0;
int wx = register_WX;

View File

@ -119,9 +119,15 @@ static inline u32 CPUReadMemory(u32 address)
return eepromRead(address);
goto unreadable;
case 14:
case 15:
if(cpuFlashEnabled | cpuSramEnabled)
// no need to swap this
{ // no need to swap this
#ifdef __libretro__
return flashRead(address);
#else
value = flashRead(address) * 0x01010101;
#endif
break
// default
default:
unreadable:
@ -266,9 +272,16 @@ static inline u32 CPUReadHalfWord(u32 address)
return eepromRead(address);
goto unreadable;
case 14:
case 15:
if(cpuFlashEnabled | cpuSramEnabled)
// no need to swap this
{
#ifdef __libretro__
return flashRead(address);
#else
value = flashRead(address) * 0x0101;
#endif
}
// default
default:
unreadable:
@ -305,22 +318,17 @@ unreadable:
static inline s16 CPUReadHalfWordSigned(u32 address)
{
u32 oldAddress = address;
if(address & 1) {
address &= ~0x01;
}
s16 value = (s16)CPUReadHalfWord(address);
if((oldAddress & 1))
s32 value = (s32)CPUReadHalfWord(address);
if((address & 1))
{
value = (s8)value;
#ifdef GBA_LOGGING
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);
}
#endif
}
return value;
return (s16)value;
}
static inline u8 CPUReadByte(u32 address)
@ -369,6 +377,7 @@ static inline u8 CPUReadByte(u32 address)
return eepromRead(address);
goto unreadable;
case 14:
case 15:
if(cpuSramEnabled | cpuFlashEnabled)
return flashRead(address);
if(cpuEEPROMSensorEnabled) {
@ -486,6 +495,7 @@ static inline void CPUWriteMemory(u32 address, u32 value)
}
goto unwritable;
case 0x0E:
case 0x0F:
if((!eepromInUse) | cpuSramEnabled | cpuFlashEnabled) {
(*cpuSaveGameFunc)(address, (u8)value);
break;
@ -590,6 +600,7 @@ static inline void CPUWriteHalfWord(u32 address, u16 value)
}
goto unwritable;
case 14:
case 15:
if((!eepromInUse) | cpuSramEnabled | cpuFlashEnabled) {
(*cpuSaveGameFunc)(address, (u8)value);
break;
@ -726,6 +737,7 @@ static inline void CPUWriteByte(u32 address, u8 b)
}
goto unwritable;
case 14:
case 15:
if ((saveType != 5) && ((!eepromInUse) | cpuSramEnabled | cpuFlashEnabled)) {
//if(!cpuEEPROMEnabled && (cpuSramEnabled | cpuFlashEnabled)) {

View File

@ -345,9 +345,9 @@ bool OpenGLDisplay::initialize()
cpu_mmx = 0;
#endif
systemRedShift = 3;
systemRedShift = 19;
systemGreenShift = 11;
systemBlueShift = 19;
systemBlueShift = 3;
systemColorDepth = 32;
theApp.fsColorDepth = 32;
@ -401,7 +401,7 @@ void OpenGLDisplay::render()
} else {
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 );