WARNING: CONFIGS MIGHT PARTIALLY BREAK WHERE DEVICE NAMES HAVE CHANGED.

Changes to device_t struct to accomodate the upcoming PCI IRQ arbitration rewrite;
Added device.c/h API to obtain name from the device_t struct;
Significant changes to win/win_settings.c to clean up the code a bit and fix bugs;
Ported all the CPU and AudioPCI commits from PCem;
Added an API call to allow ACPI soft power off to gracefully stop the emulator;
Removed the Siemens PCD-2L from the Dev branch because it now works;
Removed the Socket 5 HP Vectra from the Dev branch because it now works;
Fixed the Compaq Presario and the Micronics Spitfire;
Give the IBM PC330 its own list of 486 CPU so it can have DX2's with CPUID 0x470;
SMM fixes;
Rewrote the SYSENTER, SYSEXIT, SYSCALL, and SYSRET instructions;
Changed IDE reset period to match the specification, fixes #929;
The keyboard input and output ports are now forced in front of the queue when read, fixes a number of bugs, including the AMI Apollo hanging on soft reset;
Added the Intel AN430TX but Dev branched because it does not work;
The network code no longer drops packets if the emulated network card has failed to receive them (eg. when the buffer is full);
Changes to PCI card adding and renamed some PCI slot types, also added proper AGP bridge slot types;
USB UHCI emulation is no longer a stub (still doesn't fully work, but at least Windows XP chk with Debug no longer ASSERT's on it);
Fixed NVR on the the SMC FDC37C932QF and APM variants;
A number of fixes to Intel 4x0 chipsets, including fixing every register of the 440LX and 440EX;
Some ACPI changes.
This commit is contained in:
OBattler
2020-11-16 00:01:21 +01:00
parent 745460f64b
commit 0faf6692c9
260 changed files with 5122 additions and 4471 deletions

View File

@@ -75,7 +75,8 @@ typedef struct
typedef struct
{
acpi_regs_t regs;
uint8_t gporeg_default[4];
uint8_t gpireg2_default, pad[3],
gporeg_default[4];
uint16_t io_base, aux_io_base;
int vendor,
slot, irq_mode,
@@ -102,6 +103,7 @@ extern void acpi_set_slot(acpi_t *dev, int slot);
extern void acpi_set_irq_mode(acpi_t *dev, int irq_mode);
extern void acpi_set_irq_pin(acpi_t *dev, int irq_pin);
extern void acpi_set_irq_line(acpi_t *dev, int irq_line);
extern void acpi_set_gpireg2_default(acpi_t *dev, uint8_t gpireg2_default);
extern void acpi_set_nvr(acpi_t *dev, nvr_t *nvr);
#ifdef __cplusplus

View File

@@ -90,11 +90,15 @@ typedef struct {
} cdrom_ops_t;
typedef struct cdrom {
uint8_t id,
res, res0, /* Reserved for other ID's. */
res1,
ide_channel, scsi_device_id,
bus_type, /* 0 = ATAPI, 1 = SCSI */
uint8_t id;
union {
uint8_t res, res0, /* Reserved for other ID's. */
res1,
ide_channel, scsi_device_id;
};
uint8_t bus_type, /* 0 = ATAPI, 1 = SCSI */
bus_mode, /* Bit 0 = PIO suported;
Bit 1 = DMA supportd. */
cd_status, /* Struct variable reserved for

View File

@@ -55,16 +55,17 @@
enum {
DEVICE_NOT_WORKING = 1, /* does not currently work correctly and will be disabled in a release build */
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_LPT = 2, /* requires a parallel port */
DEVICE_PCJR = 4, /* requires an IBM PCjr */
DEVICE_AT = 8, /* requires an AT-compatible system */
DEVICE_PS2 = 0x10, /* requires a PS/1 or PS/2 system */
DEVICE_ISA = 0x20, /* requires the ISA bus */
DEVICE_CBUS = 0x40, /* requires the C-BUS bus */
DEVICE_MCA = 0x80, /* requires the MCA bus */
DEVICE_EISA = 0x100, /* requires the EISA bus */
DEVICE_VLB = 0x200, /* requires the PCI bus */
DEVICE_PCI = 0x400, /* requires the VLB bus */
DEVICE_AGP = 0x800 /* requires the AGP bus */
};
@@ -74,14 +75,9 @@ typedef struct {
} device_config_selection_t;
typedef struct {
const char *description;
const char *extensions[5];
} device_config_file_filter_t;
typedef struct {
int min;
int max;
int step;
int16_t min;
int16_t max;
int16_t step;
} device_config_spinner_t;
typedef struct {
@@ -90,9 +86,9 @@ typedef struct {
int type;
const char *default_string;
int default_int;
device_config_selection_t selection[16];
device_config_file_filter_t file_filter[16];
const char *file_filter;
device_config_spinner_t spinner;
const device_config_selection_t selection[16];
} device_config_t;
typedef struct _device_ {
@@ -103,7 +99,11 @@ typedef struct _device_ {
void *(*init)(const struct _device_ *);
void (*close)(void *priv);
void (*reset)(void *priv);
int (*available)(/*void*/);
union {
int (*available)(void);
int (*poll)(int x, int y, int z, int b, void *priv);
void (*register_pci_slot)(int device, int type, int inta, int intb, int intc, int intd, void *priv);
};
void (*speed_changed)(void *priv);
void (*force_redraw)(void *priv);
@@ -138,8 +138,11 @@ extern void device_reset_all(void);
extern void device_reset_all_pci(void);
extern void *device_get_priv(const device_t *d);
extern int device_available(const device_t *d);
extern int device_poll(const device_t *d, int x, int y, int z, int b);
extern void device_register_pci_slot(const device_t *d, int device, int type, int inta, int intb, int intc, int intd);
extern void device_speed_changed(void);
extern void device_force_redraw(void);
extern void device_get_name(const device_t *d, int bus, char *name);
extern int device_is_valid(const device_t *, int machine_flags);

View File

@@ -32,7 +32,6 @@ extern const device_t fdc_pii158b_device;
extern void fdc_card_init(void);
extern char *fdc_card_getname(int card);
extern char *fdc_card_get_internal_name(int card);
extern int fdc_card_get_from_internal_name(char *s);
extern const device_t *fdc_card_getdevice(int card);

View File

@@ -24,6 +24,7 @@
#define ESDI_NUM 2 /* 2 drives per controller supported */
#define XTA_NUM 2 /* 2 drives per controller supported */
#define IDE_NUM 10 /* 8 drives per AT IDE + 2 for XT IDE */
#define ATAPI_NUM 8 /* 8 drives per AT IDE */
#define SCSI_NUM 16 /* theoretically the controller can have at
* least 7 devices, with each device being
* able to support 8 units, but hey... */
@@ -73,9 +74,7 @@ extern const device_t xtide_at_ps2_device; /* xtide_at_ps2 */
extern void hdc_init(void);
extern void hdc_reset(void);
extern char *hdc_get_name(int hdc);
extern char *hdc_get_internal_name(int hdc);
extern int hdc_get_id(char *s);
extern int hdc_get_from_internal_name(char *s);
extern int hdc_has_config(int hdc);
extern const device_t *hdc_get_device(int hdc);

View File

@@ -19,7 +19,7 @@
# define EMU_HDD_H
#define HDD_NUM 30 /* total of 30 images supported */
#define HDD_NUM 40 /* total of 40 images supported */
/* Hard Disk bus types. */
@@ -76,11 +76,15 @@ enum {
/* Define the virtual Hard Disk. */
typedef struct {
uint8_t id;
uint8_t mfm_channel; /* Should rename and/or unionize */
uint8_t esdi_channel;
uint8_t xta_channel;
uint8_t ide_channel;
uint8_t scsi_id;
union {
uint8_t channel; /* Needed for Settings to reduce the number of if's */
uint8_t mfm_channel; /* Should rename and/or unionize */
uint8_t esdi_channel;
uint8_t xta_channel;
uint8_t ide_channel;
uint8_t scsi_id;
};
uint8_t bus,
res; /* Reserved for bus mode */
uint8_t wp; /* Disk has been mounted READ-ONLY */

View File

@@ -58,8 +58,7 @@ extern "C" {
/* Functions. */
extern void isartc_reset(void);
extern char *isartc_get_name(int t);
extern char *isartc_get_internal_name(int t);
extern char *isartc_get_internal_name(int t);
extern int isartc_get_from_internal_name(char *s);
extern const device_t *isartc_get_device(int t);

View File

@@ -226,9 +226,7 @@ extern int machine_at_ibmatquadtel_init(const machine_t *); // IBM AT with Quadt
extern int machine_at_ibmxt286_init(const machine_t *);
#if defined(DEV_BRANCH) && defined(USE_SIEMENS)
extern int machine_at_siemens_init(const machine_t *); //Siemens PCD-2L. N82330 discrete machine. It segfaults in some places
#endif
#if defined(DEV_BRANCH) && defined(USE_OPEN_AT)
extern int machine_at_open_at_init(const machine_t *);
@@ -372,14 +370,13 @@ extern int machine_at_endeavor_init(const machine_t *);
extern int machine_at_zappa_init(const machine_t *);
extern int machine_at_mb500n_init(const machine_t *);
extern int machine_at_apollo_init(const machine_t *);
#if defined(DEV_BRANCH) && defined(USE_VECTRA54)
extern int machine_at_vectra54_init(const machine_t *);
#endif
extern int machine_at_powermate_v_init(const machine_t *);
extern int machine_at_acerv30_init(const machine_t *);
#ifdef EMU_DEVICE_H
extern const device_t *at_endeavor_get_device(void);
#define at_vectra54_get_device at_endeavor_get_device
extern const device_t *at_pb520r_get_device(void);
extern const device_t *at_thor_get_device(void);
#endif
@@ -416,6 +413,9 @@ extern int machine_at_pb680_init(const machine_t *);
extern int machine_at_nupro592_init(const machine_t *);
extern int machine_at_tx97_init(const machine_t *);
extern int machine_at_ym430tx_init(const machine_t *);
#if defined(DEV_BRANCH) && defined(NO_SIO)
extern int machine_at_an430tx_init(const machine_t *);
#endif
extern int machine_at_mb540n_init(const machine_t *);
extern int machine_at_p5mms98_init(const machine_t *);

View File

@@ -14,22 +14,20 @@ extern void (*input_msg)(void *p, uint8_t *msg);
extern int (*input_sysex)(void *p, uint8_t *buf, uint32_t len, int abort);
extern void *midi_in_p;
int midi_device_available(int card);
int midi_in_device_available(int card);
char *midi_device_getname(int card);
char *midi_in_device_getname(int card);
extern int midi_device_available(int card);
extern int midi_in_device_available(int card);
#ifdef EMU_DEVICE_H
const device_t *midi_device_getdevice(int card);
const device_t *midi_in_device_getdevice(int card);
#endif
int midi_device_has_config(int card);
int midi_in_device_has_config(int card);
char *midi_device_get_internal_name(int card);
char *midi_in_device_get_internal_name(int card);
int midi_device_get_from_internal_name(char *s);
int midi_in_device_get_from_internal_name(char *s);
void midi_device_init();
void midi_in_device_init();
extern int midi_device_has_config(int card);
extern int midi_in_device_has_config(int card);
extern char * midi_device_get_internal_name(int card);
extern char * midi_in_device_get_internal_name(int card);
extern int midi_device_get_from_internal_name(char *s);
extern int midi_in_device_get_from_internal_name(char *s);
extern void midi_device_init();
extern void midi_in_device_init();
typedef struct midi_device_t

View File

@@ -91,11 +91,15 @@ enum {
};
typedef struct {
uint8_t id,
res, res0, /* Reserved for other ID's. */
res1,
ide_channel, scsi_device_id,
bus_type, /* 0 = ATAPI, 1 = SCSI */
uint8_t id;
union {
uint8_t res, res0, /* Reserved for other ID's. */
res1,
ide_channel, scsi_device_id;
};
uint8_t bus_type, /* 0 = ATAPI, 1 = SCSI */
bus_mode, /* Bit 0 = PIO suported;
Bit 1 = DMA supportd. */
read_only, /* Struct variable reserved for

View File

@@ -196,7 +196,7 @@ extern void dp8390_chipmem_write(dp8390_t *dev, uint32_t addr, uint32_t val, uns
extern uint32_t dp8390_read_cr(dp8390_t *dev);
extern void dp8390_write_cr(dp8390_t *dev, uint32_t val);
extern void dp8390_rx(void *priv, uint8_t *buf, int io_len);
extern int dp8390_rx(void *priv, uint8_t *buf, int io_len);
extern uint32_t dp8390_page0_read(dp8390_t *dev, uint32_t off, unsigned int len);
extern void dp8390_page0_write(dp8390_t *dev, uint32_t off, uint32_t val, unsigned len);

View File

@@ -40,7 +40,7 @@ enum {
NE2K_NONE = 0,
NE2K_NE1000 = 1, /* 8-bit ISA NE1000 */
NE2K_NE2000 = 2, /* 16-bit ISA NE2000 */
NE2K_ETHERNEXT_MC = 3, /* 16-bit MCA EtherNext/MC */
NE2K_ETHERNEXT_MC = 3, /* 16-bit MCA EtherNext/MC */
NE2K_RTL8019AS = 4, /* 16-bit ISA PnP Realtek 8019AS */
NE2K_RTL8029AS = 5 /* 32-bit PCI Realtek 8029AS */
};

View File

@@ -64,7 +64,7 @@ enum {
};
typedef void (*NETRXCB)(void *, uint8_t *, int);
typedef int (*NETRXCB)(void *, uint8_t *, int);
typedef int (*NETWAITCB)(void *);
typedef int (*NETSETLINKSTATE)(void *);
@@ -78,7 +78,6 @@ typedef struct netpkt {
} netpkt_t;
typedef struct {
const char *name;
const char *internal_name;
const device_t *device;
void *priv;
@@ -133,7 +132,6 @@ extern void net_slirp_in(uint8_t *, int);
extern int network_dev_to_id(char *);
extern int network_card_available(int);
extern char *network_card_getname(int);
extern int network_card_has_config(int);
extern char *network_card_get_internal_name(int);
extern int network_card_get_from_internal_name(char *);

View File

@@ -49,24 +49,29 @@
enum {
PCI_CARD_NORTHBRIDGE = 0,
PCI_CARD_AGPBRIDGE,
PCI_CARD_SOUTHBRIDGE,
PCI_CARD_NORMAL,
PCI_CARD_NORMAL = 0x10,
PCI_CARD_NORMAL_NOBRIDGE,
PCI_CARD_ONBOARD,
PCI_CARD_VIDEO,
PCI_CARD_SCSI,
PCI_CARD_SOUND,
PCI_CARD_IDE,
PCI_CARD_SPECIAL
PCI_CARD_NETWORK,
PCI_CARD_BRIDGE,
};
enum {
PCI_ADD_NORTHBRIDGE = 0x80,
PCI_ADD_NORTHBRIDGE = 0,
PCI_ADD_AGPBRIDGE,
PCI_ADD_SOUTHBRIDGE,
PCI_ADD_NORMAL,
PCI_ADD_NORMAL = 0x10,
PCI_ADD_NORMAL_NOBRIDGE,
PCI_ADD_VIDEO,
PCI_ADD_SCSI,
PCI_ADD_SOUND,
PCI_ADD_IDE,
PCI_ADD_NETWORK,
PCI_ADD_BRIDGE
};

View File

@@ -118,6 +118,10 @@ extern void do_start(void);
extern void do_stop(void);
/* Power off. */
extern void plat_power_off(void);
/* Platform-specific device support. */
extern void floppy_mount(uint8_t id, wchar_t *fn, uint8_t wp);
extern void floppy_eject(uint8_t id);

View File

@@ -24,7 +24,6 @@
extern int scsi_card_current;
extern int scsi_card_available(int card);
extern char *scsi_card_getname(int card);
#ifdef EMU_DEVICE_H
extern const device_t *scsi_card_getdevice(int card);
#endif

View File

@@ -26,6 +26,7 @@ extern const device_t fdc37c665_device;
extern const device_t fdc37c666_device;
extern const device_t fdc37c669_device;
extern const device_t fdc37c931apm_device;
extern const device_t fdc37c931apm_compaq_device;
extern const device_t fdc37c932fr_device;
extern const device_t fdc37c932qf_device;
extern const device_t fdc37c935_device;
@@ -35,6 +36,7 @@ extern const device_t i82091aa_ide_device;
extern const device_t pc87306_device;
extern const device_t pc87307_device;
extern const device_t pc87307_15c_device;
extern const device_t pc87307_both_device;
extern const device_t pc87309_device;
extern const device_t pc87309_15c_device;
extern const device_t pc87332_device;

View File

@@ -49,7 +49,6 @@ extern void sound_set_cd_audio_filter(void (*filter)(int channel, \
double *buffer, void *p), void *p);
extern int sound_card_available(int card);
extern char *sound_card_getname(int card);
#ifdef EMU_DEVICE_H
extern const device_t *sound_card_getdevice(int card);
#endif

View File

@@ -24,7 +24,7 @@ extern "C" {
typedef struct
{
uint8_t ohci_mmio[4096];
uint8_t uhci_io[32], ohci_mmio[4096];
uint16_t uhci_io_base;
int uhci_enable, ohci_enable;
uint32_t ohci_mem_base;

View File

@@ -138,12 +138,10 @@ extern void (*video_recalctimings)(void);
/* Table functions. */
extern int video_card_available(int card);
extern char *video_card_getname(int card);
#ifdef EMU_DEVICE_H
extern const device_t *video_card_getdevice(int card);
#endif
extern int video_card_has_config(int card);
extern int video_card_getid(char *s);
extern char *video_get_internal_name(int card);
extern int video_get_video_from_internal_name(char *s);
extern int video_is_mda(void);

View File

@@ -39,11 +39,15 @@ enum {
typedef struct {
uint8_t id,
res, res0, /* Reserved for other ID's. */
res1,
ide_channel, scsi_device_id,
bus_type, /* 0 = ATAPI, 1 = SCSI */
uint8_t id;
union {
uint8_t res, res0, /* Reserved for other ID's. */
res1,
ide_channel, scsi_device_id;
};
uint8_t bus_type, /* 0 = ATAPI, 1 = SCSI */
bus_mode, /* Bit 0 = PIO suported;
Bit 1 = DMA supportd. */
read_only, /* Struct variable reserved for