src/mame/machine/n64.c
| r14600 | r14601 | |
| 1299 | 1299 | ai_status |= 0x40000000; |
| 1300 | 1300 | |
| 1301 | 1301 | // adjust the timer |
| 1302 | | period = attotime::from_hz(DACRATE_NTSC) * ((ai_dacrate + 1) * (current->length / 4)); |
| 1302 | period = attotime::from_hz(DACRATE_NTSC) * ((ai_dacrate + 1) * (current->length / 8)); |
| 1303 | 1303 | ai_timer->adjust(period); |
| 1304 | 1304 | } |
| 1305 | 1305 | |
| r14600 | r14601 | |
| 1338 | 1338 | else if (ai_status & 0x40000000) |
| 1339 | 1339 | { |
| 1340 | 1340 | double secs_left = (ai_timer->expire() - machine().time()).as_double(); |
| 1341 | | unsigned int samples_left = secs_left * DACRATE_NTSC / (ai_dacrate + 1); |
| 1342 | | ret = samples_left * 4; |
| 1341 | unsigned int samples_left = (UINT32)(secs_left * (double)DACRATE_NTSC / (double)(ai_dacrate + 1)); |
| 1342 | ret = samples_left * 8; |
| 1343 | 1343 | } |
| 1344 | 1344 | else |
| 1345 | 1345 | { |
| r14600 | r14601 | |
| 1562 | 1562 | pi_dma_dir = 0; |
| 1563 | 1563 | pi_status |= 1; |
| 1564 | 1564 | |
| 1565 | | attotime dma_period = attotime::from_hz(93750000) * (int)((float)(pi_rd_len + 1) * 10.2f); |
| 1565 | attotime dma_period = attotime::from_hz(93750000) * (int)((float)(pi_rd_len + 1) * 3.0f); |
| 1566 | 1566 | //printf("want read dma in %d\n", (pi_rd_len + 1)); |
| 1567 | 1567 | pi_dma_timer->adjust(dma_period); |
| 1568 | 1568 | //pi_dma_tick(); |
| r14600 | r14601 | |
| 1575 | 1575 | pi_dma_dir = 1; |
| 1576 | 1576 | pi_status |= 1; |
| 1577 | 1577 | |
| 1578 | | attotime dma_period = attotime::from_hz(93750000) * (int)((float)(pi_wr_len + 1) * 10.2f); |
| 1578 | attotime dma_period = attotime::from_hz(93750000) * (int)((float)(pi_wr_len + 1) * 3.0f); |
| 1579 | 1579 | //printf("want write dma in %d\n", (pi_wr_len + 1)); |
| 1580 | 1580 | pi_dma_timer->adjust(dma_period); |
| 1581 | 1581 | |
| r14600 | r14601 | |
| 1717 | 1717 | case 0x00: // Read status |
| 1718 | 1718 | case 0xff: // Reset |
| 1719 | 1719 | { |
| 1720 | if(command == 0) |
| 1721 | { |
| 1722 | //printf("Read status\n"); |
| 1723 | } |
| 1724 | else |
| 1725 | { |
| 1726 | //printf("Reset\n"); |
| 1727 | } |
| 1720 | 1728 | switch (channel) |
| 1721 | 1729 | { |
| 1722 | 1730 | case 0: |
| r14600 | r14601 | |
| 1801 | 1809 | address = (sdata[1] << 8) | (sdata[2]); |
| 1802 | 1810 | address &= ~0x1f; |
| 1803 | 1811 | |
| 1804 | | //printf("Read mempak at %04x\n", address); |
| 1812 | ////printf("Read mempak at %04x\n", address); |
| 1805 | 1813 | |
| 1806 | 1814 | if(address == 0x8000) |
| 1807 | 1815 | { |
| r14600 | r14601 | |
| 1831 | 1839 | UINT32 address = (sdata[1] << 8) | (sdata[2]); |
| 1832 | 1840 | address &= ~0x1f; |
| 1833 | 1841 | |
| 1834 | | //printf("Write mempak at %04x\n", address); |
| 1842 | ////printf("Write mempak at %04x\n", address); |
| 1835 | 1843 | if (address >= 0x8000) |
| 1836 | 1844 | { |
| 1837 | 1845 | |
| r14600 | r14601 | |
| 2026 | 2034 | } |
| 2027 | 2035 | } |
| 2028 | 2036 | |
| 2029 | | //pif_ram[0x3f] = 0; |
| 2037 | pif_ram[0x3f] = 0; |
| 2030 | 2038 | } |
| 2031 | 2039 | |
| 2032 | 2040 | /*printf("After:\n"); fflush(stdout); |