Merge branch 'master' into opengl

This commit is contained in:
ts-korhonen
2021-04-16 18:46:53 +03:00
27 changed files with 397 additions and 188 deletions

View File

@@ -1076,6 +1076,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

View File

@@ -51,6 +51,9 @@ ifeq ($(DEV_BUILD), y)
ifndef I450KX
I450KX := y
endif
ifndef M154X
M145X := y
endif
ifndef LASERXT
LASERXT := y
endif
@@ -130,6 +133,9 @@ else
ifndef LASERXT
LASERXT := n
endif
ifndef M154X
M145X := n
endif
ifndef MGA
MGA := n
endif

View File

@@ -23,6 +23,7 @@
#include <86box/win.h>
#define MACHINE_HAS_IDE (machines[machine].flags & MACHINE_IDE_QUAD)
#define MACHINE_HAS_SCSI (machines[machine].flags & MACHINE_SCSI_DUAL)
#define FDD_FIRST 0
#define CDROM_FIRST FDD_FIRST + FDD_NUM
@@ -294,7 +295,7 @@ is_valid_cdrom(int i)
{
if ((cdrom[i].bus_type == CDROM_BUS_ATAPI) && !MACHINE_HAS_IDE)
return 0;
if ((cdrom[i].bus_type == CDROM_BUS_SCSI) && (scsi_card_current == 0))
if ((cdrom[i].bus_type == CDROM_BUS_SCSI) && !MACHINE_HAS_SCSI && (scsi_card_current == 0))
return 0;
return cdrom[i].bus_type != 0;
}
@@ -304,7 +305,7 @@ is_valid_zip(int i)
{
if ((zip_drives[i].bus_type == ZIP_BUS_ATAPI) && !MACHINE_HAS_IDE)
return 0;
if ((zip_drives[i].bus_type == ZIP_BUS_SCSI) && (scsi_card_current == 0))
if ((zip_drives[i].bus_type == ZIP_BUS_SCSI) && !MACHINE_HAS_SCSI && (scsi_card_current == 0))
return 0;
return zip_drives[i].bus_type != 0;
}
@@ -314,7 +315,7 @@ is_valid_mo(int i)
{
if ((mo_drives[i].bus_type == MO_BUS_ATAPI) && !MACHINE_HAS_IDE)
return 0;
if ((mo_drives[i].bus_type == MO_BUS_SCSI) && (scsi_card_current == 0))
if ((mo_drives[i].bus_type == MO_BUS_SCSI) && !MACHINE_HAS_SCSI && (scsi_card_current == 0))
return 0;
return mo_drives[i].bus_type != 0;
}

View File

@@ -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
@@ -424,6 +426,11 @@ StatusBarDestroyTips(void)
void
ui_sb_set_ready(int ready)
{
if (ready == 0) {
ui_sb_bugui(NULL);
ui_sb_set_text(NULL);
}
sb_ready = ready;
}
@@ -639,7 +646,7 @@ ui_sb_update_panes(void)
sb_map[SB_HDD | HDD_BUS_IDE] = sb_parts;
sb_parts++;
}
if (c_scsi && (scsi_card_current != 0)) {
if (c_scsi && (scsi_int || (scsi_card_current != 0))) {
edge += icon_width;
iStatusWidths[sb_parts] = edge;
sb_part_meanings[sb_parts] = SB_HDD | HDD_BUS_SCSI;
@@ -941,9 +948,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;
@@ -953,7 +959,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();
}
@@ -961,11 +979,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();
}
@@ -973,9 +991,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();
}