PIC rewrite, proper SMRAM API, complete SiS 471 rewrite and addition of 40x, 460, and 461, changes to mem.c/h, disabled Voodoo memory dumping on exit, bumped SDL Hardware scale quality to 2, bumped IDE/ATAPI drives to ATA-6, finally bumped emulator version to 3.0, redid the bus type ID's to allow for planned ATAPI hard disks, made SST flash set its high mappings to the correct address if the CPU is 16-bit, and added the SiS 401 AMI 486 Clone, AOpen Vi15G, and the Soyo 4SA2 (486 with SiS 496/497 that can boot from CD-ROM), assorted 286+ protected mode fixes (for slightly more accuracy), and fixes to 808x emulation (MS Word 1.0 and 1.10 for DOS now work correctly from floppy).
2020-10-14 23:15:01 +02:00
|
|
|
/*
|
2023-01-06 15:36:05 -05:00
|
|
|
* 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.
|
PIC rewrite, proper SMRAM API, complete SiS 471 rewrite and addition of 40x, 460, and 461, changes to mem.c/h, disabled Voodoo memory dumping on exit, bumped SDL Hardware scale quality to 2, bumped IDE/ATAPI drives to ATA-6, finally bumped emulator version to 3.0, redid the bus type ID's to allow for planned ATAPI hard disks, made SST flash set its high mappings to the correct address if the CPU is 16-bit, and added the SiS 401 AMI 486 Clone, AOpen Vi15G, and the Soyo 4SA2 (486 with SiS 496/497 that can boot from CD-ROM), assorted 286+ protected mode fixes (for slightly more accuracy), and fixes to 808x emulation (MS Word 1.0 and 1.10 for DOS now work correctly from floppy).
2020-10-14 23:15:01 +02:00
|
|
|
*
|
2023-01-06 15:36:05 -05:00
|
|
|
* This file is part of the 86Box distribution.
|
PIC rewrite, proper SMRAM API, complete SiS 471 rewrite and addition of 40x, 460, and 461, changes to mem.c/h, disabled Voodoo memory dumping on exit, bumped SDL Hardware scale quality to 2, bumped IDE/ATAPI drives to ATA-6, finally bumped emulator version to 3.0, redid the bus type ID's to allow for planned ATAPI hard disks, made SST flash set its high mappings to the correct address if the CPU is 16-bit, and added the SiS 401 AMI 486 Clone, AOpen Vi15G, and the Soyo 4SA2 (486 with SiS 496/497 that can boot from CD-ROM), assorted 286+ protected mode fixes (for slightly more accuracy), and fixes to 808x emulation (MS Word 1.0 and 1.10 for DOS now work correctly from floppy).
2020-10-14 23:15:01 +02:00
|
|
|
*
|
2023-01-06 15:36:05 -05:00
|
|
|
* Header of the implementation of the Intel PIC chip emulation,
|
|
|
|
|
* partially ported from reenigne's XTCE.
|
PIC rewrite, proper SMRAM API, complete SiS 471 rewrite and addition of 40x, 460, and 461, changes to mem.c/h, disabled Voodoo memory dumping on exit, bumped SDL Hardware scale quality to 2, bumped IDE/ATAPI drives to ATA-6, finally bumped emulator version to 3.0, redid the bus type ID's to allow for planned ATAPI hard disks, made SST flash set its high mappings to the correct address if the CPU is 16-bit, and added the SiS 401 AMI 486 Clone, AOpen Vi15G, and the Soyo 4SA2 (486 with SiS 496/497 that can boot from CD-ROM), assorted 286+ protected mode fixes (for slightly more accuracy), and fixes to 808x emulation (MS Word 1.0 and 1.10 for DOS now work correctly from floppy).
2020-10-14 23:15:01 +02:00
|
|
|
*
|
2023-01-06 15:36:05 -05:00
|
|
|
* Authors: Andrew Jenner, <https://www.reenigne.org>
|
|
|
|
|
* Miran Grca, <mgrca8@gmail.com>
|
PIC rewrite, proper SMRAM API, complete SiS 471 rewrite and addition of 40x, 460, and 461, changes to mem.c/h, disabled Voodoo memory dumping on exit, bumped SDL Hardware scale quality to 2, bumped IDE/ATAPI drives to ATA-6, finally bumped emulator version to 3.0, redid the bus type ID's to allow for planned ATAPI hard disks, made SST flash set its high mappings to the correct address if the CPU is 16-bit, and added the SiS 401 AMI 486 Clone, AOpen Vi15G, and the Soyo 4SA2 (486 with SiS 496/497 that can boot from CD-ROM), assorted 286+ protected mode fixes (for slightly more accuracy), and fixes to 808x emulation (MS Word 1.0 and 1.10 for DOS now work correctly from floppy).
2020-10-14 23:15:01 +02:00
|
|
|
*
|
2023-01-06 15:36:05 -05:00
|
|
|
* Copyright 2015-2020 Andrew Jenner.
|
|
|
|
|
* Copyright 2016-2020 Miran Grca.
|
PIC rewrite, proper SMRAM API, complete SiS 471 rewrite and addition of 40x, 460, and 461, changes to mem.c/h, disabled Voodoo memory dumping on exit, bumped SDL Hardware scale quality to 2, bumped IDE/ATAPI drives to ATA-6, finally bumped emulator version to 3.0, redid the bus type ID's to allow for planned ATAPI hard disks, made SST flash set its high mappings to the correct address if the CPU is 16-bit, and added the SiS 401 AMI 486 Clone, AOpen Vi15G, and the Soyo 4SA2 (486 with SiS 496/497 that can boot from CD-ROM), assorted 286+ protected mode fixes (for slightly more accuracy), and fixes to 808x emulation (MS Word 1.0 and 1.10 for DOS now work correctly from floppy).
2020-10-14 23:15:01 +02:00
|
|
|
*/
|
2022-02-18 19:42:21 -05:00
|
|
|
|
2017-11-02 02:28:00 -05:00
|
|
|
#ifndef EMU_PIC_H
|
2022-09-18 17:15:38 -04:00
|
|
|
#define EMU_PIC_H
|
2017-11-02 02:28:00 -05:00
|
|
|
|
PIC rewrite, proper SMRAM API, complete SiS 471 rewrite and addition of 40x, 460, and 461, changes to mem.c/h, disabled Voodoo memory dumping on exit, bumped SDL Hardware scale quality to 2, bumped IDE/ATAPI drives to ATA-6, finally bumped emulator version to 3.0, redid the bus type ID's to allow for planned ATAPI hard disks, made SST flash set its high mappings to the correct address if the CPU is 16-bit, and added the SiS 401 AMI 486 Clone, AOpen Vi15G, and the Soyo 4SA2 (486 with SiS 496/497 that can boot from CD-ROM), assorted 286+ protected mode fixes (for slightly more accuracy), and fixes to 808x emulation (MS Word 1.0 and 1.10 for DOS now work correctly from floppy).
2020-10-14 23:15:01 +02:00
|
|
|
typedef struct pic {
|
2022-09-18 17:15:38 -04:00
|
|
|
uint8_t icw1, icw2, icw3, icw4,
|
|
|
|
|
imr, isr, irr, ocw2,
|
|
|
|
|
ocw3, int_pending, is_master, elcr,
|
|
|
|
|
state, ack_bytes, priority, special_mask_mode,
|
|
|
|
|
auto_eoi_rotate, interrupt, lines, data_bus;
|
|
|
|
|
uint32_t at;
|
|
|
|
|
struct pic *slaves[8];
|
PIC rewrite, proper SMRAM API, complete SiS 471 rewrite and addition of 40x, 460, and 461, changes to mem.c/h, disabled Voodoo memory dumping on exit, bumped SDL Hardware scale quality to 2, bumped IDE/ATAPI drives to ATA-6, finally bumped emulator version to 3.0, redid the bus type ID's to allow for planned ATAPI hard disks, made SST flash set its high mappings to the correct address if the CPU is 16-bit, and added the SiS 401 AMI 486 Clone, AOpen Vi15G, and the Soyo 4SA2 (486 with SiS 496/497 that can boot from CD-ROM), assorted 286+ protected mode fixes (for slightly more accuracy), and fixes to 808x emulation (MS Word 1.0 and 1.10 for DOS now work correctly from floppy).
2020-10-14 23:15:01 +02:00
|
|
|
} pic_t;
|
2017-11-02 02:28:00 -05:00
|
|
|
|
2022-09-18 17:15:38 -04:00
|
|
|
extern pic_t pic, pic2;
|
|
|
|
|
|
|
|
|
|
extern void pic_reset_smi_irq_mask(void);
|
|
|
|
|
extern void pic_set_smi_irq_mask(int irq, int set);
|
|
|
|
|
extern uint16_t pic_get_smi_irq_status(void);
|
|
|
|
|
extern void pic_clear_smi_irq_status(int irq);
|
|
|
|
|
|
|
|
|
|
extern int pic_elcr_get_enabled(void);
|
|
|
|
|
extern void pic_elcr_set_enabled(int enabled);
|
|
|
|
|
extern void pic_elcr_io_handler(int set);
|
|
|
|
|
extern void pic_elcr_write(uint16_t port, uint8_t val, void *priv);
|
|
|
|
|
extern uint8_t pic_elcr_read(uint16_t port, void *priv);
|
|
|
|
|
|
|
|
|
|
extern void pic_set_shadow(int sh);
|
2023-04-08 00:40:57 +02:00
|
|
|
extern int pic_get_pci_flag(void);
|
2022-09-18 17:15:38 -04:00
|
|
|
extern void pic_set_pci_flag(int pci);
|
|
|
|
|
extern void pic_set_pci(void);
|
|
|
|
|
extern void pic_init(void);
|
|
|
|
|
extern void pic_init_pcjr(void);
|
|
|
|
|
extern void pic2_init(void);
|
|
|
|
|
extern void pic_reset(void);
|
|
|
|
|
|
|
|
|
|
extern int picint_is_level(int irq);
|
|
|
|
|
extern void picint_common(uint16_t num, int level, int set);
|
|
|
|
|
extern void picint(uint16_t num);
|
|
|
|
|
extern void picintlevel(uint16_t num);
|
|
|
|
|
extern void picintc(uint16_t num);
|
|
|
|
|
extern int picinterrupt(void);
|
|
|
|
|
|
|
|
|
|
extern uint8_t pic_irq_ack(void);
|
|
|
|
|
|
|
|
|
|
#endif /*EMU_PIC_H*/
|