Miscellaneous; Recognizing Sgb - Nintendo GAME BOY Programming Manual

Hide thumbs Also See for GAME BOY:
Table of Contents

Advertisement

Game Boy Programming Manual

4. MISCELLANEOUS

4.1 Reading Input from Multiple Controllers
After a multiplayer request (Command MLT_REQ) is sent, data from Controllers 1, 2, 3, and 4
automatically become readable.
In 2-player mode, data from Controller 1 is read first, followed by data from Controller 2, then data
from Controller 1 again, and so on. In 4-player mode, the order is Controller 1, Controller 2, Controller
3, Controller 4, Controller 1 again, and so on.
In these cases, the next Controller for which data is to be read must be determined beforehand by
reading P10-P13 with P14 and P15 high.
Note:
Controller data cannot be read if Multiplayer 5 and Super NES Mouse are
connected at the same time.

4.2 Recognizing SGB

4.2.1 Distinguishing between Game Boy types (DMG, MGB/MGL, SGB, and SGB2)
The program uses the following methods to determine which of the 4 types is operating.
!
Checks the initial value of the internal accumulator of the CPU. (distinguishes between
previous/new versions of CPU).
01
FF
!
Sends a muliplayer request (Command MLT_REQ) and determines whether there is a
switch to multiplayer mode.
No switch → DMG or MGB/MGL
Switch
* The following table summarizes these methods.
P10 - P13
Next Controller to Read
Fh
Eh
Dh
Ch
→ DMG or SGB
→ MGB/MGL or SGB2
→ SGB or SGB2
Controller 1
Controller 2
Controller 3
Controller 4
182

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents