From 2c9983b2de00b6b2bf0cec4746518fd7e670b577 Mon Sep 17 00:00:00 2001 From: Angelo Salese Date: Fri, 22 Feb 2013 17:43:28 +0000 Subject: [PATCH] Actually fixed track seek, fixes regression with Zero Divide --- hash/saturn.xml | 2 +- src/emu/machine/stvcd.c | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/hash/saturn.xml b/hash/saturn.xml index ed52d1f8b63..720a5623c94 100644 --- a/hash/saturn.xml +++ b/hash/saturn.xml @@ -493,7 +493,7 @@ Horde, The (Japan) [T-15902G] | (hordej) Horror Tour (Japan) [T-24301G] | (horror) Houkago Ren-ai Club: Koi no Etude (Japan) [T-19713G] | (houkago) - Houkago Ren-ai Club: Koi no Etude (Japan) (Genteiban) [T-19714G] | houkagogen) + Houkago Ren-ai Club: Koi no Etude (Japan) (Genteiban) [T-19714G] | (houkagogen) Houma Hunter Lime: Perfect Collection (Japan) [T-2001G] | (hhuntlim) House of the Dead, The (Japan) [GS-9173] | (hotdj) House of the Dead, The (Japan) (Satakore) [GS-9207] | @@ diff --git a/src/emu/machine/stvcd.c b/src/emu/machine/stvcd.c index 53e805eaf40..c485c72a6dc 100644 --- a/src/emu/machine/stvcd.c +++ b/src/emu/machine/stvcd.c @@ -2450,13 +2450,27 @@ void saturn_state::cd_playdata( void ) { if ((cd_stat & 0x0f00) == CD_STAT_SEEK) { + INT32 fad_diff; + //printf("PRE %08x %08x %08x %d\n",cd_curfad,cd_fad_seek,cd_stat,cd_fad_seek - cd_curfad); + + fad_diff = (cd_fad_seek - cd_curfad); + /* Zero Divide wants this TODO: timings. */ - if((cd_fad_seek - cd_curfad) > (750*cd_speed)) + if(fad_diff > (750*cd_speed)) + { + //printf("PRE FFWD %08x %08x %08x %d %d\n",cd_curfad,cd_fad_seek,cd_stat,cd_fad_seek - cd_curfad,750*cd_speed); cd_curfad += (750*cd_speed); - else if((cd_fad_seek - cd_curfad) < (-750*cd_speed)) + //printf("POST FFWD %08x %08x %08x %d %d\n",cd_curfad,cd_fad_seek,cd_stat,cd_fad_seek - cd_curfad, 750*cd_speed); + } + else if(fad_diff < (-750*cd_speed)) + { + //printf("PRE REW %08x %08x %08x %d %d\n",cd_curfad,cd_fad_seek,cd_stat,cd_fad_seek - cd_curfad, -750*cd_speed); cd_curfad -= (750*cd_speed); + //printf("POST REW %08x %08x %08x %d %d\n",cd_curfad,cd_fad_seek,cd_stat,cd_fad_seek - cd_curfad, -750*cd_speed); + } else { + //printf("Ready\n"); cd_curfad = cd_fad_seek; cd_stat = CD_STAT_PLAY; }