2017-05-30 03:38:38 +02:00
|
|
|
/*
|
|
|
|
|
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
|
|
|
|
* running old operating systems and software designed for IBM
|
|
|
|
|
* PC systems and compatibles from 1981 through fairly recent
|
|
|
|
|
* system designs based on the PCI bus.
|
|
|
|
|
*
|
|
|
|
|
* This file is part of the 86Box distribution.
|
|
|
|
|
*
|
2017-10-29 04:20:20 -05:00
|
|
|
* Platform main support module for Windows.
|
2017-05-30 03:38:38 +02:00
|
|
|
*
|
2020-03-25 00:46:02 +02:00
|
|
|
*
|
2017-05-30 03:38:38 +02:00
|
|
|
*
|
2017-05-29 22:21:55 -04:00
|
|
|
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
2017-05-30 03:38:38 +02:00
|
|
|
* Miran Grca, <mgrca8@gmail.com>
|
2017-06-05 01:20:51 -04:00
|
|
|
* Fred N. van Kempen, <decwiz@yahoo.com>
|
2017-10-07 04:34:04 -04:00
|
|
|
*
|
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.
2019-09-20 14:02:30 +02:00
|
|
|
* Copyright 2008-2019 Sarah Walker.
|
|
|
|
|
* Copyright 2016-2019 Miran Grca.
|
|
|
|
|
* Copyright 2017-2019 Fred N. van Kempen.
|
2017-05-30 03:38:38 +02:00
|
|
|
*/
|
2017-09-25 04:31:20 -04:00
|
|
|
#define UNICODE
|
2020-02-04 22:08:05 +08:00
|
|
|
#define NTDDI_VERSION 0x06010000
|
2017-09-25 04:31:20 -04:00
|
|
|
#include <windows.h>
|
2020-12-02 06:11:27 +01:00
|
|
|
#include <commctrl.h>
|
2018-10-12 20:10:33 +02:00
|
|
|
#include <shlobj.h>
|
2020-02-04 22:08:05 +08:00
|
|
|
#include <shobjidl.h>
|
2018-05-21 19:04:05 +02:00
|
|
|
#include <fcntl.h>
|
|
|
|
|
#include <stdarg.h>
|
2017-09-25 04:31:20 -04:00
|
|
|
#include <stdint.h>
|
2018-05-21 19:04:05 +02:00
|
|
|
#include <stdio.h>
|
2017-05-24 00:27:42 -04:00
|
|
|
#include <string.h>
|
2017-09-25 04:31:20 -04:00
|
|
|
#include <stdlib.h>
|
2017-10-11 05:40:44 -04:00
|
|
|
#include <time.h>
|
2021-03-14 20:35:01 +01:00
|
|
|
#include <direct.h>
|
2017-09-25 04:31:20 -04:00
|
|
|
#include <wchar.h>
|
2021-03-21 01:59:46 +01:00
|
|
|
#include <io.h>
|
2018-05-21 19:04:05 +02:00
|
|
|
#define HAVE_STDARG_H
|
2020-03-29 14:24:42 +02:00
|
|
|
#include <86box/86box.h>
|
|
|
|
|
#include <86box/config.h>
|
|
|
|
|
#include <86box/device.h>
|
|
|
|
|
#include <86box/keyboard.h>
|
|
|
|
|
#include <86box/mouse.h>
|
2021-03-24 19:52:44 +01:00
|
|
|
#include <86box/timer.h>
|
|
|
|
|
#include <86box/nvr.h>
|
2020-03-29 14:24:42 +02:00
|
|
|
#include <86box/video.h>
|
2017-10-17 01:59:09 -04:00
|
|
|
#define GLOBAL
|
2020-03-29 14:24:42 +02:00
|
|
|
#include <86box/plat.h>
|
|
|
|
|
#include <86box/plat_midi.h>
|
|
|
|
|
#include <86box/ui.h>
|
2020-04-18 11:51:54 +02:00
|
|
|
#ifdef USE_VNC
|
|
|
|
|
# include <86box/vnc.h>
|
|
|
|
|
#endif
|
2020-04-17 02:06:00 +02:00
|
|
|
#include <86box/win_sdl.h>
|
2021-04-10 01:35:17 +03:00
|
|
|
#include <86box/win_opengl.h>
|
2020-03-29 14:24:42 +02:00
|
|
|
#include <86box/win.h>
|
2020-06-26 13:26:42 +02:00
|
|
|
#include <86box/version.h>
|
2021-02-10 20:22:51 +00:00
|
|
|
#ifdef MTR_ENABLED
|
|
|
|
|
#include <minitrace/minitrace.h>
|
|
|
|
|
#endif
|
2017-10-08 19:14:46 -04:00
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
WCHAR str[512];
|
|
|
|
|
} rc_str_t;
|
|
|
|
|
|
|
|
|
|
|
2017-11-19 03:15:29 -05:00
|
|
|
/* Platform Public data, specific. */
|
2017-10-19 04:27:04 -04:00
|
|
|
HINSTANCE hinstance; /* application instance */
|
2017-10-14 00:49:08 -04:00
|
|
|
HANDLE ghMutex;
|
2017-10-19 04:27:04 -04:00
|
|
|
LCID lang_id; /* current language ID used */
|
|
|
|
|
DWORD dwSubLangID;
|
2021-03-14 20:35:01 +01:00
|
|
|
int acp_utf8; /* Windows supports UTF-8 codepage */
|
2017-05-18 14:03:43 -04:00
|
|
|
|
|
|
|
|
|
2017-10-14 00:49:08 -04:00
|
|
|
/* Local data. */
|
2017-10-07 00:46:54 -04:00
|
|
|
static HANDLE thMain;
|
2017-10-14 00:49:08 -04:00
|
|
|
static rc_str_t *lpRCstr2048,
|
|
|
|
|
*lpRCstr4096,
|
|
|
|
|
*lpRCstr4352,
|
|
|
|
|
*lpRCstr4608,
|
|
|
|
|
*lpRCstr5120,
|
|
|
|
|
*lpRCstr5376,
|
|
|
|
|
*lpRCstr5632,
|
2018-01-19 15:39:13 +01:00
|
|
|
*lpRCstr5888,
|
|
|
|
|
*lpRCstr6144,
|
|
|
|
|
*lpRCstr7168;
|
2018-04-25 23:51:13 +02:00
|
|
|
static int vid_api_inited = 0;
|
2021-03-14 20:35:01 +01:00
|
|
|
static char *argbuf;
|
2021-03-24 19:52:44 +01:00
|
|
|
static int first_use = 1;
|
|
|
|
|
static LARGE_INTEGER StartingTime;
|
|
|
|
|
static LARGE_INTEGER Frequency;
|
2017-05-18 14:03:43 -04:00
|
|
|
|
|
|
|
|
|
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.
2019-09-20 14:02:30 +02:00
|
|
|
static const struct {
|
|
|
|
|
const char *name;
|
2017-12-04 11:59:26 -05:00
|
|
|
int local;
|
|
|
|
|
int (*init)(void *);
|
|
|
|
|
void (*close)(void);
|
|
|
|
|
void (*resize)(int x, int y);
|
|
|
|
|
int (*pause)(void);
|
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.
2019-09-20 14:02:30 +02:00
|
|
|
void (*enable)(int enable);
|
2020-11-28 07:04:40 +01:00
|
|
|
void (*set_fs)(int fs);
|
2021-04-21 01:33:01 +03:00
|
|
|
void (*reload)(void);
|
2020-11-28 07:04:40 +01:00
|
|
|
} vid_apis[RENDERERS_NUM] = {
|
2021-04-21 01:33:01 +03:00
|
|
|
{ "SDL_Software", 1, (int(*)(void*))sdl_inits, sdl_close, NULL, sdl_pause, sdl_enable, sdl_set_fs, NULL },
|
|
|
|
|
{ "SDL_Hardware", 1, (int(*)(void*))sdl_inith, sdl_close, NULL, sdl_pause, sdl_enable, sdl_set_fs, NULL },
|
|
|
|
|
{ "SDL_OpenGL", 1, (int(*)(void*))sdl_initho, sdl_close, NULL, sdl_pause, sdl_enable, sdl_set_fs, NULL }
|
2021-04-26 02:45:20 +05:00
|
|
|
#if defined(DEV_BRANCH) && defined(USE_OPENGL)
|
2021-04-23 16:09:45 +03:00
|
|
|
,{ "OpenGL_Core", 1, (int(*)(void*))opengl_init, opengl_close, opengl_resize, opengl_pause, NULL, opengl_set_fs, opengl_reload}
|
2021-04-17 13:45:11 +03:00
|
|
|
#else
|
2021-04-21 01:33:01 +03:00
|
|
|
,{ "OpenGL_Core", 1, (int(*)(void*))sdl_initho, sdl_close, NULL, sdl_pause, sdl_enable, sdl_set_fs, NULL } /* fall back to SDL_OpenGL */
|
2021-04-17 13:45:11 +03:00
|
|
|
#endif
|
2020-04-18 11:51:54 +02:00
|
|
|
#ifdef USE_VNC
|
2021-04-21 01:33:01 +03:00
|
|
|
,{ "VNC", 0, vnc_init, vnc_close, vnc_resize, vnc_pause, NULL, NULL }
|
2020-04-18 11:51:54 +02:00
|
|
|
#endif
|
2017-12-04 11:59:26 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2021-03-24 19:52:44 +01:00
|
|
|
extern int title_update;
|
|
|
|
|
|
|
|
|
|
|
2018-05-21 19:04:05 +02:00
|
|
|
#ifdef ENABLE_WIN_LOG
|
|
|
|
|
int win_do_log = ENABLE_WIN_LOG;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
win_log(const char *fmt, ...)
|
|
|
|
|
{
|
|
|
|
|
va_list ap;
|
|
|
|
|
|
|
|
|
|
if (win_do_log) {
|
|
|
|
|
va_start(ap, fmt);
|
|
|
|
|
pclog_ex(fmt, ap);
|
|
|
|
|
va_end(ap);
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-10-19 00:39:32 +02:00
|
|
|
#else
|
|
|
|
|
#define win_log(fmt, ...)
|
|
|
|
|
#endif
|
2018-05-21 19:04:05 +02:00
|
|
|
|
|
|
|
|
|
2017-10-07 00:46:54 -04:00
|
|
|
static void
|
2017-11-19 03:15:29 -05:00
|
|
|
LoadCommonStrings(void)
|
2017-08-22 02:47:22 +02:00
|
|
|
{
|
2017-11-19 03:15:29 -05:00
|
|
|
int i;
|
2017-10-07 00:46:54 -04:00
|
|
|
|
2017-11-19 03:15:29 -05:00
|
|
|
lpRCstr2048 = (rc_str_t *)malloc(STR_NUM_2048*sizeof(rc_str_t));
|
|
|
|
|
lpRCstr4096 = (rc_str_t *)malloc(STR_NUM_4096*sizeof(rc_str_t));
|
|
|
|
|
lpRCstr4352 = (rc_str_t *)malloc(STR_NUM_4352*sizeof(rc_str_t));
|
|
|
|
|
lpRCstr4608 = (rc_str_t *)malloc(STR_NUM_4608*sizeof(rc_str_t));
|
|
|
|
|
lpRCstr5120 = (rc_str_t *)malloc(STR_NUM_5120*sizeof(rc_str_t));
|
|
|
|
|
lpRCstr5376 = (rc_str_t *)malloc(STR_NUM_5376*sizeof(rc_str_t));
|
|
|
|
|
lpRCstr5632 = (rc_str_t *)malloc(STR_NUM_5632*sizeof(rc_str_t));
|
2018-01-19 15:39:13 +01:00
|
|
|
lpRCstr5888 = (rc_str_t *)malloc(STR_NUM_5888*sizeof(rc_str_t));
|
2017-11-19 03:15:29 -05:00
|
|
|
lpRCstr6144 = (rc_str_t *)malloc(STR_NUM_6144*sizeof(rc_str_t));
|
2018-01-19 15:39:13 +01:00
|
|
|
lpRCstr7168 = (rc_str_t *)malloc(STR_NUM_7168*sizeof(rc_str_t));
|
2017-11-19 03:15:29 -05:00
|
|
|
|
|
|
|
|
for (i=0; i<STR_NUM_2048; i++)
|
|
|
|
|
LoadString(hinstance, 2048+i, lpRCstr2048[i].str, 512);
|
2017-10-07 00:46:54 -04:00
|
|
|
|
2017-11-19 03:15:29 -05:00
|
|
|
for (i=0; i<STR_NUM_4096; i++)
|
|
|
|
|
LoadString(hinstance, 4096+i, lpRCstr4096[i].str, 512);
|
2017-10-07 00:46:54 -04:00
|
|
|
|
2017-11-19 03:15:29 -05:00
|
|
|
for (i=0; i<STR_NUM_4352; i++)
|
|
|
|
|
LoadString(hinstance, 4352+i, lpRCstr4352[i].str, 512);
|
2017-10-07 00:46:54 -04:00
|
|
|
|
2017-11-19 03:15:29 -05:00
|
|
|
for (i=0; i<STR_NUM_4608; i++)
|
|
|
|
|
LoadString(hinstance, 4608+i, lpRCstr4608[i].str, 512);
|
2017-10-07 00:46:54 -04:00
|
|
|
|
2017-11-19 03:15:29 -05:00
|
|
|
for (i=0; i<STR_NUM_5120; i++)
|
|
|
|
|
LoadString(hinstance, 5120+i, lpRCstr5120[i].str, 512);
|
2017-10-07 00:46:54 -04:00
|
|
|
|
2018-07-15 01:41:53 +02:00
|
|
|
for (i=0; i<STR_NUM_5376; i++) {
|
|
|
|
|
if ((i == 0) || (i > 3))
|
|
|
|
|
LoadString(hinstance, 5376+i, lpRCstr5376[i].str, 512);
|
|
|
|
|
}
|
2017-10-07 00:46:54 -04:00
|
|
|
|
2018-07-15 01:41:53 +02:00
|
|
|
for (i=0; i<STR_NUM_5632; i++) {
|
|
|
|
|
if ((i == 0) || (i > 3))
|
|
|
|
|
LoadString(hinstance, 5632+i, lpRCstr5632[i].str, 512);
|
|
|
|
|
}
|
2017-10-07 00:46:54 -04:00
|
|
|
|
2018-01-19 15:39:13 +01:00
|
|
|
for (i=0; i<STR_NUM_5888; i++)
|
|
|
|
|
LoadString(hinstance, 5888+i, lpRCstr5888[i].str, 512);
|
|
|
|
|
|
2017-11-19 03:15:29 -05:00
|
|
|
for (i=0; i<STR_NUM_6144; i++)
|
|
|
|
|
LoadString(hinstance, 6144+i, lpRCstr6144[i].str, 512);
|
2018-01-19 15:39:13 +01:00
|
|
|
|
|
|
|
|
for (i=0; i<STR_NUM_7168; i++)
|
|
|
|
|
LoadString(hinstance, 7168+i, lpRCstr7168[i].str, 512);
|
2017-10-07 00:46:54 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2021-03-14 20:35:01 +01:00
|
|
|
size_t mbstoc16s(uint16_t dst[], const char src[], int len)
|
|
|
|
|
{
|
|
|
|
|
if (src == NULL) return 0;
|
|
|
|
|
if (len < 0) return 0;
|
|
|
|
|
|
|
|
|
|
size_t ret = MultiByteToWideChar(CP_UTF8, 0, src, -1, dst, dst == NULL ? 0 : len);
|
|
|
|
|
|
|
|
|
|
if (!ret) {
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
size_t c16stombs(char dst[], const uint16_t src[], int len)
|
|
|
|
|
{
|
|
|
|
|
if (src == NULL) return 0;
|
|
|
|
|
if (len < 0) return 0;
|
|
|
|
|
|
|
|
|
|
size_t ret = WideCharToMultiByte(CP_UTF8, 0, src, -1, dst, dst == NULL ? 0 : len, NULL, NULL);
|
|
|
|
|
|
|
|
|
|
if (!ret) {
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2017-11-19 03:15:29 -05:00
|
|
|
/* Set (or re-set) the language for the application. */
|
|
|
|
|
void
|
|
|
|
|
set_language(int id)
|
2017-10-07 00:46:54 -04:00
|
|
|
{
|
2017-11-19 03:15:29 -05:00
|
|
|
LCID lcidNew = MAKELCID(id, dwSubLangID);
|
2017-10-07 00:46:54 -04:00
|
|
|
|
2017-11-19 03:15:29 -05:00
|
|
|
if (lang_id != lcidNew) {
|
|
|
|
|
/* Set our new language ID. */
|
|
|
|
|
lang_id = lcidNew;
|
2017-10-07 00:46:54 -04:00
|
|
|
|
2017-11-19 03:15:29 -05:00
|
|
|
SetThreadLocale(lang_id);
|
2017-08-22 02:47:22 +02:00
|
|
|
|
2017-11-19 03:15:29 -05:00
|
|
|
/* Load the strings table for this ID. */
|
|
|
|
|
LoadCommonStrings();
|
2017-10-07 00:46:54 -04:00
|
|
|
}
|
|
|
|
|
}
|
2017-05-18 14:03:43 -04:00
|
|
|
|
|
|
|
|
|
2017-11-19 03:15:29 -05:00
|
|
|
wchar_t *
|
|
|
|
|
plat_get_string(int i)
|
2017-10-08 19:14:46 -04:00
|
|
|
{
|
2017-11-19 03:15:29 -05:00
|
|
|
LPTSTR str;
|
2017-10-08 19:14:46 -04:00
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
if ((i >= 2048) && (i <= 3071))
|
2017-11-19 03:15:29 -05:00
|
|
|
str = lpRCstr2048[i-2048].str;
|
2018-04-25 23:51:13 +02:00
|
|
|
else if ((i >= 4096) && (i <= 4351))
|
2017-11-19 03:15:29 -05:00
|
|
|
str = lpRCstr4096[i-4096].str;
|
2018-04-25 23:51:13 +02:00
|
|
|
else if ((i >= 4352) && (i <= 4607))
|
2017-11-19 03:15:29 -05:00
|
|
|
str = lpRCstr4352[i-4352].str;
|
2018-04-25 23:51:13 +02:00
|
|
|
else if ((i >= 4608) && (i <= 5119))
|
2017-11-19 03:15:29 -05:00
|
|
|
str = lpRCstr4608[i-4608].str;
|
2018-04-25 23:51:13 +02:00
|
|
|
else if ((i >= 5120) && (i <= 5375))
|
2017-11-19 03:15:29 -05:00
|
|
|
str = lpRCstr5120[i-5120].str;
|
2018-04-25 23:51:13 +02:00
|
|
|
else if ((i >= 5376) && (i <= 5631))
|
2017-11-19 03:15:29 -05:00
|
|
|
str = lpRCstr5376[i-5376].str;
|
2018-04-25 23:51:13 +02:00
|
|
|
else if ((i >= 5632) && (i <= 5887))
|
2017-11-19 03:15:29 -05:00
|
|
|
str = lpRCstr5632[i-5632].str;
|
2018-04-25 23:51:13 +02:00
|
|
|
else if ((i >= 5888) && (i <= 6143))
|
2018-01-19 15:39:13 +01:00
|
|
|
str = lpRCstr5888[i-5888].str;
|
2018-04-25 23:51:13 +02:00
|
|
|
else if ((i >= 6144) && (i <= 7167))
|
2017-11-19 03:15:29 -05:00
|
|
|
str = lpRCstr6144[i-6144].str;
|
2018-04-25 23:51:13 +02:00
|
|
|
else
|
2018-01-19 15:39:13 +01:00
|
|
|
str = lpRCstr7168[i-7168].str;
|
2017-10-08 19:14:46 -04:00
|
|
|
|
2017-11-19 03:15:29 -05:00
|
|
|
return((wchar_t *)str);
|
2017-10-08 19:14:46 -04:00
|
|
|
}
|
|
|
|
|
|
2021-02-10 20:22:51 +00:00
|
|
|
#ifdef MTR_ENABLED
|
|
|
|
|
void
|
|
|
|
|
init_trace(void)
|
|
|
|
|
{
|
|
|
|
|
mtr_init("trace.json");
|
|
|
|
|
mtr_start();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
shutdown_trace(void)
|
|
|
|
|
{
|
|
|
|
|
mtr_stop();
|
|
|
|
|
mtr_shutdown();
|
|
|
|
|
}
|
|
|
|
|
#endif
|
2017-10-08 19:14:46 -04:00
|
|
|
|
2017-10-07 00:46:54 -04:00
|
|
|
/* Create a console if we don't already have one. */
|
|
|
|
|
static void
|
|
|
|
|
CreateConsole(int init)
|
|
|
|
|
{
|
|
|
|
|
HANDLE h;
|
|
|
|
|
FILE *fp;
|
|
|
|
|
fpos_t p;
|
|
|
|
|
int i;
|
2017-10-02 02:15:35 -04:00
|
|
|
|
2017-10-07 00:46:54 -04:00
|
|
|
if (! init) {
|
2020-04-22 13:19:28 +02:00
|
|
|
if (force_debug)
|
|
|
|
|
FreeConsole();
|
2017-10-07 00:46:54 -04:00
|
|
|
return;
|
|
|
|
|
}
|
2017-10-02 02:15:35 -04:00
|
|
|
|
2017-10-07 00:46:54 -04:00
|
|
|
/* Are we logging to a file? */
|
|
|
|
|
p = 0;
|
|
|
|
|
(void)fgetpos(stdout, &p);
|
|
|
|
|
if (p != -1) return;
|
2017-10-02 02:15:35 -04:00
|
|
|
|
2017-10-07 00:46:54 -04:00
|
|
|
/* Not logging to file, attach to console. */
|
|
|
|
|
if (! AttachConsole(ATTACH_PARENT_PROCESS)) {
|
|
|
|
|
/* Parent has no console, create one. */
|
2018-04-25 23:51:13 +02:00
|
|
|
if (! AllocConsole()) {
|
|
|
|
|
/* Cannot create console, just give up. */
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
fp = NULL;
|
|
|
|
|
if ((h = GetStdHandle(STD_OUTPUT_HANDLE)) != NULL) {
|
|
|
|
|
/* We got the handle, now open a file descriptor. */
|
|
|
|
|
if ((i = _open_osfhandle((intptr_t)h, _O_TEXT)) != -1) {
|
|
|
|
|
/* We got a file descriptor, now allocate a new stream. */
|
|
|
|
|
if ((fp = _fdopen(i, "w")) != NULL) {
|
|
|
|
|
/* Got the stream, re-initialize stdout without it. */
|
|
|
|
|
(void)freopen("CONOUT$", "w", stdout);
|
|
|
|
|
setvbuf(stdout, NULL, _IONBF, 0);
|
|
|
|
|
fflush(stdout);
|
|
|
|
|
}
|
|
|
|
|
}
|
2017-10-07 00:46:54 -04:00
|
|
|
}
|
2020-01-14 22:23:56 +01:00
|
|
|
|
|
|
|
|
if (fp != NULL) {
|
|
|
|
|
fclose(fp);
|
|
|
|
|
fp = NULL;
|
|
|
|
|
}
|
2017-05-18 14:03:43 -04:00
|
|
|
}
|
|
|
|
|
|
2017-10-02 02:15:35 -04:00
|
|
|
|
2020-04-22 13:19:28 +02:00
|
|
|
static void
|
|
|
|
|
CloseConsole(void)
|
|
|
|
|
{
|
|
|
|
|
CreateConsole(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2017-10-07 00:46:54 -04:00
|
|
|
/* Process the commandline, and create standard argc/argv array. */
|
2017-11-19 03:15:29 -05:00
|
|
|
static int
|
2021-03-14 20:35:01 +01:00
|
|
|
ProcessCommandLine(char ***argv)
|
2017-10-07 00:46:54 -04:00
|
|
|
{
|
2021-03-14 20:35:01 +01:00
|
|
|
char **args;
|
2017-10-07 00:46:54 -04:00
|
|
|
int argc_max;
|
2017-11-19 03:15:29 -05:00
|
|
|
int i, q, argc;
|
2017-10-07 00:46:54 -04:00
|
|
|
|
2021-03-14 20:35:01 +01:00
|
|
|
if (acp_utf8) {
|
|
|
|
|
i = strlen(GetCommandLineA()) + 1;
|
|
|
|
|
argbuf = (char *)malloc(i);
|
|
|
|
|
strcpy(argbuf, GetCommandLineA());
|
|
|
|
|
} else {
|
|
|
|
|
i = c16stombs(NULL, GetCommandLineW(), 0) + 1;
|
|
|
|
|
argbuf = (char *)malloc(i);
|
|
|
|
|
c16stombs(argbuf, GetCommandLineW(), i);
|
|
|
|
|
}
|
2017-10-07 00:46:54 -04:00
|
|
|
|
|
|
|
|
argc = 0;
|
|
|
|
|
argc_max = 64;
|
2021-03-14 20:35:01 +01:00
|
|
|
args = (char **)malloc(sizeof(char *) * argc_max);
|
2017-11-19 03:15:29 -05:00
|
|
|
if (args == NULL) {
|
2017-10-07 00:46:54 -04:00
|
|
|
free(argbuf);
|
2017-11-19 03:15:29 -05:00
|
|
|
return(0);
|
2017-10-07 00:46:54 -04:00
|
|
|
}
|
2017-10-02 02:15:35 -04:00
|
|
|
|
2017-10-07 00:46:54 -04:00
|
|
|
/* parse commandline into argc/argv format */
|
|
|
|
|
i = 0;
|
|
|
|
|
while (argbuf[i]) {
|
2021-03-14 20:35:01 +01:00
|
|
|
while (argbuf[i] == ' ')
|
2017-10-07 00:46:54 -04:00
|
|
|
i++;
|
2017-10-02 02:15:35 -04:00
|
|
|
|
2017-10-07 00:46:54 -04:00
|
|
|
if (argbuf[i]) {
|
2021-03-14 20:35:01 +01:00
|
|
|
if ((argbuf[i] == '\'') || (argbuf[i] == '"')) {
|
2017-10-07 00:46:54 -04:00
|
|
|
q = argbuf[i++];
|
|
|
|
|
if (!argbuf[i])
|
|
|
|
|
break;
|
|
|
|
|
} else
|
|
|
|
|
q = 0;
|
2017-05-18 14:03:43 -04:00
|
|
|
|
2017-11-19 03:15:29 -05:00
|
|
|
args[argc++] = &argbuf[i];
|
2017-05-18 14:03:43 -04:00
|
|
|
|
2017-10-07 00:46:54 -04:00
|
|
|
if (argc >= argc_max) {
|
|
|
|
|
argc_max += 64;
|
2021-03-14 20:35:01 +01:00
|
|
|
args = realloc(args, sizeof(char *)*argc_max);
|
2017-11-19 03:15:29 -05:00
|
|
|
if (args == NULL) {
|
2017-10-07 00:46:54 -04:00
|
|
|
free(argbuf);
|
2017-11-19 03:15:29 -05:00
|
|
|
return(0);
|
2017-05-18 14:03:43 -04:00
|
|
|
}
|
2017-10-07 00:46:54 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
while ((argbuf[i]) && ((q)
|
2021-03-14 20:35:01 +01:00
|
|
|
? (argbuf[i]!=q) : (argbuf[i]!=' '))) i++;
|
2017-10-07 00:46:54 -04:00
|
|
|
|
|
|
|
|
if (argbuf[i]) {
|
|
|
|
|
argbuf[i] = 0;
|
|
|
|
|
i++;
|
|
|
|
|
}
|
2017-05-18 14:03:43 -04:00
|
|
|
}
|
2017-10-07 00:46:54 -04:00
|
|
|
}
|
2017-05-18 14:03:43 -04:00
|
|
|
|
2017-11-19 03:15:29 -05:00
|
|
|
args[argc] = NULL;
|
2021-03-14 20:35:01 +01:00
|
|
|
*argv = args;
|
2017-11-19 03:15:29 -05:00
|
|
|
|
|
|
|
|
return(argc);
|
2017-05-18 14:03:43 -04:00
|
|
|
}
|
|
|
|
|
|
2017-05-27 03:53:32 +02:00
|
|
|
|
2017-12-04 11:59:26 -05:00
|
|
|
/* For the Windows platform, this is the start of the application. */
|
2017-10-07 00:46:54 -04:00
|
|
|
int WINAPI
|
2017-11-23 17:42:00 -05:00
|
|
|
WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpszArg, int nCmdShow)
|
2017-10-07 00:46:54 -04:00
|
|
|
{
|
2021-03-14 20:35:01 +01:00
|
|
|
char **argv = NULL;
|
2017-11-19 03:15:29 -05:00
|
|
|
int argc, i;
|
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.
2019-09-20 14:02:30 +02:00
|
|
|
wchar_t * AppID = L"86Box.86Box\0";
|
|
|
|
|
|
|
|
|
|
SetCurrentProcessExplicitAppUserModelID(AppID);
|
2017-10-19 04:27:04 -04:00
|
|
|
|
2021-03-14 20:35:01 +01:00
|
|
|
/* Check if Windows supports UTF-8 */
|
|
|
|
|
if (GetACP() == CP_UTF8)
|
|
|
|
|
acp_utf8 = 1;
|
|
|
|
|
else
|
|
|
|
|
acp_utf8 = 0;
|
|
|
|
|
|
2017-12-15 18:47:29 +01:00
|
|
|
/* Set this to the default value (windowed mode). */
|
|
|
|
|
video_fullscreen = 0;
|
|
|
|
|
|
2017-10-19 04:27:04 -04:00
|
|
|
/* We need this later. */
|
|
|
|
|
hinstance = hInst;
|
|
|
|
|
|
2017-11-13 02:06:00 -05:00
|
|
|
/* Set the application version ID string. */
|
|
|
|
|
sprintf(emu_version, "%s v%s", EMU_NAME, EMU_VERSION);
|
|
|
|
|
|
2017-10-19 04:27:04 -04:00
|
|
|
/* First, set our (default) language. */
|
|
|
|
|
set_language(0x0409);
|
|
|
|
|
|
2017-10-07 00:46:54 -04:00
|
|
|
/* Process the command line for options. */
|
2021-03-14 20:35:01 +01:00
|
|
|
argc = ProcessCommandLine(&argv);
|
2017-10-07 00:46:54 -04:00
|
|
|
|
|
|
|
|
/* Pre-initialize the system, this loads the config file. */
|
2021-03-14 20:35:01 +01:00
|
|
|
if (! pc_init(argc, argv)) {
|
2017-10-07 00:46:54 -04:00
|
|
|
/* Detach from console. */
|
2020-04-22 13:19:28 +02:00
|
|
|
if (force_debug)
|
|
|
|
|
CreateConsole(0);
|
2019-11-02 16:18:18 +01:00
|
|
|
|
|
|
|
|
if (source_hwnd)
|
2019-11-03 03:18:30 +01:00
|
|
|
PostMessage((HWND) (uintptr_t) source_hwnd, WM_HAS_SHUTDOWN, (WPARAM) 0, (LPARAM) hwndMain);
|
2019-11-02 16:18:18 +01:00
|
|
|
|
2020-01-17 05:44:38 +01:00
|
|
|
free(argbuf);
|
2021-03-14 20:35:01 +01:00
|
|
|
free(argv);
|
2017-10-07 00:46:54 -04:00
|
|
|
return(1);
|
|
|
|
|
}
|
2021-03-25 03:20:25 -05:00
|
|
|
|
2020-05-05 21:05:56 +02:00
|
|
|
/* Enable crash dump services. */
|
|
|
|
|
if (enable_crashdump)
|
|
|
|
|
InitCrashDump();
|
2017-10-02 02:15:35 -04:00
|
|
|
|
2020-11-09 04:42:14 +05:00
|
|
|
/* Create console window. */
|
|
|
|
|
if (force_debug) {
|
|
|
|
|
CreateConsole(1);
|
2020-04-22 13:19:28 +02:00
|
|
|
atexit(CloseConsole);
|
2020-11-09 04:42:14 +05:00
|
|
|
}
|
2017-10-02 02:15:35 -04:00
|
|
|
|
2017-11-19 03:15:29 -05:00
|
|
|
/* Handle our GUI. */
|
2017-11-23 17:42:00 -05:00
|
|
|
i = ui_init(nCmdShow);
|
2017-10-02 02:15:35 -04:00
|
|
|
|
2020-01-17 05:44:38 +01:00
|
|
|
free(argbuf);
|
2021-03-14 20:35:01 +01:00
|
|
|
free(argv);
|
2017-11-19 03:15:29 -05:00
|
|
|
return(i);
|
2017-10-19 04:27:04 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2021-03-24 19:52:44 +01:00
|
|
|
void
|
|
|
|
|
main_thread(void *param)
|
|
|
|
|
{
|
|
|
|
|
uint32_t old_time, new_time;
|
|
|
|
|
int drawits, frames;
|
|
|
|
|
|
2021-03-30 03:49:46 +02:00
|
|
|
framecountx = 0;
|
2021-03-24 19:52:44 +01:00
|
|
|
title_update = 1;
|
|
|
|
|
old_time = GetTickCount();
|
|
|
|
|
drawits = frames = 0;
|
2021-03-25 03:20:25 -05:00
|
|
|
while (!is_quit) {
|
2021-03-24 19:52:44 +01:00
|
|
|
/* See if it is time to run a frame of code. */
|
|
|
|
|
new_time = GetTickCount();
|
|
|
|
|
drawits += (new_time - old_time);
|
|
|
|
|
old_time = new_time;
|
|
|
|
|
if (drawits > 0 && !dopause) {
|
|
|
|
|
/* Yes, so do one frame now. */
|
|
|
|
|
drawits -= 10;
|
|
|
|
|
if (drawits > 50)
|
|
|
|
|
drawits = 0;
|
|
|
|
|
|
|
|
|
|
/* Run a block of code. */
|
|
|
|
|
pc_run();
|
|
|
|
|
|
|
|
|
|
/* Every 200 frames we save the machine status. */
|
|
|
|
|
if (++frames >= 200 && nvr_dosave) {
|
|
|
|
|
nvr_save();
|
|
|
|
|
nvr_dosave = 0;
|
|
|
|
|
frames = 0;
|
|
|
|
|
}
|
|
|
|
|
} else /* Just so we dont overload the host OS. */
|
|
|
|
|
Sleep(1);
|
|
|
|
|
|
|
|
|
|
/* If needed, handle a screen resize. */
|
|
|
|
|
if (doresize && !video_fullscreen) {
|
2021-04-17 22:43:31 +02:00
|
|
|
if (vid_resize & 2)
|
|
|
|
|
plat_resize(fixed_size_x, fixed_size_y);
|
|
|
|
|
else
|
|
|
|
|
plat_resize(scrnsz_x, scrnsz_y);
|
2021-03-24 19:52:44 +01:00
|
|
|
doresize = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2017-10-19 04:27:04 -04:00
|
|
|
/*
|
|
|
|
|
* We do this here since there is platform-specific stuff
|
|
|
|
|
* going on here, and we do it in a function separate from
|
|
|
|
|
* main() so we can call it from the UI module as well.
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
do_start(void)
|
|
|
|
|
{
|
|
|
|
|
LARGE_INTEGER qpc;
|
|
|
|
|
|
|
|
|
|
/* We have not stopped yet. */
|
2021-03-25 03:20:25 -05:00
|
|
|
is_quit = 0;
|
2017-10-19 04:27:04 -04:00
|
|
|
|
|
|
|
|
/* Initialize the high-precision timer. */
|
|
|
|
|
timeBeginPeriod(1);
|
|
|
|
|
QueryPerformanceFrequency(&qpc);
|
|
|
|
|
timer_freq = qpc.QuadPart;
|
2018-05-21 19:04:05 +02:00
|
|
|
win_log("Main timer precision: %llu\n", timer_freq);
|
2017-10-19 04:27:04 -04:00
|
|
|
|
|
|
|
|
/* Start the emulator, really. */
|
2021-03-25 03:20:25 -05:00
|
|
|
thMain = thread_create(main_thread, &is_quit);
|
2017-10-19 04:27:04 -04:00
|
|
|
SetThreadPriority(thMain, THREAD_PRIORITY_HIGHEST);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Cleanly stop the emulator. */
|
|
|
|
|
void
|
|
|
|
|
do_stop(void)
|
|
|
|
|
{
|
2021-03-25 03:20:25 -05:00
|
|
|
is_quit = 1;
|
2017-10-19 04:27:04 -04:00
|
|
|
|
|
|
|
|
plat_delay_ms(100);
|
|
|
|
|
|
2019-11-03 03:18:30 +01:00
|
|
|
if (source_hwnd)
|
|
|
|
|
PostMessage((HWND) (uintptr_t) source_hwnd, WM_HAS_SHUTDOWN, (WPARAM) 0, (LPARAM) hwndMain);
|
2019-11-02 16:18:18 +01:00
|
|
|
|
2017-10-19 04:27:04 -04:00
|
|
|
pc_close(thMain);
|
|
|
|
|
|
|
|
|
|
thMain = NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void
|
2021-03-14 20:35:01 +01:00
|
|
|
plat_get_exe_name(char *s, int size)
|
2017-10-19 04:27:04 -04:00
|
|
|
{
|
2021-03-14 20:35:01 +01:00
|
|
|
wchar_t *temp;
|
|
|
|
|
|
|
|
|
|
if (acp_utf8)
|
|
|
|
|
GetModuleFileNameA(hinstance, s, size);
|
|
|
|
|
else {
|
|
|
|
|
temp = malloc(size * sizeof(wchar_t));
|
|
|
|
|
GetModuleFileNameW(hinstance, temp, size);
|
|
|
|
|
c16stombs(s, temp, size);
|
|
|
|
|
free(temp);
|
|
|
|
|
}
|
2017-10-12 14:25:17 -04:00
|
|
|
}
|
|
|
|
|
|
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.
2019-09-20 14:02:30 +02:00
|
|
|
|
2018-11-04 23:35:28 +01:00
|
|
|
void
|
2021-03-14 20:35:01 +01:00
|
|
|
plat_tempfile(char *bufp, char *prefix, char *suffix)
|
2018-11-04 23:35:28 +01:00
|
|
|
{
|
|
|
|
|
SYSTEMTIME SystemTime;
|
|
|
|
|
|
|
|
|
|
if (prefix != NULL)
|
2021-03-14 20:35:01 +01:00
|
|
|
sprintf(bufp, "%s-", prefix);
|
2018-11-04 23:35:28 +01:00
|
|
|
else
|
2021-03-14 20:35:01 +01:00
|
|
|
strcpy(bufp, "");
|
2018-11-04 23:35:28 +01:00
|
|
|
|
|
|
|
|
GetSystemTime(&SystemTime);
|
2021-03-14 20:35:01 +01:00
|
|
|
sprintf(&bufp[strlen(bufp)], "%d%02d%02d-%02d%02d%02d-%03d%s",
|
2018-11-04 23:35:28 +01:00
|
|
|
SystemTime.wYear, SystemTime.wMonth, SystemTime.wDay,
|
|
|
|
|
SystemTime.wHour, SystemTime.wMinute, SystemTime.wSecond,
|
|
|
|
|
SystemTime.wMilliseconds,
|
|
|
|
|
suffix);
|
|
|
|
|
}
|
2017-10-12 14:25:17 -04:00
|
|
|
|
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.
2019-09-20 14:02:30 +02:00
|
|
|
|
2017-10-12 14:25:17 -04:00
|
|
|
int
|
2021-03-14 20:35:01 +01:00
|
|
|
plat_getcwd(char *bufp, int max)
|
2017-10-12 14:25:17 -04:00
|
|
|
{
|
2021-03-14 20:35:01 +01:00
|
|
|
wchar_t *temp;
|
|
|
|
|
|
|
|
|
|
if (acp_utf8)
|
|
|
|
|
(void)_getcwd(bufp, max);
|
|
|
|
|
else {
|
|
|
|
|
temp = malloc(max * sizeof(wchar_t));
|
|
|
|
|
(void)_wgetcwd(temp, max);
|
|
|
|
|
c16stombs(bufp, temp, max);
|
|
|
|
|
free(temp);
|
|
|
|
|
}
|
2017-10-12 14:25:17 -04:00
|
|
|
|
|
|
|
|
return(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int
|
2021-03-14 20:35:01 +01:00
|
|
|
plat_chdir(char *path)
|
2017-10-12 14:25:17 -04:00
|
|
|
{
|
2021-03-14 20:35:01 +01:00
|
|
|
wchar_t *temp;
|
|
|
|
|
int len, ret;
|
|
|
|
|
|
|
|
|
|
if (acp_utf8)
|
|
|
|
|
return(_chdir(path));
|
|
|
|
|
else {
|
|
|
|
|
len = mbstoc16s(NULL, path, 0) + 1;
|
|
|
|
|
temp = malloc(len * sizeof(wchar_t));
|
|
|
|
|
mbstoc16s(temp, path, len);
|
|
|
|
|
|
|
|
|
|
ret = _wchdir(temp);
|
|
|
|
|
|
|
|
|
|
free(temp);
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
2017-10-12 14:25:17 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2017-10-19 04:27:04 -04:00
|
|
|
FILE *
|
2021-03-14 20:35:01 +01:00
|
|
|
plat_fopen(const char *path, const char *mode)
|
2017-10-19 04:27:04 -04:00
|
|
|
{
|
2021-03-14 20:35:01 +01:00
|
|
|
wchar_t *pathw, *modew;
|
|
|
|
|
int len;
|
|
|
|
|
FILE *fp;
|
|
|
|
|
|
|
|
|
|
if (acp_utf8)
|
|
|
|
|
return fopen(path, mode);
|
|
|
|
|
else {
|
|
|
|
|
len = mbstoc16s(NULL, path, 0) + 1;
|
|
|
|
|
pathw = malloc(sizeof(wchar_t) * len);
|
|
|
|
|
mbstoc16s(pathw, path, len);
|
|
|
|
|
|
|
|
|
|
len = mbstoc16s(NULL, mode, 0) + 1;
|
|
|
|
|
modew = malloc(sizeof(wchar_t) * len);
|
|
|
|
|
mbstoc16s(modew, mode, len);
|
|
|
|
|
|
|
|
|
|
fp = _wfopen(pathw, modew);
|
|
|
|
|
|
|
|
|
|
free(pathw);
|
|
|
|
|
free(modew);
|
|
|
|
|
|
|
|
|
|
return fp;
|
|
|
|
|
}
|
2017-10-19 04:27:04 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
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.
2019-09-20 14:02:30 +02:00
|
|
|
/* Open a file, using Unicode pathname, with 64bit pointers. */
|
|
|
|
|
FILE *
|
2021-03-14 20:35:01 +01:00
|
|
|
plat_fopen64(const char *path, const char *mode)
|
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.
2019-09-20 14:02:30 +02:00
|
|
|
{
|
2021-03-14 20:35:01 +01:00
|
|
|
return plat_fopen(path, mode);
|
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.
2019-09-20 14:02:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2017-10-07 00:46:54 -04:00
|
|
|
void
|
2021-03-14 20:35:01 +01:00
|
|
|
plat_remove(char *path)
|
2017-10-07 00:46:54 -04:00
|
|
|
{
|
2021-03-14 20:35:01 +01:00
|
|
|
wchar_t *temp;
|
|
|
|
|
int len;
|
|
|
|
|
|
|
|
|
|
if (acp_utf8)
|
|
|
|
|
remove(path);
|
|
|
|
|
else {
|
|
|
|
|
len = mbstoc16s(NULL, path, 0) + 1;
|
|
|
|
|
temp = malloc(len * sizeof(wchar_t));
|
|
|
|
|
mbstoc16s(temp, path, len);
|
|
|
|
|
|
|
|
|
|
_wremove(temp);
|
|
|
|
|
|
|
|
|
|
free(temp);
|
|
|
|
|
}
|
2017-10-07 00:46:54 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2017-12-04 11:59:26 -05:00
|
|
|
/* Make sure a path ends with a trailing (back)slash. */
|
|
|
|
|
void
|
2021-03-14 20:35:01 +01:00
|
|
|
plat_path_slash(char *path)
|
2017-12-04 11:59:26 -05:00
|
|
|
{
|
2021-03-14 20:35:01 +01:00
|
|
|
if ((path[strlen(path)-1] != '\\') &&
|
|
|
|
|
(path[strlen(path)-1] != '/')) {
|
|
|
|
|
strcat(path, "\\");
|
2017-12-04 11:59:26 -05:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Check if the given path is absolute or not. */
|
|
|
|
|
int
|
2021-03-14 20:35:01 +01:00
|
|
|
plat_path_abs(char *path)
|
2017-12-04 11:59:26 -05:00
|
|
|
{
|
2021-03-14 20:35:01 +01:00
|
|
|
if ((path[1] == ':') || (path[0] == '\\') || (path[0] == '/'))
|
2017-12-04 11:59:26 -05:00
|
|
|
return(1);
|
|
|
|
|
|
|
|
|
|
return(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
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.
2019-09-20 14:02:30 +02:00
|
|
|
/* Return the last element of a pathname. */
|
2021-03-14 20:35:01 +01:00
|
|
|
char *
|
|
|
|
|
plat_get_basename(const char *path)
|
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.
2019-09-20 14:02:30 +02:00
|
|
|
{
|
2021-03-14 20:35:01 +01:00
|
|
|
int c = (int)strlen(path);
|
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.
2019-09-20 14:02:30 +02:00
|
|
|
|
|
|
|
|
while (c > 0) {
|
2021-03-14 20:35:01 +01:00
|
|
|
if (path[c] == '/' || path[c] == '\\')
|
|
|
|
|
return((char *)&path[c]);
|
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.
2019-09-20 14:02:30 +02:00
|
|
|
c--;
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-14 20:35:01 +01:00
|
|
|
return((char *)path);
|
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.
2019-09-20 14:02:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Return the 'directory' element of a pathname. */
|
|
|
|
|
void
|
2021-03-14 20:35:01 +01:00
|
|
|
plat_get_dirname(char *dest, const char *path)
|
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.
2019-09-20 14:02:30 +02:00
|
|
|
{
|
2021-03-14 20:35:01 +01:00
|
|
|
int c = (int)strlen(path);
|
|
|
|
|
char *ptr;
|
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.
2019-09-20 14:02:30 +02:00
|
|
|
|
2021-03-14 20:35:01 +01:00
|
|
|
ptr = (char *)path;
|
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.
2019-09-20 14:02:30 +02:00
|
|
|
|
|
|
|
|
while (c > 0) {
|
2021-03-14 20:35:01 +01:00
|
|
|
if (path[c] == '/' || path[c] == '\\') {
|
|
|
|
|
ptr = (char *)&path[c];
|
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.
2019-09-20 14:02:30 +02:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
c--;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Copy to destination. */
|
|
|
|
|
while (path < ptr)
|
|
|
|
|
*dest++ = *path++;
|
2021-03-14 20:35:01 +01:00
|
|
|
*dest = '\0';
|
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.
2019-09-20 14:02:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2021-03-14 20:35:01 +01:00
|
|
|
char *
|
|
|
|
|
plat_get_filename(char *s)
|
2017-10-17 01:59:09 -04:00
|
|
|
{
|
2021-03-14 20:35:01 +01:00
|
|
|
int c = strlen(s) - 1;
|
2017-10-17 01:59:09 -04:00
|
|
|
|
|
|
|
|
while (c > 0) {
|
2021-03-14 20:35:01 +01:00
|
|
|
if (s[c] == '/' || s[c] == '\\')
|
2017-10-17 01:59:09 -04:00
|
|
|
return(&s[c+1]);
|
|
|
|
|
c--;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return(s);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2021-03-14 20:35:01 +01:00
|
|
|
char *
|
|
|
|
|
plat_get_extension(char *s)
|
2017-10-17 01:59:09 -04:00
|
|
|
{
|
2021-03-14 20:35:01 +01:00
|
|
|
int c = strlen(s) - 1;
|
2017-10-17 01:59:09 -04:00
|
|
|
|
|
|
|
|
if (c <= 0)
|
|
|
|
|
return(s);
|
|
|
|
|
|
2021-03-14 20:35:01 +01:00
|
|
|
while (c && s[c] != '.')
|
2017-10-17 01:59:09 -04:00
|
|
|
c--;
|
|
|
|
|
|
|
|
|
|
if (!c)
|
2021-03-14 20:35:01 +01:00
|
|
|
return(&s[strlen(s)]);
|
2017-10-17 01:59:09 -04:00
|
|
|
|
|
|
|
|
return(&s[c+1]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void
|
2021-04-15 16:36:02 +03:00
|
|
|
plat_append_filename(char *dest, const char *s1, const char *s2)
|
2017-10-17 01:59:09 -04:00
|
|
|
{
|
2021-03-14 20:35:01 +01:00
|
|
|
strcpy(dest, s1);
|
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.
2019-09-20 14:02:30 +02:00
|
|
|
plat_path_slash(dest);
|
2021-03-14 20:35:01 +01:00
|
|
|
strcat(dest, s2);
|
2017-10-17 01:59:09 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void
|
2021-03-14 20:35:01 +01:00
|
|
|
plat_put_backslash(char *s)
|
2017-10-17 01:59:09 -04:00
|
|
|
{
|
2021-03-14 20:35:01 +01:00
|
|
|
int c = strlen(s) - 1;
|
2017-10-17 01:59:09 -04:00
|
|
|
|
2021-03-14 20:35:01 +01:00
|
|
|
if (s[c] != '/' && s[c] != '\\')
|
|
|
|
|
s[c] = '/';
|
2017-10-17 01:59:09 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2017-10-10 03:07:29 -04:00
|
|
|
int
|
2021-03-14 20:35:01 +01:00
|
|
|
plat_dir_check(char *path)
|
|
|
|
|
{
|
|
|
|
|
DWORD dwAttrib;
|
|
|
|
|
int len;
|
|
|
|
|
wchar_t *temp;
|
|
|
|
|
|
|
|
|
|
if (acp_utf8)
|
|
|
|
|
dwAttrib = GetFileAttributesA(path);
|
|
|
|
|
else {
|
|
|
|
|
len = mbstoc16s(NULL, path, 0) + 1;
|
|
|
|
|
temp = malloc(len * sizeof(wchar_t));
|
|
|
|
|
mbstoc16s(temp, path, len);
|
|
|
|
|
|
|
|
|
|
dwAttrib = GetFileAttributesW(temp);
|
|
|
|
|
|
|
|
|
|
free(temp);
|
|
|
|
|
}
|
2017-10-10 03:07:29 -04:00
|
|
|
|
|
|
|
|
return(((dwAttrib != INVALID_FILE_ATTRIBUTES &&
|
|
|
|
|
(dwAttrib & FILE_ATTRIBUTE_DIRECTORY))) ? 1 : 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int
|
2021-03-14 20:35:01 +01:00
|
|
|
plat_dir_create(char *path)
|
2017-10-10 03:07:29 -04:00
|
|
|
{
|
2021-03-14 20:35:01 +01:00
|
|
|
int ret, len;
|
|
|
|
|
wchar_t *temp;
|
|
|
|
|
|
|
|
|
|
if (acp_utf8)
|
|
|
|
|
return (int)SHCreateDirectoryExA(NULL, path, NULL);
|
|
|
|
|
else {
|
|
|
|
|
len = mbstoc16s(NULL, path, 0) + 1;
|
|
|
|
|
temp = malloc(len * sizeof(wchar_t));
|
|
|
|
|
mbstoc16s(temp, path, len);
|
|
|
|
|
|
|
|
|
|
ret = (int)SHCreateDirectoryExW(NULL, temp, NULL);
|
|
|
|
|
|
|
|
|
|
free(temp);
|
|
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
2017-10-10 03:07:29 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2017-10-07 00:46:54 -04:00
|
|
|
uint64_t
|
2017-10-17 01:59:09 -04:00
|
|
|
plat_timer_read(void)
|
2017-10-07 00:46:54 -04:00
|
|
|
{
|
|
|
|
|
LARGE_INTEGER li;
|
2017-05-27 03:53:32 +02:00
|
|
|
|
2017-10-07 00:46:54 -04:00
|
|
|
QueryPerformanceCounter(&li);
|
2017-05-27 03:53:32 +02:00
|
|
|
|
2017-10-07 00:46:54 -04:00
|
|
|
return(li.QuadPart);
|
|
|
|
|
}
|
2017-05-27 03:53:32 +02:00
|
|
|
|
2021-04-23 16:09:45 +03:00
|
|
|
static LARGE_INTEGER
|
|
|
|
|
plat_get_ticks_common(void)
|
2017-10-07 00:46:54 -04:00
|
|
|
{
|
2021-03-24 19:52:44 +01:00
|
|
|
LARGE_INTEGER EndingTime, ElapsedMicroseconds;
|
|
|
|
|
|
|
|
|
|
if (first_use) {
|
2021-03-25 03:20:25 -05:00
|
|
|
QueryPerformanceFrequency(&Frequency);
|
2021-03-24 19:52:44 +01:00
|
|
|
QueryPerformanceCounter(&StartingTime);
|
|
|
|
|
first_use = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QueryPerformanceCounter(&EndingTime);
|
|
|
|
|
ElapsedMicroseconds.QuadPart = EndingTime.QuadPart - StartingTime.QuadPart;
|
|
|
|
|
|
|
|
|
|
/* We now have the elapsed number of ticks, along with the
|
|
|
|
|
number of ticks-per-second. We use these values
|
|
|
|
|
to convert to the number of elapsed microseconds.
|
|
|
|
|
To guard against loss-of-precision, we convert
|
|
|
|
|
to microseconds *before* dividing by ticks-per-second. */
|
|
|
|
|
ElapsedMicroseconds.QuadPart *= 1000000;
|
|
|
|
|
ElapsedMicroseconds.QuadPart /= Frequency.QuadPart;
|
|
|
|
|
|
2021-04-23 16:09:45 +03:00
|
|
|
return ElapsedMicroseconds;
|
2017-10-07 00:46:54 -04:00
|
|
|
}
|
2017-05-27 03:53:32 +02:00
|
|
|
|
2021-04-23 16:09:45 +03:00
|
|
|
uint32_t
|
|
|
|
|
plat_get_ticks(void)
|
|
|
|
|
{
|
|
|
|
|
return (uint32_t)(plat_get_ticks_common().QuadPart / 1000);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint32_t
|
|
|
|
|
plat_get_micro_ticks(void)
|
|
|
|
|
{
|
|
|
|
|
return (uint32_t)plat_get_ticks_common().QuadPart;
|
|
|
|
|
}
|
2017-06-01 17:52:39 +02:00
|
|
|
|
2017-10-07 00:46:54 -04:00
|
|
|
void
|
2017-10-17 01:59:09 -04:00
|
|
|
plat_delay_ms(uint32_t count)
|
2017-10-07 00:46:54 -04:00
|
|
|
{
|
|
|
|
|
Sleep(count);
|
|
|
|
|
}
|
2017-12-04 11:59:26 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Return the VIDAPI number for the given name. */
|
|
|
|
|
int
|
|
|
|
|
plat_vidapi(char *name)
|
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
|
2019-12-05 00:51:07 +01:00
|
|
|
/* Default/System is SDL Hardware. */
|
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.
2019-09-20 14:02:30 +02:00
|
|
|
if (!strcasecmp(name, "default") || !strcasecmp(name, "system")) return(1);
|
2019-12-05 00:51:07 +01:00
|
|
|
|
|
|
|
|
/* If DirectDraw or plain SDL was specified, return SDL Software. */
|
|
|
|
|
if (!strcasecmp(name, "ddraw") || !strcasecmp(name, "sdl")) return(1);
|
2017-12-04 11:59:26 -05:00
|
|
|
|
2018-07-15 01:41:53 +02:00
|
|
|
for (i = 0; i < RENDERERS_NUM; i++) {
|
2020-11-28 07:04:40 +01:00
|
|
|
if (vid_apis[i].name &&
|
|
|
|
|
!strcasecmp(vid_apis[i].name, name)) return(i);
|
2017-12-04 11:59:26 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Default value. */
|
2019-12-05 00:51:07 +01:00
|
|
|
return(1);
|
2017-12-04 11:59:26 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Return the VIDAPI name for the given number. */
|
|
|
|
|
char *
|
|
|
|
|
plat_vidapi_name(int api)
|
|
|
|
|
{
|
|
|
|
|
char *name = "default";
|
|
|
|
|
|
|
|
|
|
switch(api) {
|
|
|
|
|
case 0:
|
2019-12-05 00:51:07 +01:00
|
|
|
name = "sdl_software";
|
2017-12-04 11:59:26 -05:00
|
|
|
break;
|
2019-02-06 03:34:39 +01:00
|
|
|
case 1:
|
|
|
|
|
break;
|
2020-11-26 18:20:24 +01:00
|
|
|
case 2:
|
|
|
|
|
name = "sdl_opengl";
|
|
|
|
|
break;
|
2021-04-26 02:45:20 +05:00
|
|
|
#if defined(DEV_BRANCH) && defined(USE_OPENGL)
|
2021-04-17 13:45:11 +03:00
|
|
|
case 3:
|
|
|
|
|
name = "opengl_core";
|
|
|
|
|
break;
|
|
|
|
|
#else
|
2020-11-26 18:20:24 +01:00
|
|
|
case 3:
|
2021-04-17 13:45:11 +03:00
|
|
|
name = "sdl_opengl"; /* fall back to SDL_OpenGL */
|
|
|
|
|
break;
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef USE_VNC
|
|
|
|
|
case 4:
|
2018-07-15 01:41:53 +02:00
|
|
|
name = "vnc";
|
2017-12-04 11:59:26 -05:00
|
|
|
break;
|
2020-04-18 11:51:54 +02:00
|
|
|
#endif
|
2019-12-05 00:51:07 +01:00
|
|
|
default:
|
|
|
|
|
fatal("Unknown renderer: %i\n", api);
|
|
|
|
|
break;
|
2017-12-04 11:59:26 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return(name);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
plat_setvid(int api)
|
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
|
2018-05-21 19:04:05 +02:00
|
|
|
win_log("Initializing VIDAPI: api=%d\n", api);
|
2017-12-04 11:59:26 -05:00
|
|
|
startblit();
|
|
|
|
|
|
|
|
|
|
/* Close the (old) API. */
|
2020-11-28 07:04:40 +01:00
|
|
|
vid_apis[vid_api].close();
|
2017-12-04 11:59:26 -05:00
|
|
|
vid_api = api;
|
|
|
|
|
|
2020-11-28 07:04:40 +01:00
|
|
|
if (vid_apis[vid_api].local)
|
2017-12-04 11:59:26 -05:00
|
|
|
ShowWindow(hwndRender, SW_SHOW);
|
|
|
|
|
else
|
|
|
|
|
ShowWindow(hwndRender, SW_HIDE);
|
|
|
|
|
|
|
|
|
|
/* Initialize the (new) API. */
|
2020-11-28 07:04:40 +01:00
|
|
|
i = vid_apis[vid_api].init((void *)hwndRender);
|
2017-12-04 11:59:26 -05:00
|
|
|
endblit();
|
|
|
|
|
if (! i) return(0);
|
|
|
|
|
|
|
|
|
|
device_force_redraw();
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
vid_api_inited = 1;
|
|
|
|
|
|
2017-12-04 11:59:26 -05:00
|
|
|
return(1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Tell the renderers about a new screen resolution. */
|
|
|
|
|
void
|
|
|
|
|
plat_vidsize(int x, int y)
|
|
|
|
|
{
|
2020-11-28 07:04:40 +01:00
|
|
|
if (!vid_api_inited || !vid_apis[vid_api].resize) return;
|
2017-12-04 11:59:26 -05:00
|
|
|
|
|
|
|
|
startblit();
|
2020-11-28 07:04:40 +01:00
|
|
|
vid_apis[vid_api].resize(x, y);
|
2017-12-04 11:59:26 -05:00
|
|
|
endblit();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
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.
2019-09-20 14:02:30 +02:00
|
|
|
void
|
|
|
|
|
plat_vidapi_enable(int enable)
|
|
|
|
|
{
|
2020-11-26 18:20:24 +01:00
|
|
|
int i = 1;
|
|
|
|
|
|
2020-11-28 07:04:40 +01:00
|
|
|
if (!vid_api_inited || !vid_apis[vid_api].enable)
|
|
|
|
|
return;
|
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.
2019-09-20 14:02:30 +02:00
|
|
|
|
2020-11-28 07:04:40 +01:00
|
|
|
vid_apis[vid_api].enable(enable != 0);
|
2020-11-26 18:20:24 +01:00
|
|
|
|
2020-11-28 07:04:40 +01:00
|
|
|
if (! i)
|
|
|
|
|
return;
|
2020-11-26 18:20:24 +01:00
|
|
|
|
2020-11-28 07:04:40 +01:00
|
|
|
if (enable)
|
2020-11-26 18:20:24 +01:00
|
|
|
device_force_redraw();
|
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.
2019-09-20 14:02:30 +02:00
|
|
|
}
|
|
|
|
|
|
2020-11-28 07:04:40 +01:00
|
|
|
|
2017-12-04 11:59:26 -05:00
|
|
|
int
|
|
|
|
|
get_vidpause(void)
|
|
|
|
|
{
|
2020-11-28 07:04:40 +01:00
|
|
|
return(vid_apis[vid_api].pause());
|
2017-12-04 11:59:26 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
plat_setfullscreen(int on)
|
|
|
|
|
{
|
2020-12-02 06:11:27 +01:00
|
|
|
RECT rect;
|
|
|
|
|
int temp_x, temp_y;
|
|
|
|
|
int dpi = win_get_dpi(hwndMain);
|
|
|
|
|
|
2020-11-28 07:04:40 +01:00
|
|
|
/* Are we changing from the same state to the same state? */
|
|
|
|
|
if ((!!on) == (!!video_fullscreen))
|
|
|
|
|
return;
|
2017-12-04 11:59:26 -05:00
|
|
|
|
2017-12-15 18:47:29 +01:00
|
|
|
if (on && video_fullscreen_first) {
|
2020-11-28 07:04:40 +01:00
|
|
|
video_fullscreen |= 2;
|
2020-07-27 19:28:32 -03:00
|
|
|
if (ui_msgbox_header(MBX_INFO | MBX_DONTASK, (wchar_t *) IDS_2134, (wchar_t *) IDS_2052) == 10) {
|
2020-06-18 21:46:28 -03:00
|
|
|
video_fullscreen_first = 0;
|
2020-07-27 19:28:32 -03:00
|
|
|
config_save();
|
|
|
|
|
}
|
2020-11-28 07:04:40 +01:00
|
|
|
video_fullscreen &= 1;
|
2017-12-04 11:59:26 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* OK, claim the video. */
|
|
|
|
|
win_mouse_close();
|
|
|
|
|
|
|
|
|
|
/* Close the current mode, and open the new one. */
|
2020-11-28 07:04:40 +01:00
|
|
|
video_fullscreen = on | 2;
|
|
|
|
|
if (vid_apis[vid_api].set_fs)
|
|
|
|
|
vid_apis[vid_api].set_fs(on);
|
2020-12-02 06:11:27 +01:00
|
|
|
if (!on) {
|
2020-11-28 07:04:40 +01:00
|
|
|
plat_resize(scrnsz_x, scrnsz_y);
|
2020-12-02 06:11:27 +01:00
|
|
|
if (vid_resize) {
|
|
|
|
|
/* scale the screen base on DPI */
|
2021-04-12 05:58:59 +02:00
|
|
|
if (!(vid_resize & 2) && window_remember) {
|
2020-12-26 17:21:38 +01:00
|
|
|
MoveWindow(hwndMain, window_x, window_y, window_w, window_h, TRUE);
|
|
|
|
|
GetClientRect(hwndMain, &rect);
|
|
|
|
|
|
|
|
|
|
temp_x = rect.right - rect.left + 1;
|
|
|
|
|
temp_y = rect.bottom - rect.top + 1 - sbar_height;
|
2020-12-02 06:11:27 +01:00
|
|
|
} else {
|
2020-12-25 23:34:37 +01:00
|
|
|
if (dpi_scale) {
|
2021-04-12 05:58:59 +02:00
|
|
|
temp_x = MulDiv((vid_resize & 2) ? fixed_size_x : unscaled_size_x, dpi, 96);
|
|
|
|
|
temp_y = MulDiv((vid_resize & 2) ? fixed_size_y : unscaled_size_y, dpi, 96);
|
2020-12-25 23:34:37 +01:00
|
|
|
} else {
|
2021-04-12 05:58:59 +02:00
|
|
|
temp_x = (vid_resize & 2) ? fixed_size_x : unscaled_size_x;
|
|
|
|
|
temp_y = (vid_resize & 2) ? fixed_size_y : unscaled_size_y;
|
2020-12-25 23:34:37 +01:00
|
|
|
}
|
2020-12-26 17:21:38 +01:00
|
|
|
|
2021-03-25 03:20:25 -05:00
|
|
|
/* Main Window. */
|
2020-12-26 17:21:38 +01:00
|
|
|
ResizeWindowByClientArea(hwndMain, temp_x, temp_y + sbar_height);
|
2020-12-02 06:11:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Render window. */
|
|
|
|
|
MoveWindow(hwndRender, 0, 0, temp_x, temp_y, TRUE);
|
|
|
|
|
GetWindowRect(hwndRender, &rect);
|
|
|
|
|
|
|
|
|
|
/* Status bar. */
|
|
|
|
|
MoveWindow(hwndSBAR, 0, rect.bottom, temp_x, 17, TRUE);
|
|
|
|
|
|
|
|
|
|
if (mouse_capture)
|
|
|
|
|
ClipCursor(&rect);
|
|
|
|
|
|
2021-04-12 05:58:59 +02:00
|
|
|
scrnsz_x = (vid_resize & 2) ? fixed_size_x : unscaled_size_x;
|
|
|
|
|
scrnsz_y = (vid_resize & 2) ? fixed_size_y : unscaled_size_y;
|
2020-12-02 06:11:27 +01:00
|
|
|
}
|
|
|
|
|
}
|
2020-11-28 07:04:40 +01:00
|
|
|
video_fullscreen &= 1;
|
|
|
|
|
video_force_resize_set(1);
|
|
|
|
|
if (!on)
|
|
|
|
|
doresize = 1;
|
2017-12-04 11:59:26 -05:00
|
|
|
|
|
|
|
|
win_mouse_init();
|
|
|
|
|
|
|
|
|
|
/* Release video and make it redraw the screen. */
|
|
|
|
|
device_force_redraw();
|
2017-12-15 00:42:10 -05:00
|
|
|
|
2019-10-20 15:09:38 +02:00
|
|
|
/* Send a CTRL break code so CTRL does not get stuck. */
|
|
|
|
|
keyboard_input(0, 0x01D);
|
|
|
|
|
|
2017-12-15 00:42:10 -05:00
|
|
|
/* Finally, handle the host's mouse cursor. */
|
2018-05-21 19:04:05 +02:00
|
|
|
/* win_log("%s full screen, %s cursor\n", on ? "enter" : "leave", on ? "hide" : "show"); */
|
2017-12-15 00:42:10 -05:00
|
|
|
show_cursor(video_fullscreen ? 0 : -1);
|
2020-11-28 07:04:40 +01:00
|
|
|
|
|
|
|
|
/* This is needed for OpenGL. */
|
|
|
|
|
plat_vidapi_enable(0);
|
|
|
|
|
plat_vidapi_enable(1);
|
2017-12-04 11:59:26 -05:00
|
|
|
}
|
|
|
|
|
|
2021-04-23 16:09:45 +03:00
|
|
|
void
|
|
|
|
|
plat_vid_reload_options(void)
|
|
|
|
|
{
|
|
|
|
|
if (!vid_api_inited || !vid_apis[vid_api].reload)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
vid_apis[vid_api].reload();
|
|
|
|
|
}
|
|
|
|
|
|
2017-12-04 11:59:26 -05:00
|
|
|
|
|
|
|
|
void
|
|
|
|
|
take_screenshot(void)
|
|
|
|
|
{
|
2019-10-20 15:09:38 +02:00
|
|
|
startblit();
|
|
|
|
|
screenshots++;
|
|
|
|
|
endblit();
|
|
|
|
|
device_force_redraw();
|
2017-12-04 11:59:26 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
/* LPARAM interface to plat_get_string(). */
|
|
|
|
|
LPARAM win_get_string(int id)
|
|
|
|
|
{
|
|
|
|
|
wchar_t *ret;
|
|
|
|
|
|
|
|
|
|
ret = plat_get_string(id);
|
|
|
|
|
return ((LPARAM) ret);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2017-12-04 11:59:26 -05:00
|
|
|
void /* plat_ */
|
|
|
|
|
startblit(void)
|
|
|
|
|
{
|
|
|
|
|
WaitForSingleObject(ghMutex, INFINITE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void /* plat_ */
|
|
|
|
|
endblit(void)
|
|
|
|
|
{
|
|
|
|
|
ReleaseMutex(ghMutex);
|
|
|
|
|
}
|