diff --git a/src/gb/GB.cpp b/src/gb/GB.cpp index 67cb1615..db68076d 100644 --- a/src/gb/GB.cpp +++ b/src/gb/GB.cpp @@ -5034,8 +5034,7 @@ void gbEmulate(int ticksToStop) { u16 color = gbColorOption ? gbColorFilter[0] : 0; if (!gbCgbMode) - color = gbColorOption ? gbColorFilter[gbPalette[3] & 0x7FFF] : - gbPalette[3] & 0x7FFF; + color = gbColorOption ? gbColorFilter[gbPalette[3] & 0x7FFF] : gbPalette[3] & 0x7FFF; for(int i = 0; i < 160; i++) { gbLineMix[i] = color; @@ -5111,11 +5110,9 @@ void gbEmulate(int ticksToStop) u8 register_LYLcdOff = ((register_LY+154)%154); for (register_LY=0;register_LY <= 0x90;register_LY++) { - u16 color = gbColorOption ? gbColorFilter[0x7FFF] : - 0x7FFF; + u16 color = gbColorOption ? gbColorFilter[0x7FFF] : 0x7FFF; if (!gbCgbMode) - color = gbColorOption ? gbColorFilter[gbPalette[0] & 0x7FFF] : - gbPalette[0] & 0x7FFF; + color = gbColorOption ? gbColorFilter[gbPalette[0] & 0x7FFF] : gbPalette[0] & 0x7FFF; for(int i = 0; i < 160; i++) { gbLineMix[i] = color; @@ -5138,11 +5135,9 @@ void gbEmulate(int ticksToStop) if (register_LY<144) { - u16 color = gbColorOption ? gbColorFilter[0x7FFF] : - 0x7FFF; + u16 color = gbColorOption ? gbColorFilter[0x7FFF] : 0x7FFF; if (!gbCgbMode) - color = gbColorOption ? gbColorFilter[gbPalette[0] & 0x7FFF] : - gbPalette[0] & 0x7FFF; + color = gbColorOption ? gbColorFilter[gbPalette[0] & 0x7FFF] : gbPalette[0] & 0x7FFF; for(int i = 0; i < 160; i++) { gbLineMix[i] = color; diff --git a/src/gb/gbGfx.cpp b/src/gb/gbGfx.cpp index 37e40976..b2e0ecbd 100644 --- a/src/gb/gbGfx.cpp +++ b/src/gb/gbGfx.cpp @@ -155,8 +155,7 @@ void gbRenderLine() c = c + 4*palette; } } - gbLineMix[x] = gbColorOption ? gbColorFilter[gbPalette[c] & 0x7FFF] : - gbPalette[c] & 0x7FFF; + gbLineMix[x] = gbColorOption ? gbColorFilter[gbPalette[c] & 0x7FFF] : gbPalette[c] & 0x7FFF; x++; if(x >= 160) break; @@ -204,10 +203,10 @@ void gbRenderLine() // Also added the gbColorOption (fixes Dracula Densetsu II color problems) for(int i = 0; i < 160; i++) { - u16 color = gbColorOption ? gbColorFilter[0x7FFF] : - 0x7FFF; + u16 color = gbColorOption ? gbColorFilter[0x7FFF] : 0x7FFF; if (!gbCgbMode) - color = gbColorOption ? gbColorFilter[gbPalette[gbBgpLine[i+(gbSpeed ? 5 : 11)+gbSpritesTicks[i]*(gbSpeed ? 2 : 4)]&3] & 0x7FFF] : + color = gbColorOption ? + gbColorFilter[gbPalette[gbBgpLine[i+(gbSpeed ? 5 : 11)+gbSpritesTicks[i]*(gbSpeed ? 2 : 4)]&3] & 0x7FFF] : gbPalette[gbBgpLine[i+(gbSpeed ? 5 : 11)+gbSpritesTicks[i]*(gbSpeed ? 2 : 4)]&3] & 0x7FFF; gbLineMix[i] = color; gbLineBuffer[i] = 0; @@ -218,8 +217,7 @@ void gbRenderLine() // LCDC.0 also enables/disables the window in !gbCgbMode ?!?! // (tested on real hardware) // This fixes Last Bible II & Zankurou Musouken - if((register_LCDC & 0x01 || gbCgbMode) && (register_LCDC & 0x20) && - (layerSettings & 0x2000) && (gbWindowLine != -2)) { + if((register_LCDC & 0x01 || gbCgbMode) && (register_LCDC & 0x20) && (layerSettings & 0x2000) && (gbWindowLine != -2)) { int i = 0; // Fix (accurate emulation) for most of the window display problems // (ie. Zen - Intergalactic Ninja, Urusei Yatsura...). @@ -236,7 +234,7 @@ void gbRenderLine() if(y >= inUseRegister_WY) { - if (gbWindowLine == -1) + if ((gbWindowLine>144)) gbWindowLine = 0; int wx = register_WX; @@ -352,8 +350,7 @@ void gbRenderLine() c = c + 4*palette; } } - gbLineMix[x] = gbColorOption ? gbColorFilter[gbPalette[c] & 0x7FFF] : - gbPalette[c] & 0x7FFF; + gbLineMix[x] = gbColorOption ? gbColorFilter[gbPalette[c] & 0x7FFF] : gbPalette[c] & 0x7FFF; } x++; if(x >= 160) @@ -390,11 +387,9 @@ void gbRenderLine() gbWindowLine = 0; } } else { - u16 color = gbColorOption ? gbColorFilter[0x7FFF] : - 0x7FFF; + u16 color = gbColorOption ? gbColorFilter[0x7FFF] : 0x7FFF; if (!gbCgbMode) - color = gbColorOption ? gbColorFilter[gbPalette[0] & 0x7FFF] : - gbPalette[0] & 0x7FFF; + color = gbColorOption ? gbColorFilter[gbPalette[0] & 0x7FFF] : gbPalette[0] & 0x7FFF; for(int i = 0; i < 160; i++) { gbLineMix[i] = color; @@ -521,8 +516,7 @@ void gbDrawSpriteTile(int tile, int x,int y,int t, int flags, } } - gbLineMix[xxx] = gbColorOption ? gbColorFilter[gbPalette[c] & 0x7FFF] : - gbPalette[c] & 0x7FFF; + gbLineMix[xxx] = gbColorOption ? gbColorFilter[gbPalette[c] & 0x7FFF] : gbPalette[c] & 0x7FFF; } }