Nintendo DMG-01 Manual - Page 136
V 1.01
View all Nintendo DMG-01 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 136 highlights
5.1. Emulator Notes Game BoyTM CPU Manual 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 V 1.01