Skip to content
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

Merged
merged 4 commits into from Feb 24, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
101 changes: 101 additions & 0 deletions hash/msx2_cart.xml
Expand Up @@ -3582,6 +3582,26 @@ LZ93A13 (32 pin) - 8KB banks
</part>
</software>

<software name="hbiv1" supported="no">
<description>HBI-V1 Video Digitizer (Japan)</description>
<year>1989</year>
<publisher>Sony</publisher>
<notes>Digitizer cartridge not emulated.</notes>
<info name="alt_title" value="ビデオデジタイザー"/>
Copy link
Member

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.

Copy link
Contributor Author

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.

<info name="serial" value="HBI-V1"/>
<part name="cart" interface="msx_cart">
<dataarea name="rom" size="0x8000">
<rom name="hbp-v1.ic107" size="0x8000" status="nodump"/>
</dataarea>
</part>
<part name="flop1" interface="floppy_3_5">
<feature name="part_id" value="オートグラフィックローダ"/>
<dataarea name="flop" size="737280">
<rom name="auto graphic loader - sony.dsk" size="737280" crc="b7675805" sha1="5133282dd32361d8f3c94de05b3dd6b1773f8231"/>
</dataarea>
</part>
</software>

<!-- Missing Kanji rom. -->
<software name="msxwrit2" supported="no">
<description>Japanese MSX-Write II (Japan)</description>
Expand Down Expand Up @@ -3827,6 +3847,74 @@ LZ93A13 (32 pin) - 8KB banks
</part>
</software>

<software name="megascsi" supported="partial">
<description>MEGA-SCSI (1024KB)</description>
<year>1995</year>
<publisher>ESE Artists' Factory</publisher>
<info name="usage" value="Requires MSX-DOS2."/>
<part name="cart" interface="msx_cart">
<feature name="slot" value="mega_scsi"/>
<dataarea name="sram" size="0x100000" />
</part>
<part name="flop" interface="floppy_3_5">
<dataarea name="flop" size="737280">
<!-- Already contains some kernel files generated with ksaver. -->
<rom name="mega-scsi - ese artists factory.dsk" size="737280" crc="59e65112" sha1="616c63e979c992182c2664c9ca65ea7e984d5c8d" status="baddump"/>
</dataarea>
</part>
</software>

<software name="megascsi4" cloneof="megascsi" supported="partial">
<description>MEGA-SCSI (512KB)</description>
<year>1995</year>
<publisher>ESE Artists' Factory</publisher>
<info name="usage" value="Requires MSX-DOS2."/>
<part name="cart" interface="msx_cart">
<feature name="slot" value="mega_scsi"/>
<dataarea name="sram" size="0x80000" />
</part>
<part name="flop" interface="floppy_3_5">
<dataarea name="flop" size="737280">
<!-- Already contains some kernel files generated with ksaver. -->
<rom name="mega-scsi - ese artists factory.dsk" size="737280" crc="59e65112" sha1="616c63e979c992182c2664c9ca65ea7e984d5c8d" status="baddump"/>
</dataarea>
</part>
</software>

<software name="megascsi2" cloneof="megascsi" supported="partial">
<description>MEGA-SCSI (256KB)</description>
<year>1995</year>
<publisher>ESE Artists' Factory</publisher>
<info name="usage" value="Requires MSX-DOS2."/>
<part name="cart" interface="msx_cart">
<feature name="slot" value="mega_scsi"/>
<dataarea name="sram" size="0x40000" />
</part>
<part name="flop" interface="floppy_3_5">
<dataarea name="flop" size="737280">
<!-- Already contains some kernel files generated with ksaver. -->
<rom name="mega-scsi - ese artists factory.dsk" size="737280" crc="59e65112" sha1="616c63e979c992182c2664c9ca65ea7e984d5c8d" status="baddump"/>
</dataarea>
</part>
</software>

<software name="megascsi1" cloneof="megascsi" supported="partial">
<description>MEGA-SCSI (128KB)</description>
<year>1995</year>
<publisher>ESE Artists' Factory</publisher>
<info name="usage" value="Requires MSX-DOS2."/>
<part name="cart" interface="msx_cart">
<feature name="slot" value="mega_scsi"/>
<dataarea name="sram" size="0x20000" />
</part>
<part name="flop" interface="floppy_3_5">
<dataarea name="flop" size="737280">
<!-- Already contains some kernel files generated with ksaver. -->
<rom name="mega-scsi - ese artists factory.dsk" size="737280" crc="59e65112" sha1="616c63e979c992182c2664c9ca65ea7e984d5c8d" status="baddump"/>
</dataarea>
</part>
</software>

<!-- Homebrew / Doujin software -->

<software name="moronslt" supported="partial">
Expand Down Expand Up @@ -3980,6 +4068,19 @@ LZ93A13 (32 pin) - 8KB banks
</part>
</software>

<software name="dskpro116">
<description>DSKPRO (v11.6)</description>
<year>2017</year>
<publisher>Pirates do Caribe</publisher>
<info name="usage" value="Type CALL DSKPRO or _DSKPRO to start the software."/>
<part name="cart" interface="msx_cart">
<feature name="start_page" value="1"/>
<dataarea name="rom" size="0x8000">
<rom name="dskpro - pirates do caribe (v11.6).rom" size="0x8000" crc="d4e00d75" sha1="8d2b1bbaee6f9ab86b6764c51a94d89e2a1959a0"/>
</dataarea>
</part>
</software>

<software name="equivocal" supported="partial">
<description>Equivocal (v1.5)</description>
<year>2009</year>
Expand Down
1 change: 1 addition & 0 deletions src/devices/bus/msx/cart/cartridge.cpp
Expand Up @@ -81,6 +81,7 @@ void msx_cart(device_slot_interface &device, bool is_in_subslot)
device.option_add_internal(slotoptions::LOVEPLUS, MSX_CART_LOVEPLUS);
device.option_add_internal(slotoptions::MAJUSTUSHI, MSX_CART_MAJUTSUSHI);
device.option_add_internal(slotoptions::MATRA_COMP, MSX_CART_MATRA_COMP);
device.option_add_internal(slotoptions::MEGA_SCSI, MSX_CART_MEGA_SCSI);
device.option_add_internal(slotoptions::MSXAUD_FSCA1, MSX_CART_MSX_AUDIO_FSCA1);
device.option_add_internal(slotoptions::MSXAUD_HXMU900, MSX_CART_MSX_AUDIO_HXMU900);
device.option_add_internal(slotoptions::MSXAUD_NMS1205, MSX_CART_MSX_AUDIO_NMS1205);
Expand Down
156 changes: 145 additions & 11 deletions src/devices/bus/msx/cart/scsi.cpp
Expand Up @@ -5,25 +5,29 @@

#include "bus/nscsi/devices.h"
#include "machine/nscsi_bus.h"
#include "machine/mb87030.h"
#include "machine/wd33c9x.h"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#include statements not sorted.

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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
Expand All @@ -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);
Expand All @@ -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)
Expand Down Expand Up @@ -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")
1 change: 1 addition & 0 deletions src/devices/bus/msx/cart/scsi.h
Expand Up @@ -8,5 +8,6 @@
#include "bus/msx/slot/cartridge.h"

DECLARE_DEVICE_TYPE(MSX_CART_GOUDA_SCSI, msx_cart_interface)
DECLARE_DEVICE_TYPE(MSX_CART_MEGA_SCSI, msx_cart_interface)

#endif // MAME_BUS_MSX_CART_SCSI_H
3 changes: 2 additions & 1 deletion src/devices/bus/msx/cart/slotoptions.cpp
Expand Up @@ -31,8 +31,8 @@ char const *const DISK_NMS1200 = "disk_nms1200";
char const *const DISK_TADPF550 = "disk_tadpf550";
char const *const DISK_VY0010 = "disk_vy0010";
char const *const DOOLY = "dooly";
char const *const EC701 = "ec701";
char const *const EASISPEECH = "easispeech";
char const *const EC701 = "ec701";
char const *const FMPAC = "fmpac";
char const *const FS_SR021 = "fs_sr021";
char const *const FS_SR022 = "fs_sr022";
Expand All @@ -55,6 +55,7 @@ char const *const KOREAN_HYDLIDE2 = "korean_hydlide2";
char const *const LOVEPLUS = "loveplus";
char const *const MAJUSTUSHI = "majutsushi";
char const *const MATRA_COMP = "matra_comp";
char const *const MEGA_SCSI = "mega_scsi";
char const *const MM256K = "mm256k";
char const *const MM512K = "mm512k";
char const *const MM768K = "mm768k";
Expand Down
3 changes: 2 additions & 1 deletion src/devices/bus/msx/cart/slotoptions.h
Expand Up @@ -34,8 +34,8 @@ extern char const *const DISK_NMS1200;
extern char const *const DISK_TADPF550;
extern char const *const DISK_VY0010;
extern char const *const DOOLY;
extern char const *const EC701;
extern char const *const EASISPEECH;
extern char const *const EC701;
extern char const *const FMPAC;
extern char const *const FS_SR021;
extern char const *const FS_SR022;
Expand All @@ -58,6 +58,7 @@ extern char const *const KOREAN_HYDLIDE2;
extern char const *const LOVEPLUS;
extern char const *const MAJUSTUSHI;
extern char const *const MATRA_COMP;
extern char const *const MEGA_SCSI;
extern char const *const MM256K;
extern char const *const MM512K;
extern char const *const MM768K;
Expand Down
6 changes: 3 additions & 3 deletions src/devices/machine/mb87030.h
Expand Up @@ -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;
Copy link
Member

Choose a reason for hiding this comment

The 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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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.
Similarly trying to install the os on a clean harddisk image results in an error when creating the filesystem.

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;
Expand Down