From 5843263d43ec1d1ff6d449d06719d82fe3524dd8 Mon Sep 17 00:00:00 2001 From: Olivier Galibert Date: Sun, 23 Jan 2022 19:55:27 +0100 Subject: slapfight: Add the missing proms, correct screen timings, remove non-existing sprite buffer ram --- src/mame/drivers/slapfght.cpp | 93 ++++++++++++++++++++++++++++--------------- src/mame/includes/slapfght.h | 4 +- src/mame/video/slapfght.cpp | 15 ++++--- 3 files changed, 71 insertions(+), 41 deletions(-) diff --git a/src/mame/drivers/slapfght.cpp b/src/mame/drivers/slapfght.cpp index bf91fc423e8..9dc077f1602 100644 --- a/src/mame/drivers/slapfght.cpp +++ b/src/mame/drivers/slapfght.cpp @@ -909,15 +909,9 @@ void slapfght_state::perfrman(machine_config &config) config.set_perfect_quantum(m_maincpu); /* video hardware */ - BUFFERED_SPRITERAM8(config, m_spriteram); - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_refresh_hz(60); - m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500) /* not accurate */); - m_screen->set_size(64*8, 32*8); - m_screen->set_visarea(0*8, 32*8-1, 2*8, 32*8-1); + m_screen->set_raw(36_MHz_XTAL/6, 388, 0, 296, 270, 0, 240); m_screen->set_screen_update(FUNC(slapfght_state::screen_update_perfrman)); - m_screen->screen_vblank().set(m_spriteram, FUNC(buffered_spriteram8_device::vblank_copy_rising)); m_screen->screen_vblank().append(FUNC(slapfght_state::vblank_irq)); m_screen->set_palette(m_palette); @@ -943,7 +937,7 @@ void slapfght_state::perfrman(machine_config &config) void slapfght_state::tigerh(machine_config &config) { /* basic machine hardware */ - Z80(config, m_maincpu, XTAL(36'000'000)/6); // 6MHz + Z80(config, m_maincpu, 36_MHz_XTAL/6); // 6MHz m_maincpu->set_addrmap(AS_PROGRAM, &slapfght_state::tigerh_map_mcu); m_maincpu->set_addrmap(AS_IO, &slapfght_state::io_map_mcu); @@ -952,7 +946,7 @@ void slapfght_state::tigerh(machine_config &config) mainlatch.q_out_cb<1>().set(FUNC(slapfght_state::flipscreen_w)); mainlatch.q_out_cb<3>().set(FUNC(slapfght_state::irq_enable_w)); - Z80(config, m_audiocpu, XTAL(36'000'000)/12); // 3MHz + Z80(config, m_audiocpu, 36_MHz_XTAL/12); // 3MHz m_audiocpu->set_addrmap(AS_PROGRAM, &slapfght_state::tigerh_sound_map); m_audiocpu->set_periodic_int(FUNC(slapfght_state::sound_nmi), attotime::from_hz(360)); // music speed, verified with pcb recording @@ -961,15 +955,9 @@ void slapfght_state::tigerh(machine_config &config) config.set_perfect_quantum(m_maincpu); /* video hardware */ - BUFFERED_SPRITERAM8(config, m_spriteram); - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_refresh_hz(60); - m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500) /* not accurate */); - m_screen->set_size(64*8, 32*8); - m_screen->set_visarea(1*8, 36*8-1, 2*8-1, 32*8-1-1); + m_screen->set_raw(36_MHz_XTAL/6, 388, 0, 296, 270, 0, 240); m_screen->set_screen_update(FUNC(slapfght_state::screen_update_slapfight)); - m_screen->screen_vblank().set(m_spriteram, FUNC(buffered_spriteram8_device::vblank_copy_rising)); m_screen->screen_vblank().append(FUNC(slapfght_state::vblank_irq)); m_screen->set_palette(m_palette); @@ -980,12 +968,12 @@ void slapfght_state::tigerh(machine_config &config) /* sound hardware */ SPEAKER(config, "mono").front_center(); - ay8910_device &ay1(AY8910(config, "ay1", XTAL(36'000'000)/24)); // 1.5MHz + ay8910_device &ay1(AY8910(config, "ay1", 36_MHz_XTAL/24)); // 1.5MHz ay1.port_a_read_callback().set_ioport("IN0"); ay1.port_b_read_callback().set_ioport("IN1"); ay1.add_route(ALL_OUTPUTS, "mono", 0.25); - ay8910_device &ay2(AY8910(config, "ay2", XTAL(36'000'000)/24)); // 1.5MHz + ay8910_device &ay2(AY8910(config, "ay2", 36_MHz_XTAL/24)); // 1.5MHz ay2.port_a_read_callback().set_ioport("DSW1"); ay2.port_b_read_callback().set_ioport("DSW2"); ay2.add_route(ALL_OUTPUTS, "mono", 0.25); @@ -1027,7 +1015,7 @@ void slapfght_state::tigerhb4(machine_config &config) void slapfght_state::slapfigh(machine_config &config) { /* basic machine hardware */ - Z80(config, m_maincpu, XTAL(36'000'000)/6); // 6MHz + Z80(config, m_maincpu, 36_MHz_XTAL/6); // 6MHz m_maincpu->set_addrmap(AS_PROGRAM, &slapfght_state::slapfigh_map_mcu); m_maincpu->set_addrmap(AS_IO, &slapfght_state::io_map_mcu); @@ -1037,7 +1025,7 @@ void slapfght_state::slapfigh(machine_config &config) mainlatch.q_out_cb<3>().set(FUNC(slapfght_state::irq_enable_w)); mainlatch.q_out_cb<4>().set_membank("bank1"); - Z80(config, m_audiocpu, XTAL(36'000'000)/12); // 3MHz + Z80(config, m_audiocpu, 36_MHz_XTAL/12); // 3MHz m_audiocpu->set_addrmap(AS_PROGRAM, &slapfght_state::tigerh_sound_map); m_audiocpu->set_periodic_int(FUNC(slapfght_state::sound_nmi), attotime::from_hz(180)); @@ -1047,15 +1035,9 @@ void slapfght_state::slapfigh(machine_config &config) config.set_perfect_quantum(m_maincpu); /* video hardware */ - BUFFERED_SPRITERAM8(config, m_spriteram); - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_refresh_hz(60); - m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500) /* not accurate */); - m_screen->set_size(64*8, 32*8); - m_screen->set_visarea(1*8, 36*8-1, 2*8-1, 32*8-1-1); + m_screen->set_raw(36_MHz_XTAL/6, 388, 0, 296, 270, 0, 240); m_screen->set_screen_update(FUNC(slapfght_state::screen_update_slapfight)); - m_screen->screen_vblank().set(m_spriteram, FUNC(buffered_spriteram8_device::vblank_copy_rising)); m_screen->screen_vblank().append(FUNC(slapfght_state::vblank_irq)); m_screen->set_palette(m_palette); @@ -1066,12 +1048,12 @@ void slapfght_state::slapfigh(machine_config &config) /* sound hardware */ SPEAKER(config, "mono").front_center(); - ay8910_device &ay1(AY8910(config, "ay1", XTAL(36'000'000)/24)); // 1.5MHz + ay8910_device &ay1(AY8910(config, "ay1", 36_MHz_XTAL/24)); // 1.5MHz ay1.port_a_read_callback().set_ioport("IN0"); ay1.port_b_read_callback().set_ioport("IN1"); ay1.add_route(ALL_OUTPUTS, "mono", 0.25); - ay8910_device &ay2(AY8910(config, "ay2", XTAL(36'000'000)/24)); // 1.5MHz + ay8910_device &ay2(AY8910(config, "ay2", 36_MHz_XTAL/24)); // 1.5MHz ay2.port_a_read_callback().set_ioport("DSW1"); ay2.port_b_read_callback().set_ioport("DSW2"); ay2.add_route(ALL_OUTPUTS, "mono", 0.25); @@ -1563,6 +1545,37 @@ Notes: A77_05 to A77_08 - 27256 EPROM A77_03, A77_04 - 2764 EPROM (replace with A77_03-1, A77_04-1 on Alcon) A77_13 - Motorola MC68705P5S Micro-Controller (protected). Clock 3.000MHz + +Non-color PROM usage (slap fight board names, seem common for all games): + ROM14.2C: + Horizontal signals. In normal mode hpos goes from 0 to 387, in + flipped mode hpos goes from 291 to -96. The prom address is: + ((hpos >> 2) & 0x7f) | (flip ? 0x80 : 0x00) + + Bits are: + 0: 1 = sync active + 1: 1 = blank active + 2: unused + 3: 0 = reset hpos + + ROM15.8B: + Vertical signals. Vpos goes from 0 to 269. The prom address is + vpos >> 1. + + Bits are: + 0: 0 = sync active + 1: 1 = blank active + 2: unused + 3: 0 = reset vpos + + ROM16.1E, ROM17.1C: + Two nibbles providing a byte (1E high, 1C low). Seems linked with + reading the sprite ram, addressing is a little weird and usage not + obvious. Low 3 bits seem to choose a target (0=none, + 1,3=position, 4=code, 2=misc, 5+ unknown). + + ROM18.2B: + Something to do with sprites, even less clear. */ ROM_START( alcon ) @@ -1593,10 +1606,15 @@ ROM_START( alcon ) ROM_LOAD( "a77_09.7h", 0x18000, 0x8000, CRC(587113ae) SHA1(90abe961494a1af7c87693a419fbabf7a58a5dee) ) - ROM_REGION( 0x0300, "proms", 0 ) + ROM_REGION( 0x0720, "proms", 0 ) ROM_LOAD( "21_82s129.12q", 0x0000, 0x0100, CRC(a0efaf99) SHA1(5df01663480acad1f89abab8662d437617a66d1c) ) /* Silkscreened as ROM21 */ ROM_LOAD( "20_82s129.12m", 0x0100, 0x0100, CRC(a56d57e5) SHA1(bfbd0db52b23fe1b4994e05103be3d412c1c013e) ) /* Silkscreened as ROM20 */ ROM_LOAD( "19_82s129.12n", 0x0200, 0x0100, CRC(5cbf9fbf) SHA1(abfa58fa4e44ebc56f2e0fac9bcc36164c845fa3) ) /* Silkscreened as ROM19 */ + ROM_LOAD( "14_82s129.2c", 0x0300, 0x0100, CRC(4dc04453) SHA1(524e5a212ab496c52adc0def995b75e89aba48e7) ) /* Silkscreened as ROM14 */ + ROM_LOAD( "15_82s129.8b", 0x0400, 0x0100, CRC(48ac3db4) SHA1(6a73fe21529bc760b8df1893aee9e89fb60976eb) ) /* Silkscreened as ROM15 */ + ROM_LOAD( "16_82s129.1e", 0x0500, 0x0100, CRC(59490887) SHA1(c894edecbcfc67972ad893cd7c8197d07862a20a) ) /* Silkscreened as ROM16 */ + ROM_LOAD( "17_82s129.1c", 0x0600, 0x0100, CRC(d492e6c2) SHA1(5789adda3a63ef8656ebd012416fcf3f991241fe) ) /* Silkscreened as ROM17 */ + ROM_LOAD( "18_82s123.2b", 0x0700, 0x0020, CRC(aa0ca5a5) SHA1(4c45be71658f40ebb05634febba5822f1a8a7f79) ) /* Silkscreened as ROM18 */ ROM_END ROM_START( slapfigh ) @@ -1626,10 +1644,15 @@ ROM_START( slapfigh ) ROM_LOAD( "a77_10.8h", 0x10000, 0x8000, CRC(422d946b) SHA1(c251ef9597a11ec8de39be4fcbddaba84e649ef2) ) ROM_LOAD( "a77_09.7h", 0x18000, 0x8000, CRC(587113ae) SHA1(90abe961494a1af7c87693a419fbabf7a58a5dee) ) - ROM_REGION( 0x0300, "proms", 0 ) + ROM_REGION( 0x0720, "proms", 0 ) ROM_LOAD( "21_82s129.12q", 0x0000, 0x0100, CRC(a0efaf99) SHA1(5df01663480acad1f89abab8662d437617a66d1c) ) /* Silkscreened as ROM21 */ ROM_LOAD( "20_82s129.12m", 0x0100, 0x0100, CRC(a56d57e5) SHA1(bfbd0db52b23fe1b4994e05103be3d412c1c013e) ) /* Silkscreened as ROM20 */ ROM_LOAD( "19_82s129.12n", 0x0200, 0x0100, CRC(5cbf9fbf) SHA1(abfa58fa4e44ebc56f2e0fac9bcc36164c845fa3) ) /* Silkscreened as ROM19 */ + ROM_LOAD( "14_82s129.2c", 0x0300, 0x0100, CRC(4dc04453) SHA1(524e5a212ab496c52adc0def995b75e89aba48e7) ) /* Silkscreened as ROM14 */ + ROM_LOAD( "15_82s129.8b", 0x0400, 0x0100, CRC(48ac3db4) SHA1(6a73fe21529bc760b8df1893aee9e89fb60976eb) ) /* Silkscreened as ROM15 */ + ROM_LOAD( "16_82s129.1e", 0x0500, 0x0100, CRC(59490887) SHA1(c894edecbcfc67972ad893cd7c8197d07862a20a) ) /* Silkscreened as ROM16 */ + ROM_LOAD( "17_82s129.1c", 0x0600, 0x0100, CRC(d492e6c2) SHA1(5789adda3a63ef8656ebd012416fcf3f991241fe) ) /* Silkscreened as ROM17 */ + ROM_LOAD( "18_82s123.2b", 0x0700, 0x0020, CRC(aa0ca5a5) SHA1(4c45be71658f40ebb05634febba5822f1a8a7f79) ) /* Silkscreened as ROM18 */ ROM_END /* @@ -1668,10 +1691,15 @@ ROM_START( slapfigha ) ROM_LOAD( "a76_11.8h", 0x10000, 0x8000, CRC(422d946b) SHA1(c251ef9597a11ec8de39be4fcbddaba84e649ef2) ) ROM_LOAD( "a76_10.6h", 0x18000, 0x8000, CRC(587113ae) SHA1(90abe961494a1af7c87693a419fbabf7a58a5dee) ) - ROM_REGION( 0x0300, "proms", 0 ) + ROM_REGION( 0x0720, "proms", 0 ) ROM_LOAD( "a76-17.12q", 0x0000, 0x0100, CRC(a0efaf99) SHA1(5df01663480acad1f89abab8662d437617a66d1c) ) /* 82S129 Biploar PROM, Silkscreened as ROM21 */ ROM_LOAD( "a76-15.12m", 0x0100, 0x0100, CRC(a56d57e5) SHA1(bfbd0db52b23fe1b4994e05103be3d412c1c013e) ) /* 82S129 Biploar PROM, Silkscreened as ROM20 */ ROM_LOAD( "a76-16.12n", 0x0200, 0x0100, CRC(5cbf9fbf) SHA1(abfa58fa4e44ebc56f2e0fac9bcc36164c845fa3) ) /* 82S129 Biploar PROM, Silkscreened as ROM19 */ + ROM_LOAD( "14_82s129.2c", 0x0300, 0x0100, CRC(4dc04453) SHA1(524e5a212ab496c52adc0def995b75e89aba48e7) ) /* Silkscreened as ROM14 */ + ROM_LOAD( "15_82s129.8b", 0x0400, 0x0100, CRC(48ac3db4) SHA1(6a73fe21529bc760b8df1893aee9e89fb60976eb) ) /* Silkscreened as ROM15 */ + ROM_LOAD( "16_82s129.1e", 0x0500, 0x0100, CRC(59490887) SHA1(c894edecbcfc67972ad893cd7c8197d07862a20a) ) /* Silkscreened as ROM16 */ + ROM_LOAD( "17_82s129.1c", 0x0600, 0x0100, CRC(d492e6c2) SHA1(5789adda3a63ef8656ebd012416fcf3f991241fe) ) /* Silkscreened as ROM17 */ + ROM_LOAD( "18_82s123.2b", 0x0700, 0x0020, CRC(aa0ca5a5) SHA1(4c45be71658f40ebb05634febba5822f1a8a7f79) ) /* Silkscreened as ROM18 */ ROM_END /* @@ -1899,7 +1927,6 @@ A68_02 & 06 to 09 - 27256 EPROM A68_04/05 - 2764 EPROM A68_14 - Motorola MC68705P5 Micro-Controller (protected). Clock 3.000MHz [36/12] X - Unpopulated socket - */ ROM_START( grdian ) diff --git a/src/mame/includes/slapfght.h b/src/mame/includes/slapfght.h index ff3aa5c0f3e..2cd6b72b37b 100644 --- a/src/mame/includes/slapfght.h +++ b/src/mame/includes/slapfght.h @@ -28,9 +28,9 @@ public: m_gfxdecode(*this, "gfxdecode"), m_screen(*this, "screen"), m_palette(*this, "palette"), - m_spriteram(*this, "spriteram"), m_videoram(*this, "videoram"), m_colorram(*this, "colorram"), + m_spriteram(*this, "spriteram"), m_fixvideoram(*this, "fixvideoram"), m_fixcolorram(*this, "fixcolorram") { } @@ -59,10 +59,10 @@ private: required_device m_gfxdecode; required_device m_screen; required_device m_palette; - required_device m_spriteram; required_shared_ptr m_videoram; required_shared_ptr m_colorram; + required_shared_ptr m_spriteram; optional_shared_ptr m_fixvideoram; optional_shared_ptr m_fixcolorram; diff --git a/src/mame/video/slapfght.cpp b/src/mame/video/slapfght.cpp index eef63a3d517..0418c2d6cb8 100644 --- a/src/mame/video/slapfght.cpp +++ b/src/mame/video/slapfght.cpp @@ -136,9 +136,9 @@ WRITE_LINE_MEMBER(slapfght_state::palette_bank_w) void slapfght_state::draw_perfrman_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int layer) { - uint8_t *src = m_spriteram->buffer(); + const uint8_t *src = m_spriteram; - for (int offs = 0; offs < m_spriteram->bytes(); offs += 4) + for (int offs = 0; offs < m_spriteram.bytes(); offs += 4) { /* 0: xxxxxxxx - code @@ -186,9 +186,9 @@ uint32_t slapfght_state::screen_update_perfrman(screen_device &screen, bitmap_in void slapfght_state::draw_slapfight_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) { - uint8_t *src = m_spriteram->buffer(); + const uint8_t *src = m_spriteram; - for (int offs = 0; offs < m_spriteram->bytes(); offs += 4) + for (int offs = 0; offs < m_spriteram.bytes(); offs += 4) { /* 0: xxxxxxxx - code low @@ -201,8 +201,8 @@ void slapfght_state::draw_slapfight_sprites(bitmap_ind16 &bitmap, const rectangl */ int code = src[offs + 0] | ((src[offs + 2] & 0xc0) << 2); - int sy = src[offs + 3]; - int sx = (src[offs + 1] | (src[offs + 2] << 8 & 0x100)) - 13; + int sy = src[offs + 3] + 2; + int sx = (src[offs + 1] | (src[offs + 2] << 8 & 0x100)) - 17; int color = src[offs + 2] >> 1 & 0xf; int fx = 0, fy = 0; @@ -213,6 +213,9 @@ void slapfght_state::draw_slapfight_sprites(bitmap_ind16 &bitmap, const rectangl fx = fy = 1; } + if (sy > 256-8) + sy -= 256; + m_gfxdecode->gfx(2)->transpen(bitmap, cliprect, code, color, fx, fy, sx, sy, 0); } } -- cgit v1.2.3