From: Javier S. Pedro Date: Mon, 19 Oct 2009 18:38:48 +0000 (+0200) Subject: fix most compiler code style warnings X-Git-Tag: drnoksnes_1_3_0~43 X-Git-Url: http://git.maemo.org/git/?p=drnoksnes;a=commitdiff_plain;h=d2524ff5cd9d2738148020cb0c6ff6153b83572e fix most compiler code style warnings --- diff --git a/65c816ops.inc b/65c816ops.inc index fbc7e71..a36bbfa 100644 --- a/65c816ops.inc +++ b/65c816ops.inc @@ -2447,47 +2447,48 @@ static void Op0CM0 () /* Branch Instructions *********************************************************************** */ #ifndef SA1_OPCODES #define BranchCheck0()\ - if( CPU.BranchSkip)\ + if (CPU.BranchSkip)\ {\ - CPU.BranchSkip = FALSE;\ - if (!Settings.SoundSkipMethod)\ - if( CPU.PC - CPU.PCBase > OpAddress)\ - return;\ + CPU.BranchSkip = FALSE;\ + if (!Settings.SoundSkipMethod)\ + if( CPU.PC - CPU.PCBase > OpAddress)\ + return;\ } #define BranchCheck1()\ - if( CPU.BranchSkip)\ + if (CPU.BranchSkip)\ {\ - CPU.BranchSkip = FALSE;\ - if (!Settings.SoundSkipMethod) {\ - if( CPU.PC - CPU.PCBase > OpAddress)\ - return;\ - } else \ - if (Settings.SoundSkipMethod == 1)\ - return;\ - if (Settings.SoundSkipMethod == 3)\ - if( CPU.PC - CPU.PCBase > OpAddress)\ - return;\ - else\ - CPU.PC = CPU.PCBase + OpAddress;\ - } + CPU.BranchSkip = FALSE;\ + if (!Settings.SoundSkipMethod) {\ + if( CPU.PC - CPU.PCBase > OpAddress)\ + return;\ + } else if (Settings.SoundSkipMethod == 1) {\ + return;\ + } else if (Settings.SoundSkipMethod == 3) {\ + if( CPU.PC - CPU.PCBase > OpAddress)\ + return;\ + else\ + CPU.PC = CPU.PCBase + OpAddress;\ + }\ + } #define BranchCheck2()\ - if( CPU.BranchSkip)\ + if (CPU.BranchSkip)\ {\ - CPU.BranchSkip = FALSE;\ - if (!Settings.SoundSkipMethod) {\ - if( CPU.PC - CPU.PCBase > OpAddress)\ - return;\ - } else \ - if (Settings.SoundSkipMethod == 1)\ - CPU.PC = CPU.PCBase + OpAddress;\ - if (Settings.SoundSkipMethod == 3)\ - if (CPU.PC - CPU.PCBase > OpAddress)\ - return;\ - else\ - CPU.PC = CPU.PCBase + OpAddress;\ + CPU.BranchSkip = FALSE;\ + if (!Settings.SoundSkipMethod) {\ + if( CPU.PC - CPU.PCBase > OpAddress)\ + return;\ + } else if (Settings.SoundSkipMethod == 1) {\ + CPU.PC = CPU.PCBase + OpAddress;\ + } else if (Settings.SoundSkipMethod == 3) {\ + if (CPU.PC - CPU.PCBase > OpAddress)\ + return;\ + else\ + CPU.PC = CPU.PCBase + OpAddress;\ + }\ } + #else #define BranchCheck0() #define BranchCheck1() diff --git a/fxinst.cpp b/fxinst.cpp index fe12de1..a3db07b 100644 --- a/fxinst.cpp +++ b/fxinst.cpp @@ -453,15 +453,16 @@ static void fx_plot_8bit() R15++; CLRFLAGS; R1++; - + #ifdef CHECK_LIMITS if(y >= GSU.vScreenHeight) return; #endif - c = (uint8)GSU.vColorReg; - if(GSU.vPlotOptionReg & 0x10) - if( !(GSU.vPlotOptionReg & 0x01) && !(c&0xf)) return; - else - if( !(GSU.vPlotOptionReg & 0x01) && !c) return; + c = (uint8)GSU.vColorReg; + if(GSU.vPlotOptionReg & 0x10) { + if( !(GSU.vPlotOptionReg & 0x01) && !(c&0xf)) return; + } else { + if( !(GSU.vPlotOptionReg & 0x01) && !c) return; + } a = GSU.apvScreen[y >> 3] + GSU.x[x >> 3] + ((y & 7) << 1); v = 128 >> (x&7); diff --git a/getset.h b/getset.h index 90396c6..26e2709 100644 --- a/getset.h +++ b/getset.h @@ -457,12 +457,16 @@ INLINE void S9xSetWord (uint16 Word, uint32 Address) #endif if (CPU.Memory_SRAMMask) { - *(Memory.SRAM + - (((Address & 0x7fff) - 0x6000 + - ((Address & 0xf0000) >> MEMMAP_SHIFT) & CPU.Memory_SRAMMask))) = (uint8) Word; - *(Memory.SRAM + - ((((Address + 1) & 0x7fff) - 0x6000 + - (((Address + 1) & 0xf0000) >> MEMMAP_SHIFT) & CPU.Memory_SRAMMask))) = (uint8) (Word >> 8); + *(Memory.SRAM + + ((Address & 0x7fff) - 0x6000) + + (((Address & 0xf0000) >> MEMMAP_SHIFT) & CPU.Memory_SRAMMask) + ) = (uint8) Word; + + *(Memory.SRAM + + (((Address + 1) & 0x7fff) - 0x6000) + + ((((Address + 1) & 0xf0000) >> MEMMAP_SHIFT) & CPU.Memory_SRAMMask) + ) = (uint8) (Word >> 8); + CPU.SRAMModified = TRUE; } return; diff --git a/gfx.cpp b/gfx.cpp index ce2421b..79f8feb 100644 --- a/gfx.cpp +++ b/gfx.cpp @@ -3786,18 +3786,19 @@ else \ // Define an inline function to handle which BGs are being displayed #define DISPLAY(n) \ -(!(PPU.BG_Forced & n) && \ -(GFX.r212c & n) || \ -((GFX.r212d & n) && subadd)) + ( \ + (!(PPU.BG_Forced & n) && (GFX.r212c & n)) || \ + (((GFX.r212d & n) && subadd)) \ + ) uint8 subadd = GFX.r2131 & 0x3f; // go through all BGS are check if they need to be displayed - bool8_32 BG0 = DISPLAY(1) && !(Settings.os9x_hack & GFX_IGNORE_BG0); - bool8_32 BG1 = DISPLAY(2) && !(Settings.os9x_hack & GFX_IGNORE_BG1); - bool8_32 BG2 = DISPLAY(4) && !(Settings.os9x_hack & GFX_IGNORE_BG2); - bool8_32 BG3 = DISPLAY(8) && !(Settings.os9x_hack & GFX_IGNORE_BG3); - bool8_32 OB = DISPLAY(16) && !(Settings.os9x_hack & GFX_IGNORE_OBJ); + bool BG0 = DISPLAY(1) && !(Settings.os9x_hack & GFX_IGNORE_BG0); + bool BG1 = DISPLAY(2) && !(Settings.os9x_hack & GFX_IGNORE_BG1); + bool BG2 = DISPLAY(4) && !(Settings.os9x_hack & GFX_IGNORE_BG2); + bool BG3 = DISPLAY(8) && !(Settings.os9x_hack & GFX_IGNORE_BG3); + bool OB = DISPLAY(16) && !(Settings.os9x_hack & GFX_IGNORE_OBJ); if (PPU.BGMode <= 1) { diff --git a/gfx.h b/gfx.h index 281f418..51ddc21 100644 --- a/gfx.h +++ b/gfx.h @@ -183,23 +183,23 @@ GFX.X2 [((((C1) & RGB_REMOVE_LOW_BITS_MASK) + \ #endif #define COLOR_ADD1_2(C1, C2) \ -(((((C1) & RGB_REMOVE_LOW_BITS_MASK) + \ - ((C2) & RGB_REMOVE_LOW_BITS_MASK)) >> 1) + \ - ((C1) & (C2) & RGB_LOW_BITS_MASK) | ALPHA_BITS_MASK) + ((((((C1) & RGB_REMOVE_LOW_BITS_MASK) + \ + ((C2) & RGB_REMOVE_LOW_BITS_MASK)) >> 1) + \ + ((C1) & (C2) & RGB_LOW_BITS_MASK)) | ALPHA_BITS_MASK) #if defined(OLD_COLOUR_BLENDING) #define COLOR_SUB(C1, C2) \ -GFX.ZERO_OR_X2 [(((C1) | RGB_HI_BITS_MASKx2) - \ + GFX.ZERO_OR_X2 [(((C1) | RGB_HI_BITS_MASKx2) - \ ((C2) & RGB_REMOVE_LOW_BITS_MASK)) >> 1] #else #define COLOR_SUB(C1, C2) \ -(GFX.ZERO_OR_X2 [(((C1) | RGB_HI_BITS_MASKx2) - \ + (GFX.ZERO_OR_X2 [(((C1) | RGB_HI_BITS_MASKx2) - \ ((C2) & RGB_REMOVE_LOW_BITS_MASK)) >> 1] + \ -((C1) & RGB_LOW_BITS_MASK) - ((C2) & RGB_LOW_BITS_MASK)) + ((C1) & RGB_LOW_BITS_MASK) - ((C2) & RGB_LOW_BITS_MASK)) #endif #define COLOR_SUB1_2(C1, C2) \ -GFX.ZERO [(((C1) | RGB_HI_BITS_MASKx2) - \ + GFX.ZERO [(((C1) | RGB_HI_BITS_MASKx2) - \ ((C2) & RGB_REMOVE_LOW_BITS_MASK)) >> 1] typedef void (*NormalTileRenderer) (uint32 Tile, uint32 Offset, diff --git a/ppu.cpp b/ppu.cpp index 1bc2d41..b9a5963 100644 --- a/ppu.cpp +++ b/ppu.cpp @@ -1338,13 +1338,13 @@ uint8 S9xGetPPU(uint16 Address) CPU.BranchSkip = TRUE; break; } - if (Address & 3 < 2) + if ((Address & 3) < 2) { int r = rand(); if (r & 2) { if (r & 4) - return (Address & 3 == 1 ? 0xaa : 0xbb); + return ((Address & 3) == 1 ? 0xaa : 0xbb); else return ((r >> 3) & 0xff); }