Cleaned the interrupt code a bit

This commit is contained in:
2022-05-08 20:47:58 -07:00
parent a6dbca6a90
commit 1a57ab1e26
4 changed files with 38 additions and 18 deletions

20
src/interrupts.c Normal file
View File

@@ -0,0 +1,20 @@
/**
* Copyright (c) 2022 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include "interrupts.h"
void interruptOnScanline() {
if(LYC_REG == 0) {
LCDC_REG |= LCDCF_BG8000;
if((TEXTBOX_STATE & TEXTBOX_STATE_VISIBLE) != 0) {
LYC_REG = INTERRUPT_TEXTBOX_VRAM;
}
} else if(LYC_REG == INTERRUPT_TEXTBOX_VRAM) {
LCDC_REG &= ~LCDCF_BG8000;
LYC_REG = 0;
}
}