Previous 15994 Revisions Next

r12404 Sunday 31st July, 2011 at 01:44:08 UTC by Angelo Salese
Implemented various flag conditions for command 0x48
[src/mame/machine]stvcd.c

src/mame/machine/stvcd.c
r12403r12404
321321   CDROM_LOG(("cd_free_block: %x\n", (UINT32)(FPTR)blktofree))
322322
323323   if(blktofree == NULL)
324   {
324325      return;
326   }
325327
326328   for (i = 0; i < 200; i++)
327329   {
r12403r12404
685687            // CR1 & 4 = don't confirm mode 2 subheader
686688            // CR1 & 8 = retry reading mode 2 sectors
687689            // CR1 & 10 = force single-speed
690            // CR1 & 80 = no change flag (done by Assault Suit Leynos 2)
688691         CDROM_LOG(("%s:CD: Initialize CD system\n", machine.describe_context()))
689         hirqreg &= 0xffe5;
692         if((cr1 & 0x80) == 0x00)
693         {
694            cd_stat = CD_STAT_PAUSE;
695            cd_curfad = 150;
696            fadstoplay = 0;
697            in_buffer = 0;
698            buffull = 0;
699            hirqreg &= 0xffe5;
700         }
690701         hirqreg |= (CMOK|ESEL);
691         cd_stat = CD_STAT_PAUSE;
692         cd_curfad = 150;
693         fadstoplay = 0;
694         in_buffer = 0;
695         buffull = 0;
696702         cr_standard_return(cd_stat);
697703         break;
698704
r12403r12404
10491055         break;
10501056
10511057      case 0x4800:   // Reset Selector
1058         {
1059         int i,j;
1060
10521061         CDROM_LOG(("%s:CD: Reset Selector\n",   machine.describe_context()))
10531062
10541063         if((cr1 & 0xff) == 0x00)
10551064         {
10561065            UINT8 bufnum = cr3>>8;
1057            int i;
10581066
10591067            if(bufnum < MAX_FILTERS)
10601068            {
r12403r12404
10781086            return;
10791087         }
10801088
1081         // ...
1089         /* reset false filter output conditions */
1090         if(cr1 & 0x80)
1091         {
1092            for(i=0;i<MAX_FILTERS;i++)
1093               filters[i].condfalse = 0xff;
1094         }
1095
1096         /* reset true filter output conditions */
1097         if(cr1 & 0x40)
1098         {
1099            for(i=0;i<MAX_FILTERS;i++)
1100               filters[i].condtrue = i;
1101         }
1102
1103         /* reset filter conditions*/
1104         if(cr1 & 0x10)
1105         {
1106            for(i=0;i<MAX_FILTERS;i++)
1107            {
1108               filters[i].fad = 0;
1109               filters[i].range = 0xffffffff;
1110               filters[i].mode = 0;
1111               filters[i].chan = 0;
1112               filters[i].smmask = 0;
1113               filters[i].cimask = 0;
1114               filters[i].fid = 0;
1115               filters[i].smval = 0;
1116               filters[i].cival = 0;
1117            }
1118         }
1119
1120         /* reset partition buffer data */
1121         if(cr1 & 0x4)
1122         {
1123            for(i=0;i<MAX_FILTERS;i++)
1124            {
1125               for (j = 0; j < MAX_BLOCKS; j++)
1126               {
1127                  cd_free_block(partitions[i].blocks[j]);
1128                  partitions[i].blocks[j] = (blockT *)NULL;
1129                  partitions[i].bnum[j] = 0xff;
1130               }
1131
1132               partitions[i].size = -1;
1133               partitions[i].numblks = 0;
1134            }
1135
1136            buffull = sectorstore = 0;
1137         }
1138
10821139         hirqreg |= (CMOK|ESEL);
10831140         cr_standard_return(cd_stat);
1141         }
10841142         break;
10851143
10861144      case 0x5000:   // get Buffer Size

Previous 15994 Revisions Next


© 1998-2018 The MESS Team