Nintendo DMG-01 - Game Boy Console Manual page 37

Manual
Table of Contents

Advertisement

TM
Game Boy
CPU Manual
CPL
AND $0F
OR B
LD B,A
LD A,($FF8B)
XOR B
AND B
LD ($FF8C),A
LD A,B
LD ($FF8B),A
LD A,$30
LD ($FF00),A
RET
The button values using the above method are
such:
$80 - Start
$40 - Select
$20 - B
$10 - A
Let's say we held down A, Start, and Up. The
value returned in accumulator A would be $94.
2. FF01 (SB)
Name
Contents - Serial transfer data (R/W)
3. FF02 (SC)
Name
Contents - SIO control
by DP
<- complement (invert)
<- get first 4 bits
<- put A and B together
<- store A in D
<- read old joy data from ram
<- toggle w/current button bit
<- get current button bit back
<- save in new Joydata storage
<- put original value in A
<- store it as old joy data
<- deselect P14 and P15
<- RESET Joypad
<- Return from Subroutine
- SB
8 Bits of data to be read/written
- SC
$8 - Down
$4 - Up
$2 - Left
$1 - Right
(R/W)
2.13.1. I/O Registers
Page 37

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Game boy

Table of Contents