From 73bf7791f8b3989d599c8e625a49ee7304979ee5 Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Fri, 17 Feb 2017 10:56:19 -0800 Subject: [PATCH] use i/o register constants --- src/main.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main.c b/src/main.c index 18cccfe08f..cfc6ac6a93 100644 --- a/src/main.c +++ b/src/main.c @@ -202,10 +202,9 @@ u16 GetTrainerId(void) void EnableVCountIntrAtLine150(void) { - u16 gpuReg = GetGpuReg(0x4) & 0xFF | 0x9600; - - SetGpuReg(4, gpuReg | 0x20); - EnableInterrupts(0x4); // please use IRQ_MASK_VCOUNT + u16 gpuReg = (GetGpuReg(REG_OFFSET_DISPSTAT) & 0xFF) | (150 << 8); + SetGpuReg(REG_OFFSET_DISPSTAT, gpuReg | DISPSTAT_VCOUNT_INTR); + EnableInterrupts(INTR_FLAG_VCOUNT); } void InitKeys(void)