Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

slapfght.cpp: Hooked up flip screen output to MCU for alcon and slapfigh #9748

Merged
merged 2 commits into from May 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 13 additions & 6 deletions src/mame/drivers/slapfght.cpp
Expand Up @@ -14,8 +14,6 @@

TODO:
- proper MCU emulation (mame/machine/slapfght.cpp)
- alcon cocktail/flipscreen, it doesn't write to the flipscreen reg


****************************************************************************

Expand Down Expand Up @@ -1021,7 +1019,6 @@ void slapfght_state::slapfigh(machine_config &config)

ls259_device &mainlatch(LS259(config, "mainlatch"));
mainlatch.q_out_cb<0>().set(FUNC(slapfght_state::sound_reset_w));
mainlatch.q_out_cb<1>().set(FUNC(slapfght_state::flipscreen_w));
mainlatch.q_out_cb<3>().set(FUNC(slapfght_state::irq_enable_w));
mainlatch.q_out_cb<4>().set_membank("bank1");

Expand All @@ -1030,6 +1027,7 @@ void slapfght_state::slapfigh(machine_config &config)
m_audiocpu->set_periodic_int(FUNC(slapfght_state::sound_nmi), attotime::from_hz(180));

TAITO68705_MCU(config, m_bmcu, 36_MHz_XTAL/12); // 3MHz
m_bmcu->aux_out_cb<5>().set(FUNC(slapfght_state::flipscreen_w));
m_bmcu->aux_strobe_cb().set(FUNC(slapfght_state::scroll_from_mcu_w));

config.set_perfect_quantum(m_maincpu);
Expand Down Expand Up @@ -1059,6 +1057,15 @@ void slapfght_state::slapfigh(machine_config &config)
ay2.add_route(ALL_OUTPUTS, "mono", 0.25);
}

void slapfght_state::slapfigha(machine_config &config)
{
slapfigh(config);

subdevice<ls259_device>("mainlatch")->q_out_cb<1>().set(FUNC(slapfght_state::flipscreen_w));

m_bmcu->aux_out_cb<5>().set_nop();
}

void slapfght_state::slapfighb1(machine_config &config)
{
slapfigh(config);
Expand Down Expand Up @@ -2083,9 +2090,9 @@ GAME( 1985, tigerhb2, tigerh, tigerhb2, tigerh, slapfght_state, empty_i
GAME( 1985, tigerhb3, tigerh, tigerhb2, tigerh, slapfght_state, empty_init, ROT270, "bootleg", "Tiger-Heli (bootleg set 3)", MACHINE_SUPPORTS_SAVE )
GAME( 1985, tigerhb4, tigerh, tigerhb4, tigerh, slapfght_state, empty_init, ROT270, "bootleg", "Tiger-Heli (bootleg set 4)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // MCU not hooked up

GAME( 1986, alcon, 0, slapfigh, slapfigh, slapfght_state, init_slapfigh, ROT270, "Toaplan / Taito America Corp.", "Alcon (US)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL )
GAME( 1986, slapfigh, alcon, slapfigh, slapfigh, slapfght_state, init_slapfigh, ROT270, "Toaplan / Taito", "Slap Fight (A77 set, 8606M PCB)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL )
GAME( 1986, slapfigha, alcon, slapfigh, slapfigh, slapfght_state, init_slapfigh, ROT270, "Toaplan / Taito", "Slap Fight (A76 set, GX-006-A PCB)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL )
GAME( 1986, alcon, 0, slapfigh, slapfigh, slapfght_state, init_slapfigh, ROT270, "Toaplan / Taito America Corp.", "Alcon (US)", MACHINE_SUPPORTS_SAVE )
GAME( 1986, slapfigh, alcon, slapfigh, slapfigh, slapfght_state, init_slapfigh, ROT270, "Toaplan / Taito", "Slap Fight (A77 set, 8606M PCB)", MACHINE_SUPPORTS_SAVE )
GAME( 1986, slapfigha, alcon, slapfigha, slapfigh, slapfght_state, init_slapfigh, ROT270, "Toaplan / Taito", "Slap Fight (A76 set, GX-006-A PCB)", MACHINE_SUPPORTS_SAVE )
GAME( 1986, slapfighb1, alcon, slapfighb1, slapfigh, slapfght_state, init_slapfigh, ROT270, "bootleg", "Slap Fight (bootleg set 1)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL )
GAME( 1986, slapfighb2, alcon, slapfighb2, slapfigh, slapfght_state, init_slapfigh, ROT270, "bootleg", "Slap Fight (bootleg set 2)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL ) // England?
GAME( 1986, slapfighb3, alcon, slapfighb2, slapfigh, slapfght_state, init_slapfigh, ROT270, "bootleg", "Slap Fight (bootleg set 3)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL ) // PCB labeled 'slap fighter'
Expand Down
3 changes: 2 additions & 1 deletion src/mame/includes/slapfght.h
Expand Up @@ -40,11 +40,12 @@ class slapfght_state : public driver_device
void tigerhb2(machine_config &config);
void tigerhb4(machine_config &config);
void getstarb2(machine_config &config);
void slapfighb2(machine_config &config);
void getstarb1(machine_config &config);
void perfrman(machine_config &config);
void slapfigh(machine_config &config);
void slapfigha(machine_config &config);
void slapfighb1(machine_config &config);
void slapfighb2(machine_config &config);

void init_banks();
void init_getstarb1();
Expand Down
7 changes: 6 additions & 1 deletion src/mame/machine/taito68705interface.cpp
@@ -1,5 +1,5 @@
// license:BSD-3-Clause
// copyright-holders:Ernesto Corvi, Nicola Salmoria, David Haywood, Vas Crabb
// copyright-holders:David Haywood, Vas Crabb
#include "emu.h"
#include "machine/taito68705interface.h"

Expand Down Expand Up @@ -184,6 +184,7 @@ taito68705_mcu_device::taito68705_mcu_device(const machine_config &mconfig, cons

taito68705_mcu_device::taito68705_mcu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock)
: taito68705_mcu_device_base(mconfig, type, tag, owner, clock)
, m_aux_out_cb(*this)
, m_aux_strobe_cb(*this)
, m_pb_output(0xff)
{
Expand All @@ -201,6 +202,7 @@ void taito68705_mcu_device::device_start()
{
taito68705_mcu_device_base::device_start();

m_aux_out_cb.resolve_all_safe();
m_aux_strobe_cb.resolve_safe();

save_item(NAME(m_pb_output));
Expand Down Expand Up @@ -239,6 +241,7 @@ void taito68705_mcu_device::mcu_portb_w(offs_t offset, u8 data, u8 mem_mask)
{
// some games have additional peripherals strobed on falling edge
u8 const old_pa_value(pa_value());
u8 const aux_changed((data ^ m_pb_output) >> 2);
u8 const aux_strobes((mem_mask & ~data & m_pb_output) >> 2);

// rising edge on PB1 clears the host semaphore flag
Expand All @@ -248,6 +251,8 @@ void taito68705_mcu_device::mcu_portb_w(offs_t offset, u8 data, u8 mem_mask)
// callbacks for other peripherals
for (unsigned i = 0; i < 6; ++i)
{
if (BIT(aux_changed, i))
m_aux_out_cb[i](BIT(data, i + 2));
if (BIT(aux_strobes, i))
m_aux_strobe_cb(i, old_pa_value, 0xff);
}
Expand Down
6 changes: 4 additions & 2 deletions src/mame/machine/taito68705interface.h
@@ -1,5 +1,5 @@
// license:BSD-3-Clause
// copyright-holders:Ernesto Corvi, Nicola Salmoria, David Haywood, Vas Crabb
// copyright-holders:David Haywood, Vas Crabb
#ifndef MAME_MACHINE_TAITO68705INTERFACE_H
#define MAME_MACHINE_TAITO68705INTERFACE_H

Expand Down Expand Up @@ -63,6 +63,7 @@ class taito68705_mcu_device_base : public device_t
class taito68705_mcu_device : public taito68705_mcu_device_base
{
public:
template <unsigned N> auto aux_out_cb() { return m_aux_out_cb[N].bind(); }
auto aux_strobe_cb() { return m_aux_strobe_cb.bind(); }

taito68705_mcu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
Expand All @@ -76,7 +77,8 @@ class taito68705_mcu_device : public taito68705_mcu_device_base
virtual void device_add_mconfig(machine_config &config) override;
virtual void device_start() override;

devcb_write8 m_aux_strobe_cb;
devcb_write_line::array<6> m_aux_out_cb;
devcb_write8 m_aux_strobe_cb;

u8 m_pb_output;
};
Expand Down