From 2a84d62187e75caba8517c32b76656fc9eb2597e Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Mon, 3 Oct 2016 01:29:54 +0300 Subject: [PATCH] Forbid reading the image while the camera is busy --- Core/camera.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Core/camera.c b/Core/camera.c index db8eb2f..af30bad 100644 --- a/Core/camera.c +++ b/Core/camera.c @@ -2,6 +2,10 @@ uint8_t GB_camera_read_image(GB_gameboy_t *gb, uint16_t addr) { + if (gb->camera_registers[0]) { + /* Forbid reading the image while the camera is busy. */ + return 0xFF; + } uint8_t tile_x = addr / 0x10 % 0x10; uint8_t tile_y = addr / 0x10 / 0x10;