Merge branch '86Box:master' into nec-v20
This commit is contained in:
10
src/86box.c
10
src/86box.c
@@ -409,8 +409,10 @@ pc_init(int argc, char *argv[])
|
||||
char temp[2048];
|
||||
struct tm *info;
|
||||
time_t now;
|
||||
int c;
|
||||
int ng = 0, lvmp = 0;
|
||||
int c, lvmp = 0;
|
||||
#ifdef ENABLE_NG
|
||||
int ng = 0;
|
||||
#endif
|
||||
#ifdef _WIN32
|
||||
uint32_t *uid, *shwnd;
|
||||
#endif
|
||||
@@ -492,12 +494,14 @@ usage:
|
||||
!strcasecmp(argv[c], "-D")) {
|
||||
force_debug = 1;
|
||||
#endif
|
||||
#ifdef ENABLE_NG
|
||||
} else if (!strcasecmp(argv[c], "--nographic") ||
|
||||
!strcasecmp(argv[c], "-E")) {
|
||||
/* Currently does nothing, but if/when we implement a built-in manager,
|
||||
it's going to force the manager not to run, allowing the old usage
|
||||
without parameter. */
|
||||
ng = 1;
|
||||
#endif
|
||||
} else if (!strcasecmp(argv[c], "--fullscreen") ||
|
||||
!strcasecmp(argv[c], "-F")) {
|
||||
start_in_fullscreen = 1;
|
||||
@@ -1263,8 +1267,6 @@ pc_onesec(void)
|
||||
void
|
||||
set_screen_size_monitor(int x, int y, int monitor_index)
|
||||
{
|
||||
int owsx = monitors[monitor_index].mon_scrnsz_x;
|
||||
int owsy = monitors[monitor_index].mon_scrnsz_y;
|
||||
int temp_overscan_x = monitors[monitor_index].mon_overscan_x;
|
||||
int temp_overscan_y = monitors[monitor_index].mon_overscan_y;
|
||||
double dx, dy, dtx, dty;
|
||||
|
||||
@@ -197,9 +197,7 @@ ali1489_defaults(ali1489_t *dev)
|
||||
|
||||
picintc(1 << 10);
|
||||
picintc(1 << 15);
|
||||
#ifdef OLD_NMI_BEHAVIOR
|
||||
nmi = 0;
|
||||
#endif
|
||||
smi_line = 0;
|
||||
in_smm = 0;
|
||||
|
||||
|
||||
@@ -728,10 +728,8 @@ pipc_fmnmi_read(uint16_t addr, void *priv)
|
||||
if (dev->ac97_regs[0][0x48] & 0x01) {
|
||||
if (dev->ac97_regs[0][0x48] & 0x04)
|
||||
smi_line = 0;
|
||||
#ifdef OLD_NMI_BEHAVIOR
|
||||
else
|
||||
nmi = 0;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
46
src/config.c
46
src/config.c
@@ -587,11 +587,9 @@ load_general(void)
|
||||
confirm_exit = config_get_int(cat, "confirm_exit", 1);
|
||||
confirm_save = config_get_int(cat, "confirm_save", 1);
|
||||
|
||||
p = config_get_string(cat, "language", NULL);
|
||||
if (p != NULL)
|
||||
{
|
||||
lang_id = plat_language_code(p);
|
||||
}
|
||||
p = config_get_string(cat, "language", NULL);
|
||||
if (p != NULL)
|
||||
lang_id = plat_language_code(p);
|
||||
|
||||
mouse_sensitivity = config_get_double(cat, "mouse_sensitivity", 1.0);
|
||||
if (mouse_sensitivity < 0.5)
|
||||
@@ -599,11 +597,11 @@ load_general(void)
|
||||
else if (mouse_sensitivity > 2.0)
|
||||
mouse_sensitivity = 2.0;
|
||||
|
||||
p = config_get_string(cat, "iconset", NULL);
|
||||
if (p != NULL)
|
||||
strcpy(icon_set, p);
|
||||
else
|
||||
strcpy(icon_set, "");
|
||||
p = config_get_string(cat, "iconset", NULL);
|
||||
if (p != NULL)
|
||||
strcpy(icon_set, p);
|
||||
else
|
||||
strcpy(icon_set, "");
|
||||
|
||||
enable_discord = !!config_get_int(cat, "enable_discord", 0);
|
||||
|
||||
@@ -2224,7 +2222,7 @@ static void
|
||||
save_general(void)
|
||||
{
|
||||
char *cat = "General";
|
||||
char temp[512];
|
||||
char temp[512], buffer[512] = {0};
|
||||
|
||||
char *va_name;
|
||||
|
||||
@@ -2233,11 +2231,10 @@ save_general(void)
|
||||
config_delete_var(cat, "vid_resize");
|
||||
|
||||
va_name = plat_vidapi_name(vid_api);
|
||||
if (!strcmp(va_name, "default")) {
|
||||
if (!strcmp(va_name, "default"))
|
||||
config_delete_var(cat, "vid_renderer");
|
||||
} else {
|
||||
else
|
||||
config_set_string(cat, "vid_renderer", va_name);
|
||||
}
|
||||
|
||||
if (video_fullscreen_scale == 0)
|
||||
config_delete_var(cat, "video_fullscreen_scale");
|
||||
@@ -2304,9 +2301,8 @@ save_general(void)
|
||||
config_set_int(cat, "window_remember", window_remember);
|
||||
else
|
||||
config_delete_var(cat, "window_remember");
|
||||
} else {
|
||||
} else
|
||||
config_delete_var(cat, "window_remember");
|
||||
}
|
||||
|
||||
if (vid_resize & 2) {
|
||||
sprintf(temp, "%ix%i", fixed_size_x, fixed_size_y);
|
||||
@@ -2356,17 +2352,15 @@ save_general(void)
|
||||
|
||||
if (lang_id == DEFAULT_LANGUAGE)
|
||||
config_delete_var(cat, "language");
|
||||
else
|
||||
{
|
||||
char buffer[512] = {0};
|
||||
plat_language_code_r(lang_id, buffer, 511);
|
||||
config_set_string(cat, "language", buffer);
|
||||
}
|
||||
else {
|
||||
plat_language_code_r(lang_id, buffer, 511);
|
||||
config_set_string(cat, "language", buffer);
|
||||
}
|
||||
|
||||
if (!strcmp(icon_set, ""))
|
||||
config_delete_var(cat, "iconset");
|
||||
else
|
||||
config_set_string(cat, "iconset", icon_set);
|
||||
if (!strcmp(icon_set, ""))
|
||||
config_delete_var(cat, "iconset");
|
||||
else
|
||||
config_set_string(cat, "iconset", icon_set);
|
||||
|
||||
if (enable_discord)
|
||||
config_set_int(cat, "enable_discord", enable_discord);
|
||||
|
||||
@@ -1068,9 +1068,7 @@ vid_in_200(uint16_t addr, void *priv)
|
||||
case 0x03dd:
|
||||
ret = vid->crtc_index; /* Read NMI reason */
|
||||
vid->crtc_index &= 0x1f; /* Reset NMI reason */
|
||||
#ifdef OLD_NMI_BEHAVIOR
|
||||
nmi = 0; /* And reset NMI flag */
|
||||
#endif
|
||||
return(ret);
|
||||
|
||||
case 0x03de:
|
||||
|
||||
@@ -1211,7 +1211,7 @@ static const device_config_t ne2000_config[] = {
|
||||
.description = "IRQ",
|
||||
.type = CONFIG_SELECTION,
|
||||
.default_string = "",
|
||||
.default_int = 10,
|
||||
.default_int = 3,
|
||||
.file_filter = "",
|
||||
.spinner = { 0 },
|
||||
.selection = {
|
||||
|
||||
@@ -229,7 +229,10 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
});
|
||||
|
||||
connect(this, &MainWindow::resizeContents, this, [this](int w, int h) {
|
||||
ui->stackedWidget->setFixedSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX);
|
||||
if (shownonce) {
|
||||
if (resizableonce == false) ui->stackedWidget->setFixedSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX);
|
||||
resizableonce = true;
|
||||
}
|
||||
if (!QApplication::platformName().contains("eglfs") && vid_resize != 1) {
|
||||
w = (w / (!dpi_scale ? util::screenOfWidget(this)->devicePixelRatio() : 1.));
|
||||
|
||||
@@ -558,7 +561,7 @@ void MainWindow::closeEvent(QCloseEvent *event) {
|
||||
if (renderers[i]) {
|
||||
monitor_settings[i].mon_window_w = renderers[i]->geometry().width();
|
||||
monitor_settings[i].mon_window_h = renderers[i]->geometry().height();
|
||||
if (!QApplication::platformName().contains("wayland")) continue;
|
||||
if (QApplication::platformName().contains("wayland")) continue;
|
||||
monitor_settings[i].mon_window_x = renderers[i]->geometry().x();
|
||||
monitor_settings[i].mon_window_y = renderers[i]->geometry().y();
|
||||
}
|
||||
@@ -582,7 +585,6 @@ void MainWindow::initRendererMonitorSlot(int monitor_index)
|
||||
auto& secondaryRenderer = this->renderers[monitor_index];
|
||||
secondaryRenderer.reset(new RendererStack(nullptr, monitor_index));
|
||||
if (secondaryRenderer) {
|
||||
connect(this, &MainWindow::pollMouse, secondaryRenderer.get(), &RendererStack::mousePoll, Qt::DirectConnection);
|
||||
connect(secondaryRenderer.get(), &RendererStack::rendererChanged, this, [this, monitor_index]
|
||||
{
|
||||
this->renderers[monitor_index]->show();
|
||||
|
||||
@@ -141,6 +141,7 @@ private:
|
||||
/* If main window should send keyboard input */
|
||||
bool send_keyboard_input = true;
|
||||
bool shownonce = false;
|
||||
bool resizableonce = false;
|
||||
|
||||
friend class SpecifyDimensions;
|
||||
friend class ProgSettings;
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
|
||||
#include "evdev_mouse.hpp"
|
||||
|
||||
#include <atomic>
|
||||
#include <stdexcept>
|
||||
|
||||
#include <QScreen>
|
||||
@@ -53,8 +54,8 @@ double mouse_sensitivity = 1.0;
|
||||
}
|
||||
|
||||
struct mouseinputdata {
|
||||
int deltax, deltay, deltaz;
|
||||
int mousebuttons;
|
||||
atomic_int deltax, deltay, deltaz;
|
||||
atomic_int mousebuttons;
|
||||
};
|
||||
static mouseinputdata mousedata;
|
||||
|
||||
@@ -145,7 +146,7 @@ int ignoreNextMouseEvent = 1;
|
||||
void
|
||||
RendererStack::mouseReleaseEvent(QMouseEvent *event)
|
||||
{
|
||||
if (this->geometry().contains(event->pos()) && event->button() == Qt::LeftButton && !mouse_capture && (isMouseDown & 1)) {
|
||||
if (this->geometry().contains(event->pos()) && event->button() == Qt::LeftButton && !mouse_capture && (isMouseDown & 1) && mouse_get_buttons() != 0) {
|
||||
plat_mouse_capture(1);
|
||||
this->setCursor(Qt::BlankCursor);
|
||||
if (!ignoreNextMouseEvent)
|
||||
@@ -164,6 +165,7 @@ RendererStack::mouseReleaseEvent(QMouseEvent *event)
|
||||
}
|
||||
isMouseDown &= ~1;
|
||||
}
|
||||
|
||||
void
|
||||
RendererStack::mousePressEvent(QMouseEvent *event)
|
||||
{
|
||||
@@ -173,6 +175,7 @@ RendererStack::mousePressEvent(QMouseEvent *event)
|
||||
}
|
||||
event->accept();
|
||||
}
|
||||
|
||||
void
|
||||
RendererStack::wheelEvent(QWheelEvent *event)
|
||||
{
|
||||
|
||||
@@ -306,9 +306,7 @@ es1371_reset(void *p)
|
||||
es1371_t *dev = (es1371_t *) p;
|
||||
int i;
|
||||
|
||||
#ifdef OLD_NMI_BEHAVIOR
|
||||
nmi = 0;
|
||||
#endif
|
||||
|
||||
/* Interrupt/Chip Select Control Register, Address 00H
|
||||
Addressable as byte, word, longword */
|
||||
|
||||
@@ -245,9 +245,7 @@ sigma_out(uint16_t addr, uint8_t val, void *p)
|
||||
sigma->lastport &= 0x7F;
|
||||
return;
|
||||
case 0x2DC: /* Reset NMI */
|
||||
#ifdef OLD_NMI_BEHAVIOR
|
||||
nmi = 0;
|
||||
#endif
|
||||
sigma->lastport &= 0x7F;
|
||||
return;
|
||||
case 0x2DD: /* Page in RAM at 0xC1800 */
|
||||
|
||||
@@ -76,35 +76,30 @@
|
||||
|
||||
#include <minitrace/minitrace.h>
|
||||
|
||||
volatile int screenshots = 0;
|
||||
//bitmap_t *buffer32 = NULL;
|
||||
uint8_t fontdat[2048][8]; /* IBM CGA font */
|
||||
uint8_t fontdatm[2048][16]; /* IBM MDA font */
|
||||
uint8_t fontdatw[512][32]; /* Wyse700 font */
|
||||
uint8_t fontdat8x12[256][16]; /* MDSI Genius font */
|
||||
uint8_t fontdat12x18[256][36]; /* IM1024 font */
|
||||
dbcs_font_t *fontdatksc5601 = NULL; /* Korean KSC-5601 font */
|
||||
dbcs_font_t *fontdatksc5601_user = NULL; /* Korean KSC-5601 user defined font */
|
||||
int herc_blend = 0;
|
||||
uint32_t *video_6to8 = NULL,
|
||||
*video_8togs = NULL,
|
||||
*video_8to32 = NULL,
|
||||
*video_15to32 = NULL,
|
||||
*video_16to32 = NULL;
|
||||
int frames = 0;
|
||||
int fullchange = 0;
|
||||
uint8_t edatlookup[4][4];
|
||||
static int video_force_resize;
|
||||
int video_grayscale = 0;
|
||||
int video_graytype = 0;
|
||||
static int vid_type;
|
||||
static const video_timings_t *vid_timings;
|
||||
static uint32_t cga_2_table[16];
|
||||
static uint8_t thread_run = 0;
|
||||
monitor_t monitors[MONITORS_NUM];
|
||||
monitor_settings_t monitor_settings[MONITORS_NUM];
|
||||
atomic_bool doresize_monitors[MONITORS_NUM];
|
||||
int monitor_index_global = 0;
|
||||
volatile int screenshots = 0;
|
||||
uint8_t edatlookup[4][4];
|
||||
uint8_t fontdat[2048][8]; /* IBM CGA font */
|
||||
uint8_t fontdatm[2048][16]; /* IBM MDA font */
|
||||
uint8_t fontdatw[512][32]; /* Wyse700 font */
|
||||
uint8_t fontdat8x12[256][16]; /* MDSI Genius font */
|
||||
uint8_t fontdat12x18[256][36]; /* IM1024 font */
|
||||
dbcs_font_t *fontdatksc5601 = NULL; /* Korean KSC-5601 font */
|
||||
dbcs_font_t *fontdatksc5601_user = NULL; /* Korean KSC-5601 user defined font */
|
||||
int herc_blend = 0;
|
||||
int frames = 0;
|
||||
int fullchange = 0;
|
||||
int video_grayscale = 0;
|
||||
int video_graytype = 0;
|
||||
int monitor_index_global = 0;
|
||||
uint32_t *video_6to8 = NULL,
|
||||
*video_8togs = NULL,
|
||||
*video_8to32 = NULL,
|
||||
*video_15to32 = NULL,
|
||||
*video_16to32 = NULL;
|
||||
monitor_t monitors[MONITORS_NUM];
|
||||
monitor_settings_t monitor_settings[MONITORS_NUM];
|
||||
atomic_bool doresize_monitors[MONITORS_NUM];
|
||||
|
||||
|
||||
#ifdef _WIN32
|
||||
void * __cdecl (*video_copy)(void *_Dst, const void *_Src, size_t _Size) = memcpy;
|
||||
@@ -241,18 +236,21 @@ const uint32_t shade[5][256] =
|
||||
};
|
||||
|
||||
|
||||
static struct blit_data_struct {
|
||||
typedef struct blit_data_struct {
|
||||
int x, y, w, h;
|
||||
int busy;
|
||||
int buffer_in_use;
|
||||
int thread_run;
|
||||
int monitor_index;
|
||||
int monitor_index;
|
||||
|
||||
thread_t *blit_thread;
|
||||
event_t *wake_blit_thread;
|
||||
event_t *blit_complete;
|
||||
event_t *buffer_not_in_use;
|
||||
} blit_data;
|
||||
} blit_data_t;
|
||||
|
||||
|
||||
static uint32_t cga_2_table[16];
|
||||
|
||||
|
||||
static void (*blit_func)(int x, int y, int w, int h, int monitor_index);
|
||||
@@ -288,7 +286,7 @@ video_setblit(void(*blit)(int,int,int,int,int))
|
||||
void
|
||||
video_blit_complete_monitor(int monitor_index)
|
||||
{
|
||||
struct blit_data_struct* blit_data_ptr = monitors[monitor_index].mon_blit_data_ptr;
|
||||
blit_data_t* blit_data_ptr = monitors[monitor_index].mon_blit_data_ptr;
|
||||
blit_data_ptr->buffer_in_use = 0;
|
||||
|
||||
thread_set_event(blit_data_ptr->buffer_not_in_use);
|
||||
@@ -298,7 +296,7 @@ video_blit_complete_monitor(int monitor_index)
|
||||
void
|
||||
video_wait_for_blit_monitor(int monitor_index)
|
||||
{
|
||||
struct blit_data_struct* blit_data_ptr = monitors[monitor_index].mon_blit_data_ptr;
|
||||
blit_data_t* blit_data_ptr = monitors[monitor_index].mon_blit_data_ptr;
|
||||
|
||||
while (blit_data_ptr->busy)
|
||||
thread_wait_event(blit_data_ptr->blit_complete, -1);
|
||||
@@ -309,7 +307,7 @@ video_wait_for_blit_monitor(int monitor_index)
|
||||
void
|
||||
video_wait_for_buffer_monitor(int monitor_index)
|
||||
{
|
||||
struct blit_data_struct* blit_data_ptr = monitors[monitor_index].mon_blit_data_ptr;
|
||||
blit_data_t* blit_data_ptr = monitors[monitor_index].mon_blit_data_ptr;
|
||||
|
||||
while (blit_data_ptr->buffer_in_use)
|
||||
thread_wait_event(blit_data_ptr->buffer_not_in_use, -1);
|
||||
@@ -328,7 +326,7 @@ video_take_screenshot_monitor(const char *fn, uint32_t *buf, int start_x, int st
|
||||
png_bytep *b_rgb = NULL;
|
||||
FILE *fp = NULL;
|
||||
uint32_t temp = 0x00000000;
|
||||
struct blit_data_struct* blit_data_ptr = monitors[monitor_index].mon_blit_data_ptr;
|
||||
blit_data_t* blit_data_ptr = monitors[monitor_index].mon_blit_data_ptr;
|
||||
|
||||
/* create file */
|
||||
fp = plat_fopen((char *) fn, (char *) "wb");
|
||||
@@ -460,7 +458,7 @@ video_transform_copy(void *__restrict _Dst, const void *__restrict _Src, size_t
|
||||
static
|
||||
void blit_thread(void *param)
|
||||
{
|
||||
struct blit_data_struct* data = param;
|
||||
blit_data_t* data = param;
|
||||
while (data->thread_run) {
|
||||
thread_wait_event(data->wake_blit_thread, -1);
|
||||
thread_reset_event(data->wake_blit_thread);
|
||||
@@ -870,7 +868,7 @@ video_monitor_init(int index)
|
||||
monitors[index].mon_bpp = 8;
|
||||
monitors[index].mon_changeframecount = 2;
|
||||
monitors[index].target_buffer = create_bitmap(2048, 2048);
|
||||
monitors[index].mon_blit_data_ptr = calloc(1, sizeof(struct blit_data_struct));
|
||||
monitors[index].mon_blit_data_ptr = calloc(1, sizeof(blit_data_t));
|
||||
monitors[index].mon_blit_data_ptr->wake_blit_thread = thread_create_event();
|
||||
monitors[index].mon_blit_data_ptr->blit_complete = thread_create_event();
|
||||
monitors[index].mon_blit_data_ptr->buffer_not_in_use = thread_create_event();
|
||||
|
||||
Reference in New Issue
Block a user