New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
msx2_cart.xml: Added 6 items, 5 working. #12052
Changes from 3 commits
bff1dc8
0fba52b
780f7ea
8c3e66f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,25 +5,29 @@ | |
|
||
#include "bus/nscsi/devices.h" | ||
#include "machine/nscsi_bus.h" | ||
#include "machine/mb87030.h" | ||
#include "machine/wd33c9x.h" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorted the includes |
||
|
||
/* | ||
|
||
Implementation of SCSI interface as it appeared in: | ||
- MSX Computer Club Gouda MSX-SCSI Interface | ||
- ESE MegaSCSI | ||
- Came with SRAM on the cartridge (128/256/512/1024KB SRAM) | ||
|
||
|
||
Other known SCSI(-ish) interfaces: | ||
|
||
ASCII HD Interface (SASI Interface) | ||
B.E.R.T. | ||
ESE MegaSCSI | ||
- Came with SRAM on the cartridge (128/256/512/1024KB SRAM) | ||
HSH SCSI Interface | ||
MAK/Green/Sparrowsoft SCSI Interface | ||
MK SCSI Interface | ||
- Evolved into B.E.R.T. SCSI Interface. | ||
|
||
TODO: | ||
- Fix MegaSCSI mb89352 write operation at 8MHz. | ||
|
||
*/ | ||
|
||
namespace | ||
|
@@ -47,15 +51,9 @@ class msx_cart_gouda_scsi_device : public device_t, public msx_cart_interface | |
private: | ||
required_device<wd33c93a_device> m_wd33c93a; | ||
|
||
void wd33c93a(device_t *device); | ||
void reset_w(u8 data); | ||
}; | ||
|
||
void msx_cart_gouda_scsi_device::wd33c93a(device_t *device) | ||
{ | ||
device->set_clock(10'000'000); | ||
} | ||
|
||
void msx_cart_gouda_scsi_device::device_add_mconfig(machine_config &config) | ||
{ | ||
NSCSI_BUS(config, "scsi", 0); | ||
|
@@ -65,9 +63,7 @@ void msx_cart_gouda_scsi_device::device_add_mconfig(machine_config &config) | |
NSCSI_CONNECTOR(config, "scsi:3", default_scsi_devices, nullptr, false); | ||
NSCSI_CONNECTOR(config, "scsi:4", default_scsi_devices, nullptr, false); | ||
NSCSI_CONNECTOR(config, "scsi:5", default_scsi_devices, nullptr, false); | ||
NSCSI_CONNECTOR(config, "scsi:6").option_set("wd33c93a", WD33C93A) | ||
.machine_config([this] (device_t *device) { wd33c93a(device); }); | ||
|
||
NSCSI_CONNECTOR(config, "scsi:6").option_set("wd33c93a", WD33C93A).clock(10_MHz_XTAL); | ||
} | ||
|
||
std::error_condition msx_cart_gouda_scsi_device::initialize_cartridge(std::string &message) | ||
|
@@ -98,6 +94,144 @@ void msx_cart_gouda_scsi_device::reset_w(u8 data) | |
m_wd33c93a->reset_w(data); | ||
} | ||
|
||
|
||
|
||
class msx_cart_mega_scsi_device : public device_t, public msx_cart_interface | ||
{ | ||
public: | ||
msx_cart_mega_scsi_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) | ||
: device_t(mconfig, MSX_CART_MEGA_SCSI, tag, owner, clock) | ||
, msx_cart_interface(mconfig, *this) | ||
, m_mb89352a(*this, "scsi:7:mb89352a") | ||
, m_srambank(*this, "srambank%u", 0U) | ||
, m_view0(*this, "view0") | ||
, m_view2(*this, "view2") | ||
, m_view3(*this, "view3") | ||
, m_bank_mask(0) | ||
{ } | ||
|
||
virtual std::error_condition initialize_cartridge(std::string &message) override; | ||
|
||
static constexpr feature_type imperfect_features() { return feature::TIMING; } | ||
|
||
protected: | ||
virtual void device_start() override { } | ||
virtual void device_reset() override; | ||
virtual void device_add_mconfig(machine_config &config) override; | ||
|
||
private: | ||
static constexpr size_t BANK_SIZE = 0x2000; | ||
|
||
required_device<mb89352_device> m_mb89352a; | ||
memory_bank_array_creator<4> m_srambank; | ||
memory_view m_view0; | ||
memory_view m_view2; | ||
memory_view m_view3; | ||
u8 m_bank_mask; | ||
|
||
template <int Bank> void bank_w(u8 data); | ||
}; | ||
|
||
void msx_cart_mega_scsi_device::device_add_mconfig(machine_config &config) | ||
{ | ||
NSCSI_BUS(config, "scsi", 0); | ||
NSCSI_CONNECTOR(config, "scsi:0", default_scsi_devices, "harddisk", false); | ||
NSCSI_CONNECTOR(config, "scsi:1", default_scsi_devices, nullptr, false); | ||
NSCSI_CONNECTOR(config, "scsi:2", default_scsi_devices, nullptr, false); | ||
NSCSI_CONNECTOR(config, "scsi:3", default_scsi_devices, nullptr, false); | ||
NSCSI_CONNECTOR(config, "scsi:4", default_scsi_devices, nullptr, false); | ||
NSCSI_CONNECTOR(config, "scsi:5", default_scsi_devices, nullptr, false); | ||
NSCSI_CONNECTOR(config, "scsi:6", default_scsi_devices, nullptr, false); | ||
// Input clock is 8MHz according to the schematic. However, clocks below 11MHz cause writes to fail. Reads are fine at 8MHz. | ||
//NSCSI_CONNECTOR(config, "scsi:7").option_set("mb89352a", MB89352).clock(16_MHz_XTAL/2); | ||
NSCSI_CONNECTOR(config, "scsi:7").option_set("mb89352a", MB89352).clock(11'000'000); | ||
} | ||
|
||
void msx_cart_mega_scsi_device::device_reset() | ||
{ | ||
for (int i = 0; i < 4; i++) | ||
m_srambank[i]->set_entry(0); | ||
m_view0.select(0); | ||
m_view2.select(0); | ||
m_view3.select(0); | ||
} | ||
|
||
std::error_condition msx_cart_mega_scsi_device::initialize_cartridge(std::string &message) | ||
{ | ||
if (!cart_sram_region()) | ||
{ | ||
message = "msx_cart_mega_scsi_device: Required region 'sram' was not found."; | ||
return image_error::INTERNAL; | ||
} | ||
|
||
const u32 sram_size = cart_sram_region()->bytes(); | ||
|
||
if (sram_size != 0x20000 && sram_size != 0x40000 && sram_size != 0x80000 && sram_size != 0x100000) | ||
{ | ||
message = "msx_cart_mega_scsi_device: Region 'sram' has unsupported size."; | ||
return image_error::INVALIDLENGTH; | ||
} | ||
|
||
const u16 sram_banks = sram_size / BANK_SIZE; | ||
m_bank_mask = sram_banks - 1; | ||
|
||
for (int i = 0; i < 4; i++) | ||
m_srambank[i]->configure_entries(0, sram_banks, cart_sram_region()->base(), BANK_SIZE); | ||
|
||
page(1)->install_view(0x4000, 0x5fff, m_view0); | ||
m_view0[0].install_read_bank(0x4000, 0x5fff, m_srambank[0]); | ||
m_view0[1].install_readwrite_bank(0x4000, 0x5fff, m_srambank[0]); | ||
m_view0[2].install_read_handler(0x4000, 0x4fff, emu::rw_delegate(*m_mb89352a, FUNC(mb89352_device::dma_r))); | ||
m_view0[2].install_write_handler(0x4000, 0x4fff, emu::rw_delegate(*m_mb89352a, FUNC(mb89352_device::dma_w))); | ||
// mb89352 is mirrored at 5000 - 5fff | ||
for (int i = 0; i < 0x1000; i += 0x10) | ||
m_view0[2].install_device(0x5000 + i, 0x500f + i, *m_mb89352a, &mb89352_device::map); | ||
page(1)->install_read_bank(0x6000, 0x7fff, m_srambank[1]); | ||
page(2)->install_view(0x8000, 0x9fff, m_view2); | ||
m_view2[0].install_read_bank(0x8000, 0x9fff, m_srambank[2]); | ||
m_view2[1].install_readwrite_bank(0x8000, 0x9fff, m_srambank[2]); | ||
m_view2[2].install_read_handler(0x8000, 0x8fff, emu::rw_delegate(*m_mb89352a, FUNC(mb89352_device::dma_r))); | ||
m_view2[2].install_write_handler(0x8000, 0x8fff, emu::rw_delegate(*m_mb89352a, FUNC(mb89352_device::dma_w))); | ||
// mb89352 is mirrored at 9000 - 9fff | ||
for (int i = 0; i < 0x1000; i += 0x10) | ||
m_view2[2].install_device(0x9000 + i, 0x900f + i, *m_mb89352a, &mb89352_device::map); | ||
page(2)->install_view(0xa000, 0xbfff, m_view3); | ||
m_view3[0].install_read_bank(0xa000, 0xbfff, m_srambank[3]); | ||
m_view3[1].install_readwrite_bank(0xa000, 0xbfff, m_srambank[3]); | ||
m_view3[2].install_read_handler(0xa000, 0xafff, emu::rw_delegate(*m_mb89352a, FUNC(mb89352_device::dma_r))); | ||
m_view3[2].install_write_handler(0xa000, 0xafff, emu::rw_delegate(*m_mb89352a, FUNC(mb89352_device::dma_w))); | ||
// mb89352 is mirrored at b000 - bfff | ||
for (int i = 0; i < 0x1000; i += 0x10) | ||
m_view3[2].install_device(0xb000 + i, 0xb00f + i, *m_mb89352a, &mb89352_device::map); | ||
|
||
page(1)->install_write_handler(0x6000, 0x67ff, emu::rw_delegate(*this, FUNC(msx_cart_mega_scsi_device::bank_w<0>))); | ||
page(1)->install_write_handler(0x6800, 0x6fff, emu::rw_delegate(*this, FUNC(msx_cart_mega_scsi_device::bank_w<1>))); | ||
page(1)->install_write_handler(0x7000, 0x77ff, emu::rw_delegate(*this, FUNC(msx_cart_mega_scsi_device::bank_w<2>))); | ||
page(1)->install_write_handler(0x7800, 0x7fff, emu::rw_delegate(*this, FUNC(msx_cart_mega_scsi_device::bank_w<3>))); | ||
|
||
return std::error_condition(); | ||
} | ||
|
||
template <int Bank> | ||
void msx_cart_mega_scsi_device::bank_w(u8 data) | ||
{ | ||
// Also writes of $00 and $10 to 7ffe are seen before banking; some kind of banking enable? | ||
m_srambank[Bank]->set_entry(data & m_bank_mask); | ||
if (Bank != 1) | ||
{ | ||
int view_to_select = BIT(data, 7) ? 1 : (BIT(data, 6) ? 2 : 0); | ||
|
||
if (Bank == 0) | ||
m_view0.select(view_to_select); | ||
if (Bank == 2) | ||
m_view2.select(view_to_select); | ||
if (Bank == 3) | ||
m_view3.select(view_to_select); | ||
} | ||
} | ||
|
||
|
||
} // anonymous namespace | ||
|
||
DEFINE_DEVICE_TYPE_PRIVATE(MSX_CART_GOUDA_SCSI, msx_cart_interface, msx_cart_gouda_scsi_device, "msx_cart_gouda_scsi", "MSX Computer Club Gouda MSX-SCSI Interface") | ||
DEFINE_DEVICE_TYPE_PRIVATE(MSX_CART_MEGA_SCSI, msx_cart_interface, msx_cart_mega_scsi_device, "msx_cart_mega_scsi", "ESE MEGA-SCSI") |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,9 +74,9 @@ class mb87030_device : public nscsi_device, public nscsi_slot_card_interface | |
constexpr static uint8_t SCTL_RESET_AND_DISABLE = 0x80; | ||
|
||
constexpr static uint8_t SCMD_TERM_MODE = 0x01; | ||
constexpr static uint8_t SCMD_PRG_XFER = 0x02; | ||
constexpr static uint8_t SCMD_INTERCEPT_XFER = 0x04; | ||
constexpr static uint8_t SCMD_RST_OUT = 0x08; | ||
constexpr static uint8_t SCMD_PRG_XFER = 0x04; | ||
constexpr static uint8_t SCMD_INTERCEPT_XFER = 0x08; | ||
constexpr static uint8_t SCMD_RST_OUT = 0x10; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Have you checked that this doesn’t break the HP9000/300 series machines that use this device? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Before and after this change the hp9k drivers fail to boot the os from the hdd image in the software list resulting in a 'Root device busy' message and halting the boot process. |
||
constexpr static uint8_t SCMD_CMD_BUS_RELEASE = 0x00; | ||
constexpr static uint8_t SCMD_CMD_SELECT = 0x20; | ||
constexpr static uint8_t SCMD_CMD_RESET_ATN = 0x40; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you’re including the model number in the title, it should probably be in both titles. I’d probably make it “Video Digitizer HBI-V1 (Japan)” and “ビデオデジタイザー HBI-V1” as the box and manual have “Video Digitizer” most prominent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have removed the HBI-V1 part from the description to match the Japanese name on the box and manual.