diff --git a/src/mame/drivers/taito_h.cpp b/src/mame/drivers/taito_h.cpp index 4aad8ac9a1c..1abb6acd715 100644 --- a/src/mame/drivers/taito_h.cpp +++ b/src/mame/drivers/taito_h.cpp @@ -589,44 +589,6 @@ INPUT_PORTS_END ***************************************************************************/ -static const gfx_layout tilelayout = -{ - 16,16, /* 16x16 pixels */ - RGN_FRAC(1,1), /* 32768 tiles */ - 4, - { STEP4(0,1) }, - { STEP16(15*4, -4) }, - { STEP16(0, 16*4) }, - 16*16*4 -}; - -#if 0 -static const gfx_layout charlayout = -{ - 8, 8, /* 8x8 pixels */ - 256, /* 256 chars */ - 4, /* 4 bit per pixel */ - { 0x1000*8 + 8, 0x1000*8, 8, 0 }, - { 0, 1, 2, 3, 4, 5, 6, 7 }, - { 16*0, 16*1, 16*2, 16*3, 16*4, 16*5, 16*6, 16*7 }, - 16*8 -}; -#endif - - -static GFXDECODE_START( gfx_syvalion ) - GFXDECODE_ENTRY( "gfx1", 0, tilelayout, 0, 32 ) -GFXDECODE_END - -static GFXDECODE_START( gfx_recordbr ) - GFXDECODE_ENTRY( "gfx1", 0, tilelayout, 0, 32 ) -GFXDECODE_END - -static GFXDECODE_START( gfx_dleague ) - GFXDECODE_ENTRY( "gfx1", 0, tilelayout, 0, 32 ) -GFXDECODE_END - - void taitoh_state::machine_reset() { } @@ -666,15 +628,12 @@ void taitoh_state::syvalion(machine_config &config) screen.set_screen_update(FUNC(taitoh_state::screen_update_syvalion)); screen.set_palette(m_palette); - GFXDECODE(config, m_gfxdecode, m_palette, gfx_syvalion); PALETTE(config, m_palette).set_format(palette_device::xBGR_555, 33*16); TC0080VCO(config, m_tc0080vco, 0); - m_tc0080vco->set_gfx_region(0); - m_tc0080vco->set_tx_region(1); m_tc0080vco->set_offsets(1, 1); m_tc0080vco->set_bgflip_yoffs(-2); - m_tc0080vco->set_gfxdecode_tag(m_gfxdecode); + m_tc0080vco->set_palette(m_palette); /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -719,15 +678,12 @@ void taitoh_state::recordbr(machine_config &config) screen.set_screen_update(FUNC(taitoh_state::screen_update_recordbr)); screen.set_palette(m_palette); - GFXDECODE(config, m_gfxdecode, m_palette, gfx_recordbr); PALETTE(config, m_palette).set_format(palette_device::xBGR_555, 32*16); TC0080VCO(config, m_tc0080vco, 0); - m_tc0080vco->set_gfx_region(0); - m_tc0080vco->set_tx_region(1); m_tc0080vco->set_offsets(1, 1); m_tc0080vco->set_bgflip_yoffs(-2); - m_tc0080vco->set_gfxdecode_tag(m_gfxdecode); + m_tc0080vco->set_palette(m_palette); /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -782,15 +738,12 @@ void taitoh_state::dleague(machine_config &config) screen.set_screen_update(FUNC(taitoh_state::screen_update_dleague)); screen.set_palette(m_palette); - GFXDECODE(config, m_gfxdecode, m_palette, gfx_dleague); PALETTE(config, m_palette).set_format(palette_device::xBGR_555, 33*16); TC0080VCO(config, m_tc0080vco, 0); - m_tc0080vco->set_gfx_region(0); - m_tc0080vco->set_tx_region(1); m_tc0080vco->set_offsets(1, 1); m_tc0080vco->set_bgflip_yoffs(-2); - m_tc0080vco->set_gfxdecode_tag(m_gfxdecode); + m_tc0080vco->set_palette(m_palette); /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -823,7 +776,7 @@ ROM_START( syvalion ) ROM_REGION( 0x10000, "audiocpu", 0 ) /* sound cpu */ ROM_LOAD( "b51-23.bin", 0x00000, 0x10000, CRC(734662de) SHA1(0058d6de68f26cd58b9eb8859e15f3ced6bd3489) ) - ROM_REGION( 0x200000, "gfx1", 0 ) + ROM_REGION( 0x200000, "tc0080vco", 0 ) ROM_LOAD64_BYTE( "b51-16.bin", 0x000007, 0x20000, CRC(c0fcf7a5) SHA1(4550ba6d822ba12ad39576bcbed09b5fa54279e8) ) ROM_LOAD64_BYTE( "b51-12.bin", 0x000006, 0x20000, CRC(6b36d358) SHA1(4101c110e99fe2ac1a989c84857f6438439b79a1) ) ROM_LOAD64_BYTE( "b51-08.bin", 0x000005, 0x20000, CRC(9f6a535c) SHA1(40d52d3f572dd87b41d89707a2ec189760d806b0) ) @@ -858,7 +811,7 @@ ROM_START( syvalionu ) ROM_REGION( 0x10000, "audiocpu", 0 ) /* sound cpu */ ROM_LOAD( "b51-23.bin", 0x00000, 0x10000, CRC(734662de) SHA1(0058d6de68f26cd58b9eb8859e15f3ced6bd3489) ) - ROM_REGION( 0x200000, "gfx1", 0 ) + ROM_REGION( 0x200000, "tc0080vco", 0 ) ROM_LOAD64_BYTE( "b51-16.bin", 0x000007, 0x20000, CRC(c0fcf7a5) SHA1(4550ba6d822ba12ad39576bcbed09b5fa54279e8) ) ROM_LOAD64_BYTE( "b51-12.bin", 0x000006, 0x20000, CRC(6b36d358) SHA1(4101c110e99fe2ac1a989c84857f6438439b79a1) ) ROM_LOAD64_BYTE( "b51-08.bin", 0x000005, 0x20000, CRC(9f6a535c) SHA1(40d52d3f572dd87b41d89707a2ec189760d806b0) ) @@ -893,7 +846,7 @@ ROM_START( syvalionw ) ROM_REGION( 0x10000, "audiocpu", 0 ) /* sound cpu */ ROM_LOAD( "b51-23.bin", 0x00000, 0x10000, CRC(734662de) SHA1(0058d6de68f26cd58b9eb8859e15f3ced6bd3489) ) - ROM_REGION( 0x200000, "gfx1", 0 ) + ROM_REGION( 0x200000, "tc0080vco", 0 ) ROM_LOAD64_BYTE( "b51-16.bin", 0x000007, 0x20000, CRC(c0fcf7a5) SHA1(4550ba6d822ba12ad39576bcbed09b5fa54279e8) ) ROM_LOAD64_BYTE( "b51-12.bin", 0x000006, 0x20000, CRC(6b36d358) SHA1(4101c110e99fe2ac1a989c84857f6438439b79a1) ) ROM_LOAD64_BYTE( "b51-08.bin", 0x000005, 0x20000, CRC(9f6a535c) SHA1(40d52d3f572dd87b41d89707a2ec189760d806b0) ) @@ -928,7 +881,7 @@ ROM_START( syvalionp ) ROM_REGION( 0x10000, "audiocpu", 0 ) /* sound cpu */ ROM_LOAD( "c69b.ic58", 0x00000, 0x10000, CRC(07d3d789) SHA1(dbbe308f74637bb5a2651654bbada6a07f99ae14) ) - ROM_REGION( 0x200000, "gfx1", 0 ) + ROM_REGION( 0x200000, "tc0080vco", 0 ) ROM_LOAD64_BYTE( "chr-00.ic16", 0x000007, 0x20000, CRC(b0c66db7) SHA1(e3a1e9b0d6157e5085a55fdac1daa61f5a03b048) ) ROM_LOAD64_BYTE( "chr-01.ic12", 0x000006, 0x20000, CRC(dd07db12) SHA1(76317c27b1e649d73f639b565b67f42af0233118) ) ROM_LOAD64_BYTE( "chr-02.ic8", 0x000005, 0x20000, CRC(323a9ad9) SHA1(7ae6fa2dcc2078ae64d6d28cadacb52c6a069575) ) @@ -974,7 +927,7 @@ ROM_START( recordbr ) ROM_REGION( 0x10000, "audiocpu", 0 ) /* sound cpu */ ROM_LOAD( "b56-19.bin", 0x00000, 0x10000, CRC(c68085ee) SHA1(78634216a622a08c20dae0422283c4a7ed360546) ) - ROM_REGION( 0x100000, "gfx1", 0 ) + ROM_REGION( 0x100000, "tc0080vco", 0 ) ROM_LOAD64_BYTE( "b56-04.bin", 0x000007, 0x20000, CRC(f7afdff0) SHA1(8f8ea0e8da20913426ff3b58d7bb63bd352d3fb4) ) ROM_LOAD64_BYTE( "b56-08.bin", 0x000006, 0x20000, CRC(c9f0d38a) SHA1(aa22f1a06e00f90c546eebcd8b42da3e3c7d0781) ) ROM_LOAD64_BYTE( "b56-03.bin", 0x000005, 0x20000, CRC(4045fd44) SHA1(a84be9eedba7aed30d4f2841016784f8024d9443) ) @@ -1004,7 +957,7 @@ ROM_START( gogold ) ROM_REGION( 0x10000, "audiocpu", 0 ) /* sound cpu */ ROM_LOAD( "b56-19.bin", 0x00000, 0x10000, CRC(c68085ee) SHA1(78634216a622a08c20dae0422283c4a7ed360546) ) - ROM_REGION( 0x100000, "gfx1", 0 ) + ROM_REGION( 0x100000, "tc0080vco", 0 ) ROM_LOAD64_BYTE( "b56-04.bin", 0x000007, 0x20000, CRC(f7afdff0) SHA1(8f8ea0e8da20913426ff3b58d7bb63bd352d3fb4) ) ROM_LOAD64_BYTE( "b56-08.bin", 0x000006, 0x20000, CRC(c9f0d38a) SHA1(aa22f1a06e00f90c546eebcd8b42da3e3c7d0781) ) ROM_LOAD64_BYTE( "b56-03.bin", 0x000005, 0x20000, CRC(4045fd44) SHA1(a84be9eedba7aed30d4f2841016784f8024d9443) ) @@ -1036,7 +989,7 @@ ROM_START( tetristh ) ROM_REGION( 0x10000, "audiocpu", 0 ) /* sound cpu */ ROM_LOAD( "c26-13.ic56", 0x00000, 0x10000, CRC(efa89dfa) SHA1(556e77c63cb95e441ea1d1beb3d43c61a48a3bb1) ) - ROM_REGION( 0x100000, "gfx1", 0 ) + ROM_REGION( 0x100000, "tc0080vco", 0 ) ROM_LOAD64_BYTE( "c26-04.ic51", 0x000007, 0x20000, CRC(23ddf00f) SHA1(f7bb19db62d5e6cb27a6e98db68c54c01e34b776) ) ROM_LOAD64_BYTE( "c26-08.ic65", 0x000006, 0x20000, CRC(86071824) SHA1(00ba24b35ad93aa0f29e05068ddc9276f2d333af) ) ROM_LOAD64_BYTE( "c26-03.ic50", 0x000005, 0x20000, CRC(341be9ac) SHA1(a93c55cb20cb0433855ceb125bffcbcecb0e552d) ) @@ -1067,7 +1020,7 @@ ROM_START( dleague ) ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "c02-23.40", 0x00000, 0x10000, CRC(5632ee49) SHA1(90dedaf40ab526529cd7d569b78a9d5451ec3e25) ) - ROM_REGION( 0x400000, "gfx1", 0 ) + ROM_REGION( 0x400000, "tc0080vco", 0 ) ROM_LOAD64_WORD_SWAP( "c02-02.15", 0x000006, 0x80000, CRC(b273f854) SHA1(5961b9fe2c49fb05f5bc3e27e05925dbef8577e9) ) ROM_LOAD64_WORD_SWAP( "c02-03.17", 0x000004, 0x80000, CRC(c3fd0dcd) SHA1(43f32cefbca203bd0453e1c3d4523f0834900418) ) ROM_LOAD64_WORD_SWAP( "c02-24.19", 0x000002, 0x80000, CRC(18ef740a) SHA1(27f0445c053e28267e5688627d4f91d158d4fb07) ) @@ -1098,7 +1051,7 @@ ROM_START( dleaguej ) ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "c02-23.40", 0x00000, 0x10000, CRC(5632ee49) SHA1(90dedaf40ab526529cd7d569b78a9d5451ec3e25) ) - ROM_REGION( 0x400000, "gfx1", 0 ) + ROM_REGION( 0x400000, "tc0080vco", 0 ) ROM_LOAD64_WORD_SWAP( "c02-02.15", 0x000006, 0x80000, CRC(b273f854) SHA1(5961b9fe2c49fb05f5bc3e27e05925dbef8577e9) ) ROM_LOAD64_WORD_SWAP( "c02-03.17", 0x000004, 0x80000, CRC(c3fd0dcd) SHA1(43f32cefbca203bd0453e1c3d4523f0834900418) ) ROM_LOAD64_WORD_SWAP( "c02-24.19", 0x000002, 0x80000, CRC(18ef740a) SHA1(27f0445c053e28267e5688627d4f91d158d4fb07) ) diff --git a/src/mame/drivers/taito_o.cpp b/src/mame/drivers/taito_o.cpp index 01489e6b7a1..2f7f68b3fd5 100644 --- a/src/mame/drivers/taito_o.cpp +++ b/src/mame/drivers/taito_o.cpp @@ -193,21 +193,6 @@ static INPUT_PORTS_START( parentj ) INPUT_PORTS_END -static const gfx_layout parentj_layout = -{ - 16,16, - RGN_FRAC(1,1), - 4, - { STEP4(0,1) }, - { STEP16(15*4, -4) }, - { STEP16(0, 16*4) }, - 16*16*4 -}; - -static GFXDECODE_START( gfx_parentj ) - GFXDECODE_ENTRY( "gfx1", 0, parentj_layout, 0x0, 0x400/16 ) -GFXDECODE_END - /* unknown sources ... */ TIMER_DEVICE_CALLBACK_MEMBER(taitoo_state::parentj_interrupt) { @@ -240,15 +225,12 @@ void taitoo_state::parentj(machine_config &config) screen.set_screen_update(FUNC(taitoo_state::screen_update)); screen.set_palette(m_palette); - GFXDECODE(config, m_gfxdecode, m_palette, gfx_parentj); PALETTE(config, m_palette).set_format(palette_device::xBGR_555, 33*16); TC0080VCO(config, m_tc0080vco, 0); - m_tc0080vco->set_gfx_region(0); - m_tc0080vco->set_tx_region(1); m_tc0080vco->set_offsets(1, 1); m_tc0080vco->set_bgflip_yoffs(-2); - m_tc0080vco->set_gfxdecode_tag(m_gfxdecode); + m_tc0080vco->set_palette(m_palette); SPEAKER(config, "mono").front_center(); @@ -263,7 +245,7 @@ ROM_START( parentj ) ROM_LOAD16_BYTE( "c42-13.21", 0x00000, 0x10000, CRC(823623eb) SHA1(7302cc0ac532f6190ae35218ea05bf8cf11fd687) ) ROM_LOAD16_BYTE( "c42-12.20", 0x00001, 0x10000, CRC(8654b0ab) SHA1(edd23a731c1c60cab353e51ef5e66d33bc3fde61) ) - ROM_REGION( 0x100000, "gfx1", 0 ) + ROM_REGION( 0x100000, "tc0080vco", 0 ) ROM_LOAD64_BYTE( "c42-05.06", 0x00000, 0x20000, CRC(7af0d45d) SHA1(bc527b74185596e4e77b34d08eb3e1678614b451) ) ROM_LOAD64_BYTE( "c42-04.05", 0x00001, 0x20000, CRC(133009a1) SHA1(fae5dd600384790225c24a62d1f8a00f0366dae9) ) ROM_LOAD64_BYTE( "c42-09.13", 0x00002, 0x20000, CRC(ba35fb03) SHA1(b76e50d298ccc0f230c865b563cd8e02866a4ffb) ) diff --git a/src/mame/drivers/taitoair.cpp b/src/mame/drivers/taitoair.cpp index dc668728ff2..61970748df6 100644 --- a/src/mame/drivers/taitoair.cpp +++ b/src/mame/drivers/taitoair.cpp @@ -642,26 +642,6 @@ static INPUT_PORTS_START( ainferno ) INPUT_PORTS_END -/************************************************************ - GFX DECODING -************************************************************/ - -static const gfx_layout tilelayout = -{ - 16,16, /* 16x16 pixels */ - RGN_FRAC(1,1), - 4, - { STEP4(0, 1) }, - { STEP16(15*4, -4) }, - { STEP16(0, 16*4) }, - 16*16*4 -}; - -static GFXDECODE_START( gfx_airsys ) - GFXDECODE_ENTRY( "gfx1", 0, tilelayout, 0, 32*16 ) -GFXDECODE_END - - /************************************************************ MACHINE DRIVERS ************************************************************/ @@ -730,16 +710,12 @@ void taitoair_state::airsys(machine_config &config) m_screen->set_screen_update(FUNC(taitoair_state::screen_update)); m_screen->set_palette(m_palette); - GFXDECODE(config, m_gfxdecode, m_palette, gfx_airsys); - PALETTE(config, m_palette, palette_device::BLACK, 512*16+512*16); TC0080VCO(config, m_tc0080vco, 0); - m_tc0080vco->set_gfx_region(0); - m_tc0080vco->set_tx_region(1); m_tc0080vco->set_offsets(1, 1); m_tc0080vco->set_bgflip_yoffs(-2); - m_tc0080vco->set_gfxdecode_tag(m_gfxdecode); + m_tc0080vco->set_palette(m_palette); /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -798,7 +774,7 @@ ROM_START( topland ) ROM_REGION( 0x10000, "mechacpu", 0 ) ROM_LOAD( "b62_mecha.rom", 0x00000, 0x08000, NO_DUMP ) - ROM_REGION( 0x100000, "gfx1", 0 ) /* 16x16 tiles */ + ROM_REGION( 0x100000, "tc0080vco", 0 ) /* 16x16 tiles */ ROM_LOAD64_BYTE( "b62-33.39", 0x000007, 0x20000, CRC(38786867) SHA1(7292e3fa69cad6494f2e8e7efa9c3f989bdf958d) ) ROM_LOAD64_BYTE( "b62-36.48", 0x000006, 0x20000, CRC(4259e76a) SHA1(eb0dc5d0a6f875e3b8335fb30d4c2ad3880c31b9) ) ROM_LOAD64_BYTE( "b62-29.27", 0x000005, 0x20000, CRC(efdd5c51) SHA1(6df3e9782946cf6f4a21ee3d335548c53cd21e3a) ) @@ -847,7 +823,7 @@ ROM_START( toplandj ) ROM_REGION( 0x10000, "mechacpu", 0 ) ROM_LOAD( "b62_mecha.rom", 0x00000, 0x08000, NO_DUMP ) - ROM_REGION( 0x100000, "gfx1", 0 ) /* 16x16 tiles */ + ROM_REGION( 0x100000, "tc0080vco", 0 ) /* 16x16 tiles */ ROM_LOAD64_BYTE( "b62-33.39", 0x000007, 0x20000, CRC(38786867) SHA1(7292e3fa69cad6494f2e8e7efa9c3f989bdf958d) ) ROM_LOAD64_BYTE( "b62-36.48", 0x000006, 0x20000, CRC(4259e76a) SHA1(eb0dc5d0a6f875e3b8335fb30d4c2ad3880c31b9) ) ROM_LOAD64_BYTE( "b62-29.27", 0x000005, 0x20000, CRC(efdd5c51) SHA1(6df3e9782946cf6f4a21ee3d335548c53cd21e3a) ) @@ -897,7 +873,7 @@ ROM_START( ainferno ) ROM_REGION( 0x10000, "mechacpu", 0 ) // on "Controller P.C.B." ROM_LOAD( "c45-30.9", 0x00000, 0x10000, CRC(fa2db40f) SHA1(91c34a53d2fec619f2536ca79fdc6a17fb0d21e4) ) // 27c512, 1111xxxxxxxxxxxx = 0xFF - ROM_REGION( 0x100000, "gfx1", 0 ) /* 16x16 tiles */ + ROM_REGION( 0x100000, "tc0080vco", 0 ) /* 16x16 tiles */ ROM_LOAD64_BYTE( "c45-11.28", 0x000007, 0x20000, CRC(d9b4b77c) SHA1(69d570efa8146fb0a712ff45e77bda6fd85769f8) ) ROM_LOAD64_BYTE( "c45-15.40", 0x000006, 0x20000, CRC(d4610698) SHA1(5de519a23300d5b3b09ce7cf8c02a1a6b2fb985c) ) ROM_LOAD64_BYTE( "c45-12.29", 0x000005, 0x20000, CRC(4ae305b8) SHA1(2bbb981853a7abbba90afb8eb58f6869357551d3) ) @@ -952,7 +928,7 @@ ROM_START( ainfernoj ) ROM_REGION( 0x10000, "mechacpu", 0 ) // on "Controller P.C.B." ROM_LOAD( "c45-30.9", 0x00000, 0x10000, CRC(fa2db40f) SHA1(91c34a53d2fec619f2536ca79fdc6a17fb0d21e4) ) // 27c512, 1111xxxxxxxxxxxx = 0xFF - ROM_REGION( 0x100000, "gfx1", 0 ) /* 16x16 tiles */ + ROM_REGION( 0x100000, "tc0080vco", 0 ) /* 16x16 tiles */ ROM_LOAD64_BYTE( "c45-11.28", 0x000007, 0x20000, CRC(d9b4b77c) SHA1(69d570efa8146fb0a712ff45e77bda6fd85769f8) ) ROM_LOAD64_BYTE( "c45-15.40", 0x000006, 0x20000, CRC(d4610698) SHA1(5de519a23300d5b3b09ce7cf8c02a1a6b2fb985c) ) ROM_LOAD64_BYTE( "c45-12.29", 0x000005, 0x20000, CRC(4ae305b8) SHA1(2bbb981853a7abbba90afb8eb58f6869357551d3) ) diff --git a/src/mame/includes/taito_h.h b/src/mame/includes/taito_h.h index 706db7392b3..3ea4584336c 100644 --- a/src/mame/includes/taito_h.h +++ b/src/mame/includes/taito_h.h @@ -24,7 +24,6 @@ public: m_audiocpu(*this, "audiocpu"), m_tc0080vco(*this, "tc0080vco"), m_tc0040ioc(*this, "tc0040ioc"), - m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette"), m_z80bank(*this, "z80bank"), m_io_p1x(*this, "P1X"), @@ -48,7 +47,6 @@ private: required_device m_audiocpu; required_device m_tc0080vco; optional_device m_tc0040ioc; - required_device m_gfxdecode; required_device m_palette; required_memory_bank m_z80bank; @@ -67,7 +65,6 @@ private: void syvalion_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); void recordbr_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int priority); void dleague_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int priority); - inline void draw_single_sprite(bitmap_ind16 &bitmap, const rectangle &cliprect, u32 tile_offs, int sx, int sy, int ysize, int dx, int dy, int zx, int zy); void taitoh_log_vram(); void dleague_map(address_map &map); void recordbr_map(address_map &map); diff --git a/src/mame/includes/taito_o.h b/src/mame/includes/taito_o.h index 4b8cf8d2a01..5870c575c0d 100644 --- a/src/mame/includes/taito_o.h +++ b/src/mame/includes/taito_o.h @@ -23,7 +23,6 @@ public: m_maincpu(*this, "maincpu"), m_watchdog(*this, "watchdog"), m_tc0080vco(*this, "tc0080vco"), - m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette"), m_io_in(*this, "IN%u", 0U) { } @@ -38,7 +37,6 @@ private: required_device m_maincpu; required_device m_watchdog; required_device m_tc0080vco; - required_device m_gfxdecode; required_device m_palette; required_ioport_array<2> m_io_in; diff --git a/src/mame/includes/taitoair.h b/src/mame/includes/taitoair.h index 81fd71e8993..e284251c5e8 100644 --- a/src/mame/includes/taitoair.h +++ b/src/mame/includes/taitoair.h @@ -47,7 +47,6 @@ public: , m_tc0080vco(*this, "tc0080vco") , m_tc0220ioc(*this, "tc0220ioc") , m_yoke(*this, "yokectrl") - , m_gfxdecode(*this, "gfxdecode") , m_screen(*this, "screen") , m_palette(*this, "palette") , m_z80bank(*this, "z80bank") @@ -77,7 +76,6 @@ private: required_device m_tc0080vco; required_device m_tc0220ioc; required_device m_yoke; - required_device m_gfxdecode; required_device m_screen; required_device m_palette; diff --git a/src/mame/video/taito_h.cpp b/src/mame/video/taito_h.cpp index 9284f94b6ac..8153dc5893a 100644 --- a/src/mame/video/taito_h.cpp +++ b/src/mame/video/taito_h.cpp @@ -51,241 +51,57 @@ sprite RAM #include "includes/taito_h.h" -/* These are hand-tuned values */ -static const int zoomy_conv_table[] = -{ -/* +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +a +b +c +d +e +f */ - 0x00,0x01,0x01,0x02,0x02,0x03,0x04,0x05, 0x06,0x06,0x07,0x08,0x09,0x0a,0x0a,0x0b, /* 0x00 */ - 0x0b,0x0c,0x0c,0x0d,0x0e,0x0e,0x0f,0x10, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x16, - 0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e, 0x1f,0x20,0x21,0x22,0x24,0x25,0x26,0x27, - 0x28,0x2a,0x2b,0x2c,0x2e,0x30,0x31,0x32, 0x34,0x36,0x37,0x38,0x3a,0x3c,0x3e,0x3f, - - 0x40,0x41,0x42,0x42,0x43,0x43,0x44,0x44, 0x45,0x45,0x46,0x46,0x47,0x47,0x48,0x49, /* 0x40 */ - 0x4a,0x4a,0x4b,0x4b,0x4c,0x4d,0x4e,0x4f, 0x4f,0x50,0x51,0x51,0x52,0x53,0x54,0x55, - 0x56,0x57,0x58,0x59,0x5a,0x5b,0x5c,0x5d, 0x5e,0x5f,0x60,0x61,0x62,0x63,0x64,0x66, - 0x67,0x68,0x6a,0x6b,0x6c,0x6e,0x6f,0x71, 0x72,0x74,0x76,0x78,0x80,0x7b,0x7d,0x7f -}; - -inline void taitoh_state::draw_single_sprite(bitmap_ind16 &bitmap, const rectangle &cliprect, u32 tile_offs, int sx, int sy, int ysize, int dx, int dy, int zx, int zy) -{ - int y = sy; - for (int j = 0; j < ysize; j++) - { - int x = sx; - for (int k = 0; k < 4; k++) - { - if (tile_offs >= 0x1000) /* or dleague pitcher gets blanked */ - { - const u32 tile = m_tc0080vco->cram_0_r(tile_offs) & 0x7fff; - const u32 color = m_tc0080vco->cram_1_r(tile_offs) & 0x001f; - int flipx = m_tc0080vco->cram_1_r(tile_offs) & 0x0040; - int flipy = m_tc0080vco->cram_1_r(tile_offs) & 0x0080; - - if (m_tc0080vco->flipscreen_r()) - { - flipx ^= 0x0040; - flipy ^= 0x0080; - } - - m_gfxdecode->gfx(0)->zoom_transpen(bitmap,cliprect, - tile, - color, - flipx, flipy, - x, y, - zx, zy, 0); - } - tile_offs++; - x += dx; - } - y += dy; - } -} - /*************************************************************************** Screen refresh ***************************************************************************/ void taitoh_state::syvalion_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) { - /* Y chain size is 16/32?/64/64? pixels. X chain size - is always 64 pixels. */ - - static const u8 size[] = { 1, 2, 4, 4 }; - for (int offs = 0x03f8 / 2; offs >= 0; offs -= 0x008 / 2) { - int x0 = m_tc0080vco->sprram_r(offs + 1) & 0x3ff; - int y0 = m_tc0080vco->sprram_r(offs + 0) & 0x3ff; - int zoomx = (m_tc0080vco->sprram_r(offs + 2) & 0x7f00) >> 8; - u32 tile_offs = (m_tc0080vco->sprram_r(offs + 3) & 0x1fff) << 2; - const u8 ysize = size[(m_tc0080vco->sprram_r(offs) & 0x0c00) >> 10]; + m_tc0080vco->get_sprite_params(offs, false); - if (tile_offs) + if (m_tc0080vco->get_sprite_tile_offs()) { - int dx, ex, zx; - /* The increasing ratio of expansion is different whether zoom value */ - /* is less or more than 63. */ - if (zoomx < 63) - { - dx = 8 + (zoomx + 2) / 8; - ex = (zoomx + 2) % 8; - zx = ((dx << 1) + ex) << 11; - } - else - { - dx = 16 + (zoomx - 63) / 4; - ex = (zoomx - 63) % 4; - zx = (dx + ex) << 12; - } - - if (x0 >= 0x200) x0 -= 0x400; - if (y0 >= 0x200) y0 -= 0x400; - - if (m_tc0080vco->flipscreen_r()) - { - x0 = 497 - x0; - y0 = 498 - y0; - dx = -dx; - } - else - { - x0 += 1; - y0 += 2; - } - - draw_single_sprite(bitmap, cliprect, tile_offs, x0, y0, ysize, dx, dx, zx, zx); + m_tc0080vco->draw_single_sprite(bitmap, cliprect); } } } void taitoh_state::recordbr_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int priority) { - /* Y chain size is 16/32?/64/64? pixels. X chain size - is always 64 pixels. */ - - static const u8 size[] = { 1, 2, 4, 4 }; - for (int offs = 0x03f8 / 2; offs >= 0; offs -= 0x008 / 2) { if (offs < 0x01b0 && priority == 0) continue; if (offs >= 0x01b0 && priority == 1) continue; - int x0 = m_tc0080vco->sprram_r(offs + 1) & 0x3ff; - int y0 = m_tc0080vco->sprram_r(offs + 0) & 0x3ff; - int zoomx = (m_tc0080vco->sprram_r(offs + 2) & 0x7f00) >> 8; - int zoomy = (m_tc0080vco->sprram_r(offs + 2) & 0x007f); - u32 tile_offs = (m_tc0080vco->sprram_r(offs + 3) & 0x1fff) << 2; - const u8 ysize = size[(m_tc0080vco->sprram_r(offs) & 0x0c00) >> 10]; + m_tc0080vco->get_sprite_params(offs, true); - if (tile_offs) + if (m_tc0080vco->get_sprite_tile_offs()) { - int dx, dy, ex, ey, zx, zy; - /* Convert zoomy value to real value as zoomx */ - zoomy = zoomy_conv_table[zoomy]; - - if (zoomx < 63) - { - dx = 8 + (zoomx + 2) / 8; - ex = (zoomx + 2) % 8; - zx = ((dx << 1) + ex) << 11; - } - else - { - dx = 16 + (zoomx - 63) / 4; - ex = (zoomx - 63) % 4; - zx = (dx + ex) << 12; - } - - if (zoomy < 63) - { - dy = 8 + (zoomy + 2) / 8; - ey = (zoomy + 2) % 8; - zy = ((dy << 1) + ey) << 11; - } - else - { - dy = 16 + (zoomy - 63) / 4; - ey = (zoomy - 63) % 4; - zy = (dy + ey) << 12; - } - - if (x0 >= 0x200) x0 -= 0x400; - if (y0 >= 0x200) y0 -= 0x400; - - if (m_tc0080vco->flipscreen_r()) - { - x0 = 497 - x0; - y0 = 498 - y0; - dx = -dx; - dy = -dy; - } - else - { - x0 += 1; - y0 += 2; - } - - draw_single_sprite(bitmap, cliprect, tile_offs, x0, y0, ysize, dx, dy, zx, zy); + m_tc0080vco->draw_single_sprite(bitmap, cliprect); } } } void taitoh_state::dleague_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int priority) { - /* Y chain size is 16/32?/64/64? pixels. X chain size - is always 64 pixels. */ - - static const u8 size[] = { 1, 2, 4, 4 }; - for (int offs = 0x03f8 / 2; offs >= 0; offs -= 0x008 / 2) { - int x0 = m_tc0080vco->sprram_r(offs + 1) & 0x3ff; - int y0 = m_tc0080vco->sprram_r(offs + 0) & 0x3ff; - int zoomx = (m_tc0080vco->sprram_r(offs + 2) & 0x7f00) >> 8; - u32 tile_offs = (m_tc0080vco->sprram_r(offs + 3) & 0x1fff) << 2; - int pribit = (m_tc0080vco->sprram_r(offs + 0) & 0x1000) >> 12; - const u8 ysize = size[(m_tc0080vco->sprram_r(offs) & 0x0c00) >> 10]; + m_tc0080vco->get_sprite_params(offs, false); + int pribit = (m_tc0080vco->sprram_r(offs + 0) & 0x1000) >> 12; - if (tile_offs) + if (m_tc0080vco->get_sprite_tile_offs()) { - int dx, ex, zx; - /* The increasing ratio of expansion is different whether zoom value */ - /* is less or more than 63. */ - if (zoomx < 63) - { - dx = 8 + (zoomx + 2) / 8; - ex = (zoomx + 2) % 8; - zx = ((dx << 1) + ex) << 11; + if (m_tc0080vco->get_sprite_zoomx() < 63) pribit = 0; - } - else - { - dx = 16 + (zoomx - 63) / 4; - ex = (zoomx - 63) % 4; - zx = (dx + ex) << 12; - } if (m_tc0080vco->scrram_r(0x0002) & 0x8000) pribit = 1; - if (x0 >= 0x200) x0 -= 0x400; - if (y0 >= 0x200) y0 -= 0x400; - - if (m_tc0080vco->flipscreen_r()) - { - x0 = 497 - x0; - y0 = 498 - y0; - dx = -dx; - } - else - { - x0 += 1; - y0 += 2; - } - if (priority == pribit) { - draw_single_sprite(bitmap, cliprect, tile_offs, x0, y0, ysize, dx, dx, zx, zx); + m_tc0080vco->draw_single_sprite(bitmap, cliprect); } } } diff --git a/src/mame/video/taito_o.cpp b/src/mame/video/taito_o.cpp index 8066851442b..aa97db1028a 100644 --- a/src/mame/video/taito_o.cpp +++ b/src/mame/video/taito_o.cpp @@ -10,121 +10,18 @@ Based on taito_h.cpp #include "includes/taito_o.h" -/* These are hand-tuned values */ -static const int zoomy_conv_table[] = -{ -/* +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +a +b +c +d +e +f */ - 0x00,0x01,0x01,0x02,0x02,0x03,0x04,0x05, 0x06,0x06,0x07,0x08,0x09,0x0a,0x0a,0x0b, /* 0x00 */ - 0x0b,0x0c,0x0c,0x0d,0x0e,0x0e,0x0f,0x10, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x16, - 0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e, 0x1f,0x20,0x21,0x22,0x24,0x25,0x26,0x27, - 0x28,0x2a,0x2b,0x2c,0x2e,0x30,0x31,0x32, 0x34,0x36,0x37,0x38,0x3a,0x3c,0x3e,0x3f, - - 0x40,0x41,0x42,0x42,0x43,0x43,0x44,0x44, 0x45,0x45,0x46,0x46,0x47,0x47,0x48,0x49, /* 0x40 */ - 0x4a,0x4a,0x4b,0x4b,0x4c,0x4d,0x4e,0x4f, 0x4f,0x50,0x51,0x51,0x52,0x53,0x54,0x55, - 0x56,0x57,0x58,0x59,0x5a,0x5b,0x5c,0x5d, 0x5e,0x5f,0x60,0x61,0x62,0x63,0x64,0x66, - 0x67,0x68,0x6a,0x6b,0x6c,0x6e,0x6f,0x71, 0x72,0x74,0x76,0x78,0x80,0x7b,0x7d,0x7f -}; - - void taitoo_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int priority) { - /* Y chain size is 16/32?/64/64? pixels. X chain size - is always 64 pixels. */ - - static const u8 size[] = { 1, 2, 4, 4 }; - for (int offs = 0x03f8 / 2; offs >= 0; offs -= 0x008 / 2) { if (offs < 0x01b0 && priority == 0) continue; if (offs >= 0x01b0 && priority == 1) continue; - int x0 = m_tc0080vco->sprram_r(offs + 1) & 0x3ff; - int y0 = m_tc0080vco->sprram_r(offs + 0) & 0x3ff; - int zoomx = (m_tc0080vco->sprram_r(offs + 2) & 0x7f00) >> 8; - int zoomy = (m_tc0080vco->sprram_r(offs + 2) & 0x007f); - u32 tile_offs = (m_tc0080vco->sprram_r(offs + 3) & 0x1fff) << 2; - const u8 ysize = size[(m_tc0080vco->sprram_r(offs) & 0x0c00) >> 10]; + m_tc0080vco->get_sprite_params(offs, true); - if (tile_offs) + if (m_tc0080vco->get_sprite_tile_offs()) { - int dx, dy, ex, ey, zx, zy; - /* Convert zoomy value to real value as zoomx */ - zoomy = zoomy_conv_table[zoomy]; - - if (zoomx < 63) - { - dx = 8 + (zoomx + 2) / 8; - ex = (zoomx + 2) % 8; - zx = ((dx << 1) + ex) << 11; - } - else - { - dx = 16 + (zoomx - 63) / 4; - ex = (zoomx - 63) % 4; - zx = (dx + ex) << 12; - } - - if (zoomy < 63) - { - dy = 8 + (zoomy + 2) / 8; - ey = (zoomy + 2) % 8; - zy = ((dy << 1) + ey) << 11; - } - else - { - dy = 16 + (zoomy - 63) / 4; - ey = (zoomy - 63) % 4; - zy = (dy + ey) << 12; - } - - if (x0 >= 0x200) x0 -= 0x400; - if (y0 >= 0x200) y0 -= 0x400; - - if (m_tc0080vco->flipscreen_r()) - { - x0 = 497 - x0; - y0 = 498 - y0; - dx = -dx; - dy = -dy; - } - else - { - x0 += 1; - y0 += 2; - } - - int y = y0; - for (int j = 0; j < ysize; j++) - { - int x = x0; - for (int k = 0; k < 4; k++) - { - if (tile_offs >= 0x1000) - { - const u32 tile = m_tc0080vco->cram_0_r(tile_offs) & 0x7fff; - const u32 color = m_tc0080vco->cram_1_r(tile_offs) & 0x001f; - int flipx = m_tc0080vco->cram_1_r(tile_offs) & 0x0040; - int flipy = m_tc0080vco->cram_1_r(tile_offs) & 0x0080; - - if (m_tc0080vco->flipscreen_r()) - { - flipx ^= 0x0040; - flipy ^= 0x0080; - } - - m_gfxdecode->gfx(0)->zoom_transpen(bitmap,cliprect, - tile, - color, - flipx, flipy, - x, y, - zx, zy, 0 - ); - } - tile_offs++; - x += dx; - } - y += dy; - } + m_tc0080vco->draw_single_sprite(bitmap, cliprect); } } } diff --git a/src/mame/video/taitoair.cpp b/src/mame/video/taitoair.cpp index e04aab1f25a..37ec4ac5e1e 100644 --- a/src/mame/video/taitoair.cpp +++ b/src/mame/video/taitoair.cpp @@ -51,21 +51,6 @@ sprite RAM #include "includes/taitoair.h" -/* These are hand-tuned values */ -static const int zoomy_conv_table[] = -{ -/* +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +a +b +c +d +e +f */ - 0x00,0x01,0x01,0x02,0x02,0x03,0x04,0x05, 0x06,0x06,0x07,0x08,0x09,0x0a,0x0a,0x0b, /* 0x00 */ - 0x0b,0x0c,0x0c,0x0d,0x0e,0x0e,0x0f,0x10, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x16, - 0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e, 0x1f,0x20,0x21,0x22,0x24,0x25,0x26,0x27, - 0x28,0x2a,0x2b,0x2c,0x2e,0x30,0x31,0x32, 0x34,0x36,0x37,0x38,0x3a,0x3c,0x3e,0x3f, - - 0x40,0x41,0x42,0x42,0x43,0x43,0x44,0x44, 0x45,0x45,0x46,0x46,0x47,0x47,0x48,0x49, /* 0x40 */ - 0x4a,0x4a,0x4b,0x4b,0x4c,0x4d,0x4e,0x4f, 0x4f,0x50,0x51,0x51,0x52,0x53,0x54,0x55, - 0x56,0x57,0x58,0x59,0x5a,0x5b,0x5c,0x5d, 0x5e,0x5f,0x60,0x61,0x62,0x63,0x64,0x66, - 0x67,0x68,0x6a,0x6b,0x6c,0x6e,0x6f,0x71, 0x72,0x74,0x76,0x78,0x80,0x7b,0x7d,0x7f -}; - /*************************************************************************** Screen refresh ***************************************************************************/ @@ -81,10 +66,7 @@ int taitoair_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect */ int taitoair_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int start_offset) { - /* Y chain size is 16/32?/64/64? pixels. X chain size - is always 64 pixels. */ //const u16 stop_values[4] = { 0xc00, 0, 0, 0 }; - static const u8 size[] = { 1, 2, 4, 4 }; for (int offs = start_offset; offs >= 0; offs -= 0x008 / 2) { @@ -99,92 +81,11 @@ int taitoair_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect m_tc0080vco->sprram_r(offs + 0) == 0xcff) // Air Inferno return offs - 8/2; - int x0 = m_tc0080vco->sprram_r(offs + 1) & 0x3ff; - int y0 = m_tc0080vco->sprram_r(offs + 0) & 0x3ff; - int zoomx = (m_tc0080vco->sprram_r(offs + 2) & 0x7f00) >> 8; - int zoomy = (m_tc0080vco->sprram_r(offs + 2) & 0x007f); - u32 tile_offs = (m_tc0080vco->sprram_r(offs + 3) & 0x1fff) << 2; - const u8 ysize = size[(m_tc0080vco->sprram_r(offs) & 0x0c00) >> 10]; + m_tc0080vco->get_sprite_params(offs, true); - if (tile_offs) + if (m_tc0080vco->get_sprite_tile_offs()) { - /* Convert zoomy value to real value as zoomx */ - zoomy = zoomy_conv_table[zoomy]; - - int dx, dy, ex, ey, zx, zy; - if (zoomx < 63) - { - dx = 8 + (zoomx + 2) / 8; - ex = (zoomx + 2) % 8; - zx = ((dx << 1) + ex) << 11; - } - else - { - dx = 16 + (zoomx - 63) / 4; - ex = (zoomx - 63) % 4; - zx = (dx + ex) << 12; - } - - if (zoomy < 63) - { - dy = 8 + (zoomy + 2) / 8; - ey = (zoomy + 2) % 8; - zy = ((dy << 1) + ey) << 11; - } - else - { - dy = 16 + (zoomy - 63) / 4; - ey = (zoomy - 63) % 4; - zy = (dy + ey) << 12; - } - - if (x0 >= 0x200) x0 -= 0x400; - if (y0 >= 0x200) y0 -= 0x400; - - if (m_tc0080vco->flipscreen_r()) - { - x0 = 497 - x0; - y0 = 498 - y0; - dx = -dx; - dy = -dy; - } - else - { - x0 += 1; - y0 += 2; - } - - int y = y0; - for (int j = 0; j < ysize; j++) - { - int x = x0; - for (int k = 0; k < 4; k++) - { - if (tile_offs >= 0x1000) - { - const u32 tile = m_tc0080vco->cram_0_r(tile_offs) & 0x7fff; - const u32 color = m_tc0080vco->cram_1_r(tile_offs) & 0x001f; - int flipx = m_tc0080vco->cram_1_r(tile_offs) & 0x0040; - int flipy = m_tc0080vco->cram_1_r(tile_offs) & 0x0080; - - if (m_tc0080vco->flipscreen_r()) - { - flipx = !flipx; - flipy = !flipy; - } - - m_gfxdecode->gfx(0)->zoom_transpen(bitmap,cliprect, - tile, - color, - flipx, flipy, - x, y, - zx, zy, 0); - } - tile_offs++; - x += dx; - } - y += dy; - } + m_tc0080vco->draw_single_sprite(bitmap, cliprect); } } diff --git a/src/mame/video/tc0080vco.cpp b/src/mame/video/tc0080vco.cpp index d74f30f0dd5..fcc725abd69 100644 --- a/src/mame/video/tc0080vco.cpp +++ b/src/mame/video/tc0080vco.cpp @@ -37,7 +37,7 @@ start of the tc0080vco address space - not the start of chain ram. In practice only Dleague seems to do this, for c.10 frames as the pitcher bowls, and I think it's a coding error. Log it and see.] -[Ainferno and Syvalion are only games using FG0 layer.] +[Parentj, Ainferno and Syvalion are only games using FG0 layer.] Control registers @@ -81,32 +81,32 @@ this seems to be the only zoom feature actually used in the games. DEFINE_DEVICE_TYPE(TC0080VCO, tc0080vco_device, "tc0080vco", "Taito TC0080VCO") tc0080vco_device::tc0080vco_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) - : device_t(mconfig, TC0080VCO, tag, owner, clock), - m_ram(nullptr), - m_bg0_ram_0(nullptr), - m_bg0_ram_1(nullptr), - m_bg1_ram_0(nullptr), - m_bg1_ram_1(nullptr), - m_tx_ram_0(nullptr), - m_tx_ram_1(nullptr), - m_char_ram(nullptr), - m_bgscroll_ram(nullptr), - m_chain_ram_0(nullptr), - m_chain_ram_1(nullptr), - m_spriteram(nullptr), - m_scroll_ram(nullptr), - m_bg0_scrollx(0), - m_bg0_scrolly(0), - m_bg1_scrollx(0), - m_bg1_scrolly(0), - m_flipscreen(0), - m_gfxnum(0), - m_txnum(0), - m_bg_xoffs(0), - m_bg_yoffs(0), - m_bg_flip_yoffs(0), - m_has_fg0(1), - m_gfxdecode(*this, finder_base::DUMMY_TAG) + : device_t(mconfig, TC0080VCO, tag, owner, clock) + , device_gfx_interface(mconfig, *this, nullptr) + , m_ram(nullptr) + , m_bg0_ram_0(nullptr) + , m_bg0_ram_1(nullptr) + , m_bg1_ram_0(nullptr) + , m_bg1_ram_1(nullptr) + , m_tx_ram_0(nullptr) + , m_tx_ram_1(nullptr) + , m_char_ram(nullptr) + , m_bgscroll_ram(nullptr) + , m_chain_ram_0(nullptr) + , m_chain_ram_1(nullptr) + , m_spriteram(nullptr) + , m_scroll_ram(nullptr) + , m_bg0_scrollx(0) + , m_bg0_scrolly(0) + , m_bg1_scrollx(0) + , m_bg1_scrolly(0) + , m_flipscreen(0) + , m_bg_xoffs(0) + , m_bg_yoffs(0) + , m_bg_flip_yoffs(0) + , m_has_fg0(1) + , m_colbase(0) + , m_gfx_region(*this, DEVICE_SELF) { } @@ -120,22 +120,31 @@ void tc0080vco_device::device_start() #define XOR(a) WORD_XOR_BE(a) + gfx_layout tilelayout = + { + 16,16, /* 16x16 pixels */ + 0, + 4, + { STEP4(0,1) }, + { STEP16(15*4, -4) }, + { STEP16(0, 16*4) }, + 16*16*4 + }; + tilelayout.total = m_gfx_region->bytes() / ((16*16*4) / 8); + static const gfx_layout charlayout = { - 8, 8, /* 8x8 pixels */ - 256, /* 256 chars */ - 3, /* 3 bits per pixel */ - { 0x10000*8 + XOR(2)*4, XOR(0)*4, XOR(2)*4 }, - { 0, 1, 2, 3, 4, 5, 6, 7 }, - { 16*0, 16*1, 16*2, 16*3, 16*4, 16*5, 16*6, 16*7 }, - 16*8 + 8, 8, /* 8x8 pixels */ + 256, /* 256 chars */ + 3, /* 3 bits per pixel */ + { 0x10000*8 + XOR(2)*4, XOR(0)*4, XOR(2)*4 }, + { STEP8(0,1) }, + { STEP8(0,8*2) }, + 16*8 }; - if(!m_gfxdecode->started()) - throw device_missing_dependencies(); - - m_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(tc0080vco_device::get_bg0_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 64); - m_tilemap[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(tc0080vco_device::get_bg1_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 64); + m_tilemap[0] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(tc0080vco_device::get_bg0_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 64); + m_tilemap[1] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(tc0080vco_device::get_bg1_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 64); m_tilemap[0]->set_transparent_pen(0); m_tilemap[1]->set_transparent_pen(0); @@ -149,7 +158,7 @@ void tc0080vco_device::device_start() m_tilemap[0]->set_scroll_rows(512); /* Perform extra initialisations for text layer */ - m_tilemap[2] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(tc0080vco_device::get_tx_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64); + m_tilemap[2] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(tc0080vco_device::get_tx_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64); m_tilemap[2]->set_scrolldx(0, 0); m_tilemap[2]->set_scrolldy(48, -448); @@ -175,7 +184,8 @@ void tc0080vco_device::device_start() m_scroll_ram = m_ram.get() + 0x20800 / 2; /* create the char set (gfx will then be updated dynamically from RAM) */ - m_gfxdecode->set_gfx(m_txnum, std::make_unique(&m_gfxdecode->palette(), charlayout, (u8 *)m_char_ram, 0, 1, 512)); + set_gfx(0, std::make_unique(&palette(), tilelayout, m_gfx_region->base(), 0, 0x20, m_colbase)); + set_gfx(1, std::make_unique(&palette(), charlayout, (u8 *)m_char_ram, 0, 0x01, m_colbase + 512)); save_pointer(NAME(m_ram), TC0080VCO_RAM_SIZE / 2); } @@ -185,7 +195,6 @@ void tc0080vco_device::device_start() DEVICE HANDLERS *****************************************************************************/ -#if 0 static const int tc0080vco_zoomy_conv_table[] = { /* These are hand-tuned values... */ @@ -200,8 +209,114 @@ static const int tc0080vco_zoomy_conv_table[] = 0x56,0x57,0x58,0x59,0x5a,0x5b,0x5c,0x5d, 0x5e,0x5f,0x60,0x61,0x62,0x63,0x64,0x66, 0x67,0x68,0x6a,0x6b,0x6c,0x6e,0x6f,0x71, 0x72,0x74,0x76,0x78,0x80,0x7b,0x7d,0x7f }; -#endif +/* Y chain size is 16/32?/64/64? pixels. X chain size + is always 64 pixels. */ + +static const u8 size[] = { 1, 2, 4, 4 }; + +void tc0080vco_device::get_sprite_params(int offs, bool zoomy_enable) +{ + m_sprite.tile_offs = (m_spriteram[offs + 3] & 0x1fff) << 2; + if (m_sprite.tile_offs) + { + m_sprite.x0 = m_spriteram[offs + 1] & 0x03ff; + m_sprite.y0 = m_spriteram[offs + 0] & 0x03ff; + m_sprite.zoomx = (m_spriteram[offs + 2] & 0x7f00) >> 8; + /* Convert zoomy value to real value as zoomx */ + m_sprite.zoomy = zoomy_enable ? tc0080vco_zoomy_conv_table[m_spriteram[offs + 2] & 0x007f] : m_sprite.zoomx; + m_sprite.ysize = size[(m_spriteram[offs + 0] & 0x0c00) >> 10]; + + /* The increasing ratio of expansion is different whether zoom value */ + /* is less or more than 63. */ + if (m_sprite.zoomx < 63) + { + m_sprite.dx = 8 + (m_sprite.zoomx + 2) / 8; + m_sprite.ex = (m_sprite.zoomx + 2) % 8; + m_sprite.zx = ((m_sprite.dx << 1) + m_sprite.ex) << 11; + } + else + { + m_sprite.dx = 16 + (m_sprite.zoomx - 63) / 4; + m_sprite.ex = (m_sprite.zoomx - 63) % 4; + m_sprite.zx = (m_sprite.dx + m_sprite.ex) << 12; + } + + if (m_sprite.zoomx == m_sprite.zoomy) + { + m_sprite.dy = m_sprite.dx; + m_sprite.ey = m_sprite.ex; + m_sprite.zy = m_sprite.zx; + } + else + { + if (m_sprite.zoomy < 63) + { + m_sprite.dy = 8 + (m_sprite.zoomy + 2) / 8; + m_sprite.ey = (m_sprite.zoomy + 2) % 8; + m_sprite.zy = ((m_sprite.dy << 1) + m_sprite.ey) << 11; + } + else + { + m_sprite.dy = 16 + (m_sprite.zoomy - 63) / 4; + m_sprite.ey = (m_sprite.zoomy - 63) % 4; + m_sprite.zy = (m_sprite.dy + m_sprite.ey) << 12; + } + } + + if (m_sprite.x0 >= 0x200) m_sprite.x0 -= 0x400; + if (m_sprite.y0 >= 0x200) m_sprite.y0 -= 0x400; + + if (m_flipscreen) + { + m_sprite.x0 = 497 - m_sprite.x0; + m_sprite.y0 = 498 - m_sprite.y0; + m_sprite.dx = -m_sprite.dx; + m_sprite.dy = -m_sprite.dy; + } + else + { + m_sprite.x0 += 1; + m_sprite.y0 += 2; + } + } +} + +void tc0080vco_device::draw_single_sprite(bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + u32 tile_offs = m_sprite.tile_offs; + int y = m_sprite.y0; + for (int j = 0; j < m_sprite.ysize; j++) + { + int x = m_sprite.x0; + for (int k = 0; k < 4; k++) + { + if (tile_offs >= 0x1000) /* or dleague pitcher gets blanked */ + { + const u32 tile = m_chain_ram_0[tile_offs] & 0x7fff; + const u32 color = m_chain_ram_1[tile_offs] & 0x001f; + int flipx = m_chain_ram_1[tile_offs] & 0x0040; + int flipy = m_chain_ram_1[tile_offs] & 0x0080; + + if (m_flipscreen) + { + flipx ^= 0x0040; + flipy ^= 0x0080; + } + + gfx(0)->zoom_transpen(bitmap,cliprect, + tile, + color, + flipx, flipy, + x, y, + m_sprite.zx, m_sprite.zy, 0); + } + tile_offs++; + x += m_sprite.dx; + } + y += m_sprite.dy; + } +} TILE_GET_INFO_MEMBER(tc0080vco_device::get_bg0_tile_info) { @@ -212,7 +327,7 @@ TILE_GET_INFO_MEMBER(tc0080vco_device::get_bg0_tile_info) tileinfo.category = 0; - SET_TILE_INFO_MEMBER(m_gfxnum, + SET_TILE_INFO_MEMBER(0, tile, color, TILE_FLIPYX((m_bg0_ram_1[tile_index] & 0x00c0) >> 6)); @@ -227,7 +342,7 @@ TILE_GET_INFO_MEMBER(tc0080vco_device::get_bg1_tile_info) tileinfo.category = 0; - SET_TILE_INFO_MEMBER(m_gfxnum, + SET_TILE_INFO_MEMBER(0, tile, color, TILE_FLIPYX((m_bg1_ram_1[tile_index] & 0x00c0) >> 6)); @@ -254,14 +369,14 @@ TILE_GET_INFO_MEMBER(tc0080vco_device::get_tx_tile_info) tileinfo.category = 0; } - SET_TILE_INFO_MEMBER(m_txnum, + SET_TILE_INFO_MEMBER(1, tile, 0, 0); } -WRITE16_MEMBER( tc0080vco_device::scrollram_w ) +void tc0080vco_device::scrollram_w(offs_t offset, u16 data) { switch (offset) { @@ -299,12 +414,12 @@ WRITE16_MEMBER( tc0080vco_device::scrollram_w ) } } -READ16_MEMBER( tc0080vco_device::word_r ) +u16 tc0080vco_device::word_r(offs_t offset) { return m_ram[offset]; } -WRITE16_MEMBER( tc0080vco_device::word_w ) +void tc0080vco_device::word_w(offs_t offset, u16 data, u16 mem_mask) { COMBINE_DATA(&m_ram[offset]); @@ -312,7 +427,7 @@ WRITE16_MEMBER( tc0080vco_device::word_w ) if (offset < 0x1000 / 2) { - m_gfxdecode->gfx(m_txnum)->mark_dirty(offset / 8); + gfx(1)->mark_dirty(offset / 8); #if 0 if (!m_has_fg0) { @@ -343,7 +458,7 @@ WRITE16_MEMBER( tc0080vco_device::word_w ) else if (offset < 0x11000 / 2) { - m_gfxdecode->gfx(m_txnum)->mark_dirty((offset - 0x10000 / 2) / 8); + gfx(1)->mark_dirty((offset - 0x10000 / 2) / 8); #if 0 if (!m_has_fg0) { @@ -372,21 +487,19 @@ WRITE16_MEMBER( tc0080vco_device::word_w ) else if (offset < 0x20800 / 2) /* sprite ram */ {} else if (offset < 0x20fff / 2) - scrollram_w(space, offset - (0x20800 / 2), m_ram[offset], mem_mask); + scrollram_w(offset - (0x20800 / 2), m_ram[offset]); } void tc0080vco_device::tilemap_update( ) { - int j; - if (!m_flipscreen) { - for (j = 0; j < 0x400; j++) + for (int j = 0; j < 0x400; j++) m_tilemap[0]->set_scrollx((j + 0) & 0x3ff, -m_bg0_scrollx - m_bgscroll_ram[j & 0x1ff]); } else { - for (j = 0; j < 0x400; j++) + for (int j = 0; j < 0x400; j++) m_tilemap[0]->set_scrollx((j + 0) & 0x3ff, -m_bg0_scrollx + m_bgscroll_ram[j & 0x1ff]); } @@ -402,11 +515,10 @@ void tc0080vco_device::tilemap_update( ) void tc0080vco_device::bg0_tilemap_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int flags, u8 priority, u8 pmask) { - u16 zoom = m_scroll_ram[6]; - int zx, zy; + const u16 zoom = m_scroll_ram[6]; - zx = (zoom & 0xff00) >> 8; - zy = zoom & 0x00ff; + int zx = (zoom & 0xff00) >> 8; + int zy = zoom & 0x00ff; if (zx == 0x3f && zy == 0x7f) /* normal size */ { @@ -414,25 +526,22 @@ void tc0080vco_device::bg0_tilemap_draw(screen_device &screen, bitmap_ind16 &bit } else /* zoom + rowscroll = custom draw routine */ { - u16 *dst16, *src16; - u8 *tsrc; u16 scanline[512]; bitmap_ind16 &srcbitmap = m_tilemap[0]->pixmap(); bitmap_ind8 &flagsbitmap = m_tilemap[0]->flagsmap(); int sx, zoomx, zoomy; int dx, ex, dy, ey; - int y_index, src_y_index, row_index; - int x_index, x_step; + int y_index; - int flip = m_flipscreen; + const bool flip = m_flipscreen; - int min_x = cliprect.min_x; - int max_x = cliprect.max_x; - int min_y = cliprect.min_y; - int max_y = cliprect.max_y; - int screen_width = max_x + 1; - int width_mask = 0x3ff; /* underlying tilemap */ + const int min_x = cliprect.min_x; + const int max_x = cliprect.max_x; + const int min_y = cliprect.min_y; + const int max_y = cliprect.max_y; + const int screen_width = max_x + 1; + const int width_mask = 0x3ff; /* underlying tilemap */ #if 0 @@ -485,20 +594,20 @@ void tc0080vco_device::bg0_tilemap_draw(screen_device &screen, bitmap_ind16 &bit for (int y = min_y; y <= max_y; y++) { - src_y_index = (y_index >> 16) & 0x3ff; /* tilemaps are 1024 px up/down */ + int src_y_index = (y_index >> 16) & 0x3ff; /* tilemaps are 1024 px up/down */ /* row areas are the same in flipscreen, so we must read in reverse */ - row_index = (src_y_index & 0x1ff); + int row_index = (src_y_index & 0x1ff); if (flip) row_index = 0x1ff - row_index; - x_index = sx - ((m_bgscroll_ram[row_index] << 16)); + int x_index = sx - ((m_bgscroll_ram[row_index] << 16)); - src16 = &srcbitmap.pix16(src_y_index); - tsrc = &flagsbitmap.pix8(src_y_index); - dst16 = scanline; + u16 *src16 = &srcbitmap.pix16(src_y_index); + u8 *tsrc = &flagsbitmap.pix8(src_y_index); + u16 *dst16 = scanline; - x_step = zoomx; + int x_step = zoomx; if (flags & TILEMAP_DRAW_OPAQUE) { @@ -542,15 +651,14 @@ while (0) void tc0080vco_device::bg1_tilemap_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int flags, u8 priority, u8 pmask) { u8 layer = 1; - u16 zoom = m_scroll_ram[6 + layer]; - int min_x = cliprect.min_x; - int max_x = cliprect.max_x; - int min_y = cliprect.min_y; - int max_y = cliprect.max_y; - int zoomx, zoomy; + const u16 zoom = m_scroll_ram[6 + layer]; + const int min_x = cliprect.min_x; + const int max_x = cliprect.max_x; + const int min_y = cliprect.min_y; + const int max_y = cliprect.max_y; - zoomx = (zoom & 0xff00) >> 8; - zoomy = zoom & 0x00ff; + int zoomx = (zoom & 0xff00) >> 8; + int zoomy = zoom & 0x00ff; if (zoomx == 0x3f && zoomy == 0x7f) /* normal size */ { diff --git a/src/mame/video/tc0080vco.h b/src/mame/video/tc0080vco.h index 39e17159917..f68d156e4b8 100644 --- a/src/mame/video/tc0080vco.h +++ b/src/mame/video/tc0080vco.h @@ -5,15 +5,13 @@ #pragma once -class tc0080vco_device : public device_t +class tc0080vco_device : public device_t, public device_gfx_interface { public: tc0080vco_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); // configuration - template void set_gfxdecode_tag(T &&tag) { m_gfxdecode.set_tag(std::forward(tag)); } - void set_gfx_region(int gfxnum) { m_gfxnum = gfxnum; } - void set_tx_region(int txnum) { m_txnum = txnum; } + void set_colbase(u16 base) { m_colbase = base; } void set_offsets(int x_offset, int y_offset) { m_bg_xoffs = x_offset; @@ -21,9 +19,11 @@ public: } void set_bgflip_yoffs(int offs) { m_bg_flip_yoffs = offs; } - DECLARE_READ16_MEMBER( word_r ); - DECLARE_WRITE16_MEMBER( word_w ); + u16 word_r(offs_t offset); + void word_w(offs_t offset, u16 data, u16 mem_mask = ~0); + void get_sprite_params(int offs, bool zoomy_enable); + void draw_single_sprite(bitmap_ind16 &bitmap, const rectangle &cliprect); void tilemap_update(); void tilemap_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, u8 priority, u8 pmask = 0xff); void set_fg0_debug(bool debug) { m_has_fg0 = debug ? 0 : 1; } @@ -32,9 +32,15 @@ public: u16 cram_1_r(int offset); u16 sprram_r(int offset); u16 scrram_r(int offset); - DECLARE_WRITE16_MEMBER( scrollram_w ); + void scrollram_w(offs_t offset, u16 data); READ_LINE_MEMBER( flipscreen_r ); + int get_sprite_x() { return m_sprite.x0; } + int get_sprite_y() { return m_sprite.y0; } + u32 get_sprite_tile_offs() { return m_sprite.tile_offs; } + int get_sprite_zoomx() { return m_sprite.zoomx; } + int get_sprite_zoomy() { return m_sprite.zoomy; } + protected: // device-level overrides virtual void device_start() override; @@ -42,6 +48,16 @@ protected: private: // internal state + struct sprite_t + { + int x0 = 0, y0 = 0; + int zoomx = 0, zoomy = 0; + u32 tile_offs = 0; + u8 ysize = 0; + int dx = 0, ex = 0, zx = 0; + int dy = 0, ey = 0, zy = 0; + }; + std::unique_ptr m_ram; u16 * m_bg0_ram_0; u16 * m_bg0_ram_1; @@ -63,17 +79,17 @@ private: u16 m_bg1_scrollx; u16 m_bg1_scrolly; - tilemap_t *m_tilemap[3]; + tilemap_t *m_tilemap[3]; - s32 m_flipscreen; + bool m_flipscreen; - int m_gfxnum; - int m_txnum; - int m_bg_xoffs, m_bg_yoffs; - int m_bg_flip_yoffs; - int m_has_fg0; // for debug, it can be enabled with set_fg0_debug(true) + int m_bg_xoffs, m_bg_yoffs; + int m_bg_flip_yoffs; + int m_has_fg0; // for debug, it can be enabled with set_fg0_debug(true) + sprite_t m_sprite; + u16 m_colbase; - required_device m_gfxdecode; + required_memory_region m_gfx_region; TILE_GET_INFO_MEMBER(get_bg0_tile_info); TILE_GET_INFO_MEMBER(get_bg1_tile_info);