fix bug: reading from unmapped vram should return zero

This commit is contained in:
zeromus 2008-10-10 16:36:32 +00:00
parent 82aa8a7d3f
commit a02e215b3e
2 changed files with 2426 additions and 2422 deletions

File diff suppressed because it is too large Load Diff

View File

@ -69,13 +69,13 @@ void mmu_log_debug(u32 adr, u8 proc, const char *fmt, ...)
if (adr >= 0x4800000 && adr <= 0x4808000) return; // WLAN Registers
}
va_list list;
char msg[512];
memset(msg,0,512);
va_start(list,fmt);
_vsnprintf(msg,511,fmt,list);
va_list list;
char msg[512];
memset(msg,0,512);
va_start(list,fmt);
_vsnprintf(msg,511,fmt,list);
va_end(list);
printlog("MMU ARM%s 0x%08X: %s\n",proc==ARMCPU_ARM9?"9":"7",adr, msg);
@ -476,6 +476,10 @@ void MMU_VRAMWriteBackToLCD(u8 block)
if (!destination) return ;
if (!source) return ;
memcpy(destination,source,size) ;
//zero 10/10/08 - if vram is not mapped, then when it is read from, it should be zero
//mimic this by clearing it now.
memset(source,0,size) ;
}
void MMU_VRAMReloadFromLCD(u8 block,u8 VRAMBankCnt)