diff --git a/desmume/src/GPU.cpp b/desmume/src/GPU.cpp index 6a10a0860..f2c672725 100644 --- a/desmume/src/GPU.cpp +++ b/desmume/src/GPU.cpp @@ -50,7 +50,7 @@ #include "debug.h" #include "render3D.h" #include "GPU_osd.h" -#include "debug.h" +#include "debug.h" ARM9_struct ARM9Mem; @@ -1999,7 +1999,7 @@ void GPU_set_DISPCAPCNT(u32 val) case 2: gpu->dispCapCnt.capx = 256; gpu->dispCapCnt.capy = 128; - break; + break; case 3: gpu->dispCapCnt.capx = 256; gpu->dispCapCnt.capy = 192; @@ -2019,8 +2019,8 @@ BOOL bright_init=FALSE; // comment this if want to use formulas instead // #define BRIGHT_TABLES - -#ifdef BRIGHT_TABLES + +#ifdef BRIGHT_TABLES static void calc_bright_colors() { int base = 31 ; int factor; @@ -2053,8 +2053,8 @@ static void calc_bright_colors() { #undef FORMULA_MORE #undef FORMULA_LESS -} -#endif +} +#endif static INLINE void GPU_ligne_layer(NDS_Screen * screen, u16 l) { GPU * gpu = screen->gpu; @@ -2125,13 +2125,13 @@ static INLINE void GPU_ligne_layer(NDS_Screen * screen, u16 l) T2WriteWord(dst, i16 << 1, T2ReadWord(spr, i16 << 1)); } } -} - +} + // TODO: capture emulated not fully static INLINE void GPU_ligne_DispCapture(u16 l) { - GPU * gpu = MainScreen.gpu; - struct _DISPCNT * dispCnt = &(gpu->dispx_st)->dispx_DISPCNT.bits; + GPU * gpu = MainScreen.gpu; + struct _DISPCNT * dispCnt = &(gpu->dispx_st)->dispx_DISPCNT.bits; if (l == 0) { @@ -2213,10 +2213,10 @@ static INLINE void GPU_ligne_DispCapture(u16 l) } } -static INLINE void GPU_ligne_Brightness(u16 l) +static INLINE void GPU_ligne_Brightness(NDS_Screen * screen, u16 l) { - GPU * gpu = MainScreen.gpu; - u8 * dst = GPU_screen + (MainScreen.offset + l) * 512; + GPU * gpu = screen->gpu; + u8 * dst = GPU_screen + (screen->offset + l) * 512; u16 i16; #ifndef HAVE_LIBGDKGLEXT_X11_1_0 // damdoum : @@ -2375,10 +2375,8 @@ void GPU_ligne(NDS_Screen * screen, u16 l) } if (gpu->core == GPU_MAIN) - { GPU_ligne_DispCapture(l); - GPU_ligne_Brightness(l); - } + GPU_ligne_Brightness(screen, l); } void gpu_savestate(std::ostream* os) @@ -2390,4 +2388,4 @@ bool gpu_loadstate(std::istream* is) { is->read((char*)GPU_screen,sizeof(GPU_screen)); return !is->fail(); -} +} \ No newline at end of file