APU DMC IRQ Question

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
APU DMC IRQ Question
by on (#57366)
The Wiki (http://wiki.nesdev.com/w/index.php/APU_DMC) says:

Quote:
The bytes remaining counter is decremented; if it becomes zero and the loop flag is set, the sample is restarted (see above), otherwise if the bytes remaining counter becomes zero and the IRQ enabled flag is set, the interrupt flag is set.


So does this mean the the IRQ flag is only ever set if looping is disabled? It's not 100% clear...I want to be sure.

Thanks!

Jonathon

by on (#57367)
I'm pretty sure it means that it must not be looping in order for an IRQ to happen. But either way, the time it takes to handle an interrupt to make the DMC play something else would be almost inaudible, unless you are using very short samples.

by on (#57368)
cool, thanks Dwedit! :)

by on (#57373)
The APU conceptually just asserts the IRQ line via a logical OR of a few things. The Wiki describes under what conditions the DMC interrupt flag/line is asserted. I read the quoted portion to mean that when the bytes remaining counter becomes zero, the IRQ enabled flag is examined. If the enabled flag is set at that time, the interrupt flag is set.

by on (#57375)
Something odd we can do is to load the sample start address, set the loop mode, then play, then change the start address, so it plays the first segment and it finished, start th esecond segment.
ok
by on (#57381)
Ok, so it seems there is a difference of opinion on what really happens. So I will make a test app that checks to see if the IRQ flag is set based on the loop flag. I will run it on a few emulators and get a majority vote - I have a feeling different emulators are going to have different opinions about this as well. haha.

Pz!
Re: ok
by on (#57383)
jwdonal wrote:
I will run it on a few emulators and get a majority vote - I have a feeling different emulators are going to have different opinions about this as well.


Bad idea. Instead of running your test code on emulators, run it on real hardware (or get someone else to run it for you), using a powerpak or a homebuilt eprom-based cart. That way instead of getting the 'popular' answer you'll get the 'correct' answer.

LN

by on (#57384)
Point taken. I actually have a PowerPak! I've been working on my own hardware so long I actually forgot that I had one. :-P LOL