Reformatting memory.cpp
This commit is contained in:
parent
56ac1d81e7
commit
dbb252a725
1 changed files with 35 additions and 34 deletions
|
@ -40,9 +40,9 @@ static bool last_address_space_24;
|
|||
|
||||
addrbank *mem_banks[MEMORY_BANKS];
|
||||
|
||||
int addr_valid(const TCHAR *txt, uaecptr addr, uae_u32 len)
|
||||
int addr_valid(const TCHAR* txt, uaecptr addr, uae_u32 len)
|
||||
{
|
||||
addrbank *ab = &get_mem_bank(addr);
|
||||
addrbank* ab = &get_mem_bank(addr);
|
||||
if (ab == 0 || !(ab->flags & (ABFLAG_RAM | ABFLAG_ROM)) || addr < 0x100 || len > 16777215 || !valid_address(addr, len)) {
|
||||
write_log(_T("corrupt %s pointer %x (%d) detected!\n"), txt, addr, len);
|
||||
return 0;
|
||||
|
@ -937,10 +937,10 @@ static bool load_kickstart_replacement(void)
|
|||
}
|
||||
|
||||
/* disable incompatible drivers */
|
||||
static int patch_residents (uae_u8 *kickmemory, int size)
|
||||
static int patch_residents(uae_u8* kickmemory, int size)
|
||||
{
|
||||
int i, j, patched = 0;
|
||||
const uae_char *residents[] = { "NCR scsi.device", NULL };
|
||||
const uae_char* residents[] = { "NCR scsi.device", NULL };
|
||||
// "scsi.device", "carddisk.device", "card.resource" };
|
||||
uaecptr base = size == ROM_SIZE_512 ? 0xf80000 : 0xfc0000;
|
||||
|
||||
|
@ -954,10 +954,10 @@ static int patch_residents (uae_u8 *kickmemory, int size)
|
|||
if (addr >= base && addr < base + size) {
|
||||
j = 0;
|
||||
while (residents[j]) {
|
||||
if (!memcmp (residents[j], kickmemory + addr - base, strlen (residents[j]) + 1)) {
|
||||
TCHAR *s = au (residents[j]);
|
||||
write_log (_T("KSPatcher: '%s' at %08X disabled\n"), s, i + base);
|
||||
xfree (s);
|
||||
if (!memcmp(residents[j], kickmemory + addr - base, strlen(residents[j]) + 1)) {
|
||||
TCHAR* s = au(residents[j]);
|
||||
write_log(_T("KSPatcher: '%s' at %08X disabled\n"), s, i + base);
|
||||
xfree(s);
|
||||
kickmemory[i] = 0x4b; /* destroy RTC_MATCHWORD */
|
||||
patched++;
|
||||
break;
|
||||
|
@ -1244,7 +1244,7 @@ static void allocate_memory(void)
|
|||
void map_overlay(int chip)
|
||||
{
|
||||
int size;
|
||||
addrbank *cb;
|
||||
addrbank* cb;
|
||||
int currPC = m68k_getpc();
|
||||
|
||||
size = chipmem_bank.allocated_size >= 0x180000 ? (chipmem_bank.allocated_size >> 16) : 32;
|
||||
|
@ -1252,8 +1252,9 @@ void map_overlay(int chip)
|
|||
if (chip) {
|
||||
map_banks(&dummy_bank, 0, size, 0);
|
||||
map_banks(cb, 0, size, chipmem_bank.allocated_size);
|
||||
} else {
|
||||
addrbank *rb = NULL;
|
||||
}
|
||||
else {
|
||||
addrbank* rb = NULL;
|
||||
if (size < 32)
|
||||
size = 32;
|
||||
cb = &get_mem_bank(0xf00000);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue