diff --git a/src/mouse_serial.c b/src/mouse_serial.c index d3d567d23..1008c6210 100644 --- a/src/mouse_serial.c +++ b/src/mouse_serial.c @@ -10,7 +10,7 @@ * * Based on the 86Box Serial Mouse driver as a framework. * - * Version: @(#)mouse_serial.c 1.0.12 2017/11/08 + * Version: @(#)mouse_serial.c 1.0.13 2017/11/13 * * Author: Fred N. van Kempen, */ @@ -37,11 +37,7 @@ typedef struct mouse_serial_t { /* Callback from serial driver: RTS was toggled. */ static void -#ifdef WALTJE -sermouse_callback(void *priv) -#else sermouse_callback(struct SERIAL *serial, void *priv) -#endif { mouse_serial_t *ms = (mouse_serial_t *)priv; @@ -65,43 +61,25 @@ sermouse_timer(void *priv) switch(ms->type & MOUSE_TYPE_MASK) { case MOUSE_TYPE_MSYSTEMS: /* Identifies Mouse Systems serial mouse. */ -#ifdef WALTJE - serial_write_fifo(ms->serial, 'H', 1); -#else serial_write_fifo(ms->serial, 'H'); -#endif break; case MOUSE_TYPE_MICROSOFT: default: /* Identifies a two-button Microsoft Serial mouse. */ -#ifdef WALTJE - serial_write_fifo(ms->serial, 'M', 1); -#else serial_write_fifo(ms->serial, 'M'); -#endif break; case MOUSE_TYPE_LOGITECH: /* Identifies a two-button Logitech Serial mouse. */ -#ifdef WALTJE - serial_write_fifo(ms->serial, 'M', 1); - serial_write_fifo(ms->serial, '3', 1); -#else serial_write_fifo(ms->serial, 'M'); serial_write_fifo(ms->serial, '3'); -#endif break; case MOUSE_TYPE_MSWHEEL: /* Identifies multi-button Microsoft Wheel Mouse. */ -#ifdef WALTJE - serial_write_fifo(ms->serial, 'M', 1); - serial_write_fifo(ms->serial, 'Z', 1); -#else serial_write_fifo(ms->serial, 'M'); serial_write_fifo(ms->serial, 'Z'); -#endif break; } } @@ -186,11 +164,7 @@ sermouse_poll(int x, int y, int z, int b, void *priv) /* Send the packet to the bottom-half of the attached port. */ for (b=0; bserial, buff[b], 1); -#else serial_write_fifo(ms->serial, buff[b]); -#endif return(0); } @@ -202,11 +176,7 @@ sermouse_close(void *priv) mouse_serial_t *ms = (mouse_serial_t *)priv; /* Detach serial port from the mouse. */ -#ifdef WALTJE - serial_attach(ms->port, NULL, NULL); -#else serial1.rcr_callback = NULL; -#endif free(ms); } @@ -222,13 +192,9 @@ sermouse_init(mouse_t *info) ms->type = info->type; /* Attach a serial port to the mouse. */ -#ifdef WALTJE - ms->serial = serial_attach(ms->port, sermouse_callback, ms); -#else ms->serial = &serial1; ms->serial->rcr_callback = sermouse_callback; ms->serial->rcr_callback_p = ms; -#endif timer_add(sermouse_timer, &ms->delay, &ms->delay, ms); diff --git a/src/pc.c b/src/pc.c index 5a385e491..1d8d1b5e6 100644 --- a/src/pc.c +++ b/src/pc.c @@ -8,7 +8,7 @@ * * Main emulator module where most things are controlled. * - * Version: @(#)pc.c 1.0.42 2017/11/05 + * Version: @(#)pc.c 1.0.43 2017/11/18 * * Authors: Sarah Walker, * Miran Grca, @@ -156,17 +156,6 @@ static int unscaled_size_x = SCREEN_RES_X, /* current unscaled size X */ efscrnsz_y = SCREEN_RES_Y; -int get_actual_size_x(void) -{ - return unscaled_size_x; -} - -int get_actual_size_y(void) -{ - return efscrnsz_y; -} - - /* Log something to the logfile or stdout. */ void pclog(const char *format, ...) @@ -304,6 +293,20 @@ set_screen_size_natural(void) } +int +get_actual_size_x(void) +{ + return(unscaled_size_x); +} + + +int +get_actual_size_y(void) +{ + return(efscrnsz_y); +} + + /* * Perform initial startup of the PC. * @@ -560,7 +563,7 @@ again2: keyboard_init(); mouse_init(); -#ifdef WALTJE +#ifdef WALTJE_SERIAL serial_init(); #endif joystick_init(); @@ -693,7 +696,7 @@ pc_reset_hard_init(void) fdc_update_is_nsc(0); floppy_reset(); -#ifndef WALTJE +#ifndef WALTJE_SERIAL /* This is needed to initialize the serial timer. */ serial_init(); #endif diff --git a/src/plat.h b/src/plat.h index 472535666..97563986f 100644 --- a/src/plat.h +++ b/src/plat.h @@ -8,7 +8,7 @@ * * Define the various platform support functions. * - * Version: @(#)plat.h 1.0.18 2017/11/12 + * Version: @(#)plat.h 1.0.20 2017/11/18 * * Authors: Miran Grca, * Fred N. van Kempen, @@ -25,7 +25,7 @@ #ifndef _WIN32 -# define RENDER_FPS 70 /* default render speed */ +# define RENDER_FPS 30 /* default render speed */ #endif /* The Win32 API uses _wcsicmp. */ @@ -65,6 +65,7 @@ GLOBAL char emu_version[128]; /* version ID string */ /* System-related functions. */ +extern wchar_t *fix_exe_path(wchar_t *str); extern FILE *plat_fopen(wchar_t *path, wchar_t *mode); extern void plat_remove(wchar_t *path); extern int plat_getcwd(wchar_t *bufp, int max); @@ -90,9 +91,15 @@ extern void plat_resize(int x, int y); /* Resource management. */ +extern void set_language(int id); extern wchar_t *plat_get_string(int id); +/* Emulator start/stop support functions. */ +extern void do_start(void); +extern void do_stop(void); + + /* Platform-specific device support. */ extern uint8_t host_cdrom_drive_available[26]; extern uint8_t host_cdrom_drive_available_num; diff --git a/src/plat_joystick.h b/src/plat_joystick.h index ecb80168e..d1287f769 100644 --- a/src/plat_joystick.h +++ b/src/plat_joystick.h @@ -1,69 +1,65 @@ -/* Copyright holders: Sarah Walker - see COPYING for more details -*/ +#define MAX_PLAT_JOYSTICKS 8 +#define MAX_JOYSTICKS 4 + +#define POV_X 0x80000000 +#define POV_Y 0x40000000 + + +typedef struct { + char name[64]; + + int a[8]; + int b[32]; + int p[4]; + + struct { + char name[32]; + int id; + } axis[8]; + + struct { + char name[32]; + int id; + } button[32]; + + struct { + char name[32]; + int id; + } pov[4]; + + int nr_axes; + int nr_buttons; + int nr_povs; +} plat_joystick_t; + +typedef struct { + int axis[8]; + int button[32]; + int pov[4]; + + int plat_joystick_nr; + int axis_mapping[8]; + int button_mapping[32]; + int pov_mapping[4][2]; +} joystick_t; + + #ifdef __cplusplus extern "C" { #endif -extern void joystick_init(void); -extern void joystick_close(void); -extern void joystick_process(void); -typedef struct plat_joystick_t -{ - char name[64]; +extern plat_joystick_t plat_joystick_state[MAX_PLAT_JOYSTICKS]; +extern joystick_t joystick_state[MAX_JOYSTICKS]; +extern int joysticks_present; - int a[8]; - int b[32]; - int p[4]; - - struct - { - char name[32]; - int id; - } axis[8]; - - struct - { - char name[32]; - int id; - } button[32]; - - struct - { - char name[32]; - int id; - } pov[4]; - - int nr_axes; - int nr_buttons; - int nr_povs; -} plat_joystick_t; - -#define MAX_PLAT_JOYSTICKS 8 - -extern plat_joystick_t plat_joystick_state[MAX_PLAT_JOYSTICKS]; -extern int joysticks_present; - -#define POV_X 0x80000000 -#define POV_Y 0x40000000 - -typedef struct joystick_t -{ - int axis[8]; - int button[32]; - int pov[4]; - - int plat_joystick_nr; - int axis_mapping[8]; - int button_mapping[32]; - int pov_mapping[4][2]; -} joystick_t; - -#define MAX_JOYSTICKS 4 -extern joystick_t joystick_state[MAX_JOYSTICKS]; #define JOYSTICK_PRESENT(n) (joystick_state[n].plat_joystick_nr != 0) + +extern void joystick_init(void); +extern void joystick_close(void); +extern void joystick_process(void); + #ifdef __cplusplus } #endif diff --git a/src/plat_midi.h b/src/plat_midi.h index b1b93b5e2..1d167c475 100644 --- a/src/plat_midi.h +++ b/src/plat_midi.h @@ -1,7 +1,8 @@ -void plat_midi_init(); -void plat_midi_close(); -void plat_midi_play_msg(uint8_t* val); -void plat_midi_play_sysex(uint8_t* data, unsigned int len); -int plat_midi_write(uint8_t val); -int plat_midi_get_num_devs(); -void plat_midi_get_dev_name(int num, char *s); +extern void plat_midi_init(void); +extern void plat_midi_close(void); + +extern void plat_midi_play_msg(uint8_t* val); +extern void plat_midi_play_sysex(uint8_t* data, unsigned int len); +extern int plat_midi_write(uint8_t val); +extern int plat_midi_get_num_devs(); +extern void plat_midi_get_dev_name(int num, char *s); diff --git a/src/plat_serial.h b/src/plat_serial.h deleted file mode 100644 index dc3fc338b..000000000 --- a/src/plat_serial.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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. - * - * Definitions for the Bottom Half of the SERIAL card. - * - * Version: @(#)plat_serial.h 1.0.5 2017/06/04 - * - * Author: Fred N. van Kempen, - * Copyright 2017 Fred N. van Kempen. - */ -#ifndef PLAT_SERIAL_H -# define PLAT_SERIAL_H - - -typedef struct { - char name[80]; /* name of open port */ - void (*rd_done)(void *, int); - void *rd_arg; -#ifdef PLAT_SERIAL_C - HANDLE handle; - OVERLAPPED rov, /* READ and WRITE events */ - wov; - int tmo; /* current timeout value */ - DCB dcb, /* terminal settings */ - odcb; - thread_t *tid; /* pointer to receiver thread */ - char buff[1024]; - int icnt, ihead, itail; -#endif -} BHTTY; - - -extern BHTTY *bhtty_open(char *__port, int __tmo); -extern void bhtty_close(BHTTY *); -extern int bhtty_flush(BHTTY *); -extern void bhtty_raw(BHTTY *, void *__arg); -extern int bhtty_speed(BHTTY *, long __speed); -extern int bhtty_params(BHTTY *, char __dbit, char __par, char __sbit); -extern int bhtty_sstate(BHTTY *, void *__arg); -extern int bhtty_gstate(BHTTY *, void *__arg); -extern int bhtty_crtscts(BHTTY *, char __yesno); -extern int bhtty_active(BHTTY *, int); -extern int bhtty_write(BHTTY *, unsigned char); -extern int bhtty_read(BHTTY *, unsigned char *, int); - - -#endif /*PLAT_SERIAL_H*/ diff --git a/src/serial.c b/src/serial.c index 7e70a6cae..828513109 100644 --- a/src/serial.c +++ b/src/serial.c @@ -23,6 +23,7 @@ enum }; SERIAL serial1, serial2; +int serial_do_log = 0; void serial_reset() diff --git a/src/serial.h b/src/serial.h index f127d74f0..9c637d160 100644 --- a/src/serial.h +++ b/src/serial.h @@ -17,7 +17,7 @@ # define EMU_SERIAL_H -#ifdef WALTJE +#ifdef WALTJE_SERIAL /* Default settings for the standard ports. */ #define SERIAL1_ADDR 0x03f8 #define SERIAL1_IRQ 4 @@ -114,4 +114,4 @@ extern SERIAL serial1, serial2; #endif -#endif /*EMU_SERIAL_H*/ \ No newline at end of file +#endif /*EMU_SERIAL_H*/ diff --git a/src/video/vid_colorplus.c b/src/video/vid_colorplus.c index 6c24a04e0..6af4e1b81 100644 --- a/src/video/vid_colorplus.c +++ b/src/video/vid_colorplus.c @@ -8,7 +8,7 @@ * * Plantronics ColorPlus emulation. * - * Version: @(#)vid_colorplus.c 1.0.6 2017/11/04 + * Version: @(#)vid_colorplus.c 1.0.7 2017/11/14 * * Authors: Sarah Walker, * Miran Grca, diff --git a/src/video/vid_hercules.c b/src/video/vid_hercules.c index cee5283f1..188e4ea9e 100644 --- a/src/video/vid_hercules.c +++ b/src/video/vid_hercules.c @@ -8,7 +8,7 @@ * * Hercules emulation. * - * Version: @(#)vid_hercules.c 1.0.7 2017/11/04 + * Version: @(#)vid_hercules.c 1.0.8 2017/11/14 * * Authors: Sarah Walker, * Miran Grca, diff --git a/src/video/vid_herculesplus.c b/src/video/vid_herculesplus.c index efe0ede30..282a1bb38 100644 --- a/src/video/vid_herculesplus.c +++ b/src/video/vid_herculesplus.c @@ -8,7 +8,7 @@ * * Hercules InColor emulation. * - * Version: @(#)vid_herculesplus.c 1.0.5 2017/11/04 + * Version: @(#)vid_herculesplus.c 1.0.6 2017/11/14 * * Authors: Sarah Walker, * Miran Grca, diff --git a/src/video/vid_incolor.c b/src/video/vid_incolor.c index 983d062a6..b3a81fca7 100644 --- a/src/video/vid_incolor.c +++ b/src/video/vid_incolor.c @@ -8,7 +8,7 @@ * * Hercules InColor emulation. * - * Version: @(#)vid_incolor.c 1.0.6 2017/11/04 + * Version: @(#)vid_incolor.c 1.0.7 2017/11/14 * * Authors: Sarah Walker, * Miran Grca, diff --git a/src/video/vid_mda.c b/src/video/vid_mda.c index 4f15830dd..655ac231c 100644 --- a/src/video/vid_mda.c +++ b/src/video/vid_mda.c @@ -8,7 +8,7 @@ * * MDA emulation. * - * Version: @(#)vid_mda.c 1.0.8 2017/11/04 + * Version: @(#)vid_mda.c 1.0.9 2017/11/14 * * Authors: Sarah Walker, * Miran Grca, diff --git a/src/win/Makefile.mingw b/src/win/Makefile.mingw index 6d179d0fa..a39ae9f4e 100644 --- a/src/win/Makefile.mingw +++ b/src/win/Makefile.mingw @@ -8,7 +8,7 @@ # # Makefile for Win32 (MinGW32) environment. # -# Version: @(#)Makefile.mingw 1.0.76 2017/11/12 +# Version: @(#)Makefile.mingw 1.0.77 2017/11/17 # # Authors: Miran Grca, # Fred N. van Kempen, @@ -272,6 +272,46 @@ EUROPC := m_europc.o endif +ifeq ($(WX), y) +CFLAGS += -I$(WXLIB)/wx/include/msw-unicode-3.0 -I$(WXINC) \ + -D__WXMSW__ -DWX_PRECOMP -D_FILE_OFFSET_BITS=64 +# -lwx_mswu_gl-3.0.dll -llzma +WXLIBS := -mwindows -mthreads \ + -L$(WXLIB) \ + -lwx_mswu-3.0.dll \ + -lrpcrt4 -loleaut32 -lole32 -luuid \ + -lwinspool -lwinmm -lshell32 -lcomctl32 \ + -lcomdlg32 -ladvapi32 -lwsock32 -lgdi32 +endif + +ifeq ($(WX), static) +CFLAGS += -I$(WXLIB)/wx/include/msw-unicode-3.0 -I$(WXINC) \ + -D__WXMSW__ -DWX_PRECOMP -D_FILE_OFFSET_BITS=64 +# -lwx_mswu_gl-3.0 -lwxtiff-3.0 -llzma +WXLIBS := -mwindows -mthreads \ + -L$(WXLIB) \ + -lwx_mswu-3.0 -lwxscintilla-3.0 \ + -lwxjpeg-3.0 -lwxpng-3.0 -lwxzlib-3.0 \ + -lwxregexu-3.0 -lwxexpat-3.0 \ + -lrpcrt4 -loleaut32 -lole32 -luuid \ + -lwinspool -lwinmm -lshell32 -lcomctl32 \ + -lcomdlg32 -ladvapi32 -lwsock32 -lgdi32 +endif + + +# Final versions of the toolchain flags. +#CFLAGS := $(WX_FLAGS) $(OPTS) $(DFLAGS) $(COPTIM) $(AOPTIM) \ +# $(AFLAGS) -fomit-frame-pointer -mstackrealign -Wall +#CXXFLAGS := $(WX_FLAGS) $(OPTS) $(DFLAGS) $(AOPTIM) \ +# $(AFLAGS) -fno-strict-aliasing -fvisibility=hidden \ +# -Wall -Wundef -fvisibility-inlines-hidden \ +# -Wunused-parameter -Wno-ctor-dtor-privacy \ +# -Woverloaded-virtual + + +######################################################################### +# Create the (final) list of objects to build. # +######################################################################### MAINOBJ := pc.o config.o random.o timer.o io.o dma.o nmi.o pic.o \ pit.o ppi.o pci.o mca.o mcr.o mem.o memregs.o rom.o \ device.o nvr.o nvr_at.o nvr_ps2.o $(VNCOBJ) $(RDPOBJ) \ @@ -481,6 +521,12 @@ ifneq ($(DEBUG), y) @strip pcap_if.exe endif +hello.exe: hello.o + $(CXX) $(LDFLAGS) -o hello.exe hello.o $(WXLIBS) $(LIBS) +ifneq ($(DEBUG), y) + @strip hello.exe +endif + clean: @echo Cleaning objects.. diff --git a/src/plat_dir.h b/src/win/plat_dir.h similarity index 100% rename from src/plat_dir.h rename to src/win/plat_dir.h diff --git a/src/win/win_opendir.c b/src/win/win_opendir.c index af0c6e768..bcd683c3d 100644 --- a/src/win/win_opendir.c +++ b/src/win/win_opendir.c @@ -10,7 +10,7 @@ * * Based on old original code @(#)dir_win32.c 1.2.0 2007/04/19 * - * Version: @(#)win_opendir.c 1.0.3 2017/10/16 + * Version: @(#)win_opendir.c 1.0.4 2017/11/18 * * Author: Fred N. van Kempen, * @@ -27,7 +27,7 @@ #include #include "../86box.h" #include "../plat.h" -#include "../plat_dir.h" +#include "plat_dir.h" #ifdef UNICODE