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

Function cdvdWrite

pcsx2/CDVD/CDVD.cpp:3109–3167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3107}
3108
3109void cdvdWrite(u8 key, u8 rt)
3110{
3111 switch (key)
3112 {
3113 case 0x04:
3114 cdvdWrite04(rt);
3115 break;
3116 case 0x05:
3117 cdvdWrite05(rt);
3118 break;
3119 case 0x06:
3120 cdvdWrite06(rt);
3121 break;
3122 case 0x07:
3123 cdvdWrite07(rt);
3124 break;
3125 case 0x08:
3126 cdvdWrite08(rt);
3127 break;
3128 case 0x09:
3129 /*
3130 The register 0xC, 0xD, 0xE give back MSF of the current sector being read/played from the actual DSP hardware. They are named "where" registers : where0, where1, where2.
3131 They can be read anytime on hw as long as there is a valid disc and mode configured properly. Register 0x9 is where_select register which determines the mode for this registers. The mode must be set according to the used disc.
3132 0 = CDDA
3133 1 = CDROM
3134 2 = DVD
3135
3136 If no disc or invalid mode for disc type then those registers return 0. Only official usage so far is cdvdman reading those registers and waiting to sync while doing SubQ.
3137 Only logging writes different than 0 is enough.
3138 */
3139 if (rt != 0)
3140 Console.Warning("8bit write to addr 0x1f402009 = 0x%x", rt);
3141 break;
3142 case 0x0A:
3143 cdvdWrite0A(rt);
3144 break;
3145 case 0x0F:
3146 cdvdWrite0F(rt);
3147 break;
3148 case 0x14:
3149 cdvdWrite14(rt);
3150 break;
3151 case 0x16:
3152 cdvdWrite16(rt);
3153 break;
3154 case 0x17:
3155 cdvdWrite17(rt);
3156 break;
3157 case 0x18:
3158 cdvdWrite18(rt);
3159 break;
3160 case 0x3A:
3161 cdvdWrite3A(rt);
3162 break;
3163 default:
3164 Console.Warning("IOP Unknown 8bit write to addr 0x1f4020%02x = 0x%x", key, rt);
3165 break;
3166 }

Callers 1

psxHw4Write8Function · 0.85

Calls 13

cdvdWrite04Function · 0.85
cdvdWrite05Function · 0.85
cdvdWrite06Function · 0.85
cdvdWrite07Function · 0.85
cdvdWrite08Function · 0.85
cdvdWrite0AFunction · 0.85
cdvdWrite0FFunction · 0.85
cdvdWrite14Function · 0.85
cdvdWrite16Function · 0.85
cdvdWrite17Function · 0.85
cdvdWrite18Function · 0.85
cdvdWrite3AFunction · 0.85

Tested by

no test coverage detected