Previous 199869 Revisions Next

r21154 Monday 18th February, 2013 at 01:35:52 UTC by Angelo Salese
Fixed filter reading on false connector
[src/emu/machine]stvcd.c

trunk/src/emu/machine/stvcd.c
r21153r21154
22232223
22242224saturn_state::partitionT *saturn_state::cd_filterdata(filterT *flt, int trktype, UINT8 *p_ok)
22252225{
2226   int match = 1, keepgoing = 2;
2226   int match, keepgoing;
22272227   partitionT *filterprt = (partitionT *)NULL;
22282228
22292229   CDROM_LOG(("cd_filterdata, trktype %d\n", trktype))
2230   match = 1;
2231   keepgoing = 2;
2232   lastbuf = flt->condtrue;
22302233
22312234   // loop on the filters
22322235   do
r21153r21154
22382241         if ((cd_curfad < flt->fad) || (cd_curfad > (flt->fad + flt->range)))
22392242         {
22402243            printf("curfad reject %08x %08x %08x %08x\n",cd_curfad,fadstoplay,flt->fad,flt->fad+flt->range);
2241            //match = 0;
2242            lastbuf = flt->condfalse;
2243            flt = &filters[lastbuf];
2244
2245            keepgoing--;
2244            match = 0;
2245            //lastbuf = flt->condfalse;
2246            //flt = &filters[lastbuf];
22462247         }
22472248      }
22482249
r21153r21154
22522253         {
22532254            if (curblock.fnum != flt->fid)
22542255            {
2255               logerror("fnum reject\n");
2256               printf("fnum reject\n");
22562257               match = 0;
22572258            }
22582259         }
r21153r21154
22612262         {
22622263            if (curblock.chan != flt->chan)
22632264            {
2264               logerror("channel number reject\n");
2265               printf("channel number reject\n");
22652266               match = 0;
22662267            }
22672268         }
r21153r21154
22702271         {
22712272            if((curblock.subm & flt->smmask) != flt->smval)
22722273            {
2273               logerror("sub mode reject\n");
2274               printf("sub mode reject\n");
22742275               match = 0;
22752276            }
22762277         }
r21153r21154
22792280         {
22802281            if((curblock.cinf & flt->cimask) != flt->cival)
22812282            {
2282               logerror("coding information reject\n");
2283               printf("coding information reject\n");
22832284               match = 0;
22842285            }
22852286         }
r21153r21154
22922293
22932294      if (match)
22942295      {
2295         lastbuf = flt->condtrue;
2296         filterprt = &partitions[lastbuf];
2296         //lastbuf = flt->condtrue;
2297         //filterprt = &partitions[lastbuf];
22972298         // we're done
22982299         keepgoing = 0;
22992300      }
r21153r21154
23022303         lastbuf = flt->condfalse;
23032304
23042305         // reject sector if no match on either connector
2305         if ((lastbuf == 0xff) || (keepgoing < 2))
2306         if ((lastbuf == 0xff) || (keepgoing == 0))
23062307         {
23072308            *p_ok = 0;
23082309            return (partitionT *)NULL;
r21153r21154
23102311
23112312         // try again using the filter that was on the "false" connector
23122313         flt = &filters[lastbuf];
2314         match = 1;
23132315
23142316         // and exit if we fail
23152317         keepgoing--;
23162318      }
23172319   } while (keepgoing);
23182320
2321   filterprt = &partitions[lastbuf];
2322
23192323   // try to allocate a block
23202324   filterprt->blocks[filterprt->numblks] = cd_alloc_block(&filterprt->bnum[filterprt->numblks]);
23212325

Previous 199869 Revisions Next


© 1997-2024 The MAME Team