diff options
author | 2020-10-20 21:33:02 +1100 | |
---|---|---|
committer | 2020-10-20 21:33:02 +1100 | |
commit | a1f255e40787ff5aff520e39610bd9a14e90fe0c (patch) | |
tree | e5d03dfda32f1bf75ec394619a15f30563819f88 | |
parent | e8ea164a8b5bf170d04e693eabc2ceca2523ddd5 (diff) | |
parent | abb640434b5f4ae0c2e0c879dded74b348e19da9 (diff) |
Merge remote-tracking branch 'upstream/master'
106 files changed, 3649 insertions, 1420 deletions
diff --git a/docs/source/techspecs/layout_files.rst b/docs/source/techspecs/layout_files.rst index 9ebb5863de5..7bb69678d8c 100644 --- a/docs/source/techspecs/layout_files.rst +++ b/docs/source/techspecs/layout_files.rst @@ -699,8 +699,8 @@ element Adds an element to the view (see :ref:`layout-parts-elements`). The name of the element to add is specified using the required ``ref`` attribute. It is an error if no element with this name is defined in the layout file. Within - a layer, elements are drawn in the order they appear in the layout file, - from front to back. See below for more details. + a view, elements are drawn in the order they appear in the layout file, from + front to back. See below for more details. May optionally be connected to an emulated I/O port using ``inputtag`` and ``inputmask`` attributes, and/or an emulated output using a ``name`` diff --git a/hash/bbc_rom.xml b/hash/bbc_rom.xml index fc12051e964..7ea963da603 100644 --- a/hash/bbc_rom.xml +++ b/hash/bbc_rom.xml @@ -2660,13 +2660,26 @@ license:CC0 </part> </software> - <software name="datagem"> + <software name="datagem102f" cloneof="datagem"> <description>DataGem 1.02F</description> - <year>1985</year> - <publisher>Merlin Computer Products</publisher> + <year>1984</year> + <publisher>Gemini</publisher> <part name="rom1" interface="bbc_rom"> <dataarea name="rom" size="16384"> - <rom name="DataGem-1.02F.rom" size="16384" crc="bfb21e7e" sha1="043f372195f25acb3e55b042a8d8e9f3f4e3806f"/> + <rom name="DataGem-1.02F.rom" size="16384" crc="bfb21e7e" sha1="043f372195f25acb3e55b042a8d8e9f3f4e3806f" offset="0x0000" status="baddump"/> + </dataarea> + </part> + </software> + + <software name="datagem"> + <description>DataGem 2.039</description> + <year>1984</year> + <publisher>Gemini</publisher> + <part name="rom1" interface="bbc_rom"> + <feature name="slot" value="datagem" /> + <dataarea name="rom" size="24576"> + <rom name="DataGem_A-2.039.rom" size="16384" crc="99db6f25" sha1="89980609542ee392ba650ed781cd1d43fdefe55c" offset="0x0000"/> + <rom name="DataGem_B-2.039.rom" size="8192" crc="cda9aaf9" sha1="70d28e0771efc45036ea104e64f86aa2dd06492f" offset="0x4000"/> </dataarea> </part> </software> @@ -3733,13 +3746,48 @@ license:CC0 </part> </software> + <software name="epromer23" cloneof="epromer2" supported="no"> + <description>Epromer II 2.3</description> + <year>1985</year> + <publisher>Technomatic</publisher> + <part name="rom1" interface="bbc_rom"> + <dataarea name="rom" size="16384"> + <rom name="Epromer-2.3.rom" size="16384" crc="8a3369a8" sha1="6229c77b756a70b8cb70d050dddc1bd445e3026c"/> + </dataarea> + </part> + </software> + <software name="epromer2" supported="no"> - <description>Epromer II</description> + <description>Epromer II 2.5</description> <year>1985</year> <publisher>Technomatic</publisher> <part name="rom1" interface="bbc_rom"> <dataarea name="rom" size="16384"> - <rom name="EpromerII-2.3.rom" size="16384" crc="8a3369a8" sha1="6229c77b756a70b8cb70d050dddc1bd445e3026c"/> + <rom name="Epromer-2.5.rom" size="16384" crc="3e0cc2bb" sha1="bbd419500ce7000fffa1cc7e40ebb3de71c0a298"/> + </dataarea> + </part> + </software> + + <software name="epromer31" cloneof="epromer3" supported="no"> + <description>Epromer III 3.1</description> + <year>1987</year> + <publisher>Technomatic</publisher> + <sharedfeat name="compatibility" value="M"/> + <part name="rom1" interface="bbc_rom"> + <dataarea name="rom" size="16384"> + <rom name="Epromer-3.1.rom" size="16384" crc="e7708fb8" sha1="7a5ae8778af9df3b3f8492e4b9cac2a9380a0dc7"/> + </dataarea> + </part> + </software> + + <software name="epromer3" supported="no"> + <description>Epromer III 3.3</description> + <year>1987</year> + <publisher>Technomatic</publisher> + <sharedfeat name="compatibility" value="M"/> + <part name="rom1" interface="bbc_rom"> + <dataarea name="rom" size="16384"> + <rom name="Epromer-3.3.rom" size="16384" crc="d4f73f96" sha1="1798db3fe9478a2ebadd39015830ca001fbac730"/> </dataarea> </part> </software> diff --git a/hash/ibm5170.xml b/hash/ibm5170.xml index eb0104c8120..63352eceaa4 100644 --- a/hash/ibm5170.xml +++ b/hash/ibm5170.xml @@ -12853,6 +12853,92 @@ license:CC0 </part> </software> + <software name="mmagic"> + <description>Master of Magic (v1.1)</description> + <year>1994</year> + <publisher>MicroProse</publisher> + <info name="developer" value="SimTex" /> + <info name="version" value="v1.1" /> + <part name="flop1" interface="floppy_3_5"> + <dataarea name="flop" size = "1474560"> + <rom name="Master of Magic (v1.1) [MicroProse] [1994] [3.5HD] [Disk 1 of 7].img" size="1474560" crc="5a5f656d" sha1="0244a0ee5e3695aa0a4acff771939928d4cc1169" /> + </dataarea> + </part> + <part name="flop2" interface="floppy_3_5"> + <dataarea name="flop" size = "1474560"> + <rom name="Master of Magic (v1.1) [MicroProse] [1994] [3.5HD] [Disk 2 of 7].img" size="1474560" crc="ec6b43bd" sha1="0ca1e773de672d619af3dd592935c713f373fe67" /> + </dataarea> + </part> + <part name="flop3" interface="floppy_3_5"> + <dataarea name="flop" size = "1474560"> + <rom name="Master of Magic (v1.1) [MicroProse] [1994] [3.5HD] [Disk 3 of 7].img" size="1474560" crc="aec3a1a7" sha1="75cf93521d9a2a6b349e2ca4ce1894acb923a6d3" /> + </dataarea> + </part> + <part name="flop4" interface="floppy_3_5"> + <dataarea name="flop" size = "1474560"> + <rom name="Master of Magic (v1.1) [MicroProse] [1994] [3.5HD] [Disk 4 of 7].img" size="1474560" crc="042ea60d" sha1="8d64348242da472b07ea8ffb555c491586be32ad" /> + </dataarea> + </part> + <part name="flop5" interface="floppy_3_5"> + <dataarea name="flop" size = "1474560"> + <rom name="Master of Magic (v1.1) [MicroProse] [1994] [3.5HD] [Disk 5 of 7].img" size="1474560" crc="2a0215d6" sha1="b8c3eca13679a081ac507e835e65ec01ce9e1db4" /> + </dataarea> + </part> + <part name="flop6" interface="floppy_3_5"> + <dataarea name="flop" size = "1474560"> + <rom name="Master of Magic (v1.1) [MicroProse] [1994] [3.5HD] [Disk 6 of 7].img" size="1474560" crc="dc9888fe" sha1="3ea5a5febea4356d393dabe4b21c776fddfba167" /> + </dataarea> + </part> + <part name="flop7" interface="floppy_3_5"> + <dataarea name="flop" size = "1474560"> + <rom name="Master of Magic (v1.1) [MicroProse] [1994] [3.5HD] [Disk 7 of 7].img" size="1474560" crc="83a626b5" sha1="62c1d7717be4f5ac536fb9c8586283e92f7ea81b" /> + </dataarea> + </part> + </software> + + <software name="mmagica" cloneof="mmagic"> + <description>Master of Magic (v1.0)</description> + <year>1994</year> + <publisher>MicroProse</publisher> + <info name="developer" value="SimTex" /> + <info name="version" value="v1.0" /> + <part name="flop1" interface="floppy_3_5"> + <dataarea name="flop" size = "1474560"> + <rom name="Master of Magic [MicroProse] [1994] [3.5HD] [Disk 1 of 7].img" size="1474560" crc="183161bf" sha1="7c8ff4474a0f4714a2b597b61ab11238d6e19526" /> + </dataarea> + </part> + <part name="flop2" interface="floppy_3_5"> + <dataarea name="flop" size = "1474560"> + <rom name="Master of Magic [MicroProse] [1994] [3.5HD] [Disk 2 of 7].img" size="1474560" crc="a0295102" sha1="fe3a01c31065b31d5ed21706431979354934378b" /> + </dataarea> + </part> + <part name="flop3" interface="floppy_3_5"> + <dataarea name="flop" size = "1474560"> + <rom name="Master of Magic [MicroProse] [1994] [3.5HD] [Disk 3 of 7].img" size="1474560" crc="4c44bd1f" sha1="e3c00c246cb9377c6237bdebc86a638bfe9dd35b" /> + </dataarea> + </part> + <part name="flop4" interface="floppy_3_5"> + <dataarea name="flop" size = "1474560"> + <rom name="Master of Magic [MicroProse] [1994] [3.5HD] [Disk 4 of 7].img" size="1474560" crc="4b9be538" sha1="5b6dd84e9b22aebec0cadd23d7f67d27621b6096" /> + </dataarea> + </part> + <part name="flop5" interface="floppy_3_5"> + <dataarea name="flop" size = "1474560"> + <rom name="Master of Magic [MicroProse] [1994] [3.5HD] [Disk 5 of 7].img" size="1474560" crc="9736e01c" sha1="2c68324ee278026f5103f98ebb82ab7ba186bd29" /> + </dataarea> + </part> + <part name="flop6" interface="floppy_3_5"> + <dataarea name="flop" size = "1474560"> + <rom name="Master of Magic [MicroProse] [1994] [3.5HD] [Disk 6 of 7].img" size="1474560" crc="00e54856" sha1="cd384739f59ae99aa859c00d64d6470596e80988" /> + </dataarea> + </part> + <part name="flop7" interface="floppy_3_5"> + <dataarea name="flop" size = "1474560"> + <rom name="Master of Magic [MicroProse] [1994] [3.5HD] [Disk 7 of 7].img" size="1474560" crc="783b8434" sha1="a5722583bb690dd23983886b594ee63abf1a75e3" /> + </dataarea> + </part> + </software> + <software name="moo"> <description>Master of Orion</description> <year>1993</year> @@ -14764,6 +14850,7 @@ license:CC0 <description>UFO - Enemy Unknown (Euro)</description> <year>1994</year> <publisher>MicroProse</publisher> + <info name="version" value="v1" /> <part name="flop1" interface="floppy_3_5"> <!-- mpscopy.exe file version: MicroProse Software Unpacker - by Brian Reynolds - Version 1.07 - Lib 4.02 --> <dataarea name="flop" size = "1474560"> @@ -14786,6 +14873,7 @@ license:CC0 <description>UFO - Enemy Unknown (Euro) (alt)</description> <year>1994</year> <publisher>MicroProse</publisher> + <info name="version" value="v1" /> <part name="flop1" interface="floppy_3_5"> <!-- mpscopy.exe file version: MicroProse Software Unpacker - F-15 Strike Eagle 3 - Version 1.08 - Lib 4.02 --> <dataarea name="flop" size = "1474560"> @@ -14808,6 +14896,7 @@ license:CC0 <description>UFO - Enemy Unknown (Italy)</description> <year>1994</year> <publisher>MicroProse</publisher> + <info name="version" value="v1.2" /> <part name="flop1" interface="floppy_3_5"> <dataarea name="flop" size = "1474560"> <rom name="Ufo Enemy Unknown (Italy) [Microprose] [1994] [3.5HD] [Disk 1 of 3].img" size="1474560" crc="e6cac594" sha1="ff9e23147c99fa8bf101c556a6727a6261542893"/> @@ -14829,6 +14918,7 @@ license:CC0 <description>X-COM - UFO Defense (USA)</description> <year>1994</year> <publisher>MicroProse</publisher> + <info name="version" value="v1.2" /> <part name="flop1" interface="floppy_3_5"> <dataarea name="flop" size = "1474560"> <rom name="Xcom Ufo Defense (USA) [Microprose] [1994] [3.5HD] [Disk 1 of 3].img" size="1474560" crc="286b3afa" sha1="937264378c4766dcb8c6fc0ccbc607a8fe334f39"/> diff --git a/scripts/genie.lua b/scripts/genie.lua index 5310e003ed8..4665349c98f 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -1177,6 +1177,7 @@ configuration { "asmjs" } } linkoptions { "-Wl,--start-group", + "-r", } archivesplit_size "20" diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua index eb1784a9c67..00b37942b3d 100644 --- a/scripts/src/bus.lua +++ b/scripts/src/bus.lua @@ -543,6 +543,8 @@ if (BUSES["BBC_ROM"]~=null) then MAME_DIR .. "src/devices/bus/bbc/rom/ram.h", MAME_DIR .. "src/devices/bus/bbc/rom/nvram.cpp", MAME_DIR .. "src/devices/bus/bbc/rom/nvram.h", + MAME_DIR .. "src/devices/bus/bbc/rom/datagem.cpp", + MAME_DIR .. "src/devices/bus/bbc/rom/datagem.h", MAME_DIR .. "src/devices/bus/bbc/rom/dfs.cpp", MAME_DIR .. "src/devices/bus/bbc/rom/dfs.h", MAME_DIR .. "src/devices/bus/bbc/rom/genie.cpp", diff --git a/scripts/src/formats.lua b/scripts/src/formats.lua index 815ecabe73d..a3decee1833 100644 --- a/scripts/src/formats.lua +++ b/scripts/src/formats.lua @@ -307,6 +307,18 @@ end -------------------------------------------------- -- +--@src/lib/formats/aquarius_caq.h,FORMATS["AQUARIUS_CAQ"] = true +-------------------------------------------------- + +if (FORMATS["AQUARIUS_CAQ"]~=null or _OPTIONS["with-tools"]) then + files { + MAME_DIR.. "src/lib/formats/aquarius_caq.cpp", + MAME_DIR.. "src/lib/formats/aquarius_caq.h", + } +end + +-------------------------------------------------- +-- --@src/lib/formats/asst128_dsk.h,FORMATS["ASST128_DSK"] = true -------------------------------------------------- diff --git a/scripts/target/mame/arcade.lua b/scripts/target/mame/arcade.lua index fb07463d7ee..91f71a55c1c 100644 --- a/scripts/target/mame/arcade.lua +++ b/scripts/target/mame/arcade.lua @@ -5036,6 +5036,7 @@ files { MAME_DIR .. "src/mame/drivers/rcorsair.cpp", MAME_DIR .. "src/mame/drivers/re900.cpp", MAME_DIR .. "src/mame/drivers/rfslots8085.cpp", + MAME_DIR .. "src/mame/drivers/rfslotspcpent.cpp", MAME_DIR .. "src/mame/drivers/rgum.cpp", MAME_DIR .. "src/mame/drivers/roul.cpp", MAME_DIR .. "src/mame/drivers/rulechan.cpp", diff --git a/scripts/target/mame/mess.lua b/scripts/target/mame/mess.lua index 42b0c54b16b..a9d9c2ffa74 100644 --- a/scripts/target/mame/mess.lua +++ b/scripts/target/mame/mess.lua @@ -980,6 +980,7 @@ FORMATS["APOLLO_DSK"] = true FORMATS["APPLIX_DSK"] = true FORMATS["APRIDISK"] = true FORMATS["AP_DSK35"] = true +FORMATS["AQUARIUS_CAQ"] = true FORMATS["ASST128_DSK"] = true FORMATS["ASTROCADE_WAV"] = true FORMATS["ATARI_DSK"] = true @@ -1754,6 +1755,8 @@ files { MAME_DIR .. "src/mame/drivers/lwriter.cpp", MAME_DIR .. "src/mame/drivers/mac128.cpp", MAME_DIR .. "src/mame/drivers/macquadra700.cpp", + MAME_DIR .. "src/mame/drivers/macprtb.cpp", + MAME_DIR .. "src/mame/drivers/macpwrbk030.cpp", MAME_DIR .. "src/mame/drivers/mac.cpp", MAME_DIR .. "src/mame/includes/mac.h", MAME_DIR .. "src/mame/machine/egret.cpp", diff --git a/src/devices/bus/bbc/rom/datagem.cpp b/src/devices/bus/bbc/rom/datagem.cpp new file mode 100644 index 00000000000..11f2cfdb631 --- /dev/null +++ b/src/devices/bus/bbc/rom/datagem.cpp @@ -0,0 +1,96 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/*************************************************************************** + + Gemini DataGem ROM Carrier + +***************************************************************************/ + +#include "emu.h" +#include "datagem.h" + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +DEFINE_DEVICE_TYPE(BBC_DATAGEM, bbc_datagem_device, "bbc_datagem", "Gemini DataGem ROM Carrier") + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// bbc_datagem_device - constructor +//------------------------------------------------- + +bbc_datagem_device::bbc_datagem_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : device_t(mconfig, BBC_DATAGEM, tag, owner, clock) + , device_bbc_rom_interface(mconfig, *this) + , m_bank(0) +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void bbc_datagem_device::device_start() +{ + /* register for save states */ + save_item(NAME(m_bank)); +} + +//------------------------------------------------- +// decrypt_rom +//------------------------------------------------- + +void bbc_datagem_device::decrypt_rom() +{ + uint8_t *rom = get_rom_base(); + + for (int i = 0x0000; i < 0x6000; i++) + { + /* decrypt 16K and 8K ROM data lines */ + switch (rom[i] & 0x07) + { + case 0x01: case 0x06: rom[i] = bitswap<8>(rom[i], 7, 6, 5, 4, 3, 0, 1, 2); break; + case 0x02: case 0x05: rom[i] = bitswap<8>(rom[i], 7, 6, 5, 4, 3, 2, 0, 1); break; + case 0x03: case 0x04: rom[i] = bitswap<8>(rom[i], 7, 6, 5, 4, 3, 1, 2, 0); break; + } + + /* decrypt additional 8K ROM data lines */ + if (i & 0x4000) + { + rom[i] = bitswap<8>(rom[i], 3, 6, 5, 4, 7, 2, 1, 0); + } + } +} + +//------------------------------------------------- +// read +//------------------------------------------------- + +uint8_t bbc_datagem_device::read(offs_t offset) +{ + if (!machine().side_effects_disabled()) + { + /* switching zones for DataGem */ + switch (offset & 0x3fff) + { + case 0x1ffe: m_bank = 1; break; + case 0x1fff: m_bank = 0; break; + } + } + + if (offset & 0x2000) + { + return get_rom_base()[(offset & 0x3fff) + (m_bank << 13)]; + } + else + { + return get_rom_base()[offset & 0x3fff]; + } +} diff --git a/src/devices/bus/bbc/rom/datagem.h b/src/devices/bus/bbc/rom/datagem.h new file mode 100644 index 00000000000..0d78f754e44 --- /dev/null +++ b/src/devices/bus/bbc/rom/datagem.h @@ -0,0 +1,48 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/*************************************************************************** + + Gemini DataGem ROM Carrier + +***************************************************************************/ + +#ifndef MAME_BUS_BBC_ROM_DATAGEM_H +#define MAME_BUS_BBC_ROM_DATAGEM_H + +#pragma once + +#include "slot.h" + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> bbc_datagem_device + +class bbc_datagem_device : public device_t, + public device_bbc_rom_interface +{ +public: + // construction/destruction + bbc_datagem_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + +protected: + // device-level overrides + virtual void device_start() override; + + // device_bbc_rom_interface overrides + virtual uint32_t get_rom_size() override { return 0x4000; } + virtual uint8_t read(offs_t offset) override; + virtual void decrypt_rom() override; + +private: + uint8_t m_bank; +}; + + +// device type definition +DECLARE_DEVICE_TYPE(BBC_DATAGEM, bbc_datagem_device) + + +#endif // MAME_BUS_BBC_ROM_DATAGEM_H diff --git a/src/devices/bus/bbc/rom/slot.cpp b/src/devices/bus/bbc/rom/slot.cpp index 9434a186e81..8a315e12234 100644 --- a/src/devices/bus/bbc/rom/slot.cpp +++ b/src/devices/bus/bbc/rom/slot.cpp @@ -133,6 +133,8 @@ image_init_result bbc_romslot_device::call_load() else memcpy(m_cart->get_rom_base(), get_software_region("rom"), size); + m_cart->decrypt_rom(); + if (get_software_region("ram")) m_cart->ram_alloc(get_software_region_length("ram")); @@ -208,6 +210,7 @@ void bbc_romslot_device::write(offs_t offset, uint8_t data) #include "rom.h" #include "ram.h" #include "nvram.h" +#include "datagem.h" #include "dfs.h" #include "genie.h" #include "pal.h" @@ -229,6 +232,7 @@ void bbc_rom_devices(device_slot_interface &device) device.option_add_internal("palabep", BBC_PALABEP); device.option_add_internal("palabe", BBC_PALABE); device.option_add_internal("palmo2", BBC_PALMO2); + device.option_add_internal("datagem", BBC_DATAGEM); device.option_add_internal("genie", BBC_PMSGENIE); device.option_add_internal("dfse00", BBC_DFSE00); //device.option_add_internal("ramagic", BBC_RAMAGIC); diff --git a/src/devices/bus/bbc/rom/slot.h b/src/devices/bus/bbc/rom/slot.h index 8d92dbf3950..4b43024d555 100644 --- a/src/devices/bus/bbc/rom/slot.h +++ b/src/devices/bus/bbc/rom/slot.h @@ -138,6 +138,9 @@ public: uint8_t* get_nvram_base() { return &m_nvram[0]; } uint32_t get_nvram_size() { return m_nvram.size(); } + // decrypt data lines + virtual void decrypt_rom() { }; + protected: device_bbc_rom_interface(const machine_config &mconfig, device_t &device); diff --git a/src/devices/cpu/m6502/dm740.lst b/src/devices/cpu/m6502/dm740.lst index 04f67738dc9..b288e084154 100644 --- a/src/devices/cpu/m6502/dm740.lst +++ b/src/devices/cpu/m6502/dm740.lst @@ -1,13 +1,13 @@ # license:BSD-3-Clause # copyright-holders:Olivier Galibert # m740 device -brk740_imp ora_idx kil_non bbs_bar nop_zpg ora_zpg asl_zpg bbs_bzr php_imp ora_imm asl_acc seb_bac nop_aba ora_aba asl_aba seb_biz +brk740_imp ora_idx jsr_zpi bbs_bar nop_zpg ora_zpg asl_zpg bbs_bzr php_imp ora_imm asl_acc seb_bac nop_aba ora_aba asl_aba seb_biz bpl_rel ora_idy clt_imp bbc_bar nop_zpx ora_zpx asl_zpx bbc_bzr clc_imp ora_aby dec_acc clb_bac nop_abx ora_abx asl_abx clb_biz jsr_adr and_idx jsr_spg bbs_bar bit_zpg and_zpg rol_zpg bbs_bzr plp_imp and_imm rol_acc seb_bac bit_aba and_aba rol_aba seb_biz bmi_rel and_idy set_imp bbc_bar nop_zpx and_zpx rol_zpx bbc_bzr sec_imp and_aby inc_acc clb_bac ldm_imz and_abx rol_abx clb_biz rti_imp eor_idx kil_non bbs_bar com_zpg eor_zpg lsr_zpg bbs_bzr pha_imp eor_imm lsr_acc seb_bac jmp_adr eor_aba lsr_aba seb_biz bvc_rel eor_idy kil_non bbc_bar nop_zpx eor_zpx lsr_zpx bbc_bzr cli_imp eor_aby nop_imp clb_bac nop_abx eor_abx lsr_abx clb_biz -rts_imp adc_idx kil_non bbs_bar nop_zpg adc_zpg ror_zpg bbs_bzr pla_imp adc_imm ror_acc seb_bac jmp_ind adc_aba ror_aba seb_biz +rts_imp adc_idx kil_non bbs_bar tst_zpg adc_zpg ror_zpg bbs_bzr pla_imp adc_imm ror_acc seb_bac jmp_ind adc_aba ror_aba seb_biz bvs_rel adc_idy kil_non bbc_bar nop_zpx adc_zpx ror_zpx bbc_bzr sei_imp adc_aby nop_imp clb_bac nop_abx adc_abx ror_abx clb_biz bra_rel sta_idx rrf_zpg bbs_bar sty_zpg sta_zpg stx_zpg bbs_bzr dey_imp nop_imm txa_imp seb_bac sty_aba sta_aba stx_aba seb_biz bcc_rel sta_idy kil_non bbc_bar sty_zpx sta_zpx stx_zpy bbc_bzr tya_imp sta_aby txs_imp clb_bac shy_abx sta_abx shx_aby clb_biz @@ -17,13 +17,13 @@ cpy_imm cmp_idx nop_imm bbs_bar cpy_zpg cmp_zpg dec_zpg bne_rel cmp_idy kil_non bbc_bar nop_zpx cmp_zpx dec_zpx bbc_bzr cld_imp cmp_aby nop_imp clb_bac nop_abx cmp_abx dec_abx clb_biz cpx_imm sbc_idx nop_imm bbs_bar cpx_zpg sbc_zpg inc_zpg bbs_bzr inx_imp sbc_imm nop_imp seb_bac cpx_aba sbc_aba inc_aba seb_biz beq_rel sbc_idy kil_non bbc_bar nop_zpx sbc_zpx inc_zpx bbc_bzr sed_imp sbc_aby nop_imp clb_bac nop_abx sbc_abx inc_abx clb_biz -brk740_imp ort_idx kil_non bbs_bar nop_zpg ort_zpg asl_zpg bbs_bzr php_imp ort_imm asl_acc seb_bac nop_aba ort_aba asl_aba seb_biz +brk740_imp ort_idx jsr_zpi bbs_bar nop_zpg ort_zpg asl_zpg bbs_bzr php_imp ort_imm asl_acc seb_bac nop_aba ort_aba asl_aba seb_biz bpl_rel ort_idy clt_imp bbc_bar nop_zpx ort_zpx asl_zpx bbc_bzr clc_imp ort_aby dect_acc clb_bac nop_abx ort_abx asl_abx clb_biz jsr_adr andt_idx jsr_spg bbs_bar bit_zpg andt_zpg rol_zpg bbs_bzr plp_imp andt_imm rol_acc seb_bac bit_aba andt_aba rol_aba seb_biz bmi_rel andt_idy set_imp bbc_bar nop_zpx andt_zpx rol_zpx bbc_bzr sec_imp andt_aby inct_acc clb_bac ldm_imz andt_abx rol_abx clb_biz rti_imp eort_idx kil_non bbs_bar com_zpg eort_zpg lsr_zpg bbs_bzr pha_imp eort_imm lsr_acc seb_bac jmp_adr eort_aba lsr_aba seb_biz bvc_rel eort_idy kil_non bbc_bar nop_zpx eort_zpx lsr_zpx bbc_bzr cli_imp eort_aby nop_imp clb_bac nop_abx eort_abx lsr_abx clb_biz -rts_imp adct_idx kil_non bbs_bar nop_zpg adct_zpg ror_zpg bbs_bzr pla_imp adct_imm ror_acc seb_bac jmp_ind adct_aba ror_aba seb_biz +rts_imp adct_idx kil_non bbs_bar tst_zpg adct_zpg ror_zpg bbs_bzr pla_imp adct_imm ror_acc seb_bac jmp_ind adct_aba ror_aba seb_biz bvs_rel adct_idy kil_non bbc_bar nop_zpx adct_zpx ror_zpx bbc_bzr sei_imp adct_aby nop_imp clb_bac nop_abx adct_abx ror_abx clb_biz bra_rel sta_idx rrf_zpg bbs_bar sty_zpg sta_zpg stx_zpg bbs_bzr dey_imp nop_imm txa_imp seb_bac sty_aba sta_aba stx_aba seb_biz bcc_rel sta_idy kil_non bbc_bar sty_zpx sta_zpx stx_zpy bbc_bzr tya_imp sta_aby txs_imp clb_bac shy_abx sta_abx shx_aby clb_biz diff --git a/src/devices/cpu/m6502/m5074x.cpp b/src/devices/cpu/m6502/m5074x.cpp index 794ef338e31..c36399bf745 100644 --- a/src/devices/cpu/m6502/m5074x.cpp +++ b/src/devices/cpu/m6502/m5074x.cpp @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:R. Belmont, Olivier Galibert /* - Mitsubishi M5074x 8-bit microcontroller family + Mitsubishi M5074x/5075x 8-bit microcontroller family */ #include "emu.h" @@ -11,19 +11,19 @@ // MACROS / CONSTANTS //************************************************************************** -#define IRQ_CNTRREQ (0x80) -#define IRQ_CNTRENA (0x40) -#define IRQ_TMR1REQ (0x20) -#define IRQ_TMR1ENA (0x10) -#define IRQ_TMR2REQ (0x08) -#define IRQ_TMR2ENA (0x04) -#define IRQ_INTREQ (0x02) -#define IRQ_INTENA (0x01) +static constexpr u8 IRQ_CNTRREQ = 0x80; +static constexpr u8 IRQ_CNTRENA = 0x40; +static constexpr u8 IRQ_TMR1REQ = 0x20; +static constexpr u8 IRQ_TMR1ENA = 0x10; +static constexpr u8 IRQ_TMR2REQ = 0x08; +static constexpr u8 IRQ_TMR2ENA = 0x04; +static constexpr u8 IRQ_INTREQ = 0x02; +static constexpr u8 IRQ_INTENA = 0x01; -#define TMRC_TMRXREQ (0x80) -#define TMRC_TMRXENA (0x40) -#define TMRC_TMRXHLT (0x20) -#define TMRC_TMRXMDE (0x0c) +static constexpr u8 TMRC_TMRXREQ = 0x80; +static constexpr u8 TMRC_TMRXENA = 0x40; +static constexpr u8 TMRC_TMRXHLT = 0x20; +static constexpr u8 TMRC_TMRXMDE = 0x0c; //************************************************************************** // DEVICE DEFINITIONS @@ -31,6 +31,7 @@ DEFINE_DEVICE_TYPE(M50740, m50740_device, "m50740", "Mitsubishi M50740") DEFINE_DEVICE_TYPE(M50741, m50741_device, "m50741", "Mitsubishi M50741") +DEFINE_DEVICE_TYPE(M50753, m50753_device, "m50753", "Mitsubishi M50753") //************************************************************************** // LIVE DEVICE @@ -39,9 +40,9 @@ DEFINE_DEVICE_TYPE(M50741, m50741_device, "m50741", "Mitsubishi M50741") //------------------------------------------------- // m5074x_device - constructor //------------------------------------------------- -m5074x_device::m5074x_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, address_map_constructor internal_map) : +m5074x_device::m5074x_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, int addrbits, address_map_constructor internal_map) : m740_device(mconfig, type, tag, owner, clock), - m_program_config("program", ENDIANNESS_LITTLE, 8, 13, 0, internal_map), + m_program_config("program", ENDIANNESS_LITTLE, 8, addrbits, 0, internal_map), m_read_p(*this), m_write_p(*this), m_intctrl(0), @@ -319,6 +320,12 @@ uint8_t m5074x_device::ports_r(offs_t offset) case 9: return m_ddrs[3]; + + case 0xa: + return read_port(4); + + case 0xb: + return m_ddrs[4]; } return 0xff; @@ -367,6 +374,16 @@ void m5074x_device::ports_w(offs_t offset, uint8_t data) send_port(3, m_ports[3] & data); m_ddrs[3] = data; break; + + case 0xa: // p4 + send_port(4, data & m_ddrs[4]); + m_ports[4] = data; + break; + + case 0xb: // p4 ddr + send_port(4, m_ports[4] & data); + m_ddrs[4] = data; + break; } } @@ -440,13 +457,13 @@ void m5074x_device::tmrirq_w(offs_t offset, uint8_t data) } } -/* M50740 - baseline for this familiy */ +// M50740 - baseline for this family void m50740_device::m50740_map(address_map &map) { map(0x0000, 0x005f).ram(); map(0x00e0, 0x00e9).rw(FUNC(m50740_device::ports_r), FUNC(m50740_device::ports_w)); map(0x00f9, 0x00ff).rw(FUNC(m50740_device::tmrirq_r), FUNC(m50740_device::tmrirq_w)); - map(0x1400, 0x1fff).rom().region(M5074X_INTERNAL_ROM_REGION, 0); + map(0x1400, 0x1fff).rom().region(DEVICE_SELF, 0); } m50740_device::m50740_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : @@ -455,17 +472,17 @@ m50740_device::m50740_device(const machine_config &mconfig, const char *tag, dev } m50740_device::m50740_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : - m5074x_device(mconfig, type, tag, owner, clock, address_map_constructor(FUNC(m50740_device::m50740_map), this)) + m5074x_device(mconfig, type, tag, owner, clock, 13, address_map_constructor(FUNC(m50740_device::m50740_map), this)) { } -/* M50741 - 50740 with a larger internal ROM */ +// M50741 - 50740 with a larger internal ROM void m50741_device::m50741_map(address_map &map) { map(0x0000, 0x005f).ram(); map(0x00e0, 0x00e9).rw(FUNC(m50741_device::ports_r), FUNC(m50741_device::ports_w)); map(0x00f9, 0x00ff).rw(FUNC(m50741_device::tmrirq_r), FUNC(m50741_device::tmrirq_w)); - map(0x1000, 0x1fff).rom().region("internal", 0); + map(0x1000, 0x1fff).rom().region(DEVICE_SELF, 0); } m50741_device::m50741_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : @@ -474,6 +491,118 @@ m50741_device::m50741_device(const machine_config &mconfig, const char *tag, dev } m50741_device::m50741_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : - m5074x_device(mconfig, type, tag, owner, clock, address_map_constructor(FUNC(m50741_device::m50741_map), this)) + m5074x_device(mconfig, type, tag, owner, clock, 13, address_map_constructor(FUNC(m50741_device::m50741_map), this)) +{ +} + +// M50753 - M5074X with more pins, more RAM, more ROM, A-D, PWM, serial I/O (TODO) +void m50753_device::m50753_map(address_map &map) +{ + map(0x0000, 0x00bf).ram(); + map(0x00e0, 0x00eb).rw(FUNC(m50753_device::ports_r), FUNC(m50753_device::ports_w)); + map(0x00ef, 0x00ef).r(FUNC(m50753_device::ad_r)); + map(0x00f2, 0x00f2).w(FUNC(m50753_device::ad_control_w)); + map(0x00f3, 0x00f3).rw(FUNC(m50753_device::ad_control_r), FUNC(m50753_device::ad_control_w)); + map(0x00f5, 0x00f5).rw(FUNC(m50753_device::pwm_control_r), FUNC(m50753_device::pwm_control_w)); + map(0x00f9, 0x00ff).rw(FUNC(m50753_device::tmrirq_r), FUNC(m50753_device::tmrirq_w)); + map(0xe800, 0xffff).rom().region(DEVICE_SELF, 0); +} + +m50753_device::m50753_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + m50753_device(mconfig, M50753, tag, owner, clock) { } + +m50753_device::m50753_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : + m5074x_device(mconfig, type, tag, owner, clock, 16, address_map_constructor(FUNC(m50753_device::m50753_map), this)), + m_ad_in(*this), + m_ad_control(0), + m_pwm_enabled(false) +{ +} + +void m50753_device::device_start() +{ + m5074x_device::device_start(); + + m_ad_in.resolve_all_safe(0); + + save_item(NAME(m_ad_control)); + save_item(NAME(m_pwm_enabled)); +} + +void m50753_device::device_reset() +{ + m5074x_device::device_reset(); + + m_ad_control = 0; + m_pwm_enabled = false; +} + +uint8_t m50753_device::ad_r() +{ + return m_ad_in[m_ad_control & 0x07](); +} + +void m50753_device::ad_start_w(uint8_t data) +{ + logerror("%s: A-D start (IN%d)\n", machine().describe_context(), m_ad_control & 0x07); +} + +uint8_t m50753_device::ad_control_r() +{ + return m_ad_control; +} + +void m50753_device::ad_control_w(uint8_t data) +{ + m_ad_control = data & 0x0f; +} + +uint8_t m50753_device::pwm_control_r() +{ + return m_pwm_enabled ? 0x01 : 0x00; +} + +void m50753_device::pwm_control_w(uint8_t data) +{ + m_pwm_enabled = BIT(data, 0); +} + +// interrupt bits on 50753 are slightly different from the 740/741. +static constexpr u8 IRQ_50753_INT1REQ = 0x80; +static constexpr u8 IRQ_50753_INT2REQ = 0x02; + +void m50753_device::execute_set_input(int inputnum, int state) +{ + switch (inputnum) + { + case M50753_INT1_LINE: + if (state == ASSERT_LINE) + { + m_intctrl |= IRQ_50753_INT1REQ; + } + else + { + m_intctrl &= ~IRQ_50753_INT1REQ; + } + break; + + case M50753_INT2_LINE: + if (state == ASSERT_LINE) + { + m_intctrl |= IRQ_50753_INT2REQ; + } + else + { + m_intctrl &= ~IRQ_50753_INT2REQ; + } + break; + + case M5074X_SET_OVERFLOW: // the base 740 class can handle this + m740_device::execute_set_input(M740_SET_OVERFLOW, state); + break; + } + + recalc_irqs(); +} diff --git a/src/devices/cpu/m6502/m5074x.h b/src/devices/cpu/m6502/m5074x.h index 165a7cc7599..6af2156622c 100644 --- a/src/devices/cpu/m6502/m5074x.h +++ b/src/devices/cpu/m6502/m5074x.h @@ -8,14 +8,6 @@ #include "m740.h" //************************************************************************** -// CONSTANTS -//************************************************************************** - -// internal ROM region -#define M5074X_INTERNAL_ROM_REGION "internal" -#define M5074X_INTERNAL_ROM(_tag) (_tag ":" M5074X_INTERNAL_ROM_REGION) - -//************************************************************************** // TYPE DEFINITIONS //************************************************************************** @@ -25,6 +17,7 @@ class m5074x_device : public m740_device { friend class m50740_device; friend class m50741_device; + friend class m50753_device; enum { @@ -57,7 +50,7 @@ public: protected: // construction/destruction - m5074x_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, address_map_constructor internal_map); + m5074x_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, int addrbits, address_map_constructor internal_map); // device-level overrides virtual void device_start() override; @@ -72,10 +65,10 @@ protected: void recalc_irqs(); void recalc_timer(int timer); - devcb_read8::array<4> m_read_p; - devcb_write8::array<4> m_write_p; + devcb_read8::array<5> m_read_p; + devcb_write8::array<5> m_write_p; - uint8_t m_ports[6], m_ddrs[6]; + uint8_t m_ports[5], m_ddrs[5]; uint8_t m_intctrl, m_tmrctrl; uint8_t m_tmr12pre, m_tmr1, m_tmr2, m_tmrxpre, m_tmrx; uint8_t m_tmr1latch, m_tmr2latch, m_tmrxlatch; @@ -90,9 +83,11 @@ class m50740_device : public m5074x_device public: m50740_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - void m50740_map(address_map &map); protected: m50740_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); + +private: + void m50740_map(address_map &map); }; class m50741_device : public m5074x_device @@ -100,12 +95,55 @@ class m50741_device : public m5074x_device public: m50741_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - void m50741_map(address_map &map); protected: m50741_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); + +private: + void m50741_map(address_map &map); +}; + +class m50753_device : public m5074x_device +{ +public: + m50753_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + + enum + { + M50753_INT1_LINE = INPUT_LINE_IRQ0, + M50753_INT2_LINE = INPUT_LINE_IRQ1, + + M5074X_SET_OVERFLOW = M740_SET_OVERFLOW + }; + + template <std::size_t Bit> auto ad_in() { return m_ad_in[Bit].bind(); } + +protected: + m50753_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); + + // device-level overrides + virtual void device_start() override; + virtual void device_reset() override; + + virtual void execute_set_input(int inputnum, int state) override; + +private: + void m50753_map(address_map &map); + + uint8_t ad_r(); + void ad_start_w(uint8_t data); + uint8_t ad_control_r(); + void ad_control_w(uint8_t data); + uint8_t pwm_control_r(); + void pwm_control_w(uint8_t data); + + devcb_read8::array<8> m_ad_in; + + uint8_t m_ad_control; + bool m_pwm_enabled; }; DECLARE_DEVICE_TYPE(M50740, m50740_device) DECLARE_DEVICE_TYPE(M50741, m50741_device) +DECLARE_DEVICE_TYPE(M50753, m50753_device) #endif // MAME_CPU_M6502_M5074X_H diff --git a/src/devices/cpu/m6502/m740.h b/src/devices/cpu/m6502/m740.h index 352f0a4be5c..fc5371ebb4c 100644 --- a/src/devices/cpu/m6502/m740.h +++ b/src/devices/cpu/m6502/m740.h @@ -80,6 +80,7 @@ protected: O(rrf_zpg); O(bra_rel); O(jmp_zpi); + O(jsr_zpi); O(adct_aba); O(adct_abx); O(adct_aby); O(adct_idx); O(adct_idy); O(adct_imm); O(adct_zpg); O(adct_zpx); O(andt_aba); O(andt_abx); O(andt_aby); O(andt_imm); O(andt_idx); O(andt_idy); O(andt_zpg); O(andt_zpx); @@ -93,6 +94,7 @@ protected: O(ldt_aba); O(ldt_abx); O(ldt_aby); O(ldt_idx); O(ldt_idy); O(ldt_imm); O(ldt_zpg); O(ldt_zpx); O(ort_aba); O(ort_abx); O(ort_aby); O(ort_imm); O(ort_idx); O(ort_idy); O(ort_zpg); O(ort_zpx); O(sbct_aba); O(sbct_abx); O(sbct_aby); O(sbct_idx); O(sbct_idy); O(sbct_imm); O(sbct_zpg); O(sbct_zpx); + O(tst_zpg); #undef O diff --git a/src/devices/cpu/m6502/om740.lst b/src/devices/cpu/m6502/om740.lst index 342d224131d..841af3db193 100644 --- a/src/devices/cpu/m6502/om740.lst +++ b/src/devices/cpu/m6502/om740.lst @@ -113,6 +113,18 @@ jmp_zpi PC = TMP; prefetch(); +jsr_zpi + TMP2 = read_pc_noinc(); + read(SP); + write(SP, PC>>8); + dec_SP(); + write(SP, PC); + dec_SP(); + TMP = read(TMP2 & 0xff); + TMP = set_h(TMP, read((TMP2+1) & 0xff)); + PC = TMP; + prefetch(); + reset740 P |= F_I; PC = read_arg(0xfffe); PC = set_h(PC, read_arg(0xffff)); @@ -749,3 +761,9 @@ sbct_zpx do_sbct(TMP); write(X, TMP2); prefetch(); + +tst_zpg + TMP = read_pc(); + TMP2 = read(TMP); + set_nz(TMP2); + prefetch(); diff --git a/src/devices/machine/e05a30.cpp b/src/devices/machine/e05a30.cpp index 8b6d17f21b1..378fedc0539 100644 --- a/src/devices/machine/e05a30.cpp +++ b/src/devices/machine/e05a30.cpp @@ -56,6 +56,7 @@ void e05a30_device::device_start() save_item(NAME(m_printhead)); save_item(NAME(m_pf_stepper)); save_item(NAME(m_cr_stepper)); + save_item(NAME(m_c000_shift_register)); } //------------------------------------------------- @@ -167,6 +168,22 @@ void e05a30_device::write(offs_t offset, uint8_t data) LOG("%s: e05a30_w([0xC0%02x]): %02x\n", machine().describe_context(), offset, data); switch (offset) { + /* The documentation on the e05a30 in the LX-810/850 Technical Manual + * is incomplete. There are instances of writing 0 to c000, so it is a guess + * that writing to c000 will clear the shift register. */ + case 0x00: + m_c000_shift_register = 0; + break; + /* A similar Epson Gate Array, the e05a03 has a 24 bit shift + * register documented in the LX-800 Technical Manual (p.48). + * It is a guess that c001,c002, and c003 are the high, middle, and low bytes + * of a 24 bit shift register. */ + case 0x01: + case 0x02: + case 0x03: + m_c000_shift_register &= ~(uint32_t (0xff) << ((3-offset)*8)); + m_c000_shift_register |= (uint32_t (data) << ((3-offset)*8)); + break; case 0x04: m_centronics_nack = BIT(data,5); m_centronics_busy = BIT(data,0); @@ -197,6 +214,12 @@ uint8_t e05a30_device::read(offs_t offset) LOG("%s: e05a30_r([0xC0%02x]): ", machine().describe_context(), offset); switch (offset) { + case 0x00: + result = BIT(m_c000_shift_register, 23) << 7; + if (!machine().side_effects_disabled()) { + m_c000_shift_register = (m_c000_shift_register << 1) & 0xffffff; + } + break; case 0x02: result = m_centronics_data_latched << 7; break; diff --git a/src/devices/machine/e05a30.h b/src/devices/machine/e05a30.h index 4cc88759ff5..b6fd7af343b 100644 --- a/src/devices/machine/e05a30.h +++ b/src/devices/machine/e05a30.h @@ -76,6 +76,7 @@ private: uint8_t m_centronics_strobe; uint8_t m_centronics_data_latch; uint8_t m_centronics_data_latched; + uint32_t m_c000_shift_register; }; DECLARE_DEVICE_TYPE(E05A30, e05a30_device) diff --git a/src/devices/sound/dac.cpp b/src/devices/sound/dac.cpp index 727a5679ba5..926e2444a76 100644 --- a/src/devices/sound/dac.cpp +++ b/src/devices/sound/dac.cpp @@ -91,7 +91,7 @@ dac_device_base::dac_device_base(const machine_config &mconfig, device_type type m_bits(bits), m_mapper(mapper), m_gain(gain), - m_range_min(-1.0), + m_range_min((bits == 1) ? 0.0 : -1.0), m_range_max(1.0) { } diff --git a/src/emu/rendlay.cpp b/src/emu/rendlay.cpp index 1f10941bbab..7215061df15 100644 --- a/src/emu/rendlay.cpp +++ b/src/emu/rendlay.cpp @@ -38,9 +38,10 @@ #define LOG_GROUP_BOUNDS_RESOLUTION (1U << 1) #define LOG_INTERACTIVE_ITEMS (1U << 2) -#define LOG_IMAGE_LOAD (1U << 3) +#define LOG_DISK_DRAW (1U << 3) +#define LOG_IMAGE_LOAD (1U << 4) -//#define VERBOSE (LOG_GROUP_BOUNDS_RESOLUTION | LOG_INTERACTIVE_ITEMS | LOG_IMAGE_LOAD) +//#define VERBOSE (LOG_GROUP_BOUNDS_RESOLUTION | LOG_INTERACTIVE_ITEMS | LOG_DISK_DRAW | LOG_IMAGE_LOAD) #define LOG_OUTPUT_FUNC osd_printf_verbose #include "logmacro.h" @@ -2041,6 +2042,8 @@ public: float const yradius = curbounds.height() * float(dest.height()) * 0.5F; s32 const miny = s32(curbounds.y0 * float(dest.height())); s32 const maxy = s32(std::ceil(curbounds.y1 * float(dest.height()))) - 1; + LOGMASKED(LOG_DISK_DRAW, "Draw disk: bounds (%s %s %s %s); (((x - %s) ** 2) / (%s ** 2) + ((y - %s) ** 2) / (%s ** 2)) = 1; rows [%s %s]\n", + curbounds.x0, curbounds.y0, curbounds.x1, curbounds.y1, xcenter, xradius, ycenter, yradius, miny, maxy); if (miny == maxy) { @@ -2115,17 +2118,18 @@ public: // draw rows above the axis s32 y = miny + 1; float ycoord1 = ycenter - float(y); - float xval1 = xradius * std::sqrt((std::max)(1.0F - (ycoord1 * ycoord1) * ooyradius2, 0.0F)); - float l1 = xcenter - xval1; - float r1 = xcenter + xval1; + float xval1 = std::sqrt((std::max)(1.0F - (ycoord1 * ycoord1) * ooyradius2, 0.0F)); + float l1 = xcenter - (xval1 * xradius); + float r1 = xcenter + (xval1 * xradius); for ( ; (maxy > y) && (float(y + 1) <= ycenter); ++y) { + float const xval0 = xval1; float const l0 = l1; float const r0 = r1; ycoord1 = ycenter - float(y + 1); - xval1 = xradius * std::sqrt((std::max)(1.0F - (ycoord1 * ycoord1) * ooyradius2, 0.0F)); - l1 = xcenter - xval1; - r1 = xcenter + xval1; + xval1 = std::sqrt((std::max)(1.0F - (ycoord1 * ycoord1) * ooyradius2, 0.0F)); + l1 = xcenter - (xval1 * xradius); + r1 = xcenter + (xval1 * xradius); s32 minx = int(l1); s32 maxx = int(std::ceil(r1)) - 1; u32 *dst = &dest.pix(y, minx); @@ -2142,13 +2146,13 @@ public: { float val = 0.0F; if (float(x + 1) <= l0) - val += integral((xcenter - float(x + 1)) / xradius, (xcenter - (std::max)(float(x), l1)) / xradius); + val += integral((std::max)((float(x) - xcenter) / xradius, -xval1), (float(x + 1) - xcenter) / xradius); else if (float(x) <= l0) - val += integral((xcenter - l0) / xradius, (xcenter - (std::max)(float(x), l1)) / xradius); + val += integral((std::max)((float(x) - xcenter) / xradius, -xval1), -xval0); else if (float(x) >= r0) - val += integral((float(x) - xcenter) / xradius, ((std::min)(float(x + 1), r1) - xcenter) / xradius); + val += integral((float(x) - xcenter) / xradius, (std::min)((float(x + 1) - xcenter) / xradius, xval1)); else if (float(x + 1) >= r0) - val += integral((r0 - xcenter) / xradius, ((std::min)(float(x + 1), r1) - xcenter) / xradius); + val += integral(xval0, (std::min)((float(x + 1) - xcenter) / xradius, xval1)); val *= scale; if (float(x) <= l0) val -= ((std::min)(float(x + 1), l0) - (std::max)(float(x), l1)) * ycoord1; @@ -2163,12 +2167,13 @@ public: // row spanning the axis if ((maxy > y) && (float(y) < ycenter)) { + float const xval0 = xval1; float const l0 = l1; float const r0 = r1; ycoord1 = float(y + 1) - ycenter; - xval1 = xradius * std::sqrt((std::max)(1.0F - (ycoord1 * ycoord1) * ooyradius2, 0.0F)); - l1 = xcenter - xval1; - r1 = xcenter + xval1; + xval1 = std::sqrt((std::max)(1.0F - (ycoord1 * ycoord1) * ooyradius2, 0.0F)); + l1 = xcenter - (xval1 * xradius); + r1 = xcenter + (xval1 * xradius); s32 const minx = int(curbounds.x0 * float(dest.width())); s32 const maxx = int(std::ceil(curbounds.x1 * float(dest.width()))) - 1; u32 *dst = &dest.pix(y, minx); @@ -2187,19 +2192,19 @@ public: if (float(x + 1) <= l0) val += integral((xcenter - float(x + 1)) / xradius, (std::min)((xcenter - float(x)) / xradius, 1.0F)); else if (float(x) <= l0) - val += integral((xcenter - l0) / xradius, (std::min)((xcenter - float(x)) / xradius, 1.0F)); + val += integral(xval0, (std::min)((xcenter - float(x)) / xradius, 1.0F)); else if (float(x) >= r0) val += integral((float(x) - xcenter) / xradius, (std::min)((float(x + 1) - xcenter) / xradius, 1.0F)); else if (float(x + 1) >= r0) - val += integral((r0 - xcenter) / xradius, (std::min)((float(x + 1) - xcenter) / xradius, 1.0F)); + val += integral(xval0, (std::min)((float(x + 1) - xcenter) / xradius, 1.0F)); if (float(x + 1) <= l1) val += integral((xcenter - float(x + 1)) / xradius, (std::min)((xcenter - float(x)) / xradius, 1.0F)); else if (float(x) <= l1) - val += integral((xcenter - l1) / xradius, (std::min)((xcenter - float(x)) / xradius, 1.0F)); + val += integral(xval1, (std::min)((xcenter - float(x)) / xradius, 1.0F)); else if (float(x) >= r1) val += integral((float(x) - xcenter) / xradius, (std::min)((float(x + 1) - xcenter) / xradius, 1.0F)); else if (float(x + 1) >= r1) - val += integral((r1 - xcenter) / xradius, (std::min)((float(x + 1) - xcenter) / xradius, 1.0F)); + val += integral(xval1, (std::min)((float(x + 1) - xcenter) / xradius, 1.0F)); val *= scale; val += (std::max)(((std::min)(float(x + 1), r0) - (std::max)(float(x), l0)), 0.0F) * (ycenter - float(y)); val += (std::max)(((std::min)(float(x + 1), r1) - (std::max)(float(x), l1)), 0.0F) * (float(y + 1) - ycenter); @@ -2213,12 +2218,13 @@ public: for ( ; maxy > y; ++y) { float const ycoord0 = ycoord1; + float const xval0 = xval1; float const l0 = l1; float const r0 = r1; ycoord1 = float(y + 1) - ycenter; - xval1 = xradius * std::sqrt((std::max)(1.0F - (ycoord1 * ycoord1) * ooyradius2, 0.0F)); - l1 = xcenter - xval1; - r1 = xcenter + xval1; + xval1 = std::sqrt((std::max)(1.0F - (ycoord1 * ycoord1) * ooyradius2, 0.0F)); + l1 = xcenter - (xval1 * xradius); + r1 = xcenter + (xval1 * xradius); s32 minx = int(l0); s32 maxx = int(std::ceil(r0)) - 1; u32 *dst = &dest.pix(y, minx); @@ -2235,13 +2241,13 @@ public: { float val = 0.0F; if (float(x + 1) <= l1) - val += integral((xcenter - float(x + 1)) / xradius, (xcenter - (std::max)(float(x), l0)) / xradius); + val += integral((std::max)((float(x) - xcenter) / xradius, -xval0), (float(x + 1) - xcenter) / xradius); else if (float(x) <= l1) - val += integral((xcenter - l1) / xradius, (xcenter - (std::max)(float(x), l0)) / xradius); + val += integral((std::max)((float(x) - xcenter) / xradius, -xval0), -xval1); else if (float(x) >= r1) - val += integral((float(x) - xcenter) / xradius, ((std::min)(float(x + 1), r0) - xcenter) / xradius); + val += integral((float(x) - xcenter) / xradius, (std::min)((float(x + 1) - xcenter) / xradius, xval0)); else if (float(x + 1) >= r1) - val += integral((r1 - xcenter) / xradius, ((std::min)(float(x + 1), r0) - xcenter) / xradius); + val += integral(xval1, (std::min)((float(x + 1) - xcenter) / xradius, xval0)); val *= scale; if (float(x) <= l1) val -= ((std::min)(float(x + 1), l1) - (std::max)(float(x), l0)) * ycoord0; diff --git a/src/emu/sound.cpp b/src/emu/sound.cpp index eaf640a3e57..3d235ab8151 100644 --- a/src/emu/sound.cpp +++ b/src/emu/sound.cpp @@ -595,6 +595,7 @@ sound_stream::sound_stream(device_t &device, u32 inputs, u32 outputs, u32 output // create a unique tag for saving std::string state_tag = string_format("%d", m_device.machine().sound().unique_id()); auto &save = m_device.machine().save(); + save.save_item(&m_device, "stream.sample_rate", state_tag.c_str(), 0, NAME(m_sample_rate)); save.register_postload(save_prepost_delegate(FUNC(sound_stream::postload), this)); // initialize all inputs diff --git a/src/lib/formats/aquarius_caq.cpp b/src/lib/formats/aquarius_caq.cpp new file mode 100644 index 00000000000..aecb883aabf --- /dev/null +++ b/src/lib/formats/aquarius_caq.cpp @@ -0,0 +1,107 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************* + + formats/aquarius_caq.cpp + + Cassette code for Aquarius .CAQ files + +*********************************************************************/ + +#include "aquarius_caq.h" + +#include "coretmpl.h" // BIT + +#include <cassert> + + +/*------------------------------------------------- + CassetteModulation aquarius_caq_modulation +-------------------------------------------------*/ + +static const cassette_image::Modulation aquarius_caq_modulation = +{ + cassette_image::MODULATION_SINEWAVE, + 900.0 - 300, 900.0, 900.0 + 300, + 1800.0 - 600, 1800.0, 1800.0 + 600 + + +}; + +/*------------------------------------------------- + aquarius_caq_identify - identify cassette +-------------------------------------------------*/ + +static cassette_image::error aquarius_caq_identify(cassette_image *cassette, cassette_image::Options *opts) +{ + return cassette->modulation_identify(aquarius_caq_modulation, opts); +} + +/*------------------------------------------------- + aquarius_caq_load - load cassette +-------------------------------------------------*/ + +#define MODULATE(_value) \ + for (int i = 0; i < 2; i++) { \ + err = cassette->put_modulated_data_bit(0, time_index, _value, aquarius_caq_modulation, &time_displacement); \ + if (err != cassette_image::error::SUCCESS) return err; \ + time_index += time_displacement; \ + } + +static cassette_image::error aquarius_caq_load(cassette_image *cassette) +{ + cassette_image::error err; + uint64_t image_size = cassette->image_size(); + uint64_t image_pos = 0; + double time_index = 0.0; + double time_displacement; + uint8_t data; + + /* silence */ + err = cassette->put_sample(0, time_index, 0.5, 0); + if (err != cassette_image::error::SUCCESS) return err; + time_index += 0.5; + + while (image_pos < image_size) + { + cassette->image_read(&data, image_pos, 1); + + /* start bit */ + MODULATE(0); + + /* data bits */ + for (int bit = 7; bit >= 0; bit--) + { + MODULATE(util::BIT(data, bit)); + } + + /* stop bits */ + MODULATE(1); + MODULATE(1); + + image_pos++; + } + + /* silence */ + err = cassette->put_sample(0, time_index, 0.5, 0); + if (err != cassette_image::error::SUCCESS) return err; + time_index += 0.5; + + return cassette_image::error::SUCCESS; +} + +/*------------------------------------------------- + CassetteFormat aquarius_caq_cassette_format +-------------------------------------------------*/ + +const cassette_image::Format aquarius_caq_format = +{ + "caq", + aquarius_caq_identify, + aquarius_caq_load, + nullptr +}; + +CASSETTE_FORMATLIST_START( aquarius_cassette_formats ) + CASSETTE_FORMAT(aquarius_caq_format) +CASSETTE_FORMATLIST_END diff --git a/src/lib/formats/aquarius_caq.h b/src/lib/formats/aquarius_caq.h new file mode 100644 index 00000000000..158b1f12a5d --- /dev/null +++ b/src/lib/formats/aquarius_caq.h @@ -0,0 +1,19 @@ +// license:BSD-3-Clause +// copyright-holders:Nigel Barnes +/********************************************************************* + + formats/aquarius_caq.h + + Cassette code for Aquarius .CAQ files + +*********************************************************************/ +#ifndef MAME_FORMATS_AQUARIUS_CAQ_H +#define MAME_FORMATS_AQUARIUS_CAQ_H + +#pragma once + +#include "cassimg.h" + +CASSETTE_FORMATLIST_EXTERN(aquarius_cassette_formats); + +#endif // MAME_FORMATS_AQUARIUS_CAQ_H diff --git a/src/mame/arcade.flt b/src/mame/arcade.flt index 7b20a5588fa..5edf09476ee 100644 --- a/src/mame/arcade.flt +++ b/src/mame/arcade.flt @@ -1027,6 +1027,7 @@ relief.cpp renegade.cpp retofinv.cpp rfslots8085.cpp +rfslotspcpent.cpp rgum.cpp rltennis.cpp rmhaihai.cpp diff --git a/src/mame/drivers/accomm.cpp b/src/mame/drivers/accomm.cpp index 6a1c050195e..34194c84a3f 100644 --- a/src/mame/drivers/accomm.cpp +++ b/src/mame/drivers/accomm.cpp @@ -56,6 +56,8 @@ public: m_vram(*this, "vram"), m_keybd1(*this, "LINE1.%u", 0), m_keybd2(*this, "LINE2.%u", 0), + m_shiftlock_led(*this, "shiftlock_led"), + m_capslock_led(*this, "capslock_led"), m_ch00rom_enabled(true) { } @@ -63,6 +65,12 @@ public: DECLARE_INPUT_CHANGED_MEMBER(trigger_reset); +protected: + // driver_device overrides + virtual void machine_reset() override; + virtual void machine_start() override; + virtual void video_start() override; + private: uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); @@ -77,8 +85,6 @@ private: void accomm_palette(palette_device &palette) const; INTERRUPT_GEN_MEMBER(vbl_int); - virtual void machine_reset() override; - virtual void machine_start() override; void main_map(address_map &map); // devices @@ -92,9 +98,8 @@ private: required_device<mc6854_device> m_adlc; required_shared_ptr<uint8_t> m_vram; required_ioport_array<14> m_keybd1, m_keybd2; - - // driver_device overrides - virtual void video_start() override; + output_finder<> m_shiftlock_led; + output_finder<> m_capslock_led; void interrupt_handler(int mode, int interrupt); inline uint8_t read_vram( uint16_t addr ); @@ -207,6 +212,9 @@ void accomm_state::machine_reset() void accomm_state::machine_start() { + m_shiftlock_led.resolve(); + m_capslock_led.resolve(); + m_ula.interrupt_status = 0x82; m_ula.interrupt_control = 0x00; } @@ -580,9 +588,9 @@ void accomm_state::sheila_w(offs_t offset, uint8_t data) m_ula.vram = (uint8_t *)m_vram.target() + m_ula.screen_base; logerror( "ULA: screen mode set to %d\n", m_ula.screen_mode ); m_ula.shiftlock_mode = !BIT(data, 6); - output().set_value("shiftlock_led", m_ula.shiftlock_mode); + m_shiftlock_led = m_ula.shiftlock_mode; m_ula.capslock_mode = BIT(data, 7); - output().set_value("capslock_led", m_ula.capslock_mode); + m_capslock_led = m_ula.capslock_mode; break; case 0x08: case 0x0A: case 0x0C: case 0x0E: // video_update diff --git a/src/mame/drivers/alesis.cpp b/src/mame/drivers/alesis.cpp index 1b02744e3bb..19a0809fb6d 100644 --- a/src/mame/drivers/alesis.cpp +++ b/src/mame/drivers/alesis.cpp @@ -27,18 +27,9 @@ uint8_t alesis_state::kb_r() { uint8_t data = 0xff; - if (!(m_kb_matrix & 0x01)) - data &= m_col1->read(); - if (!(m_kb_matrix & 0x02)) - data &= m_col2->read(); - if (!(m_kb_matrix & 0x04)) - data &= m_col3->read(); - if (!(m_kb_matrix & 0x08)) - data &= m_col4->read(); - if (!(m_kb_matrix & 0x10)) - data &= m_col5->read(); - if (!(m_kb_matrix & 0x20)) - data &= m_col6->read(); + for (int i = 0; i < 6; i++) + if (!BIT(m_kb_matrix, i)) + data &= m_col[i]->read(); return data; } @@ -338,6 +329,7 @@ void alesis_state::alesis_palette(palette_device &palette) const void alesis_state::machine_start() { m_digit.resolve(); + m_pattern.resolve(); m_track_led.resolve(); m_patt_led.resolve(); m_song_led.resolve(); diff --git a/src/mame/drivers/apple2gs.cpp b/src/mame/drivers/apple2gs.cpp index 28f1296e22c..d21dfc9618b 100644 --- a/src/mame/drivers/apple2gs.cpp +++ b/src/mame/drivers/apple2gs.cpp @@ -4806,7 +4806,7 @@ void apple2gs_state::apple2gsr1(machine_config &config) ***************************************************************************/ ROM_START(apple2gs) // M50740/50741 ADB MCU inside the IIgs system unit - ROM_REGION(0x1000,M5074X_INTERNAL_ROM(A2GS_ADBMCU_TAG),0) + ROM_REGION(0x1000, A2GS_ADBMCU_TAG, 0) ROM_LOAD( "341s0632-2.bin", 0x000000, 0x001000, CRC(e1c11fb0) SHA1(141d18c36a617ab9dce668445440d34354be0672) ) // i8048 microcontroller inside the IIgs ADB Standard Keyboard @@ -4834,7 +4834,7 @@ ROM_START(apple2gs) ROM_END ROM_START(apple2gsr3p) - ROM_REGION(0x1000,M5074X_INTERNAL_ROM(A2GS_ADBMCU_TAG),0) + ROM_REGION(0x1000, A2GS_ADBMCU_TAG, 0) ROM_LOAD( "341s0632-2.bin", 0x000000, 0x001000, CRC(e1c11fb0) SHA1(141d18c36a617ab9dce668445440d34354be0672) ) ROM_REGION(0x400, "kmcu", 0) @@ -4854,7 +4854,7 @@ ROM_START(apple2gsr3p) ROM_END ROM_START(apple2gsr1) - ROM_REGION(0xc00,M5074X_INTERNAL_ROM(A2GS_ADBMCU_TAG),0) + ROM_REGION(0xc00, A2GS_ADBMCU_TAG, 0) ROM_LOAD( "341s0345.bin", 0x000000, 0x000c00, CRC(48cd5779) SHA1(97e421f5247c00a0ca34cd08b6209df573101480) ) ROM_REGION(0x400, "kmcu", 0) @@ -4873,7 +4873,7 @@ ROM_START(apple2gsr1) ROM_END ROM_START(apple2gsr0) - ROM_REGION(0xc00,M5074X_INTERNAL_ROM(A2GS_ADBMCU_TAG),0) + ROM_REGION(0xc00, A2GS_ADBMCU_TAG, 0) ROM_LOAD( "341s0345.bin", 0x000000, 0x000c00, CRC(48cd5779) SHA1(97e421f5247c00a0ca34cd08b6209df573101480) ) ROM_REGION(0x400, "kmcu", 0) @@ -4892,7 +4892,7 @@ ROM_START(apple2gsr0) ROM_END ROM_START(apple2gsr0p) // 6/19/1986 Cortland prototype - ROM_REGION(0xc00,M5074X_INTERNAL_ROM(A2GS_ADBMCU_TAG),0) + ROM_REGION(0xc00, A2GS_ADBMCU_TAG, 0) ROM_LOAD( "341s0345.bin", 0x000000, 0x000c00, CRC(48cd5779) SHA1(97e421f5247c00a0ca34cd08b6209df573101480) ) ROM_REGION(0x400, "kmcu", 0) @@ -4911,7 +4911,7 @@ ROM_START(apple2gsr0p) // 6/19/1986 Cortland prototype ROM_END ROM_START(apple2gsr0p2) // 3/10/1986 Cortland prototype, boots as "Apple //'ing - Alpha 2.0" - ROM_REGION(0xc00,M5074X_INTERNAL_ROM(A2GS_ADBMCU_TAG),0) + ROM_REGION(0xc00, A2GS_ADBMCU_TAG, 0) ROM_LOAD( "341s0345.bin", 0x000000, 0x000c00, CRC(48cd5779) SHA1(97e421f5247c00a0ca34cd08b6209df573101480) ) ROM_REGION(0x400, "kmcu", 0) diff --git a/src/mame/drivers/aquarius.cpp b/src/mame/drivers/aquarius.cpp index b1d9abb6d3b..fe2bbf745c4 100644 --- a/src/mame/drivers/aquarius.cpp +++ b/src/mame/drivers/aquarius.cpp @@ -10,7 +10,6 @@ - slot interface for cartridges - hand controllers - scramble RAM also - - CAQ tape support - memory mapper - proper video timings - PAL mode @@ -43,7 +42,7 @@ X-6026 : Roll of paper for the printer ***************************************************************************/ #define XTAL1 8866000 -#define XTAL2 XTAL(7'159'090) +#define XTAL2 7.15909_MHz_XTAL /*************************************************************************** @@ -362,7 +361,7 @@ GFXDECODE_END void aquarius_state::aquarius(machine_config &config) { /* basic machine hardware */ - Z80(config, m_maincpu, XTAL(3'579'545)); // ??? + Z80(config, m_maincpu, XTAL2 / 2); m_maincpu->set_addrmap(AS_PROGRAM, &aquarius_state::aquarius_mem); m_maincpu->set_addrmap(AS_IO, &aquarius_state::aquarius_io); m_maincpu->set_vblank_int("screen", FUNC(aquarius_state::irq0_line_hold)); @@ -384,6 +383,7 @@ void aquarius_state::aquarius(machine_config &config) SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); + /* mini expander */ ay8910_device &ay8910(AY8910(config, "ay8910", XTAL(3'579'545)/2)); // ??? AY-3-8914 ay8910.port_a_read_callback().set_ioport("RIGHT"); ay8910.port_b_read_callback().set_ioport("LEFT"); @@ -393,12 +393,14 @@ void aquarius_state::aquarius(machine_config &config) CASSETTE(config, m_cassette); m_cassette->set_default_state(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED); m_cassette->add_route(ALL_OUTPUTS, "mono", 0.05); + m_cassette->set_formats(aquarius_cassette_formats); + m_cassette->set_interface("aquarius_cass"); /* cartridge */ GENERIC_CARTSLOT(config, m_cart, generic_linear_slot, "aquarius_cart"); /* internal ram */ - RAM(config, RAM_TAG).set_default_size("4K").set_extra_options("8K,20K,36K"); + RAM(config, RAM_TAG).set_default_size("20K").set_extra_options("4K,8K,36K"); /* software lists */ SOFTWARE_LIST(config, "cart_list").set_original("aquarius"); @@ -414,10 +416,10 @@ ROM_START( aquarius ) /* basic rom */ ROM_DEFAULT_BIOS("rev2") - ROM_SYSTEM_BIOS(0, "rev1", "Revision 1") - ROMX_LOAD("aq1.u2", 0x0000, 0x2000, NO_DUMP, ROM_BIOS(0)) - ROM_SYSTEM_BIOS(1, "rev2", "Revision 2") - ROMX_LOAD("aq2.u2", 0x0000, 0x2000, CRC(a2d15bcf) SHA1(ca6ef55e9ead41453efbf5062d6a60285e9661a6), ROM_BIOS(1)) + ROM_SYSTEM_BIOS(0, "rev2", "Revision 2") + ROMX_LOAD("aq2.u2", 0x0000, 0x2000, CRC(a2d15bcf) SHA1(ca6ef55e9ead41453efbf5062d6a60285e9661a6), ROM_BIOS(0)) + ROM_SYSTEM_BIOS(1, "rev1", "Revision 1") + ROMX_LOAD("aq1.u2", 0x0000, 0x2000, NO_DUMP, ROM_BIOS(1)) /* charrom */ ROM_REGION(0x800, "gfx1", 0) diff --git a/src/mame/drivers/babbage.cpp b/src/mame/drivers/babbage.cpp index ffe18957e66..74d520744ac 100644 --- a/src/mame/drivers/babbage.cpp +++ b/src/mame/drivers/babbage.cpp @@ -37,15 +37,18 @@ public: babbage_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) , m_maincpu(*this, "maincpu") - , m_pio_1(*this, "z80pio_1") - , m_pio_2(*this, "z80pio_2") + , m_pio(*this, "z80pio_%u", 1U) , m_ctc(*this, "z80ctc") , m_display(*this, "display") , m_io_keyboard(*this, "X%u", 0U) + , m_leds(*this, "led%u", 0U) { } void babbage(machine_config &config); +protected: + virtual void machine_start() override; + private: uint8_t pio2_a_r(); void pio1_b_w(uint8_t data); @@ -62,13 +65,13 @@ private: uint8_t m_key; uint8_t m_prev_key; bool m_step; - virtual void machine_start() override; + required_device<z80_device> m_maincpu; - required_device<z80pio_device> m_pio_1; - required_device<z80pio_device> m_pio_2; + required_device_array<z80pio_device, 2> m_pio; required_device<z80ctc_device> m_ctc; required_device<pwm_display_device> m_display; required_ioport_array<4> m_io_keyboard; + output_finder<8> m_leds; }; @@ -90,8 +93,8 @@ void babbage_state::babbage_io(address_map &map) { map.global_mask(0xff); map(0x00, 0x03).rw(m_ctc, FUNC(z80ctc_device::read), FUNC(z80ctc_device::write)); - map(0x10, 0x13).rw(m_pio_1, FUNC(z80pio_device::read_alt), FUNC(z80pio_device::write_alt)); - map(0x20, 0x23).rw(m_pio_2, FUNC(z80pio_device::read_alt), FUNC(z80pio_device::write_alt)); + map(0x10, 0x13).rw(m_pio[0], FUNC(z80pio_device::read_alt), FUNC(z80pio_device::write_alt)); + map(0x20, 0x23).rw(m_pio[1], FUNC(z80pio_device::read_alt), FUNC(z80pio_device::write_alt)); } @@ -153,17 +156,14 @@ WRITE_LINE_MEMBER( babbage_state::ctc_z2_w ) // bios never writes here - you need to set PIO for output yourself - see test program above void babbage_state::pio1_b_w(uint8_t data) { - char ledname[8]; for (int i = 0; i < 8; i++) - { - sprintf(ledname,"led%d",i); - output().set_value(ledname, BIT(data, i)); - } + m_leds[i] = BIT(data, i); } uint8_t babbage_state::pio2_a_r() { - m_maincpu->set_input_line(0, CLEAR_LINE); // release interrupt + if (!machine().side_effects_disabled()) + m_maincpu->set_input_line(0, CLEAR_LINE); // release interrupt return m_key; } @@ -212,14 +212,16 @@ TIMER_DEVICE_CALLBACK_MEMBER(babbage_state::keyboard_callback) if (data < 0xff) { m_key = data; - m_pio_2->strobe(0, 0); + m_pio[1]->strobe(0, 0); } else - m_pio_2->strobe(0, 1); + m_pio[1]->strobe(0, 1); } void babbage_state::machine_start() { + m_leds.resolve(); + save_item(NAME(m_seg)); save_item(NAME(m_key)); save_item(NAME(m_prev_key)); @@ -252,14 +254,14 @@ void babbage_state::babbage(machine_config &config) m_ctc->zc_callback<1>().set(FUNC(babbage_state::ctc_z1_w)); m_ctc->zc_callback<2>().set(FUNC(babbage_state::ctc_z2_w)); - Z80PIO(config, m_pio_1, MAIN_CLOCK); - m_pio_1->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0); - m_pio_1->out_pb_callback().set(FUNC(babbage_state::pio1_b_w)); + Z80PIO(config, m_pio[0], MAIN_CLOCK); + m_pio[0]->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0); + m_pio[0]->out_pb_callback().set(FUNC(babbage_state::pio1_b_w)); - Z80PIO(config, m_pio_2, MAIN_CLOCK); - m_pio_2->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0); - m_pio_2->in_pa_callback().set(FUNC(babbage_state::pio2_a_r)); - m_pio_2->out_pb_callback().set(FUNC(babbage_state::pio2_b_w)); + Z80PIO(config, m_pio[1], MAIN_CLOCK); + m_pio[1]->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0); + m_pio[1]->in_pa_callback().set(FUNC(babbage_state::pio2_a_r)); + m_pio[1]->out_pb_callback().set(FUNC(babbage_state::pio2_b_w)); TIMER(config, "keyboard_timer", 0).configure_periodic(FUNC(babbage_state::keyboard_callback), attotime::from_hz(30)); } diff --git a/src/mame/drivers/chessmst.cpp b/src/mame/drivers/chessmst.cpp index 18c7f4cfa85..f22f1d8999f 100644 --- a/src/mame/drivers/chessmst.cpp +++ b/src/mame/drivers/chessmst.cpp @@ -43,7 +43,9 @@ public: m_extra(*this, "EXTRA"), m_buttons(*this, "BUTTONS"), m_digits(*this, "digit%u", 0U), - m_leds(*this, "led_%c%u", unsigned('a'), 1U) + m_leds(*this, "led_%c%u", unsigned('a'), 1U), + m_monitor_led(*this, "monitor_led"), + m_playmode_led(*this, "playmode_led") { } DECLARE_INPUT_CHANGED_MEMBER(reset_button); @@ -82,6 +84,8 @@ private: required_ioport m_buttons; output_finder<4> m_digits; output_finder<10, 8> m_leds; + output_finder<> m_monitor_led; + output_finder<> m_playmode_led; uint16_t m_matrix; uint16_t m_led_sel; @@ -182,6 +186,8 @@ void chessmst_state::machine_start() { m_digits.resolve(); m_leds.resolve(); + m_monitor_led.resolve(); + m_playmode_led.resolve(); save_item(NAME(m_matrix)); save_item(NAME(m_led_sel)); @@ -248,8 +254,8 @@ void chessmst_state::pio1_port_b_dm_w(uint8_t data) m_beeper->set_state(BIT(data, 3)); - output().set_value("monitor_led", !BIT(data, 5)); - output().set_value("playmode_led", !BIT(data, 6)); + m_monitor_led = !BIT(data, 5); + m_playmode_led = !BIT(data, 6); } uint8_t chessmst_state::pio2_port_a_r() diff --git a/src/mame/drivers/cz101.cpp b/src/mame/drivers/cz101.cpp index 1e475f33125..122e0e86a0b 100644 --- a/src/mame/drivers/cz101.cpp +++ b/src/mame/drivers/cz101.cpp @@ -37,6 +37,7 @@ public: m_maincpu(*this, "maincpu"), m_hd44780(*this, "hd44780"), m_keys(*this, "kc%u", 0), + m_leds(*this, "led_%u", 0U), m_port_b(0), m_port_c(0) { } @@ -54,6 +55,7 @@ private: required_device<upd7810_device> m_maincpu; required_device<hd44780_device> m_hd44780; required_ioport_array<16> m_keys; + output_finder<32> m_leds; void maincpu_map(address_map &map); @@ -264,50 +266,50 @@ HD44780_PIXEL_UPDATE( cz101_state::lcd_pixel_update ) void cz101_state::led_4_w(uint8_t data) { - output().set_value("led_0", BIT(data, 7) ? 0 : 1); - output().set_value("led_1", BIT(data, 6) ? 0 : 1); - output().set_value("led_2", BIT(data, 5) ? 0 : 1); - output().set_value("led_3", BIT(data, 4) ? 0 : 1); - output().set_value("led_4", BIT(data, 3) ? 0 : 1); - output().set_value("led_5", BIT(data, 2) ? 0 : 1); - output().set_value("led_6", BIT(data, 1) ? 0 : 1); - output().set_value("led_7", BIT(data, 0) ? 0 : 1); + m_leds[0] = BIT(data, 7) ? 0 : 1; + m_leds[1] = BIT(data, 6) ? 0 : 1; + m_leds[2] = BIT(data, 5) ? 0 : 1; + m_leds[3] = BIT(data, 4) ? 0 : 1; + m_leds[4] = BIT(data, 3) ? 0 : 1; + m_leds[5] = BIT(data, 2) ? 0 : 1; + m_leds[6] = BIT(data, 1) ? 0 : 1; + m_leds[7] = BIT(data, 0) ? 0 : 1; } void cz101_state::led_3_w(uint8_t data) { - output().set_value("led_8", BIT(data, 7) ? 0 : 1); - output().set_value("led_9", BIT(data, 6) ? 0 : 1); - output().set_value("led_10", BIT(data, 5) ? 0 : 1); - output().set_value("led_11", BIT(data, 4) ? 0 : 1); - output().set_value("led_12", BIT(data, 3) ? 0 : 1); - output().set_value("led_13", BIT(data, 2) ? 0 : 1); - output().set_value("led_14", BIT(data, 1) ? 0 : 1); - output().set_value("led_15", BIT(data, 0) ? 0 : 1); + m_leds[8] = BIT(data, 7) ? 0 : 1; + m_leds[9] = BIT(data, 6) ? 0 : 1; + m_leds[10] = BIT(data, 5) ? 0 : 1; + m_leds[11] = BIT(data, 4) ? 0 : 1; + m_leds[12] = BIT(data, 3) ? 0 : 1; + m_leds[13] = BIT(data, 2) ? 0 : 1; + m_leds[14] = BIT(data, 1) ? 0 : 1; + m_leds[15] = BIT(data, 0) ? 0 : 1; } void cz101_state::led_2_w(uint8_t data) { - output().set_value("led_16", BIT(data, 7) ? 0 : 1); - output().set_value("led_17", BIT(data, 6) ? 0 : 1); - output().set_value("led_18", BIT(data, 5) ? 0 : 1); - output().set_value("led_19", BIT(data, 4) ? 0 : 1); - output().set_value("led_20", BIT(data, 3) ? 0 : 1); - output().set_value("led_21", BIT(data, 2) ? 0 : 1); - output().set_value("led_22", BIT(data, 1) ? 0 : 1); - output().set_value("led_23", BIT(data, 0) ? 0 : 1); + m_leds[16] = BIT(data, 7) ? 0 : 1; + m_leds[17] = BIT(data, 6) ? 0 : 1; + m_leds[18] = BIT(data, 5) ? 0 : 1; + m_leds[19] = BIT(data, 4) ? 0 : 1; + m_leds[20] = BIT(data, 3) ? 0 : 1; + m_leds[21] = BIT(data, 2) ? 0 : 1; + m_leds[22] = BIT(data, 1) ? 0 : 1; + m_leds[23] = BIT(data, 0) ? 0 : 1; } void cz101_state::led_1_w(uint8_t data) { - output().set_value("led_24", BIT(data, 7) ? 0 : 1); - output().set_value("led_25", BIT(data, 6) ? 0 : 1); - output().set_value("led_26", BIT(data, 5) ? 0 : 1); - output().set_value("led_27", BIT(data, 4) ? 0 : 1); - output().set_value("led_28", BIT(data, 3) ? 0 : 1); - output().set_value("led_29", BIT(data, 2) ? 0 : 1); - output().set_value("led_30", BIT(data, 1) ? 0 : 1); - output().set_value("led_31", BIT(data, 0) ? 0 : 1); + m_leds[24] = BIT(data, 7) ? 0 : 1; + m_leds[25] = BIT(data, 6) ? 0 : 1; + m_leds[26] = BIT(data, 5) ? 0 : 1; + m_leds[27] = BIT(data, 4) ? 0 : 1; + m_leds[28] = BIT(data, 3) ? 0 : 1; + m_leds[29] = BIT(data, 2) ? 0 : 1; + m_leds[30] = BIT(data, 1) ? 0 : 1; + m_leds[31] = BIT(data, 0) ? 0 : 1; } uint8_t cz101_state::keys_r() @@ -349,6 +351,8 @@ void cz101_state::port_c_w(uint8_t data) void cz101_state::machine_start() { + m_leds.resolve(); + // register for save states save_item(NAME(m_port_b)); save_item(NAME(m_port_c)); diff --git a/src/mame/drivers/dct11em.cpp b/src/mame/drivers/dct11em.cpp index c273b2b667a..27d2ad605b7 100644 --- a/src/mame/drivers/dct11em.cpp +++ b/src/mame/drivers/dct11em.cpp @@ -39,6 +39,7 @@ public: , m_terminal(*this, "terminal") , m_io_keyboard(*this, "X%u", 0U) , m_digits(*this, "digit%d", 0U) + , m_led(*this, "led0") { } void dct11em(machine_config &config); @@ -72,6 +73,7 @@ private: required_device<generic_terminal_device> m_terminal; required_ioport_array<5> m_io_keyboard; output_finder<12> m_digits; + output_finder<> m_led; }; void dct11em_state::mem_map(address_map &map) @@ -152,7 +154,7 @@ void dct11em_state::portc_w(u8 data) m_digits[data] = m_seg_lower; m_digits[data+6] = m_seg_upper; } - output().set_value("led0", (data!=9)); + m_led = (data!=9); } u8 dct11em_state::portc_r() @@ -201,6 +203,8 @@ void dct11em_state::machine_reset() void dct11em_state::machine_start() { m_digits.resolve(); + m_led.resolve(); + save_item(NAME(m_seg_lower)); save_item(NAME(m_seg_upper)); save_item(NAME(m_portc)); diff --git a/src/mame/drivers/digel804.cpp b/src/mame/drivers/digel804.cpp index 4fe6499cacf..573674cd8d8 100644 --- a/src/mame/drivers/digel804.cpp +++ b/src/mame/drivers/digel804.cpp @@ -79,7 +79,10 @@ public: m_vfd(*this, "vfd"), m_kb(*this, "74c923"), m_rambank(*this, "bankedram"), - m_func_leds(*this, "func_led%u", 0U) + m_func_leds(*this, "func_led%u", 0U), + m_input_led(*this, "input_led"), + m_busy_led(*this, "busy_led"), + m_error_led(*this, "error_led") { } @@ -129,6 +132,9 @@ private: required_memory_bank m_rambank; output_finder<16> m_func_leds; + output_finder<> m_input_led; + output_finder<> m_busy_led; + output_finder<> m_error_led; // current speaker state for port 45 uint8_t m_speaker_state; @@ -169,6 +175,9 @@ enum { MODE_OFF, MODE_KEY, MODE_REM, MODE_SIM }; void digel804_state::machine_start() { m_func_leds.resolve(); + m_input_led.resolve(); + m_busy_led.resolve(); + m_error_led.resolve(); save_item(NAME(m_speaker_state)); save_item(NAME(m_ram_bank)); @@ -377,9 +386,9 @@ void digel804_state::op46(uint8_t data) //popmessage("LEDS: %s %s %s Func: %s%d\n", (data&0x80)?"INPUT":"-----", (data&0x40)?"BUSY":"----", (data&0x20)?"ERROR":"-----", (data&0x10)?"None":"", (data&0x10)?-1:(~data&0xF)); //fprintf("LEDS: %s %s %s Func: %s%d\n", (data&0x80)?"INPUT":"-----", (data&0x40)?"BUSY":"----", (data&0x20)?"ERROR":"-----", (data&0x10)?"None":"", (data&0x10)?-1:(~data&0xF)); - output().set_value("input_led", BIT(data,7)); - output().set_value("busy_led", BIT(data,6)); - output().set_value("error_led", BIT(data,5)); + m_input_led = BIT(data,7); + m_busy_led = BIT(data,6); + m_error_led = BIT(data,5); for (int i = 0; i < 16; i++) m_func_leds[i] = (!(data & 0x10) && ((~data & 0x0f) == i)) ? 1 : 0; diff --git a/src/mame/drivers/eacc.cpp b/src/mame/drivers/eacc.cpp index bcaf5016d18..c3fbda5d051 100644 --- a/src/mame/drivers/eacc.cpp +++ b/src/mame/drivers/eacc.cpp @@ -63,11 +63,17 @@ public: , m_maincpu(*this, "maincpu") , m_pia(*this, "pia") , m_p_nvram(*this, "nvram") + , m_io_keyboard(*this, "X%u", 0U) , m_digits(*this, "digit%u", 0U) + , m_leds(*this, "led%u", 0U) { } void eacc(machine_config &config); +protected: + virtual void machine_reset() override; + virtual void machine_start() override; + private: DECLARE_READ_LINE_MEMBER( cb1_r ); DECLARE_READ_LINE_MEMBER( distance_r ); @@ -83,12 +89,13 @@ private: bool m_cb1; bool m_cb2; bool m_nmi; - virtual void machine_reset() override; - virtual void machine_start() override; + required_device<m6802_cpu_device> m_maincpu; required_device<pia6821_device> m_pia; required_shared_ptr<uint8_t> m_p_nvram; + required_ioport_array<4> m_io_keyboard; output_finder<7> m_digits; + output_finder<8> m_leds; }; @@ -147,6 +154,7 @@ void eacc_state::machine_reset() void eacc_state::machine_start() { m_digits.resolve(); + m_leds.resolve(); save_item(NAME(m_cb1)); save_item(NAME(m_cb2)); @@ -193,14 +201,9 @@ uint8_t eacc_state::keyboard_r() { uint8_t data = m_digit; - if (BIT(m_digit, 3)) - data |= ioport("X0")->read(); - if (BIT(m_digit, 4)) - data |= ioport("X1")->read(); - if (BIT(m_digit, 5)) - data |= ioport("X2")->read(); - if (BIT(m_digit, 6)) - data |= ioport("X3")->read(); + for (uint8_t i = 3; i < 7; i++) + if (BIT(m_digit, i)) + data |= m_io_keyboard[i - 3]->read(); return data; } @@ -218,21 +221,16 @@ void eacc_state::segment_w(uint8_t data) if (!m_nmi) { - uint8_t i; if (BIT(m_digit, 7)) { - char lednum[6]; data ^= 0xff; - for (i = 0; i < 8; i++) - { - sprintf(lednum,"led%d",i); - output().set_value(lednum, BIT(data, i)); - } + for (uint8_t i = 0; i < 8; i++) + m_leds[i] = BIT(data, i); } else { - for (i = 3; i < 7; i++) + for (uint8_t i = 3; i < 7; i++) if (BIT(m_digit, i)) m_digits[i] = bitswap<8>(data, 7, 0, 1, 4, 5, 6, 2, 3); } diff --git a/src/mame/drivers/einstein.cpp b/src/mame/drivers/einstein.cpp index b781ad3aa21..34d3543a652 100644 --- a/src/mame/drivers/einstein.cpp +++ b/src/mame/drivers/einstein.cpp @@ -90,6 +90,7 @@ public: m_porta_joy(*this, "PORTA_JOY"), m_portb_joy(*this, "PORTB_JOY"), m_dips(*this, "DIPS"), + m_alpha_lock_led(*this, "alpha_lock_led"), m_rom_enabled(0), m_keyboard_line(0), m_keyboard_data(0xff), m_centronics_ack(0), m_centronics_busy(0), m_centronics_perror(0), m_centronics_fault(0), m_strobe(-1), @@ -103,6 +104,10 @@ public: DECLARE_QUICKLOAD_LOAD_MEMBER(quickload_cb); +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + private: TIMER_DEVICE_CALLBACK_MEMBER(keyboard_timer_callback); void keyboard_line_write(uint8_t data); @@ -140,9 +145,6 @@ private: void einstein_mem(address_map &map); void einst256_io(address_map &map); - virtual void machine_start() override; - virtual void machine_reset() override; - void einstein_scan_keyboard(); required_device<z80_device> m_maincpu; @@ -168,6 +170,7 @@ private: optional_ioport m_porta_joy; optional_ioport m_portb_joy; optional_ioport m_dips; + output_finder<> m_alpha_lock_led; int m_rom_enabled; @@ -181,7 +184,7 @@ private: int m_centronics_perror; int m_centronics_fault; int m_strobe; - int m_alpha_lock_led; + int m_alpha_lock; int m_int; }; @@ -453,6 +456,8 @@ void einstein_state::reset_w(uint8_t data) void einstein_state::machine_start() { + m_alpha_lock_led.resolve(); + // initialize memory mapping m_bank1->configure_entry(0, m_ram->pointer()); m_bank1->configure_entry(1, m_bios->base()); @@ -477,6 +482,7 @@ void einstein_state::machine_reset() m_strobe = -1; // enable Alpha Lock LED + m_alpha_lock = 1; m_alpha_lock_led = 1; } @@ -588,15 +594,18 @@ void einstein_state::pseudo_adc_w(uint8_t data) uint8_t einstein_state::alpha_lock_r() { - m_alpha_lock_led ^= 1; - output().set_value("alpha_lock_led", m_alpha_lock_led); + if (!machine().side_effects_disabled()) + { + m_alpha_lock ^= 1; + m_alpha_lock_led = m_alpha_lock; + } return 0xff; } void einstein_state::alpha_lock_w(uint8_t data) { - m_alpha_lock_led ^= 1; - output().set_value("alpha_lock_led", m_alpha_lock_led); + m_alpha_lock ^= 1; + m_alpha_lock_led = m_alpha_lock; } diff --git a/src/mame/drivers/emma2.cpp b/src/mame/drivers/emma2.cpp index 3de35f7633c..6d965780f3c 100644 --- a/src/mame/drivers/emma2.cpp +++ b/src/mame/drivers/emma2.cpp @@ -204,7 +204,7 @@ void emma2_state::emma2(machine_config &config) m_pia->writepa_handler().set(FUNC(emma2_state::segment_w)); m_pia->writepb_handler().set(FUNC(emma2_state::digit_w)); m_pia->readpb_handler().set(FUNC(emma2_state::keyboard_r)); - m_pia->ca2_handler().set([this] (bool state) { output().set_value("led0", state); }); + m_pia->ca2_handler().set_output("led0"); m_pia->irqa_handler().set_inputline(m_maincpu, m6502_device::IRQ_LINE); m_pia->irqb_handler().set_inputline(m_maincpu, m6502_device::IRQ_LINE); diff --git a/src/mame/drivers/generalplus_gpl16250_rom.cpp b/src/mame/drivers/generalplus_gpl16250_rom.cpp index 9a118332720..f8c35f7cb3a 100644 --- a/src/mame/drivers/generalplus_gpl16250_rom.cpp +++ b/src/mame/drivers/generalplus_gpl16250_rom.cpp @@ -486,12 +486,12 @@ CONS(2009, smartfps, smartfp, 0, base, smartfp, gcm394_game_state, empty_init, // These are ports of the 'Family Sport' games to GPL16250 type hardware, but they don't seem to use many unSP 2.0 instructions. // The menu style is close to 'm505neo' but the game selection is closer to 'dnv200fs' (but without the Sports titles removed, and with a few other extras not found on that unit) -CONS(201?, tkmag220, 0, 0, tkmag220, tkmag220, tkmag220_game_state, empty_init, "TaiKee", "Mini Arcade Games Console (Family Sport 220-in-1)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +CONS(201?, tkmag220, 0, 0, tkmag220, tkmag220, tkmag220_game_state, empty_init, "TaiKee / Senca", "Mini Arcade Games Console (Family Sport 220-in-1)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // DGUN-2891 or DGUN-2864 ? both look the same, no indication on unboxed unit? -CONS(201?, myac220, 0, 0, tkmag220, tkmag220, tkmag220_game_state, empty_init, "dreamGEAR", "My Arcade Go Gamer Portable (Family Sport 220-in-1)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +CONS(201?, myac220, 0, 0, tkmag220, tkmag220, tkmag220_game_state, empty_init, "dreamGEAR / Senca", "My Arcade Go Gamer Portable (Family Sport 220-in-1)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // 2012 date from manual -CONS(2012, imgame, 0, 0, tkmag220, tkmag220, tkmag220_game_state, empty_init, "I'm Game", "I'm Game! GP120 (Family Sport 120-in-1)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +CONS(2012, imgame, 0, 0, tkmag220, tkmag220, tkmag220_game_state, empty_init, "I'm Game / Senca", "I'm Game! GP120 (Family Sport 120-in-1)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // a 180 game Family Sport I'm Game! also exists (and some Famiclones) // memory mapping needs figuring out diff --git a/src/mame/drivers/gladiatr.cpp b/src/mame/drivers/gladiatr.cpp index bf18e3e7408..02ad08679ec 100644 --- a/src/mame/drivers/gladiatr.cpp +++ b/src/mame/drivers/gladiatr.cpp @@ -170,6 +170,7 @@ Notes: - gladiatr and clones start with one credit due to the way MAME initialises memory and the dodgy code the bootleg MCUs use to synchronise with the host CPUs. On an F3 reset they randomly start with one credit or no credits. +- gladiatr and clones don't show player inputs in service mode. TODO: ----- @@ -183,7 +184,7 @@ TODO: - YM2203 some sound effects just don't sound correct - Audio Filter Switch not hooked up (might solve YM2203 mixing issue) - Ports 60,61,80,81 not fully understood yet... -- The four 8741 dumps come from an unprotected bootleg, we need dumps from +- Three 8741 dumps come from an unprotected bootleg, we need dumps from original boards. ***************************************************************************/ @@ -1048,7 +1049,7 @@ void gladiatr_state::gladiatr(machine_config &config) m_ucpu->t0_in_cb().set(FUNC(gladiatr_state::tclk_r)); m_ucpu->t1_in_cb().set(FUNC(gladiatr_state::ucpu_t1_r)); - I8741A(config, m_csnd, 12_MHz_XTAL/2); /* verified on pcb */ + I8742(config, m_csnd, 12_MHz_XTAL/2); /* verified on pcb */ m_csnd->p1_in_cb().set(FUNC(gladiatr_state::csnd_p1_r)); m_csnd->p1_out_cb().set(FUNC(gladiatr_state::csnd_p1_w)); m_csnd->p2_in_cb().set(FUNC(gladiatr_state::csnd_p2_r)); @@ -1096,6 +1097,18 @@ void gladiatr_state::gladiatr(machine_config &config) LS259(config, "filtlatch", 0); // 9R - filters on sound output } +void gladiatr_state::greatgur(machine_config &config) +{ + gladiatr(config); + + I8741A(config.replace(), m_csnd, 12_MHz_XTAL/2); /* verified on pcb */ + m_csnd->p1_in_cb().set(FUNC(gladiatr_state::csnd_p1_r)); + m_csnd->p1_out_cb().set(FUNC(gladiatr_state::csnd_p1_w)); + m_csnd->p2_in_cb().set(FUNC(gladiatr_state::csnd_p2_r)); + m_csnd->t0_in_cb().set(FUNC(gladiatr_state::tclk_r)); + m_csnd->t1_in_cb().set(FUNC(gladiatr_state::csnd_t1_r)); +} + /*************************************************************************** @@ -1196,8 +1209,8 @@ ROM_START( gladiatr ) ROM_REGION( 0x0400, "ucpu", 0 ) /* comms MCU */ ROM_LOAD( "aq_006.3a", 0x00000, 0x0400, CRC(3c5ca4c6) SHA1(0d8c2e1c2142ada11e30cfb9a48663386fee9cb8) BAD_DUMP ) - ROM_REGION( 0x0400, "csnd", 0 ) /* comms MCU */ - ROM_LOAD( "aq_006.6c", 0x00000, 0x0400, CRC(3c5ca4c6) SHA1(0d8c2e1c2142ada11e30cfb9a48663386fee9cb8) BAD_DUMP ) + ROM_REGION( 0x0800, "csnd", 0 ) /* comms MCU */ + ROM_LOAD( "aq_007.6c", 0x00000, 0x0800, CRC(f19af04d) SHA1(61105cb905128e5d10b2e97d6201034584eb1ada) ) ROM_END ROM_START( ogonsiro ) @@ -1251,8 +1264,8 @@ ROM_START( ogonsiro ) ROM_REGION( 0x0400, "ucpu", 0 ) /* comms MCU */ ROM_LOAD( "aq_006.3a", 0x00000, 0x0400, CRC(3c5ca4c6) SHA1(0d8c2e1c2142ada11e30cfb9a48663386fee9cb8) BAD_DUMP ) - ROM_REGION( 0x0400, "csnd", 0 ) /* comms MCU */ - ROM_LOAD( "aq_006.6c", 0x00000, 0x0400, CRC(3c5ca4c6) SHA1(0d8c2e1c2142ada11e30cfb9a48663386fee9cb8) BAD_DUMP ) + ROM_REGION( 0x0800, "csnd", 0 ) /* comms MCU */ + ROM_LOAD( "aq_007.6c", 0x00000, 0x0800, CRC(f19af04d) SHA1(61105cb905128e5d10b2e97d6201034584eb1ada) ) ROM_END ROM_START( greatgur ) @@ -1361,20 +1374,17 @@ ROM_START( gcastle ) ROM_REGION( 0x0400, "ucpu", 0 ) /* comms MCU */ ROM_LOAD( "aq_006.3a", 0x00000, 0x0400, CRC(3c5ca4c6) SHA1(0d8c2e1c2142ada11e30cfb9a48663386fee9cb8) BAD_DUMP ) - ROM_REGION( 0x0400, "csnd", 0 ) /* comms MCU */ - ROM_LOAD( "aq_006.6c", 0x00000, 0x0400, CRC(3c5ca4c6) SHA1(0d8c2e1c2142ada11e30cfb9a48663386fee9cb8) BAD_DUMP ) + ROM_REGION( 0x0800, "csnd", 0 ) /* comms MCU */ + ROM_LOAD( "aq_007.6c", 0x00000, 0x0800, CRC(f19af04d) SHA1(61105cb905128e5d10b2e97d6201034584eb1ada) ) ROM_END -void gladiatr_state::swap_block(u8 *src1,u8 *src2,int len) +void gladiatr_state::swap_block(u8 *src1, u8 *src2, int len) { - int i,t; - - for (i = 0;i < len;i++) + for (int i = 0; i < len; i++) { - t = src1[i]; - src1[i] = src2[i]; - src2[i] = t; + using std::swap; + swap(src1[i], src2[i]); } } @@ -1465,9 +1475,9 @@ void ppking_state::init_ppking() } - -GAME( 1985, ppking, 0, ppking, ppking, ppking_state, init_ppking, ROT90, "Taito America Corporation", "Ping-Pong King", MACHINE_IMPERFECT_SOUND | MACHINE_NO_COCKTAIL | MACHINE_NODEVICE_LAN ) -GAME( 1986, gladiatr, 0, gladiatr, gladiatr, gladiatr_state, init_gladiatr, ROT0, "Allumer / Taito America Corporation", "Gladiator (US)", MACHINE_SUPPORTS_SAVE ) -GAME( 1986, ogonsiro, gladiatr, gladiatr, gladiatr, gladiatr_state, init_gladiatr, ROT0, "Allumer / Taito Corporation", "Ougon no Shiro (Japan)", MACHINE_SUPPORTS_SAVE ) -GAME( 1986, greatgur, gladiatr, gladiatr, gladiatr, gladiatr_state, init_gladiatr, ROT0, "Allumer / Taito Corporation", "Great Gurianos (Japan?)", MACHINE_SUPPORTS_SAVE ) -GAME( 1986, gcastle, gladiatr, gladiatr, gladiatr, gladiatr_state, init_gladiatr, ROT0, "Allumer / Taito Corporation", "Golden Castle (prototype?)", MACHINE_SUPPORTS_SAVE ) // incomplete dump +// year name parent machine input class init rot company fullname flags +GAME( 1985, ppking, 0, ppking, ppking, ppking_state, init_ppking, ROT90, "Taito America Corporation", "Ping-Pong King", MACHINE_IMPERFECT_SOUND | MACHINE_NO_COCKTAIL | MACHINE_NODEVICE_LAN ) +GAME( 1986, gladiatr, 0, gladiatr, gladiatr, gladiatr_state, init_gladiatr, ROT0, "Allumer / Taito America Corporation", "Gladiator (US)", MACHINE_SUPPORTS_SAVE ) +GAME( 1986, ogonsiro, gladiatr, gladiatr, gladiatr, gladiatr_state, init_gladiatr, ROT0, "Allumer / Taito Corporation", "Ougon no Shiro (Japan)", MACHINE_SUPPORTS_SAVE ) +GAME( 1986, greatgur, gladiatr, greatgur, gladiatr, gladiatr_state, init_gladiatr, ROT0, "Allumer / Taito Corporation", "Great Gurianos (Japan?)", MACHINE_SUPPORTS_SAVE ) +GAME( 1986, gcastle, gladiatr, gladiatr, gladiatr, gladiatr_state, init_gladiatr, ROT0, "Allumer / Taito Corporation", "Golden Castle (prototype?)", MACHINE_SUPPORTS_SAVE ) // incomplete dump diff --git a/src/mame/drivers/h8.cpp b/src/mame/drivers/h8.cpp index bb2c3279643..cc095a80499 100644 --- a/src/mame/drivers/h8.cpp +++ b/src/mame/drivers/h8.cpp @@ -67,13 +67,22 @@ public: , m_uart(*this, "uart") , m_cass(*this, "cassette") , m_beep(*this, "beeper") + , m_io_keyboard(*this, "X%u", 0U) , m_digits(*this, "digit%u", 0U) + , m_mon_led(*this, "mon_led") + , m_pwr_led(*this, "pwr_led") + , m_ion_led(*this, "ion_led") + , m_run_led(*this, "run_led") { } void h8(machine_config &config); DECLARE_INPUT_CHANGED_MEMBER(button_0); +protected: + virtual void machine_reset() override; + virtual void machine_start() override; + private: u8 portf0_r(); void portf0_w(u8 data); @@ -94,13 +103,17 @@ private: u8 m_cass_data[4]; bool m_cassbit; bool m_cassold; - virtual void machine_reset() override; - virtual void machine_start() override; + required_device<i8080_cpu_device> m_maincpu; required_device<i8251_device> m_uart; required_device<cassette_image_device> m_cass; required_device<beep_device> m_beep; + required_ioport_array<2> m_io_keyboard; output_finder<16> m_digits; + output_finder<> m_mon_led; + output_finder<> m_pwr_led; + output_finder<> m_ion_led; + output_finder<> m_run_led; }; @@ -125,7 +138,7 @@ u8 h8_state::portf0_r() u8 i,keyin,data = 0xff; - keyin = ioport("X0")->read(); + keyin = m_io_keyboard[0]->read(); if (keyin != 0xff) { for (i = 1; i < 8; i++) @@ -134,7 +147,7 @@ u8 h8_state::portf0_r() data &= 0xfe; } - keyin = ioport("X1")->read(); + keyin = m_io_keyboard[1]->read(); if (keyin != 0xff) { for (i = 1; i < 8; i++) @@ -157,7 +170,7 @@ void h8_state::portf0_w(u8 data) m_digit = data & 15; if (m_digit) m_digits[m_digit] = m_segment; - output().set_value("mon_led", !BIT(data, 5)); + m_mon_led = !BIT(data, 5); m_beep->set_state(!BIT(data, 7)); m_maincpu->set_input_line(INPUT_LINE_IRQ0, CLEAR_LINE); @@ -228,7 +241,7 @@ INPUT_CHANGED_MEMBER(h8_state::button_0) { if (newval) { - u8 data = ioport("X1")->read() ^ 0xff; + u8 data = m_io_keyboard[1]->read() ^ 0xff; if (BIT(data, 5)) m_maincpu->reset(); else @@ -239,7 +252,7 @@ INPUT_CHANGED_MEMBER(h8_state::button_0) void h8_state::machine_reset() { - output().set_value("pwr_led", 0); + m_pwr_led = 0; m_irq_ctl = 1; m_cassbit = 1; m_cass_data[0] = 0; @@ -254,6 +267,10 @@ void h8_state::machine_reset() void h8_state::machine_start() { m_digits.resolve(); + m_mon_led.resolve(); + m_pwr_led.resolve(); + m_ion_led.resolve(); + m_run_led.resolve(); save_item(NAME(m_digit)); save_item(NAME(m_segment)); @@ -266,8 +283,8 @@ void h8_state::machine_start() WRITE_LINE_MEMBER( h8_state::h8_inte_callback ) { - // operate the ION LED - output().set_value("ion_led", !state); + // operate the ION LED + m_ion_led = !state; m_irq_ctl &= 0x7f | ((state) ? 0 : 0x80); } @@ -298,8 +315,8 @@ But, all of this can only occur if bit 4 of port F0 is low. */ } - // operate the RUN LED - output().set_value("run_led", state); + // operate the RUN LED + m_run_led = state; } TIMER_DEVICE_CALLBACK_MEMBER(h8_state::kansas_w) diff --git a/src/mame/drivers/hh_tms1k.cpp b/src/mame/drivers/hh_tms1k.cpp index 3219fa5234b..7d24a5e37ef 100644 --- a/src/mame/drivers/hh_tms1k.cpp +++ b/src/mame/drivers/hh_tms1k.cpp @@ -811,15 +811,35 @@ class bcheetah_state : public hh_tms1k_state { public: bcheetah_state(const machine_config &mconfig, device_type type, const char *tag) : - hh_tms1k_state(mconfig, type, tag) + hh_tms1k_state(mconfig, type, tag), + m_motor1(*this, "motor1"), + m_motor2_left(*this, "motor2_left"), + m_motor2_right(*this, "motor2_right") { } + void bcheetah(machine_config &config); + +protected: + virtual void machine_start() override; + +private: void write_r(u16 data); void write_o(u16 data); u8 read_k(); - void bcheetah(machine_config &config); + + output_finder<> m_motor1; + output_finder<> m_motor2_left; + output_finder<> m_motor2_right; }; +void bcheetah_state::machine_start() +{ + hh_tms1k_state::machine_start(); + m_motor1.resolve(); + m_motor2_left.resolve(); + m_motor2_right.resolve(); +} + // handlers void bcheetah_state::write_r(u16 data) @@ -835,9 +855,9 @@ void bcheetah_state::write_o(u16 data) // O0: front motor steer left // O2: front motor steer right // O3: GND, other: N/C - output().set_value("motor1", data >> 1 & 1); - output().set_value("motor2_left", data & 1); - output().set_value("motor2_right", data >> 2 & 1); + m_motor1 = data >> 1 & 1; + m_motor2_left = data & 1; + m_motor2_right = data >> 2 & 1; } u8 bcheetah_state::read_k() @@ -7315,9 +7335,20 @@ class bigtrak_state : public hh_tms1k_state { public: bigtrak_state(const machine_config &mconfig, device_type type, const char *tag) : - hh_tms1k_state(mconfig, type, tag) + hh_tms1k_state(mconfig, type, tag), + m_left_motor_forward(*this, "left_motor_forward"), + m_left_motor_reverse(*this, "left_motor_reverse"), + m_right_motor_forward(*this, "right_motor_forward"), + m_right_motor_reverse(*this, "right_motor_reverse"), + m_ext_out(*this, "ext_out") { } + void bigtrak(machine_config &config); + +protected: + virtual void machine_start() override; + +private: void write_r(u16 data); void write_o(u16 data); u8 read_k(); @@ -7325,16 +7356,24 @@ public: int m_gearbox_pos; bool sensor_state() { return m_gearbox_pos < 0 && m_display->element_on(0, 0); } TIMER_DEVICE_CALLBACK_MEMBER(gearbox_sim_tick); - void bigtrak(machine_config &config); -protected: - virtual void machine_start() override; + output_finder<> m_left_motor_forward; + output_finder<> m_left_motor_reverse; + output_finder<> m_right_motor_forward; + output_finder<> m_right_motor_reverse; + output_finder<> m_ext_out; }; void bigtrak_state::machine_start() { hh_tms1k_state::machine_start(); + m_left_motor_forward.resolve(); + m_left_motor_reverse.resolve(); + m_right_motor_forward.resolve(); + m_right_motor_reverse.resolve(); + m_ext_out.resolve(); + // zerofill/register for savestates m_gearbox_pos = 0; save_item(NAME(m_gearbox_pos)); @@ -7377,11 +7416,11 @@ void bigtrak_state::write_o(u16 data) // O4: right motor reverse // O5: ext out // O6: N/C - output().set_value("left_motor_forward", data >> 1 & 1); - output().set_value("left_motor_reverse", data >> 2 & 1); - output().set_value("right_motor_forward", data >> 3 & 1); - output().set_value("right_motor_reverse", data >> 4 & 1); - output().set_value("ext_out", data >> 5 & 1); + m_left_motor_forward = data >> 1 & 1; + m_left_motor_reverse = data >> 2 & 1; + m_right_motor_forward = data >> 3 & 1; + m_right_motor_reverse = data >> 4 & 1; + m_ext_out = data >> 5 & 1; // O0,O7(,R10)(tied together): speaker out m_speaker->level_w((data & 1) | (data >> 6 & 2) | (m_r >> 8 & 4)); @@ -7513,12 +7552,25 @@ class mbdtower_state : public hh_tms1k_state { public: mbdtower_state(const machine_config &mconfig, device_type type, const char *tag) : - hh_tms1k_state(mconfig, type, tag) + hh_tms1k_state(mconfig, type, tag), + m_motor_pos_out(*this, "motor_pos"), + m_card_pos_out(*this, "card_pos"), + m_motor_on_out(*this, "motor_on") { } + void mbdtower(machine_config &config); + +protected: + virtual void machine_start() override; + +private: void update_display(); bool sensor_led_on() { return m_display->element_on(0, 0); } + output_finder<> m_motor_pos_out; + output_finder<> m_card_pos_out; + output_finder<> m_motor_on_out; + int m_motor_pos; int m_motor_pos_prev; int m_motor_decay; @@ -7530,16 +7582,16 @@ public: void write_r(u16 data); void write_o(u16 data); u8 read_k(); - void mbdtower(machine_config &config); - -protected: - virtual void machine_start() override; }; void mbdtower_state::machine_start() { hh_tms1k_state::machine_start(); + m_motor_pos_out.resolve(); + m_card_pos_out.resolve(); + m_motor_on_out.resolve(); + // zerofill m_motor_pos = 0; m_motor_pos_prev = -1; @@ -7582,7 +7634,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(mbdtower_state::motor_sim_tick) // on change, output info if (m_motor_pos != m_motor_pos_prev) - output().set_value("motor_pos", 100 * (m_motor_pos / (float)0x80)); + m_motor_pos_out = 100 * (m_motor_pos / (float)0x80); /* 3 display cards per hole, like this: @@ -7594,7 +7646,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(mbdtower_state::motor_sim_tick) */ int card_pos = m_motor_pos >> 4 & 7; if (card_pos != (m_motor_pos_prev >> 4 & 7)) - output().set_value("card_pos", card_pos); + m_card_pos_out = card_pos; m_motor_pos_prev = m_motor_pos; } @@ -7625,7 +7677,7 @@ void mbdtower_state::write_r(u16 data) // R9: motor on if ((m_r ^ data) & 0x200) - output().set_value("motor_on", data >> 9 & 1); + m_motor_on_out = data >> 9 & 1; if (data & 0x200) m_motor_on = true; diff --git a/src/mame/drivers/holeland.cpp b/src/mame/drivers/holeland.cpp index 3fb26e8d4a3..5f78055e13c 100644 --- a/src/mame/drivers/holeland.cpp +++ b/src/mame/drivers/holeland.cpp @@ -571,22 +571,22 @@ ROM_START( crzrallyrf ) ROM_LOAD( "crzrallyrf_8.1k", 0x4000, 0x2000, CRC(2a0d5bca) SHA1(8d7aedd63ea374a5809c24f957b0afa3cad437d0) ) ROM_LOAD( "crzrallyrf_9.1i", 0x6000, 0x2000, CRC(49c0c2b8) SHA1(30c4fe1dc2df499927f8fd4a041a707b81a04e1d) ) - /* Not dumped on the Refreativos Franco PCB, taken from the parent set */ + // Not dumped on the Recreativos Franco PCB, taken from the parent set ROM_REGION( 0x0300, "proms", 0 ) - ROM_LOAD( "82s129.9n", 0x0000, 0x0100, CRC(98ff725a) SHA1(553f033212a7c4785c0beb8156400cabcd53cf25) ) /* Red component */ - ROM_LOAD( "82s129.9m", 0x0100, 0x0100, CRC(d41f5800) SHA1(446046f5694357da876e1307f49584d79c8d9a1a) ) /* Green component */ - ROM_LOAD( "82s129.9l", 0x0200, 0x0100, CRC(9ed49cb4) SHA1(f54e66e2211d5fb0da9a81e11670367ee4d9b49a) ) /* Blue component */ + ROM_LOAD( "82s129.9n", 0x0000, 0x0100, CRC(98ff725a) SHA1(553f033212a7c4785c0beb8156400cabcd53cf25) ) // Red component + ROM_LOAD( "82s129.9m", 0x0100, 0x0100, CRC(d41f5800) SHA1(446046f5694357da876e1307f49584d79c8d9a1a) ) // Green component + ROM_LOAD( "82s129.9l", 0x0200, 0x0100, CRC(9ed49cb4) SHA1(f54e66e2211d5fb0da9a81e11670367ee4d9b49a) ) // Blue component - /* Not dumped on the Refreativos Franco PCB, taken from the parent set */ + // Not dumped on the Recreativos Franco PCB, taken from the parent set ROM_REGION( 0x0200, "user1", 0 ) // unknown ROM_LOAD( "82s147.1f", 0x0000, 0x0200, CRC(5261bc11) SHA1(1cc7a9a7376e65f4587b75ef9382049458656372) ) - /* Not dumped on the Refreativos Franco PCB, taken from the parent set */ + // Not dumped on the Recreativos Franco PCB, taken from the parent set ROM_REGION( 0x0800, "plds", 0 ) ROM_LOAD( "pal16r6a.5k", 0x0000, 0x0104, CRC(3d12afba) SHA1(60245089947e4a4f7bfa94a8cc96d4d8eebe4afc) ) - ROM_LOAD( "pal16r4a.5l", 0x0200, 0x0104, NO_DUMP ) /* PAL is read protected */ - ROM_LOAD( "pal16r4a.5m", 0x0400, 0x0104, NO_DUMP ) /* PAL is read protected */ - ROM_LOAD( "pal16r8a.1d", 0x0600, 0x0104, NO_DUMP ) /* PAL is read protected */ + ROM_LOAD( "pal16r4a.5l", 0x0200, 0x0104, NO_DUMP ) // PAL is read protected + ROM_LOAD( "pal16r4a.5m", 0x0400, 0x0104, NO_DUMP ) // PAL is read protected + ROM_LOAD( "pal16r8a.1d", 0x0600, 0x0104, NO_DUMP ) // PAL is read protected ROM_END GAME( 1984, holeland, 0, holeland, holeland, holeland_state, empty_init, ROT0, "Tecfri", "Hole Land (Japan)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/hp9845.cpp b/src/mame/drivers/hp9845.cpp index 400aeb02133..935da2f459c 100644 --- a/src/mame/drivers/hp9845.cpp +++ b/src/mame/drivers/hp9845.cpp @@ -200,8 +200,8 @@ constexpr unsigned LP_XOFFSET = 5; // x-offset of LP (due to delay in hit recog class hp9845_state : public driver_device { public: - hp9845_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag) + hp9845_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) { } void hp9845a(machine_config &config); @@ -428,6 +428,9 @@ hp9845_base_state::hp9845_base_state(const machine_config &mconfig, device_type m_io_slot(*this, "slot%u", 0U), m_ram(*this, RAM_TAG), m_softkeys(*this, "Softkey%u", 0U), + m_shift_lock_led(*this, "shift_lock_led"), + m_prt_all_led(*this, "prt_all_led"), + m_auto_st_led(*this, "auto_st_led"), m_chargen(*this, "chargen") { } @@ -442,6 +445,10 @@ void hp9845_base_state::setup_ram_block(unsigned block , unsigned offset) void hp9845_base_state::machine_start() { m_softkeys.resolve(); + m_shift_lock_led.resolve(); + m_prt_all_led.resolve(); + m_auto_st_led.resolve(); + m_screen->register_screen_bitmap(m_bitmap); // setup RAM dynamically for -ramsize @@ -719,21 +726,21 @@ INPUT_CHANGED_MEMBER(hp9845_base_state::togglekey_changed) { bool state = m_io_shiftlock->read(); popmessage("SHIFT LOCK %s", state ? "ON" : "OFF"); - output().set_value("shift_lock_led" , state); + m_shift_lock_led = state; } break; case 1: // Prt all { bool state = BIT(m_io_key[0]->read(), 1); popmessage("PRT ALL %s", state ? "ON" : "OFF"); - output().set_value("prt_all_led" , state); + m_prt_all_led = state; } break; case 2: // Auto st { bool state = BIT(m_io_key[0]->read(), 17); popmessage("AUTO ST %s", state ? "ON" : "OFF"); - output().set_value("auto_st_led" , state); + m_auto_st_led = state; } break; } diff --git a/src/mame/drivers/ibm6580.cpp b/src/mame/drivers/ibm6580.cpp index 26ae14be877..b8912a37383 100644 --- a/src/mame/drivers/ibm6580.cpp +++ b/src/mame/drivers/ibm6580.cpp @@ -144,13 +144,19 @@ public: , m_screen(*this, "screen") , m_kbd(*this, "kbd") , m_fdc(*this, UPD765_TAG) - , m_flop0(*this, UPD765_TAG ":0") - , m_flop1(*this, UPD765_TAG ":1") + , m_flop(*this, UPD765_TAG ":%u", 0U) , m_p_chargen(*this, "chargen") + , m_io_dump(*this, "DUMP") + , m_leds(*this, "led%u", 5U) { } void ibm6580(machine_config &config); +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; + private: void pic_latch_w(uint16_t data); void unk_latch_w(uint16_t data); @@ -185,10 +191,6 @@ private: void ibm6580_io(address_map &map); void ibm6580_mem(address_map &map); - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void video_start() override; - uint8_t m_p40, m_p50, m_e000, m_kb_data, m_ppi_c; bool m_kb_data_bit, m_kb_strobe; util::fifo<uint8_t, 4> m_kb_fifo; @@ -213,9 +215,10 @@ private: required_device<screen_device> m_screen; required_device<dw_keyboard_device> m_kbd; required_device<upd765a_device> m_fdc; - required_device<floppy_connector> m_flop0; - required_device<floppy_connector> m_flop1; + required_device_array<floppy_connector, 2> m_flop; required_region_ptr<u8> m_p_chargen; + required_ioport m_io_dump; + output_finder<4> m_leds; }; @@ -326,7 +329,7 @@ WRITE_LINE_MEMBER(ibm6580_state::vblank_w) // if (state) // m_pic8259->ir6_w(state); - if (ioport("DUMP")->read()) + if (m_io_dump->read()) m_p40 |= 4; } @@ -356,10 +359,8 @@ void ibm6580_state::unk_latch_w(uint16_t data) void ibm6580_state::led_w(uint8_t data) { - output().set_value("led5", BIT(data, 7)); - output().set_value("led6", BIT(data, 6)); - output().set_value("led7", BIT(data, 5)); - output().set_value("led8", BIT(data, 4)); + for (int i = 0; i < 4; i++) + m_leds[i] = BIT(data, 7 - i); if (data & 0xf) return; @@ -533,8 +534,8 @@ uint8_t ibm6580_state::floppy_mcu_command() // 1 byte -- get status? case 5: m_floppy_mcu_sr.enqueue(0x00); - if (m_flop0->get_device()->exists()) - m_floppy_mcu_sr.enqueue( m_flop0->get_device()->idx_r() ? 0x08 : 0); + if (m_flop[0]->get_device()->exists()) + m_floppy_mcu_sr.enqueue( m_flop[0]->get_device()->idx_r() ? 0x08 : 0); else m_floppy_mcu_sr.enqueue(0x08); break; @@ -564,10 +565,10 @@ uint8_t ibm6580_state::floppy_mcu_command() case 0xd: m_floppy_mcu_sr.enqueue(0x00); i = 0; - if (m_flop0->get_device()->exists()) - i |= m_flop0->get_device()->ready_r() ? 0 : 0x40; - if (m_flop1->get_device()->exists()) - i |= m_flop1->get_device()->ready_r() ? 0 : 0x80; + if (m_flop[0]->get_device()->exists()) + i |= m_flop[0]->get_device()->ready_r() ? 0 : 0x40; + if (m_flop[1]->get_device()->exists()) + i |= m_flop[1]->get_device()->ready_r() ? 0 : 0x80; m_floppy_mcu_sr.enqueue(i); break; @@ -577,9 +578,9 @@ uint8_t ibm6580_state::floppy_mcu_command() i = m_floppy_mcu_cr.dequeue(); #if 1 if (i & 1) - m_fdc->set_floppy(m_flop0->get_device()); + m_fdc->set_floppy(m_flop[0]->get_device()); else if (i & 2) - m_fdc->set_floppy(m_flop1->get_device()); + m_fdc->set_floppy(m_flop[1]->get_device()); #endif break; @@ -659,7 +660,7 @@ uint8_t ibm6580_state::floppy_r(offs_t offset) if (offset) LOG("Floppy %02x == %02x\n", 0x8150 + (offset << 1), data); else { - floppy_image_device *f = m_flop0->get_device(); + floppy_image_device *f = m_flop[0]->get_device(); if (f) LOG("Floppy %02x == %02x (empty %d hdl %d + idle %d irq %d drq %d + dskchg %d idx %d cyl %d)\n", @@ -832,6 +833,8 @@ void ibm6580_state::machine_start() membank("bank10")->set_base(m_ram->pointer()); m_fdc->set_rate(500000); // XXX workaround + + m_leds.resolve(); } void ibm6580_state::machine_reset() @@ -843,12 +846,12 @@ void ibm6580_state::machine_reset() m_pit8253->set_clockin(0, 0.0); - if (ioport("DUMP")->read()) + if (m_io_dump->read()) m_p40 |= 4; - m_flop0->get_device()->mon_w(!m_flop0->get_device()->exists()); - m_flop1->get_device()->mon_w(!m_flop1->get_device()->exists()); - m_fdc->set_floppy(m_flop0->get_device()); + m_flop[0]->get_device()->mon_w(!m_flop[0]->get_device()->exists()); + m_flop[1]->get_device()->mon_w(!m_flop[1]->get_device()->exists()); + m_fdc->set_floppy(m_flop[0]->get_device()); m_floppy_mcu_sr.clear(); m_floppy_mcu_cr.clear(); m_floppy_mcu_cr_fifo = 0; diff --git a/src/mame/drivers/igs017.cpp b/src/mame/drivers/igs017.cpp index 5e3fe848760..5822ac80966 100644 --- a/src/mame/drivers/igs017.cpp +++ b/src/mame/drivers/igs017.cpp @@ -519,8 +519,9 @@ public: void init_unkigs(); protected: - virtual void video_start() override; + virtual void machine_start() override; virtual void machine_reset() override; + virtual void video_start() override; private: int m_remap_addr; @@ -643,6 +644,24 @@ private: void tjsb_map(address_map &map); }; +void igs017_state::machine_start() +{ + save_item(NAME(m_remap_addr)); + save_item(NAME(m_input_select)); + save_item(NAME(m_hopper)); + save_item(NAME(m_igs_magic)); + save_item(NAME(m_scramble_data)); + save_item(NAME(m_dsw_select)); + save_item(NAME(m_i8255_portc_mux)); + save_item(NAME(m_igs029_send_data)); + save_item(NAME(m_igs029_recv_data)); + save_item(NAME(m_igs029_send_buf)); + save_item(NAME(m_igs029_recv_buf)); + save_item(NAME(m_igs029_send_len)); + save_item(NAME(m_igs029_recv_len)); + save_item(NAME(m_igs029_mgcs_long)); +} + void igs017_state::machine_reset() { m_igs029_send_len = m_igs029_recv_len = 0; @@ -1024,7 +1043,7 @@ void igs017_state::starzan_decrypt_program_rom() void igs017_state::init_starzan() { starzan_decrypt_program_rom(); - // starzan_decrypt_tiles(); // to do when dumped + tarzan_decrypt_tiles(); mgcs_flip_sprites(); // ? } @@ -4929,15 +4948,15 @@ ROM_START( starzan ) ROM_REGION( 0x40000, "maincpu", 0 ) ROM_LOAD( "v100i.u9", 0x00000, 0x40000, CRC(64180bff) SHA1(b08dbe8a17ca33024442ebee41f111c8f98a2109) ) - ROM_REGION( 0x100000, "igs017_igs031:sprites", 0 ) - ROM_LOAD( "cg.u2", 0x00000, 0x80000, CRC(884f95f5) SHA1(2e526aa966e90dc696a8b392a5a99e14f03c4bd4) ) // FIXED BITS (xxxxxxx0xxxxxxxx) - ROM_LOAD( "t2105_cg_v110.u11", 0x80000, 0x80000, NO_DUMP ) + ROM_REGION( 0x400000, "igs017_igs031:sprites", ROMREGION_ERASEFF ) + ROM_LOAD( "c0057209.u3", 0x00000, 0x400000, NO_DUMP ) // this is also probably the same as tarzanc. Current theory is the 0x400000 mask ROM at u3 is the same for all games of the same type, with EPROM at u2 providing an overlay for game specific sprites + ROM_LOAD( "cg.u2", 0x00000, 0x080000, CRC(884f95f5) SHA1(2e526aa966e90dc696a8b392a5a99e14f03c4bd4) ) // FIXED BITS (xxxxxxx0xxxxxxxx) ROM_REGION( 0x80000, "igs017_igs031:tilemaps", 0 ) - ROM_LOAD( "c0057209.u3", 0x00000, 0x80000, NO_DUMP ) + ROM_LOAD( "t2105_cg_v110.u11", 0x00000, 0x80000, BAD_DUMP CRC(1d4be260) SHA1(6374c61735144b3ff54d5e490f26adac4a10b14d) ) // not dumped for this board, but same label as the one from tarzanc, assuming same contents for now - ROM_REGION( 0x80000, "oki", ROMREGION_ERASE ) - ROM_LOAD( "s2102_sp_v102.u8", 0x00000, 0x80000, NO_DUMP ) + ROM_REGION( 0x80000, "oki", 0 ) + ROM_LOAD( "s2102_sp_v102.u8", 0x00000, 0x80000, BAD_DUMP CRC(90dda82d) SHA1(67fbc1e8d76b85e124136e2f1df09c8b6c5a8f97) ) // not dumped for this board, but same label as the one from tarzanc, assuming same contents for now ROM_REGION( 0x2dd * 2, "plds", 0 ) ROM_LOAD( "palce22v10h_tar97_u10-1.u10", 0x000, 0x2dd, NO_DUMP ) @@ -4955,9 +4974,9 @@ ROM_START( happyskl ) ROM_REGION( 0x40000, "maincpu", 0 ) ROM_LOAD( "v611.u8", 0x00000, 0x40000, CRC(1fb3da98) SHA1(60674af9f5c53298b8ef856f1986c905b9bd7b96) ) - ROM_REGION( 0x480000, "igs017_igs031:sprites", 0 ) + ROM_REGION( 0x400000, "igs017_igs031:sprites", 0 ) + ROM_LOAD( "igs_a2701_cg_v100.u3", 0x00000, 0x400000, CRC(f3756a51) SHA1(8dd4677584f309cec4b068be9f9370a7a172a031) ) // FIXED BITS (xxxxxxx0xxxxxxxx) - 1xxxxxxxxxxxxxxxxxxxxx = 0x00 ROM_LOAD( "happyskill_cg.u2", 0x00000, 0x080000, CRC(297a1893) SHA1(9be9e2cdaba1615ea376f3fb7087bf990e68b3b4) ) // FIXED BITS (xxxxxxx0xxxxxxxx) - ROM_LOAD( "igs_a2701_cg_v100.u3", 0x80000, 0x400000, CRC(f3756a51) SHA1(8dd4677584f309cec4b068be9f9370a7a172a031) ) // FIXED BITS (xxxxxxx0xxxxxxxx) - 1xxxxxxxxxxxxxxxxxxxxx = 0x00 ROM_REGION( 0x80000, "igs017_igs031:tilemaps", 0 ) ROM_LOAD( "happyskill_text.u11", 0x00000, 0x80000, CRC(c6f51041) SHA1(81a9a03e92c1c67f299113dec9e05ba77395ea31) ) @@ -4976,12 +4995,12 @@ ROM_START( unkigs ) ROM_REGION( 0x40000, "maincpu", 0 ) ROM_LOAD( "u9.bin", 0x00000, 0x40000, CRC(8d79eb4d) SHA1(9cad09013f83335ec78c3ff78715bc5d9a989eb7) ) - ROM_REGION( 0x480000, "igs017_igs031:sprites", ROMREGION_ERASE ) - ROM_LOAD( "u2", 0x00000, 0x080000, NO_DUMP ) // not populated. Never there or removed (more probable)? + ROM_REGION( 0x400000, "igs017_igs031:sprites", 0 ) // the following ROM wasn't readable on this PCB, but it's the same as the one in happyskl. Assuming same contents for now - ROM_LOAD( "igs_a2701_cg_v100.u3", 0x80000, 0x400000, BAD_DUMP CRC(f3756a51) SHA1(8dd4677584f309cec4b068be9f9370a7a172a031) ) // FIXED BITS (xxxxxxx0xxxxxxxx) - 1xxxxxxxxxxxxxxxxxxxxx = 0x00 + ROM_LOAD( "igs_a2701_cg_v100.u3", 0x00000, 0x400000, BAD_DUMP CRC(f3756a51) SHA1(8dd4677584f309cec4b068be9f9370a7a172a031) ) // FIXED BITS (xxxxxxx0xxxxxxxx) - 1xxxxxxxxxxxxxxxxxxxxx = 0x00 + //ROM_LOAD( "u2", 0x00000, 0x080000, NO_DUMP ) // not populated. Never there or removed? Possibly never there, current theory is the 0x400000 mask ROM at u3 is the same for all games of the same type, with EPROM at u2 providing an overlay for game specific sprites - ROM_REGION( 0x40000, "igs017_igs031:tilemaps", ROMREGION_ERASEFF ) + ROM_REGION( 0x40000, "igs017_igs031:tilemaps", 0 ) ROM_LOAD( "u11.bin", 0x00000, 0x40000, CRC(34475c83) SHA1(376ff68d89c25471483b074dcf7542f42f954e67) ) ROM_IGNORE(0x040000) // 1xxxxxxxxxxxxxxxxxx = 0x00 diff --git a/src/mame/drivers/instruct.cpp b/src/mame/drivers/instruct.cpp index 9d57c095809..b2cdf2686e5 100644 --- a/src/mame/drivers/instruct.cpp +++ b/src/mame/drivers/instruct.cpp @@ -2,7 +2,7 @@ // copyright-holders:Robbbert /*************************************************************************** -Signetics Intructor 50 +Signetics Instructor 50 2010-04-08 Skeleton driver. 2012-05-20 Connected digits, system boots. [Robbbert] @@ -69,12 +69,16 @@ public: , m_cass(*this, "cassette") , m_display(*this, "display") , m_io_keyboard(*this, "X%u", 0U) + , m_leds(*this, "led%u", 0U) { } void instruct(machine_config &config); -private: +protected: + virtual void machine_reset() override; + virtual void machine_start() override; +private: uint8_t port_r(); uint8_t portfc_r(); uint8_t portfd_r(); @@ -91,8 +95,6 @@ private: void io_map(address_map &map); void mem_map(address_map &map); - void machine_reset() override; - void machine_start() override; uint16_t m_lar; uint8_t m_digit; u8 m_seg; @@ -105,23 +107,20 @@ private: required_device<cassette_image_device> m_cass; required_device<pwm_display_device> m_display; required_ioport_array<6> m_io_keyboard; + output_finder<9> m_leds; }; // flag led WRITE_LINE_MEMBER( instruct_state::flag_w ) { - output().set_value("led8", !state); + m_leds[8] = !state; } // user port void instruct_state::port_w(uint8_t data) { - char ledname[8]; for (int i = 0; i < 8; i++) - { - sprintf(ledname,"led%d",i); - output().set_value(ledname, !BIT(data, i)); - } + m_leds[i] = !BIT(data, i); } // cassette port @@ -339,6 +338,8 @@ void instruct_state::machine_reset() void instruct_state::machine_start() { + m_leds.resolve(); + save_item(NAME(m_lar)); save_item(NAME(m_digit)); save_item(NAME(m_seg)); diff --git a/src/mame/drivers/jungleyo.cpp b/src/mame/drivers/jungleyo.cpp index dc8967d320a..9cc0952226a 100644 --- a/src/mame/drivers/jungleyo.cpp +++ b/src/mame/drivers/jungleyo.cpp @@ -56,11 +56,13 @@ public: void jungleyo(machine_config &config); + void init_jungleyo(); + protected: virtual void video_start() override; private: - /* video-related */ + // video-related uint32_t screen_update_jungleyo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void jungleyo_map(address_map &map); @@ -148,11 +150,11 @@ void jungleyo_state::jungleyo(machine_config &config) ROM_START( jungleyo ) - ROM_REGION( 0x40000, "maincpu", 0 ) /* 68000 Code */ // encrypted? + ROM_REGION( 0x40000, "maincpu", 0 ) // 68000 code, encrypted ROM_LOAD16_BYTE( "jungle_=record=_rom3_vi3.02.u15", 0x00001, 0x20000, CRC(7c9f431e) SHA1(fb3f90c4fe59c938f36b30c5fa3af227031e7d7a) ) ROM_LOAD16_BYTE( "jungle_=record=_rom2_vi3.02.u14", 0x00000, 0x20000, CRC(f6a71260) SHA1(8e48cbb9d701ad968540244396820359afe97c28) ) - ROM_REGION( 0x040000, "oki", 0 ) /* Samples */ + ROM_REGION( 0x040000, "oki", 0 ) ROM_LOAD( "jungle_rom1.u99", 0x00000, 0x40000, CRC(05ef5b85) SHA1(ca7584646271c6adc7880eca5cf43a412340c522) ) ROM_REGION( 0x80000, "reelgfx", 0 ) @@ -166,4 +168,22 @@ ROM_START( jungleyo ) ROM_END -GAME( 1999, jungleyo, 0, jungleyo, jungleyo, jungleyo_state, empty_init, ROT0, "Yonshi", "Jungle (VI3.02)", MACHINE_NOT_WORKING ) +void jungleyo_state::init_jungleyo() // TODO: just a start, gives correct (?) strings at 0x2000-0x2fff, 0x7000-0x9000 and 0xc000-0xd000 ranges. From 0x10000 onwards needs something different +{ + uint16_t *src = (uint16_t *)memregion("maincpu")->base(); + + for (int i = 0x00000; i < 0x40000 / 2; i++) + src[i] = bitswap<16>(src[i] ^ 0xff00, 14, 12, 10, 15, 11, 8, 9, 13, 0, 2, 7, 3, 1, 6, 4, 5); // TODO: possibly the bitswap and XOR are applied per byte and not per word, verify when more is discovered + + /*char filename[256]; + sprintf(filename,"p_decrypted_%s", machine().system().name); + FILE *fp = fopen(filename, "w+b"); + if (fp) + { + fwrite(src, 0x40000, 1, fp); + fclose(fp); + }*/ +} + + +GAME( 1999, jungleyo, 0, jungleyo, jungleyo, jungleyo_state, init_jungleyo, ROT0, "Yonshi", "Jungle (VI3.02)", MACHINE_NOT_WORKING ) // version 3.02 built on 2001/02/09, there's copyright both for Yonshi and Global in strings diff --git a/src/mame/drivers/kdt6.cpp b/src/mame/drivers/kdt6.cpp index 5cb6a5b28cb..0c041655103 100644 --- a/src/mame/drivers/kdt6.cpp +++ b/src/mame/drivers/kdt6.cpp @@ -54,14 +54,14 @@ public: m_gfx(*this, "gfx"), m_rtc(*this, "rtc"), m_fdc(*this, "fdc"), - m_floppy0(*this, "fdc:0"), - m_floppy1(*this, "fdc:1"), + m_floppy(*this, "fdc:%u", 0U), m_beeper(*this, "beeper"), m_beep_timer(*this, "beep_timer"), m_centronics(*this, "centronics"), m_dip_s2(*this, "S2"), m_keyboard(*this, "kbd"), m_rs232b(*this, "rs232b"), + m_drive_led(*this, "drive%u_led", 0U), m_sasi_dma(false), m_dma_map(0), m_status0(0), m_status1(0), m_status2(0), @@ -70,6 +70,10 @@ public: void psi98(machine_config &config); +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + private: DECLARE_WRITE_LINE_MEMBER(busreq_w); uint8_t memory_r(offs_t offset); @@ -113,9 +117,6 @@ private: void psi98_io(address_map &map); void psi98_mem(address_map &map); - virtual void machine_start() override; - virtual void machine_reset() override; - required_device<z80_device> m_cpu; required_device<z80dma_device> m_dma; required_device<z80sio_device> m_sio; @@ -126,14 +127,14 @@ private: required_region_ptr<u8> m_gfx; required_device<upd1990a_device> m_rtc; required_device<upd765a_device> m_fdc; - required_device<floppy_connector> m_floppy0; - required_device<floppy_connector> m_floppy1; + required_device_array<floppy_connector, 2> m_floppy; required_device<beep_device> m_beeper; required_device<timer_device> m_beep_timer; required_device<centronics_device> m_centronics; required_ioport m_dip_s2; required_device<psi_keyboard_bus_device> m_keyboard; required_device<rs232_port_device> m_rs232b; + output_finder<2> m_drive_led; std::unique_ptr<uint8_t[]> m_ram; std::unique_ptr<uint16_t[]> m_vram; // 10-bit @@ -244,12 +245,12 @@ WRITE_LINE_MEMBER( kdt6_state::fdc_drq_w ) void kdt6_state::drive0_led_cb(floppy_image_device *floppy, int state) { - machine().output().set_value("drive0_led", state); + m_drive_led[0] = state; } void kdt6_state::drive1_led_cb(floppy_image_device *floppy, int state) { - machine().output().set_value("drive1_led", state); + m_drive_led[1] = state; } @@ -498,10 +499,9 @@ void kdt6_state::status0_w(uint8_t data) m_beep_timer->adjust(attotime::from_msec(250)); // timing unknown } - if (m_floppy0->get_device()) - m_floppy0->get_device()->mon_w(BIT(data, 7) ? 0 : 1); - if (m_floppy1->get_device()) - m_floppy1->get_device()->mon_w(BIT(data, 7) ? 0 : 1); + for (auto &floppy : m_floppy) + if (floppy->get_device()) + floppy->get_device()->mon_w(BIT(data, 7) ? 0 : 1); m_status0 = data; } @@ -567,6 +567,8 @@ void kdt6_state::status2_w(uint8_t data) void kdt6_state::machine_start() { + m_drive_led.resolve(); + // 256 kb ram, 64 kb vram (and two dummy regions for invalid pages) m_ram = std::make_unique<uint8_t[]>(0x40000); m_vram = std::make_unique<uint16_t[]>(0x10000); @@ -579,10 +581,10 @@ void kdt6_state::machine_start() m_fdc->set_rate(250000); - if (m_floppy0->get_device()) - m_floppy0->get_device()->setup_led_cb(floppy_image_device::led_cb(&kdt6_state::drive0_led_cb, this)); - if (m_floppy1->get_device()) - m_floppy1->get_device()->setup_led_cb(floppy_image_device::led_cb(&kdt6_state::drive1_led_cb, this)); + if (m_floppy[0]->get_device()) + m_floppy[0]->get_device()->setup_led_cb(floppy_image_device::led_cb(&kdt6_state::drive0_led_cb, this)); + if (m_floppy[1]->get_device()) + m_floppy[1]->get_device()->setup_led_cb(floppy_image_device::led_cb(&kdt6_state::drive1_led_cb, this)); // register for save states save_pointer(NAME(m_ram), 0x40000); diff --git a/src/mame/drivers/mac.cpp b/src/mame/drivers/mac.cpp index 925d4cb9bce..2d4adf755b5 100644 --- a/src/mame/drivers/mac.cpp +++ b/src/mame/drivers/mac.cpp @@ -422,11 +422,6 @@ void mac_state::mac_rbv_w(offs_t offset, uint8_t data) } } -// Portable/PB100 video -VIDEO_START_MEMBER(mac_state,macprtb) -{ -} - uint16_t mac_state::mac_config_r() { return 0xffff; // returns nonzero if no PDS RAM expansion, 0 if present @@ -534,64 +529,10 @@ void mac_state::hmc_w(offs_t offset, uint8_t data) } } -uint8_t mac_state::mac_gsc_r(offs_t offset) -{ - if (offset == 1) - { - return 5; - } - - return 0; -} - -void mac_state::mac_gsc_w(uint8_t data) -{ -} - -uint8_t mac_state::mac_5396_r(offs_t offset) -{ - if (offset < 0x100) - { - return m_539x_1->read(offset>>4); - } - else // pseudo-DMA: read from the FIFO - { - return m_539x_1->read(2); - } - - // never executed - //return 0; -} - -void mac_state::mac_5396_w(offs_t offset, uint8_t data) -{ - if (offset < 0x100) - { - m_539x_1->write(offset>>4, data); - } - else // pseudo-DMA: write to the FIFO - { - m_539x_1->write(2, data); - } -} - /*************************************************************************** ADDRESS MAPS ***************************************************************************/ -void mac_state::macprtb_map(address_map &map) -{ - map(0x900000, 0x93ffff).rom().region("bootrom", 0).mirror(0x0c0000); - map(0xf60000, 0xf6ffff).rw(FUNC(mac_state::mac_iwm_r), FUNC(mac_state::mac_iwm_w)); - map(0xf70000, 0xf7ffff).rw(FUNC(mac_state::mac_via_r), FUNC(mac_state::mac_via_w)); - map(0xf90000, 0xf9ffff).rw(FUNC(mac_state::macplus_scsi_r), FUNC(mac_state::macplus_scsi_w)); - map(0xfa8000, 0xfaffff).ram().share("vram16"); // VRAM - map(0xfb0000, 0xfbffff).rw(m_asc, FUNC(asc_device::read), FUNC(asc_device::write)); - map(0xfc0000, 0xfcffff).r(FUNC(mac_state::mac_config_r)); - map(0xfd0000, 0xfdffff).rw(FUNC(mac_state::mac_scc_r), FUNC(mac_state::mac_scc_2_w)); - map(0xfffff0, 0xffffff).rw(FUNC(mac_state::mac_autovector_r), FUNC(mac_state::mac_autovector_w)); -} - void mac_state::maclc_map(address_map &map) { map.global_mask(0x80ffffff); // V8 uses bit 31 and 23-0 for address decoding only @@ -700,85 +641,6 @@ void mac_state::maciifx_map(address_map &map) map(0x50040000, 0x50041fff).rw(FUNC(mac_state::mac_via_r), FUNC(mac_state::mac_via_w)).mirror(0x00f00000); } -// ROM detects the "Jaws" ASIC by checking for I/O space mirrored at 0x01000000 boundries -void mac_state::macpb140_map(address_map &map) -{ - map(0x40000000, 0x400fffff).r(FUNC(mac_state::rom_switch_r)).mirror(0x0ff00000); - - map(0x50000000, 0x50001fff).rw(FUNC(mac_state::mac_via_r), FUNC(mac_state::mac_via_w)).mirror(0x01f00000); - map(0x50002000, 0x50003fff).rw(FUNC(mac_state::mac_via2_r), FUNC(mac_state::mac_via2_w)).mirror(0x01f00000); - map(0x50004000, 0x50005fff).rw(FUNC(mac_state::mac_scc_r), FUNC(mac_state::mac_scc_2_w)).mirror(0x01f00000); - map(0x50006000, 0x50007fff).rw(FUNC(mac_state::macii_scsi_drq_r), FUNC(mac_state::macii_scsi_drq_w)).mirror(0x01f00000); - map(0x50010000, 0x50011fff).rw(FUNC(mac_state::macplus_scsi_r), FUNC(mac_state::macii_scsi_w)).mirror(0x01f00000); - map(0x50012060, 0x50012063).r(FUNC(mac_state::macii_scsi_drq_r)).mirror(0x01f00000); - map(0x50014000, 0x50015fff).rw(m_asc, FUNC(asc_device::read), FUNC(asc_device::write)).mirror(0x01f00000); - map(0x50016000, 0x50017fff).rw(FUNC(mac_state::mac_iwm_r), FUNC(mac_state::mac_iwm_w)).mirror(0x01f00000); - map(0x50024000, 0x50027fff).r(FUNC(mac_state::buserror_r)).mirror(0x01f00000); // bus error here to make sure we aren't mistaken for another decoder - - map(0xfee08000, 0xfeffffff).ram().share("vram"); -} - -void mac_state::macpb160_map(address_map &map) -{ - map(0x40000000, 0x400fffff).r(FUNC(mac_state::rom_switch_r)).mirror(0x0ff00000); - - map(0x50f00000, 0x50f01fff).rw(FUNC(mac_state::mac_via_r), FUNC(mac_state::mac_via_w)); - map(0x50f02000, 0x50f03fff).rw(FUNC(mac_state::mac_via2_r), FUNC(mac_state::mac_via2_w)); - map(0x50f04000, 0x50f05fff).rw(FUNC(mac_state::mac_scc_r), FUNC(mac_state::mac_scc_2_w)); - map(0x50f06000, 0x50f07fff).rw(FUNC(mac_state::macii_scsi_drq_r), FUNC(mac_state::macii_scsi_drq_w)); - map(0x50f10000, 0x50f11fff).rw(FUNC(mac_state::macplus_scsi_r), FUNC(mac_state::macii_scsi_w)); - map(0x50f12060, 0x50f12063).r(FUNC(mac_state::macii_scsi_drq_r)); - map(0x50f14000, 0x50f15fff).rw(m_asc, FUNC(asc_device::read), FUNC(asc_device::write)); - map(0x50f16000, 0x50f17fff).rw(FUNC(mac_state::mac_iwm_r), FUNC(mac_state::mac_iwm_w)); - map(0x50f20000, 0x50f21fff).rw(FUNC(mac_state::mac_gsc_r), FUNC(mac_state::mac_gsc_w)); - map(0x50f24000, 0x50f27fff).r(FUNC(mac_state::buserror_r)); // bus error here to make sure we aren't mistaken for another decoder - - map(0x60000000, 0x6001ffff).ram().share("vram").mirror(0x0ffe0000); -} - -void mac_state::macpb165c_map(address_map &map) -{ - map(0x40000000, 0x400fffff).r(FUNC(mac_state::rom_switch_r)).mirror(0x0ff00000); - - map(0x50f00000, 0x50f01fff).rw(FUNC(mac_state::mac_via_r), FUNC(mac_state::mac_via_w)); - map(0x50f02000, 0x50f03fff).rw(FUNC(mac_state::mac_via2_r), FUNC(mac_state::mac_via2_w)); - map(0x50f04000, 0x50f05fff).rw(FUNC(mac_state::mac_scc_r), FUNC(mac_state::mac_scc_2_w)); - map(0x50f06000, 0x50f07fff).rw(FUNC(mac_state::macii_scsi_drq_r), FUNC(mac_state::macii_scsi_drq_w)); - map(0x50f10000, 0x50f11fff).rw(FUNC(mac_state::macplus_scsi_r), FUNC(mac_state::macii_scsi_w)); - map(0x50f12060, 0x50f12063).r(FUNC(mac_state::macii_scsi_drq_r)); - map(0x50f14000, 0x50f15fff).rw(m_asc, FUNC(asc_device::read), FUNC(asc_device::write)); - map(0x50f16000, 0x50f17fff).rw(FUNC(mac_state::mac_iwm_r), FUNC(mac_state::mac_iwm_w)); - map(0x50f20000, 0x50f21fff).r(FUNC(mac_state::buserror_r)); // bus error here to detect we're not the grayscale 160/165/180 - map(0x50f24000, 0x50f27fff).r(FUNC(mac_state::buserror_r)); // bus error here to make sure we aren't mistaken for another decoder - - // on-board color video on 165c/180c - map(0xfc000000, 0xfc07ffff).ram().share("vram").mirror(0x00380000); // 512k of VRAM - map(0xfc400000, 0xfcefffff).rw(FUNC(mac_state::macwd_r), FUNC(mac_state::macwd_w)); -// fc4003c8 = DAC control, fc4003c9 = DAC data -// fc4003da bit 3 is VBL - map(0xfcff8000, 0xfcffffff).rom().region("vrom", 0x0000); -} - -void mac_state::macpd210_map(address_map &map) -{ - map(0x40000000, 0x400fffff).r(FUNC(mac_state::rom_switch_r)).mirror(0x0ff00000); - - map(0x50f00000, 0x50f01fff).rw(FUNC(mac_state::mac_via_r), FUNC(mac_state::mac_via_w)); - map(0x50f02000, 0x50f03fff).rw(FUNC(mac_state::mac_via2_r), FUNC(mac_state::mac_via2_w)); - map(0x50f04000, 0x50f05fff).rw(FUNC(mac_state::mac_scc_r), FUNC(mac_state::mac_scc_2_w)); - map(0x50f06000, 0x50f07fff).rw(FUNC(mac_state::macii_scsi_drq_r), FUNC(mac_state::macii_scsi_drq_w)); - map(0x50f10000, 0x50f11fff).rw(FUNC(mac_state::macplus_scsi_r), FUNC(mac_state::macii_scsi_w)); - map(0x50f12060, 0x50f12063).r(FUNC(mac_state::macii_scsi_drq_r)); - map(0x50f14000, 0x50f15fff).rw(m_asc, FUNC(asc_device::read), FUNC(asc_device::write)); - map(0x50f16000, 0x50f17fff).rw(FUNC(mac_state::mac_iwm_r), FUNC(mac_state::mac_iwm_w)); - map(0x50f20000, 0x50f21fff).rw(FUNC(mac_state::mac_gsc_r), FUNC(mac_state::mac_gsc_w)); - map(0x50f24000, 0x50f27fff).r(FUNC(mac_state::buserror_r)); // bus error here to make sure we aren't mistaken for another decoder - - map(0x5ffffffc, 0x5fffffff).r(FUNC(mac_state::mac_read_id)); - - map(0x60000000, 0x6001ffff).ram().share("vram").mirror(0x0ffe0000); -} - void mac_state::pwrmac_map(address_map &map) { map(0x00000000, 0x007fffff).ram(); // 8 MB standard @@ -1019,43 +881,6 @@ template <typename T> void mac_state::add_nubus_pds(machine_config &config, cons NUBUS_SLOT(config, slot_tag, "pds", std::forward<T>(opts), nullptr); } -void mac_state::macprtb(machine_config &config) -{ - /* basic machine hardware */ - M68000(config, m_maincpu, C15M); - m_maincpu->set_addrmap(AS_PROGRAM, &mac_state::macprtb_map); - m_maincpu->set_dasm_override(FUNC(mac_state::mac_dasm_override)); - - config.set_maximum_quantum(attotime::from_hz(60)); - - add_pb1xx_screen(config); - m_screen->set_screen_update(FUNC(mac_state::screen_update_macprtb)); - - PALETTE(config, m_palette, palette_device::MONOCHROME_INVERTED); - - MCFG_VIDEO_START_OVERRIDE(mac_state,macprtb) - - /* devices */ - add_base_devices(config); - add_scsi(config); - add_asc(config, asc_device::asc_type::ASC); - - MACADB(config, m_macadb, C15M); - m_macadb->set_pmu_mode(true); - m_macadb->set_pmu_is_via1(true); - - VIA6522(config, m_via1, 783360); - m_via1->readpa_handler().set(FUNC(mac_state::mac_via_in_a_pmu)); - m_via1->readpb_handler().set(FUNC(mac_state::mac_via_in_b_pmu)); - m_via1->writepa_handler().set(FUNC(mac_state::mac_via_out_a_pmu)); - m_via1->writepb_handler().set(FUNC(mac_state::mac_via_out_b_pmu)); - m_via1->irq_handler().set(FUNC(mac_state::mac_via_irq)); - - RAM(config, m_ram); - m_ram->set_default_size("1M"); - m_ram->set_extra_options("1M,3M,5M,7M,9M"); -} - void mac_state::macii(machine_config &config, bool cpu, asc_device::asc_type asc_type, bool nubus, bool nubus_bank1, bool nubus_bank2) { if (cpu) @@ -1301,108 +1126,6 @@ void mac_state::macse30(machine_config &config) SOFTWARE_LIST(config, "flop35_list").set_original("mac_flop"); } -void mac_state::macpb140(machine_config &config) -{ - M68030(config, m_maincpu, C15M); - m_maincpu->set_addrmap(AS_PROGRAM, &mac_state::macpb140_map); - m_maincpu->set_dasm_override(FUNC(mac_state::mac_dasm_override)); - - add_pb1xx_screen(config); - m_screen->set_screen_update(FUNC(mac_state::screen_update_macpb140)); - - PALETTE(config, m_palette, palette_device::MONOCHROME_INVERTED); - - MCFG_VIDEO_START_OVERRIDE(mac_state,macprtb) - - add_asc(config, asc_device::asc_type::ASC); - add_scsi(config); - add_base_devices(config, false, true); - add_pb1xx_vias(config); - - MACADB(config, m_macadb, C15M); - m_macadb->set_pmu_mode(true); - - RAM(config, m_ram); - m_ram->set_default_size("2M"); - m_ram->set_extra_options("4M,6M,8M"); - - SOFTWARE_LIST(config, "flop35_list").set_original("mac_flop"); -} - -// PowerBook 145 = 140 @ 25 MHz (still 2MB RAM - the 145B upped that to 4MB) -void mac_state::macpb145(machine_config &config) -{ - macpb140(config); - m_maincpu->set_clock(25000000); - - m_ram->set_default_size("4M"); - m_ram->set_extra_options("6M,8M"); -} - -// PowerBook 170 = 140 @ 25 MHz with an active-matrix LCD (140/145/145B were passive) -void mac_state::macpb170(machine_config &config) -{ - macpb140(config); - m_maincpu->set_clock(25000000); - - m_ram->set_default_size("4M"); - m_ram->set_extra_options("6M,8M"); -} - -void mac_state::macpb160(machine_config &config) -{ - M68030(config, m_maincpu, 25000000); - m_maincpu->set_addrmap(AS_PROGRAM, &mac_state::macpb160_map); - m_maincpu->set_dasm_override(FUNC(mac_state::mac_dasm_override)); - - add_pb1xx_screen(config); - m_screen->set_screen_update(FUNC(mac_state::screen_update_macpb160)); - - PALETTE(config, m_palette, FUNC(mac_state::macgsc_palette), 16); - - MCFG_VIDEO_START_OVERRIDE(mac_state,macprtb) - - add_asc(config, asc_device::asc_type::ASC); - add_scsi(config); - add_base_devices(config, false, true); - add_pb1xx_vias(config); - - MACADB(config, m_macadb, C15M); - m_macadb->set_pmu_mode(true); - - RAM(config, m_ram); - m_ram->set_default_size("4M"); - m_ram->set_extra_options("8M,12M,16M"); - - SOFTWARE_LIST(config, "flop35_list").set_original("mac_flop"); -} - -void mac_state::macpb180(machine_config &config) -{ - macpb160(config); - m_maincpu->set_clock(33000000); -} - -void mac_state::macpb180c(machine_config &config) -{ - macpb160(config); - m_maincpu->set_clock(33000000); - m_maincpu->set_addrmap(AS_PROGRAM, &mac_state::macpb165c_map); - - m_screen->set_size(800, 525); - m_screen->set_visarea(0, 640-1, 0, 480-1); - m_screen->set_screen_update(FUNC(mac_state::screen_update_macpbwd)); - m_screen->set_no_palette(); -} - -void mac_state::macpd210(machine_config &config) -{ - macpb160(config); - m_maincpu->set_addrmap(AS_PROGRAM, &mac_state::macpd210_map); - - m_ram->set_extra_options("8M,12M,16M,20M,24M"); -} - void mac_state::macclas2(machine_config &config) { maclc(config, false, true, asc_device::asc_type::EAGLE); @@ -1638,91 +1361,11 @@ ROM_START( pmac6100 ) ROM_LOAD( "9feb69b3.rom", 0x000000, 0x400000, CRC(a43fadbc) SHA1(6fac1c4e920a077c077b03902fef9199d5e8f2c3) ) ROM_END -ROM_START( macprtb ) - ROM_REGION16_BE(0x40000, "bootrom", 0) - ROM_LOAD16_WORD( "93ca3846.rom", 0x000000, 0x040000, CRC(497348f8) SHA1(79b468b33fc53f11e87e2e4b195aac981bf0c0a6) ) - - ROM_REGION(0x1800, "pmu", 0) - ROM_LOAD( "pmuv1.bin", 0x000000, 0x001800, CRC(01dae148) SHA1(29d2fca7426c31f2b9334832ed3d257974a61bb1) ) -ROM_END - -ROM_START( macpb100 ) - ROM_REGION16_BE(0x40000, "bootrom", 0) - ROM_LOAD16_WORD( "96645f9c.rom", 0x000000, 0x040000, CRC(29ac7ee9) SHA1(7f3acf40b1f63612de2314a2e9fcfeafca0711fc) ) - - ROM_REGION(0x1800, "pmu", 0) - ROM_LOAD( "pmuv1.bin", 0x000000, 0x001800, CRC(01dae148) SHA1(29d2fca7426c31f2b9334832ed3d257974a61bb1) ) -ROM_END - -ROM_START( macpb140 ) - ROM_REGION32_BE(0x100000, "bootrom", 0) - ROM_LOAD( "420dbff3.rom", 0x000000, 0x100000, CRC(88ea2081) SHA1(7a8ee468d16e64f2ad10cb8d1a45e6f07cc9e212) ) - - ROM_REGION(0x1800, "pmu", 0) - ROM_LOAD( "pmuv2.bin", 0x000000, 0x001800, CRC(1a32b5e5) SHA1(7c096324763cfc8d2024893b3e8493b7729b3a92) ) -ROM_END - -ROM_START( macpb145 ) - ROM_REGION32_BE(0x100000, "bootrom", 0) - ROM_LOAD( "420dbff3.rom", 0x000000, 0x100000, CRC(88ea2081) SHA1(7a8ee468d16e64f2ad10cb8d1a45e6f07cc9e212) ) - - ROM_REGION(0x1800, "pmu", 0) - ROM_LOAD( "pmuv2.bin", 0x000000, 0x001800, CRC(1a32b5e5) SHA1(7c096324763cfc8d2024893b3e8493b7729b3a92) ) -ROM_END - -ROM_START( macpb145b ) - ROM_REGION32_BE(0x100000, "bootrom", 0) - ROM_LOAD( "420dbff3.rom", 0x000000, 0x100000, CRC(88ea2081) SHA1(7a8ee468d16e64f2ad10cb8d1a45e6f07cc9e212) ) - - ROM_REGION(0x1800, "pmu", 0) - ROM_LOAD( "pmuv2.bin", 0x000000, 0x001800, CRC(1a32b5e5) SHA1(7c096324763cfc8d2024893b3e8493b7729b3a92) ) -ROM_END - -ROM_START( macpb170 ) - ROM_REGION32_BE(0x100000, "bootrom", 0) - ROM_LOAD( "420dbff3.rom", 0x000000, 0x100000, CRC(88ea2081) SHA1(7a8ee468d16e64f2ad10cb8d1a45e6f07cc9e212) ) - - ROM_REGION(0x1800, "pmu", 0) - ROM_LOAD( "pmuv2.bin", 0x000000, 0x001800, CRC(1a32b5e5) SHA1(7c096324763cfc8d2024893b3e8493b7729b3a92) ) -ROM_END - -ROM_START( macpb160 ) - ROM_REGION32_BE(0x100000, "bootrom", 0) - ROM_LOAD( "e33b2724.rom", 0x000000, 0x100000, CRC(536c60f4) SHA1(c0510682ae6d973652d7e17f3c3b27629c47afac) ) - - ROM_REGION(0x1800, "pmu", 0) - ROM_LOAD( "pmuv3.bin", 0x000000, 0x001800, CRC(f2df696c) SHA1(fc312cbfd407c6f0248c6463910e41ad6b5b0daa) ) -ROM_END - -ROM_START( macpb180 ) - ROM_REGION32_BE(0x100000, "bootrom", 0) - ROM_LOAD( "e33b2724.rom", 0x000000, 0x100000, CRC(536c60f4) SHA1(c0510682ae6d973652d7e17f3c3b27629c47afac) ) - - ROM_REGION(0x1800, "pmu", 0) - ROM_LOAD( "pmuv3.bin", 0x000000, 0x001800, CRC(f2df696c) SHA1(fc312cbfd407c6f0248c6463910e41ad6b5b0daa) ) -ROM_END - -ROM_START( macpb180c ) - ROM_REGION32_BE(0x100000, "bootrom", 0) - ROM_LOAD( "e33b2724.rom", 0x000000, 0x100000, CRC(536c60f4) SHA1(c0510682ae6d973652d7e17f3c3b27629c47afac) ) - - ROM_REGION32_BE(0x8000, "vrom", 0) - ROM_LOAD( "pb180cvrom.bin", 0x0000, 0x8000, CRC(810c75ad) SHA1(3a936e97dee5ceeb25e50197ef504e514ae689a4)) - - ROM_REGION(0x1800, "pmu", 0) - ROM_LOAD( "pmuv3.bin", 0x000000, 0x001800, CRC(f2df696c) SHA1(fc312cbfd407c6f0248c6463910e41ad6b5b0daa) ) -ROM_END - ROM_START( maccclas ) ROM_REGION32_BE(0x100000, "bootrom", 0) ROM_LOAD( "ecd99dc0.rom", 0x000000, 0x100000, CRC(c84c3aa5) SHA1(fd9e852e2d77fe17287ba678709b9334d4d74f1e) ) ROM_END -ROM_START( macpd210 ) - ROM_REGION32_BE(0x100000, "bootrom", 0) - ROM_LOAD( "ecfa989b.rom", 0x000000, 0x100000, CRC(b86ed854) SHA1(ed1371c97117a5884da4a6605ecfc5abed48ae5a) ) -ROM_END - ROM_START( maclc520 ) ROM_REGION32_BE(0x100000, "bootrom", 0) ROM_LOAD( "ede66cbd.rom", 0x000000, 0x100000, CRC(a893cb0f) SHA1(c54ee2f45020a4adeb7451adce04cd6e5fb69790) ) @@ -1733,25 +1376,15 @@ COMP( 1987, macii, 0, 0, macii, macadb, mac_state, init_maci COMP( 1987, maciihmu, macii, 0, maciihmu, macadb, mac_state, init_macii, "Apple Computer", "Macintosh II (w/o 68851 MMU)", MACHINE_NOT_WORKING ) COMP( 1988, mac2fdhd, 0, 0, macii, macadb, mac_state, init_maciifdhd, "Apple Computer", "Macintosh II (FDHD)", MACHINE_NOT_WORKING ) COMP( 1988, maciix, mac2fdhd, 0, maciix, macadb, mac_state, init_maciix, "Apple Computer", "Macintosh IIx", MACHINE_NOT_WORKING ) -COMP( 1989, macprtb, 0, 0, macprtb, macadb, mac_state, init_macprtb, "Apple Computer", "Macintosh Portable", MACHINE_NOT_WORKING ) COMP( 1989, macse30, mac2fdhd, 0, macse30, macadb, mac_state, init_macse30, "Apple Computer", "Macintosh SE/30", MACHINE_NOT_WORKING ) COMP( 1989, maciicx, mac2fdhd, 0, maciicx, macadb, mac_state, init_maciicx, "Apple Computer", "Macintosh IIcx", MACHINE_NOT_WORKING ) COMP( 1989, maciici, 0, 0, maciici, maciici, mac_state, init_maciici, "Apple Computer", "Macintosh IIci", MACHINE_NOT_WORKING ) COMP( 1990, maciifx, 0, 0, maciifx, macadb, mac_state, init_maciifx, "Apple Computer", "Macintosh IIfx", MACHINE_NOT_WORKING ) COMP( 1990, maclc, 0, 0, maclc, maciici, mac_state, init_maclc, "Apple Computer", "Macintosh LC", MACHINE_IMPERFECT_SOUND ) COMP( 1990, maciisi, 0, 0, maciisi, maciici, mac_state, init_maciisi, "Apple Computer", "Macintosh IIsi", MACHINE_NOT_WORKING ) -COMP( 1991, macpb100, 0, 0, macprtb, macadb, mac_state, init_macprtb, "Apple Computer", "Macintosh PowerBook 100", MACHINE_NOT_WORKING ) -COMP( 1991, macpb140, 0, 0, macpb140, macadb, mac_state, init_macpb140, "Apple Computer", "Macintosh PowerBook 140", MACHINE_NOT_WORKING ) -COMP( 1991, macpb170, macpb140, 0, macpb170, macadb, mac_state, init_macpb140, "Apple Computer", "Macintosh PowerBook 170", MACHINE_NOT_WORKING ) COMP( 1991, macclas2, 0, 0, macclas2, macadb, mac_state, init_macclassic2, "Apple Computer", "Macintosh Classic II", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_SOUND ) COMP( 1991, maclc2, 0, 0, maclc2, maciici, mac_state, init_maclc2, "Apple Computer", "Macintosh LC II", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_SOUND ) -COMP( 1992, macpb145, macpb140, 0, macpb145, macadb, mac_state, init_macpb140, "Apple Computer", "Macintosh PowerBook 145", MACHINE_NOT_WORKING ) -COMP( 1992, macpb160, 0, 0, macpb160, macadb, mac_state, init_macpb160, "Apple Computer", "Macintosh PowerBook 160", MACHINE_NOT_WORKING ) -COMP( 1992, macpb180, macpb160, 0, macpb180, macadb, mac_state, init_macpb160, "Apple Computer", "Macintosh PowerBook 180", MACHINE_NOT_WORKING ) -COMP( 1992, macpb180c, macpb160, 0, macpb180c,macadb, mac_state, init_macpb160, "Apple Computer", "Macintosh PowerBook 180c", MACHINE_NOT_WORKING ) -COMP( 1992, macpd210, 0, 0, macpd210, macadb, mac_state, init_macpd210, "Apple Computer", "Macintosh PowerBook Duo 210", MACHINE_NOT_WORKING ) COMP( 1993, maccclas, 0, 0, maccclas, macadb, mac_state, init_maclrcclassic, "Apple Computer", "Macintosh Color Classic", MACHINE_NOT_WORKING ) -COMP( 1992, macpb145b, macpb140, 0, macpb170, macadb, mac_state, init_macpb140, "Apple Computer", "Macintosh PowerBook 145B", MACHINE_NOT_WORKING ) COMP( 1993, maclc3, 0, 0, maclc3, maciici, mac_state, init_maclc3, "Apple Computer", "Macintosh LC III", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_SOUND ) COMP( 1993, maciivx, 0, 0, maciivx, maciici, mac_state, init_maciivx, "Apple Computer", "Macintosh IIvx", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_SOUND ) COMP( 1993, maciivi, maciivx, 0, maciivi, maciici, mac_state, init_maciivi, "Apple Computer", "Macintosh IIvi", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_SOUND ) diff --git a/src/mame/drivers/macprtb.cpp b/src/mame/drivers/macprtb.cpp new file mode 100644 index 00000000000..de52cb2b637 --- /dev/null +++ b/src/mame/drivers/macprtb.cpp @@ -0,0 +1,529 @@ +// license:BSD-3-Clause +// copyright-holders:R. Belmont +/**************************************************************************** + + drivers/macprtb.cpp + Mac Portable / PowerBook 100 emulation + By R. Belmont + + These are electrically identical 68000 machines in very different form factors. + The Mac Portable came in a large, heavy, "luggable" form factor and didn't enjoy + much success. + + The PowerBook 100 was much smaller and lighter, the result of + Apple partnering with Sony to redesign the Portable motherboard to fit into + a much smaller case. The PowerBook 100 pioneered the modern convention of + having the pointing device nearest the user with the keyboard pushed back + towards the hinge. + + These are sort of an intermediate step between the SE and Mac II in terms + of functional layout: ASC and SWIM are present, but there's only 1 VIA + and an M50753 microcontroller "PMU" handles power management, ADB, and + clock/PRAM. + +****************************************************************************/ + +#include "emu.h" + +#include "machine/macrtc.h" +#include "cpu/m68000/m68000.h" +#include "cpu/m6502/m5074x.h" +#include "machine/6522via.h" +#include "machine/applefdc.h" +#include "machine/ram.h" +#include "machine/sonydriv.h" +#include "machine/swim.h" +#include "machine/timer.h" +#include "machine/z80scc.h" +#include "machine/macadb.h" +#include "machine/ncr5380.h" +#include "bus/scsi/scsi.h" +#include "bus/scsi/scsihd.h" +#include "sound/asc.h" +#include "formats/ap_dsk35.h" + +#include "emupal.h" +#include "screen.h" +#include "softlist.h" +#include "speaker.h" + +#define C7M (7833600) +#define C15M (C7M*2) +#define C32M (C15M*2) + +// M50753 emulation needs some work before this is a thing. +//#define PMU_LLE + +class macportable_state : public driver_device +{ +public: + macportable_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_pmu(*this, "pmu"), + m_via1(*this, "via1"), + m_macadb(*this, "macadb"), + m_ncr5380(*this, "ncr5380"), + m_ram(*this, RAM_TAG), + m_iwm(*this, "fdc"), + m_screen(*this, "screen"), + m_asc(*this, "asc"), + m_scc(*this, "scc"), + m_vram(*this, "vram") + { + } + + void macprtb(machine_config &config); + void macprtb_map(address_map &map); + + void init_macprtb(); + +private: + required_device<m68000_device> m_maincpu; + required_device<m50753_device> m_pmu; + required_device<via6522_device> m_via1; + required_device<macadb_device> m_macadb; + required_device<ncr5380_device> m_ncr5380; + required_device<ram_device> m_ram; + required_device<applefdc_base_device> m_iwm; + required_device<screen_device> m_screen; + required_device<asc_device> m_asc; + required_device<z80scc_device> m_scc; + required_shared_ptr<uint16_t> m_vram; + + virtual void machine_start() override; + virtual void machine_reset() override; + + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + + u16 *m_ram_ptr, *m_rom_ptr; + u32 m_ram_mask, m_ram_size, m_rom_size; + + emu_timer *m_6015_timer; + + WRITE_LINE_MEMBER(adb_irq_w) { m_adb_irq_pending = state; } + int m_adb_irq_pending; + + uint16_t mac_via_r(offs_t offset); + void mac_via_w(offs_t offset, uint16_t data, uint16_t mem_mask); + uint8_t mac_via_in_a(); + uint8_t mac_via_in_b(); + void mac_via_out_a(uint8_t data); + void mac_via_out_b(uint8_t data); + void field_interrupts(); + DECLARE_WRITE_LINE_MEMBER(via_irq_w); + TIMER_CALLBACK_MEMBER(mac_6015_tick); + int m_via_cycles, m_via_interrupt, m_scc_interrupt, m_asc_interrupt, m_last_taken_interrupt; + int m_irq_count, m_ca1_data, m_ca2_data; + + uint16_t rom_switch_r(offs_t offset); + bool m_overlay; + + uint16_t scsi_r(offs_t offset, uint16_t mem_mask); + void scsi_w(offs_t offset, uint16_t data, uint16_t mem_mask); + + uint16_t mac_scc_r(offs_t offset) + { + uint16_t result = m_scc->dc_ab_r(offset); + return (result << 8) | result; + } + void mac_scc_2_w(offs_t offset, uint16_t data) { m_scc->dc_ab_w(offset, data >> 8); } + + uint16_t mac_iwm_r(offs_t offset, uint16_t mem_mask) + { + uint16_t result = m_iwm->read(offset >> 8); + return (result << 8) | result; + } + void mac_iwm_w(offs_t offset, uint16_t data, uint16_t mem_mask) + { + if (ACCESSING_BITS_0_7) + m_iwm->write((offset >> 8), data & 0xff); + else + m_iwm->write((offset >> 8), data>>8); + } + + uint16_t mac_autovector_r(offs_t offset) { return 0; } + void mac_autovector_w(offs_t offset, uint16_t data) {}; + + // returns nonzero if no PDS RAM expansion, 0 if present + uint16_t mac_config_r() { return 0xffff; } + + DECLARE_WRITE_LINE_MEMBER(asc_irq_w) + { + m_asc_interrupt = state; + field_interrupts(); + } + + u8 m_pmu_from_via, m_pmu_to_via, m_pmu_ack, m_pmu_req; + u8 pmu_data_r() { return m_pmu_from_via; } + void pmu_data_w(u8 data) { m_pmu_to_via = data; } + u8 pmu_comms_r() { return (m_pmu_req<<7); } + void pmu_comms_w(u8 data) { m_pmu_ack = (data & 0x40)>>6; } +}; + +void macportable_state::field_interrupts() +{ + int take_interrupt = -1; + + if ((m_scc_interrupt) || (m_asc_interrupt)) + { + take_interrupt = 2; + } + else if (m_via_interrupt) + { + take_interrupt = 1; + } + + if (m_last_taken_interrupt > -1) + { + m_maincpu->set_input_line(m_last_taken_interrupt, CLEAR_LINE); + m_last_taken_interrupt = -1; + } + + if (take_interrupt > -1) + { + m_maincpu->set_input_line(take_interrupt, ASSERT_LINE); + m_last_taken_interrupt = take_interrupt; + } +} + +void macportable_state::machine_start() +{ + m_ram_ptr = (u16*)m_ram->pointer(); + m_ram_size = m_ram->size()>>1; + m_ram_mask = m_ram_size - 1; + m_rom_ptr = (u16*)memregion("bootrom")->base(); + m_rom_size = memregion("bootrom")->bytes(); + m_via_cycles = -50; + m_via_interrupt = m_scc_interrupt = m_asc_interrupt = 0; + m_last_taken_interrupt = -1; + m_irq_count = m_ca1_data = m_ca2_data = 0; + m_pmu_to_via = m_pmu_from_via = 0; + m_pmu_ack = m_pmu_req = 0; + + m_6015_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(macportable_state::mac_6015_tick),this)); + m_6015_timer->adjust(attotime::never); +} + +void macportable_state::machine_reset() +{ + m_overlay = true; + m_via_interrupt = m_scc_interrupt = 0; + m_last_taken_interrupt = -1; + m_irq_count = m_ca1_data = m_ca2_data = 0; + + // put ROM mirror at 0 + address_space& space = m_maincpu->space(AS_PROGRAM); + const u32 memory_size = std::min((u32)0x3fffff, m_rom_size); + const u32 memory_end = memory_size - 1; + offs_t memory_mirror = memory_end & ~(memory_size - 1); + + space.unmap_write(0x00000000, memory_end); + space.install_read_bank(0x00000000, memory_end & ~memory_mirror, memory_mirror, "bank1"); + membank("bank1")->set_base(m_rom_ptr); + + // start 60.15 Hz timer + m_6015_timer->adjust(attotime::from_hz(60.15), 0, attotime::from_hz(60.15)); +} + +void macportable_state::init_macprtb() +{ +} + +uint32_t macportable_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +{ + uint16_t const *const video_ram = (const uint16_t *) m_vram.target(); + + for (int y = 0; y < 400; y++) + { + uint32_t *const line = &bitmap.pix(y); + + for (int x = 0; x < 640; x += 16) + { + uint16_t const word = video_ram[((y * 640)/16) + ((x/16))]; + for (int b = 0; b < 16; b++) + { + line[x + b] = ((word >> (15 - b)) & 0x0001) ? 0 : 0xffffffff; + } + } + } + return 0; +} + +uint16_t macportable_state::mac_via_r(offs_t offset) +{ + uint16_t data; + + offset >>= 8; + offset &= 0x0f; + + data = m_via1->read(offset); + + m_maincpu->adjust_icount(m_via_cycles); + + return (data & 0xff) | (data << 8); +} + +void macportable_state::mac_via_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + offset >>= 8; + offset &= 0x0f; + + if (ACCESSING_BITS_0_7) + m_via1->write(offset, data & 0xff); + if (ACCESSING_BITS_8_15) + m_via1->write(offset, (data >> 8) & 0xff); + + m_maincpu->adjust_icount(m_via_cycles); +} + +WRITE_LINE_MEMBER(macportable_state::via_irq_w) +{ + m_via_interrupt = state; + field_interrupts(); +} + +uint16_t macportable_state::rom_switch_r(offs_t offset) +{ + // disable the overlay + if (m_overlay) + { + address_space& space = m_maincpu->space(AS_PROGRAM); + const u32 memory_end = m_ram->size() - 1; + void *memory_data = m_ram->pointer(); + offs_t memory_mirror = memory_end & ~memory_end; + + space.install_readwrite_bank(0x00000000, memory_end & ~memory_mirror, memory_mirror, "bank1"); + membank("bank1")->set_base(memory_data); + m_overlay = false; + } + + //printf("rom_switch_r: offset %08x ROM_size -1 = %08x, masked = %08x\n", offset, m_rom_size-1, offset & ((m_rom_size - 1)>>2)); + + return m_rom_ptr[offset & ((m_rom_size - 1)>>2)]; +} + +TIMER_CALLBACK_MEMBER(macportable_state::mac_6015_tick) +{ + /* signal VBlank on CA1 input on the VIA */ + m_ca1_data ^= 1; + m_via1->write_ca1(m_ca1_data); + + if (++m_irq_count == 60) + { + m_irq_count = 0; + + m_ca2_data ^= 1; + /* signal 1 Hz irq on CA2 input on the VIA */ + m_via1->write_ca2(m_ca2_data); + } +} + +uint16_t macportable_state::scsi_r(offs_t offset, uint16_t mem_mask) +{ + int reg = (offset >> 3) & 0xf; + + // logerror("macplus_scsi_r: offset %x mask %x\n", offset, mem_mask); + + if ((reg == 6) && (offset == 0x130)) + { + reg = R5380_CURDATA_DTACK; + } + + return m_ncr5380->ncr5380_read_reg(reg) << 8; +} + +void macportable_state::scsi_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + int reg = (offset >> 3) & 0xf; + + // logerror("macplus_scsi_w: data %x offset %x mask %x\n", data, offset, mem_mask); + + if ((reg == 0) && (offset == 0x100)) + { + reg = R5380_OUTDATA_DTACK; + } + + m_ncr5380->ncr5380_write_reg(reg, data); +} +/*************************************************************************** + ADDRESS MAPS +***************************************************************************/ +void macportable_state::macprtb_map(address_map &map) +{ + map(0x000000, 0x8fffff).r(FUNC(macportable_state::rom_switch_r)); + map(0x900000, 0x93ffff).rom().region("bootrom", 0).mirror(0x0c0000); + map(0xf60000, 0xf6ffff).rw(FUNC(macportable_state::mac_iwm_r), FUNC(macportable_state::mac_iwm_w)); + map(0xf70000, 0xf7ffff).rw(FUNC(macportable_state::mac_via_r), FUNC(macportable_state::mac_via_w)); + map(0xf90000, 0xf9ffff).rw(FUNC(macportable_state::scsi_r), FUNC(macportable_state::scsi_w)); + map(0xfa8000, 0xfaffff).ram().share("vram"); // VRAM + map(0xfb0000, 0xfbffff).rw(m_asc, FUNC(asc_device::read), FUNC(asc_device::write)); + map(0xfc0000, 0xfcffff).r(FUNC(macportable_state::mac_config_r)); + map(0xfd0000, 0xfdffff).rw(FUNC(macportable_state::mac_scc_r), FUNC(macportable_state::mac_scc_2_w)); + map(0xfffff0, 0xffffff).rw(FUNC(macportable_state::mac_autovector_r), FUNC(macportable_state::mac_autovector_w)); +} + +uint8_t macportable_state::mac_via_in_a() +{ + #ifdef PMU_LLE + return m_pmu_to_via; + #else + return m_macadb->get_pm_data_recv(); + #endif +} + +uint8_t macportable_state::mac_via_in_b() +{ + int val = 0; + // printf("Read VIA B: PM_ACK %x\n", m_pm_ack); + val = 0x80 | 0x04; + + #ifdef PMU_LLE + val |= ((m_pmu_ack & 1)<<1); + #else + val |= m_macadb->get_pm_ack(); // SCC wait/request (bit 2 must be set at 900c1a or startup tests always fail) + #endif + + // printf("%s VIA1 IN_B = %02x\n", machine().describe_context().c_str(), val); + + return val; +} + +void macportable_state::mac_via_out_a(uint8_t data) +{ + // printf("%s VIA1 OUT A: %02x\n", machine().describe_context().c_str(), data); + #ifdef PMU_LLE + m_pmu_from_via = data; + #else + m_macadb->set_pm_data_send(data); + #endif +} + +void macportable_state::mac_via_out_b(uint8_t data) +{ + // printf("%s VIA1 OUT B: %02x\n", machine().describe_context().c_str(), data); + sony_set_sel_line(m_iwm.target(), (data & 0x20) >> 5); + #ifdef PMU_LLE + m_pmu_req = (data & 1); + #else + m_macadb->pmu_req_w(data & 1); + #endif +} + +/*************************************************************************** + DEVICE CONFIG +***************************************************************************/ + +static const applefdc_interface mac_iwm_interface = +{ + sony_set_lines, + sony_set_enable_lines, + + sony_read_data, + sony_write_data, + sony_read_status +}; + +static const floppy_interface mac_floppy_interface = +{ + FLOPPY_STANDARD_3_5_DSHD, + LEGACY_FLOPPY_OPTIONS_NAME(apple35_mac), + "floppy_3_5" +}; + +static INPUT_PORTS_START( macadb ) +INPUT_PORTS_END + +/*************************************************************************** + MACHINE DRIVERS +***************************************************************************/ + +void macportable_state::macprtb(machine_config &config) +{ + /* basic machine hardware */ + M68000(config, m_maincpu, C15M); + m_maincpu->set_addrmap(AS_PROGRAM, &macportable_state::macprtb_map); + + M50753(config, m_pmu, 3.93216_MHz_XTAL); + m_pmu->read_p<2>().set(FUNC(macportable_state::pmu_data_r)); + m_pmu->write_p<2>().set(FUNC(macportable_state::pmu_data_w)); + m_pmu->read_p<3>().set(FUNC(macportable_state::pmu_comms_r)); + m_pmu->write_p<3>().set(FUNC(macportable_state::pmu_comms_w)); + + M50740(config, "kybd", 3.93216_MHz_XTAL).set_disable(); + + #ifdef PMU_LLE + config.set_perfect_quantum(m_maincpu); + #endif + + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60.15); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(1260)); + m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); + m_screen->set_size(700, 480); + m_screen->set_visarea(0, 639, 0, 399); + m_screen->set_screen_update(FUNC(macportable_state::screen_update)); + + MACADB(config, m_macadb, C15M); + m_macadb->set_pmu_mode(true); + m_macadb->set_pmu_is_via1(true); + + LEGACY_IWM(config, m_iwm, &mac_iwm_interface); + sonydriv_floppy_image_device::legacy_2_drives_add(config, &mac_floppy_interface); + + scsi_port_device &scsibus(SCSI_PORT(config, "scsi")); + scsibus.set_slot_device(1, "harddisk", SCSIHD, DEVICE_INPUT_DEFAULTS_NAME(SCSI_ID_6)); + scsibus.set_slot_device(2, "harddisk", SCSIHD, DEVICE_INPUT_DEFAULTS_NAME(SCSI_ID_5)); + + NCR5380(config, m_ncr5380, C7M); + m_ncr5380->set_scsi_port("scsi"); + + SCC85C30(config, m_scc, C7M); +// m_scc->intrq_callback().set(FUNC(macportable_state::set_scc_interrupt)); + + VIA6522(config, m_via1, C7M/10); + m_via1->readpa_handler().set(FUNC(macportable_state::mac_via_in_a)); + m_via1->readpb_handler().set(FUNC(macportable_state::mac_via_in_b)); + m_via1->writepa_handler().set(FUNC(macportable_state::mac_via_out_a)); + m_via1->writepb_handler().set(FUNC(macportable_state::mac_via_out_b)); + m_via1->irq_handler().set(FUNC(macportable_state::via_irq_w)); + + SPEAKER(config, "lspeaker").front_left(); + SPEAKER(config, "rspeaker").front_right(); + ASC(config, m_asc, C15M, asc_device::asc_type::ASC); + m_asc->irqf_callback().set(FUNC(macportable_state::asc_irq_w)); + m_asc->add_route(0, "lspeaker", 1.0); + m_asc->add_route(1, "rspeaker", 1.0); + + /* internal ram */ + RAM(config, m_ram); + m_ram->set_default_size("1M"); + m_ram->set_extra_options("1M,3M,5M,7M,9M"); + + SOFTWARE_LIST(config, "flop35_list").set_original("mac_flop"); +} + +ROM_START(macprtb) + ROM_REGION16_BE(0x40000, "bootrom", 0) + ROM_LOAD16_WORD("93ca3846.rom", 0x000000, 0x040000, CRC(497348f8) SHA1(79b468b33fc53f11e87e2e4b195aac981bf0c0a6)) + + ROM_REGION(0x1800, "pmu", 0) + ROM_LOAD("pmuv1.bin", 0x000000, 0x001800, CRC(01dae148) SHA1(29d2fca7426c31f2b9334832ed3d257974a61bb1)) + + ROM_REGION(0xc00, "kybd", 0) + ROM_LOAD("342s0740-2.12l", 0x000, 0xc00, NO_DUMP) +ROM_END + +ROM_START(macpb100) + ROM_REGION16_BE(0x40000, "bootrom", 0) + ROM_LOAD16_WORD("96645f9c.rom", 0x000000, 0x040000, CRC(29ac7ee9) SHA1(7f3acf40b1f63612de2314a2e9fcfeafca0711fc)) + + ROM_REGION(0x1800, "pmu", 0) + ROM_LOAD("pmuv1.bin", 0x000000, 0x001800, CRC(01dae148) SHA1(29d2fca7426c31f2b9334832ed3d257974a61bb1)) + + ROM_REGION(0xc00, "kybd", 0) + ROM_LOAD("342s0743-1.u29", 0x000, 0xc00, NO_DUMP) +ROM_END + +COMP(1989, macprtb, 0, 0, macprtb, macadb, macportable_state, init_macprtb, "Apple Computer", "Macintosh Portable", MACHINE_NOT_WORKING) +COMP(1991, macpb100, 0, 0, macprtb, macadb, macportable_state, init_macprtb, "Apple Computer", "Macintosh PowerBook 100", MACHINE_NOT_WORKING ) diff --git a/src/mame/drivers/macpwrbk030.cpp b/src/mame/drivers/macpwrbk030.cpp new file mode 100644 index 00000000000..aba0820c7fe --- /dev/null +++ b/src/mame/drivers/macpwrbk030.cpp @@ -0,0 +1,974 @@ +// license:BSD-3-Clause +// copyright-holders:R. Belmont +/**************************************************************************** + + drivers/macpwrbk030.cpp + Mac PowerBooks with a 68030 CPU and M50753 PMU + By R. Belmont + + These are basically late-period Mac IIs without NuBus and with + Egret/Cuda replaced with the PMU. + +****************************************************************************/ + +#include "emu.h" + +#include "machine/macrtc.h" +#include "cpu/m68000/m68000.h" +#include "machine/6522via.h" +#include "machine/applefdc.h" +#include "machine/ram.h" +#include "machine/sonydriv.h" +#include "machine/swim.h" +#include "machine/timer.h" +#include "machine/z80scc.h" +#include "machine/macadb.h" +#include "machine/ncr5380.h" +#include "bus/scsi/scsi.h" +#include "bus/scsi/scsihd.h" +#include "sound/asc.h" +#include "formats/ap_dsk35.h" + +#include "emupal.h" +#include "screen.h" +#include "softlist.h" +#include "speaker.h" + +#define C7M (7833600) +#define C15M (C7M*2) +#define C32M (C15M*2) + +class macpb030_state : public driver_device +{ +public: + macpb030_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_via1(*this, "via1"), + m_via2(*this, "via2"), + m_macadb(*this, "macadb"), + m_ncr5380(*this, "ncr5380"), + m_ram(*this, RAM_TAG), + m_iwm(*this, "fdc"), + m_screen(*this, "screen"), + m_palette(*this, "palette"), + m_asc(*this, "asc"), + m_scc(*this, "scc"), + m_vram(*this, "vram") + { + } + + void macpb140(machine_config &config); + void macpb145(machine_config &config); + void macpb160(machine_config &config); + void macpb170(machine_config &config); + void macpb180(machine_config &config); + void macpb180c(machine_config &config); + void macpd210(machine_config &config); + void macpb140_map(address_map &map); + void macpb160_map(address_map &map); + void macpb165c_map(address_map &map); + void macpd210_map(address_map &map); + + void init_macpb140(); + void init_macpb160(); + +private: + required_device<m68030_device> m_maincpu; + required_device<via6522_device> m_via1; + required_device<via6522_device> m_via2; + required_device<macadb_device> m_macadb; + required_device<ncr5380_device> m_ncr5380; + required_device<ram_device> m_ram; + required_device<applefdc_base_device> m_iwm; + required_device<screen_device> m_screen; + required_device<palette_device> m_palette; + required_device<asc_device> m_asc; + required_device<z80scc_device> m_scc; + required_shared_ptr<u32> m_vram; + + virtual void machine_start() override; + virtual void machine_reset() override; + + u32 screen_update_macpb140(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + u32 screen_update_macpb160(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + u32 screen_update_macpbwd(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + + u32 *m_ram_ptr, *m_rom_ptr; + u32 m_ram_mask, m_ram_size, m_rom_size; + + emu_timer *m_6015_timer; + + WRITE_LINE_MEMBER(adb_irq_w) { m_adb_irq_pending = state; } + int m_adb_irq_pending; + + u16 mac_via_r(offs_t offset); + void mac_via_w(offs_t offset, u16 data, u16 mem_mask); + u16 mac_via2_r(offs_t offset); + void mac_via2_w(offs_t offset, u16 data, u16 mem_mask); + u8 mac_via_in_a(); + u8 mac_via_in_b(); + void mac_via_out_a(u8 data); + void mac_via_out_b(u8 data); + u8 mac_via2_in_a(); + u8 mac_via2_in_b(); + void mac_via2_out_a(u8 data); + void mac_via2_out_b(u8 data); + void field_interrupts(); + DECLARE_WRITE_LINE_MEMBER(via_irq_w); + DECLARE_WRITE_LINE_MEMBER(via2_irq_w); + TIMER_CALLBACK_MEMBER(mac_6015_tick); + WRITE_LINE_MEMBER(via_cb2_w) { m_macadb->adb_data_w(state); } + int m_via_cycles, m_via_interrupt, m_via2_interrupt, m_scc_interrupt, m_asc_interrupt, m_last_taken_interrupt; + int m_irq_count, m_ca1_data, m_ca2_data; + + u32 rom_switch_r(offs_t offset); + bool m_overlay; + + u16 scsi_r(offs_t offset, u16 mem_mask); + void scsi_w(offs_t offset, u16 data, u16 mem_mask); + uint32_t scsi_drq_r(offs_t offset, uint32_t mem_mask = ~0); + void scsi_drq_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0); + u16 mac_scc_r(offs_t offset) + { + u16 result = m_scc->dc_ab_r(offset); + return (result << 8) | result; + } + void mac_scc_2_w(offs_t offset, u16 data) { m_scc->dc_ab_w(offset, data >> 8); } + + u16 mac_iwm_r(offs_t offset, u16 mem_mask) + { + u16 result = m_iwm->read(offset >> 8); + return (result << 8) | result; + } + void mac_iwm_w(offs_t offset, u16 data, u16 mem_mask) + { + if (ACCESSING_BITS_0_7) + m_iwm->write((offset >> 8), data & 0xff); + else + m_iwm->write((offset >> 8), data>>8); + } + + u32 buserror_r(); + + DECLARE_WRITE_LINE_MEMBER(asc_irq_w) + { + m_asc_interrupt = state; + field_interrupts(); + } + + // ID for PowerBook Duo 210 + u32 pd210_id_r() { return 0xa55a1004; } + + uint8_t mac_gsc_r(offs_t offset); + void mac_gsc_w(uint8_t data); + void macgsc_palette(palette_device &palette) const; + + uint32_t macwd_r(offs_t offset, uint32_t mem_mask = ~0); + void macwd_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0); + + u32 m_colors[3], m_count, m_clutoffs, m_wd_palette[256]; +}; + +// 4-level grayscale +void macpb030_state::macgsc_palette(palette_device &palette) const +{ + palette.set_pen_color(0, 0xff, 0xff, 0xff); + palette.set_pen_color(1, 0x7f, 0x7f, 0x7f); + palette.set_pen_color(2, 0x3f, 0x3f, 0x3f); + palette.set_pen_color(3, 0x00, 0x00, 0x00); +} + +u32 macpb030_state::buserror_r() +{ + m_maincpu->set_input_line(M68K_LINE_BUSERROR, ASSERT_LINE); + m_maincpu->set_input_line(M68K_LINE_BUSERROR, CLEAR_LINE); + return 0; +} + +void macpb030_state::field_interrupts() +{ + int take_interrupt = -1; + + if (m_scc_interrupt) + { + take_interrupt = 4; + } + else if (m_via2_interrupt) + { + take_interrupt = 2; + } + else if (m_via_interrupt) + { + take_interrupt = 1; + } + + if (m_last_taken_interrupt > -1) + { + m_maincpu->set_input_line(m_last_taken_interrupt, CLEAR_LINE); + m_last_taken_interrupt = -1; + } + + if (take_interrupt > -1) + { + m_maincpu->set_input_line(take_interrupt, ASSERT_LINE); + m_last_taken_interrupt = take_interrupt; + } +} + +void macpb030_state::machine_start() +{ + m_ram_ptr = (u32*)m_ram->pointer(); + m_ram_size = m_ram->size()>>1; + m_ram_mask = m_ram_size - 1; + m_rom_ptr = (u32*)memregion("bootrom")->base(); + m_rom_size = memregion("bootrom")->bytes(); + m_via_cycles = -50; + m_via_interrupt = m_via2_interrupt = m_scc_interrupt = m_asc_interrupt = 0; + m_last_taken_interrupt = -1; + m_irq_count = m_ca1_data = m_ca2_data = 0; + + m_6015_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(macpb030_state::mac_6015_tick),this)); + m_6015_timer->adjust(attotime::never); +} + +void macpb030_state::machine_reset() +{ + m_overlay = true; + m_via_interrupt = m_via2_interrupt = m_scc_interrupt = m_asc_interrupt = 0; + m_last_taken_interrupt = -1; + m_irq_count = m_ca1_data = m_ca2_data = 0; + + // put ROM mirror at 0 + address_space& space = m_maincpu->space(AS_PROGRAM); + const u32 memory_size = std::min((u32)0x3fffff, m_rom_size); + const u32 memory_end = memory_size - 1; + offs_t memory_mirror = memory_end & ~(memory_size - 1); + + space.unmap_write(0x00000000, memory_end); + space.install_read_bank(0x00000000, memory_end & ~memory_mirror, memory_mirror, "bank1"); + membank("bank1")->set_base(m_rom_ptr); + + // start 60.15 Hz timer + m_6015_timer->adjust(attotime::from_hz(60.15), 0, attotime::from_hz(60.15)); +} + +void macpb030_state::init_macpb140() +{ +} + +void macpb030_state::init_macpb160() +{ +} + +u32 macpb030_state::screen_update_macpb140(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + u16 const *const video_ram = (const uint16_t *)m_vram.target(); + + for (int y = 0; y < 400; y++) + { + u16 *const line = &bitmap.pix(y); + + for (int x = 0; x < 640; x += 16) + { + uint16_t const word = video_ram[((y * 640) / 16) + ((x / 16) ^ 1)]; + for (int b = 0; b < 16; b++) + { + line[x + b] = (word >> (15 - b)) & 0x0001; + } + } + } + return 0; +} + +u32 macpb030_state::screen_update_macpb160(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + u8 const *const vram8 = (uint8_t *)m_vram.target(); + + for (int y = 0; y < 400; y++) + { + u16 *line = &bitmap.pix(y); + + for (int x = 0; x < 640 / 4; x++) + { + uint8_t const pixels = vram8[(y * 160) + (BYTE4_XOR_BE(x))]; + + *line++ = ((pixels >> 6) & 3); + *line++ = ((pixels >> 4) & 3); + *line++ = ((pixels >> 2) & 3); + *line++ = (pixels & 3); + } + } + return 0; +} + +u32 macpb030_state::screen_update_macpbwd(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) /* Color PowerBooks using an off-the-shelf WD video chipset */ +{ + u8 const *vram8 = (uint8_t *)m_vram.target(); + + // vram8 += 0x40000; + + for (int y = 0; y < 480; y++) + { + u32 *scanline = &bitmap.pix(y); + for (int x = 0; x < 640; x++) + { + uint8_t const pixels = vram8[(y * 640) + (BYTE4_XOR_BE(x))]; + *scanline++ = m_wd_palette[pixels]; + } + } + + return 0; +} + +u16 macpb030_state::mac_via_r(offs_t offset) +{ + u16 data; + + offset >>= 8; + offset &= 0x0f; + + data = m_via1->read(offset); + + m_maincpu->adjust_icount(m_via_cycles); + + return (data & 0xff) | (data << 8); +} + +void macpb030_state::mac_via_w(offs_t offset, u16 data, u16 mem_mask) +{ + offset >>= 8; + offset &= 0x0f; + + if (ACCESSING_BITS_0_7) + m_via1->write(offset, data & 0xff); + if (ACCESSING_BITS_8_15) + m_via1->write(offset, (data >> 8) & 0xff); + + m_maincpu->adjust_icount(m_via_cycles); +} + +uint16_t macpb030_state::mac_via2_r(offs_t offset) +{ + int data; + + offset >>= 8; + offset &= 0x0f; + + data = m_via2->read(offset); + return (data & 0xff) | (data << 8); +} + +void macpb030_state::mac_via2_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + offset >>= 8; + offset &= 0x0f; + + if (ACCESSING_BITS_0_7) + m_via2->write(offset, data & 0xff); + if (ACCESSING_BITS_8_15) + m_via2->write(offset, (data >> 8) & 0xff); +} + +WRITE_LINE_MEMBER(macpb030_state::via_irq_w) +{ + m_via_interrupt = state; + field_interrupts(); +} + +WRITE_LINE_MEMBER(macpb030_state::via2_irq_w) +{ + m_via2_interrupt = state; + field_interrupts(); +} + +u32 macpb030_state::rom_switch_r(offs_t offset) +{ + // disable the overlay + if (m_overlay) + { + address_space& space = m_maincpu->space(AS_PROGRAM); + const u32 memory_end = m_ram->size() - 1; + void *memory_data = m_ram->pointer(); + offs_t memory_mirror = memory_end & ~memory_end; + + space.install_readwrite_bank(0x00000000, memory_end & ~memory_mirror, memory_mirror, "bank1"); + membank("bank1")->set_base(memory_data); + m_overlay = false; + } + + //printf("rom_switch_r: offset %08x ROM_size -1 = %08x, masked = %08x\n", offset, m_rom_size-1, offset & ((m_rom_size - 1)>>2)); + + return m_rom_ptr[offset & ((m_rom_size - 1)>>2)]; +} + +TIMER_CALLBACK_MEMBER(macpb030_state::mac_6015_tick) +{ + /* signal VBlank on CA1 input on the VIA */ + m_ca1_data ^= 1; + m_via1->write_ca1(m_ca1_data); + + if (++m_irq_count == 60) + { + m_irq_count = 0; + + m_ca2_data ^= 1; + /* signal 1 Hz irq on CA2 input on the VIA */ + m_via1->write_ca2(m_ca2_data); + } +} + +u16 macpb030_state::scsi_r(offs_t offset, u16 mem_mask) +{ + int reg = (offset >> 3) & 0xf; + + // logerror("macplus_scsi_r: offset %x mask %x\n", offset, mem_mask); + + if ((reg == 6) && (offset == 0x130)) + { + reg = R5380_CURDATA_DTACK; + } + + return m_ncr5380->ncr5380_read_reg(reg) << 8; +} + +void macpb030_state::scsi_w(offs_t offset, u16 data, u16 mem_mask) +{ + int reg = (offset >> 3) & 0xf; + + // logerror("macplus_scsi_w: data %x offset %x mask %x\n", data, offset, mem_mask); + + if ((reg == 0) && (offset == 0x100)) + { + reg = R5380_OUTDATA_DTACK; + } + + m_ncr5380->ncr5380_write_reg(reg, data); +} + +uint32_t macpb030_state::scsi_drq_r(offs_t offset, uint32_t mem_mask) +{ + switch (mem_mask) + { + case 0xff000000: + return m_ncr5380->ncr5380_read_reg(R5380_CURDATA_DTACK)<<24; + + case 0xffff0000: + return (m_ncr5380->ncr5380_read_reg(R5380_CURDATA_DTACK)<<24) | (m_ncr5380->ncr5380_read_reg(R5380_CURDATA_DTACK)<<16); + + case 0xffffffff: + return (m_ncr5380->ncr5380_read_reg(R5380_CURDATA_DTACK)<<24) | (m_ncr5380->ncr5380_read_reg(R5380_CURDATA_DTACK)<<16) | (m_ncr5380->ncr5380_read_reg(R5380_CURDATA_DTACK)<<8) | m_ncr5380->ncr5380_read_reg(R5380_CURDATA_DTACK); + + default: + logerror("scsi_drq_r: unknown mem_mask %08x\n", mem_mask); + } + + return 0; +} + +void macpb030_state::scsi_drq_w(offs_t offset, uint32_t data, uint32_t mem_mask) +{ + switch (mem_mask) + { + case 0xff000000: + m_ncr5380->ncr5380_write_reg(R5380_OUTDATA_DTACK, data>>24); + break; + + case 0xffff0000: + m_ncr5380->ncr5380_write_reg(R5380_OUTDATA_DTACK, data>>24); + m_ncr5380->ncr5380_write_reg(R5380_OUTDATA_DTACK, data>>16); + break; + + case 0xffffffff: + m_ncr5380->ncr5380_write_reg(R5380_OUTDATA_DTACK, data>>24); + m_ncr5380->ncr5380_write_reg(R5380_OUTDATA_DTACK, data>>16); + m_ncr5380->ncr5380_write_reg(R5380_OUTDATA_DTACK, data>>8); + m_ncr5380->ncr5380_write_reg(R5380_OUTDATA_DTACK, data&0xff); + break; + + default: + logerror("scsi_drq_w: unknown mem_mask %08x\n", mem_mask); + break; + } +} + +uint8_t macpb030_state::mac_gsc_r(offs_t offset) +{ + if (offset == 1) + { + return 5; + } + + return 0; +} + +void macpb030_state::mac_gsc_w(uint8_t data) +{ +} + +uint32_t macpb030_state::macwd_r(offs_t offset, uint32_t mem_mask) +{ + switch (offset) + { + case 0xf6: + if (m_screen->vblank()) + { + return 0xffffffff; + } + else + { + return 0; + } + + default: + // printf("macwd_r: @ %x, mask %08x (PC=%x)\n", offset, mem_mask, m_maincpu->pc()); + break; + } + return 0; +} + +void macpb030_state::macwd_w(offs_t offset, uint32_t data, uint32_t mem_mask) +{ + switch (offset) + { + case 0xf2: + if (mem_mask == 0xff000000) // DAC control + { + m_clutoffs = data >> 24; + m_count = 0; + } + else if (mem_mask == 0x00ff0000) // DAC data + { + m_colors[m_count++] = (data >> 16) & 0xff; + if (m_count == 3) + { + // printf("RAMDAC: color %d = %02x %02x %02x\n", m_rbv_clutoffs, m_rbv_colors[0], m_rbv_colors[1], m_rbv_colors[2]); + m_wd_palette[m_clutoffs] = rgb_t(m_colors[0], m_colors[1], m_colors[2]); + m_clutoffs++; + m_count = 0; + } + } + else + { + printf("macwd: Unknown DAC write, data %08x, mask %08x\n", data, mem_mask); + } + break; + + default: + // printf("macwd_w: %x @ %x, mask %08x (PC=%x)\n", data, offset, mem_mask, m_maincpu->pc()); + break; + } +} + +/*************************************************************************** + ADDRESS MAPS +****************************************************************************/ + +// ROM detects the "Jaws" ASIC by checking for I/O space mirrored at 0x01000000 boundries +void macpb030_state::macpb140_map(address_map &map) +{ + map(0x40000000, 0x400fffff).r(FUNC(macpb030_state::rom_switch_r)).mirror(0x0ff00000); + + map(0x50000000, 0x50001fff).rw(FUNC(macpb030_state::mac_via_r), FUNC(macpb030_state::mac_via_w)).mirror(0x01f00000); + map(0x50002000, 0x50003fff).rw(FUNC(macpb030_state::mac_via2_r), FUNC(macpb030_state::mac_via2_w)).mirror(0x01f00000); + map(0x50004000, 0x50005fff).rw(FUNC(macpb030_state::mac_scc_r), FUNC(macpb030_state::mac_scc_2_w)).mirror(0x01f00000); + map(0x50006000, 0x50007fff).rw(FUNC(macpb030_state::scsi_drq_r), FUNC(macpb030_state::scsi_drq_w)).mirror(0x01f00000); + map(0x50010000, 0x50011fff).rw(FUNC(macpb030_state::scsi_r), FUNC(macpb030_state::scsi_w)).mirror(0x01f00000); + map(0x50012060, 0x50012063).r(FUNC(macpb030_state::scsi_drq_r)).mirror(0x01f00000); + map(0x50014000, 0x50015fff).rw(m_asc, FUNC(asc_device::read), FUNC(asc_device::write)).mirror(0x01f00000); + map(0x50016000, 0x50017fff).rw(FUNC(macpb030_state::mac_iwm_r), FUNC(macpb030_state::mac_iwm_w)).mirror(0x01f00000); + map(0x50024000, 0x50027fff).r(FUNC(macpb030_state::buserror_r)).mirror(0x01f00000); // bus error here to make sure we aren't mistaken for another decoder + + map(0xfee08000, 0xfeffffff).ram().share("vram"); +} + +void macpb030_state::macpb160_map(address_map &map) +{ + map(0x40000000, 0x400fffff).r(FUNC(macpb030_state::rom_switch_r)).mirror(0x0ff00000); + + map(0x50f00000, 0x50f01fff).rw(FUNC(macpb030_state::mac_via_r), FUNC(macpb030_state::mac_via_w)); + map(0x50f02000, 0x50f03fff).rw(FUNC(macpb030_state::mac_via2_r), FUNC(macpb030_state::mac_via2_w)); + map(0x50f04000, 0x50f05fff).rw(FUNC(macpb030_state::mac_scc_r), FUNC(macpb030_state::mac_scc_2_w)); + map(0x50f06000, 0x50f07fff).rw(FUNC(macpb030_state::scsi_drq_r), FUNC(macpb030_state::scsi_drq_w)); + map(0x50f10000, 0x50f11fff).rw(FUNC(macpb030_state::scsi_r), FUNC(macpb030_state::scsi_w)); + map(0x50f12060, 0x50f12063).r(FUNC(macpb030_state::scsi_drq_r)); + map(0x50f14000, 0x50f15fff).rw(m_asc, FUNC(asc_device::read), FUNC(asc_device::write)); + map(0x50f16000, 0x50f17fff).rw(FUNC(macpb030_state::mac_iwm_r), FUNC(macpb030_state::mac_iwm_w)); + map(0x50f20000, 0x50f21fff).rw(FUNC(macpb030_state::mac_gsc_r), FUNC(macpb030_state::mac_gsc_w)); + map(0x50f24000, 0x50f27fff).r(FUNC(macpb030_state::buserror_r)); // bus error here to make sure we aren't mistaken for another decoder + + map(0x60000000, 0x6001ffff).ram().share("vram").mirror(0x0ffe0000); +} + +void macpb030_state::macpb165c_map(address_map &map) +{ + map(0x40000000, 0x400fffff).r(FUNC(macpb030_state::rom_switch_r)).mirror(0x0ff00000); + + map(0x50f00000, 0x50f01fff).rw(FUNC(macpb030_state::mac_via_r), FUNC(macpb030_state::mac_via_w)); + map(0x50f02000, 0x50f03fff).rw(FUNC(macpb030_state::mac_via2_r), FUNC(macpb030_state::mac_via2_w)); + map(0x50f04000, 0x50f05fff).rw(FUNC(macpb030_state::mac_scc_r), FUNC(macpb030_state::mac_scc_2_w)); + map(0x50f06000, 0x50f07fff).rw(FUNC(macpb030_state::scsi_drq_r), FUNC(macpb030_state::scsi_drq_w)); + map(0x50f10000, 0x50f11fff).rw(FUNC(macpb030_state::scsi_r), FUNC(macpb030_state::scsi_w)); + map(0x50f12060, 0x50f12063).r(FUNC(macpb030_state::scsi_drq_r)); + map(0x50f14000, 0x50f15fff).rw(m_asc, FUNC(asc_device::read), FUNC(asc_device::write)); + map(0x50f16000, 0x50f17fff).rw(FUNC(macpb030_state::mac_iwm_r), FUNC(macpb030_state::mac_iwm_w)); + map(0x50f20000, 0x50f21fff).r(FUNC(macpb030_state::buserror_r)); // bus error here to detect we're not the grayscale 160/165/180 + map(0x50f24000, 0x50f27fff).r(FUNC(macpb030_state::buserror_r)); // bus error here to make sure we aren't mistaken for another decoder + + // on-board color video on 165c/180c + map(0xfc000000, 0xfc07ffff).ram().share("vram").mirror(0x00380000); // 512k of VRAM + map(0xfc400000, 0xfcefffff).rw(FUNC(macpb030_state::macwd_r), FUNC(macpb030_state::macwd_w)); + // fc4003c8 = DAC control, fc4003c9 = DAC data + // fc4003da bit 3 is VBL + map(0xfcff8000, 0xfcffffff).rom().region("vrom", 0x0000); +} + +void macpb030_state::macpd210_map(address_map &map) +{ + map(0x40000000, 0x400fffff).r(FUNC(macpb030_state::rom_switch_r)).mirror(0x0ff00000); + + map(0x50f00000, 0x50f01fff).rw(FUNC(macpb030_state::mac_via_r), FUNC(macpb030_state::mac_via_w)); + map(0x50f02000, 0x50f03fff).rw(FUNC(macpb030_state::mac_via2_r), FUNC(macpb030_state::mac_via2_w)); + map(0x50f04000, 0x50f05fff).rw(FUNC(macpb030_state::mac_scc_r), FUNC(macpb030_state::mac_scc_2_w)); + map(0x50f06000, 0x50f07fff).rw(FUNC(macpb030_state::scsi_drq_r), FUNC(macpb030_state::scsi_drq_w)); + map(0x50f10000, 0x50f11fff).rw(FUNC(macpb030_state::scsi_r), FUNC(macpb030_state::scsi_w)); + map(0x50f12060, 0x50f12063).r(FUNC(macpb030_state::scsi_drq_r)); + map(0x50f14000, 0x50f15fff).rw(m_asc, FUNC(asc_device::read), FUNC(asc_device::write)); + map(0x50f16000, 0x50f17fff).rw(FUNC(macpb030_state::mac_iwm_r), FUNC(macpb030_state::mac_iwm_w)); + map(0x50f20000, 0x50f21fff).rw(FUNC(macpb030_state::mac_gsc_r), FUNC(macpb030_state::mac_gsc_w)); + map(0x50f24000, 0x50f27fff).r(FUNC(macpb030_state::buserror_r)); // bus error here to make sure we aren't mistaken for another decoder + + map(0x5ffffffc, 0x5fffffff).r(FUNC(macpb030_state::pd210_id_r)); + + map(0x60000000, 0x6001ffff).ram().share("vram").mirror(0x0ffe0000); +} + +u8 macpb030_state::mac_via_in_a() +{ + return 0x81 | 0x12; +} + +u8 macpb030_state::mac_via_in_b() +{ + int val = 0; + // TODO: is this valid for VIA2 PMU machines? + /* video beam in display (! VBLANK && ! HBLANK basically) */ + + if (m_screen->vpos() >= 480) + val |= 0x40; + + // printf("%s VIA1 IN_B = %02x\n", machine().describe_context().c_str(), val); + + return val; +} + +void macpb030_state::mac_via_out_a(u8 data) +{ + sony_set_sel_line(m_iwm.target(), (data & 0x20) >> 5); +} + +void macpb030_state::mac_via_out_b(u8 data) +{ +} + +u8 macpb030_state::mac_via2_in_a() +{ + return m_macadb->get_pm_data_recv(); +} + +u8 macpb030_state::mac_via2_in_b() +{ + if (m_macadb->get_pm_ack() == 2) + { + return 0xcf; + } + else + { + return 0xcd; + } +} + +void macpb030_state::mac_via2_out_a(u8 data) +{ + m_macadb->set_pm_data_send(data); +} + +void macpb030_state::mac_via2_out_b(u8 data) +{ + m_macadb->pmu_req_w((data >> 2) & 1); +} + +/*************************************************************************** + DEVICE CONFIG +***************************************************************************/ + +static const applefdc_interface mac_iwm_interface = +{ + sony_set_lines, + sony_set_enable_lines, + + sony_read_data, + sony_write_data, + sony_read_status +}; + +static const floppy_interface mac_floppy_interface = +{ + FLOPPY_STANDARD_3_5_DSHD, + LEGACY_FLOPPY_OPTIONS_NAME(apple35_mac), + "floppy_3_5" +}; + +static INPUT_PORTS_START( macadb ) +INPUT_PORTS_END + +/*************************************************************************** + MACHINE DRIVERS +***************************************************************************/ + +void macpb030_state::macpb140(machine_config &config) +{ + M68030(config, m_maincpu, C15M); + m_maincpu->set_addrmap(AS_PROGRAM, &macpb030_state::macpb140_map); + + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60.15); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(1260)); + m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); + m_screen->set_size(700, 480); + m_screen->set_visarea(0, 639, 0, 399); + m_screen->set_palette(m_palette); + m_screen->set_screen_update(FUNC(macpb030_state::screen_update_macpb140)); + + PALETTE(config, m_palette, palette_device::MONOCHROME_INVERTED); + + MACADB(config, m_macadb, C15M); + m_macadb->set_pmu_mode(true); + m_macadb->set_pmu_is_via1(false); + + LEGACY_IWM(config, m_iwm, &mac_iwm_interface); + sonydriv_floppy_image_device::legacy_2_drives_add(config, &mac_floppy_interface); + + scsi_port_device &scsibus(SCSI_PORT(config, "scsi")); + scsibus.set_slot_device(1, "harddisk", SCSIHD, DEVICE_INPUT_DEFAULTS_NAME(SCSI_ID_6)); + scsibus.set_slot_device(2, "harddisk", SCSIHD, DEVICE_INPUT_DEFAULTS_NAME(SCSI_ID_5)); + + NCR5380(config, m_ncr5380, C7M); + m_ncr5380->set_scsi_port("scsi"); + + SCC85C30(config, m_scc, C7M); +// m_scc->intrq_callback().set(FUNC(macpb030_state::set_scc_interrupt)); + + VIA6522(config, m_via1, C7M/10); + m_via1->readpa_handler().set(FUNC(macpb030_state::mac_via_in_a)); + m_via1->readpb_handler().set(FUNC(macpb030_state::mac_via_in_b)); + m_via1->writepa_handler().set(FUNC(macpb030_state::mac_via_out_a)); + m_via1->writepb_handler().set(FUNC(macpb030_state::mac_via_out_b)); + m_via1->irq_handler().set(FUNC(macpb030_state::via_irq_w)); + m_via1->cb2_handler().set(FUNC(macpb030_state::via_cb2_w)); + + VIA6522(config, m_via2, C7M/10); + m_via2->readpa_handler().set(FUNC(macpb030_state::mac_via2_in_a)); + m_via2->readpb_handler().set(FUNC(macpb030_state::mac_via2_in_b)); + m_via2->writepa_handler().set(FUNC(macpb030_state::mac_via2_out_a)); + m_via2->writepb_handler().set(FUNC(macpb030_state::mac_via2_out_b)); + m_via2->irq_handler().set(FUNC(macpb030_state::via2_irq_w)); + + SPEAKER(config, "lspeaker").front_left(); + SPEAKER(config, "rspeaker").front_right(); + ASC(config, m_asc, C15M, asc_device::asc_type::ASC); + m_asc->irqf_callback().set(FUNC(macpb030_state::asc_irq_w)); + m_asc->add_route(0, "lspeaker", 1.0); + m_asc->add_route(1, "rspeaker", 1.0); + + /* internal ram */ + RAM(config, m_ram); + m_ram->set_default_size("2M"); + m_ram->set_extra_options("4M,6M,8M"); + + SOFTWARE_LIST(config, "flop35_list").set_original("mac_flop"); +} + +// PowerBook 145 = 140 @ 25 MHz (still 2MB RAM - the 145B upped that to 4MB) +void macpb030_state::macpb145(machine_config &config) +{ + macpb140(config); + m_maincpu->set_clock(25000000); + + m_ram->set_default_size("4M"); + m_ram->set_extra_options("6M,8M"); +} + +// PowerBook 170 = 140 @ 25 MHz with an active-matrix LCD (140/145/145B were passive) +void macpb030_state::macpb170(machine_config &config) +{ + macpb140(config); + m_maincpu->set_clock(25000000); + + m_ram->set_default_size("4M"); + m_ram->set_extra_options("6M,8M"); +} + +void macpb030_state::macpb160(machine_config &config) +{ + M68030(config, m_maincpu, 25000000); + m_maincpu->set_addrmap(AS_PROGRAM, &macpb030_state::macpb160_map); + + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60.15); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(1260)); + m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); + m_screen->set_size(700, 480); + m_screen->set_visarea(0, 639, 0, 399); + m_screen->set_palette(m_palette); + m_screen->set_screen_update(FUNC(macpb030_state::screen_update_macpb160)); + + PALETTE(config, m_palette, FUNC(macpb030_state::macgsc_palette), 16); + + MACADB(config, m_macadb, C15M); + m_macadb->set_pmu_mode(true); + m_macadb->set_pmu_is_via1(false); + + LEGACY_IWM(config, m_iwm, &mac_iwm_interface); + sonydriv_floppy_image_device::legacy_2_drives_add(config, &mac_floppy_interface); + + scsi_port_device &scsibus(SCSI_PORT(config, "scsi")); + scsibus.set_slot_device(1, "harddisk", SCSIHD, DEVICE_INPUT_DEFAULTS_NAME(SCSI_ID_6)); + scsibus.set_slot_device(2, "harddisk", SCSIHD, DEVICE_INPUT_DEFAULTS_NAME(SCSI_ID_5)); + + NCR5380(config, m_ncr5380, C7M); + m_ncr5380->set_scsi_port("scsi"); + + SCC85C30(config, m_scc, C7M); + // m_scc->intrq_callback().set(FUNC(macpb030_state::set_scc_interrupt)); + + VIA6522(config, m_via1, C7M / 10); + m_via1->readpa_handler().set(FUNC(macpb030_state::mac_via_in_a)); + m_via1->readpb_handler().set(FUNC(macpb030_state::mac_via_in_b)); + m_via1->writepa_handler().set(FUNC(macpb030_state::mac_via_out_a)); + m_via1->writepb_handler().set(FUNC(macpb030_state::mac_via_out_b)); + m_via1->irq_handler().set(FUNC(macpb030_state::via_irq_w)); + m_via1->cb2_handler().set(FUNC(macpb030_state::via_cb2_w)); + + VIA6522(config, m_via2, C7M / 10); + m_via2->readpa_handler().set(FUNC(macpb030_state::mac_via2_in_a)); + m_via2->readpb_handler().set(FUNC(macpb030_state::mac_via2_in_b)); + m_via2->writepa_handler().set(FUNC(macpb030_state::mac_via2_out_a)); + m_via2->writepb_handler().set(FUNC(macpb030_state::mac_via2_out_b)); + m_via2->irq_handler().set(FUNC(macpb030_state::via2_irq_w)); + + SPEAKER(config, "lspeaker").front_left(); + SPEAKER(config, "rspeaker").front_right(); + ASC(config, m_asc, C15M, asc_device::asc_type::ASC); + m_asc->irqf_callback().set(FUNC(macpb030_state::asc_irq_w)); + m_asc->add_route(0, "lspeaker", 1.0); + m_asc->add_route(1, "rspeaker", 1.0); + + /* internal ram */ + RAM(config, m_ram); + m_ram->set_default_size("2M"); + m_ram->set_extra_options("4M,6M,8M"); + + SOFTWARE_LIST(config, "flop35_list").set_original("mac_flop"); +} + +void macpb030_state::macpb180(machine_config &config) +{ + macpb160(config); + m_maincpu->set_clock(33000000); +} + +void macpb030_state::macpb180c(machine_config &config) +{ + macpb160(config); + m_maincpu->set_clock(33000000); + m_maincpu->set_addrmap(AS_PROGRAM, &macpb030_state::macpb165c_map); + + m_screen->set_size(800, 525); + m_screen->set_visarea(0, 640 - 1, 0, 480 - 1); + m_screen->set_screen_update(FUNC(macpb030_state::screen_update_macpbwd)); + m_screen->set_no_palette(); +} + +void macpb030_state::macpd210(machine_config &config) +{ + macpb160(config); + m_maincpu->set_addrmap(AS_PROGRAM, &macpb030_state::macpd210_map); + + m_ram->set_extra_options("8M,12M,16M,20M,24M"); +} + +ROM_START(macpb140) + ROM_REGION32_BE(0x100000, "bootrom", 0) + ROM_LOAD("420dbff3.rom", 0x000000, 0x100000, CRC(88ea2081) SHA1(7a8ee468d16e64f2ad10cb8d1a45e6f07cc9e212)) + + ROM_REGION(0x1800, "pmu", 0) + ROM_LOAD("pmuv2.bin", 0x000000, 0x001800, CRC(1a32b5e5) SHA1(7c096324763cfc8d2024893b3e8493b7729b3a92)) +ROM_END + +ROM_START(macpb145) + ROM_REGION32_BE(0x100000, "bootrom", 0) + ROM_LOAD("420dbff3.rom", 0x000000, 0x100000, CRC(88ea2081) SHA1(7a8ee468d16e64f2ad10cb8d1a45e6f07cc9e212)) + + ROM_REGION(0x1800, "pmu", 0) + ROM_LOAD("pmuv2.bin", 0x000000, 0x001800, CRC(1a32b5e5) SHA1(7c096324763cfc8d2024893b3e8493b7729b3a92)) +ROM_END + +ROM_START(macpb145b) + ROM_REGION32_BE(0x100000, "bootrom", 0) + ROM_LOAD("420dbff3.rom", 0x000000, 0x100000, CRC(88ea2081) SHA1(7a8ee468d16e64f2ad10cb8d1a45e6f07cc9e212)) + + ROM_REGION(0x1800, "pmu", 0) + ROM_LOAD("pmuv2.bin", 0x000000, 0x001800, CRC(1a32b5e5) SHA1(7c096324763cfc8d2024893b3e8493b7729b3a92)) +ROM_END + +ROM_START(macpb170) + ROM_REGION32_BE(0x100000, "bootrom", 0) + ROM_LOAD("420dbff3.rom", 0x000000, 0x100000, CRC(88ea2081) SHA1(7a8ee468d16e64f2ad10cb8d1a45e6f07cc9e212)) + + ROM_REGION(0x1800, "pmu", 0) + ROM_LOAD("pmuv2.bin", 0x000000, 0x001800, CRC(1a32b5e5) SHA1(7c096324763cfc8d2024893b3e8493b7729b3a92)) +ROM_END + +ROM_START(macpb160) + ROM_REGION32_BE(0x100000, "bootrom", 0) + ROM_LOAD("e33b2724.rom", 0x000000, 0x100000, CRC(536c60f4) SHA1(c0510682ae6d973652d7e17f3c3b27629c47afac)) + + ROM_REGION(0x1800, "pmu", 0) + ROM_LOAD("pmuv3.bin", 0x000000, 0x001800, CRC(f2df696c) SHA1(fc312cbfd407c6f0248c6463910e41ad6b5b0daa)) +ROM_END + +ROM_START(macpb180) + ROM_REGION32_BE(0x100000, "bootrom", 0) + ROM_LOAD("e33b2724.rom", 0x000000, 0x100000, CRC(536c60f4) SHA1(c0510682ae6d973652d7e17f3c3b27629c47afac)) + + ROM_REGION(0x1800, "pmu", 0) + ROM_LOAD("pmuv3.bin", 0x000000, 0x001800, CRC(f2df696c) SHA1(fc312cbfd407c6f0248c6463910e41ad6b5b0daa)) +ROM_END + +ROM_START(macpb180c) + ROM_REGION32_BE(0x100000, "bootrom", 0) + ROM_LOAD("e33b2724.rom", 0x000000, 0x100000, CRC(536c60f4) SHA1(c0510682ae6d973652d7e17f3c3b27629c47afac)) + + ROM_REGION32_BE(0x8000, "vrom", 0) + ROM_LOAD("pb180cvrom.bin", 0x0000, 0x8000, CRC(810c75ad) SHA1(3a936e97dee5ceeb25e50197ef504e514ae689a4)) + + ROM_REGION(0x1800, "pmu", 0) + ROM_LOAD("pmuv3.bin", 0x000000, 0x001800, CRC(f2df696c) SHA1(fc312cbfd407c6f0248c6463910e41ad6b5b0daa)) +ROM_END + +ROM_START(macpd210) + ROM_REGION32_BE(0x100000, "bootrom", 0) + ROM_LOAD("ecfa989b.rom", 0x000000, 0x100000, CRC(b86ed854) SHA1(ed1371c97117a5884da4a6605ecfc5abed48ae5a)) +ROM_END + +COMP(1991, macpb140, 0, 0, macpb140, macadb, macpb030_state, init_macpb140, "Apple Computer", "Macintosh PowerBook 140", MACHINE_NOT_WORKING) +COMP(1991, macpb170, macpb140, 0, macpb170, macadb, macpb030_state, init_macpb140, "Apple Computer", "Macintosh PowerBook 170", MACHINE_NOT_WORKING) +COMP(1992, macpb145, macpb140, 0, macpb145, macadb, macpb030_state, init_macpb140, "Apple Computer", "Macintosh PowerBook 145", MACHINE_NOT_WORKING) +COMP(1992, macpb145b, macpb140, 0, macpb170, macadb, macpb030_state, init_macpb140, "Apple Computer", "Macintosh PowerBook 145B", MACHINE_NOT_WORKING) +COMP(1992, macpb160, 0, 0, macpb160, macadb, macpb030_state, init_macpb160, "Apple Computer", "Macintosh PowerBook 160", MACHINE_NOT_WORKING) +COMP(1992, macpb180, macpb160, 0, macpb180, macadb, macpb030_state, init_macpb160, "Apple Computer", "Macintosh PowerBook 180", MACHINE_NOT_WORKING) +COMP(1992, macpb180c, macpb160, 0, macpb180c,macadb, macpb030_state, init_macpb160, "Apple Computer", "Macintosh PowerBook 180c", MACHINE_NOT_WORKING) + +// PowerBook Duos (may or may not belong in this driver ultimately) +COMP( 1992, macpd210, 0, 0, macpd210, macadb, macpb030_state, init_macpb160, "Apple Computer", "Macintosh PowerBook Duo 210", MACHINE_NOT_WORKING ) diff --git a/src/mame/drivers/megadriv_rad.cpp b/src/mame/drivers/megadriv_rad.cpp index fb4c4d52d2f..85c67b38602 100644 --- a/src/mame/drivers/megadriv_rad.cpp +++ b/src/mame/drivers/megadriv_rad.cpp @@ -180,6 +180,11 @@ ROM_START( rad_gen1 ) ROM_LOAD16_WORD_SWAP( "radicav1.bin", 0x000000, 0x400000, CRC(3b4c8438) SHA1(5ed9c053f9ebc8d4bf571d57e562cf347585d158) ) ROM_END +ROM_START( rad_md1 ) + ROM_REGION( 0x400000, "maincpu", 0 ) + ROM_LOAD16_WORD_SWAP( "radica.bin", 0x000000, 0x400000, CRC(85867db1) SHA1(ddc596e2e68dc872bc0679a2de7a295b4c6d6b8e) ) +ROM_END + ROM_START( rad_gen2 ) ROM_REGION( 0x400000, "maincpu", 0 ) ROM_LOAD16_WORD_SWAP( "genesisred.bin", 0x000000, 0x400000, CRC(7c1a0f0e) SHA1(a6441f75a4cd48f1563aeafdfbdde00202d4067c) ) @@ -220,13 +225,18 @@ void megadriv_radica_state::init_megadriv_radica_6button_ntsc() } -CONS( 2004, rad_gen1, 0, 0, megadriv_radica_3button_ntsc, megadriv_radica_3button_1player, megadriv_radica_state, init_megadriv, "Radica / Sega", "Genesis Collection Volume 1 (Radica, Arcade Legends) (USA)", 0) -CONS( 2004, rad_gen2, 0, 0, megadriv_radica_3button_ntsc, megadriv_radica_3button_1player, megadriv_radica_state, init_megadriv, "Radica / Sega", "Genesis Collection Volume 2 (Radica, Arcade Legends) (USA)", 0) -CONS( 2004, rad_sonic, 0, 0, megadriv_radica_3button_ntsc, megadriv_radica_3button_1player, megadriv_radica_state, init_megadriv, "Radica / Sega", "Super Sonic Gold (Radica Plug & Play) (USA)", 0) // box calls this Volume 3 +CONS( 2004, rad_gen1, 0, 0, megadriv_radica_3button_ntsc, megadriv_radica_3button_1player, megadriv_radica_state, init_megadriv, "Radica / Sega", "Genesis Collection Volume 1 (Radica, Arcade Legends) (USA)", 0) +CONS( 2004, rad_md1, rad_gen1, 0, megadriv_radica_3button_pal, megadriv_radica_3button_1player, megadriv_radica_state, init_megadrie, "Radica / Sega", "Mega Drive Collection Volume 1 (Radica, Arcade Legends) (Europe)", 0) + +CONS( 2004, rad_gen2, 0, 0, megadriv_radica_3button_ntsc, megadriv_radica_3button_1player, megadriv_radica_state, init_megadriv, "Radica / Sega", "Genesis Collection Volume 2 (Radica, Arcade Legends) (USA)", 0) + +// box calls this Volume 3 +CONS( 2004, rad_sonic, 0, 0, megadriv_radica_3button_ntsc, megadriv_radica_3button_1player, megadriv_radica_state, init_megadriv, "Radica / Sega", "Super Sonic Gold (Radica Plug & Play) (USA)", 0) -CONS( 2004, rad_sf2, 0, 0, megadriv_radica_6button_ntsc, megadriv_radica_6button, megadriv_radica_state, init_megadriv_radica_6button_ntsc,"Radica / Capcom / Sega", "Street Fighter II: Special Champion Edition [Ghouls'n Ghosts] (Radica, Arcade Legends) (USA)", 0) -CONS( 2004, rad_sf2p, rad_sf2,0, megadriv_radica_6button_pal, megadriv_radica_6button, megadriv_radica_state, init_megadriv_radica_6button_pal, "Radica / Capcom / Sega", "Street Fighter II: Special Champion Edition [Ghouls'n Ghosts] (Radica, Arcade Legends) (Europe)", 0) +CONS( 2004, rad_sf2, 0, 0, megadriv_radica_6button_ntsc, megadriv_radica_6button, megadriv_radica_state, init_megadriv_radica_6button_ntsc,"Radica / Capcom / Sega", "Street Fighter II: Special Champion Edition [Ghouls'n Ghosts] (Radica, Arcade Legends) (USA)", 0) +CONS( 2004, rad_sf2p, rad_sf2, 0, megadriv_radica_6button_pal, megadriv_radica_6button, megadriv_radica_state, init_megadriv_radica_6button_pal, "Radica / Capcom / Sega", "Street Fighter II: Special Champion Edition [Ghouls'n Ghosts] (Radica, Arcade Legends) (Europe)", 0) -CONS( 2004, rad_ssoc, 0, 0, megadriv_radica_3button_pal, megadriv_radica_3button, megadriv_radica_state, init_megadrie, "Radica / Sensible Software / Sega", "Sensible Soccer plus [Cannon Fodder, Mega lo Mania] (Radica, Arcade Legends) (Europe)", 0) // still branded as Arcade Legends even if none of these were ever arcade games +// still branded as Arcade Legends even if none of these were ever arcade games, European exclusive +CONS( 2004, rad_ssoc, 0, 0, megadriv_radica_3button_pal, megadriv_radica_3button, megadriv_radica_state, init_megadrie, "Radica / Sensible Software / Sega", "Sensible Soccer plus [Cannon Fodder, Mega lo Mania] (Radica, Arcade Legends) (Europe)", 0) -CONS( 2004, rad_orun, 0, 0, megadriv_radica_3button_pal, megadriv_radica_3button_1player, megadriv_radica_state, init_megadrie, "Radica / Sega", "Out Run 2019 (Radica Plug & Play, Europe)", 0) +CONS( 2004, rad_orun, 0, 0, megadriv_radica_3button_pal, megadriv_radica_3button_1player, megadriv_radica_state, init_megadrie, "Radica / Sega", "Out Run 2019 (Radica Plug & Play, Europe)", 0) diff --git a/src/mame/drivers/ms0515.cpp b/src/mame/drivers/ms0515.cpp index 5adf16996ad..44cd5692db2 100644 --- a/src/mame/drivers/ms0515.cpp +++ b/src/mame/drivers/ms0515.cpp @@ -68,19 +68,23 @@ public: , m_maincpu(*this, "maincpu") , m_ram(*this, RAM_TAG) , m_fdc(*this, "vg93") - , m_floppy0(*this, "vg93:0:525qd") - , m_floppy1(*this, "vg93:1:525qd") + , m_floppies(*this, "vg93:%u", 0U) , m_i8251line(*this, "i8251line") , m_rs232(*this, "rs232") , m_i8251kbd(*this, "i8251kbd") , m_ms7004(*this, "ms7004") , m_pit8253(*this, "pit8253") , m_speaker(*this, "speaker") + , m_bank(*this, "bank%u", 0U) + , m_led9(*this, "led9") + , m_led16(*this, "led16") + , m_led17(*this, "led17") { } void ms0515(machine_config &config); protected: + virtual void machine_start() override; virtual void machine_reset() override; private: @@ -116,14 +120,17 @@ private: required_device<t11_device> m_maincpu; // actual CPU is T11 clone, KR1807VM1 required_device<ram_device> m_ram; required_device<kr1818vg93_device> m_fdc; - required_device<floppy_image_device> m_floppy0; - required_device<floppy_image_device> m_floppy1; + required_device_array<floppy_connector, 2> m_floppies; required_device<i8251_device> m_i8251line; required_device<rs232_port_device> m_rs232; required_device<i8251_device> m_i8251kbd; required_device<ms7004_device> m_ms7004; required_device<pit8253_device> m_pit8253; required_device<speaker_sound_device> m_speaker; + required_memory_bank_array<7> m_bank; + output_finder<> m_led9; + output_finder<> m_led16; + output_finder<> m_led17; uint8_t *m_video_ram; uint8_t m_sysrega, m_sysregc; @@ -199,30 +206,30 @@ void ms0515_state::ms0515_bank_w(uint16_t data) m_bankreg = data; - membank("bank0")->set_base(ram + 0000000 + BIT(data, 0) * 0160000); - membank("bank1")->set_base(ram + 0020000 + BIT(data, 1) * 0160000); - membank("bank2")->set_base(ram + 0040000 + BIT(data, 2) * 0160000); - membank("bank3")->set_base(ram + 0060000 + BIT(data, 3) * 0160000); - membank("bank4")->set_base(ram + 0100000 + BIT(data, 4) * 0160000); - membank("bank5")->set_base(ram + 0120000 + BIT(data, 5) * 0160000); - membank("bank6")->set_base(ram + 0140000 + BIT(data, 6) * 0160000); + m_bank[0]->set_base(ram + 0000000 + BIT(data, 0) * 0160000); + m_bank[1]->set_base(ram + 0020000 + BIT(data, 1) * 0160000); + m_bank[2]->set_base(ram + 0040000 + BIT(data, 2) * 0160000); + m_bank[3]->set_base(ram + 0060000 + BIT(data, 3) * 0160000); + m_bank[4]->set_base(ram + 0100000 + BIT(data, 4) * 0160000); + m_bank[5]->set_base(ram + 0120000 + BIT(data, 5) * 0160000); + m_bank[6]->set_base(ram + 0140000 + BIT(data, 6) * 0160000); if (BIT(data, 7)) { switch ((data >> 10) & 3) { case 0: // 000000 - 037777 - membank("bank0")->set_base(ram + 0000000 + 0340000); - membank("bank1")->set_base(ram + 0020000 + 0340000); + m_bank[0]->set_base(ram + 0000000 + 0340000); + m_bank[1]->set_base(ram + 0020000 + 0340000); break; case 1: // 040000 - 077777 - membank("bank2")->set_base(ram + 0000000 + 0340000); - membank("bank3")->set_base(ram + 0020000 + 0340000); + m_bank[2]->set_base(ram + 0000000 + 0340000); + m_bank[3]->set_base(ram + 0020000 + 0340000); break; case 2: case 3: // 100000 - 137777 - membank("bank4")->set_base(ram + 0000000 + 0340000); - membank("bank5")->set_base(ram + 0020000 + 0340000); + m_bank[4]->set_base(ram + 0000000 + 0340000); + m_bank[5]->set_base(ram + 0020000 + 0340000); break; } } @@ -258,17 +265,17 @@ void ms0515_state::ms0515_porta_w(uint8_t data) { LOGSYSREG("Sysreg A <- %02x\n", data); - output().set_value("led16", BIT(data, 5)); - output().set_value("led9", BIT(data, 4)); + m_led16 = BIT(data, 5); + m_led9 = BIT(data, 4); switch (data & 3) { case 0: - m_floppy = m_floppy0; + m_floppy = m_floppies[0]->get_device(); break; case 1: - m_floppy = m_floppy1; + m_floppy = m_floppies[1]->get_device(); break; default: @@ -284,8 +291,9 @@ void ms0515_state::ms0515_porta_w(uint8_t data) } else { - m_floppy0->mon_w(1); - m_floppy1->mon_w(1); + for (auto &floppy : m_floppies) + if (floppy->get_device() != nullptr) + floppy->get_device()->mon_w(1); } m_sysrega = data; @@ -330,7 +338,7 @@ void ms0515_state::ms0515_portc_w(uint8_t data) LOGSYSREG("Sysreg C <- %02x\n", data); m_pit8253->write_gate2(BIT(data, 7)); - output().set_value("led17", BIT(data, 4)); + m_led17 = BIT(data, 4); m_sysregc = data; } @@ -352,6 +360,13 @@ WRITE_LINE_MEMBER(ms0515_state::pit8253_out2_changed) m_speaker->level_w(state); } +void ms0515_state::machine_start() +{ + m_led9.resolve(); + m_led16.resolve(); + m_led17.resolve(); +} + void ms0515_state::machine_reset() { uint8_t *ram = m_ram->pointer(); diff --git a/src/mame/drivers/nes_sh6578.cpp b/src/mame/drivers/nes_sh6578.cpp index 53e3b06992f..0199f70506f 100644 --- a/src/mame/drivers/nes_sh6578.cpp +++ b/src/mame/drivers/nes_sh6578.cpp @@ -726,25 +726,25 @@ ROM_END -CONS( 200?, maxx5in1, 0, 0, nes_sh6578, nes_sh6578, nes_sh6578_state, init_nes_sh6578, "Senario", "Vs Maxx 5-in-1 Casino / Senario Card & Casino Games", 0 ) // advertised on box as 'With Solitaire" (was there an even older version without it?) +CONS( 200?, maxx5in1, 0, 0, nes_sh6578, nes_sh6578, nes_sh6578_state, init_nes_sh6578, "Senario / JungleTac", "Vs Maxx 5-in-1 Casino / Senario Card & Casino Games", 0 ) // advertised on box as 'With Solitaire" (was there an even older version without it?) -CONS( 200?, maxx6in1, 0, 0, nes_sh6578, nes_sh6578, nes_sh6578_state, init_nes_sh6578, "Senario", "Vs Maxx 6-in-1 Casino / Senario Card & Casino Games", 0 ) // advertised on box as "With Texas Hold 'Em" (which is the added game since the 5-in-1) +CONS( 200?, maxx6in1, 0, 0, nes_sh6578, nes_sh6578, nes_sh6578_state, init_nes_sh6578, "Senario / JungleTac", "Vs Maxx 6-in-1 Casino / Senario Card & Casino Games", 0 ) // advertised on box as "With Texas Hold 'Em" (which is the added game since the 5-in-1) -CONS( 200?, max10in1, 0, 0, nes_sh6578, nes_sh6578, nes_sh6578_max10in1_state, init_nes_sh6578, "Senario", "Vs Maxx 10-in-1 Casino / Senario Card & Casino Games", 0 ) +CONS( 200?, max10in1, 0, 0, nes_sh6578, nes_sh6578, nes_sh6578_max10in1_state, init_nes_sh6578, "Senario / JungleTac", "Vs Maxx 10-in-1 Casino / Senario Card & Casino Games", 0 ) // titles below have various issues (DMA, split interrupt timing etc.) - // aka Wik!d Joystick, sometimes also called Air Blaster like the real Air Blaster game. Wik!d seems a rebranding (a 'gift' company) so did ABL reuse the Air Blaster name here instead? -CONS( 200?, ablwikid, 0, 0, nes_sh6578_pal, nes_sh6578, nes_sh6578_abl_wikid_state, init_nes_sh6578, "Advance Bright Ltd.", "Wikid Joystick 14-in-1", MACHINE_NOT_WORKING ) +// aka Wik!d Joystick, sometimes also called Air Blaster like the real Air Blaster game. Wik!d seems a rebranding (a 'gift' company) so did ABL reuse the Air Blaster name here instead? +CONS( 200?, ablwikid, 0, 0, nes_sh6578_pal, nes_sh6578, nes_sh6578_abl_wikid_state, init_nes_sh6578, "Advance Bright Ltd. / JungleTac", "Wikid Joystick 14-in-1", MACHINE_NOT_WORKING ) -CONS( 2001?, ts_handy11, 0, 0, nes_sh6578, nes_sh6578, nes_sh6578_state, init_nes_sh6578, "Techno Source", "Handy Boy 11-in-1 (TV Play Power)", MACHINE_NOT_WORKING ) // possibly newer than 2001 +CONS( 2001?, ts_handy11, 0, 0, nes_sh6578, nes_sh6578, nes_sh6578_state, init_nes_sh6578, "Techno Source / JungleTac", "Handy Boy 11-in-1 (TV Play Power)", MACHINE_NOT_WORKING ) // possibly newer than 2001 // from a blue coloured unit, a yellow one exists, is it the same? -CONS( 2004?, vsmaxx15, 0, 0, nes_sh6578, nes_sh6578, nes_sh6578_state, init_nes_sh6578, "Senario", "Vs Maxx 15-in-1", MACHINE_NOT_WORKING ) +CONS( 2004?, vsmaxx15, 0, 0, nes_sh6578, nes_sh6578, nes_sh6578_state, init_nes_sh6578, "Senario / JungleTac", "Vs Maxx 15-in-1", MACHINE_NOT_WORKING ) // This is from the blue coloured unit with the 1p/2p slider (does it do anything / get read anywhere?) // A version of the 25-in-1 on VT hardware also exists, with the downgraded version of Big Racing & removed copyrights etc. (probably the purple tinted version without the 1p/2p slider) -CONS( 2004?, vsmaxx25, 0, 0, nes_sh6578, nes_sh6578, nes_sh6578_max10in1_state, init_nes_sh6578, "Senario", "Vs Maxx 25-in-1", MACHINE_NOT_WORKING ) +CONS( 2004?, vsmaxx25, 0, 0, nes_sh6578, nes_sh6578, nes_sh6578_max10in1_state, init_nes_sh6578, "Senario / JungleTac", "Vs Maxx 25-in-1", MACHINE_NOT_WORKING ) // titles below need inputs mapping to go further diff --git a/src/mame/drivers/nes_vt.cpp b/src/mame/drivers/nes_vt.cpp index d6fafae4898..b54e044ff6d 100644 --- a/src/mame/drivers/nes_vt.cpp +++ b/src/mame/drivers/nes_vt.cpp @@ -1795,6 +1795,18 @@ ROM_START( vsmaxx17 ) ROM_LOAD( "vsmaxx17.bin", 0x00000, 0x200000, CRC(f3fccbb9) SHA1(8b70b10d28f03e72f6b35199001955033a65fd5d) ) // M6MG3D641RB ROM_END +ROM_START( senario25 ) + ROM_REGION( 0x200000, "mainrom", 0 ) + ROM_LOAD( "senario25.bin", 0x00000, 0x200000, CRC(270c4517) SHA1(c099096d1c86f55f2b0826484cd3d3f68c90c794) ) +ROM_END + + +ROM_START( dgun851 ) + ROM_REGION( 0x400000, "mainrom", 0 ) + ROM_LOAD( "dgun851.bin", 0x00000, 0x400000, CRC(9d51c9fc) SHA1(6f49ea3343eb6e90938aabc9660783f1fc7f6084) ) +ROM_END + + ROM_START( vsmaxx77 ) ROM_REGION( 0x800000, "mainrom", 0 ) ROM_LOAD( "vsmaxx77.bin", 0x00000, 0x800000, CRC(03f1f4b5) SHA1(13f7ecea3765cffcd3065de713abdabd24946b99) ) @@ -2252,13 +2264,6 @@ CONS( 200?, wldsoctv, 0, 0, nes_vt_pal_4mb, nes_vt, nes_vt_wldsoctv_s CONS( 200?, mc_dgear, 0, 0, nes_vt_4mb, nes_vt, nes_vt_state, empty_init, "dreamGEAR", "dreamGEAR 75-in-1", MACHINE_IMPERFECT_GRAPHICS ) -// all software in this runs in the VT03 enhanced mode, it also includes an actual licensed VT03 port of Frogger. -// all games work OK except Frogger which has serious graphical issues -CONS( 2006, vgtablet, 0, 0, nes_vt_vg_4mb_rasterhack, nes_vt, nes_vt_hh_state, empty_init, "Performance Designed Products (licensed by Konami) / JungleTac", "VG Pocket Tablet (VG-4000)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) // raster timing for Frogger needs a hack -// There is a 2004 Majesco Frogger "TV game" that appears to contain the same version of Frogger as above but with no other games, so probably fits here. -CONS( 2004, majkon, 0, 0, nes_vt_1mb_majkon, nes_vt, nes_vt_state, empty_init, "Majesco (licensed from Konami) / JungleTac", "Konami Collector's Series Arcade Advanced", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) // raster timing for Frogger needs a hack, Rush'n Attack also has raster timing issues on the status bar split - -CONS( 200?, majgnc, 0, 0, nes_vt_vg_1mb_majgnc, majgnc, nes_vt_vg_1mb_majgnc_state, empty_init, "Majesco / JungleTac", "Golden Nugget Casino", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) // small black unit, dpad on left, 4 buttons (A,B,X,Y) on right, Start/Reset/Select in middle, unit text "Sudoku Plug & Play TV Game" CONS( 200?, sudopptv, 0, 0, nes_vt_waixing_512kb_rasterhack, nes_vt, nes_vt_waixing_state, empty_init, "Smart Planet", "Sudoku Plug & Play TV Game '6 Intelligent Games'", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) @@ -2283,12 +2288,21 @@ CONS( 200?, timetp7, 0, 0, nes_vt_pal_2mb, timetp36, nes_vt_timetp36_state, // emulation CONS( 200?, dgun2500, 0, 0, nes_vt_dg_baddma_16mb, nes_vt, nes_vt_dg_state, empty_init, "dreamGEAR", "dreamGEAR Wireless Motion Control with 130 games (DGUN-2500)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND) +// all software in this runs in the VT03 enhanced mode, it also includes an actual licensed VT03 port of Frogger. +// all games work OK except Frogger which has serious graphical issues +CONS( 2006, vgtablet, 0, 0, nes_vt_vg_4mb_rasterhack, nes_vt, nes_vt_hh_state, empty_init, "Performance Designed Products (licensed by Konami) / JungleTac", "VG Pocket Tablet (VG-4000)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) // raster timing for Frogger needs a hack +// There is a 2004 Majesco Frogger "TV game" that appears to contain the same version of Frogger as above but with no other games, so probably fits here. +CONS( 2004, majkon, 0, 0, nes_vt_1mb_majkon, nes_vt, nes_vt_state, empty_init, "Majesco (licensed from Konami) / JungleTac", "Konami Collector's Series Arcade Advanced", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) // raster timing for Frogger needs a hack, Rush'n Attack also has raster timing issues on the status bar split + +CONS( 200?, majgnc, 0, 0, nes_vt_vg_1mb_majgnc, majgnc, nes_vt_vg_1mb_majgnc_state, empty_init, "Majesco / JungleTac", "Golden Nugget Casino", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) + // this is VT09 based -CONS( 2009, cybar120, 0, 0, nes_vt_vg_16mb,nes_vt, nes_vt_hh_state, empty_init, "Defender / JungleTac", "Defender M2500P 120-in-1", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) -CONS( 200?, vsmaxtx2, 0, 0, nes_vt_vg_4mb, nes_vt, nes_vt_hh_state, empty_init, "Senario / JungleTac", "Vs Maxx TX-2 50-in-1", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) -CONS( 200?, rcapnp, 0, 0, nes_vt_vg_2mb, nes_vt, nes_vt_hh_state, empty_init, "RCA / JungleTac", "RCA NS-500 30-in-1", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) // from a Green unit, '17 Classic & Racing Game' -CONS( 200?, dturbogt, 0, 0, nes_vt_vg_8mb, nes_vt, nes_vt_hh_state, empty_init, "dreamGEAR / JungleTac", "Turbo GT 50-in-1", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) -CONS( 200?, ventur25, 0, 0, nes_vt_vg_4mb, nes_vt, nes_vt_hh_state, empty_init, "<unknown> / JungleTac", "Venturer '25 Games' 25-in-1", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) +CONS( 2009, cybar120, 0, 0, nes_vt_vg_16mb,nes_vt, nes_vt_hh_state, empty_init, "Defender / JungleTac", "Defender M2500P 120-in-1", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) +CONS( 200?, vsmaxtx2, 0, 0, nes_vt_vg_4mb, nes_vt, nes_vt_hh_state, empty_init, "Senario / JungleTac", "Vs Maxx TX-2 50-in-1", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) +CONS( 200?, senario25, 0, 0, nes_vt_vg_2mb, nes_vt, nes_vt_hh_state, empty_init, "Senario / JungleTac", "25 Video Games - All in 1 Video System (Senario)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) // no Vs Maxx branding, newer style packaging +CONS( 200?, rcapnp, 0, 0, nes_vt_vg_2mb, nes_vt, nes_vt_hh_state, empty_init, "RCA / JungleTac", "RCA NS-500 30-in-1", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) +CONS( 200?, dturbogt, 0, 0, nes_vt_vg_8mb, nes_vt, nes_vt_hh_state, empty_init, "dreamGEAR / JungleTac", "Turbo GT 50-in-1", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) +CONS( 200?, ventur25, 0, 0, nes_vt_vg_4mb, nes_vt, nes_vt_hh_state, empty_init, "<unknown> / JungleTac", "Venturer '25 Games' 25-in-1", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) CONS( 2005, vgpocket, 0, 0, nes_vt_vg_4mb, nes_vt, nes_vt_hh_state, empty_init, "Performance Designed Products / JungleTac", "VG Pocket (VG-2000)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) CONS( 200?, vgpmini, 0, 0, nes_vt_vg_4mb, nes_vt, nes_vt_hh_state, empty_init, "Performance Designed Products / JungleTac", "VG Pocket Mini (VG-1500)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) // VG Pocket Max (VG-2500) (blue case, 75 games) @@ -2296,15 +2310,14 @@ CONS( 200?, vgpmini, 0, 0, nes_vt_vg_4mb, nes_vt, nes_vt_hh_state, empty_ini // VG Pocket Caplet is SunPlus hardware instead, see spg2xx_lexibook.cpp // CPU die is marked 'VH2009' There's also a 62256 RAM chip on the PCB, some scrambled opcodes -CONS( 2004, polmega, 0, 0, nes_vt_vh2009_4mb, nes_vt, nes_vt_swap_op_d5_d6_state, empty_init, "Polaroid / JungleTac", "TV MegaMax active power game system 30-in-1 (MegaMax GPD001SDG)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) -CONS( 2004, vsmaxx17, 0, 0, nes_vt_vh2009_2mb, nes_vt, nes_vt_swap_op_d5_d6_state, empty_init, "Senario / JungleTac", "Vs Maxx 17-in-1", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) // from a Green unit, '17 Classic & Racing Game' +CONS( 2004, vsmaxx17, 0, 0, nes_vt_vh2009_2mb, nes_vt, nes_vt_swap_op_d5_d6_state, empty_init, "Senario / JungleTac", "Vs Maxx 17-in-1", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) // from a Green unit, '17 Classic & Racing Game' +CONS( 2004, polmega, 0, 0, nes_vt_vh2009_4mb, nes_vt, nes_vt_swap_op_d5_d6_state, empty_init, "Polaroid / JungleTac", "TV MegaMax active power game system 30-in-1 (MegaMax GPD001SDG)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) +CONS( 200?, dgun851, 0, 0, nes_vt_vh2009_4mb, nes_vt, nes_vt_swap_op_d5_d6_state, empty_init, "dreamGEAR / JungleTac", "Plug 'N' Play 30-in-1 (DGUN-851)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) CONS( 200?, silv35, 0, 0, nes_vt_vh2009_4mb, nes_vt, nes_vt_swap_op_d5_d6_state, empty_init, "SilverLit / JungleTac", "35 in 1 Super Twins", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) +CONS( 2004, vsmaxxvd, 0, 0, nes_vt_vh2009_8mb, nes_vt, nes_vt_swap_op_d5_d6_state, empty_init, "Senario / JungleTac", "Vs Maxx Video Extreme 50-in-1 (with Speed Racer and Snood)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) +CONS( 200?, vsmaxx77, 0, 0, nes_vt_vh2009_8mb, nes_vt, nes_vt_swap_op_d5_d6_state, empty_init, "Senario / JungleTac", "Vs Maxx Wireless 77-in-1", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) // die is marked as VH2009, as above, but no scrambled opcodes here -CONS( 201?, techni4, 0, 0, nes_vt_pal_2mb, nes_vt, nes_vt_state, empty_init, "Technigame", "Technigame Super 4-in-1 Sports (PAL)", MACHINE_IMPERFECT_GRAPHICS ) - - -CONS( 2004, vsmaxxvd, 0, 0, nes_vt_vh2009_8mb, nes_vt, nes_vt_swap_op_d5_d6_state, empty_init, "Senario / JungleTac", "Vs Maxx Video Extreme 50-in-1 (with Speed Racer and Snood)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) -CONS( 2004, vsmaxx77, 0, 0, nes_vt_vh2009_8mb, nes_vt, nes_vt_swap_op_d5_d6_state, empty_init, "Senario / JungleTac", "Vs Maxx Wireless 77-in-1", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) +CONS( 201?, techni4, 0, 0, nes_vt_pal_2mb, nes_vt, nes_vt_state, empty_init, "Technigame", "Technigame Super 4-in-1 Sports (PAL)", MACHINE_IMPERFECT_GRAPHICS ) // seems to use PCM for all sound, some garbage at bottom of screen, needs correct inputs (seems to respond to start, and any direction input for 'hit' - check if they're power related) @@ -2351,8 +2364,10 @@ CONS( 2006, ddrstraw, 0, 0, nes_vt_2mb, nes_vt_ddr, nes_vt_state, empt // there is also a 'Spectra Light Edition' which could be a different ROM as the title screen on this one does show the unit type. CONS( 2006, dbdancem, 0, 0, nes_vt_2mb, dbdancem, nes_vt_state, empty_init, "Senario", "Double Dance Mania - Techno Light Edition", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) -// unlike other Senario products this one is mostly just NES games, it also appears to be one of the final Senario products. Some games aren't what they claim to be, Warpman is Soccer for example. -CONS( 2009, sen101, 0, 0, nes_vt_4mb, nes_vt, nes_vt_state, empty_init, "Senario", "101 Games in 1 (Senario)", MACHINE_IMPERFECT_GRAPHICS ) +// Unlike other Senario products this one is mostly just NES games, it also appears to be one of the final Senario products. +// Some games aren't what they claim to be, Warpman is Soccer for example. +// Senario had another 101 unit with different games (not JungleTac or NES bootlegs) it might be the same as the dreamGEAR 101 below +CONS( 2009, sen101, 0, 0, nes_vt_4mb, nes_vt, nes_vt_state, empty_init, "Senario", "101 Games in 1 (Senario, NES/Famicom bootlegs)", MACHINE_IMPERFECT_GRAPHICS ) // unsorted, these were all in nes.xml listed as ONE BUS systems CONS( 200?, mc_dg101, 0, 0, nes_vt_4mb, nes_vt, nes_vt_state, empty_init, "dreamGEAR", "dreamGEAR 101 in 1", MACHINE_IMPERFECT_GRAPHICS ) // dreamGear, but no enhanced games? @@ -2452,8 +2467,7 @@ CONS( 2017, rtvgc300fz,0, 0, nes_vt_cy_bigger, nes_vt, nes_vt_cy_lexibook_stat /* The following are also confirmed to be NES/VT derived units, most having a standard set of games with a handful of lazy graphic mods thrown in to fit the unit theme - (handhekd units, use standard AAA batteries) - Lexibook Compact Cyber Arcade - Cars + (handheld units, use standard AAA batteries) Lexibook Compact Cyber Arcade - Barbie Lexibook Compact Cyber Arcade - Finding Dory Lexibook Compact Cyber Arcade - PJ Masks diff --git a/src/mame/drivers/pc1500.cpp b/src/mame/drivers/pc1500.cpp index 09e63e71504..b30ddd2b5ed 100644 --- a/src/mame/drivers/pc1500.cpp +++ b/src/mame/drivers/pc1500.cpp @@ -32,12 +32,27 @@ public: , m_lcd_data(*this, "lcd_data") , m_keyboard(*this, "KEY.%u", 0) , m_io_on(*this, "ON") + , m_busy(*this, "BUSY") + , m_shift(*this, "SHIFT") + , m_sml(*this, "SML") + , m_small(*this, "SMALL") + , m_iii(*this, "III") + , m_ii(*this, "II") + , m_i(*this, "I") + , m_def(*this, "DEF") + , m_de(*this, "DE") + , m_g(*this, "G") + , m_rad(*this, "RAD") + , m_reserve(*this, "RESERVE") + , m_pro(*this, "PRO") + , m_run(*this, "RUN") { } void pc1500(machine_config &config); protected: + virtual void machine_start() override; virtual void machine_reset() override; private: @@ -48,6 +63,21 @@ private: required_ioport_array<8> m_keyboard; required_ioport m_io_on; + output_finder<> m_busy; + output_finder<> m_shift; + output_finder<> m_sml; + output_finder<> m_small; + output_finder<> m_iii; + output_finder<> m_ii; + output_finder<> m_i; + output_finder<> m_def; + output_finder<> m_de; + output_finder<> m_g; + output_finder<> m_rad; + output_finder<> m_reserve; + output_finder<> m_pro; + output_finder<> m_run; + uint8_t m_kb_matrix; uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); @@ -113,24 +143,42 @@ uint32_t pc1500_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap } } - output().set_value("BUSY", BIT(m_lcd_data[0x4e], 0)); - output().set_value("SHIFT", BIT(m_lcd_data[0x4e], 1)); - output().set_value("SML", BIT(m_lcd_data[0x4e], 2)); - output().set_value("SMALL", BIT(m_lcd_data[0x4e], 3)); - output().set_value("III", BIT(m_lcd_data[0x4e], 4)); - output().set_value("II", BIT(m_lcd_data[0x4e], 5)); - output().set_value("I", BIT(m_lcd_data[0x4e], 6)); - output().set_value("DEF", BIT(m_lcd_data[0x4e], 7)); - output().set_value("DE", BIT(m_lcd_data[0x4f], 0)); - output().set_value("G", BIT(m_lcd_data[0x4f], 1)); - output().set_value("RAD", BIT(m_lcd_data[0x4f], 2)); - output().set_value("RESERVE", BIT(m_lcd_data[0x4f], 4)); - output().set_value("PRO", BIT(m_lcd_data[0x4f], 5)); - output().set_value("RUN", BIT(m_lcd_data[0x4f], 6)); + m_busy = BIT(m_lcd_data[0x4e], 0); + m_shift = BIT(m_lcd_data[0x4e], 1); + m_sml = BIT(m_lcd_data[0x4e], 2); + m_small = BIT(m_lcd_data[0x4e], 3); + m_iii = BIT(m_lcd_data[0x4e], 4); + m_ii = BIT(m_lcd_data[0x4e], 5); + m_i = BIT(m_lcd_data[0x4e], 6); + m_def = BIT(m_lcd_data[0x4e], 7); + m_de = BIT(m_lcd_data[0x4f], 0); + m_g = BIT(m_lcd_data[0x4f], 1); + m_rad = BIT(m_lcd_data[0x4f], 2); + m_reserve = BIT(m_lcd_data[0x4f], 4); + m_pro = BIT(m_lcd_data[0x4f], 5); + m_run = BIT(m_lcd_data[0x4f], 6); return 0; } +void pc1500_state::machine_start() +{ + m_busy.resolve(); + m_shift.resolve(); + m_sml.resolve(); + m_small.resolve(); + m_iii.resolve(); + m_ii.resolve(); + m_i.resolve(); + m_def.resolve(); + m_de.resolve(); + m_g.resolve(); + m_rad.resolve(); + m_reserve.resolve(); + m_pro.resolve(); + m_run.resolve(); +} + void pc1500_state::machine_reset() { m_kb_matrix = 0xff; diff --git a/src/mame/drivers/pce220.cpp b/src/mame/drivers/pce220.cpp index fddfa2404ae..67a79f30730 100644 --- a/src/mame/drivers/pce220.cpp +++ b/src/mame/drivers/pce220.cpp @@ -52,6 +52,26 @@ public: , m_ram(*this, RAM_TAG) , m_beep(*this, "beeper") , m_serial(*this, PCE220SERIAL_TAG) + , m_keyboard(*this, "LINE%u", 0) + , m_io_on(*this, "ON") + , m_busy(*this, "BUSY") + , m_caps(*this, "CAPS") + , m_kana(*this, "KANA") + , m_syo(*this, "SYO") + , m_2ndf(*this, "2ndF") + , m_text(*this, "TEXT") + , m_casl(*this, "CASL") + , m_pro(*this, "PRO") + , m_run(*this, "RUN") + , m_batt(*this, "BATT") + , m_e(*this, "E") + , m_m(*this, "M") + , m_const(*this, "CONST") + , m_rad(*this, "RAD") + , m_g(*this, "G") + , m_de(*this, "DE") + , m_stat(*this, "STAT") + , m_print(*this, "PRINT") { } void pce220(machine_config &config); @@ -65,6 +85,28 @@ protected: required_device<beep_device> m_beep; required_device<pce220_serial_device> m_serial; + required_ioport_array<10> m_keyboard; + required_ioport m_io_on; + + output_finder<> m_busy; + output_finder<> m_caps; + output_finder<> m_kana; + output_finder<> m_syo; + output_finder<> m_2ndf; + output_finder<> m_text; + output_finder<> m_casl; + output_finder<> m_pro; + output_finder<> m_run; + output_finder<> m_batt; + output_finder<> m_e; + output_finder<> m_m; + output_finder<> m_const; + output_finder<> m_rad; + output_finder<> m_g; + output_finder<> m_de; + output_finder<> m_stat; + output_finder<> m_print; + // HD61202 LCD controller uint8_t m_lcd_index_row; uint8_t m_lcd_index_col; @@ -82,6 +124,7 @@ protected: uint8_t m_port15; uint8_t m_port18; + virtual void device_resolve_objects() override; virtual void machine_start() override; virtual void machine_reset() override; @@ -125,14 +168,16 @@ public: void pcg850v(machine_config &config); void pcg815(machine_config &config); +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + private: uint8_t m_g850v_bank_num; uint8_t m_lcd_effects; uint8_t m_lcd_contrast; uint8_t m_lcd_read_mode; - virtual void machine_start() override; - virtual void machine_reset() override; uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); uint8_t g850v_bank_r(); void g850v_bank_w(uint8_t data); @@ -184,24 +229,24 @@ uint32_t pce220_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap memset(lcd_symbols, 0, sizeof(lcd_symbols)); } - output().set_value("BUSY" , (lcd_symbols[0] & 0x01) ? 1 : 0); - output().set_value("CAPS" , (lcd_symbols[0] & 0x02) ? 1 : 0); - output().set_value("KANA" , (lcd_symbols[0] & 0x04) ? 1 : 0); - output().set_value("SYO" , (lcd_symbols[0] & 0x08) ? 1 : 0); - output().set_value("2ndF" , (lcd_symbols[0] & 0x10) ? 1 : 0); - output().set_value("TEXT" , (lcd_symbols[1] & 0x08) ? 1 : 0); - output().set_value("CASL" , (lcd_symbols[1] & 0x10) ? 1 : 0); - output().set_value("PRO" , (lcd_symbols[1] & 0x20) ? 1 : 0); - output().set_value("RUN" , (lcd_symbols[1] & 0x40) ? 1 : 0); - output().set_value("BATT" , (lcd_symbols[2] & 0x01) ? 1 : 0); - output().set_value("E" , (lcd_symbols[2] & 0x02) ? 1 : 0); - output().set_value("M" , (lcd_symbols[2] & 0x04) ? 1 : 0); - output().set_value("CONST", (lcd_symbols[2] & 0x08) ? 1 : 0); - output().set_value("RAD" , (lcd_symbols[2] & 0x10) ? 1 : 0); - output().set_value("G" , (lcd_symbols[2] & 0x20) ? 1 : 0); - output().set_value("DE" , (lcd_symbols[2] & 0x40) ? 1 : 0); - output().set_value("STAT" , (lcd_symbols[3] & 0x20) ? 1 : 0); - output().set_value("PRINT", (lcd_symbols[3] & 0x40) ? 1 : 0); + m_busy = (lcd_symbols[0] & 0x01) ? 1 : 0; + m_caps = (lcd_symbols[0] & 0x02) ? 1 : 0; + m_kana = (lcd_symbols[0] & 0x04) ? 1 : 0; + m_syo = (lcd_symbols[0] & 0x08) ? 1 : 0; + m_2ndf = (lcd_symbols[0] & 0x10) ? 1 : 0; + m_text = (lcd_symbols[1] & 0x08) ? 1 : 0; + m_casl = (lcd_symbols[1] & 0x10) ? 1 : 0; + m_pro = (lcd_symbols[1] & 0x20) ? 1 : 0; + m_run = (lcd_symbols[1] & 0x40) ? 1 : 0; + m_batt = (lcd_symbols[2] & 0x01) ? 1 : 0; + m_e = (lcd_symbols[2] & 0x02) ? 1 : 0; + m_m = (lcd_symbols[2] & 0x04) ? 1 : 0; + m_const= (lcd_symbols[2] & 0x08) ? 1 : 0; + m_rad = (lcd_symbols[2] & 0x10) ? 1 : 0; + m_g = (lcd_symbols[2] & 0x20) ? 1 : 0; + m_de = (lcd_symbols[2] & 0x40) ? 1 : 0; + m_stat = (lcd_symbols[3] & 0x20) ? 1 : 0; + m_print= (lcd_symbols[3] & 0x40) ? 1 : 0; return 0; } @@ -266,23 +311,23 @@ uint32_t pcg850v_state::screen_update(screen_device &screen, bitmap_ind16 &bitma memset(lcd_symbols, 0, sizeof(lcd_symbols)); } - output().set_value("RUN" , (lcd_symbols[0] & 0x02) ? 1 : 0); - output().set_value("PRO" , (lcd_symbols[0] & 0x08) ? 1 : 0); - output().set_value("TEXT" , (lcd_symbols[0] & 0x40) ? 1 : 0); - output().set_value("CASL" , (lcd_symbols[1] & 0x08) ? 1 : 0); - output().set_value("STAT" , (lcd_symbols[2] & 0x01) ? 1 : 0); - output().set_value("2ndF" , (lcd_symbols[2] & 0x20) ? 1 : 0); - output().set_value("M" , (lcd_symbols[2] & 0x80) ? 1 : 0); - output().set_value("CAPS" , (lcd_symbols[3] & 0x04) ? 1 : 0); - output().set_value("KANA" , (lcd_symbols[3] & 0x80) ? 1 : 0); - output().set_value("SYO" , (lcd_symbols[4] & 0x02) ? 1 : 0); - output().set_value("DE" , (lcd_symbols[4] & 0x10) ? 1 : 0); - output().set_value("G" , (lcd_symbols[4] & 0x40) ? 1 : 0); - output().set_value("RAD" , (lcd_symbols[5] & 0x01) ? 1 : 0); - output().set_value("CONST", (lcd_symbols[5] & 0x04) ? 1 : 0); - output().set_value("PRINT", (lcd_symbols[5] & 0x10) ? 1 : 0); - output().set_value("BUSY" , (lcd_symbols[5] & 0x40) ? 1 : 0); - output().set_value("BATT" , (lcd_symbols[5] & 0x80) ? 1 : 0); + m_run = (lcd_symbols[0] & 0x02) ? 1 : 0; + m_pro = (lcd_symbols[0] & 0x08) ? 1 : 0; + m_text = (lcd_symbols[0] & 0x40) ? 1 : 0; + m_casl = (lcd_symbols[1] & 0x08) ? 1 : 0; + m_stat = (lcd_symbols[2] & 0x01) ? 1 : 0; + m_2ndf = (lcd_symbols[2] & 0x20) ? 1 : 0; + m_m = (lcd_symbols[2] & 0x80) ? 1 : 0; + m_caps = (lcd_symbols[3] & 0x04) ? 1 : 0; + m_kana = (lcd_symbols[3] & 0x80) ? 1 : 0; + m_syo = (lcd_symbols[4] & 0x02) ? 1 : 0; + m_de = (lcd_symbols[4] & 0x10) ? 1 : 0; + m_g = (lcd_symbols[4] & 0x40) ? 1 : 0; + m_rad = (lcd_symbols[5] & 0x01) ? 1 : 0; + m_const= (lcd_symbols[5] & 0x04) ? 1 : 0; + m_print= (lcd_symbols[5] & 0x10) ? 1 : 0; + m_busy = (lcd_symbols[5] & 0x40) ? 1 : 0; + m_batt = (lcd_symbols[5] & 0x80) ? 1 : 0; return 0; } @@ -423,7 +468,7 @@ uint8_t pce220_state::port1f_r() data |= m_serial->in_ack()<<1; data |= m_serial->in_xin()<<2; - data |= ioport("ON")->read()<<7; + data |= m_io_on->read()<<7; return data; } @@ -445,26 +490,9 @@ uint8_t pce220_state::kb_r() { uint8_t data = 0x00; - if (m_kb_matrix & 0x01) - data |= ioport("LINE0")->read(); - if (m_kb_matrix & 0x02) - data |= ioport("LINE1")->read(); - if (m_kb_matrix & 0x04) - data |= ioport("LINE2")->read(); - if (m_kb_matrix & 0x08) - data |= ioport("LINE3")->read(); - if (m_kb_matrix & 0x10) - data |= ioport("LINE4")->read(); - if (m_kb_matrix & 0x20) - data |= ioport("LINE5")->read(); - if (m_kb_matrix & 0x40) - data |= ioport("LINE6")->read(); - if (m_kb_matrix & 0x80) - data |= ioport("LINE7")->read(); - if (m_kb_matrix & 0x100) - data |= ioport("LINE8")->read(); - if (m_kb_matrix & 0x200) - data |= ioport("LINE9")->read(); + for (int i = 0; i < 10; i++) + if (BIT(m_kb_matrix, i)) + data |= m_keyboard[i]->read(); return data; } @@ -867,6 +895,28 @@ static INPUT_PORTS_START( pcg850v ) PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_PGUP) PORT_NAME("ON") PORT_CHANGED_MEMBER(DEVICE_SELF, pce220_state, on_irq, 0 ) INPUT_PORTS_END +void pce220_state::device_resolve_objects() +{ + m_busy.resolve(); + m_caps.resolve(); + m_kana.resolve(); + m_syo.resolve(); + m_2ndf.resolve(); + m_text.resolve(); + m_casl.resolve(); + m_pro.resolve(); + m_run.resolve(); + m_batt.resolve(); + m_e.resolve(); + m_m.resolve(); + m_const.resolve(); + m_rad.resolve(); + m_g.resolve(); + m_de.resolve(); + m_stat.resolve(); + m_print.resolve(); +} + void pce220_state::machine_start() { uint8_t *rom = memregion("user1")->base(); diff --git a/src/mame/drivers/px4.cpp b/src/mame/drivers/px4.cpp index 2f539d2c1e6..92d9bc89c73 100644 --- a/src/mame/drivers/px4.cpp +++ b/src/mame/drivers/px4.cpp @@ -69,8 +69,10 @@ public: m_speaker(*this, "speaker"), m_sio(*this, "sio"), m_rs232(*this, "rs232"), - m_caps1(*this, "capsule1"), m_caps2(*this, "capsule2"), - m_caps1_rom(nullptr), m_caps2_rom(nullptr), + m_caps(*this, "capsule%u", 0U), + m_dips(*this, "dips"), + m_leds(*this, "led_%u", 0U), + m_caps_rom{nullptr, nullptr}, m_ctrl1(0), m_icrb(0), m_bankr(0), m_isr(0), m_ier(0), m_sior(0xbf), m_frc_value(0), m_frc_latch(0), @@ -188,7 +190,7 @@ protected: DECLARE_WRITE_LINE_MEMBER( serial_rx_w ); void txd_w(int data); - void install_rom_capsule(address_space &space, int size, memory_region *mem); + void install_rom_capsule(address_space &space, int size, uint8_t *mem); // internal devices required_device<cpu_device> m_z80; @@ -200,11 +202,11 @@ protected: required_device<speaker_sound_device> m_speaker; required_device<epson_sio_device> m_sio; required_device<rs232_port_device> m_rs232; - required_device<generic_slot_device> m_caps1; - required_device<generic_slot_device> m_caps2; + required_device_array<generic_slot_device, 2> m_caps; + required_ioport m_dips; + output_finder<3> m_leds; - memory_region *m_caps1_rom; - memory_region *m_caps2_rom; + uint8_t *m_caps_rom[2]; // gapnit register uint8_t m_ctrl1; @@ -504,18 +506,18 @@ uint8_t px4_state::str_r() } // helper function to map rom capsules -void px4_state::install_rom_capsule(address_space &space, int size, memory_region *mem) +void px4_state::install_rom_capsule(address_space &space, int size, uint8_t *mem) { // ram, part 1 space.install_ram(0x0000, 0xdfff - size, m_ram->pointer()); // actual rom data, part 1 if (mem) - space.install_rom(0xe000 - size, 0xffff, mem->base() + (size - 0x2000)); + space.install_rom(0xe000 - size, 0xffff, mem + (size - 0x2000)); // rom data, part 2 if (mem && size != 0x2000) - space.install_rom(0x10000 - size, 0xdfff, mem->base()); + space.install_rom(0x10000 - size, 0xdfff, mem); // ram, continued space.install_ram(0xe000, 0xffff, m_ram->pointer() + 0xe000); @@ -545,12 +547,12 @@ void px4_state::bankr_w(uint8_t data) space_program.install_ram(0x0000, 0xffff, m_ram->pointer()); break; - case 0x08: install_rom_capsule(space_program, 0x2000, m_caps1_rom); break; - case 0x09: install_rom_capsule(space_program, 0x4000, m_caps1_rom); break; - case 0x0a: install_rom_capsule(space_program, 0x8000, m_caps1_rom); break; - case 0x0c: install_rom_capsule(space_program, 0x2000, m_caps2_rom); break; - case 0x0d: install_rom_capsule(space_program, 0x4000, m_caps2_rom); break; - case 0x0e: install_rom_capsule(space_program, 0x8000, m_caps2_rom); break; + case 0x08: install_rom_capsule(space_program, 0x2000, m_caps_rom[0]); break; + case 0x09: install_rom_capsule(space_program, 0x4000, m_caps_rom[0]); break; + case 0x0a: install_rom_capsule(space_program, 0x8000, m_caps_rom[0]); break; + case 0x0c: install_rom_capsule(space_program, 0x2000, m_caps_rom[1]); break; + case 0x0d: install_rom_capsule(space_program, 0x4000, m_caps_rom[1]); break; + case 0x0e: install_rom_capsule(space_program, 0x8000, m_caps_rom[1]); break; default: if (VERBOSE) @@ -727,7 +729,7 @@ void px4_state::sior_w(uint8_t data) case 0x0a: if (VERBOSE) logerror("7508 cmd: DIP Switch Read\n"); - m_sior = ioport("dips")->read(); + m_sior = m_dips->read(); break; case 0x0b: if (VERBOSE) logerror("7508 cmd: Stop Key Interrupt disable\n"); break; @@ -1052,9 +1054,9 @@ void px4_state::ioctlr_w(uint8_t data) // bit 3, cartridge reset - output().set_value("led_0", BIT(data, 4)); // caps lock - output().set_value("led_1", BIT(data, 5)); // num lock - output().set_value("led_2", BIT(data, 6)); // "led 2" + m_leds[0] = BIT(data, 4); // caps lock + m_leds[1] = BIT(data, 5); // num lock + m_leds[2] = BIT(data, 6); // "led 2" m_speaker->level_w(BIT(data, 7)); } @@ -1234,9 +1236,10 @@ void px4p_state::init_px4p() void px4_state::machine_start() { - std::string region_tag; - m_caps1_rom = memregion(region_tag.assign(m_caps1->tag()).append(GENERIC_ROM_REGION_TAG).c_str()); - m_caps2_rom = memregion(region_tag.assign(m_caps2->tag()).append(GENERIC_ROM_REGION_TAG).c_str()); + m_leds.resolve(); + + for (int i = 0; i < 2; i++) + m_caps_rom[i] = m_caps[i]->get_rom_base(); m_nvram->set_base(m_ram->pointer(), 0x10000); @@ -1541,8 +1544,8 @@ void px4_state::px4(machine_config &config) m_rs232->cts_handler().set(FUNC(px4_state::rs232_cts_w)); // rom capsules - GENERIC_CARTSLOT(config, m_caps1, generic_plain_slot, "px4_cart"); - GENERIC_CARTSLOT(config, m_caps2, generic_plain_slot, "px4_cart"); + GENERIC_CARTSLOT(config, m_caps[0], generic_plain_slot, "px4_cart"); + GENERIC_CARTSLOT(config, m_caps[1], generic_plain_slot, "px4_cart"); // software list SOFTWARE_LIST(config, "cart_list").set_original("px4_cart"); diff --git a/src/mame/drivers/px8.cpp b/src/mame/drivers/px8.cpp index b33a203f1a2..a27d666d4ee 100644 --- a/src/mame/drivers/px8.cpp +++ b/src/mame/drivers/px8.cpp @@ -330,9 +330,8 @@ void px8_state::gah40m_w(offs_t offset, uint8_t data) */ - output().set_value("led_0", BIT(data, 0)); - output().set_value("led_1", BIT(data, 1)); - output().set_value("led_2", BIT(data, 2)); + for (int i = 0; i < 3; i++) + m_leds[i] = BIT(data, i); break; case GAH40M_IER: @@ -714,6 +713,8 @@ GFXDECODE_END void px8_state::machine_start() { + m_leds.resolve(); + /* register for state saving */ save_item(NAME(m_ier)); save_item(NAME(m_isr)); diff --git a/src/mame/drivers/rainbow.cpp b/src/mame/drivers/rainbow.cpp index 15889f0a18d..8db3fc465ac 100644 --- a/src/mame/drivers/rainbow.cpp +++ b/src/mame/drivers/rainbow.cpp @@ -497,7 +497,9 @@ public: m_palette2(*this, "palette2"), // GDC m_video_ram(*this, "vram"), - m_digits(*this, "digit%u", 0U) + m_digits(*this, "digit%u", 0U), + m_leds(*this, "led%u", 1U), + m_driveleds(*this, "driveled%u", 0U) { } @@ -652,6 +654,8 @@ protected: required_shared_ptr<uint16_t> m_video_ram; output_finder<2> m_digits; + output_finder<7> m_leds; + output_finder<4> m_driveleds; void raise_8088_irq(int ref); void lower_8088_irq(int ref); @@ -893,6 +897,8 @@ void rainbow_base_state::machine_start() switch_off_timer->adjust(attotime::from_msec(10)); m_digits.resolve(); + m_leds.resolve(); + m_driveleds.resolve(); m_screen_blank = false; @@ -1188,7 +1194,7 @@ void rainbow_base_state::machine_reset() hard_disk_file *local_hard_disk; local_hard_disk = rainbow_hdc_file(0); // one hard disk for now. - output().set_value("led1", 0); + m_leds[0] = 0; switch_off_timer->adjust(attotime::from_msec(500)); if (local_hard_disk) @@ -1196,7 +1202,7 @@ void rainbow_base_state::machine_reset() hard_disk_info *info; if ((info = hard_disk_get_info(local_hard_disk))) { - output().set_value("led1", 1); + m_leds[0] = 1; uint32_t max_sector = (info->cylinders) * (info->heads) * (info->sectors); popmessage("DEC %u (%3.2f) MB HARD DISK MOUNTED.\nGEOMETRY: %d HEADS (1..%d ARE OK).\n%d CYLINDERS (151 to %d ARE OK).\n%d SECTORS / TRACK (up to %d ARE OK). \n%d BYTES / SECTOR (128 to 1024 ARE OK).\n", @@ -1251,19 +1257,15 @@ void rainbow_base_state::machine_reset() m_irq_mask = 0; // RESET RED LEDs - output().set_value("led1", 1); - output().set_value("led2", 1); - output().set_value("led3", 1); - output().set_value("led4", 1); - output().set_value("led5", 1); - output().set_value("led6", 1); - output().set_value("led7", 1); + m_leds[0] = 1; + m_leds[1] = 1; + m_leds[2] = 1; + m_leds[3] = 1; + m_leds[4] = 1; + m_leds[5] = 1; + m_leds[6] = 1; - // GREEN KEYBOARD LEDs (1 = on, 0 = off): - output().set_value("led_wait", 0); // led8 - output().set_value("led_compose", 0); // led9 - output().set_value("led_lock", 0); // led10 - output().set_value("led_hold", 0); // led11 + // GREEN KEYBOARD LEDs (see machine/dec_lk201.cpp) } void rainbow_modela_state::machine_reset() @@ -1302,13 +1304,13 @@ void rainbow_base_state::device_timer(emu_timer &timer, device_timer_id tid, int switch_off_timer->adjust(attotime::never); - output().set_value("driveled0", 0); // DRIVE 0 (A) - output().set_value("driveled1", 0); // DRIVE 1 (B) - output().set_value("driveled2", 0); // DRIVE 2 (C) - output().set_value("driveled3", 0); // DRIVE 3 (D) + m_driveleds[0] = 0; // DRIVE 0 (A) + m_driveleds[1] = 0; // DRIVE 1 (B) + m_driveleds[2] = 0; // DRIVE 2 (C) + m_driveleds[3] = 0; // DRIVE 3 (D) - output().set_value("led1", 1); // 1 = OFF (One of the CPU LEDs as drive LED for DEC hard disk) - output().set_value("led2", 1); // 1 = OFF (One of the CPU LEDs as drive LED for Corvus HD) + m_leds[0] = 1; // 1 = OFF (One of the CPU LEDs as drive LED for DEC hard disk) + m_leds[1] = 1; // 1 = OFF (One of the CPU LEDs as drive LED for Corvus HD) break; // case 1 @@ -1637,7 +1639,7 @@ uint8_t rainbow_base_state::corvus_status_r() } else { - output().set_value("led2", 0); + m_leds[1] = 0; switch_off_timer->adjust(attotime::from_msec(500)); uint8_t status = m_corvus_hdc->status_r(); @@ -1747,7 +1749,7 @@ WRITE_LINE_MEMBER(rainbow_base_state::hdc_read_sector) if ((state == 0) && (last_state == 1) && (drv == 0)) { read_status = 2; // logerror("\nTRYING TO READ"); - output().set_value("led1", 0); + m_leds[0] = 0; switch_off_timer->adjust(attotime::from_msec(500)); int hi = (m_hdc->read(0x05)) & 0x07; @@ -1765,7 +1767,7 @@ WRITE_LINE_MEMBER(rainbow_base_state::hdc_read_sector) if ((info = hard_disk_get_info(local_hard_disk))) { read_status = 4; - output().set_value("led1", 1); + m_leds[0] = 1; // Pointer to info + C + H + S uint32_t lbasector = get_and_print_lbasector(this, info, cylinder, sdh & 0x07, sector_number); @@ -1816,7 +1818,7 @@ WRITE_LINE_MEMBER(rainbow_base_state::hdc_write_sector) if (state == 0 && wg_last == 1 && drv == 0) // Check correct state transition and DRIVE 0 .... { - output().set_value("led1", 0); // (1 = OFF ) =HARD DISK ACTIVITY = + m_leds[0] = 0; // (1 = OFF ) =HARD DISK ACTIVITY = switch_off_timer->adjust(attotime::from_msec(500)); if (rainbow_hdc_file(0) != nullptr) @@ -1853,7 +1855,7 @@ WRITE_LINE_MEMBER(rainbow_base_state::hdc_write_sector) int rainbow_base_state::do_write_sector() { int feedback = 0; // no error - output().set_value("led1", 0); // ON + m_leds[0] = 0; // ON switch_off_timer->adjust(attotime::from_msec(500)); hard_disk_file *local_hard_disk = rainbow_hdc_file(0); // one hard disk for now. @@ -1864,7 +1866,7 @@ int rainbow_base_state::do_write_sector() if (info) { feedback = 10; - output().set_value("led1", 1); // OFF + m_leds[0] = 1; // OFF uint8_t sdh = (m_hdc->read(0x06)); @@ -2007,7 +2009,7 @@ void rainbow_base_state::hd_status_68_w(uint8_t data) // 1 : see @ 088D after 'READ_SECTOR_OK' if (data & 0x01) { - output().set_value("led1", 0); // 1 = OFF (One of the CPU LEDs as DRIVE LED) = HARD DISK ACTIVITY = + m_leds[0] = 0; // 1 = OFF (One of the CPU LEDs as DRIVE LED) = HARD DISK ACTIVITY = switch_off_timer->adjust(attotime::from_msec(500)); m_hdc->buffer_ready(true); @@ -2075,7 +2077,7 @@ WRITE_LINE_MEMBER(rainbow_base_state::hdc_step) { m_hdc_step_latch = true; - output().set_value("led1", 0); // 1 = OFF (One of the CPU LEDs as DRIVE LED) = HARD DISK ACTIVITY = + m_leds[0] = 0; // 1 = OFF (One of the CPU LEDs as DRIVE LED) = HARD DISK ACTIVITY = switch_off_timer->adjust(attotime::from_msec(500)); } @@ -2240,10 +2242,10 @@ void rainbow_base_state::comm_control_w(uint8_t data) D6 -D5-D4-D3 <- INTERNAL LED NUMBER (DEC PDF) -4--5--6--7- <- NUMBERS EMBOSSED ON BACK OF PLASTIC HOUSING (see error chart) */ - output().set_value("led4", BIT(data, 5)); // LED "D6" - output().set_value("led5", BIT(data, 7)); // LED "D5" - output().set_value("led6", BIT(data, 6)); // LED "D4" - output().set_value("led7", BIT(data, 4)); // LED "D3" + m_leds[3] = BIT(data, 5); // LED "D6" + m_leds[4] = BIT(data, 7); // LED "D5" + m_leds[5] = BIT(data, 6); // LED "D4" + m_leds[6] = BIT(data, 4); // LED "D3" } // 8088 writes to port 0x00 (interrupts Z80) @@ -2307,9 +2309,9 @@ void rainbow_base_state::z80_diskdiag_write_w(uint8_t data) D11 D10 -D9 <- INTERNAL LED NUMBER (see PDF) -1 --2-- 3 <- NUMBERS EMBOSSED ON BACK OF PLASTIC HOUSING (see error chart) */ - output().set_value("led1", BIT(data, 4)); // LED "D11" - output().set_value("led2", BIT(data, 5)); // LED "D10" - output().set_value("led3", BIT(data, 6)); // LED "D9" + m_leds[0] = BIT(data, 4); // LED "D11" + m_leds[1] = BIT(data, 5); // LED "D10" + m_leds[2] = BIT(data, 6); // LED "D9" m_zflip = false; // "a write to 21H will reset ZFLIP" } @@ -2457,11 +2459,8 @@ void rainbow_base_state::z80_diskcontrol_w(uint8_t data) m_floppy = nullptr; } - output().set_value("driveled0", (selected_drive == 0) ? 1 : 0); - output().set_value("driveled1", (selected_drive == 1) ? 1 : 0); - - output().set_value("driveled2", (selected_drive == 2) ? 1 : 0); - output().set_value("driveled3", (selected_drive == 3) ? 1 : 0); + for (int i = 0; i < 4; i++) + m_driveleds[i] = (selected_drive == i) ? 1 : 0; switch_off_timer->adjust(attotime::from_msec(500)); if (m_floppy != nullptr) @@ -2483,14 +2482,14 @@ void rainbow_base_state::z80_diskcontrol_w(uint8_t data) m_fdc->set_force_ready(force_ready); // 1 : assert DRIVE READY on FDC (diagnostic override) if (selected_drive < 2) - { data |= 8; + { + data |= 8; enable_start = 0; disable_start = 2; } - else + else { data |= 16; - enable_start = 2; disable_start = 4; } diff --git a/src/mame/drivers/ravens.cpp b/src/mame/drivers/ravens.cpp index 91f123cefbf..c2d817ea7f2 100644 --- a/src/mame/drivers/ravens.cpp +++ b/src/mame/drivers/ravens.cpp @@ -103,18 +103,25 @@ class ravens_state : public ravens_base public: ravens_state(const machine_config &mconfig, device_type type, const char *tag) : ravens_base(mconfig, type, tag) + , m_io_keyboard(*this, "X%u", 0U) , m_digits(*this, "digit%u", 0U) + , m_leds(*this, "led%u", 0U) { } void ravens(machine_config &config); +protected: + virtual void machine_start() override; + private: - virtual void machine_start() override { m_digits.resolve(); } void io_map(address_map &map); u8 port17_r(); void display_w(offs_t offset, u8 data); void leds_w(u8 data); + + required_ioport_array<3> m_io_keyboard; output_finder<7> m_digits; + output_finder<8> m_leds; }; class ravens2_state : public ravens_base @@ -127,9 +134,11 @@ public: void ravens2(machine_config &config); -private: +protected: virtual void machine_reset() override; virtual void machine_start() override; + +private: void io_map(address_map &map); void kbd_put(u8 data); u8 port07_r(); @@ -150,6 +159,12 @@ READ_LINE_MEMBER( ravens_base::cass_r ) return (m_cass->input() > 0.03) ? 1 : 0; } +void ravens_state::machine_start() +{ + m_digits.resolve(); + m_leds.resolve(); +} + void ravens_state::display_w(offs_t offset, u8 data) { m_digits[offset] = data; @@ -157,18 +172,15 @@ void ravens_state::display_w(offs_t offset, u8 data) void ravens_state::leds_w(u8 data) { - char ledname[8]; for (int i = 0; i < 8; i++) - { - sprintf(ledname,"led%d",i); - output().set_value(ledname, !BIT(data, i)); - } + m_leds[i] = !BIT(data, i); } u8 ravens2_state::port07_r() { u8 ret = m_term_in; - m_term_in = 0x80; + if (!machine().side_effects_disabled()) + m_term_in = 0x80; return ret; } @@ -176,19 +188,19 @@ u8 ravens_state::port17_r() { u8 keyin, i; - keyin = ioport("X0")->read(); + keyin = m_io_keyboard[0]->read(); if (keyin != 0xff) for (i = 0; i < 8; i++) if (BIT(~keyin, i)) return i | 0x80; - keyin = ioport("X1")->read(); + keyin = m_io_keyboard[1]->read(); if (keyin != 0xff) for (i = 0; i < 8; i++) if (BIT(~keyin, i)) return i | 0x88; - keyin = ioport("X2")->read(); + keyin = m_io_keyboard[2]->read(); if (!BIT(keyin, 0)) m_maincpu->reset(); if (keyin != 0xff) diff --git a/src/mame/drivers/rfslotspcpent.cpp b/src/mame/drivers/rfslotspcpent.cpp new file mode 100644 index 00000000000..6263f7158d2 --- /dev/null +++ b/src/mame/drivers/rfslotspcpent.cpp @@ -0,0 +1,187 @@ +// license:BSD-3-Clause +// copyright-holders: +/* + +Skeleton driver for Recreativos Franco PC-Pentium based slots machines. + +Configuration for 'Santa Fe Golden' video slot machine: + +Operating system + Microsoft Windows Embedded CE 6.0 + +Motherboard + Advantech AIMB-256 + Intel Celeron 575 1M cache, 2,00 GHz + 1GB RAM + Compact Flash Transcend 512MB 20100202 + +PCB coninage (monedero-billetero-hopper) R.F. 53452303 + PIC18F448-I/P + ULN2803A + Xtal 12.000 MHz + PCA82C251 + 3xHC573A + 74HC238D + +PCB lower lights and buttons (luces inferior y botonera) R.F. 53446002 LF + PIC18F4480-I/P + Xtal 12.000 MHz + +PCB upper lights (luces superior) R.F. 53446002 LF + PIC18F4480-I/P + Xtal 12.000 MHz + +PCB reels (rodillos) R.F. 53435604 LF + PIC 18F2480 + Xatl 12.000 MHz + +PCB Sound R.F. 53422409 LF + Empty sockets: SND1 U22 (40 pin), HIGH U1 (32 pin), LOW U3 (32 pin), RAM U6 (32 pin) + OKI M6650 + Xtal 4.000 MHz + AMD N80C188-20 + Xtal 32.000 MHz + +PCB ccTalk R.F. 53475502 + PIC18F2580 + Xtal 10.000 MHz + +PCB counters (contadores) (no R.F. P/N) + PIC18F2580 + Xtal 12.00 MHz +*/ + +#include "emu.h" +#include "cpu/i386/i386.h" +#include "screen.h" + +namespace { + +class rfslotspcpent_state : public driver_device +{ +public: + rfslotspcpent_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu") + { } + + void rfslotspcpent(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; + +private: + required_device<cpu_device> m_maincpu; + + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + void rfslotspcpent_map(address_map &map); +}; + +void rfslotspcpent_state::video_start() +{ +} + +uint32_t rfslotspcpent_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +{ + return 0; +} + +void rfslotspcpent_state::rfslotspcpent_map(address_map &map) +{ +} + +static INPUT_PORTS_START( rfslotspcpent ) +INPUT_PORTS_END + + +void rfslotspcpent_state::machine_start() +{ +} + +void rfslotspcpent_state::machine_reset() +{ +} + +void rfslotspcpent_state::rfslotspcpent(machine_config &config) +{ + // Basic machine hardware + PENTIUM4(config, m_maincpu, 100000000); // Actually an Intel Celeron 575 1M cache, 2,00 GHz + m_maincpu->set_addrmap(AS_PROGRAM, &rfslotspcpent_state::rfslotspcpent_map); + + // Video hardware + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(640, 480); + screen.set_visarea(0, 640-1, 0, 480-1); + screen.set_screen_update(FUNC(rfslotspcpent_state::screen_update)); +} + +/*************************************************************************** + + Game drivers + +***************************************************************************/ + +ROM_START( rfsantafeg ) + ROM_REGION(0x200000, "bios", 0) // Advantech AIMB-256 + ROM_LOAD("bios_a256v103.bin", 0x000000, 0x200000, CRC(06df0d8d) SHA1(5d740071500729af8c045b562adc5f8da058b59f) ) + + DISK_REGION( "ide:0:hdd:image" ) // Compact Flash Transcend 512MB + DISK_IMAGE( "santa_fe_golden_g12v5_11482e_advantech", 0, SHA1(7ad57f0c80e89ab8086fc5c9c7ba9be4b2c90451) ) + + ROM_REGION(0x4000, "pics", 0) + + /* + PCB counters (contadores) (no R.F. P/N) + -PIC18F2580 + -Xtal 12.00 MHz + */ + ROM_LOAD("pic_contadores_15112a_ips_pic18f2580.bin", 0x00000, 0x1000, NO_DUMP ) // 32K Flash + + /* + PCB lower lights and buttons (luces inferior y botonera) R.F. 53446002 LF + -PIC18F4480-I/P + -Xtal 12.000 MHz + */ + ROM_LOAD("pic_luces_inferior_y_botonera_11242a_310d64_pic18f4480-i-p.u2", 0x01000, 0x0800, NO_DUMP ) // 16K Flash + + /* + PCB upper lights (luces superior) R.F. 53446002 LF + -PIC18F4480-I/P + -Xtal 12.000 MHz + */ + ROM_LOAD("pic_luces_superior_11125c_2f05c0_pic18f4480-i-p.u2", 0x01800, 0x0800, NO_DUMP ) // 16K Flash + + /* + PCB coinage (monedero-billetero-hopper) R.F. 53452303 + -PIC18F448-I/P + -ULN2803A + -Xtal 12.000 MHz + -PCA82C251 + -3xHC573A + -74HC238D + */ + ROM_LOAD("pic_monedero_billetero_hopper_09482b_0eda_pic18f448-i-p.u2", 0x02000, 0x0800, NO_DUMP ) // 16K Flash + + /* + PCB ccTalk R.F. 53475502 + -PIC18F2580 + -Xtal 10.000 MHz + */ + ROM_LOAD("pic_placa_cctalk_pic18f2580.u1", 0x02800, 0x1000, NO_DUMP ) // 32K Flash + + /* + PCB reels (rodillos) R.F. 53435604 LF + -PIC 18F2480 + -Xtal 12.000 MHz + */ + ROM_LOAD("pic_rodillos_14491a_ic8693.u1", 0x03800, 0x0800, NO_DUMP ) // 16K Flash +ROM_END + +} // Anonymous namespace + + +GAME( 2014, rfsantafeg, 0, rfslotspcpent, rfslotspcpent, rfslotspcpent_state, empty_init, ROT0, "Recreativos Franco", "Santa Fe Golden", MACHINE_IS_SKELETON_MECHANICAL ) diff --git a/src/mame/drivers/savia84.cpp b/src/mame/drivers/savia84.cpp index bd26fcf9631..01ddfdfcf75 100644 --- a/src/mame/drivers/savia84.cpp +++ b/src/mame/drivers/savia84.cpp @@ -42,26 +42,31 @@ public: , m_ppi8255(*this, "ppi8255") , m_display(*this, "display") , m_io_keyboard(*this, "X%u", 0U) + , m_leds(*this, "led%u", 0U) { } void savia84(machine_config &config); +protected: + virtual void machine_start() override; + private: - uint8_t savia84_8255_portc_r(); - void savia84_8255_porta_w(uint8_t data); - void savia84_8255_portb_w(uint8_t data); - void savia84_8255_portc_w(uint8_t data); + uint8_t ppi_portc_r(); + void ppi_porta_w(uint8_t data); + void ppi_portb_w(uint8_t data); + void ppi_portc_w(uint8_t data); void io_map(address_map &map); void mem_map(address_map &map); uint8_t m_digit; uint8_t m_seg; - virtual void machine_start() override; + required_device<cpu_device> m_maincpu; required_device<i8255_device> m_ppi8255; required_device<pwm_display_device> m_display; required_ioport_array<9> m_io_keyboard; + output_finder<8> m_leds; }; void savia84_state::mem_map(address_map &map) @@ -133,29 +138,25 @@ static INPUT_PORTS_START( savia84 ) INPUT_PORTS_END -void savia84_state::savia84_8255_porta_w(uint8_t data) // OUT F8 - output segments on the selected digit +void savia84_state::ppi_porta_w(uint8_t data) // OUT F8 - output segments on the selected digit { m_seg = ~data; m_display->matrix(1 << m_digit, m_seg); } -void savia84_state::savia84_8255_portb_w(uint8_t data) // OUT F9 - light the 8 leds down the left side +void savia84_state::ppi_portb_w(uint8_t data) // OUT F9 - light the 8 leds down the left side { - char ledname[8]; for (int i = 0; i < 8; i++) - { - sprintf(ledname,"led%d",i); - output().set_value(ledname, !BIT(data, i)); - } + m_leds[i] = !BIT(data, i); } -void savia84_state::savia84_8255_portc_w(uint8_t data) // OUT FA - set keyboard scanning row; set digit to display +void savia84_state::ppi_portc_w(uint8_t data) // OUT FA - set keyboard scanning row; set digit to display { m_digit = data & 15; m_display->matrix(1 << m_digit, m_seg); } -uint8_t savia84_state::savia84_8255_portc_r() // IN FA - read keyboard +uint8_t savia84_state::ppi_portc_r() // IN FA - read keyboard { if (m_digit < 9) return m_io_keyboard[m_digit]->read(); @@ -165,6 +166,8 @@ uint8_t savia84_state::savia84_8255_portc_r() // IN FA - read keyboard void savia84_state::machine_start() { + m_leds.resolve(); + save_item(NAME(m_digit)); save_item(NAME(m_seg)); } @@ -183,10 +186,10 @@ void savia84_state::savia84(machine_config &config) /* Devices */ I8255(config, m_ppi8255); - m_ppi8255->out_pa_callback().set(FUNC(savia84_state::savia84_8255_porta_w)); - m_ppi8255->out_pb_callback().set(FUNC(savia84_state::savia84_8255_portb_w)); - m_ppi8255->in_pc_callback().set(FUNC(savia84_state::savia84_8255_portc_r)); - m_ppi8255->out_pc_callback().set(FUNC(savia84_state::savia84_8255_portc_w)); + m_ppi8255->out_pa_callback().set(FUNC(savia84_state::ppi_porta_w)); + m_ppi8255->out_pb_callback().set(FUNC(savia84_state::ppi_portb_w)); + m_ppi8255->in_pc_callback().set(FUNC(savia84_state::ppi_portc_r)); + m_ppi8255->out_pc_callback().set(FUNC(savia84_state::ppi_portc_w)); } /* ROM definition */ diff --git a/src/mame/drivers/sitcom.cpp b/src/mame/drivers/sitcom.cpp index a5f2efee605..e1e7a85c03b 100644 --- a/src/mame/drivers/sitcom.cpp +++ b/src/mame/drivers/sitcom.cpp @@ -73,7 +73,6 @@ public: protected: template <unsigned D> void update_ds(offs_t offset, uint16_t data) { m_digits[(D << 2) | offset] = data; } DECLARE_WRITE_LINE_MEMBER(update_rxd) { m_rxd = bool(state); } - DECLARE_WRITE_LINE_MEMBER(sod_led) { output().set_value("sod_led", state); } DECLARE_READ_LINE_MEMBER(sid_line) { return m_rxd ? 1 : 0; } virtual void update_ppi_pa(uint8_t data); @@ -109,6 +108,7 @@ public: , m_speed(*this, "SPEED") , m_ppi(*this, "ppi") , m_ds2(*this, "ds2") + , m_test_led(*this, "test_led") , m_shutter_timer(nullptr) , m_shutter(false) , m_dac_cs(true) @@ -136,6 +136,7 @@ protected: required_ioport m_speed; required_device<i8255_device> m_ppi; required_device<dl1414_device> m_ds2; + output_finder<> m_test_led; emu_timer *m_shutter_timer; bool m_shutter; @@ -267,7 +268,7 @@ void sitcom_timer_state::update_ppi_pb(uint8_t data) m_ds2->wr_w(BIT(data, 2)); m_ds2->addr_w(bitswap<2>(data, 3, 4)); - output().set_value("test_led", BIT(data, 5)); + m_test_led = BIT(data, 5); } READ_LINE_MEMBER( sitcom_timer_state::shutter_r ) @@ -317,6 +318,8 @@ void sitcom_timer_state::machine_start() { sitcom_state::machine_start(); + m_test_led.resolve(); + m_shutter_timer = timer_alloc(TIMER_SHUTTER); save_item(NAME(m_shutter)); @@ -354,7 +357,7 @@ void sitcom_state::sitcom(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &sitcom_state::sitcom_mem); m_maincpu->set_addrmap(AS_IO, &sitcom_state::sitcom_io); m_maincpu->in_sid_func().set(FUNC(sitcom_state::sid_line)); - m_maincpu->out_sod_func().set(FUNC(sitcom_state::sod_led)); + m_maincpu->out_sod_func().set_output("sod_led"); ADDRESS_MAP_BANK(config, "bank").set_map(&sitcom_state::sitcom_bank).set_options(ENDIANNESS_LITTLE, 8, 16, 0x8000); diff --git a/src/mame/drivers/slc1.cpp b/src/mame/drivers/slc1.cpp index ea349baddfc..9ef26dc56fa 100644 --- a/src/mame/drivers/slc1.cpp +++ b/src/mame/drivers/slc1.cpp @@ -67,18 +67,22 @@ public: : driver_device(mconfig, type, tag) , m_maincpu(*this, "maincpu") , m_speaker(*this, "speaker") + , m_chess_keyboard(*this, "X%u", 0U) + , m_trainer_keyboard(*this, "Y%u", 0U) , m_display(*this, "digit%u", 0U) + , m_busyled(*this, "busyled") { } void slc1(machine_config &config); +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + private: u8 io_r(offs_t offset); void io_w(offs_t offset, u8 data); - virtual void machine_start() override; - virtual void machine_reset() override; - void mem_map(address_map &map); void io_map(address_map &map); @@ -87,7 +91,10 @@ private: required_device<cpu_device> m_maincpu; required_device<speaker_sound_device> m_speaker; + required_ioport_array<3> m_chess_keyboard; + required_ioport_array<3> m_trainer_keyboard; output_finder<8> m_display; + output_finder<> m_busyled; }; @@ -126,7 +133,7 @@ void slc1_state::io_w(offs_t offset, u8 data) m_display[m_digit] = segdata; - output().set_value("busyled", busyled); + m_busyled = busyled; if (m_digit == 3) m_kbd_type = segdata; @@ -146,24 +153,24 @@ u8 slc1_state::io_r(offs_t offset) if (m_kbd_type) { // Trainer if (upper == 3) - data &= ioport("Y0")->read(); + data &= m_trainer_keyboard[0]->read(); else if (upper == 4) - data &= ioport("Y1")->read(); + data &= m_trainer_keyboard[1]->read(); else if (upper == 5) - data &= ioport("Y2")->read(); + data &= m_trainer_keyboard[2]->read(); } else { // Chess if (upper == 3) - data &= ioport("X0")->read(); + data &= m_chess_keyboard[0]->read(); else if (upper == 4) - data &= ioport("X1")->read(); + data &= m_chess_keyboard[1]->read(); else if (upper == 5) - data &= ioport("X2")->read(); + data &= m_chess_keyboard[2]->read(); } return data; @@ -180,6 +187,7 @@ u8 slc1_state::io_r(offs_t offset) void slc1_state::machine_start() { m_display.resolve(); + m_busyled.resolve(); save_item(NAME(m_digit)); save_item(NAME(m_kbd_type)); diff --git a/src/mame/drivers/spg2xx_lexibook.cpp b/src/mame/drivers/spg2xx_lexibook.cpp index ce3db54d8fb..fb7a216b119 100644 --- a/src/mame/drivers/spg2xx_lexibook.cpp +++ b/src/mame/drivers/spg2xx_lexibook.cpp @@ -413,17 +413,17 @@ ROM_END // these all have the same ROM scrambling -CONS( 200?, lexizeus, 0, 0, lexizeus, lexizeus, spg2xx_lexizeus_game_state, init_zeus, "Lexibook", "Zeus IG900 20-in-1 (US?)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // bad sound and some corrupt bg tilemap entries in Tiger Rescue, verify ROM data (same game runs in Zone 60 without issue) +CONS( 200?, lexizeus, 0, 0, lexizeus, lexizeus, spg2xx_lexizeus_game_state, init_zeus, "Lexibook / JungleTac", "Zeus IG900 20-in-1 (US?)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // bad sound and some corrupt bg tilemap entries in Tiger Rescue, verify ROM data (same game runs in Zone 60 without issue) -CONS( 200?, vsplus, 0, 0, vsplus, vsplus, spg2xx_vsplus_game_state, init_vsplus, "<unknown>", "Vs Power Plus 30-in-1", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +CONS( 200?, vsplus, 0, 0, vsplus, vsplus, spg2xx_vsplus_game_state, init_vsplus, "<unknown> / JungleTac", "Vs Power Plus 30-in-1", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) -CONS( 200?, lexiseal, 0, 0, lexiseal, lexiseal, spg2xx_lexiseal_game_state, init_zeus, "Lexibook / Sit Up Limited", "Seal 50-in-1", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // also has bad sound in Tiger Rescue, but no corrupt tilemap +CONS( 200?, lexiseal, 0, 0, lexiseal, lexiseal, spg2xx_lexiseal_game_state, init_zeus, "Lexibook / Sit Up Limited / JungleTac", "Seal 50-in-1", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // also has bad sound in Tiger Rescue, but no corrupt tilemap // There are versions of the Seal 50-in-1 that actually show Lexibook on the boot screen rather than it just being on the unit. The Seal name was also used for some VT systems CONS( 200?, discpal, 0, 0, lexizeus, lexiseal, spg2xx_lexizeus_game_state, init_zeus, "Performance Designed Products / Disney / Jungle Soft", "Disney Game It! Classic Pals", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // There was also a Game It! Princess Pals -CONS( 2006, vgcaplet, 0, 0, lexiseal, lexiseal, spg2xx_lexiseal_game_state, init_zeus, "Performance Designed Products (licensed by Taito / Data East)", "VG Pocket Caplet Fast Acting 50-in-1", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +CONS( 2006, vgcaplet, 0, 0, lexiseal, lexiseal, spg2xx_lexiseal_game_state, init_zeus, "Performance Designed Products (licensed by Taito / Data East) / JungleTac", "VG Pocket Caplet Fast Acting 50-in-1", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) -CONS( 2006, vgcap35, 0, 0, lexiseal, lexiseal, spg2xx_lexiseal_game_state, init_zeus, "Performance Designed Products (licensed by Taito / Data East)", "VG Pocket Caplet Fast Acting 35-in-1", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +CONS( 2006, vgcap35, 0, 0, lexiseal, lexiseal, spg2xx_lexiseal_game_state, init_zeus, "Performance Designed Products (licensed by Taito / Data East) / JungleTac", "VG Pocket Caplet Fast Acting 35-in-1", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) diff --git a/src/mame/drivers/spg2xx_zone.cpp b/src/mame/drivers/spg2xx_zone.cpp index e8bd8698ce3..ca003a00c30 100644 --- a/src/mame/drivers/spg2xx_zone.cpp +++ b/src/mame/drivers/spg2xx_zone.cpp @@ -362,21 +362,23 @@ ROM_END // Many of these games are rewrites of VT1682 based titles, which in turn were based on older NES/VT ones // Badminton hangs in units where it is present (cause not yet investigated), otherwise everything runs -CONS( 2009, zone40, 0, 0, zone40, wirels60, zone40_state, init_zone40, "Ultimate Products Ltd.", "Zone 40", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) -CONS( 2009, itvg49, 0, 0, zone40p, wirels60, zone40_state, init_reactmd, "TaiKee", "Interactive TV Games 49-in-1 (PAL)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) -CONS( 200?, zonemini, 0, 0, zone40, wirels60, zone40_state, init_reactmd, "Ultimate Products Ltd.", "Zone Mini", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) -CONS( 2009, react, 0, 0, zone40, wirels60, zone40_state, init_reactmd, "Ultimate Products Ltd.", "Reactor 32-in-1 (NTSC)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +// Waixing = "Fuzhou Waixing Computer Science & Technology Co.,LTD" + +CONS( 2009, zone40, 0, 0, zone40, wirels60, zone40_state, init_zone40, "Ultimate Products Ltd. / Waixing", "Zone 40", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +CONS( 2009, itvg49, 0, 0, zone40p, wirels60, zone40_state, init_reactmd, "TaiKee / Waixing", "Interactive TV Games 49-in-1 (PAL)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +CONS( 200?, zonemini, 0, 0, zone40, wirels60, zone40_state, init_reactmd, "Ultimate Products Ltd. / Waixing", "Zone Mini", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +CONS( 2009, react, 0, 0, zone40, wirels60, zone40_state, init_reactmd, "Ultimate Products Ltd. / Waixing", "Reactor 32-in-1 (NTSC)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // Two systems in one unit - Genesis on a Chip and SunPlus, only the SunPlus part is currently emulated. Genesis on a chip is a very poor implementation with many issues on real hardware. // This should actually boot to a menu on the MD size, with the SunPlus only being enabled if selected from that menu. MD side menu runs in some enhanced / custom MD mode tho. // Badminton hangs, as it does in the 49-in-1 above -CONS( 2009, reactmd, 0, 0, zone40p, wirels60, zone40_state, init_reactmd, "AtGames / Sega", "Reactor MD (PAL)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +CONS( 2009, reactmd, 0, 0, zone40p, wirels60, zone40_state, init_reactmd, "AtGames / Sega / Waixing", "Reactor MD (PAL)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) -// These have a newer selection of games by Jungletac instead of the Waixing ones +// These have a newer selection of games by JungleTac instead of the Waixing ones -CONS( 2010, zone60, 0, 0, wireless60, wirels60, wireless60_state, empty_init, "Jungle's Soft / Ultimate Products (HK) Ltd", "Zone 60", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) -CONS( 200?, zone100, 0, 0, wireless60, wirels60, wireless60_state, init_zone100, "Jungle's Soft / Ultimate Products (HK) Ltd", "Zone 100", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // unit was black, menus still show white controllers, unlike wireless 60 -CONS( 2010, wirels60, 0, 0, wireless60, wirels60, wireless60_state, empty_init, "Jungle Soft / Kids Station Toys Inc", "Wireless 60", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) -CONS( 2011, lx_jg7415,0, 0, wireless60, wirels60, wireless60_state, init_lx_jg7415, "Lexibook", "Lexibook JG7415 120-in-1", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +CONS( 2010, zone60, 0, 0, wireless60, wirels60, wireless60_state, empty_init, "Ultimate Products (HK) Ltd / Jungle's Soft", "Zone 60", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +CONS( 200?, zone100, 0, 0, wireless60, wirels60, wireless60_state, init_zone100, "Ultimate Products (HK) Ltd / Jungle's Soft", "Zone 100", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // unit was black, menus still show white controllers, unlike wireless 60 +CONS( 2010, wirels60, 0, 0, wireless60, wirels60, wireless60_state, empty_init, "Kids Station Toys Inc / Jungle Soft", "Wireless 60", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +CONS( 2011, lx_jg7415,0, 0, wireless60, wirels60, wireless60_state, init_lx_jg7415, "Lexibook / JungleTac", "Lexibook JG7415 120-in-1", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) diff --git a/src/mame/drivers/spg2xx_zone_32bit.cpp b/src/mame/drivers/spg2xx_zone_32bit.cpp index e0c9feb17d4..a7590ca444a 100644 --- a/src/mame/drivers/spg2xx_zone_32bit.cpp +++ b/src/mame/drivers/spg2xx_zone_32bit.cpp @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Ryan Holtz, David Haywood -/* 'Zone' '32-bit' systems */ +/* Shenzhen Senca Technology Co., Ltd developed "Family Sport" systems - sold by various manufacturers */ #include "emu.h" #include "includes/spg2xx.h" @@ -1008,22 +1008,22 @@ void denver_200in1_state::init_m521neo() // Box advertises this as '40 Games Included' but the cartridge, which was glued directly to the PCB, not removable, is a 41-in-1. Maybe some versions exist with a 40 game selection. -CONS( 200?, zon32bit, 0, 0, zon32bit, zon32bit, zon32bit_state, empty_init, "Jungle Soft / Ultimate Products (HK) Ltd", "Zone 32-bit Gaming Console System (Family Sport 41-in-1)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +CONS( 200?, zon32bit, 0, 0, zon32bit, zon32bit, zon32bit_state, empty_init, "Ultimate Products (HK) Ltd / Senca", "Zone 32-bit Gaming Console System (Family Sport 41-in-1)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // My Wico Deluxe was also available under the MiWi brand (exact model unknown, but it was a cart there instead of built in) // Box claimed 53 Arcade Games + 8 Sports games + 24 Music games, although it's unclear where 24 Music Games comes from, there are 3, which are identical aside from the title screen. // The Mi Guitar menu contains 24 games, but they're dupes, and just counting those would exclude the other Mi Fit and Mi Papacon menus (which also contain dupes) -CONS( 200?, mywicodx, 0, 0, zon32bit, zon32bit, mywicodx_state, empty_init, "<unknown>", "My Wico Deluxe (Family Sport 85-in-1)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +CONS( 200?, mywicodx, 0, 0, zon32bit, zon32bit, mywicodx_state, empty_init, "<unknown> / Senca", "My Wico Deluxe (Family Sport 85-in-1)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // Shows Mi Guitar 2 in the menu, it seems likely that there was an earlier version on VT1682 hardware as there is a very similar Guitar game (with the same song selection) in those multigames -CONS( 200?, mywicogt, 0, 0, zon32bit, mywicogt, mywicogt_state, empty_init, "<unknown>", "My Wico Guitar", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +CONS( 200?, mywicogt, 0, 0, zon32bit, mywicogt, mywicogt_state, empty_init, "<unknown> / Senca", "My Wico Guitar", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // issues with 'low battery' always showing, but otherwise functional -CONS( 200?, oplayer, 0, 0, zon32bit_bat, oplayer, oplayer_100in1_state, init_oplayer, "OPlayer", "OPlayer Mobile Game Console (MGS03-white) (Family Sport 100-in-1)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +CONS( 200?, oplayer, 0, 0, zon32bit_bat, oplayer, oplayer_100in1_state, init_oplayer, "OPlayer / Senca", "OPlayer Mobile Game Console (MGS03-white) (Family Sport 100-in-1)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) -CONS( 2012, m505neo, 0, 0, zon32bit_bat, oplayer, oplayer_100in1_state, init_m505neo, "Millennium 2000 GmbH", "Millennium M505 Arcade Neo Portable Spielkonsole (Family Sport 100-in-1)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +CONS( 2012, m505neo, 0, 0, zon32bit_bat, oplayer, oplayer_100in1_state, init_m505neo, "Millennium 2000 GmbH / Senca", "Millennium M505 Arcade Neo Portable Spielkonsole (Family Sport 100-in-1)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // a version of this exists with the 'newer' style title screen seen in m505neo -CONS( 2012, m521neo, 0, 0, zon32bit_bat, oplayer, denver_200in1_state, init_m521neo, "Millennium 2000 GmbH", "Millennium M521 Arcade Neo 2.0 (Family Sport 220-in-1) ", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +CONS( 2012, m521neo, 0, 0, zon32bit_bat, oplayer, denver_200in1_state, init_m521neo, "Millennium 2000 GmbH / Senca", "Millennium M521 Arcade Neo 2.0 (Family Sport 220-in-1) ", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) /* DENVER(r) @@ -1042,6 +1042,6 @@ DENMARK */ -CONS( 200?, dnv200fs, 0, 0, zon32bit_bat, oplayer, denver_200in1_state, init_denver, "Denver", "Denver (GMP-270CMK2) (Family Sport 200-in-1)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +CONS( 200?, dnv200fs, 0, 0, zon32bit_bat, oplayer, denver_200in1_state, init_denver, "Denver / Senca", "Denver (GMP-270CMK2) (Family Sport 200-in-1)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) diff --git a/src/mame/drivers/svmu.cpp b/src/mame/drivers/svmu.cpp index 08e2ee7dd90..11bea861954 100644 --- a/src/mame/drivers/svmu.cpp +++ b/src/mame/drivers/svmu.cpp @@ -37,11 +37,17 @@ public: , m_flash(*this, "flash") , m_speaker(*this, "speaker") , m_bios(*this, "bios") + , m_battery(*this, "BATTERY") + , m_file_icon(*this, "file_icon") + , m_game_icon(*this, "game_icon") + , m_clock_icon(*this, "clock_icon") + , m_flash_icon(*this, "flash_icon") { } void svmu(machine_config &config); protected: + virtual void machine_start() override; virtual void machine_reset() override; private: @@ -62,6 +68,11 @@ private: required_device<intelfsh8_device> m_flash; required_device<speaker_sound_device> m_speaker; required_region_ptr<uint8_t> m_bios; + required_ioport m_battery; + output_finder<> m_file_icon; + output_finder<> m_game_icon; + output_finder<> m_clock_icon; + output_finder<> m_flash_icon; uint8_t m_page; }; @@ -126,7 +137,7 @@ void svmu_state::p1_w(uint8_t data) uint8_t svmu_state::p7_r() { - return (ioport("BATTERY")->read()<<1); + return (m_battery->read()<<1); } @@ -159,6 +170,14 @@ static INPUT_PORTS_START( svmu ) PORT_CONFSETTING( 0x00, "Poor" ) INPUT_PORTS_END +void svmu_state::machine_start() +{ + m_file_icon.resolve(); + m_game_icon.resolve(); + m_clock_icon.resolve(); + m_flash_icon.resolve(); +} + void svmu_state::machine_reset() { m_page = 0; @@ -188,10 +207,10 @@ LC8670_LCD_UPDATE(svmu_state::svmu_lcd_update) bitmap.fill(0, cliprect); } - machine().output().set_value("file_icon" , lcd_enabled ? BIT(vram[0xc1],6) : 0); - machine().output().set_value("game_icon" , lcd_enabled ? BIT(vram[0xc2],4) : 0); - machine().output().set_value("clock_icon", lcd_enabled ? BIT(vram[0xc3],2) : 0); - machine().output().set_value("flash_icon", lcd_enabled ? BIT(vram[0xc4],0) : 0); + m_file_icon = lcd_enabled ? BIT(vram[0xc1],6) : 0; + m_game_icon = lcd_enabled ? BIT(vram[0xc2],4) : 0; + m_clock_icon = lcd_enabled ? BIT(vram[0xc3],2) : 0; + m_flash_icon = lcd_enabled ? BIT(vram[0xc4],0) : 0; return 0; } diff --git a/src/mame/drivers/tm990189.cpp b/src/mame/drivers/tm990189.cpp index c5d4b5e01a3..f462a477a39 100644 --- a/src/mame/drivers/tm990189.cpp +++ b/src/mame/drivers/tm990189.cpp @@ -93,6 +93,7 @@ public: , m_tms9901_sys(*this, TMS9901_1_TAG) , m_tms9902(*this, "tms9902") , m_digits(*this, "digit%u", 0U) + , m_leds(*this, "led%u", 0U) { } void tm990_189_v(machine_config &config); @@ -165,6 +166,7 @@ private: required_device<tms9901_device> m_tms9901_sys; required_device<tms9902_device> m_tms9902; output_finder<10> m_digits; + output_finder<7> m_leds; int m_load_state; @@ -196,12 +198,14 @@ MACHINE_RESET_MEMBER(tm990189_state,tm990_189) MACHINE_START_MEMBER(tm990189_state,tm990_189) { m_digits.resolve(); + m_leds.resolve(); m_displayena_timer = machine().scheduler().timer_alloc(timer_expired_delegate()); } MACHINE_START_MEMBER(tm990189_state,tm990_189_v) { m_digits.resolve(); + m_leds.resolve(); m_displayena_timer = machine().scheduler().timer_alloc(timer_expired_delegate()); m_joy1x_timer = machine().scheduler().timer_alloc(timer_expired_delegate()); @@ -259,11 +263,9 @@ void tm990189_state::draw_digit() TIMER_DEVICE_CALLBACK_MEMBER(tm990189_state::display_callback) { - uint8_t i; - char ledname[8]; // since the segment data is cleared after being used, the old_segment is there // in case the segment data hasn't been refreshed yet. - for (i = 0; i < 10; i++) + for (uint8_t i = 0; i < 10; i++) { m_old_segment_state[i] |= m_segment_state[i]; m_digits[i] = m_old_segment_state[i]; @@ -271,11 +273,8 @@ TIMER_DEVICE_CALLBACK_MEMBER(tm990189_state::display_callback) m_segment_state[i] = 0; } - for (i = 0; i < 7; i++) - { - sprintf(ledname,"led%d",i); - output().set_value(ledname, !BIT(m_LED_state, i)); - } + for (uint8_t i = 0; i < 7; i++) + m_leds[i] = !BIT(m_LED_state, i); } /* diff --git a/src/mame/drivers/vk100.cpp b/src/mame/drivers/vk100.cpp index cb3e4ee42db..7dff5700c6c 100644 --- a/src/mame/drivers/vk100.cpp +++ b/src/mame/drivers/vk100.cpp @@ -179,7 +179,14 @@ public: //m_sync_timer(nullptr), m_capsshift(*this, "CAPSSHIFT"), - m_dipsw(*this, "SWITCHES") + m_dipsw(*this, "SWITCHES"), + m_online_led(*this, "online_led"), + m_local_led(*this, "local_led"), + m_noscroll_led(*this, "noscroll_led"), + m_basic_led(*this, "basic_led"), + m_hardcopy_led(*this, "hardcopy_led"), + m_l1_led(*this, "l1_led"), + m_l2_led(*this, "l2_led") { } @@ -204,6 +211,14 @@ private: required_ioport m_capsshift; required_ioport m_dipsw; + output_finder<> m_online_led; + output_finder<> m_local_led; + output_finder<> m_noscroll_led; + output_finder<> m_basic_led; + output_finder<> m_hardcopy_led; + output_finder<> m_l1_led; + output_finder<> m_l2_led; + uint8_t* m_vram; uint8_t* m_trans; uint8_t* m_pattern; @@ -556,13 +571,13 @@ void vk100_state::vgEX(offs_t offset, uint8_t data) /* port 0x68: "KBDW" d7 is beeper, d6 is keyclick, d5-d0 are keyboard LEDS */ void vk100_state::KBDW(uint8_t data) { - output().set_value("online_led",BIT(data, 5) ? 1 : 0); - output().set_value("local_led", BIT(data, 5) ? 0 : 1); - output().set_value("noscroll_led",BIT(data, 4) ? 1 : 0); - output().set_value("basic_led", BIT(data, 3) ? 1 : 0); - output().set_value("hardcopy_led", BIT(data, 2) ? 1 : 0); - output().set_value("l1_led", BIT(data, 1) ? 1 : 0); - output().set_value("l2_led", BIT(data, 0) ? 1 : 0); + m_online_led = BIT(data, 5) ? 1 : 0; + m_local_led = BIT(data, 5) ? 0 : 1; + m_noscroll_led = BIT(data, 4) ? 1 : 0; + m_basic_led = BIT(data, 3) ? 1 : 0; + m_hardcopy_led = BIT(data, 2) ? 1 : 0; + m_l1_led = BIT(data, 1) ? 1 : 0; + m_l2_led = BIT(data, 0) ? 1 : 0; #ifdef LED_VERBOSE if (BIT(data, 6)) logerror("kb keyclick bit 6 set: not emulated yet (multivibrator)!\n"); #endif @@ -923,13 +938,21 @@ INPUT_PORTS_END void vk100_state::machine_start() { - output().set_value("online_led",1); - output().set_value("local_led", 0); - output().set_value("noscroll_led",1); - output().set_value("basic_led", 1); - output().set_value("hardcopy_led", 1); - output().set_value("l1_led", 1); - output().set_value("l2_led", 1); + m_online_led.resolve(); + m_local_led.resolve(); + m_noscroll_led.resolve(); + m_basic_led.resolve(); + m_hardcopy_led.resolve(); + m_l1_led.resolve(); + m_l2_led.resolve(); + + m_online_led = 1; + m_local_led = 0; + m_noscroll_led = 1; + m_basic_led = 1; + m_hardcopy_led = 1; + m_l1_led = 1; + m_l2_led = 1; m_vsync = 0; m_dir_a6 = 1; m_cout = 0; diff --git a/src/mame/drivers/x68k.cpp b/src/mame/drivers/x68k.cpp index a2eca47417d..7a93ea3db98 100644 --- a/src/mame/drivers/x68k.cpp +++ b/src/mame/drivers/x68k.cpp @@ -1501,13 +1501,6 @@ void x68k_state::machine_reset() //m_mfpdev->i7_w(1); // h-sync // reset output values - output().set_value("key_led_kana",1); - output().set_value("key_led_romaji",1); - output().set_value("key_led_code",1); - output().set_value("key_led_caps",1); - output().set_value("key_led_insert",1); - output().set_value("key_led_hiragana",1); - output().set_value("key_led_fullsize",1); std::fill(std::begin(m_eject_drv_out), std::end(m_eject_drv_out), 1); std::fill(std::begin(m_ctrl_drv_out), std::end(m_ctrl_drv_out), 1); std::fill(std::begin(m_access_drv_out), std::end(m_access_drv_out), 1); diff --git a/src/mame/includes/alesis.h b/src/mame/includes/alesis.h index b15a3c32ae8..9efc395235e 100644 --- a/src/mame/includes/alesis.h +++ b/src/mame/includes/alesis.h @@ -61,14 +61,10 @@ public: m_lcdc(*this, "hd44780"), m_cassette(*this, "cassette"), m_maincpu(*this, "maincpu"), - m_col1(*this, "COL1"), - m_col2(*this, "COL2"), - m_col3(*this, "COL3"), - m_col4(*this, "COL4"), - m_col5(*this, "COL5"), - m_col6(*this, "COL6"), + m_col(*this, "COL%u", 1U), m_select(*this, "SELECT"), m_digit(*this, "digit%u", 0U), + m_pattern(*this, "pattern"), m_track_led(*this, "track_led%u", 1U), m_patt_led(*this, "patt_led"), m_song_led(*this, "song_led"), @@ -168,14 +164,10 @@ private: optional_device<cassette_image_device> m_cassette; required_device<mcs51_cpu_device> m_maincpu; - required_ioport m_col1; - required_ioport m_col2; - required_ioport m_col3; - required_ioport m_col4; - required_ioport m_col5; - required_ioport m_col6; + required_ioport_array<6> m_col; optional_ioport m_select; output_finder<5> m_digit; + output_finder<> m_pattern; output_finder<8> m_track_led; output_finder<> m_patt_led; output_finder<> m_song_led; diff --git a/src/mame/includes/apollo.h b/src/mame/includes/apollo.h index 367a926baa5..47f9548b31f 100644 --- a/src/mame/includes/apollo.h +++ b/src/mame/includes/apollo.h @@ -135,9 +135,37 @@ public: m_node_id(*this, APOLLO_NI_TAG), m_isa(*this, APOLLO_ISA_TAG), m_graphics(*this, APOLLO_SCREEN_TAG), - m_keyboard(*this, APOLLO_KBD_TAG) + m_keyboard(*this, APOLLO_KBD_TAG), + m_internal_leds(*this, "internal_led_%u", 1U), + m_external_leds(*this, "external_led_%c", unsigned('a')) { } + void dn3500(machine_config &config); + void dn5500_19i(machine_config &config); + void dn3000(machine_config &config); + void dn3000_15i(machine_config &config); + void dn3000_19i(machine_config &config); + void dn3500_15i(machine_config &config); + void dsp3000(machine_config &config); + void dsp3500(machine_config &config); + void dsp5500(machine_config &config); + void dn5500(machine_config &config); + void dn5500_15i(machine_config &config); + void dn3500_19i(machine_config &config); + + void init_dsp3000(); + void init_dsp5500(); + void init_dn3500(); + void init_dn3000(); + void init_dsp3500(); + void init_dn5500(); + void init_apollo(); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + +private: required_device<m68000_base_device> m_maincpu; required_device<ram_device> m_ram; required_shared_ptr<uint32_t> m_messram_ptr; @@ -154,6 +182,8 @@ public: required_device<isa16_device> m_isa; optional_device<apollo_graphics_15i> m_graphics; optional_device<apollo_kbd_device> m_keyboard; + output_finder<4> m_internal_leds; + output_finder<4> m_external_leds; void apollo_csr_status_register_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); uint16_t apollo_csr_status_register_r(offs_t offset, uint16_t mem_mask = ~0); @@ -202,16 +232,7 @@ public: uint8_t dn5500_11500_r(offs_t offset); void dn5500_io_protection_map_w(offs_t offset, uint8_t data); uint8_t dn5500_io_protection_map_r(offs_t offset); - void init_dsp3000(); - void init_dsp5500(); - void init_dn3500(); - void init_dn3000(); - void init_dsp3500(); - void init_dn5500(); - void init_apollo(); - virtual void machine_start() override; - virtual void machine_reset() override; DECLARE_MACHINE_RESET(apollo); DECLARE_MACHINE_START(apollo); @@ -264,25 +285,14 @@ public: void common(machine_config &config); void apollo(machine_config &config); void apollo_terminal(machine_config &config); - void dn3500(machine_config &config); - void dn5500_19i(machine_config &config); - void dn3000(machine_config &config); - void dn3000_15i(machine_config &config); - void dn3000_19i(machine_config &config); - void dn3500_15i(machine_config &config); - void dsp3000(machine_config &config); - void dsp3500(machine_config &config); - void dsp5500(machine_config &config); - void dn5500(machine_config &config); - void dn5500_15i(machine_config &config); - void dn3500_19i(machine_config &config); + void dn3000_map(address_map &map); void dn3500_map(address_map &map); void dn5500_map(address_map &map); void dsp3000_map(address_map &map); void dsp3500_map(address_map &map); void dsp5500_map(address_map &map); -private: + uint32_t ptm_counter; uint8_t sio_output_data; int m_dma_channel; diff --git a/src/mame/includes/aquarius.h b/src/mame/includes/aquarius.h index d1c8ea069d1..d2c54611710 100644 --- a/src/mame/includes/aquarius.h +++ b/src/mame/includes/aquarius.h @@ -20,6 +20,8 @@ #include "bus/generic/slot.h" #include "bus/generic/carts.h" +#include "formats/aquarius_caq.h" + #include "emupal.h" #include "screen.h" #include "tilemap.h" diff --git a/src/mame/includes/gladiatr.h b/src/mame/includes/gladiatr.h index 0a8d0cb8a0d..9cef1e78daf 100644 --- a/src/mame/includes/gladiatr.h +++ b/src/mame/includes/gladiatr.h @@ -110,6 +110,17 @@ public: { } + DECLARE_INPUT_CHANGED_MEMBER(p1_s1); + DECLARE_INPUT_CHANGED_MEMBER(p1_s2); + DECLARE_INPUT_CHANGED_MEMBER(p2_s1); + DECLARE_INPUT_CHANGED_MEMBER(p2_s2); + + void gladiatr(machine_config &config); + void greatgur(machine_config &config); + + void init_gladiatr(); + +private: DECLARE_WRITE_LINE_MEMBER(spritebank_w); void gladiatr_video_registers_w(offs_t offset, u8 data); @@ -131,25 +142,17 @@ public: void csnd_p1_w(u8 data); u8 csnd_p2_r(); - DECLARE_INPUT_CHANGED_MEMBER(p1_s1); - DECLARE_INPUT_CHANGED_MEMBER(p1_s2); - DECLARE_INPUT_CHANGED_MEMBER(p2_s1); - DECLARE_INPUT_CHANGED_MEMBER(p2_s2); - - void init_gladiatr(); - DECLARE_MACHINE_RESET(gladiator); DECLARE_VIDEO_START(gladiatr); uint32_t screen_update_gladiatr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void swap_block(u8 *src1,u8 *src2,int len); + static void swap_block(u8 *src1, u8 *src2, int len); - void gladiatr(machine_config &config); void gladiatr_cpu1_io(address_map &map); void gladiatr_cpu1_map(address_map &map); void gladiatr_cpu2_io(address_map &map); void gladiatr_cpu3_map(address_map &map); -private: + required_ioport m_dsw1, m_dsw2; required_ioport m_in0, m_in1, m_in2; required_ioport m_coins; diff --git a/src/mame/includes/hp48.h b/src/mame/includes/hp48.h index 6819d4a0b15..990592b5e9d 100644 --- a/src/mame/includes/hp48.h +++ b/src/mame/includes/hp48.h @@ -42,6 +42,12 @@ public: , m_palette(*this, "palette") , m_screen(*this, "screen") , m_port(*this, "port%u", 1U) + , m_lshift0(*this, "lshift0") + , m_rshift0(*this, "rshift0") + , m_alpha0(*this, "alpha0") + , m_alert0(*this, "alert0") + , m_busy0(*this, "busy0") + , m_transmit0(*this, "transmit0") { } @@ -150,6 +156,13 @@ private: */ optional_device_array<hp48_port_image_device, 2> m_port; + output_finder<> m_lshift0; + output_finder<> m_rshift0; + output_finder<> m_alpha0; + output_finder<> m_alert0; + output_finder<> m_busy0; + output_finder<> m_transmit0; + uint32_t m_bank_switch; uint32_t m_io_addr; uint16_t m_crc; diff --git a/src/mame/includes/hp9845.h b/src/mame/includes/hp9845.h index 62c2a2b6e42..30ffc7f2a46 100644 --- a/src/mame/includes/hp9845.h +++ b/src/mame/includes/hp9845.h @@ -63,6 +63,9 @@ protected: required_device_array<hp9845_io_slot_device, 4> m_io_slot; required_device<ram_device> m_ram; output_finder<8> m_softkeys; + output_finder<> m_shift_lock_led; + output_finder<> m_prt_all_led; + output_finder<> m_auto_st_led; void setup_ram_block(unsigned block , unsigned offset); diff --git a/src/mame/includes/kaypro.h b/src/mame/includes/kaypro.h index 97de596cfe4..2e66840954b 100644 --- a/src/mame/includes/kaypro.h +++ b/src/mame/includes/kaypro.h @@ -39,6 +39,7 @@ public: , m_bankw(*this, "bankw") , m_bank3(*this, "bank3") , m_floppy_timer(*this, "floppy_timer") + , m_leds(*this, "led%c", unsigned('A')) {} void omni2(machine_config &config); @@ -53,6 +54,10 @@ public: void init_kaypro(); +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + private: void kaypro484_io(address_map &map); void kaypro_map(address_map &map); @@ -75,8 +80,7 @@ private: DECLARE_WRITE_LINE_MEMBER(fdc_drq_w); u8 kaypro_videoram_r(offs_t offset); void kaypro_videoram_w(offs_t offset, u8 data); - void machine_start() override; - void machine_reset() override; + void kaypro_palette(palette_device &palette) const; uint32_t screen_update_kayproii(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); uint32_t screen_update_kaypro484(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); @@ -115,6 +119,7 @@ private: required_memory_bank m_bankw; required_memory_bank m_bank3; required_device<timer_device> m_floppy_timer; + output_finder<2> m_leds; }; #endif // MAME_INCLUDES_KAYPRO_H diff --git a/src/mame/includes/mac.h b/src/mame/includes/mac.h index 0eeed203cff..55171f89ba5 100644 --- a/src/mame/includes/mac.h +++ b/src/mame/includes/mac.h @@ -105,7 +105,6 @@ public: void maclc3(machine_config &config, bool egret = true); void macpd210(machine_config &config); void maciici(machine_config &config); - void macprtb(machine_config &config); void maciix(machine_config &config, bool nubus_bank1 = true, bool nubus_bank2 = true); void maclc520(machine_config &config); void pwrmac(machine_config &config); @@ -129,19 +128,14 @@ public: void init_maclc2(); void init_maciifdhd(); void init_macse30(); - void init_macprtb(); void init_maciivx(); void init_maciivi(); - void init_macpd210(); void init_macii(); void init_macclassic(); - void init_macquadra700(); void init_macclassic2(); void init_maciifx(); void init_maclc(); - void init_macpb160(); void init_macse(); - void init_macpb140(); void init_macpm6100(); void init_maclc520(); void init_maciici(); @@ -153,7 +147,6 @@ public: void init_maclc3plus(); void init_macpm7100(); void init_macpm8100(); - void init_macpb100(); /* tells which model is being emulated (set by macxxx_init) */ enum model_t @@ -358,15 +351,6 @@ private: void amic_dma_w(offs_t offset, uint8_t data); uint8_t pmac_diag_r(offs_t offset); - uint8_t mac_gsc_r(offs_t offset); - void mac_gsc_w(uint8_t data); - - uint8_t mac_5396_r(offs_t offset); - void mac_5396_w(offs_t offset, uint8_t data); - - uint32_t macwd_r(offs_t offset, uint32_t mem_mask = ~0); - void macwd_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0); - DECLARE_WRITE_LINE_MEMBER(nubus_irq_9_w); DECLARE_WRITE_LINE_MEMBER(nubus_irq_a_w); DECLARE_WRITE_LINE_MEMBER(nubus_irq_b_w); @@ -393,7 +377,6 @@ private: void macpb165c_map(address_map &map); void macpd210_map(address_map &map); void macplus_map(address_map &map); - void macprtb_map(address_map &map); void macse30_map(address_map &map); void macse_map(address_map &map); void pwrmac_map(address_map &map); @@ -423,10 +406,7 @@ private: uint8_t m_pm_req, m_pm_state, m_pm_dptr, m_pm_cmd; - void macgsc_palette(palette_device &palette) const; - DECLARE_VIDEO_START(mac); - DECLARE_VIDEO_START(macprtb); DECLARE_VIDEO_START(macsonora); DECLARE_VIDEO_RESET(macrbv); DECLARE_VIDEO_START(macv8); @@ -434,10 +414,7 @@ private: DECLARE_VIDEO_RESET(maceagle); DECLARE_VIDEO_START(macrbv); uint32_t screen_update_mac(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - uint32_t screen_update_macprtb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); uint32_t screen_update_macse30(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - uint32_t screen_update_macpb140(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - uint32_t screen_update_macpb160(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); uint32_t screen_update_macrbv(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); uint32_t screen_update_macrbvvram(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); uint32_t screen_update_macv8(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); diff --git a/src/mame/includes/px8.h b/src/mame/includes/px8.h index 81c6ccd6c9d..e7794dd6746 100644 --- a/src/mame/includes/px8.h +++ b/src/mame/includes/px8.h @@ -36,6 +36,7 @@ public: , m_cassette(*this, "cassette") , m_ram(*this, RAM_TAG) , m_video_ram(*this, "video_ram") + , m_leds(*this, "led_%u", 0U) { } void px8(machine_config &config); @@ -46,6 +47,7 @@ private: required_device<ram_device> m_ram; /* video state */ required_shared_ptr<uint8_t> m_video_ram; /* LCD video RAM */ + output_finder<3> m_leds; virtual void machine_start() override; virtual void machine_reset() override; diff --git a/src/mame/includes/thomson.h b/src/mame/includes/thomson.h index 430d6ea6f43..e61befe3009 100644 --- a/src/mame/includes/thomson.h +++ b/src/mame/includes/thomson.h @@ -150,7 +150,8 @@ public: m_to7qdd(*this, "to7qdd"), m_thmfc(*this, "thmfc"), m_floppy_led(*this, "floppy"), - m_floppy_image(*this, "floppy%u", 0U) + m_floppy_image(*this, "floppy%u", 0U), + m_caps_led(*this, "led0") { } @@ -434,6 +435,8 @@ private: output_finder<> m_floppy_led; required_device_array<legacy_floppy_image_device, 4> m_floppy_image; + output_finder<> m_caps_led; + /* bank logging and optimisations */ int m_old_cart_bank; int m_old_cart_bank_was_read_only; @@ -555,7 +558,6 @@ private: int mo5_get_cassette(); void mo5_set_cassette( int data ); void thom_irq_reset(); - void thom_set_caps_led( int led ); void to7_update_cart_bank(); void to7_set_init( int init ); void to7_modem_reset(); diff --git a/src/mame/layout/fidel_dsc.lay b/src/mame/layout/fidel_dsc.lay index 0287ae14efb..12f80735c69 100644 --- a/src/mame/layout/fidel_dsc.lay +++ b/src/mame/layout/fidel_dsc.lay @@ -8,8 +8,32 @@ license:CC0 <element name="black"><rect><color red="0.17" green="0.15" blue="0.15" /></rect></element> <element name="white"><rect><color red="0.81" green="0.8" blue="0.79" /></rect></element> - <element name="disk_black"><disk><color red="0.17" green="0.15" blue="0.15" /></disk></element> - <element name="disk_white"><disk><color red="0.81" green="0.8" blue="0.79" /></disk></element> + + <element name="btn_white"> + <disk> + <bounds xc="0" yc="0" width="7" height="7" /> + <color red="0.17" green="0.15" blue="0.15" /> + </disk> + <disk> + <bounds xc="0" yc="0" width="5.2" height="5.2" /> + <color red="0.81" green="0.8" blue="0.79" /> + </disk> + </element> + + <element name="btn_black"> + <disk> + <bounds xc="0" yc="0" width="7" height="7" /> + <color red="0.17" green="0.15" blue="0.15" /> + </disk> + <disk> + <bounds xc="0" yc="0" width="6.2" height="6.2" /> + <color red="0.81" green="0.8" blue="0.79" /> + </disk> + <disk> + <bounds xc="0" yc="0" width="5" height="5" /> + <color red="0.17" green="0.15" blue="0.15" /> + </disk> + </element> <element name="digit" defstate="0"> <led7seg><color red="1.0" green="0.1" blue="0.15" /></led7seg> @@ -21,10 +45,7 @@ license:CC0 </element> <element name="hlb" defstate="0"> - <text string=" "> - <bounds x="0.0" y="0.0" width="1.0" height="1.0" /> - <color red="0.0" green="0.0" blue="0.0" /> - </text> + <rect><color alpha="0" /></rect> <!-- force unit square element bounds --> <disk state="1"> <bounds x="0.0" y="0.0" width="1.0" height="1.0" /> <color red="1.0" green="1.0" blue="1.0" /> @@ -268,7 +289,7 @@ license:CC0 <element name="cwhite"><rect><color red="0.81" green="0.8" blue="0.79" /></rect></element> <element name="hlbb" defstate="0"> - <text string=" "><bounds x="0" y="0" width="1" height="1" /></text> + <rect><color alpha="0" /></rect> <!-- force unit square element bounds --> <disk state="1"> <bounds x="0.12" y="0.12" width="0.76" height="0.76" /> <color red="0" green="0" blue="0" /> @@ -276,7 +297,7 @@ license:CC0 </element> <element name="piece" defstate="0"> - <text string=" "><bounds x="0" y="0" width="1" height="1" /></text> + <rect><color alpha="0" /></rect> <!-- force unit square element bounds --> <disk state="1"> <bounds x="0.1" y="0.1" width="0.8" height="0.8" /> <color red="1" green="0.9" blue="0.6" /> @@ -344,7 +365,7 @@ license:CC0 <param name="xl" start="15" increment="20" /> <param name="xi" start="0" increment="1" /> <element ref="cblack"><bounds x="~x~" y="~y~" width="10" height="10" /></element> - <element ref="text_e~yi~~xi~"><bounds x="~xl~" y="~yl~" width="4.9" height="2.48" /></element> + <element ref="text_e~yi~~xi~"><bounds x="~xl~" y="~yl~" width="4.8" height="2.35" /></element> </repeat> </repeat> <repeat count="5"> @@ -356,7 +377,7 @@ license:CC0 <param name="xl" start="5" increment="20" /> <param name="xi" start="0" increment="1" /> <element ref="cblack"><bounds x="~x~" y="~y~" width="10" height="10" /></element> - <element ref="text_o~yi~~xi~"><bounds x="~xl~" y="~yl~" width="4.9" height="2.48" /></element> + <element ref="text_o~yi~~xi~"><bounds x="~xl~" y="~yl~" width="4.8" height="2.35" /></element> </repeat> </repeat> @@ -523,28 +544,15 @@ license:CC0 <!-- right side --> - <element ref="disk_black"><bounds x="107" y="14.5" width="7" height="7" /></element> - <element ref="disk_black"><bounds x="107" y="24.5" width="7" height="7" /></element> - <element ref="disk_black"><bounds x="107" y="34.5" width="7" height="7" /></element> - <element ref="disk_black"><bounds x="107" y="44.5" width="7" height="7" /></element> - <element ref="disk_black"><bounds x="107" y="54.5" width="7" height="7" /></element> - <element ref="disk_black"><bounds x="107" y="64.5" width="7" height="7" /></element> - <element ref="disk_black"><bounds x="107" y="74.5" width="7" height="7" /></element> - <element ref="disk_black"><bounds x="107" y="84.5" width="7" height="7" /></element> - <element ref="disk_black"><bounds x="107" y="94.5" width="7" height="7" /></element> - - <element ref="disk_white"><bounds x="107.9" y="15.4" width="5.2" height="5.2" /></element> - <element ref="disk_white"><bounds x="107.9" y="25.4" width="5.2" height="5.2" /></element> - <element ref="disk_white"><bounds x="107.9" y="35.4" width="5.2" height="5.2" /></element> - <element ref="disk_white"><bounds x="107.9" y="45.4" width="5.2" height="5.2" /></element> - <element ref="disk_white"><bounds x="107.9" y="55.4" width="5.2" height="5.2" /></element> - <element ref="disk_white"><bounds x="107.9" y="65.4" width="5.2" height="5.2" /></element> - <element ref="disk_white"><bounds x="107.9" y="75.4" width="5.2" height="5.2" /></element> - - <element ref="disk_white"><bounds x="107.4" y="84.9" width="6.2" height="6.2" /></element> - <element ref="disk_white"><bounds x="107.4" y="94.9" width="6.2" height="6.2" /></element> - <element ref="disk_black"><bounds x="108" y="85.5" width="5" height="5" /></element> - <element ref="disk_black"><bounds x="108" y="95.5" width="5" height="5" /></element> + <element ref="btn_white"><bounds x="107" y="14.5" width="7" height="7" /></element> + <element ref="btn_white"><bounds x="107" y="24.5" width="7" height="7" /></element> + <element ref="btn_white"><bounds x="107" y="34.5" width="7" height="7" /></element> + <element ref="btn_white"><bounds x="107" y="44.5" width="7" height="7" /></element> + <element ref="btn_white"><bounds x="107" y="54.5" width="7" height="7" /></element> + <element ref="btn_white"><bounds x="107" y="64.5" width="7" height="7" /></element> + <element ref="btn_white"><bounds x="107" y="74.5" width="7" height="7" /></element> + <element ref="btn_black"><bounds x="107" y="84.5" width="7" height="7" /></element> + <element ref="btn_black"><bounds x="107" y="94.5" width="7" height="7" /></element> <element ref="text_re"><bounds x="108" y="16.5" width="5" height="3" /></element> <element ref="text_pb"><bounds x="108" y="26.5" width="5" height="3" /></element> diff --git a/src/mame/layout/tmtennis.lay b/src/mame/layout/tmtennis.lay index 9d434d4a914..94384606c88 100644 --- a/src/mame/layout/tmtennis.lay +++ b/src/mame/layout/tmtennis.lay @@ -16,7 +16,7 @@ license:CC0 <path d="m 138.5,224.5 47,-166" /> <path d="m 561.5,224.5 -47,-166" /> <path d="M 163,136.5 H 537" /> - <path d="M 350,247.5 V 38.5" + <path d="M 350,247.5 V 38.5" /> </g> <g fill="#00ff00"> <rect width="12" height="39" x="344" y="0" /> diff --git a/src/mame/machine/apollo.cpp b/src/mame/machine/apollo.cpp index b0097398432..348351f4dad 100644 --- a/src/mame/machine/apollo.cpp +++ b/src/mame/machine/apollo.cpp @@ -266,14 +266,10 @@ void apollo_state::apollo_csr_control_register_w(offs_t offset, uint16_t data, u COMBINE_DATA(&cpu_control_register); - output().set_value("internal_led_1", (cpu_control_register >> 15) & 1); - output().set_value("internal_led_2", (cpu_control_register >> 14) & 1); - output().set_value("internal_led_3", (cpu_control_register >> 13) & 1); - output().set_value("internal_led_4", (cpu_control_register >> 12) & 1); - output().set_value("external_led_a", (cpu_control_register >> 11) & 1); - output().set_value("external_led_b", (cpu_control_register >> 10) & 1); - output().set_value("external_led_c", (cpu_control_register >> 9) & 1); - output().set_value("external_led_d", (cpu_control_register >> 8) & 1); + for (int i = 0; i < 4; i++) + m_internal_leds[i] = BIT(cpu_control_register, 15 - i); + for (int i = 0; i < 4; i++) + m_external_leds[i] = BIT(cpu_control_register, 11 - i); leds = ((cpu_control_register >> 8) & 0xff) ^ 0xff; @@ -1203,6 +1199,9 @@ MACHINE_START_MEMBER(apollo_state,apollo) m_dma_channel = -1; m_cur_eop = false; + + m_internal_leds.resolve(); + m_external_leds.resolve(); } MACHINE_RESET_MEMBER(apollo_state,apollo) diff --git a/src/mame/machine/dec_lk201.cpp b/src/mame/machine/dec_lk201.cpp index aca879a7775..3230a3b1dda 100644 --- a/src/mame/machine/dec_lk201.cpp +++ b/src/mame/machine/dec_lk201.cpp @@ -508,24 +508,11 @@ lk201_device::lk201_device(const machine_config &mconfig, const char *tag, devic device_serial_interface(mconfig, *this), m_maincpu(*this, LK201_CPU_TAG), m_speaker(*this, LK201_SPK_TAG), - m_kbd0(*this, "KBD0"), - m_kbd1(*this, "KBD1"), - m_kbd2(*this, "KBD2"), - m_kbd3(*this, "KBD3"), - m_kbd4(*this, "KBD4"), - m_kbd5(*this, "KBD5"), - m_kbd6(*this, "KBD6"), - m_kbd7(*this, "KBD7"), - m_kbd8(*this, "KBD8"), - m_kbd9(*this, "KBD9"), - m_kbd10(*this, "KBD10"), - m_kbd11(*this, "KBD11"), - m_kbd12(*this, "KBD12"), - m_kbd13(*this, "KBD13"), - m_kbd14(*this, "KBD14"), - m_kbd15(*this, "KBD15"), - m_kbd16(*this, "KBD16"), - m_kbd17(*this, "KBD17"), + m_kbd(*this, "KBD%u", 0U), + m_led_wait(*this, "led_wait"), + m_led_compose(*this, "led_compose"), + m_led_lock(*this, "led_lock"), + m_led_hold(*this, "led_hold"), m_tx_handler(*this) { } @@ -540,6 +527,11 @@ void lk201_device::device_start() m_tx_handler.resolve_safe(); m_beeper = timer_alloc(2); + + m_led_wait.resolve(); + m_led_compose.resolve(); + m_led_lock.resolve(); + m_led_hold.resolve(); } @@ -572,6 +564,12 @@ void lk201_device::device_reset() transmit_register_reset(); receive_register_reset(); + + // GREEN KEYBOARD LEDs (1 = on, 0 = off): + m_led_wait = 0; // led8 + m_led_compose = 0; // led9 + m_led_lock = 0; // led10 + m_led_hold = 0; // led11 } void lk201_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) @@ -733,24 +731,24 @@ void lk201_device::send_port(uint8_t offset, uint8_t olddata) // Check for keyboard read strobe if (((portc & 0x40) == 0) && (olddata & 0x40)) { - if (porta & 0x1) kbd_data = m_kbd0->read(); - if (porta & 0x2) kbd_data = m_kbd1->read(); - if (porta & 0x4) kbd_data = m_kbd2->read(); - if (porta & 0x8) kbd_data = m_kbd3->read(); - if (porta & 0x10) kbd_data = m_kbd4->read(); - if (porta & 0x20) kbd_data = m_kbd5->read(); - if (porta & 0x40) kbd_data = m_kbd6->read(); - if (porta & 0x80) kbd_data = m_kbd7->read(); - if (portb & 0x1) kbd_data = m_kbd8->read(); - if (portb & 0x2) kbd_data = m_kbd9->read(); - if (portb & 0x4) kbd_data = m_kbd10->read(); - if (portb & 0x8) kbd_data = m_kbd11->read(); - if (portb & 0x10) kbd_data = m_kbd12->read(); - if (portb & 0x20) kbd_data = m_kbd13->read(); - if (portb & 0x40) kbd_data = m_kbd14->read(); - if (portb & 0x80) kbd_data = m_kbd15->read(); - if (portc & 0x1) kbd_data = m_kbd16->read(); - if (portc & 0x2) kbd_data = m_kbd17->read(); + if (porta & 0x1) kbd_data = m_kbd[0]->read(); + if (porta & 0x2) kbd_data = m_kbd[1]->read(); + if (porta & 0x4) kbd_data = m_kbd[2]->read(); + if (porta & 0x8) kbd_data = m_kbd[3]->read(); + if (porta & 0x10) kbd_data = m_kbd[4]->read(); + if (porta & 0x20) kbd_data = m_kbd[5]->read(); + if (porta & 0x40) kbd_data = m_kbd[6]->read(); + if (porta & 0x80) kbd_data = m_kbd[7]->read(); + if (portb & 0x1) kbd_data = m_kbd[8]->read(); + if (portb & 0x2) kbd_data = m_kbd[9]->read(); + if (portb & 0x4) kbd_data = m_kbd[10]->read(); + if (portb & 0x8) kbd_data = m_kbd[11]->read(); + if (portb & 0x10) kbd_data = m_kbd[12]->read(); + if (portb & 0x20) kbd_data = m_kbd[13]->read(); + if (portb & 0x40) kbd_data = m_kbd[14]->read(); + if (portb & 0x80) kbd_data = m_kbd[15]->read(); + if (portc & 0x1) kbd_data = m_kbd[16]->read(); + if (portc & 0x2) kbd_data = m_kbd[17]->read(); } // Check for LED update strobe @@ -758,10 +756,10 @@ void lk201_device::send_port(uint8_t offset, uint8_t olddata) { if(ddrs[2] != 0x00) { // Lower nibble contains the LED values (1 = on, 0 = off) - machine().output().set_value("led_wait" , (led_data & 0x1) == 1); - machine().output().set_value("led_compose", (led_data & 0x2) == 2); - machine().output().set_value("led_lock" , (led_data & 0x4) == 4); - machine().output().set_value("led_hold" , (led_data & 0x8) == 8); + m_led_wait = (led_data & 0x1) == 1; + m_led_compose= (led_data & 0x2) == 2; + m_led_lock = (led_data & 0x4) == 4; + m_led_hold = (led_data & 0x8) == 8; } if (led_data & 0xf0) { diff --git a/src/mame/machine/dec_lk201.h b/src/mame/machine/dec_lk201.h index 98da6c23d56..87a7e45a65d 100644 --- a/src/mame/machine/dec_lk201.h +++ b/src/mame/machine/dec_lk201.h @@ -44,7 +44,7 @@ class lk201_device : public device_t, public device_serial_interface { public: // construction/destruction - lk201_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + lk201_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); uint8_t ddr_r(offs_t offset); void ddr_w(offs_t offset, uint8_t data); @@ -109,24 +109,12 @@ private: required_device<cpu_device> m_maincpu; required_device<beep_device> m_speaker; - required_ioport m_kbd0; - required_ioport m_kbd1; - required_ioport m_kbd2; - required_ioport m_kbd3; - required_ioport m_kbd4; - required_ioport m_kbd5; - required_ioport m_kbd6; - required_ioport m_kbd7; - required_ioport m_kbd8; - required_ioport m_kbd9; - required_ioport m_kbd10; - required_ioport m_kbd11; - required_ioport m_kbd12; - required_ioport m_kbd13; - required_ioport m_kbd14; - required_ioport m_kbd15; - required_ioport m_kbd16; - required_ioport m_kbd17; + required_ioport_array<18> m_kbd; + + output_finder<> m_led_wait; + output_finder<> m_led_compose; + output_finder<> m_led_lock; + output_finder<> m_led_hold; void send_port(uint8_t offset, uint8_t data); void update_interrupts(); diff --git a/src/mame/machine/hp48.cpp b/src/mame/machine/hp48.cpp index 21c889a20ce..562bad1adf5 100644 --- a/src/mame/machine/hp48.cpp +++ b/src/mame/machine/hp48.cpp @@ -246,12 +246,12 @@ void hp48_state::update_annunciators() bit 7: master enable */ int markers = HP48_IO_8(0xb); - output().set_value( "lshift0", (markers & 0x81) == 0x81 ); - output().set_value( "rshift0", (markers & 0x82) == 0x82 ); - output().set_value( "alpha0", (markers & 0x84) == 0x84 ); - output().set_value( "alert0", (markers & 0x88) == 0x88 ); - output().set_value( "busy0", (markers & 0x90) == 0x90 ); - output().set_value( "transmit0", (markers & 0xb0) == 0xb0 ); + m_lshift0 = (markers & 0x81) == 0x81; + m_rshift0 = (markers & 0x82) == 0x82; + m_alpha0 = (markers & 0x84) == 0x84; + m_alert0 = (markers & 0x88) == 0x88; + m_busy0 = (markers & 0x90) == 0x90; + m_transmit0 = (markers & 0xb0) == 0xb0; } @@ -995,6 +995,13 @@ void hp48_state::base_machine_start(hp48_models model) m_kbd_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(hp48_state::kbd_cb), this)); m_kbd_timer->adjust(attotime::from_msec(1), 0, attotime::from_msec(1)); + m_lshift0.resolve(); + m_rshift0.resolve(); + m_alpha0.resolve(); + m_alert0.resolve(); + m_busy0.resolve(); + m_transmit0.resolve(); + /* save state */ save_item(NAME(m_out)); save_item(NAME(m_kdn)); diff --git a/src/mame/machine/igs025.cpp b/src/mame/machine/igs025.cpp index 788a7694ec5..1706f3c0fcc 100644 --- a/src/mame/machine/igs025.cpp +++ b/src/mame/machine/igs025.cpp @@ -39,6 +39,8 @@ void igs025_device::device_start() m_kb_reg = 0; m_kb_ptr = 0; m_kb_swap = 0; + m_olds_bs = 0; + m_kb_cmd3 = 0; m_execute_external.resolve(); @@ -48,19 +50,9 @@ void igs025_device::device_start() save_item(NAME(m_kb_cmd)); save_item(NAME(m_kb_reg)); save_item(NAME(m_kb_ptr)); - - - - - m_olds_bs = 0; - m_kb_cmd3 = 0; - - + save_item(NAME(m_kb_swap)); save_item(NAME(m_olds_bs)); save_item(NAME(m_kb_cmd3)); - - - } void igs025_device::device_reset() diff --git a/src/mame/machine/igs025.h b/src/mame/machine/igs025.h index 31a9cf74296..237d7f3db51 100644 --- a/src/mame/machine/igs025.h +++ b/src/mame/machine/igs025.h @@ -1,6 +1,6 @@ // license:BSD-3-Clause // copyright-holders:David Haywood, ElSemi -/* Common device stuff for IGS025 / IGS022, should be split into devices for each chip once we know where what part does what */ + #ifndef MAME_MACHINE_IGS025_H #define MAME_MACHINE_IGS025_H diff --git a/src/mame/machine/kay_kbd.cpp b/src/mame/machine/kay_kbd.cpp index b147169115c..0958c84170e 100644 --- a/src/mame/machine/kay_kbd.cpp +++ b/src/mame/machine/kay_kbd.cpp @@ -338,6 +338,7 @@ kaypro_10_keyboard_device::kaypro_10_keyboard_device( , m_bell(*this, "bell") , m_matrix(*this, "ROW.%X", 0) , m_modifiers(*this, "MOD") + , m_led_caps_lock(*this, "led_caps_lock") , m_rxd_cb(*this) , m_txd(1U) , m_bus(0U) @@ -372,6 +373,7 @@ ioport_constructor kaypro_10_keyboard_device::device_input_ports() const void kaypro_10_keyboard_device::device_start() { m_rxd_cb.resolve_safe(); + m_led_caps_lock.resolve(); save_item(NAME(m_txd)); save_item(NAME(m_bus)); @@ -424,6 +426,6 @@ uint8_t kaypro_10_keyboard_device::bus_r() void kaypro_10_keyboard_device::bus_w(uint8_t data) { if (BIT(m_bus ^ data, 4)) - machine().output().set_value("led_caps_lock", BIT(data, 4)); + m_led_caps_lock = BIT(data, 4); m_bus = data; } diff --git a/src/mame/machine/kay_kbd.h b/src/mame/machine/kay_kbd.h index 0d1e53395c0..6ceea75dce4 100644 --- a/src/mame/machine/kay_kbd.h +++ b/src/mame/machine/kay_kbd.h @@ -39,6 +39,7 @@ private: required_device<speaker_sound_device> m_bell; required_ioport_array<16> m_matrix; required_ioport m_modifiers; + output_finder<> m_led_caps_lock; devcb_write_line m_rxd_cb; std::uint8_t m_txd; diff --git a/src/mame/machine/kaypro.cpp b/src/mame/machine/kaypro.cpp index dd6327e2341..7826f6fb85d 100644 --- a/src/mame/machine/kaypro.cpp +++ b/src/mame/machine/kaypro.cpp @@ -65,8 +65,8 @@ void kaypro_state::kayproii_pio_system_w(u8 data) m_floppy->ss_w(!BIT(data, 2)); // signal exists even though drives are single sided } - output().set_value("ledA", BIT(data, 0)); /* LEDs in artwork */ - output().set_value("ledB", BIT(data, 1)); + m_leds[0] = BIT(data, 0); // LEDs in artwork + m_leds[1] = BIT(data, 1); m_centronics->write_strobe(BIT(data, 4)); @@ -128,8 +128,8 @@ void kaypro_state::kaypro484_system_port_w(u8 data) m_floppy->ss_w(!BIT(data, 2)); } - output().set_value("ledA", BIT(data, 0)); /* LEDs in artwork */ - output().set_value("ledB", BIT(data, 1)); + m_leds[0] = BIT(data, 0); // LEDs in artwork + m_leds[1] = BIT(data, 1); m_centronics->write_strobe(BIT(data, 3)); @@ -223,6 +223,8 @@ void kaypro_state::machine_start() if (m_pio_s) m_pio_s->strobe_a(0); + m_leds.resolve(); + save_pointer(NAME(m_vram), 0x1000); save_pointer(NAME(m_ram), 0x4000); diff --git a/src/mame/machine/mac.cpp b/src/mame/machine/mac.cpp index 30eaec3893c..67d0a20965d 100644 --- a/src/mame/machine/mac.cpp +++ b/src/mame/machine/mac.cpp @@ -173,17 +173,6 @@ void mac_state::field_interrupts() take_interrupt = 1; } } - else if ((m_model == MODEL_MAC_PORTABLE) || (m_model == MODEL_MAC_PB100)) - { - if ((m_scc_interrupt) || (m_asc_interrupt)) - { - take_interrupt = 2; - } - else if (m_via_interrupt) - { - take_interrupt = 1; - } - } else if ((m_model < MODEL_MAC_POWERMAC_6100) && (m_model != MODEL_MAC_IIFX)) { if (m_scc_interrupt) @@ -251,11 +240,6 @@ WRITE_LINE_MEMBER(mac_state::mac_asc_irq) rbv_recalc_irqs(); } } - else if ((m_model == MODEL_MAC_PORTABLE) || (m_model == MODEL_MAC_PB100)) - { -// m_asc_interrupt = state; -// field_interrupts(); - } else if ((m_model >= MODEL_MAC_II) && (m_model != MODEL_MAC_IIFX)) { m_via2->write_cb1(state^1); @@ -422,7 +406,7 @@ void mac_state::set_memory_overlay(int overlay) mac_install_memory(0x40000000, 0x4007ffff, memory_size, memory_data, is_rom, "bank2"); } } - else if ((m_model == MODEL_MAC_PORTABLE) || (m_model == MODEL_MAC_PB100) || (m_model == MODEL_MAC_IIFX)) + else if (m_model == MODEL_MAC_IIFX) { address_space& space = m_maincpu->space(AS_PROGRAM); space.unmap_write(0x000000, 0x9fffff); @@ -1066,7 +1050,7 @@ uint8_t mac_state::mac_via2_in_a() { uint8_t result; - if ((m_model == MODEL_MAC_QUADRA_700) || (m_model == MODEL_MAC_QUADRA_900) || (m_model == MODEL_MAC_QUADRA_950)) + if ((m_model == MODEL_MAC_QUADRA_900) || (m_model == MODEL_MAC_QUADRA_950)) { result = 0x80 | m_nubus_irq_state; } @@ -1426,8 +1410,7 @@ void mac_state::mac_driver_init(model_t model) memset(m_ram->pointer(), 0, m_ram->size()); if ((model == MODEL_MAC_SE) || (model == MODEL_MAC_CLASSIC) || (model == MODEL_MAC_CLASSIC_II) || (model == MODEL_MAC_LC) || (model == MODEL_MAC_COLOR_CLASSIC) || (model >= MODEL_MAC_LC_475 && model <= MODEL_MAC_LC_580) || - (model == MODEL_MAC_LC_II) || (model == MODEL_MAC_LC_III) || (model == MODEL_MAC_LC_III_PLUS) || ((m_model >= MODEL_MAC_II) && (m_model <= MODEL_MAC_SE30)) || - (model == MODEL_MAC_PORTABLE) || (model == MODEL_MAC_PB100)) + (model == MODEL_MAC_LC_II) || (model == MODEL_MAC_LC_III) || (model == MODEL_MAC_LC_III_PLUS) || ((m_model >= MODEL_MAC_II) && (m_model <= MODEL_MAC_SE30))) { m_overlay_timeout = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mac_state::overlay_timeout_func),this)); } @@ -1461,15 +1444,9 @@ MAC_DRIVER_INIT(maclrcclassic, MODEL_MAC_COLOR_CLASSIC) MAC_DRIVER_INIT(macpm6100, MODEL_MAC_POWERMAC_6100) MAC_DRIVER_INIT(macpm7100, MODEL_MAC_POWERMAC_7100) MAC_DRIVER_INIT(macpm8100, MODEL_MAC_POWERMAC_8100) -MAC_DRIVER_INIT(macprtb, MODEL_MAC_PORTABLE) -MAC_DRIVER_INIT(macpb100, MODEL_MAC_PB100) -MAC_DRIVER_INIT(macpb140, MODEL_MAC_PB140) -MAC_DRIVER_INIT(macpb160, MODEL_MAC_PB160) MAC_DRIVER_INIT(maciivx, MODEL_MAC_IIVX) MAC_DRIVER_INIT(maciivi, MODEL_MAC_IIVI) MAC_DRIVER_INIT(maciifx, MODEL_MAC_IIFX) -MAC_DRIVER_INIT(macpd210, MODEL_MAC_PBDUO_210) -MAC_DRIVER_INIT(macquadra700, MODEL_MAC_QUADRA_700) MAC_DRIVER_INIT(maciicx, MODEL_MAC_IICX) MAC_DRIVER_INIT(maciifdhd, MODEL_MAC_II_FDHD) MAC_DRIVER_INIT(maciix, MODEL_MAC_IIX) diff --git a/src/mame/machine/megacd.cpp b/src/mame/machine/megacd.cpp index 0fefc92c4b6..669326e95a3 100644 --- a/src/mame/machine/megacd.cpp +++ b/src/mame/machine/megacd.cpp @@ -336,6 +336,8 @@ sega_segacd_device::sega_segacd_device(const machine_config &mconfig, device_typ , m_prgram(*this, "prgram") , m_dataram(*this, "dataram") , m_font_bits(*this, "font_bits") + , m_red_led(*this, "red_led") + , m_green_led(*this, "green_led") { } @@ -1274,10 +1276,8 @@ void sega_segacd_device::segacd_sub_led_ready_w(offs_t offset, uint16_t data, ui segacd_redled = (data >> 8)&1; segacd_greenled = (data >> 9)&1; - machine().output().set_value("red_led",segacd_redled ^ 1); - machine().output().set_value("green_led",segacd_greenled ^ 1); - - //popmessage("%02x %02x",segacd_greenled,segacd_redled); + m_red_led = segacd_redled ^ 1; + m_green_led = segacd_greenled ^ 1; } } @@ -1731,6 +1731,9 @@ void sega_segacd_device::device_start() segacd_4meg_prgbank = 0; + m_red_led.resolve(); + m_green_led.resolve(); + space.unmap_readwrite (0x020000,0x3fffff); space.install_read_handler (0x0020000, 0x003ffff, read16sm_delegate(*this, FUNC(sega_segacd_device::scd_4m_prgbank_ram_r)) ); diff --git a/src/mame/machine/megacd.h b/src/mame/machine/megacd.h index f18411d82ef..1074c0405db 100644 --- a/src/mame/machine/megacd.h +++ b/src/mame/machine/megacd.h @@ -123,6 +123,9 @@ protected: required_shared_ptr<uint16_t> m_dataram; required_shared_ptr<uint16_t> m_font_bits; + output_finder<> m_red_led; + output_finder<> m_green_led; + // can't use a memshare because it's 8-bit RAM in a 16-bit address space std::vector<uint8_t> m_backupram; diff --git a/src/mame/machine/nes_vt_soc.cpp b/src/mame/machine/nes_vt_soc.cpp index f3ee35252ff..6467c9b4ba3 100644 --- a/src/mame/machine/nes_vt_soc.cpp +++ b/src/mame/machine/nes_vt_soc.cpp @@ -15,7 +15,7 @@ VT08 - ? - VT09 - alt 4bpp modes? + VT09 - alt 4bpp mode, 4KB system RAM VT16 - ? VT18 - ? diff --git a/src/mame/machine/thomson.cpp b/src/mame/machine/thomson.cpp index cf8ca0fc56c..01a88fbef5e 100644 --- a/src/mame/machine/thomson.cpp +++ b/src/mame/machine/thomson.cpp @@ -245,15 +245,6 @@ void thomson_state::thom_irq_reset() -/* ------------ LED ------------ */ - - - -void thomson_state::thom_set_caps_led( int led ) -{ - output().set_value( "led0", led ); -} - /* ------------ 6850 defines ------------ */ #define ACIA_6850_RDRF 0x01 /* Receive data register full */ @@ -391,7 +382,7 @@ uint8_t thomson_state::to7_cartridge_r(offs_t offset) void thomson_state::to7_timer_port_out(uint8_t data) { thom_set_mode_point( data & 1 ); /* bit 0: video bank switch */ - thom_set_caps_led( (data & 8) ? 1 : 0 ) ; /* bit 3: keyboard led */ + m_caps_led = (data & 8) ? 1 : 0; /* bit 3: keyboard led */ thom_set_border_color( ((data & 0x10) ? 1 : 0) | /* bits 4-6: border color */ ((data & 0x20) ? 2 : 0) | ((data & 0x40) ? 4 : 0) ); @@ -1129,7 +1120,7 @@ void thomson_state::to770_sys_portb_out(uint8_t data) void thomson_state::to770_timer_port_out(uint8_t data) { thom_set_mode_point( data & 1 ); /* bit 0: video bank switch */ - thom_set_caps_led( (data & 8) ? 1 : 0 ) ; /* bit 3: keyboard led */ + m_caps_led = (data & 8) ? 1 : 0; /* bit 3: keyboard led */ thom_set_border_color( ((data & 0x10) ? 1 : 0) | /* 4-bit border color */ ((data & 0x20) ? 2 : 0) | ((data & 0x40) ? 4 : 0) | @@ -2176,7 +2167,7 @@ void thomson_state::to9_kbd_w(offs_t offset, uint8_t data) logerror( "$%04x %f to9_kbd_w: unknown kbd command %02X\n", m_maincpu->pc(), machine().time().as_double(), data ); } - thom_set_caps_led( !m_to9_kbd_caps ); + m_caps_led = !m_to9_kbd_caps; LOG(( "$%04x %f to9_kbd_w: kbd command %02X (caps=%i, pad=%i, periph=%i)\n", m_maincpu->pc(), machine().time().as_double(), data, @@ -2297,7 +2288,7 @@ int thomson_state::to9_kbd_get_key() m_to9_kbd_last_key = key; m_to9_kbd_caps = !m_to9_kbd_caps; - thom_set_caps_led( !m_to9_kbd_caps ); + m_caps_led = !m_to9_kbd_caps; return 0; } else @@ -2412,7 +2403,7 @@ void thomson_state::to9_kbd_reset() m_to9_kbd_periph = 0; m_to9_kbd_pad = 0; m_to9_kbd_byte_count = 0; - thom_set_caps_led( !m_to9_kbd_caps ); + m_caps_led = !m_to9_kbd_caps; m_to9_kbd_key_count = 0; m_to9_kbd_last_key = 0xff; to9_kbd_update_irq(); @@ -2679,7 +2670,7 @@ int thomson_state::to8_kbd_get_key() m_to8_kbd_caps = !m_to8_kbd_caps; if ( m_to8_kbd_caps ) key |= 0x080; /* auto-shift */ - thom_set_caps_led( !m_to8_kbd_caps ); + m_caps_led = !m_to8_kbd_caps; return key; } else if ( key == m_to8_kbd_last_key ) @@ -2827,7 +2818,7 @@ void thomson_state::to8_kbd_set_ack( int data ) m_to8_kbd_caps = 0; } } - thom_set_caps_led( !m_to8_kbd_caps ); + m_caps_led = !m_to8_kbd_caps; } else { @@ -2867,7 +2858,7 @@ void thomson_state::to8_kbd_reset() m_to8_kbd_data = 0; m_to8_kbd_ack = 1; m_to8_kbd_caps = 1; - thom_set_caps_led( !m_to8_kbd_caps ); + m_caps_led = !m_to8_kbd_caps; to8_kbd_timer_func(); } @@ -4141,7 +4132,7 @@ void thomson_state::mo6_sys_porta_out(uint8_t data) { thom_set_mode_point( data & 1 ); /* bit 0: video bank switch */ m_to7_game_mute = data & 4; /* bit 2: sound mute */ - thom_set_caps_led( (data & 16) ? 0 : 1 ) ; /* bit 4: keyboard led */ + m_caps_led = (data & 16) ? 0 : 1; /* bit 4: keyboard led */ mo5_set_cassette( (data & 0x40) ? 1 : 0 ); /* bit 6: cassette output */ mo6_update_cart_bank(); /* bit 5: rom bank */ to7_game_sound_update(); diff --git a/src/mame/machine/x68k_kbd.cpp b/src/mame/machine/x68k_kbd.cpp index aeec14124ca..6835e2e24b2 100644 --- a/src/mame/machine/x68k_kbd.cpp +++ b/src/mame/machine/x68k_kbd.cpp @@ -9,6 +9,13 @@ x68k_keyboard_device::x68k_keyboard_device(const machine_config& mconfig, const char* tag, device_t* owner, uint32_t clock) : buffered_rs232_device(mconfig, X68K_KEYBOARD, tag, owner, 0) , device_matrix_keyboard_interface(mconfig, *this, "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7", "LINE8", "LINE9", "LINEA", "LINEB", "LINEC", "LINED", "LINEE") + , m_led_kana(*this, "key_led_kana") + , m_led_romaji(*this, "key_led_romaji") + , m_led_code(*this, "key_led_code") + , m_led_caps(*this, "key_led_caps") + , m_led_insert(*this, "key_led_insert") + , m_led_hiragana(*this, "key_led_hiragana") + , m_led_fullsize(*this, "key_led_fullsize") { } @@ -49,13 +56,13 @@ void x68k_keyboard_device::received_byte(uint8_t data) if (data & 0x80) // LED status { - machine().output().set_value("key_led_kana", data & 0x01); - machine().output().set_value("key_led_romaji", data & 0x02); - machine().output().set_value("key_led_code", data & 0x04); - machine().output().set_value("key_led_caps", data & 0x08); - machine().output().set_value("key_led_insert", data & 0x10); - machine().output().set_value("key_led_hiragana", data & 0x20); - machine().output().set_value("key_led_fullsize", data & 0x40); + m_led_kana = BIT(data, 0); + m_led_romaji = BIT(data, 1); + m_led_code = BIT(data, 2); + m_led_caps = BIT(data, 3); + m_led_insert = BIT(data, 4); + m_led_hiragana = BIT(data, 5); + m_led_fullsize = BIT(data, 6); logerror("KB: LED status set to %02x\n", data & 0x7f); } @@ -266,6 +273,14 @@ void x68k_keyboard_device::device_start() { buffered_rs232_device::device_start(); + m_led_kana.resolve(); + m_led_romaji.resolve(); + m_led_code.resolve(); + m_led_caps.resolve(); + m_led_insert.resolve(); + m_led_hiragana.resolve(); + m_led_fullsize.resolve(); + save_item(NAME(m_delay)); save_item(NAME(m_repeat)); save_item(NAME(m_enabled)); @@ -293,6 +308,14 @@ void x68k_keyboard_device::device_reset() output_dsr(0); output_cts(0); output_rxd(1); + + m_led_kana = 1; + m_led_romaji = 1; + m_led_code = 1; + m_led_caps = 1; + m_led_insert = 1; + m_led_hiragana = 1; + m_led_fullsize = 1; } diff --git a/src/mame/machine/x68k_kbd.h b/src/mame/machine/x68k_kbd.h index e6fc09b3dbf..e0c610462c0 100644 --- a/src/mame/machine/x68k_kbd.h +++ b/src/mame/machine/x68k_kbd.h @@ -21,6 +21,14 @@ protected: private: virtual void received_byte(uint8_t data) override; + output_finder<> m_led_kana; + output_finder<> m_led_romaji; + output_finder<> m_led_code; + output_finder<> m_led_caps; + output_finder<> m_led_insert; + output_finder<> m_led_hiragana; + output_finder<> m_led_fullsize; + int m_delay; // keypress delay after initial press int m_repeat; // keypress repeat rate uint8_t m_enabled; // keyboard enabled? diff --git a/src/mame/machine/zorbakbd.cpp b/src/mame/machine/zorbakbd.cpp index b7b1d8fcead..5d965d10791 100644 --- a/src/mame/machine/zorbakbd.cpp +++ b/src/mame/machine/zorbakbd.cpp @@ -256,6 +256,8 @@ zorba_keyboard_device::zorba_keyboard_device( : device_t(mconfig, ZORBA_KEYBOARD, tag, owner, clock) , m_rows(*this, "ROW%u", 0) , m_beeper(*this, "beeper") + , m_led_key_caps_lock(*this, "led_key_caps_lock") + , m_led_key_shift_lock(*this, "led_key_shift_lock") , m_rxd_cb(*this) , m_txd_high(true) , m_row_select(0) @@ -286,8 +288,8 @@ void zorba_keyboard_device::mcu_pb_w(u8 data) // TODO: bits 2/3/4 do something; some photos show F17/F18/F19 with LED windows m_rxd_cb(BIT(data, 6) ? 0 : 1); m_beeper->set_state(BIT(data, 5) ? 0 : 1); - machine().output().set_value("led_key_caps_lock", BIT(data, 1) ? 0 : 1); - machine().output().set_value("led_key_shift_lock", BIT(data, 0) ? 0 : 1); + m_led_key_caps_lock = BIT(data, 1) ? 0 : 1; + m_led_key_shift_lock = BIT(data, 0) ? 0 : 1; } @@ -300,6 +302,8 @@ void zorba_keyboard_device::mcu_pc_w(u8 data) void zorba_keyboard_device::device_start() { m_rxd_cb.resolve_safe(); + m_led_key_caps_lock.resolve(); + m_led_key_shift_lock.resolve(); save_item(NAME(m_txd_high)); save_item(NAME(m_row_select)); diff --git a/src/mame/machine/zorbakbd.h b/src/mame/machine/zorbakbd.h index a92b0c81246..4a88735ae41 100644 --- a/src/mame/machine/zorbakbd.h +++ b/src/mame/machine/zorbakbd.h @@ -32,6 +32,8 @@ protected: required_ioport_array<16> m_rows; required_device<beep_device> m_beeper; + output_finder<> m_led_key_caps_lock; + output_finder<> m_led_key_shift_lock; devcb_write_line m_rxd_cb; bool m_txd_high; diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 3bb03db488f..ea4e82908ab 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -19075,6 +19075,12 @@ korgwssr // @source:korgz3.cpp korgz3 // +@source:kpython.cpp +kpython // Konami Python Bios +wswe // World Soccer Winning Eleven +wswe2k3 // World Soccer Winning Eleven 2003 +popn9 // 2003 + @source:kramermc.cpp kramermc // 1987 Kramer MC @@ -19900,7 +19906,17 @@ maclc // 1990 Apple Macintosh LC maclc2 // 1991 Apple Macintosh LC II maclc3 // 1993 Apple Macintosh LC III maclc520 // 1993 Apple Macintosh LC 520 +macse30 // 1989 Apple Macintosh SE/30 +pmac6100 // 1993 Apple Power Macintosh 6100 + +@source:macquadra700.cpp +macqd700 // 1991 Apple Macintosh Quadra 700 + +@source:macprtb.cpp +macprtb // 1989 Apple Macintosh Portable macpb100 // 1991 Apple Macintosh PowerBook 100 + +@source:macpwrbk030.cpp macpb140 // 1991 Apple Macintosh PowerBook 140 macpb145 // 1992 Apple Macintosh PowerBook 145 macpb145b // 1993 Apple Macintosh PowerBook 145B @@ -19909,12 +19925,6 @@ macpb170 // 1991 Apple Macintosh PowerBook 170 macpb180 // 1992 Apple Macintosh PowerBook 180 macpb180c // 1992 Apple Macintosh PowerBook 180c macpd210 // 1992 Apple Macintosh PowerBook Duo 210 -macprtb // 1989 Apple Macintosh Portable -macse30 // 1989 Apple Macintosh SE/30 -pmac6100 // 1993 Apple Power Macintosh 6100 - -@source:macquadra700.cpp -macqd700 // 1991 Apple Macintosh Quadra 700 @source:mac128.cpp mac128k // 1984 Apple Macintosh @@ -22241,6 +22251,7 @@ rad_sf2 // (c)2004 Radica rad_sf2p // (c)2004 Radica rad_gen1 // (c)2004 Radica rad_gen2 // (c)2004 Radica +rad_md1 rad_ssoc // (c)2004 Radica rad_sonic rad_orun @@ -32291,6 +32302,8 @@ zdog otrail denv150 techni4 +senario25 +dgun851 sporzpp sporzbx sporztn @@ -35039,12 +35052,6 @@ px8 // pyl601 // pyl601a // -@source:kpython.cpp -kpython // Konami Python Bios -wswe // World Soccer Winning Eleven -wswe2k3 // World Soccer Winning Eleven 2003 -popn9 // 2003 - @source:pzletime.cpp pzletime // @@ -35379,6 +35386,9 @@ rex6000 // @source:rfslots8085.cpp unkrfslt // +@source:rfslotspcpent.cpp +rfsantafeg // (c) 2014 Recreativos Franco + @source:rgum.cpp rgum // diff --git a/src/mame/video/alesis.cpp b/src/mame/video/alesis.cpp index 0e66435bf37..b5e00ccd797 100644 --- a/src/mame/video/alesis.cpp +++ b/src/mame/video/alesis.cpp @@ -47,7 +47,7 @@ void alesis_state::update_lcd_symbols(bitmap_ind16 &bitmap, uint8_t pos, uint8_t case 2: if (y == 0) { - output().set_value("pattern", state); + m_pattern = state; } else if (y < 8) { diff --git a/src/mame/video/mac.cpp b/src/mame/video/mac.cpp index b167fa870e2..26bcf75942a 100644 --- a/src/mame/video/mac.cpp +++ b/src/mame/video/mac.cpp @@ -59,15 +59,6 @@ Apple color FPD 01 11 10 (FPD = Full Page Display) #include "machine/ram.h" #include "render.h" -// 4-level grayscale -void mac_state::macgsc_palette(palette_device &palette) const -{ - palette.set_pen_color(0, 0xff, 0xff, 0xff); - palette.set_pen_color(1, 0x7f, 0x7f, 0x7f); - palette.set_pen_color(2, 0x3f, 0x3f, 0x3f); - palette.set_pen_color(3, 0x00, 0x00, 0x00); -} - VIDEO_START_MEMBER(mac_state,mac) { } @@ -117,68 +108,6 @@ uint32_t mac_state::screen_update_macse30(screen_device &screen, bitmap_ind16 &b return 0; } -uint32_t mac_state::screen_update_macprtb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - uint16_t const *const video_ram = (const uint16_t *) m_vram16.target(); - - for (int y = 0; y < 400; y++) - { - uint16_t *const line = &bitmap.pix(y); - - for (int x = 0; x < 640; x += 16) - { - uint16_t const word = video_ram[((y * 640)/16) + ((x/16))]; - for (int b = 0; b < 16; b++) - { - line[x + b] = (word >> (15 - b)) & 0x0001; - } - } - } - return 0; -} - -uint32_t mac_state::screen_update_macpb140(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - uint16_t const *const video_ram = (const uint16_t *) m_vram.target(); - - for (int y = 0; y < 400; y++) - { - uint16_t *const line = &bitmap.pix(y); - - for (int x = 0; x < 640; x += 16) - { - uint16_t const word = video_ram[((y * 640)/16) + ((x/16)^1)]; - for (int b = 0; b < 16; b++) - { - line[x + b] = (word >> (15 - b)) & 0x0001; - } - } - } - return 0; -} - -uint32_t mac_state::screen_update_macpb160(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - uint8_t const *const vram8 = (uint8_t *)m_vram.target(); - - for (int y = 0; y < 400; y++) - { - uint16_t *line = &bitmap.pix(y); - - for (int x = 0; x < 640/4; x++) - { - uint8_t const pixels = vram8[(y * 160) + (BYTE4_XOR_BE(x))]; - - *line++ = ((pixels>>6)&3); - *line++ = ((pixels>>4)&3); - *line++ = ((pixels>>2)&3); - *line++ = (pixels&3); - - } - } - return 0; -} - // IIci/IIsi RAM-Based Video (RBV) and children: V8, Eagle, Spice, VASP, Sonora VIDEO_START_MEMBER(mac_state,macrbv) @@ -781,75 +710,3 @@ uint32_t mac_state::screen_update_macsonora(screen_device &screen, bitmap_rgb32 return 0; } -uint32_t mac_state::screen_update_macpbwd(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)/* Color PowerBooks using an off-the-shelf WD video chipset */ -{ - uint8_t const *vram8 = (uint8_t *)m_vram.target(); - -// vram8 += 0x40000; - - for (int y = 0; y < 480; y++) - { - uint32_t *scanline = &bitmap.pix(y); - for (int x = 0; x < 640; x++) - { - uint8_t const pixels = vram8[(y * 640) + (BYTE4_XOR_BE(x))]; - *scanline++ = m_rbv_palette[pixels]; - } - } - - return 0; -} - -uint32_t mac_state::macwd_r(offs_t offset, uint32_t mem_mask) -{ - switch (offset) - { - case 0xf6: - if (m_screen->vblank()) - { - return 0xffffffff; - } - else - { - return 0; - } - - default: -// printf("macwd_r: @ %x, mask %08x (PC=%x)\n", offset, mem_mask, m_maincpu->pc()); - break; - } - return 0; -} - -void mac_state::macwd_w(offs_t offset, uint32_t data, uint32_t mem_mask) -{ - switch (offset) - { - case 0xf2: - if (mem_mask == 0xff000000) // DAC control - { - m_rbv_clutoffs = data>>24; - m_rbv_count = 0; - } - else if (mem_mask == 0x00ff0000) // DAC data - { - m_rbv_colors[m_rbv_count++] = (data>>16)&0xff; - if (m_rbv_count == 3) - { -// printf("RAMDAC: color %d = %02x %02x %02x\n", m_rbv_clutoffs, m_rbv_colors[0], m_rbv_colors[1], m_rbv_colors[2]); - m_rbv_palette[m_rbv_clutoffs] = rgb_t(m_rbv_colors[0], m_rbv_colors[1], m_rbv_colors[2]); - m_rbv_clutoffs++; - m_rbv_count = 0; - } - } - else - { - printf("macwd: Unknown DAC write, data %08x, mask %08x\n", data, mem_mask); - } - break; - - default: -// printf("macwd_w: %x @ %x, mask %08x (PC=%x)\n", data, offset, mem_mask, m_maincpu->pc()); - break; - } -} diff --git a/src/mame/video/thomson.cpp b/src/mame/video/thomson.cpp index 2af06012b67..cb1073549dd 100644 --- a/src/mame/video/thomson.cpp +++ b/src/mame/video/thomson.cpp @@ -1199,6 +1199,8 @@ VIDEO_START_MEMBER( thomson_state, thom ) save_item(NAME(m_thom_floppy_rcount)); m_floppy_led.resolve(); + m_caps_led.resolve(); + m_thom_video_timer = machine().scheduler().timer_alloc(timer_expired_delegate()); m_thom_scanline_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(thomson_state::thom_scanline_start),this)); |