Merge remote-tracking branch 'upstream/master' into feature/machine_cdpmpc

This commit is contained in:
Jasmine Iwanek
2023-08-23 05:51:20 -04:00
242 changed files with 13878 additions and 10117 deletions

View File

@@ -38,6 +38,9 @@
/* Default language 0xFFFF = from system, 0x409 = en-US */
#define DEFAULT_LANGUAGE 0x0409
#define POSTCARDS_NUM 4
#define POSTCARD_MASK (POSTCARDS_NUM - 1)
#ifdef MIN
# undef MIN
#endif
@@ -127,8 +130,8 @@ extern int isamem_type[]; /* (C) enable ISA mem cards */
extern int isartc_type; /* (C) enable ISA RTC card */
extern int sound_is_float; /* (C) sound uses FP values */
extern int voodoo_enabled; /* (C) video option */
extern int ibm8514_enabled; /* (C) video option */
extern int xga_enabled; /* (C) video option */
extern int ibm8514_standalone_enabled; /* (C) video option */
extern int xga_standalone_enabled; /* (C) video option */
extern uint32_t mem_size; /* (C) memory size (Installed on system board) */
extern uint32_t isa_mem_size; /* (C) memory size (ISA Memory Cards) */
extern int cpu; /* (C) cpu type */
@@ -142,8 +145,6 @@ extern int confirm_exit; /* (C) enable exit confirmation */
extern int confirm_save; /* (C) enable save confirmation */
extern int enable_discord; /* (C) enable Discord integration */
extern int is_pentium; /* TODO: Move back to cpu/cpu.h when it's figured out,
how to remove that hack from the ET4000/W32p. */
extern int fixed_size_x;
extern int fixed_size_y;
extern double mouse_sensitivity; /* (C) Mouse sensitivity scale */
@@ -178,7 +179,7 @@ extern void reset_screen_size_monitor(int monitor_index);
extern void set_screen_size_natural(void);
extern void update_mouse_msg(void);
#if 0
extern void pc_reload(wchar_t *fn);
extern void pc_reload(wchar_t *fn);
#endif
extern int pc_init_modules(void);
extern int pc_init(int argc, char *argv[]);
@@ -207,7 +208,8 @@ extern double isa_timing;
extern int io_delay;
extern int framecountx;
extern volatile int cpu_thread_run;
extern volatile int cpu_thread_run;
extern uint8_t postcard_codes[POSTCARDS_NUM];
#ifdef __cplusplus
}

View File

@@ -1,5 +1,5 @@
/*
* 86Box A hypervisor and IBM PC system emulator that specializes in
* 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.

View File

@@ -60,12 +60,14 @@ enum {
CDROM_BUS_USB = 8
};
#define KNOWN_CDROM_DRIVE_TYPES 35
#define BUS_TYPE_ALL 0
#define BUS_TYPE_IDE 1
#define BUS_TYPE_SCSI 2
#define KNOWN_CDROM_DRIVE_TYPES 35
#define BUS_TYPE_IDE CDROM_BUS_ATAPI
#define BUS_TYPE_SCSI CDROM_BUS_SCSI
#define BUS_TYPE_BOTH -2
#define BUS_TYPE_NONE -1
static const struct {
static const struct
{
const char vendor[9];
const char model[17];
const char revision[5];
@@ -73,7 +75,7 @@ static const struct {
const char *internal_name;
const int bus_type;
} cdrom_drive_types[] = {
{ "86BOX", "CD-ROM", "1.00", "(ATAPI/SCSI) 86BOX CD-ROM 1.00", "86BOX_CD-ROM_1.00", BUS_TYPE_ALL }, /*1*/
{ "86BOX", "CD-ROM", "1.00", "(ATAPI/SCSI) 86BOX CD-ROM 1.00", "86BOX_CD-ROM_1.00", BUS_TYPE_BOTH }, /*1*/
{ "AZT", "CDA46802I", "1.15", "(ATAPI) AZT CDA46802I 1.15", "AZT_CDA46802I_1.15", BUS_TYPE_IDE }, /*2*/
{ "BTC", "CD-ROM BCD36XH", "U1.0", "(ATAPI) BTC CD-ROM BCD36XH U1.0", "BTC_CD-ROM_BCD36XH_U1.0", BUS_TYPE_IDE }, /*3*/
{ "GOLDSTAR", "CRD-8160B", "3.14", "(ATAPI) GOLDSTAR CRD-8160B 3.14", "GOLDSTAR_CRD-8160B_3.14", BUS_TYPE_IDE }, /*4*/
@@ -108,7 +110,7 @@ static const struct {
{ "TOSHIBA", "CD-ROM DRIVE:XM", "3433", "(SCSI) TOSHIBA CD-ROM DRIVE:XM 3433", "TOSHIBA_CD-ROM_DRIVEXM_3433", BUS_TYPE_SCSI }, /*33*/
{ "TOSHIBA", "CD-ROM XM-3301TA", "0272", "(SCSI) TOSHIBA CD-ROM XM-3301TA 0272", "TOSHIBA_CD-ROM_XM-3301TA_0272", BUS_TYPE_SCSI }, /*34*/
{ "TOSHIBA", "CD-ROM XM-5701TA", "3136", "(SCSI) TOSHIBA CD-ROM XM-5701TA 3136", "TOSHIBA_CD-ROM_XM-5701TA_3136", BUS_TYPE_SCSI }, /*35*/
{ "", "", "", "", "", -1 },
{ "", "", "", "", "", BUS_TYPE_NONE },
};
/* To shut up the GCC compilers. */

View File

@@ -1,18 +1,18 @@
/*
* 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.
* 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.
* This file is part of the 86Box distribution.
*
* Definitions for the common CD-ROM interface controller handler.
* Definitions for the common CD-ROM interface controller handler.
*
*
*
* Authors: TheCollector1995
* Authors: TheCollector1995
*
* Copyright 2022 TheCollector1995.
* Copyright 2022 TheCollector1995.
*/
#ifndef EMU_CDROM_INTERFACE_H
#define EMU_CDROM_INTERFACE_H

View File

@@ -111,6 +111,8 @@ extern const device_t opti283_device;
extern const device_t opti291_device;
extern const device_t opti493_device;
extern const device_t opti495_device;
extern const device_t opti601_device;
extern const device_t opti602_device;
extern const device_t opti802g_device;
extern const device_t opti802g_pci_device;
extern const device_t opti822_device;

View File

@@ -58,19 +58,26 @@
enum {
DEVICE_PCJR = 2, /* requires an IBM PCjr */
DEVICE_AT = 4, /* requires an AT-compatible system */
DEVICE_PS2 = 8, /* requires a PS/1 or PS/2 system */
DEVICE_ISA = 0x10, /* requires the ISA bus */
DEVICE_CBUS = 0x20, /* requires the C-BUS bus */
DEVICE_MCA = 0x40, /* requires the MCA bus */
DEVICE_EISA = 0x80, /* requires the EISA bus */
DEVICE_VLB = 0x100, /* requires the PCI bus */
DEVICE_PCI = 0x200, /* requires the VLB bus */
DEVICE_AGP = 0x400, /* requires the AGP bus */
DEVICE_AC97 = 0x800, /* requires the AC'97 bus */
DEVICE_COM = 0x1000, /* requires a serial port */
DEVICE_LPT = 0x2000, /* requires a parallel port */
DEVICE_KBC = 0x4000, /* is a keyboard controller */
DEVICE_XTKBC = 4, /* requires an XT-compatible keyboard controller */
DEVICE_AT = 8, /* requires an AT-compatible system */
DEVICE_ATKBC = 0x10, /* requires an AT-compatible keyboard controller */
DEVICE_PS2 = 0x20, /* requires a PS/1 or PS/2 system */
DEVICE_ISA = 0x40, /* requires the ISA bus */
DEVICE_CBUS = 0x80, /* requires the C-BUS bus */
DEVICE_PCMCIA = 0x100, /* requires the PCMCIA bus */
DEVICE_MCA = 0x200, /* requires the MCA bus */
DEVICE_HIL = 0x400, /* requires the HP HIL bus */
DEVICE_EISA = 0x800, /* requires the EISA bus */
DEVICE_OLB = 0x1000, /* requires the OPTi local bus */
DEVICE_VLB = 0x2000, /* requires the VLB bus */
DEVICE_PCI = 0x4000, /* requires the PCI bus */
DEVICE_CARDBUS = 0x8000, /* requires the CardBus bus */
DEVICE_USB = 0x10000, /* requires the USB bus */
DEVICE_AGP = 0x20000, /* requires the AGP bus */
DEVICE_AC97 = 0x40000, /* requires the AC'97 bus */
DEVICE_COM = 0x80000, /* requires a serial port */
DEVICE_LPT = 0x100000, /* requires a parallel port */
DEVICE_KBC = 0x200000, /* is a keyboard controller */
DEVICE_EXTPARAMS = 0x40000000, /* accepts extended parameters */

68
src/include/86box/fifo.h Normal file
View File

@@ -0,0 +1,68 @@
/*
* 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.
*
* FIFO infrastructure header.
*
* Authors: Miran Grca, <mgrca8@gmail.com>
*
* Copyright 2023 Miran Grca.
*/
#define FIFO(size) \
typedef struct \
{ \
int start, end, \
trigger_len, len, \
empty, overrun, \
full, ready, \
d_empty, d_overrun, \
d_full, d_ready; \
\
void *priv; \
\
void (*d_empty_evt)(void *); \
void (*d_overrun_evt)(void *); \
void (*d_full_evt)(void *); \
void (*d_ready_evt)(void *); \
\
uint8_t buf[size]; \
} fifo## size ##_t;
FIFO()
FIFO(16)
#define fifo16_init() fifo_init(16)
FIFO(64)
#define fifo64_init() fifo_init(64)
extern int fifo_get_count(void *priv);
extern void fifo_write(uint8_t val, void *priv);
extern void fifo_write_evt(uint8_t val, void *priv);
extern uint8_t fifo_read(void *priv);
extern uint8_t fifo_read_evt(void *priv);
extern void fifo_clear_overrun(void *priv);
extern int fifo_get_full(void *priv);
extern int fifo_get_d_full(void *priv);
extern int fifo_get_empty(void *priv);
extern int fifo_get_d_empty(void *priv);
extern int fifo_get_overrun(void *priv);
extern int fifo_get_d_overrun(void *priv);
extern int fifo_get_ready(void *priv);
extern int fifo_get_d_ready(void *priv);
extern int fifo_get_trigger_len(void *priv);
extern void fifo_set_trigger_len(void *priv, int trigger_len);
extern void fifo_set_len(void *priv, int len);
extern void fifo_set_d_full_evt(void *priv, void (*d_full_evt)(void *));
extern void fifo_set_d_empty_evt(void *priv, void (*d_empty_evt)(void *));
extern void fifo_set_d_overrun_evt(void *priv, void (*d_overrun_evt)(void *));
extern void fifo_set_d_ready_evt(void *priv, void (*d_ready_evt)(void *));
extern void fifo_set_priv(void *priv, void *sub_priv);
extern void fifo_reset(void *priv);
extern void fifo_reset_evt(void *priv);
extern void fifo_close(void *priv);
extern void * fifo_init(int len);

View File

@@ -24,6 +24,16 @@
#define MAX_PLAT_JOYSTICKS 8
#define MAX_JOYSTICKS 4
#define JS_TYPE_NONE 0
#define JS_TYPE_2AXIS_4BUTTON 1
#define JS_TYPE_2AXIS_6BUTTON 2
#define JS_TYPE_2AXIS_8BUTTON 3
#define JS_TYPE_4AXIS_4BUTTON 4
#define JS_TYPE_CH_FLIGHTSTICK_PRO 5
#define JS_TYPE_SIDEWINDER_PAD 6
#define JS_TYPE_THRUSTMASTER_FCS 7
#define POV_X 0x80000000
#define POV_Y 0x40000000
#define SLIDER 0x20000000
@@ -84,11 +94,11 @@ typedef struct joystick_if_t {
const char *internal_name;
void *(*init)(void);
void (*close)(void *p);
uint8_t (*read)(void *p);
void (*write)(void *p);
int (*read_axis)(void *p, int axis);
void (*a0_over)(void *p);
void (*close)(void *priv);
uint8_t (*read)(void *priv);
void (*write)(void *priv);
int (*read_axis)(void *priv, int axis);
void (*a0_over)(void *priv);
int axis_count;
int button_count;
@@ -133,16 +143,16 @@ extern void joystick_init(void);
extern void joystick_close(void);
extern void joystick_process(void);
extern char *joystick_get_name(int js);
extern char *joystick_get_internal_name(int js);
extern int joystick_get_from_internal_name(char *s);
extern int joystick_get_max_joysticks(int js);
extern int joystick_get_axis_count(int js);
extern int joystick_get_button_count(int js);
extern int joystick_get_pov_count(int js);
extern char *joystick_get_axis_name(int js, int id);
extern char *joystick_get_button_name(int js, int id);
extern char *joystick_get_pov_name(int js, int id);
extern const char *joystick_get_name(int js);
extern const char *joystick_get_internal_name(int js);
extern int joystick_get_from_internal_name(char *s);
extern int joystick_get_max_joysticks(int js);
extern int joystick_get_axis_count(int js);
extern int joystick_get_button_count(int js);
extern int joystick_get_pov_count(int js);
extern const char *joystick_get_axis_name(int js, int id);
extern const char *joystick_get_button_name(int js, int id);
extern const char *joystick_get_pov_name(int js, int id);
extern void gameport_update_joystick_type(void);
extern void gameport_remap(void *priv, uint16_t address);

View File

@@ -53,13 +53,13 @@ extern void lpt1_remove_ams(void);
#define lpt4_remove() lpt_port_remove(3)
#if 0
#define lpt5_init(a) lpt_port_init(4, a)
#define lpt5_irq(a) lpt_port_irq(4, a)
#define lpt5_remove() lpt_port_remove(4)
#define lpt5_init(a) lpt_port_init(4, a)
#define lpt5_irq(a) lpt_port_irq(4, a)
#define lpt5_remove() lpt_port_remove(4)
#define lpt6_init(a) lpt_port_init(5, a)
#define lpt6_irq(a) lpt_port_irq(5, a)
#define lpt6_remove() lpt_port_remove(5)
#define lpt6_init(a) lpt_port_init(5, a)
#define lpt6_irq(a) lpt_port_irq(5, a)
#define lpt6_remove() lpt_port_remove(5)
#endif
void lpt_devices_init(void);

View File

@@ -12,11 +12,11 @@
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com>
* Sarah Walker, <https://pcem-emulator.co.uk/>
* John Elliott, <jce@seasip.info>
*
* Copyright 2017-2018 Fred N. van Kempen.
* Copyright 2016-2018 Miran Grca.
* Copyright 2008-2018 Sarah Walker.
* Copyright 2008-2018 John Elliott.
*
* 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

View File

@@ -12,11 +12,11 @@
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com>
* Sarah Walker, <https://pcem-emulator.co.uk/>
* John Elliott, <jce@seasip.info>
*
* Copyright 2017-2018 Fred N. van Kempen.
* Copyright 2016-2018 Miran Grca.
* Copyright 2008-2018 Sarah Walker.
* Copyright 2008-2018 John Elliott.
*
* 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

View File

@@ -28,18 +28,25 @@
#define MACHINE_BUS_ISA 0x00000001 /* sys has ISA bus */
#define MACHINE_BUS_CASSETTE 0x00000002 /* sys has cassette port */
#define MACHINE_BUS_CARTRIDGE 0x00000004 /* sys has two cartridge bays */
#define MACHINE_BUS_ISA16 0x00000008 /* sys has ISA16 bus - PC/AT architecture */
#define MACHINE_BUS_CBUS 0x00000010 /* sys has C-BUS bus */
#define MACHINE_BUS_PS2_LATCH 0x00000020 /* system has PS/2 keyboard controller IRQ latch */
#define MACHINE_BUS_PS2_PORTS 0x00000040 /* system has PS/2 keyboard and mouse ports */
#define MACHINE_BUS_PCJR 0x00000008 /* sys has PCjr sidecar bus */
#define MACHINE_BUS_DM_KBC 0x00000010 /* system has keyboard controller that supports
both XT and AT keyboards */
#define MACHINE_BUS_ISA16 0x00000020 /* sys has ISA16 bus - PC/AT architecture */
#define MACHINE_BUS_CBUS 0x00000040 /* sys has C-BUS bus */
#define MACHINE_BUS_PCMCIA 0x00000080 /* sys has PCMCIA bus */
#define MACHINE_BUS_PS2_LATCH 0x00000100 /* system has PS/2 keyboard controller IRQ latch */
#define MACHINE_BUS_PS2_PORTS 0x00000200 /* system has PS/2 keyboard and mouse ports */
#define MACHINE_BUS_PS2 (MACHINE_BUS_PS2_LATCH | MACHINE_BUS_PS2_PORTS)
#define MACHINE_BUS_EISA 0x00000080 /* sys has EISA bus */
#define MACHINE_BUS_VLB 0x00000100 /* sys has VL bus */
#define MACHINE_BUS_MCA 0x00000200 /* sys has MCA bus */
#define MACHINE_BUS_PCI 0x00000400 /* sys has PCI bus */
#define MACHINE_BUS_PCMCIA 0x00000800 /* sys has PCMCIA bus */
#define MACHINE_BUS_AGP 0x00001000 /* sys has AGP bus */
#define MACHINE_BUS_AC97 0x00002000 /* sys has AC97 bus (ACR/AMR/CNR slot) */
#define MACHINE_BUS_HIL 0x00000400 /* system has HP HIL keyboard and mouse ports */
#define MACHINE_BUS_EISA 0x00000800 /* sys has EISA bus */
#define MACHINE_BUS_OLB 0x00001000 /* sys has OPTi local bus */
#define MACHINE_BUS_VLB 0x00002000 /* sys has VL bus */
#define MACHINE_BUS_MCA 0x00004000 /* sys has MCA bus */
#define MACHINE_BUS_PCI 0x00008000 /* sys has PCI bus */
#define MACHINE_BUS_CARDBUS 0x00010000 /* sys has CardBus bus */
#define MACHINE_BUS_USB 0x00020000 /* sys has USB bus */
#define MACHINE_BUS_AGP 0x00040000 /* sys has AGP bus */
#define MACHINE_BUS_AC97 0x00080000 /* sys has AC97 bus (ACR/AMR/CNR slot) */
/* Aliases. */
#define MACHINE_CASSETTE (MACHINE_BUS_CASSETTE) /* sys has cassette port */
#define MACHINE_CARTRIDGE (MACHINE_BUS_CARTRIDGE) /* sys has two cartridge bays */
@@ -73,61 +80,65 @@
#define MACHINE_PS2_NOISA (MACHINE_PS2_AGP & ~MACHINE_AT) /* sys is AGP PS/2 without ISA */
#define MACHINE_PS2_NOI97 (MACHINE_PS2_A97 & ~MACHINE_AT) /* sys is AGP/AC97 PS/2 without ISA */
/* Feature flags for miscellaneous internal devices. */
#define MACHINE_FLAGS_NONE 0x00000000 /* sys has no int devices */
#define MACHINE_VIDEO 0x00000001 /* sys has int video */
#define MACHINE_VIDEO_ONLY 0x00000002 /* sys has fixed video */
#define MACHINE_MOUSE 0x00000004 /* sys has int mouse */
#define MACHINE_FDC 0x00000008 /* sys has int FDC */
#define MACHINE_LPT_PRI 0x00000010 /* sys has int pri LPT */
#define MACHINE_LPT_SEC 0x00000020 /* sys has int sec LPT */
#define MACHINE_UART_PRI 0x00000040 /* sys has int pri UART */
#define MACHINE_UART_SEC 0x00000080 /* sys has int sec UART */
#define MACHINE_UART_TER 0x00000100 /* sys has int ter UART */
#define MACHINE_UART_QUA 0x00000200 /* sys has int qua UART */
#define MACHINE_GAMEPORT 0x00000400 /* sys has int game port */
#define MACHINE_SOUND 0x00000800 /* sys has int sound */
#define MACHINE_NIC 0x00001000 /* sys has int NIC */
#define MACHINE_MODEM 0x00002000 /* sys has int modem */
#define MACHINE_FLAGS_NONE 0x00000000 /* sys has no int devices */
#define MACHINE_SOFTFLOAT_ONLY 0x00000001 /* sys requires SoftFloat FPU */
#define MACHINE_VIDEO 0x00000002 /* sys has int video */
#define MACHINE_VIDEO_8514A 0x00000004 /* sys has int video */
#define MACHINE_VIDEO_XGA 0x00000008 /* sys has int video */
#define MACHINE_VIDEO_ONLY 0x00000010 /* sys has fixed video */
#define MACHINE_MOUSE 0x00000020 /* sys has int mouse */
#define MACHINE_FDC 0x00000040 /* sys has int FDC */
#define MACHINE_LPT_PRI 0x00000080 /* sys has int pri LPT */
#define MACHINE_LPT_SEC 0x00000100 /* sys has int sec LPT */
#define MACHINE_LPT_TER 0x00000200 /* sys has int ter LPT */
#define MACHINE_LPT_QUA 0x00000400 /* sys has int qua LPT */
#define MACHINE_UART_PRI 0x00000800 /* sys has int pri UART */
#define MACHINE_UART_SEC 0x00001000 /* sys has int sec UART */
#define MACHINE_UART_TER 0x00002000 /* sys has int ter UART */
#define MACHINE_UART_QUA 0x00004000 /* sys has int qua UART */
#define MACHINE_GAMEPORT 0x00008000 /* sys has int game port */
#define MACHINE_SOUND 0x00010000 /* sys has int sound */
#define MACHINE_NIC 0x00020000 /* sys has int NIC */
#define MACHINE_MODEM 0x00040000 /* sys has int modem */
/* Feature flags for advanced devices. */
#define MACHINE_APM 0x00004000 /* sys has APM */
#define MACHINE_ACPI 0x00008000 /* sys has ACPI */
#define MACHINE_HWM 0x00010000 /* sys has hw monitor */
/* Combined flags. */
#define MACHINE_VIDEO_FIXED (MACHINE_VIDEO | MACHINE_VIDEO_ONLY) /* sys has fixed int video */
#define MACHINE_SUPER_IO (MACHINE_FDC | MACHINE_LPT_PRI | MACHINE_UART_PRI | MACHINE_UART_SEC)
#define MACHINE_SUPER_IO_GAME (MACHINE_SUPER_IO | MACHINE_GAMEPORT)
#define MACHINE_SUPER_IO_DUAL (MACHINE_SUPER_IO | MACHINE_LPT_SEC | MACHINE_UART_TER | MACHINE_UART_QUA)
#define MACHINE_AV (MACHINE_VIDEO | MACHINE_SOUND) /* sys has video and sound */
#define MACHINE_AG (MACHINE_SOUND | MACHINE_GAMEPORT) /* sys has sound and game port */
#define MACHINE_APM 0x00080000 /* sys has APM */
#define MACHINE_ACPI 0x00100000 /* sys has ACPI */
#define MACHINE_HWM 0x00200000 /* sys has hw monitor */
#define MACHINE_COREBOOT 0x00400000 /* sys has coreboot BIOS */
/* Feature flags for internal storage controllers. */
#define MACHINE_HDC 0x03FE0000 /* sys has int HDC */
#define MACHINE_MFM 0x00020000 /* sys has int MFM/RLL */
#define MACHINE_XTA 0x00040000 /* sys has int XTA */
#define MACHINE_ESDI 0x00080000 /* sys has int ESDI */
#define MACHINE_IDE_PRI 0x00100000 /* sys has int pri IDE/ATAPI */
#define MACHINE_IDE_SEC 0x00200000 /* sys has int sec IDE/ATAPI */
#define MACHINE_IDE_TER 0x00400000 /* sys has int ter IDE/ATAPI */
#define MACHINE_IDE_QUA 0x00800000 /* sys has int qua IDE/ATAPI */
#define MACHINE_SCSI_PRI 0x01000000 /* sys has int pri SCSI */
#define MACHINE_SCSI_SEC 0x02000000 /* sys has int sec SCSI */
#define MACHINE_USB_PRI 0x04000000 /* sys has int pri USB */
#define MACHINE_USB_SEC 0x08000000 /* sys has int sec USB */
#define MACHINE_COREBOOT 0x10000000 /* sys has coreboot BIOS */
#define MACHINE_SOFTFLOAT_ONLY 0x20000000 /* sys requires softfloat FPU */
#define MACHINE_MFM 0x00800000 /* sys has int MFM/RLL */
#define MACHINE_XTA 0x01000000 /* sys has int XTA */
#define MACHINE_ESDI 0x02000000 /* sys has int ESDI */
#define MACHINE_IDE_PRI 0x04000000 /* sys has int pri IDE/ATAPI */
#define MACHINE_IDE_SEC 0x08000000 /* sys has int sec IDE/ATAPI */
#define MACHINE_IDE_TER 0x10000000 /* sys has int ter IDE/ATAPI */
#define MACHINE_IDE_QUA 0x20000000 /* sys has int qua IDE/ATAPI */
#define MACHINE_SCSI 0x40000000 /* sys has int SCSI */
#define MACHINE_USB 0x80000000 /* sys has int USB */
/* Combined flags. */
#define MACHINE_IDE (MACHINE_IDE_PRI) /* sys has int single IDE/ATAPI - mark as pri IDE/ATAPI */
#define MACHINE_IDE_DUAL (MACHINE_IDE_PRI | MACHINE_IDE_SEC) /* sys has int dual IDE/ATAPI - mark as both pri and sec IDE/ATAPI */
#define MACHINE_IDE_DUALTQ (MACHINE_IDE_TER | MACHINE_IDE_QUA)
#define MACHINE_IDE_QUAD (MACHINE_IDE_DUAL | MACHINE_IDE_DUALTQ) /* sys has int quad IDE/ATAPI - mark as dual + both ter and and qua IDE/ATAPI */
#define MACHINE_SCSI (MACHINE_SCSI_PRI) /* sys has int single SCSI - mark as pri SCSI */
#define MACHINE_SCSI_DUAL (MACHINE_SCSI_PRI | MACHINE_SCSI_SEC) /* sys has int dual SCSI - mark as both pri and sec SCSI */
#define MACHINE_USB (MACHINE_USB_PRI)
#define MACHINE_USB_DUAL (MACHINE_USB_PRI | MACHINE_USB_SEC)
#define MACHINE_LPT (MACHINE_LPT-PRI | MACHINE_LPT_SEC | \
MACHINE_LPT_TER | MACHINE_LPT_QUA)
#define MACHINE_UART (MACHINE_UART_PRI | MACHINE_UART_SEC | \
MACHINE_UART_TER | MACHINE_UART_QUA)
#define MACHINE_VIDEO_FIXED (MACHINE_VIDEO | MACHINE_VIDEO_ONLY) /* sys has fixed int video */
#define MACHINE_SUPER_IO (MACHINE_FDC | MACHINE_LPT_PRI | MACHINE_UART_PRI | MACHINE_UART_SEC)
#define MACHINE_SUPER_IO_GAME (MACHINE_SUPER_IO | MACHINE_GAMEPORT)
#define MACHINE_SUPER_IO_DUAL (MACHINE_SUPER_IO | MACHINE_LPT_SEC | \
MACHINE_UART_TER | MACHINE_UART_QUA)
#define MACHINE_AV (MACHINE_VIDEO | MACHINE_SOUND) /* sys has video and sound */
#define MACHINE_AG (MACHINE_SOUND | MACHINE_GAMEPORT) /* sys has sound and game port */
/* Combined flag for internal storage controllerss. */
#define MACHINE_IDE (MACHINE_IDE_PRI) /* sys has int single IDE/ATAPI - mark as pri IDE/ATAPI */
#define MACHINE_IDE_DUAL (MACHINE_IDE_PRI | MACHINE_IDE_SEC) /* sys has int dual IDE/ATAPI - mark as both pri and sec IDE/ATAPI */
#define MACHINE_IDE_DUALTQ (MACHINE_IDE_TER | MACHINE_IDE_QUA)
#define MACHINE_IDE_QUAD (MACHINE_IDE_DUAL | MACHINE_IDE_DUALTQ) /* sys has int quad IDE/ATAPI - mark as dual + both ter and and qua IDE/ATAPI */
#define MACHINE_HDC (MACHINE_MFM | MACHINE_XTA | \
MACHINE_ESDI | MACHINE_IDE_QUAD | \
MACHINE_SCSI | MACHINE_USB)
/* Special combined flags. */
#define MACHINE_PIIX (MACHINE_IDE_DUAL)
#define MACHINE_PIIX3 (MACHINE_PIIX | MACHINE_USB)
/* TODO: ACPI flag. */
#define MACHINE_PIIX4 (MACHINE_PIIX3 | MACHINE_ACPI)
#define MACHINE_PIIX (MACHINE_IDE_DUAL)
#define MACHINE_PIIX3 (MACHINE_PIIX | MACHINE_USB)
#define MACHINE_PIIX4 (MACHINE_PIIX3 | MACHINE_ACPI)
#define IS_ARCH(m, a) ((machines[m].bus_flags & (a)) ? 1 : 0)
#define IS_AT(m) (((machines[m].bus_flags & (MACHINE_BUS_ISA16 | MACHINE_BUS_EISA | MACHINE_BUS_VLB | MACHINE_BUS_MCA | MACHINE_BUS_PCI | MACHINE_BUS_PCMCIA | MACHINE_BUS_AGP | MACHINE_BUS_AC97)) && !(machines[m].bus_flags & MACHINE_PC98)) ? 1 : 0)
@@ -303,8 +314,8 @@ typedef struct _machine_ {
void *kbc_device;
#endif /* EMU_DEVICE_H */
/* Bits:
7-0 Set bits are forced set on P1 (no forced set = 0x00);
15-8 Clear bits are forced clear on P1 (no foced clear = 0xff). */
7-0 Set bits are forced set on P1 (no forced set = 0x00);
15-8 Clear bits are forced clear on P1 (no foced clear = 0xff). */
uint16_t kbc_p1;
uint32_t gpio;
uint32_t gpio_acpi;
@@ -545,7 +556,7 @@ extern int machine_at_portableii_init(const machine_t *);
extern int machine_at_portableiii_init(const machine_t *);
extern int machine_at_portableiii386_init(const machine_t *);
extern int machine_at_deskpro386_init(const machine_t *);
extern int machine_at_deskpro386_01_1988_init(const machine_t *);
extern int machine_at_deskpro386_05_1988_init(const machine_t *);
/* m_at_socket4.c */
extern void machine_at_premiere_common_init(const machine_t *, int);

View File

@@ -27,6 +27,8 @@
#define MO_TIME 10.0
#define MO_IMAGE_HISTORY 4
typedef struct mo_type_t {
uint32_t sectors;
uint16_t bytes_per_sector;
@@ -113,6 +115,8 @@ typedef struct mo_drive_t {
char image_path[1024];
char prev_image_path[1024];
char *image_history[MO_IMAGE_HISTORY];
uint32_t type;
uint32_t medium_size;
uint32_t base;

View File

@@ -65,7 +65,7 @@ extern const device_t mouse_logibus_device;
extern const device_t mouse_logibus_onboard_device;
extern const device_t mouse_msinport_device;
# ifdef USE_GENIBUS
extern const device_t mouse_genibus_device;
extern const device_t mouse_genibus_device;
# endif
extern const device_t mouse_mssystems_device;
extern const device_t mouse_msserial_device;

View File

@@ -11,7 +11,7 @@
*
*
*
* Based on @(#)Dev3C501.cpp Oracle (VirtualBox)
* Based on @(#)Dev3C501.cpp Oracle (VirtualBox)
*
* Authors: TheCollector1995, <mariogplayer@gmail.com>
* Oracle

View File

@@ -85,6 +85,7 @@ extern int nvr_dosave;
#ifdef EMU_DEVICE_H
extern const device_t at_nvr_old_device;
extern const device_t at_nvr_device;
extern const device_t at_mb_nvr_device;
extern const device_t ps_nvr_device;
extern const device_t amstrad_nvr_device;
extern const device_t amstrad_megapc_nvr_device;
@@ -126,5 +127,8 @@ extern void nvr_via_wp_set(int set, int reg, nvr_t *nvr);
extern void nvr_bank_set(int base, uint8_t bank, nvr_t *nvr);
extern void nvr_lock_set(int base, int size, int lock, nvr_t *nvr);
extern void nvr_irq_set(int irq, nvr_t *nvr);
extern void nvr_smi_enable(int enable, nvr_t *nvr);
extern uint8_t nvr_smi_status(nvr_t *nvr);
extern void nvr_smi_status_clear(nvr_t *nvr);
#endif /*EMU_NVR_H*/

View File

@@ -3,5 +3,6 @@ extern char *path_get_filename(char *s);
extern char *path_get_extension(char *s);
extern void path_append_filename(char *dest, const char *s1, const char *s2);
extern void path_slash(char *path);
extern char *path_get_slash(char *path);
extern void path_normalize(char *path);
extern int path_abs(char *path);

View File

@@ -49,21 +49,12 @@ extern int strnicmp(const char *s1, const char *s2, size_t n);
# define ftello64 ftello
# define off64_t off_t
#elif defined(_MSC_VER)
// # define fopen64 fopen
// # define fopen64 fopen
# define fseeko64 _fseeki64
# define ftello64 _ftelli64
# define off64_t off_t
#endif
#if __has_attribute(fallthrough)
# define fallthrough __attribute__((fallthrough))
#else
# if __has_attribute(__fallthrough__)
# define fallthrough __attribute__((__fallthrough__))
# endif
# define fallthrough do {} while (0) /* fallthrough */
#endif
#ifdef _MSC_VER
# define UNUSED(arg) arg
#else
@@ -89,6 +80,19 @@ extern "C" {
# define ssize_t intptr_t
#endif
#ifdef _MSC_VER
# define fallthrough do {} while (0) /* fallthrough */
#else
# if __has_attribute(fallthrough)
# define fallthrough __attribute__((fallthrough))
# else
# if __has_attribute(__fallthrough__)
# define fallthrough __attribute__((__fallthrough__))
# endif
# define fallthrough do {} while (0) /* fallthrough */
# endif
#endif
/* Global variables residing in the platform module. */
extern int dopause; /* system is paused */
extern int mouse_capture; /* mouse is captured in app */

View File

@@ -40,23 +40,23 @@ struct dirent {
# define d_namlen d_reclen
typedef struct DIR_t {
short flags; /* internal flags */
short offset; /* offset of entry into dir */
long handle; /* open handle to Win32 system */
short sts; /* last known status code */
char *dta; /* internal work data */
short flags; /* internal flags */
short offset; /* offset of entry into dir */
long handle; /* open handle to Win32 system */
short sts; /* last known status code */
char *dta; /* internal work data */
# ifdef UNICODE
wchar_t dir[MAXDIRLEN + 1]; /* open dir */
wchar_t dir[MAXDIRLEN + 1]; /* open dir */
# else
char dir[MAXDIRLEN + 1]; /* open dir */
char dir[MAXDIRLEN + 1]; /* open dir */
# endif
struct dirent dent; /* actual directory entry */
struct dirent dent; /* actual directory entry */
} DIR;
/* Directory routine flags. */
# define DIR_F_LOWER 0x0001 /* force to lowercase */
# define DIR_F_SANE 0x0002 /* force this to sane path */
# define DIR_F_ISROOT 0x0010 /* this is the root directory */
# define DIR_F_LOWER 0x0001 /* force to lowercase */
# define DIR_F_SANE 0x0002 /* force this to sane path */
# define DIR_F_ISROOT 0x0010 /* this is the root directory */
/* Function prototypes. */
extern DIR *opendir(const char *);

View File

@@ -18,13 +18,17 @@
#ifndef EMU_PLAT_FALLTHROUGH_H
#define EMU_PLAT_FALLTHROUGH_H
#if __has_attribute(__fallthrough__)
# define fallthrough __attribute__((__fallthrough__))
#ifdef _MSC_VER
# define fallthrough do {} while (0) /* fallthrough */
#else
# if __has_attribute(fallthrough)
# define fallthrough __attribute__((fallthrough))
# else
# if __has_attribute(__fallthrough__)
# define fallthrough __attribute__((__fallthrough__))
# endif
# define fallthrough do {} while (0) /* fallthrough */
# endif
# define fallthrough do {} while (0) /* fallthrough */
#endif
#endif /*EMU_PLAT_FALLTHROUGH_H*/

View File

@@ -67,7 +67,7 @@
#define IDT_CPU_SPEED 1710 /* CPU speed: */
#define IDT_FPU 1711 /* FPU: */
#define IDT_WAIT_STATES 1712 /* Wait states: */
#define IDT_MB 1713 /* MB == IDC_TEXT_MB */
#define IDT_MB 1713 /* MB == IDC_TEXT_MB */
#define IDT_MEMORY 1714 /* Memory: */
/* DLG_CFG_VIDEO */

View File

@@ -1,18 +1,18 @@
/*
* 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.
* 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.
* This file is part of the 86Box distribution.
*
* Definitions for the SMRAM interface.
* Definitions for the SMRAM interface.
*
*
*
* Authors: Miran Grca, <mgrca8@gmail.com>
* Authors: Miran Grca, <mgrca8@gmail.com>
*
* Copyright 2016-2020 Miran Grca.
* Copyright 2016-2020 Miran Grca.
*/
#ifndef EMU_ROW_H
@@ -43,4 +43,4 @@ extern void row_set_boundary(uint8_t row_id, uint32_t boundary);
extern device_t row_device;
#endif /*EMU_ROW_H*/
#endif /*EMU_ROW_H*/

View File

@@ -30,32 +30,32 @@
#define NVR_SIZE 256 /* size of NVR */
/* EEPROM map and bit definitions. */
#define EE0_HOSTID 0x07 /* EE(0) [2:0] */
#define EE0_ALTFLOP 0x80 /* EE(0) [7] FDC at 370h */
#define EE1_IRQCH 0x07 /* EE(1) [3:0] */
#define EE1_DMACH 0x70 /* EE(1) [7:4] */
#define EE2_RMVOK 0x01 /* EE(2) [0] Support removable disks */
#define EE2_HABIOS 0x02 /* EE(2) [1] HA Bios Space Reserved */
#define EE2_INT19 0x04 /* EE(2) [2] HA Bios Controls INT19 */
#define EE2_DYNSCAN 0x08 /* EE(2) [3] Dynamically scan bus */
#define EE2_TWODRV 0x10 /* EE(2) [4] Allow more than 2 drives */
#define EE2_SEEKRET 0x20 /* EE(2) [5] Immediate return on seek */
#define EE2_EXT1G 0x80 /* EE(2) [7] Extended Translation >1GB */
#define EE3_SPEED 0x00 /* EE(3) [7:0] DMA Speed */
#define EE0_HOSTID 0x07 /* EE(0) [2:0] */
#define EE0_ALTFLOP 0x80 /* EE(0) [7] FDC at 370h */
#define EE1_IRQCH 0x07 /* EE(1) [3:0] */
#define EE1_DMACH 0x70 /* EE(1) [7:4] */
#define EE2_RMVOK 0x01 /* EE(2) [0] Support removable disks */
#define EE2_HABIOS 0x02 /* EE(2) [1] HA Bios Space Reserved */
#define EE2_INT19 0x04 /* EE(2) [2] HA Bios Controls INT19 */
#define EE2_DYNSCAN 0x08 /* EE(2) [3] Dynamically scan bus */
#define EE2_TWODRV 0x10 /* EE(2) [4] Allow more than 2 drives */
#define EE2_SEEKRET 0x20 /* EE(2) [5] Immediate return on seek */
#define EE2_EXT1G 0x80 /* EE(2) [7] Extended Translation >1GB */
#define EE3_SPEED 0x00 /* EE(3) [7:0] DMA Speed */
#define SPEED_33 0xFF
#define SPEED_50 0x00
#define SPEED_56 0x04
#define SPEED_67 0x01
#define SPEED_80 0x02
#define SPEED_10 0x03
#define EE4_FLOPTOK 0x80 /* EE(4) [7] Support Flopticals */
#define EE6_PARITY 0x01 /* EE(6) [0] parity check enable */
#define EE6_TERM 0x02 /* EE(6) [1] host term enable */
#define EE6_RSTBUS 0x04 /* EE(6) [2] reset SCSI bus on boot */
#define EEE_SYNC 0x01 /* EE(E) [0] Enable Sync Negotiation */
#define EEE_DISCON 0x02 /* EE(E) [1] Enable Disconnection */
#define EEE_FAST 0x04 /* EE(E) [2] Enable FAST SCSI */
#define EEE_START 0x08 /* EE(E) [3] Enable Start Unit */
#define EE4_FLOPTOK 0x80 /* EE(4) [7] Support Flopticals */
#define EE6_PARITY 0x01 /* EE(6) [0] parity check enable */
#define EE6_TERM 0x02 /* EE(6) [1] host term enable */
#define EE6_RSTBUS 0x04 /* EE(6) [2] reset SCSI bus on boot */
#define EEE_SYNC 0x01 /* EE(E) [0] Enable Sync Negotiation */
#define EEE_DISCON 0x02 /* EE(E) [1] Enable Disconnection */
#define EEE_FAST 0x04 /* EE(E) [2] Enable FAST SCSI */
#define EEE_START 0x08 /* EE(E) [3] Enable Start Unit */
/*
* Host Adapter I/O ports.
@@ -166,11 +166,11 @@
#define FOURTEEN_BYTES 0x00 /* Request Sense Buffer size */
#define NO_AUTO_REQUEST_SENSE 0x01 /* No Request Sense Buffer */
/* Bytes 4, 5 and 6 Data Length - Data transfer byte count */
/* Bytes 7, 8 and 9 Data Pointer - SGD List or Data Buffer */
/* Bytes 10, 11 and 12 Link Pointer - Next CCB in Linked List */
/* Byte 13 Command Link ID - TBD (I don't know yet) */
/* Byte 14 Host Status - Host Adapter status */
/* Bytes 4, 5 and 6 Data Length - Data transfer byte count */
/* Bytes 7, 8 and 9 Data Pointer - SGD List or Data Buffer */
/* Bytes 10, 11 and 12 Link Pointer - Next CCB in Linked List */
/* Byte 13 Command Link ID - TBD (I don't know yet) */
/* Byte 14 Host Status - Host Adapter status */
#define CCB_COMPLETE 0x00 /* CCB completed without error */
#define CCB_LINKED_COMPLETE 0x0A /* Linked command completed */
#define CCB_LINKED_COMPLETE_INT 0x0B /* Linked complete with intr */

View File

@@ -65,29 +65,21 @@ typedef struct serial_s {
uint8_t inst;
uint8_t transmit_enabled;
uint8_t fifo_enabled;
uint8_t rcvr_fifo_len;
uint8_t bits;
uint8_t data_bits;
uint8_t baud_cycles;
uint8_t rcvr_fifo_full;
uint8_t txsr;
uint8_t out;
uint8_t txsr_empty;
uint8_t msr_set;
uint8_t pad;
uint8_t irq_state;
uint8_t pad0;
uint16_t dlab;
uint16_t base_address;
uint16_t out_new;
uint16_t pad1;
uint16_t thr_empty;
uint8_t rcvr_fifo_pos;
uint8_t xmit_fifo_pos;
uint8_t rcvr_fifo_end;
uint8_t xmit_fifo_end;
uint8_t rcvr_fifo[SERIAL_FIFO_SIZE];
uint8_t xmit_fifo[SERIAL_FIFO_SIZE];
void *rcvr_fifo;
void *xmit_fifo;
pc_timer_t transmit_timer;
pc_timer_t timeout_timer;

View File

@@ -668,11 +668,11 @@ Short Delay Short Delay + Feedback
// Chorus Params
typedef struct {
WORD FbkLevel; // Feedback Level (0xE600-0xE6FF)
WORD Delay; // Delay (0-0x0DA3) [1/44100 sec]
WORD LfoDepth; // LFO Depth (0xBC00-0xBCFF)
DWORD DelayR; // Right Delay (0-0xFFFFFFFF) [1/256/44100 sec]
DWORD LfoFreq; // LFO Frequency (0-0xFFFFFFFF)
WORD FbkLevel; // Feedback Level (0xE600-0xE6FF)
WORD Delay; // Delay (0-0x0DA3) [1/44100 sec]
WORD LfoDepth; // LFO Depth (0xBC00-0xBCFF)
DWORD DelayR; // Right Delay (0-0xFFFFFFFF) [1/256/44100 sec]
DWORD LfoFreq; // LFO Frequency (0-0xFFFFFFFF)
} CHORUS_TYPE;

View File

@@ -8,7 +8,7 @@
*
* Definitions for the NukedOPL3 driver.
*
* Version: @(#)snd_opl_nuked.h 1.0.5 2020/07/16
* Version: @(#)snd_opl_nuked.h 1.0.5 2020/07/16
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com>

View File

@@ -7,6 +7,7 @@
#define MAX_USEC64 1000000ULL
#define MAX_USEC 1000000.0
#define TIMER_PROCESS 4
#define TIMER_SPLIT 2
#define TIMER_ENABLED 1
@@ -117,6 +118,13 @@ timer_is_enabled(pc_timer_t *timer)
return !!(timer->flags & TIMER_ENABLED);
}
/*True if timer currently on*/
static __inline int
timer_is_on(pc_timer_t *timer)
{
return ((timer->flags & TIMER_SPLIT) && (timer->flags & TIMER_ENABLED));
}
/*Return integer timestamp of timer*/
static __inline uint32_t
timer_get_ts_int(pc_timer_t *timer)
@@ -176,45 +184,8 @@ timer_set_p(pc_timer_t *timer, void *priv)
/* The API for big timer periods starts here. */
extern void timer_stop(pc_timer_t *timer);
extern void timer_advance_ex(pc_timer_t *timer, int start);
extern void timer_on(pc_timer_t *timer, double period, int start);
extern void timer_on_auto(pc_timer_t *timer, double period);
extern void timer_remove_head(void);
extern pc_timer_t *timer_head;
extern int timer_inited;
static __inline void
timer_process_inline(void)
{
pc_timer_t *timer;
if (!timer_head)
return;
while (1) {
timer = timer_head;
if (!TIMER_LESS_THAN_VAL(timer, (uint32_t) tsc))
break;
timer_head = timer->next;
if (timer_head)
timer_head->prev = NULL;
timer->next = timer->prev = NULL;
timer->flags &= ~TIMER_ENABLED;
if (timer->flags & TIMER_SPLIT)
timer_advance_ex(timer, 0); /* We're splitting a > 1 s period into multiple <= 1 s periods. */
else if (timer->callback != NULL) /* Make sure it's no NULL, so that we can have a NULL callback when no operation is needed. */
timer->callback(timer->priv);
}
timer_target = timer_head->ts.ts32.integer;
}
#ifdef __cplusplus
}
#endif

View File

@@ -1,18 +1,18 @@
/*
* 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.
* 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.
* This file is part of the 86Box distribution.
*
* Definitions for the Distributed DMA emulation.
* Definitions for the Distributed DMA emulation.
*
*
*
* Authors: Miran Grca, <mgrca8@gmail.com>
* Authors: Miran Grca, <mgrca8@gmail.com>
*
* Copyright 2020 Miran Grca.
* Copyright 2020 Miran Grca.
*/
#ifndef USB_H
@@ -22,188 +22,21 @@
extern "C" {
#endif
typedef struct usb_t usb_t;
typedef struct usb_device_t usb_device_t;
enum usb_pid
typedef struct
{
USB_PID_OUT = 0xE1,
USB_PID_IN = 0x69,
USB_PID_SETUP = 0x2D
};
enum usb_errors
{
USB_ERROR_NO_ERROR = 0,
USB_ERROR_NAK = 1,
USB_ERROR_OVERRUN = 2,
USB_ERROR_UNDERRUN = 3
};
enum usb_bus_types
{
USB_BUS_OHCI = 0,
USB_BUS_UHCI = 1,
USB_BUS_MAX = 2
};
/* USB device creation parameters struct */
typedef struct usb_params_t
{
void (*update_interrupt)(usb_t*, void*);
/* Handle (but do not raise) SMI. Returns 1 if SMI can be raised, 0 otherwise. */
uint8_t (*smi_handle)(usb_t*, void*);
void* parent_priv;
} usb_params_t;
typedef union {
uint32_t l;
uint16_t w[2];
uint8_t b[4];
} ohci_mmio_t;
/* USB Host Controller device struct */
typedef struct usb_t {
uint8_t uhci_io[32];
ohci_mmio_t ohci_mmio[1024];
uint8_t uhci_io[32], ohci_mmio[4096];
uint16_t uhci_io_base;
int uhci_enable;
int ohci_enable;
int uhci_enable, ohci_enable;
uint32_t ohci_mem_base;
uint32_t irq_level;
mem_mapping_t ohci_mmio_mapping;
pc_timer_t ohci_frame_timer;
pc_timer_t ohci_port_reset_timer[2];
uint8_t ohci_interrupt_counter : 3;
usb_device_t *ohci_devices[2];
usb_device_t *uhci_devices[2];
uint8_t ohci_usb_buf[4096];
uint8_t ohci_initial_start;
usb_params_t *usb_params;
} usb_t;
#pragma pack(push, 1)
/* Base USB descriptor struct. */
typedef struct usb_desc_base_t {
uint8_t bLength;
uint8_t bDescriptorType;
} usb_desc_base_t;
enum usb_desc_setup_req_types {
USB_SETUP_TYPE_DEVICE = 0x0,
USB_SETUP_TYPE_INTERFACE = 0x1,
USB_SETUP_TYPE_ENDPOING = 0x2,
USB_SETUP_TYPE_OTHER = 0x3,
};
#define USB_SETUP_TYPE_MAX 0x1F
#define USB_SETUP_DEV_TO_HOST 0x80
typedef struct usb_desc_setup_t {
uint8_t bmRequestType;
uint8_t bRequest;
uint16_t wValue;
uint16_t wIndex;
uint16_t wLength;
} usb_desc_setup_t;
typedef struct usb_desc_endpoint_t {
usb_desc_base_t base;
uint8_t bEndpointAddress;
uint8_t bmAttributes;
uint16_t wMaxPacketSize;
uint8_t bInterval;
} usb_desc_endpoint_t;
typedef struct usb_desc_hid_t {
usb_desc_base_t base;
uint16_t bcdHID;
uint8_t bCountryCode;
uint8_t bNumDescriptors;
uint8_t bDescriptorType;
uint16_t wDescriptorLength;
} usb_desc_hid_t;
typedef struct usb_desc_interface_t {
usb_desc_base_t base;
uint8_t bInterfaceNumber;
uint8_t bAlternateSetting;
uint8_t bNumEndpoints;
uint8_t bInterfaceClass;
uint8_t bInterfaceSubClass;
uint8_t bInterfaceProtocol;
uint8_t iInterface;
} usb_desc_interface_t;
typedef struct usb_desc_string_t {
usb_desc_base_t base;
uint16_t bString[];
} usb_desc_string_t;
typedef struct usb_desc_conf_t {
usb_desc_base_t base;
uint16_t wTotalLength;
uint8_t bNumInterfaces;
uint8_t bConfigurationValue;
uint8_t iConfiguration;
uint8_t bmAttributes;
uint8_t bMaxPower;
} usb_desc_conf_t;
typedef struct usb_desc_device_t {
usb_desc_base_t base;
uint16_t bcdUSB;
uint8_t bDeviceClass;
uint8_t bDeviceSubClass;
uint8_t bDeviceProtocol;
uint8_t bMaxPacketSize;
uint16_t idVendor;
uint16_t idProduct;
uint16_t bcdDevice;
uint8_t iManufacturer;
uint8_t iProduct;
uint8_t iSerialNumber;
uint8_t bNumConfigurations;
} usb_desc_device_t;
#pragma pack(pop)
/* USB endpoint device struct. Incomplete and unused. */
typedef struct usb_device_t {
usb_desc_device_t device_desc;
struct {
usb_desc_conf_t conf_desc;
usb_desc_base_t* other_descs[16];
} conf_desc_items;
/* General-purpose function for I/O. Non-zero value indicates error. */
uint8_t (*device_process)(void* priv, uint8_t* data, uint32_t *len, uint8_t pid_token, uint8_t endpoint, uint8_t underrun_not_allowed);
/* Device reset. */
void (*device_reset)(void* priv);
/* Get address. */
uint8_t (*device_get_address)(void* priv);
void* priv;
} usb_device_t;
/* Global variables. */
extern const device_t usb_device;
extern usb_t* usb_device_inst;
/* Functions. */
extern void uhci_update_io_mapping(usb_t *dev, uint8_t base_l, uint8_t base_h, int enable);
extern void ohci_update_mem_mapping(usb_t *dev, uint8_t base1, uint8_t base2, uint8_t base3, int enable);
/* Attach USB device to a port of a USB bus. Returns the port to which it got attached to. */
extern uint8_t usb_attach_device(usb_t *dev, usb_device_t* device, uint8_t bus_type);
/* Detach USB device from a port. */
extern void usb_detach_device(usb_t *dev, uint8_t port, uint8_t bus_type);
#ifdef __cplusplus
}

View File

@@ -42,6 +42,8 @@ typedef struct ibm8514_t {
int type;
int local;
int bpp;
int on;
int accel_bpp;
uint32_t vram_size;
uint32_t vram_mask;

View File

@@ -21,6 +21,7 @@ typedef struct mda_t {
int firstline;
int lastline;
int fontbase;
int linepos;
int displine;
int vc;

View File

@@ -11,14 +11,10 @@
*
*
*
* Authors: Sarah Walker, <https://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>
* Authors: Miran Grca, <mgrca8@gmail.com>
* EngiNerd, <webmaster.crrc@yahoo.it>
*
* Copyright 2008-2019 Sarah Walker.
* Copyright 2016-2019 Miran Grca.
* Copyright 2017-2019 Fred N. van Kempen.
* Copyright 2020 EngiNerd.
*/

View File

@@ -11,14 +11,10 @@
*
*
*
* Authors: Sarah Walker, <https://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>
* Authors: Miran Grca, <mgrca8@gmail.com>
* EngiNerd, <webmaster.crrc@yahoo.it>
*
* Copyright 2008-2019 Sarah Walker.
* Copyright 2016-2019 Miran Grca.
* Copyright 2017-2019 Fred N. van Kempen.
* Copyright 2020 EngiNerd.
*/

View File

@@ -156,12 +156,12 @@ extern void pgc_sto_raster(pgc_t *, int16_t *x, int16_t *y);
extern void pgc_ito_raster(pgc_t *, int32_t *x, int32_t *y);
extern void pgc_dto_raster(pgc_t *, double *x, double *y);
#if 0
extern int pgc_input_byte(pgc_t *, uint8_t *val);
extern int pgc_output_byte(pgc_t *, uint8_t val);
extern int pgc_input_byte(pgc_t *, uint8_t *val);
extern int pgc_output_byte(pgc_t *, uint8_t val);
#endif
extern int pgc_output_string(pgc_t *, const char *val);
#if 0
extern int pgc_error_byte(pgc_t *, uint8_t val);
extern int pgc_error_byte(pgc_t *, uint8_t val);
#endif
extern int pgc_error_string(pgc_t *, const char *val);
extern int pgc_error(pgc_t *, int err);

View File

@@ -182,6 +182,7 @@ typedef struct svga_t {
hwcursor_t overlay_latch;
void (*render)(struct svga_t *svga);
void (*render8514)(struct svga_t *svga);
void (*recalctimings_ex)(struct svga_t *svga);
void (*video_out)(uint16_t addr, uint8_t val, void *priv);
@@ -271,7 +272,6 @@ typedef struct svga_t {
} svga_t;
extern int vga_on;
extern int ibm8514_on;
extern void ibm8514_poll(ibm8514_t *dev, svga_t *svga);
extern void ibm8514_recalctimings(svga_t *svga);

View File

@@ -1,18 +1,18 @@
/*
* 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.
* 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.
* This file is part of the 86Box distribution.
*
* 3DFX Voodoo emulation.
* 3DFX Voodoo emulation.
*
*
*
* Authors: Sarah Walker, <https://pcem-emulator.co.uk/>
* Authors: Sarah Walker, <https://pcem-emulator.co.uk/>
*
* Copyright 2008-2020 Sarah Walker.
* Copyright 2008-2020 Sarah Walker.
*/
#ifndef VIDEO_VOODOO_BLITTER_H

File diff suppressed because it is too large Load Diff

View File

@@ -17,7 +17,6 @@
#ifndef VIDEO_XGA_DEVICE_H
#define VIDEO_XGA_DEVICE_H
extern int xga_has_vga;
#ifdef EMU_DEVICE_H
extern const device_t xga_device;

View File

@@ -152,7 +152,7 @@ extern int changeframecount;
extern volatile int screenshots;
#if 0
extern bitmap_t *buffer32;
extern bitmap_t *buffer32;
#endif
#define buffer32 (monitors[monitor_index_global].target_buffer)
#define pal_lookup (monitors[monitor_index_global].mon_pal_lookup)
@@ -179,7 +179,7 @@ extern bitmap_t *buffer32;
extern PALETTE cgapal;
extern PALETTE cgapal_mono[6];
#if 0
extern uint32_t pal_lookup[256];
extern uint32_t pal_lookup[256];
#endif
extern int video_fullscreen;
extern int video_fullscreen_scale;
@@ -208,7 +208,8 @@ extern double cpuclock;
extern int emu_fps;
extern int frames;
extern int readflash;
extern int ibm8514_has_vga;
extern int ibm8514_active;
extern int xga_active;
/* Function handler pointers. */
extern void (*video_recalctimings)(void);
@@ -352,6 +353,7 @@ extern const device_t gd5429_vlb_device;
extern const device_t gd5430_diamond_speedstar_pro_se_a8_vlb_device;
extern const device_t gd5430_vlb_device;
extern const device_t gd5430_pci_device;
extern const device_t gd5430_onboard_pci_device;
extern const device_t gd5434_isa_device;
extern const device_t gd5434_diamond_speedstar_64_a3_isa_device;
extern const device_t gd5434_onboard_pci_device;

View File

@@ -29,6 +29,8 @@
#define ZIP_250_SECTORS (489532)
#define ZIP_IMAGE_HISTORY 4
enum {
ZIP_BUS_DISABLED = 0,
ZIP_BUS_ATAPI = 5,
@@ -61,6 +63,8 @@ typedef struct zip_drive_t {
char image_path[1024];
char prev_image_path[1024];
char *image_history[ZIP_IMAGE_HISTORY];
uint32_t is_250;
uint32_t medium_size;
uint32_t base;