Nintendo GAME BOY Programming Manual page 66

Hide thumbs Also See for GAME BOY:
Table of Contents

Advertisement

Game Boy Programming Manual
3) When the DMA transfer is performed, the subroutine written to internal RAM shown in 1)
above is executed:
Note:
The preceding program is used for DMA transfers performed within routines for
processing interrupts implemented by vertical blanking.
however, the program written to internal RAM should be as shown below to
prevent interrupts during a transfer.
Address
FF80
Example 2
The example below shows a DMA transfer of 40 x 32 bits of data from the display RAM area
(9F00h-9F9Fh) to OAM (FE00-FE9Hh).
Machine Code
3E 9F
E0 46
Data can be transferred by DMA from 8000h-9F9Fh to OAM either by the method shown in
Example 1 or by using only the above instructions.
.
CALL 0FF80h
.
Command
Label
F3
3E C0
E0 46
3E 28
3D
L1:
20 FD
FB
C9
Label
;DMA transfer
Instruction
DI
LD
A, 0C0H
LD
(DMA), A
LD
A, 40
DEC A
JR
NZ, L1
EI
RET
Instruction
LD
A, 9FH
LD
(DMA), A
66
In all other cases,
Comment
;Interrupt disabled
;C000-C09F.OAM
;160-cycle wait
;Interrupt enabled
Comment
;9F00-9F9F.OAM

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents