void SIO_Write(pscpu_timestamp_t timestamp, uint32 A, uint32 V) { V <<= (A & 1) * 8; switch(A & 0xE) { default: PSX_WARNING("[SIO] Unknown write: 0x%08x 0x%08x -- %d\n", A, V, timestamp); break; case 0x0: //case 0x2: V <<= (A & 2) * 8; DataBuffer = V; break; case 0x8: Mode = V; break; case 0xA: Control = V; break; case 0xE: BaudRate = V; break; } }
uint32 SIO_Read(pscpu_timestamp_t timestamp, uint32 A) { uint32 ret = 0; switch(A & 0xE) { default: PSX_WARNING("[SIO] Unknown read: 0x%08x -- %d\n", A, timestamp); break; case 0x0: //case 0x2: ret = DataBuffer >> ((A & 2) * 8); break; case 0x4: ret = Status; break; case 0x8: ret = Mode; break; case 0xA: ret = Control; break; case 0xE: ret = BaudRate; break; } return(ret >> ((A & 1) * 8)); }
void PS_CPU::SetBIU(uint32 val) { const uint32 old_BIU = BIU; BIU = val & ~(0x440); #if PS_CPU_EMULATE_ICACHE if((BIU ^ old_BIU) & 0x800) { if(BIU & 0x800) // ICache enabled { for(unsigned i = 0; i < 1024; i++) ICache[i].TV &= ~0x1; } else // ICache disabled { for(unsigned i = 0; i < 1024; i++) ICache[i].TV |= 0x1; } } #endif PSX_WARNING("[CPU] Set BIU=0x%08x", BIU); }