Nintendo DMG-01 - Game Boy Console Manual page 136

Manual
Table of Contents

Advertisement

5.1. Emulator Notes
6. If you are using sprites then you should not use the
following commands when their register contents are
in the range $fe00-$feff.
inc bc
inc de
inc hl
dec bc
dec de
dec hl
If you don't follow this rule, sprite trash in the
form of sprite "blink" will randomly affect your
sprites.
7. Normally you should only make changes to Sprite RAM
during V-Blank unless you are an expert and know
exactly what you are doing. The common way to do this
is to use the GB DMA register ($ff46) to do a fast
copy from your sprite table in RAM to $fE00-$fe9f.
A. You need a sprite table in RAM with a starting
address of $XX00 and with a length of 160 ($a0). Many
often use $c000-$c09f for this purpose but anywhere
in RAM starting with $XX00 is fine.
B. You need to create a VBlank interrupt routine that
contains the DMA command, followed by a short delay
to allow the DMA to complete, and copy this routine
to high RAM ($ff00-$fffe). The DMA command WILL NOT
WORK in ROM or low RAM because these are disabled
during DMA.
C. After copying this routine to high RAM you then need
to enable the VBLANK interrupt and then enable
interrupts.
Page 136
TM
Game Boy
CPU Manual
V 1.01

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Game boy

Table of Contents