From 161d8afb11c3efb04c43198bbb3097b54dee47eb Mon Sep 17 00:00:00 2001 From: arbee Date: Mon, 21 Aug 2023 22:58:24 -0400 Subject: apple/cuda.cpp: Applied the same set_default_bios cleanup, restoring compatibility with previous ROMs. [R. Belmont] apple/egret.cpp: Fixed an oversight in the previous revision. [R. Belmont] --- src/mame/apple/cuda.cpp | 103 ++++++++-------------------------------- src/mame/apple/cuda.h | 36 ++------------ src/mame/apple/egret.cpp | 6 +-- src/mame/apple/imacg3.cpp | 3 +- src/mame/apple/maclc.cpp | 3 +- src/mame/apple/maclc3.cpp | 3 +- src/mame/apple/macpdm.cpp | 3 +- src/mame/apple/macquadra605.cpp | 3 +- src/mame/apple/macquadra630.cpp | 3 +- src/mame/apple/pippin.cpp | 3 +- src/mame/apple/powermacg3.cpp | 3 +- 11 files changed, 42 insertions(+), 127 deletions(-) diff --git a/src/mame/apple/cuda.cpp b/src/mame/apple/cuda.cpp index 7dcfd2c0966..4bf4860c20c 100644 --- a/src/mame/apple/cuda.cpp +++ b/src/mame/apple/cuda.cpp @@ -53,7 +53,6 @@ #include "emu.h" #include "cuda.h" #include "cpu/m6805/m6805.h" -#include "sound/asc.h" #define LOG_ADB (1U << 1) // low-level ADB details #define LOG_I2C (1U << 2) // low-level I2C details @@ -68,10 +67,7 @@ // DEVICE DEFINITIONS //************************************************************************** -DEFINE_DEVICE_TYPE(CUDA_V235, cuda_235_device, "cuda235", "Apple Cuda v2.35 ADB/I2C") -DEFINE_DEVICE_TYPE(CUDA_V237, cuda_237_device, "cuda237", "Apple Cuda v2.37 ADB/I2C") -DEFINE_DEVICE_TYPE(CUDA_V238, cuda_238_device, "cuda238", "Apple Cuda v2.38 ADB/I2C") -DEFINE_DEVICE_TYPE(CUDA_V240, cuda_240_device, "cuda240", "Apple Cuda v2.40 ADB/I2C") +DEFINE_DEVICE_TYPE(CUDA_V2XX, cuda_2xx_device, "cuda", "Apple Cuda v2.xx ADB/I2C") DEFINE_DEVICE_TYPE(CUDA_V302, cuda_302_device, "cuda302", "Apple Cuda v3.02 ADB/I2C") DEFINE_DEVICE_TYPE(CUDA_LITE, cuda_lite_device,"cudalite","Apple Cuda Lite ADB+I2C+PS/2") @@ -126,6 +122,10 @@ cuda_device::cuda_device(const machine_config &mconfig, device_type type, const m_iic_sda(0), m_last_adb_time(0), m_cuda_controls_power(false), m_adb_in(false), m_reset_line(0), m_adb_dtime(0), m_pram_loaded(false) { + std::fill(std::begin(m_pram), std::end(m_pram), 0); + std::fill(std::begin(m_disk_pram), std::end(m_disk_pram), 0); + std::fill(std::begin(m_ports), std::end(m_ports), 0); + std::fill(std::begin(m_ddrs), std::end(m_ddrs), 0); } void cuda_device::device_start() @@ -165,25 +165,10 @@ void cuda_device::device_start() void cuda_device::device_reset() { - m_ddrs[0] = m_ddrs[1] = m_ddrs[2] = 0; - m_ports[0] = m_ports[1] = m_ports[2] = 0; - m_timer->adjust(attotime::never); m_prog_timer->adjust(attotime::never); - m_cuda_controls_power = false; // set to hard power control - m_adb_in = true; // line is pulled up to +5v, so nothing plugged in would read as "1" - m_reset_line = 0; - m_tip = 0; - m_treq = 0; - m_byteack = 0; - m_via_data = 0; - m_via_clock = 0; - m_pll_ctrl = 0; - m_timer_ctrl = 0; m_last_adb_time = m_maincpu->total_cycles(); - m_onesec = 0; - m_last_adb = 0; } void cuda_device::send_port(u8 offset, u8 data) @@ -516,83 +501,35 @@ bool cuda_device::nvram_write(util::write_stream &file) return !file.write(m_pram, 0x100, actual) && actual == 0x100; } -// Cuda v2.35 ------------------------------------------------------------------------ - -ROM_START( cuda235 ) - ROM_REGION(0x1100, "roms", 0) - ROM_LOAD( "341s0417.bin", 0x0000, 0x1100, CRC(571f24c9) SHA1(a2ae12492389a00e5f4b1ef19b267d6f3a8eadc3) ) - - ROM_REGION(0x100, "defaultnv", 0) - ROM_LOAD( "cuda_nvram.bin", 0x000000, 0x000100, CRC(6e3da389) SHA1(e5b13a2a904cc9fc612ed25b76718c501c11b00a) ) -ROM_END - -const tiny_rom_entry *cuda_235_device::device_rom_region() const -{ - return ROM_NAME( cuda235 ); -} - -cuda_235_device::cuda_235_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : - cuda_device(mconfig, CUDA_V235, tag, owner, clock) -{ -} - -// Cuda v2.37 ------------------------------------------------------------------------ - -ROM_START( cuda237 ) - ROM_REGION(0x1100, "roms", 0) - ROM_LOAD( "341s0788.bin", 0x0000, 0x1100, CRC(df6e1b43) SHA1(ec23cc6214c472d61b98964928c40589517a3172) ) - - ROM_REGION(0x100, "defaultnv", 0) - ROM_LOAD( "cuda_nvram.bin", 0x000000, 0x000100, CRC(6e3da389) SHA1(e5b13a2a904cc9fc612ed25b76718c501c11b00a) ) -ROM_END - -const tiny_rom_entry *cuda_237_device::device_rom_region() const -{ - return ROM_NAME( cuda237 ); -} - -cuda_237_device::cuda_237_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : - cuda_device(mconfig, CUDA_V237, tag, owner, clock) -{ -} - -// Cuda v2.38 ------------------------------------------------------------------------ +// Cuda v2.XX ------------------------------------------------------------------------ -ROM_START( cuda238 ) +ROM_START( cuda2xx ) ROM_REGION(0x1100, "roms", 0) - ROM_LOAD( "cuda2_38d.bin", 0x0000, 0x1100, CRC(682d2ace) SHA1(81a9e25204f58363ed2f5945763ac19a1a66234e) ) + ROM_DEFAULT_BIOS("341s0788") - ROM_REGION(0x100, "defaultnv", 0) - ROM_LOAD( "cuda_nvram.bin", 0x000000, 0x000100, CRC(6e3da389) SHA1(e5b13a2a904cc9fc612ed25b76718c501c11b00a) ) -ROM_END + ROM_SYSTEM_BIOS(0, "341s0417", "Cuda 2.35 (341S0417)") + ROMX_LOAD( "341s0417.bin", 0x0000, 0x1100, CRC(571f24c9) SHA1(a2ae12492389a00e5f4b1ef19b267d6f3a8eadc3), ROM_BIOS(0) ) -const tiny_rom_entry *cuda_238_device::device_rom_region() const -{ - return ROM_NAME( cuda238 ); -} + ROM_SYSTEM_BIOS(1, "341s0788", "Cuda 2.37 (341S0788)") + ROMX_LOAD("341s0788.bin", 0x0000, 0x1100, CRC(df6e1b43) SHA1(ec23cc6214c472d61b98964928c40589517a3172), ROM_BIOS(1)) -cuda_238_device::cuda_238_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : - cuda_device(mconfig, CUDA_V238, tag, owner, clock) -{ -} + ROM_SYSTEM_BIOS(2, "341s0789", "Cuda 2.38 (341S0789)") + ROMX_LOAD("341s0789.bin", 0x0000, 0x1100, CRC(682d2ace) SHA1(81a9e25204f58363ed2f5945763ac19a1a66234e), ROM_BIOS(2)) -// Cuda v2.40 ------------------------------------------------------------------------ - -ROM_START( cuda240 ) - ROM_REGION(0x1100, "roms", 0) - ROM_LOAD( "341s0060.bin", 0x0000, 0x1100, CRC(0f5e7b4a) SHA1(972b3778146d9787b18c3a9874d505cf606b3e15) ) + ROM_SYSTEM_BIOS(3, "341s0060", "Cuda 2.40 (341S0060)") + ROMX_LOAD("341s0060.bin", 0x0000, 0x1100, CRC(0f5e7b4a) SHA1(972b3778146d9787b18c3a9874d505cf606b3e15), ROM_BIOS(3)) ROM_REGION(0x100, "defaultnv", 0) ROM_LOAD( "cuda_nvram.bin", 0x000000, 0x000100, CRC(6e3da389) SHA1(e5b13a2a904cc9fc612ed25b76718c501c11b00a) ) ROM_END -const tiny_rom_entry *cuda_240_device::device_rom_region() const +const tiny_rom_entry *cuda_2xx_device::device_rom_region() const { - return ROM_NAME( cuda240 ); + return ROM_NAME( cuda2xx ); } -cuda_240_device::cuda_240_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : - cuda_device(mconfig, CUDA_V240, tag, owner, clock) +cuda_2xx_device::cuda_2xx_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + cuda_device(mconfig, CUDA_V2XX, tag, owner, clock) { } diff --git a/src/mame/apple/cuda.h b/src/mame/apple/cuda.h index 87eda596ff4..754d943b813 100644 --- a/src/mame/apple/cuda.h +++ b/src/mame/apple/cuda.h @@ -95,37 +95,10 @@ private: void send_port(u8 offset, u8 data); }; -class cuda_235_device : public cuda_device +class cuda_2xx_device : public cuda_device { public: - cuda_235_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - -protected: - virtual const tiny_rom_entry *device_rom_region() const override; -}; - -class cuda_237_device : public cuda_device -{ -public: - cuda_237_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - -protected: - virtual const tiny_rom_entry *device_rom_region() const override; -}; - -class cuda_238_device : public cuda_device -{ -public: - cuda_238_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - -protected: - virtual const tiny_rom_entry *device_rom_region() const override; -}; - -class cuda_240_device : public cuda_device -{ -public: - cuda_240_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + cuda_2xx_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); protected: virtual const tiny_rom_entry *device_rom_region() const override; @@ -160,10 +133,7 @@ private: }; // device type definition -DECLARE_DEVICE_TYPE(CUDA_V235, cuda_235_device) -DECLARE_DEVICE_TYPE(CUDA_V237, cuda_237_device) -DECLARE_DEVICE_TYPE(CUDA_V238, cuda_238_device) -DECLARE_DEVICE_TYPE(CUDA_V240, cuda_240_device) +DECLARE_DEVICE_TYPE(CUDA_V2XX, cuda_2xx_device) DECLARE_DEVICE_TYPE(CUDA_LITE, cuda_lite_device) DECLARE_DEVICE_TYPE(CUDA_V302, cuda_302_device) diff --git a/src/mame/apple/egret.cpp b/src/mame/apple/egret.cpp index 197b5ce0a73..2f404e7aaa7 100644 --- a/src/mame/apple/egret.cpp +++ b/src/mame/apple/egret.cpp @@ -70,13 +70,13 @@ ROM_START( egret ) ROM_DEFAULT_BIOS("341s0851") ROM_SYSTEM_BIOS(0, "344s0100", "Egret 1.00 (344S0100)") - ROM_LOAD("344s0100.bin", 0x0000, 0x1100, CRC(59e2b6b6) SHA1(540e752b7da521f1bdb16e0ad7c5f46ddc92d4e9)) + ROMX_LOAD("344s0100.bin", 0x0000, 0x1100, CRC(59e2b6b6) SHA1(540e752b7da521f1bdb16e0ad7c5f46ddc92d4e9), ROM_BIOS(0)) ROM_SYSTEM_BIOS(1, "341s0850", "Egret 1.01 (earlier) (341S0850)") - ROM_LOAD("341s0850.bin", 0x0000, 0x1100, CRC(4906ecd0) SHA1(95e08ba0c5d4b242f115f104aba9905dbd3fd87c)) + ROMX_LOAD("341s0850.bin", 0x0000, 0x1100, CRC(4906ecd0) SHA1(95e08ba0c5d4b242f115f104aba9905dbd3fd87c), ROM_BIOS(1)) ROM_SYSTEM_BIOS(2, "341s0851", "Egret 1.01 (341S0851)") - ROM_LOAD("341s0851.bin", 0x0000, 0x1100, CRC(ea9ea6e4) SHA1(8b0dae3ec66cdddbf71567365d2c462688aeb571)) + ROMX_LOAD("341s0851.bin", 0x0000, 0x1100, CRC(ea9ea6e4) SHA1(8b0dae3ec66cdddbf71567365d2c462688aeb571), ROM_BIOS(2)) ROM_END //------------------------------------------------- diff --git a/src/mame/apple/imacg3.cpp b/src/mame/apple/imacg3.cpp index 788a5e52779..a31f4192487 100644 --- a/src/mame/apple/imacg3.cpp +++ b/src/mame/apple/imacg3.cpp @@ -174,7 +174,8 @@ void imac_state::imac(machine_config &config) MACADB(config, m_macadb, 15.6672_MHz_XTAL); - CUDA_V240(config, m_cuda, XTAL(32'768)); + CUDA_V2XX(config, m_cuda, XTAL(32'768)); + m_cuda->set_default_bios_tag("341s0060"); m_cuda->reset_callback().set(FUNC(imac_state::cuda_reset_w)); m_cuda->linechange_callback().set(m_macadb, FUNC(macadb_device::adb_linechange_w)); m_cuda->via_clock_callback().set(paddington, FUNC(heathrow_device::cb1_w)); diff --git a/src/mame/apple/maclc.cpp b/src/mame/apple/maclc.cpp index 1c736b06898..c9954833135 100644 --- a/src/mame/apple/maclc.cpp +++ b/src/mame/apple/maclc.cpp @@ -417,7 +417,8 @@ void maclc_state::maccclas(machine_config &config) config.device_remove("egret"); config.device_remove("fdc"); - CUDA_V237(config, m_cuda, XTAL(32'768)); + CUDA_V2XX(config, m_cuda, XTAL(32'768)); + m_cuda->set_default_bios_tag("341s0788"); m_cuda->reset_callback().set(FUNC(maclc_state::egret_reset_w)); m_cuda->linechange_callback().set(m_macadb, FUNC(macadb_device::adb_linechange_w)); m_cuda->via_clock_callback().set(m_v8, FUNC(v8_device::cb1_w)); diff --git a/src/mame/apple/maclc3.cpp b/src/mame/apple/maclc3.cpp index 1579cd1f321..b4a8c4bddc4 100644 --- a/src/mame/apple/maclc3.cpp +++ b/src/mame/apple/maclc3.cpp @@ -324,7 +324,8 @@ void macvail_state::maclc520(machine_config &config) maclc3_base(config); m_maincpu->set_addrmap(AS_PROGRAM, &macvail_state::maclc520_map); - CUDA_V240(config, m_cuda, XTAL(32'768)); + CUDA_V2XX(config, m_cuda, XTAL(32'768)); + m_cuda->set_default_bios_tag("341s0060"); m_cuda->reset_callback().set(FUNC(macvail_state::cuda_reset_w)); m_cuda->linechange_callback().set(m_macadb, FUNC(macadb_device::adb_linechange_w)); m_cuda->via_clock_callback().set(m_sonora, FUNC(sonora_device::cb1_w)); diff --git a/src/mame/apple/macpdm.cpp b/src/mame/apple/macpdm.cpp index 2657704153a..e953966a64e 100644 --- a/src/mame/apple/macpdm.cpp +++ b/src/mame/apple/macpdm.cpp @@ -1168,7 +1168,8 @@ void macpdm_state::macpdm(machine_config &config) m_ram->set_extra_options("16M,32M,64M,128M"); MACADB(config, m_macadb, IO_CLOCK/2); - CUDA_V240(config, m_cuda, XTAL(32'768)); + CUDA_V2XX(config, m_cuda, XTAL(32'768)); + m_cuda->set_default_bios_tag("341s0060"); m_cuda->reset_callback().set(FUNC(macpdm_state::cuda_reset_w)); m_cuda->linechange_callback().set(m_macadb, FUNC(macadb_device::adb_linechange_w)); m_cuda->via_clock_callback().set(m_via1, FUNC(via6522_device::write_cb1)); diff --git a/src/mame/apple/macquadra605.cpp b/src/mame/apple/macquadra605.cpp index f753401e427..8530f661c67 100644 --- a/src/mame/apple/macquadra605.cpp +++ b/src/mame/apple/macquadra605.cpp @@ -205,7 +205,8 @@ void quadra605_state::macqd605(machine_config &config) MACADB(config, m_macadb, C15M); - CUDA_V237(config, m_cuda, XTAL(32'768)); + CUDA_V2XX(config, m_cuda, XTAL(32'768)); + m_cuda->set_default_bios_tag("341s0788"); m_cuda->reset_callback().set(FUNC(quadra605_state::cuda_reset_w)); m_cuda->linechange_callback().set(m_macadb, FUNC(macadb_device::adb_linechange_w)); m_cuda->via_clock_callback().set(m_primetime, FUNC(primetime_device::cb1_w)); diff --git a/src/mame/apple/macquadra630.cpp b/src/mame/apple/macquadra630.cpp index 3d78a106f58..180c2e20349 100755 --- a/src/mame/apple/macquadra630.cpp +++ b/src/mame/apple/macquadra630.cpp @@ -166,7 +166,8 @@ void quadra630_state::macqd630(machine_config &config) // TODO: recapamac.com.au's logic board photos show Cuda 2.40 for both Q630 and LC580, // but both ROM versions have issues syncing with 2.38 and 2.40 while 2.37 works. - CUDA_V237(config, m_cuda, XTAL(32'768)); + CUDA_V2XX(config, m_cuda, XTAL(32'768)); + m_cuda->set_default_bios_tag("341s0788"); m_cuda->reset_callback().set(FUNC(quadra630_state::cuda_reset_w)); m_cuda->linechange_callback().set(m_macadb, FUNC(macadb_device::adb_linechange_w)); m_cuda->via_clock_callback().set(m_primetimeii, FUNC(primetime_device::cb1_w)); diff --git a/src/mame/apple/pippin.cpp b/src/mame/apple/pippin.cpp index a1f0a027b71..c8784893409 100644 --- a/src/mame/apple/pippin.cpp +++ b/src/mame/apple/pippin.cpp @@ -197,7 +197,8 @@ void pippin_state::pippin(machine_config &config) MACADB(config, m_macadb, 15.6672_MHz_XTAL); - CUDA_V240(config, m_cuda, XTAL(32'768)); + CUDA_V2XX(config, m_cuda, XTAL(32'768)); + m_cuda->set_default_bios_tag("341s0060"); m_cuda->reset_callback().set(FUNC(pippin_state::cuda_reset_w)); m_cuda->linechange_callback().set(m_macadb, FUNC(macadb_device::adb_linechange_w)); m_cuda->via_clock_callback().set(grandcentral, FUNC(heathrow_device::cb1_w)); diff --git a/src/mame/apple/powermacg3.cpp b/src/mame/apple/powermacg3.cpp index fb7baa9ce8a..70e90e33085 100644 --- a/src/mame/apple/powermacg3.cpp +++ b/src/mame/apple/powermacg3.cpp @@ -159,7 +159,8 @@ void pwrmacg3_state::pwrmacg3(machine_config &config) MACADB(config, m_macadb, 15.6672_MHz_XTAL); - CUDA_V240(config, m_cuda, XTAL(32'768)); + CUDA_V2XX(config, m_cuda, XTAL(32'768)); + m_cuda->set_default_bios_tag("341s0060"); m_cuda->reset_callback().set(FUNC(pwrmacg3_state::cuda_reset_w)); m_cuda->linechange_callback().set(m_macadb, FUNC(macadb_device::adb_linechange_w)); m_cuda->via_clock_callback().set(heathrow, FUNC(heathrow_device::cb1_w)); -- cgit v1.2.3