1
- # Multiplayer Command
1
+ # Multiplayer Command
2
2
3
3
## SGB Command 11h - MLT_REQ
4
4
@@ -16,39 +16,39 @@ Boy program, it is also used to detect SGB hardware.
16
16
2-F Not used (zero)
17
17
```
18
18
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
22
22
external "Multiplayer 5" adapter.
23
23
24
24
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
29
29
not be exactly as expected. The most frequent case is going from one
30
30
player to two-or-four player which will always start with player 1
31
31
active.
32
32
33
33
## Reading Multiple Controllers (Joypads)
34
34
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
37
37
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
39
39
the following joypad input:
40
40
41
41
Byte | Player \#
42
42
-----|-----------
43
- $0F | 1
44
- $0E | 2
45
- $0D | 3
46
- $0C | 4
43
+ $xF | 1
44
+ $xE | 2
45
+ $xD | 3
46
+ $xC | 4
47
47
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
49
49
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.
52
52
53
53
If for whatever reason you want to increment the joypad number without
54
54
reading the joypad state you only need to set P15 to LOW before setting
0 commit comments