diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua index 33e8258dd87..f0c8f83e466 100644 --- a/scripts/src/bus.lua +++ b/scripts/src/bus.lua @@ -3274,6 +3274,8 @@ if (BUSES["RS232"]~=null) then MAME_DIR .. "src/devices/bus/rs232/sun_kbd.h", MAME_DIR .. "src/devices/bus/rs232/swtpc8212.cpp", MAME_DIR .. "src/devices/bus/rs232/swtpc8212.h", + MAME_DIR .. "src/devices/bus/rs232/teletex800.cpp", + MAME_DIR .. "src/devices/bus/rs232/teletex800.h", MAME_DIR .. "src/devices/bus/rs232/terminal.cpp", MAME_DIR .. "src/devices/bus/rs232/terminal.h", MAME_DIR .. "src/devices/bus/rs232/xvd701.cpp", diff --git a/src/devices/bus/mackbd/keyboard.cpp b/src/devices/bus/mackbd/keyboard.cpp index 27edfb335bd..5b3cca18b21 100644 --- a/src/devices/bus/mackbd/keyboard.cpp +++ b/src/devices/bus/mackbd/keyboard.cpp @@ -189,6 +189,7 @@ * M0110 (U.S. - ANSI) * M0110B (British - ISO) * M0110F (French - ISO) + * M0110J (Japanese - ANSI) * M0110T (Italian - ISO) * M0120 (keypad - English) * M0120P (keypad - European) @@ -198,9 +199,6 @@ Enter and Clear (all variants use icons for command and the cursor arrows). - Also known to exist: - * Japanese - ANSI (U.S. with different key caps) - TODO: * Determine whether P00 or P01 actually feeds the keypad watchdog * Find more model numbers and implement more layouts diff --git a/src/devices/bus/rs232/teletex800.cpp b/src/devices/bus/rs232/teletex800.cpp new file mode 100644 index 00000000000..85a90494b33 --- /dev/null +++ b/src/devices/bus/rs232/teletex800.cpp @@ -0,0 +1,103 @@ +// license:BSD-3-Clause +// copyright-holders:Curt Coder + +#include "emu.h" +#include "printer.h" +#include "teletex800.h" +#include "cpu/z80/z80.h" +#include "machine/6821pia.h" +#include "machine/6850acia.h" +#include "machine/z80ctc.h" +#include "machine/z80daisy.h" +#include "machine/z80sio.h" + +namespace { + +ROM_START( teletex800 ) + ROM_REGION( 0x1000, "z80", 0 ) + ROM_LOAD( "ix44_ver1.1.u57", 0x0000, 0x1000, CRC(5c11b89c) SHA1(4911332709a8dcda12e72bcdf7a0acd58d65cbfd) ) +ROM_END + +static const z80_daisy_config z80_daisy_chain[] = +{ + { nullptr } +}; + +static void printer_devices(device_slot_interface &device) +{ + device.option_add("printer", SERIAL_PRINTER); +} + +static INPUT_PORTS_START( teletex800 ) +INPUT_PORTS_END + +class teletex_800_device : public device_t, public device_rs232_port_interface +{ +public: + teletex_800_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, TELETEX_800, tag, owner, clock), + device_rs232_port_interface(mconfig, *this), + m_maincpu(*this, "z80"), + m_ctc(*this, "ctc"), + m_sio(*this, "sio"), + m_acia(*this, "acia"), + m_pia(*this, "pia"), + m_pia_cp(*this, "pia_cp") + { + } + +protected: + virtual const tiny_rom_entry *device_rom_region() const override + { + return ROM_NAME( teletex800 ); + } + + virtual void device_add_mconfig(machine_config &config) override + { + // main board + Z80(config, m_maincpu, XTAL(4'915'200)); + m_maincpu->set_daisy_config(z80_daisy_chain); + m_maincpu->set_addrmap(AS_PROGRAM, &teletex_800_device::program_map); + m_maincpu->set_addrmap(AS_IO, &teletex_800_device::io_map); + + Z80CTC(config, m_ctc, XTAL(4'915'200)); + Z80SIO(config, m_sio, XTAL(4'915'200)); + ACIA6850(config, m_acia); + PIA6821(config, m_pia); + + RS232_PORT(config, "printer", printer_devices, "printer"); + + // control panel + PIA6821(config, m_pia_cp); + } + + virtual ioport_constructor device_input_ports() const override + { + return INPUT_PORTS_NAME( teletex800 ); + } + + virtual void device_start() override + { + } + +private: + required_device m_maincpu; + required_device m_ctc; + required_device m_sio; + required_device m_acia; + required_device m_pia; + required_device m_pia_cp; + + void program_map(address_map &map) + { + map(0x0000, 0x0fff).rom().region("z80", 0); + } + + void io_map(address_map &map) + { + } +}; + +} // anonymous namespace + +DEFINE_DEVICE_TYPE_PRIVATE(TELETEX_800, device_rs232_port_interface, teletex_800_device, "teletex800", "Luxor Teletex 800") diff --git a/src/devices/bus/rs232/teletex800.h b/src/devices/bus/rs232/teletex800.h new file mode 100644 index 00000000000..970a309d31e --- /dev/null +++ b/src/devices/bus/rs232/teletex800.h @@ -0,0 +1,13 @@ +// license:BSD-3-Clause +// copyright-holders:Curt Coder +#ifndef MAME_BUS_RS232_TELETEX800_H +#define MAME_BUS_RS232_TELETEX800_H + +#pragma once + +#include "rs232.h" + + +DECLARE_DEVICE_TYPE(TELETEX_800, device_rs232_port_interface) + +#endif // MAME_BUS_RS232_TELETEX800_H diff --git a/src/mame/galaxian/galaxian.cpp b/src/mame/galaxian/galaxian.cpp index 782ba636be6..87f0b24c589 100644 --- a/src/mame/galaxian/galaxian.cpp +++ b/src/mame/galaxian/galaxian.cpp @@ -2531,21 +2531,18 @@ void monsterz_state::monsterz_map(address_map &map) /* changes from galaxian map: galaxian sound removed $4800-$57ff: contains video and object RAM (normally at $5000-$5fff) - $5800-$5fff: AY-8910 access added $6002-$6006: graphics banking controls replace coin lockout, coin counter, and lfo $7002: coin counter (moved from $6003) $8000-$afff: additional ROM area $b000-$bfff: protection (T00 custom chip) */ -void galaxian_state::jumpbug_map(address_map &map) +void galaxian_state::jumpbugbrf_map(address_map &map) { map.unmap_value_high(); map(0x0000, 0x3fff).rom(); map(0x4000, 0x47ff).ram(); map(0x4800, 0x4bff).mirror(0x0400).ram().w(FUNC(galaxian_state::galaxian_videoram_w)).share("videoram"); map(0x5000, 0x50ff).mirror(0x0700).ram().w(FUNC(galaxian_state::galaxian_objram_w)).share("spriteram"); - map(0x5800, 0x5800).mirror(0x00ff).w("8910.0", FUNC(ay8910_device::data_w)); - map(0x5900, 0x5900).mirror(0x00ff).w("8910.0", FUNC(ay8910_device::address_w)); map(0x6000, 0x6000).mirror(0x07ff).portr("IN0"); map(0x6002, 0x6006).mirror(0x07f8).w(FUNC(galaxian_state::galaxian_gfxbank_w)); map(0x6800, 0x6800).mirror(0x07ff).portr("IN1"); @@ -2559,6 +2556,16 @@ void galaxian_state::jumpbug_map(address_map &map) map(0xb000, 0xbfff).r(FUNC(galaxian_state::jumpbug_protection_r)); } +/* changes from jumpbugbrf map: + $5800-$5fff: AY-8910 access added +*/ +void galaxian_state::jumpbug_map(address_map &map) +{ + jumpbugbrf_map(map); + map(0x5800, 0x5800).mirror(0x00ff).w("8910.0", FUNC(ay8910_device::data_w)); + map(0x5900, 0x5900).mirror(0x00ff).w("8910.0", FUNC(ay8910_device::address_w)); +} + void galaxian_state::frogf_map(address_map &map) { @@ -7482,7 +7489,6 @@ void galaxian_state::sidam_bootleg_base(machine_config &config) m_screen->set_raw(12_MHz_XTAL, SIDAM_HTOTAL, SIDAM_HBEND, SIDAM_HBSTART, GALAXIAN_VTOTAL, GALAXIAN_VBEND, GALAXIAN_VBSTART); set_x_scale(SIDAM_XSCALE); set_h0_start(SIDAM_H0START); - } @@ -7913,12 +7919,20 @@ void guttangt_state::guttangts3(machine_config &config) -void galaxian_state::jumpbug(machine_config &config) +void galaxian_state::jumpbugbrf(machine_config &config) { galaxian_base(config); config.device_remove("watchdog"); + // basic machine hardware + m_maincpu->set_addrmap(AS_PROGRAM, &galaxian_state::jumpbugbrf_map); +} + +void galaxian_state::jumpbug(machine_config &config) +{ + jumpbugbrf(config); + // basic machine hardware m_maincpu->set_addrmap(AS_PROGRAM, &galaxian_state::jumpbug_map); @@ -13549,6 +13563,29 @@ ROM_START( jumpbugb ) ROM_LOAD( "l06_prom.bin", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) ) ROM_END +// Recreativos Franco PCB. There is no AY-8910, although the AY-8910 routines are still on the code. +ROM_START( jumpbugbrf ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "bg1-2732.bin", 0x0000, 0x1000, CRC(415aa1b7) SHA1(4f9edd7e9720acf085dd8910849c2f2fac5cb547) ) + ROM_LOAD( "bg2-2732.bin", 0x1000, 0x1000, CRC(b1c27510) SHA1(66fbe0b94b6c101cb50d7a3ff78160110415dff9) ) + ROM_LOAD( "bg3-2732.bin", 0x2000, 0x1000, CRC(cb8b8a0f) SHA1(9e8591471dda2cb964ba2a866d4a5a3ef65d8707) ) + ROM_LOAD( "bg4-2732.bin", 0x3000, 0x1000, CRC(66751d12) SHA1(26c68cfb59596ae164ee9ae4a24ddf8dc7a923a7) ) + ROM_LOAD( "bg5-2732.bin", 0x8000, 0x1000, CRC(7553b5e2) SHA1(6439585e713581dd36cea6324414f803d683216f) ) + ROM_LOAD( "bg6-2732.bin", 0x9000, 0x1000, CRC(47be9843) SHA1(495d6fc732267bfd19a953b0b70df3f94b3c1e38) ) + ROM_LOAD( "bg7-2732.bin", 0xa000, 0x1000, CRC(2c4b37aa) SHA1(14dea66b083a421623e7be8deb9fee8ed5e7ee28) ) + + ROM_REGION( 0x3000, "gfx1", 0 ) + ROM_LOAD( "jbl", 0x0000, 0x0800, BAD_DUMP CRC(9a091b0a) SHA1(19b88f802ee80ff8901ef99e3688f2869f1a69c5) ) // Missing on this PCB, borrowed from 'jumpbugb' + ROM_LOAD( "jbm", 0x0800, 0x0800, BAD_DUMP CRC(8a0fc082) SHA1(58b72a3161950a2fb71cdab3f30bb3abb19c7978) ) // Missing on this PCB, borrowed from 'jumpbugb' + ROM_LOAD( "jbn", 0x1000, 0x0800, BAD_DUMP CRC(155186e0) SHA1(717ddaecc52a4ef03a01fcddb520acdbfb0d722a) ) // Missing on this PCB, borrowed from 'jumpbugb' + ROM_LOAD( "jbi", 0x1800, 0x0800, BAD_DUMP CRC(7749b111) SHA1(55071ce04708bd52177644298f76ae79d23f6ac9) ) // Missing on this PCB, borrowed from 'jumpbugb' + ROM_LOAD( "jbj", 0x2000, 0x0800, BAD_DUMP CRC(06e8d7df) SHA1(d04f1503d9fde5aae92652cb9d2eb16bd6a0fe9c) ) // Missing on this PCB, borrowed from 'jumpbugb' + ROM_LOAD( "jbk", 0x2800, 0x0800, BAD_DUMP CRC(b8dbddf3) SHA1(043de444890a93459789dc99c43ef88ff66b79e4) ) // Missing on this PCB, borrowed from 'jumpbugb' + + ROM_REGION( 0x0020, "proms", 0 ) + ROM_LOAD( "82s123.bin", 0x0000, 0x0020, CRC(4e3caeab) SHA1(a25083c3e36d28afdefe4af6e6d4f3155e303625) ) +ROM_END + ROM_START( olibug ) // bootleg on an original Midway Galaxian PCB ROM_REGION( 0x10000, "maincpu", 0 ) // b6 and b7 differ from jumpbugb ROM_LOAD( "b1.bin", 0x0000, 0x1000, CRC(415aa1b7) SHA1(4f9edd7e9720acf085dd8910849c2f2fac5cb547) ) @@ -16647,10 +16684,11 @@ GAME( 198?, fantastc, 0, fantastc, fantastc, galaxian_state, init_ GAME( 198?, timefgtr, 0, timefgtr, timefgtr, galaxian_state, init_timefgtr, ROT90, "Taito do Brasil", "Time Fighter (Time Pilot conversion on Galaxian hardware)", MACHINE_SUPPORTS_SAVE | MACHINE_WRONG_COLORS ) // rewrite of Time Pilot (!) not a clone // Extra ROMs, protection, and sound hardware replaced with AY8910 -GAME( 1981, jumpbug, 0, jumpbug, jumpbug, galaxian_state, init_jumpbug, ROT90, "Hoei (Rock-Ola license)", "Jump Bug", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND ) // or by Alpha Denshi Co. under contract from Hoei? -GAME( 1981, jumpbugb, jumpbug, jumpbug, jumpbug, galaxian_state, init_jumpbug, ROT90, "bootleg", "Jump Bug (bootleg)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND ) // bootleg of Sega license -GAME( 1982, olibug, jumpbug, jumpbug, jumpbug, galaxian_state, init_jumpbug, ROT90, "bootleg", "Oli Bug (bootleg of Jump Bug)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND | MACHINE_WRONG_COLORS | MACHINE_NOT_WORKING ) // one bad GFX ROM, uses Galaxian color PROM? -GAME( 1983, levers, 0, jumpbug, levers, galaxian_state, init_jumpbug, ROT90, "Rock-Ola", "Levers", MACHINE_SUPPORTS_SAVE ) +GAME( 1981, jumpbug, 0, jumpbug, jumpbug, galaxian_state, init_jumpbug, ROT90, "Hoei (Rock-Ola license)", "Jump Bug", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND ) // or by Alpha Denshi Co. under contract from Hoei? +GAME( 1981, jumpbugb, jumpbug, jumpbug, jumpbug, galaxian_state, init_jumpbug, ROT90, "bootleg", "Jump Bug (bootleg, set 1)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND ) // bootleg of Sega license +GAME( 1982, jumpbugbrf, jumpbug, jumpbugbrf, jumpbug, galaxian_state, init_jumpbug, ROT90, "bootleg (Recreativos Franco)", "Jump Bug (bootleg, set 2)", MACHINE_NO_SOUND | MACHINE_SUPPORTS_SAVE ) // bootleg from Recreativos Franco, without AY-8910 +GAME( 1982, olibug, jumpbug, jumpbug, jumpbug, galaxian_state, init_jumpbug, ROT90, "bootleg", "Oli Bug (bootleg of Jump Bug)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND | MACHINE_WRONG_COLORS | MACHINE_NOT_WORKING ) // one bad GFX ROM, uses Galaxian color PROM? +GAME( 1983, levers, 0, jumpbug, levers, galaxian_state, init_jumpbug, ROT90, "Rock-Ola", "Levers", MACHINE_SUPPORTS_SAVE ) // 2nd CPU driving AY8910 for sound GAME( 1982, checkman, 0, checkman, checkman, galaxian_state, init_checkman, ROT90, "Zilec-Zenitone", "Check Man", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/galaxian/galaxian.h b/src/mame/galaxian/galaxian.h index ef4a4704b44..a3d0803c44a 100644 --- a/src/mame/galaxian/galaxian.h +++ b/src/mame/galaxian/galaxian.h @@ -279,6 +279,7 @@ class galaxian_state : public driver_device void turtles(machine_config &config); void fantastc(machine_config &config); void jumpbug(machine_config &config); + void jumpbugbrf(machine_config &config); void checkmaj(machine_config &config); void pacmanbl(machine_config &config); void quaak(machine_config &config); @@ -367,6 +368,7 @@ class galaxian_state : public driver_device void galaxian_map_discrete(address_map &map); void highroll_map(address_map &map); void jumpbug_map(address_map &map); + void jumpbugbrf_map(address_map &map); void jungsub_map(address_map &map); void jungsub_io_map(address_map &map); void konami_sound_map(address_map &map); diff --git a/src/mame/luxor/abc80x.cpp b/src/mame/luxor/abc80x.cpp index 0b4ee10a6ee..f7a234415bc 100644 --- a/src/mame/luxor/abc80x.cpp +++ b/src/mame/luxor/abc80x.cpp @@ -2019,6 +2019,12 @@ QUICKLOAD_LOAD_MEMBER(abc800_state::quickload_cb) return std::make_pair(std::error_condition(), std::string()); } +static void printer_devices(device_slot_interface &device) +{ + device.option_add("printer", SERIAL_PRINTER); + device.option_add("teletex800", TELETEX_800); +} + //************************************************************************** @@ -2071,7 +2077,7 @@ void abc800_state::common(machine_config &config) m_cassette->add_route(ALL_OUTPUTS, "mono", 0.05); TIMER(config, TIMER_CASSETTE_TAG).configure_periodic(FUNC(abc800_state::cassette_input_tick), attotime::from_hz(44100)); - rs232_port_device &rs232a(RS232_PORT(config, RS232_A_TAG, default_rs232_devices, nullptr)); + rs232_port_device &rs232a(RS232_PORT(config, RS232_A_TAG, printer_devices, nullptr)); rs232a.rxd_handler().set(m_dart, FUNC(z80dart_device::rxa_w)); rs232a.dcd_handler().set(m_dart, FUNC(z80dart_device::dcda_w)); rs232a.cts_handler().set(m_dart, FUNC(z80dart_device::ctsa_w)); diff --git a/src/mame/luxor/abc80x.h b/src/mame/luxor/abc80x.h index f293a6de24d..c3ae17f9e74 100644 --- a/src/mame/luxor/abc80x.h +++ b/src/mame/luxor/abc80x.h @@ -5,27 +5,31 @@ #pragma once +#include "emupal.h" +#include "softlist.h" +#include "speaker.h" #include "bus/abcbus/abcbus.h" +#include "bus/abckb/abc800kb.h" +#include "bus/abckb/abckb.h" +#include "bus/rs232/printer.h" #include "bus/rs232/rs232.h" -#include "cpu/z80/z80.h" -#include "machine/z80daisy.h" +#include "bus/rs232/teletex800.h" #include "cpu/mcs48/mcs48.h" +#include "cpu/z80/z80.h" #include "imagedev/cassette.h" #include "imagedev/snapquik.h" -#include "bus/abckb/abckb.h" -#include "bus/abckb/abc800kb.h" #include "machine/74259.h" #include "machine/e0516.h" -#include "machine/z80ctc.h" -#include "machine/z80sio.h" #include "machine/ram.h" #include "machine/timer.h" +#include "machine/z80ctc.h" +#include "machine/z80daisy.h" +#include "machine/z80sio.h" #include "sound/discrete.h" #include "video/mc6845.h" #include "video/saa5050.h" -#include "emupal.h" -#include "softlist.h" -#include "speaker.h" + + //************************************************************************** // MACROS / CONSTANTS diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 92475683799..c8f6d81e61e 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -18576,6 +18576,7 @@ guttangts3 // highroll // jumpbug // (c) 1981 Rock-ola jumpbugb // (c) 1981 Sega +jumpbugbrf // bootleg jungsub // bootleg kamakazi3 // Video Games (UK) Ltd., hack or bootleg? kamikazesp // bootleg (Euromatic S.A.) @@ -33300,7 +33301,7 @@ sweetlnd // @source:namco/sweetland4.cpp sweetld4 // -tairyouda // (c) 2000 Namco +tairyodk // (c) 2000 Namco @source:namco/tankbatt.cpp tankbatt // (c) 1980 Namco @@ -36751,6 +36752,7 @@ brvteam // canasta // corsario // ind250cc // +indunkgam // lapbylap // larana // mundial // diff --git a/src/mame/midway/midzeus.h b/src/mame/midway/midzeus.h index 6c2ec5a2597..0f4bb9abb5b 100644 --- a/src/mame/midway/midzeus.h +++ b/src/mame/midway/midzeus.h @@ -119,7 +119,7 @@ class midzeus_state : public driver_device optional_memory_bank m_mainbank; private: - static constexpr XTAL MIDZEUS_VIDEO_CLOCK = XTAL(66'666'700); + static inline constexpr XTAL MIDZEUS_VIDEO_CLOCK = 66.6667_MHz_XTAL; void exit_handler(); void zeus_pointer_w(uint32_t which, uint32_t data, bool logit); diff --git a/src/mame/midway/midzeus_v.cpp b/src/mame/midway/midzeus_v.cpp index 9485bed740f..ffb40db0f94 100644 --- a/src/mame/midway/midzeus_v.cpp +++ b/src/mame/midway/midzeus_v.cpp @@ -346,26 +346,26 @@ uint32_t midzeus_state::screen_update(screen_device &screen, bitmap_ind16 &bitma uint32_t midzeus_state::zeus_r(offs_t offset) { - bool logit = ((!machine().side_effects_disabled()) && (offset < 0xb0 || offset > 0xb7)); + bool logit = !machine().side_effects_disabled() && ((offset < 0xb0) || (offset > 0xb7)); uint32_t result = m_zeusbase[offset & ~1]; switch (offset & ~1) { case 0xf0: result = m_screen->hpos(); - logit = 0; + logit = false; break; case 0xf2: result = m_screen->vpos(); - logit = 0; + logit = false; break; case 0xf4: result = 6; if (m_screen->vblank()) result |= 0x800; - logit = 0; + logit = false; break; case 0xf6: // status -- they wait for this & 9 == 0 @@ -373,13 +373,13 @@ uint32_t midzeus_state::zeus_r(offs_t offset) result = 0x9600; if (m_zeusbase[0xb6] == 0x80040000) result |= 1; - logit = 0; + logit = false; break; } - // 32-bit mode if (m_zeusbase[0x80] & 0x00020000) { + // 32-bit mode if (offset & 1) result >>= 16; if (logit) @@ -392,10 +392,9 @@ uint32_t midzeus_state::zeus_r(offs_t offset) LOGZEUS("%06X:zeus32_r(%02X) = %08X\n", m_maincpu->pc(), offset, result); } } - - // 16-bit mode else { + // 16-bit mode if (offset & 1) result >>= 16; else @@ -421,13 +420,10 @@ void midzeus_state::zeus_w(offs_t offset, uint32_t data) if (logit) LOGZEUS("%06X:zeus_w", m_maincpu->pc()); - // 32-bit mode if (m_zeusbase[0x80] & 0x00020000) - zeus_register32_w(offset, data, logit); - - // 16-bit mode + zeus_register32_w(offset, data, logit); // 32-bit mode else - zeus_register16_w(offset, data, logit); + zeus_register16_w(offset, data, logit); // 16-bit mode } diff --git a/src/mame/misc/micro3d_a.cpp b/src/mame/misc/micro3d_a.cpp index 91674ada07f..6db60dddcc3 100644 --- a/src/mame/misc/micro3d_a.cpp +++ b/src/mame/misc/micro3d_a.cpp @@ -75,8 +75,8 @@ void micro3d_sound_device::lp_filter::init(double fsval) static void prewarp(double &a0, double &a1, double &a2, double fc, double fs) { - double pi = 4.0 * atan(1.0); - double wp = 2.0 * fs * tan(pi * fc / fs); + double const pi = 4.0 * atan(1.0); + double const wp = 2.0 * fs * tan(pi * fc / fs); a2 = a2 / (wp * wp); a1 = a1 / wp; @@ -86,8 +86,8 @@ static void bilinear(double a0, double a1, double a2, double b0, double b1, double b2, double &k, double fs, float *coef) { - double ad = 4. * a2 * fs * fs + 2. * a1 * fs + a0; - double bd = 4. * b2 * fs * fs + 2. * b1* fs + b0; + double const ad = 4. * a2 * fs * fs + 2. * a1 * fs + a0; + double const bd = 4. * b2 * fs * fs + 2. * b1* fs + b0; k *= ad / bd; @@ -137,8 +137,8 @@ void micro3d_sound_device::noise_sh_w(u8 data) else m_gain = expf(-(float)(m_dac[VCA]) / 25.0f) * 10.0f; - double q = 0.75/255 * (255 - m_dac[VCQ]) + 0.1; - double fc = 4500.0/255 * (255 - m_dac[VCF]) + 100; + double const q = 0.75/255 * (255 - m_dac[VCQ]) + 0.1; + double const fc = 4500.0/255 * (255 - m_dac[VCF]) + 100; m_filter.recompute(m_gain, q, fc); } @@ -195,15 +195,12 @@ void micro3d_sound_device::device_start() save_item(NAME(m_filter.history)); save_item(NAME(m_filter.coef)); save_item(NAME(m_filter.fs)); - for (int i = 0; i < 2; i++) - { - save_item(NAME(m_filter.proto_coef[i].a0), i); - save_item(NAME(m_filter.proto_coef[i].a1), i); - save_item(NAME(m_filter.proto_coef[i].a2), i); - save_item(NAME(m_filter.proto_coef[i].b0), i); - save_item(NAME(m_filter.proto_coef[i].b1), i); - save_item(NAME(m_filter.proto_coef[i].b2), i); - } + save_item(STRUCT_MEMBER(m_filter.proto_coef, a0)); + save_item(STRUCT_MEMBER(m_filter.proto_coef, a1)); + save_item(STRUCT_MEMBER(m_filter.proto_coef, a2)); + save_item(STRUCT_MEMBER(m_filter.proto_coef, b0)); + save_item(STRUCT_MEMBER(m_filter.proto_coef, b1)); + save_item(STRUCT_MEMBER(m_filter.proto_coef, b2)); save_item(STRUCT_MEMBER(m_noise_filters, capval)); save_item(STRUCT_MEMBER(m_noise_filters, exponent)); } @@ -239,8 +236,8 @@ void micro3d_sound_device::sound_stream_update(sound_stream &stream, std::vector if (m_gain == 0) return; - float pan_l = (float)(255 - m_dac[PAN]) / 255.0f; - float pan_r = (float)(m_dac[PAN]) / 255.0f; + float const pan_l = float(255 - m_dac[PAN]) / 255.0f; + float const pan_r = float(m_dac[PAN]) / 255.0f; for (int sampindex = 0; sampindex < fl.samples(); sampindex++) { @@ -254,7 +251,7 @@ void micro3d_sound_device::sound_stream_update(sound_stream &stream, std::vector m_noise_subcount = 2000000 / MM5837_CLOCK; } m_noise_subcount -= step; - float input = (float)m_noise_value - 0.5f; + float input = float(m_noise_value) - 0.5f; float white = input; // Pink noise filtering diff --git a/src/mame/misc/micro3d_a.h b/src/mame/misc/micro3d_a.h index fd3908afd46..a0976c219b8 100644 --- a/src/mame/misc/micro3d_a.h +++ b/src/mame/misc/micro3d_a.h @@ -27,7 +27,8 @@ class micro3d_sound_device : public device_t, public device_sound_interface virtual void sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) override; private: - enum dac_registers { + enum dac_registers + { VCF, VCQ, VCA, diff --git a/src/mame/misc/micro3d_v.cpp b/src/mame/misc/micro3d_v.cpp index ccdafc19e9b..120f34ec6a7 100644 --- a/src/mame/misc/micro3d_v.cpp +++ b/src/mame/misc/micro3d_v.cpp @@ -297,8 +297,9 @@ void micro3d_state::draw_line(uint32_t x1, uint32_t y1, uint32_t x2, uint32_t y2 if (x2 < x1) { - std::swap(x1, x2); - std::swap(y1, y2); + using std::swap; + swap(x1, x2); + swap(y1, y2); } dx = x2 - x1; diff --git a/src/mame/namco/sweetland4.cpp b/src/mame/namco/sweetland4.cpp index f1e0b1a01e0..0377316226e 100644 --- a/src/mame/namco/sweetland4.cpp +++ b/src/mame/namco/sweetland4.cpp @@ -47,7 +47,7 @@ class sweetland4_state : public driver_device {} void sweetland4(machine_config &config); - void tairyouda(machine_config &config); + void tairyodk(machine_config &config); private: required_device m_maincpu; @@ -110,7 +110,7 @@ static INPUT_PORTS_START( sweetld4 ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) INPUT_PORTS_END -static INPUT_PORTS_START( tairyouda ) +static INPUT_PORTS_START( tairyodk ) PORT_START("DSW1") // only one bank of 4 dip switches on PCB PORT_DIPNAME( 0x01, 0x01, "DSW1-01" ) PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) @@ -142,7 +142,7 @@ void sweetland4_state::sweetland4(machine_config &config) oki.add_route(1, "rspeaker", 1.00); } -void sweetland4_state::tairyouda(machine_config &config) +void sweetland4_state::tairyodk(machine_config &config) { H83002(config, m_maincpu, 14.746_MHz_XTAL); // H8/3002 6413002F17 @@ -201,7 +201,7 @@ ROM_END |________________________________________________________________________| */ -ROM_START( tairyouda ) // 大漁太鼓337拍子 +ROM_START( tairyodk ) // 大漁太鼓337拍子 ROM_REGION( 0x80000, "maincpu", 0 ) ROM_LOAD( "t3b1_prg0.5f", 0x00000, 0x80000, CRC(d09dcb0c) SHA1(dbb66f5d548079f19b06dd98d3a44ee6b42b470a) ) @@ -212,5 +212,5 @@ ROM_END } // anonymous namespace -GAME( 2004, sweetld4, 0, sweetland4, sweetld4, sweetland4_state, empty_init, ROT0, "Namco", "Sweet Land 4 Bright (ver 2004.9.29)", MACHINE_IS_SKELETON_MECHANICAL ) -GAME( 2000, tairyouda, 0, tairyouda, tairyouda, sweetland4_state, empty_init, ROT0, "Namco", "Tairyo-Daiko 337 Byoshi", MACHINE_IS_SKELETON_MECHANICAL ) +GAME( 2004, sweetld4, 0, sweetland4, sweetld4, sweetland4_state, empty_init, ROT0, "Namco", "Sweet Land 4 Bright (ver 2004.9.29)", MACHINE_IS_SKELETON_MECHANICAL ) +GAME( 2000, tairyodk, 0, tairyodk, tairyodk, sweetland4_state, empty_init, ROT0, "Namco", "Tairyo-Daiko 337 Byoshi", MACHINE_IS_SKELETON_MECHANICAL ) diff --git a/src/mame/pinball/inder.cpp b/src/mame/pinball/inder.cpp index 8254af7333d..c7572e30b40 100644 --- a/src/mame/pinball/inder.cpp +++ b/src/mame/pinball/inder.cpp @@ -1709,4 +1709,4 @@ GAME(1991, larana, 0, inder, larana, inder_state, init_0, ROT0, "Inder", GAME(1992, ind250cc, 0, inder, ind250cc, inder_state, init_1, ROT0, "Inder", "250 CC", MACHINE_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // Unknown sound hardware, unknown machine (using 'larana' inputs until proper ones are figured out). -GAME(1991, indunkgam, 0, inder, larana, inder_state, init_0, ROT0, "Inder", "Unknown gambling game on Inder pinball hardware", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME(1991, indunkgam, 0, inder, larana, inder_state, init_0, ROT0, "Inder", "unknown gambling game on Inder pinball hardware", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/promat/3x3puzzl.cpp b/src/mame/promat/3x3puzzl.cpp index 8cbc3b16086..6f4ec488817 100644 --- a/src/mame/promat/3x3puzzl.cpp +++ b/src/mame/promat/3x3puzzl.cpp @@ -82,17 +82,17 @@ class _3x3puzzle_state : public driver_device required_device m_gfxdecode; required_device m_screen; - // screen updates - uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - // video-related tilemap_t *m_tilemap[3] = {nullptr, nullptr, nullptr}; - template TILE_GET_INFO_MEMBER(get_tile_info); - int m_oki_bank = 0; uint16_t m_gfx_control = 0; + // screen updates + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + + template TILE_GET_INFO_MEMBER(get_tile_info); + void gfx_ctrl_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); void tilemap1_scrollx_w(uint16_t data); void tilemap1_scrolly_w(uint16_t data); @@ -101,7 +101,7 @@ class _3x3puzzle_state : public driver_device }; -template +template TILE_GET_INFO_MEMBER(_3x3puzzle_state::get_tile_info) { tileinfo.set(Which, @@ -294,10 +294,10 @@ static INPUT_PORTS_START( casanova ) PORT_MODIFY("DSW01") // Do NOT trust "DIP INFO" for correct settings! At least Coinage is WRONG! PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1,2") - PORT_DIPSETTING( 0x0002, DEF_STR( 1C_2C ) ) // Dip info shows 2 Coins / Credit + PORT_DIPSETTING( 0x0002, DEF_STR( 1C_2C ) ) // DIP switch info shows 2 Coins / Credit PORT_DIPSETTING( 0x0003, DEF_STR( 1C_1C ) ) - PORT_DIPSETTING( 0x0001, DEF_STR( 2C_1C ) ) // Dip info shows 3 Coins / Credit - PORT_DIPSETTING( 0x0000, DEF_STR( 3C_1C ) ) // Dip info shows 5 Coins / Credit + PORT_DIPSETTING( 0x0001, DEF_STR( 2C_1C ) ) // DIP switch info shows 3 Coins / Credit + PORT_DIPSETTING( 0x0000, DEF_STR( 3C_1C ) ) // DIP switch info shows 5 Coins / Credit PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:3,4") PORT_DIPSETTING( 0x0008, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x000c, DEF_STR( Normal ) ) diff --git a/src/mame/seta/seta2.cpp b/src/mame/seta/seta2.cpp index dc9e0bbe8a0..597dde6b4bc 100644 --- a/src/mame/seta/seta2.cpp +++ b/src/mame/seta/seta2.cpp @@ -61,7 +61,7 @@ P0-145-1 2002 Trophy Hunting - Bear & Moose (test) Sammy - slowdowns, music tempo is incorrect mj4simai: -- test mode doesn't work correctly, the grid is ok but when you press a key to go to the +- test mode doesn't work correctly, the grid is OK but when you press a key to go to the next screen (input test) it stays up a second and then drops back into the game myangel: @@ -102,6 +102,17 @@ funcube series: #include "diserial.h" #include "speaker.h" +#define LOG_IO (1U << 1) +#define LOG_DEBUG (1U << 2) + +#define LOG_ALL (LOG_IO) + +#define VERBOSE (0) +#include "logmacro.h" + +#define LOGIO(...) LOGMASKED(LOG_IO, __VA_ARGS__) +#define LOGDEBUG(...) LOGMASKED(LOG_DEBUG, __VA_ARGS__) + /*************************************************************************** @@ -141,14 +152,14 @@ void seta2_state::sound_bank_w(offs_t offset, uint8_t data) void seta2_state::x1_map(address_map &map) { - map(0x00000, 0x1ffff).bankr("x1_bank_1"); - map(0x20000, 0x3ffff).bankr("x1_bank_2"); - map(0x40000, 0x5ffff).bankr("x1_bank_3"); - map(0x60000, 0x7ffff).bankr("x1_bank_4"); - map(0x80000, 0x9ffff).bankr("x1_bank_5"); - map(0xa0000, 0xbffff).bankr("x1_bank_6"); - map(0xc0000, 0xdffff).bankr("x1_bank_7"); - map(0xe0000, 0xfffff).bankr("x1_bank_8"); + map(0x00000, 0x1ffff).bankr(m_x1_bank[0]); + map(0x20000, 0x3ffff).bankr(m_x1_bank[1]); + map(0x40000, 0x5ffff).bankr(m_x1_bank[2]); + map(0x60000, 0x7ffff).bankr(m_x1_bank[3]); + map(0x80000, 0x9ffff).bankr(m_x1_bank[4]); + map(0xa0000, 0xbffff).bankr(m_x1_bank[5]); + map(0xc0000, 0xdffff).bankr(m_x1_bank[6]); + map(0xe0000, 0xfffff).bankr(m_x1_bank[7]); } @@ -159,29 +170,29 @@ void seta2_state::x1_map(address_map &map) void seta2_state::grdians_lockout_w(uint8_t data) { // initially 0, then either $25 (coin 1) or $2a (coin 2) - machine().bookkeeping().coin_counter_w(0,data & 0x01); // or 0x04 - machine().bookkeeping().coin_counter_w(1,data & 0x02); // or 0x08 - //popmessage("%04X", data & 0xff); + machine().bookkeeping().coin_counter_w(0, BIT(data, 0)); // or 0x04 + machine().bookkeeping().coin_counter_w(1, BIT(data, 1)); // or 0x08 + //LOGIO("%04X\n", data & 0xff); } void seta2_state::grdians_map(address_map &map) { - map(0x000000, 0x1fffff).rom(); // ROM - map(0x200000, 0x20ffff).ram(); // RAM - map(0x304000, 0x30ffff).ram(); // ? seems tile data - map(0x600000, 0x600001).portr("DSW1"); // DSW 1 - map(0x600002, 0x600003).portr("DSW2"); // DSW 2 - map(0x700000, 0x700001).portr("P1"); // P1 - map(0x700002, 0x700003).portr("P2"); // P2 - map(0x700004, 0x700005).portr("SYSTEM"); // Coins + map(0x000000, 0x1fffff).rom(); // ROM + map(0x200000, 0x20ffff).ram(); // RAM + map(0x304000, 0x30ffff).ram(); // ? seems tile data + map(0x600000, 0x600001).portr("DSW1"); // DSW 1 + map(0x600002, 0x600003).portr("DSW2"); // DSW 2 + map(0x700000, 0x700001).portr("P1"); // P1 + map(0x700002, 0x700003).portr("P2"); // P2 + map(0x700004, 0x700005).portr("SYSTEM"); // Coins map(0x70000c, 0x70000d).r("watchdog", FUNC(watchdog_timer_device::reset16_r)); map(0x800001, 0x800001).w(FUNC(seta2_state::grdians_lockout_w)); - map(0xb00000, 0xb03fff).rw("x1snd", FUNC(x1_010_device::word_r), FUNC(x1_010_device::word_w)); // Sound - map(0xc00000, 0xc3ffff).ram().w(FUNC(seta2_state::spriteram_w)).share("spriteram"); // Sprites + map(0xb00000, 0xb03fff).rw("x1snd", FUNC(x1_010_device::word_r), FUNC(x1_010_device::word_w)); // Sound + map(0xc00000, 0xc3ffff).ram().w(FUNC(seta2_state::spriteram_w)).share(m_spriteram); // Sprites map(0xc40000, 0xc4ffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette - map(0xc50000, 0xc5ffff).ram(); // cleared - map(0xc60000, 0xc6003f).ram().w(FUNC(seta2_state::vregs_w)).share("vregs"); // Video Registers - map(0xe00010, 0xe0001f).w(FUNC(seta2_state::sound_bank_w)).umask16(0x00ff); // Samples Banks + map(0xc50000, 0xc5ffff).ram(); // cleared + map(0xc60000, 0xc6003f).ram().w(FUNC(seta2_state::vregs_w)).share(m_vregs); // Video Registers + map(0xe00010, 0xe0001f).w(FUNC(seta2_state::sound_bank_w)).umask16(0x00ff); // Samples Banks } /*************************************************************************** @@ -190,36 +201,36 @@ void seta2_state::grdians_map(address_map &map) uint16_t seta2_state::gundamex_eeprom_r() { - return ((m_eeprom->do_read() & 1)) << 3; + return (m_eeprom->do_read() & 1) << 3; } void seta2_state::gundamex_eeprom_w(uint16_t data) { - m_eeprom->clk_write((data & 0x2) ? ASSERT_LINE : CLEAR_LINE); - m_eeprom->di_write(data & 0x1); - m_eeprom->cs_write((data & 0x4) ? ASSERT_LINE : CLEAR_LINE); + m_eeprom->clk_write(BIT(data, 1) ? ASSERT_LINE : CLEAR_LINE); + m_eeprom->di_write(BIT(data, 0)); + m_eeprom->cs_write(BIT(data, 2) ? ASSERT_LINE : CLEAR_LINE); } void seta2_state::gundamex_map(address_map &map) { - map(0x000000, 0x1fffff).rom(); // ROM - map(0x200000, 0x20ffff).ram(); // RAM - map(0x500000, 0x57ffff).rom(); // ROM - map(0x600000, 0x600001).portr("DSW1"); // DSW 1 - map(0x600002, 0x600003).portr("DSW2"); // DSW 2 - map(0x700000, 0x700001).portr("P1"); // P1 - map(0x700002, 0x700003).portr("P2"); // P2 - map(0x700004, 0x700005).portr("SYSTEM"); // Coins - map(0x700008, 0x700009).portr("IN0"); // P1 - map(0x70000a, 0x70000b).portr("IN1"); // P2 + map(0x000000, 0x1fffff).rom(); // ROM + map(0x200000, 0x20ffff).ram(); // RAM + map(0x500000, 0x57ffff).rom(); // ROM + map(0x600000, 0x600001).portr("DSW1"); // DSW 1 + map(0x600002, 0x600003).portr("DSW2"); // DSW 2 + map(0x700000, 0x700001).portr("P1"); // P1 + map(0x700002, 0x700003).portr("P2"); // P2 + map(0x700004, 0x700005).portr("SYSTEM"); // Coins + map(0x700008, 0x700009).portr("IN0"); // P1 + map(0x70000a, 0x70000b).portr("IN1"); // P2 map(0x70000c, 0x70000d).w("watchdog", FUNC(watchdog_timer_device::reset16_w)); map(0x800000, 0x800001).w(FUNC(seta2_state::grdians_lockout_w)); - map(0xb00000, 0xb03fff).rw("x1snd", FUNC(x1_010_device::word_r), FUNC(x1_010_device::word_w)); // Sound - map(0xc00000, 0xc3ffff).ram().share("spriteram"); // Sprites + map(0xb00000, 0xb03fff).rw("x1snd", FUNC(x1_010_device::word_r), FUNC(x1_010_device::word_w)); // Sound + map(0xc00000, 0xc3ffff).ram().share(m_spriteram); // Sprites map(0xc40000, 0xc4ffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette - map(0xc50000, 0xc5ffff).ram(); // cleared - map(0xc60000, 0xc6003f).ram().w(FUNC(seta2_state::vregs_w)).share("vregs"); // Video Registers - map(0xe00010, 0xe0001f).w(FUNC(seta2_state::sound_bank_w)).umask16(0x00ff); // Samples Banks + map(0xc50000, 0xc5ffff).ram(); // cleared + map(0xc60000, 0xc6003f).ram().w(FUNC(seta2_state::vregs_w)).share(m_vregs); // Video Registers + map(0xe00010, 0xe0001f).w(FUNC(seta2_state::sound_bank_w)).umask16(0x00ff); // Samples Banks } @@ -233,49 +244,35 @@ void mj4simai_state::machine_start() save_item(NAME(m_keyboard_row)); } -uint16_t seta2_state::mj4simai_p1_r() +template +uint16_t mj4simai_state::mj4simai_key_r() { - switch (m_keyboard_row) - { - case 0x01: return ioport("P1_KEY0")->read(); - case 0x02: return ioport("P1_KEY1")->read(); - case 0x04: return ioport("P1_KEY2")->read(); - case 0x08: return ioport("P1_KEY3")->read(); - case 0x10: return ioport("P1_KEY4")->read(); - default: logerror("p1_r with keyboard_row = %02x\n", m_keyboard_row); return 0xffff; - } + uint16_t result = 0xffff; + if (BIT(m_keyboard_row, 0)) result &= m_keys[Which][0]->read(); + if (BIT(m_keyboard_row, 1)) result &= m_keys[Which][1]->read(); + if (BIT(m_keyboard_row, 2)) result &= m_keys[Which][2]->read(); + if (BIT(m_keyboard_row, 3)) result &= m_keys[Which][3]->read(); + if (BIT(m_keyboard_row, 4)) result &= m_keys[Which][4]->read(); + return result; } -uint16_t seta2_state::mj4simai_p2_r() +void mj4simai_state::mj4simai_map(address_map &map) { - switch (m_keyboard_row) - { - case 0x01: return ioport("P2_KEY0")->read(); - case 0x02: return ioport("P2_KEY1")->read(); - case 0x04: return ioport("P2_KEY2")->read(); - case 0x08: return ioport("P2_KEY3")->read(); - case 0x10: return ioport("P2_KEY4")->read(); - default: logerror("p2_r with keyboard_row = %02x\n", m_keyboard_row); return 0xffff; - } -} - -void seta2_state::mj4simai_map(address_map &map) -{ - map(0x000000, 0x1fffff).rom(); // ROM - map(0x200000, 0x20ffff).ram(); // RAM - map(0x600000, 0x600001).r(FUNC(seta2_state::mj4simai_p1_r)); // P1 - map(0x600002, 0x600003).r(FUNC(seta2_state::mj4simai_p2_r)); // P2 - map(0x600005, 0x600005).lw8(NAME([this] (u8 data){ m_keyboard_row = data; })); // select keyboard row to read + map(0x000000, 0x1fffff).rom(); // ROM + map(0x200000, 0x20ffff).ram(); // RAM + map(0x600000, 0x600001).r(FUNC(mj4simai_state::mj4simai_key_r<0>)); // P1 + map(0x600002, 0x600003).r(FUNC(mj4simai_state::mj4simai_key_r<1>)); // P2 + map(0x600005, 0x600005).lw8(NAME([this] (u8 data) { m_keyboard_row = data; })); // select keyboard row to read map(0x600006, 0x600007).r("watchdog", FUNC(watchdog_timer_device::reset16_r)); - map(0x600100, 0x600101).portr("SYSTEM"); // - map(0x600200, 0x600201).nopw(); // Leds? Coins? - map(0x600300, 0x600301).portr("DSW1"); // DSW 1 - map(0x600302, 0x600303).portr("DSW2"); // DSW 2 - map(0x600300, 0x60030f).w(FUNC(seta2_state::sound_bank_w)).umask16(0x00ff); // Samples Banks - map(0xb00000, 0xb03fff).rw("x1snd", FUNC(x1_010_device::word_r), FUNC(x1_010_device::word_w)); // Sound - map(0xc00000, 0xc3ffff).ram().share("spriteram"); // Sprites + map(0x600100, 0x600101).portr("SYSTEM"); + map(0x600200, 0x600201).nopw(); // LEDs? Coins? + map(0x600300, 0x600301).portr("DSW1"); // DSW 1 + map(0x600302, 0x600303).portr("DSW2"); // DSW 2 + map(0x600300, 0x60030f).w(FUNC(mj4simai_state::sound_bank_w)).umask16(0x00ff); // Samples Banks + map(0xb00000, 0xb03fff).rw("x1snd", FUNC(x1_010_device::word_r), FUNC(x1_010_device::word_w)); // Sound + map(0xc00000, 0xc3ffff).ram().share(m_spriteram); // Sprites map(0xc40000, 0xc4ffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette - map(0xc60000, 0xc6003f).ram().w(FUNC(seta2_state::vregs_w)).share("vregs"); // Video Registers + map(0xc60000, 0xc6003f).ram().w(FUNC(mj4simai_state::vregs_w)).share(m_vregs); // Video Registers } @@ -285,20 +282,20 @@ void seta2_state::mj4simai_map(address_map &map) void seta2_state::myangel_map(address_map &map) { - map(0x000000, 0x1fffff).rom(); // ROM - map(0x200000, 0x20ffff).ram(); // RAM - map(0x700000, 0x700001).portr("P1"); // P1 - map(0x700002, 0x700003).portr("P2"); // P2 - map(0x700004, 0x700005).portr("SYSTEM"); // Coins + map(0x000000, 0x1fffff).rom(); // ROM + map(0x200000, 0x20ffff).ram(); // RAM + map(0x700000, 0x700001).portr("P1"); // P1 + map(0x700002, 0x700003).portr("P2"); // P2 + map(0x700004, 0x700005).portr("SYSTEM"); // Coins map(0x700006, 0x700007).r("watchdog", FUNC(watchdog_timer_device::reset16_r)); - map(0x700200, 0x700201).nopw(); // Leds? Coins? - map(0x700300, 0x700301).portr("DSW1"); // DSW 1 - map(0x700302, 0x700303).portr("DSW2"); // DSW 2 - map(0x700310, 0x70031f).w(FUNC(seta2_state::sound_bank_w)).umask16(0x00ff); // Samples Banks - map(0xb00000, 0xb03fff).rw("x1snd", FUNC(x1_010_device::word_r), FUNC(x1_010_device::word_w)); // Sound - map(0xc00000, 0xc3ffff).ram().share("spriteram"); // Sprites + map(0x700200, 0x700201).nopw(); // LEDs? Coins? + map(0x700300, 0x700301).portr("DSW1"); // DSW 1 + map(0x700302, 0x700303).portr("DSW2"); // DSW 2 + map(0x700310, 0x70031f).w(FUNC(seta2_state::sound_bank_w)).umask16(0x00ff); // Samples Banks + map(0xb00000, 0xb03fff).rw("x1snd", FUNC(x1_010_device::word_r), FUNC(x1_010_device::word_w)); // Sound + map(0xc00000, 0xc3ffff).ram().share(m_spriteram); // Sprites map(0xc40000, 0xc4ffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette - map(0xc60000, 0xc6003f).ram().w(FUNC(seta2_state::vregs_w)).share("vregs"); // Video Registers + map(0xc60000, 0xc6003f).ram().w(FUNC(seta2_state::vregs_w)).share(m_vregs); // Video Registers } @@ -308,20 +305,20 @@ void seta2_state::myangel_map(address_map &map) void seta2_state::myangel2_map(address_map &map) { - map(0x000000, 0x1fffff).rom(); // ROM - map(0x200000, 0x20ffff).ram(); // RAM - map(0x600000, 0x600001).portr("P1"); // P1 - map(0x600002, 0x600003).portr("P2"); // P2 - map(0x600004, 0x600005).portr("SYSTEM"); // Coins + map(0x000000, 0x1fffff).rom(); // ROM + map(0x200000, 0x20ffff).ram(); // RAM + map(0x600000, 0x600001).portr("P1"); // P1 + map(0x600002, 0x600003).portr("P2"); // P2 + map(0x600004, 0x600005).portr("SYSTEM"); // Coins map(0x600006, 0x600007).r("watchdog", FUNC(watchdog_timer_device::reset16_r)); - map(0x600200, 0x600201).nopw(); // Leds? Coins? - map(0x600300, 0x600301).portr("DSW1"); // DSW 1 - map(0x600302, 0x600303).portr("DSW2"); // DSW 2 - map(0x600300, 0x60030f).w(FUNC(seta2_state::sound_bank_w)).umask16(0x00ff); // Samples Banks - map(0xb00000, 0xb03fff).rw("x1snd", FUNC(x1_010_device::word_r), FUNC(x1_010_device::word_w)); // Sound - map(0xd00000, 0xd3ffff).ram().share("spriteram"); // Sprites + map(0x600200, 0x600201).nopw(); // LEDs? Coins? + map(0x600300, 0x600301).portr("DSW1"); // DSW 1 + map(0x600302, 0x600303).portr("DSW2"); // DSW 2 + map(0x600300, 0x60030f).w(FUNC(seta2_state::sound_bank_w)).umask16(0x00ff); // Samples Banks + map(0xb00000, 0xb03fff).rw("x1snd", FUNC(x1_010_device::word_r), FUNC(x1_010_device::word_w)); // Sound + map(0xd00000, 0xd3ffff).ram().share(m_spriteram); // Sprites map(0xd40000, 0xd4ffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette - map(0xd60000, 0xd6003f).ram().w(FUNC(seta2_state::vregs_w)).share("vregs"); // Video Registers + map(0xd60000, 0xd6003f).ram().w(FUNC(seta2_state::vregs_w)).share(m_vregs); // Video Registers } @@ -333,37 +330,37 @@ void seta2_state::myangel2_map(address_map &map) The offset to use is stored in RAM at address 0x20BA16 */ uint16_t seta2_state::pzlbowl_protection_r(address_space &space) { - uint32_t address = (space.read_word(0x20ba16) << 16) | space.read_word(0x20ba18); + const uint32_t address = (space.read_word(0x20ba16) << 16) | space.read_word(0x20ba18); return memregion("maincpu")->base()[address - 2]; } uint8_t seta2_state::pzlbowl_coins_r() { - return ioport("SYSTEM")->read() | (machine().rand() & 0x80 ); + return m_in_system->read() | (machine().rand() & 0x80); } void seta2_state::pzlbowl_coin_counter_w(uint8_t data) { - machine().bookkeeping().coin_counter_w(0,data & 0x10); - machine().bookkeeping().coin_counter_w(1,data & 0x20); + machine().bookkeeping().coin_counter_w(0, BIT(data, 4)); + machine().bookkeeping().coin_counter_w(1, BIT(data, 5)); } void seta2_state::pzlbowl_map(address_map &map) { - map(0x000000, 0x0fffff).rom(); // ROM - map(0x200000, 0x20ffff).ram(); // RAM - map(0x400300, 0x400301).portr("DSW1"); // DSW 1 - map(0x400302, 0x400303).portr("DSW2"); // DSW 2 - map(0x400300, 0x40030f).w(FUNC(seta2_state::sound_bank_w)).umask16(0x00ff); // Samples Banks - map(0x500000, 0x500001).portr("P1"); // P1 - map(0x500002, 0x500003).portr("P2"); // P2 + map(0x000000, 0x0fffff).rom(); // ROM + map(0x200000, 0x20ffff).ram(); // RAM + map(0x400300, 0x400301).portr("DSW1"); // DSW 1 + map(0x400302, 0x400303).portr("DSW2"); // DSW 2 + map(0x400300, 0x40030f).w(FUNC(seta2_state::sound_bank_w)).umask16(0x00ff); // Samples Banks + map(0x500000, 0x500001).portr("P1"); // P1 + map(0x500002, 0x500003).portr("P2"); // P2 map(0x500005, 0x500005).rw(FUNC(seta2_state::pzlbowl_coins_r), FUNC(seta2_state::pzlbowl_coin_counter_w)); // Coins + Protection? map(0x500006, 0x500007).r("watchdog", FUNC(watchdog_timer_device::reset16_r)); - map(0x700000, 0x700001).r(FUNC(seta2_state::pzlbowl_protection_r)); // Protection - map(0x800000, 0x83ffff).ram().share("spriteram"); // Sprites + map(0x700000, 0x700001).r(FUNC(seta2_state::pzlbowl_protection_r)); // Protection + map(0x800000, 0x83ffff).ram().share(m_spriteram); // Sprites map(0x840000, 0x84ffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette - map(0x860000, 0x86003f).ram().w(FUNC(seta2_state::vregs_w)).share("vregs"); // Video Registers - map(0x900000, 0x903fff).rw("x1snd", FUNC(x1_010_device::word_r), FUNC(x1_010_device::word_w)); // Sound + map(0x860000, 0x86003f).ram().w(FUNC(seta2_state::vregs_w)).share(m_vregs); // Video Registers + map(0x900000, 0x903fff).rw("x1snd", FUNC(x1_010_device::word_r), FUNC(x1_010_device::word_w)); // Sound } @@ -395,7 +392,7 @@ void seta2_state::penbros_map(address_map &map) map(0x500300, 0x500301).portr("DSW1"); map(0x500302, 0x500303).portr("DSW2"); map(0x500300, 0x50030f).w(FUNC(seta2_state::sound_bank_w)).umask16(0x00ff); - map(0xb60000, 0xb6003f).ram().w(FUNC(seta2_state::vregs_w)).share("vregs"); + map(0xb60000, 0xb6003f).ram().w(FUNC(seta2_state::vregs_w)).share(m_vregs); } void seta2_state::ablastb_map(address_map &map) @@ -430,37 +427,37 @@ void seta2_state::reelquak_leds_w(offs_t offset, uint16_t data, uint16_t mem_mas m_dispenser->motor_w(BIT(data, 8)); // ticket dispenser } - //popmessage("LED %04X", data); + //LOGIO("LED %04X\n", data); } void seta2_state::reelquak_coin_w(uint8_t data) { - machine().bookkeeping().coin_counter_w(0, data & 0x01); // coin in - machine().bookkeeping().coin_counter_w(1, data & 0x02); // coin in - machine().bookkeeping().coin_counter_w(2, data & 0x04); // pay out - machine().bookkeeping().coin_counter_w(3, data & 0x08); // key in - // data & 0x10); // Sound IRQ Ack.? 1->0 - // data & 0x20); // Vblank IRQ.? 1 - //popmessage("COIN %04X", data & 0xff); + machine().bookkeeping().coin_counter_w(0, BIT(data, 0)); // coin in + machine().bookkeeping().coin_counter_w(1, BIT(data, 1)); // coin in + machine().bookkeeping().coin_counter_w(2, BIT(data, 2)); // pay out + machine().bookkeeping().coin_counter_w(3, BIT(data, 3)); // key in + // BIT(data, 4)); // Sound IRQ Ack.? 1->0 + // BIT(data, 5)); // Vblank IRQ.? 1 + //LOGIO("COIN %04X\n", data & 0xff); } void seta2_state::reelquak_map(address_map &map) { - map(0x000000, 0x0fffff).rom(); // ROM - map(0x200000, 0x20ffff).ram(); // RAM - map(0x300000, 0x303fff).ram().share("nvram"); // NVRAM (Battery Backed) - map(0x400000, 0x400001).portr("P1"); // P1 - map(0x400002, 0x400003).portr("TICKET"); // Tickets - map(0x400004, 0x400005).portr("SYSTEM"); // Coins + map(0x000000, 0x0fffff).rom(); // ROM + map(0x200000, 0x20ffff).ram(); // RAM + map(0x300000, 0x303fff).ram().share("nvram"); // NVRAM (Battery Backed) + map(0x400000, 0x400001).portr("P1"); // P1 + map(0x400002, 0x400003).portr("TICKET"); // Tickets + map(0x400004, 0x400005).portr("SYSTEM"); // Coins map(0x400006, 0x400007).r("watchdog", FUNC(watchdog_timer_device::reset16_r)); - map(0x400201, 0x400201).w(FUNC(seta2_state::reelquak_coin_w)); // Coin Counters / IRQ Ack - map(0x400300, 0x400301).portr("DSW1"); // DSW 1 - map(0x400302, 0x400303).portr("DSW2"); // DSW 2 - map(0x400300, 0x40030f).w(FUNC(seta2_state::sound_bank_w)).umask16(0x00ff); // Samples Banks - map(0xb00000, 0xb03fff).rw("x1snd", FUNC(x1_010_device::word_r), FUNC(x1_010_device::word_w)); // Sound - map(0xc00000, 0xc3ffff).ram().share("spriteram"); // Sprites + map(0x400201, 0x400201).w(FUNC(seta2_state::reelquak_coin_w)); // Coin Counters / IRQ Ack + map(0x400300, 0x400301).portr("DSW1"); // DSW 1 + map(0x400302, 0x400303).portr("DSW2"); // DSW 2 + map(0x400300, 0x40030f).w(FUNC(seta2_state::sound_bank_w)).umask16(0x00ff); // Samples Banks + map(0xb00000, 0xb03fff).rw("x1snd", FUNC(x1_010_device::word_r), FUNC(x1_010_device::word_w)); // Sound + map(0xc00000, 0xc3ffff).ram().share(m_spriteram); // Sprites map(0xc40000, 0xc4ffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette - map(0xc60000, 0xc6003f).ram().w(FUNC(seta2_state::vregs_w)).share("vregs"); // Video Registers + map(0xc60000, 0xc6003f).ram().w(FUNC(seta2_state::vregs_w)).share(m_vregs); // Video Registers } @@ -471,10 +468,10 @@ void seta2_state::reelquak_map(address_map &map) // To be done: void seta2_state::namcostr_map(address_map &map) { - map(0x000000, 0x07ffff).rom(); // ROM - map(0x200000, 0x20ffff).ram(); // RAM - map(0xc00000, 0xc3ffff).ram().share("spriteram"); // Sprites - map(0xc60000, 0xc6003f).ram().w(FUNC(seta2_state::vregs_w)).share("vregs"); // Video Registers + map(0x000000, 0x07ffff).rom(); // ROM + map(0x200000, 0x20ffff).ram(); // RAM + map(0xc00000, 0xc3ffff).ram().share(m_spriteram); // Sprites + map(0xc60000, 0xc6003f).ram().w(FUNC(seta2_state::vregs_w)).share(m_vregs); // Video Registers } @@ -484,13 +481,13 @@ void seta2_state::namcostr_map(address_map &map) void seta2_state::samshoot_coin_w(uint8_t data) { - machine().bookkeeping().coin_counter_w(0, data & 0x10); - machine().bookkeeping().coin_counter_w(1, data & 0x20); + machine().bookkeeping().coin_counter_w(0, BIT( data, 4)); + machine().bookkeeping().coin_counter_w(1, BIT( data, 5)); // Are these connected? They are set in I/O test - machine().bookkeeping().coin_lockout_w(0,~data & 0x40); - machine().bookkeeping().coin_lockout_w(1,~data & 0x80); - //popmessage("%04x",data); + machine().bookkeeping().coin_lockout_w(0, BIT(~data, 6)); + machine().bookkeeping().coin_lockout_w(1, BIT(~data, 7)); + //LOGIO("%04x\n",data); } void seta2_state::samshoot_map(address_map &map) @@ -499,25 +496,25 @@ void seta2_state::samshoot_map(address_map &map) map(0x200000, 0x20ffff).ram(); map(0x300000, 0x30ffff).ram().share("nvram"); - map(0x400000, 0x400001).portr("DSW1"); // DSW 1 - map(0x400002, 0x400003).portr("BUTTONS"); // Buttons + map(0x400000, 0x400001).portr("DSW1"); // DSW 1 + map(0x400002, 0x400003).portr("BUTTONS"); // Buttons - map(0x400300, 0x40030f).w(FUNC(seta2_state::sound_bank_w)).umask16(0x00ff); // Samples Banks + map(0x400300, 0x40030f).w(FUNC(seta2_state::sound_bank_w)).umask16(0x00ff); // Samples Banks - map(0x500000, 0x500001).portr("GUN1"); // P1 - map(0x580000, 0x580001).portr("GUN2"); // P2 + map(0x500000, 0x500001).portr("GUN1"); // P1 + map(0x580000, 0x580001).portr("GUN2"); // P2 - map(0x700000, 0x700001).portr("TRIGGER"); // Trigger - map(0x700002, 0x700003).portr("PUMP"); // Pump - map(0x700004, 0x700005).portr("COIN"); // Coins - map(0x700005, 0x700005).w(FUNC(seta2_state::samshoot_coin_w)); // Coins - map(0x700006, 0x700007).r("watchdog", FUNC(watchdog_timer_device::reset16_r)); // Watchdog? + map(0x700000, 0x700001).portr("TRIGGER"); // Trigger + map(0x700002, 0x700003).portr("PUMP"); // Pump + map(0x700004, 0x700005).portr("COIN"); // Coins + map(0x700005, 0x700005).w(FUNC(seta2_state::samshoot_coin_w)); // Coins + map(0x700006, 0x700007).r("watchdog", FUNC(watchdog_timer_device::reset16_r)); // Watchdog? - map(0x800000, 0x83ffff).ram().share("spriteram"); // Sprites - map(0x840000, 0x84ffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette - map(0x860000, 0x86003f).ram().w(FUNC(seta2_state::vregs_w)).share("vregs"); // Video Registers + map(0x800000, 0x83ffff).ram().share(m_spriteram); // Sprites + map(0x840000, 0x84ffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette + map(0x860000, 0x86003f).ram().w(FUNC(seta2_state::vregs_w)).share(m_vregs); // Video Registers - map(0x900000, 0x903fff).rw("x1snd", FUNC(x1_010_device::word_r), FUNC(x1_010_device::word_w)); // Sound + map(0x900000, 0x903fff).rw("x1snd", FUNC(x1_010_device::word_r), FUNC(x1_010_device::word_w)); // Sound } @@ -529,7 +526,7 @@ void seta2_state::samshoot_map(address_map &map) void staraudi_state::staraudi_debug_outputs() { - //popmessage("L1: %04X L2: %04X CAM: %04X", m_lamps1, m_lamps2, m_cam); + //LOGDEBUG("L1: %04X L2: %04X CAM: %04X\n", m_lamps1, m_lamps2, m_cam); } void staraudi_state::lamps1_w(offs_t offset, uint8_t data, uint8_t mem_mask) @@ -538,14 +535,14 @@ void staraudi_state::lamps1_w(offs_t offset, uint8_t data, uint8_t mem_mask) m_leds[0] = BIT(data, 0); // Lamp 1 | m_leds[1] = BIT(data, 1); // Lamp 2 |- Camera Lamps m_leds[2] = BIT(data, 2); // Lamp 3 | - // data & 0x08 ); // Degauss + // BIT(data, 3) ); // Degauss staraudi_debug_outputs(); } void staraudi_state::lamps2_w(offs_t offset, uint8_t data, uint8_t mem_mask) { COMBINE_DATA(&m_lamps2); - // data & 0x20 ); // ? Always On + // BIT(data, 5) ); // ? Always On m_leds[3] = BIT(data, 6); // 2P Switch Lamp m_leds[4] = BIT(data, 7); // 1P Switch Lamp staraudi_debug_outputs(); @@ -554,10 +551,10 @@ void staraudi_state::lamps2_w(offs_t offset, uint8_t data, uint8_t mem_mask) void staraudi_state::camera_w(offs_t offset, uint8_t data, uint8_t mem_mask) { COMBINE_DATA(&m_cam); - // data & 0x01 ); // ? Always On - // data & 0x02 ); // ? Print Test - // data & 0x08 ); // Camera On (Test Mode) - // data & 0x20 ); // ? + // BIT(data, 0) ); // ? Always On + // BIT(data, 1) ); // ? Print Test + // BIT(data, 3) ); // Camera On (Test Mode) + // BIT(data, 5) ); // ? staraudi_debug_outputs(); } @@ -588,7 +585,7 @@ void staraudi_state::staraudi_map(address_map &map) // map(0x500000, 0x53ffff).ram(); // Camera RAM (r8g8) // map(0x540000, 0x57ffff).ram(); // Camera RAM (00b8) - map(0x500000, 0x57ffff).ram().share("rgbram"); + map(0x500000, 0x57ffff).ram().share(m_rgbram); map(0x600001, 0x600001).w(FUNC(staraudi_state::camera_w)); // Camera Outputs @@ -610,7 +607,7 @@ void staraudi_state::staraudi_map(address_map &map) map(0xc00000, 0xc3ffff).ram().share("spriteram"); // Sprites map(0xc40000, 0xc4ffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette map(0xc50000, 0xc5ffff).ram(); // cleared - map(0xc60000, 0xc6003f).ram().w(FUNC(staraudi_state::vregs_w)).share("vregs"); // Video Registers + map(0xc60000, 0xc6003f).ram().w(FUNC(staraudi_state::vregs_w)).share(m_vregs); // Video Registers } @@ -623,7 +620,7 @@ void seta2_state::telpacfl_lamp1_w(uint8_t data) for (int i = 0; i <= 7; i++) m_lamps[i] = BIT(data, i); - //popmessage("LAMP1 %04X", data); + //LOGIO("LAMP1 %04X\n", data); } void seta2_state::telpacfl_lamp2_w(uint8_t data) @@ -631,44 +628,44 @@ void seta2_state::telpacfl_lamp2_w(uint8_t data) m_lamps[8] = BIT(data, 0); // on/off lamp (throughout) m_lamps[9] = BIT(data, 1); // bet lamp m_lamps[10] = BIT(data, 2); // payout lamp - m_dispenser->motor_w(data & 0x08); // coin out motor - machine().bookkeeping().coin_counter_w(0, data & 0x10); // coin out counter - // data & 0x20 ); // on credit increase + m_dispenser->motor_w(BIT(data, 3)); // coin out motor + machine().bookkeeping().coin_counter_w(0, BIT(data, 4)); // coin out counter + // BIT(data, 5) ); // on credit increase - //popmessage("LAMP2 %04X", data); + //LOGIO("LAMP2 %04X\n", data); } void seta2_state::telpacfl_lockout_w(uint8_t data) { - machine().bookkeeping().coin_counter_w(1, data & 0x02); // 100yen in - machine().bookkeeping().coin_lockout_w(0, ~data & 0x04); // coin blocker - machine().bookkeeping().coin_lockout_w(1, ~data & 0x08); // 100yen blocker + machine().bookkeeping().coin_counter_w(1, BIT( data, 1)); // 100yen in + machine().bookkeeping().coin_lockout_w(0, BIT(~data, 2)); // coin blocker + machine().bookkeeping().coin_lockout_w(1, BIT(~data, 3)); // 100yen blocker // bits 0x30 ? - //popmessage("LOCK %04X", data); + //LOGIO("LOCK %04X\n", data); } void seta2_state::telpacfl_map(address_map &map) { - map(0x000000, 0x0fffff).rom(); // ROM - map(0x200000, 0x20ffff).ram(); // RAM - map(0x300000, 0x303fff).ram().share("nvram"); // NVRAM (Battery Backed) - map(0x600000, 0x600001).portr("DSW1"); // DSW 1 - map(0x600002, 0x600003).portr("DSW2"); // DSW 2 - map(0x700000, 0x700001).portr("COIN"); // Coin - map(0x700002, 0x700003).portr("P1"); // P1 + Dispenser - map(0x700004, 0x700005).portr("SERVICE"); // Service - map(0x700006, 0x700007).portr("UNKNOWN"); // (unused?) - map(0x700009, 0x700009).w(FUNC(seta2_state::telpacfl_lamp1_w)); // Lamps - map(0x70000d, 0x70000d).w(FUNC(seta2_state::telpacfl_lamp2_w)); // "" - map(0x800001, 0x800001).w(FUNC(seta2_state::telpacfl_lockout_w)); // Coin Blockers - map(0x900000, 0x903fff).rw("x1snd", FUNC(x1_010_device::word_r), FUNC(x1_010_device::word_w)); // Sound - map(0xb00000, 0xb3ffff).ram().share("spriteram"); // Sprites + map(0x000000, 0x0fffff).rom(); // ROM + map(0x200000, 0x20ffff).ram(); // RAM + map(0x300000, 0x303fff).ram().share("nvram"); // NVRAM (Battery Backed) + map(0x600000, 0x600001).portr("DSW1"); // DSW 1 + map(0x600002, 0x600003).portr("DSW2"); // DSW 2 + map(0x700000, 0x700001).portr("COIN"); // Coin + map(0x700002, 0x700003).portr("P1"); // P1 + Dispenser + map(0x700004, 0x700005).portr("SERVICE"); // Service + map(0x700006, 0x700007).portr("UNKNOWN"); // (unused?) + map(0x700009, 0x700009).w(FUNC(seta2_state::telpacfl_lamp1_w)); // Lamps + map(0x70000d, 0x70000d).w(FUNC(seta2_state::telpacfl_lamp2_w)); // "" + map(0x800001, 0x800001).w(FUNC(seta2_state::telpacfl_lockout_w)); // Coin Blockers + map(0x900000, 0x903fff).rw("x1snd", FUNC(x1_010_device::word_r), FUNC(x1_010_device::word_w)); // Sound + map(0xb00000, 0xb3ffff).ram().share(m_spriteram); // Sprites map(0xb40000, 0xb4ffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette - map(0xb60000, 0xb6003f).ram().w(FUNC(seta2_state::vregs_w)).share("vregs"); // Video Registers + map(0xb60000, 0xb6003f).ram().w(FUNC(seta2_state::vregs_w)).share(m_vregs); // Video Registers map(0xd00006, 0xd00007).r("watchdog", FUNC(watchdog_timer_device::reset16_r)); // map(0xe00000, 0xe00001).w(FUNC(seta2_state::)); - map(0xe00010, 0xe0001f).w(FUNC(seta2_state::sound_bank_w)).umask16(0x00ff); // Samples Banks + map(0xe00010, 0xe0001f).w(FUNC(seta2_state::sound_bank_w)).umask16(0x00ff); // Samples Banks } @@ -757,7 +754,7 @@ void funcube_touchscreen_device::device_reset() TIMER_CALLBACK_MEMBER(funcube_touchscreen_device::read_buttons) { - uint8_t button_state = m_btn->read(); + const uint8_t button_state = m_btn->read(); if (m_button_state != button_state) { m_button_state = button_state; @@ -786,7 +783,7 @@ void funcube_touchscreen_device::tra_callback() uint32_t funcube_state::debug_r() { - uint32_t ret = ioport("DEBUG")->read(); + uint32_t ret = m_in_debug->read(); // This bits let you move the crosshair in the inputs / touch panel test with a joystick if (!(m_screen->frame_number() % 3)) @@ -850,33 +847,39 @@ void funcube_state::funcube_sub_map(address_map &map) // Simulate coin drop through two sensors -#define FUNCUBE_SUB_CPU_CLOCK (XTAL(14'745'600)) +static constexpr XTAL FUNCUBE_SUB_CPU_CLOCK = XTAL(14'745'600); uint8_t funcube_state::coins_r() { - uint8_t ret = ioport("SWITCH")->read(); + uint8_t ret = m_in_switch->read(); uint8_t coin_bit0 = 1; // active low uint8_t coin_bit1 = 1; - uint8_t hopper_bit = (m_hopper_motor && !(m_screen->frame_number() % 20)) ? 1 : 0; + const uint8_t hopper_bit = (m_hopper_motor && !(m_screen->frame_number() % 20)) ? 1 : 0; const uint64_t coin_total_cycles = FUNCUBE_SUB_CPU_CLOCK.value() / (1000/10); if (m_coin_start_cycles) { - uint64_t elapsed = m_sub->total_cycles() - m_coin_start_cycles; + const uint64_t elapsed = m_sub->total_cycles() - m_coin_start_cycles; if (elapsed < coin_total_cycles/2) coin_bit0 = 0; else if (elapsed < coin_total_cycles) coin_bit1 = 0; else - m_coin_start_cycles = 0; + { + if (!machine().side_effects_disabled()) + m_coin_start_cycles = 0; + } } else { - if (!(ret & 1)) - m_coin_start_cycles = m_sub->total_cycles(); + if (!machine().side_effects_disabled()) + { + if (!(ret & 1)) + m_coin_start_cycles = m_sub->total_cycles(); + } } return (ret & ~7) | (hopper_bit << 2) | (coin_bit1 << 1) | coin_bit0; @@ -884,7 +887,7 @@ uint8_t funcube_state::coins_r() void funcube_state::funcube_debug_outputs() { - //popmessage("LED: %02x OUT: %02x", m_funcube_leds, m_outputs); + //LOGDEBUG("LED: %02x OUT: %02x\n", m_funcube_leds, m_outputs); } void funcube_state::leds_w(uint8_t data) @@ -916,7 +919,7 @@ void funcube_state::outputs_w(uint8_t data) // Bits 0,1,3 written // Bit 0: hopper motor - m_hopper_motor = (~data) & 0x01; + m_hopper_motor = BIT(~data, 0); // Bit 1: high on pay out @@ -928,7 +931,7 @@ void funcube_state::outputs_w(uint8_t data) uint8_t funcube_state::battery_r() { - return ioport("BATTERY")->read() ? 0x40 : 0x00; + return m_in_battery->read() ? 0x40 : 0x00; } @@ -952,14 +955,14 @@ static INPUT_PORTS_START( gundamex ) PORT_DIPSETTING( 0x0006, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x0002, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) ) - PORT_DIPUNUSED_DIPLOC( 0x0008, 0x0008, "SW1:4" ) /* Listed as "Unused" */ + PORT_DIPUNUSED_DIPLOC( 0x0008, 0x0008, "SW1:4" ) // Listed as "Unused" PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:5") PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0020, 0x0020, "Freeze" ) PORT_DIPLOCATION("SW1:6") /* Listed as "Unused" */ + PORT_DIPNAME( 0x0020, 0x0020, "Freeze" ) PORT_DIPLOCATION("SW1:6") // Listed as "Unused" PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0040, 0x0040, "Show Targets" ) PORT_DIPLOCATION("SW1:7") /* Listed as "Unused" */ + PORT_DIPNAME( 0x0040, 0x0040, "Show Targets" ) PORT_DIPLOCATION("SW1:7") // Listed as "Unused" PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_SERVICE_DIPLOC( 0x0080, IP_ACTIVE_LOW, "SW1:8" ) @@ -1072,7 +1075,7 @@ static INPUT_PORTS_START( grdians ) PORT_DIPSETTING( 0x0030, "2" ) PORT_DIPSETTING( 0x0010, "3" ) PORT_DIPSETTING( 0x0000, "4" ) - PORT_SERVICE_DIPLOC( 0x0040, IP_ACTIVE_LOW, "SW1:7" ) /* NOTE: Test mode shows player 3 & 4 controls, but it's a two player game */ + PORT_SERVICE_DIPLOC( 0x0040, IP_ACTIVE_LOW, "SW1:7" ) // NOTE: Test mode shows player 3 & 4 controls, but it's a two player game PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:8") PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0080, DEF_STR( On ) ) @@ -1313,8 +1316,8 @@ INPUT_PORTS_END static INPUT_PORTS_START( myangel ) PORT_START("DSW1") // $700300.w PORT_SERVICE_DIPLOC( 0x0001, IP_ACTIVE_LOW, "SW1:1" ) - PORT_DIPUNUSED_DIPLOC( 0x0002, 0x0002, "SW1:2" ) /* Listed as "Unused" */ - PORT_DIPUNUSED_DIPLOC( 0x0004, 0x0004, "SW1:3" ) /* Listed as "Unused" */ + PORT_DIPUNUSED_DIPLOC( 0x0002, 0x0002, "SW1:2" ) // Listed as "Unused" + PORT_DIPUNUSED_DIPLOC( 0x0004, 0x0004, "SW1:3" ) // Listed as "Unused" PORT_DIPNAME( 0x0008, 0x0008, "Increase Lives While Playing" ) PORT_DIPLOCATION("SW1:4") PORT_DIPSETTING( 0x0000, DEF_STR( No ) ) PORT_DIPSETTING( 0x0008, DEF_STR( Yes ) ) @@ -1349,9 +1352,9 @@ static INPUT_PORTS_START( myangel ) PORT_DIPSETTING( 0x000a, DEF_STR( 1C_6C ) ) PORT_DIPSETTING( 0x0009, DEF_STR( 1C_7C ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) ) - PORT_DIPUNUSED_DIPLOC( 0x0010, 0x0010, "SW2:5" ) /* Listed as "Unused" */ - PORT_DIPUNUSED_DIPLOC( 0x0020, 0x0020, "SW2:6" ) /* Listed as "Unused" */ - PORT_DIPUNUSED_DIPLOC( 0x0040, 0x0040, "SW2:7" ) /* Listed as "Unused" */ + PORT_DIPUNUSED_DIPLOC( 0x0010, 0x0010, "SW2:5" ) // Listed as "Unused" + PORT_DIPUNUSED_DIPLOC( 0x0020, 0x0020, "SW2:6" ) // Listed as "Unused" + PORT_DIPUNUSED_DIPLOC( 0x0040, 0x0040, "SW2:7" ) // Listed as "Unused" PORT_DIPNAME( 0x0080, 0x0080, "Push Start To Freeze (Cheat)") PORT_DIPLOCATION("SW2:8") PORT_DIPSETTING( 0x0080, DEF_STR( No ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Yes ) ) @@ -1399,8 +1402,8 @@ INPUT_PORTS_END static INPUT_PORTS_START( myangel2 ) PORT_START("DSW1") //$600300.w PORT_SERVICE_DIPLOC( 0x0001, IP_ACTIVE_LOW, "SW1:1" ) - PORT_DIPUNUSED_DIPLOC( 0x0002, 0x0002, "SW1:2" ) /* Listed as "Unused" */ - PORT_DIPUNUSED_DIPLOC( 0x0004, 0x0004, "SW1:3" ) /* Listed as "Unused" */ + PORT_DIPUNUSED_DIPLOC( 0x0002, 0x0002, "SW1:2" ) // Listed as "Unused" + PORT_DIPUNUSED_DIPLOC( 0x0004, 0x0004, "SW1:3" ) // Listed as "Unused" PORT_DIPNAME( 0x0008, 0x0008, "Increase Lives While Playing" ) PORT_DIPLOCATION("SW1:4") PORT_DIPSETTING( 0x0000, DEF_STR( No ) ) PORT_DIPSETTING( 0x0008, DEF_STR( Yes ) ) @@ -1435,10 +1438,10 @@ static INPUT_PORTS_START( myangel2 ) PORT_DIPSETTING( 0x000a, DEF_STR( 1C_6C ) ) PORT_DIPSETTING( 0x0009, DEF_STR( 1C_7C ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) ) - PORT_DIPUNUSED_DIPLOC( 0x0010, 0x0010, "SW2:5" ) /* Listed as "Unused" */ - PORT_DIPUNUSED_DIPLOC( 0x0020, 0x0020, "SW2:6" ) /* Listed as "Unused" */ - PORT_DIPUNUSED_DIPLOC( 0x0040, 0x0040, "SW2:7" ) /* Listed as "Unused" */ - PORT_DIPUNUSED_DIPLOC( 0x0080, 0x0080, "SW2:8" ) /* Listed as "Unused" */ + PORT_DIPUNUSED_DIPLOC( 0x0010, 0x0010, "SW2:5" ) // Listed as "Unused" + PORT_DIPUNUSED_DIPLOC( 0x0020, 0x0020, "SW2:6" ) // Listed as "Unused" + PORT_DIPUNUSED_DIPLOC( 0x0040, 0x0040, "SW2:7" ) // Listed as "Unused" + PORT_DIPUNUSED_DIPLOC( 0x0080, 0x0080, "SW2:8" ) // Listed as "Unused" PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("P1") //$600000.w @@ -1500,7 +1503,7 @@ static INPUT_PORTS_START( pzlbowl ) PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) ) PORT_DIPNAME( 0x00c0, 0x00c0, "Winning Rounds (Player VS Player)" ) PORT_DIPLOCATION("SW1:7,8") PORT_DIPSETTING( 0x0040, "1" ) - PORT_DIPSETTING( 0x00c0, "2" ) /* This setting is not defined in the manual */ + PORT_DIPSETTING( 0x00c0, "2" ) // This setting is not defined in the manual PORT_DIPSETTING( 0x0080, "3" ) PORT_DIPSETTING( 0x0000, "5" ) PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) @@ -1510,14 +1513,14 @@ static INPUT_PORTS_START( pzlbowl ) PORT_DIPSETTING( 0x0005, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x0008, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x0004, DEF_STR( 3C_2C ) ) -// PORT_DIPSETTING( 0x0002, DEF_STR( 1C_1C ) ) /* This setting is not defined in the manual */ +// PORT_DIPSETTING( 0x0002, DEF_STR( 1C_1C ) ) // This setting is not defined in the manual PORT_DIPSETTING( 0x000f, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x0003, DEF_STR( 3C_4C ) ) PORT_DIPSETTING( 0x0007, DEF_STR( 2C_3C ) ) PORT_DIPSETTING( 0x000e, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x0006, DEF_STR( 2C_5C ) ) PORT_DIPSETTING( 0x000d, DEF_STR( 1C_3C ) ) -// PORT_DIPSETTING( 0x0001, DEF_STR( 1C_3C ) ) /* This setting is not defined in the manual */ +// PORT_DIPSETTING( 0x0001, DEF_STR( 1C_3C ) ) // This setting is not defined in the manual PORT_DIPSETTING( 0x000c, DEF_STR( 1C_4C ) ) PORT_DIPSETTING( 0x000b, DEF_STR( 1C_5C ) ) PORT_DIPSETTING( 0x000a, DEF_STR( 1C_6C ) ) @@ -1626,7 +1629,7 @@ static INPUT_PORTS_START( penbros ) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) - PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* Player 1 button 3 is unused */ + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) // Player 1 button 3 is unused PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) @@ -1637,7 +1640,7 @@ static INPUT_PORTS_START( penbros ) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) - PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* Player 2 button 3 is unused */ + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) // Player 2 button 3 is unused PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START2 ) PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) @@ -2003,7 +2006,7 @@ static INPUT_PORTS_START( trophyh ) PORT_INCLUDE(wschamp) PORT_MODIFY("DSW2") // fffd0a.w - PORT_DIPNAME( 0x0020, 0x0020, "Blood Color" ) PORT_DIPLOCATION("SW2:6") /* WSChamp doesn't use Blood Color, so add it back in */ + PORT_DIPNAME( 0x0020, 0x0020, "Blood Color" ) PORT_DIPLOCATION("SW2:6") // WSChamp doesn't use Blood Color, so add it back in PORT_DIPSETTING( 0x0020, "Red" ) PORT_DIPSETTING( 0x0000, "Yellow" ) INPUT_PORTS_END @@ -2012,7 +2015,7 @@ static INPUT_PORTS_START( trophyht ) PORT_INCLUDE(wschamp) PORT_MODIFY("DSW2") // fffd0a.w - PORT_DIPNAME( 0x0020, 0x0020, "Blood Color" ) PORT_DIPLOCATION("SW2:6") /* WSChamp doesn't use Blood Color, so add it back in */ + PORT_DIPNAME( 0x0020, 0x0020, "Blood Color" ) PORT_DIPLOCATION("SW2:6") // WSChamp doesn't use Blood Color, so add it back in PORT_DIPSETTING( 0x0020, "Red" ) PORT_DIPSETTING( 0x0000, "Yellow" ) PORT_DIPNAME( 0x0080, 0x0000, "Gun Type (Leave on Hand Gun)" ) PORT_DIPLOCATION("SW2:8") @@ -2231,7 +2234,6 @@ GFXDECODE_END void seta2_state::seta2(machine_config &config) { TMP68301(config, m_maincpu, XTAL(50'000'000)/3); // Verified on some PCBs - m_maincpu->set_addrmap(AS_PROGRAM, &seta2_state::mj4simai_map); WATCHDOG_TIMER(config, "watchdog"); @@ -2307,6 +2309,13 @@ void seta2_state::grdiansa(machine_config &config) } +void mj4simai_state::mj4simai(machine_config &config) +{ + seta2(config); + m_maincpu->set_addrmap(AS_PROGRAM, &mj4simai_state::mj4simai_map); +} + + void seta2_state::myangel(machine_config &config) { seta2(config); @@ -2387,7 +2396,7 @@ void staraudi_state::staraudi(machine_config &config) seta2(config); m_maincpu->set_addrmap(AS_PROGRAM, &staraudi_state::staraudi_map); - SHARP_LH28F016S_16BIT(config, "flash"); + SHARP_LH28F016S_16BIT(config, m_flash); UPD4992(config, m_rtc, 32'768); // video hardware @@ -2423,10 +2432,10 @@ TIMER_DEVICE_CALLBACK_MEMBER(funcube_state::funcube_interrupt) { int scanline = param; - if(scanline == 368) + if (scanline == 368) m_maincpu->set_input_line(1, HOLD_LINE); - if(scanline == 0) + if (scanline == 0) m_maincpu->set_input_line(2, HOLD_LINE); } @@ -2505,14 +2514,6 @@ void funcube_state::funcube2(machine_config &config) } -void funcube_state::funcube3(machine_config &config) -{ - funcube2(config); - // video hardware - m_screen->set_visarea(0x0, 0x140-1, 0x00, 0xf0-1); -} - - void seta2_state::namcostr(machine_config &config) { TMP68301(config, m_maincpu, XTAL(50'000'000)/3); // !! TMP68301 !! @@ -2946,7 +2947,7 @@ JP1 - JP4 single wire connections for power ***************************************************************************/ -ROM_START( grdians ) /* P-FG01-1 PCB */ +ROM_START( grdians ) // P-FG01-1 PCB ROM_REGION( 0x200000, "maincpu", 0 ) // TMP68301 Code ROM_LOAD16_BYTE( "u2.bin", 0x000000, 0x080000, CRC(36adc6f2) SHA1(544e87f88179fe1342e7a06a8948ac1828e85108) ) ROM_LOAD16_BYTE( "u3.bin", 0x000001, 0x080000, CRC(2704f416) SHA1(9081a12cbb9927d36e1c50b52aa2c6003810ee42) ) @@ -2971,7 +2972,7 @@ ROM_START( grdians ) /* P-FG01-1 PCB */ ROM_LOAD( "u32.bin", 0x000000, 0x100000, CRC(cf0f3017) SHA1(8376d3a674f71aec72f52c72758fbc53d9feb1a1) ) ROM_END -ROM_START( grdiansa ) /* P0-113A PCB */ +ROM_START( grdiansa ) // P0-113A PCB ROM_REGION( 0x200000, "maincpu", 0 ) // TMP68301 Code ROM_LOAD16_BYTE( "ka2_001_001.u2", 0x000000, 0x080000, CRC(36adc6f2) SHA1(544e87f88179fe1342e7a06a8948ac1828e85108) ) // same program code as P-FG01-1 PCB above ROM_LOAD16_BYTE( "ka2_001_004.u3", 0x000001, 0x080000, CRC(2704f416) SHA1(9081a12cbb9927d36e1c50b52aa2c6003810ee42) ) @@ -4082,10 +4083,10 @@ Trophy Hunting - Bear & Moose: CEEF E01 ***************************************************************************/ -ROM_START( deerhunt ) /* Deer Hunting USA V4.3 (11/1/2000) - The "E05" breaks version label conventions but is correct & verified */ +ROM_START( deerhunt ) // Deer Hunting USA V4.3 (11/1/2000) - The "E05" breaks version label conventions but is correct & verified ROM_REGION( 0x200000, "maincpu", 0 ) // TMP68301 Code - ROM_LOAD16_BYTE( "as0906_e05_u6_694e.u06", 0x000000, 0x100000, CRC(20c81f17) SHA1(d41d93d6ee88738cec55f7bf3ce6be1dbec68e09) ) /* checksum 694E printed on label */ - ROM_LOAD16_BYTE( "as0907_e05_u7_5d89.u07", 0x000001, 0x100000, CRC(1731aa2a) SHA1(cffae7a99a7f960a62ef0c4454884df17a93c1a6) ) /* checksum 5D89 printed on label */ + ROM_LOAD16_BYTE( "as0906_e05_u6_694e.u06", 0x000000, 0x100000, CRC(20c81f17) SHA1(d41d93d6ee88738cec55f7bf3ce6be1dbec68e09) ) // checksum 694E printed on label + ROM_LOAD16_BYTE( "as0907_e05_u7_5d89.u07", 0x000001, 0x100000, CRC(1731aa2a) SHA1(cffae7a99a7f960a62ef0c4454884df17a93c1a6) ) // checksum 5D89 printed on label ROM_REGION( 0x2000000, "sprites", 0 ) // Sprites ROM_LOAD64_WORD( "as0901m01.u38", 0x0000000, 0x800000, CRC(1d6acf8f) SHA1(6f61fe21bebb7c87e8e6c3ef3ba73b8cf327dde9) ) @@ -4097,10 +4098,10 @@ ROM_START( deerhunt ) /* Deer Hunting USA V4.3 (11/1/2000) - The "E05" breaks ve ROM_LOAD( "as0905m01.u18", 0x000000, 0x400000, CRC(8d8165bb) SHA1(aca7051613d260734ee787b4c3db552c336bd600) ) ROM_END -ROM_START( deerhunta ) /* Deer Hunting USA V4.2 (xx/x/2000) */ +ROM_START( deerhunta ) // Deer Hunting USA V4.2 (xx/x/2000) ROM_REGION( 0x200000, "maincpu", 0 ) // TMP68301 Code - ROM_LOAD16_BYTE( "as0906_e04_u6_6640.u06", 0x000000, 0x100000, CRC(bb3af36f) SHA1(f04071347e8ad361bf666fcb6c0136e522f19d47) ) /* checksum 6640 printed on label */ - ROM_LOAD16_BYTE( "as0907_e04_u7_595a.u07", 0x000001, 0x100000, CRC(83f02117) SHA1(70fc2291bc93af3902aae88688be6a8078f7a07e) ) /* checksum 595A printed on label */ + ROM_LOAD16_BYTE( "as0906_e04_u6_6640.u06", 0x000000, 0x100000, CRC(bb3af36f) SHA1(f04071347e8ad361bf666fcb6c0136e522f19d47) ) // checksum 6640 printed on label + ROM_LOAD16_BYTE( "as0907_e04_u7_595a.u07", 0x000001, 0x100000, CRC(83f02117) SHA1(70fc2291bc93af3902aae88688be6a8078f7a07e) ) // checksum 595A printed on label ROM_REGION( 0x2000000, "sprites", 0 ) // Sprites ROM_LOAD64_WORD( "as0901m01.u38", 0x0000000, 0x800000, CRC(1d6acf8f) SHA1(6f61fe21bebb7c87e8e6c3ef3ba73b8cf327dde9) ) @@ -4112,10 +4113,10 @@ ROM_START( deerhunta ) /* Deer Hunting USA V4.2 (xx/x/2000) */ ROM_LOAD( "as0905m01.u18", 0x000000, 0x400000, CRC(8d8165bb) SHA1(aca7051613d260734ee787b4c3db552c336bd600) ) ROM_END -ROM_START( deerhuntb ) /* Deer Hunting USA V4.0 (6/15/2000) */ +ROM_START( deerhuntb ) // Deer Hunting USA V4.0 (6/15/2000) ROM_REGION( 0x200000, "maincpu", 0 ) // TMP68301 Code - ROM_LOAD16_BYTE( "as_0906_e04.u06", 0x000000, 0x100000, CRC(07d9b64a) SHA1(f9aac644aab920bbac84b14836ee589ccd51f6db) ) /* also commonly labeled as: Deer Hunting USA U6 Ver 4.0 2000.6.15 - SUM16 = 7BBB */ - ROM_LOAD16_BYTE( "as_0907_e04.u07", 0x000001, 0x100000, CRC(19973d08) SHA1(da1cc02ce480a62ccaf94d0af1246a340f054b43) ) /* also commonly labeled as: Deer Hunting USA U7 Ver 4.0 2000.6.15 - SUM16 = 4C78 */ + ROM_LOAD16_BYTE( "as_0906_e04.u06", 0x000000, 0x100000, CRC(07d9b64a) SHA1(f9aac644aab920bbac84b14836ee589ccd51f6db) ) // also commonly labeled as: Deer Hunting USA U6 Ver 4.0 2000.6.15 - SUM16 = 7BBB + ROM_LOAD16_BYTE( "as_0907_e04.u07", 0x000001, 0x100000, CRC(19973d08) SHA1(da1cc02ce480a62ccaf94d0af1246a340f054b43) ) // also commonly labeled as: Deer Hunting USA U7 Ver 4.0 2000.6.15 - SUM16 = 4C78 ROM_REGION( 0x2000000, "sprites", 0 ) // Sprites ROM_LOAD64_WORD( "as0901m01.u38", 0x0000000, 0x800000, CRC(1d6acf8f) SHA1(6f61fe21bebb7c87e8e6c3ef3ba73b8cf327dde9) ) @@ -4127,12 +4128,12 @@ ROM_START( deerhuntb ) /* Deer Hunting USA V4.0 (6/15/2000) */ ROM_LOAD( "as0905m01.u18", 0x000000, 0x400000, CRC(8d8165bb) SHA1(aca7051613d260734ee787b4c3db552c336bd600) ) ROM_END - /* Are there versions 3.x of Deer Hunting USA with labels "AS0906 E03 U06" & "AS0907 E03 U07" ?? */ + // Are there versions 3.x of Deer Hunting USA with labels "AS0906 E03 U06" & "AS0907 E03 U07" ?? -ROM_START( deerhuntc ) /* These rom labels break label conventions but is correct & verified. Version in program code is listed as 0.00 */ +ROM_START( deerhuntc ) // These rom labels break label conventions but is correct & verified. Version in program code is listed as 0.00 ROM_REGION( 0x200000, "maincpu", 0 ) // TMP68301 Code - ROM_LOAD16_BYTE( "as_0937_e01.u06", 0x000000, 0x100000, CRC(8d74088e) SHA1(cb11ffaf4c0267cc8cbe01accc3daeed910a3af3) ) /* SUM16 = C2CD - same as version dated 2000.5.31? */ - ROM_LOAD16_BYTE( "as_0938_e01.u07", 0x000001, 0x100000, CRC(c7657889) SHA1(4cc707c8abbc0862457375a9a910d3c338859193) ) /* SUM16 = 27D7 - same as version dated 2000.5.31? */ + ROM_LOAD16_BYTE( "as_0937_e01.u06", 0x000000, 0x100000, CRC(8d74088e) SHA1(cb11ffaf4c0267cc8cbe01accc3daeed910a3af3) ) // SUM16 = C2CD - same as version dated 2000.5.31? + ROM_LOAD16_BYTE( "as_0938_e01.u07", 0x000001, 0x100000, CRC(c7657889) SHA1(4cc707c8abbc0862457375a9a910d3c338859193) ) // SUM16 = 27D7 - same as version dated 2000.5.31? ROM_REGION( 0x2000000, "sprites", 0 ) // Sprites ROM_LOAD64_WORD( "as0901m01.u38", 0x0000000, 0x800000, CRC(1d6acf8f) SHA1(6f61fe21bebb7c87e8e6c3ef3ba73b8cf327dde9) ) @@ -4144,10 +4145,10 @@ ROM_START( deerhuntc ) /* These rom labels break label conventions but is correc ROM_LOAD( "as0905m01.u18", 0x000000, 0x400000, CRC(8d8165bb) SHA1(aca7051613d260734ee787b4c3db552c336bd600) ) ROM_END -ROM_START( deerhuntd ) /* Deer Hunting USA V2.x - No version number is printed to screen but "E02" in EPROM label signifies V2 */ +ROM_START( deerhuntd ) // Deer Hunting USA V2.x - No version number is printed to screen but "E02" in EPROM label signifies V2 ROM_REGION( 0x200000, "maincpu", 0 ) // TMP68301 Code - ROM_LOAD16_BYTE( "as_0906_e02.u06", 0x000000, 0x100000, CRC(190cca42) SHA1(aef63f5e8c71ed0156b8b0104c5d23872c119167) ) /* Version in program code is listed as 0.00 */ - ROM_LOAD16_BYTE( "as_0907_e02.u07", 0x000001, 0x100000, CRC(9de2b901) SHA1(d271bc54c41e30c0d9962eedd22f3ef2b7b8c9e5) ) /* Verified with two different sets of chips */ + ROM_LOAD16_BYTE( "as_0906_e02.u06", 0x000000, 0x100000, CRC(190cca42) SHA1(aef63f5e8c71ed0156b8b0104c5d23872c119167) ) // Version in program code is listed as 0.00 + ROM_LOAD16_BYTE( "as_0907_e02.u07", 0x000001, 0x100000, CRC(9de2b901) SHA1(d271bc54c41e30c0d9962eedd22f3ef2b7b8c9e5) ) // Verified with two different sets of chips ROM_REGION( 0x2000000, "sprites", 0 ) // Sprites ROM_LOAD64_WORD( "as0901m01.u38", 0x0000000, 0x800000, CRC(1d6acf8f) SHA1(6f61fe21bebb7c87e8e6c3ef3ba73b8cf327dde9) ) @@ -4159,10 +4160,10 @@ ROM_START( deerhuntd ) /* Deer Hunting USA V2.x - No version number is printed t ROM_LOAD( "as0905m01.u18", 0x000000, 0x400000, CRC(8d8165bb) SHA1(aca7051613d260734ee787b4c3db552c336bd600) ) ROM_END -ROM_START( deerhunte ) /* Deer Hunting USA V1.x - No version number is printed to screen but "E01" in EPROM label signifies V1 */ +ROM_START( deerhunte ) // Deer Hunting USA V1.x - No version number is printed to screen but "E01" in EPROM label signifies V1 ROM_REGION( 0x200000, "maincpu", 0 ) // TMP68301 Code - ROM_LOAD16_BYTE( "as_0906_e01.u06", 0x000000, 0x100000, CRC(103e3ba3) SHA1(677d912ea9ed2ee1f26cdcac1687ce8ef416a96f) ) /* Version in program code is listed as 0.00 */ - ROM_LOAD16_BYTE( "as_0907_e01.u07", 0x000001, 0x100000, CRC(ddeb0f97) SHA1(a2578071f3506d69057d2256685b969adc50d275) ) /* Verified with two different sets of chips */ + ROM_LOAD16_BYTE( "as_0906_e01.u06", 0x000000, 0x100000, CRC(103e3ba3) SHA1(677d912ea9ed2ee1f26cdcac1687ce8ef416a96f) ) // Version in program code is listed as 0.00 + ROM_LOAD16_BYTE( "as_0907_e01.u07", 0x000001, 0x100000, CRC(ddeb0f97) SHA1(a2578071f3506d69057d2256685b969adc50d275) ) // Verified with two different sets of chips ROM_REGION( 0x2000000, "sprites", 0 ) // Sprites ROM_LOAD64_WORD( "as0901m01.u38", 0x0000000, 0x800000, CRC(1d6acf8f) SHA1(6f61fe21bebb7c87e8e6c3ef3ba73b8cf327dde9) ) @@ -4174,9 +4175,9 @@ ROM_START( deerhunte ) /* Deer Hunting USA V1.x - No version number is printed t ROM_LOAD( "as0905m01.u18", 0x000000, 0x400000, CRC(8d8165bb) SHA1(aca7051613d260734ee787b4c3db552c336bd600) ) ROM_END -ROM_START( deerhuntj ) /* Higher ROM labels indicate a specific version / region - No specific "For use in Japan" warning */ +ROM_START( deerhuntj ) // Higher ROM labels indicate a specific version / region - No specific "For use in Japan" warning ROM_REGION( 0x200000, "maincpu", 0 ) // TMP68301 Code - ROM_LOAD16_BYTE( "as0_908e01_u6_jdh.u06", 0x000000, 0x100000, CRC(52f037da) SHA1(72afb4461be059655a2fe9b138e9feef19ecaa84) ) /* Version shows as VER .4.4.1 */ + ROM_LOAD16_BYTE( "as0_908e01_u6_jdh.u06", 0x000000, 0x100000, CRC(52f037da) SHA1(72afb4461be059655a2fe9b138e9feef19ecaa84) ) // Version shows as VER .4.4.1 ROM_LOAD16_BYTE( "as0_909e01_u7_jdh.u07", 0x000001, 0x100000, CRC(b391bc87) SHA1(eb62e18b6ac9b0198911ec6684de73102c1d6df0) ) ROM_REGION( 0x2000000, "sprites", 0 ) // Sprites @@ -4189,10 +4190,10 @@ ROM_START( deerhuntj ) /* Higher ROM labels indicate a specific version / region ROM_LOAD( "as0905m01.u18", 0x000000, 0x400000, CRC(8d8165bb) SHA1(aca7051613d260734ee787b4c3db552c336bd600) ) ROM_END -ROM_START( turkhunt ) /* V1.0 is currently the only known version */ +ROM_START( turkhunt ) // V1.0 is currently the only known version ROM_REGION( 0x200000, "maincpu", 0 ) // TMP68301 Code - ROM_LOAD16_BYTE( "asx_906e01_th.u06", 0x000000, 0x100000, CRC(c96266e1) SHA1(0ca462b3b0f27198e36384eee6ea5c5d4e7e1293) ) /* also commonly labeled as: Turkey U6 Ver 1.00 E510 */ - ROM_LOAD16_BYTE( "asx_907e01_th.u07", 0x000001, 0x100000, CRC(7c67b502) SHA1(6a0e8883a115dac4095d86897e7eca2a007a1c71) ) /* also commonly labeled as: Turkey U7 Ver 1.00 AB40 */ + ROM_LOAD16_BYTE( "asx_906e01_th.u06", 0x000000, 0x100000, CRC(c96266e1) SHA1(0ca462b3b0f27198e36384eee6ea5c5d4e7e1293) ) // also commonly labeled as: Turkey U6 Ver 1.00 E510 + ROM_LOAD16_BYTE( "asx_907e01_th.u07", 0x000001, 0x100000, CRC(7c67b502) SHA1(6a0e8883a115dac4095d86897e7eca2a007a1c71) ) // also commonly labeled as: Turkey U7 Ver 1.00 AB40 ROM_REGION( 0x2000000, "sprites", 0 ) // Sprites ROM_LOAD64_WORD( "asx901m01.u38", 0x0000000, 0x800000, CRC(eabd3f44) SHA1(5a1ac986d11a8b019e18761cf4ea0a6f49fbdbfc) ) @@ -4204,10 +4205,10 @@ ROM_START( turkhunt ) /* V1.0 is currently the only known version */ ROM_LOAD( "asx905m01.u18", 0x000000, 0x400000, CRC(8d9dd9a9) SHA1(1fc2f3688d2c24c720dca7357bca6bf5f4016c53) ) ROM_END -ROM_START( wschamp ) /* Wing Shooting Championship V2.00 (01/23/2002) - The "E03" breaks version label conventions but is correct & verified */ +ROM_START( wschamp ) // Wing Shooting Championship V2.00 (01/23/2002) - The "E03" breaks version label conventions but is correct & verified ROM_REGION( 0x200000, "maincpu", 0 ) // TMP68301 Code - ROM_LOAD16_BYTE( "as_1006_e03.u06", 0x000000, 0x100000, CRC(0ad01677) SHA1(63e09b9f7cc8b781af1756f86caa0cc0962ae584) ) /* also commonly labeled as: WSC U6 Ver 2.00 421E */ - ROM_LOAD16_BYTE( "as_1007_e03.u07", 0x000001, 0x100000, CRC(572624f0) SHA1(0c2f67daa22f4edd66a2be990dc6cd999faff0fa) ) /* also commonly labeled as: WSC U7 Ver 2.00 A48F */ + ROM_LOAD16_BYTE( "as_1006_e03.u06", 0x000000, 0x100000, CRC(0ad01677) SHA1(63e09b9f7cc8b781af1756f86caa0cc0962ae584) ) // also commonly labeled as: WSC U6 Ver 2.00 421E + ROM_LOAD16_BYTE( "as_1007_e03.u07", 0x000001, 0x100000, CRC(572624f0) SHA1(0c2f67daa22f4edd66a2be990dc6cd999faff0fa) ) // also commonly labeled as: WSC U7 Ver 2.00 A48F ROM_REGION( 0x2000000, "sprites", 0 ) // Sprites ROM_LOAD64_WORD( "as1001m01.u38", 0x0000000, 0x800000, CRC(92595579) SHA1(75a7131aedb18b7103677340c3cca7c91aaca2bf) ) @@ -4219,10 +4220,10 @@ ROM_START( wschamp ) /* Wing Shooting Championship V2.00 (01/23/2002) - The "E03 ROM_LOAD( "as1005m01.u18", 0x000000, 0x400000, CRC(e4b137b8) SHA1(4d8d15073c51f7d383282cc5755ae5b2eab6226c) ) ROM_END -ROM_START( wschampa ) /* Wing Shooting Championship V1.01 */ +ROM_START( wschampa ) // Wing Shooting Championship V1.01 ROM_REGION( 0x200000, "maincpu", 0 ) // TMP68301 Code - ROM_LOAD16_BYTE( "as_1006_e02.u06", 0x000000, 0x100000, CRC(d3d3b2b5) SHA1(2d036d795b40a4ed78bb9f7751f875cfc76276a9) ) /* SUM16 = 31EF */ - ROM_LOAD16_BYTE( "as_1007_e02.u07", 0x000001, 0x100000, CRC(78ede6d9) SHA1(e6d10f52cd4c6bf97288df44911f23bb64fc012c) ) /* SUM16 = 615E */ + ROM_LOAD16_BYTE( "as_1006_e02.u06", 0x000000, 0x100000, CRC(d3d3b2b5) SHA1(2d036d795b40a4ed78bb9f7751f875cfc76276a9) ) // SUM16 = 31EF + ROM_LOAD16_BYTE( "as_1007_e02.u07", 0x000001, 0x100000, CRC(78ede6d9) SHA1(e6d10f52cd4c6bf97288df44911f23bb64fc012c) ) // SUM16 = 615E ROM_REGION( 0x2000000, "sprites", 0 ) // Sprites ROM_LOAD64_WORD( "as1001m01.u38", 0x0000000, 0x800000, CRC(92595579) SHA1(75a7131aedb18b7103677340c3cca7c91aaca2bf) ) @@ -4234,10 +4235,10 @@ ROM_START( wschampa ) /* Wing Shooting Championship V1.01 */ ROM_LOAD( "as1005m01.u18", 0x000000, 0x400000, CRC(e4b137b8) SHA1(4d8d15073c51f7d383282cc5755ae5b2eab6226c) ) ROM_END -ROM_START( wschampb ) /* Wing Shooting Championship V1.00, dumps match listed checksum but shows as "NG" on boot screen - need to verify correct at some point if possible */ +ROM_START( wschampb ) // Wing Shooting Championship V1.00, dumps match listed checksum but shows as "NG" on boot screen - need to verify correct at some point if possible ROM_REGION( 0x200000, "maincpu", 0 ) // TMP68301 Code - ROM_LOAD16_BYTE( "as10u6.u06", 0x000000, 0x100000, CRC(70a18bef) SHA1(3fb2e8a4db790dd732115d7d3d991b2d6c54feb9) ) /* checksum 3F38 & 10/26 16:00 hand written on label */ - ROM_LOAD16_BYTE( "as10u7.u07", 0x000001, 0x100000, CRC(cf23be7d) SHA1(b9130757466ff0d41d261b1c2435d36d2452df54) ) /* checksum 1537 & 10/26 16:00 hand written on label */ + ROM_LOAD16_BYTE( "as10u6.u06", 0x000000, 0x100000, CRC(70a18bef) SHA1(3fb2e8a4db790dd732115d7d3d991b2d6c54feb9) ) // checksum 3F38 & 10/26 16:00 hand written on label + ROM_LOAD16_BYTE( "as10u7.u07", 0x000001, 0x100000, CRC(cf23be7d) SHA1(b9130757466ff0d41d261b1c2435d36d2452df54) ) // checksum 1537 & 10/26 16:00 hand written on label ROM_REGION( 0x2000000, "sprites", 0 ) // Sprites ROM_LOAD64_WORD( "as1001m01.u38", 0x0000000, 0x800000, CRC(92595579) SHA1(75a7131aedb18b7103677340c3cca7c91aaca2bf) ) @@ -4249,10 +4250,10 @@ ROM_START( wschampb ) /* Wing Shooting Championship V1.00, dumps match listed ch ROM_LOAD( "as1005m01.u18", 0x000000, 0x400000, CRC(e4b137b8) SHA1(4d8d15073c51f7d383282cc5755ae5b2eab6226c) ) ROM_END -ROM_START( trophyh ) /* Version 1.00 - v: Thu Mar 28 12:35:50 2002 JST-9 - on a B0-010A PCB with all mask ROMs */ +ROM_START( trophyh ) // Version 1.00 - v: Thu Mar 28 12:35:50 2002 JST-9 - on a B0-010A PCB with all mask ROMs ROM_REGION( 0x200000, "maincpu", 0 ) // TMP68301 Code - ROM_LOAD16_BYTE( "as_1106_e01.u06", 0x000000, 0x100000, CRC(b4950882) SHA1(2749f7ffc5b543c9f39815f0913a1d1e385b63f4) ) /* also commonly labeled as: Trophy U6 Ver 1.00 D8DA */ - ROM_LOAD16_BYTE( "as_1107_e01.u07", 0x000001, 0x100000, CRC(19ee67cb) SHA1(e75ce66d3ff5aad46ba997c09d6514260e617f55) ) /* also commonly labeled as: Trophy U7 Ver 1.00 CEEF */ + ROM_LOAD16_BYTE( "as_1106_e01.u06", 0x000000, 0x100000, CRC(b4950882) SHA1(2749f7ffc5b543c9f39815f0913a1d1e385b63f4) ) // also commonly labeled as: Trophy U6 Ver 1.00 D8DA + ROM_LOAD16_BYTE( "as_1107_e01.u07", 0x000001, 0x100000, CRC(19ee67cb) SHA1(e75ce66d3ff5aad46ba997c09d6514260e617f55) ) // also commonly labeled as: Trophy U7 Ver 1.00 CEEF ROM_REGION( 0x2000000, "sprites", 0 ) // Sprites ROM_LOAD64_WORD( "as1101m01.u38", 0x0000000, 0x800000, CRC(855ed675) SHA1(84ce229a9feb6331413253a5aed10b362e8102e5) ) @@ -4264,14 +4265,14 @@ ROM_START( trophyh ) /* Version 1.00 - v: Thu Mar 28 12:35:50 2002 JST-9 - on a ROM_LOAD( "as1105m01.u18", 0x000000, 0x400000, CRC(633d0df8) SHA1(3401c424f5c207ef438a9269e0c0e7d482771fed) ) ROM_END -ROM_START( trophyht ) /* V1.00 Location Test - v: Tue Feb 26 18:18:43 2002 JST-9 - on a P0-145-1 main PCB with a P1-115A flash ROM board */ +ROM_START( trophyht ) // V1.00 Location Test - v: Tue Feb 26 18:18:43 2002 JST-9 - on a P0-145-1 main PCB with a P1-115A flash ROM board ROM_REGION( 0x200000, "maincpu", 0 ) // TMP68301 Code - ROM_LOAD16_BYTE( "trophy_2-26_u6_2e9c.u06", 0x000000, 0x100000, CRC(74496d65) SHA1(8af7bce528557efe68e0ed8be8b60d0ba4409c35) ) /* hand written label: Trophy 2/26 U6 2E9C */ - ROM_LOAD16_BYTE( "trophy_2-26_u6_de45.u07", 0x000001, 0x100000, CRC(9ae364f6) SHA1(9df8352345e59f1e0a5cb66a8b43d5ad7785ca29) ) /* hand written label: Trophy 2/26 U7 DE45 */ + ROM_LOAD16_BYTE( "trophy_2-26_u6_2e9c.u06", 0x000000, 0x100000, CRC(74496d65) SHA1(8af7bce528557efe68e0ed8be8b60d0ba4409c35) ) // hand written label: Trophy 2/26 U6 2E9C + ROM_LOAD16_BYTE( "trophy_2-26_u6_de45.u07", 0x000001, 0x100000, CRC(9ae364f6) SHA1(9df8352345e59f1e0a5cb66a8b43d5ad7785ca29) ) // hand written label: Trophy 2/26 U7 DE45 ROM_REGION( 0x2000000, "sprites", 0 ) // Sprites - ROM_LOAD( "lh28f016sat.u20", 0x0000000, 0x200000, NO_DUMP ) /* None of the 28F016 flash ROMs are dumped */ - ROM_LOAD( "lh28f016sat.u21", 0x0200000, 0x200000, NO_DUMP ) /* The correct loading order is unknown */ + ROM_LOAD( "lh28f016sat.u20", 0x0000000, 0x200000, NO_DUMP ) // None of the 28F016 flash ROMs are dumped + ROM_LOAD( "lh28f016sat.u21", 0x0200000, 0x200000, NO_DUMP ) // The correct loading order is unknown ROM_LOAD( "lh28f016sat.u22", 0x0400000, 0x200000, NO_DUMP ) ROM_LOAD( "lh28f016sat.u23", 0x0600000, 0x200000, NO_DUMP ) ROM_LOAD( "lh28f016sat.u24", 0x0800000, 0x200000, NO_DUMP ) @@ -4286,13 +4287,13 @@ ROM_START( trophyht ) /* V1.00 Location Test - v: Tue Feb 26 18:18:43 2002 JST-9 ROM_LOAD( "lh28f016sat.u33", 0x1a00000, 0x200000, NO_DUMP ) ROM_LOAD( "lh28f016sat.u34", 0x1c00000, 0x200000, NO_DUMP ) ROM_LOAD( "lh28f016sat.u35", 0x1e00000, 0x200000, NO_DUMP ) - ROM_LOAD64_WORD( "as1101m01.u38", 0x0000000, 0x800000, CRC(855ed675) SHA1(84ce229a9feb6331413253a5aed10b362e8102e5) ) /* Load these in until the flash ROMs are dumped */ - ROM_LOAD64_WORD( "as1102m01.u39", 0x0000002, 0x800000, CRC(d186d271) SHA1(3c54438b35adfab8be91df0a633270d6db49beef) ) /* Load these in until the flash ROMs are dumped */ - ROM_LOAD64_WORD( "as1103m01.u40", 0x0000004, 0x800000, CRC(adf8a54e) SHA1(bb28bf219d18082246f7964851a5c49b9c0ba7f5) ) /* Load these in until the flash ROMs are dumped */ - ROM_LOAD64_WORD( "as1104m01.u41", 0x0000006, 0x800000, CRC(387882e9) SHA1(0fdd0c77dabd1066c6f3bd64e357236a76f524ab) ) /* Load these in until the flash ROMs are dumped */ + ROM_LOAD64_WORD( "as1101m01.u38", 0x0000000, 0x800000, CRC(855ed675) SHA1(84ce229a9feb6331413253a5aed10b362e8102e5) ) // Load these in until the flash ROMs are dumped + ROM_LOAD64_WORD( "as1102m01.u39", 0x0000002, 0x800000, CRC(d186d271) SHA1(3c54438b35adfab8be91df0a633270d6db49beef) ) // Load these in until the flash ROMs are dumped + ROM_LOAD64_WORD( "as1103m01.u40", 0x0000004, 0x800000, CRC(adf8a54e) SHA1(bb28bf219d18082246f7964851a5c49b9c0ba7f5) ) // Load these in until the flash ROMs are dumped + ROM_LOAD64_WORD( "as1104m01.u41", 0x0000006, 0x800000, CRC(387882e9) SHA1(0fdd0c77dabd1066c6f3bd64e357236a76f524ab) ) // Load these in until the flash ROMs are dumped ROM_REGION( 0x400000, "x1snd", 0 ) // Samples - ROM_LOAD( "as1105m01.u18", 0x000000, 0x400000, CRC(633d0df8) SHA1(3401c424f5c207ef438a9269e0c0e7d482771fed) ) /* unlabeled 27C322 with same data as AS1105M01 mask ROM */ + ROM_LOAD( "as1105m01.u18", 0x000000, 0x400000, CRC(633d0df8) SHA1(3401c424f5c207ef438a9269e0c0e7d482771fed) ) // unlabeled 27C322 with same data as AS1105M01 mask ROM ROM_END /*************************************************************************** @@ -4402,7 +4403,7 @@ GAME( 1995, grdians, 0, grdians, grdians, seta2_state, empty_init, GAME( 1995, grdiansa, grdians, grdiansa, grdians, seta2_state, empty_init, ROT0, "Winkysoft (Banpresto license)", "Guardians / Denjin Makai II (P0-113A PCB)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_GRAPHICS ) GAME( 1998, grdiansbl, grdians, grdiansa, grdians, seta2_state, empty_init, ROT0, "bootleg (Intac Japan)", "Guardians / Denjin Makai II (bootleg)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_GRAPHICS ) -GAME( 1996, mj4simai, 0, seta2, mj4simai, mj4simai_state, empty_init, ROT0, "Maboroshi Ware", "Wakakusamonogatari Mahjong Yonshimai (Japan)", MACHINE_NO_COCKTAIL ) +GAME( 1996, mj4simai, 0, mj4simai, mj4simai, mj4simai_state, empty_init, ROT0, "Maboroshi Ware", "Wakakusamonogatari Mahjong Yonshimai (Japan)", MACHINE_NO_COCKTAIL ) GAME( 1996, myangel, 0, myangel, myangel, seta2_state, empty_init, ROT0, "MOSS / Namco", "Kosodate Quiz My Angel (Japan)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_GRAPHICS ) @@ -4446,7 +4447,7 @@ GAME( 2000, funcube, 0, funcube, funcube, funcube_state, init_funcub GAME( 2001, funcube2, 0, funcube2, funcube, funcube_state, init_funcube2, ROT0, "Namco", "Funcube 2 (v1.1)", MACHINE_NO_COCKTAIL ) -GAME( 2001, funcube3, 0, funcube3, funcube, funcube_state, init_funcube3, ROT0, "Namco", "Funcube 3 (v1.1)", MACHINE_NO_COCKTAIL ) +GAME( 2001, funcube3, 0, funcube2, funcube, funcube_state, init_funcube3, ROT0, "Namco", "Funcube 3 (v1.1)", MACHINE_NO_COCKTAIL ) GAME( 2001, funcube4, 0, funcube2, funcube, funcube_state, init_funcube2, ROT0, "Namco", "Funcube 4 (v1.0)", MACHINE_NO_COCKTAIL ) diff --git a/src/mame/seta/seta2.h b/src/mame/seta/seta2.h index de2671787d6..6cbc08a09e5 100644 --- a/src/mame/seta/seta2.h +++ b/src/mame/seta/seta2.h @@ -37,12 +37,12 @@ class seta2_state : public driver_device m_x1_bank(*this, "x1_bank_%u", 1U), m_spriteram(*this, "spriteram", 0x40000, ENDIANNESS_BIG), m_vregs(*this, "vregs", 0x40, ENDIANNESS_BIG), + + m_in_system(*this, "SYSTEM"), m_leds(*this, "led%u", 0U), m_lamps(*this, "lamp%u", 0U) { } - void seta2(machine_config &config); - void seta2_32m(machine_config &config); void grdians(machine_config &config); void grdiansa(machine_config &config); void myangel(machine_config &config); @@ -64,9 +64,6 @@ class seta2_state : public driver_device void grdians_lockout_w(uint8_t data); - uint16_t mj4simai_p1_r(); - uint16_t mj4simai_p2_r(); - uint16_t pzlbowl_protection_r(address_space &space); uint8_t pzlbowl_coins_r(); void pzlbowl_coin_counter_w(uint8_t data); @@ -88,8 +85,8 @@ class seta2_state : public driver_device uint16_t spriteram_r(offs_t offset); void spriteram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - int calculate_global_xoffset(int nozoom_fixedpalette_fixedposition); - int calculate_global_yoffset(int nozoom_fixedpalette_fixedposition); + int calculate_global_xoffset(bool nozoom_fixedpalette_fixedposition); + int calculate_global_yoffset(bool nozoom_fixedpalette_fixedposition); void draw_sprites_line(bitmap_ind16 &bitmap, const rectangle &cliprect, int scanline, int realscanline, int xoffset, uint32_t xzoom, bool xzoominverted); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); @@ -101,7 +98,6 @@ class seta2_state : public driver_device void ablastb_map(address_map &map); void grdians_map(address_map &map); void gundamex_map(address_map &map); - void mj4simai_map(address_map &map); void myangel2_map(address_map &map); void myangel_map(address_map &map); void namcostr_map(address_map &map); @@ -113,6 +109,9 @@ class seta2_state : public driver_device void telpacfl_map(address_map &map); void x1_map(address_map &map); + void seta2(machine_config &config); + void seta2_32m(machine_config &config); + required_device m_maincpu; optional_device m_sub; required_device m_gfxdecode; @@ -127,57 +126,70 @@ class seta2_state : public driver_device optional_memory_bank_array<8> m_x1_bank; memory_share_creator m_spriteram; memory_share_creator m_vregs; + optional_ioport m_in_system; output_finder<7> m_leds; output_finder<11> m_lamps; - int m_keyboard_row; std::unique_ptr m_private_spriteram; private: - void drawgfx_line(bitmap_ind16 &bitmap, const rectangle &cliprect, int gfx, const uint8_t* const addr, const uint32_t realcolor, int flipx, int flipy, int base_sx, uint32_t xzoom, int shadow, int screenline, int line, int opaque); - inline void get_tile(uint16_t* spriteram, int is_16x16, int x, int y, int page, int& code, int& attr, int& flipx, int& flipy, int& color); + void drawgfx_line(bitmap_ind16 &bitmap, const rectangle &cliprect, int gfx, uint8_t const *const addr, uint32_t realcolor, bool flipx, bool flipy, int base_sx, uint32_t xzoom, bool shadow, int screenline, int line, bool opaque); + inline void get_tile(uint16_t const *spriteram, bool is_16x16, int x, int y, int page, int &code, int &attr, bool &flipx, bool &flipy, int &color); + + TIMER_CALLBACK_MEMBER(raster_timer_done); std::unique_ptr m_realtilenumber; gfx_element *m_spritegfx; - uint16_t m_rasterposition; - uint16_t m_rasterenabled; - TIMER_CALLBACK_MEMBER(raster_timer_done); - emu_timer *m_raster_timer; + uint16_t m_rasterposition = 0; + uint16_t m_rasterenabled = 0; + emu_timer *m_raster_timer = nullptr; }; class mj4simai_state : public seta2_state { public: - mj4simai_state(const machine_config &mconfig, device_type type, const char *tag) - : seta2_state(mconfig, type, tag) + mj4simai_state(const machine_config &mconfig, device_type type, const char *tag) : + seta2_state(mconfig, type, tag), + m_keys{ { *this, "P1_KEY%u", 0U }, { *this, "P2_KEY%u", 0U } } { } + void mj4simai(machine_config &config); + protected: virtual void machine_start() override; + +private: + template uint16_t mj4simai_key_r(); + + void mj4simai_map(address_map &map); + + required_ioport_array<5> m_keys[2]; + + uint8_t m_keyboard_row = 0; }; class funcube_state : public seta2_state { public: - funcube_state(const machine_config &mconfig, device_type type, const char *tag) - : seta2_state(mconfig, type, tag) - , m_nvram(*this, "nvram", 0x180, ENDIANNESS_BIG) + funcube_state(const machine_config &mconfig, device_type type, const char *tag) : + seta2_state(mconfig, type, tag), + m_nvram(*this, "nvram", 0x180, ENDIANNESS_BIG), + m_in_debug(*this, "DEBUG"), + m_in_switch(*this, "SWITCH"), + m_in_battery(*this, "BATTERY") { } void funcube(machine_config &config); - void funcube3(machine_config &config); void funcube2(machine_config &config); - void init_funcube3(); void init_funcube(); void init_funcube2(); + void init_funcube3(); private: - memory_share_creator m_nvram; - virtual void machine_start() override; virtual void machine_reset() override; @@ -199,7 +211,13 @@ class funcube_state : public seta2_state void funcube_debug_outputs(); - uint8_t m_outputs, m_funcube_leds; + memory_share_creator m_nvram; + + required_ioport m_in_debug; + required_ioport m_in_switch; + required_ioport m_in_battery; + + uint8_t m_outputs = 0, m_funcube_leds = 0; uint64_t m_coin_start_cycles = 0; uint8_t m_hopper_motor = 0; }; diff --git a/src/mame/seta/seta2_v.cpp b/src/mame/seta/seta2_v.cpp index 7e6ae1e6509..59c5927adb0 100644 --- a/src/mame/seta/seta2_v.cpp +++ b/src/mame/seta/seta2_v.cpp @@ -89,6 +89,22 @@ #include "emu.h" #include "seta2.h" +#define LOG_VREG (1U << 1) +#define LOG_VIDEO (1U << 2) +#define LOG_SPRITE (1U << 3) +#define LOG_OFFSET (1U << 4) + +#define LOG_ALL (LOG_IO) + +#define VERBOSE (0) +#include "logmacro.h" + +#define LOGVREG(...) LOGMASKED(LOG_VREG, __VA_ARGS__) +#define LOGVIDEO(...) LOGMASKED(LOG_VIDEO, __VA_ARGS__) +#define LOGSPRITE(...) LOGMASKED(LOG_SPRITE, __VA_ARGS__) +#define LOGOFFSET(...) LOGMASKED(LOG_OFFSET, __VA_ARGS__) + + /*************************************************************************** Video Registers @@ -170,35 +186,34 @@ void seta2_state::vregs_w(offs_t offset, uint16_t data, uint16_t mem_mask) grdians = 019a */ - uint16_t olddata = m_vregs[offset]; + const uint16_t olddata = m_vregs[offset]; COMBINE_DATA(&m_vregs[offset]); - if (m_vregs[offset] != olddata) - logerror("CPU #0 PC %06X: Video Reg %02X <- %04X\n", m_maincpu->pc(), offset * 2, data); + LOGVREG("CPU #0 PC %06X: Video Reg %02X <- %04X\n", m_maincpu->pc(), offset * 2, data); switch (offset * 2) { case 0x1a: - logerror("%s: Register 1a write (vertical offset?) %04X (%04x)\n", machine().describe_context(), data, mem_mask); + LOGVREG("%s: Register 1a write (vertical offset?) %04X (%04x)\n", machine().describe_context(), data, mem_mask); break; case 0x1c: // FLIP SCREEN (myangel) <- this is actually zoom - flip_screen_set(data & 1); - if (data & ~1) logerror("CPU #0 PC %06X: flip screen unknown bits %04X\n", m_maincpu->pc(), data); + flip_screen_set(BIT(data, 0)); + if (data & ~1) LOGVREG("CPU #0 PC %06X: flip screen unknown bits %04X\n", m_maincpu->pc(), data); break; case 0x2a: // FLIP X (pzlbowl) - flip_screen_x_set(data & 1); - if (data & ~1) logerror("CPU #0 PC %06X: flipx unknown bits %04X\n", m_maincpu->pc(), data); + flip_screen_x_set(BIT(data, 0)); + if (data & ~1) LOGVREG("CPU #0 PC %06X: flipx unknown bits %04X\n", m_maincpu->pc(), data); break; case 0x2c: // FLIP Y (pzlbowl) - flip_screen_y_set(data & 1); - if (data & ~1) logerror("CPU #0 PC %06X: flipy unknown bits %04X\n", m_maincpu->pc(), data); + flip_screen_y_set(BIT(data, 0)); + if (data & ~1) LOGVREG("CPU #0 PC %06X: flipy unknown bits %04X\n", m_maincpu->pc(), data); break; case 0x30: // BLANK SCREEN (pzlbowl, myangel) - if (data & ~1) logerror("CPU #0 PC %06X: blank unknown bits %04X\n", m_maincpu->pc(), data); + if (data & ~1) LOGVREG("CPU #0 PC %06X: blank unknown bits %04X\n", m_maincpu->pc(), data); break; case 0x24: // funcube3 and staraudi write here instead, why? mirror or different meaning? @@ -218,12 +233,12 @@ void seta2_state::vregs_w(offs_t offset, uint16_t data, uint16_t mem_mask) m_private_spriteram[i + 1] = m_spriteram[(0x3000 / 2) + i + 1]; m_private_spriteram[i + 2] = m_spriteram[(0x3000 / 2) + i + 2]; - int sprite = m_spriteram[(0x3000 / 2) + i + 3]; + const int sprite = m_spriteram[(0x3000 / 2) + i + 3]; m_private_spriteram[i + 3] = ((current_sprite_entry / 4) & 0x7fff) | (sprite & 0x8000); - int list2addr = (sprite & 0x7fff) * 4; + const int list2addr = (sprite & 0x7fff) * 4; - num &=0xff; + num &= 0xff; for (int j = 0; j <= num; j++) { @@ -237,14 +252,12 @@ void seta2_state::vregs_w(offs_t offset, uint16_t data, uint16_t mem_mask) } } - if (m_private_spriteram[i + 0] & 0x8000) // end of list marker, mj4simai must draw the sprite this covers for the company logo, title screen etc. + if (BIT(m_private_spriteram[i + 0], 15)) // end of list marker, mj4simai must draw the sprite this covers for the company logo, title screen etc. { // HACK: however penbros has a dummy sprite entry there which points to 0x0000 as the tile source, and causes garbage with the rearranged format, // so change it to something that's invalid where we can filter it later. This strongly indicates that the current approach is incorrect however. if (sprite == 0x00) - { m_private_spriteram[i + 3] |= 0x4000; - } break; } @@ -254,24 +267,24 @@ void seta2_state::vregs_w(offs_t offset, uint16_t data, uint16_t mem_mask) break; case 0x3c: // Raster IRQ related - //logerror("%s: Register 3c write (raster enable?) current vpos is %d : %04X (%04x)\n",machine().describe_context(),m_screen->vpos(), data, mem_mask); + //LOGVREG("%s: Register 3c write (raster enable?) current vpos is %d : %04X (%04x)\n",machine().describe_context(),m_screen->vpos(), data, mem_mask); COMBINE_DATA(&m_rasterenabled); - //if (m_rasterenabled & 1) + //if (BIT(m_rasterenabled, 0)) { int hpos = 0; - int vpos = m_rasterposition; + const int vpos = m_rasterposition; // in the vblank it specifies line 0, the first raster interrupt then specifies line 0 again before the subsequent ones use the real line numbers? // It seems more likely that the raster IRQ stays asserted for the entire line, thus triggering a second interrupt unless the line number is changed? if (m_rasterposition == m_screen->vpos()) hpos = m_screen->hpos() + 0x100; - //logerror("setting raster to %d %d\n", vpos, hpos); + //LOGVREG("setting raster to %d %d\n", vpos, hpos); m_raster_timer->adjust(m_screen->time_until_pos(vpos, hpos), 0); } break; case 0x3e: // Raster IRQ related - //logerror("%s: Register 3e write (raster position?) %04X (%04x)\n",machine().describe_context(),data, mem_mask); + //LOGVREG("%s: Register 3e write (raster position?) %04X (%04x)\n",machine().describe_context(),data, mem_mask); COMBINE_DATA(&m_rasterposition); break; } @@ -295,7 +308,20 @@ void seta2_state::spriteram_w(offs_t offset, uint16_t data, uint16_t mem_mask) ***************************************************************************/ -inline void seta2_state::drawgfx_line(bitmap_ind16& bitmap, const rectangle& cliprect, int which_gfx, const uint8_t* const addr, const uint32_t realcolor, int flipx, int flipy, int base_sx, uint32_t xzoom, int use_shadow, int screenline, int line, int opaque) +inline void seta2_state::drawgfx_line( + bitmap_ind16 &bitmap, + const rectangle &cliprect, + int which_gfx, + uint8_t const *const addr, + uint32_t realcolor, + bool flipx, + bool flipy, + int base_sx, + uint32_t xzoom, + bool use_shadow, + int screenline, + int line, + bool opaque) { struct drawmodes { @@ -317,21 +343,21 @@ inline void seta2_state::drawgfx_line(bitmap_ind16& bitmap, const rectangle& cli }; int shadow = BPP_MASK_TABLE[(which_gfx & 0x0700) >> 8].shadow; - int gfx_mask = BPP_MASK_TABLE[(which_gfx & 0x0700) >> 8].gfx_mask; - int gfx_shift = BPP_MASK_TABLE[(which_gfx & 0x0700) >> 8].gfx_shift; + const int gfx_mask = BPP_MASK_TABLE[(which_gfx & 0x0700) >> 8].gfx_mask; + const int gfx_shift = BPP_MASK_TABLE[(which_gfx & 0x0700) >> 8].gfx_shift; if (!use_shadow) shadow = 0; uint16_t *const dest = &bitmap.pix(screenline); - int minx = cliprect.min_x << 16; - int maxx = (cliprect.max_x + 1) << 16; + const int minx = cliprect.min_x << 16; + const int maxx = (cliprect.max_x + 1) << 16; if (xzoom < 0x10000) // shrink { - int x0 = flipx ? (base_sx + (8 * xzoom) - xzoom) : (base_sx); - int x1 = flipx ? (base_sx - xzoom) : (x0 + (8 * xzoom)); + const int x0 = flipx ? (base_sx + (8 * xzoom) - xzoom) : (base_sx); + const int x1 = flipx ? (base_sx - xzoom) : (x0 + (8 * xzoom)); const int dx = flipx ? (-xzoom) : (xzoom); const uint8_t* const source = flipy ? addr + (7 - line) * 8 : addr + line * 8; @@ -339,23 +365,20 @@ inline void seta2_state::drawgfx_line(bitmap_ind16& bitmap, const rectangle& cli for (int sx = x0; sx != x1; sx += dx) { - uint8_t pen = (source[column++] & gfx_mask) >> gfx_shift; - + const uint8_t pen = (source[column++] & gfx_mask) >> gfx_shift; if (sx >= minx && sx < maxx) { - int realsx = sx >> 16; + const int realsx = sx >> 16; if (pen || opaque) { if (!shadow) - { dest[realsx] = (realcolor + pen) & 0x7fff; - } else { - int pen_shift = 15 - shadow; - int pen_mask = (1 << pen_shift) - 1; + const int pen_shift = 15 - shadow; + const int pen_mask = (1 << pen_shift) - 1; dest[realsx] = ((dest[realsx] & pen_mask) | (pen << pen_shift)) & 0x7fff; } } @@ -366,27 +389,23 @@ inline void seta2_state::drawgfx_line(bitmap_ind16& bitmap, const rectangle& cli { const uint8_t* const source = flipy ? addr + (7 - line) * 8 : addr + line * 8; - int x0 = (base_sx); - int x1 = (x0 + (8 * xzoom)); + const int x0 = (base_sx); + const int x1 = (x0 + (8 * xzoom)); int column; if (!flipx) - { column = 0; - } else - { column = 7; - } uint32_t countx = 0; for (int sx = x0; sx < x1; sx += 0x10000) { - uint8_t pen = (source[column] & gfx_mask) >> gfx_shift; + const uint8_t pen = (source[column] & gfx_mask) >> gfx_shift; if (sx >= minx && sx < maxx) { - int realsx = sx >> 16; + const int realsx = sx >> 16; if (pen || opaque) { @@ -396,8 +415,8 @@ inline void seta2_state::drawgfx_line(bitmap_ind16& bitmap, const rectangle& cli } else { - int pen_shift = 15 - shadow; - int pen_mask = (1 << pen_shift) - 1; + const int pen_shift = 15 - shadow; + const int pen_mask = (1 << pen_shift) - 1; dest[realsx] = ((dest[realsx] & pen_mask) | (pen << pen_shift)) & 0x7fff; } } @@ -407,13 +426,9 @@ inline void seta2_state::drawgfx_line(bitmap_ind16& bitmap, const rectangle& cli if (countx >= xzoom) { if (!flipx) - { column++; - } else - { column--; - } countx -= xzoom; } @@ -423,19 +438,29 @@ inline void seta2_state::drawgfx_line(bitmap_ind16& bitmap, const rectangle& cli // takes an x/y pixel position in the virtual tilemap and returns the code + attributes etc. for it -inline void seta2_state::get_tile(uint16_t* spriteram, int is_16x16, int x, int y, int page, int& code, int& attr, int& flipx, int& flipy, int& color) +inline void seta2_state::get_tile( + uint16_t const *const spriteram, + bool is_16x16, + int x, + int y, + int page, + int &code, + int &attr, + bool &flipx, + bool &flipy, + int &color) { - int xtile = x >> (is_16x16 ? 4 : 3); + const int xtile = x >> (is_16x16 ? 4 : 3); int ytile = y >> (is_16x16 ? 4 : 3); // yes the tilemap in RAM is flipped?! ytile ^= 0x1f; - uint16_t *s3 = &spriteram[2 * ((page * 0x2000 / 4) + ((ytile & 0x1f) << 6) + ((xtile) & 0x03f))]; + uint16_t const *const s3 = &spriteram[2 * ((page * 0x2000 / 4) + ((ytile & 0x1f) << 6) + (xtile & 0x03f))]; attr = s3[0]; code = s3[1] + ((attr & 0x0007) << 16); - flipx = (attr & 0x0010); - flipy = (attr & 0x0008); + flipx = BIT(attr, 4); + flipy = BIT(attr, 3); color = (attr & 0xffe0) >> 5; if (is_16x16) { @@ -443,37 +468,29 @@ inline void seta2_state::get_tile(uint16_t* spriteram, int is_16x16, int x, int if (!flipx) { - if (x & 8) - { + if (BIT(x, 3)) code += 1; - } } else { - if (!(x & 8)) - { + if (BIT(~x, 3)) code += 1; - } } if (!flipy) { - if (y & 8) - { + if (BIT(y, 3)) code += 2; - } } else { - if (!(y & 8)) - { + if (BIT(~y, 3)) code += 2; - } } } } -int seta2_state::calculate_global_xoffset(int nozoom_fixedpalette_fixedposition) +int seta2_state::calculate_global_xoffset(bool nozoom_fixedpalette_fixedposition) { /* int global_xoffset = (m_vregs[0x12/2] & 0x7ff); // and 0x10/2 for low bits @@ -501,7 +518,7 @@ int seta2_state::calculate_global_xoffset(int nozoom_fixedpalette_fixedposition) return global_xoffset; } -int seta2_state::calculate_global_yoffset(int nozoom_fixedpalette_fixedposition) +int seta2_state::calculate_global_yoffset(bool nozoom_fixedpalette_fixedposition) { // Sprites list //int global_yoffset = (m_vregs[0x1a / 2] & 0x7ff); // and 0x18/2 for low bits @@ -520,51 +537,46 @@ int seta2_state::calculate_global_yoffset(int nozoom_fixedpalette_fixedposition) void seta2_state::draw_sprites_line(bitmap_ind16 &bitmap, const rectangle &cliprect, int scanline, int realscanline, int xoffset, uint32_t xzoom, bool xzoominverted) { - uint16_t* spriteram = m_spriteram; - - uint16_t *s1 = m_private_spriteram.get(); + const uint16_t *s1 = m_private_spriteram.get(); int sprite_debug_count = 0; - for (; s1 < &m_private_spriteram[0x1000 / 2]; s1 += 4,sprite_debug_count++) + for (; s1 < &m_private_spriteram[0x1000 / 2]; s1 += 4, sprite_debug_count++) { int num = s1[0]; int xoffs = s1[1]; int yoffs = s1[2]; - int sprite = s1[3]; + const int sprite = s1[3]; // Single-sprite address - uint16_t *s2 = &spriteram[(sprite & 0x7fff) * 4]; - uint16_t *end = &spriteram[m_spriteram.bytes() / 2]; + uint16_t const *s2 = &m_spriteram[(sprite & 0x7fff) * 4]; + uint16_t const *const end = &m_spriteram[m_spriteram.bytes() / 2]; // Single-sprite size - int global_sizex = xoffs & 0xfc00; - int global_sizey = yoffs & 0xfc00; - - - int nozoom_fixedpalette_fixedposition = num & 0x4000; // ignore various things including global offsets, zoom. different palette selection too? - bool opaque = num & 0x2000; - int use_global_size = num & 0x1000; - int use_shadow = num & 0x0800; - int which_gfx = num & 0x0700; + const int global_sizex = xoffs & 0xfc00; + const int global_sizey = yoffs & 0xfc00; + + const bool nozoom_fixedpalette_fixedposition = BIT(num, 14); // ignore various things including global offsets, zoom. different palette selection too? + const bool opaque = BIT(num, 13); + const bool use_global_size = BIT(num, 12); + bool use_shadow = BIT(num, 11); + const int which_gfx = num & 0x0700; xoffs &= 0x3ff; yoffs &= 0x3ff; - - if (yoffs & 0x200) yoffs -= 0x400; - int global_xoffset = calculate_global_xoffset(nozoom_fixedpalette_fixedposition); - int global_yoffset = calculate_global_yoffset(nozoom_fixedpalette_fixedposition); + const int global_xoffset = calculate_global_xoffset(nozoom_fixedpalette_fixedposition); + const int global_yoffset = calculate_global_yoffset(nozoom_fixedpalette_fixedposition); int usedscanline; int usedxoffset; uint32_t usedxzoom; if (nozoom_fixedpalette_fixedposition) { - use_shadow = 0; + use_shadow = false; //which_gfx = 4 << 8; usedscanline = realscanline; // no zooming? usedxzoom = 0x10000; @@ -581,15 +593,14 @@ void seta2_state::draw_sprites_line(bitmap_ind16 &bitmap, const rectangle &clipr num = (num & 0x00ff) + 1; // all sprites, except invalid ones should have a pointer <0x3000 in the reformatted list - if ((sprite&0x7fff) < 0x3000 / 2 / 4) + if ((sprite & 0x7fff) < 0x3000 / 2 / 4) { for (; num > 0; num--, s2 += 4) { if (s2 >= end) break; - if (sprite & 0x8000) + if (BIT(sprite, 15)) { - // "floating tilemap" sprite // the 'floating tilemap sprites' are just a window into the tilemap, the position of the sprite does not change the scroll values @@ -600,7 +611,7 @@ void seta2_state::draw_sprites_line(bitmap_ind16 &bitmap, const rectangle &clipr if (sy & 0x200) sy -= 0x400; - int local_sizey = s2[1] & 0xfc00; + const int local_sizey = s2[1] & 0xfc00; int height = use_global_size ? global_sizey : local_sizey; height = ((height & 0xfc00) >> 10) + 1; @@ -631,7 +642,7 @@ void seta2_state::draw_sprites_line(bitmap_ind16 &bitmap, const rectangle &clipr // get everything we need to calculate if sprite is actually within the x co-ordinates of the screen int sx = s2[0]; - int local_sizex = sx & 0xfc00; + const int local_sizex = sx & 0xfc00; sx &= 0x3ff; sx -= global_xoffset; @@ -642,43 +653,54 @@ void seta2_state::draw_sprites_line(bitmap_ind16 &bitmap, const rectangle &clipr int firstcolumn = (sx + xoffs); firstcolumn = (firstcolumn & 0x1ff) - (firstcolumn & 0x200); - int lastcolumn = firstcolumn + width * 0x10 - 1; + const int lastcolumn = firstcolumn + width * 0x10 - 1; // if the sprite isn't within the x-coordinates of the screen, bail if (firstcolumn > cliprect.max_x) continue; if (lastcolumn < cliprect.min_x) continue; - // otherwise get the rest of the things we need to draw int scrolly = s2[3]; scrolly &= 0x1ff; scrolly += global_yoffset; - int sourceline = (usedscanline - scrolly) & 0x1ff; + const int sourceline = (usedscanline - scrolly) & 0x1ff; int scrollx = s2[2]; - int is_16x16 = (scrollx & 0x8000) >> 15; - int page = (scrollx & 0x7c00) >> 10; + const bool is_16x16 = BIT(scrollx, 15); + const int page = (scrollx & 0x7c00) >> 10; scrollx &= 0x3ff; // we treat 16x16 tiles as 4 8x8 tiles, so while the tilemap is 0x40 tiles wide in memory, that becomes 0x80 tiles in 16x16 mode, with the data wrapping in 8x8 mode for (int x = 0; x < 0x80; x++) { - int code, attr, flipx, flipy, color; + int code, attr, color; + bool flipx, flipy; // tilemap data is NOT buffered? - get_tile(spriteram, is_16x16, x * 8, sourceline, page, code, attr, flipx, flipy, color); + get_tile( + m_spriteram, is_16x16, x * 8, sourceline, page, + code, attr, flipx, flipy, color); - int tileline = sourceline & 0x07; - int dx = sx + (scrollx & 0x3ff) + xoffs + 0x10; - int px = (((dx + x * 8) + 0x10) & 0x3ff) - 0x10; + const int tileline = sourceline & 0x07; + const int dx = sx + (scrollx & 0x3ff) + xoffs + 0x10; + const int px = (((dx + x * 8) + 0x10) & 0x3ff) - 0x10; int dst_x = px & 0x3ff; dst_x = (dst_x & 0x1ff) - (dst_x & 0x200); if ((dst_x >= firstcolumn - 8) && (dst_x <= lastcolumn)) // reelnquak reels are heavily glitched without this check { uint32_t realsx = dst_x; - realsx -= usedxoffset>>16; // need to refactor, this causes loss of lower 16 bits of offset which are important in zoomed cases for precision + realsx -= usedxoffset >> 16; // need to refactor, this causes loss of lower 16 bits of offset which are important in zoomed cases for precision realsx = realsx * usedxzoom; - drawgfx_line(bitmap, cliprect, which_gfx, m_spritegfx->get_data(m_realtilenumber[code]), color << 4, flipx, flipy, realsx, usedxzoom, use_shadow, realscanline, tileline, opaque); + drawgfx_line( + bitmap, cliprect, + which_gfx, + m_spritegfx->get_data(m_realtilenumber[code]), + color << 4, + flipx, flipy, + realsx, + usedxzoom, use_shadow, + realscanline, tileline, + opaque); } } } @@ -693,10 +715,9 @@ void seta2_state::draw_sprites_line(bitmap_ind16 &bitmap, const rectangle &clipr sy += global_yoffset; sy &= 0x3ff; - if (realscanline == 128) { - // printf("%04x %02x %d %d\n", sprite_debug_count, num, yoffs, sy); + //LOGSPRITE("%04x %02x %d %d\n", sprite_debug_count, num, yoffs, sy); } int sizey = use_global_size ? global_sizey : s2[1] & 0xfc00; @@ -715,12 +736,11 @@ void seta2_state::draw_sprites_line(bitmap_ind16 &bitmap, const rectangle &clipr if (endline & 0x200) endline -= 0x400; - // if the sprite doesn't cover this scanline, bail now if (endline >= firstline) { - if (firstline > usedscanline) continue; - if (endline < usedscanline) continue; + if ((firstline > usedscanline) || (endline < usedscanline)) + continue; } else { @@ -730,10 +750,10 @@ void seta2_state::draw_sprites_line(bitmap_ind16 &bitmap, const rectangle &clipr } // otherwise get the rest of the things we need to draw - int attr = s2[2]; + const int attr = s2[2]; int code = s2[3] + ((attr & 0x0007) << 16); - int flipx = (attr & 0x0010); - int flipy = (attr & 0x0008); + const bool flipx = BIT(attr, 4); + const bool flipy = BIT(attr, 3); int color = (attr & 0xffe0) >> 5; int sx = s2[0]; @@ -744,11 +764,10 @@ void seta2_state::draw_sprites_line(bitmap_ind16 &bitmap, const rectangle &clipr sx = (sx & 0x1ff) - (sx & 0x200); sx -= global_xoffset; - int basecode = code &= ~((sizex + 1) * (sizey + 1) - 1); // see myangel, myangel2 and grdians - + const int basecode = code &= ~((sizex + 1) * (sizey + 1) - 1); // see myangel, myangel2 and grdians int line = usedscanline - firstline; - int y = (line >> 3); + const int y = (line >> 3); line &= 0x7; if (nozoom_fixedpalette_fixedposition) @@ -759,17 +778,26 @@ void seta2_state::draw_sprites_line(bitmap_ind16 &bitmap, const rectangle &clipr for (int x = 0; x <= sizex; x++) { - int realcode = (basecode + (flipy ? sizey - y : y)*(sizex + 1)) + (flipx ? sizex - x : x); + const int realcode = (basecode + (flipy ? sizey - y : y)*(sizex + 1)) + (flipx ? sizex - x : x); uint32_t realsx = (sx + x * 8); - realsx -= usedxoffset>>16; // need to refactor, this causes loss of lower 16 bits of offset which are important in zoomed cases for precision + realsx -= usedxoffset >> 16; // need to refactor, this causes loss of lower 16 bits of offset which are important in zoomed cases for precision realsx = realsx * usedxzoom; - drawgfx_line(bitmap, cliprect, which_gfx, m_spritegfx->get_data(m_realtilenumber[realcode]), color << 4, flipx, flipy, realsx, usedxzoom, use_shadow, realscanline, line, opaque); + drawgfx_line( + bitmap, cliprect, + which_gfx, + m_spritegfx->get_data(m_realtilenumber[realcode]), + color << 4, + flipx, flipy, + realsx, + usedxzoom, use_shadow, + realscanline, line, + opaque); } } } } - if (s1[0] & 0x8000) break; // end of list marker + if (BIT(s1[0], 15)) break; // end of list marker } // sprite list } @@ -779,10 +807,10 @@ TIMER_CALLBACK_MEMBER(seta2_state::raster_timer_done) auto *tmp68301 = dynamic_cast(m_maincpu.target()); if (tmp68301) { - if (m_rasterenabled & 1) + if (BIT(m_rasterenabled, 0)) { tmp68301->set_input_line(1, HOLD_LINE); - logerror("external int (vpos is %d)\n", m_screen->vpos()); + LOGVIDEO("external int (vpos is %d)\n", m_screen->vpos()); m_screen->update_partial(m_screen->vpos() - 1); } } @@ -791,7 +819,7 @@ TIMER_CALLBACK_MEMBER(seta2_state::raster_timer_done) void seta2_state::draw_sprites(bitmap_ind16& bitmap, const rectangle& cliprect) { - //printf("yoffset: %04x%04x yzoom: %04x%04x | xoffset: %04x%04x xzoom: %04x%04x \n", m_vregs[0x1a/2], m_vregs[0x18/2], m_vregs[0x1e/2], m_vregs[0x1c/2] , m_vregs[0x12/2], m_vregs[0x10/2], m_vregs[0x16/2], m_vregs[0x14/2]); + //LOGOFFSET("yoffset: %04x%04x yzoom: %04x%04x | xoffset: %04x%04x xzoom: %04x%04x \n", m_vregs[0x1a/2], m_vregs[0x18/2], m_vregs[0x1e/2], m_vregs[0x1c/2] , m_vregs[0x12/2], m_vregs[0x10/2], m_vregs[0x16/2], m_vregs[0x14/2]); uint32_t yoffset = (m_vregs[0x1a / 2] << 16) | m_vregs[0x18 / 2]; yoffset &= 0x07ffffff; @@ -808,7 +836,6 @@ void seta2_state::draw_sprites(bitmap_ind16& bitmap, const rectangle& cliprect) yzoominverted = true; } - int xoffset = (m_vregs[0x12 / 2] << 16) | m_vregs[0x10 / 2]; xoffset &= 0x07ffffff; @@ -825,15 +852,14 @@ void seta2_state::draw_sprites(bitmap_ind16& bitmap, const rectangle& cliprect) xzoominverted = true; } - if (!xzoom) return; - uint64_t inc = 0x100000000ULL; + const uint64_t inc = 0x100000000ULL; - uint32_t inc2 = inc / xzoom; + const uint32_t inc2 = inc / xzoom; - //printf("xinc is %04x xoom %04x xoffset is %4x\n", inc2, xzoom, xoffset); + //LOGOFFSET("xinc is %04x xoom %04x xoffset is %4x\n", inc2, xzoom, xoffset); for (int y = cliprect.min_y; y <= cliprect.max_y; y++) { @@ -844,9 +870,7 @@ void seta2_state::draw_sprites(bitmap_ind16& bitmap, const rectangle& cliprect) int yy; if (!yzoominverted) - { yy = y; // not handled yet (this is using negative yzoom to do flipscreen...) - } else { yy = y * yzoom; @@ -854,11 +878,10 @@ void seta2_state::draw_sprites(bitmap_ind16& bitmap, const rectangle& cliprect) yy &= 0x07ffffff; yy >>= 16; - //printf("line %04x yline requested %04x\n", y, yy); + //LOGOFFSET("line %04x yline requested %04x\n", y, yy); if (yy & 0x400) yy -= 0x800; - } draw_sprites_line(bitmap, tempcliprect, yy, y, xoffset, inc2, xzoominverted); @@ -885,9 +908,7 @@ void seta2_state::video_start() m_spritegfx = m_gfxdecode->gfx(0); for (int i = 0; i < 0x80000; i++) - { m_realtilenumber[i] = i % m_spritegfx->elements(); - } m_raster_timer = timer_alloc(FUNC(seta2_state::raster_timer_done), this); @@ -899,7 +920,7 @@ uint32_t seta2_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, // Black or pen 0? bitmap.fill(m_palette->pen(0), cliprect); - if ((m_vregs[0x30/2] & 1) == 0) // 1 = BLANK SCREEN + if (BIT(~m_vregs[0x30/2], 0)) // 1 = BLANK SCREEN draw_sprites(bitmap, cliprect); return 0; @@ -907,7 +928,7 @@ uint32_t seta2_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, void seta2_state::screen_vblank(int state) { - //popmessage("yoffset: %04x%04x yzoom: %04x%04x | xoffset: %04x%04x xzoom: %04x%04x \n", m_vregs[0x1a/2], m_vregs[0x18/2], m_vregs[0x1e/2], m_vregs[0x1c/2] , m_vregs[0x12/2], m_vregs[0x10/2], m_vregs[0x16/2], m_vregs[0x14/2]); + //LOGVIDEO("yoffset: %04x%04x yzoom: %04x%04x | xoffset: %04x%04x xzoom: %04x%04x \n", m_vregs[0x1a/2], m_vregs[0x18/2], m_vregs[0x1e/2], m_vregs[0x1c/2], m_vregs[0x12/2], m_vregs[0x10/2], m_vregs[0x16/2], m_vregs[0x14/2]); } // staraudi @@ -920,12 +941,13 @@ void staraudi_state::draw_rgbram(bitmap_ind16 &bitmap) { for (int x = 0; x < 0x200; ++x) { - int offs = x * 2/2 + y * 0x400/2; - uint32_t data = ((m_rgbram[offs + 0x40000/2] & 0xff) << 16) | m_rgbram[offs]; + const int offs = x * 2/2 + y * 0x400/2; + const uint32_t data = ((m_rgbram[offs + 0x40000/2] & 0xff) << 16) | m_rgbram[offs]; bitmap.pix(y, x) = (data & 0x7fff); } } } + uint32_t staraudi_state::staraudi_screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { screen_update(screen, bitmap, cliprect); diff --git a/src/mame/sgi/ip20.cpp b/src/mame/sgi/ip20.cpp index 5d2fdee4de4..7088bbc7cd1 100644 --- a/src/mame/sgi/ip20.cpp +++ b/src/mame/sgi/ip20.cpp @@ -282,7 +282,11 @@ void ip20_state::ip20(machine_config &config) ROM_START(indigo_r4000) ROM_REGION64_BE(0x80000, "prom", 0) - ROMX_LOAD("ip20prom.070-8116-004.bin", 0x000000, 0x080000, CRC(940d960e) SHA1(596aba530b53a147985ff3f6f853471ce48c866c), ROM_GROUPDWORD | ROM_REVERSE) + ROM_SYSTEM_BIOS(0, "405g-rev-b", "SGI Version 4.0.5G Rev B IP20, Nov 10, 1992") // dumped over serial connection from boot monitor and swapped + ROMX_LOAD("ip20prom.070-8116-005.bin", 0x000000, 0x080000, CRC(1875b645) SHA1(52f5d7baea3d1bc720eb2164104c177e23504345), ROM_GROUPDWORD | ROM_REVERSE | ROM_BIOS(0)) + + ROM_SYSTEM_BIOS(1, "405d-rev-a", "SGI Version 4.0.5D Rev A IP20, Aug 19, 1992") + ROMX_LOAD("ip20prom.070-8116-004.bin", 0x000000, 0x080000, CRC(940d960e) SHA1(596aba530b53a147985ff3f6f853471ce48c866c), ROM_GROUPDWORD | ROM_REVERSE | ROM_BIOS(1)) // hand-made content sets eaddr 08:00:69:12:34:56 and netaddr 192.168.137.2 ROM_REGION16_LE(0x100, "nvram", 0) diff --git a/src/mame/sony/clie_db.cpp b/src/mame/sony/clie_db.cpp index 40e9a7cea02..1d3338f4ac0 100644 --- a/src/mame/sony/clie_db.cpp +++ b/src/mame/sony/clie_db.cpp @@ -26,10 +26,10 @@ namespace { class clie_db_state : public driver_device { public: - clie_db_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + clie_db_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu") - { } + { } void t650c(machine_config &config); diff --git a/src/mame/yamaha/ymqs300.cpp b/src/mame/yamaha/ymqs300.cpp index b0fdc4168b4..b26da7a4d79 100644 --- a/src/mame/yamaha/ymqs300.cpp +++ b/src/mame/yamaha/ymqs300.cpp @@ -12,35 +12,44 @@ #include "screen.h" #include "speaker.h" + #include "utf8.h" +namespace { + class qs300_state : public driver_device { public: - qs300_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), - m_subcpu(*this, "subcpu"), - m_swp00(*this, "swp00"), - m_lcdc(*this, "vs254300"), - m_nvram(*this, "ram"), - m_inputs(*this, "DR%u", 0U), - m_is_eos(false) - - { } + qs300_state(const machine_config &mconfig, device_type type, const char *tag) : + qs300_state(mconfig, type, tag, false) + { + } void qs300(machine_config &config); protected: + qs300_state(const machine_config &mconfig, device_type type, const char *tag, bool is_eos) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_subcpu(*this, "subcpu"), + m_swp00(*this, "swp00"), + m_lcdc(*this, "vs254300"), + m_nvram(*this, "ram"), + m_inputs(*this, "DR%u", 0U), + m_is_eos(is_eos) + { + } + required_device m_maincpu; required_device m_subcpu; required_device m_swp00; required_device m_lcdc; required_device m_nvram; required_ioport_array<7> m_inputs; - // required_ioport m_sustain; - // required_ioport m_pitch_bend; + //required_ioport m_sustain; + //required_ioport m_pitch_bend; + + bool const m_is_eos; - bool m_is_eos; u8 m_mlatch, m_slatch; bool m_mlatch_full, m_slatch_full; @@ -73,10 +82,9 @@ class qs300_state : public driver_device { class eos_b900_state : public qs300_state { public: - eos_b900_state(const machine_config &mconfig, device_type type, const char *tag) - : qs300_state(mconfig, type, tag) + eos_b900_state(const machine_config &mconfig, device_type type, const char *tag) : + qs300_state(mconfig, type, tag, true) { - m_is_eos = true; } }; @@ -370,5 +378,7 @@ ROM_START( eosb900 ) // This t6963c_0101 internal CG ROM is similar to lm24014w_0101.bin which may be used as a replacement ROM_END +} // anonymous namespace + SYST( 1999, qs300, 0, 0, qs300, qs300, qs300_state, empty_init, "Yamaha", "QS300", MACHINE_NOT_WORKING ) SYST( 1999, eosb900, qs300, 0, qs300, qs300, eos_b900_state, empty_init, "Yamaha", "EOS B900", MACHINE_NOT_WORKING )