Merge branch 'master' into feature/global-config

This commit is contained in:
David Hrdlička
2025-08-06 12:26:10 +02:00
committed by GitHub
715 changed files with 96594 additions and 40250 deletions

View File

@@ -25,6 +25,11 @@
#include <stdarg.h>
#endif
#if defined(__HAIKU__)
/* Doesn't compile on Haiku without this include */
#include <stdlib.h>
#endif
/* Configuration values. */
#define GFXCARD_MAX 2
#define SERIAL_MAX 8
@@ -121,7 +126,6 @@ extern int dpi_scale; /* (C) DPI scaling of the emulated s
extern int vid_api; /* (C) video renderer */
extern int vid_cga_contrast; /* (C) video */
extern int video_fullscreen; /* (C) video */
extern int video_fullscreen_first; /* (C) video */
extern int video_fullscreen_scale; /* (C) video */
extern int enable_overscan; /* (C) video */
extern int force_43; /* (C) video */
@@ -135,6 +139,7 @@ extern int postcard_enabled; /* (C) enable POST card */
extern int unittester_enabled; /* (C) enable unit tester device */
extern int gameport_type[]; /* (C) enable gameports */
extern int isamem_type[]; /* (C) enable ISA mem cards */
extern int isarom_type[]; /* (C) enable ISA ROM 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 */
@@ -149,13 +154,14 @@ extern int fpu_type; /* (C) fpu type */
extern int fpu_softfloat; /* (C) fpu uses softfloat */
extern int time_sync; /* (C) enable time sync */
extern int hdd_format_type; /* (C) hard disk file format */
extern int lba_enhancer_enabled; /* (C) enable Vision Systems LBA Enhancer */
extern int confirm_reset; /* (C) enable reset confirmation */
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 force_10ms; /* (C) force 10ms CPU frame interval */
extern int other_ide_present; /* IDE controllers from non-IDE cards are present */
extern int other_scsi_present; /* SCSI controllers from non-SCSI cards are present */
extern int is_pcjr; /* The current machine is PCjr. */
extern int hard_reset_pending;
extern int fixed_size_x;
@@ -178,6 +184,8 @@ extern char cfg_path[1024]; /* full path of config file */
extern char global_cfg_path[1024]; /* full path of global config file */
extern int open_dir_usr_path; /* default file open dialog directory of usr_path */
extern char uuid[MAX_UUID_LEN]; /* UUID or machine identifier */
extern char vmm_path[1024]; /* VM Manager path to scan (temporary) */
extern int vmm_enabled;
#ifndef USE_NEW_DYNAREC
extern FILE *stdlog; /* file to log output to */
#endif

View File

@@ -75,7 +75,7 @@ void pc_cas_del(pc_cassette_t *cas);
* @short Set the cassette file
* @return True on error, false otherwise
*****************************************************************************/
int pc_cas_set_fname(pc_cassette_t *cas, const char *fname);
int pc_cas_set_fname(pc_cassette_t *cas, char *fname);
/*!***************************************************************************
* @short Get the cassette mode

View File

@@ -29,8 +29,9 @@
#define CD_STATUS_STOPPED 6
#define CD_STATUS_PLAYING_COMPLETED 7
#define CD_STATUS_HOLD 8
#define CD_STATUS_DVD_REJECTED 16
#define CD_STATUS_HAS_AUDIO 0xc
#define CD_STATUS_MASK 0xf
#define CD_STATUS_MASK 0x1f
/* Medium changed flag. */
#define CD_STATUS_TRANSITION 0x40
@@ -69,6 +70,8 @@
#define CD_FPS 75
#define _LUT_SIZE 0x100
#define FRAMES_TO_MSF(f, M, S, F) \
{ \
uint64_t value = f; \
@@ -91,13 +94,19 @@ extern "C" {
#endif
enum {
CDROM_BUS_DISABLED = 0,
CDROM_BUS_ATAPI = 5,
CDROM_BUS_SCSI = 6,
CDROM_BUS_MITSUMI = 7,
CDROM_BUS_USB = 8
CDROM_BUS_DISABLED = 0,
CDROM_BUS_PHILIPS = 1,
CDROM_BUS_SONY = 2,
CDROM_BUS_HITACHI = 3,
CDROM_BUS_MKE = 4,
CDROM_BUS_MITSUMI = 5,
CDROM_BUS_LPT = 6,
CDROM_BUS_ATAPI = 8,
CDROM_BUS_SCSI = 9,
CDROM_BUS_USB = 10
};
#define BUS_TYPE_MKE CDROM_BUS_MKE
#define BUS_TYPE_IDE CDROM_BUS_ATAPI
#define BUS_TYPE_SCSI CDROM_BUS_SCSI
#define BUS_TYPE_BOTH -2
@@ -106,117 +115,122 @@ enum {
#define CDV EMU_VERSION_EX
static const struct cdrom_drive_types_s {
const char * vendor;
const char * model;
const char * revision;
const char * internal_name;
const char *vendor;
const char *model;
const char *revision;
const char *internal_name;
const int bus_type;
/* SCSI standard for SCSI (or both) devices, early for IDE. */
const int scsi_std;
const int speed;
const int inquiry_len;
const int caddy;
const int is_dvd;
const int transfer_max[4];
} cdrom_drive_types[] = {
{ EMU_NAME, "86B_CD", CDV, "86cd", BUS_TYPE_BOTH, 2, -1, 36, 0, { 4, 2, 2, 5 } },
{ EMU_NAME, "86B_CD", CDV, "86cd", BUS_TYPE_BOTH, 2, -1, 36, 0, 0, { 4, 2, 2, 5 } },
/* SCSI-1 / early ATAPI generic - second on purpose so the later variant is the default. */
{ EMU_NAME, "86B_CD", "1.00", "86cd100", BUS_TYPE_BOTH, 1, -1, 36, 1, { 0, -1, -1, -1 } },
{ EMU_NAME, "86B_CD", "1.00", "86cd100", BUS_TYPE_BOTH, 1, -1, 36, 1, 0, { 0, -1, -1, -1 } },
/* No difference from 86BOX CD-ROM, other than name - but enough people have requested such a name to warrant it. */
{ EMU_NAME, "86B_DVD", "4.30", "86dvd", BUS_TYPE_BOTH, 2, -1, 36, 0, { 4, 2, 2, 5 } },
{ "ASUS", "CD-S500/A", "1.41", "asus_500", BUS_TYPE_IDE, 0, 50, 36, 0, { 4, 2, 2, 2 } },
{ "ASUS", "CD-S520/A4", "1.32", "asus_520", BUS_TYPE_IDE, 0, 52, 36, 0, { 4, 2, 2, 2 } },
{ "AZT", "CDA46802I", "1.15", "azt_cda", BUS_TYPE_IDE, 0, 4, 36, 0, { 3, 0, 0, 0 } },
{ "BTC", "CD-ROM BCD36XH", "U1.0", "btc_36xh", BUS_TYPE_IDE, 0, 36, 36, 0, { 4, 2, 2, -1 } },
{ "GOLDSTAR", "CRD-8160B", "3.14", "goldstar", BUS_TYPE_IDE, 0, 16, 36, 0, { 4, 2, 2, -1 } },
{ EMU_NAME, "86B_DVD", "5.00", "86dvd", BUS_TYPE_BOTH, 2, -1, 36, 0, 1, { 4, 2, 2, 5 } },
{ "ASUS", "CD-S500/A", "1.41", "asus_500", BUS_TYPE_IDE, 0, 50, 36, 0, 0, { 4, 2, 2, 2 } },
{ "ASUS", "CD-S520/A4", "1.32", "asus_520", BUS_TYPE_IDE, 0, 52, 36, 0, 0, { 4, 2, 2, 2 } },
{ "AZT", "CDA46802I", "1.15", "azt_cda", BUS_TYPE_IDE, 0, 4, 36, 0, 0, { 3, 0, 0, 0 } },
{ "BTC", "CD-ROM BCD36XH", "U1.0", "btc_36xh", BUS_TYPE_IDE, 0, 36, 36, 0, 0, { 4, 2, 2, -1 } },
{ "GOLDSTAR", "CRD-8160B", "3.14", "goldstar", BUS_TYPE_IDE, 0, 16, 36, 0, 0, { 4, 2, 2, -1 } },
/* TODO: Find an IDENTIFY and/or INQUIRY dump. */
{ "GOLDSTAR", "GCD-R560B", "1.00", "goldstar", BUS_TYPE_IDE, 0, 6, 36, 0, { 4, 2, 2, -1 } },
{ "HITACHI", "CDR-8130", "0020", "hitachi_r8130", BUS_TYPE_IDE, 0, 16, 36, 0, { 4, 2, 2, -1 } },
{ "HITACHI", "GD-7500", "A1 ", "hitachi_7500", BUS_TYPE_IDE, 0, 40, 36, 0, { 4, 2, 2, 2 } }, /* DVD. */
{ "HL-DT-ST", "CD-ROM GCR-8526B", "1.01", "hldtst_8526b", BUS_TYPE_IDE, 0, 52, 36, 0, { 4, 2, 2, 2 } },
{ "HL-DT-ST", "DVDRAM GSA-4160", "A302", "hldtst_4160", BUS_TYPE_IDE, 0, 40, 36, 0, { 4, 2, 2, 2 } },
{ "KENWOOD", "CD-ROM UCR-421", "208E", "kenwood_421", BUS_TYPE_IDE, 0, 72, 36, 0, { 4, 2, 2, 4 } },
{ "GOLDSTAR", "GCD-R560B", "1.00", "goldstar", BUS_TYPE_IDE, 0, 6, 36, 0, 0, { 4, 2, 2, -1 } },
{ "HITACHI", "CDR-8130", "0020", "hitachi_r8130", BUS_TYPE_IDE, 0, 16, 36, 0, 0, { 4, 2, 2, -1 } },
{ "HITACHI", "GD-7500", "A1 ", "hitachi_7500", BUS_TYPE_IDE, 0, 40, 36, 0, 0, { 4, 2, 2, 2 } }, /* DVD. */
{ "HL-DT-ST", "CD-ROM GCR-8526B", "1.01", "hldtst_8526b", BUS_TYPE_IDE, 0, 52, 36, 0, 0, { 4, 2, 2, 2 } },
{ "HL-DT-ST", "DVDRAM GSA-4160", "A302", "hldtst_4160", BUS_TYPE_IDE, 0, 40, 36, 0, 0, { 4, 2, 2, 2 } },
{ "KENWOOD", "CD-ROM UCR-421", "208E", "kenwood_421", BUS_TYPE_IDE, 0, 72, 36, 0, 0, { 4, 2, 2, 4 } },
/*
This is a laptop/notebook drive, as is also evident from the name:
CRN = Notebook, CRD = Desktop.
*/
{ "LG", "CD-ROM CRN-8245B", "1.30", "lg_8245b", BUS_TYPE_IDE, 0, 24, 36, 0, { 4, 2, 2, -1 } },
{ "LG", "CD-ROM CRD-8322B", "1.06", "lg_8322b", BUS_TYPE_IDE, 0, 32, 36, 0, { 4, 2, 2, -1 } },
{ "LG", "CD-ROM CRN-8245B", "1.30", "lg_8245b", BUS_TYPE_IDE, 0, 24, 36, 0, 0, { 4, 2, 2, -1 } },
{ "LG", "CD-ROM CRD-8322B", "1.06", "lg_8322b", BUS_TYPE_IDE, 0, 32, 36, 0, 0, { 4, 2, 2, -1 } },
/* Nothing on Google, deduced 48x from the name. */
{ "LITE-ON", "LTN48125S", "1S07", "liteon_48125s", BUS_TYPE_IDE, 0, 48, 36, 0, { 4, 2, 2, 2 } },
{ "LITE-ON", "LTN48125S", "1S07", "liteon_48125s", BUS_TYPE_IDE, 0, 48, 36, 0, 0, { 4, 2, 2, 2 } },
/* Confirmed to be 52x, was the basis for deducing the other one's speed. */
{ "LITE-ON", "LTN526D", "YSR5", "liteon_526d", BUS_TYPE_IDE, 0, 52, 36, 0, { 4, 2, 2, 2 } },
{ "MATSHITA", "CD-ROM CR-583", "1.07", "matshita_583", BUS_TYPE_IDE, 0, 8, 36, 0, { 4, 2, 2, -1 } },
{ "MATSHITA", "CD-ROM CR-585", "Z18P", "matshita_585", BUS_TYPE_IDE, 0, 24, 36, 0, { 4, 2, 2, -1 } },
{ "MATSHITA", "CD-ROM CR-587", "7S13", "matshita_587", BUS_TYPE_IDE, 0, 24, 36, 0, { 4, 2, 2, -1 } },
{ "MATSHITA", "CD-ROM CR-588", "LS15", "matshita_588", BUS_TYPE_IDE, 0, 32, 36, 0, { 4, 2, 2, -1 } },
{ "MATSHITA", "CR-571", "1.0e", "matshita_571", BUS_TYPE_IDE, 0, 2, 36, 0, { 0, -1, -1, -1 } },
{ "MATSHITA", "CR-572", "1.0j", "matshita_572", BUS_TYPE_IDE, 0, 4, 36, 0, { 0, -1, -1, -1 } },
{ "MITSUMI", "CRMC-FX4820T", "D02A", "mitsumi_4820t", BUS_TYPE_IDE, 0, 48, 36, 0, { 4, 2, 2, 2 } },
{ "LITE-ON", "LTN526D", "YSR5", "liteon_526d", BUS_TYPE_IDE, 0, 52, 36, 0, 0, { 4, 2, 2, 2 } },
{ "MATSHITA", "CD-ROM CR-583", "1.07", "matshita_583", BUS_TYPE_IDE, 0, 8, 36, 0, 0, { 4, 2, 2, -1 } },
{ "MATSHITA", "CD-ROM CR-585", "Z18P", "matshita_585", BUS_TYPE_IDE, 0, 24, 36, 0, 0, { 4, 2, 2, -1 } },
{ "MATSHITA", "CD-ROM CR-587", "7S13", "matshita_587", BUS_TYPE_IDE, 0, 24, 36, 0, 0, { 4, 2, 2, -1 } },
{ "MATSHITA", "CD-ROM CR-588", "LS15", "matshita_588", BUS_TYPE_IDE, 0, 32, 36, 0, 0, { 4, 2, 2, -1 } },
{ "MATSHITA", "CR-571", "1.0e", "matshita_571", BUS_TYPE_IDE, 0, 2, 36, 0, 0, { 0, -1, -1, -1 } },
{ "MATSHITA", "CR-572", "1.0j", "matshita_572", BUS_TYPE_IDE, 0, 4, 36, 0, 0, { 0, -1, -1, -1 } },
{ "MITSUMI", "CRMC-FX4820T", "D02A", "mitsumi_4820t", BUS_TYPE_IDE, 0, 48, 36, 0, 0, { 4, 2, 2, 2 } },
/* TODO: Find an IDENTIFY and/or INQUIRY dump. */
{ "MITSUMI", "CRMC-FX810T4", "????", "mitsumi_810t4", BUS_TYPE_IDE, 0, 8, 36, 0, { 4, 2, 2, -1 } },
{ "NEC", "CD-ROM DRIVE:260", "1.00", "nec_260_early", BUS_TYPE_IDE, 1, 2, 36, 1, { 0, -1, -1, -1 } },
{ "NEC", "CD-ROM DRIVE:260", "1.01", "nec_260", BUS_TYPE_IDE, 1, 4, 36, 1, { 0, -1, -1, -1 } },
{ "NEC", "CD-ROM DRIVE:273", "4.20", "nec_273", BUS_TYPE_IDE, 0, 4, 36, 0, { 0, -1, -1, -1 } },
{ "NEC", "CD-ROM DRIVE:280", "1.05", "nec_280_early", BUS_TYPE_IDE, 0, 6, 36, 1, { 4, 2, 2, -1 } },
{ "NEC", "CD-ROM DRIVE:280", "3.08", "nec_280", BUS_TYPE_IDE, 0, 8, 36, 1, { 4, 2, 2, -1 } },
{ "NEC", "CDR-1300A", "1.05", "nec_1300a", BUS_TYPE_IDE, 0, 6, 36, 0, { 4, 2, 2, -1 } },
{ "NEC", "CDR-1900A", "1.00", "nec_1900a", BUS_TYPE_IDE, 0, 32, 36, 0, { 4, 2, 2, -1 } },
{ "PHILIPS", "CD-ROM PCA403CD", "U31P", "philips_403", BUS_TYPE_IDE, 0, 40, 36, 0, { 4, 2, 2, -1 } },
{ "SONY", "CD-ROM CDU76", "1.0i", "sony_76", BUS_TYPE_IDE, 0, 4, 36, 0, { 2, -1, -1, -1 } },
{ "SONY", "CD-ROM CDU311", "3.0h", "sony_311", BUS_TYPE_IDE, 0, 8, 36, 0, { 3, 2, 1, -1 } },
{ "SONY", "CD-ROM CDU5225", "NYS4", "sony_5225", BUS_TYPE_IDE, 0, 52, 36, 0, { 4, 2, 2, 4 } },
{ "TEAC", "CD-516E", "1.0G", "teac_516e", BUS_TYPE_IDE, 0, 16, 36, 0, { 3, 2, 2, -1 } },
{ "TEAC", "CD-524EA", "3.0D", "teac_524ea", BUS_TYPE_IDE, 0, 24, 36, 0, { 3, 2, 2, -1 } },
{ "TEAC", "CD-532E", "2.0A", "teac_532e", BUS_TYPE_IDE, 0, 32, 36, 0, { 3, 2, 2, -1 } },
{ "TOSHIBA", "CD-ROM XM-5302TA", "0305", "toshiba_5302ta", BUS_TYPE_IDE, 0, 4, 96, 0, { 0, -1, -1, -1 } },
{ "TOSHIBA", "CD-ROM XM-5702B", "TA70", "toshiba_5702b", BUS_TYPE_IDE, 0, 12, 96, 0, { 3, 2, 1, -1 } },
{ "TOSHIBA", "CD-ROM XM-6202B", "1512", "toshiba_6202b", BUS_TYPE_IDE, 0, 32, 96, 0, { 4, 2, 2, -1 } },
{ "TOSHIBA", "CD-ROM XM-6402B", "1008", "toshiba_6402b", BUS_TYPE_IDE, 0, 32, 96, 0, { 4, 2, 2, 2 } },
{ "TOSHIBA", "CD-ROM XM-6702B", "1007", "toshiba_6720b", BUS_TYPE_IDE, 0, 48, 96, 0, { 4, 2, 2, 2 } },
{ "TOSHIBA", "DVD-ROM SD-M1802", "1051", "toshiba_m1802", BUS_TYPE_IDE, 0, 48, 96, 0, { 4, 2, 2, 2 } },
{ "CHINON", "CD-ROM CDS-431", "H42 ", "chinon_431", BUS_TYPE_SCSI, 1, 1, 36, 1, { -1, -1, -1, -1 } },
{ "CHINON", "CD-ROM CDX-435", "M62 ", "chinon_435", BUS_TYPE_SCSI, 1, 2, 36, 1, { -1, -1, -1, -1 } },
{ "DEC", "RRD45 (C) DEC", "0436", "dec_45", BUS_TYPE_SCSI, 1, 4, 36, 0, { -1, -1, -1, -1 } },
{ "MATSHITA", "CD-ROM CR-501", "1.0b", "matshita_501", BUS_TYPE_SCSI, 1, 1, 36, 1, { -1, -1, -1, -1 } },
{ "NEC", "CD-ROM DRIVE:25", "1.0a", "nec_25", BUS_TYPE_SCSI, 1, 2, 36, 0, { -1, -1, -1, -1 } },
{ "NEC", "CD-ROM DRIVE:38", "1.00", "nec_38", BUS_TYPE_SCSI, 2, 1, 36, 0, { -1, -1, -1, -1 } },
{ "MITSUMI", "CRMC-FX810T4", "????", "mitsumi_810t4", BUS_TYPE_IDE, 0, 8, 36, 0, 0, { 4, 2, 2, -1 } },
{ "NEC", "CD-ROM DRIVE:260", "1.00", "nec_260_early", BUS_TYPE_IDE, 1, 2, 36, 1, 0, { 0, -1, -1, -1 } },
{ "NEC", "CD-ROM DRIVE:260", "1.01", "nec_260", BUS_TYPE_IDE, 1, 4, 36, 1, 0, { 0, -1, -1, -1 } },
{ "NEC", "CD-ROM DRIVE:273", "4.20", "nec_273", BUS_TYPE_IDE, 0, 4, 36, 0, 0, { 0, -1, -1, -1 } },
{ "NEC", "CD-ROM DRIVE:280", "1.05", "nec_280_early", BUS_TYPE_IDE, 0, 6, 36, 1, 0, { 4, 2, 2, -1 } },
{ "NEC", "CD-ROM DRIVE:280", "3.08", "nec_280", BUS_TYPE_IDE, 0, 8, 36, 1, 0, { 4, 2, 2, -1 } },
{ "NEC", "CDR-1300A", "1.05", "nec_1300a", BUS_TYPE_IDE, 0, 6, 36, 0, 0, { 4, 2, 2, -1 } },
{ "NEC", "CDR-1900A", "1.00", "nec_1900a", BUS_TYPE_IDE, 0, 32, 36, 0, 0, { 4, 2, 2, -1 } },
{ "PHILIPS", "CD-ROM PCA403CD", "U31P", "philips_403", BUS_TYPE_IDE, 0, 40, 36, 0, 0, { 4, 2, 2, -1 } },
{ "SONY", "CD-ROM CDU76", "1.0i", "sony_76", BUS_TYPE_IDE, 0, 4, 36, 0, 0, { 2, -1, -1, -1 } },
{ "SONY", "CD-ROM CDU311", "3.0h", "sony_311", BUS_TYPE_IDE, 0, 8, 36, 0, 0, { 3, 2, 1, -1 } },
{ "SONY", "CD-ROM CDU5225", "NYS4", "sony_5225", BUS_TYPE_IDE, 0, 52, 36, 0, 0, { 4, 2, 2, 4 } },
{ "TEAC", "CD-516E", "1.0G", "teac_516e", BUS_TYPE_IDE, 0, 16, 36, 0, 0, { 3, 2, 2, -1 } },
{ "TEAC", "CD-524EA", "3.0D", "teac_524ea", BUS_TYPE_IDE, 0, 24, 36, 0, 0, { 3, 2, 2, -1 } },
{ "TEAC", "CD-532E", "2.0A", "teac_532e", BUS_TYPE_IDE, 0, 32, 36, 0, 0, { 3, 2, 2, -1 } },
{ "TOSHIBA", "CD-ROM XM-5302TA", "0305", "toshiba_5302ta", BUS_TYPE_IDE, 0, 4, 96, 0, 0, { 0, -1, -1, -1 } },
{ "TOSHIBA", "CD-ROM XM-5702B", "TA70", "toshiba_5702b", BUS_TYPE_IDE, 0, 12, 96, 0, 0, { 3, 2, 1, -1 } },
{ "TOSHIBA", "CD-ROM XM-6202B", "1512", "toshiba_6202b", BUS_TYPE_IDE, 0, 32, 96, 0, 0, { 4, 2, 2, -1 } },
{ "TOSHIBA", "CD-ROM XM-6402B", "1008", "toshiba_6402b", BUS_TYPE_IDE, 0, 32, 96, 0, 0, { 4, 2, 2, 2 } },
{ "TOSHIBA", "CD-ROM XM-6702B", "1007", "toshiba_6720b", BUS_TYPE_IDE, 0, 48, 96, 0, 0, { 4, 2, 2, 2 } },
{ "TOSHIBA", "DVD-ROM SD-M1802", "1051", "toshiba_m1802", BUS_TYPE_IDE, 0, 48, 96, 0, 1, { 4, 2, 2, 2 } },
{ "CHINON", "CD-ROM CDS-431", "H42 ", "chinon_431", BUS_TYPE_SCSI, 1, 1, 36, 1, 0, { -1, -1, -1, -1 } },
{ "CHINON", "CD-ROM CDX-435", "M62 ", "chinon_435", BUS_TYPE_SCSI, 1, 2, 36, 1, 0, { -1, -1, -1, -1 } },
{ "DEC", "RRD45 (C) DEC", "0436", "dec_45", BUS_TYPE_SCSI, 1, 4, 36, 0, 0, { -1, -1, -1, -1 } },
{ "MATSHITA", "CD-ROM CR-501", "1.0b", "matshita_501", BUS_TYPE_SCSI, 1, 1, 36, 1, 0, { -1, -1, -1, -1 } },
{ "NEC", "CD-ROM DRIVE:25", "1.0a", "nec_25", BUS_TYPE_SCSI, 1, 2, 36, 0, 0, { -1, -1, -1, -1 } },
{ "NEC", "CD-ROM DRIVE:38", "1.00", "nec_38", BUS_TYPE_SCSI, 2, 1, 36, 0, 0, { -1, -1, -1, -1 } },
/* The speed of the following two is guesswork based on the CDR-74. */
{ "NEC", "CD-ROM DRIVE:75", "1.03", "nec_75", BUS_TYPE_SCSI, 1, 1, 36, 1, { -1, -1, -1, -1 } },
{ "NEC", "CD-ROM DRIVE:77", "1.06", "nec_77", BUS_TYPE_SCSI, 1, 1, 36, 1, { -1, -1, -1, -1 } },
{ "NEC", "CD-ROM DRIVE:211", "1.00", "nec_211", BUS_TYPE_SCSI, 2, 3, 36, 0, { -1, -1, -1, -1 } },
{ "NEC", "CD-ROM DRIVE:75", "1.03", "nec_75", BUS_TYPE_SCSI, 1, 1, 36, 1, 0, { -1, -1, -1, -1 } },
{ "NEC", "CD-ROM DRIVE:77", "1.06", "nec_77", BUS_TYPE_SCSI, 1, 1, 36, 1, 0, { -1, -1, -1, -1 } },
{ "NEC", "CD-ROM DRIVE:211", "1.00", "nec_211", BUS_TYPE_SCSI, 2, 3, 36, 0, 0, { -1, -1, -1, -1 } },
/* The speed of the following two is guesswork based on the CDR-400. */
{ "NEC", "CD-ROM DRIVE:464", "1.05", "nec_464", BUS_TYPE_SCSI, 2, 3, 36, 0, { -1, -1, -1, -1 } },
{ "NEC", "CD-ROM DRIVE:464", "1.05", "nec_464", BUS_TYPE_SCSI, 2, 3, 36, 0, 0, { -1, -1, -1, -1 } },
/* The speed of the following two is guesswork based on the name. */
{ "ShinaKen", "CD-ROM DM-3x1S", "1.04", "shinaken_3x1s", BUS_TYPE_SCSI, 1, 3, 36, 0, { -1, -1, -1, -1 } },
{ "SONY", "CD-ROM CDU-541", "1.0i", "sony_541", BUS_TYPE_SCSI, 1, 1, 36, 1, { -1, -1, -1, -1 } },
{ "SONY", "CD-ROM CDU-561", "1.8k", "sony_561", BUS_TYPE_SCSI, 2, 2, 36, 1, { -1, -1, -1, -1 } },
{ "SONY", "CD-ROM CDU-76S", "1.00", "sony_76s", BUS_TYPE_SCSI, 2, 4, 36, 0, { -1, -1, -1, -1 } },
{ "PHILIPS", "CDD2600", "1.07", "philips_2600", BUS_TYPE_SCSI, 2, 6, 36, 0, { -1, -1, -1, -1 } },
{ "ShinaKen", "CD-ROM DM-3x1S", "1.04", "shinaken_3x1s", BUS_TYPE_SCSI, 1, 3, 36, 0, 0, { -1, -1, -1, -1 } },
{ "SONY", "CD-ROM CDU-541", "1.0i", "sony_541", BUS_TYPE_SCSI, 1, 1, 36, 1, 0, { -1, -1, -1, -1 } },
{ "SONY", "CD-ROM CDU-561", "1.8k", "sony_561", BUS_TYPE_SCSI, 2, 2, 36, 1, 0, { -1, -1, -1, -1 } },
{ "SONY", "CD-ROM CDU-76S", "1.00", "sony_76s", BUS_TYPE_SCSI, 2, 4, 36, 0, 0, { -1, -1, -1, -1 } },
{ "PHILIPS", "CDD2600", "1.07", "philips_2600", BUS_TYPE_SCSI, 2, 6, 36, 0, 0, { -1, -1, -1, -1 } },
/* NOTE: The real thing is a CD changer drive! */
{ "PIONEER", "CD-ROM DRM-604X", "2403", "pioneer_604x", BUS_TYPE_SCSI, 2, 4, 47, 0, { -1, -1, -1, -1 } },
{ "PLEXTOR", "CD-ROM PX-32TS", "1.03", "plextor_32ts", BUS_TYPE_SCSI, 2, 32, 36, 0, { -1, -1, -1, -1 } },
{ "PIONEER", "CD-ROM DRM-604X", "2403", "pioneer_604x", BUS_TYPE_SCSI, 2, 4, 47, 0, 0, { -1, -1, -1, -1 } },
{ "PLEXTOR", "CD-ROM PX-32TS", "1.03", "plextor_32ts", BUS_TYPE_SCSI, 2, 32, 36, 0, 0, { -1, -1, -1, -1 } },
/* The speed of the following two is guesswork based on the R55S. */
{ "TEAC", "CD 50", "1.00", "teac_50", BUS_TYPE_SCSI, 2, 4, 36, 1, { -1, -1, -1, -1 } },
{ "TEAC", "CD-ROM R55S", "1.0R", "teac_55s", BUS_TYPE_SCSI, 2, 4, 36, 0, { -1, -1, -1, -1 } },
{ "TEAC", "CD 50", "1.00", "teac_50", BUS_TYPE_SCSI, 2, 4, 36, 1, 0, { -1, -1, -1, -1 } },
{ "TEAC", "CD-ROM R55S", "1.0R", "teac_55s", BUS_TYPE_SCSI, 2, 4, 36, 0, 0, { -1, -1, -1, -1 } },
/* Texel is Plextor according to Plextor's own EU website. */
{ "TEXEL", "CD-ROM DM-3024", "1.00", "texel_3024", BUS_TYPE_SCSI, 2, 2, 36, 1, { -1, -1, -1, -1 } },
{ "TEXEL", "CD-ROM DM-3024", "1.00", "texel_3024", BUS_TYPE_SCSI, 2, 2, 36, 1, 0, { -1, -1, -1, -1 } },
/*
Unusual 2.23x according to Google, I'm rounding it upwards to 3x.
Assumed caddy based on the DM-3024.
*/
{ "TEXEL", "CD-ROM DM-3028", "1.06", "texel_3028", BUS_TYPE_SCSI, 2, 3, 36, 1, { -1, -1, -1, -1 } }, /* Caddy. */
{ "TEXEL", "CD-ROM DM-3028", "1.06", "texel_3028", BUS_TYPE_SCSI, 2, 3, 36, 1, 0, { -1, -1, -1, -1 } }, /* Caddy. */
/*
The characteristics are a complete guesswork because I can't find
this one on Google.
Also, INQUIRY length is always 96 on these Toshiba drives.
*/
{ "TOSHIBA", "CD-ROM DRIVE:XM", "3433", "toshiba_xm", BUS_TYPE_SCSI, 2, 2, 96, 0, { -1, -1, -1, -1 } }, /* Tray. */
{ "TOSHIBA", "CD-ROM XM-3201B", "3232", "toshiba_3201b", BUS_TYPE_SCSI, 1, 1, 96, 1, { -1, -1, -1, -1 } }, /* Caddy. */
{ "TOSHIBA", "CD-ROM XM-3301TA", "0272", "toshiba_3301ta", BUS_TYPE_SCSI, 2, 2, 96, 0, { -1, -1, -1, -1 } }, /* Tray. */
{ "TOSHIBA", "CD-ROM XM-5701TA", "3136", "toshiba_5701a", BUS_TYPE_SCSI, 2, 12, 96, 0, { -1, -1, -1, -1 } }, /* Tray. */
{ "TOSHIBA", "DVD-ROM SD-M1401", "1008", "toshiba_m1401", BUS_TYPE_SCSI, 2, 40, 96, 0, { -1, -1, -1, -1 } }, /* Tray. */
{ "", "", "", "", BUS_TYPE_NONE, 0, -1, 0, 0, { -1, -1, -1, -1 } }
{ "TOSHIBA", "CD-ROM DRIVE:XM", "3433", "toshiba_xm", BUS_TYPE_SCSI, 2, 2, 96, 0, 0, { -1, -1, -1, -1 } }, /* Tray. */
{ "TOSHIBA", "CD-ROM XM-3201B", "3232", "toshiba_3201b", BUS_TYPE_SCSI, 1, 1, 96, 1, 0, { -1, -1, -1, -1 } }, /* Caddy. */
{ "TOSHIBA", "CD-ROM XM-3301TA", "0272", "toshiba_3301ta", BUS_TYPE_SCSI, 2, 2, 96, 0, 0, { -1, -1, -1, -1 } }, /* Tray. */
{ "TOSHIBA", "CD-ROM XM-5701TA", "3136", "toshiba_5701a", BUS_TYPE_SCSI, 2, 12, 96, 0, 0, { -1, -1, -1, -1 } }, /* Tray. */
{ "TOSHIBA", "DVD-ROM SD-M1401", "1008", "toshiba_m1401", BUS_TYPE_SCSI, 2, 40, 96, 0, 1, { -1, -1, -1, -1 } }, /* Tray. */
{ "MATSHITA", "CR-562", "0.75", "cr562", BUS_TYPE_MKE , 0, 2, 0, 0, 0, { -1, -1, -1, -1 } },
{ "MATSHITA", "CR-562", "0.80", "cr562_080", BUS_TYPE_MKE , 0, 2, 0, 0, 0, { -1, -1, -1, -1 } },
{ "MATSHITA", "CR-563", "0.75", "cr563", BUS_TYPE_MKE , 0, 2, 0, 0, 0, { -1, -1, -1, -1 } },
{ "MATSHITA", "CR-563", "0.80", "cr563_080", BUS_TYPE_MKE , 0, 2, 0, 0, 0, { -1, -1, -1, -1 } },
{ "", "", "", "", BUS_TYPE_NONE, 0, -1, 0, 0, 0, { -1, -1, -1, -1 } }
};
/* To shut up the GCC compilers. */
@@ -283,7 +297,7 @@ typedef struct cdrom {
union {
uint8_t res;
uint8_t res0; /* Reserved for other ID's. */
uint8_t res1;
uint8_t mke_channel;
uint8_t ide_channel;
uint8_t scsi_device_id;
};
@@ -296,7 +310,7 @@ typedef struct cdrom {
uint8_t speed;
uint8_t cur_speed;
void * priv;
void *priv;
char image_path[1024];
char prev_image_path[1280];
@@ -322,10 +336,10 @@ typedef struct cdrom {
const cdrom_ops_t *ops;
char * image_history[CD_IMAGE_HISTORY];
char *image_history[CD_IMAGE_HISTORY];
void * local;
void * log;
void *local;
void *log;
void (*insert)(void *priv);
void (*close)(void *priv);
@@ -351,6 +365,13 @@ typedef struct cdrom {
/* Only used on Windows hosts for disc change notifications. */
uint8_t host_letter;
uint8_t mode2;
uint8_t _F_LUT[_LUT_SIZE];
uint8_t _B_LUT[_LUT_SIZE];
uint8_t p_parity[172];
uint8_t q_parity[104];
} cdrom_t;
extern cdrom_t cdrom[CDROM_NUM];
@@ -374,6 +395,7 @@ extern void cdrom_get_model(const int type, char *name, const int id)
extern char *cdrom_get_revision(const int type);
extern int cdrom_get_scsi_std(const int type);
extern int cdrom_is_early(const int type);
extern int cdrom_is_dvd(const int type);
extern int cdrom_is_generic(const int type);
extern int cdrom_is_caddy(const int type);
extern int cdrom_get_speed(const int type);
@@ -381,6 +403,7 @@ extern int cdrom_get_inquiry_len(const int type);
extern int cdrom_has_dma(const int type);
extern int cdrom_get_transfer_max(const int type, const int mode);
extern int cdrom_get_type_count(void);
extern void cdrom_generate_name_mke(const int type, char *name);
extern void cdrom_get_identify_model(const int type, char *name, const int id);
extern void cdrom_get_name(const int type, char *name);
extern char *cdrom_get_internal_name(const int type);
@@ -448,6 +471,12 @@ extern int cdrom_is_empty(const uint8_t id);
extern void cdrom_eject(const uint8_t id);
extern void cdrom_reload(const uint8_t id);
extern void cdrom_compute_ecc_block(cdrom_t *dev, uint8_t *parity, const uint8_t *data,
uint32_t major_count, uint32_t minor_count,
uint32_t major_mult, uint32_t minor_inc, int m2f1);
extern unsigned long cdrom_crc32(unsigned long crc, const unsigned char *buf,
size_t len);
extern int cdrom_assigned_letters;
#ifdef __cplusplus

View File

@@ -33,6 +33,6 @@ typedef struct track_file_t {
int motorola;
} track_file_t;
extern void * image_open(cdrom_t *dev, const char *path);
extern void *image_open(cdrom_t *dev, const char *path);
#endif /*CDROM_IMAGE_H*/

View File

@@ -8,11 +8,11 @@
*
* Mitsumi CD-ROM emulation for the ISA bus.
*
*
*
* Authors: Miran Grca, <mgrca8@gmail.com>
* Jasmine Iwanek, <jriwanek@gmail.com>
*
* Copyright 2022 Miran Grca.
* Copyright 2022 Miran Grca.
* Copyright 2024-2025 Jasmine Iwanek.
*/
#ifndef CDROM_MITSUMI_H
#define CDROM_MITSUMI_H

View File

@@ -0,0 +1,24 @@
/*
* 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.
*
* Panasonic/MKE CD-ROM emulation for the ISA bus.
*
* Authors: Miran Grca, <mgrca8@gmail.com>
* Cacodemon345
*
* Copyright 2022-2025 Miran Grca.
* Copyright 2025 Cacodemon345.
*/
#ifndef CDROM_MKE_H
#define CDROM_MKE_H
extern const device_t mke_cdrom_device;
extern const device_t mke_cdrom_noncreative_device;
#endif /*CDROM_MKE_H*/

View File

@@ -18,6 +18,7 @@
#define EMU_CHIPSET_H
/* ACC */
extern const device_t acc2036_device;
extern const device_t acc2168_device;
/* ALi */
@@ -37,6 +38,9 @@ extern const device_t ali6117d_device;
/* AMD */
extern const device_t amd640_device;
/* ASUS */
extern const device_t isa486c_device;
/* Compaq */
extern const device_t compaq_386_device;
extern const device_t compaq_genoa_device;
@@ -52,6 +56,7 @@ extern const device_t neat_sx_device;
extern const device_t scat_device;
extern const device_t scat_4_device;
extern const device_t scat_sx_device;
extern const device_t cs8220_device;
extern const device_t cs8230_device;
extern const device_t cs4031_device;
@@ -109,6 +114,9 @@ extern const device_t slc90e66_device;
extern const device_t ioapic_device;
/* Olivetti */
extern const device_t olivetti_eva_device;
/* OPTi */
extern const device_t opti283_device;
extern const device_t opti291_device;
@@ -116,7 +124,9 @@ extern const device_t opti381_device;
extern const device_t opti391_device;
extern const device_t opti481_device;
extern const device_t opti493_device;
extern const device_t opti495_device;
extern const device_t opti495slc_device;
extern const device_t opti495sx_device;
extern const device_t opti498_device;
extern const device_t opti499_device;
extern const device_t opti601_device;
extern const device_t opti602_device;
@@ -156,6 +166,9 @@ extern const device_t stpc_atlas_device;
extern const device_t stpc_serial_device;
extern const device_t stpc_lpt_device;
/* Symphony */
extern const device_t sl82c461_device;
/* UMC */
extern const device_t umc_8886f_device;
extern const device_t umc_8886af_device;
@@ -191,12 +204,12 @@ extern const device_t vlsi_scamp_device;
extern const device_t wd76c10_device;
/* Miscellaneous Hardware */
extern const device_t tulip_jumper_device;
extern const device_t dell_jumper_device;
extern const device_t nec_mate_unk_device;
extern const device_t phoenix_486_jumper_device;
extern const device_t phoenix_486_jumper_pci_device;
#ifdef USE_OLIVETTI
extern const device_t olivetti_eva_device;
#endif /* USE_OLIVETTI */
#endif /*EMU_CHIPSET_H*/

View File

@@ -122,6 +122,7 @@ typedef struct config_t {
int ide_qua_enabled; /* Quaternary IDE controller enabled */
int bugger_enabled; /* ISA bugger device enabled */
int isa_rtc_type; /* ISA RTC card */
int isa_rom_type[ISAROM_MAX]; /* ISA ROM boards */
int isa_mem_type[ISAMEM_MAX]; /* ISA memory boards */
/* Hard disks category */
@@ -132,7 +133,7 @@ typedef struct config_t {
/* Other removable devices category */
storage_cfg_t cdrom[CDROM_NUM]; /* CD-ROM drives */
storage_cfg_t rdisk[ZIP_NUM]; /* Removable disk drives */
storage_cfg_t rdisk[RDISK_NUM]; /* Removable disk drives */
} config_t;
#endif

View File

@@ -239,6 +239,8 @@ extern const char *device_get_internal_name(const device_t *dev);
extern int machine_get_config_int(char *str);
extern const char *machine_get_config_string(char *str);
extern int machine_device_available(const device_t *dev);
extern const device_t device_none;
extern const device_t device_internal;

View File

@@ -38,26 +38,27 @@
#define FDC_QUATERNARY_IRQ 6
#define FDC_QUATERNARY_DMA 2
#define FDC_FLAG_PCJR 0x01 /* PCjr */
#define FDC_FLAG_DISKCHG_ACTLOW 0x02 /* Amstrad, PS/1, PS/2 ISA */
#define FDC_FLAG_AT 0x04 /* AT+, PS/x */
#define FDC_FLAG_PS2 0x08 /* PS/1, PS/2 ISA */
#define FDC_FLAG_PS2_MCA 0x10 /* PS/2 MCA */
#define FDC_FLAG_SUPERIO 0x20 /* Super I/O chips */
#define FDC_FLAG_START_RWC_1 0x40 /* W83877F, W83977F */
#define FDC_FLAG_MORE_TRACKS 0x80 /* W83877F, W83977F, PC87306, PC87309 */
#define FDC_FLAG_NSC 0x100 /* PC87306, PC87309 */
#define FDC_FLAG_TOSHIBA 0x200 /* T1000, T1200 */
#define FDC_FLAG_AMSTRAD 0x400 /* Non-AT Amstrad machines */
#define FDC_FLAG_UMC 0x800 /* UMC UM8398 */
#define FDC_FLAG_ALI 0x1000 /* ALi M512x / M1543C */
#define FDC_FLAG_NO_DSR_RESET 0x2000 /* Has no DSR reset */
#define FDC_FLAG_DENSEL_INVERT 0x4000 /* Invert DENSEL polarity */
#define FDC_FLAG_FINTR 0x8000 /* Raise FINTR on data command finish */
#define FDC_FLAG_NEC 0x10000 /* Is NEC upd765-compatible */
#define FDC_FLAG_SEC 0x20000 /* Is Secondary */
#define FDC_FLAG_TER 0x40000 /* Is Tertiary */
#define FDC_FLAG_QUA 0x80000 /* Is Quaternary */
#define FDC_FLAG_PCJR 0x01 /* PCjr */
#define FDC_FLAG_DISKCHG_ACTLOW 0x02 /* Amstrad, PS/1, PS/2 ISA */
#define FDC_FLAG_AT 0x04 /* AT+, PS/x */
#define FDC_FLAG_PS2 0x08 /* PS/1, PS/2 ISA */
#define FDC_FLAG_PS2_MCA 0x10 /* PS/2 MCA */
#define FDC_FLAG_SUPERIO 0x20 /* Super I/O chips */
#define FDC_FLAG_START_RWC_1 0x40 /* W83877F, W83977F */
#define FDC_FLAG_MORE_TRACKS 0x80 /* W83877F, W83977F, PC87306, PC87309 */
#define FDC_FLAG_NSC 0x100 /* PC87306, PC87309 */
#define FDC_FLAG_TOSHIBA 0x200 /* T1000, T1200 */
#define FDC_FLAG_AMSTRAD 0x400 /* Non-AT Amstrad machines */
#define FDC_FLAG_UMC 0x800 /* UMC UM8398 */
#define FDC_FLAG_ALI 0x1000 /* ALi M512x / M1543C */
#define FDC_FLAG_NO_DSR_RESET 0x2000 /* Has no DSR reset */
#define FDC_FLAG_DENSEL_INVERT 0x4000 /* Invert DENSEL polarity */
#define FDC_FLAG_FINTR 0x8000 /* Raise FINTR on data command finish */
#define FDC_FLAG_NEC 0x10000 /* Is NEC upd765-compatible */
#define FDC_FLAG_SEC 0x20000 /* Is Secondary */
#define FDC_FLAG_TER 0x40000 /* Is Tertiary */
#define FDC_FLAG_QUA 0x80000 /* Is Quaternary */
#define FDC_FLAG_SMC661 0x100000 /* SM(s)C FDC37C661 - different TDR enhanced mode */
typedef struct fdc_t {
uint8_t dor;
@@ -119,6 +120,8 @@ typedef struct fdc_t {
uint8_t lock;
uint8_t dsr;
uint8_t media_id;
uint8_t params[15];
uint8_t specify[2];
uint8_t res[11];
@@ -166,6 +169,9 @@ extern void fdc_3f1_enable(fdc_t *fdc, int enable);
extern int fdc_get_bit_rate(fdc_t *fdc);
extern int fdc_get_bitcell_period(fdc_t *fdc);
extern uint8_t fdc_get_media_id(fdc_t *fdc, int id);
extern void fdc_set_media_id(fdc_t *fdc, int id, int set);
/* A few functions to communicate between Super I/O chips and the FDC. */
extern void fdc_update_enh_mode(fdc_t *fdc, int enh_mode);
extern int fdc_get_rwc(fdc_t *fdc, int drive);
@@ -177,6 +183,7 @@ extern uint8_t fdc_get_densel_polarity(fdc_t *fdc);
extern void fdc_update_densel_force(fdc_t *fdc, int densel_force);
extern void fdc_update_drvrate(fdc_t *fdc, int drive, int drvrate);
extern void fdc_update_drv2en(fdc_t *fdc, int drv2en);
extern void fdc_toggle_flag(fdc_t *fdc, int flag, int on);
extern void fdc_noidam(fdc_t *fdc);
extern void fdc_nosector(fdc_t *fdc);
@@ -201,6 +208,7 @@ extern int fdc_get_drive(fdc_t *fdc);
extern int fdc_get_perp(fdc_t *fdc);
extern int fdc_get_format_n(fdc_t *fdc);
extern int fdc_is_mfm(fdc_t *fdc);
extern int fdc_is_dma(fdc_t *fdc);
extern double fdc_get_hut(fdc_t *fdc);
extern double fdc_get_hlt(fdc_t *fdc);
extern void fdc_request_next_sector_id(fdc_t *fdc);
@@ -215,6 +223,11 @@ extern uint8_t fdc_get_diswr(fdc_t *fdc);
extern void fdc_set_diswr(fdc_t *fdc, uint8_t diswr);
extern uint8_t fdc_get_swap(fdc_t *fdc);
extern void fdc_set_swap(fdc_t *fdc, uint8_t swap);
extern void fdc_set_flags(fdc_t *fdc, int flags);
extern void fdc_clear_flags(fdc_t *fdc, int flags);
extern void fdc_set_fdd_changed(int drive, int changed);
extern uint8_t fdc_get_fdd_changed(int drive);
extern uint8_t fdc_get_shadow(fdc_t *fdc);
extern void fdc_finishcompare(fdc_t *fdc, int satisfying);
extern void fdc_finishread(fdc_t *fdc);
@@ -254,6 +267,7 @@ extern const device_t fdc_at_sec_device;
extern const device_t fdc_at_ter_device;
extern const device_t fdc_at_qua_device;
extern const device_t fdc_at_actlow_device;
extern const device_t fdc_at_smc_661_device;
extern const device_t fdc_at_smc_device;
extern const device_t fdc_at_ali_device;
extern const device_t fdc_at_winbond_device;

View File

@@ -20,6 +20,7 @@
#ifndef EMU_FLASH_H
#define EMU_FLASH_H
extern const device_t amd_am28f010_flash_device;
extern const device_t catalyst_flash_device;
extern const device_t intel_flash_bxt_ami_device;

View File

@@ -15,7 +15,7 @@
*
* Copyright 2016-2022 Miran Grca.
* Copyright 2008-2018 Sarah Walker.
* Copyright 2021 RichardG.
* Copyright 2021 RichardG.
* Copyright 2021-2025 Jasmine Iwanek.
*/
#ifndef EMU_GAMEPORT_H
@@ -51,8 +51,29 @@
#define GAMEPORT_6ADDR 0x060000
#define GAMEPORT_8ADDR 0x080000
#define GAMEPORT_SIO 0x1000000
#define GAMEPORT_PNPROM 0x2000000
typedef struct plat_joystick_t {
typedef struct joystick_t {
const char *name;
const char *internal_name;
void *(*init)(void);
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;
int pov_count;
int max_joysticks;
const char *axis_names[MAX_JOY_AXES];
const char *button_names[MAX_JOY_BUTTONS];
const char *pov_names[MAX_JOY_POVS];
} joystick_t;
typedef struct plat_joystick_state_t {
char name[260];
int a[MAX_JOY_AXES];
@@ -77,9 +98,9 @@ typedef struct plat_joystick_t {
int nr_axes;
int nr_buttons;
int nr_povs;
} plat_joystick_t;
} plat_joystick_state_t;
typedef struct joystick_t {
typedef struct joystick_state_t {
int axis[MAX_JOY_AXES];
int button[MAX_JOY_BUTTONS];
int pov[MAX_JOY_POVS];
@@ -88,27 +109,7 @@ typedef struct joystick_t {
int axis_mapping[MAX_JOY_AXES];
int button_mapping[MAX_JOY_BUTTONS];
int pov_mapping[MAX_JOY_POVS][2];
} joystick_t;
typedef struct joystick_if_t {
const char *name;
const char *internal_name;
void *(*init)(void);
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;
int pov_count;
int max_joysticks;
const char *axis_names[MAX_JOY_AXES];
const char *button_names[MAX_JOY_BUTTONS];
const char *pov_names[MAX_JOY_POVS];
} joystick_if_t;
} joystick_state_t;
extern device_t game_ports[GAMEPORT_MAX];
@@ -126,6 +127,7 @@ extern int gameport_get_from_internal_name(const char *str);
#ifdef EMU_DEVICE_H
extern const device_t gameport_device;
extern const device_t gameport_200_device;
extern const device_t gameport_201_device;
extern const device_t gameport_203_device;
extern const device_t gameport_205_device;
@@ -144,10 +146,10 @@ extern const device_t gameport_sio_1io_device;
extern const device_t *standalone_gameport_type;
#endif
extern int gameport_instance_id;
extern plat_joystick_t plat_joystick_state[MAX_PLAT_JOYSTICKS];
extern joystick_t joystick_state[GAMEPORT_MAX][MAX_JOYSTICKS];
extern int joysticks_present;
extern int gameport_instance_id;
extern plat_joystick_state_t plat_joystick_state[MAX_PLAT_JOYSTICKS];
extern joystick_state_t joystick_state[GAMEPORT_MAX][MAX_JOYSTICKS];
extern int joysticks_present;
extern int joystick_type;
@@ -170,29 +172,28 @@ extern void gameport_update_joystick_type(void);
extern void gameport_remap(void *priv, uint16_t address);
extern void *gameport_add(const device_t *gameport_type);
extern const joystick_if_t joystick_2axis_2button;
extern const joystick_if_t joystick_2axis_4button;
extern const joystick_if_t joystick_3axis_2button;
extern const joystick_if_t joystick_3axis_4button;
extern const joystick_if_t joystick_4axis_4button;
extern const joystick_if_t joystick_2axis_6button;
extern const joystick_if_t joystick_2axis_8button;
extern const joystick_t joystick_2axis_2button;
extern const joystick_t joystick_2button_gamepad;
extern const joystick_t joystick_2button_flight_yoke;
extern const joystick_t joystick_2axis_4button;
extern const joystick_t joystick_4button_gamepad;
extern const joystick_t joystick_4button_flight_yoke;
extern const joystick_t joystick_3axis_2button;
extern const joystick_t joystick_2button_yoke_throttle;
extern const joystick_t joystick_3axis_4button;
extern const joystick_t joystick_4button_yoke_throttle;
extern const joystick_t joystick_win95_steering_wheel;
extern const joystick_t joystick_4axis_4button;
extern const joystick_t joystick_2axis_6button;
extern const joystick_t joystick_2axis_8button;
extern const joystick_if_t joystick_ch_flightstick_pro;
extern const joystick_if_t joystick_ch_flightstick_pro_ch_pedals;
extern const joystick_t joystick_ch_flightstick_pro;
extern const joystick_t joystick_ch_flightstick_pro_ch_pedals;
extern const joystick_if_t joystick_sw_pad;
extern const joystick_t joystick_sw_pad;
extern const joystick_if_t joystick_tm_fcs;
extern const joystick_if_t joystick_tm_fcs_rcs;
extern int gameport_available(int);
extern int gameport_has_config(int);
extern const char *gameport_get_internal_name(int);
extern int gampeport_get_from_internal_name(char *);
#ifdef EMU_DEVICE_H
extern const device_t *gameport_getdevice(int);
#endif
extern const joystick_t joystick_tm_fcs;
extern const joystick_t joystick_tm_fcs_rcs;
#ifdef __cplusplus
}

View File

@@ -27,7 +27,7 @@
#define HDC_NONE 0
#define HDC_INTERNAL 1
#define HDC_MAX 2
#define HDC_MAX 4
extern int hdc_current[HDC_MAX];
@@ -60,6 +60,8 @@ extern const device_t ide_pci_device; /* pci_ide */
extern const device_t ide_pci_sec_device; /* pci_ide sec */
extern const device_t ide_pci_2ch_device; /* pci_ide_2ch */
extern const device_t ide_pci_ter_qua_2ch_device; /* pci_ide_ter_qua_2ch */
extern const device_t ide_ali1489_device; /* ALi M1489 */
extern const device_t ide_ali5213_device; /* ALi M5213 */
@@ -76,10 +78,17 @@ extern const device_t ide_cmd640_pci_single_channel_sec_device; /* CMD PCI-640B
extern const device_t ide_cmd646_device; /* CMD PCI-646 */
extern const device_t ide_cmd646_legacy_only_device; /* CMD PCI-646 (Legacy Mode Only) */
extern const device_t ide_cmd646_single_channel_device; /* CMD PCI-646 (Only primary channel) */
extern const device_t ide_cmd646_ter_qua_device; /* CMD PCI-646 (Tertiary and quaternary channels) */
extern const device_t ide_cmd648_ter_qua_device; /* CMD PCI-648 (Tertiary and quaternary channels) */
extern const device_t ide_cmd648_ter_qua_onboard_device; /* CMD PCI-648 (Tertiary and quaternary channels, on-board) */
extern const device_t ide_cmd649_ter_qua_device; /* CMD PCI-649 (Tertiary and quaternary channels) */
extern const device_t ide_opti611_vlb_device; /* OPTi 82c611/611A VLB */
extern const device_t ide_opti611_vlb_sec_device; /* OPTi 82c611/611A VLB (Secondary channel) */
extern const device_t ide_rz1000_pci_device; /* PC Technology RZ-1000 PCI */
extern const device_t ide_rz1000_pci_single_channel_device; /* PC Technology RZ-1000 PCI (Only primary channel) */
extern const device_t ide_um8673f_device; /* UMC UM8673F */
extern const device_t ide_um8886af_device; /* UMC UM8886AF */
@@ -96,8 +105,10 @@ extern const device_t ide_qua_pnp_device;
extern const device_t mcide_device;
extern const device_t xta_wdxt150_device; /* xta_wdxt150 */
extern const device_t xta_hd20_device; /* EuroPC internal */
extern const device_t xta_wdxt150_device; /* xta_wdxt150 */
extern const device_t xta_hd20_device; /* EuroPC internal */
extern const device_t xta_st50x_device; /* ST-50X */
extern const device_t xta_st50x_pc5086_device; /* ST-50X (PC-5086) */
extern const device_t xtide_device; /* xtide_xt */
extern const device_t xtide_at_device; /* xtide_at */
@@ -106,17 +117,16 @@ extern const device_t xtide_acculogic_device; /* xtide_ps2 */
extern const device_t xtide_at_ps2_device; /* xtide_at_ps2 */
extern const device_t xtide_at_ps2_2ch_device; /* xtide_at_ps2_2ch */
/* Miscellaneous */
extern const device_t lba_enhancer_device;
extern void hdc_init(void);
extern void hdc_reset(void);
extern const char *hdc_get_internal_name(int hdc);
extern int hdc_get_from_internal_name(char *s);
extern int hdc_get_from_internal_name(const char *s);
extern int hdc_has_config(int hdc);
extern const device_t *hdc_get_device(int hdc);
extern int hdc_get_flags(int hdc);
extern int hdc_available(int hdc);
extern void xta_handler(void *priv, int set);
#endif /*EMU_HDC_H*/

View File

@@ -178,9 +178,6 @@ enum {
TIMINGS_PIO_FC = 2
};
extern int ide_ter_enabled;
extern int ide_qua_enabled;
#ifdef SCSI_DEVICE_H
extern ide_t *ide_get_drive(int ch);
extern void ide_irq(ide_t *ide, int set, int log);
@@ -230,6 +227,8 @@ extern void ide_padstr8(uint8_t *buf, int buf_size, const char *src);
extern uint8_t ide_read_ali_75(void);
extern uint8_t ide_read_ali_76(void);
extern void ide_hard_reset(void);
/* Legacy #define's. */
#define ide_irq_raise(ide) ide_irq(ide, 1, 1)
#define ide_irq_lower(ide) ide_irq(ide, 0, 1)

View File

@@ -56,6 +56,11 @@ typedef struct sff8038i_t
int irq_level;
int irq_pin;
int pci_irq_line;
uint8_t (*ven_write)(uint16_t port, uint8_t val, void *priv);
uint8_t (*ven_read)(uint16_t port, uint8_t val, void *priv);
void *priv;
} sff8038i_t;
extern const device_t sff8038i_device;
@@ -78,4 +83,7 @@ extern void sff_set_irq_pin(sff8038i_t *dev, int irq_pin);
extern void sff_set_irq_level(sff8038i_t *dev, int irq_level);
extern void sff_set_mirq(sff8038i_t *dev, uint8_t mirq);
extern void sff_set_ven_handlers(sff8038i_t *dev, uint8_t (*ven_write)(uint16_t port, uint8_t val, void *priv),
uint8_t (*ven_read)(uint16_t port, uint8_t val, void *priv), void *priv);
#endif /*EMU_HDC_IDE_SFF8038I_H*/

View File

@@ -67,14 +67,15 @@ enum {
};
#else
enum {
HDD_BUS_DISABLED = 0,
HDD_BUS_MFM = 1,
HDD_BUS_XTA = 2,
HDD_BUS_ESDI = 3,
HDD_BUS_IDE = 4,
HDD_BUS_ATAPI = 5,
HDD_BUS_SCSI = 6,
HDD_BUS_USB = 7
HDD_BUS_DISABLED = 0,
HDD_BUS_MFM = 1,
HDD_BUS_XTA = 2,
HDD_BUS_ESDI = 3,
HDD_BUS_LPT = 6,
HDD_BUS_IDE = 7,
HDD_BUS_ATAPI = 8,
HDD_BUS_SCSI = 9,
HDD_BUS_USB = 10
};
#endif
@@ -159,7 +160,7 @@ typedef struct hard_disk_t {
uint8_t pad;
uint8_t pad0;
void * priv;
void *priv;
char fn[1024]; /* Name of current image file */
/* Differential VHD parent file */
@@ -185,7 +186,7 @@ typedef struct hard_disk_t {
uint8_t max_multiple_block;
uint8_t pad1[3];
const char * model;
const char *model;
hdd_zone_t zones[HDD_MAX_ZONES];

View File

@@ -42,7 +42,6 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef EMU_ISAMEM_H
#define EMU_ISAMEM_H
@@ -52,17 +51,12 @@
extern "C" {
#endif
/* Global variables. */
extern const device_t isamem_device;
extern const device_t isamem_brat80_device;
extern const device_t isamem_ev159_device;
/* Functions. */
extern void isamem_reset(void);
extern const char *isamem_get_name(int t);
extern const char *isamem_get_internal_name(int t);
extern int isamem_get_from_internal_name(const char *s);
extern int isamem_get_from_internal_name(const char *str);
extern const device_t *isamem_get_device(int t);
extern int isamem_has_config(int board);

View File

@@ -0,0 +1,37 @@
/*
* 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.
*
* Implementation of ISA ROM card Expansions.
*
* Authors: Jasmine Iwanek, <jriwanek@gmail.com>
*
* Copyright 2025 Jasmine Iwanek.
*/
#ifndef EMU_ISAROM_H
#define EMU_ISAROM_H
#define ISAROM_MAX 4 /* max #cards in system */
#ifdef __cplusplus
extern "C" {
#endif
/* Functions. */
extern void isarom_reset(void);
extern const char *isarom_get_name(int t);
extern const char *isarom_get_internal_name(int t);
extern int isarom_get_from_internal_name(const char *str);
extern const device_t *isarom_get_device(int t);
extern int isarom_has_config(int board);
#ifdef __cplusplus
}
#endif
#endif /*EMU_ISAROM_H*/

View File

@@ -42,7 +42,6 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef EMU_ISARTC_H
#define EMU_ISARTC_H
@@ -50,13 +49,11 @@
extern "C" {
#endif
/* Global variables. */
/* Functions. */
extern void isartc_reset(void);
extern const char *isartc_get_internal_name(int t);
extern int isartc_get_from_internal_name(char *s);
extern int isartc_get_from_internal_name(const char *str);
extern const device_t *isartc_get_device(int t);
extern int isartc_has_config(int board);

View File

@@ -22,6 +22,21 @@
#ifndef EMU_KEYBOARD_H
#define EMU_KEYBOARD_H
#define FLAG_AT 0x00 /* dev is AT */
#define FLAG_PS2_KBD 0x10 /* dev is AT or PS/2 */
#define FLAG_AX 0x08 /* dev is AX */
#define FLAG_TYPE_MASK 0x07 /* mask for type */
enum {
KBD_83_KEY = 0,
KBD_84_KEY,
KBD_101_KEY,
KBD_102_KEY,
KBD_JIS,
KBD_KSC,
KBD_ABNT2
};
enum {
DEV_KBD = 0,
DEV_AUX = 1
@@ -38,6 +53,15 @@ enum {
DEV_STATE_MAIN_WANT_EXECUTE_BAT = 7
};
enum {
KEYBOARD_TYPE_INTERNAL = 0,
KEYBOARD_TYPE_PC_XT,
KEYBOARD_TYPE_AT,
KEYBOARD_TYPE_AX,
KEYBOARD_TYPE_PS2,
KEYBOARD_TYPE_PS55
};
/* Used by the AT / PS/2 keyboard controller, common device, keyboard, and mouse. */
typedef struct kbc_at_port_t {
uint8_t wantcmd;
@@ -194,6 +218,8 @@ typedef struct scancode {
extern "C" {
#endif
extern int keyboard_type;
extern uint8_t keyboard_mode;
extern int keyboard_scan;
@@ -216,52 +242,56 @@ extern int mouse_scan;
extern kbc_at_port_t *kbc_at_ports[2];
#ifdef EMU_DEVICE_H
extern const device_t keyboard_pc_device;
extern const device_t keyboard_pc82_device;
extern const device_t keyboard_pravetz_device;
extern const device_t keyboard_xt_device;
extern const device_t keyboard_xt86_device;
extern const device_t keyboard_xt_compaq_device;
extern const device_t keyboard_xt_t1x00_device;
extern const device_t keyboard_tandy_device;
# ifdef USE_LASERXT
extern const device_t keyboard_xt_lxt3_device;
# endif /* USE_LASERXT */
extern const device_t keyboard_xt_olivetti_device;
extern const device_t keyboard_xt_zenith_device;
extern const device_t keyboard_xt_hyundai_device;
extern const device_t keyboard_xtclone_device;
extern const device_t keyboard_at_device;
extern const device_t keyboard_at_ami_device;
extern const device_t keyboard_at_compaq_device;
extern const device_t keyboard_at_phoenix_device;
extern const device_t keyboard_at_ncr_device;
extern const device_t keyboard_at_olivetti_device;
extern const device_t keyboard_at_siemens_device;
extern const device_t keyboard_at_tg_ami_device;
extern const device_t keyboard_at_toshiba_device;
extern const device_t keyboard_ps2_device;
extern const device_t keyboard_ps2_ps1_device;
extern const device_t keyboard_ps2_ps1_pci_device;
extern const device_t keyboard_ps2_xi8088_device;
extern const device_t keyboard_ps2_ami_device;
extern const device_t keyboard_ps2_compaq_device;
extern const device_t keyboard_ps2_holtek_device;
extern const device_t keyboard_ps2_mca_1_device;
extern const device_t keyboard_ps2_mca_2_device;
extern const device_t keyboard_ps2_olivetti_device;
extern const device_t keyboard_ps2_phoenix_device;
extern const device_t keyboard_ps2_quadtel_device;
extern const device_t keyboard_ps2_tg_ami_device;
extern const device_t keyboard_ps2_tg_ami_green_device;
extern const device_t keyboard_ps2_pci_device;
extern const device_t keyboard_ps2_ami_pci_device;
extern const device_t keyboard_ps2_intel_ami_pci_device;
extern const device_t keyboard_ps2_acer_pci_device;
extern const device_t keyboard_ps2_ali_pci_device;
extern const device_t keyboard_ps2_phoenix_pci_device;
extern const device_t keyboard_ps2_tg_ami_pci_device;
extern const device_t kbc_pc_device;
extern const device_t kbc_pc82_device;
extern const device_t kbc_pravetz_device;
extern const device_t kbc_xt_device;
extern const device_t kbc_xt86_device;
extern const device_t kbc_xt_compaq_device;
extern const device_t kbc_xt_t1x00_device;
extern const device_t kbc_tandy_device;
extern const device_t kbc_xt_lxt3_device;
extern const device_t kbc_xt_olivetti_device;
extern const device_t kbc_xt_zenith_device;
extern const device_t kbc_xt_hyundai_device;
extern const device_t kbc_xt_fe2010_device;
extern const device_t kbc_xtclone_device;
extern const device_t kbc_at_device;
extern const device_t kbc_at_ami_device;
extern const device_t kbc_at_compaq_device;
extern const device_t kbc_at_phoenix_device;
extern const device_t kbc_at_ncr_device;
extern const device_t kbc_at_olivetti_device;
extern const device_t kbc_at_siemens_device;
extern const device_t kbc_at_tg_ami_device;
extern const device_t kbc_at_toshiba_device;
extern const device_t kbc_ps2_device;
extern const device_t kbc_ps2_ps1_device;
extern const device_t kbc_ps2_ps1_pci_device;
extern const device_t kbc_ps2_xi8088_device;
extern const device_t kbc_ps2_ami_device;
extern const device_t kbc_ps2_compaq_device;
extern const device_t kbc_ps2_holtek_device;
extern const device_t kbc_ps2_mca_1_device;
extern const device_t kbc_ps2_mca_2_device;
extern const device_t kbc_ps2_olivetti_device;
extern const device_t kbc_ps2_phoenix_device;
extern const device_t kbc_ps2_quadtel_device;
extern const device_t kbc_ps2_tg_ami_device;
extern const device_t kbc_ps2_tg_ami_green_device;
extern const device_t kbc_ps2_pci_device;
extern const device_t kbc_ps2_ami_pci_device;
extern const device_t kbc_ps2_intel_ami_pci_device;
extern const device_t kbc_ps2_acer_pci_device;
extern const device_t kbc_ps2_ali_pci_device;
extern const device_t kbc_ps2_phoenix_pci_device;
extern const device_t kbc_ps2_tg_ami_pci_device;
extern const device_t keyboard_pc_xt_device;
extern const device_t keyboard_at_device;
extern const device_t keyboard_ax_device;
extern const device_t keyboard_ps2_device;
extern const device_t keyboard_ps55_device;
extern const device_t keyboard_at_generic_device;
#endif /*EMU_DEVICE_H*/
@@ -273,9 +303,11 @@ extern void keyboard_process(void);
extern uint16_t keyboard_convert(int ch);
extern void keyboard_input(int down, uint16_t scan);
extern void keyboard_all_up(void);
extern void keyboard_update_states(uint8_t cl, uint8_t nl, uint8_t sl);
extern void keyboard_update_states(uint8_t cl, uint8_t nl, uint8_t sl, uint8_t kl);
extern uint8_t keyboard_get_shift(void);
extern void keyboard_get_states(uint8_t *cl, uint8_t *nl, uint8_t *sl);
extern void keyboard_set_in_reset(uint8_t in_reset);
extern uint8_t keyboard_get_in_reset(void);
extern void keyboard_get_states(uint8_t *cl, uint8_t *nl, uint8_t *sl, uint8_t *kl);
extern void keyboard_set_states(uint8_t cl, uint8_t nl, uint8_t sl);
extern int keyboard_recv(uint16_t key);
extern int keyboard_recv_ui(uint16_t key);
@@ -285,11 +317,15 @@ extern int keyboard_isfsexit(void);
extern int keyboard_isfsexit_up(void);
extern void keyboard_set_is_amstrad(int ams);
extern void kbc_at_set_ps2(void *priv, uint8_t ps2);
extern uint8_t kbc_at_read_p(void *priv, uint8_t port, uint8_t mask);
extern void kbc_at_write_p(void *priv, uint8_t port, uint8_t mask, uint8_t val);
extern void kbc_at_set_fast_reset(uint8_t new_fast_reset);
extern void kbc_at_handler(int set, void *priv);
extern void kbc_at_port_handler(int num, int set, uint16_t port, void *priv);
extern void kbc_at_handler(int set, uint16_t port, void *priv);
extern void kbc_at_set_irq(int num, uint16_t irq, void *priv);
extern void kbc_at_dev_queue_reset(atkbc_dev_t *dev, uint8_t reset_main);
extern uint8_t kbc_at_dev_queue_pos(atkbc_dev_t *dev, uint8_t main);
extern void kbc_at_dev_queue_add(atkbc_dev_t *dev, uint8_t val, uint8_t main);
extern void kbc_at_dev_reset(atkbc_dev_t *dev, int do_fa);
@@ -298,6 +334,18 @@ extern atkbc_dev_t *kbc_at_dev_init(uint8_t inst);
passed on incorrectly. */
extern uint16_t convert_scan_code(uint16_t scan_code);
extern const char * keyboard_get_name(int mouse);
extern const char * keyboard_get_internal_name(int mouse);
extern int keyboard_get_from_internal_name(char *s);
extern int keyboard_has_config(int mouse);
#ifdef EMU_DEVICE_H
extern const device_t *keyboard_get_device(int mouse);
#endif
extern int keyboard_get_ndev(void);
extern void keyboard_add_device(void);
extern const scancode scancode_set1[512];
#ifdef __cplusplus
}
#endif

View File

@@ -17,87 +17,130 @@
#define LPT6_IRQ 5
#endif
typedef struct lpt_device_t {
const char *name;
const char *internal_name;
typedef struct lpt_device_s {
const char *name;
const char *internal_name;
void *(*init)(void *lpt);
void (*close)(void *priv);
void (*write_data)(uint8_t val, void *priv);
void (*write_ctrl)(uint8_t val, void *priv);
uint8_t (*read_data)(void *priv);
uint8_t (*read_status)(void *priv);
uint8_t (*read_ctrl)(void *priv);
void *(*init)(void *lpt);
void (*close)(void *priv);
void (*write_data)(uint8_t val, void *priv);
void (*write_ctrl)(uint8_t val, void *priv);
void (*autofeed)(uint8_t val,void *priv);
void (*strobe)(uint8_t old, uint8_t val,void *priv);
uint8_t (*read_status)(void *priv);
uint8_t (*read_ctrl)(void *priv);
void (*epp_write_data)(uint8_t is_addr, uint8_t val, void *priv);
void (*epp_request_read)(uint8_t is_addr, void *priv);
void *priv;
struct lpt_t *lpt;
//#ifdef EMU_DEVICE_H
// struct device_t *cfgdevice;
//#else
void *cfgdevice;
//#endif
} lpt_device_t;
extern void lpt_init(void);
extern void lpt_port_setup(int i, uint16_t port);
extern void lpt_port_irq(int i, uint8_t irq);
extern void lpt_port_remove(int i);
extern void lpt1_remove_ams(void);
#define lpt1_setup(a) lpt_port_setup(0, a)
#define lpt1_irq(a) lpt_port_irq(0, a)
#define lpt1_remove() lpt_port_remove(0)
#define lpt2_setup(a) lpt_port_setup(1, a)
#define lpt2_irq(a) lpt_port_irq(1, a)
#define lpt2_remove() lpt_port_remove(1)
#define lpt3_setup(a) lpt_port_setup(2, a)
#define lpt3_irq(a) lpt_port_irq(2, a)
#define lpt3_remove() lpt_port_remove(2)
#define lpt4_setup(a) lpt_port_setup(3, a)
#define lpt4_irq(a) lpt_port_irq(3, a)
#define lpt4_remove() lpt_port_remove(3)
#if 0
#define lpt5_setup(a) lpt_port_setup(4, a)
#define lpt5_irq(a) lpt_port_irq(4, a)
#define lpt5_remove() lpt_port_remove(4)
#define lpt6_setup(a) lpt_port_setup(5, a)
#define lpt6_irq(a) lpt_port_irq(5, a)
#define lpt6_remove() lpt_port_remove(5)
#endif
void lpt_devices_init(void);
void lpt_devices_close(void);
typedef struct lpt_port_t {
#ifdef _TIMER_H_
typedef struct lpt_t {
uint8_t enabled;
uint8_t irq;
uint8_t irq_state;
uint8_t dma;
uint8_t dat;
uint8_t ctrl;
uint8_t ext;
uint8_t epp;
uint8_t ecp;
uint8_t ecr;
uint8_t in_dat;
uint8_t fifo_stat;
uint8_t dma_stat;
uint8_t state;
uint8_t autofeed;
uint8_t strobe;
uint8_t lv2;
uint8_t cnfga_readout;
uint8_t inst;
uint8_t pad[5];
uint16_t addr;
uint16_t pad0;
int device;
uint16_t id;
uint16_t pad0[2];
int enable_irq;
lpt_device_t *dt;
void *priv;
#ifdef FIFO_H
fifo16_t * fifo;
#else
void * fifo;
#endif
pc_timer_t fifo_out_timer;
} lpt_t;
#endif /* _TIMER_H_ */
typedef struct lpt_port_s {
uint8_t enabled;
int device;
} lpt_port_t;
extern lpt_port_t lpt_ports[PARALLEL_MAX];
extern void lpt_write(uint16_t port, uint8_t val, void *priv);
extern uint8_t lpt_read(uint16_t port, void *priv);
typedef enum {
LPT_STATE_IDLE = 0,
LPT_STATE_READ_DMA,
LPT_STATE_WRITE_FIFO
} lpt_state_t;
extern uint8_t lpt_read_port(int port, uint16_t reg);
extern void lpt_write(uint16_t port, uint8_t val, void *priv);
extern uint8_t lpt_read_status(int port);
extern void lpt_irq(void *priv, int raise);
extern void lpt_write_to_fifo(void *priv, uint8_t val);
extern const char *lpt_device_get_name(int id);
extern const char *lpt_device_get_internal_name(int id);
extern uint8_t lpt_read(uint16_t port, void *priv);
extern int lpt_device_get_from_internal_name(char *s);
extern uint8_t lpt_read_port(lpt_t *dev, uint16_t reg);
extern const lpt_device_t lpt_dac_device;
extern const lpt_device_t lpt_dac_stereo_device;
extern uint8_t lpt_read_status(lpt_t *dev);
extern void lpt_irq(void *priv, int raise);
extern const lpt_device_t dss_device;
extern int lpt_device_get_from_internal_name(const char *str);
extern const lpt_device_t lpt_hasp_savquest_device;
extern const char *lpt_device_get_name(int id);
extern const char *lpt_device_get_internal_name(int id);
#ifdef EMU_DEVICE_H
extern const device_t *lpt_device_getdevice(const int id);
#endif
extern int lpt_device_has_config(const int id);
extern const lpt_device_t lpt_dac_device;
extern const lpt_device_t lpt_dac_stereo_device;
extern const lpt_device_t dss_device;
extern const lpt_device_t lpt_hasp_savquest_device;
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_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);
extern void lpt_port_irq(lpt_t *dev, uint8_t irq);
extern void lpt_port_dma(lpt_t *dev, uint8_t dma);
extern void lpt_port_remove(lpt_t *dev);
extern void lpt1_remove_ams(lpt_t *dev);
extern void lpt_devices_init(void);
extern void lpt_devices_close(void);
extern void lpt_set_next_inst(int ni);
extern void lpt_set_3bc_used(int is_3bc_used);
extern void lpt_standalone_init(void);
extern const device_t lpt_port_device;
#endif /*EMU_LPT_H*/

View File

@@ -0,0 +1,74 @@
/*
* 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.
*
* Header files for the PCjr keyboard and video subsystems.
*
*
*
* Authors: Connor Hyde, <mario64crashed@gmail.com>
*
* Copyright 2025 starfrost
*/
#pragma once
#define PCJR_RGB 0
#define PCJR_COMPOSITE 1
#define PCJR_RGB_NO_BROWN 4
#define PCJR_RGB_IBM_5153 5
typedef struct pcjr_s
{
/* Video Controller stuff. */
mem_mapping_t mapping;
uint8_t crtc[32];
int crtcreg;
int array_index;
uint8_t array[32];
int array_ff;
int memctrl;
uint8_t status;
int addr_mode;
uint8_t *vram;
uint8_t *b8000;
int linepos;
int displine;
int scanline;
int vc;
int dispon;
int cursorvisible; // Is the cursor visible on the current scanline?
int cursoron;
int blink;
int vsynctime;
int fullchange;
int vadj;
uint16_t memaddr;
uint16_t memaddr_backup;
uint64_t dispontime;
uint64_t dispofftime;
pc_timer_t timer;
int firstline;
int lastline;
int composite;
int apply_hd;
/* Keyboard Controller stuff. */
int latched;
int data;
int serial_data[44];
int serial_pos;
uint8_t pa;
uint8_t pb;
pc_timer_t send_delay_timer;
} pcjr_t;
void pcjr_recalc_timings(pcjr_t *pcjr);
// Note: This is a temporary solution until the pcjr video is made its own gfx card
void pcjr_vid_init(pcjr_t *pcjr);

View File

@@ -0,0 +1,95 @@
/*
* 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.
*
* Header files for the Tandy keyboard and video subsystems.
*
*
*
* Authors: Connor Hyde, <mario64crashed@gmail.com>
*
* Copyright 2025 starfrost
*/
typedef struct t1kvid_t {
mem_mapping_t mapping;
mem_mapping_t vram_mapping;
uint8_t crtc[32];
int crtcreg;
int array_index;
uint8_t array[256];
int memctrl;
uint8_t mode;
uint8_t col;
uint8_t status;
uint8_t *vram;
uint8_t *b8000;
uint32_t b8000_mask;
uint32_t b8000_limit;
uint8_t planar_ctrl;
uint8_t lp_strobe;
int linepos;
int displine;
int scanline;
int vc;
int dispon;
int cursorvisible;
int cursoron;
int blink;
int fullchange;
int vsynctime;
int vadj;
uint16_t memaddr;
uint16_t memaddr_backup;
uint64_t dispontime;
uint64_t dispofftime;
pc_timer_t timer;
int firstline;
int lastline;
int composite;
} t1kvid_t;
typedef struct t1keep_t {
char *path;
int state;
int count;
int addr;
int clk;
uint16_t data;
uint16_t store[64];
} t1keep_t;
typedef struct tandy_t {
mem_mapping_t ram_mapping;
mem_mapping_t rom_mapping; /* SL2 */
uint8_t *rom; /* SL2 */
uint8_t ram_bank;
uint8_t rom_bank; /* SL2 */
int rom_offset; /* SL2 */
uint32_t base;
uint32_t mask;
int is_hx;
int is_sl2;
t1kvid_t *vid;
} tandy_t;
void tandy_vid_init(tandy_t* dev);
uint8_t tandy_vid_in(uint16_t addr, void* priv);
void tandy_vid_out(uint16_t addr, uint8_t val, void *priv);
void tandy_vid_close(void* priv);
void tandy_recalc_address_sl(tandy_t* dev); //this function is needed by both m_ and vid_tandy.c

View File

@@ -85,27 +85,28 @@
#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_PS2_KBC 0x00000400 /* sys has a PS/2 keyboard controller */
#define MACHINE_VIDEO_ONLY 0x00000008 /* sys has fixed video */
#define MACHINE_KEYBOARD 0x00000010 /* sys has int keyboard */
#define MACHINE_AX 0x00000020 /* sys adheres to Japanese AX standard */
#define MACHINE_KEYBOARD_JIS 0x00000020 /* sys has int keyboard which is Japanese (AX or PS/55) */
#define MACHINE_MOUSE 0x00000040 /* sys has int mouse */
#define MACHINE_FDC 0x00000080 /* sys has int FDC */
#define MACHINE_LPT_PRI 0x00000100 /* sys has int pri LPT */
#define MACHINE_LPT_SEC 0x00000200 /* sys has int sec LPT */
#define MACHINE_LPT_TER 0x00000400 /* sys has int ter LPT */
#define MACHINE_PS2_KBC 0x00000800 /* sys has a PS/2 keyboard controller */
/* this is separate from having PS/2 ports */
#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 */
#define MACHINE_UART_PRI 0x00010800 /* sys has int pri UART */
#define MACHINE_UART_SEC 0x00002000 /* sys has int sec UART */
#define MACHINE_UART_TER 0x00004000 /* sys has int ter UART */
#define MACHINE_UART_QUA 0x00008000 /* sys has int qua UART */
#define MACHINE_GAMEPORT 0x00010000 /* sys has int game port */
#define MACHINE_SOUND 0x00020000 /* sys has int sound */
#define MACHINE_NIC 0x00040000 /* sys has int NIC */
/* Feature flags for advanced devices. */
#define MACHINE_APM 0x00080000 /* sys has APM */
#define MACHINE_ACPI 0x00100000 /* sys has ACPI */
#define MACHINE_HWM 0x00200000 /* sys has hw monitor */
#define MACHINE_PCI_INTERNAL 0x00200000 /* sys has only internal PCI */
#define MACHINE_CARTRIDGE 0x00400000 /* sys has cartridge bays */
/* Feature flags for internal storage controllers. */
#define MACHINE_MFM 0x00800000 /* sys has int MFM/RLL */
@@ -197,6 +198,7 @@ enum {
MACHINE_CHIPSET_GC100A,
MACHINE_CHIPSET_GC103,
MACHINE_CHIPSET_HT18,
MACHINE_CHIPSET_ACC_2036,
MACHINE_CHIPSET_ACC_2168,
MACHINE_CHIPSET_ALI_M1217,
MACHINE_CHIPSET_ALI_M6117,
@@ -211,6 +213,7 @@ enum {
MACHINE_CHIPSET_SCAT_SX,
MACHINE_CHIPSET_NEAT,
MACHINE_CHIPSET_NEAT_SX,
MACHINE_CHIPSET_CT_AT,
MACHINE_CHIPSET_CT_386,
MACHINE_CHIPSET_CT_CS4031,
MACHINE_CHIPSET_CONTAQ_82C596,
@@ -239,7 +242,9 @@ enum {
MACHINE_CHIPSET_OPTI_391,
MACHINE_CHIPSET_OPTI_481,
MACHINE_CHIPSET_OPTI_493,
MACHINE_CHIPSET_OPTI_495,
MACHINE_CHIPSET_OPTI_495SLC,
MACHINE_CHIPSET_OPTI_495SX,
MACHINE_CHIPSET_OPTI_498,
MACHINE_CHIPSET_OPTI_499,
MACHINE_CHIPSET_OPTI_895_802G,
MACHINE_CHIPSET_OPTI_547_597,
@@ -334,6 +339,7 @@ typedef struct _machine_ {
uint32_t gpio_acpi;
#ifdef EMU_DEVICE_H
const device_t *device;
const device_t *kbd_device;
const device_t *fdc_device;
const device_t *sio_device;
const device_t *vid_device;
@@ -341,6 +347,7 @@ typedef struct _machine_ {
const device_t *net_device;
#else
void *device;
void *kbd_device;
void *fdc_device;
void *sio_device;
void *vid_device;
@@ -385,6 +392,7 @@ extern int machine_get_min_ram(int m);
extern int machine_get_max_ram(int m);
extern int machine_get_ram_granularity(int m);
extern int machine_get_type(int m);
extern int machine_get_chipset(int m);
extern void machine_close(void);
extern int machine_has_mouse(void);
extern int machine_is_sony(void);
@@ -446,9 +454,6 @@ 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_wellamerastar_init(const machine_t *); // Wells American A*Star with custom award BIOS
#ifdef USE_OPEN_AT
extern int machine_at_openat_init(const machine_t *);
#endif /* USE_OPEN_AT */
/* m_at_286_386sx.c */
extern int machine_at_tg286m_init(const machine_t *);
@@ -457,6 +462,7 @@ 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 *);
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 *);
@@ -466,6 +472,7 @@ extern int machine_at_quadt386sx_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 *);
@@ -475,18 +482,21 @@ 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 *);
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 *);
extern int machine_at_pc8_init(const machine_t *);
extern int machine_at_3302_init(const machine_t *);
#ifdef USE_OLIVETTI
extern int machine_at_m290_init(const machine_t *);
#endif /* USE_OLIVETTI */
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 *);
@@ -508,15 +518,19 @@ extern int machine_at_pc916sx_init(const machine_t *);
sure this appear here (and in the .c file) in the order and position
in which they appear in the machine table. */
extern int machine_at_dataexpert386wb_init(const machine_t *);
extern int machine_at_isa486c_init(const machine_t *);
extern int machine_at_genoa486_init(const machine_t *);
extern int machine_at_ga486l_init(const machine_t *);
extern int machine_at_cobalt_init(const machine_t *);
extern int machine_at_cougar_init(const machine_t *);
extern int machine_at_acc386_init(const machine_t *);
extern int machine_at_asus3863364k_init(const machine_t *);
extern int machine_at_asus386_init(const machine_t *);
extern int machine_at_ecs386_init(const machine_t *);
extern int machine_at_spc6000a_init(const machine_t *);
extern int machine_at_micronics386_init(const machine_t *);
extern int machine_at_micronics386px_init(const machine_t *);
extern int machine_at_ecs386v_init(const machine_t *);
extern int machine_at_tandy4000_init(const machine_t *);
@@ -529,6 +543,8 @@ extern int machine_at_cs4031_init(const machine_t *);
extern int machine_at_pb410a_init(const machine_t *);
extern int machine_at_decpclpv_init(const machine_t *);
extern int machine_at_dell466np_init(const machine_t *);
extern int machine_at_acerv10_init(const machine_t *);
extern int machine_at_acera1g_init(const machine_t *);
@@ -538,10 +554,13 @@ extern int machine_at_winbios1429_init(const machine_t *);
extern int machine_at_opti495_init(const machine_t *);
extern int machine_at_opti495_ami_init(const machine_t *);
extern int machine_at_opti495_mr_init(const machine_t *);
extern int machine_at_c747_init(const machine_t *);
extern int machine_at_exp4349_init(const machine_t *);
extern int machine_at_vect486vl_init(const machine_t *);
extern int machine_at_d824_init(const machine_t *);
extern int machine_at_tuliptc38_init(const machine_t *);
extern int machine_at_martin_init(const machine_t *);
extern int machine_at_403tg_init(const machine_t *);
extern int machine_at_403tg_d_init(const machine_t *);
@@ -552,9 +571,11 @@ extern int machine_at_aptiva510_init(const machine_t *);
extern int machine_at_pc330_6573_init(const machine_t *);
extern int machine_at_mvi486_init(const machine_t *);
extern int machine_at_dtk461_init(const machine_t *);
extern int machine_at_sis401_init(const machine_t *);
extern int machine_at_isa486_init(const machine_t *);
extern int machine_at_av4_init(const machine_t *);
extern int machine_at_advantage40xxd_init(const machine_t *);
extern int machine_at_valuepoint433_init(const machine_t *);
extern int machine_at_vli486sv2g_init(const machine_t *);
@@ -583,6 +604,7 @@ extern int machine_at_sb486p_init(const machine_t *);
extern int machine_at_486sp3_init(const machine_t *);
extern int machine_at_486sp3c_init(const machine_t *);
extern int machine_at_486sp3g_init(const machine_t *);
extern int machine_at_sb486pv_init(const machine_t *);
extern int machine_at_486ap4_init(const machine_t *);
extern int machine_at_g486vpa_init(const machine_t *);
extern int machine_at_486vipio2_init(const machine_t *);
@@ -603,6 +625,7 @@ extern int machine_at_iach488_init(const machine_t *);
extern int machine_at_pcm9340_init(const machine_t *);
extern int machine_at_pcm5330_init(const machine_t *);
extern int machine_at_84xxuuda_init(const machine_t *);
extern int machine_at_ecs486_init(const machine_t *);
extern int machine_at_hot433a_init(const machine_t *);
extern int machine_at_pl4600c_init(const machine_t *);
@@ -635,6 +658,7 @@ extern void machine_at_award_common_init(const machine_t *);
extern void machine_at_sp4_common_init(const machine_t *model);
extern int machine_at_v12p_init(const machine_t *);
extern int machine_at_excaliburpci_init(const machine_t *);
extern int machine_at_p5mp3_init(const machine_t *);
extern int machine_at_dellxp60_init(const machine_t *);
@@ -657,6 +681,7 @@ extern int machine_at_p5sp4_init(const machine_t *);
/* m_at_socket5.c */
extern int machine_at_plato_init(const machine_t *);
extern int machine_at_dellplato_init(const machine_t *);
extern int machine_at_d842_init(const machine_t *);
extern int machine_at_ambradp90_init(const machine_t *);
extern int machine_at_p54np4_init(const machine_t *);
extern int machine_at_586ip_init(const machine_t *);
@@ -664,6 +689,7 @@ extern int machine_at_tek932_init(const machine_t *);
extern int machine_at_acerv30_init(const machine_t *);
extern int machine_at_apollo_init(const machine_t *);
extern int machine_at_optiplexgxl_init(const machine_t *);
extern int machine_at_zappa_init(const machine_t *);
extern int machine_at_powermatev_init(const machine_t *);
extern int machine_at_hawk_init(const machine_t *);
@@ -700,6 +726,7 @@ extern int machine_at_fmb_init(const machine_t *);
extern int machine_at_acerm3a_init(const machine_t *);
extern int machine_at_ap53_init(const machine_t *);
extern int machine_at_8500tuc_init(const machine_t *);
extern int machine_at_d943_init(const machine_t *);
extern int machine_at_p55t2s_init(const machine_t *);
extern int machine_at_p5vxb_init(const machine_t *);
@@ -714,6 +741,8 @@ extern int machine_at_vectra54_init(const machine_t *);
extern int machine_at_5sbm2_init(const machine_t *);
/* m_at_socket7.c */
extern void machine_at_optiplex_21152_init(void);
extern int machine_at_acerv35n_init(const machine_t *);
extern int machine_at_p55t2p4_init(const machine_t *);
extern int machine_at_m7shi_init(const machine_t *);
@@ -743,11 +772,10 @@ extern int machine_at_gw2kte_init(const machine_t *);
extern int machine_at_ma23c_init(const machine_t *);
extern int machine_at_nupro592_init(const machine_t *);
extern int machine_at_tx97_init(const machine_t *);
#ifdef USE_AN430TX
extern int machine_at_an430tx_init(const machine_t *);
#endif /* USE_AN430TX */
extern int machine_at_optiplexgn_init(const machine_t *);
extern int machine_at_ym430tx_init(const machine_t *);
extern int machine_at_thunderbolt_init(const machine_t *);
extern int machine_at_an430tx_init(const machine_t *);
extern int machine_at_mb540n_init(const machine_t *);
extern int machine_at_56a5_init(const machine_t *);
extern int machine_at_p5mms98_init(const machine_t *);
@@ -764,6 +792,7 @@ extern int machine_at_ms5146_init(const machine_t *);
extern int machine_at_cb52xsi_init(const machine_t *);
extern int machine_at_m560_init(const machine_t *);
extern int machine_at_m5ata_init(const machine_t *);
extern int machine_at_ms5164_init(const machine_t *);
extern int machine_at_sp97xv_init(const machine_t *);
@@ -782,6 +811,7 @@ extern int machine_at_ax59pro_init(const machine_t *);
extern int machine_at_mvp3_init(const machine_t *);
extern int machine_at_ficva503a_init(const machine_t *);
extern int machine_at_5emapro_init(const machine_t *);
extern int machine_at_delhi3_init(const machine_t *);
extern int machine_at_5sg100_init(const machine_t *);
@@ -793,6 +823,7 @@ extern int machine_at_686nx_init(const machine_t *);
extern int machine_at_acerv60n_init(const machine_t *);
extern int machine_at_lgibmx61_init(const machine_t *);
extern int machine_at_vs440fx_init(const machine_t *);
extern int machine_at_dellvenus_init(const machine_t *);
extern int machine_at_gw2kvenus_init(const machine_t *);
extern int machine_at_ap440fx_init(const machine_t *);
extern int machine_at_mb600n_init(const machine_t *);
@@ -806,12 +837,13 @@ extern int machine_at_p65up5_cp6nd_init(const machine_t *);
/* m_at_slot1.c */
extern int machine_at_m729_init(const machine_t *);
extern int machine_at_acerv62x_init(const machine_t *);
extern int machine_at_p65up5_cpknd_init(const machine_t *);
extern int machine_at_kn97_init(const machine_t *);
extern int machine_at_lx6_init(const machine_t *);
extern int machine_at_optiplexgxa_init(const machine_t *);
extern int machine_at_spitfire_init(const machine_t *);
extern int machine_at_ma30d_init(const machine_t *);
extern int machine_at_p6i440e2_init(const machine_t *);
@@ -889,6 +921,9 @@ extern int machine_xt_m19_init(const machine_t *);
/* m_pcjr.c */
extern int machine_pcjr_init(const machine_t *);
/* m_pc5086.c */
extern int machine_pc5086_init(const machine_t *);
/* m_ps1.c */
extern int machine_ps1_m2011_init(const machine_t *);
extern int machine_ps1_m2121_init(const machine_t *);
@@ -955,6 +990,7 @@ extern int machine_xt_kaypropc_init(const machine_t *);
extern int machine_xt_sansx16_init(const machine_t *);
extern int machine_xt_bw230_init(const machine_t *);
extern int machine_xt_pb8810_init(const machine_t *);
extern int machine_xt_tuliptc8_init(const machine_t *);
extern int machine_xt_v20xt_init(const machine_t *);
@@ -969,10 +1005,14 @@ extern int machine_xt_compaq_deskpro_init(const machine_t *);
extern int machine_xt_compaq_portable_init(const machine_t *);
/* m_xt_laserxt.c */
#ifdef USE_LASERXT
extern int machine_xt_laserxt_init(const machine_t *);
#ifdef EMU_DEVICE_H
extern const device_t laserxt_device;
#endif
extern int machine_xt_lxt3_init(const machine_t *);
#endif /* USE_LASERXT */
#ifdef EMU_DEVICE_H
extern const device_t lxt3_device;
#endif
/* m_xt_philips.c */
extern int machine_xt_p3105_init(const machine_t *);

View File

@@ -5,6 +5,7 @@ typedef struct dev_status_empty_active_t {
atomic_bool_t empty;
atomic_bool_t active;
atomic_bool_t write_active;
atomic_bool_t write_prot;
} dev_status_empty_active_t;
typedef struct dev_status_active_t {
@@ -19,7 +20,7 @@ typedef struct dev_status_empty_t {
typedef struct machine_status_t {
dev_status_empty_active_t fdd[FDD_NUM];
dev_status_empty_active_t cdrom[CDROM_NUM];
dev_status_empty_active_t zip[ZIP_NUM];
dev_status_empty_active_t rdisk[RDISK_NUM];
dev_status_empty_active_t mo[MO_NUM];
dev_status_empty_active_t cassette;
dev_status_active_t hdd[HDD_BUS_USB];

View File

@@ -265,12 +265,16 @@ extern uint32_t biosmask;
extern uint32_t biosaddr;
extern int readlookup[256];
#if (!(defined __amd64__ || defined _M_X64 || defined __aarch64__ || defined _M_ARM64))
extern uintptr_t *readlookup2;
#endif
extern uintptr_t old_rl2;
extern uint8_t uncached;
extern int readlnext;
extern int writelookup[256];
#if (!(defined __amd64__ || defined _M_X64 || defined __aarch64__ || defined _M_ARM64))
extern uintptr_t *writelookup2;
#endif
extern int writelnext;
extern uint32_t ram_mapped_addr[64];
extern uint8_t page_ff[4096];
@@ -288,7 +292,16 @@ extern mem_mapping_t bios_high_mapping;
extern uint32_t mem_logical_addr;
extern page_t *pages;
#if (!(defined __amd64__ || defined _M_X64 || defined __aarch64__ || defined _M_ARM64))
extern page_t **page_lookup;
#endif
#if (defined __amd64__ || defined _M_X64 || defined __aarch64__ || defined _M_ARM64)
/* The lookup tables. */
extern page_t *page_lookup[1048576];
extern uintptr_t readlookup2[1048576];
extern uintptr_t writelookup2[1048576];
#endif
extern uint32_t get_phys_virt;
extern uint32_t get_phys_phys;
@@ -300,7 +313,6 @@ extern int writelnum;
extern int memspeed[11];
extern int mmu_perm;
extern uint8_t high_page; /* if a high (> 4 gb) page was detected */
extern uint8_t *_mem_exec[MEM_MAPPINGS_NO];
@@ -458,6 +470,9 @@ extern void mem_a20_init(void);
extern void mem_a20_recalc(void);
extern void mem_init(void);
#if (!(defined __amd64__ || defined _M_X64 || defined __aarch64__ || defined _M_ARM64))
extern void mem_free(void);
#endif
extern void mem_close(void);
extern void mem_zero(void);
extern void mem_reset(void);
@@ -468,6 +483,8 @@ extern void mem_remap_top_nomid(int kb);
extern void umc_smram_recalc(uint32_t start, int set);
extern void pcjr_waitstates(void *);
extern mem_mapping_t *read_mapping[MEM_MAPPINGS_NO];
extern mem_mapping_t *write_mapping[MEM_MAPPINGS_NO];

View File

@@ -84,10 +84,11 @@ static const mo_drive_type_t mo_drive_types[KNOWN_MO_DRIVE_TYPES] = {
};
enum {
MO_BUS_DISABLED = 0,
MO_BUS_ATAPI = 5,
MO_BUS_SCSI = 6,
MO_BUS_USB = 7
MO_BUS_DISABLED = 0,
MO_BUS_LPT = 6,
MO_BUS_ATAPI = 8,
MO_BUS_SCSI = 9,
MO_BUS_USB = 10
};
typedef struct mo_drive_t {
@@ -110,13 +111,13 @@ typedef struct mo_drive_t {
uint8_t pad;
uint8_t pad0;
FILE * fp;
void * priv;
FILE *fp;
void *priv;
char image_path[1024];
char prev_image_path[1024];
char * image_history[MO_IMAGE_HISTORY];
char *image_history[MO_IMAGE_HISTORY];
uint32_t type;
uint32_t medium_size;
@@ -129,16 +130,16 @@ typedef struct mo_drive_t {
typedef struct mo_t {
mode_sense_pages_t ms_pages_saved;
mo_drive_t * drv;
mo_drive_t *drv;
#ifdef EMU_IDE_H
ide_tf_t * tf;
ide_tf_t *tf;
#else
void * tf;
void *tf;
#endif
void * log;
uint8_t * buffer;
uint8_t *buffer;
uint8_t atapi_cdb[16];
uint8_t current_cdb[16];
uint8_t sense[256];

View File

@@ -26,7 +26,7 @@
#endif
#define MOUSE_TYPE_NONE 0 /* no mouse configured */
#define MOUSE_TYPE_INTERNAL 1 /* achine has internal mouse */
#define MOUSE_TYPE_INTERNAL 1 /* machine has internal mouse */
#define MOUSE_TYPE_LOGIBUS 2 /* Logitech/ATI Bus Mouse */
#define MOUSE_TYPE_INPORT 3 /* Microsoft InPort Mouse */
#if 0
@@ -42,7 +42,10 @@
#define MOUSE_TYPE_WACOM 12 /* WACOM tablet */
#define MOUSE_TYPE_WACOMARTP 13 /* WACOM tablet (ArtPad) */
#define MOUSE_TYPE_MSYSTEMSB 14 /* Mouse Systems bus mouse */
#define MOUSE_TYPE_MSBPOINT 15 /* Microsoft Serial BallPoint mouse */
#define MOUSE_TYPE_PS2_QPORT 27 /* PS/2 QuickPort series Bus Mouse */
#define MOUSE_TYPE_QPORT 0x40 /* Mouse is an on-board version of one of the above. */
#define MOUSE_TYPE_ONBOARD 0x80 /* Mouse is an on-board version of one of the above. */
@@ -71,8 +74,11 @@ extern const device_t mouse_genibus_device;
extern const device_t mouse_mssystems_device;
extern const device_t mouse_mssystems_bus_device;
extern const device_t mouse_msserial_device;
extern const device_t mouse_msserial_ballpoint_device;
extern const device_t mouse_ltserial_device;
extern const device_t mouse_ps2_device;
extern const device_t mouse_upc_device;
extern const device_t mouse_upc_standalone_device;
# ifdef USE_WACOM
extern const device_t mouse_wacom_device;
extern const device_t mouse_wacom_artpad_device;
@@ -129,6 +135,11 @@ extern void mouse_init(void);
extern void mouse_bus_set_irq(void *priv, int irq);
extern void mouse_upc_port_handler(int num, int set, uint16_t port, void *priv);
extern void mouse_upc_handler(int set, uint16_t port, void *priv);
extern void mouse_upc_set_irq(int num, uint16_t irq, void *priv);
#ifdef __cplusplus
}
#endif

View File

@@ -41,89 +41,89 @@ typedef struct dp8390_t {
/* Command Register - 00h read/write */
struct CR_t {
int stop; /* STP - Software Reset command */
int start; /* START - start the NIC */
int tx_packet; /* TXP - initiate packet transmission */
bool stop; /* STP - Software Reset command */
bool start; /* START - start the NIC */
bool tx_packet; /* TXP - initiate packet transmission */
uint8_t rdma_cmd; /* RD0,RD1,RD2 - Remote DMA command */
uint8_t pgsel; /* PS0,PS1 - Page select */
} CR;
/* Interrupt Status Register - 07h read/write */
struct ISR_t {
int pkt_rx; /* PRX - packet received with no errors */
int pkt_tx; /* PTX - packet txed with no errors */
int rx_err; /* RXE - packet rxed with 1 or more errors */
int tx_err; /* TXE - packet txed " " " " " */
int overwrite; /* OVW - rx buffer resources exhausted */
int cnt_oflow; /* CNT - network tally counter MSB's set */
int rdma_done; /* RDC - remote DMA complete */
int reset; /* RST - reset status */
bool pkt_rx; /* PRX - packet received with no errors */
bool pkt_tx; /* PTX - packet txed with no errors */
bool rx_err; /* RXE - packet rxed with 1 or more errors */
bool tx_err; /* TXE - packet txed " " " " " */
bool overwrite; /* OVW - rx buffer resources exhausted */
bool cnt_oflow; /* CNT - network tally counter MSB's set */
bool rdma_done; /* RDC - remote DMA complete */
bool reset; /* RST - reset status */
} ISR;
/* Interrupt Mask Register - 0fh write */
struct IMR_t {
int rx_inte; /* PRXE - packet rx interrupt enable */
int tx_inte; /* PTXE - packet tx interrput enable */
int rxerr_inte; /* RXEE - rx error interrupt enable */
int txerr_inte; /* TXEE - tx error interrupt enable */
int overw_inte; /* OVWE - overwrite warn int enable */
int cofl_inte; /* CNTE - counter o'flow int enable */
int rdma_inte; /* RDCE - remote DMA complete int enable */
int reserved; /* D7 - reserved */
bool rx_inte; /* PRXE - packet rx interrupt enable */
bool tx_inte; /* PTXE - packet tx interrput enable */
bool rxerr_inte; /* RXEE - rx error interrupt enable */
bool txerr_inte; /* TXEE - tx error interrupt enable */
bool overw_inte; /* OVWE - overwrite warn int enable */
bool cofl_inte; /* CNTE - counter o'flow int enable */
bool rdma_inte; /* RDCE - remote DMA complete int enable */
bool reserved; /* D7 - reserved */
} IMR;
/* Data Configuration Register - 0eh write */
struct DCR_t {
int wdsize; /* WTS - 8/16-bit select */
int endian; /* BOS - byte-order select */
int longaddr; /* LAS - long-address select */
int loop; /* LS - loopback select */
int auto_rx; /* AR - auto-remove rx pkts with remote DMA */
bool wdsize; /* WTS - 8/16-bit select */
bool endian; /* BOS - byte-order select */
bool longaddr; /* LAS - long-address select */
bool loop; /* LS - loopback select */
bool auto_rx; /* AR - auto-remove rx pkts with remote DMA */
uint8_t fifo_size; /* FT0,FT1 - fifo threshold */
} DCR;
/* Transmit Configuration Register - 0dh write */
struct TCR_t {
int crc_disable; /* CRC - inhibit tx CRC */
bool crc_disable; /* CRC - inhibit tx CRC */
uint8_t loop_cntl; /* LB0,LB1 - loopback control */
int ext_stoptx; /* ATD - allow tx disable by external mcast */
int coll_prio; /* OFST - backoff algorithm select */
bool ext_stoptx; /* ATD - allow tx disable by external mcast */
bool coll_prio; /* OFST - backoff algorithm select */
uint8_t reserved; /* D5,D6,D7 - reserved */
} TCR;
/* Transmit Status Register - 04h read */
struct TSR_t {
int tx_ok; /* PTX - tx complete without error */
int reserved; /* D1 - reserved */
int collided; /* COL - tx collided >= 1 times */
int aborted; /* ABT - aborted due to excessive collisions */
int no_carrier; /* CRS - carrier-sense lost */
int fifo_ur; /* FU - FIFO underrun */
int cd_hbeat; /* CDH - no tx cd-heartbeat from transceiver */
int ow_coll; /* OWC - out-of-window collision */
bool tx_ok; /* PTX - tx complete without error */
bool reserved; /* D1 - reserved */
bool collided; /* COL - tx collided >= 1 times */
bool aborted; /* ABT - aborted due to excessive collisions */
bool no_carrier; /* CRS - carrier-sense lost */
bool fifo_ur; /* FU - FIFO underrun */
bool cd_hbeat; /* CDH - no tx cd-heartbeat from transceiver */
bool ow_coll; /* OWC - out-of-window collision */
} TSR;
/* Receive Configuration Register - 0ch write */
struct RCR_t {
int errors_ok; /* SEP - accept pkts with rx errors */
int runts_ok; /* AR - accept < 64-byte runts */
int broadcast; /* AB - accept eth broadcast address */
int multicast; /* AM - check mcast hash array */
int promisc; /* PRO - accept all packets */
int monitor; /* MON - check pkts, but don't rx */
bool errors_ok; /* SEP - accept pkts with rx errors */
bool runts_ok; /* AR - accept < 64-byte runts */
bool broadcast; /* AB - accept eth broadcast address */
bool multicast; /* AM - check mcast hash array */
bool promisc; /* PRO - accept all packets */
bool monitor; /* MON - check pkts, but don't rx */
uint8_t reserved; /* D6,D7 - reserved */
} RCR;
/* Receive Status Register - 0ch read */
struct RSR_t {
int rx_ok; /* PRX - rx complete without error */
int bad_crc; /* CRC - Bad CRC detected */
int bad_falign; /* FAE - frame alignment error */
int fifo_or; /* FO - FIFO overrun */
int rx_missed; /* MPA - missed packet error */
int rx_mbit; /* PHY - unicast or mcast/bcast address match */
int rx_disabled; /* DIS - set when in monitor mode */
int deferred; /* DFR - collision active */
bool rx_ok; /* PRX - rx complete without error */
bool bad_crc; /* CRC - Bad CRC detected */
bool bad_falign; /* FAE - frame alignment error */
bool fifo_or; /* FO - FIFO overrun */
bool rx_missed; /* MPA - missed packet error */
bool rx_mbit; /* PHY - unicast or mcast/bcast address match */
bool rx_disabled; /* DIS - set when in monitor mode */
bool deferred; /* DFR - collision active */
} RSR;
uint16_t local_dma; /* 01,02h read ; current local DMA addr */

View File

@@ -48,10 +48,13 @@
#include <stdint.h>
/* Network provider types. */
#define NET_TYPE_NONE 0 /* use the null network driver */
#define NET_TYPE_SLIRP 1 /* use the SLiRP port forwarder */
#define NET_TYPE_PCAP 2 /* use the (Win)Pcap API */
#define NET_TYPE_VDE 3 /* use the VDE plug API */
#define NET_TYPE_NONE 0 /* use the null network driver */
#define NET_TYPE_SLIRP 1 /* use the SLiRP port forwarder */
#define NET_TYPE_PCAP 2 /* use the (Win)Pcap API */
#define NET_TYPE_VDE 3 /* use the VDE plug API */
#define NET_TYPE_TAP 4 /* use a linux TAP device */
#define NET_TYPE_NMSWITCH 5 /* use the network multicast switch provider */
#define NET_TYPE_NRSWITCH 6 /* use the network remote switch provider */
#define NET_MAX_FRAME 1518
/* Queue size must be a power of 2 */
@@ -95,6 +98,9 @@ typedef struct netcard_conf_t {
int net_type;
char host_dev_name[128];
uint32_t link_state;
uint8_t switch_group;
uint8_t promisc_mode;
char nrs_hostname[128];
} netcard_conf_t;
extern netcard_conf_t net_cards_conf[NET_CARD_MAX];
@@ -126,7 +132,9 @@ typedef struct netdrv_t {
extern const netdrv_t net_pcap_drv;
extern const netdrv_t net_slirp_drv;
extern const netdrv_t net_vde_drv;
extern const netdrv_t net_tap_drv;
extern const netdrv_t net_null_drv;
extern const netdrv_t net_netswitch_drv;
struct _netcard_t {
const device_t *device;
@@ -155,10 +163,11 @@ typedef struct {
int has_slirp;
int has_pcap;
int has_vde;
int has_tap;
} network_devmap_t;
#define HAS_NOSLIRP_NET(x) (x.has_pcap || x.has_vde)
#define HAS_NOSLIRP_NET(x) (x.has_pcap || x.has_vde || x.has_tap)
#ifdef __cplusplus
extern "C" {
@@ -191,6 +200,7 @@ extern int network_dev_available(int);
extern int network_dev_to_id(char *);
extern int network_card_available(int);
extern int network_card_has_config(int);
extern int network_type_has_config(int);
extern const char *network_card_get_internal_name(int);
extern int network_card_get_from_internal_name(char *);
#ifdef EMU_DEVICE_H

View File

@@ -99,6 +99,7 @@ extern const device_t ami_1994_nvr_device;
extern const device_t ami_1995_nvr_device;
extern const device_t via_nvr_device;
extern const device_t p6rp4_nvr_device;
extern const device_t martin_nvr_device;
extern const device_t elt_nvr_device;
#endif

View File

@@ -283,9 +283,11 @@ extern void pci_init(int flags);
/* PCI bridge stuff. */
extern void pci_bridge_set_ctl(void *priv, uint8_t ctl);
extern uint8_t pci_bridge_get_bus_index(void *priv);
#ifdef EMU_DEVICE_H
extern const device_t dec21150_device;
extern const device_t dec21152_device;
extern const device_t ali5243_agp_device;
extern const device_t ali5247_agp_device;

View File

@@ -102,4 +102,6 @@ extern int picinterrupt(void);
extern uint8_t pic_irq_ack(void);
extern void pic_toggle_latch(int is_ps2);
#endif /*EMU_PIC_H*/

View File

@@ -32,8 +32,8 @@
/* String ID numbers. */
enum {
STRING_MOUSE_CAPTURE, /* "Click to capture mouse" */
STRING_MOUSE_RELEASE, /* "Press F8+F12 to release mouse" */
STRING_MOUSE_RELEASE_MMB, /* "Press F8+F12 or middle button to release mouse" */
STRING_MOUSE_RELEASE, /* "Press %1 to release mouse" */
STRING_MOUSE_RELEASE_MMB, /* "Press %1 or middle button to release mouse" */
STRING_INVALID_CONFIG, /* "Invalid configuration" */
STRING_NO_ST506_ESDI_CDROM, /* "MFM/RLL or ESDI CD-ROM drives never existed" */
STRING_NET_ERROR, /* "Failed to initialize network driver" */
@@ -185,9 +185,9 @@ extern void floppy_mount(uint8_t id, char *fn, uint8_t wp);
extern void floppy_eject(uint8_t id);
extern void cdrom_mount(uint8_t id, char *fn);
extern void plat_cdrom_ui_update(uint8_t id, uint8_t reload);
extern void zip_eject(uint8_t id);
extern void zip_mount(uint8_t id, char *fn, uint8_t wp);
extern void zip_reload(uint8_t id);
extern void rdisk_eject(uint8_t id);
extern void rdisk_mount(uint8_t id, char *fn, uint8_t wp);
extern void rdisk_reload(uint8_t id);
extern void mo_eject(uint8_t id);
extern void mo_mount(uint8_t id, char *fn, uint8_t wp);
extern void mo_reload(uint8_t id);

View File

@@ -2,10 +2,14 @@
#define EMU_PRT_DEVS_H
extern const lpt_device_t lpt_prt_text_device;
extern const device_t prt_text_device;
extern const lpt_device_t lpt_prt_escp_device;
extern const device_t prt_escp_device;
extern const lpt_device_t lpt_prt_ps_device;
extern const device_t prt_ps_device;
#ifdef USE_PCL
extern const lpt_device_t lpt_prt_pcl_device;
extern const device_t prt_pcl_device;
#endif
#endif /*EMU_PRT_DEVS_H*/

View File

@@ -0,0 +1,50 @@
/*
* 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.
*
* Define the various paper sizes for printers.
*
* Authors: Jasmine Iwanek, <jasmine@iwanek.co.uk>
*
* Copyright 2025 Jasmine Iwanek
*/
#ifndef EMU_PRT_PAPERSIZES_H
#define EMU_PRT_PAPERSIZES_H
/* Standard U.S. Letter */
#define LETTER_PAGE_WIDTH 8.5
#define LETTER_PAGE_HEIGHT 11.0
/* Standard U.S. Legal */
#define LEGAL_PAGE_WIDTH 8.5
#define LEGAL_PAGE_HEIGHT 14.0
/* Standard U.S. Ledger */
#define LEDGER_PAGE_WIDTH 11.0
#define LEDGER_PAGE_HEIGHT 17.0
/* Standard A0 */
#define A0_PAGE_WIDTH 33.125
#define A0_PAGE_HEIGHT 46.75
/* Standard A1 */
#define A1_PAGE_WIDTH 23.375
#define A1_PAGE_HEIGHT 33.125
/* Standard A2 */
#define A2_PAGE_WIDTH 16.5
#define A2_PAGE_HEIGHT 23.375
/* Standard A3 */
#define A3_PAGE_WIDTH 11.75
#define A3_PAGE_HEIGHT 16.5
/* Standard A4 */
#define A4_PAGE_WIDTH 8.25
#define A4_PAGE_HEIGHT 11.75
#endif /*EMU_PLAT_FALLTHROUGH_H*/

182
src/include/86box/rdisk.h Normal file
View File

@@ -0,0 +1,182 @@
/*
* 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.
*
* Implementation of the Iomega ZIP drive with SCSI(-like)
* commands, for both ATAPI and SCSI usage.
*
*
*
* Authors: Miran Grca, <mgrca8@gmail.com>
*
* Copyright 2018-2025 Miran Grca.
*/
#ifndef EMU_RDISK_H
#define EMU_RDISK_H
#define RDISK_NUM 4
#define BUF_SIZE 32768
#define RDISK_TIME 10.0
#define ZIP_SECTORS (96 * 2048)
#define ZIP_250_SECTORS (489532)
#define RDISK_IMAGE_HISTORY 10
enum {
RDISK_TYPE_GENERIC = 0,
RDISK_TYPE_ZIP_100,
RDISK_TYPE_ZIP_250
};
typedef struct rdisk_type_t {
uint32_t sectors;
uint16_t bytes_per_sector;
} rdisk_type_t;
#define KNOWN_RDISK_TYPES 2
static const rdisk_type_t rdisk_types[KNOWN_RDISK_TYPES] = {
{ ZIP_SECTORS, 512 },
{ ZIP_250_SECTORS, 512 },
};
typedef struct rdisk_drive_type_t {
const char *vendor;
const char *model;
const char *revision;
int8_t supported_media[KNOWN_RDISK_TYPES];
} rdisk_drive_type_t;
#define KNOWN_RDISK_DRIVE_TYPES 3
static const rdisk_drive_type_t rdisk_drive_types[KNOWN_RDISK_DRIVE_TYPES] = {
{ "86BOX", "REMOVABLE DISK", "5.00", { 1, 1 }},
{ "IOMEGA", "ZIP 100", "E.08", { 1, 0 }},
{ "IOMEGA", "ZIP 250", "42.S", { 1, 1 }}
};
enum {
RDISK_BUS_DISABLED = 0,
RDISK_BUS_LPT = 6,
RDISK_BUS_IDE = 7,
RDISK_BUS_ATAPI = 8,
RDISK_BUS_SCSI = 9,
RDISK_BUS_USB = 10
};
typedef struct rdisk_drive_t {
uint8_t id;
union {
uint8_t res;
/* Reserved for other ID's. */
uint8_t res0;
uint8_t res1;
uint8_t ide_channel;
uint8_t scsi_device_id;
};
uint8_t bus_type; /* 0 = ATAPI, 1 = SCSI */
uint8_t bus_mode; /* Bit 0 = PIO suported;
Bit 1 = DMA supportd. */
uint8_t read_only; /* Struct variable reserved for
media status. */
uint8_t pad;
uint8_t pad0;
FILE *fp;
void *priv;
char image_path[1024];
char prev_image_path[1024];
char *image_history[RDISK_IMAGE_HISTORY];
uint32_t type;
uint32_t medium_size;
uint32_t base;
} rdisk_drive_t;
typedef struct rdisk_t {
mode_sense_pages_t ms_pages_saved;
rdisk_drive_t *drv;
#ifdef EMU_IDE_H
ide_tf_t *tf;
#else
void *tf;
#endif
void *log;
uint8_t *buffer;
uint8_t atapi_cdb[16];
uint8_t current_cdb[16];
uint8_t sense[256];
uint8_t id;
uint8_t cur_lun;
uint8_t pad0;
uint8_t pad1;
uint16_t max_transfer_len;
uint16_t pad2;
int requested_blocks;
int packet_status;
int total_length;
int do_page_save;
int unit_attention;
int request_pos;
int old_len;
int transition;
uint32_t sector_pos;
uint32_t sector_len;
uint32_t packet_len;
uint32_t block_len;
double callback;
uint8_t (*ven_cmd)(void *sc, uint8_t *cdb, int32_t *BufLen);
} rdisk_t;
extern rdisk_t *rdisk[RDISK_NUM];
extern rdisk_drive_t rdisk_drives[RDISK_NUM];
extern uint8_t atapi_rdisk_drives[8];
extern uint8_t scsi_rdisk_drives[16];
#define rdisk_sense_error dev->sense[0]
#define rdisk_sense_key dev->sense[2]
#define rdisk_info *(uint32_t *) &(dev->sense[3])
#define rdisk_asc dev->sense[12]
#define rdisk_ascq dev->sense[13]
#ifdef __cplusplus
extern "C" {
#endif
extern void rdisk_disk_close(const rdisk_t *dev);
extern void rdisk_disk_reload(const rdisk_t *dev);
extern void rdisk_insert(rdisk_t *dev);
extern void rdisk_global_init(void);
extern void rdisk_hard_reset(void);
extern void rdisk_reset(scsi_common_t *sc);
extern int rdisk_is_empty(const uint8_t id);
extern void rdisk_load(const rdisk_t *dev, const char *fn, const int skip_insert);
extern void rdisk_close(void);
#ifdef __cplusplus
}
#endif
#endif /*EMU_RDISK_H*/

View File

@@ -0,0 +1,40 @@
/*
* 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 renderers
*
* Authors: Jasmine Iwanek, <jriwanek@gmail.com>
*
* Copyright 2025 Jasmine Iwanek.
*/
#ifndef EMU_RENDERDEFS_H
#define EMU_RENDERDEFS_H
#define RENDERER_NAME_DEFAULT "default"
#define RENDERER_NAME_SYSTEM "system"
#define RENDERER_NAME_QT_SOFTWARE "qt_software"
#define RENDERER_NAME_QT_OPENGL "qt_opengl"
#define RENDERER_NAME_QT_OPENGLES "qt_opengles"
#define RENDERER_NAME_QT_OPENGL3 "qt_opengl3"
#define RENDERER_NAME_QT_VULKAN "qt_vulkan"
#define RENDERER_NAME_VNC "vnc"
#define RENDERER_SOFTWARE 0
#define RENDERER_OPENGL3 1
#define RENDERER_VULKAN 2
#define RENDERER_VNC 3
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif /*EMU_RENDERDEFS_H*/

View File

@@ -151,6 +151,7 @@ extern void serial_set_dsr(serial_t *dev, uint8_t enabled);
extern void serial_set_dcd(serial_t *dev, uint8_t enabled);
extern void serial_set_ri(serial_t *dev, uint8_t enabled);
extern int serial_get_ri(serial_t *dev);
extern uint8_t serial_get_shadow(serial_t *dev);
extern const device_t ns8250_device;
extern const device_t ns8250_pcjr_device;

View File

@@ -13,7 +13,7 @@
* Jasmine Iwanek <jasmine@iwanek.co.uk>
*
* Copyright 2021 Andreas J. Reichel.
* Copyright 2021-2022 Jasmine Iwanek.
* Copyright 2021-2025 Jasmine Iwanek.
*/
#ifndef SERIAL_PASSTHROUGH_H
@@ -28,10 +28,15 @@
#include <86box/serial.h>
enum serial_passthrough_mode {
SERPT_MODE_VCON, /*Named Pipe (Server) / Pseudo Terminal/Virtual Console */
SERPT_MODE_TCPSRV, /* TCP Server (TODO) */
SERPT_MODE_TCPCLNT, /* TCP Client (TODO) */
SERPT_MODE_HOSTSER, /* Host Serial Passthrough */
#ifdef _WIN32
SERPT_MODE_NPIPE_SRV, /* Named Pipe (Server) */
SERPT_MODE_NPIPE_CLNT, /* Named Pipe (Client) */
#else
SERPT_MODE_VCON, /* Pseudo Terminal/Virtual Console */
#endif
SERPT_MODE_TCP_SRV, /* TCP Server (TODO) */
SERPT_MODE_TCP_CLNT, /* TCP Client (TODO) */
SERPT_MODE_HOSTSER, /* Host Serial Passthrough */
SERPT_MODES_MAX,
};

View File

@@ -20,14 +20,13 @@
extern const device_t acc3221_device;
/* Acer / ALi */
extern const device_t ali5105_device;
extern const device_t ali5123_device;
/* Chips & Technologies */
extern const device_t f82c606_device;
extern const device_t f82c710_device;
extern const device_t f82c710_pc5086_device;
/* SM(S)C */
extern const device_t fdc37c651_device;
@@ -46,33 +45,61 @@ extern const device_t fdc37c666_device;
extern const device_t fdc37c669_device;
extern const device_t fdc37c669_370_device;
extern const device_t fdc37c67x_device;
#define FDC37C93X_NORMAL 0x0002
#define FDC37C93X_FR 0x0003
#define FDC37C93X_APM 0x0030
#define FDC37C93X_CHIP_ID 0x00ff
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 fdc37c932_device;
extern const device_t fdc37c935_device;
extern const device_t fdc37c935_370_device;
extern const device_t fdc37c935_no_nvr_device;
#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 FDC37C93X_NO_NVR 0x1000
#define FDC37XXXX_370 0x2000
extern const device_t fdc37c93x_device;
extern const device_t fdc37m60x_device;
extern const device_t fdc37m60x_370_device;
extern const device_t fdc37c67x_device;
/* ITE */
extern const device_t it8661f_device;
extern const device_t it8671f_device;
/* Intel */
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 */
/* National Semiconductors PC87310 / ALi M5105 */
#define PC87310_IDE 0x0001
#define PC87310_ALI 0x0002
extern const device_t pc87310_device;
extern const device_t pc87310_ide_device;
/* National Semiconductors */
#define PCX7307_PC87307 0x00c0
#define PCX7307_PC97307 0x00cf
#define PC87309_PC87309 0x00e0
#define PCX730X_CHIP_ID 0x00ff
#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_15C 0x2000
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;
@@ -81,13 +108,10 @@ 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;
/* National Semiconductors PC87307 / PC87309 */
extern const device_t pc87307_device;
extern const device_t pc87307_15c_device;
extern const device_t pc87307_both_device;
extern const device_t pc97307_device;
extern const device_t pc87309_device;
extern const device_t pc87309_15c_device;
/* LG Prime */
extern const device_t prime3b_device;
@@ -104,6 +128,10 @@ 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;

View File

@@ -100,6 +100,7 @@
#define AC97_CODEC_STAC9708 AC97_VENDOR_ID(0x83, 0x84, 0x76, 0x08)
#define AC97_CODEC_STAC9721 AC97_VENDOR_ID(0x83, 0x84, 0x76, 0x09)
#define AC97_CODEC_TR28023 AC97_VENDOR_ID('T', 'R', 'A', 0x03)
#define AC97_CODEC_W83971D AC97_VENDOR_ID('W', 'E', 'C', 0x01)
#define AC97_CODEC_WM9701A AC97_VENDOR_ID('W', 'M', 'L', 0x00)
typedef struct ac97_vendor_reg_t {
@@ -150,6 +151,7 @@ extern const device_t cs4297a_device;
extern const device_t stac9708_device;
extern const device_t stac9721_device;
extern const device_t tr28023_device;
extern const device_t w83971d_device;
extern const device_t wm9701a_device;
extern const device_t ac97_via_device;

View File

@@ -7,20 +7,23 @@
#define MASTER_CLOCK 7159090
typedef struct cms_t {
#ifdef SAASOUND_H_INCLUDED
SAASND saasound;
SAASND saasound2;
#else
void* saasound;
void* saasound2;
#endif
int addrs[2];
uint8_t regs[2][32];
uint16_t latch[2][6];
int freq[2][6];
float count[2][6];
int vol[2][6][2];
int stat[2][6];
uint16_t noise[2][2];
uint16_t noisefreq[2][2];
int noisecount[2][2];
int noisetype[2][2];
uint8_t latched_data;
int16_t buffer[WTBUFLEN * 2];
int16_t buffer2[WTBUFLEN * 2];
int16_t buffer[SOUNDBUFLEN * 2];
int pos, pos2;
int pos;
} cms_t;
extern void cms_update(cms_t *cms);

View File

@@ -0,0 +1,42 @@
/*
* 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.
*
* Mindscape Music Board emulation.
*
* Authors: Roy Baer, <https://pcem-emulator.co.uk/>
* Jasmine Iwanek, <jriwanek@gmail.com>
*
* Copyright 2025 Roy Baer.
* Copyright 2025 Jasmine Iwanek.
*/
#ifndef _SOUND_SND_MMB_H_
#define _SOUND_SND_MMB_H_
#define MMB_FREQ FREQ_48000
/* NOTE:
* The constant clock rate is a deviation from the real hardware which has
* the design flaw that the clock rate is always half the ISA bus clock.
*/
#define MMB_CLOCK 2386364
typedef struct ay_3_891x_s {
uint8_t index;
uint8_t regs[16];
struct ayumi chip;
} ay_3_891x_t;
typedef struct mmb_s {
ay_3_891x_t first;
ay_3_891x_t second;
int16_t buffer[SOUNDBUFLEN * 2];
int pos;
} mmb_t;
#endif /* _SOUND_SND_MMB_H_ */

View File

@@ -4,7 +4,7 @@
#ifdef __cplusplus
extern "C" {
#endif
void *sid_init(uint8_t type);
void *sid_init(uint8_t type, double range);
void sid_close(void *priv);
void sid_reset(void *priv);
uint8_t sid_read(uint16_t addr, void *priv);

View File

@@ -12,9 +12,11 @@
*
* Authors: Sarah Walker, <https://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
* Jasmine Iwanek, <jriwanek@gmail.com>
*
* Copyright 2008-2018 Sarah Walker.
* Copyright 2016-2018 Miran Grca.
* Copyright 2016-2025 Miran Grca.
* Copyright 2024-2025 Jasmine Iwanek.
*/
#ifndef EMU_SOUND_H
@@ -132,6 +134,12 @@ extern const device_t cmi8738_device;
extern const device_t cmi8738_onboard_device;
extern const device_t cmi8738_6ch_onboard_device;
/* Covox ISA */
extern const device_t voicemasterkey_device;
extern const device_t soundmasterplus_device;
extern const device_t isadacr0_device;
extern const device_t isadacr1_device;
/* Creative Labs Game Blaster */
extern const device_t cms_device;
@@ -197,6 +205,7 @@ extern const device_t ct5880_onboard_device;
/* Gravis UltraSound and UltraSound Max */
extern const device_t gus_device;
extern const device_t gus_max_device;
/* IBM PS/1 Audio Card */
extern const device_t ps1snd_device;
@@ -205,11 +214,17 @@ extern const device_t ps1snd_device;
extern const device_t ssi2001_device;
extern const device_t entertainer_device;
/* Mindscape Music Board */
extern const device_t mmb_device;
/* Pro Audio Spectrum Plus, 16, and 16D */
extern const device_t pasplus_device;
extern const device_t pas16_device;
extern const device_t pas16d_device;
/* Rainbow Arts PC-Soundman */
extern const device_t soundman_device;
/* Tandy PSSJ */
extern const device_t pssj_device;
extern const device_t pssj_isa_device;

View File

@@ -49,7 +49,7 @@ extern int ui_msgbox_header(int flags, void *header, void *message);
#define SB_CARTRIDGE 0x10
#define SB_FLOPPY 0x20
#define SB_CDROM 0x30
#define SB_ZIP 0x40
#define SB_RDISK 0x40
#define SB_MO 0x50
#define SB_HDD 0x60
#define SB_NETWORK 0x70
@@ -67,6 +67,7 @@ extern void ui_sb_update_tip(int meaning);
extern void ui_sb_update_icon(int tag, int active);
extern void ui_sb_update_icon_write(int tag, int write);
extern void ui_sb_update_icon_state(int tag, int state);
extern void ui_sb_update_icon_wp(int tag, int state);
extern void ui_sb_set_text_w(wchar_t *wstr);
extern void ui_sb_set_text(char *str);
extern void ui_sb_bugui(char *str);

View File

@@ -24,6 +24,26 @@
#define INT_FIFO_EMP (1 << 3)
#define INT_MASK 0xf
typedef enum {
IBM_8514A_TYPE = 0,
ATI_38800_TYPE,
ATI_68800_TYPE,
TYPE_MAX
} ibm8514_card_type;
typedef enum {
IBM = 0,
ATI,
EXTENSIONS_MAX
} ibm8514_extensions_t;
typedef enum {
VGA_MODE = 0,
IBM_MODE,
ATI_MODE,
MODE_MAX
} ibm8514_mode_t;
typedef struct hwcursor8514_t {
int ena;
int x;
@@ -58,7 +78,7 @@ typedef struct ibm8514_t {
int force_old_addr;
int type;
int local;
ibm8514_card_type local;
int bpp;
int on;
int accel_bpp;
@@ -67,7 +87,7 @@ typedef struct ibm8514_t {
uint32_t vram_mask;
uint32_t pallook[512];
uint32_t bios_addr;
uint32_t ma_latch;
uint32_t memaddr_latch;
PALETTE vgapal;
uint8_t hwcursor_oddeven;
@@ -189,6 +209,7 @@ typedef struct ibm8514_t {
int split;
int h_disp;
int h_total;
int h_sync_start;
int h_sync_width;
int h_disp_time;
int rowoffset;
@@ -207,8 +228,8 @@ typedef struct ibm8514_t {
int lastline_draw;
int displine;
int fullchange;
uint32_t ma;
uint32_t maback;
uint32_t memaddr;
uint32_t memaddr_backup;
uint8_t *vram;
uint8_t *changedvram;
@@ -223,7 +244,7 @@ typedef struct ibm8514_t {
int hdisp;
int hdisp2;
int hdisped;
int sc;
int scanline;
int vsyncstart;
int vsyncwidth;
int vtotal;
@@ -246,7 +267,9 @@ typedef struct ibm8514_t {
int pitch;
int ext_pitch;
int ext_crt_pitch;
int extensions;
ibm8514_extensions_t extensions;
ibm8514_mode_t mode;
int onboard;
int linear;
uint32_t vram_amount;
int vram_512k_8514;
@@ -263,9 +286,9 @@ typedef struct ibm8514_t {
} ibm8514_t;
#define IBM_8514A (((dev->local & 0xff) == 0x00) && (dev->extensions == 0x00))
#define ATI_8514A_ULTRA (((dev->local & 0xff) == 0x00) && (dev->extensions == 0x01))
#define ATI_GRAPHICS_ULTRA ((dev->local & 0xff) == 0x01)
#define ATI_MACH32 ((dev->local & 0xff) == 0x02)
#define IBM_8514A (((dev->local & 0xff) == IBM_8514A_TYPE) && (dev->extensions == IBM))
#define ATI_8514A_ULTRA (((dev->local & 0xff) == IBM_8514A_TYPE) && (dev->extensions == ATI))
#define ATI_GRAPHICS_ULTRA ((dev->local & 0xff) == ATI_38800_TYPE)
#define ATI_MACH32 ((dev->local & 0xff) == ATI_68800_TYPE)
#endif /*VIDEO_8514A_H*/

View File

@@ -18,6 +18,12 @@
#ifndef VIDEO_ATI_MACH8_H
#define VIDEO_ATI_MACH8_H
typedef enum {
ATI_68875 = 0,
ATI_68860,
RAMDAC_MAX
} mach_ramdac_type;
typedef struct mach_t {
ati_eeprom_t eeprom;
svga_t svga;
@@ -39,7 +45,7 @@ typedef struct mach_t {
uint8_t irq_state;
int index;
int ramdac_type;
mach_ramdac_type ramdac_type;
int old_mode;
uint16_t config1;
@@ -137,6 +143,7 @@ typedef struct mach_t {
int16_t dx_end;
int16_t dy;
int16_t dy_end;
int16_t dx_first_row_start;
int16_t dx_start;
int16_t dy_start;
int16_t cy;

View File

@@ -8,23 +8,69 @@
*
* Emulation of the old and new IBM CGA graphics cards.
*
*
*
* Authors: Sarah Walker, <https://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
* Connor Hyde / starfrost, <mario64crashed@gmail.com>
*
* Copyright 2008-2018 Sarah Walker.
* Copyright 2016-2018 Miran Grca.
* Copyright 2025 starfrost (refactoring).
*/
#ifndef VIDEO_CGA_H
#define VIDEO_CGA_H
// Mode flags for the CGA.
// Set by writing to 3D8
typedef enum cga_mode_flags_e {
CGA_MODE_FLAG_HIGHRES = 1 << 0, // 80-column text mode
CGA_MODE_FLAG_GRAPHICS = 1 << 1, // Graphics mode
CGA_MODE_FLAG_BW = 1 << 2, // Black and white
CGA_MODE_FLAG_VIDEO_ENABLE = 1 << 3, // 0 = no video (as if the video was 0)
CGA_MODE_FLAG_HIGHRES_GRAPHICS = 1 << 4, // 640*200 mode. Corrupts text mode if CGA_MODE_FLAG_GRAPHICS not set.
CGA_MODE_FLAG_BLINK = 1 << 5, // If this is set, bit 5 of textmode characters blinks. Otherwise it is a high-intensity bg mode.
} cga_mode_flags;
// Motorola MC6845 CRTC registers
typedef enum cga_crtc_registers_e {
CGA_CRTC_HTOTAL = 0x0, // Horizontal total (total number of characters incl. hsync)
CGA_CRTC_HDISP = 0x1, // Horizontal display
CGA_CRTC_HSYNC_POS = 0x2, // Horizontal position of horizontal ysnc
CGA_CRTC_HSYNC_WIDTH = 0x3, // Width of horizontal sync
CGA_CRTC_VTOTAL = 0x4, // Vertical total (total number of scanlines incl. vsync)
CGA_CRTC_VTOTAL_ADJUST = 0x5, // Vertical total adjust value
CGA_CRTC_VDISP = 0x6, // Vertical display (total number of displayed scanline)
CGA_CRTC_VSYNC = 0x7, // Vertical sync scanline number
CGA_CRTC_INTERLACE = 0x8, // Interlacing mode
CGA_CRTC_MAX_SCANLINE_ADDR = 0x9, // Maximum scanline address
CGA_CRTC_CURSOR_START = 0xA, // Cursor start scanline
CGA_CRTC_CURSOR_END = 0xB, // Cursor end scanline
CGA_CRTC_START_ADDR_HIGH = 0xC, // Screen start address high 8 bits
CGA_CRTC_START_ADDR_LOW = 0xD, // Screen start address low 8 bits
CGA_CRTC_CURSOR_ADDR_HIGH = 0xE, // Cursor address high 8 bits
CGA_CRTC_CURSOR_ADDR_LOW = 0xF, // Cursor address low 8 bits
CGA_CRTC_LIGHT_PEN_ADDR_HIGH = 0x10, // Light pen address high 8 bits (not currently supported)
CGA_CRTC_LIGHT_PEN_ADDR_LOW = 0x11, // Light pen address low 8 bits (not currently supported)
} cga_crtc_registers;
// Registers for the CGA
typedef enum cga_registers_e {
CGA_REGISTER_CRTC_INDEX = 0x3D4,
CGA_REGISTER_CRTC_DATA = 0x3D5,
CGA_REGISTER_MODE_CONTROL = 0x3D8,
CGA_REGISTER_COLOR_SELECT = 0x3D9,
CGA_REGISTER_STATUS = 0x3DA,
CGA_REGISTER_CLEAR_LIGHT_PEN_LATCH = 0x3DB,
CGA_REGISTER_SET_LIGHT_PEN_LATCH = 0x3DC,
} cga_registers;
#define CGA_NUM_CRTC_REGS 32
typedef struct cga_t {
mem_mapping_t mapping;
int crtcreg;
uint8_t crtc[32];
uint8_t crtc[CGA_NUM_CRTC_REGS];
uint8_t cgastat;
@@ -36,17 +82,16 @@ typedef struct cga_t {
int fontbase;
int linepos;
int displine;
int sc;
int scanline;
int vc;
int cgadispon;
int con;
int coff;
int cursorvisible; // Determines if the cursor is visible FOR THE CURRENT SCANLINE.
int cursoron;
int cgablink;
int vsynctime;
int vadj;
uint16_t ma;
uint16_t maback;
uint16_t memaddr;
uint16_t memaddr_backup;
int oddeven;
uint64_t dispontime;
@@ -79,11 +124,11 @@ uint8_t cga_read(uint32_t addr, void *priv);
void cga_recalctimings(cga_t *cga);
void cga_poll(void *priv);
#ifdef EMU_DEVICE_H
extern const device_config_t cga_config[];
extern const device_t cga_device;
extern const device_t cga_pravetz_device;
#endif
//#ifdef EMU_DEVICE_H
//extern const device_config_t cga_config[];
//
//extern const device_t cga_device;
//extern const device_t cga_pravetz_device;
//#endif
//
#endif /*VIDEO_CGA_H*/

View File

@@ -4,6 +4,8 @@
typedef struct colorplus_t {
cga_t cga;
uint8_t control;
lpt_t * lpt;
} colorplus_t;
void colorplus_init(colorplus_t *colorplus);

View File

@@ -39,7 +39,7 @@ typedef struct ega_t {
uint8_t lb;
uint8_t lc;
uint8_t ld;
uint8_t stat;
uint8_t status;
uint8_t colourcompare;
uint8_t colournocare;
uint8_t scrblank;
@@ -68,12 +68,12 @@ typedef struct ega_t {
int chain4;
int chain2_read;
int chain2_write;
int con;
int cursorvisible;
int oddeven_page;
int oddeven_chain;
int vc;
int real_vc;
int sc;
int scanline;
int dispon;
int hdisp_on;
int cursoron;
@@ -115,14 +115,14 @@ typedef struct ega_t {
int chipset;
int mono_display;
int mdacols[256][2][2];
int mda_attr_to_color_table[256][2][2];
uint32_t charseta;
uint32_t charsetb;
uint32_t ma_latch;
uint32_t ma;
uint32_t maback;
uint32_t ca;
uint32_t memaddr_latch;
uint32_t memaddr;
uint32_t memaddr_backup;
uint32_t cursoraddr;
uint32_t vram_limit;
uint32_t overscan_color;
uint32_t cca;
@@ -148,6 +148,8 @@ typedef struct ega_t {
card should not attempt to display anything. */
void (*render_override)(void *priv);
void * priv_parent;
uint8_t alt_addr; /* 0 for 0x3XX range, 1 for 0x2XX range */
} ega_t;
#endif
@@ -187,11 +189,11 @@ extern void ega_set_type(void *priv, uint32_t local);
extern int firstline_draw;
extern int lastline_draw;
extern int displine;
extern int sc;
extern int scanline;
extern uint32_t ma;
extern uint32_t ca;
extern int con;
extern uint32_t memaddr;
extern uint32_t cursoraddr;
extern int cursorvisible;
extern int cursoron;
extern int cgablink;

View File

@@ -33,9 +33,9 @@
} \
\
if (nr & VAR_ROW0_MA13) \
out_addr = (out_addr & ~0x8000) | ((ega->sc & 1) ? 0x8000 : 0); \
out_addr = (out_addr & ~0x8000) | ((ega->scanline & 1) ? 0x8000 : 0); \
if (nr & VAR_ROW1_MA14) \
out_addr = (out_addr & ~0x10000) | ((ega->sc & 2) ? 0x10000 : 0); \
out_addr = (out_addr & ~0x10000) | ((ega->scanline & 2) ? 0x10000 : 0); \
\
return out_addr; \
}

View File

@@ -13,10 +13,12 @@
* Authors: Sarah Walker, <https://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
* Jasmine Iwanek, <jriwanek@gmail.com>
*
* Connor Hyde / starfrost, <mario64crashed@gmail.com
*
* Copyright 2008-2019 Sarah Walker.
* Copyright 2016-2019 Miran Grca.
* Copyright 2021 Jasmine Iwanek.
* Copyright 2025 starfrost
*/
#ifndef VIDEO_HERCULES_H
@@ -31,7 +33,7 @@ typedef struct {
uint8_t ctrl;
uint8_t ctrl2;
uint8_t stat;
uint8_t status;
uint64_t dispontime;
uint64_t dispofftime;
@@ -43,22 +45,22 @@ typedef struct {
int linepos;
int displine;
int vc;
int sc;
uint16_t ma;
uint16_t maback;
int con;
int coff;
int scanline;
uint16_t memaddr;
uint16_t memaddr_backup;
int cursorvisible;
int cursoron;
int dispon;
int blink;
int vsynctime;
int vadj;
int lp_ff;
int fullchange;
int lp_ff;
int fullchange;
int cols[256][2][2];
int cols[256][2][2];
lpt_t *lpt;
uint8_t *vram;
int monitor_index;
int prev_monitor_index;

View File

@@ -1,44 +1,126 @@
/* Copyright holders: Sarah Walker
see COPYING for more details
*/
/*
* 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.
*
* Emulation of the IBM Monochrome Display and Printer card.
*
* Authors: Sarah Walker, starfrost
*
* Copyright 2007-2024 Sarah Walker
* Copyright 2025 Connor Hyde / starfrost, <mario64crashed@gmail.com>
*/
#ifndef VIDEO_MDA_H
#define VIDEO_MDA_H
// Defines
#define MDA_CRTC_NUM_REGISTERS 32
// Enums & structures
typedef enum mda_registers_e
{
MDA_REGISTER_START = 0x3B0,
MDA_REGISTER_CRTC_INDEX = 0x3B4,
MDA_REGISTER_CRTC_DATA = 0x3B5,
MDA_REGISTER_MODE_CONTROL = 0x3B8,
MDA_REGISTER_CRT_STATUS = 0x3BA,
MDA_REGISTER_PARALLEL_DATA = 0x3BC,
MDA_REGISTER_PRINTER_STATUS = 0x3BD,
MDA_REGISTER_PRINTER_CONTROL = 0x3BE,
MDA_REGISTER_END = 0x3BF,
} mda_registers;
// Motorola MC6845 CRTC registers (without light pen for some reason)
typedef enum mda_crtc_registers_e
{
MDA_CRTC_HTOTAL = 0x0, // Horizontal total (total number of characters incl. hsync)
MDA_CRTC_HDISP = 0x1, // Horizontal display
MDA_CRTC_HSYNC_POS = 0x2, // Horizontal position of horizontal ysnc
MDA_CRTC_HSYNC_WIDTH = 0x3, // Width of horizontal sync
MDA_CRTC_VTOTAL = 0x4, // Vertical total (total number of scanlines incl. vsync)
MDA_CRTC_VTOTAL_ADJUST = 0x5, // Vertical total adjust value
MDA_CRTC_VDISP = 0x6, // Vertical display (total number of displayed scanline)
MDA_CRTC_VSYNC = 0x7, // Vertical sync scanline number
MDA_CRTC_INTERLACE = 0x8, // Interlacing mode
MDA_CRTC_MAX_SCANLINE_ADDR = 0x9, // Maximum scanline address
MDA_CRTC_CURSOR_START = 0xA, // Cursor start scanline
MDA_CRTC_CURSOR_END = 0xB, // Cursor end scanline
MDA_CRTC_START_ADDR_HIGH = 0xC, // Screen start address high 8 bits
MDA_CRTC_START_ADDR_LOW = 0xD, // Screen start address low 8 bits
MDA_CRTC_CURSOR_ADDR_HIGH = 0xE, // Cursor address high 8 bits
MDA_CRTC_CURSOR_ADDR_LOW = 0xF, // Cursor address low 8 bits
} mda_crtc_registers;
typedef enum mda_mode_flags_e
{
MDA_MODE_HIGHRES = 1 << 0, // MUST be enabled for sane operation
MDA_MODE_BW = 1 << 1, // UNUSED in most cases. Not present on Hercules
MDA_MODE_VIDEO_ENABLE = 1 << 3,
MDA_MODE_BLINK = 1 << 5,
} mda_mode_flags;
typedef enum mda_colors_e
{
MDA_COLOR_BLACK = 0,
MDA_COLOR_BLUE = 1,
MDA_COLOR_GREEN = 2,
MDA_COLOR_CYAN = 3,
MDA_COLOR_RED = 4,
MDA_COLOR_MAGENTA = 5,
MDA_COLOR_BROWN = 6,
MDA_COLOR_WHITE = 7,
MDA_COLOR_GREY = 8,
MDA_COLOR_BRIGHT_BLUE = 9,
MDA_COLOR_BRIGHT_GREEN = 10,
MDA_COLOR_BRIGHT_CYAN = 11,
MDA_COLOR_BRIGHT_RED = 12,
MDA_COLOR_BRIGHT_MAGENTA = 13,
MDA_COLOR_BRIGHT_YELLOW = 14,
MDA_COLOR_BRIGHT_WHITE = 15,
} mda_colors;
typedef struct mda_t {
mem_mapping_t mapping;
uint8_t crtc[32];
int crtcreg;
uint8_t crtc[MDA_CRTC_NUM_REGISTERS];
int32_t crtcreg;
uint8_t ctrl;
uint8_t stat;
uint8_t mode;
uint8_t status;
uint64_t dispontime;
uint64_t dispofftime;
pc_timer_t timer;
uint64_t dispontime;
uint64_t dispofftime;
pc_timer_t timer;
int firstline;
int lastline;
int32_t firstline;
int32_t lastline;
int fontbase;
int linepos;
int displine;
int vc;
int sc;
uint16_t ma;
uint16_t maback;
int con;
int coff;
int cursoron;
int dispon;
int blink;
int vsynctime;
int vadj;
int monitor_index;
int prev_monitor_index;
int32_t fontbase;
int32_t linepos;
int32_t displine;
int32_t vc;
int32_t scanline;
uint16_t memaddr;
uint16_t memaddr_backup;
int32_t cursorvisible;
int32_t cursoron;
int32_t dispon;
int32_t blink;
int32_t vsynctime;
int32_t vadj;
int32_t monitor_index;
int32_t prev_monitor_index;
int32_t monitor_type; // Used for MDA Colour support (REV0 u64)
uint8_t *vram;
uint8_t *vram;
lpt_t *lpt;
} mda_t;
#define VIDEO_MONITOR_PROLOGUE() \

View File

@@ -115,14 +115,13 @@ typedef struct pgc {
int displine;
int vc;
int cgadispon;
int con;
int coff;
int cursorvisible;
int cursoron;
int cgablink;
int vsynctime;
int vadj;
uint16_t ma;
uint16_t maback;
uint16_t memaddr;
uint16_t memaddr_backup;
int oddeven;
uint64_t dispontime;

View File

@@ -0,0 +1,93 @@
/*
* 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.
*
* Quadram Quadcolor I / I+II emulation
*
* Authors: Benedikt Freisen, <https://pcem-emulator.co.uk/>
* Jasmine Iwanek, <jriwanek@gmail.com>
*
* Copyright 2024 Benedikt Freisen.
Copyright 2025 Jasmine Iwanek.
*/
#ifndef _VID_QUADCOLOR_H_
#define _VID_QUADCOLOR_H_
typedef struct quadcolor_t {
mem_mapping_t mapping;
mem_mapping_t mapping_2;
int crtcreg;
#if 0
uint8_t crtc[CGA_NUM_CRTC_REGS];
#else
uint8_t crtc[32];
#endif
uint8_t cgastat;
uint8_t cgamode;
uint8_t cgacol;
uint8_t lp_strobe;
uint8_t quadcolor_ctrl;
uint8_t quadcolor_2_oe;
uint16_t page_offset;
int fontbase;
int linepos;
int displine;
int scanline;
int vc;
int cgadispon;
int cursorvisible; // Determines if the cursor is visible FOR THE CURRENT SCANLINE.
int cursoron;
int cgablink;
int vsynctime;
int vadj;
uint16_t memaddr;
uint16_t memaddr_backup;
int oddeven;
int qc2idx;
uint8_t qc2mask;
uint64_t dispontime;
uint64_t dispofftime;
pc_timer_t timer;
int firstline;
int lastline;
int drawcursor;
int fullchange;
uint8_t *vram;
uint8_t *vram_2;
uint8_t charbuffer[256];
int revision;
int composite;
int rgb_type;
int double_type;
int has_2nd_charset;
int has_quadcolor_2;
} quadcolor_t;
void quadcolor_init(quadcolor_t *quadcolor);
void quadcolor_out(uint16_t addr, uint8_t val, void *priv);
uint8_t quadcolor_in(uint16_t addr, void *priv);
void quadcolor_write(uint32_t addr, uint8_t val, void *priv);
uint8_t quadcolor_read(uint32_t addr, void *priv);
void quadcolor_recalctimings(quadcolor_t *quadcolor);
void quadcolor_poll(void *priv);
#endif /* _VID_QUADCOLOR_H_ */

View File

@@ -30,6 +30,7 @@
# define FLAG_S3_911_16BIT 256
# define FLAG_512K_MASK 512
# define FLAG_NO_SHIFT3 1024 /* Needed for Bochs VBE. */
# define FLAG_PRECISETIME 2048 /* Needed for Copper demo if on dynarec. */
struct monitor_t;
typedef struct hwcursor_t {
@@ -100,12 +101,12 @@ typedef struct svga_t {
int dispon;
int hdisp_on;
int vc;
int sc;
int scanline;
int linepos;
int vslines;
int linecountff;
int oddeven;
int con;
int cursorvisible;
int cursoron;
int blink;
int scrollcache;
@@ -116,6 +117,7 @@ typedef struct svga_t {
int lastline_draw;
int displine;
int fullchange;
int left_overscan;
int x_add;
int y_add;
int pan;
@@ -135,6 +137,9 @@ typedef struct svga_t {
int packed_4bpp;
int ps_bit_bug;
int ati_4color;
int vblankend;
int render_line_offset;
int start_retrace_latch;
/*The three variables below allow us to implement memory maps like that seen on a 1MB Trio64 :
0MB-1MB - VRAM
@@ -151,15 +156,15 @@ typedef struct svga_t {
uint32_t charseta;
uint32_t charsetb;
uint32_t adv_flags;
uint32_t ma_latch;
uint32_t memaddr_latch;
uint32_t ca_adj;
uint32_t ma;
uint32_t maback;
uint32_t memaddr;
uint32_t memaddr_backup;
uint32_t write_bank;
uint32_t read_bank;
uint32_t extra_banks[2];
uint32_t banked_mask;
uint32_t ca;
uint32_t cursoraddr;
uint32_t overscan_color;
uint32_t *map8;
uint32_t pallook[512];
@@ -280,6 +285,10 @@ typedef struct svga_t {
you should set this flag when entering that mode*/
int disable_blink;
/*Force special shifter bypass logic for 8-bpp lowres modes.
Needed if the screen is squished on certain S3 cards.*/
int force_shifter_bypass;
/*Force CRTC to dword mode, regardless of CR14/CR17. Required for S3 enhanced mode*/
int force_dword_mode;
@@ -403,15 +412,15 @@ uint32_t svga_lookup_lut_ram(svga_t* svga, uint32_t val);
/* We need a way to add a device with a pointer to a parent device so it can attach itself to it, and
possibly also a second ATi 68860 RAM DAC type that auto-sets SVGA render on RAM DAC render change. */
extern void ati68860_ramdac_out(uint16_t addr, uint8_t val, void *priv, svga_t *svga);
extern uint8_t ati68860_ramdac_in(uint16_t addr, void *priv, svga_t *svga);
extern void ati68860_ramdac_out(uint16_t addr, uint8_t val, int is_8514, void *priv, svga_t *svga);
extern uint8_t ati68860_ramdac_in(uint16_t addr, int is_8514, void *priv, svga_t *svga);
extern void ati68860_set_ramdac_type(void *priv, int type);
extern void ati68860_ramdac_set_render(void *priv, svga_t *svga);
extern void ati68860_ramdac_set_pallook(void *priv, int i, uint32_t col);
extern void ati68860_hwcursor_draw(svga_t *svga, int displine);
extern void ati68875_ramdac_out(uint16_t addr, int rs2, int rs3, uint8_t val, void *priv, svga_t *svga);
extern uint8_t ati68875_ramdac_in(uint16_t addr, int rs2, int rs3, void *priv, svga_t *svga);
extern void ati68875_ramdac_out(uint16_t addr, int rs2, int rs3, uint8_t val, int is_8514, void *priv, svga_t *svga);
extern uint8_t ati68875_ramdac_in(uint16_t addr, int rs2, int rs3, int is_8514, void *priv, svga_t *svga);
extern void att49x_ramdac_out(uint16_t addr, int rs2, uint8_t val, void *priv, svga_t *svga);
extern uint8_t att49x_ramdac_in(uint16_t addr, int rs2, void *priv, svga_t *svga);

View File

@@ -23,11 +23,11 @@
extern int firstline_draw;
extern int lastline_draw;
extern int displine;
extern int sc;
extern int scanline;
extern uint32_t ma;
extern uint32_t ca;
extern int con;
extern uint32_t memaddr;
extern uint32_t cursoraddr;
extern int cursorvisible;
extern int cursoron;
extern int cgablink;
@@ -55,13 +55,10 @@ extern void svga_render_4bpp_lowres(svga_t *svga);
extern void svga_render_4bpp_highres(svga_t *svga);
extern void svga_render_8bpp_lowres(svga_t *svga);
extern void svga_render_8bpp_highres(svga_t *svga);
extern void svga_render_4bpp_tseng_highres(svga_t *svga);
extern void svga_render_8bpp_clone_highres(svga_t *svga);
extern void svga_render_8bpp_tseng_lowres(svga_t *svga);
extern void svga_render_8bpp_tseng_highres(svga_t *svga);
extern void svga_render_8bpp_gs_lowres(svga_t *svga);
extern void svga_render_8bpp_gs_highres(svga_t *svga);
extern void svga_render_8bpp_rgb_lowres(svga_t *svga);
extern void svga_render_8bpp_rgb_highres(svga_t *svga);
extern void svga_render_15bpp_lowres(svga_t *svga);
extern void svga_render_15bpp_highres(svga_t *svga);
extern void svga_render_15bpp_mix_lowres(svga_t *svga);

View File

@@ -47,9 +47,9 @@
} \
\
if (nr & VAR_ROW0_MA13) \
out_addr = (out_addr & ~0x8000) | ((svga->sc & 1) ? 0x8000 : 0); \
out_addr = (out_addr & ~0x8000) | ((svga->scanline & 1) ? 0x8000 : 0); \
if (nr & VAR_ROW1_MA14) \
out_addr = (out_addr & ~0x10000) | ((svga->sc & 2) ? 0x10000 : 0); \
out_addr = (out_addr & ~0x10000) | ((svga->scanline & 2) ? 0x10000 : 0); \
\
return out_addr; \
}

View File

@@ -19,6 +19,9 @@
#include <86box/rom.h>
#define XGA_INT_START_BLKNK_ENAB (1 << 0)
#define XGA_INT_MASK 0xf
typedef struct xga_hwcursor_t {
int ena;
int x;
@@ -84,13 +87,13 @@ typedef struct xga_t {
uint8_t border_color;
uint8_t direct_color;
uint8_t dma_channel;
uint8_t instance_isa;
uint8_t instance_num;
uint8_t ext_mem_addr;
uint8_t vga_post;
uint8_t addr_test;
uint8_t *vram;
uint8_t *changedvram;
uint8_t int_ena;
uint8_t int_stat;
int16_t hwc_pos_x;
int16_t hwc_pos_y;
@@ -127,7 +130,7 @@ typedef struct xga_t {
int dispon;
int h_disp_on;
int vc;
int sc;
int scanline;
int linepos;
int oddeven;
int firstline;
@@ -149,9 +152,9 @@ typedef struct xga_t {
int cursor_data_on;
int pal_test;
int a5_test;
int test_stage;
int type;
int bus;
int busy;
uint32_t linear_base;
uint32_t linear_size;
@@ -160,17 +163,18 @@ typedef struct xga_t {
uint32_t hwc_color0;
uint32_t hwc_color1;
uint32_t disp_start_addr;
uint32_t ma_latch;
uint32_t memaddr_latch;
uint32_t vram_size;
uint32_t vram_mask;
uint32_t rom_addr;
uint32_t ma;
uint32_t maback;
uint32_t memaddr;
uint32_t memaddr_backup;
uint32_t read_bank;
uint32_t write_bank;
uint32_t px_map_base;
uint32_t pallook[512];
uint32_t bios_diag;
uint32_t mapping_base;
PALETTE xgapal;
@@ -205,6 +209,10 @@ typedef struct xga_t {
uint16_t dst_map_y;
uint16_t pat_map_x;
uint16_t pat_map_y;
uint16_t clip_l;
uint16_t clip_r;
uint16_t clip_t;
uint16_t clip_b;
int ssv_state;
int pat_src;
@@ -218,13 +226,13 @@ typedef struct xga_t {
int y;
int sx;
int sy;
int dx;
int dy;
int px;
int py;
int pattern;
int command_len;
int filling;
int y_len;
int x_len;
uint32_t short_stroke;
uint32_t color_cmp;
@@ -234,6 +242,7 @@ typedef struct xga_t {
uint32_t bkgd_color;
uint32_t command;
uint32_t dir_cmd;
uint32_t pattern_data;
uint8_t px_map_format[4];
uint16_t px_map_width[4];

View File

@@ -20,7 +20,6 @@
#ifdef EMU_DEVICE_H
extern const device_t xga_device;
extern const device_t xga_isa_device;
extern const device_t inmos_isa_device;
#endif
#endif /*VIDEO_XGA_DEVICE_H*/

View File

@@ -36,6 +36,10 @@ using atomic_int = std::atomic_int;
#define getcolg(color) (((color) >> 8) & 0xFF)
#define getcolb(color) ((color) & 0xFF)
#ifdef __cplusplus
extern "C" {
#endif
enum {
VID_NONE = 0,
VID_INTERNAL
@@ -49,10 +53,6 @@ enum {
FULLSCR_SCALE_INT43
};
#ifdef __cplusplus
extern "C" {
#endif
enum {
VIDEO_ISA = 0,
VIDEO_MCA,
@@ -71,6 +71,12 @@ enum {
#define VIDEO_FLAG_TYPE_SECONDARY VIDEO_FLAG_TYPE_SPECIAL
#define FONT_IBM_MDA_437_PATH "roms/video/mda/mda.rom"
#define FONT_IBM_MDA_437_NORDIC_PATH "roms/video/mda/4733197.bin"
#define FONT_KAM_PATH "roms/video/mda/kam.bin"
#define FONT_KAMCL16_PATH "roms/video/mda/kamcl16.bin"
#define FONT_TULIP_DGA_PATH "roms/video/mda/tulip-dga-bios.bin"
typedef struct video_timings_t {
int type;
int write_b;
@@ -182,6 +188,10 @@ extern bitmap_t *buffer32;
#define efscrnsz_y (monitors[monitor_index_global].mon_efscrnsz_y)
#define unscaled_size_x (monitors[monitor_index_global].mon_unscaled_size_x)
#define unscaled_size_y (monitors[monitor_index_global].mon_unscaled_size_y)
#define CGAPAL_CGA_START 16 // Where the 16-color cga text/composite starts
extern PALETTE cgapal;
extern PALETTE cgapal_mono[6];
#if 0
@@ -189,16 +199,15 @@ extern uint32_t pal_lookup[256];
#endif
extern int video_fullscreen;
extern int video_fullscreen_scale;
extern int video_fullscreen_first;
extern uint8_t fontdat[2048][8];
extern uint8_t fontdatm[2048][16];
extern uint8_t fontdat2[2048][8];
extern uint8_t fontdatm2[2048][16];
extern uint8_t fontdatw[512][32];
extern uint8_t fontdat8x12[256][16];
extern uint8_t fontdat12x18[256][36];
extern dbcs_font_t *fontdatksc5601;
extern dbcs_font_t *fontdatksc5601_user;
extern uint8_t fontdat[2048][8]; /* IBM CGA font */
extern uint8_t fontdatm[2048][16]; /* IBM MDA font */
extern uint8_t fontdat2[2048][8]; /* IBM CGA 2nd instance font */
extern uint8_t fontdatm2[2048][16]; /* IBM MDA 2nd instance font */
extern uint8_t fontdatw[512][32]; /* Wyse700 font */
extern uint8_t fontdat8x12[256][16]; /* MDSI Genius font */
extern uint8_t fontdat12x18[256][36]; /* IM1024 font */
extern dbcs_font_t *fontdatksc5601; /* Korean KSC-5601 font */
extern dbcs_font_t *fontdatksc5601_user; /* Korean KSC-5601 user defined font */
extern uint32_t *video_6to8;
extern uint32_t *video_8togs;
extern uint32_t *video_8to32;
@@ -278,8 +287,8 @@ extern uint8_t video_force_resize_get_monitor(int monitor_index);
extern void video_force_resize_set_monitor(uint8_t res, int monitor_index);
extern void video_update_timing(void);
extern void loadfont_ex(char *s, int format, int offset);
extern void loadfont(char *s, int format);
extern void loadfont_ex(char *fn, int format, int offset);
extern void loadfont(char *fn, int format);
extern int get_actual_size_x(void);
extern int get_actual_size_y(void);
@@ -349,11 +358,14 @@ extern const device_t chips_69000_onboard_device;
/* Cirrus Logic GD54xx */
extern const device_t gd5401_isa_device;
extern const device_t gd5401_onboard_device;
extern const device_t gd5402_isa_device;
extern const device_t gd5402_onboard_device;
extern const device_t gd5420_isa_device;
extern const device_t gd5420_onboard_device;
extern const device_t gd5422_isa_device;
extern const device_t gd5424_vlb_device;
extern const device_t gd5424_onboard_device;
extern const device_t gd5426_isa_device;
extern const device_t gd5426_diamond_speedstar_pro_a1_isa_device;
extern const device_t gd5426_vlb_device;
@@ -366,6 +378,7 @@ extern const device_t gd5428_boca_isa_device;
extern const device_t gd5428_mca_device;
extern const device_t gd5426_mca_device;
extern const device_t gd5428_onboard_device;
extern const device_t gd5428_onboard_vlb_device;
extern const device_t gd5429_isa_device;
extern const device_t gd5429_vlb_device;
extern const device_t gd5430_diamond_speedstar_pro_se_a8_vlb_device;
@@ -386,9 +399,17 @@ extern const device_t gd5446_pci_device;
extern const device_t gd5446_stb_pci_device;
extern const device_t gd5480_pci_device;
/* IBM CGA*/
extern const device_t cga_device;
/* pravetz CGA */
extern const device_t cga_pravetz_device;
/* Compaq CGA */
extern const device_t compaq_cga_device;
extern const device_t compaq_cga_2_device;
extern const device_t compaq_plasma_device;
/* Olivetti OGC */
extern const device_t ogc_device;
@@ -461,6 +482,7 @@ extern const device_t if386jega_device;
/* Oak OTI-0x7 */
extern const device_t oti037c_device;
extern const device_t oti037_pbl300sx_device;
extern const device_t oti067_device;
extern const device_t oti067_acer386_device;
extern const device_t oti067_ama932j_device;
@@ -476,6 +498,9 @@ extern const device_t paradise_wd90c11_megapc_device;
extern const device_t paradise_wd90c11_device;
extern const device_t paradise_wd90c30_device;
/* Quadram Quadcolor I / I + II */
extern const device_t quadcolor_device;
/* Realtek (S)VGA */
extern const device_t realtek_rtg3105_device;
extern const device_t realtek_rtg3106_device;
@@ -488,6 +513,7 @@ extern const device_t s3_metheus_86c928_isa_device;
extern const device_t s3_metheus_86c928_vlb_device;
extern const device_t s3_spea_mercury_lite_86c928_pci_device;
extern const device_t s3_spea_mirage_86c801_isa_device;
extern const device_t s3_winner1000_805_isa_device;
extern const device_t s3_86c805_onboard_vlb_device;
extern const device_t s3_spea_mirage_86c805_vlb_device;
extern const device_t s3_mirocrystal_8s_805_vlb_device;
@@ -602,6 +628,11 @@ extern const device_t velocity_200_agp_device;
/* Wyse 700 */
extern const device_t wy700_device;
/* Tandy */
extern const device_t tandy_1000_video_device;
extern const device_t tandy_1000hx_video_device;
extern const device_t tandy_1000sl_video_device;
#endif
#endif /*EMU_VIDEO_H*/

View File

@@ -1,149 +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.
*
* Implementation of the Iomega ZIP drive with SCSI(-like)
* commands, for both ATAPI and SCSI usage.
*
*
*
* Authors: Miran Grca, <mgrca8@gmail.com>
*
* Copyright 2018-2025 Miran Grca.
*/
#ifndef EMU_ZIP_H
#define EMU_ZIP_H
#define ZIP_NUM 4
#define BUF_SIZE 32768
#define ZIP_TIME 10.0
#define ZIP_SECTORS (96 * 2048)
#define ZIP_250_SECTORS (489532)
#define ZIP_IMAGE_HISTORY 10
enum {
ZIP_BUS_DISABLED = 0,
ZIP_BUS_ATAPI = 5,
ZIP_BUS_SCSI = 6,
ZIP_BUS_USB = 7
};
typedef struct zip_drive_t {
uint8_t id;
union {
uint8_t res;
/* Reserved for other ID's. */
uint8_t res0;
uint8_t res1;
uint8_t ide_channel;
uint8_t scsi_device_id;
};
uint8_t bus_type; /* 0 = ATAPI, 1 = SCSI */
uint8_t bus_mode; /* Bit 0 = PIO suported;
Bit 1 = DMA supportd. */
uint8_t read_only; /* Struct variable reserved for
media status. */
uint8_t pad;
uint8_t pad0;
FILE * fp;
void * priv;
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;
} zip_drive_t;
typedef struct zip_t {
mode_sense_pages_t ms_pages_saved;
zip_drive_t * drv;
#ifdef EMU_IDE_H
ide_tf_t * tf;
#else
void * tf;
#endif
void * log;
uint8_t * buffer;
uint8_t atapi_cdb[16];
uint8_t current_cdb[16];
uint8_t sense[256];
uint8_t id;
uint8_t cur_lun;
uint8_t pad0;
uint8_t pad1;
uint16_t max_transfer_len;
uint16_t pad2;
int requested_blocks;
int packet_status;
int total_length;
int do_page_save;
int unit_attention;
int request_pos;
int old_len;
int transition;
uint32_t sector_pos;
uint32_t sector_len;
uint32_t packet_len;
uint32_t block_len;
double callback;
uint8_t (*ven_cmd)(void *sc, uint8_t *cdb, int32_t *BufLen);
} zip_t;
extern zip_t *zip[ZIP_NUM];
extern zip_drive_t zip_drives[ZIP_NUM];
extern uint8_t atapi_zip_drives[8];
extern uint8_t scsi_zip_drives[16];
#define zip_sense_error dev->sense[0]
#define zip_sense_key dev->sense[2]
#define zip_info *(uint32_t *) &(dev->sense[3])
#define zip_asc dev->sense[12]
#define zip_ascq dev->sense[13]
#ifdef __cplusplus
extern "C" {
#endif
extern void zip_disk_close(const zip_t *dev);
extern void zip_disk_reload(const zip_t *dev);
extern void zip_insert(zip_t *dev);
extern void zip_global_init(void);
extern void zip_hard_reset(void);
extern void zip_reset(scsi_common_t *sc);
extern int zip_is_empty(const uint8_t id);
extern void zip_load(const zip_t *dev, const char *fn, const int skip_insert);
extern void zip_close(void);
#ifdef __cplusplus
}
#endif
#endif /*EMU_ZIP_H*/