DPMS screen blanking support
This commit is contained in:
@@ -115,6 +115,7 @@
|
||||
#define IDS_2139 2139 // "MO images (*.IM?)\0*.IM?..."
|
||||
#define IDS_2140 2140 // "CD-ROM images (*.ISO;*.CU.."
|
||||
#define IDS_2141 2141 // "%hs Device Configuration"
|
||||
#define IDS_2142 2142 // "Monitor in sleep mode"
|
||||
|
||||
#define IDS_4096 4096 // "Hard disk (%s)"
|
||||
#define IDS_4097 4097 // "%01i:%01i"
|
||||
@@ -222,7 +223,7 @@
|
||||
|
||||
#define IDS_LANG_ENUS IDS_7168
|
||||
|
||||
#define STR_NUM_2048 94
|
||||
#define STR_NUM_2048 95
|
||||
#define STR_NUM_3072 11
|
||||
#define STR_NUM_4096 39
|
||||
#define STR_NUM_4352 6
|
||||
|
@@ -135,6 +135,7 @@ typedef struct svga_t
|
||||
plane_mask, writemask,
|
||||
colourcompare, colournocare,
|
||||
dac_mask, dac_status,
|
||||
dpms, dpms_ui,
|
||||
ksc5601_sbyte_mask, ksc5601_udc_area_msb[2];
|
||||
|
||||
int ksc5601_swap_mode;
|
||||
|
@@ -34,6 +34,8 @@
|
||||
#include <86box/pit.h>
|
||||
#include <86box/mem.h>
|
||||
#include <86box/rom.h>
|
||||
#include <86box/plat.h>
|
||||
#include <86box/ui.h>
|
||||
#include <86box/video.h>
|
||||
#include <86box/vid_svga.h>
|
||||
#include <86box/vid_svga_render.h>
|
||||
@@ -574,12 +576,29 @@ svga_recalctimings(svga_t *svga)
|
||||
svga->dispontime = TIMER_USEC;
|
||||
if (svga->dispofftime < TIMER_USEC)
|
||||
svga->dispofftime = TIMER_USEC;
|
||||
|
||||
/* Inform the user interface of any DPMS mode changes. */
|
||||
if (svga->dpms) {
|
||||
if (!svga->dpms_ui) {
|
||||
svga->dpms_ui = 1;
|
||||
ui_sb_set_text_w(plat_get_string(IDS_2142));
|
||||
}
|
||||
} else if (svga->dpms_ui) {
|
||||
svga->dpms_ui = 0;
|
||||
ui_sb_set_text_w(NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
svga_do_render(svga_t *svga)
|
||||
{
|
||||
/* Always render a blank screen and nothing else while in DPMS mode. */
|
||||
if (svga->dpms) {
|
||||
svga_render_blank(svga);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!svga->override) {
|
||||
svga->render(svga);
|
||||
|
||||
@@ -1361,7 +1380,10 @@ svga_doblit(int y1, int y2, int wx, int wy, svga_t *svga)
|
||||
} else
|
||||
suppress_overscan = 0;
|
||||
|
||||
set_screen_size(xsize + x_add, ysize + y_add);
|
||||
/* Block resolution changes while in DPMS mode to avoid getting a bogus
|
||||
screen width (320). We're already rendering a blank screen anyway. */
|
||||
if (!svga->dpms)
|
||||
set_screen_size(xsize + x_add, ysize + y_add);
|
||||
|
||||
if (video_force_resize_get())
|
||||
video_force_resize_set(0);
|
||||
|
@@ -1054,6 +1054,7 @@ BEGIN
|
||||
IDS_2139 "MO images (*.IM?;*.MDI)\0*.IM?;*.MDI\0All files (*.*)\0*.*\0"
|
||||
IDS_2140 "CD-ROM images (*.ISO;*.CUE)\0*.ISO;*.CUE\0All files (*.*)\0*.*\0"
|
||||
IDS_2141 "%hs Device Configuration"
|
||||
IDS_2142 "Monitor in sleep mode"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
|
@@ -72,6 +72,8 @@ static int sb_ready = 0;
|
||||
static uint8_t sb_map[256];
|
||||
static int dpi = 96;
|
||||
static int icon_width = 24;
|
||||
static wchar_t sb_text[512] = L"\0";
|
||||
static wchar_t sb_bugtext[512] = L"\0";
|
||||
|
||||
/* Also used by win_settings.c */
|
||||
intptr_t
|
||||
@@ -933,9 +935,8 @@ StatusBarCreate(HWND hwndParent, uintptr_t idStatus, HINSTANCE hInst)
|
||||
}
|
||||
|
||||
|
||||
/* API */
|
||||
void
|
||||
ui_sb_set_text_w(wchar_t *wstr)
|
||||
static void
|
||||
ui_sb_update_text()
|
||||
{
|
||||
uint8_t part = 0xff;
|
||||
|
||||
@@ -945,7 +946,19 @@ ui_sb_set_text_w(wchar_t *wstr)
|
||||
part = sb_map[SB_TEXT];
|
||||
|
||||
if (part != 0xff)
|
||||
SendMessage(hwndSBAR, SB_SETTEXT, part | SBT_NOBORDERS, (LPARAM)wstr);
|
||||
SendMessage(hwndSBAR, SB_SETTEXT, part | SBT_NOBORDERS, (LPARAM)((sb_text[0] != L'\0') ? sb_text : sb_bugtext));
|
||||
}
|
||||
|
||||
|
||||
/* API */
|
||||
void
|
||||
ui_sb_set_text_w(wchar_t *wstr)
|
||||
{
|
||||
if (wstr)
|
||||
wcscpy(sb_text, wstr);
|
||||
else
|
||||
memset(sb_text, 0x00, sizeof(sb_text));
|
||||
ui_sb_update_text();
|
||||
}
|
||||
|
||||
|
||||
@@ -953,11 +966,11 @@ ui_sb_set_text_w(wchar_t *wstr)
|
||||
void
|
||||
ui_sb_set_text(char *str)
|
||||
{
|
||||
static wchar_t wstr[512];
|
||||
|
||||
memset(wstr, 0x00, sizeof(wstr));
|
||||
mbstowcs(wstr, str, strlen(str) + 1);
|
||||
ui_sb_set_text_w(wstr);
|
||||
if (str)
|
||||
mbstowcs(sb_text, str, strlen(str) + 1);
|
||||
else
|
||||
memset(sb_text, 0x00, sizeof(sb_text));
|
||||
ui_sb_update_text();
|
||||
}
|
||||
|
||||
|
||||
@@ -965,9 +978,9 @@ ui_sb_set_text(char *str)
|
||||
void
|
||||
ui_sb_bugui(char *str)
|
||||
{
|
||||
static wchar_t wstr[512];
|
||||
|
||||
memset(wstr, 0x00, sizeof(wstr));
|
||||
mbstowcs(wstr, str, strlen(str) + 1);
|
||||
ui_sb_set_text_w(wstr);
|
||||
if (str)
|
||||
mbstowcs(sb_bugtext, str, strlen(str) + 1);
|
||||
else
|
||||
memset(sb_bugtext, 0x00, sizeof(sb_bugtext));
|
||||
ui_sb_update_text();
|
||||
}
|
||||
|
Reference in New Issue
Block a user