| 34 | |
| 35 | template<uint page> |
| 36 | void _hwWrite32( u32 mem, u32 value ) |
| 37 | { |
| 38 | pxAssume( (mem & 0x03) == 0 ); |
| 39 | |
| 40 | // Notes: |
| 41 | // All unknown registers on the EE are "reserved" as discarded writes and indeterminate |
| 42 | // reads. Bus error is only generated for registers outside the first 16k of mapped |
| 43 | // register space (which is handled by the VTLB mapping, so no need for checks here). |
| 44 | #if PSX_EXTRALOGS |
| 45 | if ((mem & 0x1000ff00) == 0x1000f300) DevCon.Warning("32bit Write to SIF Register %x value %x", mem, value); |
| 46 | //if ((mem & 0x1000ff00) == 0x1000f200) DevCon.Warning("Write to SIF Register %x value %x", mem, value); |
| 47 | #endif |
| 48 | |
| 49 | switch (page) |
| 50 | { |
| 51 | case 0x00: if (!rcntWrite32<0x00>(mem, value)) return; break; |
| 52 | case 0x01: if (!rcntWrite32<0x01>(mem, value)) return; break; |
| 53 | |
| 54 | case 0x02: |
| 55 | if (!ipuWrite32(mem, value)) return; |
| 56 | break; |
| 57 | |
| 58 | case 0x04: |
| 59 | case 0x05: |
| 60 | case 0x06: |
| 61 | case 0x07: |
| 62 | { |
| 63 | // [Ps2Confirm] Direct FIFO read/write behavior. We need to create a test that writes |
| 64 | // data to one of the FIFOs and determine the result. I'm not quite sure offhand a good |
| 65 | // way to do that --air |
| 66 | // Current assumption is that 32-bit and 64-bit writes likely do 128-bit zero-filled |
| 67 | // writes (upper 96 bits are 0, lower 32 bits are effective). |
| 68 | |
| 69 | u128 zerofill = u128::From32(0); |
| 70 | zerofill._u32[(mem >> 2) & 0x03] = value; |
| 71 | |
| 72 | _hwWrite128<page>(mem & ~0x0f, r128_from_u128(zerofill)); |
| 73 | } |
| 74 | return; |
| 75 | |
| 76 | case 0x03: |
| 77 | if (mem >= EEMemoryMap::VIF0_Start) |
| 78 | { |
| 79 | if(mem >= EEMemoryMap::VIF1_Start) |
| 80 | { |
| 81 | if (!vifWrite32<1>(mem, value)) return; |
| 82 | } |
| 83 | else |
| 84 | { |
| 85 | if (!vifWrite32<0>(mem, value)) return; |
| 86 | } |
| 87 | } |
| 88 | else switch(mem) |
| 89 | { |
| 90 | case (GIF_CTRL): |
| 91 | { |
| 92 | // Not exactly sure what RST needs to do |
| 93 | gifRegs.ctrl.write(value & 9); |
nothing calls this directly
no test coverage detected