General cleanup.
This commit is contained in:
@@ -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, <decwiz@yahoo.com>
|
||||
*/
|
||||
@@ -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; b<len; b++)
|
||||
#ifdef WALTJE
|
||||
serial_write_fifo(ms->serial, 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);
|
||||
|
||||
|
31
src/pc.c
31
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, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -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
|
||||
|
11
src/plat.h
11
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, <mgrca8@gmail.com>
|
||||
* Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
@@ -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;
|
||||
|
@@ -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
|
||||
|
@@ -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);
|
||||
|
@@ -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, <decwiz@yahoo.com>
|
||||
* 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*/
|
@@ -23,6 +23,7 @@ enum
|
||||
};
|
||||
|
||||
SERIAL serial1, serial2;
|
||||
int serial_do_log = 0;
|
||||
|
||||
|
||||
void serial_reset()
|
||||
|
@@ -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*/
|
||||
#endif /*EMU_SERIAL_H*/
|
||||
|
@@ -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, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
|
@@ -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, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
|
@@ -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, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
|
@@ -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, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
|
@@ -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, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
|
@@ -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, <mgrca8@gmail.com>
|
||||
# Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
@@ -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..
|
||||
|
@@ -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, <decwiz@yahoo.com>
|
||||
*
|
||||
@@ -27,7 +27,7 @@
|
||||
#include <wchar.h>
|
||||
#include "../86box.h"
|
||||
#include "../plat.h"
|
||||
#include "../plat_dir.h"
|
||||
#include "plat_dir.h"
|
||||
|
||||
|
||||
#ifdef UNICODE
|
||||
|
Reference in New Issue
Block a user