summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/vii.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/vii.cpp')
-rw-r--r--src/mame/drivers/vii.cpp164
1 files changed, 79 insertions, 85 deletions
diff --git a/src/mame/drivers/vii.cpp b/src/mame/drivers/vii.cpp
index 0bdbf330a4c..ddb70ff9c39 100644
--- a/src/mame/drivers/vii.cpp
+++ b/src/mame/drivers/vii.cpp
@@ -151,7 +151,6 @@ public:
: driver_device(mconfig, type, tag)
, m_maincpu(*this, "maincpu")
, m_screen(*this, "screen")
- , m_spg(*this, "spg")
, m_bank(*this, "cartbank")
, m_io_p1(*this, "P1")
, m_io_p2(*this, "P2")
@@ -200,9 +199,8 @@ protected:
DECLARE_WRITE16_MEMBER(jakks_porta_w);
DECLARE_WRITE16_MEMBER(jakks_portb_w);
- required_device<unsp_device> m_maincpu;
+ required_device<spg2xx_device> m_maincpu;
required_device<screen_device> m_screen;
- required_device<spg2xx_device> m_spg;
optional_memory_bank m_bank;
DECLARE_READ16_MEMBER(walle_portc_r);
@@ -574,19 +572,16 @@ READ16_MEMBER(spg2xx_game_state::rad_portc_r)
void spg2xx_game_state::mem_map_4m(address_map &map)
{
map(0x000000, 0x3fffff).bankr("cartbank");
- map(0x000000, 0x003fff).m(m_spg, FUNC(spg2xx_device::map));
}
void spg2xx_game_state::mem_map_2m(address_map &map)
{
map(0x000000, 0x1fffff).mirror(0x200000).bankr("cartbank");
- map(0x000000, 0x003fff).m(m_spg, FUNC(spg2xx_device::map));
}
void spg2xx_game_state::mem_map_1m(address_map &map)
{
map(0x000000, 0x0fffff).mirror(0x300000).bankr("cartbank");
- map(0x000000, 0x003fff).m(m_spg, FUNC(spg2xx_device::map));
}
static INPUT_PORTS_START( vii )
@@ -1877,7 +1872,7 @@ void vii_state::poll_controls()
if (memcmp(old_input, m_controller_input, 8))
{
for(int i = 0; i < 8; i++)
- m_spg->uart_rx(m_controller_input[i]);
+ m_maincpu->uart_rx(m_controller_input[i]);
}
}
@@ -1899,25 +1894,23 @@ DEVICE_IMAGE_LOAD_MEMBER(vii_state, vii_cart)
void spg2xx_game_state::spg2xx_base(machine_config &config)
{
- UNSP(config, m_maincpu, XTAL(27'000'000));
- m_maincpu->set_addrmap(AS_PROGRAM, &spg2xx_game_state::mem_map_4m);
-
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
m_screen->set_refresh_hz(60);
m_screen->set_size(320, 262);
m_screen->set_visarea(0, 320-1, 0, 240-1);
- m_screen->set_screen_update("spg", FUNC(spg2xx_device::screen_update));
- m_screen->screen_vblank().set(m_spg, FUNC(spg2xx_device::vblank));
+ m_screen->set_screen_update("maincpu", FUNC(spg2xx_device::screen_update));
+ m_screen->screen_vblank().set(m_maincpu, FUNC(spg2xx_device::vblank));
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
- m_spg->add_route(ALL_OUTPUTS, "lspeaker", 0.5);
- m_spg->add_route(ALL_OUTPUTS, "rspeaker", 0.5);
+ m_maincpu->add_route(ALL_OUTPUTS, "lspeaker", 0.5);
+ m_maincpu->add_route(ALL_OUTPUTS, "rspeaker", 0.5);
}
void spg2xx_game_state::non_spg_base(machine_config &config)
{
- SPG24X(config, m_spg, XTAL(27'000'000), m_maincpu, m_screen);
+ SPG24X(config, m_maincpu, XTAL(27'000'000), m_screen);
+ m_maincpu->set_addrmap(AS_PROGRAM, &spg2xx_game_state::mem_map_4m);
spg2xx_base(config);
}
@@ -1932,13 +1925,14 @@ void spg2xx_game_state::spg2xx_basep(machine_config &config)
void vii_state::vii(machine_config &config)
{
- SPG24X(config, m_spg, XTAL(27'000'000), m_maincpu, m_screen);
+ SPG24X(config, m_maincpu, XTAL(27'000'000), m_screen);
+ m_maincpu->set_addrmap(AS_PROGRAM, &vii_state::mem_map_4m);
spg2xx_base(config);
- m_spg->portb_out().set(FUNC(vii_state::vii_portb_w));
- m_spg->eeprom_w().set(FUNC(vii_state::eeprom_w));
- m_spg->eeprom_r().set(FUNC(vii_state::eeprom_r));
+ m_maincpu->portb_out().set(FUNC(vii_state::vii_portb_w));
+ m_maincpu->eeprom_w().set(FUNC(vii_state::eeprom_w));
+ m_maincpu->eeprom_r().set(FUNC(vii_state::eeprom_r));
NVRAM(config, m_nvram, nvram_device::DEFAULT_ALL_1);
@@ -1951,16 +1945,16 @@ void vii_state::vii(machine_config &config)
void icanguit_state::icanguit(machine_config &config)
{
- SPG24X(config, m_spg, XTAL(27'000'000), m_maincpu, m_screen);
+ SPG24X(config, m_maincpu, XTAL(27'000'000), m_screen);
spg2xx_base(config);
- m_spg->porta_in().set(FUNC(icanguit_state::porta_r));
- m_spg->portb_in().set(FUNC(icanguit_state::portb_r));
- m_spg->portc_in().set(FUNC(icanguit_state::portc_r));
- m_spg->porta_out().set(FUNC(icanguit_state::guit_porta_w));
- m_spg->portb_out().set(FUNC(icanguit_state::portb_w));
- m_spg->portc_out().set(FUNC(icanguit_state::portc_w));
+ m_maincpu->porta_in().set(FUNC(icanguit_state::porta_r));
+ m_maincpu->portb_in().set(FUNC(icanguit_state::portb_r));
+ m_maincpu->portc_in().set(FUNC(icanguit_state::portc_r));
+ m_maincpu->porta_out().set(FUNC(icanguit_state::guit_porta_w));
+ m_maincpu->portb_out().set(FUNC(icanguit_state::portb_w));
+ m_maincpu->portc_out().set(FUNC(icanguit_state::portc_w));
GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "icanguit_cart");
@@ -1973,16 +1967,16 @@ void icanguit_state::icanguit(machine_config &config)
void icanguit_state::icanpian(machine_config &config)
{
- SPG24X(config, m_spg, XTAL(27'000'000), m_maincpu, m_screen);
+ SPG24X(config, m_maincpu, XTAL(27'000'000), m_screen);
spg2xx_base(config);
- m_spg->porta_in().set(FUNC(icanguit_state::porta_r));
- m_spg->portb_in().set(FUNC(icanguit_state::portb_r));
- m_spg->portc_in().set(FUNC(icanguit_state::portc_r));
- m_spg->porta_out().set(FUNC(icanguit_state::porta_w));
- m_spg->portb_out().set(FUNC(icanguit_state::portb_w));
- m_spg->portc_out().set(FUNC(icanguit_state::portc_w));
+ m_maincpu->porta_in().set(FUNC(icanguit_state::porta_r));
+ m_maincpu->portb_in().set(FUNC(icanguit_state::portb_r));
+ m_maincpu->portc_in().set(FUNC(icanguit_state::portc_r));
+ m_maincpu->porta_out().set(FUNC(icanguit_state::porta_w));
+ m_maincpu->portb_out().set(FUNC(icanguit_state::portb_w));
+ m_maincpu->portc_out().set(FUNC(icanguit_state::portc_w));
GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "icanpian_cart");
m_cart->set_width(GENERIC_ROM16_WIDTH);
@@ -1994,13 +1988,13 @@ void icanguit_state::icanpian(machine_config &config)
void tvgogo_state::tvgogo(machine_config &config)
{
- SPG24X(config, m_spg, XTAL(27'000'000), m_maincpu, m_screen);
+ SPG24X(config, m_maincpu, XTAL(27'000'000), m_screen);
spg2xx_base(config);
- m_spg->porta_in().set_ioport("P1");
- m_spg->portb_in().set_ioport("P2");
- m_spg->portc_in().set_ioport("P3");
+ m_maincpu->porta_in().set_ioport("P1");
+ m_maincpu->portb_in().set_ioport("P2");
+ m_maincpu->portc_in().set_ioport("P3");
GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "tvgogo_cart");
m_cart->set_width(GENERIC_ROM16_WIDTH);
@@ -2013,22 +2007,22 @@ void tvgogo_state::tvgogo(machine_config &config)
void spg2xx_game_state::wireless60(machine_config &config)
{
- SPG24X(config, m_spg, XTAL(27'000'000), m_maincpu, m_screen);
+ SPG24X(config, m_maincpu, XTAL(27'000'000), m_screen);
spg2xx_base(config);
- m_spg->porta_out().set(FUNC(spg2xx_game_state::wireless60_porta_w));
- m_spg->portb_out().set(FUNC(spg2xx_game_state::wireless60_portb_w));
- m_spg->porta_in().set(FUNC(spg2xx_game_state::wireless60_porta_r));
+ m_maincpu->porta_out().set(FUNC(spg2xx_game_state::wireless60_porta_w));
+ m_maincpu->portb_out().set(FUNC(spg2xx_game_state::wireless60_portb_w));
+ m_maincpu->porta_in().set(FUNC(spg2xx_game_state::wireless60_porta_r));
}
void spg2xx_game_state::jakks(machine_config &config)
{
- SPG24X(config, m_spg, XTAL(27'000'000), m_maincpu, m_screen);
+ SPG24X(config, m_maincpu, XTAL(27'000'000), m_screen);
spg2xx_base(config);
- m_spg->porta_in().set(FUNC(spg2xx_game_state::jakks_porta_r));
- m_spg->porta_out().set(FUNC(spg2xx_game_state::jakks_porta_w));
- m_spg->portb_out().set(FUNC(spg2xx_game_state::jakks_portb_w));
+ m_maincpu->porta_in().set(FUNC(spg2xx_game_state::jakks_porta_r));
+ m_maincpu->porta_out().set(FUNC(spg2xx_game_state::jakks_porta_w));
+ m_maincpu->portb_out().set(FUNC(spg2xx_game_state::jakks_portb_w));
}
void spg2xx_game_state::jakks_i2c(machine_config &config)
@@ -2060,12 +2054,12 @@ void jakks_gkr_state::jakks_gkr(machine_config &config)
{
jakks(config);
- m_spg->porta_in().set(FUNC(jakks_gkr_state::jakks_porta_key_io_r));
- m_spg->porta_out().set(FUNC(jakks_gkr_state::jakks_porta_key_io_w));
- m_spg->portc_in().set_ioport("P3");
- m_spg->portc_out().set(FUNC(jakks_gkr_state::gkr_portc_w));
+ m_maincpu->porta_in().set(FUNC(jakks_gkr_state::jakks_porta_key_io_r));
+ m_maincpu->porta_out().set(FUNC(jakks_gkr_state::jakks_porta_key_io_w));
+ m_maincpu->portc_in().set_ioport("P3");
+ m_maincpu->portc_out().set(FUNC(jakks_gkr_state::gkr_portc_w));
- m_spg->set_rowscroll_offset(0);
+ m_maincpu->set_rowscroll_offset(0);
JAKKS_GAMEKEY_SLOT(config, m_cart, 0, jakks_gamekey, nullptr);
}
@@ -2136,8 +2130,8 @@ void jakks_gkr_state::jakks_gkr_sw_i2c(machine_config &config)
{
jakks_gkr_i2c(config);
m_maincpu->set_addrmap(AS_PROGRAM, &jakks_gkr_state::mem_map_1m);
- m_spg->adc_in<0>().set_ioport("JOYX");
- m_spg->adc_in<1>().set_ioport("JOYY");
+ m_maincpu->adc_in<0>().set_ioport("JOYX");
+ m_maincpu->adc_in<1>().set_ioport("JOYY");
SOFTWARE_LIST(config, "jakks_gamekey_sw").set_original("jakks_gamekey_sw");
}
@@ -2145,8 +2139,8 @@ void jakks_gkr_state::jakks_gkr_wp(machine_config &config)
{
jakks_gkr(config);
m_maincpu->set_addrmap(AS_PROGRAM, &jakks_gkr_state::mem_map_1m);
- m_spg->adc_in<0>().set_ioport("JOYX");
- m_spg->adc_in<1>().set_ioport("JOYY");
+ m_maincpu->adc_in<0>().set_ioport("JOYX");
+ m_maincpu->adc_in<1>().set_ioport("JOYY");
//SOFTWARE_LIST(config, "jakks_gamekey_wp").set_original("jakks_gamekey_wp"); // NO KEYS RELEASED
}
@@ -2154,7 +2148,7 @@ void jakks_gkr_state::jakks_gkr_nm_i2c(machine_config &config)
{
jakks_gkr_i2c(config);
m_maincpu->set_addrmap(AS_PROGRAM, &jakks_gkr_state::mem_map_1m);
- m_spg->adc_in<0>().set_ioport("DIALX");
+ m_maincpu->adc_in<0>().set_ioport("DIALX");
SOFTWARE_LIST(config, "jakks_gamekey_nm").set_original("jakks_gamekey_nm");
}
@@ -2162,8 +2156,8 @@ void jakks_gkr_state::jakks_gkr_wf_i2c(machine_config &config)
{
jakks_gkr_i2c(config);
m_maincpu->set_addrmap(AS_PROGRAM, &jakks_gkr_state::mem_map_1m);
- //m_spg->adc_in<0>().set_ioport("DIALX"); // wheel does not seem to map here
- //m_spg->adc_in<1>().set_ioport("DIALY");
+ //m_maincpu->adc_in<0>().set_ioport("DIALX"); // wheel does not seem to map here
+ //m_maincpu->adc_in<1>().set_ioport("DIALY");
//SOFTWARE_LIST(config, "jakks_gamekey_wf").set_original("jakks_gamekey_wf"); // no game keys were released
}
@@ -2172,74 +2166,74 @@ void spg2xx_game_state::lexizeus(machine_config &config)
{
non_spg_base(config);
m_maincpu->set_addrmap(AS_PROGRAM, &spg2xx_game_state::mem_map_4m);
- m_spg->porta_in().set_ioport("P1");
- m_spg->portb_in().set_ioport("P2");
- m_spg->portc_in().set_ioport("P3");
+ m_maincpu->porta_in().set_ioport("P1");
+ m_maincpu->portb_in().set_ioport("P2");
+ m_maincpu->portc_in().set_ioport("P3");
}
void spg2xx_game_state::walle(machine_config &config)
{
jakks_i2c(config);
m_maincpu->set_addrmap(AS_PROGRAM, &spg2xx_game_state::mem_map_2m);
- m_spg->portc_in().set_ioport("P3");
- m_spg->portc_out().set(FUNC(spg2xx_game_state::walle_portc_w));
+ m_maincpu->portc_in().set_ioport("P3");
+ m_maincpu->portc_out().set(FUNC(spg2xx_game_state::walle_portc_w));
}
void spg2xx_game_state::rad_skat(machine_config &config)
{
- SPG24X(config, m_spg, XTAL(27'000'000), m_maincpu, m_screen);
+ SPG24X(config, m_maincpu, XTAL(27'000'000), m_screen);
spg2xx_base(config);
- m_spg->porta_in().set_ioport("P1");
- m_spg->portb_in().set_ioport("P2");
- m_spg->portc_in().set_ioport("P3");
- m_spg->eeprom_w().set(FUNC(spg2xx_game_state::eeprom_w));
- m_spg->eeprom_r().set(FUNC(spg2xx_game_state::eeprom_r));
+ m_maincpu->porta_in().set_ioport("P1");
+ m_maincpu->portb_in().set_ioport("P2");
+ m_maincpu->portc_in().set_ioport("P3");
+ m_maincpu->eeprom_w().set(FUNC(spg2xx_game_state::eeprom_w));
+ m_maincpu->eeprom_r().set(FUNC(spg2xx_game_state::eeprom_r));
NVRAM(config, m_nvram, nvram_device::DEFAULT_ALL_1);
}
void dreamlif_state::dreamlif(machine_config &config)
{
- SPG24X(config, m_spg, XTAL(27'000'000), m_maincpu, m_screen);
+ SPG24X(config, m_maincpu, XTAL(27'000'000), m_screen);
spg2xx_base(config);
- m_spg->porta_in().set_ioport("P1");
- m_spg->portb_in().set(FUNC(dreamlif_state::portb_r));
- m_spg->portb_out().set(FUNC(dreamlif_state::portb_w));
+ m_maincpu->porta_in().set_ioport("P1");
+ m_maincpu->portb_in().set(FUNC(dreamlif_state::portb_r));
+ m_maincpu->portb_out().set(FUNC(dreamlif_state::portb_w));
}
void spg2xx_game_state::rad_skatp(machine_config &config)
{
rad_skat(config);
- m_spg->set_pal(true);
+ m_maincpu->set_pal(true);
}
void spg2xx_game_state::rad_sktv(machine_config &config)
{
- SPG24X(config, m_spg, XTAL(27'000'000), m_maincpu, m_screen);
+ SPG24X(config, m_maincpu, XTAL(27'000'000), m_screen);
spg2xx_base(config);
- m_spg->porta_in().set(FUNC(spg2xx_game_state::rad_porta_r));
- m_spg->portb_in().set(FUNC(spg2xx_game_state::rad_portb_r));
- m_spg->portc_in().set(FUNC(spg2xx_game_state::rad_portc_r));
- m_spg->eeprom_w().set(FUNC(spg2xx_game_state::eeprom_w));
- m_spg->eeprom_r().set(FUNC(spg2xx_game_state::eeprom_r));
+ m_maincpu->porta_in().set(FUNC(spg2xx_game_state::rad_porta_r));
+ m_maincpu->portb_in().set(FUNC(spg2xx_game_state::rad_portb_r));
+ m_maincpu->portc_in().set(FUNC(spg2xx_game_state::rad_portc_r));
+ m_maincpu->eeprom_w().set(FUNC(spg2xx_game_state::eeprom_w));
+ m_maincpu->eeprom_r().set(FUNC(spg2xx_game_state::eeprom_r));
NVRAM(config, m_nvram, nvram_device::DEFAULT_ALL_1);
}
void spg2xx_game_state::rad_crik(machine_config &config)
{
- SPG28X(config, m_spg, XTAL(27'000'000), m_maincpu, m_screen);
+ SPG28X(config, m_maincpu, XTAL(27'000'000), m_screen);
spg2xx_base(config);
- m_spg->porta_in().set_ioport("P1");
- m_spg->portb_in().set_ioport("P2");
- m_spg->portc_in().set_ioport("P3");
- m_spg->eeprom_w().set(FUNC(spg2xx_game_state::eeprom_w));
- m_spg->eeprom_r().set(FUNC(spg2xx_game_state::eeprom_r));
+ m_maincpu->porta_in().set_ioport("P1");
+ m_maincpu->portb_in().set_ioport("P2");
+ m_maincpu->portc_in().set_ioport("P3");
+ m_maincpu->eeprom_w().set(FUNC(spg2xx_game_state::eeprom_w));
+ m_maincpu->eeprom_r().set(FUNC(spg2xx_game_state::eeprom_r));
NVRAM(config, m_nvram, nvram_device::DEFAULT_ALL_1);
}