From 8125dce816412787077eac415f9b4269beabc570 Mon Sep 17 00:00:00 2001 From: Fabian Vogt Date: Tue, 8 Aug 2023 21:37:45 +0200 Subject: [PATCH] Clear LCD cursor state on reset Data after the palette member isn't cleared on reset, but that's needed for the cursor state. Especially when switching from CX II emulation to classic emulation, the cursor remains enabled while the registers are inaccessible. --- core/lcd.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/lcd.h b/core/lcd.h index ec0b5163..6e238a20 100644 --- a/core/lcd.h +++ b/core/lcd.h @@ -17,7 +17,6 @@ typedef struct lcd_state { uint32_t control; uint8_t int_mask; uint8_t int_status; - uint16_t palette[256]; uint8_t cursor_ram[64*64/4]; // 64x64 2bpp cursor uint8_t cursor_control; uint8_t cursor_config; @@ -26,6 +25,8 @@ typedef struct lcd_state { uint16_t cursor_clip; uint8_t cursor_int_mask; uint8_t cursor_int_status; + // Below here isn't zeroed in lcd_reset + uint16_t palette[256]; } lcd_state; void lcd_draw_frame(uint8_t *buffer);