.global ari_write_ram_mirror8
.global ari_write_ram_mirror16
.global ari_write_ram_mirror32
+.global ari_read_bios8
+.global ari_read_bios16
+.global ari_read_bios32
.global ari_read_io8
.global ari_read_io16
.global ari_read_io32
ari_write_ram_mirror (3<<11), word, str
+.macro ari_read_bios_mirror bic_const op
+ ldr r0, [fp, #address-dynarec_local]
+ orr r0, r0, #0x80000000
+ bic r0, r0, #(0x20000000|\bic_const) @ map to 0x9fc...
+ \op r0, [r0]
+ str r0, [fp, #readmem_dword-dynarec_local]
+ mov pc, lr
+.endm
+
+ari_read_bios8:
+ ari_read_bios_mirror 0, ldrb
+
+ari_read_bios16:
+ ari_read_bios_mirror 1, ldrh
+
+ari_read_bios32:
+ ari_read_bios_mirror 3, ldr
+
+
@ for testing
.macro ari_read_io_old tab_shift
str lr, [sp, #-8]! @ EABI alignment..
extern void ari_write_ram_mirror8();
extern void ari_write_ram_mirror16();
extern void ari_write_ram_mirror32();
+extern void ari_read_bios8();
+extern void ari_read_bios16();
+extern void ari_read_bios32();
extern void ari_read_io8();
extern void ari_read_io16();
extern void ari_read_io32();
writemem[i] = write_mem32;
#if 1
readmemb[i] = readmemh[i] = readmem[i] = read_mem_dummy;
- readmemb[i] = readmemh[i] = readmem[i] = write_mem_dummy;
+ writememb[i] = writememh[i] = writemem[i] = write_mem_dummy;
#endif
}
writemem[i] = ari_write_ram32;
}
+ // BIOS and it's mirrors
+ for (i = 0x1fc0; i < 0x1fc8; i++) {
+ readmemb[i] = readmemb[0x8000|i] = readmemb[0xa000|i] = ari_read_bios8;
+ readmemh[i] = readmemh[0x8000|i] = readmemh[0xa000|i] = ari_read_bios16;
+ readmem[i] = readmem[0x8000|i] = readmem[0xa000|i] = ari_read_bios32;
+ }
+
// I/O
readmemb[0x1f80] = ari_read_io8;
readmemh[0x1f80] = ari_read_io16;
psxP = &psxM[0x200000];
psxH = &psxM[0x210000];
- psxR = (s8 *)malloc(0x00080000);
+ psxR = mmap((void *)0x9fc00000, 0x80000,
+ PROT_WRITE | PROT_READ, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (psxMemRLUT == NULL || psxMemWLUT == NULL ||
- psxM != (void *)0x80000000 || psxP == NULL || psxH == NULL) {
+ psxM != (void *)0x80000000 || psxR != (void *)0x9fc00000 ||
+ psxP == NULL || psxH == NULL) {
SysMessage(_("Error allocating memory!"));
return -1;
}
void psxMemShutdown() {
munmap(psxM, 0x00220000);
+ munmap(psxR, 0x80000);
- free(psxR);
free(psxMemRLUT);
free(psxMemWLUT);
}