From 4996c8d2e25692d620bfe79e050e460792663948 Mon Sep 17 00:00:00 2001 From: angelosa Date: Sat, 24 Feb 2024 00:55:55 +0100 Subject: bus/ata: basic Toshiba XM-3301 ATAPI CD drive [Angelo Salese, Grull Osgo] * Allows mounting with TAISATAP.SYS in DOS, allows gammagic to moving on to Voodoo init --- scripts/src/bus.lua | 2 ++ src/devices/bus/ata/atadev.cpp | 2 ++ src/devices/bus/ata/xm3301.cpp | 74 ++++++++++++++++++++++++++++++++++++++++++ src/devices/bus/ata/xm3301.h | 31 ++++++++++++++++++ src/devices/video/gf7600gs.cpp | 1 + src/mame/misc/gammagic.cpp | 26 +++++---------- src/mame/sega/lindbergh.cpp | 4 +-- 7 files changed, 121 insertions(+), 19 deletions(-) create mode 100644 src/devices/bus/ata/xm3301.cpp create mode 100644 src/devices/bus/ata/xm3301.h diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua index 8d7079b3ba2..23aed10441e 100644 --- a/scripts/src/bus.lua +++ b/scripts/src/bus.lua @@ -512,6 +512,8 @@ if (BUSES["ATA"]~=null) then MAME_DIR .. "src/devices/bus/ata/hdd.h", MAME_DIR .. "src/devices/bus/ata/px320a.cpp", MAME_DIR .. "src/devices/bus/ata/px320a.h", + MAME_DIR .. "src/devices/bus/ata/xm3301.cpp", + MAME_DIR .. "src/devices/bus/ata/xm3301.h", MAME_DIR .. "src/devices/bus/ata/zip100.cpp", MAME_DIR .. "src/devices/bus/ata/zip100.h", } diff --git a/src/devices/bus/ata/atadev.cpp b/src/devices/bus/ata/atadev.cpp index 6d2098707ff..2b1008eef33 100644 --- a/src/devices/bus/ata/atadev.cpp +++ b/src/devices/bus/ata/atadev.cpp @@ -14,6 +14,7 @@ #include "cr589.h" #include "hdd.h" #include "px320a.h" +#include "xm3301.h" #include "zip100.h" //------------------------------------------------- @@ -78,5 +79,6 @@ void ata_devices(device_slot_interface &device) device.option_add("cp2024", CP2024); device.option_add("cr589", CR589); device.option_add("px320a", PX320A); + device.option_add("xm3301", XM3301); device.option_add("zip100", ZIP100_IDE); } diff --git a/src/devices/bus/ata/xm3301.cpp b/src/devices/bus/ata/xm3301.cpp new file mode 100644 index 00000000000..fad92778dfd --- /dev/null +++ b/src/devices/bus/ata/xm3301.cpp @@ -0,0 +1,74 @@ +// license:BSD-3-Clause +// copyright-holders: Angelo Salese +/************************************************************************************************** + +Toshiba TAISATAP.SYS support + +TODO: +- XM-3301 on its own is a SCSI-2 drive, the ATAPI variants must be higher number(s)? + +**************************************************************************************************/ + +#include "emu.h" +#include "xm3301.h" + +DEFINE_DEVICE_TYPE(XM3301, toshiba_xm3301_device, "xm3301", "Toshiba XM-3301 CD-ROM Drive") + +toshiba_xm3301_device::toshiba_xm3301_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : atapi_cdrom_device(mconfig, XM3301, tag, owner, clock) +{ +} + +void toshiba_xm3301_device::device_start() +{ + atapi_cdrom_device::device_start(); + + memset(m_identify_buffer, 0, sizeof(m_identify_buffer)); + + // "E:XM" and "1.0" is where Master Model and Revision are printed + t10mmc::set_model("TOSHIBA CD-ROM DRVE:XM 1.0"); + + m_identify_buffer[0] = 0x8520; + + // TODO: everything below here is unconfirmed + m_identify_buffer[23] = ('1' << 8) | '.'; + m_identify_buffer[24] = ('0' << 8) | ' '; + m_identify_buffer[25] = (' ' << 8) | ' '; + m_identify_buffer[26] = (' ' << 8) | ' '; + + m_identify_buffer[27] = ('T' << 8) | 'O'; + m_identify_buffer[28] = ('S' << 8) | 'H'; + m_identify_buffer[29] = ('I' << 8) | 'B'; + m_identify_buffer[30] = ('A' << 8) | ' '; + m_identify_buffer[31] = ('X' << 8) | 'M'; + m_identify_buffer[32] = ('-' << 8) | '3'; + m_identify_buffer[33] = ('3' << 8) | '0'; + m_identify_buffer[34] = ('1' << 8) | ' '; + m_identify_buffer[35] = (' ' << 8) | ' '; + m_identify_buffer[36] = (' ' << 8) | ' '; + m_identify_buffer[37] = (' ' << 8) | ' '; + m_identify_buffer[38] = (' ' << 8) | ' '; + m_identify_buffer[39] = (' ' << 8) | ' '; + m_identify_buffer[40] = (' ' << 8) | ' '; + m_identify_buffer[41] = (' ' << 8) | ' '; + m_identify_buffer[42] = (' ' << 8) | ' '; + m_identify_buffer[43] = (' ' << 8) | ' '; + m_identify_buffer[44] = (' ' << 8) | ' '; + m_identify_buffer[45] = (' ' << 8) | ' '; + m_identify_buffer[46] = (' ' << 8) | ' '; + + m_identify_buffer[49] = 0x0400; // IORDY may be disabled +} + +void toshiba_xm3301_device::device_reset() +{ + atapi_cdrom_device::device_reset(); + +} + +void toshiba_xm3301_device::identify_packet_device() +{ + // gammagic CD_BALLY.SYS doesn't care about $a1 contents but wants these two to be high + // when command is issued. + m_status |= IDE_STATUS_DSC | IDE_STATUS_DRDY; +} diff --git a/src/devices/bus/ata/xm3301.h b/src/devices/bus/ata/xm3301.h new file mode 100644 index 00000000000..2c497e65860 --- /dev/null +++ b/src/devices/bus/ata/xm3301.h @@ -0,0 +1,31 @@ +// license:BSD-3-Clause +// copyright-holders:Angelo Salese + +#ifndef MAME_BUS_ATA_XM3301_H +#define MAME_BUS_ATA_XM3301_H + +#pragma once + +#include "atapicdr.h" + +class toshiba_xm3301_device : public atapi_cdrom_device +{ +public: + toshiba_xm3301_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + + static constexpr feature_type unemulated_features() { return feature::DISK; } + +protected: + // device-level overrides + virtual void device_start() override; + virtual void device_reset() override; + + virtual void identify_packet_device() override; +private: + +}; + +// device type definition +DECLARE_DEVICE_TYPE(XM3301, toshiba_xm3301_device) + +#endif // MAME_BUS_ATA_XM3301_H diff --git a/src/devices/video/gf7600gs.cpp b/src/devices/video/gf7600gs.cpp index 10188e627d5..bbe409525e2 100644 --- a/src/devices/video/gf7600gs.cpp +++ b/src/devices/video/gf7600gs.cpp @@ -32,6 +32,7 @@ void geforce_7600gs_device::device_add_mconfig(machine_config &config) // TODO: very late superset (G73) NVIDIA_NV3_VGA(config, m_vga, 0); m_vga->set_screen("screen"); + // FIXME: shared RAM m_vga->set_vram_size(256*1024*1024); } diff --git a/src/mame/misc/gammagic.cpp b/src/mame/misc/gammagic.cpp index 9503ff09e3f..b598ebac5ef 100644 --- a/src/mame/misc/gammagic.cpp +++ b/src/mame/misc/gammagic.cpp @@ -7,12 +7,8 @@ Game Magic (c) 1997 Bally Gaming Co. Preliminary driver by Grull Osgo TODO: -- gammagic: throws a CONFIG.SYS error in CD_BALLY.SYS right away. - Checks the disc drive in bp 6b5b subroutine against a 0x0258 status after sending an - identify packet device command (ATAPI returns 0x0208) expecting a ready + device fault? - Drive should be a Toshiba XM-3301 CD/DVD drive according to RAM buffer. - -- gammagic: can't find D: if above is skipped after detecting ESS and Voodoo cards. +- gammagic: pings ESS Solo Adlib ports, prints "Voodoo two 50hz enabled" (dual screen?), + "ignoring write to swapbufferCMD when CMDFIFO is enabled", hangs there; - 99bottles: "not High Sierra or ISO9660", likely bad (disc-at-once with one track?) @@ -154,9 +150,8 @@ void gammagic_state::gammagic(machine_config &config) i82371sb_ide_device &ide(I82371SB_IDE(config, "pci:07.1", 0, "maincpu")); ide.irq_pri().set("pci:07.0", FUNC(i82371sb_isa_device::pc_irq14_w)); ide.irq_sec().set("pci:07.0", FUNC(i82371sb_isa_device::pc_mirq0_w)); - // FIXME: change to Toshiba CDROM - ide.subdevice("ide1")->slot(0).set_default_option("cdrom"); -// ide.subdevice("ide1")->slot(0).set_option_machine_config("cdrom", cdrom_config); + ide.subdevice("ide1")->slot(0).set_default_option("xm3301"); +// ide.subdevice("ide1")->slot(0).set_option_machine_config("xm3301", cdrom_config); ide.subdevice("ide2")->slot(0).set_default_option(nullptr); PCI_SLOT(config, "pci:1", pci_cards, 15, 0, 1, 2, 3, nullptr); @@ -207,7 +202,7 @@ ROM_START( gammagic ) // 68k code, unknown size/number of roms ROM_LOAD("v8000.bin", 0x0000, 0x20000, NO_DUMP) - DISK_REGION( "pci:07.1:ide1:0:cdrom" ) + DISK_REGION( "pci:07.1:ide1:0:xm3301" ) DISK_IMAGE_READONLY( "gammagic", 0, SHA1(947650b13f87eea6608a32a1bae7dca19d911f15) ) ROM_END @@ -222,7 +217,7 @@ ROM_START( 99bottles ) // 68k code, unknown size/number of roms ROM_LOAD("v8000.bin", 0x0000, 0x20000, NO_DUMP) - DISK_REGION( "pci:07.1:ide1:0:cdrom" ) + DISK_REGION( "pci:07.1:ide1:0:xm3301" ) DISK_IMAGE_READONLY( "99bottles", 0, BAD_DUMP SHA1(0b874178c8dd3cfc451deb53dc7936dc4ad5a04f)) ROM_END @@ -234,10 +229,7 @@ ROM_END Game driver(s) ***************************************************************************/ -/************************* -* Game Drivers * -*************************/ -// YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS -GAME( 1999, gammagic, 0, gammagic, gammagic, gammagic_state, empty_init, ROT0, "Bally Gaming Co.", "Game Magic", MACHINE_IS_SKELETON ) -GAME( 1999, 99bottles, gammagic, gammagic, gammagic, gammagic_state, empty_init, ROT0, "Bally Gaming Co.", "99 Bottles of Beer", MACHINE_IS_SKELETON ) + +GAME( 1999, gammagic, 0, gammagic, gammagic, gammagic_state, empty_init, ROT0, "Bally Gaming Co.", "Game Magic", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1999, 99bottles, gammagic, gammagic, gammagic, gammagic_state, empty_init, ROT0, "Bally Gaming Co.", "99 Bottles of Beer", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_IMPERFECT_GRAPHICS ) diff --git a/src/mame/sega/lindbergh.cpp b/src/mame/sega/lindbergh.cpp index 888c1cc7a44..0850b1cdd27 100644 --- a/src/mame/sega/lindbergh.cpp +++ b/src/mame/sega/lindbergh.cpp @@ -17,8 +17,8 @@ TODO: - bp e7abf,1,{eip+=3;g} - bp 79068,1,{eip+=2;g} - bp 78aed,1,{eip+=2;g} -- BIOS detects CPU as :), throws errors 0270 (RTC), CMOS bad (0251) and - PCI resource conflict on SATA. +- BIOS detects CPU as :), 5M of System RAM, throws errors 0270 (RTC), + CMOS bad (0251) and PCI resource conflict on SATA. *************************************************************************** -- cgit v1.2.3