Previous 15994 Revisions Next

r14601 Friday 24th February, 2012 at 02:41:39 UTC by MooglyGuy
[N64] Fix audio sync issues in Super Mario 64 and probably others, and also bring PI DMA speed into the realm of reality. [Ryan Holtz]

(nw) I put off the move until tonight due to scheduling concerns... leaving in 4 hours, wish me luck!
[src/mame/machine]n64.c

src/mame/machine/n64.c
r14600r14601
12991299    ai_status |= 0x40000000;
13001300
13011301   // 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));
13031303   ai_timer->adjust(period);
13041304}
13051305
r14600r14601
13381338            else if (ai_status & 0x40000000)
13391339            {
13401340                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;
13431343            }
13441344            else
13451345            {
r14600r14601
15621562         pi_dma_dir = 0;
15631563         pi_status |= 1;
15641564
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);
15661566         //printf("want read dma in %d\n", (pi_rd_len + 1));
15671567         pi_dma_timer->adjust(dma_period);
15681568         //pi_dma_tick();
r14600r14601
15751575         pi_dma_dir = 1;
15761576         pi_status |= 1;
15771577
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);
15791579         //printf("want write dma in %d\n", (pi_wr_len + 1));
15801580         pi_dma_timer->adjust(dma_period);
15811581
r14600r14601
17171717      case 0x00:      // Read status
17181718      case 0xff:      // Reset
17191719      {
1720         if(command == 0)
1721         {
1722            //printf("Read status\n");
1723         }
1724         else
1725         {
1726            //printf("Reset\n");
1727         }
17201728         switch (channel)
17211729         {
17221730            case 0:
r14600r14601
18011809         address = (sdata[1] << 8) | (sdata[2]);
18021810         address &= ~0x1f;
18031811
1804         //printf("Read mempak at %04x\n", address);
1812         ////printf("Read mempak at %04x\n", address);
18051813
18061814         if(address == 0x8000)
18071815         {
r14600r14601
18311839         UINT32 address = (sdata[1] << 8) | (sdata[2]);
18321840         address &= ~0x1f;
18331841
1834         //printf("Write mempak at %04x\n", address);
1842         ////printf("Write mempak at %04x\n", address);
18351843         if (address >= 0x8000)
18361844         {
18371845
r14600r14601
20262034         }
20272035      }
20282036
2029      //pif_ram[0x3f] = 0;
2037      pif_ram[0x3f] = 0;
20302038   }
20312039
20322040   /*printf("After:\n"); fflush(stdout);

Previous 15994 Revisions Next


© 1998-2018 The MESS Team