Vblank now returns a white screen if LCD is off, instead of keeping the buffer unmodified.

This commit is contained in:
Lior Halphon 2016-03-30 23:36:24 +03:00
parent e822f17bb7
commit 3344480de7

View File

@ -3,6 +3,7 @@
#include <sys/time.h>
#include <stdlib.h>
#include <assert.h>
#include <string.h>
#include "gb.h"
#include "display.h"
@ -197,6 +198,11 @@ void display_vblank(GB_gameboy_t *gb)
frames++;
*/
if (!(gb->io_registers[GB_IO_LCDC] & 0x80)) {
/* LCD is off, memset screen to white */
memset(gb->screen, 0xFF, 160 * 144 * 4);
}
gb->vblank_callback(gb);
if (!gb->turbo) {
struct timeval now;