From ac9d1301cbe2c59ef81f975d682c9a16935f38bd Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Mon, 8 Nov 2021 11:29:49 +1100 Subject: -laserbas.cpp: Fixed a bug in sound output, improved trackball handling. -taito_h.cpp: Moved Syvalion trackball handling to a derived class, reduced copy/paste in I/O handler function. -Various small cleanups to drivers. --- src/mame/audio/nl_segaspeech.h | 2 + src/mame/audio/segag80.cpp | 6 +- src/mame/audio/segaspeech.cpp | 3 +- src/mame/drivers/gigatron.cpp | 26 ++---- src/mame/drivers/laserbas.cpp | 165 +++++++++++++++++++--------------- src/mame/drivers/taito_h.cpp | 200 ++++++++++++++--------------------------- src/mame/includes/segag80r.h | 2 + src/mame/includes/segag80v.h | 9 +- src/mame/includes/taito_h.h | 45 ++++++---- src/mame/video/taito_h.cpp | 4 +- 10 files changed, 217 insertions(+), 245 deletions(-) diff --git a/src/mame/audio/nl_segaspeech.h b/src/mame/audio/nl_segaspeech.h index 2affc0665a1..fcfd4b2e49e 100644 --- a/src/mame/audio/nl_segaspeech.h +++ b/src/mame/audio/nl_segaspeech.h @@ -5,6 +5,8 @@ #pragma once +#include "netlist/nl_setup.h" + NETLIST_EXTERNAL(segaspeech) #endif // MAME_AUDIO_NL_SEGASPEECH_H diff --git a/src/mame/audio/segag80.cpp b/src/mame/audio/segag80.cpp index aa377894643..cf790afc61c 100644 --- a/src/mame/audio/segag80.cpp +++ b/src/mame/audio/segag80.cpp @@ -7,12 +7,14 @@ *************************************************************************/ #include "emu.h" - #include "audio/segag80.h" + +#include "includes/segag80v.h" // FIXME: eliminate the need for this dependency + #include "audio/nl_astrob.h" #include "audio/nl_elim.h" #include "audio/nl_spacfury.h" -#include "includes/segag80v.h" + #include "sound/samples.h" diff --git a/src/mame/audio/segaspeech.cpp b/src/mame/audio/segaspeech.cpp index 81a74350476..cd766d6a2ca 100644 --- a/src/mame/audio/segaspeech.cpp +++ b/src/mame/audio/segaspeech.cpp @@ -12,8 +12,7 @@ #include "segaspeech.h" #include "sound/sp0250.h" -#include "includes/segag80r.h" -#include "includes/segag80v.h" + #include "audio/nl_segaspeech.h" #define VERBOSE 0 diff --git a/src/mame/drivers/gigatron.cpp b/src/mame/drivers/gigatron.cpp index b82ba93f74d..b3ea0db7ac6 100644 --- a/src/mame/drivers/gigatron.cpp +++ b/src/mame/drivers/gigatron.cpp @@ -44,10 +44,7 @@ public: , m_dac(*this, "dac") , m_screen(*this, "screen") , m_io_inputs(*this, "GAMEPAD") - , m_blinken1(*this, "blinken1") - , m_blinken2(*this, "blinken2") - , m_blinken3(*this, "blinken3") - , m_blinken4(*this, "blinken4") + , m_blinken(*this, "blinken%u", 1U) { } @@ -85,10 +82,7 @@ private: required_device m_screen; required_ioport m_io_inputs; - output_finder<> m_blinken1; - output_finder<> m_blinken2; - output_finder<> m_blinken3; - output_finder<> m_blinken4; + output_finder<4> m_blinken; }; //************************************************************************** @@ -150,10 +144,11 @@ uint32_t gigatron_state::screen_update(screen_device &screen, bitmap_rgb32 &bitm copybitmap(bitmap, *m_bitmap_render, 0, 0, 0, 0, cliprect); video_reset(); - m_blinken1 = (m_lights >> 3) & 1; - m_blinken2 = (m_lights >> 2) & 1; - m_blinken3 = (m_lights >> 1) & 1; - m_blinken4 = (m_lights >> 0) & 1; + m_blinken[0] = BIT(m_lights, 3); + m_blinken[1] = BIT(m_lights, 2); + m_blinken[2] = BIT(m_lights, 1); + m_blinken[3] = BIT(m_lights, 0); + return 0; } @@ -190,10 +185,7 @@ INPUT_PORTS_END void gigatron_state::machine_start() { //blinkenlights - m_blinken1.resolve(); - m_blinken2.resolve(); - m_blinken3.resolve(); - m_blinken4.resolve(); + m_blinken.resolve(); //Savestate stuff save_item(NAME(m_lights)); @@ -231,7 +223,7 @@ void gigatron_state::gigatron(machine_config &config) /* sound hardware */ SPEAKER(config, "speaker").front_center(); - DAC_4BIT_R2R(config, "dac", 0).add_route(ALL_OUTPUTS, "speaker", 0.5); + DAC_4BIT_R2R(config, m_dac, 0).add_route(ALL_OUTPUTS, "speaker", 0.5); GTRON(config, m_maincpu, MAIN_CLOCK); m_maincpu->set_addrmap(AS_PROGRAM, &gigatron_state::prog_map); diff --git a/src/mame/drivers/laserbas.cpp b/src/mame/drivers/laserbas.cpp index 23f3ad2cd0e..3c2a68780d4 100644 --- a/src/mame/drivers/laserbas.cpp +++ b/src/mame/drivers/laserbas.cpp @@ -60,15 +60,20 @@ expected: 43 FB CC 9A D4 23 6C 01 3E <- From ROM 4 ********************************************/ #include "emu.h" + #include "cpu/z80/z80.h" #include "machine/pit8253.h" #include "machine/timer.h" #include "sound/dac.h" #include "video/mc6845.h" + #include "emupal.h" #include "screen.h" #include "speaker.h" + +namespace { + class laserbas_state : public driver_device { public: @@ -76,7 +81,9 @@ public: driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_palette(*this, "palette"), - m_dac(*this, "dac%u", 1U) + m_dac(*this, "dac%u", 1U), + m_vrambank(*this, "vram"), + m_track(*this, { "TRACK_X", "TRACK_Y" }) { } void laserbas(machine_config &config); @@ -86,31 +93,34 @@ protected: virtual void machine_reset() override; private: - /* misc */ - int m_dac_data; - int m_counter[6]; - int m_cnt_out[6]; + required_device m_maincpu; + required_device m_palette; + required_device_array m_dac; + required_memory_bank m_vrambank; + required_ioport_array<2> m_track; + + // misc + uint8_t m_counter[6]; + uint8_t m_cnt_out[6]; int m_nmi; - /* video-related */ - int m_vrambank; + + // input-related + uint8_t m_track_prv[2]; + int8_t m_track_cnt[2]; + + // video-related uint8_t m_vram[0x10000]; - int m_hset, m_vset; - int m_bset; - int m_scl; + uint8_t m_hset, m_vset; + uint8_t m_bset; + uint8_t m_scl; bool m_flipscreen; uint64_t m_z1data; - required_device m_maincpu; - required_device m_palette; - required_device_array m_dac; - - uint8_t vram_r(offs_t offset); - void vram_w(offs_t offset, uint8_t data); void videoctrl1_w(offs_t offset, uint8_t data); void videoctrl2_w(offs_t offset, uint8_t data); uint8_t z1_r(offs_t offset); - uint8_t track_lo_r(); - uint8_t track_hi_r(); + uint8_t track_dir_r(); + uint8_t track_val_r(); void out_w(uint8_t data); template DECLARE_WRITE_LINE_MEMBER(pit_out_w); TIMER_DEVICE_CALLBACK_MEMBER(laserbas_scanline); @@ -166,16 +176,6 @@ MC6845_UPDATE_ROW( laserbas_state::crtc_update_row ) } } -uint8_t laserbas_state::vram_r(offs_t offset) -{ - return m_vram[offset+(m_vrambank?0x8000:0)]; -} - -void laserbas_state::vram_w(offs_t offset, uint8_t data) -{ - m_vram[offset+(m_vrambank?0x8000:0)] = data; -} - void laserbas_state::videoctrl1_w(offs_t offset, uint8_t data) { data ^= 0xff; @@ -183,10 +183,10 @@ void laserbas_state::videoctrl1_w(offs_t offset, uint8_t data) // 7------- flip screen // -6------ layer select // --543--- vset (vertical scroll, inc'ed on interrupts - 8 ints/frame?) - // -----210 hset (presumely horizontal scroll) + // -----210 hset (presumably horizontal scroll) - m_flipscreen = bool(BIT(data, 7)); - m_vrambank = BIT(data, 6) ? 0 : 1; + m_flipscreen = BIT(data, 7); + m_vrambank->set_entry(BIT(~data, 6)); m_vset = (data >> 3) & 0x07; m_hset = (data >> 0) & 0x07; } @@ -225,75 +225,96 @@ uint8_t laserbas_state::z1_r(offs_t offset) return (bit7 << 7) | (bit6 << 6) | (bit5 << 5) | (bit4 << 4) | (bit3 << 3) | (bit2 << 2) | (bit1 << 1) | (bit0 << 0); } -uint8_t laserbas_state::track_lo_r() +// trackball read twice per frame, direction first then value + +uint8_t laserbas_state::track_dir_r() { - uint8_t dx = ioport("TRACK_X")->read(); - uint8_t dy = ioport("TRACK_Y")->read(); - if (dx & 0x10) - dx ^= 0xf; - if (dy & 0x10) - dy ^= 0x0f; - int data = (dx & 0x0f) | ((dy & 0x0f) << 4); - return data; + for (unsigned i = 0; m_track.size() > i; ++i) + { + uint8_t const track = uint8_t(m_track[i]->read()); + int diff = track - m_track_prv[i]; + m_track_prv[i] = track; + + if (diff > 0x20) + diff -= 0x40; + else if (diff < -0x20) + diff += 0x40; + + m_track_cnt[i] += diff; + } + return ((m_track_cnt[0] < 0) ? 0x01 : 0x00) | ((m_track_cnt[1] > 0) ? 0x02 : 0x00); } -uint8_t laserbas_state::track_hi_r() +uint8_t laserbas_state::track_val_r() { - int data = ((ioport("TRACK_X")->read() & 0x10) >> 4) | ((ioport("TRACK_Y")->read() & 0x10) >> 3); - return data; + int8_t const x = std::clamp(m_track_cnt[0], -15, 15); + int8_t const y = std::clamp(m_track_cnt[1], -15, 15); + m_track_cnt[0] -= x; + m_track_cnt[1] -= y; + + return std::abs(x) | (std::abs(y) << 4); } void laserbas_state::out_w(uint8_t data) { - /* sound related , maybe also lamps */ + // sound related , maybe also lamps } void laserbas_state::machine_start() { + m_vrambank->configure_entries(0, 2, m_vram, 0x8000); + + std::fill(std::begin(m_counter), std::end(m_counter), 0); + std::fill(std::begin(m_cnt_out), std::end(m_cnt_out), 0); + m_nmi = 0; + + std::fill(std::begin(m_track_prv), std::end(m_track_prv), 0); + std::fill(std::begin(m_track_cnt), std::end(m_track_cnt), 0); + + save_item(NAME(m_counter)); + save_item(NAME(m_cnt_out)); + save_item(NAME(m_nmi)); + save_item(NAME(m_track_prv)); + save_item(NAME(m_track_cnt)); save_item(NAME(m_vram)); - save_item(NAME(m_flipscreen)); - save_item(NAME(m_vrambank)); save_item(NAME(m_hset)); save_item(NAME(m_vset)); save_item(NAME(m_bset)); save_item(NAME(m_scl)); - save_item(NAME(m_nmi)); - save_item(NAME(m_dac_data)); - save_item(NAME(m_counter)); - save_item(NAME(m_cnt_out)); + save_item(NAME(m_flipscreen)); save_item(NAME(m_z1data)); } void laserbas_state::machine_reset() { - m_vrambank = 0; - m_flipscreen = false; - m_nmi=0; - m_bset = 0; + m_vrambank->set_entry(1); + m_hset = 0; m_vset = 0; + m_bset = 0; m_scl = 0; + m_flipscreen = 0; } template WRITE_LINE_MEMBER(laserbas_state::pit_out_w) { - state^=1; // 7404 (6G) - if((!state)& m_cnt_out[Which]){ // 0->1 rising edge CLK - m_counter[Which] = (m_counter[Which]+1)&0x0f; // 4 bit counters 74393 - } - int data =(state) | ((m_counter[Which]&7)<<1); // combine output from 8253 with counter bits 0-3 - data<<=4; - if(m_counter[Which]&8) data^=0x0f; // counter bit 4 xors the data ( 7486 x 6) - m_dac[Which]->write(data); // 4 resistor packs : 47k, 100k, 220k, 470k + state ^= 1; // 7404 (6G) + if (!state && m_cnt_out[Which]) // 0->1 rising edge CLK + m_counter[Which] = (m_counter[Which] + 1) & 0x0f; // 4 bit counters 74393 - m_cnt_out[Which]=state; + int data = state | ((m_counter[Which] & 7) << 1); // combine output from 8253 with counter bits 0-3 + if (m_counter[Which] & 8) // counter bit 4 XORs the data (7486 x 6) + data ^= 0x0f; + m_dac[Which]->write(data); // 4 resistor packs: 47k, 100k, 220k, 470k + + m_cnt_out[Which] = state; } void laserbas_state::laserbas_memory(address_map &map) { map(0x0000, 0x3fff).rom(); - map(0x4000, 0xbfff).rw(FUNC(laserbas_state::vram_r), FUNC(laserbas_state::vram_w)); + map(0x4000, 0xbfff).bankrw(m_vrambank); map(0xc000, 0xf7ff).rom().nopw(); map(0xf800, 0xfbff).r(FUNC(laserbas_state::z1_r)).nopw(); /* protection device */ map(0xfc00, 0xffff).ram(); @@ -308,8 +329,8 @@ void laserbas_state::laserbas_io(address_map &map) map(0x11, 0x11).w(FUNC(laserbas_state::videoctrl2_w)); map(0x20, 0x20).portr("DSW"); map(0x21, 0x21).portr("INPUTS"); - map(0x22, 0x22).r(FUNC(laserbas_state::track_hi_r)); - map(0x23, 0x23).r(FUNC(laserbas_state::track_lo_r)); + map(0x22, 0x22).r(FUNC(laserbas_state::track_dir_r)); + map(0x23, 0x23).r(FUNC(laserbas_state::track_val_r)); map(0x20, 0x23).w(FUNC(laserbas_state::out_w)); map(0x40, 0x43).rw("pit0", FUNC(pit8253_device::read), FUNC(pit8253_device::write)); map(0x44, 0x47).rw("pit1", FUNC(pit8253_device::read), FUNC(pit8253_device::write)); @@ -362,10 +383,10 @@ static INPUT_PORTS_START( laserbas ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 ) // service coin PORT_START("TRACK_X") - PORT_BIT( 0x01f, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(30) PORT_KEYDELTA(20) PORT_RESET + PORT_BIT( 0x03f, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(30) PORT_KEYDELTA(20) PORT_START("TRACK_Y") - PORT_BIT( 0x01f, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(30) PORT_KEYDELTA(20) PORT_RESET PORT_REVERSE + PORT_BIT( 0x03f, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(30) PORT_KEYDELTA(20) INPUT_PORTS_END #define CLOCK 16680000 @@ -486,11 +507,9 @@ ROM_START( laserbasa ) ROM_END /* -It was unclear what type of device FF.9 was. The silkscreen on the PCB said -2716, +It was unclear what type of device FF.9 was. The silkscreen on the PCB said 2716, but the device is a masked ROM with its identifying marks rubbed off. -I dumped it -as a 2716 (FF.9), a 2532 like the others (FF.9A) and a 2732 (FF.9B). +I dumped it as a 2716 (FF.9), a 2532 like the others (FF.9A) and a 2732 (FF.9B). */ ROM_START( futflash ) @@ -505,6 +524,8 @@ ROM_START( futflash ) ROM_LOAD( "ff.8", 0xf000, 0x0800, CRC(623f558f) SHA1(be6c6565df658555f21c43a8c2459cf399794a84) ) ROM_END +} // anonymous namespace + GAME( 1980, futflash, 0, laserbas, laserbas, laserbas_state, empty_init, ROT270, "Hoei", "Future Flash", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_COLORS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) GAME( 1981, laserbas, futflash, laserbas, laserbas, laserbas_state, empty_init, ROT270, "Hoei (Amstar license)", "Laser Base (set 1)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_COLORS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) GAME( 1981, laserbasa, futflash, laserbas, laserbas, laserbas_state, empty_init, ROT270, "Hoei (Amstar license)", "Laser Base (set 2)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_COLORS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/taito_h.cpp b/src/mame/drivers/taito_h.cpp index 4de6c2b8d3b..91eb60b9492 100644 --- a/src/mame/drivers/taito_h.cpp +++ b/src/mame/drivers/taito_h.cpp @@ -161,49 +161,25 @@ some kind of zoom table? ***************************************************************************/ -u8 taitoh_state::syvalion_input_bypass_r() +u8 syvalion_state::syvalion_input_bypass_r() { - /* Bypass TC0040IOC controller for analog input */ + // Bypass TC0040IOC controller for trackball input - u8 port = m_tc0040ioc->port_r(); /* read port number */ + u8 port = m_tc0040ioc->port_r(); // read port number switch (port) { - case 0x08: /* trackball y coords bottom 8 bits for 2nd player */ - return m_io_p2y->read(); - - case 0x09: /* trackball y coords top 8 bits for 2nd player */ - if (m_io_p2y->read() & 0x80) /* y- direction (negative value) */ - return 0xff; - else /* y+ direction (positive value) */ - return 0x00; - - case 0x0a: /* trackball x coords bottom 8 bits for 2nd player */ - return m_io_p2x->read(); - - case 0x0b: /* trackball x coords top 8 bits for 2nd player */ - if (m_io_p2x->read() & 0x80) /* x- direction (negative value) */ - return 0xff; - else /* x+ direction (positive value) */ - return 0x00; - - case 0x0c: /* trackball y coords bottom 8 bits for 1st player */ - return m_io_p1y->read(); - - case 0x0d: /* trackball y coords top 8 bits for 1st player */ - if (m_io_p1y->read() & 0x80) /* y- direction (negative value) */ - return 0xff; - else /* y+ direction (positive value) */ - return 0x00; - - case 0x0e: /* trackball x coords bottom 8 bits for 1st player */ - return m_io_p1x->read(); - - case 0x0f: /* trackball x coords top 8 bits for 1st player */ - if (m_io_p1x->read() & 0x80) /* x- direction (negative value) */ - return 0xff; - else /* x+ direction (positive value) */ - return 0x00; + case 0x08: // trackball y coords bottom 8 bits for 2nd player + case 0x0a: // trackball x coords bottom 8 bits for 2nd player + case 0x0c: // trackball y coords bottom 8 bits for 1st player + case 0x0e: // trackball x coords bottom 8 bits for 1st player + return m_io_track[(port - 8) >> 1]->read(); + + case 0x09: // trackball y coords top 8 bits for 2nd player + case 0x0b: // trackball x coords top 8 bits for 2nd player + case 0x0d: // trackball y coords top 8 bits for 1st player + case 0x0f: // trackball x coords top 8 bits for 1st player + return (m_io_track[(port - 8) >> 1]->read() & 0x80) ? 0xff : 0x00; default: return m_tc0040ioc->portreg_r(); @@ -230,11 +206,11 @@ void taitoh_state::coin_control_w(u8 data) ***************************************************************************/ -void taitoh_state::syvalion_map(address_map &map) +void syvalion_state::syvalion_map(address_map &map) { map(0x000000, 0x07ffff).rom(); map(0x100000, 0x10ffff).mirror(0x010000).ram(); - map(0x200001, 0x200001).r(FUNC(taitoh_state::syvalion_input_bypass_r)).w(m_tc0040ioc, FUNC(tc0040ioc_device::portreg_w)).umask16(0x00ff); + map(0x200001, 0x200001).r(FUNC(syvalion_state::syvalion_input_bypass_r)).w(m_tc0040ioc, FUNC(tc0040ioc_device::portreg_w)).umask16(0x00ff); map(0x200003, 0x200003).rw(m_tc0040ioc, FUNC(tc0040ioc_device::port_r), FUNC(tc0040ioc_device::port_w)); map(0x300000, 0x300001).nopr(); map(0x300001, 0x300001).w("tc0140syt", FUNC(tc0140syt_device::master_port_w)); @@ -277,7 +253,7 @@ void taitoh_state::dleague_map(address_map &map) map(0x300003, 0x300003).rw("tc0140syt", FUNC(tc0140syt_device::master_comm_r), FUNC(tc0140syt_device::master_comm_w)); map(0x400000, 0x420fff).rw(m_tc0080vco, FUNC(tc0080vco_device::word_r), FUNC(tc0080vco_device::word_w)); map(0x500800, 0x500fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); - map(0x600000, 0x600001).nopw(); /* ?? writes zero once per frame */ + map(0x600000, 0x600001).nopw(); // ?? writes zero once per frame } @@ -599,35 +575,18 @@ void taitoh_state::machine_start() } -void taitoh_state::syvalion(machine_config &config) +void taitoh_state::taitoh_base(machine_config &config) { - /* basic machine hardware */ - M68000(config, m_maincpu, XTAL(24'000'000) / 2); /* 12 MHz */ - m_maincpu->set_addrmap(AS_PROGRAM, &taitoh_state::syvalion_map); + // basic machine hardware + M68000(config, m_maincpu, XTAL(24'000'000) / 2); // 12 MHz m_maincpu->set_vblank_int("screen", FUNC(taitoh_state::irq2_line_hold)); - Z80(config, m_audiocpu, XTAL(8'000'000) / 2); /* 4 MHz ??? */ + Z80(config, m_audiocpu, XTAL(8'000'000) / 2); // 4 MHz ??? m_audiocpu->set_addrmap(AS_PROGRAM, &taitoh_state::sound_map); config.set_maximum_quantum(attotime::from_hz(600)); - TC0040IOC(config, m_tc0040ioc, 0); - m_tc0040ioc->read_0_callback().set_ioport("DSWA"); - m_tc0040ioc->read_1_callback().set_ioport("DSWB"); - m_tc0040ioc->read_2_callback().set_ioport("IN0"); - m_tc0040ioc->read_3_callback().set_ioport("IN1"); - m_tc0040ioc->write_4_callback().set(FUNC(taitoh_state::coin_control_w)); - m_tc0040ioc->read_7_callback().set_ioport("IN2"); - - /* video hardware */ - screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); - screen.set_refresh_hz(60); - screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); - screen.set_size(64*16, 64*16); - screen.set_visarea(0*16, 32*16-1, 3*16, 28*16-1); - screen.set_screen_update(FUNC(taitoh_state::screen_update_syvalion)); - screen.set_palette(m_palette); - + // video hardware PALETTE(config, m_palette).set_format(palette_device::xBGR_555, 33*16); TC0080VCO(config, m_tc0080vco, 0); @@ -635,7 +594,7 @@ void taitoh_state::syvalion(machine_config &config) m_tc0080vco->set_bgflip_yoffs(-2); m_tc0080vco->set_palette(m_palette); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); ym2610_device &ymsnd(YM2610(config, "ymsnd", XTAL(8'000'000))); @@ -649,61 +608,63 @@ void taitoh_state::syvalion(machine_config &config) tc0140syt.set_slave_tag(m_audiocpu); } -void taitoh_state::recordbr(machine_config &config) +void syvalion_state::syvalion(machine_config &config) { - /* basic machine hardware */ - M68000(config, m_maincpu, XTAL(24'000'000) / 2); /* 12 MHz */ - m_maincpu->set_addrmap(AS_PROGRAM, &taitoh_state::recordbr_map); - m_maincpu->set_vblank_int("screen", FUNC(taitoh_state::irq2_line_hold)); - - Z80(config, m_audiocpu, XTAL(8'000'000) / 2); /* 4 MHz */ - m_audiocpu->set_addrmap(AS_PROGRAM, &taitoh_state::sound_map); + taitoh_base(config); - config.set_maximum_quantum(attotime::from_hz(600)); + // basic machine hardware + m_maincpu->set_addrmap(AS_PROGRAM, &syvalion_state::syvalion_map); TC0040IOC(config, m_tc0040ioc, 0); m_tc0040ioc->read_0_callback().set_ioport("DSWA"); m_tc0040ioc->read_1_callback().set_ioport("DSWB"); m_tc0040ioc->read_2_callback().set_ioport("IN0"); m_tc0040ioc->read_3_callback().set_ioport("IN1"); - m_tc0040ioc->write_4_callback().set(FUNC(taitoh_state::coin_control_w)); + m_tc0040ioc->write_4_callback().set(FUNC(syvalion_state::coin_control_w)); m_tc0040ioc->read_7_callback().set_ioport("IN2"); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(60); screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); screen.set_size(64*16, 64*16); - screen.set_visarea(1*16, 21*16-1, 2*16, 17*16-1); - screen.set_screen_update(FUNC(taitoh_state::screen_update_recordbr)); + screen.set_visarea(0*16, 32*16-1, 3*16, 28*16-1); + screen.set_screen_update(FUNC(syvalion_state::screen_update_syvalion)); screen.set_palette(m_palette); +} - PALETTE(config, m_palette).set_format(palette_device::xBGR_555, 32*16); +void taitoh_state::recordbr(machine_config &config) +{ + taitoh_base(config); - TC0080VCO(config, m_tc0080vco, 0); - m_tc0080vco->set_offsets(1, 1); - m_tc0080vco->set_bgflip_yoffs(-2); - m_tc0080vco->set_palette(m_palette); + // basic machine hardware + m_maincpu->set_addrmap(AS_PROGRAM, &taitoh_state::recordbr_map); - /* sound hardware */ - SPEAKER(config, "mono").front_center(); + TC0040IOC(config, m_tc0040ioc, 0); + m_tc0040ioc->read_0_callback().set_ioport("DSWA"); + m_tc0040ioc->read_1_callback().set_ioport("DSWB"); + m_tc0040ioc->read_2_callback().set_ioport("IN0"); + m_tc0040ioc->read_3_callback().set_ioport("IN1"); + m_tc0040ioc->write_4_callback().set(FUNC(taitoh_state::coin_control_w)); + m_tc0040ioc->read_7_callback().set_ioport("IN2"); - ym2610_device &ymsnd(YM2610(config, "ymsnd", XTAL(8'000'000))); - ymsnd.irq_handler().set_inputline(m_audiocpu, 0); - ymsnd.add_route(0, "mono", 0.25); - ymsnd.add_route(1, "mono", 1.0); - ymsnd.add_route(2, "mono", 1.0); + // video hardware + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(64*16, 64*16); + screen.set_visarea(1*16, 21*16-1, 2*16, 17*16-1); + screen.set_screen_update(FUNC(taitoh_state::screen_update_recordbr)); + screen.set_palette(m_palette); - tc0140syt_device &tc0140syt(TC0140SYT(config, "tc0140syt", 0)); - tc0140syt.set_master_tag(m_maincpu); - tc0140syt.set_slave_tag(m_audiocpu); + m_palette->set_entries(32*16); } void taitoh_state::tetristh(machine_config &config) { recordbr(config); - /* basic machine hardware */ + // basic machine hardware m_maincpu->set_addrmap(AS_PROGRAM, &taitoh_state::tetristh_map); m_palette->set_entries(0x800/2); @@ -711,15 +672,10 @@ void taitoh_state::tetristh(machine_config &config) void taitoh_state::dleague(machine_config &config) { - /* basic machine hardware */ - M68000(config, m_maincpu, XTAL(24'000'000) / 2); /* 12 MHz */ - m_maincpu->set_addrmap(AS_PROGRAM, &taitoh_state::dleague_map); - m_maincpu->set_vblank_int("screen", FUNC(taitoh_state::irq1_line_hold)); + taitoh_base(config); - Z80(config, m_audiocpu, XTAL(8'000'000) / 2); /* 4 MHz ??? */ - m_audiocpu->set_addrmap(AS_PROGRAM, &taitoh_state::sound_map); - - config.set_maximum_quantum(attotime::from_hz(600)); + // basic machine hardware + m_maincpu->set_addrmap(AS_PROGRAM, &taitoh_state::dleague_map); tc0220ioc_device &tc0220ioc(TC0220IOC(config, "tc0220ioc", 0)); tc0220ioc.read_0_callback().set_ioport("DSWA"); @@ -729,7 +685,7 @@ void taitoh_state::dleague(machine_config &config) tc0220ioc.write_4_callback().set(FUNC(taitoh_state::coin_control_w)); tc0220ioc.read_7_callback().set_ioport("IN2"); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(60); screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); @@ -737,26 +693,6 @@ void taitoh_state::dleague(machine_config &config) screen.set_visarea(1*16, 21*16-1, 2*16, 17*16-1); screen.set_screen_update(FUNC(taitoh_state::screen_update_dleague)); screen.set_palette(m_palette); - - PALETTE(config, m_palette).set_format(palette_device::xBGR_555, 33*16); - - TC0080VCO(config, m_tc0080vco, 0); - m_tc0080vco->set_offsets(1, 1); - m_tc0080vco->set_bgflip_yoffs(-2); - m_tc0080vco->set_palette(m_palette); - - /* sound hardware */ - SPEAKER(config, "mono").front_center(); - - ym2610_device &ymsnd(YM2610(config, "ymsnd", XTAL(8'000'000))); - ymsnd.irq_handler().set_inputline(m_audiocpu, 0); - ymsnd.add_route(0, "mono", 0.25); - ymsnd.add_route(1, "mono", 1.0); - ymsnd.add_route(2, "mono", 1.0); - - tc0140syt_device &tc0140syt(TC0140SYT(config, "tc0140syt", 0)); - tc0140syt.set_master_tag(m_maincpu); - tc0140syt.set_slave_tag(m_audiocpu); } @@ -1073,13 +1009,13 @@ ROM_START( dleaguej ) ROM_END -// YEAR NAME PARENT MACHINE INPUT STATE INIT MONITOR COMPANY FULLNAME FLAGS -GAME( 1988, syvalion, 0, syvalion, syvalion, taitoh_state, empty_init, ROT0, "Taito Corporation", "Syvalion (Japan)", MACHINE_SUPPORTS_SAVE ) -GAME( 1988, syvalionp, syvalion, syvalion, syvalionp, taitoh_state, empty_init, ROT0, "Taito Corporation", "Syvalion (World, prototype)", MACHINE_SUPPORTS_SAVE ) -GAME( 1988, syvalionu, syvalion, syvalion, syvalion, taitoh_state, empty_init, ROT0, "Taito America Corporation", "Syvalion (US, PS2 Taito Legends 2)", MACHINE_SUPPORTS_SAVE ) -GAME( 1988, syvalionw, syvalion, syvalion, syvalion, taitoh_state, empty_init, ROT0, "Taito Corporation Japan", "Syvalion (World, PS2 Taito Legends 2)", MACHINE_SUPPORTS_SAVE ) -GAME( 1988, recordbr, 0, recordbr, recordbr, taitoh_state, empty_init, ROT0, "Taito Corporation Japan", "Recordbreaker (World)", MACHINE_SUPPORTS_SAVE ) -GAME( 1988, gogold, recordbr, recordbr, gogold, taitoh_state, empty_init, ROT0, "Taito Corporation", "Go For The Gold (Japan)", MACHINE_SUPPORTS_SAVE ) -GAME( 1988, tetristh, tetris, tetristh, tetristh, taitoh_state, empty_init, ROT0, "Sega", "Tetris (Japan, Taito H-System)", MACHINE_SUPPORTS_SAVE ) -GAME( 1990, dleague, 0, dleague, dleague, taitoh_state, empty_init, ROT0, "Taito America Corporation", "Dynamite League (US)", MACHINE_SUPPORTS_SAVE ) -GAME( 1990, dleaguej, dleague, dleague, dleaguej, taitoh_state, empty_init, ROT0, "Taito Corporation", "Dynamite League (Japan)", MACHINE_SUPPORTS_SAVE ) +// YEAR NAME PARENT MACHINE INPUT STATE INIT MONITOR COMPANY FULLNAME FLAGS +GAME( 1988, syvalion, 0, syvalion, syvalion, syvalion_state, empty_init, ROT0, "Taito Corporation", "Syvalion (Japan)", MACHINE_SUPPORTS_SAVE ) +GAME( 1988, syvalionp, syvalion, syvalion, syvalionp, syvalion_state, empty_init, ROT0, "Taito Corporation", "Syvalion (World, prototype)", MACHINE_SUPPORTS_SAVE ) +GAME( 1988, syvalionu, syvalion, syvalion, syvalion, syvalion_state, empty_init, ROT0, "Taito America Corporation", "Syvalion (US, PS2 Taito Legends 2)", MACHINE_SUPPORTS_SAVE ) +GAME( 1988, syvalionw, syvalion, syvalion, syvalion, syvalion_state, empty_init, ROT0, "Taito Corporation Japan", "Syvalion (World, PS2 Taito Legends 2)", MACHINE_SUPPORTS_SAVE ) +GAME( 1988, recordbr, 0, recordbr, recordbr, taitoh_state, empty_init, ROT0, "Taito Corporation Japan", "Recordbreaker (World)", MACHINE_SUPPORTS_SAVE ) +GAME( 1988, gogold, recordbr, recordbr, gogold, taitoh_state, empty_init, ROT0, "Taito Corporation", "Go For The Gold (Japan)", MACHINE_SUPPORTS_SAVE ) +GAME( 1988, tetristh, tetris, tetristh, tetristh, taitoh_state, empty_init, ROT0, "Sega", "Tetris (Japan, Taito H-System)", MACHINE_SUPPORTS_SAVE ) +GAME( 1990, dleague, 0, dleague, dleague, taitoh_state, empty_init, ROT0, "Taito America Corporation", "Dynamite League (US)", MACHINE_SUPPORTS_SAVE ) +GAME( 1990, dleaguej, dleague, dleague, dleaguej, taitoh_state, empty_init, ROT0, "Taito Corporation", "Dynamite League (Japan)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/includes/segag80r.h b/src/mame/includes/segag80r.h index fe04be66d4d..22af51fca06 100644 --- a/src/mame/includes/segag80r.h +++ b/src/mame/includes/segag80r.h @@ -14,10 +14,12 @@ #include "audio/segag80r.h" #include "audio/segaspeech.h" #include "audio/segausb.h" + #include "machine/i8255.h" #include "machine/segag80.h" #include "sound/samples.h" #include "sound/sn76496.h" + #include "emupal.h" #include "screen.h" #include "tilemap.h" diff --git a/src/mame/includes/segag80v.h b/src/mame/includes/segag80v.h index 166ef3e499d..4106ade06be 100644 --- a/src/mame/includes/segag80v.h +++ b/src/mame/includes/segag80v.h @@ -5,10 +5,15 @@ Sega vector hardware *************************************************************************/ +#ifndef MAME_INCLUDES_SEGAG80V_H +#define MAME_INCLUDES_SEGAG80V_H +#pragma once + +#include "audio/segag80.h" #include "audio/segaspeech.h" #include "audio/segausb.h" -#include "audio/segag80.h" + #include "cpu/z80/z80.h" #include "machine/segag80.h" #include "sound/ay8910.h" @@ -166,3 +171,5 @@ private: void spacfurybl_speech_prg_map(address_map &map); void spacfurybl_speech_io_map(address_map &map); }; + +#endif // MAME_INCLUDES_SEGAG80V_H diff --git a/src/mame/includes/taito_h.h b/src/mame/includes/taito_h.h index 78e1b9e9cef..ce4bba3ea88 100644 --- a/src/mame/includes/taito_h.h +++ b/src/mame/includes/taito_h.h @@ -25,15 +25,10 @@ public: m_tc0080vco(*this, "tc0080vco"), m_tc0040ioc(*this, "tc0040ioc"), m_palette(*this, "palette"), - m_z80bank(*this, "z80bank"), - m_io_p1x(*this, "P1X"), - m_io_p1y(*this, "P1Y"), - m_io_p2x(*this, "P2X"), - m_io_p2y(*this, "P2Y") + m_z80bank(*this, "z80bank") { } void recordbr(machine_config &config); - void syvalion(machine_config &config); void dleague(machine_config &config); void tetristh(machine_config &config); @@ -41,8 +36,7 @@ protected: virtual void machine_start() override; virtual void machine_reset() override; -private: - /* devices */ + // devices required_device m_maincpu; required_device m_audiocpu; required_device m_tc0080vco; @@ -51,26 +45,43 @@ private: required_memory_bank m_z80bank; - optional_ioport m_io_p1x; - optional_ioport m_io_p1y; - optional_ioport m_io_p2x; - optional_ioport m_io_p2y; + void taitoh_base(machine_config &config); void coin_control_w(u8 data); - u8 syvalion_input_bypass_r(); + void taitoh_log_vram(); + +private: void sound_bankswitch_w(u8 data); - u32 screen_update_syvalion(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); u32 screen_update_recordbr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); u32 screen_update_dleague(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void syvalion_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); void recordbr_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int priority); void dleague_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int priority); - void taitoh_log_vram(); + void dleague_map(address_map &map); void recordbr_map(address_map &map); void sound_map(address_map &map); - void syvalion_map(address_map &map); void tetristh_map(address_map &map); }; + +class syvalion_state : public taitoh_state +{ +public: + syvalion_state(const machine_config &mconfig, device_type type, const char *tag) : + taitoh_state(mconfig, type, tag), + m_io_track(*this, { "P2Y", "P2X", "P1Y", "P1X" }) + { } + + void syvalion(machine_config &config); + +private: + required_ioport_array<4> m_io_track; + + u8 syvalion_input_bypass_r(); + + u32 screen_update_syvalion(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void syvalion_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); + void syvalion_map(address_map &map); +}; + #endif // MAME_INCLUDES_TAITO_H_H diff --git a/src/mame/video/taito_h.cpp b/src/mame/video/taito_h.cpp index 8153dc5893a..061cf4d6ac4 100644 --- a/src/mame/video/taito_h.cpp +++ b/src/mame/video/taito_h.cpp @@ -55,7 +55,7 @@ sprite RAM Screen refresh ***************************************************************************/ -void taitoh_state::syvalion_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) +void syvalion_state::syvalion_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) { for (int offs = 0x03f8 / 2; offs >= 0; offs -= 0x008 / 2) { @@ -120,7 +120,7 @@ void taitoh_state::taitoh_log_vram() /**************************************************************************/ -u32 taitoh_state::screen_update_syvalion(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +u32 syvalion_state::screen_update_syvalion(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_tc0080vco->tilemap_update(); -- cgit v1.2.3