mirror of
https://github.com/holub/mame
synced 2025-10-07 17:27:06 +03:00
seta001.cpp : Convert arrays into std::unique_ptr, Minor cleanups (#3695)
* seta001.cpp : Convert arrays into std::unique_ptr, Minor cleanups srmp2.cpp : Reduce runtime tag lookups, Minor cleanups thedealr.cpp, seta.cpp, champbwl.cpp : Reduce runtime tag lookups taito_x.cpp : Reduce runtime tag lookups, Split kyustrkr machine_config/address map related to output handler * srmp2.cpp : Revert bit manipulation
This commit is contained in:
parent
b9e47c048d
commit
c28f5f2a49
@ -165,13 +165,14 @@ Notes:
|
||||
class champbwl_state : public driver_device
|
||||
{
|
||||
public:
|
||||
champbwl_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
champbwl_state(const machine_config &mconfig, device_type type, const char *tag) :
|
||||
driver_device(mconfig, type, tag),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_seta001(*this, "spritegen"),
|
||||
m_palette(*this, "palette"),
|
||||
m_x1(*this, "x1snd"),
|
||||
m_hopper(*this, "hopper"),
|
||||
m_mainbank(*this, "mainbank"),
|
||||
m_fakex(*this, "FAKEX"),
|
||||
m_fakey(*this, "FAKEY") { }
|
||||
|
||||
@ -182,6 +183,7 @@ public:
|
||||
required_device<palette_device> m_palette;
|
||||
required_device<x1_010_device> m_x1;
|
||||
optional_device<ticket_dispenser_device> m_hopper;
|
||||
optional_memory_bank m_mainbank;
|
||||
|
||||
optional_ioport m_fakex;
|
||||
optional_ioport m_fakey;
|
||||
@ -202,7 +204,7 @@ public:
|
||||
void champbwl(machine_config &config);
|
||||
void doraemon(machine_config &config);
|
||||
void champbwl_map(address_map &map);
|
||||
void doraemon(address_map &map);
|
||||
void doraemon_map(address_map &map);
|
||||
};
|
||||
|
||||
PALETTE_INIT_MEMBER(champbwl_state,champbwl)
|
||||
@ -247,13 +249,13 @@ WRITE8_MEMBER(champbwl_state::champbwl_misc_w)
|
||||
machine().bookkeeping().coin_lockout_w(0, ~data & 8);
|
||||
machine().bookkeeping().coin_lockout_w(1, ~data & 4);
|
||||
|
||||
membank("bank1")->set_entry((data & 0x30) >> 4);
|
||||
m_mainbank->set_entry((data & 0x30) >> 4);
|
||||
}
|
||||
|
||||
void champbwl_state::champbwl_map(address_map &map)
|
||||
{
|
||||
map(0x0000, 0x3fff).rom().region("maincpu", 0x10000);
|
||||
map(0x4000, 0x7fff).bankr("bank1");
|
||||
map(0x0000, 0x3fff).rom().region("maincpu", 0);
|
||||
map(0x4000, 0x7fff).bankr("mainbank");
|
||||
map(0x8000, 0x87ff).ram().share("nvram");
|
||||
map(0xa000, 0xafff).ram().rw(m_seta001, FUNC(seta001_device::spritecodelow_r8), FUNC(seta001_device::spritecodelow_w8));
|
||||
map(0xb000, 0xbfff).ram().rw(m_seta001, FUNC(seta001_device::spritecodehigh_r8), FUNC(seta001_device::spritecodehigh_w8));
|
||||
@ -285,15 +287,15 @@ WRITE8_MEMBER(champbwl_state::doraemon_outputs_w)
|
||||
machine().bookkeeping().coin_lockout_w(0, BIT(~data, 3)); // coin lockout
|
||||
m_hopper->motor_w(BIT(~data, 2)); // gift out motor
|
||||
|
||||
membank("bank1")->set_entry((data & 0x30) >> 4);
|
||||
m_mainbank->set_entry((data & 0x30) >> 4);
|
||||
|
||||
// popmessage("%02x", data);
|
||||
}
|
||||
|
||||
void champbwl_state::doraemon(address_map &map)
|
||||
void champbwl_state::doraemon_map(address_map &map)
|
||||
{
|
||||
map(0x0000, 0x3fff).rom();
|
||||
map(0x4000, 0x7fff).bankr("bank1");
|
||||
map(0x4000, 0x7fff).bankr("mainbank");
|
||||
map(0x8000, 0x87ff).ram().share("nvram");
|
||||
map(0xa000, 0xafff).ram().rw(m_seta001, FUNC(seta001_device::spritecodelow_r8), FUNC(seta001_device::spritecodelow_w8));
|
||||
map(0xb000, 0xbfff).ram().rw(m_seta001, FUNC(seta001_device::spritecodehigh_r8), FUNC(seta001_device::spritecodehigh_w8));
|
||||
@ -455,7 +457,7 @@ MACHINE_START_MEMBER(champbwl_state,champbwl)
|
||||
{
|
||||
uint8_t *ROM = memregion("maincpu")->base();
|
||||
|
||||
membank("bank1")->configure_entries(0, 4, &ROM[0x10000], 0x4000);
|
||||
m_mainbank->configure_entries(0, 4, &ROM[0], 0x4000);
|
||||
|
||||
save_item(NAME(m_screenflip));
|
||||
save_item(NAME(m_last_trackball_val));
|
||||
@ -551,14 +553,14 @@ WRITE_LINE_MEMBER(champbwl_state::screen_vblank_doraemon)
|
||||
MACHINE_START_MEMBER(champbwl_state,doraemon)
|
||||
{
|
||||
uint8_t *ROM = memregion("maincpu")->base();
|
||||
membank("bank1")->configure_entries(0, 4, &ROM[0x10000], 0x4000);
|
||||
m_mainbank->configure_entries(0, 4, &ROM[0], 0x4000);
|
||||
}
|
||||
|
||||
MACHINE_CONFIG_START(champbwl_state::doraemon)
|
||||
|
||||
/* basic machine hardware */
|
||||
MCFG_DEVICE_ADD("maincpu", Z80, XTAL(14'318'181)/4)
|
||||
MCFG_DEVICE_PROGRAM_MAP(doraemon)
|
||||
MCFG_DEVICE_PROGRAM_MAP(doraemon_map)
|
||||
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", champbwl_state, irq0_line_hold)
|
||||
|
||||
MCFG_NVRAM_ADD_0FILL("nvram")
|
||||
@ -592,8 +594,8 @@ MACHINE_CONFIG_END
|
||||
|
||||
|
||||
ROM_START( champbwl )
|
||||
ROM_REGION( 0x20000, "maincpu", 0 ) /* Z80 Code */
|
||||
ROM_LOAD( "ab001001.u1", 0x10000, 0x10000, CRC(6c6f7675) SHA1(19834f25f2644ae5d156c1e1bbb3fc50cae10fd2) )
|
||||
ROM_REGION( 0x10000, "maincpu", 0 ) /* Z80 Code */
|
||||
ROM_LOAD( "ab001001.u1", 0x00000, 0x10000, CRC(6c6f7675) SHA1(19834f25f2644ae5d156c1e1bbb3fc50cae10fd2) )
|
||||
|
||||
ROM_REGION( 0x80000, "gfx1", 0 )
|
||||
ROM_LOAD( "ab001007.u22", 0x00000, 0x20000, CRC(1ee9f6b1) SHA1(1a67e969b1f471ec7ada294b89185c15cde8c1ab) )
|
||||
@ -692,9 +694,8 @@ Notes:
|
||||
*/
|
||||
|
||||
ROM_START( doraemon )
|
||||
ROM_REGION( 0x30000, "maincpu", 0 )
|
||||
ROM_REGION( 0x20000, "maincpu", 0 )
|
||||
ROM_LOAD( "u1.bin", 0x00000, 0x20000, CRC(d338b9ca) SHA1(5f59c994db81577dc6074362c8b6b93f8fe592f6) )
|
||||
ROM_RELOAD( 0x10000, 0x20000 ) /* banked at 4000-7fff */
|
||||
|
||||
ROM_REGION( 0x80000, "gfx1", 0 )
|
||||
ROM_LOAD( "u22.bin", 0x00000, 0x20000, CRC(b264ac2d) SHA1(0529fd1b88ba61dcf72019c7b01e9b939b6e3f2e) )
|
||||
|
@ -1592,7 +1592,7 @@ WRITE16_MEMBER(seta_state::sub_ctrl_w)
|
||||
/* DSW reading for 16 bit CPUs */
|
||||
READ16_MEMBER(seta_state::seta_dsw_r)
|
||||
{
|
||||
uint16_t dsw = ioport("DSW")->read();
|
||||
uint16_t dsw = m_dsw->read();
|
||||
if (offset == 0) return (dsw >> 8) & 0xff;
|
||||
else return (dsw >> 0) & 0xff;
|
||||
}
|
||||
@ -2852,14 +2852,13 @@ READ16_MEMBER(seta_state::kiwame_input_r)
|
||||
{
|
||||
int row_select = m_kiwame_row_select;
|
||||
int i;
|
||||
static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4" };
|
||||
|
||||
for(i = 0; i < 5; i++)
|
||||
if (row_select & (1<<i)) break;
|
||||
|
||||
switch( offset )
|
||||
{
|
||||
case 0x00/2: return ioport(keynames[i])->read();
|
||||
case 0x00/2: return m_key[i]->read();
|
||||
case 0x02/2: return 0xffff;
|
||||
case 0x04/2: return m_coins->read();
|
||||
// case 0x06/2:
|
||||
@ -3263,10 +3262,10 @@ READ16_MEMBER(jockeyc_state::trackball_r)
|
||||
{
|
||||
switch (offset)
|
||||
{
|
||||
case 0/2: return (ioport("P1X")->read() >> 0) & 0xff;
|
||||
case 2/2: return (ioport("P1X")->read() >> 8) & 0xff;
|
||||
case 4/2: return (ioport("P1Y")->read() >> 0) & 0xff;
|
||||
case 6/2: return (ioport("P1Y")->read() >> 8) & 0xff;
|
||||
case 0/2: return (m_p1x->read() >> 0) & 0xff;
|
||||
case 2/2: return (m_p1x->read() >> 8) & 0xff;
|
||||
case 4/2: return (m_p1y->read() >> 0) & 0xff;
|
||||
case 6/2: return (m_p1y->read() >> 8) & 0xff;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -3467,21 +3466,21 @@ void seta_state::twineagl_sub_map(address_map &map)
|
||||
|
||||
READ8_MEMBER(seta_state::downtown_ip_r)
|
||||
{
|
||||
int dir1 = ioport("ROT1")->read(); // analog port
|
||||
int dir2 = ioport("ROT2")->read(); // analog port
|
||||
int dir1 = m_rot[0]->read(); // analog port
|
||||
int dir2 = m_rot[1]->read(); // analog port
|
||||
|
||||
dir1 = (~ (0x800 >> dir1)) & 0xfff;
|
||||
dir2 = (~ (0x800 >> dir2)) & 0xfff;
|
||||
|
||||
switch (offset)
|
||||
{
|
||||
case 0: return (ioport("COINS")->read() & 0xf0) + (dir1 >> 8); // upper 4 bits of p1 rotation + coins
|
||||
case 0: return (m_coins->read() & 0xf0) + (dir1 >> 8); // upper 4 bits of p1 rotation + coins
|
||||
case 1: return (dir1 & 0xff); // lower 8 bits of p1 rotation
|
||||
case 2: return ioport("P1")->read(); // p1
|
||||
case 2: return m_p1->read(); // p1
|
||||
case 3: return 0xff; // ?
|
||||
case 4: return (dir2 >> 8); // upper 4 bits of p2 rotation + ?
|
||||
case 5: return (dir2 & 0xff); // lower 8 bits of p2 rotation
|
||||
case 6: return ioport("P2")->read(); // p2
|
||||
case 6: return m_p2->read(); // p2
|
||||
case 7: return 0xff; // ?
|
||||
}
|
||||
|
||||
@ -10376,7 +10375,7 @@ ROM_END
|
||||
ROM_START( rezont )
|
||||
ROM_REGION( 0x200000, "maincpu", 0 ) /* 68000 Code */
|
||||
ROM_LOAD16_BYTE( "us001001.u3", 0x000000, 0x020000, CRC(ab923052) SHA1(26761c228b63c300f635787e63e1276b6e3083f0) )
|
||||
ROM_LOAD16_BYTE( "rezon_1_p.u4", 0x000001, 0x020000, CRC(9ed32f8c) SHA1(68b926de4cb5f2632ab78b2cdf7409411fadbb1d) )
|
||||
ROM_LOAD16_BYTE( "rezon_1_p.u4", 0x000001, 0x020000, CRC(9ed32f8c) SHA1(68b926de4cb5f2632ab78b2cdf7409411fadbb1d) )
|
||||
/* empty gap */
|
||||
ROM_LOAD16_BYTE( "us001004.103", 0x100000, 0x020000, CRC(54871c7c) SHA1(2f807b15760b1e712fa69eee6f33cc8a36ee1c02) ) // 1xxxxxxxxxxxxxxxx = 0x00
|
||||
ROM_LOAD16_BYTE( "us001003.102", 0x100001, 0x020000, CRC(1ac3d272) SHA1(0f19bc9c19e355dad5b463b0fa33127523bf141b) ) // 1xxxxxxxxxxxxxxxx = 0x00
|
||||
|
@ -116,7 +116,7 @@ MACHINE_START_MEMBER(srmp2_state,srmp3)
|
||||
m_iox.protcheck[2] = 0x1c; m_iox.protlatch[2] = 0x04;
|
||||
m_iox.protcheck[3] = 0x45; m_iox.protlatch[3] = 0x00;
|
||||
|
||||
membank("bank1")->configure_entries(0, 16, memregion("maincpu")->base(), 0x2000);
|
||||
m_mainbank->configure_entries(0, 16, memregion("maincpu")->base(), 0x2000);
|
||||
|
||||
save_item(NAME(m_gfx_bank));
|
||||
}
|
||||
@ -133,7 +133,7 @@ MACHINE_START_MEMBER(srmp2_state,rmgoldyh)
|
||||
m_iox.protcheck[2] = -1; m_iox.protlatch[2] = -1;
|
||||
m_iox.protcheck[3] = -1; m_iox.protlatch[3] = -1;
|
||||
|
||||
membank("bank1")->configure_entries(0, 32, memregion("maincpu")->base(), 0x2000);
|
||||
m_mainbank->configure_entries(0, 32, memregion("maincpu")->base(), 0x2000);
|
||||
|
||||
save_item(NAME(m_gfx_bank));
|
||||
}
|
||||
@ -170,8 +170,8 @@ WRITE16_MEMBER(srmp2_state::srmp2_flags_w)
|
||||
*/
|
||||
|
||||
|
||||
machine().bookkeeping().coin_counter_w(0, ((data & 0x01) >> 0) );
|
||||
machine().bookkeeping().coin_lockout_w(0, (((~data) & 0x10) >> 4) );
|
||||
machine().bookkeeping().coin_counter_w(0, BIT(data, 0) );
|
||||
machine().bookkeeping().coin_lockout_w(0, BIT(~data, 4) );
|
||||
m_adpcm_bank = ( (data & 0x20) >> 5 );
|
||||
m_color_bank = ( (data & 0x80) >> 7 );
|
||||
}
|
||||
@ -184,8 +184,8 @@ WRITE16_MEMBER(srmp2_state::mjyuugi_flags_w)
|
||||
---x ---- : Coin Lock Out
|
||||
*/
|
||||
|
||||
machine().bookkeeping().coin_counter_w(0, ((data & 0x01) >> 0) );
|
||||
machine().bookkeeping().coin_lockout_w(0, (((~data) & 0x10) >> 4) );
|
||||
machine().bookkeeping().coin_counter_w(0, BIT(data, 0) );
|
||||
machine().bookkeeping().coin_lockout_w(0, BIT(~data, 4) );
|
||||
}
|
||||
|
||||
|
||||
@ -196,7 +196,6 @@ WRITE16_MEMBER(srmp2_state::mjyuugi_adpcm_bank_w)
|
||||
--xx ---- : GFX Bank
|
||||
*/
|
||||
|
||||
|
||||
m_adpcm_bank = (data & 0x0f);
|
||||
m_gfx_bank = ((data >> 4) & 0x03);
|
||||
}
|
||||
@ -211,10 +210,8 @@ WRITE8_MEMBER(srmp2_state::adpcm_code_w)
|
||||
table and plays the ADPCM for itself.
|
||||
*/
|
||||
|
||||
uint8_t *ROM = memregion("adpcm")->base();
|
||||
|
||||
m_adpcm_sptr = (ROM[((m_adpcm_bank * 0x10000) + (data << 2) + 0)] << 8);
|
||||
m_adpcm_eptr = (ROM[((m_adpcm_bank * 0x10000) + (data << 2) + 1)] << 8);
|
||||
m_adpcm_sptr = (m_adpcm_rom[((m_adpcm_bank * 0x10000) + (data << 2) + 0)] << 8);
|
||||
m_adpcm_eptr = (m_adpcm_rom[((m_adpcm_bank * 0x10000) + (data << 2) + 1)] << 8);
|
||||
m_adpcm_eptr = (m_adpcm_eptr - 1) & 0x0ffff;
|
||||
|
||||
m_adpcm_sptr += (m_adpcm_bank * 0x10000);
|
||||
@ -229,13 +226,11 @@ WRITE8_MEMBER(srmp2_state::adpcm_code_w)
|
||||
|
||||
WRITE_LINE_MEMBER(srmp2_state::adpcm_int)
|
||||
{
|
||||
uint8_t *ROM = memregion("adpcm")->base();
|
||||
|
||||
if (m_adpcm_sptr)
|
||||
{
|
||||
if (m_adpcm_data == -1)
|
||||
{
|
||||
m_adpcm_data = ROM[m_adpcm_sptr];
|
||||
m_adpcm_data = m_adpcm_rom[m_adpcm_sptr];
|
||||
|
||||
if (m_adpcm_sptr >= m_adpcm_eptr)
|
||||
{
|
||||
@ -372,7 +367,7 @@ WRITE8_MEMBER(srmp2_state::srmp3_rombank_w)
|
||||
*/
|
||||
m_adpcm_bank = ((data & 0xe0) >> 5);
|
||||
|
||||
membank("bank1")->set_entry(data & 0x0f);
|
||||
m_mainbank->set_entry(data & 0x0f);
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
@ -462,9 +457,8 @@ WRITE8_MEMBER(srmp2_state::srmp3_flags_w)
|
||||
xx-- ---- : GFX Bank
|
||||
*/
|
||||
|
||||
|
||||
machine().bookkeeping().coin_counter_w(0, ((data & 0x01) >> 0) );
|
||||
machine().bookkeeping().coin_lockout_w(0, (((~data) & 0x10) >> 4) );
|
||||
machine().bookkeeping().coin_counter_w(0, BIT(data, 0) );
|
||||
machine().bookkeeping().coin_lockout_w(0, BIT(~data, 4) );
|
||||
m_gfx_bank = (data >> 6) & 0x03;
|
||||
}
|
||||
|
||||
@ -476,7 +470,7 @@ WRITE8_MEMBER(srmp2_state::srmp3_irq_ack_w)
|
||||
void srmp2_state::srmp3_map(address_map &map)
|
||||
{
|
||||
map(0x0000, 0x7fff).rom();
|
||||
map(0x8000, 0x9fff).bankr("bank1"); /* rom bank */
|
||||
map(0x8000, 0x9fff).bankr("mainbank"); /* rom bank */
|
||||
map(0xa000, 0xa7ff).ram().share("nvram"); /* work ram */
|
||||
map(0xa800, 0xa800).nopw(); /* flag ? */
|
||||
map(0xb000, 0xb2ff).ram().rw(m_seta001, FUNC(seta001_device::spriteylow_r8), FUNC(seta001_device::spriteylow_w8));
|
||||
@ -503,7 +497,7 @@ void srmp2_state::srmp3_io_map(address_map &map)
|
||||
void srmp2_state::rmgoldyh_map(address_map &map)
|
||||
{
|
||||
map(0x0000, 0x7fff).rom();
|
||||
map(0x8000, 0x9fff).bankr("bank1"); /* rom bank */
|
||||
map(0x8000, 0x9fff).bankr("mainbank"); /* rom bank */
|
||||
map(0xa000, 0xafff).ram().share("nvram"); /* work ram */
|
||||
map(0xb000, 0xb2ff).ram().rw(m_seta001, FUNC(seta001_device::spriteylow_r8), FUNC(seta001_device::spriteylow_w8));
|
||||
map(0xb300, 0xb303).ram().rw(m_seta001, FUNC(seta001_device::spritectrl_r8), FUNC(seta001_device::spritectrl_w8));
|
||||
@ -520,7 +514,7 @@ WRITE8_MEMBER(srmp2_state::rmgoldyh_rombank_w)
|
||||
*/
|
||||
m_adpcm_bank = ((data & 0xe0) >> 5);
|
||||
|
||||
membank("bank1")->set_entry(data & 0x1f);
|
||||
m_mainbank->set_entry(data & 0x1f);
|
||||
}
|
||||
|
||||
void srmp2_state::rmgoldyh_io_map(address_map &map)
|
||||
|
@ -9,7 +9,7 @@ Taito X-system
|
||||
driver by Richard Bush, Howie Cohen and Yochizo
|
||||
|
||||
25th Nov 2003
|
||||
video merged with video/seta.c
|
||||
video merged with video/seta.cpp
|
||||
|
||||
|
||||
Supported games:
|
||||
@ -341,13 +341,13 @@ READ16_MEMBER(taitox_state::superman_dsw_input_r)
|
||||
switch (offset)
|
||||
{
|
||||
case 0x00:
|
||||
return ioport("DSWA")->read() & 0x0f;
|
||||
return m_dswa_io->read() & 0x0f;
|
||||
case 0x01:
|
||||
return (ioport("DSWA")->read() & 0xf0) >> 4;
|
||||
return (m_dswa_io->read() & 0xf0) >> 4;
|
||||
case 0x02:
|
||||
return ioport("DSWB")->read() & 0x0f;
|
||||
return m_dswb_io->read() & 0x0f;
|
||||
case 0x03:
|
||||
return (ioport("DSWB")->read() & 0xf0) >> 4;
|
||||
return (m_dswb_io->read() & 0xf0) >> 4;
|
||||
default:
|
||||
logerror("taitox unknown dsw read offset: %04x\n", offset);
|
||||
return 0x00;
|
||||
@ -359,11 +359,11 @@ READ16_MEMBER(taitox_state::daisenpu_input_r)
|
||||
switch (offset)
|
||||
{
|
||||
case 0x00:
|
||||
return ioport("IN0")->read(); /* Player 1 controls + START1 */
|
||||
return m_in_io[0]->read(); /* Player 1 controls + START1 */
|
||||
case 0x01:
|
||||
return ioport("IN1")->read(); /* Player 2 controls + START2 */
|
||||
return m_in_io[1]->read(); /* Player 2 controls + START2 */
|
||||
case 0x02:
|
||||
return ioport("IN2")->read(); /* COINn + SERVICE1 + TILT */
|
||||
return m_in_io[2]->read(); /* COINn + SERVICE1 + TILT */
|
||||
|
||||
default:
|
||||
logerror("taitox unknown input read offset: %04x\n", offset);
|
||||
@ -411,14 +411,24 @@ WRITE16_MEMBER(taitox_state::kyustrkr_input_w)
|
||||
|
||||
WRITE8_MEMBER(taitox_state::sound_bankswitch_w)
|
||||
{
|
||||
membank("z80bank")->set_entry(data & 3);
|
||||
m_z80bank->set_entry(data & 3);
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************************/
|
||||
|
||||
void taitox_state::taito_x_base_map(address_map &map)
|
||||
{
|
||||
map(0xb00000, 0xb00fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette");
|
||||
map(0xd00000, 0xd005ff).ram().rw(m_seta001, FUNC(seta001_device::spriteylow_r16), FUNC(seta001_device::spriteylow_w16)); // Sprites Y
|
||||
map(0xd00600, 0xd00607).ram().rw(m_seta001, FUNC(seta001_device::spritectrl_r16), FUNC(seta001_device::spritectrl_w16));
|
||||
map(0xe00000, 0xe03fff).ram().rw(m_seta001, FUNC(seta001_device::spritecode_r16), FUNC(seta001_device::spritecode_w16)); // Sprites Code + X + Attr
|
||||
map(0xf00000, 0xf03fff).ram(); /* Main RAM */
|
||||
}
|
||||
|
||||
void taitox_state::superman_map(address_map &map)
|
||||
{
|
||||
taito_x_base_map(map);
|
||||
map(0x000000, 0x07ffff).rom();
|
||||
map(0x300000, 0x300001).nopw(); /* written each frame at $3a9c, mostly 0x10 */
|
||||
map(0x400000, 0x400001).nopw(); /* written each frame at $3aa2, mostly 0x10 */
|
||||
@ -429,15 +439,11 @@ void taitox_state::superman_map(address_map &map)
|
||||
map(0x800003, 0x800003).rw("tc0140syt", FUNC(tc0140syt_device::master_comm_r), FUNC(tc0140syt_device::master_comm_w));
|
||||
map(0x900000, 0x9007ff).rw(m_cchip, FUNC(taito_cchip_device::mem68_r), FUNC(taito_cchip_device::mem68_w)).umask16(0x00ff);
|
||||
map(0x900800, 0x900fff).rw(m_cchip, FUNC(taito_cchip_device::asic_r), FUNC(taito_cchip_device::asic68_w)).umask16(0x00ff);
|
||||
map(0xb00000, 0xb00fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette");
|
||||
map(0xd00000, 0xd005ff).ram().rw(m_seta001, FUNC(seta001_device::spriteylow_r16), FUNC(seta001_device::spriteylow_w16)); // Sprites Y
|
||||
map(0xd00600, 0xd00607).ram().rw(m_seta001, FUNC(seta001_device::spritectrl_r16), FUNC(seta001_device::spritectrl_w16));
|
||||
map(0xe00000, 0xe03fff).ram().rw(m_seta001, FUNC(seta001_device::spritecode_r16), FUNC(seta001_device::spritecode_w16)); // Sprites Code + X + Attr
|
||||
map(0xf00000, 0xf03fff).ram(); /* Main RAM */
|
||||
}
|
||||
|
||||
void taitox_state::daisenpu_map(address_map &map)
|
||||
{
|
||||
taito_x_base_map(map);
|
||||
map(0x000000, 0x03ffff).rom();
|
||||
// map(0x400000, 0x400001).nopw(); /* written each frame at $2ac, values change */
|
||||
map(0x500000, 0x50000f).r(FUNC(taitox_state::superman_dsw_input_r));
|
||||
@ -446,15 +452,11 @@ void taitox_state::daisenpu_map(address_map &map)
|
||||
map(0x800001, 0x800001).w("ciu", FUNC(pc060ha_device::master_port_w));
|
||||
map(0x800003, 0x800003).rw("ciu", FUNC(pc060ha_device::master_comm_r), FUNC(pc060ha_device::master_comm_w));
|
||||
map(0x900000, 0x90000f).rw(FUNC(taitox_state::daisenpu_input_r), FUNC(taitox_state::daisenpu_input_w));
|
||||
map(0xb00000, 0xb00fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette");
|
||||
map(0xd00000, 0xd005ff).ram().rw(m_seta001, FUNC(seta001_device::spriteylow_r16), FUNC(seta001_device::spriteylow_w16)); // Sprites Y
|
||||
map(0xd00600, 0xd00607).ram().rw(m_seta001, FUNC(seta001_device::spritectrl_r16), FUNC(seta001_device::spritectrl_w16));
|
||||
map(0xe00000, 0xe03fff).ram().rw(m_seta001, FUNC(seta001_device::spritecode_r16), FUNC(seta001_device::spritecode_w16)); // Sprites Code + X + Attr
|
||||
map(0xf00000, 0xf03fff).ram(); /* Main RAM */
|
||||
}
|
||||
|
||||
void taitox_state::gigandes_map(address_map &map)
|
||||
{
|
||||
taito_x_base_map(map);
|
||||
map(0x000000, 0x07ffff).rom();
|
||||
map(0x400000, 0x400001).nopw(); /* 0x1 written each frame at $d42, watchdog? */
|
||||
map(0x500000, 0x500007).r(FUNC(taitox_state::superman_dsw_input_r));
|
||||
@ -463,15 +465,11 @@ void taitox_state::gigandes_map(address_map &map)
|
||||
map(0x800001, 0x800001).w("tc0140syt", FUNC(tc0140syt_device::master_port_w));
|
||||
map(0x800003, 0x800003).rw("tc0140syt", FUNC(tc0140syt_device::master_comm_r), FUNC(tc0140syt_device::master_comm_w));
|
||||
map(0x900000, 0x90000f).rw(FUNC(taitox_state::daisenpu_input_r), FUNC(taitox_state::daisenpu_input_w));
|
||||
map(0xb00000, 0xb00fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette");
|
||||
map(0xd00000, 0xd005ff).ram().rw(m_seta001, FUNC(seta001_device::spriteylow_r16), FUNC(seta001_device::spriteylow_w16)); // Sprites Y
|
||||
map(0xd00600, 0xd00607).ram().rw(m_seta001, FUNC(seta001_device::spritectrl_r16), FUNC(seta001_device::spritectrl_w16));
|
||||
map(0xe00000, 0xe03fff).ram().rw(m_seta001, FUNC(seta001_device::spritecode_r16), FUNC(seta001_device::spritecode_w16)); // Sprites Code + X + Attr
|
||||
map(0xf00000, 0xf03fff).ram(); /* Main RAM */
|
||||
}
|
||||
|
||||
void taitox_state::ballbros_map(address_map &map)
|
||||
{
|
||||
taito_x_base_map(map);
|
||||
map(0x000000, 0x03ffff).rom();
|
||||
map(0x400000, 0x400001).nopw(); /* 0x1 written each frame at $c56, watchdog? */
|
||||
map(0x500000, 0x50000f).r(FUNC(taitox_state::superman_dsw_input_r));
|
||||
@ -480,11 +478,19 @@ void taitox_state::ballbros_map(address_map &map)
|
||||
map(0x800001, 0x800001).w("tc0140syt", FUNC(tc0140syt_device::master_port_w));
|
||||
map(0x800003, 0x800003).rw("tc0140syt", FUNC(tc0140syt_device::master_comm_r), FUNC(tc0140syt_device::master_comm_w));
|
||||
map(0x900000, 0x90000f).rw(FUNC(taitox_state::daisenpu_input_r), FUNC(taitox_state::daisenpu_input_w));
|
||||
map(0xb00000, 0xb00fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette");
|
||||
map(0xd00000, 0xd005ff).ram().rw(m_seta001, FUNC(seta001_device::spriteylow_r16), FUNC(seta001_device::spriteylow_w16)); // Sprites Y
|
||||
map(0xd00600, 0xd00607).ram().rw(m_seta001, FUNC(seta001_device::spritectrl_r16), FUNC(seta001_device::spritectrl_w16));
|
||||
map(0xe00000, 0xe03fff).ram().rw(m_seta001, FUNC(seta001_device::spritecode_r16), FUNC(seta001_device::spritecode_w16)); // Sprites Code + X + Attr
|
||||
map(0xf00000, 0xf03fff).ram(); /* Main RAM */
|
||||
}
|
||||
|
||||
void taitox_state::kyustrkr_map(address_map &map)
|
||||
{
|
||||
taito_x_base_map(map);
|
||||
map(0x000000, 0x03ffff).rom();
|
||||
map(0x400000, 0x400001).nopw(); /* 0x1 written each frame at $c56, watchdog? */
|
||||
map(0x500000, 0x50000f).r(FUNC(taitox_state::superman_dsw_input_r));
|
||||
map(0x600000, 0x600001).nopw(); /* 0x1 written each frame at $c4e, watchdog? */
|
||||
map(0x800000, 0x800001).nopr();
|
||||
map(0x800001, 0x800001).w("tc0140syt", FUNC(tc0140syt_device::master_port_w));
|
||||
map(0x800003, 0x800003).rw("tc0140syt", FUNC(tc0140syt_device::master_comm_r), FUNC(tc0140syt_device::master_comm_w));
|
||||
map(0x900000, 0x90000f).rw(FUNC(taitox_state::daisenpu_input_r), FUNC(taitox_state::kyustrkr_input_w));
|
||||
}
|
||||
|
||||
|
||||
@ -803,7 +809,7 @@ GFXDECODE_END
|
||||
MACHINE_START_MEMBER(taitox_state,taitox)
|
||||
{
|
||||
int banks = memregion("audiocpu")->bytes() / 0x4000;
|
||||
membank("z80bank")->configure_entries(0, banks, memregion("audiocpu")->base(), 0x4000);
|
||||
m_z80bank->configure_entries(0, banks, memregion("audiocpu")->base(), 0x4000);
|
||||
}
|
||||
|
||||
INTERRUPT_GEN_MEMBER(taitox_state::interrupt)
|
||||
@ -1019,6 +1025,13 @@ MACHINE_CONFIG_START(taitox_state::ballbros)
|
||||
MCFG_TC0140SYT_SLAVE_CPU("audiocpu")
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
MACHINE_CONFIG_START(taitox_state::kyustrkr)
|
||||
ballbros(config);
|
||||
/* basic machine hardware */
|
||||
MCFG_DEVICE_MODIFY("maincpu")
|
||||
MCFG_DEVICE_PROGRAM_MAP(kyustrkr_map)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
|
||||
@ -1285,19 +1298,13 @@ ROM_START( ballbros )
|
||||
ROM_END
|
||||
|
||||
|
||||
void taitox_state::init_kyustrkr()
|
||||
{
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0x900000, 0x90000f, write16_delegate(FUNC(taitox_state::kyustrkr_input_w),this));
|
||||
}
|
||||
|
||||
|
||||
GAME( 1988, superman, 0, superman, superman, taitox_state, empty_init, ROT0, "Taito Corporation", "Superman (World)", 0 )
|
||||
GAME( 1988, supermanu, superman, superman, supermanu, taitox_state, empty_init, ROT0, "Taito Corporation", "Superman (US)", 0 )
|
||||
GAME( 1988, supermanj, superman, superman, supermanj, taitox_state, empty_init, ROT0, "Taito Corporation", "Superman (Japan)", 0 )
|
||||
GAME( 1989, twinhawk, 0, daisenpu, twinhawk, taitox_state, empty_init, ROT270, "Taito Corporation Japan", "Twin Hawk (World)", 0 )
|
||||
GAME( 1989, twinhawku, twinhawk, daisenpu, twinhawku, taitox_state, empty_init, ROT270, "Taito America Corporation", "Twin Hawk (US)", 0 )
|
||||
GAME( 1989, daisenpu, twinhawk, daisenpu, daisenpu, taitox_state, empty_init, ROT270, "Taito Corporation", "Daisenpu (Japan)", 0 )
|
||||
GAME( 1989, gigandes, 0, gigandes, gigandes, taitox_state, empty_init, ROT0, "East Technology", "Gigandes", 0 )
|
||||
GAME( 1989, gigandesa, gigandes, gigandes, gigandes, taitox_state, empty_init, ROT0, "East Technology", "Gigandes (earlier)", 0 )
|
||||
GAME( 1989, kyustrkr, 0, ballbros, kyustrkr, taitox_state, init_kyustrkr, ROT180, "East Technology", "Last Striker / Kyuukyoku no Striker", 0 )
|
||||
GAME( 1992, ballbros, 0, ballbros, ballbros, taitox_state, empty_init, ROT0, "East Technology", "Balloon Brothers", 0 )
|
||||
GAME( 1988, superman, 0, superman, superman, taitox_state, empty_init, ROT0, "Taito Corporation", "Superman (World)", 0 )
|
||||
GAME( 1988, supermanu, superman, superman, supermanu, taitox_state, empty_init, ROT0, "Taito Corporation", "Superman (US)", 0 )
|
||||
GAME( 1988, supermanj, superman, superman, supermanj, taitox_state, empty_init, ROT0, "Taito Corporation", "Superman (Japan)", 0 )
|
||||
GAME( 1989, twinhawk, 0, daisenpu, twinhawk, taitox_state, empty_init, ROT270, "Taito Corporation Japan", "Twin Hawk (World)", 0 )
|
||||
GAME( 1989, twinhawku, twinhawk, daisenpu, twinhawku, taitox_state, empty_init, ROT270, "Taito America Corporation", "Twin Hawk (US)", 0 )
|
||||
GAME( 1989, daisenpu, twinhawk, daisenpu, daisenpu, taitox_state, empty_init, ROT270, "Taito Corporation", "Daisenpu (Japan)", 0 )
|
||||
GAME( 1989, gigandes, 0, gigandes, gigandes, taitox_state, empty_init, ROT0, "East Technology", "Gigandes", 0 )
|
||||
GAME( 1989, gigandesa, gigandes, gigandes, gigandes, taitox_state, empty_init, ROT0, "East Technology", "Gigandes (earlier)", 0 )
|
||||
GAME( 1989, kyustrkr, 0, kyustrkr, kyustrkr, taitox_state, empty_init, ROT180, "East Technology", "Last Striker / Kyuukyoku no Striker", 0 )
|
||||
GAME( 1992, ballbros, 0, ballbros, ballbros, taitox_state, empty_init, ROT0, "East Technology", "Balloon Brothers", 0 )
|
||||
|
@ -49,6 +49,7 @@ public:
|
||||
m_subcpu(*this, "subcpu"),
|
||||
m_seta001(*this, "spritegen"),
|
||||
m_palette(*this, "palette"),
|
||||
m_iox_io(*this, "IOX"),
|
||||
m_leds(*this, "led%u", 0U)
|
||||
{ }
|
||||
|
||||
@ -84,6 +85,7 @@ private:
|
||||
required_device<cpu_device> m_subcpu;
|
||||
required_device<seta001_device> m_seta001;
|
||||
required_device<palette_device> m_palette;
|
||||
optional_ioport m_iox_io;
|
||||
output_finder<8> m_leds;
|
||||
};
|
||||
|
||||
@ -202,7 +204,7 @@ WRITE8_MEMBER(thedealr_state::iox_w)
|
||||
{
|
||||
case 0x01: // inputs?
|
||||
{
|
||||
uint16_t buttons = ioport("IOX")->read();
|
||||
uint16_t buttons = m_iox_io->read();
|
||||
m_iox_ret = 0;
|
||||
for (int i = 0; i < 16; ++i)
|
||||
{
|
||||
|
@ -59,6 +59,7 @@ public:
|
||||
m_extra_port(*this, "EXTRA"),
|
||||
m_track_x(*this, "TRACK%u_X", 1U),
|
||||
m_track_y(*this, "TRACK%u_Y", 1U),
|
||||
m_key(*this, "KEY%u", 0U),
|
||||
m_sharedram(*this,"sharedram"),
|
||||
m_vram(*this,"vram_%u", 0U),
|
||||
m_vctrl(*this,"vctrl_%u", 0U),
|
||||
@ -88,6 +89,7 @@ public:
|
||||
optional_ioport m_extra_port;
|
||||
optional_ioport_array<2> m_track_x;
|
||||
optional_ioport_array<2> m_track_y;
|
||||
optional_ioport_array<5> m_key;
|
||||
|
||||
optional_shared_ptr<uint8_t> m_sharedram;
|
||||
optional_shared_ptr_array<uint16_t, 2> m_vram;
|
||||
@ -406,6 +408,8 @@ public:
|
||||
m_dsw1(*this, "DSW1"),
|
||||
m_dsw2_3(*this, "DSW2_3"),
|
||||
m_cabinet(*this, "CABINET"),
|
||||
m_p1x(*this, "P1X"),
|
||||
m_p1y(*this, "P1Y"),
|
||||
m_out_cancel(*this, "cancel%u", 1U),
|
||||
m_out_payout(*this, "payout%u", 1U),
|
||||
m_out_start(*this, "start%u", 1U),
|
||||
@ -449,6 +453,8 @@ private:
|
||||
required_ioport_array<5> m_key1, m_key2;
|
||||
required_ioport m_dsw1, m_dsw2_3;
|
||||
optional_ioport m_cabinet;
|
||||
optional_ioport m_p1x;
|
||||
optional_ioport m_p1y;
|
||||
|
||||
output_finder<2> m_out_cancel;
|
||||
output_finder<2> m_out_payout;
|
||||
|
@ -15,15 +15,20 @@ struct iox_t
|
||||
class srmp2_state : public driver_device
|
||||
{
|
||||
public:
|
||||
srmp2_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
srmp2_state(const machine_config &mconfig, device_type type, const char *tag) :
|
||||
driver_device(mconfig, type, tag),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_seta001(*this, "spritegen"),
|
||||
m_msm(*this, "msm") { }
|
||||
m_msm(*this, "msm"),
|
||||
m_adpcm_rom(*this, "adpcm"),
|
||||
m_mainbank(*this, "mainbank")
|
||||
{ }
|
||||
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<seta001_device> m_seta001;
|
||||
required_device<msm5205_device> m_msm;
|
||||
required_region_ptr<uint8_t> m_adpcm_rom;
|
||||
optional_memory_bank m_mainbank;
|
||||
|
||||
int m_color_bank;
|
||||
int m_gfx_bank;
|
||||
|
@ -13,10 +13,14 @@
|
||||
class taitox_state : public seta_state
|
||||
{
|
||||
public:
|
||||
taitox_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: seta_state(mconfig, type, tag),
|
||||
taitox_state(const machine_config &mconfig, device_type type, const char *tag) :
|
||||
seta_state(mconfig, type, tag),
|
||||
m_cchip(*this, "cchip"),
|
||||
m_cchip_irq_clear(*this, "cchip_irq_clear")
|
||||
m_cchip_irq_clear(*this, "cchip_irq_clear"),
|
||||
m_z80bank(*this, "z80bank"),
|
||||
m_dswa_io(*this, "DSWA"),
|
||||
m_dswb_io(*this, "DSWB"),
|
||||
m_in_io(*this, "IN%u", 0U)
|
||||
{ }
|
||||
|
||||
DECLARE_READ16_MEMBER(superman_dsw_input_r);
|
||||
@ -25,7 +29,6 @@ public:
|
||||
DECLARE_WRITE16_MEMBER(daisenpu_input_w);
|
||||
DECLARE_WRITE16_MEMBER(kyustrkr_input_w);
|
||||
DECLARE_WRITE8_MEMBER(sound_bankswitch_w);
|
||||
void init_kyustrkr();
|
||||
DECLARE_MACHINE_START(taitox);
|
||||
|
||||
INTERRUPT_GEN_MEMBER(interrupt);
|
||||
@ -33,18 +36,25 @@ public:
|
||||
|
||||
void superman(machine_config &config);
|
||||
void ballbros(machine_config &config);
|
||||
void kyustrkr(machine_config &config);
|
||||
void gigandes(machine_config &config);
|
||||
void daisenpu(machine_config &config);
|
||||
void ballbros_map(address_map &map);
|
||||
void daisenpu_map(address_map &map);
|
||||
void daisenpu_sound_map(address_map &map);
|
||||
void gigandes_map(address_map &map);
|
||||
void kyustrkr_map(address_map &map);
|
||||
void sound_map(address_map &map);
|
||||
void superman_map(address_map &map);
|
||||
void taito_x_base_map(address_map &map);
|
||||
|
||||
private:
|
||||
optional_device<taito_cchip_device> m_cchip;
|
||||
optional_device<timer_device> m_cchip_irq_clear;
|
||||
required_memory_bank m_z80bank;
|
||||
optional_ioport m_dswa_io;
|
||||
optional_ioport m_dswb_io;
|
||||
optional_ioport_array<3> m_in_io;
|
||||
};
|
||||
|
||||
#endif // MAME_INCLUDES_TAITO_X_H
|
||||
|
@ -9,12 +9,13 @@
|
||||
|
||||
used by:
|
||||
|
||||
seta.c
|
||||
taito_x.c
|
||||
tnzs.c
|
||||
srmp2.c
|
||||
champbwl.c
|
||||
cchance.c
|
||||
seta.cpp
|
||||
taito_x.cpp
|
||||
tnzs.cpp
|
||||
srmp2.cpp
|
||||
champbwl.cpp
|
||||
cchance.cpp
|
||||
thedealr.cpp
|
||||
|
||||
note: the data bus is almost certainly 8-bit, dating back to the earliest
|
||||
hardware the games were used on. the RAM arrangements changes
|
||||
@ -40,14 +41,17 @@ seta001_device::seta001_device(const machine_config &mconfig, const char *tag, d
|
||||
|
||||
void seta001_device::device_start()
|
||||
{
|
||||
m_spriteylow = std::make_unique<uint8_t[]>(0x300); // 0x200 low y + 0x100 bg stuff
|
||||
m_spritecodelow = std::make_unique<uint8_t[]>(0x2000);
|
||||
m_spritecodehigh = std::make_unique<uint8_t[]>(0x2000);
|
||||
|
||||
// chukatai draws a column on the left from uninitialized RAM which causes garbage in a debug build
|
||||
// if we initialize ram this is a single line in the top left instead.
|
||||
// maybe there is less RAM actually present and it should mirror, or there is another flaw?
|
||||
memset(m_spritectrl,0xff,4);
|
||||
memset(m_spriteylow,0xff,0x300);
|
||||
memset(m_spritecodelow,0xff,0x2000);
|
||||
memset(m_spritecodehigh,0xff,0x2000);
|
||||
|
||||
memset(m_spriteylow.get(),0xff,0x300);
|
||||
memset(m_spritecodelow.get(),0xff,0x2000);
|
||||
memset(m_spritecodehigh.get(),0xff,0x2000);
|
||||
|
||||
m_fg_flipxoffs = 0;
|
||||
m_fg_noflipxoffs = 0;
|
||||
@ -71,9 +75,9 @@ void seta001_device::device_start()
|
||||
|
||||
save_item(NAME(m_bgflag));
|
||||
save_item(NAME(m_spritectrl));
|
||||
save_item(NAME(m_spriteylow));
|
||||
save_item(NAME(m_spritecodelow));
|
||||
save_item(NAME(m_spritecodehigh));
|
||||
save_pointer(NAME(m_spriteylow),0x300);
|
||||
save_pointer(NAME(m_spritecodelow),0x2000);
|
||||
save_pointer(NAME(m_spritecodehigh),0x2000);
|
||||
}
|
||||
|
||||
void seta001_device::device_reset()
|
||||
@ -199,24 +203,24 @@ void seta001_device::draw_background( bitmap_ind16 &bitmap, const rectangle &cli
|
||||
int offs, col;
|
||||
int xoffs, yoffs;
|
||||
|
||||
int total_color_codes = m_gfxdecode->gfx(0)->colors();
|
||||
int const total_color_codes = m_gfxdecode->gfx(0)->colors();
|
||||
|
||||
int ctrl = m_spritectrl[0];
|
||||
int ctrl2 = m_spritectrl[1];
|
||||
int const ctrl = m_spritectrl[0];
|
||||
int const ctrl2 = m_spritectrl[1];
|
||||
|
||||
int flip = ctrl & 0x40;
|
||||
int const flip = ctrl & 0x40;
|
||||
int numcol = ctrl2 & 0x0f;
|
||||
|
||||
int scrollx, scrolly;
|
||||
|
||||
uint32_t upper;
|
||||
|
||||
uint8_t* scrollram = m_spriteylow+0x200;
|
||||
const uint8_t* scrollram = &m_spriteylow[0x200];
|
||||
|
||||
/* Sprites Banking and/or Sprites Buffering */
|
||||
uint16_t bank = ( ((ctrl2 ^ (~ctrl2<<1)) & 0x40) ? bank_size : 0 );
|
||||
|
||||
int max_y = 0xf0;
|
||||
int const max_y = 0xf0;
|
||||
|
||||
// HACKS
|
||||
// used in conjunction with setac_type
|
||||
@ -230,11 +234,9 @@ void seta001_device::draw_background( bitmap_ind16 &bitmap, const rectangle &cli
|
||||
default: col0 = 0x0;
|
||||
}
|
||||
|
||||
|
||||
xoffs = flip ? m_bg_flipxoffs : m_bg_noflipxoffs;
|
||||
yoffs = flip ? m_bg_flipyoffs : m_bg_noflipyoffs;
|
||||
|
||||
|
||||
if (m_bgflag & 0x80)
|
||||
transpen = -1;
|
||||
else
|
||||
@ -314,17 +316,17 @@ void seta001_device::draw_background( bitmap_ind16 &bitmap, const rectangle &cli
|
||||
|
||||
void seta001_device::draw_foreground( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int bank_size)
|
||||
{
|
||||
int screenflip = (m_spritectrl[0] & 0x40) >> 6;
|
||||
int const screenflip = (m_spritectrl[0] & 0x40) >> 6;
|
||||
int i;
|
||||
int ctrl2 = m_spritectrl[1];
|
||||
int const ctrl2 = m_spritectrl[1];
|
||||
int xoffs, yoffs;
|
||||
|
||||
int total_color_codes = m_gfxdecode->gfx(0)->colors();
|
||||
int const total_color_codes = m_gfxdecode->gfx(0)->colors();
|
||||
|
||||
uint8_t *char_pointer = m_spritecodelow + 0x0000;
|
||||
uint8_t *x_pointer = m_spritecodelow + 0x0200;
|
||||
uint8_t *ctrl_pointer = m_spritecodehigh + 0x0000;
|
||||
uint8_t *color_pointer = m_spritecodehigh + 0x0200;
|
||||
uint8_t *char_pointer = &m_spritecodelow[0x0000];
|
||||
uint8_t *x_pointer = &m_spritecodelow[0x0200];
|
||||
uint8_t *ctrl_pointer = &m_spritecodehigh[0x0000];
|
||||
uint8_t *color_pointer = &m_spritecodehigh[0x0200];
|
||||
|
||||
xoffs = screenflip ? m_fg_flipxoffs : m_fg_noflipxoffs;
|
||||
yoffs = screenflip ? m_fg_flipyoffs : m_fg_noflipyoffs;
|
||||
@ -337,8 +339,7 @@ void seta001_device::draw_foreground( screen_device &screen, bitmap_ind16 &bitma
|
||||
color_pointer += bank_size;
|
||||
}
|
||||
|
||||
int max_y = screen.height();
|
||||
|
||||
int const max_y = screen.height();
|
||||
|
||||
/* Draw up to 512 sprites, mjyuugi has glitches if you draw them all.. */
|
||||
for (i = m_spritelimit; i >= 0; i--)
|
||||
@ -348,7 +349,6 @@ void seta001_device::draw_foreground( screen_device &screen, bitmap_ind16 &bitma
|
||||
code = char_pointer[i] + ((ctrl_pointer[i] & 0x3f) << 8);
|
||||
color = (color_pointer[i] & 0xf8) >> 3;
|
||||
|
||||
|
||||
sx = x_pointer[i] - ((color_pointer[i] & 1) << 8);
|
||||
sy = (m_spriteylow[i] & 0xff);
|
||||
flipx = ctrl_pointer[i] & 0x80;
|
||||
@ -409,7 +409,7 @@ void seta001_device::setac_eof()
|
||||
// is this handling right?
|
||||
// it differs to tnzs, and thundercade has sprite flickering issues (not related to the devicification)
|
||||
|
||||
int ctrl2 = m_spritectrl[1];
|
||||
int const ctrl2 = m_spritectrl[1];
|
||||
|
||||
if (~ctrl2 & 0x20)
|
||||
{
|
||||
@ -428,7 +428,7 @@ void seta001_device::setac_eof()
|
||||
|
||||
void seta001_device::tnzs_eof( void )
|
||||
{
|
||||
int ctrl2 = m_spritectrl[1];
|
||||
int const ctrl2 = m_spritectrl[1];
|
||||
if (~ctrl2 & 0x20)
|
||||
{
|
||||
// note I copy sprites only. setac implementation also copies the "floating tilemap"
|
||||
|
@ -81,9 +81,9 @@ private:
|
||||
// live state
|
||||
uint8_t m_bgflag;
|
||||
uint8_t m_spritectrl[4];
|
||||
uint8_t m_spriteylow[0x300]; // 0x200 low y + 0x100 bg stuff
|
||||
uint8_t m_spritecodelow[0x2000]; // tnzs.c stuff only uses half?
|
||||
uint8_t m_spritecodehigh[0x2000]; // ^
|
||||
std::unique_ptr<uint8_t[]> m_spriteylow;
|
||||
std::unique_ptr<uint8_t[]> m_spritecodelow; // tnzs.cpp stuff only uses half?
|
||||
std::unique_ptr<uint8_t[]> m_spritecodehigh; // ^
|
||||
};
|
||||
|
||||
DECLARE_DEVICE_TYPE(SETA001_SPRITE, seta001_device)
|
||||
|
@ -41,13 +41,7 @@ PALETTE_INIT_MEMBER(srmp2_state,srmp3)
|
||||
|
||||
SETA001_SPRITE_GFXBANK_CB_MEMBER(srmp2_state::srmp3_gfxbank_callback)
|
||||
{
|
||||
if (code & 0x2000)
|
||||
{
|
||||
code = (code & 0x1fff);
|
||||
code += ((m_gfx_bank + 1) * 0x2000);
|
||||
}
|
||||
|
||||
return code;
|
||||
return (code & 0x3fff) + ((code & 0x2000) ? (m_gfx_bank<<13) : 0);
|
||||
}
|
||||
|
||||
|
||||
@ -57,7 +51,7 @@ uint32_t srmp2_state::screen_update_srmp2(screen_device &screen, bitmap_ind16 &b
|
||||
|
||||
m_seta001->set_transpen(15);
|
||||
|
||||
m_seta001->set_colorbase((m_color_bank)?0x20:0x00);
|
||||
m_seta001->set_colorbase(m_color_bank<<5);
|
||||
|
||||
m_seta001->set_fg_xoffsets( 0x10, 0x10 );
|
||||
m_seta001->set_fg_yoffsets( 0x05, 0x07 );
|
||||
|
Loading…
Reference in New Issue
Block a user