summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2009-07-13 18:56:09 +0000
committer Aaron Giles <aaron@aarongiles.com>2009-07-13 18:56:09 +0000
commit9db0a2d28188b87dc95b2ac0cabbe18724a74a4a (patch)
treec5fbec640cce9ec54aaa97bfda7b76ecffeed08e
parentd1ae6b893d4544ad7b9fec5f1bad5c6ea0d25726 (diff)
Added mechanism for the laserdisc core to return 0 for the
philips codes if video is squelched. Updated the Gottlieb and Cliff Hanger drivers to request it this way, since they decode externally. Made a couple of minor tweaks to the Cliff Hanger driver. Fixed interrupt timing (was not taking into account interlacing) to fix up glitches in playback and ensure the disk test passes. Added SHA1 and marked the game as working. New games marked working: Cliff Hanger [Aaron Giles, Warren Ondras, Ernesto Corvi]
-rw-r--r--src/emu/machine/laserdsc.h2
-rw-r--r--src/emu/machine/ldcore.c21
-rw-r--r--src/emu/machine/ldpr8210.c8
-rw-r--r--src/emu/machine/ldv1000.c6
-rw-r--r--src/emu/machine/ldvp931.c2
-rw-r--r--src/mame/drivers/cliffhgr.c56
-rw-r--r--src/mame/drivers/gottlieb.c2
7 files changed, 60 insertions, 37 deletions
diff --git a/src/emu/machine/laserdsc.h b/src/emu/machine/laserdsc.h
index ec5f1bad48c..356eba80225 100644
--- a/src/emu/machine/laserdsc.h
+++ b/src/emu/machine/laserdsc.h
@@ -154,7 +154,7 @@ struct _laserdisc_config
int laserdisc_get_video(const device_config *device, bitmap_t **bitmap);
/* return the raw philips or white flag codes */
-UINT32 laserdisc_get_field_code(const device_config *device, UINT32 code);
+UINT32 laserdisc_get_field_code(const device_config *device, UINT32 code, UINT8 zero_if_squelched);
diff --git a/src/emu/machine/ldcore.c b/src/emu/machine/ldcore.c
index ded391e0642..bdc21c384b5 100644
--- a/src/emu/machine/ldcore.c
+++ b/src/emu/machine/ldcore.c
@@ -474,11 +474,15 @@ int laserdisc_get_video(const device_config *device, bitmap_t **bitmap)
information read from the disc
-------------------------------------------------*/
-UINT32 laserdisc_get_field_code(const device_config *device, UINT32 code)
+UINT32 laserdisc_get_field_code(const device_config *device, UINT32 code, UINT8 zero_if_squelched)
{
laserdisc_state *ld = get_safe_token(device);
ldcore_data *ldcore = ld->core;
int field = ldcore->fieldnum;
+
+ /* return nothing if the video is off (external devices can't sense) */
+ if (zero_if_squelched && ldcore->videosquelch)
+ return 0;
switch (code)
{
@@ -817,6 +821,14 @@ static void read_track_data(laserdisc_state *ld)
/* cheat and look up the metadata we are about to retrieve */
if (ldcore->vbidata != NULL)
vbi_metadata_unpack(&vbidata, NULL, &ldcore->vbidata[readhunk * VBI_PACKED_BYTES]);
+
+ /* if we're in the lead-in area, force the VBI data to be standard lead-in */
+ if (tracknum - 1 < VIRTUAL_LEAD_IN_TRACKS)
+ {
+ vbidata.line16 = 0;
+ vbidata.line17 = vbidata.line18 = vbidata.line1718 = VBI_CODE_LEADIN;
+ }
+//printf("track %5d.%d: %06X %06X %06X\n", tracknum, fieldnum, vbidata.line16, vbidata.line17, vbidata.line18);
/* if we're about to read the first field in a frame, advance */
frame = &ldcore->frame[ldcore->videoindex];
@@ -865,6 +877,13 @@ static void read_track_data(laserdisc_state *ld)
if (ldcore->vbidata != NULL)
vbi_metadata_unpack(&ldcore->metadata[fieldnum], &vbiframe, &ldcore->vbidata[readhunk * VBI_PACKED_BYTES]);
+ /* if we're in the lead-in area, force the VBI data to be standard lead-in */
+ if (tracknum - 1 < VIRTUAL_LEAD_IN_TRACKS)
+ {
+ ldcore->metadata[fieldnum].line16 = 0;
+ ldcore->metadata[fieldnum].line17 = ldcore->metadata[fieldnum].line18 = ldcore->metadata[fieldnum].line1718 = VBI_CODE_LEADIN;
+ }
+
/* configure the codec and then read */
ldcore->readresult = CHDERR_FILE_NOT_FOUND;
if (ldcore->disc != NULL && !ldcore->videosquelch)
diff --git a/src/emu/machine/ldpr8210.c b/src/emu/machine/ldpr8210.c
index 034bd5c0979..3dd561478ef 100644
--- a/src/emu/machine/ldpr8210.c
+++ b/src/emu/machine/ldpr8210.c
@@ -503,8 +503,8 @@ static void pr8210_control_w(laserdisc_state *ld, UINT8 prev, UINT8 data)
if (LOG_SERIAL)
{
printf("--- Command = %02X\n", player->pia.porta >> 3);
- while (input_code_pressed(KEYCODE_ENTER)) ;
- while (!input_code_pressed(KEYCODE_ENTER)) ;
+// while (input_code_pressed(KEYCODE_ENTER)) ;
+// while (!input_code_pressed(KEYCODE_ENTER)) ;
}
/* reset the first bit time so that the accumulator clears on the next write */
@@ -539,8 +539,8 @@ static TIMER_CALLBACK( vbi_data_fetch )
ldplayer_data *player = ld->player;
UINT8 focus_on = !(player->port1 & 0x08);
UINT8 laser_on = !(player->port2 & 0x01);
- UINT32 line16 = laserdisc_get_field_code(ld->device, LASERDISC_CODE_LINE16);
- UINT32 line1718 = laserdisc_get_field_code(ld->device, LASERDISC_CODE_LINE1718);
+ UINT32 line16 = laserdisc_get_field_code(ld->device, LASERDISC_CODE_LINE16, FALSE);
+ UINT32 line1718 = laserdisc_get_field_code(ld->device, LASERDISC_CODE_LINE1718, FALSE);
/* logging */
if (LOG_VBLANK_VBI)
diff --git a/src/emu/machine/ldv1000.c b/src/emu/machine/ldv1000.c
index bbb3010faaa..15ea9119579 100644
--- a/src/emu/machine/ldv1000.c
+++ b/src/emu/machine/ldv1000.c
@@ -354,9 +354,9 @@ static TIMER_CALLBACK( vbi_data_fetch )
UINT32 lines[3];
/* appears to return data in reverse order */
- lines[0] = laserdisc_get_field_code(ld->device, LASERDISC_CODE_LINE1718);
- lines[1] = laserdisc_get_field_code(ld->device, LASERDISC_CODE_LINE17);
- lines[2] = laserdisc_get_field_code(ld->device, LASERDISC_CODE_LINE16);
+ lines[0] = laserdisc_get_field_code(ld->device, LASERDISC_CODE_LINE1718, FALSE);
+ lines[1] = laserdisc_get_field_code(ld->device, LASERDISC_CODE_LINE17, FALSE);
+ lines[2] = laserdisc_get_field_code(ld->device, LASERDISC_CODE_LINE16, FALSE);
/* fill in the details */
memset(player->vbi, 0, sizeof(player->vbi));
diff --git a/src/emu/machine/ldvp931.c b/src/emu/machine/ldvp931.c
index b63d127174f..a1a076744fa 100644
--- a/src/emu/machine/ldvp931.c
+++ b/src/emu/machine/ldvp931.c
@@ -329,7 +329,7 @@ static TIMER_CALLBACK( vbi_data_fetch )
/* fetch the code and compute the DATIC latched value */
if (line >= LASERDISC_CODE_LINE16 && line <= LASERDISC_CODE_LINE18)
- code = laserdisc_get_field_code(ld->device, line);
+ code = laserdisc_get_field_code(ld->device, line, FALSE);
/* at the start of each line, signal an interrupt and use a timer to turn it off */
if (which == 0)
diff --git a/src/mame/drivers/cliffhgr.c b/src/mame/drivers/cliffhgr.c
index bcdb1cbec88..2710af12f20 100644
--- a/src/mame/drivers/cliffhgr.c
+++ b/src/mame/drivers/cliffhgr.c
@@ -94,13 +94,13 @@ static emu_timer *irq_timer;
static WRITE8_HANDLER( cliff_test_led_w )
{
- set_led_status( 0, offset ^ 1 );
+ set_led_status(0, offset ^ 1);
}
static WRITE8_HANDLER( cliff_port_bank_w )
{
/* writing 0x0f clears the LS174 flip flop */
- if ( data == 0x0f )
+ if (data == 0x0f)
port_bank = 0;
else
port_bank = data & 0x0f; /* only D3-D0 are connected */
@@ -110,10 +110,8 @@ static READ8_HANDLER( cliff_port_r )
{
static const char *const banknames[] = { "BANK0", "BANK1", "BANK2", "BANK3", "BANK4", "BANK5", "BANK6" };
- if ( port_bank < 7 )
- {
+ if (port_bank < 7)
return input_port_read(space->machine, banknames[port_bank]);
- }
/* output is pulled up for non-mapped ports */
return 0xff;
@@ -121,14 +119,17 @@ static READ8_HANDLER( cliff_port_r )
static READ8_HANDLER( cliff_phillips_code_r )
{
- if ( laserdisc != NULL )
- {
- return ( phillips_code >> (8*offset) ) & 0xff;
- }
+ if (laserdisc != NULL)
+ return (phillips_code >> (8 * offset)) & 0xff;
return 0x00;
}
+static WRITE8_HANDLER( cliff_phillips_clear_w )
+{
+ /* reset serial to parallel converters */
+}
+
static WRITE8_HANDLER( cliff_coin_counter_w )
{
coin_counter_w(0, (data & 0x40) ? 1 : 0 );
@@ -145,7 +146,7 @@ static READ8_HANDLER( cliff_irq_ack_r )
static WRITE8_DEVICE_HANDLER( cliff_sound_overlay_w )
{
int sound = data & 3;
- int overlay = ( data & 0x10 ) ? 1 : 0;
+ int overlay = (data & 0x10) ? 1 : 0;
/* configure pen 0 and 1 as transparent in the renderer and use it as the compositing color */
if (overlay)
@@ -160,13 +161,13 @@ static WRITE8_DEVICE_HANDLER( cliff_sound_overlay_w )
}
/* audio */
- discrete_sound_w(device, CLIFF_ENABLE_SND_1, sound&1);
- discrete_sound_w(device, CLIFF_ENABLE_SND_2, (sound>>1)&1);
+ discrete_sound_w(device, CLIFF_ENABLE_SND_1, sound & 1);
+ discrete_sound_w(device, CLIFF_ENABLE_SND_2, (sound >> 1) & 1);
}
static WRITE8_HANDLER( cliff_ldwire_w )
{
- laserdisc_line_w(laserdisc,LASERDISC_LINE_CONTROL,(data&1) ? ASSERT_LINE : CLEAR_LINE );
+ laserdisc_line_w(laserdisc, LASERDISC_LINE_CONTROL, (data & 1) ? ASSERT_LINE : CLEAR_LINE);
}
@@ -185,26 +186,29 @@ static TIMER_CALLBACK( cliff_irq_callback )
switch (param)
{
case 17:
- phillips_code = laserdisc_get_field_code(laserdisc, LASERDISC_CODE_LINE17);
+ phillips_code = laserdisc_get_field_code(laserdisc, LASERDISC_CODE_LINE17, TRUE);
param = 18;
break;
case 18:
- phillips_code = laserdisc_get_field_code(laserdisc, LASERDISC_CODE_LINE18);
+ phillips_code = laserdisc_get_field_code(laserdisc, LASERDISC_CODE_LINE18, TRUE);
param = 17;
break;
}
/* if we have a valid code, trigger an IRQ */
- if ( phillips_code & 0x800000 )
+ if (phillips_code & 0x800000)
+ {
+ printf("%2d:code = %06X\n", param, phillips_code);
cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE);
+ }
- timer_adjust_oneshot(irq_timer, video_screen_get_time_until_pos(machine->primary_screen, param, 0), param);
+ timer_adjust_oneshot(irq_timer, video_screen_get_time_until_pos(machine->primary_screen, param * 2, 0), param);
}
-static void vdp_interrupt (running_machine *machine, int state)
+static void vdp_interrupt(running_machine *machine, int state)
{
- cputag_set_input_line(machine, "maincpu", INPUT_LINE_NMI, state ? ASSERT_LINE : CLEAR_LINE );
+ cputag_set_input_line(machine, "maincpu", INPUT_LINE_NMI, state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -239,14 +243,14 @@ static ADDRESS_MAP_START( mainport, ADDRESS_SPACE_IO, 8 )
AM_RANGE(0x53, 0x53) AM_READ(cliff_irq_ack_r)
AM_RANGE(0x54, 0x54) AM_WRITE(TMS9928A_register_w)
AM_RANGE(0x55, 0x55) AM_READ(TMS9928A_register_r)
- AM_RANGE(0x57, 0x57) AM_WRITENOP /* clears the serial->parallel chips of the Phillips code reader. */
+ AM_RANGE(0x57, 0x57) AM_WRITE(cliff_phillips_clear_w)
AM_RANGE(0x60, 0x60) AM_WRITE(cliff_port_bank_w)
AM_RANGE(0x62, 0x62) AM_READ(cliff_port_r)
AM_RANGE(0x64, 0x64) AM_WRITENOP /* unused in schematics, may be used as timing delay for IR interface */
AM_RANGE(0x66, 0x66) AM_WRITE(cliff_ldwire_w)
AM_RANGE(0x68, 0x68) AM_WRITE(cliff_coin_counter_w)
- AM_RANGE(0x6A, 0x6A) AM_WRITENOP /* /LAMP0 (Infrared?) */
- AM_RANGE(0x6E, 0x6F) AM_WRITE(cliff_test_led_w)
+ AM_RANGE(0x6a, 0x6a) AM_WRITENOP /* /LAMP0 (Infrared?) */
+ AM_RANGE(0x6e, 0x6f) AM_WRITE(cliff_test_led_w)
ADDRESS_MAP_END
@@ -732,7 +736,7 @@ ROM_START( cliffhgr )
ROM_LOAD( "cliff_u5.bin", 0x8000, 0x2000, CRC(5922e710) SHA1(10637baba4d16dc333aeb0ab88ee251f44e1a115) )
DISK_REGION( "laserdisc" )
- DISK_IMAGE_READONLY( "cliffhgr", 0, NO_DUMP )
+ DISK_IMAGE_READONLY( "cliffhgr", 0, SHA1(4442995c824d7891a2a19c607bb3301d696fbdc8) )
ROM_END
ROM_START( cliffhga )
@@ -779,6 +783,6 @@ static DRIVER_INIT( cliff )
*
*************************************/
-GAME( 1983, cliffhgr, 0, cliffhgr, cliffhgr, cliff, ROT0, "Stern Electronics", "Cliff Hanger", GAME_NO_SOUND | GAME_NOT_WORKING)
-GAME( 1983, cliffhga, 0, cliffhgr, cliffhga, cliff, ROT0, "Stern Electronics", "Cliff Hanger (Alt)", GAME_NO_SOUND | GAME_NOT_WORKING)
-GAME( 1983, goaltogo, 0, cliffhgr, goaltogo, cliff, ROT0, "Stern Electronics", "Goal To Go", GAME_NO_SOUND | GAME_NOT_WORKING)
+GAME( 1983, cliffhgr, 0, cliffhgr, cliffhgr, cliff, ROT0, "Stern Electronics", "Cliff Hanger", 0)
+GAME( 1983, cliffhga, 0, cliffhgr, cliffhga, cliff, ROT0, "Stern Electronics", "Cliff Hanger (Alt)", 0)
+GAME( 1983, goaltogo, 0, cliffhgr, goaltogo, cliff, ROT0, "Stern Electronics", "Goal To Go", GAME_NOT_WORKING)
diff --git a/src/mame/drivers/gottlieb.c b/src/mame/drivers/gottlieb.c
index bd5d420365a..9195ab7bc6e 100644
--- a/src/mame/drivers/gottlieb.c
+++ b/src/mame/drivers/gottlieb.c
@@ -454,7 +454,7 @@ static WRITE8_HANDLER( laserdisc_command_w )
static TIMER_CALLBACK( laserdisc_philips_callback )
{
- int newcode = laserdisc_get_field_code(laserdisc, (param == 17) ? LASERDISC_CODE_LINE17 : LASERDISC_CODE_LINE18);
+ int newcode = laserdisc_get_field_code(laserdisc, (param == 17) ? LASERDISC_CODE_LINE17 : LASERDISC_CODE_LINE18, TRUE);
/* the PR8210 sends line 17/18 data on each frame; the laserdisc interface
board receives notification and latches the most recent frame number */