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]
This commit is contained in:
Aaron Giles 2009-07-13 18:56:09 +00:00
parent d1ae6b893d
commit 9db0a2d281
7 changed files with 60 additions and 37 deletions

View File

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

View File

@ -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)

View File

@ -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)

View File

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

View File

@ -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)

View File

@ -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)

View File

@ -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 */