diff --git a/desmume/src/GPU.h b/desmume/src/GPU.h index aa18f9cba..c443a5129 100644 --- a/desmume/src/GPU.h +++ b/desmume/src/GPU.h @@ -988,8 +988,8 @@ void SetupFinalPixelBlitter (GPU *gpu); #define GPU_setBLDY_EVY(gpu, val) {gpu->BLDY_EVY = (val&0x1f) > 16 ? 16 : (val&0x1f);} -#define GPU_setBGxHOFS(bg, gpu, val) gpu->dispx_st->dispx_BGxOFS[bg].BGxHOFS = (val & 0x1F) -#define GPU_setBGxVOFS(bg, gpu, val) gpu->dispx_st->dispx_BGxOFS[bg].BGxVOFS = (val & 0x1F) +#define GPU_setBGxHOFS(bg, gpu, val) gpu->dispx_st->dispx_BGxOFS[bg].BGxHOFS = (val & 0x1FF) +#define GPU_setBGxVOFS(bg, gpu, val) gpu->dispx_st->dispx_BGxOFS[bg].BGxVOFS = (val & 0x1FF) // render void gpu_UpdateRender(); diff --git a/desmume/src/texcache.cpp b/desmume/src/texcache.cpp index a87d50374..ae1a4a999 100644 --- a/desmume/src/texcache.cpp +++ b/desmume/src/texcache.cpp @@ -465,7 +465,7 @@ public: //this check isnt necessary since the addressing is tied to the texture data which will also run out: //if(msIndex.numItems != 1) PROGINFO("Your 4x4 texture index has overrun its slot.\n"); - #define PAL4X4(offset) ( *(u16*)( MMU.texInfo.texPalSlot[((paletteAddress + (offset)*2)>>14)] + ((paletteAddress + (offset)*2)&0x3FFF) ) ) + #define PAL4X4(offset) ( *(u16*)( MMU.texInfo.texPalSlot[((paletteAddress + (offset)*2)>>14)&0x7] + ((paletteAddress + (offset)*2)&0x3FFF) ) ) u16* slot1; u32* map = (u32*)ms.items[0].ptr;