NES APU Tests

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
NES APU Tests
by on (#141720)
I encountered the following problem while running the APU Tests:

Code:
Channel: 2

Problem with length counter load or $4015

1-len_ctr

Fail #2


I think channel 2 refers to the triangle channel. Does anyone know more details about this error? My emulator's pulse channels seem to pass this test and the code looks very similar.
Re: NES APU Tests
by on (#141736)
This is the source of the test:
Code:
   set_test 2,"Problem with length counter load or $4015"
   mov $4015,chan_bit      ; enable channel
   setb {$4003,x},len_2    ; load length
   jsr should_be_playing


It enables the channel via $4015, then loads the length counter via $4003. The channel should be playing.
Re: NES APU Tests
by on (#141747)
Zepper wrote:
It enables the channel via $4015, then loads the length counter via $4003. The channel should be playing.


I reviewed that code before the post and I still can't figure it out. The test seems to load the length counter with $4003 + 4 * x. I don't know how long it waits until the channel should start playing. I assume this is some sort of timing issue since games like Mega Man 2 don't sound so bad with my emulator.
Re: NES APU Tests
by on (#141751)
Check $4015 reads.
Re: NES APU Tests
by on (#141755)
Zepper wrote:
Check $4015 reads.


Yes! That was it. Thanks. I failed to include the triangle channel in the status read.
Re: NES APU Tests
by on (#141775)
Can anyone give me a hint on this one?

Code:
There should be a one-byte
buffer that's filled
immediately if empty

7-dmc_basics

Failed #19


As far as I know, I'm filling the buffer :)
Re: NES APU Tests
by on (#141786)
There is an archive compiled of all the test ROMs and their relevant source code and documentation (if available), which should (hopefully?) help you answer some of the questions: https://github.com/christopherpow/nes-test-roms

For example, the APU test ROM you're using from blargg is here, and has documentation explaining things in detail: https://github.com/christopherpow/nes-t ... r/apu_test -- relevant code: https://github.com/christopherpow/nes-t ... ics.s#L169 -- and the relevant register name equates/aliases: https://github.com/christopherpow/nes-t ... /neshw.inc