Gilbertmaxter
Member
I talked to some people in discord and they agree that its worth posting here this is the 2 player input script used to read not just the first controller but the second controller.
The whole thing is here:
http://nintendoage.com/forum/messageview.cfm?catid=22&threadid=7155
You can read more about this specifically here:
http://nintendoage.com/forum/messageview.cfm?catid=22&threadid=7974
LDA #$01
STA $4016
LDA #$00
STA $4016 ; tell both the controllers to latch buttons
LDA $4016 ; player 1 - A
LDA $4016 ; player 1 - B
LDA $4016 ; player 1 - Select
LDA $4016 ; player 1 - Start
LDA $4016 ; player 1 - Up
LDA $4016 ; player 1 - Down
LDA $4016 ; player 1 - Left
LDA $4016 ; player 1 - Right
LDA $4017 ; player 2 - A
LDA $4017 ; player 2 - B
LDA $4017 ; player 2 - Select
LDA $4017 ; player 2 - Start
LDA $4017 ; player 2 - Up
LDA $4017 ; player 2 - Down
LDA $4017 ; player 2 - Left
LDA $4017 ; player 2 - Right
A better controller reading scrtip is below:
ReadController1:
LDA #$01
STA $4016
LDA #$00
STA $4016
LDX #$08
ReadController1Loop:
LDA $4016
LSR A ; bit0 -> Carry
ROL buttons1 ; bit0 <- Carry
DEX
BNE ReadController1Loop
RTS
ReadController2:
LDA #$01
STA $4016
LDA #$00
STA $4016
LDX #$08
ReadController2Loop:
LDA $4017
LSR A ; bit0 -> Carry
ROL buttons2 ; bit0 <- Carry
DEX
BNE ReadController2Loop
RTS
I have been working on 2 player support but this so far requires me to duplicate alot of scripts just to get it to be meaningful. I posted this because it help others with getting 2 player in there game.
The whole thing is here:
http://nintendoage.com/forum/messageview.cfm?catid=22&threadid=7155
You can read more about this specifically here:
http://nintendoage.com/forum/messageview.cfm?catid=22&threadid=7974
LDA #$01
STA $4016
LDA #$00
STA $4016 ; tell both the controllers to latch buttons
LDA $4016 ; player 1 - A
LDA $4016 ; player 1 - B
LDA $4016 ; player 1 - Select
LDA $4016 ; player 1 - Start
LDA $4016 ; player 1 - Up
LDA $4016 ; player 1 - Down
LDA $4016 ; player 1 - Left
LDA $4016 ; player 1 - Right
LDA $4017 ; player 2 - A
LDA $4017 ; player 2 - B
LDA $4017 ; player 2 - Select
LDA $4017 ; player 2 - Start
LDA $4017 ; player 2 - Up
LDA $4017 ; player 2 - Down
LDA $4017 ; player 2 - Left
LDA $4017 ; player 2 - Right
A better controller reading scrtip is below:
ReadController1:
LDA #$01
STA $4016
LDA #$00
STA $4016
LDX #$08
ReadController1Loop:
LDA $4016
LSR A ; bit0 -> Carry
ROL buttons1 ; bit0 <- Carry
DEX
BNE ReadController1Loop
RTS
ReadController2:
LDA #$01
STA $4016
LDA #$00
STA $4016
LDX #$08
ReadController2Loop:
LDA $4017
LSR A ; bit0 -> Carry
ROL buttons2 ; bit0 <- Carry
DEX
BNE ReadController2Loop
RTS
I have been working on 2 player support but this so far requires me to duplicate alot of scripts just to get it to be meaningful. I posted this because it help others with getting 2 player in there game.