mirror of
https://github.com/holub/mame
synced 2025-10-06 17:08:28 +03:00
and more oki changes (nw)
This commit is contained in:
parent
1b8f5e73ef
commit
37c0c76931
@ -53,7 +53,8 @@ class namco_30test_state : public driver_device
|
||||
public:
|
||||
namco_30test_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_maincpu(*this, "maincpu") { }
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_oki(*this, "oki") { }
|
||||
|
||||
UINT8 m_mux_data;
|
||||
UINT8 m_oki_bank;
|
||||
@ -68,6 +69,7 @@ public:
|
||||
virtual void machine_start();
|
||||
virtual void machine_reset();
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<okim6295_device> m_oki;
|
||||
};
|
||||
|
||||
|
||||
@ -125,10 +127,8 @@ READ8_MEMBER(namco_30test_state::hc11_okibank_r)
|
||||
|
||||
WRITE8_MEMBER(namco_30test_state::hc11_okibank_w)
|
||||
{
|
||||
okim6295_device *oki = machine().device<okim6295_device>("oki");
|
||||
|
||||
m_oki_bank = data;
|
||||
oki->set_bank_base((data & 1) ? 0x40000 : 0);
|
||||
m_oki->set_bank_base((data & 1) ? 0x40000 : 0);
|
||||
}
|
||||
|
||||
|
||||
|
@ -69,7 +69,9 @@ public:
|
||||
m_ac_txvram(*this, "ac_txvram"),
|
||||
m_spriteram(*this, "spriteram"),
|
||||
m_ac_devram(*this, "ac_devram"),
|
||||
m_maincpu(*this, "maincpu") { }
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_oki1(*this, "oki1"),
|
||||
m_oki2(*this, "oki2") { }
|
||||
|
||||
required_shared_ptr<UINT16> m_ac_bgvram;
|
||||
required_shared_ptr<UINT16> m_ac_txvram;
|
||||
@ -98,6 +100,8 @@ public:
|
||||
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int priority, int pri_mask);
|
||||
void draw_led(bitmap_ind16 &bitmap, int x, int y,UINT8 value);
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<okim6295_device> m_oki1;
|
||||
required_device<okim6295_device> m_oki2;
|
||||
};
|
||||
|
||||
|
||||
@ -329,10 +333,10 @@ READ16_MEMBER(acommand_state::ac_devices_r)
|
||||
return ioport("IN0")->read();
|
||||
case 0x0014/2:
|
||||
case 0x0016/2:
|
||||
return machine().device<okim6295_device>("oki1")->read(space,0);
|
||||
return m_oki1->read(space,0);
|
||||
case 0x0018/2:
|
||||
case 0x001a/2:
|
||||
return machine().device<okim6295_device>("oki2")->read(space,0);
|
||||
return m_oki2->read(space,0);
|
||||
case 0x0040/2:
|
||||
/*
|
||||
"Upper switch / Under Switch"
|
||||
@ -410,26 +414,22 @@ WRITE16_MEMBER(acommand_state::ac_devices_w)
|
||||
case 0x00/2:
|
||||
if (ACCESSING_BITS_0_7)
|
||||
{
|
||||
okim6295_device *oki1 = machine().device<okim6295_device>("oki1");
|
||||
okim6295_device *oki2 = machine().device<okim6295_device>("oki2");
|
||||
oki1->set_bank_base(0x40000 * (data & 0x3));
|
||||
oki2->set_bank_base(0x40000 * (data & 0x30) >> 4);
|
||||
m_oki1->set_bank_base(0x40000 * (data & 0x3));
|
||||
m_oki2->set_bank_base(0x40000 * (data & 0x30) >> 4);
|
||||
}
|
||||
break;
|
||||
case 0x14/2:
|
||||
case 0x16/2:
|
||||
if(ACCESSING_BITS_0_7)
|
||||
{
|
||||
okim6295_device *oki1 = machine().device<okim6295_device>("oki1");
|
||||
oki1->write(space,0,data);
|
||||
m_oki1->write(space,0,data);
|
||||
}
|
||||
break;
|
||||
case 0x18/2:
|
||||
case 0x1a/2:
|
||||
if(ACCESSING_BITS_0_7)
|
||||
{
|
||||
okim6295_device *oki2 = machine().device<okim6295_device>("oki2");
|
||||
oki2->write(space,0,data);
|
||||
m_oki2->write(space,0,data);
|
||||
}
|
||||
break;
|
||||
case 0x1c/2:
|
||||
|
@ -88,15 +88,13 @@ UINT8 aquarium_state::aquarium_snd_bitswap( UINT8 scrambled_data )
|
||||
|
||||
READ8_MEMBER(aquarium_state::aquarium_oki_r)
|
||||
{
|
||||
okim6295_device *oki = machine().device<okim6295_device>("oki");
|
||||
return aquarium_snd_bitswap(oki->read(space, offset));
|
||||
return aquarium_snd_bitswap(m_oki->read(space, offset));
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(aquarium_state::aquarium_oki_w)
|
||||
{
|
||||
logerror("%s:Writing %04x to the OKI M6295\n", machine().describe_context(), aquarium_snd_bitswap(data));
|
||||
okim6295_device *oki = machine().device<okim6295_device>("oki");
|
||||
oki->write(space, offset, (aquarium_snd_bitswap(data)));
|
||||
m_oki->write(space, offset, (aquarium_snd_bitswap(data)));
|
||||
}
|
||||
|
||||
|
||||
|
@ -128,8 +128,7 @@ WRITE16_MEMBER(arcadecl_state::latch_w)
|
||||
/* lower byte being modified? */
|
||||
if (ACCESSING_BITS_0_7)
|
||||
{
|
||||
okim6295_device *oki = machine().device<okim6295_device>("oki");
|
||||
oki->set_bank_base((data & 0x80) ? 0x40000 : 0x00000);
|
||||
m_oki->set_bank_base((data & 0x80) ? 0x40000 : 0x00000);
|
||||
set_oki6295_volume((data & 0x001f) * 100 / 0x1f);
|
||||
}
|
||||
}
|
||||
|
@ -118,8 +118,7 @@ WRITE16_MEMBER(artmagic_state::control_w)
|
||||
/* OKI banking here */
|
||||
if (offset == 0)
|
||||
{
|
||||
okim6295_device *oki = machine().device<okim6295_device>("oki");
|
||||
oki->set_bank_base((((data >> 4) & 1) * 0x40000) % oki->region()->bytes());
|
||||
m_oki->set_bank_base((((data >> 4) & 1) * 0x40000) % m_oki->region()->bytes());
|
||||
}
|
||||
|
||||
logerror("%06X:control_w(%d) = %04X\n", space.device().safe_pc(), offset, data);
|
||||
|
@ -483,10 +483,8 @@ WRITE16_MEMBER(cischeat_state::scudhamm_oki_bank_w)
|
||||
{
|
||||
if (ACCESSING_BITS_0_7)
|
||||
{
|
||||
okim6295_device *oki1 = machine().device<okim6295_device>("oki1");
|
||||
okim6295_device *oki2 = machine().device<okim6295_device>("oki2");
|
||||
oki1->set_bank_base(0x40000 * ((data >> 0) & 0x3) );
|
||||
oki2->set_bank_base(0x40000 * ((data >> 4) & 0x3) );
|
||||
m_oki1->set_bank_base(0x40000 * ((data >> 0) & 0x3) );
|
||||
m_oki2->set_bank_base(0x40000 * ((data >> 4) & 0x3) );
|
||||
}
|
||||
}
|
||||
|
||||
@ -679,10 +677,8 @@ WRITE16_MEMBER(cischeat_state::bigrun_soundbank_w)
|
||||
{
|
||||
if (ACCESSING_BITS_0_7)
|
||||
{
|
||||
okim6295_device *oki1 = machine().device<okim6295_device>("oki1");
|
||||
okim6295_device *oki2 = machine().device<okim6295_device>("oki2");
|
||||
oki1->set_bank_base(0x40000 * ((data >> 0) & 1) );
|
||||
oki2->set_bank_base(0x40000 * ((data >> 4) & 1) );
|
||||
m_oki1->set_bank_base(0x40000 * ((data >> 0) & 1) );
|
||||
m_oki2->set_bank_base(0x40000 * ((data >> 4) & 1) );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1623,10 +1623,8 @@ WRITE_LINE_MEMBER(deco32_state::sound_irq_nslasher)
|
||||
|
||||
WRITE8_MEMBER(deco32_state::sound_bankswitch_w)
|
||||
{
|
||||
okim6295_device *oki1 = machine().device<okim6295_device>("oki1");
|
||||
okim6295_device *oki2 = machine().device<okim6295_device>("oki2");
|
||||
oki1->set_bank_base(((data >> 0)& 1) * 0x40000);
|
||||
oki2->set_bank_base(((data >> 1)& 1) * 0x40000);
|
||||
m_oki1->set_bank_base(((data >> 0)& 1) * 0x40000);
|
||||
m_oki2->set_bank_base(((data >> 1)& 1) * 0x40000);
|
||||
}
|
||||
|
||||
static const eeprom_interface eeprom_interface_tattass =
|
||||
|
@ -261,7 +261,7 @@ void deniam_state::machine_reset()
|
||||
doesn't matter since the coinup sfx (sample borrowed from 'tyrian' on PC)
|
||||
exists in both banks; it properly sets the bank as soon as the ufo sfx
|
||||
plays or a player character is selected on the character select screen */
|
||||
machine().device<okim6295_device>("oki")->set_bank_base(0x00000);
|
||||
m_oki->set_bank_base(0x00000);
|
||||
}
|
||||
|
||||
static MACHINE_CONFIG_START( deniam16b, deniam_state )
|
||||
|
@ -52,7 +52,8 @@ public:
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_audiocpu(*this, "audiocpu"),
|
||||
m_atram(*this, "atram"),
|
||||
m_maincpu(*this, "maincpu") { }
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_oki(*this, "oki") { }
|
||||
|
||||
/* video-related */
|
||||
tilemap_t *m_bg_tilemap;
|
||||
@ -84,6 +85,7 @@ public:
|
||||
UINT32 screen_update_egghunt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
void draw_sprites( bitmap_ind16 &bitmap,const rectangle &cliprect );
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<okim6295_device> m_oki;
|
||||
};
|
||||
|
||||
|
||||
@ -217,9 +219,8 @@ READ8_MEMBER(egghunt_state::egghunt_okibanking_r)
|
||||
|
||||
WRITE8_MEMBER(egghunt_state::egghunt_okibanking_w)
|
||||
{
|
||||
okim6295_device *oki = machine().device<okim6295_device>("oki");
|
||||
m_okibanking = data;
|
||||
oki->set_bank_base((data & 0x10) ? 0x40000 : 0);
|
||||
m_oki->set_bank_base((data & 0x10) ? 0x40000 : 0);
|
||||
}
|
||||
|
||||
static ADDRESS_MAP_START( egghunt_map, AS_PROGRAM, 8, egghunt_state )
|
||||
|
@ -70,7 +70,8 @@ public:
|
||||
feversoc_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_spriteram(*this, "spriteram"),
|
||||
m_maincpu(*this, "maincpu") { }
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_oki(*this, "oki") { }
|
||||
|
||||
UINT16 m_x;
|
||||
required_shared_ptr<UINT32> m_spriteram;
|
||||
@ -82,6 +83,7 @@ public:
|
||||
UINT32 screen_update_feversoc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
INTERRUPT_GEN_MEMBER(feversoc_irq);
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<okim6295_device> m_oki;
|
||||
};
|
||||
|
||||
|
||||
@ -157,8 +159,7 @@ WRITE32_MEMBER(feversoc_state::output_w)
|
||||
//data>>16 & 2 coin out
|
||||
coin_counter_w(machine(), 1,data>>16 & 4);
|
||||
//data>>16 & 8 coin hopper
|
||||
okim6295_device *oki = machine().device<okim6295_device>("oki");
|
||||
oki->set_bank_base(0x40000 * (((data>>16) & 0x20)>>5));
|
||||
m_oki->set_bank_base(0x40000 * (((data>>16) & 0x20)>>5));
|
||||
}
|
||||
if(ACCESSING_BITS_0_15)
|
||||
{
|
||||
|
@ -1517,8 +1517,7 @@ WRITE16_MEMBER(igs011_state::lhb2_igs003_w)
|
||||
{
|
||||
m_lhb2_pen_hi = data & 0x07;
|
||||
|
||||
okim6295_device *oki = machine().device<okim6295_device>("oki");
|
||||
oki->set_bank_base((data & 0x08) ? 0x40000 : 0);
|
||||
m_oki->set_bank_base((data & 0x08) ? 0x40000 : 0);
|
||||
}
|
||||
|
||||
if ( m_lhb2_pen_hi & ~0xf )
|
||||
@ -1652,8 +1651,7 @@ WRITE16_MEMBER(igs011_state::wlcc_igs003_w)
|
||||
coin_counter_w(machine(), 0, data & 0x01);
|
||||
// coin out data & 0x02
|
||||
|
||||
okim6295_device *oki = machine().device<okim6295_device>("oki");
|
||||
oki->set_bank_base((data & 0x10) ? 0x40000 : 0);
|
||||
m_oki->set_bank_base((data & 0x10) ? 0x40000 : 0);
|
||||
m_igs_hopper = data & 0x20;
|
||||
}
|
||||
|
||||
|
@ -58,13 +58,15 @@ public:
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_spriteram(*this, "spriteram", 0),
|
||||
m_fg_videoram(*this, "fg_videoram", 0),
|
||||
m_bg_videoram(*this, "bg_videoram", 0){ }
|
||||
m_bg_videoram(*this, "bg_videoram", 0),
|
||||
m_oki(*this, "oki"){ }
|
||||
|
||||
int m_input_addr;
|
||||
required_device<cpu_device> m_maincpu;
|
||||
optional_shared_ptr<UINT8> m_spriteram;
|
||||
optional_shared_ptr<UINT8> m_fg_videoram;
|
||||
optional_shared_ptr<UINT8> m_bg_videoram;
|
||||
required_device<okim6295_device> m_oki;
|
||||
|
||||
int m_toggle;
|
||||
int m_debug_addr;
|
||||
@ -1511,8 +1513,7 @@ WRITE16_MEMBER(igs017_state::sdmg2_magic_w)
|
||||
case 0x02:
|
||||
if (ACCESSING_BITS_0_7)
|
||||
{
|
||||
okim6295_device *oki = machine().device<okim6295_device>("oki");
|
||||
oki->set_bank_base((data & 0x80) ? 0x40000 : 0);
|
||||
m_oki->set_bank_base((data & 0x80) ? 0x40000 : 0);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -1613,8 +1614,7 @@ WRITE16_MEMBER(igs017_state::mgdha_magic_w)
|
||||
if (ACCESSING_BITS_0_7)
|
||||
{
|
||||
// bit 7?
|
||||
okim6295_device *oki = machine().device<okim6295_device>("oki");
|
||||
oki->set_bank_base((data & 0x40) ? 0x40000 : 0);
|
||||
m_oki->set_bank_base((data & 0x40) ? 0x40000 : 0);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -1710,7 +1710,7 @@ WRITE8_MEMBER(igs017_state::tjsb_output_w)
|
||||
break;
|
||||
|
||||
case 0x02:
|
||||
machine().device<okim6295_device>("oki")->set_bank_base((data & 0x10) ? 0x40000 : 0); // oki bank (0x20/0x30)
|
||||
m_oki->set_bank_base((data & 0x10) ? 0x40000 : 0); // oki bank (0x20/0x30)
|
||||
if (!(data & ~0x30))
|
||||
return;
|
||||
break;
|
||||
@ -1801,8 +1801,7 @@ WRITE16_MEMBER(igs017_state::lhzb2_magic_w)
|
||||
case 0x01:
|
||||
if (ACCESSING_BITS_0_7)
|
||||
{
|
||||
okim6295_device *oki = machine().device<okim6295_device>("oki");
|
||||
oki->set_bank_base((data & 0x80) ? 0x40000 : 0);
|
||||
m_oki->set_bank_base((data & 0x80) ? 0x40000 : 0);
|
||||
|
||||
if ( data & 0x7f )
|
||||
logerror("%s: warning, unknown bits written in oki bank = %04x\n", machine().describe_context(), data);
|
||||
@ -2162,8 +2161,7 @@ WRITE16_MEMBER(igs017_state::lhzb2a_input_select_w)
|
||||
}
|
||||
if (ACCESSING_BITS_8_15)
|
||||
{
|
||||
okim6295_device *oki = machine().device<okim6295_device>("oki");
|
||||
oki->set_bank_base((data & 0x0100) ? 0x40000 : 0);
|
||||
m_oki->set_bank_base((data & 0x0100) ? 0x40000 : 0);
|
||||
|
||||
if ( data & 0x0fe00 )
|
||||
logerror("%s: warning, unknown bits written in input_select = %04x\n", machine().describe_context(), data);
|
||||
@ -2220,8 +2218,7 @@ WRITE16_MEMBER(igs017_state::slqz2_magic_w)
|
||||
case 0x00:
|
||||
if (ACCESSING_BITS_0_7)
|
||||
{
|
||||
okim6295_device *oki = machine().device<okim6295_device>("oki");
|
||||
oki->set_bank_base((data & 0x01) ? 0x40000 : 0);
|
||||
m_oki->set_bank_base((data & 0x01) ? 0x40000 : 0);
|
||||
|
||||
// m_hopper = data & 0x20; // hopper motor
|
||||
// coin_counter_w(machine(), 1, data & 0x40); // coin out counter
|
||||
|
@ -41,7 +41,8 @@ public:
|
||||
m_spriteram(*this, "spriteram"),
|
||||
m_spriteram2(*this, "spriteram2"),
|
||||
m_videoreg(*this, "videoreg"),
|
||||
m_maincpu(*this, "maincpu") { }
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_oki(*this, "oki") { }
|
||||
|
||||
required_shared_ptr<UINT32> m_mainram;
|
||||
required_shared_ptr<UINT32> m_fg_videoram;
|
||||
@ -92,6 +93,7 @@ public:
|
||||
void draw_sprites(UINT32 *sprites, const rectangle &cliprect, int count);
|
||||
void copy_sprites(bitmap_ind16 &bitmap, bitmap_ind16 &sprites_bitmap, bitmap_ind8 &priority_bitmap, const rectangle &cliprect);
|
||||
required_device<cpu_device> m_maincpu;
|
||||
optional_device<okim6295_device> m_oki;
|
||||
};
|
||||
|
||||
/*****************************************************************************************************
|
||||
@ -288,7 +290,7 @@ READ8_MEMBER(limenko_state::spotty_sound_r)
|
||||
if(m_spotty_sound_cmd == 0xf7)
|
||||
return soundlatch_byte_r(space,0);
|
||||
else
|
||||
return machine().device<okim6295_device>("oki")->read(space,0);
|
||||
return m_oki->read(space,0);
|
||||
}
|
||||
|
||||
static ADDRESS_MAP_START( spotty_sound_io_map, AS_IO, 8, limenko_state )
|
||||
|
@ -115,8 +115,7 @@ WRITE16_MEMBER(pirates_state::pirates_out_w)
|
||||
m_eeprom->set_clock_line((data & 0x02) ? ASSERT_LINE : CLEAR_LINE);
|
||||
|
||||
/* bit 6 selects oki bank */
|
||||
okim6295_device *oki = machine().device<okim6295_device>("oki");
|
||||
oki->set_bank_base((data & 0x40) ? 0x40000 : 0x00000);
|
||||
m_oki->set_bank_base((data & 0x40) ? 0x40000 : 0x00000);
|
||||
|
||||
/* bit 7 used (function unknown) */
|
||||
}
|
||||
|
@ -195,8 +195,7 @@ WRITE8_MEMBER(playmark_state::playmark_snd_control_w)
|
||||
if ((data & 0x38) == 0x18)
|
||||
{
|
||||
// logerror("PC$%03x Writing %02x to OKI1, PortC=%02x, Code=%02x\n",space.device().safe_pcbase(),playmark_oki_command,playmark_oki_control,playmark_snd_command);
|
||||
okim6295_device *oki = machine().device<okim6295_device>("oki");
|
||||
oki->write(space, 0, m_oki_command);
|
||||
m_oki->write(space, 0, m_oki_command);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -94,7 +94,7 @@ WRITE16_MEMBER(powerbal_state::oki_banking)
|
||||
int addr = 0x40000 * ((data & 3) - 1);
|
||||
|
||||
if (addr < machine().root_device().memregion("oki")->bytes())
|
||||
machine().device<okim6295_device>("oki")->set_bank_base(addr);
|
||||
m_oki->set_bank_base(addr);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -317,7 +317,7 @@ ADDRESS_MAP_END
|
||||
|
||||
READ32_MEMBER(psikyo_state::s1945bl_oki_r)
|
||||
{
|
||||
UINT8 dat = machine().device<okim6295_device>("oki")->read(space, 0);
|
||||
UINT8 dat = m_oki->read(space, 0);
|
||||
return dat << 24;
|
||||
}
|
||||
|
||||
@ -325,8 +325,7 @@ WRITE32_MEMBER(psikyo_state::s1945bl_oki_w)
|
||||
{
|
||||
if (ACCESSING_BITS_24_31)
|
||||
{
|
||||
okim6295_device *oki = machine().device<okim6295_device>("oki");
|
||||
oki->write(space, 0, data >> 24);
|
||||
m_oki->write(space, 0, data >> 24);
|
||||
}
|
||||
|
||||
if (ACCESSING_BITS_16_23)
|
||||
|
@ -69,7 +69,7 @@ MACHINE_RESET_MEMBER(relief_state,relief)
|
||||
atarigen_state::machine_reset();
|
||||
atarivc_reset(*machine().primary_screen, m_atarivc_eof_data, 2);
|
||||
|
||||
machine().device<okim6295_device>("oki")->set_bank_base(0);
|
||||
m_oki->set_bank_base(0);
|
||||
m_ym2413_volume = 15;
|
||||
m_overall_volume = 127;
|
||||
m_adpcm_bank_base = 0;
|
||||
@ -110,8 +110,7 @@ WRITE16_MEMBER(relief_state::audio_control_w)
|
||||
if (ACCESSING_BITS_8_15)
|
||||
m_adpcm_bank_base = (0x100000 * ((data >> 8) & 1)) | (m_adpcm_bank_base & 0x0c0000);
|
||||
|
||||
okim6295_device *oki = machine().device<okim6295_device>("oki");
|
||||
oki->set_bank_base(m_adpcm_bank_base);
|
||||
m_oki->set_bank_base(m_adpcm_bank_base);
|
||||
}
|
||||
|
||||
|
||||
|
@ -866,8 +866,6 @@ READ32_MEMBER(seibuspi_state::spi_unknown_r)
|
||||
|
||||
WRITE32_MEMBER(seibuspi_state::eeprom_w)
|
||||
{
|
||||
okim6295_device *oki2 = machine().device<okim6295_device>("oki2");
|
||||
|
||||
// tile banks
|
||||
if( ACCESSING_BITS_16_23 ) {
|
||||
rf2_set_layer_banks(data >> 16);
|
||||
@ -878,8 +876,8 @@ WRITE32_MEMBER(seibuspi_state::eeprom_w)
|
||||
}
|
||||
|
||||
// oki banking
|
||||
if (oki2 != NULL)
|
||||
oki2->set_bank_base((data & 0x4000000) ? 0x40000 : 0);
|
||||
if (m_oki2 != NULL)
|
||||
m_oki2->set_bank_base((data & 0x4000000) ? 0x40000 : 0);
|
||||
}
|
||||
|
||||
WRITE32_MEMBER(seibuspi_state::z80_prg_fifo_w)
|
||||
|
@ -88,7 +88,7 @@ WRITE16_MEMBER(shangha3_state::heberpop_coinctrl_w)
|
||||
if (ACCESSING_BITS_0_7)
|
||||
{
|
||||
/* the sound ROM bank is selected by the main CPU! */
|
||||
machine().device<okim6295_device>("oki")->set_bank_base((data & 0x08) ? 0x40000 : 0x00000);
|
||||
m_oki->set_bank_base((data & 0x08) ? 0x40000 : 0x00000);
|
||||
|
||||
coin_lockout_w(machine(), 0,~data & 0x04);
|
||||
coin_lockout_w(machine(), 1,~data & 0x04);
|
||||
@ -102,7 +102,7 @@ WRITE16_MEMBER(shangha3_state::blocken_coinctrl_w)
|
||||
if (ACCESSING_BITS_0_7)
|
||||
{
|
||||
/* the sound ROM bank is selected by the main CPU! */
|
||||
machine().device<okim6295_device>("oki")->set_bank_base(((data >> 4) & 3) * 0x40000);
|
||||
m_oki->set_bank_base(((data >> 4) & 3) * 0x40000);
|
||||
|
||||
coin_lockout_w(machine(), 0,~data & 0x04);
|
||||
coin_lockout_w(machine(), 1,~data & 0x04);
|
||||
|
@ -139,7 +139,7 @@ WRITE32_MEMBER(silkroad_state::silk_6295_bank_w)
|
||||
{
|
||||
int bank = (data & 0x3000000) >> 24;
|
||||
if(bank < 3)
|
||||
machine().device<okim6295_device>("oki1")->set_bank_base(0x40000 * (bank));
|
||||
m_oki1->set_bank_base(0x40000 * (bank));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -136,8 +136,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(snowbros_state::snowbros_irq)
|
||||
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(snowbros_state::snowbros3_irq)
|
||||
{
|
||||
okim6295_device *adpcm = machine().device<okim6295_device>("oki");
|
||||
int status = adpcm->read_status();
|
||||
int status = m_oki->read_status();
|
||||
int scanline = param;
|
||||
|
||||
if(scanline == 240)
|
||||
@ -153,8 +152,8 @@ TIMER_DEVICE_CALLBACK_MEMBER(snowbros_state::snowbros3_irq)
|
||||
{
|
||||
if ((status&0x08)==0x00)
|
||||
{
|
||||
adpcm->write_command(0x80|m_sb3_music);
|
||||
adpcm->write_command(0x00|0x82);
|
||||
m_oki->write_command(0x80|m_sb3_music);
|
||||
m_oki->write_command(0x00|0x82);
|
||||
}
|
||||
|
||||
}
|
||||
@ -162,7 +161,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(snowbros_state::snowbros3_irq)
|
||||
{
|
||||
if ((status&0x08)==0x08)
|
||||
{
|
||||
adpcm->write_command(0x40); /* Stop playing music */
|
||||
m_oki->write_command(0x40); /* Stop playing music */
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -103,7 +103,8 @@ public:
|
||||
m_vram(*this, "vram"),
|
||||
m_cram(*this, "cram"),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_eeprom(*this, "eeprom") { }
|
||||
m_eeprom(*this, "eeprom"),
|
||||
m_oki(*this, "oki") { }
|
||||
|
||||
required_shared_ptr<UINT8> m_main;
|
||||
required_shared_ptr<UINT8> m_vram;
|
||||
@ -122,6 +123,7 @@ public:
|
||||
UINT32 screen_update_spool99(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<eeprom_device> m_eeprom;
|
||||
required_device<okim6295_device> m_oki;
|
||||
};
|
||||
|
||||
TILE_GET_INFO_MEMBER(spool99_state::get_spool99_tile_info)
|
||||
@ -185,7 +187,7 @@ READ8_MEMBER(spool99_state::spool99_io_r)
|
||||
// case 0xafe5: return 1;
|
||||
// case 0xafe6: return 1;
|
||||
case 0xafe7: return m_eeprom->read_bit();
|
||||
case 0xaff8: return machine().device<okim6295_device>("oki")->read(space,0);
|
||||
case 0xaff8: return m_oki->read(space,0);
|
||||
}
|
||||
}
|
||||
// printf("%04x %d\n",offset+0xaf00,io_switch);
|
||||
@ -243,7 +245,7 @@ READ8_MEMBER(spool99_state::vcarn_io_r)
|
||||
case 0xa725: return ioport("HOLD3")->read();
|
||||
case 0xa726: return ioport("HOLD4")->read();
|
||||
case 0xa727: return ioport("HOLD2")->read();
|
||||
case 0xa780: return machine().device<okim6295_device>("oki")->read(space,0);
|
||||
case 0xa780: return m_oki->read(space,0);
|
||||
case 0xa7a0: return ioport("HOLD1")->read();
|
||||
case 0xa7a1: return ioport("HOLD5")->read();
|
||||
case 0xa7a2: return ioport("START")->read();
|
||||
|
@ -216,9 +216,7 @@ static const UINT8 sslam_snd_loop[8][19] =
|
||||
TIMER_CALLBACK_MEMBER(sslam_state::music_playback)
|
||||
{
|
||||
int pattern = 0;
|
||||
okim6295_device *device = machine().device<okim6295_device>("oki");
|
||||
|
||||
if ((device->read_status() & 0x08) == 0)
|
||||
if ((m_oki->read_status() & 0x08) == 0)
|
||||
{
|
||||
m_bar += 1;
|
||||
pattern = sslam_snd_loop[m_melody][m_bar];
|
||||
@ -229,8 +227,8 @@ TIMER_CALLBACK_MEMBER(sslam_state::music_playback)
|
||||
pattern = sslam_snd_loop[m_melody][m_bar];
|
||||
}
|
||||
logerror("Changing bar in music track to pattern %02x\n",pattern);
|
||||
device->write_command(0x80 | pattern);
|
||||
device->write_command(0x81);
|
||||
m_oki->write_command(0x80 | pattern);
|
||||
m_oki->write_command(0x81);
|
||||
}
|
||||
else if (pattern == 0x00) { /* Non-looped track. Stop playing it */
|
||||
m_track = 0;
|
||||
@ -432,7 +430,7 @@ READ8_MEMBER(sslam_state::playmark_snd_command_r)
|
||||
data = soundlatch_byte_r(space,0);
|
||||
}
|
||||
else if ((m_oki_control & 0x38) == 0x28) {
|
||||
data = (machine().device<okim6295_device>("oki")->read(space,0) & 0x0f);
|
||||
data = (m_oki->read(space,0) & 0x0f);
|
||||
}
|
||||
|
||||
return data;
|
||||
@ -452,13 +450,13 @@ WRITE8_MEMBER(sslam_state::playmark_snd_control_w)
|
||||
if (m_oki_bank != ((data & 3) - 1))
|
||||
{
|
||||
m_oki_bank = (data & 3) - 1;
|
||||
machine().device<okim6295_device>("oki")->set_bank_base(0x40000 * m_oki_bank);
|
||||
m_oki->set_bank_base(0x40000 * m_oki_bank);
|
||||
}
|
||||
}
|
||||
|
||||
if ((data & 0x38) == 0x18)
|
||||
{
|
||||
machine().device<okim6295_device>("oki")->write(space, 0, m_oki_command);
|
||||
m_oki->write(space, 0, m_oki_command);
|
||||
}
|
||||
|
||||
// !(data & 0x80) -> sound enable
|
||||
|
@ -3742,12 +3742,12 @@ DRIVER_INIT_MEMBER(taito_f3_state,bubsymph)
|
||||
|
||||
READ32_MEMBER(taito_f3_state::bubsympb_oki_r)
|
||||
{
|
||||
return machine().device<okim6295_device>("oki")->read(space,0);
|
||||
return m_oki->read(space,0);
|
||||
}
|
||||
WRITE32_MEMBER(taito_f3_state::bubsympb_oki_w)
|
||||
{
|
||||
//printf("write %08x %08x\n",data,mem_mask);
|
||||
if (ACCESSING_BITS_0_7) machine().device<okim6295_device>("oki")->write(space, 0,data&0xff);
|
||||
if (ACCESSING_BITS_0_7) m_oki->write(space, 0,data&0xff);
|
||||
//if (mem_mask==0x000000ff) downcast<okim6295_device *>(device)->write(0,data&0xff);
|
||||
if (ACCESSING_BITS_16_23)
|
||||
{
|
||||
|
@ -589,7 +589,7 @@ WRITE16_MEMBER(toaplan2_state::shippumd_coin_word_w)
|
||||
if (ACCESSING_BITS_0_7)
|
||||
{
|
||||
toaplan2_coin_w(space, offset, data & 0xff);
|
||||
machine().device<okim6295_device>("oki")->set_bank_base(((data & 0x10) >> 4) * 0x40000);
|
||||
m_oki->set_bank_base(((data & 0x10) >> 4) * 0x40000);
|
||||
}
|
||||
if (ACCESSING_BITS_8_15 && (data & 0xff00) )
|
||||
{
|
||||
|
@ -314,15 +314,14 @@ Stephh's notes (based on the games M68000 code and some tests) :
|
||||
|
||||
WRITE16_MEMBER(tumbleb_state::tumblepb_oki_w)
|
||||
{
|
||||
okim6295_device *oki = machine().device<okim6295_device>("oki");
|
||||
if (mem_mask == 0xffff)
|
||||
{
|
||||
oki->write(space, 0, data & 0xff);
|
||||
m_oki->write(space, 0, data & 0xff);
|
||||
//printf("tumbleb_oki_w %04x %04x\n", data, mem_mask);
|
||||
}
|
||||
else
|
||||
{
|
||||
oki->write(space, 0, (data >> 8) & 0xff);
|
||||
m_oki->write(space, 0, (data >> 8) & 0xff);
|
||||
//printf("tumbleb_oki_w %04x %04x\n", data, mem_mask);
|
||||
}
|
||||
/* STUFF IN OTHER BYTE TOO..*/
|
||||
|
@ -1,4 +1,4 @@
|
||||
|
||||
#include "sound/okim6295.h"
|
||||
|
||||
|
||||
class aquarium_state : public driver_device
|
||||
@ -12,7 +12,8 @@ public:
|
||||
m_spriteram(*this, "spriteram"),
|
||||
m_scroll(*this, "scroll"),
|
||||
m_audiocpu(*this, "audiocpu"),
|
||||
m_maincpu(*this, "maincpu") { }
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_oki(*this, "oki") { }
|
||||
|
||||
/* memory pointers */
|
||||
required_shared_ptr<UINT16> m_mid_videoram;
|
||||
@ -52,4 +53,5 @@ public:
|
||||
void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int y_offs );
|
||||
UINT8 aquarium_snd_bitswap( UINT8 scrambled_data );
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<okim6295_device> m_oki;
|
||||
};
|
||||
|
@ -3,6 +3,7 @@
|
||||
Art & Magic hardware
|
||||
|
||||
**************************************************************************/
|
||||
#include "sound/okim6295.h"
|
||||
|
||||
class artmagic_state : public driver_device
|
||||
{
|
||||
@ -13,7 +14,8 @@ public:
|
||||
m_control(*this, "control"),
|
||||
m_vram0(*this, "vram0"),
|
||||
m_vram1(*this, "vram1"),
|
||||
m_maincpu(*this, "maincpu") { }
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_oki(*this, "oki") { }
|
||||
|
||||
required_device<tlc34076_device> m_tlc34076;
|
||||
required_shared_ptr<UINT16> m_control;
|
||||
@ -54,6 +56,7 @@ public:
|
||||
virtual void video_start();
|
||||
TIMER_CALLBACK_MEMBER(irq_off);
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<okim6295_device> m_oki;
|
||||
};
|
||||
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
#include "video/bufsprite.h"
|
||||
#include "video/decospr.h"
|
||||
#include "machine/eeprom.h"
|
||||
#include "sound/okim6295.h"
|
||||
|
||||
class deco32_state : public driver_device
|
||||
{
|
||||
@ -21,7 +22,9 @@ public:
|
||||
m_sprgen(*this, "spritegen"),
|
||||
m_sprgen1(*this, "spritegen1"),
|
||||
m_sprgen2(*this, "spritegen2"),
|
||||
m_eeprom(*this, "eeprom")
|
||||
m_eeprom(*this, "eeprom"),
|
||||
m_oki1(*this, "oki1"),
|
||||
m_oki2(*this, "oki2")
|
||||
{ }
|
||||
|
||||
required_device<cpu_device> m_maincpu;
|
||||
@ -41,6 +44,8 @@ public:
|
||||
optional_device<decospr_device> m_sprgen2;
|
||||
|
||||
optional_device<eeprom_device> m_eeprom;
|
||||
optional_device<okim6295_device> m_oki1;
|
||||
optional_device<okim6295_device> m_oki2;
|
||||
|
||||
int m_raster_enable;
|
||||
timer_device *m_raster_irq_timer;
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "machine/eeprom.h"
|
||||
#include "sound/okim6295.h"
|
||||
|
||||
class pirates_state : public driver_device
|
||||
{
|
||||
@ -11,7 +12,8 @@ public:
|
||||
m_fg_tileram(*this, "fg_tileram"),
|
||||
m_bg_tileram(*this, "bg_tileram"),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_eeprom(*this, "eeprom") { }
|
||||
m_eeprom(*this, "eeprom"),
|
||||
m_oki(*this, "oki") { }
|
||||
|
||||
required_shared_ptr<UINT16> m_spriteram;
|
||||
required_shared_ptr<UINT16> m_scroll;
|
||||
@ -41,4 +43,5 @@ public:
|
||||
void pirates_decrypt_oki();
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<eeprom_device> m_eeprom;
|
||||
required_device<okim6295_device> m_oki;
|
||||
};
|
||||
|
@ -3,6 +3,7 @@
|
||||
Psikyo Games
|
||||
|
||||
*************************************************************************/
|
||||
#include "sound/okim6295.h"
|
||||
|
||||
class psikyo_state : public driver_device
|
||||
{
|
||||
@ -15,7 +16,8 @@ public:
|
||||
m_vregs(*this, "vregs"),
|
||||
m_bootleg_spritebuffer(*this, "boot_spritebuf"),
|
||||
m_audiocpu(*this, "audiocpu"),
|
||||
m_maincpu(*this, "maincpu") { }
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_oki(*this, "oki") { }
|
||||
|
||||
/* memory pointers */
|
||||
required_shared_ptr<UINT32> m_spriteram;
|
||||
@ -103,6 +105,7 @@ public:
|
||||
DECLARE_WRITE_LINE_MEMBER(irqhandler);
|
||||
DECLARE_WRITE_LINE_MEMBER(sound_irq);
|
||||
required_device<cpu_device> m_maincpu;
|
||||
optional_device<okim6295_device> m_oki;
|
||||
};
|
||||
|
||||
/*----------- defined in video/psikyo.c -----------*/
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include "machine/intelfsh.h"
|
||||
#include "machine/eeprom.h"
|
||||
#include "sound/okim6295.h"
|
||||
|
||||
#define FIFO_SIZE 512
|
||||
|
||||
@ -12,7 +13,8 @@ public:
|
||||
m_spimainram(*this, "spimainram"),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_soundcpu(*this, "soundcpu"),
|
||||
m_eeprom(*this, "eeprom") { }
|
||||
m_eeprom(*this, "eeprom"),
|
||||
m_oki2(*this, "oki2") { }
|
||||
|
||||
optional_shared_ptr<UINT32> m_spi_scrollram;
|
||||
required_shared_ptr<UINT32> m_spimainram;
|
||||
@ -138,6 +140,7 @@ public:
|
||||
required_device<cpu_device> m_maincpu;
|
||||
optional_device<cpu_device> m_soundcpu;
|
||||
required_device<eeprom_device> m_eeprom;
|
||||
optional_device<okim6295_device> m_oki2;
|
||||
};
|
||||
/*----------- defined in machine/spisprit.c -----------*/
|
||||
void seibuspi_sprite_decrypt(UINT8 *src, int romsize);
|
||||
|
@ -1,3 +1,5 @@
|
||||
#include "sound/okim6295.h"
|
||||
|
||||
class shangha3_state : public driver_device
|
||||
{
|
||||
public:
|
||||
@ -5,7 +7,8 @@ public:
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_ram(*this, "ram"),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_audiocpu(*this, "audiocpu") { }
|
||||
m_audiocpu(*this, "audiocpu"),
|
||||
m_oki(*this, "oki") { }
|
||||
|
||||
int m_prot_count;
|
||||
required_shared_ptr<UINT16> m_ram;
|
||||
@ -33,4 +36,5 @@ public:
|
||||
DECLARE_WRITE_LINE_MEMBER(irqhandler);
|
||||
required_device<cpu_device> m_maincpu;
|
||||
optional_device<cpu_device> m_audiocpu;
|
||||
required_device<okim6295_device> m_oki;
|
||||
};
|
||||
|
@ -1,3 +1,5 @@
|
||||
#include "sound/okim6295.h"
|
||||
|
||||
class silkroad_state : public driver_device
|
||||
{
|
||||
public:
|
||||
@ -8,7 +10,8 @@ public:
|
||||
m_vidram3(*this, "vidram3"),
|
||||
m_sprram(*this, "sprram"),
|
||||
m_regs(*this, "regs"),
|
||||
m_maincpu(*this, "maincpu") { }
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_oki1(*this, "oki1") { }
|
||||
|
||||
required_shared_ptr<UINT32> m_vidram;
|
||||
required_shared_ptr<UINT32> m_vidram2;
|
||||
@ -32,4 +35,5 @@ public:
|
||||
UINT32 screen_update_silkroad(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<okim6295_device> m_oki1;
|
||||
};
|
||||
|
@ -1,3 +1,5 @@
|
||||
#include "sound/okim6295.h"
|
||||
|
||||
/* This it the best way to allow game specific kludges until the system is fully understood */
|
||||
enum {
|
||||
/* Early F3 class games, these are not cartridge games and system features may be different */
|
||||
@ -47,7 +49,8 @@ public:
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_f3_ram(*this,"f3_ram") ,
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_audiocpu(*this, "audiocpu") { }
|
||||
m_audiocpu(*this, "audiocpu"),
|
||||
m_oki(*this, "oki") { }
|
||||
|
||||
UINT16 *m_videoram;
|
||||
UINT16 *m_spriteram;
|
||||
@ -278,4 +281,5 @@ public:
|
||||
TIMER_CALLBACK_MEMBER(f3_interrupt3);
|
||||
required_device<cpu_device> m_maincpu;
|
||||
optional_device<cpu_device> m_audiocpu;
|
||||
optional_device<okim6295_device> m_oki;
|
||||
};
|
||||
|
@ -133,7 +133,8 @@ atarigen_state::atarigen_state(const machine_config &mconfig, device_type type,
|
||||
m_playfield2_latch(0),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_audiocpu(*this, "audiocpu"),
|
||||
m_jsacpu(*this, "jsa")
|
||||
m_jsacpu(*this, "jsa"),
|
||||
m_oki(*this, "oki")
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -43,7 +43,7 @@
|
||||
#include "machine/nvram.h"
|
||||
#include "machine/er2055.h"
|
||||
#include "cpu/m6502/m6502.h"
|
||||
|
||||
#include "sound/okim6295.h"
|
||||
|
||||
/***************************************************************************
|
||||
CONSTANTS
|
||||
@ -277,6 +277,7 @@ public:
|
||||
required_device<cpu_device> m_maincpu;
|
||||
optional_device<cpu_device> m_audiocpu;
|
||||
optional_device<m6502_device> m_jsacpu;
|
||||
optional_device<okim6295_device> m_oki;
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user