core: remove last traces of MMU_RenderMapToLCD, the heinous function which should never have been used. prevents crash in megaman star force

This commit is contained in:
zeromus 2009-07-16 08:05:00 +00:00
parent 3f291c8e6a
commit 55a208d0ee
4 changed files with 6 additions and 27 deletions

View File

@ -1272,7 +1272,7 @@ template<bool MOSAIC> 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<bool MOSAIC> 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<<block) + ((y>>3)*sprSize.x*8) + ((y&0x7)*8));
src = (u8 *)MMU_gpu_map(gpu->sprMem + (spriteInfo->TileIndex<<block) + ((y>>3)*sprSize.x*8) + ((y&0x7)*8));
else
src = (u8 *)MMU_RenderMapToLCD(gpu->sprMem + (spriteInfo->TileIndex<<block) + ((y>>3)*sprSize.x*4) + ((y&0x7)*4));
src = (u8 *)MMU_gpu_map(gpu->sprMem + (spriteInfo->TileIndex<<block) + ((y>>3)*sprSize.x*4) + ((y&0x7)*4));
}
render_sprite_Win (gpu, l, src, spriteInfo->Depth, lg, sprX, x, xdir);

View File

@ -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 {

View File

@ -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)

View File

@ -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)
{