This page is a mirror of Tepples' nesdev forum mirror (URL TBD).
Last updated on Oct-18-2019 Download

Here we go again : reading the second controller?

Here we go again : reading the second controller?
by on (#47405)
Just doesn't seem to be my week this week. First the battery-backed RAM problem (which I still can't get to work) and now this. :(

I have a subroutine in my code that returns dynamic and debounced button states for controlller 1 and it all works fine. So I wanted to do the same for controller 2. As I test I just changed the register in the original routine to read from $4017 instead of $4016 but it doesn't work.

Is there a special way to handle/enable the second controller? I know there's an issue with reading the controller inputs when using DPCM but I'm not using it.
Re: Here we go again : reading the second controller?
by on (#47406)
neilbaldwin wrote:
Is there a special way to handle/enable the second controller? I know there's an issue with reading the controller inputs when using DPCM but I'm not using it.

Did you change the 1/0 strobe write address from $4016 to $4017 also? (I'm just thinking because you said you replaced $4016 with $4017). Writing to $4016 strobes both ports.
Re: Here we go again : reading the second controller?
by on (#47410)
NESICIDE wrote:
neilbaldwin wrote:
Is there a special way to handle/enable the second controller? I know there's an issue with reading the controller inputs when using DPCM but I'm not using it.

Did you change the 1/0 strobe write address from $4016 to $4017 also? (I'm just thinking because you said you replaced $4016 with $4017). Writing to $4016 strobes both ports.


Ha, I've just been talking to bunnyboy over on #nesdev and he told me the exact same thing and now my problem is solved.

:)

by on (#47426)
Writing $4017 has an effect on the sound hardware too, so watch out. I think it's only for timers of the hardware effects though, which you're probably not using anyways.