Changes to logging - nothing (other than some parts of pc.c) uses the global pclog anymore (and logs will be almost empty (until the base set logging flags is agreed upon);

Fixes to various hard disk controllers;
Added the Packard Bell PB640;
Fixed the InPort mouse emulation - now it works correctly on Windows NT 3.1;
Removed the status window and the associated variables;
Completely removed the Green B 486 machine;
Fixed the MDSI Genius;
Fixed the single-sided 5.25" floppy drive;
Ported a CPU-related commit from VARCem.
This commit is contained in:
OBattler
2018-05-21 19:04:05 +02:00
parent 534ed6ea32
commit 5d8deea63b
130 changed files with 5062 additions and 3262 deletions

View File

@@ -8,7 +8,7 @@
*
* Application resource script for Windows.
*
* Version: @(#)86Box.rc 1.0.35 2018/04/28
* Version: @(#)86Box.rc 1.0.36 2018/05/01
*
* Authors: Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>
@@ -624,10 +624,8 @@ END
257 ICON DISCARDABLE "win/icons/display.ico"
258 ICON DISCARDABLE "win/icons/input_devices.ico"
259 ICON DISCARDABLE "win/icons/sound.ico"
260 ICON DISCARDABLE "win/icons/network.ico"
261 ICON DISCARDABLE "win/icons/ports.ico"
262 ICON DISCARDABLE "win/icons/other_peripherals.ico"
263 ICON DISCARDABLE "win/icons/hard_disk.ico"
264 ICON DISCARDABLE "win/icons/floppy_drives.ico"
265 ICON DISCARDABLE "win/icons/other_removable_devices.ico"
384 ICON DISCARDABLE "win/icons/floppy_525_empty.ico"

View File

@@ -8,7 +8,7 @@
#
# Makefile for Win32 (MinGW32) environment.
#
# Version: @(#)Makefile.mingw 1.0.115 2018/04/26
# Version: @(#)Makefile.mingw 1.0.116 2018/05/01
#
# Authors: Miran Grca, <mgrca8@gmail.com>
# Fred N. van Kempen, <decwiz@yahoo.com>
@@ -206,7 +206,7 @@ VPATH := $(EXPATH) . cpu \
sound/munt sound/munt/c_interface sound/munt/sha1 \
sound/munt/srchelper \
sound/resid-fp \
scsi video floppy/lzf network network/slirp win
scsi video network network/slirp win
ifeq ($(X64), y)
CPP := g++ -m64
CC := gcc -m64
@@ -246,6 +246,7 @@ ifeq ($(DEBUG), y)
COPTIM := -Og
endif
else
DFLAGS += -g0
ifeq ($(OPTIM), y)
AOPTIM := -mtune=native
ifndef COPTIM
@@ -363,7 +364,6 @@ endif
ifeq ($(I686), y)
OPTS += -DUSE_I686
DEVBROBJ += m_at_440fx.o
endif
ifeq ($(LASERXT), y)
@@ -451,8 +451,7 @@ MCHOBJ := machine.o machine_table.o \
m_at_opti495.o m_at_scat.o \
m_at_compaq.o m_at_wd76c10.o \
m_at_sis_85c471.o m_at_sis_85c496.o \
m_at_430lx_nx.o m_at_430fx.o \
m_at_430hx.o m_at_430vx.o
m_at_4x0.o
DEVOBJ := bugger.o lpt.o $(SERIAL) \
sio_fdc37c66x.o sio_fdc37c669.o sio_fdc37c93x.o \
@@ -568,8 +567,6 @@ ifdef EXOBJ
OBJ += $(EXOBJ)
endif
LZFOBJ := lzf_c.o lzf_d.o
LIBS := -mwindows \
-lopenal.dll \
-lddraw -ldinput8 -ldxguid -ld3d9 -ld3dx9 \
@@ -583,8 +580,8 @@ endif
ifneq ($(WX), n)
LIBS += $(WX_LIBS) -lm
endif
LIBS += -lpng -lz -lkernel32 -lwsock32 -liphlpapi -lpsapi
LIBS += -lpthread -static -lstdc++ -lgcc
LIBS += -lpng -lz -lwsock32 -liphlpapi
LIBS += -static -lstdc++ -lgcc
ifneq ($(X64), y)
LIBS += -Wl,--large-address-aware
endif
@@ -637,9 +634,9 @@ all: $(PROG).exe pcap_if.exe
@echo Processing $<
@$(WINDRES) $(RFLAGS) $(EXTRAS) -i $< -o 86Box.res
$(PROG).exe: $(OBJ) $(LZFOBJ) 86Box.res
$(PROG).exe: $(OBJ) 86Box.res
@echo Linking $(PROG).exe ..
@$(CC) -o $(PROG).exe $(OBJ) $(LZFOBJ) 86Box.res $(LIBS)
@$(CC) -o $(PROG).exe $(OBJ) 86Box.res $(LIBS)
ifneq ($(DEBUG), y)
@strip $(PROG).exe
endif

View File

@@ -8,7 +8,7 @@
*
* Platform main support module for Windows.
*
* Version: @(#)win.c 1.0.47 2018/03/28
* Version: @(#)win.c 1.0.48 2018/04/29
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -20,13 +20,15 @@
*/
#define UNICODE
#include <windows.h>
#include <stdio.h>
#include <fcntl.h>
#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <fcntl.h>
#include <time.h>
#include <wchar.h>
#define HAVE_STDARG_H
#include "../86box.h"
#include "../config.h"
#include "../device.h"
@@ -127,6 +129,26 @@ static struct {
};
#ifdef ENABLE_WIN_LOG
int win_do_log = ENABLE_WIN_LOG;
#endif
static void
win_log(const char *fmt, ...)
{
#ifdef ENABLE_WIN_LOG
va_list ap;
if (win_do_log) {
va_start(ap, fmt);
pclog_ex(fmt, ap);
va_end(ap);
}
#endif
}
static void
LoadCommonStrings(void)
{
@@ -403,7 +425,7 @@ do_start(void)
timeBeginPeriod(1);
QueryPerformanceFrequency(&qpc);
timer_freq = qpc.QuadPart;
pclog("Main timer precision: %llu\n", timer_freq);
win_log("Main timer precision: %llu\n", timer_freq);
/* Start the emulator, really. */
thMain = thread_create(pc_thread, &quited);
@@ -635,7 +657,7 @@ plat_setvid(int api)
{
int i;
pclog("Initializing VIDAPI: api=%d\n", api);
win_log("Initializing VIDAPI: api=%d\n", api);
startblit();
video_wait_for_blit();
@@ -730,7 +752,7 @@ plat_setfullscreen(int on)
device_force_redraw();
/* Finally, handle the host's mouse cursor. */
/* pclog("%s full screen, %s cursor\n", on ? "enter" : "leave", on ? "hide" : "show"); */
/* win_log("%s full screen, %s cursor\n", on ? "enter" : "leave", on ? "hide" : "show"); */
show_cursor(video_fullscreen ? 0 : -1);
}
@@ -742,7 +764,7 @@ take_screenshot(void)
struct tm *info;
time_t now;
pclog("Screenshot: video API is: %i\n", vid_api);
win_log("Screenshot: video API is: %i\n", vid_api);
if ((vid_api < 0) || (vid_api > 1)) return;
memset(fn, 0, sizeof(fn));

View File

@@ -11,7 +11,7 @@
* NOTES: This code should be re-merged into a single init() with a
* 'fullscreen' argument, indicating FS mode is requested.
*
* Version: @(#)win_ddraw.cpp 1.0.7 2018/03/28
* Version: @(#)win_ddraw.cpp 1.0.8 2018/04/29
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -21,8 +21,9 @@
* Copyright 2016-2018 Miran Grca.
* Copyright 2017,2018 Fred N. van Kempen.
*/
#include <stdio.h>
#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>
#define UNICODE
#define BITMAP WINDOWS_BITMAP
#include <windows.h>
@@ -31,6 +32,7 @@
#define PNG_DEBUG 0
#include <png.h>
#define HAVE_STDARG_H
#include "../86box.h"
#include "../device.h"
#include "../video/video.h"
@@ -56,6 +58,26 @@ static png_structp png_ptr;
static png_infop info_ptr;
#ifdef ENABLE_DDRAW_LOG
int ddraw_do_log = ENABLE_DDRAW_LOG;
#endif
static void
ddraw_log(const char *fmt, ...)
{
#ifdef ENABLE_DDRAW_LOG
va_list ap;
if (ddraw_do_log) {
va_start(ap, fmt);
pclog_ex(fmt, ap);
va_end(ap);
}
#endif
}
static void
CopySurface(IDirectDrawSurface4 *pDDSurface)
{
@@ -120,7 +142,7 @@ SavePNG(wchar_t *szFilename, HBITMAP hBitmap)
/* create file */
FILE *fp = plat_fopen(szFilename, (wchar_t *) L"wb");
if (!fp) {
pclog("[SavePNG] File %ls could not be opened for writing", szFilename);
ddraw_log("[SavePNG] File %ls could not be opened for writing", szFilename);
return;
}
@@ -128,14 +150,14 @@ SavePNG(wchar_t *szFilename, HBITMAP hBitmap)
png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
if (!png_ptr) {
pclog("[SavePNG] png_create_write_struct failed");
ddraw_log("[SavePNG] png_create_write_struct failed");
fclose(fp);
return;
}
info_ptr = png_create_info_struct(png_ptr);
if (!info_ptr) {
pclog("[SavePNG] png_create_info_struct failed");
ddraw_log("[SavePNG] png_create_info_struct failed");
fclose(fp);
return;
}
@@ -154,7 +176,7 @@ SavePNG(wchar_t *szFilename, HBITMAP hBitmap)
bmpInfo.bmiHeader.biWidth*abs(bmpInfo.bmiHeader.biHeight)*(bmpInfo.bmiHeader.biBitCount+7)/8;
if ((pBuf = malloc(bmpInfo.bmiHeader.biSizeImage)) == NULL) {
pclog("[SavePNG] Unable to Allocate Bitmap Memory");
ddraw_log("[SavePNG] Unable to Allocate Bitmap Memory");
fclose(fp);
return;
}
@@ -163,7 +185,7 @@ SavePNG(wchar_t *szFilename, HBITMAP hBitmap)
bmpInfo.bmiHeader.biSizeImage <<= 1;
if ((pBuf2 = malloc(bmpInfo.bmiHeader.biSizeImage)) == NULL) {
pclog("[SavePNG] Unable to Allocate Secondary Bitmap Memory");
ddraw_log("[SavePNG] Unable to Allocate Secondary Bitmap Memory");
free(pBuf);
fclose(fp);
return;
@@ -172,7 +194,7 @@ SavePNG(wchar_t *szFilename, HBITMAP hBitmap)
bmpInfo.bmiHeader.biHeight <<= 1;
}
pclog("save png w=%i h=%i\n", bmpInfo.bmiHeader.biWidth, bmpInfo.bmiHeader.biHeight);
ddraw_log("save png w=%i h=%i\n", bmpInfo.bmiHeader.biWidth, bmpInfo.bmiHeader.biHeight);
bmpInfo.bmiHeader.biCompression = BI_RGB;
@@ -183,7 +205,7 @@ SavePNG(wchar_t *szFilename, HBITMAP hBitmap)
PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);
if ((b_rgb = (png_bytep *) malloc(sizeof(png_bytep) * bmpInfo.bmiHeader.biHeight)) == NULL) {
pclog("[SavePNG] Unable to Allocate RGB Bitmap Memory");
ddraw_log("[SavePNG] Unable to Allocate RGB Bitmap Memory");
free(pBuf2);
free(pBuf);
fclose(fp);
@@ -237,7 +259,7 @@ ddraw_fs_size(RECT w_rect, RECT *r_dest, int w, int h)
int ratio_w, ratio_h;
double hsr, gsr, ra, d;
pclog("video_fullscreen_scale = %i\n", video_fullscreen_scale);
ddraw_log("video_fullscreen_scale = %i\n", video_fullscreen_scale);
switch (video_fullscreen_scale) {
case FULLSCR_SCALE_FULL:

View File

@@ -8,7 +8,7 @@
*
* Several dialogs for the application.
*
* Version: @(#)win_dialog.c 1.0.9 2018/04/01
* Version: @(#)win_dialog.c 1.0.10 2018/04/29
*
* Author: Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>
@@ -21,10 +21,12 @@
#include <windowsx.h>
#include <shlobj.h>
#include <commdlg.h>
#include <stdio.h>
#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <wchar.h>
#define HAVE_STDARG_H
#include "../86box.h"
#include "../device.h"
#include "../plat.h"
@@ -143,28 +145,20 @@ file_dlg_w(HWND hwnd, WCHAR *f, WCHAR *fn, int save)
ofn.Flags |= OFN_FILEMUSTEXIST;
/* Display the Open dialog box. */
if (save) {
// pclog("GetSaveFileName - lpstrFile = %s\n", ofn.lpstrFile);
if (save)
r = GetSaveFileName(&ofn);
} else {
// pclog("GetOpenFileName - lpstrFile = %s\n", ofn.lpstrFile);
else
r = GetOpenFileName(&ofn);
}
plat_chdir(usr_path);
if (r) {
wcstombs(openfilestring, wopenfilestring, sizeof(openfilestring));
filterindex = ofn.nFilterIndex;
// pclog("File dialog return true\n");
return(0);
}
/* pclog("File dialog return false\n"); */
/* err = CommDlgExtendedError();
pclog("CommDlgExtendedError return %04X\n", err); */
return(1);
}

View File

@@ -8,22 +8,44 @@
*
* Try to load a support DLL.
*
* Version: @(#)win_dynld.c 1.0.6 2017/10/16
* Version: @(#)win_dynld.c 1.0.7 2018/04/29
*
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
*
* Copyright 2017 Fred N. van Kempen
* Copyright 2017,2018 Fred N. van Kempen
*/
#include <stdio.h>
#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <wchar.h>
#include <windows.h>
#define HAVE_STDARG_H
#include "../86box.h"
#include "../plat_dynld.h"
#ifdef ENABLE_DYNLD_LOG
int dynld_do_log = ENABLE_DYNLD_LOG;
#endif
static void
dynld_log(const char *fmt, ...)
{
#ifdef ENABLE_DYNLD_LOG
va_list ap;
if (dynld_do_log) {
va_start(ap, fmt);
pclog_ex(fmt, ap);
va_end(ap);
}
#endif
}
void *
dynld_module(const char *name, dllimp_t *table)
{
@@ -33,7 +55,7 @@ dynld_module(const char *name, dllimp_t *table)
/* See if we can load the desired module. */
if ((h = LoadLibrary(name)) == NULL) {
pclog("DynLd(\"%s\"): library not found!\n", name);
dynld_log("DynLd(\"%s\"): library not found!\n", name);
return(NULL);
}
@@ -41,7 +63,7 @@ dynld_module(const char *name, dllimp_t *table)
for (imp=table; imp->name!=NULL; imp++) {
func = GetProcAddress(h, imp->name);
if (func == NULL) {
pclog("DynLd(\"%s\"): function '%s' not found!\n",
dynld_log("DynLd(\"%s\"): function '%s' not found!\n",
name, imp->name);
CloseHandle(h);
return(NULL);

View File

@@ -8,7 +8,7 @@
*
* Joystick interface to host device.
*
* Version: @(#)win_joystick.cpp 1.0.8 2018/03/18
* Version: @(#)win_joystick.cpp 1.0.9 2018/04/29
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -19,8 +19,10 @@
#define DIRECTINPUT_VERSION 0x0800
#include <dinput.h>
#include <math.h>
#include <stdio.h>
#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>
#define HAVE_STDARG_H
#include "../86box.h"
#include "../device.h"
#include "../plat.h"
@@ -38,12 +40,32 @@ static LPDIRECTINPUTDEVICE8 lpdi_joystick[2] = {NULL, NULL};
static GUID joystick_guids[MAX_JOYSTICKS];
#ifdef ENABLE_JOYSTICK_LOG
int joystick_do_log = ENABLE_JOYSTICK_LOG;
#endif
static void
joystick_log(const char *fmt, ...)
{
#ifdef ENABLE_JOYSTICK_LOG
va_list ap;
if (joystick_do_log) {
va_start(ap, fmt);
pclog_ex(fmt, ap);
va_end(ap);
}
#endif
}
static BOOL CALLBACK joystick_enum_callback(LPCDIDEVICEINSTANCE lpddi, UNUSED(LPVOID data))
{
if (joysticks_present >= MAX_JOYSTICKS)
return DIENUM_STOP;
pclog("joystick_enum_callback : found joystick %i : %s\n", joysticks_present, lpddi->tszProductName);
joystick_log("joystick_enum_callback : found joystick %i : %s\n", joysticks_present, lpddi->tszProductName);
joystick_guids[joysticks_present++] = lpddi->guidInstance;
@@ -64,7 +86,7 @@ BOOL CALLBACK DIEnumDeviceObjectsCallback(
lpddoi->guidType == GUID_Slider)
{
strncpy(state->axis[state->nr_axes].name, lpddoi->tszName, sizeof(state->axis[state->nr_axes].name));
pclog("Axis %i : %s %x %x\n", state->nr_axes, state->axis[state->nr_axes].name, lpddoi->dwOfs, lpddoi->dwType);
joystick_log("Axis %i : %s %x %x\n", state->nr_axes, state->axis[state->nr_axes].name, lpddoi->dwOfs, lpddoi->dwType);
if (lpddoi->guidType == GUID_XAxis)
state->axis[state->nr_axes].id = 0;
else if (lpddoi->guidType == GUID_YAxis)
@@ -82,13 +104,13 @@ BOOL CALLBACK DIEnumDeviceObjectsCallback(
else if (lpddoi->guidType == GUID_Button)
{
strncpy(state->button[state->nr_buttons].name, lpddoi->tszName, sizeof(state->button[state->nr_buttons].name));
pclog("Button %i : %s %x %x\n", state->nr_buttons, state->button[state->nr_buttons].name, lpddoi->dwOfs, lpddoi->dwType);
joystick_log("Button %i : %s %x %x\n", state->nr_buttons, state->button[state->nr_buttons].name, lpddoi->dwOfs, lpddoi->dwType);
state->nr_buttons++;
}
else if (lpddoi->guidType == GUID_POV)
{
strncpy(state->pov[state->nr_povs].name, lpddoi->tszName, sizeof(state->pov[state->nr_povs].name));
pclog("POV %i : %s %x %x\n", state->nr_povs, state->pov[state->nr_povs].name, lpddoi->dwOfs, lpddoi->dwType);
joystick_log("POV %i : %s %x %x\n", state->nr_povs, state->pov[state->nr_povs].name, lpddoi->dwOfs, lpddoi->dwType);
state->nr_povs++;
}
@@ -111,7 +133,7 @@ void joystick_init()
if (FAILED(lpdi->EnumDevices(DIDEVTYPE_JOYSTICK, joystick_enum_callback, NULL, DIEDFL_ATTACHEDONLY)))
fatal("joystick_init : EnumDevices failed\n");
pclog("joystick_init: joysticks_present=%i\n", joysticks_present);
joystick_log("joystick_init: joysticks_present=%i\n", joysticks_present);
for (c = 0; c < joysticks_present; c++)
{
@@ -130,18 +152,18 @@ void joystick_init()
device_instance.dwSize = sizeof(device_instance);
if (FAILED(lpdi_joystick[c]->GetDeviceInfo(&device_instance)))
fatal("joystick_init : GetDeviceInfo failed\n");
pclog("Joystick %i :\n", c);
pclog(" tszInstanceName = %s\n", device_instance.tszInstanceName);
pclog(" tszProductName = %s\n", device_instance.tszProductName);
joystick_log("Joystick %i :\n", c);
joystick_log(" tszInstanceName = %s\n", device_instance.tszInstanceName);
joystick_log(" tszProductName = %s\n", device_instance.tszProductName);
strncpy(plat_joystick_state[c].name, device_instance.tszInstanceName, 64);
memset(&devcaps, 0, sizeof(devcaps));
devcaps.dwSize = sizeof(devcaps);
if (FAILED(lpdi_joystick[c]->GetCapabilities(&devcaps)))
fatal("joystick_init : GetCapabilities failed\n");
pclog(" Axes = %i\n", devcaps.dwAxes);
pclog(" Buttons = %i\n", devcaps.dwButtons);
pclog(" POVs = %i\n", devcaps.dwPOVs);
joystick_log(" Axes = %i\n", devcaps.dwAxes);
joystick_log(" Buttons = %i\n", devcaps.dwButtons);
joystick_log(" POVs = %i\n", devcaps.dwPOVs);
lpdi_joystick[c]->EnumObjects(DIEnumDeviceObjectsCallback, &plat_joystick_state[c], DIDFT_ALL);
@@ -246,7 +268,7 @@ void joystick_process(void)
for (b = 0; b < 4; b++)
plat_joystick_state[c].p[b] = joystate.rgdwPOV[b];
// pclog("joystick %i - x=%i y=%i b[0]=%i b[1]=%i %i\n", c, joystick_state[c].x, joystick_state[c].y, joystick_state[c].b[0], joystick_state[c].b[1], joysticks_present);
// joystick_log("joystick %i - x=%i y=%i b[0]=%i b[1]=%i %i\n", c, joystick_state[c].x, joystick_state[c].y, joystick_state[c].b[0], joystick_state[c].b[1], joysticks_present);
}
for (c = 0; c < joystick_get_max_joysticks(joystick_type); c++)

View File

@@ -8,7 +8,7 @@
*
* Windows raw keyboard input handler.
*
* Version: @(#)win_keyboard.c 1.0.9 2018/02/10
* Version: @(#)win_keyboard.c 1.0.10 2018/04/29
*
* Author: Miran Grca, <mgrca8@gmail.com>
*
@@ -95,7 +95,6 @@ keyboard_getkeymap(void)
scancode_unmapped = convert_scan_code(scancode_unmapped);
scancode_mapped = convert_scan_code(scancode_mapped);
/* pclog("Scan code map found: %04X -> %04X\n", scancode_unmapped, scancode_mapped); */
/* Ignore source scan codes with prefixes other than E1
that are not E1 1D. */
@@ -145,7 +144,6 @@ keyboard_handle(LPARAM lParam, int infocus)
scancode = convert_scan_code(scancode);
/* Remap it according to the list from the Registry */
/* pclog("Scan code: %04X (map: %04X)\n", scancode, scancode_map[scancode]); */
scancode = scancode_map[scancode];
/* If it's not 0xFFFF, send it to the emulated

View File

@@ -1,7 +1,7 @@
#include <windows.h>
#include <mmsystem.h>
#include <stdio.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <wchar.h>
#include "../86box.h"
@@ -100,10 +100,7 @@ void plat_midi_play_sysex(uint8_t *sysex, unsigned int len)
MMRESULT result;
if (WaitForSingleObject(m_event, 2000) == WAIT_TIMEOUT)
{
pclog("Can't send MIDI message\n");
return;
}
midiOutUnprepareHeader(midi_out_device, &m_hdr, sizeof(m_hdr));

View File

@@ -8,7 +8,7 @@
*
* Handle the New Floppy Image dialog.
*
* Version: @(#)win_new_floppy.c 1.0.6 2018/03/28
* Version: @(#)win_new_floppy.c 1.0.7 2018/05/14
*
* Authors: Miran Grca, <mgrca8@gmail.com>
*
@@ -50,20 +50,20 @@ typedef struct {
} disk_size_t;
disk_size_t disk_sizes[14] = { { 0, 1, 2, 1, 0, 40, 8, 2, 0xFE, 2, 2, 1, 112 }, /* 160k */
{ 0, 1, 2, 1, 0, 40, 9, 2, 0xFC, 2, 2, 1, 112 }, /* 180k */
{ 0, 2, 2, 1, 0, 40, 8, 2, 0xFF, 2, 2, 1, 112 }, /* 320k */
{ 0, 2, 2, 1, 0, 40, 9, 2, 0xFD, 2, 2, 2, 112 }, /* 360k */
{ 0, 2, 2, 1, 0, 80, 8, 2, 0xFB, 2, 2, 2, 112 }, /* 640k */
{ 0, 2, 2, 1, 0, 80, 9, 2, 0xF9, 2, 2, 3, 112 }, /* 720k */
{ 1, 2, 0, 1, 1, 80, 15, 2, 0xF9, 1, 2, 7, 224 }, /* 1.2M */
{ 1, 2, 0, 1, 1, 77, 8, 3, 0xFE, 1, 2, 2, 192 }, /* 1.25M */
{ 1, 2, 0, 1, 0, 80, 18, 2, 0xF0, 1, 2, 9, 224 }, /* 1.44M */
{ 1, 2, 0, 1, 0, 80, 21, 2, 0xF0, 2, 2, 5, 16 }, /* DMF cluster 1024 */
{ 1, 2, 0, 1, 0, 80, 21, 2, 0xF0, 4, 2, 3, 16 }, /* DMF cluster 2048 */
{ 2, 2, 3, 1, 0, 80, 36, 2, 0xF0, 2, 2, 9, 240 }, /* 2.88M */
{ 0, 64, 0, 0, 0, 96, 32, 2, 0, 0, 0, 0, 0 }, /* ZIP 100 */
{ 0, 64, 0, 0, 0, 239, 32, 2, 0, 0, 0, 0, 0 } }; /* ZIP 250 */
static const disk_size_t disk_sizes[14] = { { 0, 1, 2, 1, 0, 40, 8, 2, 0xfe, 2, 2, 1, 112 }, /* 160k */
{ 0, 1, 2, 1, 0, 40, 9, 2, 0xfc, 2, 2, 1, 112 }, /* 180k */
{ 0, 2, 2, 1, 0, 40, 8, 2, 0xff, 2, 2, 1, 112 }, /* 320k */
{ 0, 2, 2, 1, 0, 40, 9, 2, 0xfd, 2, 2, 2, 112 }, /* 360k */
{ 0, 2, 2, 1, 0, 80, 8, 2, 0xfb, 2, 2, 2, 112 }, /* 640k */
{ 0, 2, 2, 1, 0, 80, 9, 2, 0xf9, 2, 2, 3, 112 }, /* 720k */
{ 1, 2, 0, 1, 1, 80, 15, 2, 0xf9, 1, 2, 7, 224 }, /* 1.2M */
{ 1, 2, 0, 1, 1, 77, 8, 3, 0xfe, 1, 2, 2, 192 }, /* 1.25M */
{ 1, 2, 0, 1, 0, 80, 18, 2, 0xf0, 1, 2, 9, 224 }, /* 1.44M */
{ 1, 2, 0, 1, 0, 80, 21, 2, 0xf0, 2, 2, 5, 16 }, /* DMF cluster 1024 */
{ 1, 2, 0, 1, 0, 80, 21, 2, 0xf0, 4, 2, 3, 16 }, /* DMF cluster 2048 */
{ 2, 2, 3, 1, 0, 80, 36, 2, 0xf0, 2, 2, 9, 240 }, /* 2.88M */
{ 0, 64, 0, 0, 0, 96, 32, 2, 0, 0, 0, 0, 0 }, /* ZIP 100 */
{ 0, 64, 0, 0, 0, 239, 32, 2, 0, 0, 0, 0, 0 } }; /* ZIP 250 */
static unsigned char *empty;

View File

@@ -8,7 +8,7 @@
*
* Windows 86Box Settings dialog handler.
*
* Version: @(#)win_settings.c 1.0.48 2018/04/26
* Version: @(#)win_settings.c 1.0.50 2018/05/01
*
* Author: Miran Grca, <mgrca8@gmail.com>
*
@@ -21,8 +21,8 @@
#undef BITMAP
#include <commctrl.h>
#include <inttypes.h>
#include <stdio.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <wchar.h>
#include "../86box.h"
@@ -5091,7 +5091,12 @@ static BOOL win_settings_main_image_list_init(HWND hwndList)
for (i = 0; i < 10; i++)
{
hiconItem = LoadIcon(hinstance, (LPCWSTR) (256 + (uintptr_t) i));
if (i == 4)
hiconItem = LoadIcon(hinstance, (LPCWSTR) 208);
else if (i == 7)
hiconItem = LoadIcon(hinstance, (LPCWSTR) 192);
else
hiconItem = LoadIcon(hinstance, (LPCWSTR) (256 + (uintptr_t) i));
ImageList_AddIcon(hSmall, hiconItem);
DestroyIcon(hiconItem);
}
@@ -5165,23 +5170,16 @@ win_settings_main_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
h = GetDlgItem(hdlg, IDC_SETTINGSCATLIST);
j = ListView_GetItemState(h, i, LVIS_SELECTED);
if (j)
{
category = i;
/* pclog("Category %i selected\n", i); */
}
}
if (category != -1)
{
/* pclog("Showing child: %i\n", category); */
win_settings_show_child(hdlg, category);
}
}
break;
case WM_COMMAND:
switch (LOWORD(wParam))
{
case IDOK:
/* pclog("Saving settings...\n"); */
SendMessage(hwndChildDialog, WM_SAVESETTINGS, 0, 0);
i = settings_msgbox_reset();
if (i > 0)
@@ -5191,7 +5189,6 @@ win_settings_main_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
win_settings_save();
}
/* pclog("Destroying window...\n"); */
DestroyWindow(hwndChildDialog);
EndDialog(hdlg, 0);
plat_pause(0);

View File

@@ -8,7 +8,7 @@
*
* user Interface module for WinAPI on Windows.
*
* Version: @(#)win_ui.c 1.0.25 2018/04/26
* Version: @(#)win_ui.c 1.0.27 2018/05/01
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -21,8 +21,8 @@
#define UNICODE
#include <windows.h>
#include <commctrl.h>
#include <stdio.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
@@ -227,7 +227,7 @@ LowLevelKeyboardProc(int nCode, WPARAM wParam, LPARAM lParam)
BOOL bControlKeyDown;
KBDLLHOOKSTRUCT *p;
if (nCode < 0 || nCode != HC_ACTION)
if (nCode < 0 || nCode != HC_ACTION || (!mouse_capture && !video_fullscreen))
return(CallNextHookEx(hKeyboardHook, nCode, wParam, lParam));
p = (KBDLLHOOKSTRUCT*)lParam;
@@ -395,7 +395,6 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
break;
case IDM_VID_FULLSCREEN:
/* pclog("enter full screen though menu\n"); */
plat_setfullscreen(1);
config_save();
break;
@@ -667,7 +666,6 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
break;
case WM_LEAVEFULLSCREEN:
/* pclog("leave full screen on window message\n"); */
plat_setfullscreen(0);
config_save();
break;
@@ -916,7 +914,6 @@ ui_init(int nCmdShow)
if (video_fullscreen && keyboard_isfsexit()) {
/* Signal "exit fullscreen mode". */
/* pclog("leave full screen though key combination\n"); */
plat_setfullscreen(0);
}
}
@@ -1035,13 +1032,11 @@ plat_mouse_capture(int on)
GetClipCursor(&oldclip);
GetWindowRect(hwndRender, &rect);
ClipCursor(&rect);
/* pclog("mouse capture off, hide cursor\n"); */
show_cursor(0);
mouse_capture = 1;
} else if (!on && mouse_capture) {
/* Disable the in-app mouse. */
ClipCursor(&oldclip);
/* pclog("mouse capture on, show cursor\n"); */
show_cursor(-1);
mouse_capture = 0;