diff options
| author | 2026-01-27 18:35:46 +0100 | |
|---|---|---|
| committer | 2026-01-29 17:08:58 +0100 | |
| commit | eb20ca310d38236883942468576828b06b8c7dd7 (patch) | |
| tree | 066c6a8d20456e9d956180253b5b94549d4649fa | |
| parent | bff5874d8525dc84702d8077100add84ee1c28ac (diff) | |
machine/cr560b.cpp: add command byte acks to some commands
| -rw-r--r-- | src/devices/machine/cr560b.cpp | 67 | ||||
| -rw-r--r-- | src/mame/misc/3do_amy.cpp | 26 | ||||
| -rw-r--r-- | src/mame/misc/3do_clio.h | 1 |
3 files changed, 70 insertions, 24 deletions
diff --git a/src/devices/machine/cr560b.cpp b/src/devices/machine/cr560b.cpp index 9638f1a19ef..36aa06f40b6 100644 --- a/src/devices/machine/cr560b.cpp +++ b/src/devices/machine/cr560b.cpp @@ -7,6 +7,12 @@ CR-560-B CD-ROM drive Panasonic pre-IDE MKE interface, akin to CR-511-B (which this is based off) and Creative Soundblaster. +NOTES: +- all commands but cmd_reset and cmd_read_subq acknowledge command byte issued + in first output return byte; +- 3do disks are not ISO9660 compatible. First sector at LBA 0 / MSF 00:02:00 is described at: + https://github.com/trapexit/portfolio_os/blob/bee7b0c8e4287083c73cb5497b658880c9e7af8e/utils/discdata.h#L52 + TODO: - Enough to load a few sectors and nothing else; - Find common points with other MKE drives, generate a streamlined interface; @@ -90,6 +96,7 @@ void cr560b_device::device_start() std::fill(std::begin(m_input_fifo), std::end(m_input_fifo), 0x00); std::fill(std::begin(m_output_fifo), std::end(m_output_fifo), 0x00); + std::fill(std::begin(m_transfer_buffer), std::end(m_transfer_buffer), 0xff); // register for save states save_item(NAME(m_input_fifo)); @@ -368,6 +375,7 @@ void cr560b_device::write(uint8_t data) case 0x03: cmd_motor_off(); break; //case 0x04: cmd_diag(); break; case 0x05: cmd_read_status(); break; + // TODO: drawer_open is issued by fz10e just after purging the disc avatars //case 0x06: cmd_drawer_open(); break; //case 0x07: cmd_drawer_close(); break; case 0x09: cmd_set_mode(); break; @@ -416,19 +424,42 @@ void cr560b_device::enable_w(int state) m_enabled = !bool(state); // active low } +/****************** + * + * Commands + * + *****************/ + // TODO: unverified in this implementation void cr560b_device::cmd_seek() { LOGMASKED(LOG_CMD, "Command: Seek\n"); LOGPARAM; + const u8 seek_mode = m_input_fifo[1]; + const u32 param = (m_input_fifo[2] << 16) | (m_input_fifo[3] << 8) | (m_input_fifo[4]); + + switch(seek_mode) + { + case 0x00: + LOGMASKED(LOG_CMD, "-> To LBA %06x\n", param); + break; + case 0x02: + LOGMASKED(LOG_CMD, "-> To MSF %06x\n", param); + break; + default: + LOGMASKED(LOG_CMD, "-> Unknown mode %02x!\n", seek_mode); + break; + } + // TODO: Does this enable STATUS_SUCCESS? u8 status = m_status; status |= STATUS_MOTOR; - m_output_fifo[0] = status; + m_output_fifo[0] = 0x01; + m_output_fifo[1] = status; status_change(status); - status_enable(1); + status_enable(2); } // TODO: unverified in this implementation @@ -439,10 +470,11 @@ void cr560b_device::cmd_read_status() u8 status = m_status; status &= ~STATUS_SUCCESS; - m_output_fifo[0] = status; + m_output_fifo[0] = 0x05; + m_output_fifo[1] = status; status_change(status); - status_enable(1); + status_enable(2); } // TODO: unverified in this implementation @@ -455,10 +487,11 @@ void cr560b_device::cmd_motor_on() // TODO: Does this enable STATUS_SUCCESS? u8 status = m_status; status |= STATUS_SUCCESS; - m_output_fifo[0] = status; + m_output_fifo[0] = 0x02; + m_output_fifo[1] = status; status_change(status); - status_enable(1); + status_enable(2); } // TODO: unverifed in this implementation @@ -471,10 +504,11 @@ void cr560b_device::cmd_motor_off() // TODO: Does this enable STATUS_SUCCESS? u8 status = m_status; status &= ~STATUS_MOTOR; - m_output_fifo[0] = status; + m_output_fifo[0] = 0x03; + m_output_fifo[1] = status; status_change(status); - status_enable(1); + status_enable(2); } void cr560b_device::cmd_set_mode() @@ -526,7 +560,6 @@ void cr560b_device::cmd_play_msf() { LOGMASKED(LOG_CMD, "Stop audio\n"); - if (m_cdda->audio_active()) status |= STATUS_SUCCESS; @@ -534,8 +567,6 @@ void cr560b_device::cmd_play_msf() status &= ~STATUS_PLAYING; status &= ~STATUS_MOTOR; - - status_change(status); } else if (start_lba < end_lba) { @@ -547,19 +578,18 @@ void cr560b_device::cmd_play_msf() status |= STATUS_PLAYING; status |= STATUS_MOTOR; - - status_change(status); } else { LOGMASKED(LOG_CMD, "Invalid range %d to %d!\n", start_lba, end_lba); status |= STATUS_ERROR; - status_change(status); } - m_output_fifo[0] = status; - status_enable(1); + m_output_fifo[0] = 0x0e; + m_output_fifo[1] = status; + status_change(status); + status_enable(2); } // TODO: unverified in this implementation @@ -584,10 +614,11 @@ void cr560b_device::cmd_play_track() status |= STATUS_PLAYING; status |= STATUS_MOTOR; - m_output_fifo[0] = status; + m_output_fifo[0] = 0x0f; + m_output_fifo[1] = status; status_change(status); - status_enable(1); + status_enable(2); } // TODO: unverified in this implementation (sure needs data ready in Clio) diff --git a/src/mame/misc/3do_amy.cpp b/src/mame/misc/3do_amy.cpp index 91784a54424..87eedb05643 100644 --- a/src/mame/misc/3do_amy.cpp +++ b/src/mame/misc/3do_amy.cpp @@ -20,6 +20,11 @@ TODO: #include "emu.h" #include "3do_amy.h" +#define VERBOSE (0) +//#define LOG_OUTPUT_FUNC osd_printf_warning + +#include "logmacro.h" + // a.k.a. Brooktree Bt9103 DEFINE_DEVICE_TYPE(AMY, amy_device, "amy", "3DO DA9103KPJ-XN \"Amy\" Digital Color Encoder") @@ -51,13 +56,13 @@ void amy_device::clut_write(u32 data) { const u8 reg = data >> 24; - //printf("%02x %06x\n",reg, data & 0xffffff); - // to color CLUT if (!BIT(reg, 7)) { const u8 which = reg & 0x1f; + LOG("Color CLUT %d mode %02x %06x\n", which, reg & 0x60, data & 0xff'ffff); + switch(reg & 0x60) { case 0x00: @@ -78,8 +83,20 @@ void amy_device::clut_write(u32 data) } else { - // TODO: background color (0xe0) & control word (0xc0) - // 0xe1: NULLOP + switch (reg) + { + // NULLOP + case 0xe1: break; + case 0xe0: + LOG("0xe0: background color %06x\n", data & 0xff'ffff); + break; + case 0xc0: + LOG("0xc0: display-control word %06x\n", data & 0xff'ffff); + break; + default: + LOG("%02x: unknown word set! %06x\n", data & 0xff'ffff); + break; + } } } @@ -92,7 +109,6 @@ void amy_device::pixel_xfer(int x, int y, u16 dot) g = m_custom_clut[(dot & 0x03e0) >> 5].g; b = m_custom_clut[(dot & 0x001f) >> 0].b; - //r = (dot & 0x7c00) >> 10; //g = (dot & 0x03e0) >> 5; //b = (dot & 0x001f) >> 0; diff --git a/src/mame/misc/3do_clio.h b/src/mame/misc/3do_clio.h index daeeb39590c..29505ce879e 100644 --- a/src/mame/misc/3do_clio.h +++ b/src/mame/misc/3do_clio.h @@ -30,7 +30,6 @@ public: auto vsync_cb() { return m_vsync_cb.bind(); } template <std::size_t Line> auto adb_out_cb() { return m_adb_out_cb[Line].bind(); } - void xbus_rdy_w(int state); void xbus_int_w(int state); void xbus_wr_w(int state); |
