From 091556e9ad5f7cb5fecb0993dfd279057e19f728 Mon Sep 17 00:00:00 2001 From: Gwenhael Le Moine Date: Tue, 2 Apr 2024 21:42:59 +0200 Subject: [PATCH] ui_* can use saturn.annunc directly, no need to copy it in display --- src/emu_init.c | 2 -- src/emu_memory.c | 1 - src/emulator.h | 2 -- src/ui_sdl.c | 2 +- src/ui_text.c | 2 +- src/ui_x11.c | 6 +++--- 6 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/emu_init.c b/src/emu_init.c index 16e69a2..fe74be3 100644 --- a/src/emu_init.c +++ b/src/emu_init.c @@ -197,8 +197,6 @@ void init_display( void ) display.contrast = saturn.contrast_ctrl; display.contrast |= ( ( saturn.disp_test & 0x1 ) << 4 ); - - display.annunc = saturn.annunc; } int init_emulator( void ) diff --git a/src/emu_memory.c b/src/emu_memory.c index 8f49323..c02df12 100644 --- a/src/emu_memory.c +++ b/src/emu_memory.c @@ -102,7 +102,6 @@ void write_dev_mem( long addr, int val ) case 0x10c: /* ANNUNC */ saturn.annunc &= ~nibble_masks[ addr - 0x10b ]; saturn.annunc |= val << ( ( addr - 0x10b ) * 4 ); - display.annunc = saturn.annunc; device.ann_touched = 1; return; case 0x10d: /* BAUD */ diff --git a/src/emulator.h b/src/emulator.h index d074f5e..d1332d3 100644 --- a/src/emulator.h +++ b/src/emulator.h @@ -176,8 +176,6 @@ typedef struct display_t { long menu_start; long menu_end; - - int annunc; } display_t; typedef struct mem_cntl_t { diff --git a/src/ui_sdl.c b/src/ui_sdl.c index 0df89a5..71f7cc1 100644 --- a/src/ui_sdl.c +++ b/src/ui_sdl.c @@ -2009,7 +2009,7 @@ void sdl_menu_draw_nibble( word_20 addr, word_4 val ) void sdl_draw_annunc( void ) { - int val = display.annunc; + int val = saturn.annunc; if ( val == last_annunc_state ) return; diff --git a/src/ui_text.c b/src/ui_text.c index 513e072..ceeacc6 100644 --- a/src/ui_text.c +++ b/src/ui_text.c @@ -357,7 +357,7 @@ void text_menu_draw_nibble( word_20 addr, word_4 val ) void text_draw_annunc( void ) { wchar_t* annunciators_icons[ 6 ] = { L"↰", L"↱", L"α", L"🪫", L"⌛", L"⇄" }; - int val = display.annunc; + int val = saturn.annunc; if ( val == last_annunc_state ) return; diff --git a/src/ui_x11.c b/src/ui_x11.c index 21eeadb..dcfcdec 100644 --- a/src/ui_x11.c +++ b/src/ui_x11.c @@ -1820,8 +1820,8 @@ void refresh_icon( void ) { int icon_state; - icon_state = ( ( display.on && !( ( ANN_IO & display.annunc ) == ANN_IO ) ) || - ( display.on && !( ( ANN_ALPHA & display.annunc ) == ANN_ALPHA ) ) ); + icon_state = ( ( display.on && !( ( ANN_IO & saturn.annunc ) == ANN_IO ) ) || + ( display.on && !( ( ANN_ALPHA & saturn.annunc ) == ANN_ALPHA ) ) ); if ( icon_state == last_icon_state ) return; @@ -3717,7 +3717,7 @@ void x11_menu_draw_nibble( word_20 addr, word_4 val ) void x11_draw_annunc( void ) { - int val = display.annunc; + int val = saturn.annunc; if ( val == last_annunc_state ) return;