Skip to content

Commit 53d0457

Browse files
authored
Fix up SGB multiplayer detection
Clarify that multiplayer only affects rP1 lower nibble Fix up grammar of description Add link to rP1 description Format `MLT_REQ` as monospace
1 parent 935c915 commit 53d0457

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

src/SGB_Command_Multiplayer.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Multiplayer Command
1+
# Multiplayer Command
22

33
## SGB Command 11h - MLT_REQ
44

@@ -16,39 +16,39 @@ Boy program, it is also used to detect SGB hardware.
1616
2-F Not used (zero)
1717
```
1818

19-
In one player mode, the second joypad (if any) is used for the SGB
20-
system program. In two player mode, both joypads are used for the game.
21-
Because SNES have only two joypad sockets, four player mode requires an
19+
In one-player mode, the second joypad (if any) can only be used for
20+
the SGB BIOS. In two-player mode, both joypads are used for the game.
21+
Because SNES only has two joypad sockets, four-player mode requires an
2222
external "Multiplayer 5" adapter.
2323

2424
Changing the number of active players ANDs the currently selected player
25-
minus one with the number of players in that mode minus one. For example
26-
if you go from four players to two players and player 4 was active
27-
player 2 will then be active because 3 AND 1 is 1. However, sending the
28-
MLT_REQ command will increment the counter several times so results may
25+
minus one with the number of players in that mode minus one. For example,
26+
if you go from four players to two players while player 4 was active,
27+
player 2 will then be active because `3 & 1 = 1`. However, sending the
28+
`MLT_REQ` command will increment the counter several times so results may
2929
not be exactly as expected. The most frequent case is going from one
3030
player to two-or-four player which will always start with player 1
3131
active.
3232

3333
## Reading Multiple Controllers (Joypads)
3434

35-
When having enabled multiple controllers by MLT_REQ, data for each
36-
joypad can be read out through JOYPAD register (FF00) as follows: First
35+
When having enabled multiple controllers by `MLT_REQ`, data for each
36+
joypad can be read out through [the `P1` register](<#FF00 - P1/JOYP - Joypad (R/W)>) as follows: First
3737
set P14 and P15 both HIGH (deselect both Buttons and Cursor keys), you
38-
can now read the lower 4 bits of $FF00 which indicate the joypad ID for
38+
can now read the lower 4 bits of `P1`, which indicate the joypad ID for
3939
the following joypad input:
4040

4141
Byte | Player \#
4242
-----|-----------
43-
$0F | 1
44-
$0E | 2
45-
$0D | 3
46-
$0C | 4
43+
$xF | 1
44+
$xE | 2
45+
$xD | 3
46+
$xC | 4
4747

48-
Next, read joypad state as normally. When completed, set P14 and P15
48+
Next, read joypad state normally. When completed, set both P14 and P15
4949
back HIGH, this automatically increments the joypad number (or restarts
50-
counting once reached the lastmost joypad). Repeat the procedure until
51-
you have read-out states for all two (or four) joypads.
50+
counting once the last joypad is reached). Repeat the procedure until
51+
you have read out all two (or four) joypads.
5252

5353
If for whatever reason you want to increment the joypad number without
5454
reading the joypad state you only need to set P15 to LOW before setting

0 commit comments

Comments
 (0)