Hook up Bidirectional LPT, EPP, and ECP to all Super I/O chips (missing is vendor-specific Configuration Register B behavior but that's next on my list), fixed Super I/O chip mistakes for a number of machines, split 286/386SX/M6117D machines into three separate files and reordered them as well.

This commit is contained in:
OBattler
2025-08-11 16:36:30 +02:00
parent 42fa1dbe54
commit dbd748636e
51 changed files with 5062 additions and 4463 deletions

View File

@@ -53,6 +53,7 @@ typedef struct lpt_t {
uint8_t epp;
uint8_t ecp;
uint8_t ecr;
uint8_t ret_ecr;
uint8_t in_dat;
uint8_t fifo_stat;
uint8_t dma_stat;
@@ -61,8 +62,11 @@ typedef struct lpt_t {
uint8_t strobe;
uint8_t lv2;
uint8_t cnfga_readout;
uint8_t cfg_regs_enabled;
uint8_t inst;
uint8_t pad[5];
uint8_t eir;
uint8_t pad[2];
uint8_t ext_regs[8];
uint16_t addr;
uint16_t id;
uint16_t pad0[2];
@@ -101,6 +105,8 @@ extern uint8_t lpt_read(uint16_t port, void *priv);
extern uint8_t lpt_read_port(lpt_t *dev, uint16_t reg);
extern uint8_t lpt_read_status(lpt_t *dev);
extern uint8_t lpt_read_ecp_mode(lpt_t *dev);
extern void lpt_irq(void *priv, int raise);
extern int lpt_device_get_from_internal_name(const char *str);
@@ -125,6 +131,7 @@ extern void lpt_set_ext(lpt_t *dev, uint8_t ext);
extern void lpt_set_ecp(lpt_t *dev, uint8_t ecp);
extern void lpt_set_epp(lpt_t *dev, uint8_t epp);
extern void lpt_set_lv2(lpt_t *dev, uint8_t lv2);
extern void lpt_set_cfg_regs_enabled(lpt_t *dev, uint8_t cfg_regs_enabled);
extern void lpt_set_fifo_threshold(lpt_t *dev, int threshold);
extern void lpt_set_cnfga_readout(lpt_t *dev, const uint8_t cnfga_readout);
extern void lpt_port_setup(lpt_t *dev, uint16_t port);

View File

@@ -164,31 +164,32 @@
enum {
MACHINE_TYPE_NONE = 0,
MACHINE_TYPE_8088 = 1,
MACHINE_TYPE_8086 = 2,
MACHINE_TYPE_286 = 3,
MACHINE_TYPE_386SX = 4,
MACHINE_TYPE_486SLC = 5,
MACHINE_TYPE_386DX = 6,
MACHINE_TYPE_386DX_486 = 7,
MACHINE_TYPE_486 = 8,
MACHINE_TYPE_486_S2 = 9,
MACHINE_TYPE_486_S3 = 10,
MACHINE_TYPE_486_S3_PCI = 11,
MACHINE_TYPE_486_MISC = 12,
MACHINE_TYPE_SOCKET4 = 13,
MACHINE_TYPE_SOCKET5 = 14,
MACHINE_TYPE_SOCKET7_3V = 15,
MACHINE_TYPE_SOCKET7 = 16,
MACHINE_TYPE_SOCKETS7 = 17,
MACHINE_TYPE_SOCKET8 = 18,
MACHINE_TYPE_SLOT1 = 19,
MACHINE_TYPE_SLOT1_2 = 20,
MACHINE_TYPE_SLOT1_370 = 21,
MACHINE_TYPE_SLOT2 = 22,
MACHINE_TYPE_SOCKET370 = 23,
MACHINE_TYPE_MISC = 24,
MACHINE_TYPE_MAX = 25
MACHINE_TYPE_8088,
MACHINE_TYPE_8086,
MACHINE_TYPE_286,
MACHINE_TYPE_386SX,
MACHINE_TYPE_M6117,
MACHINE_TYPE_486SLC,
MACHINE_TYPE_386DX,
MACHINE_TYPE_386DX_486,
MACHINE_TYPE_486,
MACHINE_TYPE_486_S2,
MACHINE_TYPE_486_S3,
MACHINE_TYPE_486_S3_PCI,
MACHINE_TYPE_486_MISC,
MACHINE_TYPE_SOCKET4,
MACHINE_TYPE_SOCKET5,
MACHINE_TYPE_SOCKET7_3V,
MACHINE_TYPE_SOCKET7,
MACHINE_TYPE_SOCKETS7,
MACHINE_TYPE_SOCKET8,
MACHINE_TYPE_SLOT1,
MACHINE_TYPE_SLOT1_2,
MACHINE_TYPE_SLOT1_370,
MACHINE_TYPE_SLOT2,
MACHINE_TYPE_SOCKET370,
MACHINE_TYPE_MISC,
MACHINE_TYPE_MAX
};
enum {
@@ -440,78 +441,107 @@ extern void machine_at_ibm_common_ide_init(const machine_t *);
extern void machine_at_ide_init(const machine_t *);
extern void machine_at_ps2_ide_init(const machine_t *);
extern int machine_at_ibm_init(const machine_t *);
extern int machine_at_ibm_init(const machine_t *);
// IBM AT with custom BIOS
extern int machine_at_ibmatami_init(const machine_t *); // IBM AT with AMI BIOS
extern int machine_at_ibmatpx_init(const machine_t *); // IBM AT with Phoenix BIOS
extern int machine_at_ibmatquadtel_init(const machine_t *); // IBM AT with Quadtel BIOS
extern int machine_at_ibmatami_init(const machine_t *); // IBM AT with AMI BIOS
extern int machine_at_ibmatpx_init(const machine_t *); // IBM AT with Phoenix BIOS
extern int machine_at_ibmatquadtel_init(const machine_t *); // IBM AT with Quadtel BIOS
extern int machine_at_ibmxt286_init(const machine_t *);
extern int machine_at_ibmxt286_init(const machine_t *);
extern int machine_at_pb286_init(const machine_t *);
extern int machine_at_pb286_init(const machine_t *);
extern int machine_at_siemens_init(const machine_t *); // Siemens PCD-2L. N82330 discrete machine. It segfaults in some places
extern int machine_at_siemens_init(const machine_t *); // Siemens PCD-2L. N82330 discrete machine. It segfaults in some places
extern int machine_at_wellamerastar_init(const machine_t *); // Wells American A*Star with custom award BIOS
/* m_at_286.c */
/* ISA */
extern int machine_at_mr286_init(const machine_t *);
extern int machine_at_pc8_init(const machine_t *);
extern int machine_at_m290_init(const machine_t *);
/* m_at_286_386sx.c */
extern int machine_at_tg286m_init(const machine_t *);
extern int machine_at_ama932j_init(const machine_t *);
extern int machine_at_px286_init(const machine_t *);
extern int machine_at_quadt286_init(const machine_t *);
extern int machine_at_mr286_init(const machine_t *);
/* C&T PC/AT */
extern int machine_at_dells200_init(const machine_t *);
extern int machine_at_super286c_init(const machine_t *);
extern int machine_at_at122_init(const machine_t *);
extern int machine_at_tuliptc7_init(const machine_t *);
extern int machine_at_pbl300sx_init(const machine_t *);
extern int machine_at_neat_init(const machine_t *);
extern int machine_at_neat_ami_init(const machine_t *);
extern int machine_at_ataripc4_init(const machine_t *);
/* GC103 */
extern int machine_at_quadt286_init(const machine_t *);
extern void machine_at_headland_common_init(const machine_t *model, int type);
extern int machine_at_tg286m_init(const machine_t *);
/* Wells American A*Star with custom award BIOS. */
extern int machine_at_wellamerastar_init(const machine_t *);
extern int machine_at_quadt386sx_init(const machine_t *);
/* NEAT */
extern int machine_at_ataripc4_init(const machine_t *);
extern int machine_at_neat_ami_init(const machine_t *);
extern int machine_at_3302_init(const machine_t *);
extern int machine_at_px286_init(const machine_t *);
extern int machine_at_award286_init(const machine_t *);
extern int machine_at_gdc212m_init(const machine_t *);
extern int machine_at_gw286ct_init(const machine_t *);
extern int machine_at_drsm35286_init(const machine_t *);
extern int machine_at_senor_scat286_init(const machine_t *);
extern int machine_at_super286c_init(const machine_t *);
extern int machine_at_super286tr_init(const machine_t *);
extern int machine_at_spc4200p_init(const machine_t *);
extern int machine_at_spc4216p_init(const machine_t *);
extern int machine_at_spc4620p_init(const machine_t *);
extern int machine_at_kmxc02_init(const machine_t *);
extern int machine_at_deskmaster286_init(const machine_t *);
/* SCAT */
extern int machine_at_gw286ct_init(const machine_t *);
extern int machine_at_gdc212m_init(const machine_t *);
extern int machine_at_award286_init(const machine_t *);
extern int machine_at_super286tr_init(const machine_t *);
extern int machine_at_drsm35286_init(const machine_t *);
extern int machine_at_deskmaster286_init(const machine_t *);
extern int machine_at_spc4200p_init(const machine_t *);
extern int machine_at_spc4216p_init(const machine_t *);
extern int machine_at_spc4620p_init(const machine_t *);
extern int machine_at_senor_scat286_init(const machine_t *);
extern int machine_at_dells200_init(const machine_t *);
extern int machine_at_at122_init(const machine_t *);
extern int machine_at_tuliptc7_init(const machine_t *);
/* m_at_386sx.c */
/* ISA */
extern int machine_at_pc916sx_init(const machine_t *);
extern int machine_at_quadt386sx_init(const machine_t *);
extern int machine_at_pc8_init(const machine_t *);
extern int machine_at_3302_init(const machine_t *);
/* ACC 2036 */
extern int machine_at_pbl300sx_init(const machine_t *);
extern int machine_at_m290_init(const machine_t *);
/* ALi M1217 */
extern int machine_at_arb1374_init(const machine_t *);
extern int machine_at_sbc350a_init(const machine_t *);
extern int machine_at_flytech386_init(const machine_t *);
extern int machine_at_325ax_init(const machine_t *);
extern int machine_at_mr1217_init(const machine_t *);
extern int machine_at_shuttle386sx_init(const machine_t *);
extern int machine_at_adi386sx_init(const machine_t *);
extern int machine_at_cmdsl386sx16_init(const machine_t *);
extern int machine_at_cmdsl386sx25_init(const machine_t *);
extern int machine_at_dataexpert386sx_init(const machine_t *);
extern int machine_at_dells333sl_init(const machine_t *);
extern int machine_at_if386sx_init(const machine_t *);
extern int machine_at_spc6033p_init(const machine_t *);
extern int machine_at_wd76c10_init(const machine_t *);
extern int machine_at_arb1374_init(const machine_t *);
extern int machine_at_sbc350a_init(const machine_t *);
extern int machine_at_flytech386_init(const machine_t *);
extern int machine_at_325ax_init(const machine_t *);
extern int machine_at_mr1217_init(const machine_t *);
extern int machine_at_pja511m_init(const machine_t *);
extern int machine_at_prox1332_init(const machine_t *);
extern int machine_at_acer100t_init(const machine_t *);
/* ALi M1409 */
extern int machine_at_acer100t_init(const machine_t *);
extern int machine_at_awardsx_init(const machine_t *);
/* HT18 */
extern int machine_at_ama932j_init(const machine_t *);
extern int machine_at_pc916sx_init(const machine_t *);
/* Intel 82335 */
extern int machine_at_adi386sx_init(const machine_t *);
extern int machine_at_shuttle386sx_init(const machine_t *);
/* NEAT */
extern int machine_at_cmdsl386sx16_init(const machine_t *);
extern int machine_at_neat_init(const machine_t *);
/* NEATsx */
extern int machine_at_if386sx_init(const machine_t *);
/* OPTi 291 */
extern int machine_at_awardsx_init(const machine_t *);
/* SCAMP */
extern int machine_at_cmdsl386sx25_init(const machine_t *);
extern int machine_at_dataexpert386sx_init(const machine_t *);
extern int machine_at_dells333sl_init(const machine_t *);
extern int machine_at_spc6033p_init(const machine_t *);
/* SCATsx */
extern int machine_at_kmxc02_init(const machine_t *);
/* WD76C10 */
extern int machine_at_wd76c10_init(const machine_t *);
/* m_at_m6117.c */
/* ALi M6117D */
extern int machine_at_pja511m_init(const machine_t *);
extern int machine_at_prox1332_init(const machine_t *);
/* m_at_386dx_486.c */
/* Note to jriwanek: When merging this into my branch, please make

View File

@@ -135,7 +135,6 @@ extern serial_t *serial_attach_ex_2(int port,
serial_attach_ex(port, rcr_callback, dev_write, NULL, NULL, priv);
extern void serial_remove(serial_t *dev);
extern void serial_set_type(serial_t *dev, int type);
extern void serial_setup(serial_t *dev, uint16_t addr, uint8_t irq);
extern void serial_irq(serial_t *dev, uint8_t irq);
extern void serial_clear_fifo(serial_t *dev);
@@ -143,6 +142,7 @@ extern void serial_write_fifo(serial_t *dev, uint8_t dat);
extern void serial_set_next_inst(int ni);
extern void serial_standalone_init(void);
extern void serial_set_clock_src(serial_t *dev, double clock_src);
extern void serial_set_type(serial_t *dev, uint8_t type);
extern void serial_reset_port(serial_t *dev);
extern uint8_t serial_read(uint16_t addr, void *priv);
extern void serial_device_timeout(void *priv);

View File

@@ -29,36 +29,35 @@ extern const device_t f82c710_device;
extern const device_t f82c710_pc5086_device;
/* SM(S)C */
extern const device_t fdc37c651_device;
extern const device_t fdc37c651_ide_device;
extern const device_t fdc37c661_device;
extern const device_t fdc37c661_ide_device;
extern const device_t fdc37c661_ide_sec_device;
extern const device_t fdc37c663_device;
extern const device_t fdc37c663_ide_device;
extern const device_t fdc37c665_device;
extern const device_t fdc37c665_ide_device;
extern const device_t fdc37c665_ide_pri_device;
extern const device_t fdc37c665_ide_sec_device;
extern const device_t fdc37c666_device;
#define FDC37C651 0x00051
#define FDC37C661 0x00061
#define FDC37C663 0x00063
#define FDC37C665 0x00065
#define FDC37C666 0x00066
#define FDC37C6XX_IDE_PRI 0x00100
#define FDC37C6XX_IDE_SEC 0x00200
#define FDC37C6XX_370 0x00400
extern const device_t fdc37c6xx_device;
extern const device_t fdc37c669_device;
extern const device_t fdc37c669_370_device;
#define FDC37C93X_NORMAL 0x0002
#define FDC37C93X_FR 0x0003
#define FDC37C93X_APM 0x0030
#define FDC37C93X_CHIP_ID 0x00ff
#define FDC37C93X_NORMAL 0x00002
#define FDC37C93X_FR 0x00003
#define FDC37C93X_APM 0x00030
#define FDC37C93X_CHIP_ID 0x000ff
#define FDC37XXX1 0x0100 /* Compaq KBC firmware and configuration registers on GPIO ports. */
#define FDC37XXX2 0x0200 /* AMI '5' Megakey KBC firmware. */
#define FDC37XXX3 0x0300 /* IBM KBC firmware. */
#define FDC37XXX5 0x0500 /* Phoenix Multikey/42 1.38 KBC firmware. */
#define FDC37XXX7 0x0700 /* Phoenix Multikey/42i 4.16 KBC firmware. */
#define FDC37XXXX_KBC 0x0f00
#define FDC37XXX1 0x00100 /* Compaq KBC firmware and configuration registers on GPIO ports. */
#define FDC37XXX2 0x00200 /* AMI '5' Megakey KBC firmware. */
#define FDC37XXX3 0x00300 /* IBM KBC firmware. */
#define FDC37XXX5 0x00500 /* Phoenix Multikey/42 1.38 KBC firmware. */
#define FDC37XXX7 0x00700 /* Phoenix Multikey/42i 4.16 KBC firmware. */
#define FDC37XXXX_KBC 0x00f00
#define FDC37C93X_NO_NVR 0x1000
#define FDC37XXXX_370 0x2000
#define FDC37C93X_NO_NVR 0x01000
#define FDC37XXXX_370 0x02000
extern const device_t fdc37c93x_device;
@@ -71,42 +70,52 @@ extern const device_t it8661f_device;
extern const device_t it8671f_device;
/* Intel */
#define I82091AA_022 0x00000 /* Default. */
#define I82091AA_024 0x00008
#define I82091AA_26E 0x00100
#define I82091AA_398 0x00108
#define I82091AA_IDE_PRI 0x00200
#define I82091AA_IDE_SEC 0x00400
extern const device_t i82091aa_device;
extern const device_t i82091aa_26e_device;
extern const device_t i82091aa_398_device;
extern const device_t i82091aa_ide_pri_device;
extern const device_t i82091aa_ide_device;
/* National Semiconductors PC87310 / ALi M5105 */
#define PC87310_IDE 0x0001
#define PC87310_ALI 0x0002
#define PCX73XX_IDE 0x00001
#define PCX73XX_IDE_PRI PCX73XX_IDE
#define PCX73XX_IDE_SEC 0x00002
#define PCX73XX_FDC_ON 0x10000
#define PC87310_ALI 0x00004
#define PC87332 PC87310_ALI
extern const device_t pc87310_device;
/* National Semiconductors */
#define PCX7307_PC87307 0x00c0
#define PCX7307_PC97307 0x00cf
#define PCX7307_PC87307 0x000c0
#define PCX7307_PC97307 0x000cf
#define PC87309_PC87309 0x00e0
#define PC87309_PC87309 0x000e0
#define PCX730X_CHIP_ID 0x00ff
#define PCX730X_CHIP_ID 0x000ff
#define PCX730X_AMI 0x0200 /* AMI '5' Megakey KBC firmware. */
#define PCX730X_PHOENIX_42 0x0500 /* Phoenix Multikey/42 1.37 KBC firmware. */
#define PCX730X_PHOENIX_42I 0x0700 /* Phoenix Multikey/42i 4.16 KBC firmware. */
#define PCX730X_KBC 0x0f00
#define PCX730X_AMI 0x00200 /* AMI '5' Megakey KBC firmware. */
#define PCX730X_PHOENIX_42 0x00500 /* Phoenix Multikey/42 1.37 KBC firmware. */
#define PCX730X_PHOENIX_42I 0x00700 /* Phoenix Multikey/42i 4.16 KBC firmware. */
#define PCX730X_KBC 0x00f00
#define PCX730X_15C 0x2000
#define PCX730X_398 0x00000
#define PCX730X_26E 0x01000
#define PCX730X_15C 0x02000
#define PCX730X_02E 0x03000
#define PCX730X_BADDR 0x03000
#define PCX730X_BADDR_SHIFT 12
extern const device_t pc87306_device;
extern const device_t pc87311_device;
extern const device_t pc87311_ide_device;
extern const device_t pc87332_device;
extern const device_t pc87332_398_device;
extern const device_t pc87332_398_ide_device;
extern const device_t pc87332_398_ide_sec_device;
extern const device_t pc87332_398_ide_fdcon_device;
extern const device_t pc873xx_device;
/* National Semiconductors PC87307 / PC87309 */
extern const device_t pc87307_device;
@@ -114,10 +123,15 @@ extern const device_t pc87307_device;
extern const device_t pc87309_device;
/* LG Prime */
extern const device_t prime3b_device;
extern const device_t prime3b_ide_device;
extern const device_t prime3c_device;
extern const device_t prime3c_ide_device;
#define GM82C803A 0x00000
#define GM82C803B 0x00001
#define GM82C803_IDE_PRI 0x00100
#define GM82C803_IDE_SEC 0x00200
extern const device_t gm82c803ab_device;
extern const device_t gm82c803c_device;
/* IBM PS/1 */
extern const device_t ps1_m2133_sio;
@@ -128,20 +142,17 @@ extern const device_t sio_detect_device;
#endif /* USE_SIO_DETECT */
/* UMC */
extern const device_t um82c862f_device;
extern const device_t um82c862f_ide_device;
extern const device_t um82c863f_device;
extern const device_t um82c863f_ide_device;
extern const device_t um8663af_device;
extern const device_t um8663af_ide_device;
extern const device_t um8663af_sec_device;
extern const device_t um8663bf_device;
extern const device_t um8663bf_ide_device;
extern const device_t um8663bf_sec_device;
#define UM82C862F 0x00000
#define UM82C863F 0x0c100
#define UM8663AF 0x0c300
#define UM8663BF 0x0c400
#define UM866X_IDE_PRI 0x00001
#define UM866X_IDE_SEC 0x00002
extern const device_t um866x_device;
extern const device_t um8669f_device;
extern const device_t um8669f_ide_device;
extern const device_t um8669f_ide_sec_device;
/* VIA */
extern void vt82c686_sio_write(uint8_t addr, uint8_t val, void *priv);
@@ -152,26 +163,43 @@ extern const device_t via_vt82c686_sio_device;
extern const device_t vl82c113_device;
/* Winbond */
extern const device_t w83787f_88h_device;
extern const device_t w83787f_device;
extern const device_t w83787f_ide_device;
extern const device_t w83787f_ide_en_device;
extern const device_t w83787f_ide_sec_device;
#define W83777F 0x00007
#define W83787F 0x00008
#define W83787IF 0x00009
extern const device_t w83877f_device;
extern const device_t w83877f_president_device;
extern const device_t w83877tf_device;
extern const device_t w83877tf_acorp_device;
#define W837X7_KEY_88 0x00000
#define W837X7_KEY_89 0x00020
#define TYPE_W83977EF 0x52F0
#define TYPE_W83977F 0x9771
#define TYPE_W83977TF 0x9773
#define TYPE_W83977ATF 0x9774
#define W837X7_IDE_START 0x00040
extern const device_t w83977f_device;
extern const device_t w83977f_370_device;
extern const device_t w83977tf_device;
extern const device_t w83977ef_device;
extern const device_t w83977ef_370_device;
#define W83XX7_IDE_PRI 0x10000
#define W83XX7_IDE_SEC 0x20000
extern const device_t w837x7_device;
#define W83877F 0x00a00
#define W83877TF 0x00c00
#define W83877_3F0 0x00005
#define W83877_250 0x00004
extern const device_t w83877_device;
#define W83977F 0x977100
#define W83977TF 0x977300
#define W83977EF 0x52f000
#define W83977_TYPE 0xffff00
#define W83977_TYPE_SHIFT 8
#define W83977_3F0 0x00000
#define W83977_370 0x00001
#define W83977_NO_NVR 0x00002
#define W83977_AMI 0x00010 /* AMI 'H' KBC firmware. */
#define W83977_PHOENIX 0x00020 /* Unknown Phoenix Multikey KBC firmware. */
#define W83977_KBC 0x000f0
extern const device_t w83977_device;
#endif /*EMU_SIO_H*/