Store vcount back in IO

This commit is contained in:
Jeffrey Pfau 2013-04-18 01:19:41 -07:00
parent 0048de2108
commit 97b669e4d1
2 changed files with 3 additions and 0 deletions

View File

@ -100,6 +100,7 @@ uint16_t GBAIORead(struct GBA* gba, uint32_t address) {
case REG_DMA3CNT_LO:
// Write-only register
return 0;
case REG_VCOUNT:
case REG_DMA0CNT_HI:
case REG_DMA1CNT_HI:
case REG_DMA2CNT_HI:

View File

@ -1,6 +1,7 @@
#include "gba-video.h"
#include "gba.h"
#include "gba-io.h"
#include <limits.h>
@ -55,6 +56,7 @@ int32_t GBAVideoProcessEvents(struct GBAVideo* video, int32_t cycles) {
video->nextEvent = video->nextHblank;
++video->vcount;
video->p->memory.io[REG_VCOUNT >> 1] = video->vcount;
switch (video->vcount) {
case VIDEO_VERTICAL_PIXELS: