Skip to content

Commit

Permalink
slapfight: Add the missing proms, correct screen timings, remove non-…
Browse files Browse the repository at this point in the history
…existing sprite buffer ram
  • Loading branch information
galibert committed Feb 23, 2022
1 parent afdad6b commit 5843263
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 41 deletions.
93 changes: 60 additions & 33 deletions src/mame/drivers/slapfght.cpp
Expand Up @@ -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);

Expand All @@ -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);

Expand All @@ -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

Expand All @@ -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);

Expand All @@ -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);
Expand Down Expand Up @@ -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);

Expand All @@ -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));

Expand All @@ -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);

Expand All @@ -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);
Expand Down Expand Up @@ -1563,6 +1545,37 @@ Bottom Board
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 )
Expand Down Expand Up @@ -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 )
Expand Down Expand Up @@ -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

/*
Expand Down Expand Up @@ -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

/*
Expand Down Expand Up @@ -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 )
Expand Down
4 changes: 2 additions & 2 deletions src/mame/includes/slapfght.h
Expand Up @@ -28,9 +28,9 @@ class slapfght_state : public driver_device
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")
{ }
Expand Down Expand Up @@ -59,10 +59,10 @@ class slapfght_state : public driver_device
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
required_device<buffered_spriteram8_device> m_spriteram;

required_shared_ptr<uint8_t> m_videoram;
required_shared_ptr<uint8_t> m_colorram;
required_shared_ptr<uint8_t> m_spriteram;
optional_shared_ptr<uint8_t> m_fixvideoram;
optional_shared_ptr<uint8_t> m_fixcolorram;

Expand Down
15 changes: 9 additions & 6 deletions src/mame/video/slapfght.cpp
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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;

Expand All @@ -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);
}
}
Expand Down

1 comment on commit 5843263

@Dunard
Copy link
Contributor

@Dunard Dunard commented on 5843263 Feb 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The game screen on alcon and clones moved to the right. Double black thick line on the left pushes the screen to the right. Cut the screen off on the right. Missing the black thick line on the right. :)

Please sign in to comment.