This commit is contained in:
starfrost013
2025-08-10 19:39:46 +01:00
364 changed files with 63408 additions and 26600 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
@@ -176,6 +181,7 @@ extern int hook_enabled; /* (C) Keyboard hook is enabled */
extern char exe_path[2048]; /* path (dir) of executable */
extern char usr_path[1024]; /* path (dir) of user data */
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) */
@@ -195,6 +201,7 @@ extern void warning_ex(const char *fmt, va_list ap);
#endif
extern void pclog_toggle_suppr(void);
extern void pclog(const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
extern void always_log(const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
extern void fatal(const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
extern void warning(const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
extern void set_screen_size(int x, int y);

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
@@ -116,107 +125,112 @@ static const struct cdrom_drive_types_s {
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;
};
@@ -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

@@ -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

@@ -133,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

@@ -223,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);

View File

@@ -51,8 +51,9 @@
#define GAMEPORT_6ADDR 0x060000
#define GAMEPORT_8ADDR 0x080000
#define GAMEPORT_SIO 0x1000000
#define GAMEPORT_PNPROM 0x2000000
typedef struct joystick_if_t {
typedef struct joystick_t {
const char *name;
const char *internal_name;
@@ -70,9 +71,9 @@ typedef struct joystick_if_t {
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_t;
typedef struct plat_joystick_t {
typedef struct plat_joystick_state_t {
char name[260];
int a[MAX_JOY_AXES];
@@ -97,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];
@@ -108,7 +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;
} 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,28 +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_2button_gamepad;
extern const joystick_if_t joystick_2button_flight_yoke;
extern const joystick_if_t joystick_2axis_4button;
extern const joystick_if_t joystick_4button_gamepad;
extern const joystick_if_t joystick_4button_flight_yoke;
extern const joystick_if_t joystick_3axis_2button;
extern const joystick_if_t joystick_2button_yoke_throttle;
extern const joystick_if_t joystick_3axis_4button;
extern const joystick_if_t joystick_4button_yoke_throttle;
extern const joystick_if_t joystick_win95_steering_wheel;
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 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];
@@ -79,6 +79,9 @@ 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) */
@@ -102,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 */
@@ -116,10 +121,12 @@ 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

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,51 +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;
extern const device_t keyboard_xt_lxt3_device;
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_xt_fe2010_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*/
@@ -303,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

@@ -29,7 +29,7 @@ extern "C" {
#include <stdarg.h>
#endif
#define LOG_SIZE_BUFFER 1024 /* Log size buffer */
#define LOG_SIZE_BUFFER 8192 /* Log size buffer */
#define LOG_SIZE_BUFFER_CYCLIC_LINES 32 /* Cyclic log size buffer (number of lines that should be cehcked) */
#define LOG_MINIMUM_REPEAT_ORDER 4 /* Minimum repeat size */

View File

@@ -17,66 +17,32 @@
#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);
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 *(*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_set_ext(int port, uint8_t ext);
extern void lpt_set_ecp(int port, uint8_t ecp);
extern void lpt_set_epp(int port, uint8_t epp);
extern void lpt_set_lv2(int port, uint8_t lv2);
extern void lpt_set_fifo_threshold(int port, int threshold);
extern void lpt_reset(void);
extern void lpt_close(void);
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_dma(int i, uint8_t dma);
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;
@@ -94,52 +60,87 @@ typedef struct lpt_port_t {
uint8_t autofeed;
uint8_t strobe;
uint8_t lv2;
uint8_t pad[7];
uint8_t cnfga_readout;
uint8_t inst;
uint8_t pad[5];
uint16_t addr;
uint16_t id;
uint16_t pad0[2];
int device;
int enable_irq;
lpt_device_t *dt;
#ifdef FIFO_H
fifo16_t *fifo;
fifo16_t * fifo;
#else
void *fifo;
void * fifo;
#endif
void *priv;
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];
typedef enum {
LPT_STATE_IDLE = 0,
LPT_STATE_READ_DMA,
LPT_STATE_WRITE_FIFO
} lpt_state_t;
extern lpt_port_t lpt_ports[PARALLEL_MAX];
extern void lpt_write(uint16_t port, uint8_t val, void *priv);
extern void lpt_write(uint16_t port, uint8_t val, void *priv);
extern void lpt_write_to_fifo(void *priv, uint8_t val);
extern void lpt_write_to_fifo(void *priv, uint8_t val);
extern uint8_t lpt_read(uint16_t port, void *priv);
extern uint8_t lpt_read(uint16_t port, void *priv);
extern uint8_t lpt_read_port(lpt_t *dev, uint16_t reg);
extern uint8_t lpt_read_port(int port, uint16_t reg);
extern uint8_t lpt_read_status(lpt_t *dev);
extern void lpt_irq(void *priv, int raise);
extern uint8_t lpt_read_status(int port);
extern void lpt_irq(void *priv, int raise);
extern int lpt_device_get_from_internal_name(const char *str);
extern int lpt_device_get_from_internal_name(const char *s);
extern const char *lpt_device_get_name(int id);
extern const char *lpt_device_get_internal_name(int id);
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 const lpt_device_t lpt_dac_device;
extern const lpt_device_t lpt_dac_stereo_device;
extern int lpt_device_has_config(const int id);
extern const lpt_device_t dss_device;
extern const lpt_device_t lpt_dac_device;
extern const lpt_device_t lpt_dac_stereo_device;
extern const lpt_device_t lpt_hasp_savquest_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

@@ -85,23 +85,24 @@
#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_AX 0x00040000 /* sys adheres to Japanese AX standard */
#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 */
@@ -338,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;
@@ -345,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;
@@ -789,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 *);
@@ -917,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 *);

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

@@ -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 {

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

@@ -48,11 +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_TAP 4 /* use a linux TAP device */
#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 */
@@ -96,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];
@@ -129,6 +134,7 @@ 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;
@@ -194,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

@@ -143,8 +143,8 @@ extern int plat_getcwd(char *bufp, int max);
extern int plat_chdir(char *path);
extern void plat_tempfile(char *bufp, char *prefix, char *suffix);
extern void plat_get_exe_name(char *s, int size);
extern void plat_get_global_config_dir(char *outbuf, uint8_t len);
extern void plat_get_global_data_dir(char *outbuf, uint8_t len);
extern void plat_get_global_config_dir(char *outbuf, size_t len);
extern void plat_get_global_data_dir(char *outbuf, size_t len);
extern void plat_get_temp_dir(char *outbuf, uint8_t len);
extern void plat_init_rom_paths(void);
extern int plat_dir_check(char *path);
@@ -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*/

View File

@@ -16,29 +16,62 @@
* Copyright 2018-2025 Miran Grca.
*/
#ifndef EMU_ZIP_H
#define EMU_ZIP_H
#ifndef EMU_RDISK_H
#define EMU_RDISK_H
#define ZIP_NUM 4
#define RDISK_NUM 4
#define BUF_SIZE 32768
#define BUF_SIZE 32768
#define ZIP_TIME 10.0
#define RDISK_TIME 10.0
#define ZIP_SECTORS (96 * 2048)
#define ZIP_SECTORS (96 * 2048)
#define ZIP_250_SECTORS (489532)
#define ZIP_250_SECTORS (489532)
#define ZIP_IMAGE_HISTORY 10
#define RDISK_IMAGE_HISTORY 10
enum {
ZIP_BUS_DISABLED = 0,
ZIP_BUS_ATAPI = 5,
ZIP_BUS_SCSI = 6,
ZIP_BUS_USB = 7
RDISK_TYPE_GENERIC = 0,
RDISK_TYPE_ZIP_100,
RDISK_TYPE_ZIP_250
};
typedef struct zip_drive_t {
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 {
@@ -64,17 +97,17 @@ typedef struct zip_drive_t {
char image_path[1024];
char prev_image_path[1024];
char *image_history[ZIP_IMAGE_HISTORY];
char *image_history[RDISK_IMAGE_HISTORY];
uint32_t is_250;
uint32_t type;
uint32_t medium_size;
uint32_t base;
} zip_drive_t;
} rdisk_drive_t;
typedef struct zip_t {
typedef struct rdisk_t {
mode_sense_pages_t ms_pages_saved;
zip_drive_t *drv;
rdisk_drive_t *drv;
#ifdef EMU_IDE_H
ide_tf_t *tf;
#else
@@ -113,37 +146,37 @@ typedef struct zip_t {
double callback;
uint8_t (*ven_cmd)(void *sc, uint8_t *cdb, int32_t *BufLen);
} zip_t;
} rdisk_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];
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 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]
#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 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 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 zip_global_init(void);
extern void zip_hard_reset(void);
extern void rdisk_global_init(void);
extern void rdisk_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);
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_ZIP_H*/
#endif /*EMU_RDISK_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

@@ -26,6 +26,7 @@ extern const device_t ali5123_device;
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;
@@ -44,27 +45,26 @@ 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
#define FDC37C931 0x0100 /* Compaq KBC firmware and configuration registers on GPIO ports. */
#define FDC37C932 0x0200 /* AMI '5' Megakey KBC firmware. */
#define FDC37C933 0x0300 /* IBM KBC firmware. */
#define FDC37C935 0x0500 /* Phoenix Multikey/42 1.38 KBC firmware. */
#define FDC37C937 0x0700 /* Phoenix Multikey/42i 4.16 KBC firmware. */
#define FDC37C93X_KBC 0x0f00
#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 FDC37C93X_370 0x2000
#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;
@@ -84,16 +84,6 @@ extern const device_t i82091aa_ide_device;
extern const device_t pc87310_device;
/* National Semiconductors */
extern const device_t pc87306_device;
extern const device_t pc87311_device;
extern const device_t pc87311_ide_device;
extern const device_t pc87332_device;
extern const device_t pc87332_398_device;
extern const device_t pc87332_398_ide_device;
extern const device_t pc87332_398_ide_sec_device;
extern const device_t pc87332_398_ide_fdcon_device;
/* National Semiconductors PC87307 / PC87309 */
#define PCX7307_PC87307 0x00c0
#define PCX7307_PC97307 0x00cf
@@ -108,6 +98,17 @@ extern const device_t pc87332_398_ide_fdcon_device;
#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;
extern const device_t pc87332_398_device;
extern const device_t pc87332_398_ide_device;
extern const device_t pc87332_398_ide_sec_device;
extern const device_t pc87332_398_ide_fdcon_device;
/* National Semiconductors PC87307 / PC87309 */
extern const device_t pc87307_device;
extern const device_t pc87309_device;

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;
@@ -214,6 +222,9 @@ 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

@@ -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

@@ -60,6 +60,7 @@ typedef struct {
int cols[256][2][2];
lpt_t *lpt;
uint8_t *vram;
int monitor_index;
int prev_monitor_index;

View File

@@ -119,7 +119,8 @@ typedef struct mda_t {
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

@@ -138,7 +138,6 @@ typedef struct svga_t {
int ps_bit_bug;
int ati_4color;
int vblankend;
int panning_blank;
int render_line_offset;
int start_retrace_latch;

View File

@@ -19,8 +19,8 @@
#include <86box/rom.h>
#define INT_START_BLKNK_ENAB (1 << 0)
#define INT_MASK 0xf
#define XGA_INT_START_BLKNK_ENAB (1 << 0)
#define XGA_INT_MASK 0xf
typedef struct xga_hwcursor_t {
int ena;
@@ -152,10 +152,9 @@ typedef struct xga_t {
int cursor_data_on;
int pal_test;
int a5_test;
int test_stage;
int type;
int bus;
int src_reverse_order;
int dst_reverse_order;
uint32_t linear_base;
uint32_t linear_size;
@@ -175,6 +174,7 @@ typedef struct xga_t {
uint32_t px_map_base;
uint32_t pallook[512];
uint32_t bios_diag;
uint32_t mapping_base;
PALETTE xgapal;