Previous 15994 Revisions Next

r9161 Saturday 18th September, 2010 at 06:37:49 UTC by Angelo Salese
[PCE]: Fixed another bug with redundant timers
[src/mess/machine]pce.c

src/mess/machine/pce.c
r9160r9161
14751475      printf("%02x FADE\n",data);
14761476
14771477      /* TODO: timers needs HW tests */
1478      switch(data & 0xf)
1478      if(pce_cd.regs[0xf] != data)
14791479      {
1480         case 0x00: //CD-DA / ADPCM enable (100 msecs)
1481            pce_cd.cdda_volume = 0.0;
1482            timer_adjust_oneshot(pce_cd.cdda_fadein_timer, ATTOTIME_IN_USEC(100), 100);
1483            pce_cd.adpcm_volume = 0.0;
1484            timer_adjust_oneshot(pce_cd.adpcm_fadein_timer, ATTOTIME_IN_USEC(100), 100);
1485            timer_adjust_oneshot(pce_cd.cdda_fadeout_timer, attotime_never, NULL);
1486            timer_adjust_oneshot(pce_cd.adpcm_fadeout_timer, attotime_never, NULL);
1487            break;
1488         case 0x01: //CD-DA enable (100 msecs)
1489            pce_cd.cdda_volume = 0.0;
1490            timer_adjust_oneshot(pce_cd.cdda_fadein_timer, ATTOTIME_IN_USEC(100), 100);
1491            timer_adjust_oneshot(pce_cd.cdda_fadeout_timer, attotime_never, NULL);
1492            break;
1493         case 0x08: //CD-DA short (1500 msecs) fade out / ADPCM enable
1494            pce_cd.cdda_volume = 100.0;
1495            timer_adjust_oneshot(pce_cd.cdda_fadeout_timer, ATTOTIME_IN_USEC(1500), 1500);
1496            pce_cd.adpcm_volume = 0.0;
1497            timer_adjust_oneshot(pce_cd.adpcm_fadein_timer, ATTOTIME_IN_USEC(100), 100);
1498            timer_adjust_oneshot(pce_cd.cdda_fadein_timer, attotime_never, NULL);
1499            timer_adjust_oneshot(pce_cd.adpcm_fadeout_timer, attotime_never, NULL);
1500            break;
1501         case 0x09: //CD-DA long (5000 msecs) fade out
1502            pce_cd.cdda_volume = 100.0;
1503            timer_adjust_oneshot(pce_cd.cdda_fadeout_timer, ATTOTIME_IN_USEC(5000), 5000);
1504            timer_adjust_oneshot(pce_cd.cdda_fadein_timer, attotime_never, NULL);
1505            break;
1506         case 0x0a: //ADPCM long (5000 msecs) fade out
1507            pce_cd.adpcm_volume = 100.0;
1508            timer_adjust_oneshot(pce_cd.adpcm_fadeout_timer, ATTOTIME_IN_USEC(5000), 5000);
1509            timer_adjust_oneshot(pce_cd.adpcm_fadein_timer, attotime_never, NULL);
1510            break;
1511         case 0x0c: //CD-DA short (1500 msecs) fade out / ADPCM enable
1512            pce_cd.cdda_volume = 100.0;
1513            timer_adjust_oneshot(pce_cd.cdda_fadeout_timer, ATTOTIME_IN_USEC(1500), 1500);
1514            pce_cd.adpcm_volume = 0.0;
1515            timer_adjust_oneshot(pce_cd.adpcm_fadein_timer, ATTOTIME_IN_USEC(100), 100);
1516            timer_adjust_oneshot(pce_cd.cdda_fadein_timer, attotime_never, NULL);
1517            timer_adjust_oneshot(pce_cd.adpcm_fadeout_timer, attotime_never, NULL);
1518            break;
1519         case 0x0d: //CD-DA short (1500 msecs) fade out
1520            pce_cd.cdda_volume = 100.0;
1521            timer_adjust_oneshot(pce_cd.cdda_fadeout_timer, ATTOTIME_IN_USEC(1500), 1500);
1522            timer_adjust_oneshot(pce_cd.cdda_fadein_timer, attotime_never, NULL);
1523            break;
1524         case 0x0e: //ADPCM short (1500 msecs) fade out
1525            pce_cd.adpcm_volume = 100.0;
1526            timer_adjust_oneshot(pce_cd.adpcm_fadeout_timer, ATTOTIME_IN_USEC(1500), 1500);
1527            timer_adjust_oneshot(pce_cd.adpcm_fadein_timer, attotime_never, NULL);
1528            break;
1480         switch(data & 0xf)
1481         {
1482            case 0x00: //CD-DA / ADPCM enable (100 msecs)
1483               pce_cd.cdda_volume = 0.0;
1484               timer_adjust_oneshot(pce_cd.cdda_fadein_timer, ATTOTIME_IN_USEC(100), 100);
1485               pce_cd.adpcm_volume = 0.0;
1486               timer_adjust_oneshot(pce_cd.adpcm_fadein_timer, ATTOTIME_IN_USEC(100), 100);
1487               timer_adjust_oneshot(pce_cd.cdda_fadeout_timer, attotime_never, NULL);
1488               timer_adjust_oneshot(pce_cd.adpcm_fadeout_timer, attotime_never, NULL);
1489               break;
1490            case 0x01: //CD-DA enable (100 msecs)
1491               pce_cd.cdda_volume = 0.0;
1492               timer_adjust_oneshot(pce_cd.cdda_fadein_timer, ATTOTIME_IN_USEC(100), 100);
1493               timer_adjust_oneshot(pce_cd.cdda_fadeout_timer, attotime_never, NULL);
1494               break;
1495            case 0x08: //CD-DA short (1500 msecs) fade out / ADPCM enable
1496               pce_cd.cdda_volume = 100.0;
1497               timer_adjust_oneshot(pce_cd.cdda_fadeout_timer, ATTOTIME_IN_USEC(1500), 1500);
1498               pce_cd.adpcm_volume = 0.0;
1499               timer_adjust_oneshot(pce_cd.adpcm_fadein_timer, ATTOTIME_IN_USEC(100), 100);
1500               timer_adjust_oneshot(pce_cd.cdda_fadein_timer, attotime_never, NULL);
1501               timer_adjust_oneshot(pce_cd.adpcm_fadeout_timer, attotime_never, NULL);
1502               break;
1503            case 0x09: //CD-DA long (5000 msecs) fade out
1504               pce_cd.cdda_volume = 100.0;
1505               timer_adjust_oneshot(pce_cd.cdda_fadeout_timer, ATTOTIME_IN_USEC(5000), 5000);
1506               timer_adjust_oneshot(pce_cd.cdda_fadein_timer, attotime_never, NULL);
1507               break;
1508            case 0x0a: //ADPCM long (5000 msecs) fade out
1509               pce_cd.adpcm_volume = 100.0;
1510               timer_adjust_oneshot(pce_cd.adpcm_fadeout_timer, ATTOTIME_IN_USEC(5000), 5000);
1511               timer_adjust_oneshot(pce_cd.adpcm_fadein_timer, attotime_never, NULL);
1512               break;
1513            case 0x0c: //CD-DA short (1500 msecs) fade out / ADPCM enable
1514               pce_cd.cdda_volume = 100.0;
1515               timer_adjust_oneshot(pce_cd.cdda_fadeout_timer, ATTOTIME_IN_USEC(1500), 1500);
1516               pce_cd.adpcm_volume = 0.0;
1517               timer_adjust_oneshot(pce_cd.adpcm_fadein_timer, ATTOTIME_IN_USEC(100), 100);
1518               timer_adjust_oneshot(pce_cd.cdda_fadein_timer, attotime_never, NULL);
1519               timer_adjust_oneshot(pce_cd.adpcm_fadeout_timer, attotime_never, NULL);
1520               break;
1521            case 0x0d: //CD-DA short (1500 msecs) fade out
1522               pce_cd.cdda_volume = 100.0;
1523               timer_adjust_oneshot(pce_cd.cdda_fadeout_timer, ATTOTIME_IN_USEC(1500), 1500);
1524               timer_adjust_oneshot(pce_cd.cdda_fadein_timer, attotime_never, NULL);
1525               break;
1526            case 0x0e: //ADPCM short (1500 msecs) fade out
1527               pce_cd.adpcm_volume = 100.0;
1528               timer_adjust_oneshot(pce_cd.adpcm_fadeout_timer, ATTOTIME_IN_USEC(1500), 1500);
1529               timer_adjust_oneshot(pce_cd.adpcm_fadein_timer, attotime_never, NULL);
1530               break;
1531         }
15291532      }
15301533      break;
15311534   default:

Previous 15994 Revisions Next


© 1998-2018 The MESS Team