diff options
-rw-r--r-- | src/mame/atari/atarig1.cpp | 62 | ||||
-rw-r--r-- | src/mame/atari/atarig1.h | 11 | ||||
-rw-r--r-- | src/mame/atari/atarig1_v.cpp | 34 | ||||
-rw-r--r-- | src/mame/atari/atarig42.cpp | 46 | ||||
-rw-r--r-- | src/mame/atari/atarig42.h | 14 | ||||
-rw-r--r-- | src/mame/atari/atarig42_v.cpp | 42 | ||||
-rw-r--r-- | src/mame/atari/atarigt.cpp | 126 | ||||
-rw-r--r-- | src/mame/atari/atarigt.h | 53 | ||||
-rw-r--r-- | src/mame/atari/atarigt_v.cpp | 55 | ||||
-rw-r--r-- | src/mame/atari/atarigx2.cpp | 105 | ||||
-rw-r--r-- | src/mame/atari/atarigx2.h | 11 | ||||
-rw-r--r-- | src/mame/atari/atarigx2_v.cpp | 41 | ||||
-rw-r--r-- | src/mame/atari/atarirle.cpp | 94 | ||||
-rw-r--r-- | src/mame/atari/atarirle.h | 44 |
14 files changed, 374 insertions, 364 deletions
diff --git a/src/mame/atari/atarig1.cpp b/src/mame/atari/atarig1.cpp index 85ba1f41516..b644c5059ed 100644 --- a/src/mame/atari/atarig1.cpp +++ b/src/mame/atari/atarig1.cpp @@ -51,7 +51,7 @@ void atarig1_state::video_int_ack_w(uint16_t data) void atarig1_state::mo_command_w(offs_t offset, uint16_t data, uint16_t mem_mask) { COMBINE_DATA(m_mo_command); - m_rle->command_write((data == 0 && m_is_pitfight) ? ATARIRLE_COMMAND_CHECKSUM : ATARIRLE_COMMAND_DRAW); + m_rle->command_write((data == 0 && m_is_pitfight) ? atari_rle_objects_device::COMMAND_CHECKSUM : atari_rle_objects_device::COMMAND_DRAW); } @@ -291,9 +291,9 @@ static const gfx_layout pftoplayout = static GFXDECODE_START( gfx_atarig1 ) - GFXDECODE_ENTRY( "gfx1", 0, pflayout, 0x300, 8 ) - GFXDECODE_ENTRY( "gfx2", 0, gfx_8x8x4_packed_msb, 0x100, 16 ) - GFXDECODE_ENTRY( "gfx1", 0, pftoplayout, 0x300, 8 ) + GFXDECODE_ENTRY( "tiles", 0, pflayout, 0x300, 8 ) + GFXDECODE_ENTRY( "chars", 0, gfx_8x8x4_packed_msb, 0x100, 16 ) + GFXDECODE_ENTRY( "tiles", 0, pftoplayout, 0x300, 8 ) GFXDECODE_END @@ -361,7 +361,7 @@ void atarig1_state::atarig1(machine_config &config) m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); /* note: these parameters are from published specs, not derived */ m_screen->set_raw(14.318181_MHz_XTAL/2, 456, 0, 336, 262, 0, 240); - m_screen->set_screen_update(FUNC(atarig1_state::screen_update_atarig1)); + m_screen->set_screen_update(FUNC(atarig1_state::screen_update)); m_screen->set_palette("palette"); m_screen->screen_vblank().set_inputline(m_maincpu, M68K_IRQ_1, ASSERT_LINE); @@ -476,7 +476,7 @@ ROM_START( hydra ) ROM_REGION( 0x10000, "jsa:cpu", 0 ) /* 64k for 6502 code */ ROM_LOAD( "hydraa0.bin", 0x00000, 0x10000, CRC(619d7319) SHA1(3c58f18ca5c93ae049bfca91043718fff43e674c) ) - ROM_REGION( 0x0a0000, "gfx1", 0 ) + ROM_REGION( 0x0a0000, "tiles", 0 ) ROM_LOAD( "136079-1017.bin", 0x000000, 0x10000, CRC(bd77b747) SHA1(da57e305468c159ca3d2cfae807a85e643bbf053) ) /* playfield, planes 0-3 odd */ ROM_LOAD( "136079-1018.bin", 0x010000, 0x10000, CRC(7c24e637) SHA1(dd9fa8a59cbd692b0d8c0e452df4fa18d770c602) ) ROM_LOAD( "136079-1019.bin", 0x020000, 0x10000, CRC(aa2fb07b) SHA1(ed5aa82d5bac112f0507be3e4e2a5bad184eceeb) ) @@ -488,7 +488,7 @@ ROM_START( hydra ) ROM_LOAD( "136079-1025.bin", 0x080000, 0x10000, CRC(98b5b1a1) SHA1(dfee7d334c4541eb13ee96b43d4d3e1a3c8deb72) ) /* playfield plane 4 */ ROM_LOAD( "136079-1026.bin", 0x090000, 0x10000, CRC(d68d44aa) SHA1(8fc8b82f4f90515f2af93d3f2d6903a74aac0cc9) ) - ROM_REGION( 0x020000, "gfx2", 0 ) + ROM_REGION( 0x020000, "chars", 0 ) ROM_LOAD( "136079-1027.bin", 0x000000, 0x20000, CRC(f9135b9b) SHA1(48c0ad0d3e592d191d1385e30530bdb69a095452) ) /* alphanumerics */ ROM_REGION16_BE( 0x100000, "rle", 0 ) @@ -535,7 +535,7 @@ ROM_START( hydrap ) ROM_REGION( 0x10000, "jsa:cpu", 0 ) /* 64k for 6502 code */ ROM_LOAD( "hydraa0.bin", 0x00000, 0x10000, BAD_DUMP CRC(619d7319) SHA1(3c58f18ca5c93ae049bfca91043718fff43e674c) ) - ROM_REGION( 0x0a0000, "gfx1", 0 ) + ROM_REGION( 0x0a0000, "tiles", 0 ) ROM_LOAD( "136079-1017.bin", 0x000000, 0x10000, CRC(bd77b747) SHA1(da57e305468c159ca3d2cfae807a85e643bbf053) ) /* playfield, planes 0-3 odd */ ROM_LOAD( "136079-1018.bin", 0x010000, 0x10000, CRC(7c24e637) SHA1(dd9fa8a59cbd692b0d8c0e452df4fa18d770c602) ) ROM_LOAD( "136079-1019.bin", 0x020000, 0x10000, CRC(aa2fb07b) SHA1(ed5aa82d5bac112f0507be3e4e2a5bad184eceeb) ) @@ -547,7 +547,7 @@ ROM_START( hydrap ) ROM_LOAD( "136079-1025.bin", 0x080000, 0x10000, CRC(98b5b1a1) SHA1(dfee7d334c4541eb13ee96b43d4d3e1a3c8deb72) ) /* playfield plane 4 */ ROM_LOAD( "hydpl41.bin", 0x090000, 0x10000, CRC(85f9afa6) SHA1(01d8e07ff249bfab83791fc8916542f38133fadf) ) - ROM_REGION( 0x020000, "gfx2", 0 ) + ROM_REGION( 0x020000, "chars", 0 ) ROM_LOAD( "hydalph.bin", 0x000000, 0x20000, CRC(7dd2b062) SHA1(789b35b1e8cce73e2314d1b6688b5066df91b604) ) /* alphanumerics */ ROM_REGION16_BE( 0x100000, "rle", 0 ) @@ -594,7 +594,7 @@ ROM_START( hydrap2 ) ROM_REGION( 0x10000, "jsa:cpu", 0 ) /* 64k for 6502 code */ ROM_LOAD( "aud.1b", 0x00000, 0x10000, CRC(e1b5188a) SHA1(e9f2a78df49fa085a9363ca194e2ceb5fa5409c4) ) - ROM_REGION( 0x0a0000, "gfx1", 0 ) + ROM_REGION( 0x0a0000, "tiles", 0 ) ROM_LOAD( "136079-1017.bin", 0x000000, 0x10000, CRC(bd77b747) SHA1(da57e305468c159ca3d2cfae807a85e643bbf053) ) /* playfield, planes 0-3 odd */ ROM_LOAD( "136079-1018.bin", 0x010000, 0x10000, CRC(7c24e637) SHA1(dd9fa8a59cbd692b0d8c0e452df4fa18d770c602) ) ROM_LOAD( "136079-1019.bin", 0x020000, 0x10000, CRC(aa2fb07b) SHA1(ed5aa82d5bac112f0507be3e4e2a5bad184eceeb) ) @@ -606,7 +606,7 @@ ROM_START( hydrap2 ) ROM_LOAD( "136079-1025.bin", 0x080000, 0x10000, CRC(98b5b1a1) SHA1(dfee7d334c4541eb13ee96b43d4d3e1a3c8deb72) ) /* playfield plane 4 */ ROM_LOAD( "136079-1026.bin", 0x090000, 0x10000, CRC(d68d44aa) SHA1(8fc8b82f4f90515f2af93d3f2d6903a74aac0cc9) ) - ROM_REGION( 0x020000, "gfx2", 0 ) + ROM_REGION( 0x020000, "chars", 0 ) ROM_LOAD( "136079-1027.bin", 0x000000, 0x20000, CRC(f9135b9b) SHA1(48c0ad0d3e592d191d1385e30530bdb69a095452) ) /* alphanumerics */ ROM_REGION16_BE( 0x100000, "rle", 0 ) @@ -682,14 +682,14 @@ ROM_START( pitfight ) ROM_REGION( 0x10000, "jsa:cpu", 0 ) /* 64k for 6502 code */ ROM_LOAD( "136081-1060.1b", 0x00000, 0x10000, CRC(231d71d7) SHA1(24622eee5fe873ef81e1df2691bd7a1d3ea7ef6b) ) - ROM_REGION( 0x0a0000, "gfx1", 0 ) + ROM_REGION( 0x0a0000, "tiles", 0 ) ROM_LOAD( "136081-1017.130m", 0x000000, 0x10000, CRC(ad3cfea5) SHA1(7b6fec131230e84ab87b7fc95f08989916f30e02) ) /* playfield, planes 0-3 odd */ ROM_LOAD( "136081-1018.120m", 0x010000, 0x10000, CRC(1a0f8bcf) SHA1(b965e73246db9507d2ad42dfcb033692b43b9b7a) ) ROM_LOAD( "136081-1021.90m", 0x040000, 0x10000, CRC(777efee3) SHA1(07591f11685c4c75c24c55fd242878253d32481b) ) /* playfield, planes 0-3 even */ ROM_LOAD( "136081-1022.75m", 0x050000, 0x10000, CRC(524319d0) SHA1(6f47a69d7d4e2a8f79b7470138e8b4edd6d0b2bb) ) ROM_LOAD( "136081-1025.45m", 0x080000, 0x10000, CRC(fc41691a) SHA1(4ef2f9093f20d27e1ba7d218b90ff6abb1f33646) ) /* playfield plane 4 */ - ROM_REGION( 0x020000, "gfx2", 0 ) + ROM_REGION( 0x020000, "chars", 0 ) ROM_LOAD( "136081-1027.15l", 0x000000, 0x10000, CRC(a59f381d) SHA1(b14e878340ad2adbf4f6d4fc331c58f62037c7c7) ) /* alphanumerics */ ROM_REGION16_BE( 0x200000, "rle", 0 ) @@ -777,14 +777,14 @@ ROM_START( pitfight7 ) ROM_REGION( 0x10000, "jsa:cpu", 0 ) /* 64k for 6502 code */ ROM_LOAD( "136081-1060.1b", 0x00000, 0x10000, CRC(231d71d7) SHA1(24622eee5fe873ef81e1df2691bd7a1d3ea7ef6b) ) - ROM_REGION( 0x0a0000, "gfx1", 0 ) + ROM_REGION( 0x0a0000, "tiles", 0 ) ROM_LOAD( "136081-1017.130m", 0x000000, 0x10000, CRC(ad3cfea5) SHA1(7b6fec131230e84ab87b7fc95f08989916f30e02) ) /* playfield, planes 0-3 odd */ ROM_LOAD( "136081-1018.120m", 0x010000, 0x10000, CRC(1a0f8bcf) SHA1(b965e73246db9507d2ad42dfcb033692b43b9b7a) ) ROM_LOAD( "136081-1021.90m", 0x040000, 0x10000, CRC(777efee3) SHA1(07591f11685c4c75c24c55fd242878253d32481b) ) /* playfield, planes 0-3 even */ ROM_LOAD( "136081-1022.75m", 0x050000, 0x10000, CRC(524319d0) SHA1(6f47a69d7d4e2a8f79b7470138e8b4edd6d0b2bb) ) ROM_LOAD( "136081-1025.45m", 0x080000, 0x10000, CRC(fc41691a) SHA1(4ef2f9093f20d27e1ba7d218b90ff6abb1f33646) ) /* playfield plane 4 */ - ROM_REGION( 0x020000, "gfx2", 0 ) + ROM_REGION( 0x020000, "chars", 0 ) ROM_LOAD( "136081-1027.15l", 0x000000, 0x10000, CRC(a59f381d) SHA1(b14e878340ad2adbf4f6d4fc331c58f62037c7c7) ) /* alphanumerics */ ROM_REGION16_BE( 0x200000, "rle", 0 ) @@ -839,14 +839,14 @@ ROM_START( pitfight6 ) ROM_REGION( 0x10000, "jsa:cpu", 0 ) /* 64k for 6502 code */ ROM_LOAD( "136081-1060.1b", 0x00000, 0x10000, CRC(231d71d7) SHA1(24622eee5fe873ef81e1df2691bd7a1d3ea7ef6b) ) - ROM_REGION( 0x0a0000, "gfx1", 0 ) + ROM_REGION( 0x0a0000, "tiles", 0 ) ROM_LOAD( "136081-1017.130m", 0x000000, 0x10000, CRC(ad3cfea5) SHA1(7b6fec131230e84ab87b7fc95f08989916f30e02) ) /* playfield, planes 0-3 odd */ ROM_LOAD( "136081-1018.120m", 0x010000, 0x10000, CRC(1a0f8bcf) SHA1(b965e73246db9507d2ad42dfcb033692b43b9b7a) ) ROM_LOAD( "136081-1021.90m", 0x040000, 0x10000, CRC(777efee3) SHA1(07591f11685c4c75c24c55fd242878253d32481b) ) /* playfield, planes 0-3 even */ ROM_LOAD( "136081-1022.75m", 0x050000, 0x10000, CRC(524319d0) SHA1(6f47a69d7d4e2a8f79b7470138e8b4edd6d0b2bb) ) ROM_LOAD( "136081-1025.45m", 0x080000, 0x10000, CRC(fc41691a) SHA1(4ef2f9093f20d27e1ba7d218b90ff6abb1f33646) ) /* playfield plane 4 */ - ROM_REGION( 0x020000, "gfx2", 0 ) + ROM_REGION( 0x020000, "chars", 0 ) ROM_LOAD( "136081-1027.15l", 0x000000, 0x10000, CRC(a59f381d) SHA1(b14e878340ad2adbf4f6d4fc331c58f62037c7c7) ) /* alphanumerics */ ROM_REGION16_BE( 0x200000, "rle", 0 ) @@ -889,14 +889,14 @@ ROM_START( pitfight5 ) ROM_REGION( 0x10000, "jsa:cpu", 0 ) /* 64k for 6502 code */ ROM_LOAD( "136081-1060.1b", 0x00000, 0x10000, CRC(231d71d7) SHA1(24622eee5fe873ef81e1df2691bd7a1d3ea7ef6b) ) - ROM_REGION( 0x0a0000, "gfx1", 0 ) + ROM_REGION( 0x0a0000, "tiles", 0 ) ROM_LOAD( "136081-1017.130m", 0x000000, 0x10000, CRC(ad3cfea5) SHA1(7b6fec131230e84ab87b7fc95f08989916f30e02) ) /* playfield, planes 0-3 odd */ ROM_LOAD( "136081-1018.120m", 0x010000, 0x10000, CRC(1a0f8bcf) SHA1(b965e73246db9507d2ad42dfcb033692b43b9b7a) ) ROM_LOAD( "136081-1021.90m", 0x040000, 0x10000, CRC(777efee3) SHA1(07591f11685c4c75c24c55fd242878253d32481b) ) /* playfield, planes 0-3 even */ ROM_LOAD( "136081-1022.75m", 0x050000, 0x10000, CRC(524319d0) SHA1(6f47a69d7d4e2a8f79b7470138e8b4edd6d0b2bb) ) ROM_LOAD( "136081-1025.45m", 0x080000, 0x10000, CRC(fc41691a) SHA1(4ef2f9093f20d27e1ba7d218b90ff6abb1f33646) ) /* playfield plane 4 */ - ROM_REGION( 0x020000, "gfx2", 0 ) + ROM_REGION( 0x020000, "chars", 0 ) ROM_LOAD( "136081-1027.15l", 0x000000, 0x10000, CRC(a59f381d) SHA1(b14e878340ad2adbf4f6d4fc331c58f62037c7c7) ) /* alphanumerics */ ROM_REGION16_BE( 0x200000, "rle", 0 ) @@ -939,14 +939,14 @@ ROM_START( pitfight4 ) ROM_REGION( 0x10000, "jsa:cpu", 0 ) /* 64k for 6502 code */ ROM_LOAD( "136081-1060.1b", 0x00000, 0x10000, CRC(231d71d7) SHA1(24622eee5fe873ef81e1df2691bd7a1d3ea7ef6b) ) - ROM_REGION( 0x0a0000, "gfx1", 0 ) + ROM_REGION( 0x0a0000, "tiles", 0 ) ROM_LOAD( "136081-1017.130m", 0x000000, 0x10000, CRC(ad3cfea5) SHA1(7b6fec131230e84ab87b7fc95f08989916f30e02) ) /* playfield, planes 0-3 odd */ ROM_LOAD( "136081-1018.120m", 0x010000, 0x10000, CRC(1a0f8bcf) SHA1(b965e73246db9507d2ad42dfcb033692b43b9b7a) ) ROM_LOAD( "136081-1021.90m", 0x040000, 0x10000, CRC(777efee3) SHA1(07591f11685c4c75c24c55fd242878253d32481b) ) /* playfield, planes 0-3 even */ ROM_LOAD( "136081-1022.75m", 0x050000, 0x10000, CRC(524319d0) SHA1(6f47a69d7d4e2a8f79b7470138e8b4edd6d0b2bb) ) ROM_LOAD( "136081-1025.45m", 0x080000, 0x10000, CRC(fc41691a) SHA1(4ef2f9093f20d27e1ba7d218b90ff6abb1f33646) ) /* playfield plane 4 */ - ROM_REGION( 0x020000, "gfx2", 0 ) + ROM_REGION( 0x020000, "chars", 0 ) ROM_LOAD( "136081-1027.15l", 0x000000, 0x10000, CRC(a59f381d) SHA1(b14e878340ad2adbf4f6d4fc331c58f62037c7c7) ) /* alphanumerics */ ROM_REGION16_BE( 0x200000, "rle", 0 ) @@ -1001,14 +1001,14 @@ ROM_START( pitfight3 ) ROM_REGION( 0x10000, "jsa:cpu", 0 ) /* 64k for 6502 code */ ROM_LOAD( "136081-1060.1b", 0x00000, 0x10000, CRC(231d71d7) SHA1(24622eee5fe873ef81e1df2691bd7a1d3ea7ef6b) ) - ROM_REGION( 0x0a0000, "gfx1", 0 ) + ROM_REGION( 0x0a0000, "tiles", 0 ) ROM_LOAD( "136081-1017.130m", 0x000000, 0x10000, CRC(ad3cfea5) SHA1(7b6fec131230e84ab87b7fc95f08989916f30e02) ) /* playfield, planes 0-3 odd */ ROM_LOAD( "136081-1018.120m", 0x010000, 0x10000, CRC(1a0f8bcf) SHA1(b965e73246db9507d2ad42dfcb033692b43b9b7a) ) ROM_LOAD( "136081-1021.90m", 0x040000, 0x10000, CRC(777efee3) SHA1(07591f11685c4c75c24c55fd242878253d32481b) ) /* playfield, planes 0-3 even */ ROM_LOAD( "136081-1022.75m", 0x050000, 0x10000, CRC(524319d0) SHA1(6f47a69d7d4e2a8f79b7470138e8b4edd6d0b2bb) ) ROM_LOAD( "136081-1025.45m", 0x080000, 0x10000, CRC(fc41691a) SHA1(4ef2f9093f20d27e1ba7d218b90ff6abb1f33646) ) /* playfield plane 4 */ - ROM_REGION( 0x020000, "gfx2", 0 ) + ROM_REGION( 0x020000, "chars", 0 ) ROM_LOAD( "136081-1027.15l", 0x000000, 0x10000, CRC(a59f381d) SHA1(b14e878340ad2adbf4f6d4fc331c58f62037c7c7) ) /* alphanumerics */ ROM_REGION16_BE( 0x200000, "rle", 0 ) @@ -1063,14 +1063,14 @@ ROM_START( pitfight2 ) ROM_REGION( 0x10000, "jsa:cpu", 0 ) /* 64k for 6502 code */ ROM_LOAD( "136081-1060.1b", 0x00000, 0x10000, CRC(231d71d7) SHA1(24622eee5fe873ef81e1df2691bd7a1d3ea7ef6b) ) - ROM_REGION( 0x0a0000, "gfx1", 0 ) + ROM_REGION( 0x0a0000, "tiles", 0 ) ROM_LOAD( "136081-1017.130m", 0x000000, 0x10000, CRC(ad3cfea5) SHA1(7b6fec131230e84ab87b7fc95f08989916f30e02) ) /* playfield, planes 0-3 odd */ ROM_LOAD( "136081-1018.120m", 0x010000, 0x10000, CRC(1a0f8bcf) SHA1(b965e73246db9507d2ad42dfcb033692b43b9b7a) ) ROM_LOAD( "136081-1021.90m", 0x040000, 0x10000, CRC(777efee3) SHA1(07591f11685c4c75c24c55fd242878253d32481b) ) /* playfield, planes 0-3 even */ ROM_LOAD( "136081-1022.75m", 0x050000, 0x10000, CRC(524319d0) SHA1(6f47a69d7d4e2a8f79b7470138e8b4edd6d0b2bb) ) ROM_LOAD( "136081-1025.45m", 0x080000, 0x10000, CRC(fc41691a) SHA1(4ef2f9093f20d27e1ba7d218b90ff6abb1f33646) ) /* playfield plane 4 */ - ROM_REGION( 0x020000, "gfx2", 0 ) + ROM_REGION( 0x020000, "chars", 0 ) ROM_LOAD( "136081-1027.15l", 0x000000, 0x10000, CRC(a59f381d) SHA1(b14e878340ad2adbf4f6d4fc331c58f62037c7c7) ) /* alphanumerics */ ROM_REGION16_BE( 0x200000, "rle", 0 ) @@ -1125,14 +1125,14 @@ ROM_START( pitfight1p2 ) ROM_REGION( 0x10000, "jsa:cpu", 0 ) /* 64k for 6502 code */ ROM_LOAD( "136081-1060.1b", 0x00000, 0x10000, CRC(231d71d7) SHA1(24622eee5fe873ef81e1df2691bd7a1d3ea7ef6b) ) - ROM_REGION( 0x0a0000, "gfx1", 0 ) + ROM_REGION( 0x0a0000, "tiles", 0 ) ROM_LOAD( "136081-1017.130m", 0x000000, 0x10000, CRC(ad3cfea5) SHA1(7b6fec131230e84ab87b7fc95f08989916f30e02) ) /* playfield, planes 0-3 odd */ ROM_LOAD( "136081-1018.120m", 0x010000, 0x10000, CRC(1a0f8bcf) SHA1(b965e73246db9507d2ad42dfcb033692b43b9b7a) ) ROM_LOAD( "136081-1021.90m", 0x040000, 0x10000, CRC(777efee3) SHA1(07591f11685c4c75c24c55fd242878253d32481b) ) /* playfield, planes 0-3 even */ ROM_LOAD( "136081-1022.75m", 0x050000, 0x10000, CRC(524319d0) SHA1(6f47a69d7d4e2a8f79b7470138e8b4edd6d0b2bb) ) ROM_LOAD( "136081-1025.45m", 0x080000, 0x10000, CRC(fc41691a) SHA1(4ef2f9093f20d27e1ba7d218b90ff6abb1f33646) ) /* playfield plane 4 */ - ROM_REGION( 0x020000, "gfx2", 0 ) + ROM_REGION( 0x020000, "chars", 0 ) ROM_LOAD( "136081-1027.15l", 0x000000, 0x10000, CRC(a59f381d) SHA1(b14e878340ad2adbf4f6d4fc331c58f62037c7c7) ) /* alphanumerics */ ROM_REGION16_BE( 0x200000, "rle", 0 ) @@ -1187,14 +1187,14 @@ ROM_START( pitfightj ) ROM_REGION( 0x10000, "jsa:cpu", 0 ) /* 64k for 6502 code */ ROM_LOAD( "136081-2060.1b", 0x00000, 0x10000, CRC(4317a9f3) SHA1(310154be47fd16b417699338e04e08f3ed973198) ) - ROM_REGION( 0x0a0000, "gfx1", 0 ) + ROM_REGION( 0x0a0000, "tiles", 0 ) ROM_LOAD( "136081-1017.130m", 0x000000, 0x10000, CRC(ad3cfea5) SHA1(7b6fec131230e84ab87b7fc95f08989916f30e02) ) /* playfield, planes 0-3 odd */ ROM_LOAD( "136081-1018.120m", 0x010000, 0x10000, CRC(1a0f8bcf) SHA1(b965e73246db9507d2ad42dfcb033692b43b9b7a) ) ROM_LOAD( "136081-1021.90m", 0x040000, 0x10000, CRC(777efee3) SHA1(07591f11685c4c75c24c55fd242878253d32481b) ) /* playfield, planes 0-3 even */ ROM_LOAD( "136081-1022.75m", 0x050000, 0x10000, CRC(524319d0) SHA1(6f47a69d7d4e2a8f79b7470138e8b4edd6d0b2bb) ) ROM_LOAD( "136081-1025.45m", 0x080000, 0x10000, CRC(fc41691a) SHA1(4ef2f9093f20d27e1ba7d218b90ff6abb1f33646) ) /* playfield plane 4 */ - ROM_REGION( 0x020000, "gfx2", 0 ) + ROM_REGION( 0x020000, "chars", 0 ) ROM_LOAD( "136081-1427.dat", 0x000000, 0x20000, CRC(b2c51dff) SHA1(7ad82a6a55d3a68e39d113c92f9e89a43408b5b2) ) /* alphanumerics */ ROM_REGION16_BE( 0x200000, "rle", 0 ) @@ -1249,14 +1249,14 @@ ROM_START( pitfightb ) ROM_REGION( 0x10000, "jsa:cpu", 0 ) /* 64k for 6502 code */ ROM_LOAD( "136081-1060.1b", 0x00000, 0x10000, CRC(231d71d7) SHA1(24622eee5fe873ef81e1df2691bd7a1d3ea7ef6b) ) - ROM_REGION( 0x0a0000, "gfx1", 0 ) + ROM_REGION( 0x0a0000, "tiles", 0 ) ROM_LOAD( "136081-1017.130m", 0x000000, 0x10000, CRC(ad3cfea5) SHA1(7b6fec131230e84ab87b7fc95f08989916f30e02) ) /* playfield, planes 0-3 odd */ ROM_LOAD( "136081-1018.120m", 0x010000, 0x10000, CRC(1a0f8bcf) SHA1(b965e73246db9507d2ad42dfcb033692b43b9b7a) ) ROM_LOAD( "136081-1021.90m", 0x040000, 0x10000, CRC(777efee3) SHA1(07591f11685c4c75c24c55fd242878253d32481b) ) /* playfield, planes 0-3 even */ ROM_LOAD( "136081-1022.75m", 0x050000, 0x10000, CRC(524319d0) SHA1(6f47a69d7d4e2a8f79b7470138e8b4edd6d0b2bb) ) ROM_LOAD( "136081-1025.45m", 0x080000, 0x10000, CRC(fc41691a) SHA1(4ef2f9093f20d27e1ba7d218b90ff6abb1f33646) ) /* playfield plane 4 */ - ROM_REGION( 0x020000, "gfx2", 0 ) + ROM_REGION( 0x020000, "chars", 0 ) ROM_LOAD( "136081-1027.15l", 0x000000, 0x10000, CRC(a59f381d) SHA1(b14e878340ad2adbf4f6d4fc331c58f62037c7c7) ) /* alphanumerics */ ROM_REGION16_BE( 0x200000, "rle", 0 ) diff --git a/src/mame/atari/atarig1.h b/src/mame/atari/atarig1.h index 43a8b627ea0..8e92717f653 100644 --- a/src/mame/atari/atarig1.h +++ b/src/mame/atari/atarig1.h @@ -27,8 +27,8 @@ public: m_alpha_tilemap(*this, "alpha"), m_rle(*this, "rle"), m_adc(*this, "adc"), - m_in1(*this, "IN1"), - m_mo_command(*this, "mo_command") + m_mo_command(*this, "mo_command"), + m_in1(*this, "IN1") { } void atarig1(machine_config &config); @@ -57,12 +57,13 @@ private: required_device<atari_rle_objects_device> m_rle; optional_device<adc0808_device> m_adc; + + required_shared_ptr<uint16_t> m_mo_command; + optional_ioport m_in1; bool m_is_pitfight = false; - required_shared_ptr<uint16_t> m_mo_command; - bool m_bslapstic_primed = false; uint8_t m_pfscroll_xoffset = 0; @@ -80,7 +81,7 @@ private: void update_bank(int bank); TILE_GET_INFO_MEMBER(get_alpha_tile_info); TILE_GET_INFO_MEMBER(get_playfield_tile_info); - uint32_t screen_update_atarig1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void main_map(address_map &map) ATTR_COLD; void pitfight_map(address_map &map) ATTR_COLD; void hydra_map(address_map &map) ATTR_COLD; diff --git a/src/mame/atari/atarig1_v.cpp b/src/mame/atari/atarig1_v.cpp index 8534bf4a867..1e817652e07 100644 --- a/src/mame/atari/atarig1_v.cpp +++ b/src/mame/atari/atarig1_v.cpp @@ -20,20 +20,20 @@ TILE_GET_INFO_MEMBER(atarig1_state::get_alpha_tile_info) { - uint16_t data = m_alpha_tilemap->basemem_read(tile_index); - int code = data & 0xfff; - int color = (data >> 12) & 0x0f; - int opaque = data & 0x8000; + uint16_t const data = m_alpha_tilemap->basemem_read(tile_index); + int const code = data & 0xfff; + int const color = (data >> 12) & 0x0f; + bool const opaque = BIT(data, 15); tileinfo.set(1, code, color, opaque ? TILE_FORCE_LAYER0 : 0); } TILE_GET_INFO_MEMBER(atarig1_state::get_playfield_tile_info) { - uint16_t data = m_playfield_tilemap->basemem_read(tile_index); - int code = (m_playfield_tile_bank << 12) | (data & 0xfff); - int color = (data >> 12) & 7; - tileinfo.set(0, code, color, (data >> 15) & 1); + uint16_t const data = m_playfield_tilemap->basemem_read(tile_index); + int const code = (m_playfield_tile_bank << 12) | (data & 0xfff); + int const color = (data >> 12) & 7; + tileinfo.set(0, code, color, BIT(data, 15)); } @@ -69,7 +69,7 @@ void atarig1_state::video_start() TIMER_DEVICE_CALLBACK_MEMBER(atarig1_state::scanline_update) { - int scanline = param; + int const scanline = param; //if (scanline == 0) logerror("-------\n"); @@ -82,13 +82,11 @@ TIMER_DEVICE_CALLBACK_MEMBER(atarig1_state::scanline_update) /* update the playfield scrolls */ for (int i = 0; i < 8; i++) { - uint16_t word; - /* first word controls horizontal scroll */ - word = m_alpha_tilemap->basemem_read(offset++); - if (word & 0x8000) + uint16_t word = m_alpha_tilemap->basemem_read(offset++); + if (BIT(word, 15)) { - int newscroll = ((word >> 6) + m_pfscroll_xoffset) & 0x1ff; + int const newscroll = ((word >> 6) + m_pfscroll_xoffset) & 0x1ff; if (newscroll != m_playfield_xscroll) { m_screen->update_partial(std::max(scanline + i - 1, 0)); @@ -99,10 +97,10 @@ TIMER_DEVICE_CALLBACK_MEMBER(atarig1_state::scanline_update) /* second word controls vertical scroll and tile bank */ word = m_alpha_tilemap->basemem_read(offset++); - if (word & 0x8000) + if (BIT(word, 15)) { - int newscroll = ((word >> 6) - (scanline + i)) & 0x1ff; - int newbank = word & 7; + int const newscroll = ((word >> 6) - (scanline + i)) & 0x1ff; + int const newbank = word & 7; if (newscroll != m_playfield_yscroll) { m_screen->update_partial(std::max(scanline + i - 1, 0)); @@ -127,7 +125,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(atarig1_state::scanline_update) * *************************************/ -uint32_t atarig1_state::screen_update_atarig1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t atarig1_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { /* draw the playfield */ m_playfield_tilemap->draw(screen, bitmap, cliprect, 0, 0); diff --git a/src/mame/atari/atarig42.cpp b/src/mame/atari/atarig42.cpp index d70650f2fbb..b7ad08ab84a 100644 --- a/src/mame/atari/atarig42.cpp +++ b/src/mame/atari/atarig42.cpp @@ -77,7 +77,7 @@ uint8_t atarig42_state::a2d_data_r(offs_t offset) if (!m_adc.found()) return 0xff; - uint8_t result = m_adc->data_r(); + uint8_t const result = m_adc->data_r(); if (!machine().side_effects_disabled()) m_adc->address_offset_start_w(offset, 0); return result; @@ -90,7 +90,7 @@ void atarig42_state::io_latch_w(offs_t offset, uint16_t data, uint16_t mem_mask) if (ACCESSING_BITS_8_15) { /* bit 14 controls the ASIC65 reset line */ - m_asic65->reset_line((~data >> 14) & 1); + m_asic65->reset_line(BIT(~data, 14)); /* bits 13-11 are the MO control bits */ m_rle->control_write((data >> 11) & 7); @@ -100,8 +100,8 @@ void atarig42_state::io_latch_w(offs_t offset, uint16_t data, uint16_t mem_mask) if (ACCESSING_BITS_0_7) { /* bit 4 resets the sound CPU */ - m_jsa->soundcpu().set_input_line(INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE); - if (!(data & 0x10)) + m_jsa->soundcpu().set_input_line(INPUT_LINE_RESET, BIT(data, 4) ? CLEAR_LINE : ASSERT_LINE); + if (BIT(~data, 4)) m_jsa->reset(); /* bit 5 is /XRESET, probably related to the ASIC */ @@ -114,7 +114,7 @@ void atarig42_state::io_latch_w(offs_t offset, uint16_t data, uint16_t mem_mask) void atarig42_state::mo_command_w(offs_t offset, uint16_t data, uint16_t mem_mask) { COMBINE_DATA(m_mo_command); - m_rle->command_write((data == 0) ? ATARIRLE_COMMAND_CHECKSUM : ATARIRLE_COMMAND_DRAW); + m_rle->command_write((data == 0) ? atari_rle_objects_device::COMMAND_CHECKSUM : atari_rle_objects_device::COMMAND_DRAW); } @@ -239,7 +239,8 @@ void atarig42_0x200_state::roadriot_sloop_tweak(int offset) uint16_t atarig42_0x200_state::roadriot_sloop_data_r(offs_t offset) { - roadriot_sloop_tweak(offset); + if (!machine().side_effects_disabled()) + roadriot_sloop_tweak(offset); if (offset < 0x78000/2) return m_sloop_base[offset]; else @@ -296,7 +297,8 @@ void atarig42_0x400_state::guardians_sloop_tweak(int offset) uint16_t atarig42_0x400_state::guardians_sloop_data_r(offs_t offset) { - guardians_sloop_tweak(offset); + if (!machine().side_effects_disabled()) + guardians_sloop_tweak(offset); if (offset < 0x78000/2) return m_sloop_base[offset]; else @@ -341,7 +343,7 @@ void atarig42_state::main_map(address_map &map) map(0xff1000, 0xff1fff).ram(); map(0xff2000, 0xff5fff).ram().w(m_playfield_tilemap, FUNC(tilemap_device::write16)).share("playfield"); map(0xff6000, 0xff6fff).ram().w(m_alpha_tilemap, FUNC(tilemap_device::write16)).share("alpha"); - map(0xff7000, 0xff7001).ram().w(FUNC(atarig42_state::mo_command_w)).share("mo_command"); + map(0xff7000, 0xff7001).ram().w(FUNC(atarig42_state::mo_command_w)).share(m_mo_command); map(0xff7002, 0xffffff).ram(); } @@ -503,9 +505,9 @@ static const gfx_layout pftoplayout = }; static GFXDECODE_START( gfx_atarig42 ) - GFXDECODE_ENTRY( "gfx1", 0, pflayout, 0x000, 64 ) - GFXDECODE_ENTRY( "gfx2", 0, gfx_8x8x4_packed_msb, 0x000, 16 ) - GFXDECODE_ENTRY( "gfx1", 0, pftoplayout, 0x000, 64 ) + GFXDECODE_ENTRY( "tiles", 0, pflayout, 0x000, 64 ) + GFXDECODE_ENTRY( "chars", 0, gfx_8x8x4_packed_msb, 0x000, 16 ) + GFXDECODE_ENTRY( "tiles", 0, pftoplayout, 0x000, 64 ) GFXDECODE_END @@ -578,7 +580,7 @@ void atarig42_state::atarig42(machine_config &config) /* note: these parameters are from published specs, not derived */ /* the board uses an SOS chip to generate video signals */ m_screen->set_raw(14.318181_MHz_XTAL/2, 456, 0, 336, 262, 0, 240); - m_screen->set_screen_update(FUNC(atarig42_state::screen_update_atarig42)); + m_screen->set_screen_update(FUNC(atarig42_state::screen_update)); m_screen->set_palette("palette"); m_screen->screen_vblank().set_inputline(m_maincpu, M68K_IRQ_4, ASSERT_LINE); @@ -634,7 +636,7 @@ ROM_START( roadriot ) // Test mode shows DSP COMM and DSP LINK tests; This is a ROM_REGION( 0x10000, "jsa:cpu", 0 ) /* 6502 code */ ROM_LOAD( "136089-1047.12c", 0x00000, 0x10000, CRC(849dd26c) SHA1(05a0b2a5f7ee4437448b5f076d3066d96dec2320) ) - ROM_REGION( 0xc0000, "gfx1", 0 ) + ROM_REGION( 0xc0000, "tiles", 0 ) ROM_LOAD( "136089-1041.22d", 0x000000, 0x20000, CRC(b7451f92) SHA1(9fd17913630e457e406e596f2d86afff98787750) ) /* playfield, planes 0-1 */ ROM_LOAD( "136089-1038.22c", 0x020000, 0x20000, CRC(90f3c6ee) SHA1(7607509e2d3b2080a918cfaf2879dbed6b79d029) ) ROM_LOAD( "136089-1037.2021d", 0x040000, 0x20000, CRC(d40de62b) SHA1(fa6dfd20bdad7874ae33a1027a9bb0ea200f86ca) ) /* playfield, planes 2-3 */ @@ -642,7 +644,7 @@ ROM_START( roadriot ) // Test mode shows DSP COMM and DSP LINK tests; This is a ROM_LOAD( "136089-1040.20d", 0x080000, 0x20000, CRC(a81ae93f) SHA1(b694ba5fab35f8fa505a02039ae62f7af3c7ae1d) ) /* playfield, planes 4-5 */ ROM_LOAD( "136089-1042.20c", 0x0a0000, 0x20000, CRC(b8a6d15a) SHA1(43d2be9d40a84b2c01d80bbcac737eda04d55999) ) - ROM_REGION( 0x020000, "gfx2", 0 ) + ROM_REGION( 0x020000, "chars", 0 ) ROM_LOAD( "136089-1046.22j", 0x000000, 0x20000, CRC(0005bab0) SHA1(257e1b23eea117fe6701a67134b96d9d9fe10caf) ) /* alphanumerics */ ROM_REGION16_BE( 0x200000, "rle", 0 ) @@ -694,7 +696,7 @@ ROM_START( roadriota ) // Test mode shows DSP COMM and DSP LINK tests; This is a ROM_REGION( 0x10000, "jsa:cpu", 0 ) /* 6502 code */ ROM_LOAD( "136089-1047.12c", 0x00000, 0x10000, CRC(849dd26c) SHA1(05a0b2a5f7ee4437448b5f076d3066d96dec2320) ) - ROM_REGION( 0xc0000, "gfx1", 0 ) + ROM_REGION( 0xc0000, "tiles", 0 ) ROM_LOAD( "136089-1041.22d", 0x000000, 0x20000, CRC(b7451f92) SHA1(9fd17913630e457e406e596f2d86afff98787750) ) /* playfield, planes 0-1 */ ROM_LOAD( "136089-1038.22c", 0x020000, 0x20000, CRC(90f3c6ee) SHA1(7607509e2d3b2080a918cfaf2879dbed6b79d029) ) ROM_LOAD( "136089-1037.2021d", 0x040000, 0x20000, CRC(d40de62b) SHA1(fa6dfd20bdad7874ae33a1027a9bb0ea200f86ca) ) /* playfield, planes 2-3 */ @@ -702,7 +704,7 @@ ROM_START( roadriota ) // Test mode shows DSP COMM and DSP LINK tests; This is a ROM_LOAD( "136089-1040.20d", 0x080000, 0x20000, CRC(a81ae93f) SHA1(b694ba5fab35f8fa505a02039ae62f7af3c7ae1d) ) /* playfield, planes 4-5 */ ROM_LOAD( "136089-1042.20c", 0x0a0000, 0x20000, CRC(b8a6d15a) SHA1(43d2be9d40a84b2c01d80bbcac737eda04d55999) ) - ROM_REGION( 0x020000, "gfx2", 0 ) + ROM_REGION( 0x020000, "chars", 0 ) ROM_LOAD( "136089-1046.22j", 0x000000, 0x20000, CRC(0005bab0) SHA1(257e1b23eea117fe6701a67134b96d9d9fe10caf) ) /* alphanumerics */ ROM_REGION16_BE( 0x200000, "rle", 0 ) @@ -754,7 +756,7 @@ ROM_START( roadriotb ) // Test mode shows only COMM RAM test; This is a dedicate ROM_REGION( 0x10000, "jsa:cpu", 0 ) /* 6502 code */ ROM_LOAD( "136089-1047.12c", 0x00000, 0x10000, CRC(849dd26c) SHA1(05a0b2a5f7ee4437448b5f076d3066d96dec2320) ) - ROM_REGION( 0xc0000, "gfx1", 0 ) + ROM_REGION( 0xc0000, "tiles", 0 ) ROM_LOAD( "136089-1041.22d", 0x000000, 0x20000, CRC(b7451f92) SHA1(9fd17913630e457e406e596f2d86afff98787750) ) /* playfield, planes 0-1 */ ROM_LOAD( "136089-1038.22c", 0x020000, 0x20000, CRC(90f3c6ee) SHA1(7607509e2d3b2080a918cfaf2879dbed6b79d029) ) ROM_LOAD( "136089-1037.2021d", 0x040000, 0x20000, CRC(d40de62b) SHA1(fa6dfd20bdad7874ae33a1027a9bb0ea200f86ca) ) /* playfield, planes 2-3 */ @@ -762,7 +764,7 @@ ROM_START( roadriotb ) // Test mode shows only COMM RAM test; This is a dedicate ROM_LOAD( "136089-1040.20d", 0x080000, 0x20000, CRC(a81ae93f) SHA1(b694ba5fab35f8fa505a02039ae62f7af3c7ae1d) ) /* playfield, planes 4-5 */ ROM_LOAD( "136089-1042.20c", 0x0a0000, 0x20000, CRC(b8a6d15a) SHA1(43d2be9d40a84b2c01d80bbcac737eda04d55999) ) - ROM_REGION( 0x020000, "gfx2", 0 ) + ROM_REGION( 0x020000, "chars", 0 ) ROM_LOAD( "136089-1046.22j", 0x000000, 0x20000, CRC(0005bab0) SHA1(257e1b23eea117fe6701a67134b96d9d9fe10caf) ) /* alphanumerics */ ROM_REGION16_BE( 0x200000, "rle", 0 ) @@ -813,7 +815,7 @@ ROM_START( dangerex ) ROM_LOAD( "dx12c-5.12c", 0x10000, 0x4000, CRC(d72621f7) SHA1(4bf5c98dd2434cc6ed1bddb6baf42f41cf138e1a) ) ROM_CONTINUE( 0x04000, 0xc000 ) - ROM_REGION( 0xc0000, "gfx1", 0 ) + ROM_REGION( 0xc0000, "tiles", 0 ) ROM_LOAD( "dxc117-22d.22d", 0x000000, 0x20000, CRC(5532995a) SHA1(21e001c911adb91dbe43e895ae8582df65f2995d) ) /* playfield, planes 0-1 */ ROM_LOAD( "dx82-22c.22c", 0x020000, 0x20000, CRC(9548599b) SHA1(d08bae8dabce0175f956631ddfbf091653af035e) ) ROM_LOAD( "dxc116-20-21d.21d", 0x040000, 0x20000, CRC(ebbf0fd8) SHA1(4ceb026c4231b675215110c16c8f75551cdfa461) ) /* playfield, planes 2-3 */ @@ -821,7 +823,7 @@ ROM_START( dangerex ) ROM_LOAD( "dxc115-20d.20d", 0x080000, 0x20000, CRC(2819ce54) SHA1(9a3c041d9046af41997dc1d9f41bf0e1be9489f9) ) /* playfield, planes 4-5 */ ROM_LOAD( "dxc80-20c.20c", 0x0a0000, 0x20000, CRC(a8ffe459) SHA1(92a10694c38a4fbe3022662f4e8e4e214aab31c9) ) - ROM_REGION( 0x020000, "gfx2", 0 ) + ROM_REGION( 0x020000, "chars", 0 ) ROM_LOAD( "dxc187-22j.22j", 0x000000, 0x20000, CRC(7231ecc2) SHA1(8b1b0aed3a0d907630e120395b0a97fd9a1ef8cc) ) /* alphanumerics */ ROM_REGION16_BE( 0x800000, "rle", 0 ) @@ -871,12 +873,12 @@ ROM_START( guardian ) ROM_REGION( 0x10000, "jsa:cpu", 0 ) /* 6502 code */ ROM_LOAD( "136092-0080-snd.12c", 0x00000, 0x10000, CRC(0388f805) SHA1(49c11313bc4192dbe294cf68b652cb19047889fd) ) - ROM_REGION( 0x180000, "gfx1", 0 ) + ROM_REGION( 0x180000, "tiles", 0 ) ROM_LOAD( "136092-0037a.23e", 0x000000, 0x80000, CRC(ca10b63e) SHA1(243a2a440e1bc9135d3dbe6553d39c54b9bdcd13) ) /* playfield, planes 0-1 */ ROM_LOAD( "136092-0038a.22e", 0x080000, 0x80000, CRC(cb1431a1) SHA1(d7b8f49a1e794ca2083e4bf0fa3870ce08caa53a) ) /* playfield, planes 2-3 */ ROM_LOAD( "136092-0039a.20e", 0x100000, 0x80000, CRC(2eee7188) SHA1(d3adbd7b20bc898fee35b6ba781e7775f82acd19) ) /* playfield, planes 4-5 */ - ROM_REGION( 0x020000, "gfx2", 0 ) + ROM_REGION( 0x020000, "chars", 0 ) ROM_LOAD( "136092-0030.23k", 0x000000, 0x20000, CRC(0fd7baa1) SHA1(7802d732e5173291628ed498ad0fab71aeef4688) ) /* alphanumerics */ ROM_REGION16_BE( 0x600000, "rle", 0 ) diff --git a/src/mame/atari/atarig42.h b/src/mame/atari/atarig42.h index a62f0c727c9..7d818eb6cfa 100644 --- a/src/mame/atari/atarig42.h +++ b/src/mame/atari/atarig42.h @@ -45,7 +45,7 @@ protected: TILE_GET_INFO_MEMBER(get_alpha_tile_info); TILE_GET_INFO_MEMBER(get_playfield_tile_info); TILEMAP_MAPPER_MEMBER(atarig42_playfield_scan); - uint32_t screen_update_atarig42(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void atarig42(machine_config &config); void main_map(address_map &map) ATTR_COLD; @@ -57,6 +57,8 @@ protected: required_device<asic65_device> m_asic65; optional_device<adc0808_device> m_adc; + required_shared_ptr<uint16_t> m_mo_command; + uint16_t m_playfield_base = 0; uint16_t m_current_control = 0; @@ -65,12 +67,10 @@ protected: uint16_t m_playfield_xscroll = 0; uint16_t m_playfield_yscroll = 0; - required_shared_ptr<uint16_t> m_mo_command; - - int m_sloop_bank = 0; - int m_sloop_next_bank = 0; - int m_sloop_offset = 0; - int m_sloop_state = 0; + int32_t m_sloop_bank = 0; + int32_t m_sloop_next_bank = 0; + int32_t m_sloop_offset = 0; + int32_t m_sloop_state = 0; uint16_t * m_sloop_base = nullptr; uint32_t m_last_accesses[8]{}; diff --git a/src/mame/atari/atarig42_v.cpp b/src/mame/atari/atarig42_v.cpp index 32746d9e525..1144213edfb 100644 --- a/src/mame/atari/atarig42_v.cpp +++ b/src/mame/atari/atarig42_v.cpp @@ -35,27 +35,27 @@ TILE_GET_INFO_MEMBER(atarig42_state::get_alpha_tile_info) { - uint16_t data = m_alpha_tilemap->basemem_read(tile_index); - int code = data & 0xfff; - int color = (data >> 12) & 0x0f; - int opaque = data & 0x8000; + uint16_t const data = m_alpha_tilemap->basemem_read(tile_index); + int const code = data & 0xfff; + int const color = (data >> 12) & 0x0f; + bool const opaque = BIT(data, 15); tileinfo.set(1, code, color, opaque ? TILE_FORCE_LAYER0 : 0); } TILE_GET_INFO_MEMBER(atarig42_state::get_playfield_tile_info) { - uint16_t data = m_playfield_tilemap->basemem_read(tile_index); - int code = (m_playfield_tile_bank << 12) | (data & 0xfff); - int color = (m_playfield_base >> 5) + ((m_playfield_color_bank << 3) & 0x18) + ((data >> 12) & 7); - tileinfo.set(0, code, color, (data >> 15) & 1); + uint16_t const data = m_playfield_tilemap->basemem_read(tile_index); + int const code = (m_playfield_tile_bank << 12) | (data & 0xfff); + int const color = (m_playfield_base >> 5) + ((m_playfield_color_bank << 3) & 0x18) + ((data >> 12) & 7); + tileinfo.set(0, code, color, BIT(data, 15)); tileinfo.category = (m_playfield_color_bank >> 2) & 7; } TILEMAP_MAPPER_MEMBER(atarig42_state::atarig42_playfield_scan) { - int bank = 1 - (col / (num_cols / 2)); + int const bank = 1 - (col / (num_cols / 2)); return bank * (num_rows * num_cols / 2) + row * (num_cols / 2) + (col % (num_cols / 2)); } @@ -90,7 +90,7 @@ void atarig42_state::video_start() TIMER_DEVICE_CALLBACK_MEMBER(atarig42_state::scanline_update) { - int scanline = param; + int const scanline = param; /* keep in range */ int offset = (scanline / 8) * 64 + 48; @@ -100,13 +100,11 @@ TIMER_DEVICE_CALLBACK_MEMBER(atarig42_state::scanline_update) /* update the playfield scrolls */ for (int i = 0; i < 8; i++) { - uint16_t word; - - word = m_alpha_tilemap->basemem_read(offset++); - if (word & 0x8000) + uint16_t word = m_alpha_tilemap->basemem_read(offset++); + if (BIT(word, 15)) { - int newscroll = (word >> 5) & 0x3ff; - int newbank = word & 0x1f; + int const newscroll = (word >> 5) & 0x3ff; + int const newbank = word & 0x1f; if (newscroll != m_playfield_xscroll) { if (scanline + i > 0) @@ -124,10 +122,10 @@ TIMER_DEVICE_CALLBACK_MEMBER(atarig42_state::scanline_update) } word = m_alpha_tilemap->basemem_read(offset++); - if (word & 0x8000) + if (BIT(word, 15)) { - int newscroll = ((word >> 6) - (scanline + i)) & 0x1ff; - int newbank = word & 7; + int const newscroll = ((word >> 6) - (scanline + i)) & 0x1ff; + int const newbank = word & 7; if (newscroll != m_playfield_yscroll) { if (scanline + i > 0) @@ -154,7 +152,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(atarig42_state::scanline_update) * *************************************/ -uint32_t atarig42_state::screen_update_atarig42(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t atarig42_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bitmap_ind8 &priority_bitmap = screen.priority(); @@ -187,9 +185,9 @@ uint32_t atarig42_state::screen_update_atarig42(screen_device &screen, bitmap_in if (mo[x]) { int const pfpri = pri[x]; - int const mopri = mo[x] >> ATARIRLE_PRIORITY_SHIFT; + int const mopri = mo[x] >> atari_rle_objects_device::PRIORITY_SHIFT; if (mopri >= pfpri) - pf[x] = mo[x] & ATARIRLE_DATA_MASK; + pf[x] = mo[x] & atari_rle_objects_device::DATA_MASK; } } } diff --git a/src/mame/atari/atarigt.cpp b/src/mame/atari/atarigt.cpp index 4578cd8e393..63fe14900d0 100644 --- a/src/mame/atari/atarigt.cpp +++ b/src/mame/atari/atarigt.cpp @@ -215,7 +215,7 @@ uint8_t atarigt_state::analog_port_r(offs_t offset) return 0xff; } #else - uint8_t result = m_adc->data_r(); + uint8_t const result = m_adc->data_r(); if (!machine().side_effects_disabled()) m_adc->address_offset_start_w(offset, 0); return result; @@ -255,13 +255,13 @@ void atarigt_state::latch_w(offs_t offset, uint32_t data, uint32_t mem_mask) // tmek20 needs following otherwise will cause a Cage CPU crash // that eventually turns into a MAME hardlock. // https://mametesters.org/view.php?id=7146 - m_cage->reset_w(!BIT(data, 21)); + m_cage->reset_w(BIT(~data, 21)); // sndres may reset internals instead? // 0 in tmek, 1 in primrage // also cfr. m_cage->control_w - //cage_reset_w(space, data & 0x00100000); - machine().bookkeeping().coin_counter_w(0, data & 0x00080000); - machine().bookkeeping().coin_counter_w(1, data & 0x00010000); + //cage_reset_w(space, BIT(data, 20)); + machine().bookkeeping().coin_counter_w(0, BIT(data, 19)); + machine().bookkeeping().coin_counter_w(1, BIT(data, 16)); } } @@ -270,7 +270,7 @@ void atarigt_state::mo_command_w(offs_t offset, uint32_t data, uint32_t mem_mask { COMBINE_DATA(m_mo_command); if (ACCESSING_BITS_0_15) - m_rle->command_write(((data & 0xffff) == 2) ? ATARIRLE_COMMAND_CHECKSUM : ATARIRLE_COMMAND_DRAW); + m_rle->command_write(((data & 0xffff) == 2) ? atari_rle_objects_device::COMMAND_CHECKSUM : atari_rle_objects_device::COMMAND_DRAW); } @@ -351,10 +351,13 @@ void atarigt_state::tmek_protection_w(address_space &space, offs_t offset, uint1 void atarigt_state::tmek_protection_r(address_space &space, offs_t offset, uint16_t *data) { - LOGMASKED(LOG_PROTECTION, "%s:Protection R@%06X\n", machine().describe_context(), offset); + if (!machine().side_effects_disabled()) + { + LOGMASKED(LOG_PROTECTION, "%s:Protection R@%06X\n", machine().describe_context(), offset); - /* track accesses */ - tmek_update_mode(offset); + /* track accesses */ + tmek_update_mode(offset); + } /* handle specific reads */ switch (offset) @@ -481,23 +484,29 @@ void atarigt_state::primrage_protection_w(address_space &space, offs_t offset, u void atarigt_state::primrage_protection_r(address_space &space, offs_t offset, uint16_t *data) { - /* track accesses */ - primrage_update_mode(offset); + if (!machine().side_effects_disabled()) + { + /* track accesses */ + primrage_update_mode(offset); + } - uint32_t pc = m_maincpu->pcbase(); + uint32_t const pc = m_maincpu->pcbase(); uint32_t p1, p2, a6; switch (pc) { /* protection code from 20f90 - 21000 */ case 0x20f90: - LOGMASKED(LOG_PROTECTION, "Known Protection @ 20F90: R@%06X ", offset); + if (!machine().side_effects_disabled()) + LOGMASKED(LOG_PROTECTION, "Known Protection @ 20F90: R@%06X ", offset); break; case 0x20f98: case 0x20fa0: - LOGMASKED(LOG_PROTECTION, "R@%06X ", offset); + if (!machine().side_effects_disabled()) + LOGMASKED(LOG_PROTECTION, "R@%06X ", offset); break; case 0x20fcc: - LOGMASKED(LOG_PROTECTION, "R@%06X - done\n", offset); + if (!machine().side_effects_disabled()) + LOGMASKED(LOG_PROTECTION, "R@%06X - done\n", offset); break; /* protection code from 27592 - 27664 */ @@ -507,47 +516,56 @@ void atarigt_state::primrage_protection_r(address_space &space, offs_t offset, u a6 = m_maincpu->state_int(M68K_A6); p1 = (space.read_word(a6+8) << 16) | space.read_word(a6+10); p2 = (space.read_word(a6+12) << 16) | space.read_word(a6+14); - LOGMASKED(LOG_PROTECTION, "Known Protection @ 275BC(%08X, %08X): R@%06X ", p1, p2, offset); + if (!machine().side_effects_disabled()) + LOGMASKED(LOG_PROTECTION, "Known Protection @ 275BC(%08X, %08X): R@%06X ", p1, p2, offset); break; case 0x275d2: case 0x275d8: case 0x275de: case 0x2761e: case 0x2762e: - LOGMASKED(LOG_PROTECTION, "R@%06X ", offset); + if (!machine().side_effects_disabled()) + LOGMASKED(LOG_PROTECTION, "R@%06X ", offset); break; case 0x2763e: - LOGMASKED(LOG_PROTECTION, "R@%06X - done\n", offset); + if (!machine().side_effects_disabled()) + LOGMASKED(LOG_PROTECTION, "R@%06X - done\n", offset); break; /* protection code from 3d8dc - 3d95a */ case 0x3d8f4: a6 = m_maincpu->state_int(M68K_A6); p1 = (space.read_word(a6+12) << 16) | space.read_word(a6+14); - LOGMASKED(LOG_PROTECTION, "Known Protection @ 3D8F4(%08X): R@%06X ", p1, offset); + if (!machine().side_effects_disabled()) + LOGMASKED(LOG_PROTECTION, "Known Protection @ 3D8F4(%08X): R@%06X ", p1, offset); break; case 0x3d8fa: case 0x3d90e: - LOGMASKED(LOG_PROTECTION, "R@%06X ", offset); + if (!machine().side_effects_disabled()) + LOGMASKED(LOG_PROTECTION, "R@%06X ", offset); break; /* protection code from 437fa - 43860 */ case 0x43814: a6 = m_maincpu->state_int(M68K_A6); p1 = space.read_dword(a6+14) & 0xffffff; - LOGMASKED(LOG_PROTECTION, "Known Protection @ 43814(%08X): R@%06X ", p1, offset); + if (!machine().side_effects_disabled()) + LOGMASKED(LOG_PROTECTION, "Known Protection @ 43814(%08X): R@%06X ", p1, offset); break; case 0x4381c: case 0x43840: - LOGMASKED(LOG_PROTECTION, "R@%06X ", offset); + if (!machine().side_effects_disabled()) + LOGMASKED(LOG_PROTECTION, "R@%06X ", offset); break; case 0x43848: - LOGMASKED(LOG_PROTECTION, "R@%06X - done\n", offset); + if (!machine().side_effects_disabled()) + LOGMASKED(LOG_PROTECTION, "R@%06X - done\n", offset); break; /* catch anything else */ default: - LOGMASKED(LOG_PROTECTION, "%s:Unknown protection R@%06X\n", machine().describe_context(), offset); + if (!machine().side_effects_disabled()) + LOGMASKED(LOG_PROTECTION, "%s:Unknown protection R@%06X\n", machine().describe_context(), offset); break; } @@ -567,16 +585,22 @@ void atarigt_state::primrage_protection_r(address_space &space, offs_t offset, u if (m_protmode == 2) { *data = m_protresult; - m_protmode = 0; - LOGMASKED(LOG_PROTECTION, "prot:Clearing mode 2\n"); + if (!machine().side_effects_disabled()) + { + m_protmode = 0; + LOGMASKED(LOG_PROTECTION, "prot:Clearing mode 2\n"); + } } break; case 0xdcc7c4: if (m_protmode == 1) { - m_protmode = 0; - LOGMASKED(LOG_PROTECTION, "prot:Clearing mode 1\n"); + if (!machine().side_effects_disabled()) + { + m_protmode = 0; + LOGMASKED(LOG_PROTECTION, "prot:Clearing mode 1\n"); + } } break; } @@ -592,7 +616,7 @@ void atarigt_state::primrage_protection_r(address_space &space, offs_t offset, u uint32_t atarigt_state::colorram_protection_r(address_space &space, offs_t offset, uint32_t mem_mask) { - offs_t address = 0xd80000 + offset * 4; + offs_t const address = 0xd80000 + offset * 4; uint32_t result32 = 0; uint16_t result; @@ -615,7 +639,7 @@ uint32_t atarigt_state::colorram_protection_r(address_space &space, offs_t offse void atarigt_state::colorram_protection_w(address_space &space, offs_t offset, uint32_t data, uint32_t mem_mask) { - offs_t address = 0xd80000 + offset * 4; + offs_t const address = 0xd80000 + offset * 4; if (ACCESSING_BITS_16_31) { @@ -804,9 +828,9 @@ static const gfx_layout pftoplayout = static GFXDECODE_START( gfx_atarigt ) - GFXDECODE_ENTRY( "gfx1", 0, pflayout, 0x000, 64 ) - GFXDECODE_ENTRY( "gfx2", 0, gfx_8x8x4_packed_msb, 0x000, 16 ) - GFXDECODE_ENTRY( "gfx1", 0, pftoplayout, 0x000, 64 ) + GFXDECODE_ENTRY( "tiles", 0, pflayout, 0x000, 64 ) + GFXDECODE_ENTRY( "chars", 0, gfx_8x8x4_packed_msb, 0x000, 16 ) + GFXDECODE_ENTRY( "tiles", 0, pftoplayout, 0x000, 64 ) GFXDECODE_END @@ -848,7 +872,7 @@ void atarigt_state::atarigt(machine_config &config) /* video hardware */ GFXDECODE(config, m_gfxdecode, m_palette, gfx_atarigt); - PALETTE(config, m_palette).set_entries(MRAM_ENTRIES); + PALETTE(config, m_palette).set_entries(0x8000); TILEMAP(config, m_playfield_tilemap, m_gfxdecode, 2, 8,8); m_playfield_tilemap->set_layout(FUNC(atarigt_state::playfield_scan), 128,64); @@ -860,7 +884,7 @@ void atarigt_state::atarigt(machine_config &config) /* note: these parameters are from published specs, not derived */ /* the board uses a pair of GALs to determine H and V parameters */ m_screen->set_raw(14.318181_MHz_XTAL/2, 456, 0, 336, 262, 0, 240); - m_screen->set_screen_update(FUNC(atarigt_state::screen_update_atarigt)); + m_screen->set_screen_update(FUNC(atarigt_state::screen_update)); m_screen->screen_vblank().set(FUNC(atarigt_state::video_int_write_line)); ATARI_RLE_OBJECTS(config, m_rle, 0, modesc); @@ -953,7 +977,7 @@ ROM_START( tmek ) ROM_LOAD32_WORD( "0076", 0x800000, 0x200000, CRC(74dffe2d) SHA1(9436f69827050ad2f3be58f1cb57d7a06b75ab61) ) ROM_LOAD32_WORD( "0074", 0x800002, 0x200000, CRC(8dfc6ce0) SHA1(5b0d4dd4cb7934f542e67217a2542a3c69558cea) ) - ROM_REGION( 0x300000, "gfx1", 0 ) + ROM_REGION( 0x300000, "tiles", 0 ) ROM_LOAD( "0250", 0x000000, 0x80000, CRC(56bd9f25) SHA1(a8161aeee274f28c41f82b6b3f63570970ee281d) ) /* playfield, planes 0-1 */ ROM_LOAD( "0253a", 0x080000, 0x80000, CRC(23e2f83d) SHA1(804a17ce8768bd48cda853e55fc1f54ed7475968) ) ROM_LOAD( "0251", 0x100000, 0x80000, CRC(0d3b08f7) SHA1(72ec2383011ef20e9054594279cc85fa55c3a9b2) ) /* playfield, planes 2-3 */ @@ -961,7 +985,7 @@ ROM_START( tmek ) ROM_LOAD( "0252", 0x200000, 0x80000, CRC(95a1c23b) SHA1(74eb69dcaebd7a7a03d8f7c9bf6183ece695e91d) ) /* playfield, planes 4-5 */ ROM_LOAD( "0255a", 0x280000, 0x80000, CRC(f0fbb700) SHA1(3f0355b137f6426a07abab77f25e718c6102a16f) ) - ROM_REGION( 0x020000, "gfx2", 0 ) + ROM_REGION( 0x020000, "chars", 0 ) ROM_LOAD( "0045a", 0x000000, 0x20000, CRC(057a5304) SHA1(d44c0cf885a1324888b7e8118f124c0dae616859) ) /* alphanumerics */ ROM_REGION16_BE( 0x1000000, "rle", 0 ) @@ -1008,7 +1032,7 @@ ROM_START( tmek51p ) ROM_LOAD32_WORD( "0076", 0x800000, 0x200000, CRC(74dffe2d) SHA1(9436f69827050ad2f3be58f1cb57d7a06b75ab61) ) ROM_LOAD32_WORD( "0074", 0x800002, 0x200000, CRC(8dfc6ce0) SHA1(5b0d4dd4cb7934f542e67217a2542a3c69558cea) ) - ROM_REGION( 0x300000, "gfx1", 0 ) + ROM_REGION( 0x300000, "tiles", 0 ) ROM_LOAD( "0250", 0x000000, 0x80000, CRC(56bd9f25) SHA1(a8161aeee274f28c41f82b6b3f63570970ee281d) ) /* playfield, planes 0-1 */ ROM_LOAD( "0253a", 0x080000, 0x80000, CRC(23e2f83d) SHA1(804a17ce8768bd48cda853e55fc1f54ed7475968) ) ROM_LOAD( "0251", 0x100000, 0x80000, CRC(0d3b08f7) SHA1(72ec2383011ef20e9054594279cc85fa55c3a9b2) ) /* playfield, planes 2-3 */ @@ -1016,7 +1040,7 @@ ROM_START( tmek51p ) ROM_LOAD( "0252", 0x200000, 0x80000, CRC(95a1c23b) SHA1(74eb69dcaebd7a7a03d8f7c9bf6183ece695e91d) ) /* playfield, planes 4-5 */ ROM_LOAD( "0255a", 0x280000, 0x80000, CRC(f0fbb700) SHA1(3f0355b137f6426a07abab77f25e718c6102a16f) ) - ROM_REGION( 0x020000, "gfx2", 0 ) + ROM_REGION( 0x020000, "chars", 0 ) ROM_LOAD( "0045a", 0x000000, 0x20000, CRC(057a5304) SHA1(d44c0cf885a1324888b7e8118f124c0dae616859) ) /* alphanumerics */ ROM_REGION16_BE( 0x1000000, "rle", 0 ) @@ -1063,7 +1087,7 @@ ROM_START( tmek45 ) ROM_LOAD32_WORD( "0076", 0x800000, 0x200000, CRC(74dffe2d) SHA1(9436f69827050ad2f3be58f1cb57d7a06b75ab61) ) ROM_LOAD32_WORD( "0074", 0x800002, 0x200000, CRC(8dfc6ce0) SHA1(5b0d4dd4cb7934f542e67217a2542a3c69558cea) ) - ROM_REGION( 0x300000, "gfx1", 0 ) + ROM_REGION( 0x300000, "tiles", 0 ) ROM_LOAD( "0250", 0x000000, 0x80000, CRC(56bd9f25) SHA1(a8161aeee274f28c41f82b6b3f63570970ee281d) ) /* playfield, planes 0-1 */ ROM_LOAD( "0253a", 0x080000, 0x80000, CRC(23e2f83d) SHA1(804a17ce8768bd48cda853e55fc1f54ed7475968) ) ROM_LOAD( "0251", 0x100000, 0x80000, CRC(0d3b08f7) SHA1(72ec2383011ef20e9054594279cc85fa55c3a9b2) ) /* playfield, planes 2-3 */ @@ -1071,7 +1095,7 @@ ROM_START( tmek45 ) ROM_LOAD( "0252", 0x200000, 0x80000, CRC(95a1c23b) SHA1(74eb69dcaebd7a7a03d8f7c9bf6183ece695e91d) ) /* playfield, planes 4-5 */ ROM_LOAD( "0255a", 0x280000, 0x80000, CRC(f0fbb700) SHA1(3f0355b137f6426a07abab77f25e718c6102a16f) ) - ROM_REGION( 0x020000, "gfx2", 0 ) + ROM_REGION( 0x020000, "chars", 0 ) ROM_LOAD( "0045a", 0x000000, 0x20000, CRC(057a5304) SHA1(d44c0cf885a1324888b7e8118f124c0dae616859) ) /* alphanumerics */ ROM_REGION16_BE( 0x1000000, "rle", 0 ) @@ -1118,7 +1142,7 @@ ROM_START( tmek44 ) ROM_LOAD32_WORD( "0076", 0x800000, 0x200000, CRC(74dffe2d) SHA1(9436f69827050ad2f3be58f1cb57d7a06b75ab61) ) ROM_LOAD32_WORD( "0074", 0x800002, 0x200000, CRC(8dfc6ce0) SHA1(5b0d4dd4cb7934f542e67217a2542a3c69558cea) ) - ROM_REGION( 0x300000, "gfx1", 0 ) + ROM_REGION( 0x300000, "tiles", 0 ) ROM_LOAD( "0250", 0x000000, 0x80000, CRC(56bd9f25) SHA1(a8161aeee274f28c41f82b6b3f63570970ee281d) ) /* playfield, planes 0-1 */ ROM_LOAD( "0253a", 0x080000, 0x80000, CRC(23e2f83d) SHA1(804a17ce8768bd48cda853e55fc1f54ed7475968) ) ROM_LOAD( "0251", 0x100000, 0x80000, CRC(0d3b08f7) SHA1(72ec2383011ef20e9054594279cc85fa55c3a9b2) ) /* playfield, planes 2-3 */ @@ -1126,7 +1150,7 @@ ROM_START( tmek44 ) ROM_LOAD( "0252", 0x200000, 0x80000, CRC(95a1c23b) SHA1(74eb69dcaebd7a7a03d8f7c9bf6183ece695e91d) ) /* playfield, planes 4-5 */ ROM_LOAD( "0255a", 0x280000, 0x80000, CRC(f0fbb700) SHA1(3f0355b137f6426a07abab77f25e718c6102a16f) ) - ROM_REGION( 0x020000, "gfx2", 0 ) + ROM_REGION( 0x020000, "chars", 0 ) ROM_LOAD( "0045a", 0x000000, 0x20000, CRC(057a5304) SHA1(d44c0cf885a1324888b7e8118f124c0dae616859) ) /* alphanumerics */ ROM_REGION16_BE( 0x1000000, "rle", 0 ) @@ -1173,7 +1197,7 @@ ROM_START( tmek20 ) ROM_LOAD32_WORD( "0076", 0x800000, 0x200000, CRC(74dffe2d) SHA1(9436f69827050ad2f3be58f1cb57d7a06b75ab61) ) ROM_LOAD32_WORD( "0074", 0x800002, 0x200000, CRC(8dfc6ce0) SHA1(5b0d4dd4cb7934f542e67217a2542a3c69558cea) ) - ROM_REGION( 0x300000, "gfx1", 0 ) + ROM_REGION( 0x300000, "tiles", 0 ) ROM_LOAD( "0250", 0x000000, 0x80000, CRC(56bd9f25) SHA1(a8161aeee274f28c41f82b6b3f63570970ee281d) ) /* playfield, planes 0-1 */ ROM_LOAD( "0253a", 0x080000, 0x80000, CRC(23e2f83d) SHA1(804a17ce8768bd48cda853e55fc1f54ed7475968) ) ROM_LOAD( "0251", 0x100000, 0x80000, CRC(0d3b08f7) SHA1(72ec2383011ef20e9054594279cc85fa55c3a9b2) ) /* playfield, planes 2-3 */ @@ -1181,7 +1205,7 @@ ROM_START( tmek20 ) ROM_LOAD( "0252", 0x200000, 0x80000, CRC(95a1c23b) SHA1(74eb69dcaebd7a7a03d8f7c9bf6183ece695e91d) ) /* playfield, planes 4-5 */ ROM_LOAD( "0255a", 0x280000, 0x80000, CRC(f0fbb700) SHA1(3f0355b137f6426a07abab77f25e718c6102a16f) ) - ROM_REGION( 0x020000, "gfx2", 0 ) + ROM_REGION( 0x020000, "chars", 0 ) ROM_LOAD( "alpha", 0x000000, 0x20000, CRC(8f57a604) SHA1(f076636430ff73ea11e4687ef7b21a7bac1d8e34) ) /* alphanumerics */ ROM_REGION16_BE( 0x1000000, "rle", 0 ) @@ -1223,12 +1247,12 @@ ROM_START( primrage ) // still shows 'version 2.3' on the title screen but build ROM_LOAD32_WORD( "136102-0075_dspsub.11c", 0x400000, 0x200000, CRC(02448be6) SHA1(cc82ececfa739600136b330df90edcc07dff9296) ) ROM_LOAD32_WORD( "136102-0077_dspsub.11e", 0x400002, 0x200000, CRC(057aff9a) SHA1(5d654baafb8395c059613069592ec392d1096870) ) - ROM_REGION( 0x300000, "gfx1", 0 ) // same as the primrageo set + ROM_REGION( 0x300000, "tiles", 0 ) // same as the primrageo set ROM_LOAD( "rage_136102-0050a_pf0l.25n", 0x000000, 0x80000, CRC(66896e8f) SHA1(7675b24c15ca0608f11f2a7b8d70717adb10924c) ) /* playfield, planes 0-1 */ ROM_LOAD( "rage_136102-0051a_pf0m.27n", 0x100000, 0x80000, CRC(fb5b3e7b) SHA1(f43fe4b5c4bbea10da46b60c644f586fb391355d) ) /* playfield, planes 2-3 */ ROM_LOAD( "rage_136102-0052a_pf0h.28n", 0x200000, 0x80000, CRC(cbe38670) SHA1(0780e599007851f6d37cdd8c701d01cb1ae48b9d) ) /* playfield, planes 4-5 */ - ROM_REGION( 0x020000, "gfx2", 0 ) // same as the primrageo set + ROM_REGION( 0x020000, "chars", 0 ) // same as the primrageo set ROM_LOAD( "rage_136102-1078a_alpha.22p", 0x000000, 0x20000, CRC(1d3260bf) SHA1(85d9db8499cbe180c8d52710f3cfe64453a530ff) ) /* alphanumerics */ ROM_REGION16_BE( 0x2000000, "rle", 0 ) // only first 2 dumped for this set, the rest's numbers match the primrageo set @@ -1309,12 +1333,12 @@ ROM_START( primrageo ) ROM_LOAD32_WORD( "136102-0075", 0x400000, 0x200000, CRC(b685a88e) SHA1(998b8fe54971f6cd96e4c22b19e3831f29d8172d) ) ROM_LOAD32_WORD( "136102-0077", 0x400002, 0x200000, CRC(3283cea8) SHA1(fb7333ca951053a56c501f2ce0eb197c8fcafaf7) ) - ROM_REGION( 0x300000, "gfx1", 0 ) + ROM_REGION( 0x300000, "tiles", 0 ) ROM_LOAD( "136102-0050a.25n", 0x000000, 0x80000, CRC(66896e8f) SHA1(7675b24c15ca0608f11f2a7b8d70717adb10924c) ) /* playfield, planes 0-1 */ ROM_LOAD( "136102-0051a.27n", 0x100000, 0x80000, CRC(fb5b3e7b) SHA1(f43fe4b5c4bbea10da46b60c644f586fb391355d) ) /* playfield, planes 2-3 */ ROM_LOAD( "136102-0052a.28n", 0x200000, 0x80000, CRC(cbe38670) SHA1(0780e599007851f6d37cdd8c701d01cb1ae48b9d) ) /* playfield, planes 4-5 */ - ROM_REGION( 0x020000, "gfx2", 0 ) + ROM_REGION( 0x020000, "chars", 0 ) ROM_LOAD( "136102-1045b.23p", 0x000000, 0x20000, CRC(1d3260bf) SHA1(85d9db8499cbe180c8d52710f3cfe64453a530ff) ) /* alphanumerics */ ROM_REGION16_BE( 0x2000000, "rle", 0 ) @@ -1395,12 +1419,12 @@ ROM_START( primrage20 ) ROM_LOAD32_WORD( "136102-0075", 0x400000, 0x200000, CRC(b685a88e) SHA1(998b8fe54971f6cd96e4c22b19e3831f29d8172d) ) ROM_LOAD32_WORD( "136102-0077", 0x400002, 0x200000, CRC(3283cea8) SHA1(fb7333ca951053a56c501f2ce0eb197c8fcafaf7) ) - ROM_REGION( 0x300000, "gfx1", 0 ) + ROM_REGION( 0x300000, "tiles", 0 ) ROM_LOAD( "136102-0050a.25n", 0x000000, 0x80000, CRC(66896e8f) SHA1(7675b24c15ca0608f11f2a7b8d70717adb10924c) ) /* playfield, planes 0-1 */ ROM_LOAD( "136102-0051a.27n", 0x100000, 0x80000, CRC(fb5b3e7b) SHA1(f43fe4b5c4bbea10da46b60c644f586fb391355d) ) /* playfield, planes 2-3 */ ROM_LOAD( "136102-0052a.28n", 0x200000, 0x80000, CRC(cbe38670) SHA1(0780e599007851f6d37cdd8c701d01cb1ae48b9d) ) /* playfield, planes 4-5 */ - ROM_REGION( 0x020000, "gfx2", 0 ) + ROM_REGION( 0x020000, "chars", 0 ) ROM_LOAD( "136102-0045a.23p", 0x000000, 0x20000, CRC(c8b39b1c) SHA1(836c0ccf96b2beccacf6d8ac23981fc2d1f09803) ) /* alphanumerics */ ROM_REGION16_BE( 0x2000000, "rle", 0 ) diff --git a/src/mame/atari/atarigt.h b/src/mame/atari/atarigt.h index 1b730010acc..5d35e8d5b51 100644 --- a/src/mame/atari/atarigt.h +++ b/src/mame/atari/atarigt.h @@ -14,11 +14,6 @@ #include "emupal.h" #include "tilemap.h" -#define CRAM_ENTRIES 0x4000 -#define TRAM_ENTRIES 0x4000 -#define MRAM_ENTRIES 0x8000 - -#define ADDRSEQ_COUNT 4 class atarigt_state : public atarigen_state { @@ -31,29 +26,29 @@ public: m_playfield_tilemap(*this, "playfield"), m_alpha_tilemap(*this, "alpha"), m_rle(*this, "rle"), + m_mo_command(*this, "mo_command"), + m_cage(*this, "cage"), m_service_io(*this, "SERVICE"), m_coin_io(*this, "COIN"), - m_fake_io(*this, "FAKE"), - m_mo_command(*this, "mo_command"), - m_cage(*this, "cage") + m_fake_io(*this, "FAKE") { } - void atarigt(machine_config &config); - void atarigt_stereo(machine_config &config); - void tmek(machine_config &config); - void primrage20(machine_config &config); - void primrage(machine_config &config); + void atarigt(machine_config &config) ATTR_COLD; + void atarigt_stereo(machine_config &config) ATTR_COLD; + void tmek(machine_config &config) ATTR_COLD; + void primrage20(machine_config &config) ATTR_COLD; + void primrage(machine_config &config) ATTR_COLD; - void init_primrage(); - void init_tmek(); + void init_primrage() ATTR_COLD; + void init_tmek() ATTR_COLD; protected: virtual void machine_start() override ATTR_COLD; virtual void video_start() override ATTR_COLD; private: + static inline constexpr unsigned ADDRSEQ_COUNT = 4; - bool m_is_primrage = false; required_device<palette_device> m_palette; memory_share_creator<uint16_t> m_colorram; @@ -63,34 +58,36 @@ private: required_device<tilemap_device> m_alpha_tilemap; required_device<atari_rle_objects_device> m_rle; + required_shared_ptr<uint32_t> m_mo_command; + required_device<atari_cage_device> m_cage; + optional_ioport m_service_io; optional_ioport m_coin_io; optional_ioport m_fake_io; + bool m_is_primrage = false; + bool m_scanline_int_state = false; bool m_video_int_state = false; bitmap_ind16 m_pf_bitmap; bitmap_ind16 m_an_bitmap; - uint8_t m_playfield_tile_bank = 0; - uint8_t m_playfield_color_bank = 0; - uint16_t m_playfield_xscroll = 0; - uint16_t m_playfield_yscroll = 0; - - uint32_t m_tram_checksum = 0; + uint8_t m_playfield_tile_bank = 0; + uint8_t m_playfield_color_bank = 0; + uint16_t m_playfield_xscroll = 0; + uint16_t m_playfield_yscroll = 0; - required_shared_ptr<uint32_t> m_mo_command; - required_device<atari_cage_device> m_cage; + uint32_t m_tram_checksum = 0; void (atarigt_state::*m_protection_w)(address_space &space, offs_t offset, uint16_t data); void (atarigt_state::*m_protection_r)(address_space &space, offs_t offset, uint16_t *data); bool m_ignore_writes = false; offs_t m_protaddr[ADDRSEQ_COUNT]{}; - uint8_t m_protmode = 0; - uint16_t m_protresult = 0; - std::unique_ptr<uint8_t[]> m_protdata; + uint8_t m_protmode = 0; + uint16_t m_protresult = 0; + std::unique_ptr<uint8_t []> m_protdata; INTERRUPT_GEN_MEMBER(scanline_int_gen); void video_int_write_line(int state); @@ -117,7 +114,7 @@ private: TILE_GET_INFO_MEMBER(get_alpha_tile_info); TILE_GET_INFO_MEMBER(get_playfield_tile_info); TILEMAP_MAPPER_MEMBER(playfield_scan); - uint32_t screen_update_atarigt(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void main_map(address_map &map) ATTR_COLD; void tmek_update_mode(offs_t offset); diff --git a/src/mame/atari/atarigt_v.cpp b/src/mame/atari/atarigt_v.cpp index 9914838914a..20e835083e6 100644 --- a/src/mame/atari/atarigt_v.cpp +++ b/src/mame/atari/atarigt_v.cpp @@ -32,9 +32,9 @@ * *************************************/ -#define RSHIFT 16 -#define GSHIFT 8 -#define BSHIFT 0 +static constexpr unsigned RSHIFT = 16; +static constexpr unsigned GSHIFT = 8; +static constexpr unsigned BSHIFT = 0; @@ -46,19 +46,19 @@ TILE_GET_INFO_MEMBER(atarigt_state::get_alpha_tile_info) { - uint16_t data = m_alpha_tilemap->basemem_read(tile_index); - int code = data & 0xfff; - int color = (data >> 12) & 0x0f; + uint16_t const data = m_alpha_tilemap->basemem_read(tile_index); + int const code = data & 0xfff; + int const color = (data >> 12) & 0x0f; tileinfo.set(1, code, color, 0); } TILE_GET_INFO_MEMBER(atarigt_state::get_playfield_tile_info) { - uint16_t data = m_playfield_tilemap->basemem_read(tile_index); - int code = (m_playfield_tile_bank << 12) | (data & 0xfff); - int color = (data >> 12) & 7; - tileinfo.set(0, code, color, (data >> 15) & 1); + uint16_t const data = m_playfield_tilemap->basemem_read(tile_index); + int const code = (m_playfield_tile_bank << 12) | (data & 0xfff); + int const color = (data >> 12) & 7; + tileinfo.set(0, code, color, BIT(data, 15)); } @@ -105,11 +105,9 @@ void atarigt_state::video_start() void atarigt_state::colorram_w(offs_t address, uint16_t data, uint16_t mem_mask) { - uint16_t olddata; - /* update the raw data */ address = (address & 0x7ffff) >> 1; - olddata = m_colorram[address]; + uint16_t const olddata = m_colorram[address]; COMBINE_DATA(&m_colorram[address]); /* update the TRAM checksum */ @@ -143,7 +141,7 @@ uint16_t atarigt_state::colorram_r(offs_t address) TIMER_DEVICE_CALLBACK_MEMBER(atarigt_state::scanline_update) { - int scanline = param; + int const scanline = param; /* keep in range */ int offset = ((scanline & ~7) << 3) + 48; @@ -154,11 +152,10 @@ TIMER_DEVICE_CALLBACK_MEMBER(atarigt_state::scanline_update) for (int i = 0; i < 8; i++) { uint16_t word = m_alpha_tilemap->basemem_read(offset++); - - if (word & 0x8000) + if (BIT(word, 15)) { - int newscroll = (word >> 5) & 0x3ff; - int newbank = (word >> 0) & 0x1f; + int const newscroll = (word >> 5) & 0x3ff; + int const newbank = (word >> 0) & 0x1f; if (newscroll != m_playfield_xscroll) { if (scanline + i > 0) @@ -176,10 +173,10 @@ TIMER_DEVICE_CALLBACK_MEMBER(atarigt_state::scanline_update) } word = m_alpha_tilemap->basemem_read(offset++); - if (word & 0x8000) + if (BIT(word, 15)) { - int newscroll = ((word >> 6) - (scanline + i)) & 0x1ff; - int newbank = word & 15; + int const newscroll = ((word >> 6) - (scanline + i)) & 0x1ff; + int const newbank = word & 15; if (newscroll != m_playfield_yscroll) { if (scanline + i > 0) @@ -482,7 +479,7 @@ PrimRage GALs: */ -uint32_t atarigt_state::screen_update_atarigt(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t atarigt_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { bitmap_ind16 &mo_bitmap = m_rle->vram(0); bitmap_ind16 &tm_bitmap = m_rle->vram(1); @@ -513,9 +510,9 @@ uint32_t atarigt_state::screen_update_atarigt(screen_device &screen, bitmap_rgb3 { for (int x = cliprect.left(); x <= cliprect.right(); x++) { - uint8_t pfpri = (pf[x] >> 10) & 7; - uint8_t mopri = mo[x] >> ATARIRLE_PRIORITY_SHIFT; - uint8_t mgep = (mopri >= pfpri) && !(pfpri & 4); + uint8_t const pfpri = (pf[x] >> 10) & 7; + uint8_t const mopri = mo[x] >> atari_rle_objects_device::PRIORITY_SHIFT; + uint8_t const mgep = (mopri >= pfpri) && !(pfpri & 4); /* compute CRA -- unlike T-Mek, MVID11 enforces MO priority and is ignored */ uint16_t cra; @@ -548,7 +545,7 @@ uint32_t atarigt_state::screen_update_atarigt(screen_device &screen, bitmap_rgb3 for (int x = cliprect.left(); x <= cliprect.right(); x++) { uint8_t const pfpri = (pf[x] >> 10) & 7; - uint8_t const mopri = mo[x] >> ATARIRLE_PRIORITY_SHIFT; + uint8_t const mopri = mo[x] >> atari_rle_objects_device::PRIORITY_SHIFT; uint8_t const mgep = (mopri >= pfpri) && !(pfpri & 4); /* compute CRA/TRA */ @@ -575,11 +572,11 @@ uint32_t atarigt_state::screen_update_atarigt(screen_device &screen, bitmap_rgb3 uint16_t const mra = (tm[x] & 0xe00) << 1; /* turn off CRA/TRA as appropriate */ - int no_tra = 0, no_cra = 0; + bool no_tra = false, no_cra = false; if (!(pf[x] & 0x1000) && (tra & 0x8000)) - no_cra = 1; + no_cra = true; if (!(!(cra & 0x8000) && (!(pf[x] & 0x1000) || !(pf[x] & 0x3f)))) - no_tra = 1; + no_tra = true; if (no_cra) cra = 0; if (no_tra) diff --git a/src/mame/atari/atarigx2.cpp b/src/mame/atari/atarigx2.cpp index 600802ece5a..19a001a939b 100644 --- a/src/mame/atari/atarigx2.cpp +++ b/src/mame/atari/atarigx2.cpp @@ -56,14 +56,14 @@ void atarigx2_state::video_int_ack_w(uint32_t data) uint32_t atarigx2_state::special_port2_r() { - int temp = ioport("SERVICE")->read(); + int const temp = m_io_service->read(); return (temp << 16) | temp; } uint32_t atarigx2_state::special_port3_r() { - int temp = ioport("SPECIAL")->read(); + int const temp = m_io_special->read(); return (temp << 16) | temp; } @@ -71,7 +71,7 @@ uint32_t atarigx2_state::special_port3_r() uint8_t atarigx2_state::a2d_data_r(offs_t offset) { - uint8_t result = m_adc->data_r(); + uint8_t const result = m_adc->data_r(); if (!machine().side_effects_disabled()) m_adc->address_offset_start_w(offset, 0); return result; @@ -102,7 +102,7 @@ void atarigx2_state::latch_w(offs_t offset, uint32_t data, uint32_t mem_mask) /* lower byte */ if (ACCESSING_BITS_16_23) - m_jsa->soundcpu().set_input_line(INPUT_LINE_RESET, (data & 0x100000) ? CLEAR_LINE : ASSERT_LINE); + m_jsa->soundcpu().set_input_line(INPUT_LINE_RESET, BIT(data, 20) ? CLEAR_LINE : ASSERT_LINE); } @@ -110,7 +110,7 @@ void atarigx2_state::mo_command_w(offs_t offset, uint32_t data, uint32_t mem_mas { COMBINE_DATA(m_mo_command); if (ACCESSING_BITS_0_15) - m_rle->command_write(((data & 0xffff) == 2) ? ATARIRLE_COMMAND_CHECKSUM : ATARIRLE_COMMAND_DRAW); + m_rle->command_write(((data & 0xffff) == 2) ? atari_rle_objects_device::COMMAND_CHECKSUM : atari_rle_objects_device::COMMAND_DRAW); } @@ -126,7 +126,7 @@ void atarigx2_state::mo_command_w(offs_t offset, uint32_t data, uint32_t mem_mas void atarigx2_state::atarigx2_protection_w(offs_t offset, uint32_t data, uint32_t mem_mask) { { - int pc = m_maincpu->pcbase(); + int const pc = m_maincpu->pcbase(); // if (pc == 0x11cbe || pc == 0x11c30) // logerror("%06X:Protection W@%04X = %04X (result to %06X)\n", pc, offset, data, m_maincpu->state_int(M68K_A2)); // else @@ -1137,7 +1137,7 @@ uint32_t atarigx2_state::atarigx2_protection_r(offs_t offset, uint32_t mem_mask) result |= 0x80000000; if (offset == 0x3f0) { - uint32_t tag = (m_last_write_offset << 17) | m_last_write; + uint32_t const tag = (m_last_write_offset << 17) | m_last_write; int i = 0; while (lookup_table[i][0] != 0xffffffff) @@ -1156,14 +1156,18 @@ uint32_t atarigx2_state::atarigx2_protection_r(offs_t offset, uint32_t mem_mask) result = machine().rand() << 16; else result = 0xffff << 16; - logerror("%06X:Unhandled protection R@%04X = %04X\n", m_maincpu->pcbase(), offset, result); + if (!machine().side_effects_disabled()) + logerror("%06X:Unhandled protection R@%04X = %04X\n", m_maincpu->pcbase(), offset, result); } } - if (ACCESSING_BITS_16_31) - logerror("%06X:Protection R@%04X = %04X\n", m_maincpu->pcbase(), offset * 4, result >> 16); - else - logerror("%06X:Protection R@%04X = %04X\n", m_maincpu->pcbase(), offset * 4 + 2, result); + if (!machine().side_effects_disabled()) + { + if (ACCESSING_BITS_16_31) + logerror("%06X:Protection R@%04X = %04X\n", m_maincpu->pcbase(), offset * 4, result >> 16); + else + logerror("%06X:Protection R@%04X = %04X\n", m_maincpu->pcbase(), offset * 4 + 2, result); + } return result; } @@ -1194,7 +1198,7 @@ void atarigx2_state::main_map(address_map &map) map(0xd77000, 0xd77fff).ram(); map(0xd78000, 0xd78fff).ram().share("rle"); map(0xd79000, 0xd7a1ff).ram(); - map(0xd7a200, 0xd7a203).ram().w(FUNC(atarigx2_state::mo_command_w)).share("mo_command"); + map(0xd7a200, 0xd7a203).ram().w(FUNC(atarigx2_state::mo_command_w)).share(m_mo_command); map(0xd7a204, 0xd7ffff).ram(); map(0xd80000, 0xd9ffff).w("eeprom", FUNC(eeprom_parallel_28xx_device::unlock_write32)); map(0xe06000, 0xe06000).w(m_jsa, FUNC(atari_jsa_iiis_device::main_command_w)); @@ -1423,21 +1427,10 @@ static const gfx_layout pftoplayout = 16*8 }; -static const gfx_layout anlayout = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { 0, 1, 2, 3 }, - { 0, 4, 8, 12, 16, 20, 24, 28 }, - { 0*8, 4*8, 8*8, 12*8, 16*8, 20*8, 24*8, 28*8 }, - 32*8 -}; - static GFXDECODE_START( gfx_atarigx2 ) - GFXDECODE_ENTRY( "gfx1", 0, pflayout, 0x000, 64 ) - GFXDECODE_ENTRY( "gfx2", 0, anlayout, 0x000, 16 ) - GFXDECODE_ENTRY( "gfx1", 0, pftoplayout, 0x000, 64 ) + GFXDECODE_ENTRY( "tiles", 0, pflayout, 0x000, 64 ) + GFXDECODE_ENTRY( "chars", 0, gfx_8x8x4_packed_msb, 0x000, 16 ) + GFXDECODE_ENTRY( "tiles", 0, pftoplayout, 0x000, 64 ) GFXDECODE_END static const atari_rle_objects_config modesc_0x200 = @@ -1516,7 +1509,7 @@ void atarigx2_state::atarigx2(machine_config &config) /* note: these parameters are from published specs, not derived */ /* the board uses a pair of GALs to determine H and V parameters */ m_screen->set_raw(14.318181_MHz_XTAL/2, 456, 0, 336, 262, 0, 240); - m_screen->set_screen_update(FUNC(atarigx2_state::screen_update_atarigx2)); + m_screen->set_screen_update(FUNC(atarigx2_state::screen_update)); m_screen->set_palette("palette"); m_screen->screen_vblank().set_inputline(m_maincpu, M68K_IRQ_4, ASSERT_LINE); @@ -1563,12 +1556,12 @@ ROM_START( spclords ) ROM_REGION( 0x10000, "jsa:cpu", 0 ) /* 64k for 6502 code */ ROM_LOAD( "136095.80a", 0x00000, 0x10000, CRC(33bc0ede) SHA1(2ee30d9125057cdfbdb83e4dbf28306c35a9c233) ) - ROM_REGION( 0x60000, "gfx1", 0 ) + ROM_REGION( 0x60000, "tiles", 0 ) ROM_LOAD( "136095.30a", 0x00000, 0x20000, CRC(27e0cfec) SHA1(03df57757d091f9a0b8c8d98d091dd759f570788) ) /* playfield, planes 0-1 */ ROM_LOAD( "136095.31a", 0x20000, 0x20000, CRC(5529cdc7) SHA1(8aff8a42fb2a86b7e4666940da4c1ee19dab6281) ) /* playfield, planes 2-3 */ ROM_FILL( 0x40000, 0x20000, 0x00 ) /* playfield, planes 4-5 */ - ROM_REGION( 0x020000, "gfx2", 0 ) + ROM_REGION( 0x020000, "chars", 0 ) ROM_LOAD( "136095.25a", 0x000000, 0x20000, CRC(1669496e) SHA1(005deaafd6156505e3a27966123e58928837ad9f) ) /* alphanumerics */ ROM_REGION16_BE( 0x600000, "rle", 0 ) @@ -1608,12 +1601,12 @@ ROM_START( spclordsb ) ROM_REGION( 0x10000, "jsa:cpu", 0 ) /* 64k for 6502 code */ ROM_LOAD( "136095.80a", 0x00000, 0x10000, CRC(33bc0ede) SHA1(2ee30d9125057cdfbdb83e4dbf28306c35a9c233) ) - ROM_REGION( 0x60000, "gfx1", 0 ) + ROM_REGION( 0x60000, "tiles", 0 ) ROM_LOAD( "136095.30a", 0x00000, 0x20000, CRC(27e0cfec) SHA1(03df57757d091f9a0b8c8d98d091dd759f570788) ) /* playfield, planes 0-1 */ ROM_LOAD( "136095.31a", 0x20000, 0x20000, CRC(5529cdc7) SHA1(8aff8a42fb2a86b7e4666940da4c1ee19dab6281) ) /* playfield, planes 2-3 */ ROM_FILL( 0x40000, 0x20000, 0x00 ) /* playfield, planes 4-5 */ - ROM_REGION( 0x020000, "gfx2", 0 ) + ROM_REGION( 0x020000, "chars", 0 ) ROM_LOAD( "136095.25a", 0x000000, 0x20000, CRC(1669496e) SHA1(005deaafd6156505e3a27966123e58928837ad9f) ) /* alphanumerics */ ROM_REGION16_BE( 0x600000, "rle", 0 ) @@ -1653,12 +1646,12 @@ ROM_START( spclordsg ) ROM_REGION( 0x10000, "jsa:cpu", 0 ) /* 64k for 6502 code */ ROM_LOAD( "136095.80a", 0x00000, 0x10000, CRC(33bc0ede) SHA1(2ee30d9125057cdfbdb83e4dbf28306c35a9c233) ) - ROM_REGION( 0x60000, "gfx1", 0 ) + ROM_REGION( 0x60000, "tiles", 0 ) ROM_LOAD( "136095.30a", 0x00000, 0x20000, CRC(27e0cfec) SHA1(03df57757d091f9a0b8c8d98d091dd759f570788) ) /* playfield, planes 0-1 */ ROM_LOAD( "136095.31a", 0x20000, 0x20000, CRC(5529cdc7) SHA1(8aff8a42fb2a86b7e4666940da4c1ee19dab6281) ) /* playfield, planes 2-3 */ ROM_FILL( 0x40000, 0x20000, 0x00 ) /* playfield, planes 4-5 */ - ROM_REGION( 0x020000, "gfx2", 0 ) + ROM_REGION( 0x020000, "chars", 0 ) ROM_LOAD( "136095.25a", 0x000000, 0x20000, CRC(1669496e) SHA1(005deaafd6156505e3a27966123e58928837ad9f) ) /* alphanumerics */ ROM_REGION16_BE( 0x600000, "rle", 0 ) @@ -1698,12 +1691,12 @@ ROM_START( spclordsa ) ROM_REGION( 0x10000, "jsa:cpu", 0 ) /* 64k for 6502 code */ ROM_LOAD( "136095.80a", 0x00000, 0x10000, CRC(33bc0ede) SHA1(2ee30d9125057cdfbdb83e4dbf28306c35a9c233) ) - ROM_REGION( 0x60000, "gfx1", 0 ) + ROM_REGION( 0x60000, "tiles", 0 ) ROM_LOAD( "136095.30a", 0x00000, 0x20000, CRC(27e0cfec) SHA1(03df57757d091f9a0b8c8d98d091dd759f570788) ) /* playfield, planes 0-1 */ ROM_LOAD( "136095.31a", 0x20000, 0x20000, CRC(5529cdc7) SHA1(8aff8a42fb2a86b7e4666940da4c1ee19dab6281) ) /* playfield, planes 2-3 */ ROM_FILL( 0x40000, 0x20000, 0x00 ) /* playfield, planes 4-5 */ - ROM_REGION( 0x020000, "gfx2", 0 ) + ROM_REGION( 0x020000, "chars", 0 ) ROM_LOAD( "136095.25a", 0x000000, 0x20000, CRC(1669496e) SHA1(005deaafd6156505e3a27966123e58928837ad9f) ) /* alphanumerics */ ROM_REGION16_BE( 0x600000, "rle", 0 ) @@ -1743,12 +1736,12 @@ ROM_START( motofren ) ROM_REGION( 0x10000, "jsa:cpu", 0 ) /* 64k for 6502 code */ ROM_LOAD( "136094-0080a.12c", 0x00000, 0x10000, CRC(0b1e565c) SHA1(03bdeafd8cf680f76bbd1f9aba6efac27f19a93c) ) - ROM_REGION( 0x180000, "gfx1", 0 ) + ROM_REGION( 0x180000, "tiles", 0 ) ROM_LOAD( "136094-0036a.2d", 0x000000, 0x80000, CRC(1b63b493) SHA1(980141fec011fa2b5cb020eeecb4784d31679dba) ) /* playfield, planes 0-1 */ ROM_LOAD( "136094-0037a.5d", 0x080000, 0x80000, CRC(6d290056) SHA1(fa32dbe5ac5e735d700d086353461eaa2c1dee55) ) /* playfield, planes 2-3 */ ROM_LOAD( "136094-0038a.8d", 0x100000, 0x80000, CRC(38197c88) SHA1(dc5d4d878759503b8500e8e3a032f499bfeedcb1) ) /* playfield, planes 4-5 */ - ROM_REGION( 0x020000, "gfx2", 0 ) + ROM_REGION( 0x020000, "chars", 0 ) ROM_LOAD( "136094-0025a.13n", 0x000000, 0x20000, CRC(6ab762ad) SHA1(c52dd207ff5adaffa458e020e7d452a1d1e65194) ) /* alphanumerics */ ROM_REGION16_BE( 0x700000, "rle", 0 ) @@ -1790,12 +1783,12 @@ ROM_START( motofrenmd ) ROM_REGION( 0x10000, "jsa:cpu", 0 ) /* 64k for 6502 code */ ROM_LOAD( "136094-0080b.12c", 0x00000, 0x10000, CRC(5e542608) SHA1(8a10b5fac6ac120c7aae2edaa12413c9b8345d87) ) - ROM_REGION( 0x180000, "gfx1", 0 ) /* Although verified, the manual states the label codes as 136094-0030 through 136094-0032 */ + ROM_REGION( 0x180000, "tiles", 0 ) /* Although verified, the manual states the label codes as 136094-0030 through 136094-0032 */ ROM_LOAD( "136094-0036a.2d", 0x000000, 0x80000, CRC(1b63b493) SHA1(980141fec011fa2b5cb020eeecb4784d31679dba) ) /* playfield, planes 0-1 */ ROM_LOAD( "136094-0037a.5d", 0x080000, 0x80000, CRC(6d290056) SHA1(fa32dbe5ac5e735d700d086353461eaa2c1dee55) ) /* playfield, planes 2-3 */ ROM_LOAD( "136094-0038a.8d", 0x100000, 0x80000, CRC(38197c88) SHA1(dc5d4d878759503b8500e8e3a032f499bfeedcb1) ) /* playfield, planes 4-5 */ - ROM_REGION( 0x020000, "gfx2", 0 ) + ROM_REGION( 0x020000, "chars", 0 ) ROM_LOAD( "136094-0025a.13n", 0x000000, 0x20000, CRC(6ab762ad) SHA1(c52dd207ff5adaffa458e020e7d452a1d1e65194) ) /* alphanumerics */ ROM_REGION16_BE( 0x700000, "rle", 0 ) @@ -1841,12 +1834,12 @@ ROM_START( motofrei ) ROM_REGION( 0x10000, "jsa:cpu", 0 ) /* 64k for 6502 code */ ROM_LOAD( "136094-0080a.12c", 0x00000, 0x10000, CRC(0b1e565c) SHA1(03bdeafd8cf680f76bbd1f9aba6efac27f19a93c) ) - ROM_REGION( 0x180000, "gfx1", 0 ) + ROM_REGION( 0x180000, "tiles", 0 ) ROM_LOAD( "136094-0036a.2d", 0x000000, 0x80000, CRC(1b63b493) SHA1(980141fec011fa2b5cb020eeecb4784d31679dba) ) /* playfield, planes 0-1 */ ROM_LOAD( "136094-0037a.5d", 0x080000, 0x80000, CRC(6d290056) SHA1(fa32dbe5ac5e735d700d086353461eaa2c1dee55) ) /* playfield, planes 2-3 */ ROM_LOAD( "136094-0038a.8d", 0x100000, 0x80000, CRC(38197c88) SHA1(dc5d4d878759503b8500e8e3a032f499bfeedcb1) ) /* playfield, planes 4-5 */ - ROM_REGION( 0x020000, "gfx2", 0 ) + ROM_REGION( 0x020000, "chars", 0 ) ROM_LOAD( "136094-0025a.13n", 0x000000, 0x20000, CRC(6ab762ad) SHA1(c52dd207ff5adaffa458e020e7d452a1d1e65194) ) /* alphanumerics */ ROM_REGION16_BE( 0x700000, "rle", 0 ) @@ -1889,12 +1882,12 @@ ROM_START( motofreg ) ROM_REGION( 0x10000, "jsa:cpu", 0 ) /* 64k for 6502 code */ ROM_LOAD( "136094-0080a.12c", 0x00000, 0x10000, CRC(0b1e565c) SHA1(03bdeafd8cf680f76bbd1f9aba6efac27f19a93c) ) - ROM_REGION( 0x180000, "gfx1", 0 ) + ROM_REGION( 0x180000, "tiles", 0 ) ROM_LOAD( "136094-0036a.2d", 0x000000, 0x80000, CRC(1b63b493) SHA1(980141fec011fa2b5cb020eeecb4784d31679dba) ) /* playfield, planes 0-1 */ ROM_LOAD( "136094-0037a.5d", 0x080000, 0x80000, CRC(6d290056) SHA1(fa32dbe5ac5e735d700d086353461eaa2c1dee55) ) /* playfield, planes 2-3 */ ROM_LOAD( "136094-0038a.8d", 0x100000, 0x80000, CRC(38197c88) SHA1(dc5d4d878759503b8500e8e3a032f499bfeedcb1) ) /* playfield, planes 4-5 */ - ROM_REGION( 0x020000, "gfx2", 0 ) + ROM_REGION( 0x020000, "chars", 0 ) ROM_LOAD( "136094-0025a.13n", 0x000000, 0x20000, CRC(6ab762ad) SHA1(c52dd207ff5adaffa458e020e7d452a1d1e65194) ) /* alphanumerics */ ROM_REGION16_BE( 0x700000, "rle", 0 ) @@ -1937,12 +1930,12 @@ ROM_START( motofmdg ) ROM_REGION( 0x10000, "jsa:cpu", 0 ) /* 64k for 6502 code */ ROM_LOAD( "136094-0080a.12c", 0x00000, 0x10000, CRC(0b1e565c) SHA1(03bdeafd8cf680f76bbd1f9aba6efac27f19a93c) ) - ROM_REGION( 0x180000, "gfx1", 0 ) + ROM_REGION( 0x180000, "tiles", 0 ) ROM_LOAD( "136094-0036a.2d", 0x000000, 0x80000, CRC(1b63b493) SHA1(980141fec011fa2b5cb020eeecb4784d31679dba) ) /* playfield, planes 0-1 */ ROM_LOAD( "136094-0037a.5d", 0x080000, 0x80000, CRC(6d290056) SHA1(fa32dbe5ac5e735d700d086353461eaa2c1dee55) ) /* playfield, planes 2-3 */ ROM_LOAD( "136094-0038a.8d", 0x100000, 0x80000, CRC(38197c88) SHA1(dc5d4d878759503b8500e8e3a032f499bfeedcb1) ) /* playfield, planes 4-5 */ - ROM_REGION( 0x020000, "gfx2", 0 ) + ROM_REGION( 0x020000, "chars", 0 ) ROM_LOAD( "136094-0025a.13n", 0x000000, 0x20000, CRC(6ab762ad) SHA1(c52dd207ff5adaffa458e020e7d452a1d1e65194) ) /* alphanumerics */ ROM_REGION16_BE( 0x700000, "rle", 0 ) @@ -1984,12 +1977,12 @@ ROM_START( motofrenft ) ROM_REGION( 0x10000, "jsa:cpu", 0 ) /* 64k for 6502 code */ ROM_LOAD( "136094-0080a.12c", 0x00000, 0x10000, CRC(0b1e565c) SHA1(03bdeafd8cf680f76bbd1f9aba6efac27f19a93c) ) - ROM_REGION( 0x180000, "gfx1", 0 ) + ROM_REGION( 0x180000, "tiles", 0 ) ROM_LOAD( "136094-0036a.2d", 0x000000, 0x80000, CRC(1b63b493) SHA1(980141fec011fa2b5cb020eeecb4784d31679dba) ) /* playfield, planes 0-1 */ ROM_LOAD( "136094-0037a.5d", 0x080000, 0x80000, CRC(6d290056) SHA1(fa32dbe5ac5e735d700d086353461eaa2c1dee55) ) /* playfield, planes 2-3 */ ROM_LOAD( "136094-0038a.8d", 0x100000, 0x80000, CRC(38197c88) SHA1(dc5d4d878759503b8500e8e3a032f499bfeedcb1) ) /* playfield, planes 4-5 */ - ROM_REGION( 0x020000, "gfx2", 0 ) + ROM_REGION( 0x020000, "chars", 0 ) ROM_LOAD( "136094-0025a.13n", 0x000000, 0x20000, CRC(6ab762ad) SHA1(c52dd207ff5adaffa458e020e7d452a1d1e65194) ) /* alphanumerics */ ROM_REGION16_BE( 0x700000, "rle", 0 ) @@ -2031,12 +2024,12 @@ ROM_START( motofrenmf ) ROM_REGION( 0x10000, "jsa:cpu", 0 ) /* 64k for 6502 code */ ROM_LOAD( "136094-0080a.12c", 0x00000, 0x10000, CRC(0b1e565c) SHA1(03bdeafd8cf680f76bbd1f9aba6efac27f19a93c) ) - ROM_REGION( 0x180000, "gfx1", 0 ) + ROM_REGION( 0x180000, "tiles", 0 ) ROM_LOAD( "136094-0036a.2d", 0x000000, 0x80000, CRC(1b63b493) SHA1(980141fec011fa2b5cb020eeecb4784d31679dba) ) /* playfield, planes 0-1 */ ROM_LOAD( "136094-0037a.5d", 0x080000, 0x80000, CRC(6d290056) SHA1(fa32dbe5ac5e735d700d086353461eaa2c1dee55) ) /* playfield, planes 2-3 */ ROM_LOAD( "136094-0038a.8d", 0x100000, 0x80000, CRC(38197c88) SHA1(dc5d4d878759503b8500e8e3a032f499bfeedcb1) ) /* playfield, planes 4-5 */ - ROM_REGION( 0x020000, "gfx2", 0 ) + ROM_REGION( 0x020000, "chars", 0 ) ROM_LOAD( "136094-0025a.13n", 0x000000, 0x20000, CRC(6ab762ad) SHA1(c52dd207ff5adaffa458e020e7d452a1d1e65194) ) /* alphanumerics */ ROM_REGION16_BE( 0x700000, "rle", 0 ) @@ -2075,12 +2068,12 @@ ROM_START( rrreveng ) ROM_LOAD32_BYTE( "revenge.37e", 0x00002, 0x20000, CRC(b5e2a3e2) SHA1(b6ad6d03120ad6699af31d09474b82979ead65bb) ) ROM_LOAD32_BYTE( "revenge.37j", 0x00003, 0x20000, CRC(6c7f114b) SHA1(2b9a627ec0a211da8080ea33a5486367b043952a) ) - ROM_REGION( 0x180000, "gfx1", 0 ) + ROM_REGION( 0x180000, "tiles", 0 ) ROM_LOAD( "rralpl.2d", 0x000000, 0x80000, CRC(00488dad) SHA1(604f08a219db0438dcbf21337ebd497f353bd812) ) /* playfield, planes 0-1 */ ROM_LOAD( "rralpm.5d", 0x080000, 0x80000, CRC(ade27447) SHA1(641fdca97a4b08251e111425d8467e4640433df7) ) /* playfield, planes 2-3 */ ROM_LOAD( "rralph.8d", 0x100000, 0x80000, CRC(ef04f04e) SHA1(e518133096978c4a0152253231625c385a84530f) ) /* playfield, planes 4-5 */ - ROM_REGION( 0x020000, "gfx2", 0 ) + ROM_REGION( 0x020000, "chars", 0 ) ROM_LOAD( "alpha.13n", 0x000000, 0x20000, CRC(f2efbd66) SHA1(d5339f0b3de7a102d659f7459b5f4800cab31829) ) /* alphanumerics */ ROM_REGION16_BE( 0x500000, "rle", 0 ) @@ -2139,12 +2132,12 @@ ROM_START( rrrevenga ) /* Same program roms as the set below, but shares more ro ROM_REGION( 0x10000, "jsa:cpu", 0 ) /* 64k for 6502 code */ ROM_LOAD( "rr65snd.bin", 0x00000, 0x10000, CRC(d78429da) SHA1(a4d36d74986f08c793f15f2e67cb97a8c91c5e90) ) - ROM_REGION( 0x180000, "gfx1", 0 ) + ROM_REGION( 0x180000, "tiles", 0 ) ROM_LOAD( "rralpl.2d", 0x000000, 0x80000, CRC(00488dad) SHA1(604f08a219db0438dcbf21337ebd497f353bd812) ) /* playfield, planes 0-1 */ ROM_LOAD( "rralpm.5d", 0x080000, 0x80000, CRC(ade27447) SHA1(641fdca97a4b08251e111425d8467e4640433df7) ) /* playfield, planes 2-3 */ ROM_LOAD( "rralph.8d", 0x100000, 0x80000, CRC(ef04f04e) SHA1(e518133096978c4a0152253231625c385a84530f) ) /* playfield, planes 4-5 */ - ROM_REGION( 0x020000, "gfx2", 0 ) + ROM_REGION( 0x020000, "chars", 0 ) ROM_LOAD( "alpha.13n", 0x000000, 0x20000, CRC(f2efbd66) SHA1(d5339f0b3de7a102d659f7459b5f4800cab31829) ) /* alphanumerics */ ROM_REGION16_BE( 0x500000, "rle", 0 ) @@ -2198,12 +2191,12 @@ ROM_START( rrrevengb ) ROM_REGION( 0x10000, "jsa:cpu", 0 ) /* 64k for 6502 code */ ROM_LOAD( "rr65snd.bin", 0x00000, 0x10000, CRC(d78429da) SHA1(a4d36d74986f08c793f15f2e67cb97a8c91c5e90) ) - ROM_REGION( 0x180000, "gfx1", 0 ) + ROM_REGION( 0x180000, "tiles", 0 ) ROM_LOAD( "rralpl.2d", 0x000000, 0x80000, CRC(00488dad) SHA1(604f08a219db0438dcbf21337ebd497f353bd812) ) /* playfield, planes 0-1 */ ROM_LOAD( "rralpm.5d", 0x080000, 0x80000, CRC(ade27447) SHA1(641fdca97a4b08251e111425d8467e4640433df7) ) /* playfield, planes 2-3 */ ROM_LOAD( "rralph.8d", 0x100000, 0x80000, CRC(ef04f04e) SHA1(e518133096978c4a0152253231625c385a84530f) ) /* playfield, planes 4-5 */ - ROM_REGION( 0x020000, "gfx2", 0 ) + ROM_REGION( 0x020000, "chars", 0 ) ROM_LOAD( "rralalph.13n", 0x000000, 0x20000, CRC(7ca93790) SHA1(5e2f069be4b15d63f418c8693e8550eb0ae22381) ) /* alphanumerics */ ROM_REGION16_BE( 0x500000, "rle", 0 ) diff --git a/src/mame/atari/atarigx2.h b/src/mame/atari/atarigx2.h index a62b85e681b..b97128386f8 100644 --- a/src/mame/atari/atarigx2.h +++ b/src/mame/atari/atarigx2.h @@ -31,6 +31,8 @@ public: , m_alpha_tilemap(*this, "alpha") , m_rle(*this, "rle") , m_adc(*this, "adc") + , m_io_service(*this, "SERVICE") + , m_io_special(*this, "SPECIAL") { } void init_spclords(); @@ -54,15 +56,13 @@ protected: TILE_GET_INFO_MEMBER(get_alpha_tile_info); TILE_GET_INFO_MEMBER(get_playfield_tile_info); TILEMAP_MAPPER_MEMBER(atarigx2_playfield_scan); - uint32_t screen_update_atarigx2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void atarigx2_mo_control_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); void atarigx2(machine_config &config); void main_map(address_map &map) ATTR_COLD; private: - uint16_t m_playfield_base = 0U; - required_device<atari_jsa_iiis_device> m_jsa; optional_device<atari_xga_device> m_xga; @@ -74,6 +74,11 @@ private: required_device<adc0808_device> m_adc; + optional_ioport m_io_service; + optional_ioport m_io_special; + + uint16_t m_playfield_base = 0U; + uint16_t m_current_control = 0U; uint8_t m_playfield_tile_bank = 0U; uint8_t m_playfield_color_bank = 0U; diff --git a/src/mame/atari/atarigx2_v.cpp b/src/mame/atari/atarigx2_v.cpp index f06bbb8c4bc..0a205c098bd 100644 --- a/src/mame/atari/atarigx2_v.cpp +++ b/src/mame/atari/atarigx2_v.cpp @@ -16,7 +16,7 @@ Upper bits come from the low 5 bits of the HSCROLL value in alpha RAM Playfield bank comes from low 2 bits of the VSCROLL value in alpha RAM - For GX2, there are 4 bits of bank1 + For GX2, there are 4 bits of bank ****************************************************************************/ @@ -35,27 +35,27 @@ TILE_GET_INFO_MEMBER(atarigx2_state::get_alpha_tile_info) { - uint16_t data = m_alpha_tilemap->basemem_read(tile_index); - int code = data & 0xfff; - int color = (data >> 12) & 0x0f; - int opaque = data & 0x8000; + uint16_t const data = m_alpha_tilemap->basemem_read(tile_index); + int const code = data & 0xfff; + int const color = (data >> 12) & 0x0f; + bool const opaque = BIT(data, 15); tileinfo.set(1, code, color, opaque ? TILE_FORCE_LAYER0 : 0); } TILE_GET_INFO_MEMBER(atarigx2_state::get_playfield_tile_info) { - uint16_t data = m_playfield_tilemap->basemem_read(tile_index); - int code = (m_playfield_tile_bank << 12) | (data & 0xfff); - int color = (m_playfield_base >> 5) + ((m_playfield_color_bank << 3) & 0x18) + ((data >> 12) & 7); - tileinfo.set(0, code, color, (data >> 15) & 1); + uint16_t const data = m_playfield_tilemap->basemem_read(tile_index); + int const code = (m_playfield_tile_bank << 12) | (data & 0xfff); + int const color = (m_playfield_base >> 5) + ((m_playfield_color_bank << 3) & 0x18) + ((data >> 12) & 7); + tileinfo.set(0, code, color, BIT(data, 15)); tileinfo.category = (m_playfield_color_bank >> 2) & 7; } TILEMAP_MAPPER_MEMBER(atarigx2_state::atarigx2_playfield_scan) { - int bank = 1 - (col / (num_cols / 2)); + int const bank = 1 - (col / (num_cols / 2)); return bank * (num_rows * num_cols / 2) + row * (num_cols / 2) + (col % (num_cols / 2)); } @@ -99,7 +99,7 @@ void atarigx2_state::atarigx2_mo_control_w(offs_t offset, uint16_t data, uint16_ TIMER_DEVICE_CALLBACK_MEMBER(atarigx2_state::scanline_update) { - int scanline = param; + int const scanline = param; if (scanline == 0) logerror("-------\n"); @@ -112,11 +112,10 @@ TIMER_DEVICE_CALLBACK_MEMBER(atarigx2_state::scanline_update) for (int i = 0; i < 8; i++) { uint16_t word = m_alpha_tilemap->basemem_read(offset++); - - if (word & 0x8000) + if (BIT(word, 15)) { - int newscroll = (word >> 5) & 0x3ff; - int newbank = (word >> 0) & 0x1f; + int const newscroll = (word >> 5) & 0x3ff; + int const newbank = (word >> 0) & 0x1f; if (newscroll != m_playfield_xscroll) { if (scanline + i > 0) @@ -134,10 +133,10 @@ TIMER_DEVICE_CALLBACK_MEMBER(atarigx2_state::scanline_update) } word = m_alpha_tilemap->basemem_read(offset++); - if (word & 0x8000) + if (BIT(word, 15)) { - int newscroll = ((word >> 6) - (scanline + i)) & 0x1ff; - int newbank = word & 15; + int const newscroll = ((word >> 6) - (scanline + i)) & 0x1ff; + int const newbank = word & 15; if (newscroll != m_playfield_yscroll) { if (scanline + i > 0) @@ -164,7 +163,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(atarigx2_state::scanline_update) * *************************************/ -uint32_t atarigx2_state::screen_update_atarigx2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t atarigx2_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bitmap_ind8 &priority_bitmap = screen.priority(); @@ -194,8 +193,8 @@ uint32_t atarigx2_state::screen_update_atarigx2(screen_device &screen, bitmap_in uint16_t const *const mo = &mo_bitmap.pix(y); uint8_t const *const pri = &priority_bitmap.pix(y); for (int x = left; x < right; x++) - if (mo[x] && (mo[x] >> ATARIRLE_PRIORITY_SHIFT) >= pri[x]) - pf[x] = mo[x] & ATARIRLE_DATA_MASK; + if (mo[x] && (mo[x] >> atari_rle_objects_device::PRIORITY_SHIFT) >= pri[x]) + pf[x] = mo[x] & atari_rle_objects_device::DATA_MASK; } } diff --git a/src/mame/atari/atarirle.cpp b/src/mame/atari/atarirle.cpp index 4db45368632..272019dfb1f 100644 --- a/src/mame/atari/atarirle.cpp +++ b/src/mame/atari/atarirle.cpp @@ -85,16 +85,16 @@ void atari_rle_objects_device::control_write(u8 data) //logerror("atarirle_control_w(%d)\n", bits); // do nothing if nothing changed - int oldbits = m_control_bits; + int const oldbits = m_control_bits; if (oldbits == data) return; // force a partial update first - int scanline = screen().vpos(); + int const scanline = screen().vpos(); screen().update_partial(scanline); // if the erase flag was set, erase the front map - if ((oldbits & ATARIRLE_CONTROL_ERASE) != 0) + if ((oldbits & CONTROL_ERASE) != 0) { // compute the top and bottom of the rect rectangle cliprect(m_cliprect); @@ -102,23 +102,23 @@ void atari_rle_objects_device::control_write(u8 data) (std::max)(cliprect.top(), m_partial_scanline + 1), (std::min)(cliprect.bottom(), scanline)); - //logerror(" partial erase %d-%d (frame %d)\n", cliprect.top(), cliprect.bottom(), (oldbits & ATARIRLE_CONTROL_FRAME) >> 2); + //logerror(" partial erase %d-%d (frame %d)\n", cliprect.top(), cliprect.bottom(), (oldbits & CONTROL_FRAME) >> 2); // erase the bitmap - m_vram[0][(oldbits & ATARIRLE_CONTROL_FRAME) >> 2].fill(0, cliprect); + m_vram[0][(oldbits & CONTROL_FRAME) >> 2].fill(0, cliprect); if (m_vrammask.mask() != 0) - m_vram[1][(oldbits & ATARIRLE_CONTROL_FRAME) >> 2].fill(0, cliprect); + m_vram[1][(oldbits & CONTROL_FRAME) >> 2].fill(0, cliprect); } // update the bits m_control_bits = data; // if mogo is set, do a render on the rising edge - if ((oldbits & ATARIRLE_CONTROL_MOGO) == 0 && (data & ATARIRLE_CONTROL_MOGO) != 0) + if ((oldbits & CONTROL_MOGO) == 0 && (data & CONTROL_MOGO) != 0) { - if (m_command == ATARIRLE_COMMAND_DRAW) + if (m_command == COMMAND_DRAW) sort_and_render(); - else if (m_command == ATARIRLE_COMMAND_CHECKSUM) + else if (m_command == COMMAND_CHECKSUM) compute_checksum(); } @@ -147,18 +147,18 @@ void atari_rle_objects_device::vblank_callback(screen_device &screen, bool state // on the rising edge, if the erase flag is set, erase to the end of the screen if (state) { - if (m_control_bits & ATARIRLE_CONTROL_ERASE) + if (m_control_bits & CONTROL_ERASE) { // compute top only; bottom is equal to visible_area rectangle cliprect = m_cliprect; cliprect.sety((std::max)(cliprect.top(), m_partial_scanline + 1), cliprect.bottom()); - //logerror(" partial erase %d-%d (frame %d)\n", cliprect.top(), cliprect.bottom(), (m_control_bits & ATARIRLE_CONTROL_FRAME) >> 2); + //logerror(" partial erase %d-%d (frame %d)\n", cliprect.top(), cliprect.bottom(), (m_control_bits & CONTROL_FRAME) >> 2); // erase the bitmap - m_vram[0][(m_control_bits & ATARIRLE_CONTROL_FRAME) >> 2].fill(0, cliprect); + m_vram[0][(m_control_bits & CONTROL_FRAME) >> 2].fill(0, cliprect); if (m_vrammask.mask() != 0) - m_vram[1][(m_control_bits & ATARIRLE_CONTROL_FRAME) >> 2].fill(0, cliprect); + m_vram[1][(m_control_bits & CONTROL_FRAME) >> 2].fill(0, cliprect); } // reset the partial scanline to -1 so we can detect full updates @@ -331,8 +331,8 @@ int atari_rle_objects_device::count_objects() int lowest_address = m_rombase.length(); for (int objoffset = 0; objoffset < lowest_address; objoffset += 4) { - int offset = ((m_rombase[objoffset + 2] & 0xff) << 16) | m_rombase[objoffset + 3]; -//logerror("count_objects: objoffset=%d offset=%08X\n", objoffset, offset); + int const offset = ((m_rombase[objoffset + 2] & 0xff) << 16) | m_rombase[objoffset + 3]; + //logerror("count_objects: objoffset=%d offset=%08X\n", objoffset, offset); if (offset > objoffset && offset < lowest_address) lowest_address = offset; } @@ -358,12 +358,12 @@ void atari_rle_objects_device::prescan_rle(int which) info.yoffs = (s16)base[1]; // determine the depth and table - int flags = base[2]; + int const flags = base[2]; info.bpp = m_rle_bpp[(flags >> 8) & 7]; const u16 *table = info.table = m_rle_table[(flags >> 8) & 7]; // determine the starting offset - int offset = ((base[2] & 0xff) << 16) | base[3]; + int const offset = ((base[2] & 0xff) << 16) | base[3]; info.data = base = (u16 *)&m_rombase[offset]; // make sure it's valid @@ -397,7 +397,7 @@ void atari_rle_objects_device::prescan_rle(int which) // track the width while (entry_count-- && base < end) { - int word = *base++; + int const word = *base++; int count/*, value*/; // decode the low byte first @@ -461,32 +461,32 @@ void atari_rle_objects_device::sort_and_render() sort_entry_t sort_entry[256]; for (int objnum = 0; objnum < 256; objnum++) { - int order = m_ordermask.extract(m_ram, objnum * 8); + int const order = m_ordermask.extract(m_ram, objnum * 8); sort_entry[objnum].entry = objnum * 8; sort_entry[objnum].next = list_head[order]; list_head[order] = &sort_entry[objnum]; } // now loop back and process - int bitmap_index = (~m_control_bits & ATARIRLE_CONTROL_FRAME) >> 2; + int const bitmap_index = (~m_control_bits & CONTROL_FRAME) >> 2; int count = 0; int hilite = -1; for (int order = 1; order < 256; order++) for (sort_entry_t *current = list_head[order]; current != nullptr; current = current->next) { // extract scale and code - int scale = m_scalemask.extract(m_ram, current->entry); - int code = m_codemask.extract(m_ram, current->entry); + int const scale = m_scalemask.extract(m_ram, current->entry); + int const code = m_codemask.extract(m_ram, current->entry); // make sure they are in range if (scale > 0 && code < m_objectcount) { - int hflip = m_hflipmask.extract(m_ram, current->entry); + int const hflip = m_hflipmask.extract(m_ram, current->entry); int color = m_colormask.extract(m_ram, current->entry); - int priority = m_prioritymask.extract(m_ram, current->entry); + int const priority = m_prioritymask.extract(m_ram, current->entry); int x = m_xposmask.extract(m_ram, current->entry); int y = m_yposmask.extract(m_ram, current->entry); - int which = m_vrammask.extract(m_ram, current->entry); + int const which = m_vrammask.extract(m_ram, current->entry); if (count++ == atarirle_hilite_index) hilite = current->entry; @@ -498,7 +498,7 @@ void atari_rle_objects_device::sort_and_render() x += m_cliprect.left(); // merge priority and color - color = (color << 4) | (priority << ATARIRLE_PRIORITY_SHIFT); + color = (color << 4) | (priority << PRIORITY_SHIFT); // render to one or both bitmaps bitmap_ind16 &bitmap = m_vram[which][bitmap_index]; @@ -525,7 +525,7 @@ void atari_rle_objects_device::draw_rle(bitmap_ind16 &bitmap, const rectangle &c // int scaled_xoffs = (xscale * info.xoffs) >> 12; - int scaled_yoffs = (yscale * info.yoffs) >> 12; + int const scaled_yoffs = (yscale * info.yoffs) >> 12; // we're hflipped, account for it if (hflip) @@ -542,7 +542,7 @@ void atari_rle_objects_device::draw_rle(bitmap_ind16 &bitmap, const rectangle &c y -= scaled_yoffs; // draw it with appropriate flipping - u32 palettebase = m_palettebase + color; + u32 const palettebase = m_palettebase + color; if (!hflip) draw_rle_zoom(bitmap, clip, info, palettebase, x, y, xscale << 4, yscale << 4); else @@ -565,8 +565,8 @@ void atari_rle_objects_device::draw_rle_zoom(bitmap_ind16 &bitmap, const rectang if (scaled_height == 0) scaled_height = 1; // compute the remaining parameters - int dx = (info.width << 16) / scaled_width; - int dy = (info.height << 16) / scaled_height; + int const dx = (info.width << 16) / scaled_width; + int const dy = (info.height << 16) / scaled_height; int ex = sx + scaled_width - 1; int ey = sy + scaled_height - 1; int sourcey = dy / 2; @@ -615,7 +615,7 @@ void atari_rle_objects_device::draw_rle_zoom(bitmap_ind16 &bitmap, const rectang // grab our starting parameters from this row const u16 *base = row_start; - int entry_count = *base++; + int const entry_count = *base++; // non-clipped case if (!xclipped) @@ -624,7 +624,7 @@ void atari_rle_objects_device::draw_rle_zoom(bitmap_ind16 &bitmap, const rectang for (int entry = 0; entry < entry_count; entry++) { // decode the low byte first - int word = *base++; + int const word = *base++; int count = table[word & 0xff]; int value = count & 0xff; rle_end += (count & 0xff00) << 8; @@ -672,7 +672,7 @@ void atari_rle_objects_device::draw_rle_zoom(bitmap_ind16 &bitmap, const rectang for (int entry = 0; entry < entry_count && dest <= end; entry++) { // decode the low byte first - int word = *base++; + int const word = *base++; int count = table[word & 0xff]; int value = count & 0xff; rle_end += (count & 0xff00) << 8; @@ -744,8 +744,8 @@ void atari_rle_objects_device::draw_rle_zoom_hflip(bitmap_ind16 &bitmap, const r if (scaled_height == 0) scaled_height = 1; // compute the remaining parameters - int dx = (info.width << 16) / scaled_width; - int dy = (info.height << 16) / scaled_height; + int const dx = (info.width << 16) / scaled_width; + int const dy = (info.height << 16) / scaled_height; int ex = sx + scaled_width - 1; int ey = sy + scaled_height - 1; int sourcey = dy / 2; @@ -794,7 +794,7 @@ void atari_rle_objects_device::draw_rle_zoom_hflip(bitmap_ind16 &bitmap, const r // grab our starting parameters from this row const u16 *base = row_start; - int entry_count = *base++; + int const entry_count = *base++; // non-clipped case if (!xclipped) @@ -803,7 +803,7 @@ void atari_rle_objects_device::draw_rle_zoom_hflip(bitmap_ind16 &bitmap, const r for (int entry = 0; entry < entry_count; entry++) { // decode the low byte first - int word = *base++; + int const word = *base++; int count = table[word & 0xff]; int value = count & 0xff; rle_end += (count & 0xff00) << 8; @@ -851,7 +851,7 @@ void atari_rle_objects_device::draw_rle_zoom_hflip(bitmap_ind16 &bitmap, const r for (int entry = 0; entry < entry_count && dest >= start; entry++) { // decode the low byte first - int word = *base++; + int const word = *base++; int count = table[word & 0xff]; int value = count & 0xff; rle_end += (count & 0xff00) << 8; @@ -915,15 +915,15 @@ void atari_rle_objects_device::draw_rle_zoom_hflip(bitmap_ind16 &bitmap, const r void atari_rle_objects_device::hilite_object(bitmap_ind16 &bitmap, int hilite) { // extract scale and code - int scale = m_scalemask.extract(m_ram, hilite); - int code = m_codemask.extract(m_ram, hilite); + int const scale = m_scalemask.extract(m_ram, hilite); + int const code = m_codemask.extract(m_ram, hilite); // make sure they are in range if (scale > 0 && code < m_objectcount) { - int hflip = m_hflipmask.extract(m_ram, hilite); + int const hflip = m_hflipmask.extract(m_ram, hilite); int color = m_colormask.extract(m_ram, hilite); - int priority = m_prioritymask.extract(m_ram, hilite); + int const priority = m_prioritymask.extract(m_ram, hilite); int x = m_xposmask.extract(m_ram, hilite); int y = m_yposmask.extract(m_ram, hilite); @@ -934,11 +934,11 @@ void atari_rle_objects_device::hilite_object(bitmap_ind16 &bitmap, int hilite) x += m_cliprect.left(); // merge priority and color - color = (color << 4) | (priority << ATARIRLE_PRIORITY_SHIFT); + color = (color << 4) | (priority << PRIORITY_SHIFT); const object_info &info = m_info[code]; int scaled_xoffs = (scale * info.xoffs) >> 12; - int scaled_yoffs = (scale * info.yoffs) >> 12; + int const scaled_yoffs = (scale * info.yoffs) >> 12; // we're hflipped, account for it if (hflip) @@ -1016,9 +1016,9 @@ void atari_rle_objects_device::hilite_object(bitmap_ind16 &bitmap, int hilite) //------------------------------------------------- atari_rle_objects_device::sprite_parameter::sprite_parameter() - : m_word(0), - m_shift(0), - m_mask(0) + : m_word(0) + , m_shift(0) + , m_mask(0) { } diff --git a/src/mame/atari/atarirle.h b/src/mame/atari/atarirle.h index 2204ad61a40..57fde55d4e6 100644 --- a/src/mame/atari/atarirle.h +++ b/src/mame/atari/atarirle.h @@ -16,25 +16,6 @@ //************************************************************************** -// CONSTANTS -//************************************************************************** - -#define ATARIRLE_PRIORITY_SHIFT 12 -#define ATARIRLE_BANK_SHIFT 15 -#define ATARIRLE_PRIORITY_MASK ((0xffff << ATARIRLE_PRIORITY_SHIFT) & 0xffff) -#define ATARIRLE_DATA_MASK (ATARIRLE_PRIORITY_MASK ^ 0xffff) - -#define ATARIRLE_CONTROL_MOGO 1 -#define ATARIRLE_CONTROL_ERASE 2 -#define ATARIRLE_CONTROL_FRAME 4 - -#define ATARIRLE_COMMAND_NOP 0 -#define ATARIRLE_COMMAND_DRAW 1 -#define ATARIRLE_COMMAND_CHECKSUM 2 - - - -//************************************************************************** // TYPES & STRUCTURES //************************************************************************** @@ -69,6 +50,20 @@ class atari_rle_objects_device : public device_t, public atari_rle_objects_config { public: + // constants + static inline constexpr int PRIORITY_SHIFT = 12; + //static inline constexpr int BANK_SHIFT = 15; + static inline constexpr uint16_t PRIORITY_MASK = ((0xffff << PRIORITY_SHIFT) & 0xffff); + static inline constexpr uint16_t DATA_MASK = (PRIORITY_MASK ^ 0xffff); + + static inline constexpr int CONTROL_MOGO = 1; + static inline constexpr int CONTROL_ERASE = 2; + static inline constexpr int CONTROL_FRAME = 4; + + static inline constexpr int COMMAND_NOP = 0; + static inline constexpr int COMMAND_DRAW = 1; + static inline constexpr int COMMAND_CHECKSUM = 2; + // construction/destruction atari_rle_objects_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock, const atari_rle_objects_config &config) : atari_rle_objects_device(mconfig, tag, owner, clock) @@ -89,10 +84,10 @@ public: void vblank_callback(screen_device &screen, bool state); // getters - bitmap_ind16 &vram(int idx) { return m_vram[idx][(m_control_bits & ATARIRLE_CONTROL_FRAME) >> 2]; } + bitmap_ind16 &vram(int idx) { return m_vram[idx][(m_control_bits & CONTROL_FRAME) >> 2]; } protected: - // device-level overrides + // device_t implementation virtual void device_start() override ATTR_COLD; virtual void device_reset() override ATTR_COLD; @@ -138,6 +133,9 @@ private: void draw_rle_zoom_hflip(bitmap_ind16 &bitmap, const rectangle &clip, const object_info &info, u32 palette, int sx, int sy, int scalex, int scaley); void hilite_object(bitmap_ind16 &bitmap, int hilite); + required_region_ptr<u16> m_rombase; // pointer to the base of the GFX ROM + memory_array m_ram; + // derived state int m_bitmapwidth = 0; // width of the full playfield bitmap int m_bitmapheight = 0; // height of the full playfield bitmap @@ -157,19 +155,17 @@ private: sprite_parameter m_vrammask; // mask for the VRAM target // ROM information - required_region_ptr<u16> m_rombase; // pointer to the base of the GFX ROM int m_objectcount = 0; // number of objects in the ROM std::vector<object_info> m_info; // list of info records // rendering state bitmap_ind16 m_vram[2][2]; // pointers to VRAM bitmaps and backbuffers - int m_partial_scanline = 0; // partial update scanline + s32 m_partial_scanline = 0; // partial update scanline // control state u8 m_control_bits = 0; // current control bits u8 m_command = 0; // current command u16 m_checksums[256]; // checksums for each 0x40000 bytes - memory_array m_ram; // tables u8 m_rle_bpp[8]; |