gsword: Preliminary MCU emulation. [Vas Crabb, Caps0ff, *=/STARRIDER\=*]

* Removed BAD_DUMP flag from josvolly MCU dump - there's no reason to believe the MCUs contain different programs, and Allumer were known to use different silkscreen on identical parts (would still be nice to get confirmation).
* Connected gsword MCUs and correted connections for DIP switches, player inputs, start buttons, coin chutes, and coin counters.
* Lots of guesses due to lack of measurements, schematics, or even good PCB pictures.
* Demoted gsword to MACHINE_NOT_WORKING and MACHINE_IMPERFECT_SOUND as there are issues with credits registering and sound.
* Added extensive notes.

(nw) I'm pushing this in case someone else wants to take a look.  The
actual MCU emulation seems to be working, and the MCUs are communicating
without errors.  The MCUs checksum three quarters of their program ROM
(passing) and the other quarter all looks good.  The problems may stem
from some status flag not propagating back to the main CPU, or possibly
something in the interrupt logic that was working before because serial
communication delays were inaccurate.  Although previously a set of
four MCUs were simulated, there are only three actually present.  The
second I/O MCU was mapped at a location never accessed by the sub CPU.
This commit is contained in:
Vas Crabb 2018-12-06 20:33:02 +11:00
parent ee2eddbe5c
commit 057fcc429f
2 changed files with 353 additions and 220 deletions

View File

@ -81,7 +81,7 @@ Gs16 2nd z80 Data (8K) 2000-3FFF
PORTS: PORTS:
7e 8741-#0 data port 7e 8741-#0 data port
7f 8741-#1 command / status port 7f 8741-#0 command / status port
************* *************
*2nd Z80 CPU* *2nd Z80 CPU*
@ -95,8 +95,6 @@ write
PORTS: PORTS:
00 8741-#2 data port 00 8741-#2 data port
01 8741-#2 command / status port 01 8741-#2 command / status port
20 8741-#3 data port
21 8741-#3 command / status port
40 8741-#1 data port 40 8741-#1 data port
41 8741-#1 command / status port 41 8741-#1 command / status port
@ -141,6 +139,137 @@ reg: 0->1 (main->2nd) / : (1->0) 2nd->main :
6 : : DSW0? 6 : : DSW0?
7 : : ? 7 : : ?
gsword notes:
There are three 8041 MCUs:
* One connected to the main CPU for communicating with the sub CPU and
reading DIP switch C.
* One connected to the sub CPU for communicating with the main CPU and
reading DIP switches A and B.
* One connected to the sub CPU for reading player, start and coin
inputs, and driving the coin counter outputs.
So far, only the AA-016 MCU has been dumped successfully. There's no
reason to believe that the three MCUs run different programs. Other
Allumer-developed games are known to have different silkscreen on
identical parts. It's not clear which of the MCUs (AA-013 at 5A, AA-016
at 9C and AA-017 at 9G) plays which role,
The clock inputs for the MCUs are unknown - the values used are taken
from gladiatr, where a superficially similar arrangement is used. It
would be good if we could get frequency measurements for all the clock
inputs:
* Master clock input to each MCU on XTAL 1 (DIP pin 2, PLCC pin 3)
* Serial clock input to communication MCUs on T0 (DIP pin 1, PLCC pin 2)
Communication between MCUs is working - the handlers for parity error
($187), premature end of data ($194) and excess data bits are not being
hit. This confirms that the MCUs are synchronising correctly and the
serial clock is not excessively fast in relation to the MCU core clock.
The I/O MCU is correctly reading inputs, counting coins, driving coin
counters, and driving coin counters. However, a problem elsewhere is
causing the main program to not reliably register credits. It registers
credits occasionally, and once you start a game, it's playable - player
inputs work fine.
There are problems with sound. Many effects aren't playing or are cut
off almost immediately. It's not clear why - possibly due to some of
the I/O that isn't understood.
+-----+----------------+----------------+----------------+
| Pin | MCU 1 | MCU 2 | MCU 3 |
+-----+----------------+----------------+----------------+
| P10 | to MCU 2 P10 | to MCU 1 P10 | P1 right |
| P11 | to MCU 2 T1 | to MCU 1 T1 | P1 left |
| P12 | unknown | DSW A 3 | unknown |
| P13 | unknown | DSW A 4 | P1 lower |
| P14 | unknown | DSW A 5 | P1 raise |
| P15 | unknown | unknown | P1 middle |
| P16 | unknown | unknown | 1P start |
| P17 | unknown | unknown | 2P start |
+-----+----------------+----------------+----------------+
| P20 | DSW C 1? | DSW B 1? | P2 right |
| P21 | DSW C 2? | DSW B 2? | P2 left |
| P22 | DSW C 3 | DSW B 3 | unknown |
| P23 | DSW C 4 | DSW B 4 | P2 lower |
| P24 | DSW C 5 | DSW B 5 | P2 raise |
| P25 | DSW C 6 | DSW B 6 | P2 middle |
| P26 | DSW C 7 | DSW B 7 | coin counter 1 |
| P27 | DSW C 8? | DSW B 8 | coin counter 2 |
+-----+----------------+----------------+----------------+
| T0 | serial clock | serial clock | coin chute 1 |
| T1 | from MCU 2 P11 | from MCU 1 P11 | coin chute 2 |
+-----+----------------+----------------+----------------+
The communication MCUs transfer data bidirectionally on their P10 pins
which are tied together. An MCU indicates that it is sending data by
pulling P11 low. This is connected to T1 on the other MCU. The data
clock is supplied to both communication MCUs on T0. Outputs are set
after detecting a rising edge on T0, and inputs are read after detecting
a falling edge on T0.
A frame consists to five bytes send LSB first. Each byte is followed by
an odd parity bit. Useful addresses for debugging communication:
* $12A: Function for sending a frame from $21..$25
* $159: Function for receiving a frame to $29..$2D
* $187: Receive parity error
* $194: Premature end-of-data
* $199: Excess data
The I/O MCU handles rejecting coin pulses that are too long or too short
and converting coins to credits. The duration is measured in terms of
rate that the sub CPU polls the MCU at. The minimum coin pulse duration
is always two polling periods, while the maximum is programmable. The
coins/credit settings for each coin input are programmable, but only the
first one can be set with DIP switches (the second one is always set for
1 coin/1 credit).
During the setup phase, the sub CPU writes setup instructions to the I/O
MCU's control port. Each byte has an instruction in the high three bits
and a value in the low five bits. Instructions recognised are:
* 0x00: Set coin 1 maximum pulse duration ($2E, default 6)
* 0x20: Set coin 2 maximum pulse duration ($2F, default 6)
* 0x40: Set coin 1 coins per credit ($35, default 1)
* 0x60: Set coin 2 coins per credit ($3D, default 1)
* 0x80: Set coin 1 credits per coin ($33, default 1)
* 0xa0: Set coin 2 credits per coin ($3B, default 1)
* 0xc0: Set value at $2A (never read, default $08)
* 0xe0: Swap nybbles and set value at $29 (never read, default $80)
The setup phase is terminated by writing a command to the I/O MCU's data
port. The MCU return a data byte depending on the low three bits of the
command:
* xxxxxxx1 or xxxxx000: Credit flag and start buttons
* xxxxxx10: Credit flag and P1 controls
* xxxxx100: Credit flag and P2 controls
The MCU keeps an internal credit counter ($2D). Each time the MCU
receives a polling command, if the credit counter is non-zero it will be
decremented and bit 7 of the response will be set; if the credit counter
is zero, but 7 of the response will be clear.
After terminating the setup phase, any byte written to the data port
will cause the MCU to check the coin inputs, update the credit counter
if necessary, and return the desired data. A byte written to the
control port after the setup phase terminates causes the MCU to read a
byte of program memory from page 2 using the received byte as the
offset, twos-complement it, return it, and then immediately re-execute
the previous command received on the data port.
The I/O MCU indicates status via the user-defined status flags. It sets
them to 0000 while waiting for a command, or 1111 while processing a
command.
MCU 2 P15, P16 and P17 seem to have some effect, although it's not clear
what they're supposed to do. Tying them low during startup prevents the
sub CPU from correctly programming the I/O MCU. It's not clear whether
pins corresponding to unused DIP switches have some other purpose. Fake
DIP switches have been included to make it easier to mess with some of
the unknown I/O.
The audio CPU seems to have some unmapped peripheral(s) around $FEB0.
******************************************/ ******************************************/
#include "emu.h" #include "emu.h"
@ -148,27 +277,13 @@ reg: 0->1 (main->2nd) / : (1->0) 2nd->main :
#include "cpu/mcs48/mcs48.h" #include "cpu/mcs48/mcs48.h"
#include "cpu/z80/z80.h" #include "cpu/z80/z80.h"
#include "machine/clock.h"
#include "machine/i8255.h" #include "machine/i8255.h"
#include "machine/tait8741.h"
#include "screen.h" #include "screen.h"
#include "speaker.h" #include "speaker.h"
#if 0
int gsword_state::coins_in(void)
{
/* emulate 8741 coin slot */
if (ioport("IN4")->read() & 0xc0)
{
logerror("Coin In\n");
return 0x80;
}
logerror("NO Coin\n");
return 0x00;
}
#endif
void gsword_state_base::machine_start() void gsword_state_base::machine_start()
{ {
save_item(NAME(m_fake8910_0)); save_item(NAME(m_fake8910_0));
@ -269,37 +384,17 @@ WRITE8_MEMBER(gsword_state::adpcm_data_w)
m_msm->vclk_w(BIT(data, 4)); // bit 4 m_msm->vclk_w(BIT(data, 4)); // bit 4
} }
READ8_MEMBER(gsword_state::i8741_2_r ) READ8_MEMBER(gsword_state::mcu2_p1_r)
{ {
switch (offset) // P10 is tied to P10 on MCU1, P11 is used to drive T1 on MCU1
{ // assume the low bits of DIP switch A aren't connected at all
case 0x01: /* start button , coins */ return (m_dsw0->read() & 0xfc) | 0x02 | BIT(m_mcu1_p1, 0);
return ioport("IN0")->read();
case 0x02: /* Player 1 Controller */
return ioport("IN1")->read();
case 0x04: /* Player 2 Controller */
return ioport("IN3")->read();
// default:
// logerror("8741-2 unknown read %d %s\n",offset,machine().describe_context());
}
/* unknown */
return 0;
} }
READ8_MEMBER(gsword_state::i8741_3_r ) WRITE8_MEMBER(gsword_state::mcu3_p2_w)
{ {
switch (offset) machine().bookkeeping().coin_counter_w(0, BIT(~data, 6));
{ machine().bookkeeping().coin_counter_w(1, BIT(~data, 7));
case 0x01: /* start button */
return ioport("IN2")->read();
case 0x02: /* Player 1 Controller? */
return ioport("IN1")->read();
case 0x04: /* Player 2 Controller? */
return ioport("IN3")->read();
}
/* unknown */
// logerror("8741-3 unknown read %d %s\n",offset,machine().describe_context());
return 0;
} }
INTERRUPT_GEN_MEMBER(gsword_state::sound_interrupt) INTERRUPT_GEN_MEMBER(gsword_state::sound_interrupt)
@ -344,6 +439,9 @@ void gsword_state::machine_start()
save_item(NAME(m_protect_hack)); save_item(NAME(m_protect_hack));
save_item(NAME(m_nmi_enable)); save_item(NAME(m_nmi_enable));
save_item(NAME(m_tclk_val));
save_item(NAME(m_mcu1_p1));
save_item(NAME(m_mcu2_p1));
} }
void gsword_state::machine_reset() void gsword_state::machine_reset()
@ -474,7 +572,7 @@ void gsword_state_base::cpu1_map(address_map &map)
void gsword_state::cpu1_io_map(address_map &map) void gsword_state::cpu1_io_map(address_map &map)
{ {
map.global_mask(0xff); map.global_mask(0xff);
map(0x7e, 0x7f).rw("taito8741", FUNC(taito8741_4pack_device::read_0), FUNC(taito8741_4pack_device::write_0)); map(0x7e, 0x7f).rw("mcu1", FUNC(upi41_cpu_device::upi41_master_r), FUNC(upi41_cpu_device::upi41_master_w));
} }
void gsword_state::cpu2_map(address_map &map) void gsword_state::cpu2_map(address_map &map)
@ -487,9 +585,8 @@ void gsword_state::cpu2_map(address_map &map)
void gsword_state::cpu2_io_map(address_map &map) void gsword_state::cpu2_io_map(address_map &map)
{ {
map.global_mask(0xff); map.global_mask(0xff);
map(0x00, 0x01).rw("taito8741", FUNC(taito8741_4pack_device::read_2), FUNC(taito8741_4pack_device::write_2)); map(0x00, 0x01).rw("mcu3", FUNC(upi41_cpu_device::upi41_master_r), FUNC(upi41_cpu_device::upi41_master_w));
map(0x20, 0x21).rw("taito8741", FUNC(taito8741_4pack_device::read_3), FUNC(taito8741_4pack_device::write_3)); map(0x40, 0x41).rw("mcu2", FUNC(upi41_cpu_device::upi41_master_r), FUNC(upi41_cpu_device::upi41_master_w));
map(0x40, 0x41).rw("taito8741", FUNC(taito8741_4pack_device::read_1), FUNC(taito8741_4pack_device::write_1));
map(0x60, 0x60).rw(FUNC(gsword_state::fake_0_r), FUNC(gsword_state::ay8910_control_port_0_w)); map(0x60, 0x60).rw(FUNC(gsword_state::fake_0_r), FUNC(gsword_state::ay8910_control_port_0_w));
map(0x61, 0x61).rw(m_ay0, FUNC(ay8910_device::data_r), FUNC(ay8910_device::data_w)); map(0x61, 0x61).rw(m_ay0, FUNC(ay8910_device::data_r), FUNC(ay8910_device::data_w));
map(0x80, 0x80).rw(FUNC(gsword_state::fake_1_r), FUNC(gsword_state::ay8910_control_port_1_w)); map(0x80, 0x80).rw(FUNC(gsword_state::fake_1_r), FUNC(gsword_state::ay8910_control_port_1_w));
@ -540,117 +637,130 @@ void josvolly_state::josvolly_cpu2_io_map(address_map &map)
static INPUT_PORTS_START( gsword ) static INPUT_PORTS_START( gsword )
PORT_START("IN0") /* IN0 (8741-2 port1?) */ PORT_START("MCU1.P1") // TODO: fake port for debugging - should be removed
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) PORT_BIT( 0x03, 0x02, IPT_UNUSED ) // these bits are used for communication
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 ) PORT_DIPNAME( 0x04, 0x04, "MCU1.P12" )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_DIPSETTING( 0x04, DEF_STR(Off) )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_DIPSETTING( 0x00, DEF_STR(On) )
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_DIPNAME( 0x08, 0x08, "MCU1.P13" )
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_DIPSETTING( 0x08, DEF_STR(Off) )
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_DIPSETTING( 0x00, DEF_STR(On) )
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1) PORT_DIPNAME( 0x10, 0x10, "MCU1.P14" )
PORT_DIPSETTING( 0x10, DEF_STR(Off) )
PORT_DIPSETTING( 0x00, DEF_STR(On) )
PORT_DIPNAME( 0x20, 0x20, "MCU1.P15" )
PORT_DIPSETTING( 0x20, DEF_STR(Off) )
PORT_DIPSETTING( 0x00, DEF_STR(On) )
PORT_DIPNAME( 0x40, 0x40, "MCU1.P16" )
PORT_DIPSETTING( 0x40, DEF_STR(Off) )
PORT_DIPSETTING( 0x00, DEF_STR(On) )
PORT_DIPNAME( 0x80, 0x80, "MCU1.P17" )
PORT_DIPSETTING( 0x80, DEF_STR(Off) )
PORT_DIPSETTING( 0x00, DEF_STR(On) )
PORT_START("IN1") /* IN1 (8741-2 port2?) */ PORT_START("IN0")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_DIPNAME( 0x04, 0x04, "MCU3.P12" ) // TODO: fake DIP switch for debugging - should be removed
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_DIPSETTING( 0x04, DEF_STR(Off) )
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_DIPSETTING( 0x00, DEF_STR(On) )
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON3 )
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
PORT_START("IN2") /* IN2 (8741-3 port1?) */ PORT_START("IN1")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_DIPNAME( 0x04, 0x04, "MCU3.P22" ) // TODO: fake DIP switch for debugging - should be removed
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_DIPSETTING( 0x04, DEF_STR(Off) )
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_DIPSETTING( 0x00, DEF_STR(On) )
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) // P26 and P27 are outputs for coin counters
PORT_START("IN3") /* IN3 (8741-3 port2?) */ PORT_START("COINS")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_COCKTAIL
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_COCKTAIL
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1)
PORT_START("IN4") /* IN4 (coins) */ PORT_START("DSW0")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unused ) ) PORT_DIPLOCATION("A:1")
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unused ) ) PORT_DIPLOCATION("A:2")
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_DIPNAME( 0x1c, 0x1c, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("A:3,4,5")
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1) PORT_DIPSETTING( 0x00, DEF_STR( 5C_1C ) )
PORT_DIPSETTING( 0x04, DEF_STR( 4C_1C ) )
PORT_DIPSETTING( 0x08, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x1c, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x18, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x14, DEF_STR( 1C_4C ) )
PORT_DIPSETTING( 0x10, DEF_STR( 1C_5C ) )
PORT_DIPSETTING( 0x0c, "1 Coin/10 Credits" )
// FIXME: these three DIP switches are physically present, but may not be connected to anything - turning them on seems to cause problems
PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("A:6")
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("A:7")
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("A:8")
PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_START("DSW0") /* DSW0 */ PORT_START("DSW1")
/* NOTE: Switches 0 & 1, 6,7,8 not used */ PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unused ) ) PORT_DIPLOCATION("B:1")
/* Coins configurations were handled */ PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
/* via external hardware & not via program */ PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x1c, 0x00, DEF_STR( Coin_A ) ) PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unused ) ) PORT_DIPLOCATION("B:2")
PORT_DIPSETTING( 0x1c, DEF_STR( 5C_1C ) ) PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
PORT_DIPSETTING( 0x18, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPSETTING( 0x14, DEF_STR( 2C_1C ) ) PORT_DIPNAME( 0x0c, 0x0c, "Fencing Difficulty" ) PORT_DIPLOCATION("B:3,4")
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x0c, DEF_STR( Easy ) )
PORT_DIPSETTING( 0x04, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x08, DEF_STR( Normal ) )
PORT_DIPSETTING( 0x08, DEF_STR( 1C_4C ) ) PORT_DIPSETTING( 0x04, DEF_STR( Hard ) )
PORT_DIPSETTING( 0x0c, DEF_STR( 1C_5C ) ) PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) )
PORT_DIPNAME( 0x10, 0x10, "Kendo Difficulty" ) PORT_DIPLOCATION("B:5")
PORT_DIPSETTING( 0x10, DEF_STR( Easy ) )
PORT_DIPSETTING( 0x00, DEF_STR( Hard ) )
PORT_DIPNAME( 0x20, 0x20, "Roman Difficulty" ) PORT_DIPLOCATION("B:6")
PORT_DIPSETTING( 0x20, DEF_STR( Easy ) )
PORT_DIPSETTING( 0x00, DEF_STR( Hard ) )
PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("B:7")
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x80, 0x80, DEF_STR( Lives ) ) PORT_DIPLOCATION("B:8")
PORT_DIPSETTING( 0x80, "1" )
PORT_DIPSETTING( 0x00, "255 (Cheat)" )
PORT_START("DSW1") /* DSW1 */ PORT_START("DSW2")
PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unused ) ) PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unused ) ) PORT_DIPLOCATION("C:1")
PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
PORT_DIPSETTING( 0x01, DEF_STR( On ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unused ) ) PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unused ) ) PORT_DIPLOCATION("C:2")
PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
PORT_DIPSETTING( 0x02, DEF_STR( On ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x0c, 0x00, "Fencing Difficulty" ) PORT_DIPNAME( 0x04, 0x04, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("C:3")
PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x04, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPSETTING( 0x08, DEF_STR( Hard ) ) PORT_DIPNAME( 0x08, 0x08, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("C:4")
PORT_DIPSETTING( 0x0c, DEF_STR( Hardest ) ) PORT_DIPSETTING( 0x08, DEF_STR( Upright ) )
PORT_DIPNAME( 0x10, 0x00, "Kendo Difficulty" ) PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) )
PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) PORT_DIPNAME( 0x30, 0x30, "First Stage" ) PORT_DIPLOCATION("C:5,6")
PORT_DIPSETTING( 0x10, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x30, "Fencing" )
PORT_DIPNAME( 0x20, 0x00, "Roman Difficulty" ) PORT_DIPSETTING( 0x20, "Kendo" )
PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x10, "Roman" )
PORT_DIPSETTING( 0x20, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x00, "Kendo" )
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Demo_Sounds ) ) PORT_DIPNAME( 0x40, 0x40, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("C:7")
PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
PORT_DIPSETTING( 0x40, DEF_STR( On ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x80, 0x00, DEF_STR( Lives ) ) PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) ) PORT_DIPLOCATION("C:8")
PORT_DIPSETTING( 0x00, "1" ) PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
PORT_DIPSETTING( 0x80, "255 (Cheat)" ) PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_START("DSW2") /* DSW2 */
PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unused ) )
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x01, DEF_STR( On ) )
PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unused ) )
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x02, DEF_STR( On ) )
PORT_DIPNAME( 0x04, 0x00, DEF_STR( Free_Play ) )
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x04, DEF_STR( On ) )
PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
PORT_DIPSETTING( 0x00, DEF_STR( Upright ) )
PORT_DIPSETTING( 0x08, DEF_STR( Cocktail ) )
PORT_DIPNAME( 0x30, 0x00, "First Stage" )
PORT_DIPSETTING( 0x00, "Fencing" )
PORT_DIPSETTING( 0x10, "Kendo" )
PORT_DIPSETTING( 0x20, "Roman" )
// PORT_DIPSETTING( 0x30, "Kendo" )
PORT_DIPNAME( 0x40, 0x00, DEF_STR( Flip_Screen ) )
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x40, DEF_STR( On ) )
PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unused ) )
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x80, DEF_STR( On ) )
INPUT_PORTS_END INPUT_PORTS_END
static INPUT_PORTS_START( josvolly ) static INPUT_PORTS_START( josvolly )
@ -785,29 +895,45 @@ GFXDECODE_END
MACHINE_CONFIG_START(gsword_state::gsword) MACHINE_CONFIG_START(gsword_state::gsword)
/* basic machine hardware */ /* basic machine hardware */
MCFG_DEVICE_ADD("maincpu", Z80, XTAL(18'000'000)/6) /* verified on pcb */ MCFG_DEVICE_ADD(m_maincpu, Z80, XTAL(18'000'000)/6) /* verified on pcb */
MCFG_DEVICE_PROGRAM_MAP(cpu1_map) MCFG_DEVICE_PROGRAM_MAP(cpu1_map)
MCFG_DEVICE_IO_MAP(cpu1_io_map) MCFG_DEVICE_IO_MAP(cpu1_io_map)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", gsword_state, irq0_line_hold) MCFG_DEVICE_VBLANK_INT_DRIVER("screen", gsword_state, irq0_line_hold)
MCFG_DEVICE_ADD("sub", Z80, XTAL(18'000'000)/6) /* verified on pcb */ MCFG_DEVICE_ADD(m_subcpu, Z80, XTAL(18'000'000)/6) /* verified on pcb */
MCFG_DEVICE_PROGRAM_MAP(cpu2_map) MCFG_DEVICE_PROGRAM_MAP(cpu2_map)
MCFG_DEVICE_IO_MAP(cpu2_io_map) MCFG_DEVICE_IO_MAP(cpu2_io_map)
MCFG_DEVICE_PERIODIC_INT_DRIVER(gsword_state, sound_interrupt, 4*60) MCFG_DEVICE_PERIODIC_INT_DRIVER(gsword_state, sound_interrupt, 4*60)
MCFG_DEVICE_ADD("audiocpu", Z80, XTAL(18'000'000)/6) /* verified on pcb */ MCFG_DEVICE_ADD(m_audiocpu, Z80, XTAL(18'000'000)/6) /* verified on pcb */
MCFG_DEVICE_PROGRAM_MAP(cpu3_map) MCFG_DEVICE_PROGRAM_MAP(cpu3_map)
MCFG_QUANTUM_TIME(attotime::from_hz(12000)) /* Allow time for 2nd cpu to interleave*/ upi41_cpu_device &mcu1(I8041(config, "mcu1", 12'000'000/2)); // clock unknown, using value from gladiatr
mcu1.p1_in_cb().set([this] () { return ioport("MCU1.P1")->read() | BIT(m_mcu2_p1, 0); });
mcu1.p1_out_cb().set([this] (uint8_t data) { m_mcu1_p1 = data; });
mcu1.p2_in_cb().set_ioport("DSW2");
mcu1.t0_in_cb().set([this] () { return m_tclk_val ? 1 : 0; }); // serial clock
mcu1.t1_in_cb().set([this] () { return BIT(m_mcu2_p1, 1); }); // from P11 on other MCU
MCFG_TAITO8741_ADD("taito8741") upi41_cpu_device &mcu2(I8041(config, "mcu2", 12'000'000/2)); // clock unknown, using value from gladiatr
MCFG_TAITO8741_MODES(TAITO8741_MASTER,TAITO8741_SLAVE,TAITO8741_PORT,TAITO8741_PORT) mcu2.p1_in_cb().set(FUNC(gsword_state::mcu2_p1_r));
MCFG_TAITO8741_CONNECT(1,0,0,0) mcu2.p1_out_cb().set([this] (uint8_t data) { m_mcu2_p1 = data; });
MCFG_TAITO8741_PORT_HANDLERS(IOPORT("DSW2"),IOPORT("DSW1"),READ8(*this, gsword_state,i8741_2_r),READ8(*this, gsword_state,i8741_3_r)) mcu2.p2_in_cb().set_ioport("DSW1");
#if 1 mcu2.t0_in_cb().set([this] () { return m_tclk_val ? 1 : 0; }); // serial clock
/* to MCU timeout champbbj */ mcu2.t1_in_cb().set([this] () { return BIT(m_mcu1_p1, 1); }); // from P11 on other MCU
MCFG_QUANTUM_TIME(attotime::from_hz(6000))
#endif upi41_cpu_device &mcu3(I8041(config, "mcu3", 12'000'000/2)); // clock unknown, using value from gladiatr
mcu3.p1_in_cb().set_ioport("IN0");
mcu3.p2_in_cb().set_ioport("IN1");
mcu3.p2_out_cb().set(FUNC(gsword_state::mcu3_p2_w));
mcu3.t0_in_cb().set_ioport("COINS").bit(0);
mcu3.t1_in_cb().set_ioport("COINS").bit(1);
// clock unknown, using value from gladiatr
CLOCK(config, "tclk", 12'000'000/8/128/2).signal_handler().set([this] (int state) { m_tclk_val = state != 0; });
// lazy way to ensure communication works
MCFG_QUANTUM_PERFECT_CPU("mcu1")
/* video hardware */ /* video hardware */
MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_ADD("screen", RASTER)
@ -852,20 +978,20 @@ MACHINE_CONFIG_START(josvolly_state::josvolly)
MCFG_DEVICE_IO_MAP(josvolly_cpu2_io_map) MCFG_DEVICE_IO_MAP(josvolly_cpu2_io_map)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", josvolly_state, irq0_line_assert) MCFG_DEVICE_VBLANK_INT_DRIVER("screen", josvolly_state, irq0_line_assert)
MCFG_DEVICE_ADD("mcu1", I8741, 18000000/2) /* ? */ upi41_cpu_device &mcu1(I8741(config, "mcu1", 18000000/2)); /* ? */
MCFG_MCS48_PORT_P1_IN_CB(READ8(*this, josvolly_state, mcu1_p1_r)) mcu1.p1_in_cb().set(FUNC(josvolly_state::mcu1_p1_r));
MCFG_MCS48_PORT_P1_OUT_CB(WRITE8(*this, josvolly_state, mcu1_p1_w)) mcu1.p1_out_cb().set(FUNC(josvolly_state::mcu1_p1_w));
MCFG_MCS48_PORT_P2_IN_CB(READ8(*this, josvolly_state, mcu1_p2_r)) mcu1.p2_in_cb().set(FUNC(josvolly_state::mcu1_p2_r));
MCFG_MCS48_PORT_P2_OUT_CB(WRITE8(*this, josvolly_state, mcu1_p2_w)) mcu1.p2_out_cb().set(FUNC(josvolly_state::mcu1_p2_w));
i8741_device &mcu2(I8741(config, "mcu2", 12000000/2)); /* ? */ upi41_cpu_device &mcu2(I8741(config, "mcu2", 12000000/2)); /* ? */
mcu2.p1_in_cb().set(FUNC(josvolly_state::mcu2_p1_r)); mcu2.p1_in_cb().set(FUNC(josvolly_state::mcu2_p1_r));
mcu2.p1_out_cb().set(FUNC(josvolly_state::mcu2_p1_w)); mcu2.p1_out_cb().set(FUNC(josvolly_state::mcu2_p1_w));
mcu2.p2_in_cb().set(FUNC(josvolly_state::mcu2_p2_r)); mcu2.p2_in_cb().set(FUNC(josvolly_state::mcu2_p2_r));
mcu2.p2_out_cb().set(FUNC(josvolly_state::mcu2_p2_w)); mcu2.p2_out_cb().set(FUNC(josvolly_state::mcu2_p2_w));
// TEST0 and TEST1 are driven by P20 and P21 on the other MCU // TEST0 and TEST1 are driven by P20 and P21 on the other MCU
mcu2.t0_in_cb().set("mcu1", FUNC(i8741_device::p2_r)).bit(0); mcu2.t0_in_cb().set("mcu1", FUNC(upi41_cpu_device::p2_r)).bit(0);
mcu2.t1_in_cb().set("mcu1", FUNC(i8741_device::p2_r)).bit(1); mcu2.t1_in_cb().set("mcu1", FUNC(upi41_cpu_device::p2_r)).bit(1);
i8255_device &ppi(I8255(config, "aa_007")); i8255_device &ppi(I8255(config, "aa_007"));
ppi.in_pa_callback().set_ioport("IN1"); // 1PL ppi.in_pa_callback().set_ioport("IN1"); // 1PL
@ -922,39 +1048,39 @@ ROM_START( gsword )
ROM_LOAD( "ac10-15.5h", 0x0000, 0x2000, CRC(b74e9d43) SHA1(d6e9e05e2e652c9d467dba1f1501d2a7ec8f851c) ) ROM_LOAD( "ac10-15.5h", 0x0000, 0x2000, CRC(b74e9d43) SHA1(d6e9e05e2e652c9d467dba1f1501d2a7ec8f851c) )
ROM_LOAD( "ac0-16.7h", 0x2000, 0x2000, CRC(10accc10) SHA1(311961bfe852582a9c66aaecf9bc4c8f0ac7fccf) ) ROM_LOAD( "ac0-16.7h", 0x2000, 0x2000, CRC(10accc10) SHA1(311961bfe852582a9c66aaecf9bc4c8f0ac7fccf) )
ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64K for 3nd z80 */ ROM_REGION( 0x10000, "audiocpu", 0 ) // 64K for 3nd z80
ROM_LOAD( "ac10-12.3a", 0x0000, 0x2000, CRC(56eac59f) SHA1(22bde858ddcafad3f731030c39fd525458ecdbdd) ) ROM_LOAD( "ac10-12.3a", 0x0000, 0x2000, CRC(56eac59f) SHA1(22bde858ddcafad3f731030c39fd525458ecdbdd) )
ROM_LOAD( "ac10-13.4a", 0x2000, 0x2000, CRC(3a920eaa) SHA1(256fafda0d522dee993b6840e60532f11a705345) ) ROM_LOAD( "ac10-13.4a", 0x2000, 0x2000, CRC(3a920eaa) SHA1(256fafda0d522dee993b6840e60532f11a705345) )
ROM_LOAD( "ac10-14.3d", 0x4000, 0x2000, CRC(819db933) SHA1(5e8b10d94ca6ba608a074bd5f30f14b95122fe85) ) ROM_LOAD( "ac10-14.3d", 0x4000, 0x2000, CRC(819db933) SHA1(5e8b10d94ca6ba608a074bd5f30f14b95122fe85) )
ROM_LOAD( "ac10-17.4d", 0x6000, 0x2000, CRC(87817985) SHA1(370399a4622958829ca6d1545e614b121f09c2c0) ) ROM_LOAD( "ac10-17.4d", 0x6000, 0x2000, CRC(87817985) SHA1(370399a4622958829ca6d1545e614b121f09c2c0) )
ROM_REGION( 0x10000, "cpu3", 0 ) /* 8741 */ ROM_REGION( 0x0400, "mcu1", 0 ) // 8041AH
ROM_LOAD( "aa-013.5a", 0x0000, 0x0800, NO_DUMP ) ROM_LOAD( "aa-013.5a", 0x0000, 0x0400, CRC(e546aa52) SHA1(b8197c836713b1ace8ecd8238e645405c929364f) )
ROM_REGION( 0x10000, "cpu4", 0 ) /* 8741 */ ROM_REGION( 0x0400, "mcu2", 0 ) // 8041AH
ROM_LOAD( "aa-016.9c", 0x0000, 0x0800, NO_DUMP ) ROM_LOAD( "aa-016.9c", 0x0000, 0x0400, CRC(e546aa52) SHA1(b8197c836713b1ace8ecd8238e645405c929364f) )
ROM_REGION( 0x10000, "cpu5", 0 ) /* 8741 */ ROM_REGION( 0x0400, "mcu3", 0 ) // 8041AH
ROM_LOAD( "aa-017.9g", 0x0000, 0x0800, NO_DUMP ) ROM_LOAD( "aa-017.9g", 0x0000, 0x0400, CRC(e546aa52) SHA1(b8197c836713b1ace8ecd8238e645405c929364f) )
ROM_REGION( 0x4000, "gfx1", 0 ) ROM_REGION( 0x4000, "gfx1", 0 )
ROM_LOAD( "ac1-10.9n", 0x0000, 0x2000, CRC(517c571b) SHA1(05572a8ea416922da50143936fda9ba038f0b91e) ) /* tiles */ ROM_LOAD( "ac1-10.9n", 0x0000, 0x2000, CRC(517c571b) SHA1(05572a8ea416922da50143936fda9ba038f0b91e) ) // tiles
ROM_LOAD( "ac1-11.9p", 0x2000, 0x2000, CRC(7a1d8a3a) SHA1(3f90be9ddba3cf7a879fd69ac67c2b67fd63b9ee) ) ROM_LOAD( "ac1-11.9p", 0x2000, 0x2000, CRC(7a1d8a3a) SHA1(3f90be9ddba3cf7a879fd69ac67c2b67fd63b9ee) )
ROM_REGION( 0x2000, "gfx2", 0 ) ROM_REGION( 0x2000, "gfx2", 0 )
ROM_LOAD( "ac1-6.9e", 0x0000, 0x2000, CRC(1b0a3cb7) SHA1(0b0f17b9844d7310b46110559e09cfc3b50bb38b) ) /* sprites */ ROM_LOAD( "ac1-6.9e", 0x0000, 0x2000, CRC(1b0a3cb7) SHA1(0b0f17b9844d7310b46110559e09cfc3b50bb38b) ) // sprites
ROM_REGION( 0x4000, "gfx3", 0 ) ROM_REGION( 0x4000, "gfx3", 0 )
ROM_LOAD( "ac0-7.9f", 0x0000, 0x2000, CRC(ef5f28c6) SHA1(85d943e5c5136d9458118f676b0c79fcf3aaf0c4) ) ROM_LOAD( "ac0-7.9f", 0x0000, 0x2000, CRC(ef5f28c6) SHA1(85d943e5c5136d9458118f676b0c79fcf3aaf0c4) )
ROM_LOAD( "ac0-8.9h", 0x2000, 0x2000, CRC(46824b30) SHA1(f6880b1c31ae795e3781d16ee96145df1db60328) ) ROM_LOAD( "ac0-8.9h", 0x2000, 0x2000, CRC(46824b30) SHA1(f6880b1c31ae795e3781d16ee96145df1db60328) )
ROM_REGION( 0x0360, "proms", 0 ) ROM_REGION( 0x0360, "proms", 0 )
ROM_LOAD( "ac0-1.11c", 0x0000, 0x0100, CRC(5c4b2adc) SHA1(0a6fdd60bdbd56bb7573147e4a976e5d0ddf43b5) ) /* palette low bits */ ROM_LOAD( "ac0-1.11c", 0x0000, 0x0100, CRC(5c4b2adc) SHA1(0a6fdd60bdbd56bb7573147e4a976e5d0ddf43b5) ) // palette low bits
ROM_LOAD( "ac0-2.11cd", 0x0100, 0x0100, CRC(966bda66) SHA1(05439508113b3e51a16ee87d3f4691aa8901ebcb) ) /* palette high bits */ ROM_LOAD( "ac0-2.11cd", 0x0100, 0x0100, CRC(966bda66) SHA1(05439508113b3e51a16ee87d3f4691aa8901ebcb) ) // palette high bits
ROM_LOAD( "ac0-3.8c", 0x0200, 0x0100, CRC(dae13f77) SHA1(d4d105542955e806311987dd3c4ffce1e13caf91) ) /* sprite lookup table */ ROM_LOAD( "ac0-3.8c", 0x0200, 0x0100, CRC(dae13f77) SHA1(d4d105542955e806311987dd3c4ffce1e13caf91) ) // sprite lookup table
ROM_LOAD( "003.4e", 0x0300, 0x0020, CRC(43a548b8) SHA1(d01529d7f8f5101232cdf3490fdb2c61bf179181) ) /* address decoder? not used */ ROM_LOAD( "003.4e", 0x0300, 0x0020, CRC(43a548b8) SHA1(d01529d7f8f5101232cdf3490fdb2c61bf179181) ) // address decoder? not used
ROM_LOAD( "004.4d", 0x0320, 0x0020, CRC(43a548b8) SHA1(d01529d7f8f5101232cdf3490fdb2c61bf179181) ) /* address decoder? not used */ ROM_LOAD( "004.4d", 0x0320, 0x0020, CRC(43a548b8) SHA1(d01529d7f8f5101232cdf3490fdb2c61bf179181) ) // address decoder? not used
ROM_LOAD( "005.3h", 0x0340, 0x0020, CRC(e8d6dec0) SHA1(d15cba9a4b24255d41046b15c2409391ab13ce95) ) /* address decoder? not used */ ROM_LOAD( "005.3h", 0x0340, 0x0020, CRC(e8d6dec0) SHA1(d15cba9a4b24255d41046b15c2409391ab13ce95) ) // address decoder? not used
ROM_END ROM_END
ROM_START( gsword2 ) ROM_START( gsword2 )
@ -969,39 +1095,39 @@ ROM_START( gsword2 )
ROM_LOAD( "ac0-15.5h", 0x0000, 0x2000, CRC(1aa4690e) SHA1(7b0dbc38f3e6af2c9efa44b6759a3cdd9adc992d) ) ROM_LOAD( "ac0-15.5h", 0x0000, 0x2000, CRC(1aa4690e) SHA1(7b0dbc38f3e6af2c9efa44b6759a3cdd9adc992d) )
ROM_LOAD( "ac0-16.7h", 0x2000, 0x2000, CRC(10accc10) SHA1(311961bfe852582a9c66aaecf9bc4c8f0ac7fccf) ) ROM_LOAD( "ac0-16.7h", 0x2000, 0x2000, CRC(10accc10) SHA1(311961bfe852582a9c66aaecf9bc4c8f0ac7fccf) )
ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64K for 3nd z80 */ ROM_REGION( 0x10000, "audiocpu", 0 ) // 64K for 3nd z80
ROM_LOAD( "ac0-12.3a", 0x0000, 0x2000, CRC(a6589068) SHA1(9385abe2449c5c5bac8f49d2afd140acea1791c3) ) ROM_LOAD( "ac0-12.3a", 0x0000, 0x2000, CRC(a6589068) SHA1(9385abe2449c5c5bac8f49d2afd140acea1791c3) )
ROM_LOAD( "ac0-13.4a", 0x2000, 0x2000, CRC(4ee79796) SHA1(3353625903f63910a18fae0a9568a96d75592328) ) ROM_LOAD( "ac0-13.4a", 0x2000, 0x2000, CRC(4ee79796) SHA1(3353625903f63910a18fae0a9568a96d75592328) )
ROM_LOAD( "ac0-14.3d", 0x4000, 0x2000, CRC(455364b6) SHA1(ebabf077d1ba113c13e7620d61720ed141acb5ad) ) ROM_LOAD( "ac0-14.3d", 0x4000, 0x2000, CRC(455364b6) SHA1(ebabf077d1ba113c13e7620d61720ed141acb5ad) )
/* 6000-7fff empty */ // 6000-7fff empty
ROM_REGION( 0x10000, "cpu3", 0 ) /* 8741 */ ROM_REGION( 0x0400, "mcu1", 0 ) // 8041AH
ROM_LOAD( "aa-013.5a", 0x0000, 0x0800, NO_DUMP ) ROM_LOAD( "aa-013.5a", 0x0000, 0x0400, CRC(e546aa52) SHA1(b8197c836713b1ace8ecd8238e645405c929364f) )
ROM_REGION( 0x10000, "cpu4", 0 ) /* 8741 */ ROM_REGION( 0x0400, "mcu2", 0 ) // 8041AH
ROM_LOAD( "aa-016.9c", 0x0000, 0x0800, NO_DUMP ) ROM_LOAD( "aa-016.9c", 0x0000, 0x0400, CRC(e546aa52) SHA1(b8197c836713b1ace8ecd8238e645405c929364f) )
ROM_REGION( 0x10000, "cpu5", 0 ) /* 8741 */ ROM_REGION( 0x0400, "mcu3", 0 ) // 8041AH
ROM_LOAD( "aa-017.9g", 0x0000, 0x0800, NO_DUMP ) ROM_LOAD( "aa-017.9g", 0x0000, 0x0400, CRC(e546aa52) SHA1(b8197c836713b1ace8ecd8238e645405c929364f) )
ROM_REGION( 0x4000, "gfx1", 0 ) ROM_REGION( 0x4000, "gfx1", 0 )
ROM_LOAD( "ac1-10.9n", 0x0000, 0x2000, CRC(517c571b) SHA1(05572a8ea416922da50143936fda9ba038f0b91e) ) /* tiles */ ROM_LOAD( "ac1-10.9n", 0x0000, 0x2000, CRC(517c571b) SHA1(05572a8ea416922da50143936fda9ba038f0b91e) ) // tiles
ROM_LOAD( "ac1-11.9p", 0x2000, 0x2000, CRC(7a1d8a3a) SHA1(3f90be9ddba3cf7a879fd69ac67c2b67fd63b9ee) ) ROM_LOAD( "ac1-11.9p", 0x2000, 0x2000, CRC(7a1d8a3a) SHA1(3f90be9ddba3cf7a879fd69ac67c2b67fd63b9ee) )
ROM_REGION( 0x2000, "gfx2", 0 ) ROM_REGION( 0x2000, "gfx2", 0 )
ROM_LOAD( "ac1-6.9e", 0x0000, 0x2000, CRC(1b0a3cb7) SHA1(0b0f17b9844d7310b46110559e09cfc3b50bb38b) ) /* sprites */ ROM_LOAD( "ac1-6.9e", 0x0000, 0x2000, CRC(1b0a3cb7) SHA1(0b0f17b9844d7310b46110559e09cfc3b50bb38b) ) // sprites
ROM_REGION( 0x4000, "gfx3", 0 ) ROM_REGION( 0x4000, "gfx3", 0 )
ROM_LOAD( "ac0-7.9f", 0x0000, 0x2000, CRC(ef5f28c6) SHA1(85d943e5c5136d9458118f676b0c79fcf3aaf0c4) ) ROM_LOAD( "ac0-7.9f", 0x0000, 0x2000, CRC(ef5f28c6) SHA1(85d943e5c5136d9458118f676b0c79fcf3aaf0c4) )
ROM_LOAD( "ac0-8.9h", 0x2000, 0x2000, CRC(46824b30) SHA1(f6880b1c31ae795e3781d16ee96145df1db60328) ) ROM_LOAD( "ac0-8.9h", 0x2000, 0x2000, CRC(46824b30) SHA1(f6880b1c31ae795e3781d16ee96145df1db60328) )
ROM_REGION( 0x0360, "proms", 0 ) ROM_REGION( 0x0360, "proms", 0 )
ROM_LOAD( "ac0-1.11c", 0x0000, 0x0100, CRC(5c4b2adc) SHA1(0a6fdd60bdbd56bb7573147e4a976e5d0ddf43b5) ) /* palette low bits */ ROM_LOAD( "ac0-1.11c", 0x0000, 0x0100, CRC(5c4b2adc) SHA1(0a6fdd60bdbd56bb7573147e4a976e5d0ddf43b5) ) // palette low bits
ROM_LOAD( "ac0-2.11cd", 0x0100, 0x0100, CRC(966bda66) SHA1(05439508113b3e51a16ee87d3f4691aa8901ebcb) ) /* palette high bits */ ROM_LOAD( "ac0-2.11cd", 0x0100, 0x0100, CRC(966bda66) SHA1(05439508113b3e51a16ee87d3f4691aa8901ebcb) ) // palette high bits
ROM_LOAD( "ac0-3.8c", 0x0200, 0x0100, CRC(dae13f77) SHA1(d4d105542955e806311987dd3c4ffce1e13caf91) ) /* sprite lookup table */ ROM_LOAD( "ac0-3.8c", 0x0200, 0x0100, CRC(dae13f77) SHA1(d4d105542955e806311987dd3c4ffce1e13caf91) ) // sprite lookup table
ROM_LOAD( "003.4e", 0x0300, 0x0020, CRC(43a548b8) SHA1(d01529d7f8f5101232cdf3490fdb2c61bf179181) ) /* address decoder? not used */ ROM_LOAD( "003.4e", 0x0300, 0x0020, CRC(43a548b8) SHA1(d01529d7f8f5101232cdf3490fdb2c61bf179181) ) // address decoder? not used
ROM_LOAD( "004.4d", 0x0320, 0x0020, CRC(43a548b8) SHA1(d01529d7f8f5101232cdf3490fdb2c61bf179181) ) /* address decoder? not used */ ROM_LOAD( "004.4d", 0x0320, 0x0020, CRC(43a548b8) SHA1(d01529d7f8f5101232cdf3490fdb2c61bf179181) ) // address decoder? not used
ROM_LOAD( "005.3h", 0x0340, 0x0020, CRC(e8d6dec0) SHA1(d15cba9a4b24255d41046b15c2409391ab13ce95) ) /* address decoder? not used */ ROM_LOAD( "005.3h", 0x0340, 0x0020, CRC(e8d6dec0) SHA1(d15cba9a4b24255d41046b15c2409391ab13ce95) ) // address decoder? not used
ROM_END ROM_END
ROM_START( josvolly ) ROM_START( josvolly )
@ -1015,38 +1141,38 @@ ROM_START( josvolly )
ROM_LOAD( "aa3-12.2h", 0x0000, 0x1000, CRC(3796bbf6) SHA1(8741f556ddb06e7779d1e8abc3d06688881f8269) ) ROM_LOAD( "aa3-12.2h", 0x0000, 0x1000, CRC(3796bbf6) SHA1(8741f556ddb06e7779d1e8abc3d06688881f8269) )
ROM_LOAD( "aa0-13.2j", 0x2000, 0x2000, CRC(58cc89ac) SHA1(9785ec27e593b3e249da7a1b6b025c6d573e28f9) ) ROM_LOAD( "aa0-13.2j", 0x2000, 0x2000, CRC(58cc89ac) SHA1(9785ec27e593b3e249da7a1b6b025c6d573e28f9) )
ROM_REGION( 0x04000, "user1", 0 ) /* music data and samples - not sure where it's mapped */ ROM_REGION( 0x04000, "user1", 0 ) // music data and samples - not sure where it's mapped
ROM_LOAD( "aa0-14.4j", 0x0000, 0x2000, CRC(436fe91f) SHA1(feb29501090c6db911e13ce6e9935ba004b0ce7e) ) ROM_LOAD( "aa0-14.4j", 0x0000, 0x2000, CRC(436fe91f) SHA1(feb29501090c6db911e13ce6e9935ba004b0ce7e) )
ROM_REGION( 0x400, "mcu1", 0 ) ROM_REGION( 0x400, "mcu1", 0 )
ROM_LOAD( "aa003.bin", 0x0000, 0x400, CRC(68b399d9) SHA1(053482d12c2b714c23fc80ad0589a2afd258a5a6) ) ROM_LOAD( "aa003.bin", 0x0000, 0x400, CRC(68b399d9) SHA1(053482d12c2b714c23fc80ad0589a2afd258a5a6) )
ROM_REGION( 0x400, "mcu2", 0 ) ROM_REGION( 0x400, "mcu2", 0 )
ROM_LOAD( "aa008.bin", 0x0000, 0x400, CRC(68b399d9) SHA1(053482d12c2b714c23fc80ad0589a2afd258a5a6) BAD_DUMP ) ROM_LOAD( "aa008.bin", 0x0000, 0x400, CRC(68b399d9) SHA1(053482d12c2b714c23fc80ad0589a2afd258a5a6) )
ROM_REGION( 0x4000, "gfx1", 0 ) ROM_REGION( 0x4000, "gfx1", 0 )
ROM_LOAD( "aa0-10.9n", 0x0000, 0x2000, CRC(207c4f42) SHA1(4cf2922d55cfc9e68cc07c3252ea3b5619b8aca5) ) /* tiles */ ROM_LOAD( "aa0-10.9n", 0x0000, 0x2000, CRC(207c4f42) SHA1(4cf2922d55cfc9e68cc07c3252ea3b5619b8aca5) ) // tiles */
ROM_LOAD( "aa1-11.9p", 0x2000, 0x1000, CRC(c130464a) SHA1(9d23577b8aaaffeefff3d8f93668d1b2bd0ba3d9) ) ROM_LOAD( "aa1-11.9p", 0x2000, 0x1000, CRC(c130464a) SHA1(9d23577b8aaaffeefff3d8f93668d1b2bd0ba3d9) )
ROM_RELOAD( 0x3000, 0x1000 ) // title screen data is actually read from here ROM_RELOAD( 0x3000, 0x1000 ) // title screen data is actually read from here
ROM_REGION( 0x2000, "gfx2", 0 ) ROM_REGION( 0x2000, "gfx2", 0 )
ROM_LOAD( "aa0-6.9e", 0x0000, 0x2000, CRC(c2c2401a) SHA1(ef987d53d9e502277086f39b455174d3539572e6) ) /* sprites */ ROM_LOAD( "aa0-6.9e", 0x0000, 0x2000, CRC(c2c2401a) SHA1(ef987d53d9e502277086f39b455174d3539572e6) ) // sprites */
ROM_REGION( 0x4000, "gfx3", 0 ) ROM_REGION( 0x4000, "gfx3", 0 )
ROM_LOAD( "aa0-7.9f", 0x0000, 0x2000, CRC(da836231) SHA1(209723778b705dba8206b56c3b8f0996f02ba8d5) ) ROM_LOAD( "aa0-7.9f", 0x0000, 0x2000, CRC(da836231) SHA1(209723778b705dba8206b56c3b8f0996f02ba8d5) )
ROM_LOAD( "aa0-8.9h", 0x2000, 0x2000, CRC(a0426d57) SHA1(d029408e005ea57f4902c081203f3d3980a5f927) ) ROM_LOAD( "aa0-8.9h", 0x2000, 0x2000, CRC(a0426d57) SHA1(d029408e005ea57f4902c081203f3d3980a5f927) )
ROM_REGION( 0x0460, "proms", 0 ) ROM_REGION( 0x0460, "proms", 0 )
ROM_LOAD( "a1.10k", 0x0000, 0x0100, CRC(09f7b56a) SHA1(9b82d1d4ebab14b366dc0ca95c933e37811ac155) ) /* palette red? */ ROM_LOAD( "a1.10k", 0x0000, 0x0100, CRC(09f7b56a) SHA1(9b82d1d4ebab14b366dc0ca95c933e37811ac155) ) // palette red?
ROM_LOAD( "a2.9k", 0x0100, 0x0100, CRC(852eceac) SHA1(6ed7011b45cf767d6503b92d29a14a7b8e099a76) ) /* palette green? */ ROM_LOAD( "a2.9k", 0x0100, 0x0100, CRC(852eceac) SHA1(6ed7011b45cf767d6503b92d29a14a7b8e099a76) ) // palette green?
ROM_LOAD( "a3.9j", 0x0200, 0x0100, CRC(1312718b) SHA1(4a7d7eae4d8ea085eead46758832fddac7aff0b0) ) /* palette blue? */ ROM_LOAD( "a3.9j", 0x0200, 0x0100, CRC(1312718b) SHA1(4a7d7eae4d8ea085eead46758832fddac7aff0b0) ) // palette blue?
ROM_LOAD( "a4.8c", 0x0300, 0x0100, CRC(1dcec967) SHA1(4d36842c2fd929a6508a58bc8ea7e0372296e575) ) /* sprite lookup table */ ROM_LOAD( "a4.8c", 0x0300, 0x0100, CRC(1dcec967) SHA1(4d36842c2fd929a6508a58bc8ea7e0372296e575) ) // sprite lookup table
ROM_LOAD( "003.4e", 0x0400, 0x0020, CRC(43a548b8) SHA1(d01529d7f8f5101232cdf3490fdb2c61bf179181) ) /* address decoder? not used */ ROM_LOAD( "003.4e", 0x0400, 0x0020, CRC(43a548b8) SHA1(d01529d7f8f5101232cdf3490fdb2c61bf179181) ) // address decoder? not used
ROM_LOAD( "004.4d", 0x0420, 0x0020, CRC(43a548b8) SHA1(d01529d7f8f5101232cdf3490fdb2c61bf179181) ) /* address decoder? not used */ ROM_LOAD( "004.4d", 0x0420, 0x0020, CRC(43a548b8) SHA1(d01529d7f8f5101232cdf3490fdb2c61bf179181) ) // address decoder? not used
ROM_LOAD( "005.3h", 0x0440, 0x0020, CRC(e8d6dec0) SHA1(d15cba9a4b24255d41046b15c2409391ab13ce95) ) /* address decoder? not used */ ROM_LOAD( "005.3h", 0x0440, 0x0020, CRC(e8d6dec0) SHA1(d15cba9a4b24255d41046b15c2409391ab13ce95) ) // address decoder? not used
ROM_END ROM_END
GAME( 1983, josvolly, 0, josvolly, josvolly, josvolly_state, empty_init, ROT90, "Allumer / Taito Corporation", "Joshi Volleyball", MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) GAME( 1983, josvolly, 0, josvolly, josvolly, josvolly_state, empty_init, ROT90, "Allumer / Taito Corporation", "Joshi Volleyball", MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
GAME( 1984, gsword, 0, gsword, gsword, gsword_state, init_gsword, ROT0, "Allumer / Taito Corporation", "Great Swordsman (World?)", MACHINE_SUPPORTS_SAVE ) GAME( 1984, gsword, 0, gsword, gsword, gsword_state, init_gsword, ROT0, "Allumer / Taito Corporation", "Great Swordsman (World?)", MACHINE_UNEMULATED_PROTECTION | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
GAME( 1984, gsword2, gsword, gsword, gsword, gsword_state, init_gsword2, ROT0, "Allumer / Taito Corporation", "Great Swordsman (Japan?)", MACHINE_SUPPORTS_SAVE ) GAME( 1984, gsword2, gsword, gsword, gsword, gsword_state, init_gsword2, ROT0, "Allumer / Taito Corporation", "Great Swordsman (Japan?)", MACHINE_UNEMULATED_PROTECTION | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )

View File

@ -81,8 +81,12 @@ public:
: gsword_state_base(mconfig, type, tag) : gsword_state_base(mconfig, type, tag)
, m_soundlatch(*this, "soundlatch") , m_soundlatch(*this, "soundlatch")
, m_msm(*this, "msm") , m_msm(*this, "msm")
, m_dsw0(*this, "DSW0")
, m_protect_hack(false) , m_protect_hack(false)
, m_nmi_enable(false) , m_nmi_enable(false)
, m_tclk_val(false)
, m_mcu1_p1(0xff)
, m_mcu2_p1(0xff)
{ {
} }
@ -96,8 +100,8 @@ protected:
DECLARE_WRITE8_MEMBER(nmi_set_w); DECLARE_WRITE8_MEMBER(nmi_set_w);
DECLARE_WRITE8_MEMBER(sound_command_w); DECLARE_WRITE8_MEMBER(sound_command_w);
DECLARE_WRITE8_MEMBER(adpcm_data_w); DECLARE_WRITE8_MEMBER(adpcm_data_w);
DECLARE_READ8_MEMBER(i8741_2_r); DECLARE_READ8_MEMBER(mcu2_p1_r);
DECLARE_READ8_MEMBER(i8741_3_r); DECLARE_WRITE8_MEMBER(mcu3_p2_w);
INTERRUPT_GEN_MEMBER(sound_interrupt); INTERRUPT_GEN_MEMBER(sound_interrupt);
@ -114,9 +118,12 @@ protected:
private: private:
required_device<generic_latch_8_device> m_soundlatch; required_device<generic_latch_8_device> m_soundlatch;
required_device<msm5205_device> m_msm; required_device<msm5205_device> m_msm;
required_ioport m_dsw0;
bool m_protect_hack; bool m_protect_hack;
bool m_nmi_enable; bool m_nmi_enable;
bool m_tclk_val;
uint8_t m_mcu1_p1, m_mcu2_p1;
}; };