Sorry, got carried away and forgot I had some private changes here. Reverting this part of previous commit. -- xKiv

This commit is contained in:
xkiv 2008-08-03 21:06:36 +00:00
parent 5b5f0078fe
commit 5006873994
1 changed files with 9 additions and 17 deletions

View File

@ -1288,14 +1288,6 @@ void CPUCleanUp()
emulating = 0; emulating = 0;
} }
/* allocation of memory segments + display where they are (for ptrace PEEK/POKE) */
void * pom_calloc(int elem, int kolik, const char * const co)
{
void * poi = calloc(elem, kolik);
fprintf(stderr,"%s allocated at 0x%08x - 0x%08x\n", co, (int)poi, (int)poi + kolik - 1);
return poi;
}
int CPULoadRom(const char *szFile) int CPULoadRom(const char *szFile)
{ {
romSize = 0x2000000; romSize = 0x2000000;
@ -1305,13 +1297,13 @@ int CPULoadRom(const char *szFile)
systemSaveUpdateCounter = SYSTEM_SAVE_NOT_UPDATED; systemSaveUpdateCounter = SYSTEM_SAVE_NOT_UPDATED;
rom = (u8 *)pom_calloc(1, romSize, "ROM"); rom = (u8 *)malloc(0x2000000);
if(rom == NULL) { if(rom == NULL) {
systemMessage(MSG_OUT_OF_MEMORY, N_("Failed to allocate memory for %s"), systemMessage(MSG_OUT_OF_MEMORY, N_("Failed to allocate memory for %s"),
"ROM"); "ROM");
return 0; return 0;
} }
workRAM = (u8 *)pom_calloc(1, 0x40000, "RAM"); workRAM = (u8 *)calloc(1, 0x40000);
if(workRAM == NULL) { if(workRAM == NULL) {
systemMessage(MSG_OUT_OF_MEMORY, N_("Failed to allocate memory for %s"), systemMessage(MSG_OUT_OF_MEMORY, N_("Failed to allocate memory for %s"),
"WRAM"); "WRAM");
@ -1361,49 +1353,49 @@ int CPULoadRom(const char *szFile)
temp++; temp++;
} }
bios = (u8 *)pom_calloc(1, 0x4000, "BIOS"); bios = (u8 *)calloc(1,0x4000);
if(bios == NULL) { if(bios == NULL) {
systemMessage(MSG_OUT_OF_MEMORY, N_("Failed to allocate memory for %s"), systemMessage(MSG_OUT_OF_MEMORY, N_("Failed to allocate memory for %s"),
"BIOS"); "BIOS");
CPUCleanUp(); CPUCleanUp();
return 0; return 0;
} }
internalRAM = (u8 *)pom_calloc(1, 0x8000, "internal RAM"); internalRAM = (u8 *)calloc(1,0x8000);
if(internalRAM == NULL) { if(internalRAM == NULL) {
systemMessage(MSG_OUT_OF_MEMORY, N_("Failed to allocate memory for %s"), systemMessage(MSG_OUT_OF_MEMORY, N_("Failed to allocate memory for %s"),
"IRAM"); "IRAM");
CPUCleanUp(); CPUCleanUp();
return 0; return 0;
} }
paletteRAM = (u8 *)pom_calloc(1, 0x400, "palette RAM"); paletteRAM = (u8 *)calloc(1,0x400);
if(paletteRAM == NULL) { if(paletteRAM == NULL) {
systemMessage(MSG_OUT_OF_MEMORY, N_("Failed to allocate memory for %s"), systemMessage(MSG_OUT_OF_MEMORY, N_("Failed to allocate memory for %s"),
"PRAM"); "PRAM");
CPUCleanUp(); CPUCleanUp();
return 0; return 0;
} }
vram = (u8 *)pom_calloc(1, 0x20000, "vRAM"); vram = (u8 *)calloc(1, 0x20000);
if(vram == NULL) { if(vram == NULL) {
systemMessage(MSG_OUT_OF_MEMORY, N_("Failed to allocate memory for %s"), systemMessage(MSG_OUT_OF_MEMORY, N_("Failed to allocate memory for %s"),
"VRAM"); "VRAM");
CPUCleanUp(); CPUCleanUp();
return 0; return 0;
} }
oam = (u8 *)pom_calloc(1, 0x400, "oam"); oam = (u8 *)calloc(1, 0x400);
if(oam == NULL) { if(oam == NULL) {
systemMessage(MSG_OUT_OF_MEMORY, N_("Failed to allocate memory for %s"), systemMessage(MSG_OUT_OF_MEMORY, N_("Failed to allocate memory for %s"),
"OAM"); "OAM");
CPUCleanUp(); CPUCleanUp();
return 0; return 0;
} }
pix = (u8 *)pom_calloc(1, 4 * 241 * 162, "PIX"); pix = (u8 *)calloc(1, 4 * 241 * 162);
if(pix == NULL) { if(pix == NULL) {
systemMessage(MSG_OUT_OF_MEMORY, N_("Failed to allocate memory for %s"), systemMessage(MSG_OUT_OF_MEMORY, N_("Failed to allocate memory for %s"),
"PIX"); "PIX");
CPUCleanUp(); CPUCleanUp();
return 0; return 0;
} }
ioMem = (u8 *)pom_calloc(1, 0x400, "IO"); ioMem = (u8 *)calloc(1, 0x400);
if(ioMem == NULL) { if(ioMem == NULL) {
systemMessage(MSG_OUT_OF_MEMORY, N_("Failed to allocate memory for %s"), systemMessage(MSG_OUT_OF_MEMORY, N_("Failed to allocate memory for %s"),
"IO"); "IO");