void psxMemWrite8(u32 mem, u8 value) { char *p; u32 t; psxRegs.cycle += 1; t = mem >> 16; if (t == 0x1f80 || t == 0x9f80 || t == 0xbf80) { if ((mem & 0xffff) < 0x400) psxHu8(mem) = value; else psxHwWrite8(mem, value); } else { p = (char *)(psxMemWLUT[t]); if (p != NULL) { if (Config.Debug) DebugCheckBP((mem & 0xffffff) | 0x80000000, BW1); *(u8 *)(p + (mem & 0xffff)) = value; #ifdef PSXREC psxCpu->Clear((mem & (~3)), 1); #endif } else { #ifdef PSXMEM_LOG PSXMEM_LOG("err sb %8.8lx\n", mem); #endif } } }
void __fastcall _ext_memWrite8 (u32 mem, u8 value) { switch (p) { case 1: // hwm hwWrite8(mem, value); return; case 2: // psh psxHwWrite8(mem, value); return; case 3: // psh4 psxHw4Write8(mem, value); return; case 6: // gsm gsWrite8(mem, value); return; case 7: // dev9 DEV9write8(mem & ~0xa4000000, value); SysPrintf("DEV9 write8 %8.8lx: %2.2lx\n", mem & ~0xa4000000, value); return; } MEM_LOG("Unknown Memory write8 to address %x with data %2.2x\n", mem, value); cpuTlbMissW(mem, cpuRegs.branch); }
void psxMemWrite8(u32 mem, u8 value) { u32 t; t = mem >> 16; if (t == 0x1f80) { if (mem < 0x1f801000) psxHu8(mem) = value; else psxHwWrite8(mem, value); } else { char *p = (char *)(psxMemWLUT[t]); if (p != NULL) { *(u8 *)(p + (mem & 0xffff)) = value; #ifdef PSXREC psxCpu->Clear((mem&(~3)), 1); #endif } else { #ifdef PSXMEM_LOG PSXMEM_LOG("err sb %8.8lx\n", mem); #endif } } }