trunk/src/mess/machine/psxcd.c
| r20650 | r20651 | |
| 8 | 8 | // |
| 9 | 9 | |
| 10 | 10 | //#define debug_cdrom |
| 11 | | #define debug_cdrom_registers |
| 11 | //#define debug_cdrom_registers |
| 12 | 12 | //#define skip_reads |
| 13 | 13 | //#define dump_subheader |
| 14 | 14 | //#define disable_xa_prefetch |
| r20650 | r20651 | |
| 203 | 203 | |
| 204 | 204 | switch (offset&3) |
| 205 | 205 | { |
| 206 | /* |
| 207 | x--- ---- command/parameter busy flag |
| 208 | -x-- ---- data fifo full (active low) |
| 209 | --x- ---- response fifo empty (active low) |
| 210 | ---x ---- parameter fifo full (active low) |
| 211 | ---- x--- parameter fifo empty (active high) |
| 212 | ---- --xx cmd mode |
| 213 | */ |
| 206 | 214 | case 0: ret=sr; break; |
| 207 | 215 | case 1: |
| 208 | 216 | ret=res; |
| r20650 | r20651 | |
| 226 | 234 | } |
| 227 | 235 | |
| 228 | 236 | #ifdef debug_cdrom_registers |
| 229 | | printf("cdrom: read byte %08x = %02x\n",offset,ret); |
| 237 | printf("cdrom: read byte %08x = %02x (PC=%08x)\n",offset,ret,space.device().safe_pc()); |
| 230 | 238 | #endif |
| 231 | 239 | |
| 232 | 240 | return ret; |
| r20650 | r20651 | |
| 239 | 247 | WRITE8_MEMBER( psxcd_device::write ) |
| 240 | 248 | { |
| 241 | 249 | #ifdef debug_cdrom_registers |
| 242 | | printf("cdrom: write byte %08x = %02x\n",offset,data); |
| 250 | printf("cdrom: write byte %08x = %02x (PC=%08x)\n",offset,data,space.device().safe_pc()); |
| 243 | 251 | #endif |
| 244 | 252 | |
| 245 | 253 | switch (offset&3) |
| 246 | 254 | { |
| 247 | 255 | case 0: |
| 256 | //if(data & 2) |
| 257 | // popmessage("cmdmode = %02x, contact MESSdev",data); |
| 258 | |
| 248 | 259 | cmdmode=data&1; |
| 249 | 260 | if (cmdmode==0) |
| 250 | 261 | { |
| r20650 | r20651 | |
| 309 | 320 | } else |
| 310 | 321 | { |
| 311 | 322 | // ?flush buffer? |
| 323 | //if(data & 0xf8) |
| 324 | //popmessage("Interrupt enable register mode 1 [%02x] -> %02x",offset,data); |
| 312 | 325 | } |
| 313 | 326 | break; |
| 314 | 327 | |
| 328 | /* |
| 329 | x--- ---- unknown |
| 330 | -x-- ---- Reset parameter FIFO |
| 331 | --x- ---- unknown (used on transitions, so it certainly resets something) |
| 332 | ---x ---- Command start |
| 333 | ---- -xxx Response received |
| 334 | */ |
| 315 | 335 | case 3: |
| 336 | //if(data & 0x78) |
| 337 | // popmessage("IRQ flag = %02x, contact MESSdev",data); |
| 338 | |
| 316 | 339 | if (data==0x07) |
| 317 | 340 | { |
| 318 | 341 | if (cur_res) |