Nintendo GAME BOY Programming Manual page 32

Hide thumbs Also See for GAME BOY:
Table of Contents

Advertisement

Game Boy Programming Manual
Flow after game start
If Master
Master Game
Key Input
TD
(Transfer Data)
Transfer
Game Processing
N
V_BLANK
SIO Interrupt
RD
(SB)
RETI
Data subsequently sent by the master is placed in (SB) and then sent to the slave at the same time
as the (SC) is set to $81. At exactly that same time, the master receives the slave data. An SIO
interrupt is then set in the slave and, as the flowchart indicates, the slave sets the data to be sent to
the master (current data).
Because the data sent from the slave are those loaded at the time of the previous interrupt, the
data sent to the master are one step (one pass through the main program) behind the current slave
data. Exactly the converse is true when this process is viewed from the perspective of the slave.
An SIO interrupt is set in the master, and the master sets the data to be sent to the slave (current
data). In this case, because the data sent from the master are those loaded at the time of the
previous interrupt, the data sent to slave are one step (one pass through main program) behind the
current master data. (*The data of the master and slave can be synchronized by setting the data
for each back 1 pass.)
Transfer
Y
(SC)
$81
RET
(SB)
TD
If Slave
Slave Game
Key Input
TD
(Transfer Data)
Game Processing
N
SIO Finished?
SIO Interrupt
RD
(SB)
(SC)
Set SIO Completion Flag
RETI
32
Slave waits for
Y
finish of SIO to
synchronize with
master. (This is an
example; not
necessary to
implement this
way.)
(SB)
TD
$80

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents