From 1f137b06ac4549f55fc3296c1ed6298ada56c35d Mon Sep 17 00:00:00 2001
From: Jeffrey Pfau <jeffrey@endrift.com>
Date: Sat, 27 Feb 2016 01:39:46 -0800
Subject: [PATCH] GB Video: Attempt to reproduce STAT bug

---
 src/gb/video.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/gb/video.c b/src/gb/video.c
index cb06dce48..5b7d43707 100644
--- a/src/gb/video.c
+++ b/src/gb/video.c
@@ -271,6 +271,10 @@ void GBVideoWriteLCDC(struct GBVideo* video, GBRegisterLCDC value) {
 
 void GBVideoWriteSTAT(struct GBVideo* video, GBRegisterSTAT value) {
 	video->stat = (video->stat & 0x7) | (value & 0x78);
+	if (video->p->model == GB_MODEL_DMG && video->mode == 1) {
+		video->p->memory.io[REG_IF] |= (1 << GB_IRQ_LCDSTAT);
+		GBUpdateIRQs(video->p);
+	}
 }
 
 void GBVideoWritePalette(struct GBVideo* video, uint16_t address, uint8_t value) {