mirror of
https://github.com/holub/mame
synced 2025-05-14 09:58:14 +03:00
some cleanup and vsnes change to compile on vs compile (nw)
This commit is contained in:
parent
7a4840affd
commit
2938d4c348
@ -755,7 +755,7 @@ WRITE8_MEMBER(galaga_state::bosco_latch_w)
|
||||
|
||||
case 0x03: /* RESET */
|
||||
m_subcpu->set_input_line(INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE);
|
||||
machine().device("sub2")->execute().set_input_line(INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE);
|
||||
m_subcpu2->set_input_line(INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE);
|
||||
break;
|
||||
|
||||
case 0x04: /* n.c. */
|
||||
@ -860,7 +860,7 @@ TIMER_CALLBACK_MEMBER(galaga_state::cpu3_interrupt_callback)
|
||||
int scanline = param;
|
||||
|
||||
if(m_sub2_nmi_mask)
|
||||
nmi_line_pulse(machine().device("sub2")->execute());
|
||||
nmi_line_pulse(m_subcpu2);
|
||||
|
||||
scanline = scanline + 128;
|
||||
if (scanline >= 272)
|
||||
|
@ -189,14 +189,14 @@ WRITE8_MEMBER(gaplus_state::gaplus_irq_3_ctrl_w)
|
||||
int bit = !BIT(offset, 13);
|
||||
m_sub2_irq_mask = bit & 1;
|
||||
if (!bit)
|
||||
machine().device("sub2")->execute().set_input_line(0, CLEAR_LINE);
|
||||
m_subcpu2->set_input_line(0, CLEAR_LINE);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(gaplus_state::gaplus_sreset_w)
|
||||
{
|
||||
int bit = !BIT(offset, 11);
|
||||
m_subcpu->set_input_line(INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
|
||||
machine().device("sub2")->execute().set_input_line(INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
|
||||
m_subcpu2->set_input_line(INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
|
||||
mappy_sound_enable(machine().device("namco"), bit);
|
||||
}
|
||||
|
||||
@ -274,7 +274,7 @@ INTERRUPT_GEN_MEMBER(gaplus_state::gaplus_vblank_sub_irq)
|
||||
INTERRUPT_GEN_MEMBER(gaplus_state::gaplus_vblank_sub2_irq)
|
||||
{
|
||||
if(m_sub2_irq_mask)
|
||||
machine().device("sub2")->execute().set_input_line(0, ASSERT_LINE);
|
||||
m_subcpu2->set_input_line(0, ASSERT_LINE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -94,14 +94,15 @@ class junofrst_state : public tutankhm_state
|
||||
public:
|
||||
junofrst_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: tutankhm_state(mconfig, type, tag),
|
||||
m_audiocpu(*this, "audiocpu") { }
|
||||
m_audiocpu(*this, "audiocpu"),
|
||||
m_i8039(*this, "mcu") { }
|
||||
|
||||
UINT8 m_blitterdata[4];
|
||||
int m_i8039_status;
|
||||
int m_last_irq;
|
||||
|
||||
required_device<cpu_device> m_audiocpu;
|
||||
device_t *m_i8039;
|
||||
required_device<cpu_device> m_i8039;
|
||||
|
||||
device_t *m_filter_0_0;
|
||||
device_t *m_filter_0_1;
|
||||
@ -250,14 +251,14 @@ WRITE8_MEMBER(junofrst_state::junofrst_sh_irqtrigger_w)
|
||||
|
||||
WRITE8_MEMBER(junofrst_state::junofrst_i8039_irq_w)
|
||||
{
|
||||
m_i8039->execute().set_input_line(0, ASSERT_LINE);
|
||||
m_i8039->set_input_line(0, ASSERT_LINE);
|
||||
}
|
||||
|
||||
|
||||
WRITE8_MEMBER(junofrst_state::i8039_irqen_and_status_w)
|
||||
{
|
||||
if ((data & 0x80) == 0)
|
||||
m_i8039->execute().set_input_line(0, CLEAR_LINE);
|
||||
m_i8039->set_input_line(0, CLEAR_LINE);
|
||||
m_i8039_status = (data & 0x70) >> 4;
|
||||
}
|
||||
|
||||
@ -381,7 +382,6 @@ static const ay8910_interface ay8910_config =
|
||||
|
||||
MACHINE_START_MEMBER(junofrst_state,junofrst)
|
||||
{
|
||||
m_i8039 = machine().device("mcu");
|
||||
m_filter_0_0 = machine().device("filter.0.0");
|
||||
m_filter_0_1 = machine().device("filter.0.1");
|
||||
m_filter_0_2 = machine().device("filter.0.2");
|
||||
|
@ -644,7 +644,7 @@ WRITE8_MEMBER(mappy_state::phozon_latch_w)
|
||||
case 0x04:
|
||||
m_sub2_irq_mask = bit;
|
||||
if (!bit)
|
||||
machine().device("sub2")->execute().set_input_line(0, CLEAR_LINE);
|
||||
m_subcpu2->set_input_line(0, CLEAR_LINE);
|
||||
break;
|
||||
|
||||
case 0x06:
|
||||
@ -661,7 +661,7 @@ WRITE8_MEMBER(mappy_state::phozon_latch_w)
|
||||
break;
|
||||
|
||||
case 0x0c:
|
||||
machine().device("sub2")->execute().set_input_line(INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
|
||||
m_subcpu2->set_input_line(INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
|
||||
break;
|
||||
|
||||
case 0x0e:
|
||||
@ -880,7 +880,7 @@ INTERRUPT_GEN_MEMBER(mappy_state::sub_vblank_irq)
|
||||
INTERRUPT_GEN_MEMBER(mappy_state::sub2_vblank_irq)
|
||||
{
|
||||
if(m_sub2_irq_mask)
|
||||
machine().device("sub2")->execute().set_input_line(0, ASSERT_LINE);
|
||||
m_subcpu2->set_input_line(0, ASSERT_LINE);
|
||||
}
|
||||
|
||||
static ADDRESS_MAP_START( superpac_cpu1_map, AS_PROGRAM, 8, mappy_state )
|
||||
|
@ -317,7 +317,7 @@ WRITE8_MEMBER(polepos_state::polepos_latch_w)
|
||||
break;
|
||||
|
||||
case 0x05: /* RESA */
|
||||
machine().device("sub2")->execute().set_input_line(INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
|
||||
m_subcpu2->set_input_line(INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
|
||||
break;
|
||||
|
||||
case 0x06: /* SB0 */
|
||||
@ -455,7 +455,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(polepos_state::polepos_scanline)
|
||||
if (scanline == 240 && m_sub_irq_mask) // VBLANK
|
||||
{
|
||||
m_subcpu->set_input_line(0, ASSERT_LINE);
|
||||
machine().device("sub2")->execute().set_input_line(0, ASSERT_LINE);
|
||||
m_subcpu2->set_input_line(0, ASSERT_LINE);
|
||||
}
|
||||
}
|
||||
|
||||
@ -471,7 +471,7 @@ MACHINE_RESET_MEMBER(polepos_state,polepos)
|
||||
|
||||
/* set the interrupt vectors (this shouldn't be needed) */
|
||||
m_subcpu->set_input_line_vector(0, Z8000_NVI);
|
||||
machine().device("sub2")->execute().set_input_line_vector(0, Z8000_NVI);
|
||||
m_subcpu2->set_input_line_vector(0, Z8000_NVI);
|
||||
}
|
||||
|
||||
|
||||
|
@ -410,11 +410,9 @@ void system1_state::bank0c_custom_w(UINT8 data, UINT8 prevdata)
|
||||
|
||||
WRITE8_MEMBER(system1_state::videomode_w)
|
||||
{
|
||||
device_t *i8751 = machine().device("mcu");
|
||||
|
||||
/* bit 6 is connected to the 8751 IRQ */
|
||||
if (i8751 != NULL)
|
||||
i8751->execute().set_input_line(MCS51_INT1_LINE, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE);
|
||||
if (m_mcu != NULL)
|
||||
m_mcu->set_input_line(MCS51_INT1_LINE, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE);
|
||||
|
||||
/* handle any custom banking or other stuff */
|
||||
if (m_videomode_custom != NULL)
|
||||
@ -623,9 +621,8 @@ TIMER_DEVICE_CALLBACK_MEMBER(system1_state::mcu_t0_callback)
|
||||
choplift is even more picky about it, affecting scroll speed
|
||||
*/
|
||||
|
||||
device_t *mcu = machine().device("mcu");
|
||||
mcu->execute().set_input_line(MCS51_T0_LINE, ASSERT_LINE);
|
||||
mcu->execute().set_input_line(MCS51_T0_LINE, CLEAR_LINE);
|
||||
m_mcu->set_input_line(MCS51_T0_LINE, ASSERT_LINE);
|
||||
m_mcu->set_input_line(MCS51_T0_LINE, CLEAR_LINE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -856,12 +856,13 @@ INTERRUPT_GEN_MEMBER(tatsumi_state::roundup5_interrupt)
|
||||
|
||||
static void apache3_68000_reset(device_t *device)
|
||||
{
|
||||
device->machine().device("sub2")->execute().set_input_line(INPUT_LINE_RESET, PULSE_LINE);
|
||||
tatsumi_state *state = device->machine().driver_data<tatsumi_state>();
|
||||
state->m_subcpu2->set_input_line(INPUT_LINE_RESET, PULSE_LINE);
|
||||
}
|
||||
|
||||
MACHINE_RESET_MEMBER(tatsumi_state,apache3)
|
||||
{
|
||||
machine().device("sub2")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE); // TODO
|
||||
m_subcpu2->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); // TODO
|
||||
|
||||
/* Hook the RESET line, which resets the Z80 */
|
||||
m68k_set_reset_callback(m_subcpu, apache3_68000_reset);
|
||||
|
@ -266,7 +266,7 @@ WRITE8_MEMBER(xain_state::xain_68705_w)
|
||||
m_from_main = data;
|
||||
m_mcu_accept = 0;
|
||||
|
||||
if (machine().device("mcu") != NULL)
|
||||
if (m_mcu != NULL)
|
||||
m_mcu->set_input_line(0, ASSERT_LINE);
|
||||
}
|
||||
|
||||
@ -356,7 +356,7 @@ CUSTOM_INPUT_MEMBER(xain_state::mcu_status_r)
|
||||
{
|
||||
UINT8 res = 0;
|
||||
|
||||
if (machine().device("mcu") != NULL)
|
||||
if (m_mcu != NULL)
|
||||
{
|
||||
if (m_mcu_ready == 1)
|
||||
res |= 0x01;
|
||||
@ -376,7 +376,7 @@ READ8_MEMBER(xain_state::mcu_comm_reset_r)
|
||||
m_mcu_ready = 1;
|
||||
m_mcu_accept = 1;
|
||||
|
||||
if (machine().device("mcu") != NULL)
|
||||
if (m_mcu != NULL)
|
||||
m_mcu->set_input_line(0, CLEAR_LINE);
|
||||
|
||||
return 0xff;
|
||||
|
@ -11,7 +11,8 @@ public:
|
||||
m_galaga_ram3(*this, "galaga_ram3"),
|
||||
m_galaga_starcontrol(*this, "starcontrol"),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_subcpu(*this, "sub") { }
|
||||
m_subcpu(*this, "sub"),
|
||||
m_subcpu2(*this, "sub2") { }
|
||||
|
||||
/* memory pointers */
|
||||
optional_shared_ptr<UINT8> m_videoram;
|
||||
@ -74,6 +75,7 @@ public:
|
||||
static struct star m_star_seed_tab[];
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<cpu_device> m_subcpu;
|
||||
required_device<cpu_device> m_subcpu2;
|
||||
};
|
||||
|
||||
class xevious_state : public galaga_state
|
||||
|
@ -15,7 +15,8 @@ public:
|
||||
m_videoram(*this,"videoram"),
|
||||
m_spriteram(*this,"spriteram") ,
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_subcpu(*this, "sub") { }
|
||||
m_subcpu(*this, "sub"),
|
||||
m_subcpu2(*this, "sub2") { }
|
||||
|
||||
required_shared_ptr<UINT8> m_customio_3;
|
||||
required_shared_ptr<UINT8> m_videoram;
|
||||
@ -58,4 +59,5 @@ public:
|
||||
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect );
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<cpu_device> m_subcpu;
|
||||
required_device<cpu_device> m_subcpu2;
|
||||
};
|
||||
|
@ -6,7 +6,8 @@ public:
|
||||
m_videoram(*this, "videoram"),
|
||||
m_spriteram(*this, "spriteram"),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_subcpu(*this, "sub") { }
|
||||
m_subcpu(*this, "sub"),
|
||||
m_subcpu2(*this, "sub2") { }
|
||||
|
||||
required_shared_ptr<UINT8> m_videoram;
|
||||
required_shared_ptr<UINT8> m_spriteram;
|
||||
@ -68,4 +69,5 @@ public:
|
||||
void phozon_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8 *spriteram_base);
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<cpu_device> m_subcpu;
|
||||
required_device<cpu_device> m_subcpu2;
|
||||
};
|
||||
|
@ -20,7 +20,8 @@ public:
|
||||
m_alpha16_memory(*this, "alpha16_memory"),
|
||||
m_view16_memory(*this, "view16_memory"),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_subcpu(*this, "sub") { }
|
||||
m_subcpu(*this, "sub"),
|
||||
m_subcpu2(*this, "sub2") { }
|
||||
|
||||
optional_device<tms5220n_device> m_tms;
|
||||
UINT8 m_steer_last;
|
||||
@ -91,6 +92,7 @@ public:
|
||||
void zoom_sprite(bitmap_ind16 &bitmap,int big,UINT32 code,UINT32 color,int flipx,int sx,int sy,int sizex,int sizey);
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<cpu_device> m_subcpu;
|
||||
required_device<cpu_device> m_subcpu2;
|
||||
};
|
||||
|
||||
|
||||
|
@ -26,6 +26,7 @@ public:
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_audiocpu(*this, "audiocpu"),
|
||||
m_subcpu(*this, "sub"),
|
||||
m_subcpu2(*this, "sub2"),
|
||||
m_oki(*this, "oki") { }
|
||||
|
||||
optional_shared_ptr<UINT16> m_videoram;
|
||||
@ -136,6 +137,7 @@ public:
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<cpu_device> m_audiocpu;
|
||||
required_device<cpu_device> m_subcpu;
|
||||
required_device<cpu_device> m_subcpu2;
|
||||
required_device<okim6295_device> m_oki;
|
||||
};
|
||||
|
||||
|
@ -71,7 +71,8 @@ public:
|
||||
DECLARE_WRITE8_MEMBER(mapper68_rom_banking);
|
||||
DECLARE_WRITE8_MEMBER(set_bnglngby_irq_w);
|
||||
DECLARE_READ8_MEMBER(set_bnglngby_irq_r);
|
||||
DECLARE_WRITE8_MEMBER(vsdual_vrom_banking);
|
||||
DECLARE_WRITE8_MEMBER(vsdual_vrom_banking_main);
|
||||
DECLARE_WRITE8_MEMBER(vsdual_vrom_banking_sub);
|
||||
void v_set_mirroring(int ppu, int mirroring);
|
||||
DECLARE_READ8_MEMBER(psg1_4015_r);
|
||||
DECLARE_WRITE8_MEMBER(psg1_4015_w);
|
||||
|
@ -45,7 +45,7 @@ void taitosj_state::machine_reset()
|
||||
m_zaccept = 1;
|
||||
m_zready = 0;
|
||||
m_busreq = 0;
|
||||
if (machine().device("mcu") != NULL)
|
||||
if (m_mcu != NULL)
|
||||
m_mcu->set_input_line(0, CLEAR_LINE);
|
||||
|
||||
m_spacecr_prot_value = 0;
|
||||
|
@ -41,7 +41,7 @@ WRITE16_MEMBER(tatsumi_state::apache3_bank_w)
|
||||
if (m_control_word & 0x7f00)
|
||||
{
|
||||
logerror("Unknown control Word: %04x\n",m_control_word);
|
||||
machine().device("sub2")->execute().set_input_line(INPUT_LINE_HALT, CLEAR_LINE); // ?
|
||||
m_subcpu2->set_input_line(INPUT_LINE_HALT, CLEAR_LINE); // ?
|
||||
}
|
||||
|
||||
if (m_control_word & 0x10)
|
||||
@ -61,7 +61,7 @@ WRITE16_MEMBER(tatsumi_state::apache3_bank_w)
|
||||
// D0 = /GRDACC - Allow 68000 access to road pattern RAM
|
||||
WRITE16_MEMBER(tatsumi_state::apache3_z80_ctrl_w)
|
||||
{
|
||||
machine().device("sub2")->execute().set_input_line(INPUT_LINE_HALT, data & 2 ? ASSERT_LINE : CLEAR_LINE);
|
||||
m_subcpu2->set_input_line(INPUT_LINE_HALT, data & 2 ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
READ16_MEMBER(tatsumi_state::apache3_v30_v20_r)
|
||||
|
@ -982,20 +982,28 @@ DRIVER_INIT_MEMBER(vsnes_state,bnglngby)
|
||||
/**********************************************************************************/
|
||||
/* VS Dualsystem */
|
||||
|
||||
WRITE8_MEMBER(vsnes_state::vsdual_vrom_banking)
|
||||
WRITE8_MEMBER(vsnes_state::vsdual_vrom_banking_main)
|
||||
{
|
||||
device_t *other_cpu = (&space.device() == m_maincpu) ? m_subcpu : m_maincpu;
|
||||
/* switch vrom */
|
||||
(&space.device() == m_maincpu) ? membank("bank2")->set_entry(BIT(data, 2)) : membank("bank3")->set_entry(BIT(data, 2));
|
||||
membank("bank2")->set_entry(BIT(data, 2));
|
||||
|
||||
/* bit 1 ( data & 2 ) triggers irq on the other cpu */
|
||||
other_cpu->execute().set_input_line(0, (data & 2) ? CLEAR_LINE : ASSERT_LINE);
|
||||
m_subcpu->set_input_line(0, (data & 2) ? CLEAR_LINE : ASSERT_LINE);
|
||||
|
||||
/* move along */
|
||||
if (&space.device() == m_maincpu)
|
||||
vsnes_in0_w(space, offset, data);
|
||||
else
|
||||
vsnes_in0_1_w(space, offset, data);
|
||||
vsnes_in0_w(space, offset, data);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(vsnes_state::vsdual_vrom_banking_sub)
|
||||
{
|
||||
/* switch vrom */
|
||||
membank("bank3")->set_entry(BIT(data, 2));
|
||||
|
||||
/* bit 1 ( data & 2 ) triggers irq on the other cpu */
|
||||
m_maincpu->set_input_line(0, (data & 2) ? CLEAR_LINE : ASSERT_LINE);
|
||||
|
||||
/* move along */
|
||||
vsnes_in0_1_w(space, offset, data);
|
||||
}
|
||||
|
||||
DRIVER_INIT_MEMBER(vsnes_state,vsdual)
|
||||
@ -1003,8 +1011,8 @@ DRIVER_INIT_MEMBER(vsnes_state,vsdual)
|
||||
UINT8 *prg = memregion("maincpu")->base();
|
||||
|
||||
/* vrom switching is enabled with bit 2 of $4016 */
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0x4016, 0x4016, write8_delegate(FUNC(vsnes_state::vsdual_vrom_banking),this));
|
||||
m_subcpu->space(AS_PROGRAM).install_write_handler(0x4016, 0x4016, write8_delegate(FUNC(vsnes_state::vsdual_vrom_banking),this));
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0x4016, 0x4016, write8_delegate(FUNC(vsnes_state::vsdual_vrom_banking_main),this));
|
||||
m_subcpu->space(AS_PROGRAM).install_write_handler(0x4016, 0x4016, write8_delegate(FUNC(vsnes_state::vsdual_vrom_banking_sub),this));
|
||||
|
||||
/* shared ram at $6000 */
|
||||
m_maincpu->space(AS_PROGRAM).install_ram(0x6000, 0x7fff, &prg[0x6000]);
|
||||
|
Loading…
Reference in New Issue
Block a user