MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / _hwWrite32

Function _hwWrite32

pcsx2/HwWrite.cpp:36–268  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34
35template<uint page>
36void _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);

Callers

nothing calls this directly

Calls 12

ipuWrite32Function · 0.85
From32Function · 0.85
r128_from_u128Function · 0.85
CPU_INTFunction · 0.85
cpuTestINTCIntsFunction · 0.85
psxResetFunction · 0.85
ResetFunction · 0.85
setPs1CDVDSpeedFunction · 0.85
PGIFwFunction · 0.85
WarningMethod · 0.45
writeMethod · 0.45
ResetMethod · 0.45

Tested by

no test coverage detected