summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author R. Belmont <rb6502@users.noreply.github.com>2016-11-24 16:01:35 -0500
committer GitHub <noreply@github.com>2016-11-24 16:01:35 -0500
commit2a0b269f81e8a6ac6c079e2286b614cb9a5bb0f9 (patch)
tree9609f37169dfa2543d2946045d424c40c8d96ee0
parenta24d227f75416344ef41db7cd669e5f19b42f905 (diff)
parent4643b8cd49c6b02ffed07dd6e6c1cc033564a7f6 (diff)
Merge pull request #1772 from Happy-yappH/master
n64: AI, add delayed carry signal for AI address
-rw-r--r--src/mame/includes/n64.h1
-rw-r--r--src/mame/machine/n64.cpp10
2 files changed, 11 insertions, 0 deletions
diff --git a/src/mame/includes/n64.h b/src/mame/includes/n64.h
index c06938ad3a7..6ad867b2c6f 100644
--- a/src/mame/includes/n64.h
+++ b/src/mame/includes/n64.h
@@ -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;
diff --git a/src/mame/machine/n64.cpp b/src/mame/machine/n64.cpp
index 2e38a7e2815..1b94269b7b4 100644
--- a/src/mame/machine/n64.cpp
+++ b/src/mame/machine/n64.cpp
@@ -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;
}
}