/* BFC06680 -- SCPH1001 */ void SetMem(int size) { int cur = *_memsize & 0xFFFFF8FF; switch(size) { case 2: *_memsize = cur; break; case 8: *_memsize = cur | 0x0300; break; default: printf("Effective memory must be 2/8 MBytes\n"); return; } printf("Change effective memory : %d MBytes\n"); *_ramsize = size; } /* some notes: you can think, that _memsize = 0x1F801060 (in HW) you can think, that _ramsize = 0x00000060 (in KERNEL RAM) allowed sizes of effective memory are 2 or 8 Mbytes *_memsize sets to 0x0B88 at software reset (so RAM size = 8 MB by default) */ /* HLE version -- printf's was cutted */ void HLE_SetMem() { int size = GPR[_A0_]; int current = MEM_Read32Unsigned(0x1F801060) & 0xFFFFF8FF; if(size == 2) MEM_Write32(0x1F801060, current); else if(size == 8) MEM_Write32(0x1F801060, current | 0x300); else return; MEM_Write32(0x60, size); }