Added the IBM 5161 ISA expansion for PC and XT;
Cleaned up the parallel port emulation, added IRQ support, and made enabling/disabling per port; Added the Award 430NX and the Intel Classic/PCI (Alfredo, 420TX); Finished the 586MC1; Added 8087 emulation; Moved Cyrix 6x86'es to the Dev branch; Sanitized/cleaned up memregs.c/h and intel.c/h; Split the chipsets from machines and sanitized Port 92 emulation; Added support for the 15bpp mode to the Compaq ATI 28800; Moved the MR 386DX and 486 machines to the Dev branch; Ported the new dynamic recompiler from PCem, but it remains in Dev branch until after v2.00; Ported the new timer code from PCem; Cleaned up the CPU table of unused stuff and better optimized its structure; Ported the Open-XT and Open-AT from VARCem, the Open-AT is in the Dev branch; Ported the XT MFM controller rewrite and adding of more controllers (incl. two RLL ones), from VARCem; Added the AHA-1540A and the BusTek BT-542B; Moved the Sumo SCSI-AT to the Dev branch; Minor IDE, FDC, and floppy drive code clean-ups; Made NCR 5380/53C400-based cards' BIOS address configurable; Got rid of the legacy romset variable; Unified (video) buffer and buffer32 into one and make the unified buffer 32-bit; Added the Amstead PPC512 per PCem patch by John Elliott; Switched memory mapping granularity from 16k to 4k (less than 1k not possible due to internal pages); Rewrote the CL-GD 54xx blitter, fixes Win-OS/2 on the 54x6 among other thing; Added the Image Manager 1024 and Professional Graphics Controller per PCem patch by John Elliott and work done on VARCem; Added Headland HT-216, GC-205 and Video 7 VGA 1024i emulation based on PCem commit; Implemented the fuction keys for the Toshiba T1000/T1200/T3100 enhancement; Amstrad MegaPC does now works correctly with non-internal graphics card; The SLiRP code no longer casts a packed struct type to a non-packed struct type; The Xi8088 and PB410a no longer hang on 86Box when PS/2 mouse is not present; The S3 Virge on BeOS is no longer broken (was broken by build #1591); OS/2 2.0 build 6.167 now sees key presses again; Xi8088 now work on CGA again; 86F images converted from either the old or new variants of the HxC MFM format now work correctly; Hardware interrupts with a vector of 0xFF are now handled correctly; OPTi 495SX boards no longer incorrectly have 64 MB maximum RAM when 32 MB is correct; Fixed VNC keyboard input bugs; Fixed AT RTC periodic interrupt - Chicago 58s / 73f / 73g / 81 MIDI play no longer hangs with the build's own VTD driver; Fixed mouse polling with internal mice - Amstrad and Olivetti mice now work correctly; Triones ATAPI DMA driver now correctly reads a file at the end of a CD image with a sectors number not divisible by 4; Compaq Portable now works with all graphics cards; Fixed various MDSI Genius bugs; Added segment limit checks and improved page fault checks for several CPU instructions - Memphis 15xx WINSETUP and Chicago 58s WINDISK.CPL no longer issue a GPF, and some S3 drivers that used to have glitches, now work correctly; Further improved the 808x emulation, also fixes the noticably choppy sound when using 808x CPU's, also fixes #355; OS/2 installer no logner locks up on splash screen on PS/2 Model 70 and 80, fixes #400. Fixed several Amstead bugs, GEM no longer crashes on the Amstrad 1640, fixes #391. Ported John Elliott's Amstrad fixes and improvement from PCem, and fixed the default language so it's correctly Engliish, fixes #278, fixes #389. Fixed a minor IDE timing bug, fixes #388. Fixed Toshiba T1000 RAM issues, fixes #379. Fixed EGA/(S)VGA overscan border handling, fixes #378; Got rid of the now long useless IDE channel 2 auto-removal, fixes #370; Fixed the BIOS files used by the AMSTRAD PC1512, fixes #366; Ported the Unicode CD image file name fix from VARCem, fixes #365; Fixed high density floppy disks on the Xi8088, fixes #359; Fixed some bugs in the Hercules emulation, fixes #346, fixes #358; Fixed the SCSI hard disk mode sense pages, fixes #356; Removed the AMI Unknown 386SX because of impossibility to identify the chipset, closes #349; Fixed bugs in the serial mouse emulation, fixes #344; Compiled 86Box binaries now include all the required .DLL's, fixes #341; Made some combo boxes in the Settings dialog slightly wider, fixes #276.
This commit is contained in:
@@ -12,13 +12,13 @@
|
||||
* we will not use that, but, instead, use a new window which
|
||||
* coverrs the entire desktop.
|
||||
*
|
||||
* Version: @(#)win_sdl.c 1.0.5 2019/02/08
|
||||
* Version: @(#)win_sdl.c 1.0.6 2019/03/09
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Michael Dr<44>ing, <michael@drueing.de>
|
||||
*
|
||||
* Copyright 2018 Fred N. van Kempen.
|
||||
* Copyright 2018 Michael Dr<44>ing.
|
||||
* Copyright 2018,2019 Fred N. van Kempen.
|
||||
* Copyright 2018,2019 Michael Dr<44>ing.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with
|
||||
* or without modification, are permitted provided that the
|
||||
@@ -87,9 +87,11 @@ static HWND sdl_hwnd = NULL;
|
||||
static int sdl_w, sdl_h;
|
||||
static int sdl_fs;
|
||||
static int cur_w, cur_h;
|
||||
static volatile int sdl_enabled = 0;
|
||||
static SDL_mutex* sdl_mutex = NULL;
|
||||
|
||||
static png_structp png_ptr;
|
||||
static png_infop info_ptr;
|
||||
static png_structp png_ptr;
|
||||
static png_infop info_ptr;
|
||||
|
||||
|
||||
/* Pointers to the real functions. */
|
||||
@@ -125,6 +127,11 @@ static int (*sdl_RenderReadPixels)(SDL_Renderer* renderer,
|
||||
int pitch);
|
||||
static SDL_bool (*sdl_SetHint)(const char* name,
|
||||
const char* value);
|
||||
static SDL_mutex* (*sdl_CreateMutex)(void);
|
||||
static void (*sdl_DestroyMutex)(SDL_mutex* mutex);
|
||||
static int (*sdl_LockMutex)(SDL_mutex* mutex);
|
||||
static int (*sdl_UnlockMutex)(SDL_mutex* mutex);
|
||||
|
||||
|
||||
static dllimp_t sdl_imports[] = {
|
||||
{ "SDL_GetVersion", &sdl_GetVersion },
|
||||
@@ -144,6 +151,10 @@ static dllimp_t sdl_imports[] = {
|
||||
{ "SDL_GetWindowSize", &sdl_GetWindowSize },
|
||||
{ "SDL_RenderReadPixels", &sdl_RenderReadPixels },
|
||||
{ "SDL_SetHint", &sdl_SetHint },
|
||||
{ "SDL_CreateMutex", &sdl_CreateMutex },
|
||||
{ "SDL_DestroyMutex", &sdl_DestroyMutex },
|
||||
{ "SDL_LockMutex", &sdl_LockMutex },
|
||||
{ "SDL_UnlockMutex", &sdl_UnlockMutex },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
@@ -181,33 +192,31 @@ sdl_stretch(int *w, int *h, int *x, int *y)
|
||||
*y = 0;
|
||||
break;
|
||||
case FULLSCR_SCALE_43:
|
||||
case FULLSCR_SCALE_KEEPRATIO:
|
||||
dw = (double) sdl_w;
|
||||
dh = (double) sdl_h;
|
||||
temp = (dh / 3.0) * 4.0;
|
||||
dx = (dw - temp) / 2.0;
|
||||
dw = temp;
|
||||
*w = (int) dw;
|
||||
*h = (int) dh;
|
||||
*x = (int) dx;
|
||||
*y = 0;
|
||||
break;
|
||||
case FULLSCR_SCALE_SQ:
|
||||
dw = (double) sdl_w;
|
||||
dh = (double) sdl_h;
|
||||
temp = ((double) *w);
|
||||
temp2 = ((double) *h);
|
||||
dx = (dw / 2.0) - ((dh * temp) / (temp2 * 2.0));
|
||||
dy = 0.0;
|
||||
if (dx < 0.0) {
|
||||
dx = 0.0;
|
||||
dy = (dw / 2.0) - ((dh * temp2) / (temp * 2.0));
|
||||
hsr = dw / dh;
|
||||
if (video_fullscreen_scale == FULLSCR_SCALE_43)
|
||||
gsr = 4.0 / 3.0;
|
||||
else
|
||||
gsr = ((double) *w) / ((double) *h);
|
||||
if (gsr <= hsr) {
|
||||
temp = dh * gsr;
|
||||
dx = (dw - temp) / 2.0;
|
||||
dw = temp;
|
||||
*w = (int) dw;
|
||||
*h = (int) dh;
|
||||
*x = (int) dx;
|
||||
*y = 0;
|
||||
} else {
|
||||
temp = dw / gsr;
|
||||
dy = (dh - temp) / 2.0;
|
||||
dh = temp;
|
||||
*w = (int) dw;
|
||||
*h = (int) dh;
|
||||
*x = 0;
|
||||
*y = (int) dy;
|
||||
}
|
||||
dw -= (dx * 2.0);
|
||||
dh -= (dy * 2.0);
|
||||
*w = (int) dw;
|
||||
*h = (int) dh;
|
||||
*x = (int) dx;
|
||||
*y = (int) dy;
|
||||
break;
|
||||
case FULLSCR_SCALE_INT:
|
||||
dw = (double) sdl_w;
|
||||
@@ -227,29 +236,6 @@ sdl_stretch(int *w, int *h, int *x, int *y)
|
||||
*x = (int) dx;
|
||||
*y = (int) dy;
|
||||
break;
|
||||
case FULLSCR_SCALE_KEEPRATIO:
|
||||
dw = (double) sdl_w;
|
||||
dh = (double) sdl_h;
|
||||
hsr = dw / dh;
|
||||
gsr = ((double) *w) / ((double) *h);
|
||||
if (gsr <= hsr) {
|
||||
temp = dh * gsr;
|
||||
dx = (dw - temp) / 2.0;
|
||||
dw = temp;
|
||||
*w = (int) dw;
|
||||
*h = (int) dh;
|
||||
*x = (int) dx;
|
||||
*y = 0;
|
||||
} else {
|
||||
temp = dw / gsr;
|
||||
dy = (dh - temp) / 2.0;
|
||||
dh = temp;
|
||||
*w = (int) dw;
|
||||
*h = (int) dh;
|
||||
*x = 0;
|
||||
*y = (int) dy;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -262,7 +248,12 @@ sdl_blit(int x, int y, int y1, int y2, int w, int h)
|
||||
int pitch;
|
||||
int yy, ret;
|
||||
|
||||
if (y1 == y2) {
|
||||
if (!sdl_enabled) {
|
||||
video_blit_complete();
|
||||
return;
|
||||
}
|
||||
|
||||
if ((y1 == y2) || (h <= 0)) {
|
||||
video_blit_complete();
|
||||
return;
|
||||
}
|
||||
@@ -272,6 +263,8 @@ sdl_blit(int x, int y, int y1, int y2, int w, int h)
|
||||
return;
|
||||
}
|
||||
|
||||
sdl_LockMutex(sdl_mutex);
|
||||
|
||||
/*
|
||||
* TODO:
|
||||
* SDL_UpdateTexture() might be better here, as it is
|
||||
@@ -282,9 +275,9 @@ sdl_blit(int x, int y, int y1, int y2, int w, int h)
|
||||
for (yy = y1; yy < y2; yy++) {
|
||||
if ((y + yy) >= 0 && (y + yy) < buffer32->h) {
|
||||
if (video_grayscale || invert_display)
|
||||
video_transform_copy((uint32_t *) &(((uint8_t *)pixeldata)[yy * pitch]), &(((uint32_t *)buffer32->line[y + yy])[x]), w);
|
||||
video_transform_copy((uint32_t *) &(((uint8_t *)pixeldata)[yy * pitch]), &(buffer32->line[y + yy][x]), w);
|
||||
else
|
||||
memcpy((uint32_t *) &(((uint8_t *)pixeldata)[yy * pitch]), &(((uint32_t *)buffer32->line[y + yy])[x]), w * 4);
|
||||
memcpy((uint32_t *) &(((uint8_t *)pixeldata)[yy * pitch]), &(buffer32->line[y + yy][x]), w * 4);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -309,6 +302,8 @@ sdl_blit(int x, int y, int y1, int y2, int w, int h)
|
||||
sdl_log("SDL: unable to copy texture to renderer (%s)\n", sdl_GetError());
|
||||
|
||||
sdl_RenderPresent(sdl_render);
|
||||
|
||||
sdl_UnlockMutex(sdl_mutex);
|
||||
}
|
||||
|
||||
|
||||
@@ -318,6 +313,14 @@ sdl_close(void)
|
||||
/* Unregister our renderer! */
|
||||
video_setblit(NULL);
|
||||
|
||||
if (sdl_enabled)
|
||||
sdl_enabled = 0;
|
||||
|
||||
if (sdl_mutex != NULL) {
|
||||
sdl_DestroyMutex(sdl_mutex);
|
||||
sdl_mutex = NULL;
|
||||
}
|
||||
|
||||
if (sdl_tex != NULL) {
|
||||
sdl_DestroyTexture(sdl_tex);
|
||||
sdl_tex = NULL;
|
||||
@@ -340,7 +343,8 @@ sdl_close(void)
|
||||
|
||||
SetFocus(hwndMain);
|
||||
|
||||
DestroyWindow(sdl_hwnd);
|
||||
if (sdl_fs)
|
||||
DestroyWindow(sdl_hwnd);
|
||||
sdl_hwnd = NULL;
|
||||
}
|
||||
|
||||
@@ -372,8 +376,6 @@ sdl_init_common(int fs)
|
||||
|
||||
sdl_log("SDL: init (fs=%d)\n", fs);
|
||||
|
||||
cgapal_rebuild();
|
||||
|
||||
/* Try loading the DLL. */
|
||||
sdl_handle = dynld_module(PATH_SDL_DLL, sdl_imports);
|
||||
if (sdl_handle == NULL) {
|
||||
@@ -498,6 +500,10 @@ sdl_init_common(int fs)
|
||||
|
||||
sdl_fs = fs;
|
||||
|
||||
sdl_enabled = 1;
|
||||
|
||||
sdl_mutex = sdl_CreateMutex();
|
||||
|
||||
return(1);
|
||||
}
|
||||
|
||||
@@ -619,13 +625,20 @@ sdl_resize(int x, int y)
|
||||
if ((x == cur_w) && (y == cur_h))
|
||||
return;
|
||||
|
||||
sdl_log("sdl_resize(%i, %i)\n", x, y);
|
||||
ww = x;
|
||||
wh = y;
|
||||
sdl_stretch(&ww, &wh, &wx, &wy);
|
||||
|
||||
MoveWindow(sdl_hwnd, wx, wy, ww, wh, TRUE);
|
||||
if (sdl_fs)
|
||||
MoveWindow(sdl_hwnd, wx, wy, ww, wh, TRUE);
|
||||
|
||||
cur_w = x;
|
||||
cur_h = y;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
sdl_enable(int enable)
|
||||
{
|
||||
sdl_enabled = enable;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user