From 6f7ca2ccb0ebeec154fe103d285e3b0e5af77110 Mon Sep 17 00:00:00 2001 From: SarahW Date: Tue, 2 May 2017 16:48:40 +0100 Subject: [PATCH] Disc activity indicator can now be enabled/disabled. --- src/pc.c | 2 ++ src/pc.rc | 2 ++ src/resources.h | 1 + src/video.c | 2 ++ src/video.h | 1 + src/win-ddraw-fs.cc | 4 ++-- src/win-ddraw.cc | 4 ++-- src/win.c | 7 +++++++ 8 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/pc.c b/src/pc.c index b69ecdb..547d50b 100644 --- a/src/pc.c +++ b/src/pc.c @@ -640,6 +640,7 @@ void loadconfig(char *fn) vid_resize = config_get_int(NULL, "vid_resize", 0); video_force_aspect_ration = config_get_int(NULL, "vid_force_aspect_ratio", 0); + vid_disc_indicator = config_get_int(NULL, "vid_disc_indicator", 1); vid_api = config_get_int(NULL, "vid_api", 0); video_fullscreen_scale = config_get_int(NULL, "video_fullscreen_scale", 0); video_fullscreen_first = config_get_int(NULL, "video_fullscreen_first", 1); @@ -743,6 +744,7 @@ void saveconfig() config_set_string(NULL, "cdrom_path", iso_path); config_set_int(NULL, "vid_resize", vid_resize); config_set_int(NULL, "vid_force_aspect_ratio", video_force_aspect_ration); + config_set_int(NULL, "vid_disc_indicator", vid_disc_indicator); config_set_int(NULL, "vid_api", vid_api); config_set_int(NULL, "video_fullscreen_scale", video_fullscreen_scale); config_set_int(NULL, "video_fullscreen_first", video_fullscreen_first); diff --git a/src/pc.rc b/src/pc.rc index 5aaf68d..a5a35b5 100644 --- a/src/pc.rc +++ b/src/pc.rc @@ -50,6 +50,8 @@ BEGIN MENUITEM "&Square pixels", IDM_VID_FS_SQ MENUITEM "&Integer scale", IDM_VID_FS_INT END + MENUITEM SEPARATOR + MENUITEM "Disc activity indicator", IDM_VID_DISC END MENUITEM SEPARATOR MENUITEM "&Load configuration...", IDM_CONFIG_LOAD diff --git a/src/resources.h b/src/resources.h index 55b485e..f5f3cd1 100644 --- a/src/resources.h +++ b/src/resources.h @@ -15,6 +15,7 @@ #define IDM_VID_RESIZE 40050 #define IDM_VID_REMEMBER 40051 #define IDM_VID_ASPECT 40052 +#define IDM_VID_DISC 40053 #define IDM_VID_DDRAW 40060 #define IDM_VID_D3D 40061 #define IDM_VID_FULLSCREEN 40070 diff --git a/src/video.c b/src/video.c index 30b6c9e..b2d477b 100644 --- a/src/video.c +++ b/src/video.c @@ -157,6 +157,8 @@ int video_get_video_from_internal_name(char *s) int video_fullscreen = 0, video_fullscreen_scale, video_fullscreen_first; int video_force_aspect_ration = 0; +int vid_disc_indicator = 0; + uint32_t *video_15to32, *video_16to32; int egareads=0,egawrites=0; diff --git a/src/video.h b/src/video.h index 72b38c1..42454d1 100644 --- a/src/video.h +++ b/src/video.h @@ -41,6 +41,7 @@ int video_get_video_from_internal_name(char *s); extern int video_fullscreen, video_fullscreen_scale, video_fullscreen_first; extern int video_force_aspect_ration; +extern int vid_disc_indicator; enum { diff --git a/src/win-ddraw-fs.cc b/src/win-ddraw-fs.cc index e64a849..9f16819 100644 --- a/src/win-ddraw-fs.cc +++ b/src/win-ddraw-fs.cc @@ -242,7 +242,7 @@ static void ddraw_fs_blit_memtoscreen(int x, int y, int y1, int y2, int w, int h lpdds_back2->Blt(&r_dest, lpdds_back, &r_src, DDBLT_WAIT, NULL); } - if (readflash) + if (readflash && vid_disc_indicator) { RECT r; r.left = window_rect.right - 40; @@ -321,7 +321,7 @@ static void ddraw_fs_blit_memtoscreen_8(int x, int y, int w, int h) lpdds_back2->Blt(&r_dest, lpdds_back, &r_src, DDBLT_WAIT, NULL); } - if (readflash) + if (readflash && vid_disc_indicator) { RECT r; r.left = window_rect.right - 40; diff --git a/src/win-ddraw.cc b/src/win-ddraw.cc index 5fdf813..a46dbf9 100644 --- a/src/win-ddraw.cc +++ b/src/win-ddraw.cc @@ -195,7 +195,7 @@ static void ddraw_blit_memtoscreen(int x, int y, int y1, int y2, int w, int h) lpdds_back2->Blt(&r_src, lpdds_back, &r_src, DDBLT_WAIT, NULL); } - if (readflash) + if (readflash && vid_disc_indicator) { readflash = 0; hr = lpdds_back2->Lock(NULL, &ddsd, DDLOCK_SURFACEMEMORYPTR | DDLOCK_WAIT, NULL); @@ -280,7 +280,7 @@ static void ddraw_blit_memtoscreen_8(int x, int y, int w, int h) lpdds_back2->Blt(&r_src, lpdds_back, &r_src, DDBLT_WAIT, NULL); } - if (readflash) + if (readflash && vid_disc_indicator) { readflash = 0; hr = lpdds_back2->Lock(NULL, &ddsd, DDLOCK_SURFACEMEMORYPTR | DDLOCK_WAIT, NULL); diff --git a/src/win.c b/src/win.c index 690f42d..5cff840 100644 --- a/src/win.c +++ b/src/win.c @@ -595,6 +595,7 @@ int WINAPI WinMain (HINSTANCE hThisInstance, CheckMenuItem(menu, IDM_VID_FS_FULL + video_fullscreen_scale, MF_CHECKED); CheckMenuItem(menu, IDM_VID_REMEMBER, window_remember ? MF_CHECKED : MF_UNCHECKED); CheckMenuItem(menu, IDM_BPB_DISABLE, bpb_disable ? MF_CHECKED : MF_UNCHECKED); + CheckMenuItem(menu, IDM_VID_DISC, vid_disc_indicator ? MF_CHECKED : MF_UNCHECKED); // set_display_switch_mode(SWITCH_BACKGROUND); d=romset; @@ -1035,6 +1036,12 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM saveconfig(); break; + case IDM_VID_DISC: + vid_disc_indicator = !vid_disc_indicator; + CheckMenuItem(hmenu, IDM_VID_DISC, vid_disc_indicator ? MF_CHECKED : MF_UNCHECKED); + saveconfig(); + break; + case IDM_CONFIG_LOAD: pause = 1; if (!getfile(hwnd, "Configuration (*.CFG)\0*.CFG\0All files (*.*)\0*.*\0", ""))