Fixed some bugs and warnings.
Moved the SIO files to a new sio/ folder. Added the 'version.h'stuff, added Makefile rule to generate the Manifest file for Windows. Re-worked the About dialog - it now includes more info.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
#
|
||||
# Makefile for Windows systems using the MinGW32 environment.
|
||||
#
|
||||
# Version: @(#)Makefile.mingw 1.0.7 2018/03/05
|
||||
# Version: @(#)Makefile.mingw 1.0.8 2018/03/07
|
||||
#
|
||||
# Author: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
#
|
||||
@@ -192,7 +192,7 @@ endif
|
||||
# Nothing should need changing from here on.. #
|
||||
#########################################################################
|
||||
VPATH := $(EXPATH) . cpu \
|
||||
cdrom disk floppy game machine \
|
||||
cdrom disk floppy game sio machine \
|
||||
sound \
|
||||
sound/munt sound/munt/c_interface sound/munt/sha1 \
|
||||
sound/munt/srchelper \
|
||||
@@ -218,6 +218,7 @@ ifneq ($(CROSS), n)
|
||||
CPP := /usr/bin/$(MINGW)-g++ -m32
|
||||
CC := /usr/bin/$(MINGW)-gcc -m32
|
||||
endif
|
||||
PREPROC := /usr/bin/$(MINGW)-cpp
|
||||
WINDRES := /usr/bin/$(MINGW)-windres
|
||||
|
||||
SYSINC := -I/usr/$(MINGW)/include -Iwin/mingw/include
|
||||
@@ -231,6 +232,7 @@ else
|
||||
CPP := g++ -m32
|
||||
CC := gcc -m32
|
||||
endif
|
||||
PREPROC := cpp
|
||||
WINDRES := windres
|
||||
|
||||
SYSINC := -Iwin/mingw/include
|
||||
@@ -242,15 +244,24 @@ DEPFILE := win/.depends
|
||||
|
||||
# Set up the correct toolchain flags.
|
||||
OPTS := $(EXTRAS) $(STUFF)
|
||||
ifdef BUILD
|
||||
OPTS += -DBUILD=$(BUILD)
|
||||
endif
|
||||
ifdef COMMIT
|
||||
OPTS += -DCOMMIT=0x$(COMMIT)
|
||||
endif
|
||||
ifdef UPSTREAM
|
||||
OPTS += -DUPSTREAM=0x$(UPSTREAM)
|
||||
endif
|
||||
ifdef EXFLAGS
|
||||
OPTS += $(EXFLAGS)
|
||||
OPTS += $(EXFLAGS)
|
||||
endif
|
||||
ifdef EXINC
|
||||
OPTS += -I$(EXINC)
|
||||
OPTS += -I$(EXINC)
|
||||
endif
|
||||
OPTS += $(SYSINC)
|
||||
OPTS += $(SYSINC)
|
||||
ifneq ($(CROSS), n)
|
||||
OPTS += -DUSE_CROSS
|
||||
OPTS += -DUSE_CROSS
|
||||
endif
|
||||
ifeq ($(X64), y)
|
||||
ifeq ($(OPTIM), y)
|
||||
@@ -275,7 +286,7 @@ else
|
||||
ifeq ($(OPTIM), y)
|
||||
AOPTIM := -mtune=native
|
||||
ifndef COPTIM
|
||||
COPTIM := -O6
|
||||
COPTIM := -O3
|
||||
endif
|
||||
else
|
||||
ifndef COPTIM
|
||||
@@ -637,7 +648,10 @@ endif
|
||||
all: $(PROG).exe pcap_if.exe
|
||||
|
||||
|
||||
VARCem.res: VARCem.rc
|
||||
VARCem.res: VARCem.rc VARCem.mpp
|
||||
@echo Generating Manifest file..
|
||||
@-rm -f win/VARCem.manifest 2>NUL
|
||||
@$(PREPROC) -P win/VARCem.mpp >win/VARCem.manifest
|
||||
@echo Processing $<
|
||||
@$(WINDRES) $(RFLAGS) $(EXTRAS) -i $< -o VARCem.res
|
||||
|
||||
@@ -675,6 +689,7 @@ clobber: clean
|
||||
@echo Cleaning executables..
|
||||
@-rm -f *.d 2>NUL
|
||||
@-rm -f *.exe 2>NUL
|
||||
@-rm -f win/*.manifest 2>NUL
|
||||
# @-rm -f $(DEPFILE) 2>NUL
|
||||
|
||||
ifneq ($(AUTODEP), y)
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
#include "../version.h"
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
||||
<assemblyIdentity
|
||||
version="0.1.0.0"
|
||||
version=EMU_VERSION_4
|
||||
processorArchitecture="*"
|
||||
name="VARCem.exe"
|
||||
type="win32"
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Application resource script for Windows.
|
||||
*
|
||||
* Version: @(#)VARCem.rc 1.0.4 2018/03/01
|
||||
* Version: @(#)VARCem.rc 1.0.5 2018/03/07
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -38,6 +38,7 @@
|
||||
#define IN_RESOURCE_H
|
||||
#include "resource.h"
|
||||
#include "../emu.h"
|
||||
#include "../version.h"
|
||||
#include "../plat.h"
|
||||
#undef IN_RESOURCE_H
|
||||
|
||||
@@ -236,17 +237,26 @@ END
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
DLG_ABOUT DIALOG DISCARDABLE 0, 0, 209, 114
|
||||
DLG_ABOUT DIALOG DISCARDABLE 0, 0, 250, 170
|
||||
STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "About VARCem"
|
||||
FONT 9, "Segoe UI"
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "OK",IDOK,129,94,71,12
|
||||
ICON 100,IDC_ABOUT_ICON,7,7,20,20
|
||||
LTEXT "Virtual Archaelogical Computer EMulator\n\nBased on earlier works like PCem and 86Box.\n\nAuthors: Sarah Walker, Miran Grca, Fred N. van Kempen, TheCollector1995, reenigne, JohnElliott, greatpsycho, and others.\n\nSee LICENSE.txt for more information.",
|
||||
IDC_ABOUT_ICON,54,7,146,73
|
||||
CONTROL "",IDC_ABOUT_ICON,"Static",SS_BLACKFRAME | SS_SUNKEN,0,
|
||||
86,208,1
|
||||
ICON 100,IDC_ABOUT_ICON,5,5,20,20
|
||||
CTEXT "",IDT_TITLE,55,10,195,20
|
||||
CTEXT "Virtual Archaelogical Computer EMulator",
|
||||
IDC_ABOUT_ICON,55,30,195,10
|
||||
CTEXT "",IDT_VERSION,55,40,195,10
|
||||
CONTROL "",IDC_ABOUT_ICON,"Static",SS_BLACKFRAME | SS_SUNKEN,
|
||||
57,52,190,1
|
||||
LTEXT "Authors:", IDC_ABOUT_ICON,5,60,40,10
|
||||
LTEXT "Fred N. van Kempen, Miran Grca, Sarah Walker, TheCollector1995, reenigne, John Elliott, greatpsycho, and others.",
|
||||
IDC_ABOUT_ICON,5,70,240,30
|
||||
LTEXT "Based on earlier works like 86Box, PCem, MAME, DOSbox and Qemu.",
|
||||
IDC_ABOUT_ICON,5,100,240,20
|
||||
LTEXT "Released under the BSD 3-Clause License, and the GNU General Public License (version 2 or up) for existing, imported code from other projects. See LICENSE.txt for more information.",
|
||||
IDC_ABOUT_ICON,5,120,240,30
|
||||
DEFPUSHBUTTON "OK",IDOK,169,150,71,12
|
||||
END
|
||||
|
||||
DLG_STATUS DIALOG DISCARDABLE 0, 0, 186, 386
|
||||
@@ -1063,8 +1073,8 @@ END
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 0,1,0,0
|
||||
PRODUCTVERSION 0,1,0,0
|
||||
FILEVERSION EMU_VER_MAJOR,EMU_VER_MINOR,EMU_VER_REV,0
|
||||
PRODUCTVERSION EMU_VER_MAJOR,EMU_VER_MINOR,EMU_VER_REV,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
@@ -1079,18 +1089,17 @@ BEGIN
|
||||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "Comments", "\0"
|
||||
VALUE "CompanyName", "IRC #VARCem on FreeNode\0"
|
||||
VALUE "FileDescription", "VARCem - Virtual Archaelogical Computer EMulator\0"
|
||||
VALUE "FileVersion", "0.1.0\0"
|
||||
VALUE "InternalName", "VARCem\0"
|
||||
VALUE "LegalCopyright", "Copyright Fred N. van Kempen and others, 2007-2018, Released under the BSD 3-Clause License\0"
|
||||
VALUE "LegalTrademarks", "\0"
|
||||
VALUE "OriginalFilename", "VARCem.exe\0"
|
||||
VALUE "PrivateBuild", "\0"
|
||||
VALUE "ProductName", "VARCem Emulator\0"
|
||||
VALUE "ProductVersion", "0.1.0\0"
|
||||
VALUE "SpecialBuild", "\0"
|
||||
VALUE "CompanyName", "IRC #VARCem on FreeNode"
|
||||
VALUE "FileDescription", "VARCem - Virtual Archaelogical Computer EMulator"
|
||||
VALUE "FileVersion", EMU_VERSION
|
||||
VALUE "InternalName", EMU_NAME
|
||||
VALUE "LegalCopyright", "Copyright Fred N. van Kempen and others, 2007-2018, Released under a mixed BSD 3-Clause and GPL License"
|
||||
VALUE "OriginalFilename", "VARCem.exe"
|
||||
VALUE "ProductName", "VARCem Emulator"
|
||||
VALUE "ProductVersion", EMU_VERSION
|
||||
#ifndef RELEASE_BUILD
|
||||
VALUE "SpecialBuild", "Internal Development Build"
|
||||
#endif
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Windows resource defines.
|
||||
*
|
||||
* Version: @(#)resource.h 1.0.3 2018/03/01
|
||||
* Version: @(#)resource.h 1.0.4 2018/03/07
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -110,6 +110,8 @@
|
||||
#define IDT_1756 1756 /* Channel: */
|
||||
#define IDT_1757 1757 /* Progress: */
|
||||
#define IDT_1758 1758 /* ZIP drives: */
|
||||
#define IDT_TITLE 1759 /* "VARCem for Plaform" */
|
||||
#define IDT_VERSION 1760 /* "version.." */
|
||||
|
||||
/*
|
||||
* To try to keep these organized, we now group the
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Platform main support module for Windows.
|
||||
*
|
||||
* Version: @(#)win.c 1.0.3 2018/03/02
|
||||
* Version: @(#)win.c 1.0.5 2018/03/07
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -46,6 +46,7 @@
|
||||
#include <time.h>
|
||||
#include <wchar.h>
|
||||
#include "../emu.h"
|
||||
#include "../version.h"
|
||||
#include "../config.h"
|
||||
#include "../device.h"
|
||||
#include "../mouse.h"
|
||||
@@ -270,7 +271,7 @@ CreateConsole(int init)
|
||||
if (! AttachConsole(ATTACH_PARENT_PROCESS)) {
|
||||
/* Parent has no console, create one. */
|
||||
if (! AllocConsole()) {
|
||||
#ifdef DEBUG
|
||||
#ifdef _DEBUG
|
||||
fp = fopen("error.txt", "w");
|
||||
fprintf(fp, "AllocConsole failed: %lu\n", GetLastError());
|
||||
fclose(fp);
|
||||
@@ -280,7 +281,7 @@ CreateConsole(int init)
|
||||
}
|
||||
|
||||
if ((h = GetStdHandle(STD_OUTPUT_HANDLE)) == NULL) {
|
||||
#ifdef DEBUG
|
||||
#ifdef _DEBUG
|
||||
fp = fopen("error.txt", "w");
|
||||
fprintf(fp, "GetStdHandle(OUT) failed: %lu\n", GetLastError());
|
||||
fclose(fp);
|
||||
@@ -291,7 +292,7 @@ CreateConsole(int init)
|
||||
if (i != -1) {
|
||||
fp = _fdopen(i, "w");
|
||||
if (fp == NULL) {
|
||||
#ifdef DEBUG
|
||||
#ifdef _DEBUG
|
||||
fp = fopen("error.txt", "w");
|
||||
fprintf(fp, "FdOpen(%i) failed: %lu\n", i, GetLastError());
|
||||
fclose(fp);
|
||||
@@ -301,7 +302,7 @@ CreateConsole(int init)
|
||||
setvbuf(fp, NULL, _IONBF, 1);
|
||||
*stdout = *fp;
|
||||
} else {
|
||||
#ifdef DEBUG
|
||||
#ifdef _DEBUG
|
||||
fp = fopen("error.txt", "w");
|
||||
fprintf(fp, "GetOSfHandle(%p) failed: %lu\n", h, GetLastError());
|
||||
fclose(fp);
|
||||
@@ -409,8 +410,8 @@ WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpszArg, int nCmdShow)
|
||||
/* We need this later. */
|
||||
hinstance = hInst;
|
||||
|
||||
/* Set the application version ID string. */
|
||||
sprintf(emu_version, "%s v%s", EMU_NAME, EMU_VERSION);
|
||||
/* Initialize the version data. CrashDump needs it early. */
|
||||
pc_version("Windows");
|
||||
|
||||
#ifdef USE_CRASHDUMP
|
||||
/* Enable crash dump services. */
|
||||
@@ -523,7 +524,7 @@ plat_remove(wchar_t *path)
|
||||
|
||||
/* Make sure a path ends with a trailing (back)slash. */
|
||||
void
|
||||
plat_path_slash(wchar_t *path)
|
||||
plat_append_slash(wchar_t *path)
|
||||
{
|
||||
if ((path[wcslen(path)-1] != L'\\') &&
|
||||
(path[wcslen(path)-1] != L'/')) {
|
||||
@@ -600,16 +601,6 @@ plat_append_filename(wchar_t *dest, wchar_t *s1, wchar_t *s2)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
plat_put_backslash(wchar_t *path)
|
||||
{
|
||||
int c = wcslen(path) - 1;
|
||||
|
||||
if (path[c] != L'/' && path[c] != L'\\')
|
||||
path[c] = L'/';
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
plat_dir_check(wchar_t *path)
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Platform support defintions for Win32.
|
||||
*
|
||||
* Version: @(#)win.h 1.0.3 2018/03/01
|
||||
* Version: @(#)win.h 1.0.4 2018/03/07
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -43,14 +43,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define UNICODE
|
||||
#if 0
|
||||
# ifdef _WIN32_WINNT
|
||||
# undef _WIN32_WINNT
|
||||
# define _WIN32_WINNT 0x0501
|
||||
# endif
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#include "resource.h"
|
||||
|
||||
|
||||
@@ -151,14 +143,16 @@ extern void StatusBarCreate(HWND hwndParent, uintptr_t idStatus,
|
||||
|
||||
|
||||
/* Functions in win_dialog.c: */
|
||||
extern void dialog_center(HWND hdlg);
|
||||
|
||||
extern wchar_t *BrowseFolder(wchar_t *saved_path, wchar_t *title);
|
||||
|
||||
extern int file_dlg_w(HWND hwnd, WCHAR *f, WCHAR *fn, int save);
|
||||
extern int file_dlg(HWND hwnd, WCHAR *f, char *fn, int save);
|
||||
extern int file_dlg_mb(HWND hwnd, char *f, char *fn, int save);
|
||||
extern int file_dlg_w_st(HWND hwnd, int i, WCHAR *fn, int save);
|
||||
extern int file_dlg_st(HWND hwnd, int i, char *fn, int save);
|
||||
|
||||
extern wchar_t *BrowseFolder(wchar_t *saved_path, wchar_t *title);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Handle the About dialog.
|
||||
*
|
||||
* Version: @(#)win_about.c 1.0.2 2018/02/21
|
||||
* Version: @(#)win_about.c 1.0.3 2018/03/07
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -34,9 +34,8 @@
|
||||
* Boston, MA 02111-1307
|
||||
* USA.
|
||||
*/
|
||||
#define UNICODE
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <windowsx.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
@@ -47,6 +46,31 @@
|
||||
#include "win.h"
|
||||
|
||||
|
||||
static void
|
||||
set_font_bold(HWND hdlg, int item)
|
||||
{
|
||||
LOGFONT logFont;
|
||||
HFONT font;
|
||||
HWND h;
|
||||
|
||||
/* Get a handle to the speficied control in the dialog. */
|
||||
h = GetDlgItem(hdlg, item);
|
||||
|
||||
/* Get that control's current font, and create a LOGFONT for it. */
|
||||
font = (HFONT)SendMessage(h, WM_GETFONT, 0, 0);
|
||||
GetObject(font, sizeof(logFont), &logFont);
|
||||
|
||||
/* Modify the font to have BOLD enabled. */
|
||||
logFont.lfWeight = FW_BOLD;
|
||||
logFont.lfHeight *= 2;
|
||||
logFont.lfWidth *= 2;
|
||||
font = CreateFontIndirect(&logFont);
|
||||
|
||||
/* Set the new font for the control. */
|
||||
SendMessage(h, WM_SETFONT, (WPARAM)font, 0);
|
||||
}
|
||||
|
||||
|
||||
#ifdef __amd64__
|
||||
static LRESULT CALLBACK
|
||||
#else
|
||||
@@ -54,21 +78,30 @@ static BOOL CALLBACK
|
||||
#endif
|
||||
AboutDialogProcedure(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
char temp[128];
|
||||
HWND h;
|
||||
|
||||
switch (message) {
|
||||
case WM_INITDIALOG:
|
||||
plat_pause(1);
|
||||
/* Center in the main window. */
|
||||
dialog_center(hdlg);
|
||||
|
||||
h = GetDlgItem(hdlg, IDC_ABOUT_ICON);
|
||||
SendMessage(h, STM_SETIMAGE, (WPARAM)IMAGE_ICON,
|
||||
(LPARAM)LoadImage(hinstance,(PCTSTR)100,IMAGE_ICON,64,64,0));
|
||||
SendDlgItemMessage(hdlg, IDT_TITLE, WM_SETTEXT,
|
||||
(WPARAM)NULL, (LPARAM)emu_title);
|
||||
set_font_bold(hdlg, IDT_TITLE);
|
||||
|
||||
sprintf(temp, "v%s", emu_version);
|
||||
SendDlgItemMessage(hdlg, IDT_VERSION, WM_SETTEXT,
|
||||
(WPARAM)NULL, (LPARAM)temp);
|
||||
break;
|
||||
|
||||
case WM_COMMAND:
|
||||
switch (LOWORD(wParam)) {
|
||||
case IDOK:
|
||||
EndDialog(hdlg, 0);
|
||||
plat_pause(0);
|
||||
return TRUE;
|
||||
|
||||
default:
|
||||
@@ -84,5 +117,9 @@ AboutDialogProcedure(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
void
|
||||
AboutDialogCreate(HWND hwnd)
|
||||
{
|
||||
plat_pause(1);
|
||||
|
||||
DialogBox(hinstance, (LPCTSTR)DLG_ABOUT, hwnd, AboutDialogProcedure);
|
||||
|
||||
plat_pause(0);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Handle the platform-side of CDROM drives.
|
||||
*
|
||||
* Version: @(#)win_cdrom.c 1.0.3 2018/02/24
|
||||
* Version: @(#)win_cdrom.c 1.0.4 2018/03/07
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -35,8 +35,8 @@
|
||||
* USA.
|
||||
*/
|
||||
#define UNICODE
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <windowsx.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* Implementation of the CD-ROM host drive IOCTL interface for
|
||||
* Windows using SCSI Passthrough Direct.
|
||||
*
|
||||
* Version: @(#)cdrom_ioctl.c 1.0.2 2018/03/04
|
||||
* Version: @(#)cdrom_ioctl.c 1.0.3 2018/03/07
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
*
|
||||
* Handle generation of crash-dump reports.
|
||||
*
|
||||
* Version: @(#)win_crashdump.c 1.0.3 2018/02/24
|
||||
* Version: @(#)win_crashdump.c 1.0.4 2018/03/07
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Riley (Rain-chan),
|
||||
* Riley (Rai-chan),
|
||||
*
|
||||
* Copyright 2017,2018 Fred N. van Kempen.
|
||||
* Copyright 2016-2017 Riley (Rain-chan),
|
||||
* Copyright 2016-2017 Riley (Rai-chan).
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -35,6 +35,7 @@
|
||||
* USA.
|
||||
*/
|
||||
#define _WIN32_WINNT 0x0501
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <psapi.h>
|
||||
#include <stdio.h>
|
||||
@@ -42,8 +43,8 @@
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include "../emu.h"
|
||||
#include "../version.h"
|
||||
#include "../plat.h"
|
||||
#include "win.h"
|
||||
|
||||
|
||||
#define ExceptionHandlerBufferSize (10240)
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Rendering module for Microsoft Direct3D 9.
|
||||
*
|
||||
* Version: @(#)win_d3d.cpp 1.0.3 2018/02/26
|
||||
* Version: @(#)win_d3d.cpp 1.0.4 2018/03/07
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -36,9 +36,14 @@
|
||||
* Boston, MA 02111-1307
|
||||
* USA.
|
||||
*/
|
||||
#define UNICODE
|
||||
#include <windows.h>
|
||||
#include <d3d9.h>
|
||||
#include <d3dx9tex.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include "../emu.h"
|
||||
#include "../version.h"
|
||||
#include "../device.h"
|
||||
#include "../video/video.h"
|
||||
#include "../plat.h"
|
||||
@@ -470,7 +475,7 @@ d3d_init_fs(HWND h)
|
||||
d3d_hwnd = h;
|
||||
|
||||
/*FIXME: should be done once, in win.c */
|
||||
_swprintf(title, L"%s v%s", EMU_NAME_W, EMU_VERSION_W);
|
||||
_swprintf(title, L"%s v%s", TEXT(EMU_NAME), TEXT(EMU_VERSION));
|
||||
d3d_device_window = CreateWindowEx (
|
||||
0,
|
||||
SUB_CLASS_NAME,
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Direct3D 9 rendererer and screenshots taking.
|
||||
*
|
||||
* Version: @(#)win_d3d.h 1.0.2 2018/02/21
|
||||
* Version: @(#)win_d3d.h 1.0.3 2018/03/07
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -38,9 +38,6 @@
|
||||
*/
|
||||
#ifndef WIN_D3D_H
|
||||
# define WIN_D3D_H
|
||||
# define UNICODE
|
||||
# include <d3d9.h>
|
||||
# include <d3dx9tex.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -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.1 2018/02/14
|
||||
* Version: @(#)win_ddraw.cpp 1.0.2 2018/03/07
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -39,20 +39,19 @@
|
||||
* Boston, MA 02111-1307
|
||||
* USA.
|
||||
*/
|
||||
#define UNICODE
|
||||
#include <windows.h>
|
||||
#include <ddraw.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#define UNICODE
|
||||
#define BITMAP WINDOWS_BITMAP
|
||||
#include <windows.h>
|
||||
#undef BITMAP
|
||||
#include "../emu.h"
|
||||
#include "../device.h"
|
||||
#include "../video/video.h"
|
||||
#include "../plat.h"
|
||||
#include "../ui.h"
|
||||
#include "win.h"
|
||||
#include "win_ddraw.h"
|
||||
#include "win_png.h"
|
||||
#include "win.h"
|
||||
|
||||
|
||||
static LPDIRECTDRAW lpdd = NULL;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Definitions for the DirectDraw 9 rendering module.
|
||||
*
|
||||
* Version: @(#)win_ddraw.h 1.0.2 2018/02/21
|
||||
* Version: @(#)win_ddraw.h 1.0.3 2018/03/07
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -38,8 +38,6 @@
|
||||
*/
|
||||
#ifndef WIN_DDRAW_H
|
||||
# define WIN_DDRAW_H
|
||||
# define UNICODE
|
||||
# include <ddraw.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Imlementation of the Device Configuration dialog.
|
||||
*
|
||||
* Version: @(#)win_devconf.c 1.0.2 2018/02/24
|
||||
* Version: @(#)win_devconf.c 1.0.3 2018/03/07
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -36,8 +36,12 @@
|
||||
* Boston, MA 02111-1307
|
||||
* USA.
|
||||
*/
|
||||
#define UNICODE
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "../emu.h"
|
||||
@@ -47,7 +51,6 @@
|
||||
#include "../plat_midi.h"
|
||||
#include "../ui.h"
|
||||
#include "win.h"
|
||||
#include <windowsx.h>
|
||||
|
||||
|
||||
static device_t *config_device;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Implementation of server several dialogs.
|
||||
*
|
||||
* Version: @(#)win_dialog.c 1.0.2 2018/03/01
|
||||
* Version: @(#)win_dialog.c 1.0.3 2018/03/07
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -37,8 +37,8 @@
|
||||
* USA.
|
||||
*/
|
||||
#define UNICODE
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <windowsx.h>
|
||||
#include <shlobj.h>
|
||||
#include <commdlg.h>
|
||||
#include <stdio.h>
|
||||
@@ -46,6 +46,7 @@
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "../emu.h"
|
||||
#include "../version.h"
|
||||
#include "../device.h"
|
||||
#include "../plat.h"
|
||||
#include "../ui.h"
|
||||
@@ -68,6 +69,33 @@ BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
dialog_center(HWND hdlg)
|
||||
{
|
||||
RECT r, r1, r2;
|
||||
HWND owner;
|
||||
|
||||
/* Get handle to owner window. Use desktop if needed. */
|
||||
if ((owner = GetParent(hdlg)) == NULL)
|
||||
owner = GetDesktopWindow();
|
||||
|
||||
/* Get owner and dialog rects. */
|
||||
GetWindowRect(hdlg, &r1);
|
||||
GetWindowRect(owner, &r2);
|
||||
CopyRect(&r, &r2);
|
||||
|
||||
/* Center the dialog within the owner's space. */
|
||||
OffsetRect(&r1, -r1.left, -r1.top);
|
||||
OffsetRect(&r, -r.left, -r.top);
|
||||
OffsetRect(&r, -r1.right, -r1.bottom);
|
||||
|
||||
/* Move the dialog window. */
|
||||
SetWindowPos(hdlg, HWND_TOP,
|
||||
r2.left + (r.right / 2), r2.top + (r.bottom / 2),
|
||||
0, 0, SWP_NOSIZE);
|
||||
}
|
||||
|
||||
|
||||
wchar_t *
|
||||
BrowseFolder(wchar_t *saved_path, wchar_t *title)
|
||||
{
|
||||
@@ -110,7 +138,7 @@ ui_msgbox(int flags, void *arg)
|
||||
switch(flags & 0x1f) {
|
||||
case MBX_INFO: /* just an informational message */
|
||||
fl = (MB_OK | MB_ICONINFORMATION);
|
||||
cap = EMU_NAME_W;
|
||||
cap = TEXT(EMU_NAME);
|
||||
break;
|
||||
|
||||
case MBX_ERROR: /* error message */
|
||||
@@ -125,12 +153,12 @@ ui_msgbox(int flags, void *arg)
|
||||
|
||||
case MBX_QUESTION: /* question */
|
||||
fl = (MB_YESNOCANCEL | MB_ICONQUESTION);
|
||||
cap = EMU_NAME_W;
|
||||
cap = TEXT(EMU_NAME);
|
||||
break;
|
||||
|
||||
case MBX_CONFIG: /* configuration */
|
||||
fl = (MB_YESNO | MB_ICONERROR);
|
||||
cap = EMU_NAME_W;
|
||||
cap = plat_get_string(IDS_2050); /* "Configuration Error" */
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Try to load a support DLL.
|
||||
*
|
||||
* Version: @(#)win_dynld.c 1.0.1 2018/02/14
|
||||
* Version: @(#)win_dynld.c 1.0.2 2018/03/07
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
*
|
||||
@@ -44,12 +44,13 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <wchar.h>
|
||||
#include <windows.h>
|
||||
#include "../emu.h"
|
||||
#include "../plat_dynld.h"
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
* NOTE: Hacks currently needed to compile with MSVC; DX needs to
|
||||
* be updated to 11 or 12 or so. --FvK
|
||||
*
|
||||
* Version: @(#)win_joystick.cpp 1.0.2 2018/02/21
|
||||
* Version: @(#)win_joystick.cpp 1.0.3 2018/03/07
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -39,6 +39,7 @@
|
||||
* Boston, MA 02111-1307
|
||||
* USA.
|
||||
*/
|
||||
#include <windows.h>
|
||||
#define DIRECTINPUT_VERSION 0x0800
|
||||
#include <dinput.h>
|
||||
#ifndef DIDEVTYPE_JOYSTICK
|
||||
@@ -47,9 +48,9 @@
|
||||
*/
|
||||
# define DIDEVTYPE_JOYSTICK 4
|
||||
#endif
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <math.h>
|
||||
#include "../emu.h"
|
||||
#include "../device.h"
|
||||
#include "../plat.h"
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Implementation of the Joystick Configuration dialog.
|
||||
*
|
||||
* Version: @(#)win_jsconf.c 1.0.1 2018/02/14
|
||||
* Version: @(#)win_jsconf.c 1.0.2 2018/03/07
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -36,10 +36,11 @@
|
||||
* Boston, MA 02111-1307
|
||||
* USA.
|
||||
*/
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <windowsx.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "../emu.h"
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Windows raw keyboard input handler.
|
||||
*
|
||||
* Version: @(#)win_keyboard.c 1.0.2 2018/02/21
|
||||
* Version: @(#)win_keyboard.c 1.0.3 2018/03/07
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -35,9 +35,9 @@
|
||||
* USA.
|
||||
*/
|
||||
#define UNICODE
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#define _WIN32_WINNT 0x0501
|
||||
#include <windows.h>
|
||||
#include <windowsx.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Implementation of the System MIDI interface.
|
||||
*
|
||||
* Version: @(#)win_midi.c 1.0.1 2018/02/14
|
||||
* Version: @(#)win_midi.c 1.0.2 2018/03/07
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -36,6 +36,7 @@
|
||||
* Boston, MA 02111-1307
|
||||
* USA.
|
||||
*/
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <mmsystem.h>
|
||||
#include <stdio.h>
|
||||
@@ -47,6 +48,7 @@
|
||||
#include "../sound/midi.h"
|
||||
#include "../plat.h"
|
||||
#include "../plat_midi.h"
|
||||
#include "win.h"
|
||||
|
||||
|
||||
int midi_id = 0;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Mouse interface to host device.
|
||||
*
|
||||
* Version: @(#)win_mouse.cpp 1.0.1 2018/02/14
|
||||
* Version: @(#)win_mouse.cpp 1.0.2 2018/03/07
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -36,6 +36,7 @@
|
||||
* Boston, MA 02111-1307
|
||||
* USA.
|
||||
*/
|
||||
#include <windows.h>
|
||||
#define DIRECTINPUT_VERSION 0x0800
|
||||
#include <dinput.h>
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Implementation of the New Floppy Image dialog.
|
||||
*
|
||||
* Version: @(#)win_new_floppy.c 1.0.4 2018/03/04
|
||||
* Version: @(#)win_new_floppy.c 1.0.5 2018/03/07
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -35,8 +35,8 @@
|
||||
* USA.
|
||||
*/
|
||||
#define UNICODE
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <windowsx.h>
|
||||
#include <commctrl.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
*
|
||||
* Based on old original code @(#)dir_win32.c 1.2.0 2007/04/19
|
||||
*
|
||||
* Version: @(#)win_opendir.c 1.0.1 2018/02/14
|
||||
* Version: @(#)win_opendir.c 1.0.2 2018/03/07
|
||||
*
|
||||
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
*
|
||||
@@ -47,6 +47,7 @@
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#define UNICODE
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <io.h>
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* Windows and UNIX systems, with support for FTDI and Prolific
|
||||
* USB ports. Support for these has been removed.
|
||||
*
|
||||
* Version: @(#)win_serial.c 1.0.1 2018/02/14
|
||||
* Version: @(#)win_serial.c 1.0.2 2018/03/07
|
||||
*
|
||||
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
*
|
||||
@@ -48,6 +48,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Implementation of the Settings dialog.
|
||||
*
|
||||
* Version: @(#)win_settings.c 1.0.5 2018/03/01
|
||||
* Version: @(#)win_settings.c 1.0.6 2018/03/07
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -35,12 +35,13 @@
|
||||
* USA.
|
||||
*/
|
||||
#define UNICODE
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <windowsx.h>
|
||||
#include <commctrl.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "../emu.h"
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Implementation of the Sound Gain dialog.
|
||||
*
|
||||
* Version: @(#)win_snd_gain.c 1.0.2 2018/02/21
|
||||
* Version: @(#)win_snd_gain.c 1.0.3 2018/03/07
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -35,8 +35,8 @@
|
||||
* USA.
|
||||
*/
|
||||
#define UNICODE
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <windowsx.h>
|
||||
#include <commctrl.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Implementation of the Status Window dialog.
|
||||
*
|
||||
* Version: @(#)win_status.c 1.0.2 2018/02/21
|
||||
* Version: @(#)win_status.c 1.0.3 2018/03/07
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -36,8 +36,8 @@
|
||||
* Boston, MA 02111-1307
|
||||
* USA.
|
||||
*/
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <windowsx.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Implementation of the Status Bar module.
|
||||
*
|
||||
* Version: @(#)win_stbar.c 1.0.2 2018/02/21
|
||||
* Version: @(#)win_stbar.c 1.0.3 2018/03/07
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -35,6 +35,7 @@
|
||||
* USA.
|
||||
*/
|
||||
#define UNICODE
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <windowsx.h>
|
||||
#include <commctrl.h>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Implement threads and mutexes for the Win32 platform.
|
||||
*
|
||||
* Version: @(#)win_thread.c 1.0.2 2018/02/21
|
||||
* Version: @(#)win_thread.c 1.0.3 2018/03/07
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
@@ -35,8 +35,8 @@
|
||||
* USA.
|
||||
*/
|
||||
#define UNICODE
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <windowsx.h>
|
||||
#include <process.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Implement the user Interface module.
|
||||
*
|
||||
* Version: @(#)win_ui.c 1.0.3 2018/03/02
|
||||
* Version: @(#)win_ui.c 1.0.4 2018/03/07
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
|
||||
Reference in New Issue
Block a user