Merge pull request #1772 from Happy-yappH/master

n64:  AI, add delayed carry signal for AI address
This commit is contained in:
R. Belmont 2016-11-24 16:01:35 -05:00 committed by GitHub
commit 2a0b269f81
2 changed files with 11 additions and 0 deletions

View File

@ -189,6 +189,7 @@ private:
AUDIO_DMA *ai_fifo_get_top();
void ai_fifo_push(uint32_t address, uint32_t length);
void ai_fifo_pop();
bool ai_delayed_carry;
dmadac_sound_device *ai_dac[2];
uint32_t ai_dram_addr;

View File

@ -170,6 +170,7 @@ void n64_periphs::device_reset()
ai_dacrate = 0;
ai_bitrate = 0;
ai_status = 0;
ai_delayed_carry = false;
pi_dma_timer->adjust(attotime::never);
pi_rd_len = 0;
@ -1255,6 +1256,9 @@ void n64_periphs::ai_dma()
//
//fwrite(&ram[current->address/2],current->length,1,audio_dump);
if (ai_delayed_carry)
current->address += 0x2000;
ram = &ram[current->address/2];
//osd_printf_debug("DACDMA: %x for %x bytes\n", current->address, current->length);
@ -1266,6 +1270,11 @@ void n64_periphs::ai_dma()
// adjust the timer
period = attotime::from_hz(DACRATE_NTSC) * (ai_dacrate + 1) * (current->length / 4);
ai_timer->adjust(period);
if (((current->address + current->length) & 0x1FFF) == 0)
ai_delayed_carry = true;
else
ai_delayed_carry = false;
}
TIMER_CALLBACK_MEMBER(n64_periphs::ai_timer_callback)
@ -1286,6 +1295,7 @@ void n64_periphs::ai_timer_tick()
else
{
ai_status &= ~0x40000000;
ai_delayed_carry = false;
}
}