rohga.cpp, seta.cpp: More cleanup.

* seta.cpp: Split a bit more off from base class.
* roha.cpp: Factored out common machine configuration.
This commit is contained in:
Vas Crabb 2022-06-15 07:27:45 +10:00
parent b911bd29a5
commit 7604944670
4 changed files with 136 additions and 274 deletions

View File

@ -117,11 +117,14 @@
#include "emu.h"
#include "includes/rohga.h"
#include "cpu/m68000/m68000.h"
#include "machine/decocrpt.h"
#include "cpu/m68000/m68000.h"
#include "sound/ymopm.h"
#include "screen.h"
#include "speaker.h"
#include <algorithm>
@ -295,12 +298,14 @@ void rohga_state::hotb_base_map(address_map &map)
void rohga_state::schmeisr_map(address_map &map)
{
hotb_base_map(map);
map(0xff0000, 0xff7fff).ram(); /* Main ram */
}
void rohga_state::hangzo_map(address_map &map)
{
hotb_base_map(map);
map(0x3f0000, 0x3f3fff).ram(); /* Main ram */
}
@ -861,14 +866,13 @@ DECOSPR_COLOUR_CB_MEMBER(rohga_state::schmeisr_col_callback)
return colour;
}
void rohga_state::rohga(machine_config &config)
void rohga_state::rohga_base(machine_config &config)
{
/* basic machine hardware */
M68000(config, m_maincpu, 14000000);
m_maincpu->set_addrmap(AS_PROGRAM, &rohga_state::rohga_map);
M68000(config, m_maincpu, 14'000'000);
m_maincpu->set_vblank_int("screen", FUNC(rohga_state::irq6_line_assert));
H6280(config, m_audiocpu, 32220000/4/3); /* verified on pcb (8.050Mhz is XIN on pin 10 of H6280 */
H6280(config, m_audiocpu, 32'220'000/4/3); /* verified on pcb (8.050Mhz is XIN on pin 10 of H6280 */
m_audiocpu->set_addrmap(AS_PROGRAM, &rohga_state::sound_map);
m_audiocpu->add_route(ALL_OUTPUTS, "lspeaker", 0); // internal sound unused
m_audiocpu->add_route(ALL_OUTPUTS, "rspeaker", 0);
@ -881,10 +885,7 @@ void rohga_state::rohga(machine_config &config)
screen.set_vblank_time(ATTOSECONDS_IN_USEC(529));
screen.set_size(40*8, 32*8);
screen.set_visarea(0*8, 40*8-1, 1*8, 31*8-1);
screen.set_screen_update(FUNC(rohga_state::screen_update_rohga));
screen.set_palette(m_palette);
GFXDECODE(config, "gfxdecode", m_palette, gfx_rohga);
PALETTE(config, m_palette).set_entries(2048);
DECOCOMN(config, m_decocomn, 0);
@ -917,8 +918,6 @@ void rohga_state::rohga(machine_config &config)
m_deco_tilegen[1]->set_gfxdecode_tag("gfxdecode");
DECO_SPRITE(config, m_sprgen[0], 0);
m_sprgen[0]->set_pri_callback(FUNC(rohga_state::rohga_pri_callback));
m_sprgen[0]->set_col_callback(FUNC(rohga_state::rohga_col_callback));
m_sprgen[0]->set_gfx_region(3);
m_sprgen[0]->set_gfxdecode_tag("gfxdecode");
@ -932,170 +931,91 @@ void rohga_state::rohga(machine_config &config)
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
ym2151_device &ymsnd(YM2151(config, "ymsnd", 32220000/9));
ym2151_device &ymsnd(YM2151(config, "ymsnd", 32'220'000/9));
ymsnd.irq_handler().set_inputline(m_audiocpu, 1); /* IRQ2 */
ymsnd.port_write_handler().set(FUNC(rohga_state::sound_bankswitch_w));
ymsnd.add_route(0, "lspeaker", 0.36);
ymsnd.add_route(1, "rspeaker", 0.36);
OKIM6295(config, m_oki[0], 32220000/32, okim6295_device::PIN7_HIGH);
OKIM6295(config, m_oki[0], 32'220'000/32, okim6295_device::PIN7_HIGH);
m_oki[0]->add_route(ALL_OUTPUTS, "lspeaker", 0.46);
m_oki[0]->add_route(ALL_OUTPUTS, "rspeaker", 0.46);
OKIM6295(config, m_oki[1], 32220000/16, okim6295_device::PIN7_HIGH);
OKIM6295(config, m_oki[1], 32'220'000/16, okim6295_device::PIN7_HIGH);
m_oki[1]->add_route(ALL_OUTPUTS, "lspeaker", 0.18);
m_oki[1]->add_route(ALL_OUTPUTS, "rspeaker", 0.18);
}
void rohga_state::wizdfire(machine_config &config)
void rohga_state::rohga(machine_config &config)
{
/* basic machine hardware */
M68000(config, m_maincpu, 14000000);
m_maincpu->set_addrmap(AS_PROGRAM, &rohga_state::wizdfire_map);
m_maincpu->set_vblank_int("screen", FUNC(rohga_state::irq6_line_assert));
rohga_base(config);
H6280(config, m_audiocpu, 32220000/4/3); /* verified on pcb (8.050Mhz is XIN on pin 10 of H6280 */
m_audiocpu->set_addrmap(AS_PROGRAM, &rohga_state::sound_map);
m_audiocpu->add_route(ALL_OUTPUTS, "lspeaker", 0); // internal sound unused
m_audiocpu->add_route(ALL_OUTPUTS, "rspeaker", 0);
/* basic machine hardware */
m_maincpu->set_addrmap(AS_PROGRAM, &rohga_state::rohga_map);
/* video hardware */
BUFFERED_SPRITERAM16(config, m_spriteram[0]);
subdevice<screen_device>("screen")->set_screen_update(FUNC(rohga_state::screen_update_rohga));
subdevice<screen_device>("screen")->set_palette(m_palette);
GFXDECODE(config, "gfxdecode", m_palette, gfx_rohga);
m_sprgen[0]->set_pri_callback(FUNC(rohga_state::rohga_pri_callback));
m_sprgen[0]->set_col_callback(FUNC(rohga_state::rohga_col_callback));
}
void rohga_state::wizdfire(machine_config &config)
{
rohga_base(config);
/* basic machine hardware */
m_maincpu->set_addrmap(AS_PROGRAM, &rohga_state::wizdfire_map);
/* video hardware */
BUFFERED_SPRITERAM16(config, m_spriteram[1]);
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
screen.set_refresh_hz(58);
screen.set_vblank_time(ATTOSECONDS_IN_USEC(529));
screen.set_size(40*8, 32*8);
screen.set_visarea(0*8, 40*8-1, 1*8, 31*8-1);
screen.set_screen_update(FUNC(rohga_state::screen_update_wizdfire));
subdevice<screen_device>("screen")->set_screen_update(FUNC(rohga_state::screen_update_wizdfire));
GFXDECODE(config, "gfxdecode", m_palette, gfx_wizdfire);
PALETTE(config, m_palette).set_entries(2048);
DECOCOMN(config, m_decocomn, 0);
m_decocomn->set_palette_tag(m_palette);
DECO16IC(config, m_deco_tilegen[0], 0);
m_deco_tilegen[0]->set_pf1_size(DECO_64x32);
m_deco_tilegen[0]->set_pf2_size(DECO_64x32);
m_deco_tilegen[0]->set_pf1_col_bank(0x00);
m_deco_tilegen[0]->set_pf2_col_bank(0x10);
m_deco_tilegen[0]->set_pf1_col_mask(0x0f);
m_deco_tilegen[0]->set_pf2_col_mask(0x0f);
m_deco_tilegen[0]->set_bank1_callback(FUNC(rohga_state::bank_callback));
m_deco_tilegen[0]->set_bank2_callback(FUNC(rohga_state::bank_callback));
m_deco_tilegen[0]->set_pf12_8x8_bank(0);
m_deco_tilegen[0]->set_pf12_16x16_bank(1);
m_deco_tilegen[0]->set_gfxdecode_tag("gfxdecode");
DECO16IC(config, m_deco_tilegen[1], 0);
m_deco_tilegen[1]->set_pf1_size(DECO_64x32);
m_deco_tilegen[1]->set_pf2_size(DECO_64x32);
m_deco_tilegen[1]->set_pf1_col_bank(0x00);
m_deco_tilegen[1]->set_pf2_col_bank(0x10);
m_deco_tilegen[1]->set_pf1_col_mask(0x0f);
m_deco_tilegen[1]->set_pf2_col_mask(0x0f);
m_deco_tilegen[1]->set_bank1_callback(FUNC(rohga_state::bank_callback));
m_deco_tilegen[1]->set_bank2_callback(FUNC(rohga_state::bank_callback));
m_deco_tilegen[1]->set_pf12_8x8_bank(0);
m_deco_tilegen[1]->set_pf12_16x16_bank(2);
m_deco_tilegen[1]->set_gfxdecode_tag("gfxdecode");
DECO_SPRITE(config, m_sprgen[0], 0);
m_sprgen[0]->set_gfx_region(3);
m_sprgen[0]->set_gfxdecode_tag("gfxdecode");
DECO_SPRITE(config, m_sprgen[1], 0);
m_sprgen[1]->set_gfx_region(4);
m_sprgen[1]->set_gfxdecode_tag("gfxdecode");
DECO104PROT(config, m_ioprot, 0);
m_ioprot->port_a_cb().set_ioport("INPUTS");
m_ioprot->port_b_cb().set_ioport("SYSTEM");
m_ioprot->port_c_cb().set_ioport("DSW");
m_ioprot->soundlatch_irq_cb().set_inputline("audiocpu", 0);
m_ioprot->set_interface_scramble_reverse();
MCFG_VIDEO_START_OVERRIDE(rohga_state, wizdfire)
/* sound hardware */
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
ym2151_device &ymsnd(YM2151(config, "ymsnd", 32220000/9));
ymsnd.irq_handler().set_inputline(m_audiocpu, 1); /* IRQ2 */
ymsnd.port_write_handler().set(FUNC(rohga_state::sound_bankswitch_w));
ymsnd.add_route(0, "lspeaker", 0.36);
ymsnd.add_route(1, "rspeaker", 0.36);
OKIM6295(config, m_oki[0], 32220000/32, okim6295_device::PIN7_HIGH);
m_oki[0]->add_route(ALL_OUTPUTS, "lspeaker", 0.46);
m_oki[0]->add_route(ALL_OUTPUTS, "rspeaker", 0.46);
OKIM6295(config, m_oki[1], 32220000/16, okim6295_device::PIN7_HIGH);
m_oki[1]->add_route(ALL_OUTPUTS, "lspeaker", 0.18);
m_oki[1]->add_route(ALL_OUTPUTS, "rspeaker", 0.18);
}
void rohga_state::nitrobal(machine_config &config)
{
/* basic machine hardware */
M68000(config, m_maincpu, 14000000);
m_maincpu->set_addrmap(AS_PROGRAM, &rohga_state::nitrobal_map);
m_maincpu->set_vblank_int("screen", FUNC(rohga_state::irq6_line_assert));
rohga_base(config);
H6280(config, m_audiocpu, 32220000/4/3); /* verified on pcb (8.050Mhz is XIN on pin 10 of H6280 */
m_audiocpu->set_addrmap(AS_PROGRAM, &rohga_state::sound_map);
m_audiocpu->add_route(ALL_OUTPUTS, "lspeaker", 0); // internal sound unused
m_audiocpu->add_route(ALL_OUTPUTS, "rspeaker", 0);
/* basic machine hardware */
m_maincpu->set_addrmap(AS_PROGRAM, &rohga_state::nitrobal_map);
/* video hardware */
BUFFERED_SPRITERAM16(config, m_spriteram[0]);
BUFFERED_SPRITERAM16(config, m_spriteram[1]);
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
screen.set_refresh_hz(58);
screen.set_vblank_time(ATTOSECONDS_IN_USEC(529));
screen.set_size(40*8, 32*8);
screen.set_visarea(0*8, 40*8-1, 1*8, 31*8-1);
screen.set_screen_update(FUNC(rohga_state::screen_update_nitrobal));
subdevice<screen_device>("screen")->set_screen_update(FUNC(rohga_state::screen_update_nitrobal));
GFXDECODE(config, "gfxdecode", m_palette, gfx_wizdfire);
PALETTE(config, m_palette).set_entries(2048);
DECOCOMN(config, m_decocomn, 0);
m_decocomn->set_palette_tag(m_palette);
DECO16IC(config, m_deco_tilegen[0], 0);
m_deco_tilegen[0]->set_pf1_size(DECO_64x32);
m_deco_tilegen[0]->set_pf2_size(DECO_32x32);
m_deco_tilegen[0]->set_pf1_col_bank(0x00);
m_deco_tilegen[0]->set_pf2_col_bank(0x10);
m_deco_tilegen[0]->set_pf1_col_mask(0x0f);
m_deco_tilegen[0]->set_pf2_col_mask(0x0f);
m_deco_tilegen[0]->set_bank1_callback(FUNC(rohga_state::bank_callback));
m_deco_tilegen[0]->set_bank2_callback(FUNC(rohga_state::bank_callback));
m_deco_tilegen[0]->set_pf12_8x8_bank(0);
m_deco_tilegen[0]->set_pf12_16x16_bank(1);
m_deco_tilegen[0]->set_gfxdecode_tag("gfxdecode");
DECO16IC(config, m_deco_tilegen[1], 0);
m_deco_tilegen[1]->set_pf1_size(DECO_32x32);
m_deco_tilegen[1]->set_pf2_size(DECO_32x32);
m_deco_tilegen[1]->set_pf1_col_bank(0);
m_deco_tilegen[1]->set_pf2_col_bank(0);
m_deco_tilegen[1]->set_pf1_col_mask(0);
m_deco_tilegen[1]->set_pf2_col_mask(0);
m_deco_tilegen[1]->set_bank1_callback(FUNC(rohga_state::bank_callback));
m_deco_tilegen[1]->set_bank2_callback(FUNC(rohga_state::bank_callback));
m_deco_tilegen[1]->set_pf12_8x8_bank(0);
m_deco_tilegen[1]->set_pf12_16x16_bank(2);
m_deco_tilegen[1]->set_gfxdecode_tag("gfxdecode");
DECO_SPRITE(config, m_sprgen[0], 0);
m_sprgen[0]->set_gfx_region(3);
m_sprgen[0]->set_gfxdecode_tag("gfxdecode");
DECO_SPRITE(config, m_sprgen[1], 0);
m_sprgen[1]->set_gfx_region(4);
@ -1103,121 +1023,27 @@ void rohga_state::nitrobal(machine_config &config)
MCFG_VIDEO_START_OVERRIDE(rohga_state, wizdfire)
DECO146PROT(config, m_ioprot, 0);
m_ioprot->port_a_cb().set_ioport("INPUTS");
m_ioprot->port_b_cb().set_ioport("SYSTEM");
m_ioprot->port_c_cb().set_ioport("DSW");
m_ioprot->soundlatch_irq_cb().set_inputline(m_audiocpu, 0);
m_ioprot->set_interface_scramble_reverse();
m_ioprot->set_use_magic_read_address_xor(true);
/* sound hardware */
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
ym2151_device &ymsnd(YM2151(config, "ymsnd", 32220000/9));
ymsnd.irq_handler().set_inputline(m_audiocpu, 1); /* IRQ2 */
ymsnd.port_write_handler().set(FUNC(rohga_state::sound_bankswitch_w));
ymsnd.add_route(0, "lspeaker", 0.36);
ymsnd.add_route(1, "rspeaker", 0.36);
OKIM6295(config, m_oki[0], 32220000/32, okim6295_device::PIN7_HIGH);
m_oki[0]->add_route(ALL_OUTPUTS, "lspeaker", 0.46);
m_oki[0]->add_route(ALL_OUTPUTS, "rspeaker", 0.46);
OKIM6295(config, m_oki[1], 32220000/16, okim6295_device::PIN7_HIGH);
m_oki[1]->add_route(ALL_OUTPUTS, "lspeaker", 0.18);
m_oki[1]->add_route(ALL_OUTPUTS, "rspeaker", 0.18);
}
void rohga_state::schmeisr(machine_config &config)
{
/* basic machine hardware */
M68000(config, m_maincpu, 14000000);
m_maincpu->set_addrmap(AS_PROGRAM, &rohga_state::schmeisr_map);
m_maincpu->set_vblank_int("screen", FUNC(rohga_state::irq6_line_assert));
rohga_base(config);
H6280(config, m_audiocpu, 32220000/4/3); /* verified on pcb (8.050Mhz is XIN on pin 10 of H6280 */
m_audiocpu->set_addrmap(AS_PROGRAM, &rohga_state::sound_map);
m_audiocpu->add_route(ALL_OUTPUTS, "lspeaker", 0); // internal sound unused
m_audiocpu->add_route(ALL_OUTPUTS, "rspeaker", 0);
/* basic machine hardware */
m_maincpu->set_addrmap(AS_PROGRAM, &rohga_state::schmeisr_map);
/* video hardware */
BUFFERED_SPRITERAM16(config, m_spriteram[0]);
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
screen.set_refresh_hz(58);
screen.set_vblank_time(ATTOSECONDS_IN_USEC(529));
screen.set_size(40*8, 32*8);
screen.set_visarea(0*8, 40*8-1, 1*8, 31*8-1);
screen.set_screen_update(FUNC(rohga_state::screen_update_rohga));
screen.set_palette(m_palette);
subdevice<screen_device>("screen")->set_screen_update(FUNC(rohga_state::screen_update_rohga));
subdevice<screen_device>("screen")->set_palette(m_palette);
GFXDECODE(config, "gfxdecode", m_palette, gfx_schmeisr);
PALETTE(config, m_palette).set_entries(2048);
DECOCOMN(config, m_decocomn, 0);
m_decocomn->set_palette_tag(m_palette);
DECO16IC(config, m_deco_tilegen[0], 0);
m_deco_tilegen[0]->set_pf1_size(DECO_64x64);
m_deco_tilegen[0]->set_pf2_size(DECO_64x32);
m_deco_tilegen[0]->set_pf1_col_bank(0x00);
m_deco_tilegen[0]->set_pf2_col_bank(0x10);
m_deco_tilegen[0]->set_pf1_col_mask(0x0f);
m_deco_tilegen[0]->set_pf2_col_mask(0x0f);
m_deco_tilegen[0]->set_bank1_callback(FUNC(rohga_state::bank_callback));
m_deco_tilegen[0]->set_bank2_callback(FUNC(rohga_state::bank_callback));
m_deco_tilegen[0]->set_pf12_8x8_bank(0);
m_deco_tilegen[0]->set_pf12_16x16_bank(1);
m_deco_tilegen[0]->set_gfxdecode_tag("gfxdecode");
DECO16IC(config, m_deco_tilegen[1], 0);
m_deco_tilegen[1]->set_pf1_size(DECO_64x32);
m_deco_tilegen[1]->set_pf2_size(DECO_64x32);
m_deco_tilegen[1]->set_pf1_col_bank(0x00);
m_deco_tilegen[1]->set_pf2_col_bank(0x10);
m_deco_tilegen[1]->set_pf1_col_mask(0x0f);
m_deco_tilegen[1]->set_pf2_col_mask(0x0f);
m_deco_tilegen[1]->set_bank1_callback(FUNC(rohga_state::bank_callback));
m_deco_tilegen[1]->set_bank2_callback(FUNC(rohga_state::bank_callback));
m_deco_tilegen[1]->set_pf12_8x8_bank(0);
m_deco_tilegen[1]->set_pf12_16x16_bank(2);
m_deco_tilegen[1]->set_gfxdecode_tag("gfxdecode");
DECO_SPRITE(config, m_sprgen[0], 0);
m_sprgen[0]->set_pri_callback(FUNC(rohga_state::rohga_pri_callback));
m_sprgen[0]->set_col_callback(FUNC(rohga_state::schmeisr_col_callback)); // wire mods on pcb...
m_sprgen[0]->set_gfx_region(3);
m_sprgen[0]->set_gfxdecode_tag("gfxdecode");
DECO104PROT(config, m_ioprot, 0);
m_ioprot->port_a_cb().set_ioport("INPUTS");
m_ioprot->port_b_cb().set_ioport("SYSTEM");
m_ioprot->port_c_cb().set_ioport("DSW");
m_ioprot->soundlatch_irq_cb().set_inputline("audiocpu", 0);
/* sound hardware */
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
ym2151_device &ymsnd(YM2151(config, "ymsnd", 32220000/9));
ymsnd.irq_handler().set_inputline(m_audiocpu, 1); /* IRQ2 */
ymsnd.port_write_handler().set(FUNC(rohga_state::sound_bankswitch_w));
ymsnd.add_route(0, "lspeaker", 0.36);
ymsnd.add_route(1, "rspeaker", 0.36);
OKIM6295(config, m_oki[0], 32220000/32, okim6295_device::PIN7_HIGH);
m_oki[0]->add_route(ALL_OUTPUTS, "lspeaker", 0.46);
m_oki[0]->add_route(ALL_OUTPUTS, "rspeaker", 0.46);
OKIM6295(config, m_oki[1], 32220000/16, okim6295_device::PIN7_HIGH);
m_oki[1]->add_route(ALL_OUTPUTS, "lspeaker", 0.18);
m_oki[1]->add_route(ALL_OUTPUTS, "rspeaker", 0.18);
}
void rohga_state::hangzo(machine_config &config)
{
schmeisr(config);

View File

@ -2339,6 +2339,9 @@ void keroppi_state::machine_start()
m_prize_hop = 0;
m_protection_count = 0;
save_item(NAME(m_prize_hop));
save_item(NAME(m_protection_count));
}
/***************************************************************************
@ -3178,40 +3181,51 @@ void seta_state::utoukond_map(address_map &map)
Pairs Love
***************************************************************************/
u16 seta_state::pairlove_prot_r(offs_t offset)
u16 pairlove_state::prot_r(offs_t offset)
{
const u16 retdata = m_pairslove_protram[offset];
//osd_printf_debug("pairs love protection? read %06x %04x %04x\n",m_maincpu->pc(), offset,retdata);
const u16 retdata = m_protram[offset];
//osd_printf_debug("pairs love protection? read %06x %04x %04x\n", m_maincpu->pc(), offset, retdata);
if (!machine().side_effects_disabled())
m_pairslove_protram[offset] = m_pairslove_protram_old[offset];
m_protram[offset] = m_protram_old[offset];
return retdata;
}
void seta_state::pairlove_prot_w(offs_t offset, u16 data)
void pairlove_state::prot_w(offs_t offset, u16 data)
{
//osd_printf_debug("pairs love protection? write %06x %04x %04x\n",m_maincpu->pc(), offset,data);
m_pairslove_protram_old[offset] = m_pairslove_protram[offset];
m_pairslove_protram[offset] = data;
//osd_printf_debug("pairs love protection? write %06x %04x %04x\n", m_maincpu->pc(), offset, data);
m_protram_old[offset] = m_protram[offset];
m_protram[offset] = data;
}
void seta_state::pairlove_map(address_map &map)
void pairlove_state::pairlove_map(address_map &map)
{
map(0x000000, 0x03ffff).rom(); // ROM
map(0x100000, 0x100001).nopw(); // ? 1 (start of interrupts, main loop: watchdog?)
map(0x200000, 0x200001).nopw(); // ? 0/1 (IRQ acknowledge?)
map(0x300000, 0x300003).r(FUNC(seta_state::seta_dsw_r)); // DSW
map(0x400001, 0x400001).w(FUNC(seta_state::seta_coin_lockout_w)); // Coin Lockout + Sound Enable (bit 4?)
map(0x500000, 0x500001).portr("P1"); // P1
map(0x500002, 0x500003).portr("P2"); // P2
map(0x500004, 0x500005).portr("COINS"); // Coins
map(0x900000, 0x9001ff).rw(FUNC(seta_state::pairlove_prot_r), FUNC(seta_state::pairlove_prot_w));
map(0x000000, 0x03ffff).rom(); // ROM
map(0x100000, 0x100001).nopw(); // ? 1 (start of interrupts, main loop: watchdog?)
map(0x200000, 0x200001).nopw(); // ? 0/1 (IRQ acknowledge?)
map(0x300000, 0x300003).r(FUNC(pairlove_state::seta_dsw_r)); // DSW
map(0x400001, 0x400001).w(FUNC(pairlove_state::seta_coin_lockout_w)); // Coin Lockout + Sound Enable (bit 4?)
map(0x500000, 0x500001).portr("P1"); // P1
map(0x500002, 0x500003).portr("P2"); // P2
map(0x500004, 0x500005).portr("COINS"); // Coins
map(0x900000, 0x9001ff).rw(FUNC(pairlove_state::prot_r), FUNC(pairlove_state::prot_w));
map(0xa00000, 0xa03fff).rw(m_x1, FUNC(x1_010_device::word_r), FUNC(x1_010_device::word_w)); // Sound
map(0xb00000, 0xb00fff).ram().share("paletteram1"); // Palette
map(0xb00000, 0xb00fff).ram().share("paletteram1"); // Palette
map(0xc00000, 0xc03fff).ram().rw(m_seta001, FUNC(seta001_device::spritecode_r16), FUNC(seta001_device::spritecode_w16)); // Sprites Code + X + Attr
map(0xd00000, 0xd00001).ram(); // ? 0x4000
map(0xd00000, 0xd00001).ram(); // ? 0x4000
map(0xe00000, 0xe005ff).ram().rw(m_seta001, FUNC(seta001_device::spriteylow_r16), FUNC(seta001_device::spriteylow_w16)); // Sprites Y
map(0xe00600, 0xe00607).ram().rw(m_seta001, FUNC(seta001_device::spritectrl_r16), FUNC(seta001_device::spritectrl_w16));
map(0xf00000, 0xf0ffff).ram(); // RAM
map(0xf00000, 0xf0ffff).ram(); // RAM
}
void pairlove_state::machine_start()
{
seta_state::machine_start();
m_protram = make_unique_clear<u16 []>(0x200/2);
m_protram_old = make_unique_clear<u16 []>(0x200/2);
save_pointer(NAME(m_protram), 0x200/2);
save_pointer(NAME(m_protram_old), 0x200/2);
}
@ -9877,15 +9891,15 @@ void seta_state::zingzipbl(machine_config &config)
Pairs Love
***************************************************************************/
void seta_state::pairlove(machine_config &config)
void pairlove_state::pairlove(machine_config &config)
{
/* basic machine hardware */
M68000(config, m_maincpu, 16000000/2); /* 8 MHz */
m_maincpu->set_addrmap(AS_PROGRAM, &seta_state::pairlove_map);
TIMER(config, "scantimer").configure_scanline(FUNC(seta_state::seta_interrupt_1_and_2), "screen", 0, 1);
m_maincpu->set_addrmap(AS_PROGRAM, &pairlove_state::pairlove_map);
TIMER(config, "scantimer").configure_scanline(FUNC(pairlove_state::seta_interrupt_1_and_2), "screen", 0, 1);
SETA001_SPRITE(config, m_seta001, 16000000, m_palette, gfx_pairlove);
m_seta001->set_gfxbank_callback(FUNC(seta_state::setac_gfxbank_callback));
m_seta001->set_gfxbank_callback(FUNC(pairlove_state::setac_gfxbank_callback));
// position kludges
m_seta001->set_fg_xoffsets(0, 0); // unknown
m_seta001->set_fg_yoffsets(-0x12, 0x0e);
@ -9897,7 +9911,7 @@ void seta_state::pairlove(machine_config &config)
screen.set_vblank_time(ATTOSECONDS_IN_USEC(0));
screen.set_size(64*8, 32*8);
screen.set_visarea(0*8, 48*8-1, 1*8, 31*8-1);
screen.set_screen_update(FUNC(seta_state::screen_update_seta_no_layers));
screen.set_screen_update(FUNC(pairlove_state::screen_update_seta_no_layers));
screen.set_palette(m_palette);
PALETTE(config, m_palette).set_entries(2048); // sprites only
@ -12417,14 +12431,6 @@ void seta_state::init_rezon()
m_maincpu->space(AS_PROGRAM).nop_read(0x500006, 0x500007); // irq ack?
}
void seta_state::init_pairlove()
{
m_pairslove_protram = make_unique_clear<u16[]>(0x200/2);
m_pairslove_protram_old = make_unique_clear<u16[]>(0x200/2);
save_pointer(NAME(m_pairslove_protram), 0x200/2);
save_pointer(NAME(m_pairslove_protram_old), 0x200/2);
}
void zombraid_state::init_zombraid()
{
/* bank 1 is never explicitly selected, 0 is used in its place */
@ -12527,7 +12533,7 @@ GAME( 1992, rezont, rezon, rezon, rezont, seta_state, init_rezo
GAME( 1991, stg, 0, stg, stg, seta_state, empty_init, ROT270, "Athena / Tecmo", "Strike Gunner S.T.G", 0 )
GAME( 1991, pairlove, 0, pairlove, pairlove, seta_state, init_pairlove, ROT270, "Athena", "Pairs Love", 0 )
GAME( 1991, pairlove, 0, pairlove, pairlove, pairlove_state, empty_init, ROT270, "Athena", "Pairs Love", 0 )
GAME( 1992, blandia, 0, blandia, blandia, seta_state, init_bankx1, ROT0, "Allumer", "Blandia", MACHINE_IMPERFECT_GRAPHICS )
GAME( 1992, blandiap, blandia, blandiap, blandia, seta_state, init_bankx1, ROT0, "Allumer", "Blandia (prototype)", MACHINE_IMPERFECT_GRAPHICS )

View File

@ -5,22 +5,29 @@
Data East 'Rohga' era hardware
*************************************************************************/
#ifndef MAME_INCLUDES_ROHGA_H
#define MAME_INCLUDES_ROHGA_H
#include "sound/okim6295.h"
#include "cpu/h6280/h6280.h"
#pragma once
#include "machine/deco104.h"
#include "machine/deco146.h"
#include "video/deco16ic.h"
#include "video/decocomn.h"
#include "video/bufsprite.h"
#include "video/decospr.h"
#include "machine/deco146.h"
#include "machine/deco104.h"
#include "cpu/h6280/h6280.h"
#include "sound/okim6295.h"
#include "video/bufsprite.h"
#include "emupal.h"
class rohga_state : public driver_device
{
public:
rohga_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
rohga_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
m_ioprot(*this, "ioprot"),
@ -80,11 +87,17 @@ private:
u16 ioprot_r(offs_t offset);
void ioprot_w(offs_t offset, u16 data, u16 mem_mask = ~0);
void hangzo_map(address_map &map);
void hotb_base_map(address_map &map);
void nitrobal_map(address_map &map);
void rohga_base(machine_config &config);
void rohga_map(address_map &map);
void sound_map(address_map &map);
void schmeisr_map(address_map &map);
void wizdfire_map(address_map &map);
void nitrobal_map(address_map &map);
void hotb_base_map(address_map &map);
void schmeisr_map(address_map &map);
void hangzo_map(address_map &map);
void sound_map(address_map &map);
};
#endif // MAME_INCLUDES_ROHGA_H

View File

@ -66,7 +66,6 @@ public:
void msgundam(machine_config &config);
void msgundamb(machine_config &config);
void extdwnhl(machine_config &config);
void pairlove(machine_config &config);
void zingzip(machine_config &config);
void wiggie(machine_config &config);
void umanclub(machine_config &config);
@ -97,7 +96,6 @@ public:
void init_wiggie();
void init_bankx1();
void init_eightfrc();
void init_pairlove();
void palette_init_RRRRRGGGGGBBBBB_proms(palette_device &palette) const;
@ -134,9 +132,6 @@ protected:
uPD71054_state m_uPD71054;
std::unique_ptr<u16[]> m_pairslove_protram;
std::unique_ptr<u16[]> m_pairslove_protram_old;
void seta_coin_counter_w(u8 data);
void seta_coin_lockout_w(u8 data);
void seta_vregs_w(u8 data);
@ -147,8 +142,6 @@ protected:
u16 thunderl_protection_r();
void thunderl_protection_w(u16 data);
void utoukond_sound_control_w(u8 data);
u16 pairlove_prot_r(offs_t offset);
void pairlove_prot_w(offs_t offset, u16 data);
u16 extra_r();
void blandia_palette(palette_device &palette) const;
@ -199,7 +192,6 @@ protected:
void msgundamb_map(address_map &map);
void oisipuzl_map(address_map &map);
void orbs_map(address_map &map);
void pairlove_map(address_map &map);
void thunderl_map(address_map &map);
void thunderlbl_map(address_map &map);
void thunderlbl_sound_map(address_map &map);
@ -410,11 +402,13 @@ private:
u16 coin_r();
void prize_w(u16 data);
TIMER_CALLBACK_MEMBER(prize_hop_callback);
void keroppi_map(address_map &map);
emu_timer *m_prize_hop_timer;
int m_prize_hop;
int m_protection_count;
emu_timer *m_prize_hop_timer;
};
class zombraid_state : public seta_state
@ -513,6 +507,29 @@ private:
void show_outputs();
};
class pairlove_state : public seta_state
{
public:
pairlove_state(const machine_config &mconfig, device_type type, const char *tag) :
seta_state(mconfig, type, tag)
{
}
void pairlove(machine_config &config);
protected:
virtual void machine_start() override;
protected:
u16 prot_r(offs_t offset);
void prot_w(offs_t offset, u16 data);
void pairlove_map(address_map &map);
std::unique_ptr<u16 []> m_protram;
std::unique_ptr<u16 []> m_protram_old;
};
class jockeyc_state : public seta_state
{
public: