First time Homebrewer

Are you new to 6502, NES, or even programming in general? Post any of your questions here. Remember - the only dumb question is the question that remains unasked.

Moderator: Moderators

User avatar
Kasumi
Posts: 1293
Joined: Wed Apr 02, 2008 2:09 pm

Post by Kasumi »

I don't plan to use DMC at all. Does this mean I can get away with not reading the controllers multiple times? I honestly don't like the idea of possibly having to use "old" input for a frame just for an audio thing.

Forgetting about actual four player support entirely for the moment, what I want to know is what in the above code causes player 3 and player 4's input to go to controllers 1 and 2 with a famicom four player adapter attached. That's what I am trying to avoid, at least for now. The Four Score option doesn't interfere at all. I'm only reading from each register ($4016, $4017) 8 times right now, and am not even trying to get input from player 3 or 4. Four Score behaves for two players. Famicom does not. How are they different?

I don't see a setting in FCEUX for whether the famicom 4 player adapter that I'm having trouble with is in 2 or 4 player mode, nor have an actual famicom to test on. Is it an FCEUX quirk, or is there a wiki article about the famicom 4 player adapter I have missed that explains how its read from?

Am I correct in assuming when I read $4016, what's returned is something like this:

Code: Select all

%000000XY
Where Y is joypad 1's bit for the current button, and X is joypad 3's?
Because my assumption would be that if an adapter that supports multiple players were connected, and if my emulator supported this attachment correctly, and if there is no two or four player setting in the emulator it must be supporting the four player mode. And if these things are true, player three's input is going to player one's controller because something beyond player 1's input is stored in the first 8 reads of $4016. This only happens with the new code that checks more bits than the rightmost one.
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

Kasumi wrote:I don't plan to use DMC at all. Does this mean I can get away with not reading the controllers multiple times?
Yes. If you're not using DMC for audio or abusing it for raster timing (e.g. Time Lord), you can skip the rereading steps.
I honestly don't like the idea of possibly having to use "old" input for a frame just for an audio thing.
LJ65 gets away with it.
Forgetting about actual four player support entirely for the moment, what I want to know is what in the above code causes player 3 and player 4's input to go to controllers 1 and 2 with a famicom four player adapter attached.
What a game would do in 1- or 2-player mode is LDA player3input ORA player1input STA player1input
That's what I am trying to avoid, at least for now.
Except players on a Famicom actually expect this to happen so that they can use brand new expansion controllers instead of the old beat-up hardwired controllers on a 2-player game.
The Four Score option doesn't interfere at all. I'm only reading from each register ($4016, $4017) 8 times right now, and am not even trying to get input from player 3 or 4.
Player 3 is on D1 where player 1 is on D0. Player 4 is on D1 where player 2 is on D0.
I don't see a setting in FCEUX for whether the famicom 4 player adapter that I'm having trouble with is in 2 or 4 player mode
It doesn't have modes, to my knowledge.
Am I correct in assuming when I read $4016, what's returned is something like this:

Code: Select all

%000000XY
Where Y is joypad 1's bit for the current button, and X is joypad 3's?
True.
And if these things are true, player three's input is going to player one's controller because something beyond player 1's input is stored in the first 8 reads of $4016. This only happens with the new code that checks more bits than the rightmost one.
Yes, and games that check more bits do so precisely so that they can let player 1 use player 3's possibly newer controller. "Expansion controllers" and "four-player adapter", as far as I can tell, mean the same thing.
User avatar
Kasumi
Posts: 1293
Joined: Wed Apr 02, 2008 2:09 pm

Post by Kasumi »

Cool, got it. Thanks!
Post Reply