diff --git a/desmume/src/GPU.cpp b/desmume/src/GPU.cpp index 673a5f330..202156d89 100644 --- a/desmume/src/GPU.cpp +++ b/desmume/src/GPU.cpp @@ -1272,7 +1272,7 @@ template void lineLarge8bpp(GPU * gpu) //TODO - handle wrapping / out of bounds correctly from rot_scale_op? u32 tmp_map = gpu->BG_bmp_large_ram[num] + lg * YBG; - u8* map = MMU_RenderMapToLCD(tmp_map); + u8* map = MMU_gpu_map(tmp_map); u8* pal = ARM9Mem.ARM9_VMEM + gpu->core * ADDRESS_STEP_1KB; @@ -1317,12 +1317,8 @@ template INLINE void renderline_textBG(GPU * gpu, u16 XBG, u16 YBG, if(tmp>31) tmp_map+= ADDRESS_STEP_512B << bgCnt->ScreenSize ; - //map = (u8*)MMU_RenderMapToLCD(tmp_map); map = tmp_map; - //if(!map) return; // no map - tile = gpu->BG_tile_ram[num]; - //if(!tile) return; // no tiles xoff = XBG; pal = ARM9Mem.ARM9_VMEM + gpu->core * ADDRESS_STEP_1KB; @@ -1951,7 +1947,6 @@ void GPU::_spriteRender(u8 * dst, u8 * dst_alpha, u8 * typeTab, u8 * prioTab) // If we are using 1 palette of 256 colours if(spriteInfo->Depth) { - //2d: src = (u8 *)MMU_RenderMapToLCD(gpu->sprMem + ((spriteInfo->TileIndex) << 5)); src = (u8 *)MMU_gpu_map(gpu->sprMem + (spriteInfo->TileIndex << block)); // If extended palettes are set, use them @@ -2103,9 +2098,9 @@ void GPU::_spriteRender(u8 * dst, u8 * dst_alpha, u8 * typeTab, u8 * prioTab) else { if (spriteInfo->Depth) - src = (u8 *)MMU_RenderMapToLCD(gpu->sprMem + (spriteInfo->TileIndex<>3)*sprSize.x*8) + ((y&0x7)*8)); + src = (u8 *)MMU_gpu_map(gpu->sprMem + (spriteInfo->TileIndex<>3)*sprSize.x*8) + ((y&0x7)*8)); else - src = (u8 *)MMU_RenderMapToLCD(gpu->sprMem + (spriteInfo->TileIndex<>3)*sprSize.x*4) + ((y&0x7)*4)); + src = (u8 *)MMU_gpu_map(gpu->sprMem + (spriteInfo->TileIndex<>3)*sprSize.x*4) + ((y&0x7)*4)); } render_sprite_Win (gpu, l, src, spriteInfo->Depth, lg, sprX, x, xdir); diff --git a/desmume/src/MMU.cpp b/desmume/src/MMU.cpp index 2503b6498..05adccc39 100644 --- a/desmume/src/MMU.cpp +++ b/desmume/src/MMU.cpp @@ -396,20 +396,6 @@ static FORCEINLINE u32 MMU_LCDmap(u32 addr, bool& unmapped) } -u8 *MMU_RenderMapToLCD(u32 vram_addr) -{ - //THIS FUNCTION IS DANGEROUS! - //the very idea is heinous, since people are - //certainly reading several bytes which probably overrun a page or something - //this needs to go through a system like what is used for textures for mapping into chunks - - bool unmapped; - vram_addr = MMU_LCDmap<0>(vram_addr,unmapped); - if(unmapped) return 0; - else return ARM9Mem.ARM9_LCD + (vram_addr - LCDC_HACKY_LOCATION); -} - - #define LOG_VRAM_ERROR() LOG("No data for block %i MST %i\n", block, VRAMBankCnt & 0x07); struct VramConfiguration { diff --git a/desmume/src/MMU.h b/desmume/src/MMU.h index 9dd95eeb7..8a3e331fd 100644 --- a/desmume/src/MMU.h +++ b/desmume/src/MMU.h @@ -190,8 +190,6 @@ extern struct armcpu_memory_iface arm9_base_memory_iface; extern struct armcpu_memory_iface arm7_base_memory_iface; extern struct armcpu_memory_iface arm9_direct_memory_iface; -extern u8 *MMU_RenderMapToLCD(u32 vram_addr); - #define VRAM_ARM9_PAGES 512 extern u8 vram_arm9_map[VRAM_ARM9_PAGES]; FORCEINLINE void* MMU_gpu_map(u32 vram_addr) diff --git a/desmume/src/windows/tileView.cpp b/desmume/src/windows/tileView.cpp index 0f4f1d93c..a798bd134 100644 --- a/desmume/src/windows/tileView.cpp +++ b/desmume/src/windows/tileView.cpp @@ -83,7 +83,7 @@ LRESULT TileViewBox_Direct(HWND hwnd, tileview_struct * win, WPARAM wParam, LPAR if(win->target >= ARM9MEM_LCDC) mem = ARM9Mem.ARM9_LCD + win->target - ARM9MEM_LCDC; else - mem = MMU_RenderMapToLCD(win->target); + mem = (u8*)MMU_gpu_map(win->target); if(mem) SetDIBitsToDevice(mem_dc, 0, 0, 256, 256, 0, 0, 0, 256, mem, (BITMAPINFO*)&bmi, DIB_RGB_COLORS); @@ -144,7 +144,7 @@ LRESULT TileViewBox_Pal256(HWND hwnd, tileview_struct * win, WPARAM wParam, LPAR if(win->target >= ARM9MEM_LCDC) mem = ARM9Mem.ARM9_LCD + win->target - ARM9MEM_LCDC; else - mem = MMU_RenderMapToLCD(win->target); + mem = (u8*)MMU_gpu_map(win->target); if(mem) { for(num2 = 0; num2<32; ++num2) @@ -215,7 +215,7 @@ LRESULT TileViewBox_Pal16(HWND hwnd, tileview_struct * win, WPARAM wParam, LPARA if(win->target >= ARM9MEM_LCDC) mem = ARM9Mem.ARM9_LCD + win->target - ARM9MEM_LCDC; else - mem = MMU_RenderMapToLCD(win->target); + mem = (u8*)MMU_gpu_map(win->target); if(mem) {