diff --git a/scripts/target/mame/mess.lua b/scripts/target/mame/mess.lua index 4f30e042cf6..5f735665c25 100644 --- a/scripts/target/mame/mess.lua +++ b/scripts/target/mame/mess.lua @@ -2811,6 +2811,7 @@ files { createMESSProjects(_target, _subtarget, "sharp") files { MAME_DIR .. "src/mame/drivers/hh_sm510.cpp", + MAME_DIR .. "src/mame/includes/hh_sm510.h", MAME_DIR .. "src/mame/video/mz700.cpp", MAME_DIR .. "src/mame/drivers/mz700.cpp", MAME_DIR .. "src/mame/includes/mz700.h", @@ -3122,6 +3123,7 @@ files { MAME_DIR .. "src/mame/machine/gamecom.cpp", MAME_DIR .. "src/mame/video/gamecom.cpp", MAME_DIR .. "src/mame/drivers/k28.cpp", + MAME_DIR .. "src/mame/drivers/rzone.cpp", } createMESSProjects(_target, _subtarget, "tigertel") diff --git a/src/devices/cpu/sm510/sm510.h b/src/devices/cpu/sm510/sm510.h index a3c4129329f..cb963e87fa8 100644 --- a/src/devices/cpu/sm510/sm510.h +++ b/src/devices/cpu/sm510/sm510.h @@ -36,6 +36,10 @@ #define MCFG_SM510_WRITE_R_CB(_devcb) \ devcb = &sm510_base_device::set_write_r_callback(*device, DEVCB_##_devcb); +// R port can be set to direct control with a mask option (default false) +#define MCFG_SM510_R_DIRECT_CONTROL(_direct) \ + sm510_base_device::set_r_direct_control(*device, _direct); + // LCD segment outputs: H1-4 as offset(low), a/b/c 1-16 as data d0-d15 #define MCFG_SM510_WRITE_SEGA_CB(_devcb) \ devcb = &sm510_base_device::set_write_sega_callback(*device, DEVCB_##_devcb); @@ -81,8 +85,8 @@ a1 48 | | 28 b10 H4 49 | | 27 a11 H3 50 | | 26 b11 H2 51 | | 25 a12 -H1 52 | SM510 | 24 b12 -S1 53 | SM511 | 23 a13 +H1 52 | | 24 b12 +S1 53 | SM510 | 23 a13 S2 54 | | 22 b13 S3 55 | | 21 a14 S4 56 | | 20 b14 @@ -108,6 +112,7 @@ public: , m_prgwidth(prgwidth) , m_datawidth(datawidth) , m_stack_levels(stack_levels) + , m_r_direct(false) , m_lcd_ram_a(*this, "lcd_ram_a"), m_lcd_ram_b(*this, "lcd_ram_b"), m_lcd_ram_c(*this, "lcd_ram_c") , m_write_sega(*this), m_write_segb(*this), m_write_segc(*this), m_write_segbs(*this) , m_melody_rom(*this, "melody") @@ -123,6 +128,7 @@ public: template static devcb_base &set_read_b_callback(device_t &device, Object &&cb) { return downcast(device).m_read_b.set_callback(std::forward(cb)); } template static devcb_base &set_write_s_callback(device_t &device, Object &&cb) { return downcast(device).m_write_s.set_callback(std::forward(cb)); } template static devcb_base &set_write_r_callback(device_t &device, Object &&cb) { return downcast(device).m_write_r.set_callback(std::forward(cb)); } + static void set_r_direct_control(device_t &device, bool direct) { downcast(device).m_r_direct = direct; } template static devcb_base &set_write_sega_callback(device_t &device, Object &&cb) { return downcast(device).m_write_sega.set_callback(std::forward(cb)); } template static devcb_base &set_write_segb_callback(device_t &device, Object &&cb) { return downcast(device).m_write_segb.set_callback(std::forward(cb)); } @@ -179,6 +185,7 @@ protected: bool m_skip; u8 m_w; u8 m_r, m_r_out; + bool m_r_direct; bool m_k_active; bool m_halt; int m_clk_div; diff --git a/src/devices/cpu/sm510/sm510core.cpp b/src/devices/cpu/sm510/sm510core.cpp index 3abc2ee1e9b..fe422988459 100644 --- a/src/devices/cpu/sm510/sm510core.cpp +++ b/src/devices/cpu/sm510/sm510core.cpp @@ -5,7 +5,7 @@ Sharp SM510 MCU core implementation TODO: - - buzzer control divider bit is mask-programmable? + - X */ @@ -55,10 +55,20 @@ offs_t sm510_device::disasm_disassemble(std::ostream &stream, offs_t pc, const u void sm510_device::clock_melody() { - // buzzer from divider, R2 inverse phase - u8 out = m_div >> 2 & 1; - out |= (out << 1 ^ 2); - out &= m_r; + u8 out = 0; + + if (m_r_direct) + { + // direct output + out = m_r & 3; + } + else + { + // buzzer from divider, R2 inverse phase + out = m_div >> 2 & 1; + out |= (out << 1 ^ 2); + out &= m_r; + } // output to R pins if (out != m_r_out) diff --git a/src/mame/drivers/hh_sm510.cpp b/src/mame/drivers/hh_sm510.cpp index a45a7a52b3d..09e8439b31f 100644 --- a/src/mame/drivers/hh_sm510.cpp +++ b/src/mame/drivers/hh_sm510.cpp @@ -4,6 +4,8 @@ /*************************************************************************** Sharp SM5xx family handhelds. + List of child drivers: + - rzone: Tiger R-Zone TODO: - improve LCD segments in SVGs for: gnw_mc25, gnw_eg26, exospace @@ -14,9 +16,9 @@ ***************************************************************************/ #include "emu.h" +#include "includes/hh_sm510.h" #include "cpu/sm510/sm510.h" #include "cpu/sm510/sm500.h" -#include "sound/spkrdev.h" #include "rendlay.h" #include "screen.h" #include "speaker.h" @@ -28,61 +30,6 @@ //#include "hh_sm500_test.lh" // " -class hh_sm510_state : public driver_device -{ -public: - hh_sm510_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), - m_inp_matrix(*this, "IN.%u", 0), - m_out_x(*this, "%u.%u.%u", 0U, 0U, 0U), - m_speaker(*this, "speaker"), - m_inp_lines(0), - m_display_wait(33) - { } - - // devices - required_device m_maincpu; - optional_ioport_array<7> m_inp_matrix; // max 7 - output_finder<16, 16, 4> m_out_x; - optional_device m_speaker; - - // misc common - u16 m_inp_mux; // multiplexed inputs mask - int m_inp_lines; // number of input mux columns - u8 m_s; // MCU S output pins - u8 m_r; // MCU R output pins - - u8 read_inputs(int columns); - - virtual void update_k_line(); - virtual DECLARE_INPUT_CHANGED_MEMBER(input_changed); - virtual DECLARE_INPUT_CHANGED_MEMBER(acl_button); - virtual DECLARE_WRITE16_MEMBER(sm510_lcd_segment_w); - virtual DECLARE_WRITE8_MEMBER(sm500_lcd_segment_w); - virtual DECLARE_READ8_MEMBER(input_r); - virtual DECLARE_WRITE8_MEMBER(input_w); - virtual DECLARE_WRITE8_MEMBER(piezo_r1_w); - virtual DECLARE_WRITE8_MEMBER(piezo_r2_w); - virtual DECLARE_WRITE8_MEMBER(piezo_input_w); - - // display common - int m_display_wait; // lcd segment on/off-delay in milliseconds (default 33ms) - u8 m_display_x_len; // lcd number of groups - u8 m_display_y_len; // lcd number of segments - u8 m_display_z_len; // lcd number of commons - u32 m_display_state[0x20]; // lcd segment data (max. 5-bit offset) - u8 m_display_decay[0x20][0x20]; // (internal use) - - void set_display_size(u8 x, u8 y, u8 z); - TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick); - -protected: - virtual void machine_start() override; - virtual void machine_reset() override; -}; - - // machine start/reset void hh_sm510_state::machine_start() @@ -2335,46 +2282,35 @@ ROM_START( tsjam ) ROM_END -ROM_START( rzindy500 ) - ROM_REGION( 0x1000, "maincpu", 0 ) - ROM_LOAD( "10_22", 0x0000, 0x1000, CRC(99a746d0) SHA1(64264499d45a566fa9a0801c20e7fa27eac18da6) ) - ROM_REGION( 533414, "svg", 0) - ROM_LOAD( "rzindy500.svg", 0, 533414, CRC(21c9bd2e) SHA1(549f079c5bd5883b21dc9b29b281a73728ed7827) ) -ROM_END +// YEAR NAME PARENT COMP MACHINE INPUT STATE INIT COMPANY, FULLNAME, FLAGS +CONS( 1989, kdribble, 0, 0, kdribble, kdribble, kdribble_state, 0, "Konami", "Double Dribble (handheld)", MACHINE_SUPPORTS_SAVE ) +CONS( 1989, ktopgun, 0, 0, ktopgun, ktopgun, ktopgun_state, 0, "Konami", "Top Gun (handheld)", MACHINE_SUPPORTS_SAVE ) +CONS( 1989, kcontra, 0, 0, kcontra, kcontra, kcontra_state, 0, "Konami", "Contra (handheld)", MACHINE_SUPPORTS_SAVE ) +CONS( 1989, ktmnt, 0, 0, ktmnt, ktmnt, ktmnt_state, 0, "Konami", "Teenage Mutant Ninja Turtles (handheld)", MACHINE_SUPPORTS_SAVE ) +CONS( 1989, kgradius, 0, 0, kgradius, kgradius, kgradius_state, 0, "Konami", "Gradius (handheld)", MACHINE_SUPPORTS_SAVE ) +CONS( 1989, kloneran, 0, 0, kloneran, kloneran, kloneran_state, 0, "Konami", "Lone Ranger (handheld)", MACHINE_SUPPORTS_SAVE ) +CONS( 1989, kblades, 0, 0, kblades, kblades, kblades_state, 0, "Konami", "Blades of Steel (handheld)", MACHINE_SUPPORTS_SAVE ) +CONS( 1989, knfl, 0, 0, knfl, knfl, knfl_state, 0, "Konami", "NFL Football (handheld)", MACHINE_SUPPORTS_SAVE ) +CONS( 1989, kbilly, 0, 0, kbilly, kbilly, kbilly_state, 0, "Konami", "The Adventures of Bayou Billy (handheld)", MACHINE_SUPPORTS_SAVE ) +CONS( 1991, kbucky, 0, 0, kbucky, kbucky, kbucky_state, 0, "Konami", "Bucky O'Hare (handheld)", MACHINE_SUPPORTS_SAVE ) +CONS( 1991, kgarfld, 0, 0, kgarfld, kgarfld, kgarfld_state, 0, "Konami", "Garfield (handheld)", MACHINE_SUPPORTS_SAVE ) +CONS( 1981, gnw_mc25, 0, 0, mc25, mc25, mc25_state, 0, "Nintendo", "Game & Watch: Mickey Mouse", MACHINE_SUPPORTS_SAVE ) +CONS( 1981, gnw_eg26, gnw_mc25, 0, eg26, mc25, mc25_state, 0, "Nintendo", "Game & Watch: Egg", MACHINE_SUPPORTS_SAVE ) +CONS( 1984, nupogodi, gnw_mc25, 0, nupogodi, mc25, mc25_state, 0, "Elektronika", "Nu, pogodi!", MACHINE_SUPPORTS_SAVE ) +CONS( 1989, exospace, gnw_mc25, 0, exospace, exospace, mc25_state, 0, "Elektronika", "Explorers of Space", MACHINE_SUPPORTS_SAVE ) +CONS( 1982, gnw_dm53, 0, 0, dm53, dm53, dm53_state, 0, "Nintendo", "Game & Watch: Mickey & Donald", MACHINE_SUPPORTS_SAVE ) +CONS( 1983, gnw_jr55, 0, 0, jr55, jr55, jr55_state, 0, "Nintendo", "Game & Watch: Donkey Kong II", MACHINE_SUPPORTS_SAVE ) +CONS( 1983, gnw_mw56, 0, 0, mw56, mw56, mw56_state, 0, "Nintendo", "Game & Watch: Mario Bros.", MACHINE_SUPPORTS_SAVE ) -// YEAR NAME PARENT COMP MACHINE INPUT STATE INIT COMPANY, FULLNAME, FLAGS -CONS( 1989, kdribble, 0, 0, kdribble, kdribble, kdribble_state, 0, "Konami", "Double Dribble (handheld)", MACHINE_SUPPORTS_SAVE ) -CONS( 1989, ktopgun, 0, 0, ktopgun, ktopgun, ktopgun_state, 0, "Konami", "Top Gun (handheld)", MACHINE_SUPPORTS_SAVE ) -CONS( 1989, kcontra, 0, 0, kcontra, kcontra, kcontra_state, 0, "Konami", "Contra (handheld)", MACHINE_SUPPORTS_SAVE ) -CONS( 1989, ktmnt, 0, 0, ktmnt, ktmnt, ktmnt_state, 0, "Konami", "Teenage Mutant Ninja Turtles (handheld)", MACHINE_SUPPORTS_SAVE ) -CONS( 1989, kgradius, 0, 0, kgradius, kgradius, kgradius_state, 0, "Konami", "Gradius (handheld)", MACHINE_SUPPORTS_SAVE ) -CONS( 1989, kloneran, 0, 0, kloneran, kloneran, kloneran_state, 0, "Konami", "Lone Ranger (handheld)", MACHINE_SUPPORTS_SAVE ) -CONS( 1989, kblades, 0, 0, kblades, kblades, kblades_state, 0, "Konami", "Blades of Steel (handheld)", MACHINE_SUPPORTS_SAVE ) -CONS( 1989, knfl, 0, 0, knfl, knfl, knfl_state, 0, "Konami", "NFL Football (handheld)", MACHINE_SUPPORTS_SAVE ) -CONS( 1989, kbilly, 0, 0, kbilly, kbilly, kbilly_state, 0, "Konami", "The Adventures of Bayou Billy (handheld)", MACHINE_SUPPORTS_SAVE ) -CONS( 1991, kbucky, 0, 0, kbucky, kbucky, kbucky_state, 0, "Konami", "Bucky O'Hare (handheld)", MACHINE_SUPPORTS_SAVE ) -CONS( 1991, kgarfld, 0, 0, kgarfld, kgarfld, kgarfld_state, 0, "Konami", "Garfield (handheld)", MACHINE_SUPPORTS_SAVE ) +CONS( 1982, gnw_dj101, 0, 0, dj101, dj101, dj101_state, 0, "Nintendo", "Game & Watch: Donkey Kong Jr. (new wide screen)", MACHINE_SUPPORTS_SAVE ) +CONS( 1983, gnw_ml102, 0, 0, ml102, ml102, ml102_state, 0, "Nintendo", "Game & Watch: Mario's Cement Factory (new wide screen)", MACHINE_SUPPORTS_SAVE ) -CONS( 1981, gnw_mc25, 0, 0, mc25, mc25, mc25_state, 0, "Nintendo", "Game & Watch: Mickey Mouse", MACHINE_SUPPORTS_SAVE ) -CONS( 1981, gnw_eg26, gnw_mc25, 0, eg26, mc25, mc25_state, 0, "Nintendo", "Game & Watch: Egg", MACHINE_SUPPORTS_SAVE ) -CONS( 1984, nupogodi, gnw_mc25, 0, nupogodi, mc25, mc25_state, 0, "Elektronika", "Nu, pogodi!", MACHINE_SUPPORTS_SAVE ) -CONS( 1989, exospace, gnw_mc25, 0, exospace, exospace, mc25_state, 0, "Elektronika", "Explorers of Space", MACHINE_SUPPORTS_SAVE ) +CONS( 1984, gnw_bx301, 0, 0, bx301, bx301, bx301_state, 0, "Nintendo", "Game & Watch: Boxing", MACHINE_SUPPORTS_SAVE ) -CONS( 1982, gnw_dm53, 0, 0, dm53, dm53, dm53_state, 0, "Nintendo", "Game & Watch: Mickey & Donald", MACHINE_SUPPORTS_SAVE ) -CONS( 1983, gnw_jr55, 0, 0, jr55, jr55, jr55_state, 0, "Nintendo", "Game & Watch: Donkey Kong II", MACHINE_SUPPORTS_SAVE ) -CONS( 1983, gnw_mw56, 0, 0, mw56, mw56, mw56_state, 0, "Nintendo", "Game & Watch: Mario Bros.", MACHINE_SUPPORTS_SAVE ) - -CONS( 1982, gnw_dj101, 0, 0, dj101, dj101, dj101_state, 0, "Nintendo", "Game & Watch: Donkey Kong Jr. (new wide screen)", MACHINE_SUPPORTS_SAVE ) -CONS( 1983, gnw_ml102, 0, 0, ml102, ml102, ml102_state, 0, "Nintendo", "Game & Watch: Mario's Cement Factory (new wide screen)", MACHINE_SUPPORTS_SAVE ) - -CONS( 1984, gnw_bx301, 0, 0, bx301, bx301, bx301_state, 0, "Nintendo", "Game & Watch: Boxing", MACHINE_SUPPORTS_SAVE ) - -CONS( 1988, tgaunt, 0, 0, tgaunt, tgaunt, tgaunt_state, 0, "Tiger Electronics (licensed from Tengen)", "Gauntlet (handheld)", MACHINE_SUPPORTS_SAVE ) -CONS( 1988, tddragon, 0, 0, tddragon, tddragon, tddragon_state, 0, "Tiger Electronics (licensed from Tradewest/Technos)", "Double Dragon (handheld)", MACHINE_SUPPORTS_SAVE ) -CONS( 1991, tsonic, 0, 0, tsonic, tsonic, tsonic_state, 0, "Tiger Electronics (licensed from Sega)", "Sonic The Hedgehog (handheld)", MACHINE_SUPPORTS_SAVE ) -CONS( 1996, tsjam, 0, 0, tsjam, tsjam, tsjam_state, 0, "Tiger Electronics", "Space Jam (handheld)", MACHINE_SUPPORTS_SAVE ) - -CONS( 1996, rzindy500, 0, 0, tsjam, tsjam, tsjam_state, 0, "Tiger Electronics (licensed from Sega)", "R-Zone: Indy 500", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING ) +CONS( 1988, tgaunt, 0, 0, tgaunt, tgaunt, tgaunt_state, 0, "Tiger Electronics (licensed from Tengen)", "Gauntlet (handheld)", MACHINE_SUPPORTS_SAVE ) +CONS( 1988, tddragon, 0, 0, tddragon, tddragon, tddragon_state, 0, "Tiger Electronics (licensed from Tradewest/Technos)", "Double Dragon (handheld)", MACHINE_SUPPORTS_SAVE ) +CONS( 1991, tsonic, 0, 0, tsonic, tsonic, tsonic_state, 0, "Tiger Electronics (licensed from Sega)", "Sonic The Hedgehog (handheld)", MACHINE_SUPPORTS_SAVE ) +CONS( 1996, tsjam, 0, 0, tsjam, tsjam, tsjam_state, 0, "Tiger Electronics", "Space Jam (handheld)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/hh_ucom4.cpp b/src/mame/drivers/hh_ucom4.cpp index ac40c94aec4..11a92566f36 100644 --- a/src/mame/drivers/hh_ucom4.cpp +++ b/src/mame/drivers/hh_ucom4.cpp @@ -72,6 +72,7 @@ TODO: #include "emu.h" #include "includes/hh_ucom4.h" #include "video/hlcd0515.h" +#include "rendlay.h" #include "screen.h" #include "speaker.h" diff --git a/src/mame/drivers/rzone.cpp b/src/mame/drivers/rzone.cpp new file mode 100644 index 00000000000..caee1bdfe63 --- /dev/null +++ b/src/mame/drivers/rzone.cpp @@ -0,0 +1,235 @@ +// license:BSD-3-Clause +// copyright-holders:hap, Sean Riddle +/*************************************************************************** + + ** subclass of hh_sm510_state (includes/hh_sm510.h, drivers/hh_sm510.cpp) ** + + Tiger R-Zone driver + + This is a backwards console, the heart of the machine is the cartridge. + + TODO: + - x + +***************************************************************************/ + +#include "emu.h" +#include "includes/hh_sm510.h" +#include "cpu/sm510/sm510.h" +#include "screen.h" +#include "speaker.h" + +// internal artwork +#include "rzone.lh" + +class rzone_state : public hh_sm510_state +{ +public: + rzone_state(const machine_config &mconfig, device_type type, const char *tag) + : hh_sm510_state(mconfig, type, tag), + m_led_out(*this, "led%u", 0U), + m_led_off(*this, "led_off") + { } + + output_finder<1> m_led_out; + required_device m_led_off; + + int m_led_pin; + int m_sctrl; + int m_sclock; + + TIMER_DEVICE_CALLBACK_MEMBER(led_off_callback) { m_led_out[0] = m_led_pin ? 1 : 0; } + DECLARE_WRITE_LINE_MEMBER(led_w); + DECLARE_WRITE_LINE_MEMBER(audio_w); + DECLARE_WRITE_LINE_MEMBER(sctrl_w); + DECLARE_WRITE_LINE_MEMBER(sclock_w); + DECLARE_READ_LINE_MEMBER(sdata_r); + + DECLARE_WRITE8_MEMBER(t1_write_r); + DECLARE_WRITE8_MEMBER(t1_write_s); + virtual DECLARE_READ8_MEMBER(input_r) override; + +protected: + virtual void machine_start() override; +}; + + +// machine start + +void rzone_state::machine_start() +{ + hh_sm510_state::machine_start(); + + // resolve handlers + m_led_out.resolve(); + + // zerofill + m_led_pin = 0; + m_sctrl = 0; + m_sclock = 0; + + // register for savestates + save_item(NAME(m_led_pin)); + save_item(NAME(m_sctrl)); + save_item(NAME(m_sclock)); +} + + +/*************************************************************************** + + I/O + +***************************************************************************/ + +// console + +WRITE_LINE_MEMBER(rzone_state::led_w) +{ + // LED: enable backlight + if (state) + m_led_out[0] = 1; + + // delay led off to prevent flickering + if (!state && m_led_pin) + m_led_off->adjust(attotime::from_msec(30)); + + m_led_pin = state; +} + +WRITE_LINE_MEMBER(rzone_state::audio_w) +{ + // Audio: speaker out + m_speaker->level_w(state ? 1 : 0); +} + +WRITE_LINE_MEMBER(rzone_state::sctrl_w) +{ + // SCTRL: 74165 SH/LD: reload inputs while low + if (!state || !m_sctrl) + m_inp_mux = m_inp_matrix[0]->read(); + + m_sctrl = state; +} + +WRITE_LINE_MEMBER(rzone_state::sclock_w) +{ + // SCLOCK: 74165 CLK: shift inputs on rising edge when 74165 SH/LD is high + if (m_sctrl && !m_sclock && state) + m_inp_mux >>= 1; + + m_sclock = state; +} + +READ_LINE_MEMBER(rzone_state::sdata_r) +{ + // SDATA: 74165 Q + sctrl_w(m_sctrl); // reload inputs if needed + return m_inp_mux & 1; +} + + +// cartridge type 1 + +WRITE8_MEMBER(rzone_state::t1_write_r) +{ + // R1: Audio + audio_w(data & 1); + + // R2: SCTRL + sctrl_w(data >> 1 & 1); +} + +WRITE8_MEMBER(rzone_state::t1_write_s) +{ + // S1: LED + led_w(data & 1); + + // S2: SCLOCK + sclock_w(data >> 1 & 1); +} + +READ8_MEMBER(rzone_state::input_r) +{ + // K1: SDATA + return sdata_r(); +} + + + +/*************************************************************************** + + Inputs + +***************************************************************************/ + +static INPUT_PORTS_START( rzone ) + PORT_START("IN.0") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_POWER_ON ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_sm510_state, input_changed, nullptr) + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON1 ) // A + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_BUTTON2 ) // B + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_BUTTON3 ) // C + PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_BUTTON4 ) // D + PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_VOLUME_DOWN ) PORT_NAME("Sound") + PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_SELECT ) + PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_POWER_OFF ) + PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("Pause") + PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_START ) +INPUT_PORTS_END + + + +/*************************************************************************** + + Machine Config + +***************************************************************************/ + +static MACHINE_CONFIG_START( rzindy500 ) + + /* basic machine hardware */ + MCFG_CPU_ADD("maincpu", SM510, XTAL_32_768kHz) // no external XTAL + MCFG_SM510_WRITE_SEGS_CB(WRITE16(hh_sm510_state, sm510_lcd_segment_w)) + MCFG_SM510_READ_K_CB(READ8(rzone_state, input_r)) + MCFG_SM510_WRITE_S_CB(WRITE8(rzone_state, t1_write_s)) + MCFG_SM510_WRITE_R_CB(WRITE8(rzone_state, t1_write_r)) + MCFG_SM510_R_DIRECT_CONTROL(true) + + /* video hardware */ + MCFG_SCREEN_SVG_ADD("screen", "svg") + MCFG_SCREEN_REFRESH_RATE(50) + MCFG_SCREEN_SIZE(1425, 1080) + MCFG_SCREEN_VISIBLE_AREA(0, 1425-1, 0, 1080-1) + + MCFG_TIMER_DRIVER_ADD("led_off", rzone_state, led_off_callback) + MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_sm510_state, display_decay_tick, attotime::from_msec(1)) + MCFG_DEFAULT_LAYOUT(layout_rzone) + + /* sound hardware */ + MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) +MACHINE_CONFIG_END + + + +/*************************************************************************** + + Game driver(s) + +***************************************************************************/ + +ROM_START( rzindy500 ) + ROM_REGION( 0x1000, "maincpu", 0 ) + ROM_LOAD( "10_22", 0x0000, 0x1000, CRC(99a746d0) SHA1(64264499d45a566fa9a0801c20e7fa27eac18da6) ) + + ROM_REGION( 533407, "svg", 0) + ROM_LOAD( "rzindy500.svg", 0, 533407, CRC(07f72e35) SHA1(034972c1255f8899b53a94063d6c66bdef089ce9) ) +ROM_END + + +// YEAR NAME PARENT COMP MACHINE INPUT STATE INIT COMPANY, FULLNAME, FLAGS +CONS( 1995, rzindy500, 0, 0, rzindy500, rzone, rzone_state, 0, "Tiger Electronics (licensed from Sega)", "R-Zone: Indy 500", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/includes/hh_sm510.h b/src/mame/includes/hh_sm510.h new file mode 100644 index 00000000000..21982d63410 --- /dev/null +++ b/src/mame/includes/hh_sm510.h @@ -0,0 +1,70 @@ +// license:BSD-3-Clause +// copyright-holders:hap +/* + + Sharp SM5xx family handhelds. + +*/ + +#ifndef MAME_INCLUDES_HH_SM510_H +#define MAME_INCLUDES_HH_SM510_H + +#include "sound/spkrdev.h" + + +class hh_sm510_state : public driver_device +{ +public: + hh_sm510_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_inp_matrix(*this, "IN.%u", 0), + m_out_x(*this, "%u.%u.%u", 0U, 0U, 0U), + m_speaker(*this, "speaker"), + m_inp_lines(0), + m_display_wait(33) + { } + + // devices + required_device m_maincpu; + optional_ioport_array<7> m_inp_matrix; // max 7 + output_finder<16, 16, 4> m_out_x; + optional_device m_speaker; + + // misc common + u16 m_inp_mux; // multiplexed inputs mask + int m_inp_lines; // number of input mux columns + u8 m_s; // MCU S output pins + u8 m_r; // MCU R output pins + + u8 read_inputs(int columns); + + virtual void update_k_line(); + virtual DECLARE_INPUT_CHANGED_MEMBER(input_changed); + virtual DECLARE_INPUT_CHANGED_MEMBER(acl_button); + virtual DECLARE_WRITE16_MEMBER(sm510_lcd_segment_w); + virtual DECLARE_WRITE8_MEMBER(sm500_lcd_segment_w); + virtual DECLARE_READ8_MEMBER(input_r); + virtual DECLARE_WRITE8_MEMBER(input_w); + virtual DECLARE_WRITE8_MEMBER(piezo_r1_w); + virtual DECLARE_WRITE8_MEMBER(piezo_r2_w); + virtual DECLARE_WRITE8_MEMBER(piezo_input_w); + + // display common + int m_display_wait; // lcd segment on/off-delay in milliseconds (default 33ms) + u8 m_display_x_len; // lcd number of groups + u8 m_display_y_len; // lcd number of segments + u8 m_display_z_len; // lcd number of commons + u32 m_display_state[0x20]; // lcd segment data (max. 5-bit offset) + u8 m_display_decay[0x20][0x20]; // (internal use) + + void set_display_size(u8 x, u8 y, u8 z); + TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; +}; + + +#endif // MAME_INCLUDES_HH_SM510_H diff --git a/src/mame/includes/hh_ucom4.h b/src/mame/includes/hh_ucom4.h index eddb55cc31d..ca38b68a447 100644 --- a/src/mame/includes/hh_ucom4.h +++ b/src/mame/includes/hh_ucom4.h @@ -2,7 +2,7 @@ // copyright-holders:hap /* - NEC uCOM4 MCU tabletops/handhelds or other simple devices, + NEC uCOM4 MCU tabletops/handhelds or other simple devices. */ @@ -12,8 +12,6 @@ #include "cpu/ucom4/ucom4.h" #include "sound/spkrdev.h" -#include "rendlay.h" - class hh_ucom4_state : public driver_device { diff --git a/src/mame/layout/rzone.lay b/src/mame/layout/rzone.lay new file mode 100644 index 00000000000..fc6c801753f --- /dev/null +++ b/src/mame/layout/rzone.lay @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 321a74b8fb2..743ed0e7319 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -14625,7 +14625,6 @@ knfl // Konami ktmnt // Konami ktopgun // Konami nupogodi // Elektronika -rzindy500 // Tiger tddragon // Tiger tgaunt // Tiger tsjam // Tiger @@ -32482,6 +32481,9 @@ rvoicepc // @source:rx78.cpp rx78 // +@source:rzone.cpp +rzindy500 // + @source:s11.cpp gmine_l2 // grand_l3 // diff --git a/src/mame/mess.flt b/src/mame/mess.flt index 1a36b138160..fd644371eac 100644 --- a/src/mame/mess.flt +++ b/src/mame/mess.flt @@ -550,6 +550,7 @@ rsc55.cpp rt1715.cpp rvoice.cpp rx78.cpp +rzone.cpp sacstate.cpp sage2.cpp samcoupe.cpp