Skip to content

Commit d4d0985

Browse files
committed
c140: assume keyon reg 0x40 is some kind of retrigger
1 parent 14589e0 commit d4d0985

6 files changed

Lines changed: 22 additions & 20 deletions

File tree

src/devices/sound/c140.cpp

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// copyright-holders:R. Belmont
33
/*
44
5-
c140.cpp
5+
Namco C140
66
77
Simulator based on AMUSE sources.
88
The C140 sound chip is used by Namco System 2 and System 21
@@ -21,7 +21,8 @@ Channels can be 8 bit compressed PCM, or 12 bit signed PCM.
2121
- Acknowledge A9 bit (9th address bit) of host interface
2222
- Verify data bus bits of C219
2323
- Verify C219 LFSR algorithm (same as c352.cpp?)
24-
- Verify unknown mode bits (0x40 for C140, 0x02 for C219)
24+
- Verify unknown mode bits (eg. Final Lap & Winning Run games)
25+
- Verify status register (see keyon_status_read)
2526
2627
--------------
2728
@@ -459,9 +460,11 @@ inline u8 c140_device::keyon_status_read(u16 offset)
459460
m_stream->update();
460461
C140_VOICE const &v = m_voi[offset >> 4];
461462

462-
// suzuka 8 hours and final lap games read from here, expecting bit 6 to be an in-progress sample flag.
463-
// four trax also expects bit 4 high for some specific channels to make engine noises to work properly
464-
// (sounds kinda bogus when player crashes in an object and jump spin, needs real HW verification)
463+
// Suzuka 8 Hours and Final Lap games read from here, expecting bit 6 to be
464+
// an in-progress sample flag. Simply returning the register value, even after
465+
// clearing the highest 2 bits after keyoff won't work.
466+
// Four Trax also expects bit 4 high for some specific channels (the loop flag),
467+
// so assume that part of register 0x5 is still returned as normal.
465468
return (v.key ? 0x40 : 0x00) | (m_REG[offset] & 0x3f);
466469
}
467470

@@ -499,7 +502,7 @@ void c140_device::c140_w(offs_t offset, u8 data)
499502

500503
if ((offset & 0xf) == 0x5)
501504
{
502-
if (data & 0x80)
505+
if (data & 0x80 || (data & 0x40 && v->key))
503506
{
504507
const struct voice_registers *vreg = (struct voice_registers *) &m_REG[offset & 0x1f0];
505508
v->key = 1;
@@ -598,7 +601,7 @@ void c219_device::c219_w(offs_t offset, u8 data)
598601

599602
if ((offset & 0xf) == 0x5)
600603
{
601-
if (data & 0x80)
604+
if (data & 0x80 || (data & 0x40 && v->key))
602605
{
603606
const struct voice_registers *vreg = (struct voice_registers *) &m_REG[offset & 0x1f0];
604607
v->key = 1;

src/devices/sound/c140.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// license:BSD-3-Clause
22
// copyright-holders:R. Belmont
3-
/* c140.h */
43

54
#ifndef MAME_SOUND_C140_H
65
#define MAME_SOUND_C140_H
@@ -123,6 +122,7 @@ class c219_device : public c140_device
123122
virtual int find_sample(int adrs, int bank, int voice) override;
124123

125124
virtual const inline bool ch_mulaw(C140_VOICE *v) override { return BIT(v->mode, 0); }
125+
126126
private:
127127
// bit 1 used, unknown
128128
const inline bool ch_noise(C140_VOICE *v) { return BIT(v->mode, 2); }

src/mame/namco/namcos2.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,11 +1507,11 @@ static INPUT_PORTS_START( dirtfox )
15071507
PORT_START("AN4") /* 63B05Z0 - 8 CHANNEL ANALOG - CHANNEL 4 */
15081508
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
15091509
PORT_START("AN5") /* Steering Wheel */
1510-
PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x01,0xff) PORT_SENSITIVITY(70) PORT_KEYDELTA(50)
1510+
PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x01,0xff) PORT_SENSITIVITY(50) PORT_KEYDELTA(8)
15111511
PORT_START("AN6") /* Brake pedal */
1512-
PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_MINMAX(0x00,0x40) PORT_SENSITIVITY(100) PORT_KEYDELTA(15) PORT_NAME("Brake")
1512+
PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_MINMAX(0x00,0x40) PORT_SENSITIVITY(50) PORT_KEYDELTA(8) PORT_NAME("Brake")
15131513
PORT_START("AN7") /* Accelerator pedal */
1514-
PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_MINMAX(0x00,0x80) PORT_SENSITIVITY(100) PORT_KEYDELTA(15) PORT_NAME("Accelerator")
1514+
PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_MINMAX(0x00,0x80) PORT_SENSITIVITY(50) PORT_KEYDELTA(8) PORT_NAME("Accelerator")
15151515

15161516
PORT_START("MCUH") /* 63B05Z0 - PORT H */
15171517
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1538,11 +1538,11 @@ static INPUT_PORTS_START( metlhawk )
15381538
PORT_START("AN4") /* 63B05Z0 - 8 CHANNEL ANALOG - CHANNEL 4 */
15391539
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
15401540
PORT_START("AN5") /* Joystick Y */
1541-
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_MINMAX(0x20,0xe0) PORT_SENSITIVITY(100) PORT_KEYDELTA(16)
1541+
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_MINMAX(0x20,0xe0) PORT_SENSITIVITY(50) PORT_KEYDELTA(8)
15421542
PORT_START("AN6") /* Joystick X */
1543-
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_MINMAX(0x20,0xe0) PORT_SENSITIVITY(100) PORT_KEYDELTA(16)
1543+
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_MINMAX(0x20,0xe0) PORT_SENSITIVITY(50) PORT_KEYDELTA(8)
15441544
PORT_START("AN7") /* Lever */
1545-
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Z ) PORT_MINMAX(0x20,0xe0) PORT_SENSITIVITY(100) PORT_KEYDELTA(16)
1545+
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Z ) PORT_MINMAX(0x20,0xe0) PORT_SENSITIVITY(50) PORT_KEYDELTA(8)
15461546

15471547
PORT_START("MCUH") /* 63B05Z0 - PORT H */
15481548
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 )

src/mame/namco/namcos21.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ is used to shade pixels according to their depth.
3636
3737
TODO:
3838
- polygon glitches/flicker
39-
- car engine sound is wrong
4039
- pressing service mode while the game is running causes it to lock up (need to press F3)
4140
- is there a video_enable flag? or at least one for the bitmap layer (see screen transitions)
4241
- winrungp: some missing bitmap layer gfx due to underdumps of the gpu program roms (see attract mode
@@ -1051,8 +1050,8 @@ ROM_END
10511050

10521051
/* YEAR NAME PARENT MACHINE INPUT CLASS INIT MONITOR COMPANY FULLNAME FLAGS */
10531052

1054-
GAME( 1988, winrun, 0, winrun, winrun, namcos21_state, empty_init, ROT0, "Namco", "Winning Run (World) (89/06/06, Ver.09)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) // Sub Ver.09, 1989, Graphic Ver .06, 89/01/14, Sound Ver.2.00
1055-
GAME( 1989, winrungp, 0, winrun, winrungp, namcos21_state, empty_init, ROT0, "Namco", "Winning Run Suzuka Grand Prix (Japan) (89/12/03, Ver.02)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_NODEVICE_LAN | MACHINE_SUPPORTS_SAVE ) // Sub Ver.02, 1989, Graphic Ver.02 89/12/03, Sound Ver.0000
1053+
GAME( 1988, winrun, 0, winrun, winrun, namcos21_state, empty_init, ROT0, "Namco", "Winning Run (World) (89/06/06, Ver.09)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) // Sub Ver.09, 1989, Graphic Ver .06, 89/01/14, Sound Ver.2.00
1054+
GAME( 1989, winrungp, 0, winrun, winrungp, namcos21_state, empty_init, ROT0, "Namco", "Winning Run Suzuka Grand Prix (Japan) (89/12/03, Ver.02)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NODEVICE_LAN | MACHINE_SUPPORTS_SAVE ) // Sub Ver.02, 1989, Graphic Ver.02 89/12/03, Sound Ver.0000
10561055

10571056
// Available on a size/cost reduced 2 PCB set with 'Namco System 21B' printed on each board, still C65 I/O MCU, appears to be functionally identical to original NS21
1058-
GAME( 1991, winrun91, 0, winrun, winrungp, namcos21_state, empty_init, ROT0, "Namco", "Winning Run '91 (Japan) (1991/03/05, Main Ver 1.0, Sub Ver 1.0)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_NODEVICE_LAN | MACHINE_SUPPORTS_SAVE )
1057+
GAME( 1991, winrun91, 0, winrun, winrungp, namcos21_state, empty_init, ROT0, "Namco", "Winning Run '91 (Japan) (1991/03/05, Main Ver 1.0, Sub Ver 1.0)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NODEVICE_LAN | MACHINE_SUPPORTS_SAVE )

src/mame/namco/namcos21_c67.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Namco System 21 (later hardware with 5 TMS320C25 DSPs)
88
- lamp/vibration outputs, from MCU? (particularly starblad);
99
- verify DSP clocks, they should be 40MHz, currently underclocked on purpose on MAME, otherwise polygons
1010
may disappear on some frames (try playing starblad until after the asteroids), tightening quantum by
11-
a factor of 40/24 does not fix it;
11+
a factor of 40/24 does not fix it, actually it also happens when underclocked, but less;
1212
- verify video timing, pixel clock is from 38.76922?;
1313
- verify audiocpu irq frequency;
1414
- is m_layer0_pivot software-controlled and if so, where? (solvalou sprite layer 0 is further back than

src/mame/namco/namcos21_de.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -842,4 +842,4 @@ ROM_END
842842
/* YEAR NAME PARENT MACHINE INPUT CLASS INIT MONITOR COMPANY FULLNAME FLAGS */
843843

844844
// 3 PCB stacks in a single cage (3x 4 PCBs) linked for 3 screen panorama, boards look similar to original Namco System 21 (not 21B) including TMS320C25 DSP, but use C68 I/O MCU and sprite chip instead of "68000 'GPU'" ?
845-
GAME( 1992, driveyes, 0, driveyes, driveyes, namcos21_de_state, empty_init, ROT0, "Namco", "Driver's Eyes (Japan) (1992/01/10, Main Ver 2.1, Sub Ver 1.1)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_NODEVICE_LAN | MACHINE_SUPPORTS_SAVE )
845+
GAME( 1992, driveyes, 0, driveyes, driveyes, namcos21_de_state, empty_init, ROT0, "Namco", "Driver's Eyes (Japan) (1992/01/10, Main Ver 2.1, Sub Ver 1.1)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NODEVICE_LAN | MACHINE_SUPPORTS_SAVE )

0 commit comments

Comments
 (0)