Previous 15994 Revisions Next

r6113 Saturday 17th October, 2009 at 11:45:20 UTC by Harmony
[CDI] Misc. Updates: [Harmony]
- Increased Timer 0 CLOCK_A divisor from 30 to 150; just a guess, significantly decreases out-of-control emulated machine speed (see: Pac-Panic animations)
- Separated audio and data buffer targets in cdram; significantly decreases glitchy transitions in some games (Sargon et al) while maintaining Lemmings RLE video compatibility.
[src/mess/drivers]cdi.c

src/mess/drivers/cdi.c
r6112r6113
328328   {
329329      case 0:
330330         compare = 0x10000 - scc68070_regs.timers.timer0;
331         period = attotime_mul(ATTOTIME_IN_HZ(CLOCK_A/30), compare);
331         period = attotime_mul(ATTOTIME_IN_HZ(CLOCK_A/150), compare);
332332            timer_adjust_oneshot(scc68070_regs.timers.timer0_timer, period, 0);
333333         break;
334334      default:
r6112r6113
13171317         //printf( "Reading Mode %d sector from MSF location %06x\n", cdic_regs.command - 0x28, cdic_regs.time | 2 );
13181318         verboselog(machine, 0, "Reading Mode %d sector from MSF location %06x\n", cdic_regs.command - 0x28, cdic_regs.time | 2 );
13191319
1320         cdic_regs.z_buffer ^= 0x0001;
1321         cdic_regs.data_buffer ^= 0x0001;
13221320
13231321         cdrom_read_data(cdic_regs.cd, lba, buffer, CD_TRACK_RAW_DONTCARE);
1324         for(index = 6; index < 2352/2; index++)
1325         {
1326            cdram[(cdic_regs.data_buffer & 5) * (0xa00/2) + (index - 6)] = (buffer[index*2] << 8) | buffer[index*2 + 1];
1327         }
13281322
13291323         cdic_regs.time += 0x100;
13301324         if((cdic_regs.time & 0x00000f00) == 0x00000a00)
r6112r6113
13621356            //}
13631357            //else
13641358            //{
1359               cdic_regs.data_buffer |= 0x0004;
1360               cdic_regs.data_buffer ^= 0x0001;
1361               for(index = 6; index < 2352/2; index++)
1362               {
1363                  cdram[(cdic_regs.data_buffer & 5) * (0xa00/2) + (index - 6)] = (buffer[index*2] << 8) | buffer[index*2 + 1];
1364               }
1365
13651366               cdic_decode_audio_sector(machine, ((UINT8*)cdram) + ((cdic_regs.data_buffer & 5) * 0xa00 + 4));
13661367               // Ignore the audio sector for now.
13671368               cdic_regs.x_buffer |= 0x8000;
r6112r6113
13771378         }
13781379         else if((buffer[CDIC_SECTOR_SUBMODE2] & (CDIC_SUBMODE_DATA | CDIC_SUBMODE_AUDIO | CDIC_SUBMODE_VIDEO)) == 0x00)
13791380         {
1381            cdic_regs.data_buffer ^= 0x0001;
1382            for(index = 6; index < 2352/2; index++)
1383            {
1384               cdram[(cdic_regs.data_buffer & 5) * (0xa00/2) + (index - 6)] = (buffer[index*2] << 8) | buffer[index*2 + 1];
1385            }
1386
13801387            if(buffer[CDIC_SECTOR_SUBMODE2] & CDIC_SUBMODE_TRIG)
13811388            {
13821389               cdic_regs.x_buffer |= 0x8000;
r6112r6113
14011408            cdic_regs.data_buffer |= 0x4000;
14021409            cdic_regs.data_buffer &= 0x7fff;
14031410
1411            cdic_regs.data_buffer &= ~0x0004;
1412            cdic_regs.data_buffer ^= 0x0001;
1413            for(index = 6; index < 2352/2; index++)
1414            {
1415               cdram[(cdic_regs.data_buffer & 5) * (0xa00/2) + (index - 6)] = (buffer[index*2] << 8) | buffer[index*2 + 1];
1416            }
1417
14041418            //printf( "Setting CDIC interrupt line\n" );
14051419            verboselog(machine, 0, "Setting CDIC interrupt line\n" );
14061420            cpu_set_input_line_vector(cputag_get_cpu(machine, "maincpu"), M68K_IRQ_4, 128);
14071421            cputag_set_input_line(machine, "maincpu", M68K_IRQ_4, ASSERT_LINE);
14081422         }
14091423
1410         if(!(buffer[CDIC_SECTOR_SUBMODE2] & CDIC_SUBMODE_EOF))
1411         {
1424         //if(!(buffer[CDIC_SECTOR_SUBMODE2] & CDIC_SUBMODE_EOF))
1425         //{
14121426            timer_adjust_oneshot(cdic_regs.interrupt_timer, ATTOTIME_IN_HZ(75), 0); // 75Hz = 1x CD-ROM speed
1413         }
1414         else
1415         {
1416            cdic_regs.command = 0;
1417         }
1427         //}
1428         //else
1429         //{
1430            //cdic_regs.command = 0;
1431         //}
14181432
14191433         break;
14201434      }

Previous 15994 Revisions Next


© 1998-2018 The MESS Team