diff --git a/desmume/src/windows/tileView.cpp b/desmume/src/windows/tileView.cpp index 981922f69..0f4f1d93c 100644 --- a/desmume/src/windows/tileView.cpp +++ b/desmume/src/windows/tileView.cpp @@ -79,7 +79,11 @@ LRESULT TileViewBox_Direct(HWND hwnd, tileview_struct * win, WPARAM wParam, LPAR FillRect(mem_dc, &rect, (HBRUSH)GetStockObject(WHITE_BRUSH)); - u8* mem = MMU_RenderMapToLCD(win->target); + u8* mem; + if(win->target >= ARM9MEM_LCDC) + mem = ARM9Mem.ARM9_LCD + win->target - ARM9MEM_LCDC; + else + mem = MMU_RenderMapToLCD(win->target); if(mem) SetDIBitsToDevice(mem_dc, 0, 0, 256, 256, 0, 0, 0, 256, mem, (BITMAPINFO*)&bmi, DIB_RGB_COLORS); @@ -136,7 +140,11 @@ LRESULT TileViewBox_Pal256(HWND hwnd, tileview_struct * win, WPARAM wParam, LPAR { u32 i, num2, num, y, x; - u8* mem = MMU_RenderMapToLCD(win->target); + u8* mem; + if(win->target >= ARM9MEM_LCDC) + mem = ARM9Mem.ARM9_LCD + win->target - ARM9MEM_LCDC; + else + mem = MMU_RenderMapToLCD(win->target); if(mem) { for(num2 = 0; num2<32; ++num2) @@ -203,7 +211,12 @@ LRESULT TileViewBox_Pal16(HWND hwnd, tileview_struct * win, WPARAM wParam, LPARA if(win->pal) { - u8* mem = MMU_RenderMapToLCD(win->target); + u8* mem; + if(win->target >= ARM9MEM_LCDC) + mem = ARM9Mem.ARM9_LCD + win->target - ARM9MEM_LCDC; + else + mem = MMU_RenderMapToLCD(win->target); + if(mem) { u32 num2, num, y, x;