Merge branch 'master' of https://github.com/86Box/86Box into 86Box-master
This commit is contained in:
@@ -8,14 +8,14 @@
|
||||
*
|
||||
* Main include file for the application.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Miran Grca, <mgrca8@gmail.com>
|
||||
* Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Jasmine Iwanek, <jriwanek@gmail.com>
|
||||
*
|
||||
* Copyright 2016-2020 Miran Grca.
|
||||
* Copyright 2017-2020 Fred N. van Kempen.
|
||||
* Copyright 2021 Laci bá'
|
||||
* Copyright 2021-2025 Jasmine Iwanek.
|
||||
*/
|
||||
#ifndef EMU_86BOX_H
|
||||
#define EMU_86BOX_H
|
||||
@@ -33,7 +33,7 @@
|
||||
#define SCREENSHOT_PATH "screenshots"
|
||||
|
||||
/* Recently used images */
|
||||
#define MAX_PREV_IMAGES 4
|
||||
#define MAX_PREV_IMAGES 10
|
||||
#define MAX_IMAGE_PATH_LEN 2048
|
||||
|
||||
/* Max UUID Length */
|
||||
@@ -131,6 +131,7 @@ extern int bugger_enabled; /* (C) enable ISAbugger */
|
||||
extern int novell_keycard_enabled; /* (C) enable Novell NetWare 2.x key card emulation. */
|
||||
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 isartc_type; /* (C) enable ISA RTC card */
|
||||
extern int sound_is_float; /* (C) sound uses FP values */
|
||||
@@ -154,6 +155,7 @@ extern int enable_discord; /* (C) enable Discord integration */
|
||||
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 hard_reset_pending;
|
||||
extern int fixed_size_x;
|
||||
extern int fixed_size_y;
|
||||
extern int do_auto_pause; /* (C) Auto-pause the emulator on focus loss */
|
||||
@@ -165,6 +167,7 @@ extern _Atomic double mouse_y_error; /* Mouse error accumulator - Y */
|
||||
#endif
|
||||
extern int pit_mode; /* (C) force setting PIT mode */
|
||||
extern int fm_driver; /* (C) select FM sound driver */
|
||||
extern int hook_enabled; /* (C) Keyboard hook is enabled */
|
||||
|
||||
/* Keyboard variables for future key combination redefinition. */
|
||||
extern uint16_t key_prefix_1_1;
|
||||
@@ -186,12 +189,17 @@ extern int config_changed; /* config has changed */
|
||||
|
||||
/* Function prototypes. */
|
||||
#ifdef HAVE_STDARG_H
|
||||
extern void pclog_ex(const char *fmt, va_list);
|
||||
extern void fatal_ex(const char *fmt, va_list);
|
||||
extern void pclog_ex(const char *fmt, va_list ap);
|
||||
extern void fatal_ex(const char *fmt, va_list ap);
|
||||
#endif
|
||||
extern void pclog_toggle_suppr(void);
|
||||
#ifdef _MSC_VER
|
||||
extern void pclog(const char *fmt, ...);
|
||||
extern void fatal(const char *fmt, ...);
|
||||
#else
|
||||
extern void pclog(const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
|
||||
extern void fatal(const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
|
||||
#endif
|
||||
extern void set_screen_size(int x, int y);
|
||||
extern void set_screen_size_monitor(int x, int y, int monitor_index);
|
||||
extern void reset_screen_size(void);
|
||||
|
||||
37
src/include/86box/access_bus.h
Normal file
37
src/include/86box/access_bus.h
Normal 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.
|
||||
*
|
||||
* Definitions for the ACPI emulation.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Miran Grca, <mgrca8@gmail.com>
|
||||
*
|
||||
* Copyright 2020-2025 Miran Grca.
|
||||
*/
|
||||
#ifndef ACCESS_BUS_H
|
||||
#define ACCESS_BUS_H
|
||||
|
||||
#define AB_RST 0x80
|
||||
|
||||
typedef struct access_bus_t {
|
||||
uint8_t control;
|
||||
uint8_t status;
|
||||
uint8_t own_addr;
|
||||
uint8_t data;
|
||||
uint8_t clock;
|
||||
uint8_t enable;
|
||||
uint16_t base;
|
||||
} access_bus_t;
|
||||
|
||||
extern const device_t access_bus_device;
|
||||
|
||||
/* Functions */
|
||||
extern void access_bus_handler(access_bus_t *dev, uint8_t enable, uint16_t base);
|
||||
|
||||
#endif /*ACCESS_BUS_H*/
|
||||
@@ -35,6 +35,8 @@
|
||||
* USA.
|
||||
*/
|
||||
|
||||
#ifndef __NetBSD__
|
||||
|
||||
#ifndef BSWAP_H
|
||||
#define BSWAP_H
|
||||
|
||||
@@ -131,12 +133,12 @@ bswap64s(uint64_t *s)
|
||||
return endian##_bswap(v, size); \
|
||||
} \
|
||||
\
|
||||
static __inline void endian##size##_to_cpus(type *p) \
|
||||
static __inline void endian##size##_to_cpus(UNUSED(type *p)) \
|
||||
{ \
|
||||
endian##_bswaps(p, size) \
|
||||
} \
|
||||
\
|
||||
static __inline void cpu_to_##endian##size##s(type *p) \
|
||||
static __inline void cpu_to_##endian##size##s(UNUSED(type *p)) \
|
||||
{ \
|
||||
endian##_bswaps(p, size) \
|
||||
} \
|
||||
@@ -239,3 +241,5 @@ cpu_to_be32wu(uint32_t *p, uint32_t v)
|
||||
#undef be_bswaps
|
||||
|
||||
#endif /*BSWAP_H*/
|
||||
|
||||
#endif
|
||||
|
||||
@@ -21,7 +21,10 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define CART_IMAGE_HISTORY 10
|
||||
|
||||
extern char cart_fns[2][512];
|
||||
extern char *cart_image_history[2][CART_IMAGE_HISTORY];
|
||||
|
||||
extern void cart_load(int drive, char *fn);
|
||||
extern void cart_close(int drive);
|
||||
|
||||
@@ -153,10 +153,13 @@ void pc_cas_print_state(const pc_cassette_t *cas);
|
||||
void pc_cas_clock(pc_cassette_t *cas, unsigned long cnt);
|
||||
void pc_cas_advance(pc_cassette_t *cas);
|
||||
|
||||
#define CASSETTE_IMAGE_HISTORY 10
|
||||
|
||||
extern pc_cassette_t *cassette;
|
||||
|
||||
extern char cassette_fname[512];
|
||||
extern char cassette_mode[512];
|
||||
extern char * cassette_image_history[CASSETTE_IMAGE_HISTORY];
|
||||
extern unsigned long cassette_pos;
|
||||
extern unsigned long cassette_srate;
|
||||
extern int cassette_enable;
|
||||
|
||||
@@ -15,30 +15,40 @@
|
||||
#ifndef EMU_CDROM_H
|
||||
#define EMU_CDROM_H
|
||||
|
||||
#ifndef EMU_VERSION_H
|
||||
#include <86box/version.h>
|
||||
#endif
|
||||
|
||||
#define CDROM_NUM 8
|
||||
|
||||
#define CD_STATUS_EMPTY 0
|
||||
#define CD_STATUS_DATA_ONLY 1
|
||||
#define CD_STATUS_PAUSED 2
|
||||
#define CD_STATUS_PLAYING 3
|
||||
#define CD_STATUS_STOPPED 4
|
||||
#define CD_STATUS_PLAYING_COMPLETED 5
|
||||
#define CD_STATUS_DVD 2
|
||||
#define CD_STATUS_PAUSED 4
|
||||
#define CD_STATUS_PLAYING 5
|
||||
#define CD_STATUS_STOPPED 6
|
||||
#define CD_STATUS_PLAYING_COMPLETED 7
|
||||
#define CD_STATUS_HAS_AUDIO 4
|
||||
#define CD_STATUS_MASK 7
|
||||
|
||||
/* Medium changed flag. */
|
||||
#define CD_STATUS_TRANSITION 0x40
|
||||
#define CD_STATUS_MEDIUM_CHANGED 0x80
|
||||
|
||||
#define CD_TRACK_UNK_DATA 0x04
|
||||
#define CD_TRACK_NORMAL 0x00
|
||||
#define CD_TRACK_AUDIO 0x08
|
||||
#define CD_TRACK_CDI 0x10
|
||||
#define CD_TRACK_XA 0x20
|
||||
#define CD_TRACK_MODE_MASK 0x30
|
||||
#define CD_TRACK_MODE2 0x04
|
||||
|
||||
#define CD_READ_DATA 0
|
||||
#define CD_READ_AUDIO 1
|
||||
#define CD_READ_RAW 2
|
||||
#define CD_TRACK_MODE2_MASK 0x07
|
||||
|
||||
#define CD_TOC_NORMAL 0
|
||||
#define CD_TOC_SESSION 1
|
||||
#define CD_TOC_RAW 2
|
||||
|
||||
#define CD_IMAGE_HISTORY 4
|
||||
#define CD_IMAGE_HISTORY 10
|
||||
|
||||
#define BUF_SIZE 32768
|
||||
|
||||
@@ -46,7 +56,34 @@
|
||||
|
||||
/* This is so that if/when this is changed to something else,
|
||||
changing this one define will be enough. */
|
||||
#define CDROM_EMPTY !dev->host_drive
|
||||
#define CDROM_EMPTY !dev->host_drive
|
||||
|
||||
#define DVD_LAYER_0_SECTORS 0x00210558ULL
|
||||
|
||||
#define RAW_SECTOR_SIZE 2352
|
||||
#define COOKED_SECTOR_SIZE 2048
|
||||
|
||||
#define DATA_TRACK 0x14
|
||||
#define AUDIO_TRACK 0x10
|
||||
|
||||
#define CD_FPS 75
|
||||
|
||||
#define FRAMES_TO_MSF(f, M, S, F) \
|
||||
{ \
|
||||
uint64_t value = f; \
|
||||
*(F) = (value % CD_FPS) & 0xff; \
|
||||
value /= CD_FPS; \
|
||||
*(S) = (value % 60) & 0xff; \
|
||||
value /= 60; \
|
||||
*(M) = value & 0xff; \
|
||||
}
|
||||
#define MSF_TO_FRAMES(M, S, F) ((M) *60 * CD_FPS + (S) *CD_FPS + (F))
|
||||
|
||||
typedef struct SMSF {
|
||||
uint16_t min;
|
||||
uint8_t sec;
|
||||
uint8_t fr;
|
||||
} TMSF;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -60,115 +97,125 @@ enum {
|
||||
CDROM_BUS_USB = 8
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
CDROM_TYPE_86BOX_100,
|
||||
CDROM_TYPE_AZT_CDA46802I_115,
|
||||
CDROM_TYPE_BTC_BCD36XH_U10,
|
||||
CDROM_TYPE_GOLDSTAR_CRD_8160B_314,
|
||||
CDROM_TYPE_HITACHI_CDR_8130_0020,
|
||||
CDROM_TYPE_KENWOOD_UCR_421_208E,
|
||||
CDROM_TYPE_MATSHITA_587_7S13,
|
||||
CDROM_TYPE_MATSHITA_588_LS15,
|
||||
CDROM_TYPE_MATSHITA_571_10e,
|
||||
CDROM_TYPE_MATSHITA_572_10j,
|
||||
CDROM_TYPE_MITSUMI_FX4820T_D02A,
|
||||
CDROM_TYPE_NEC_260_100,
|
||||
CDROM_TYPE_NEC_260_101,
|
||||
CDROM_TYPE_NEC_273_420,
|
||||
CDROM_TYPE_NEC_280_105,
|
||||
CDROM_TYPE_NEC_280_308,
|
||||
CDROM_TYPE_PHILIPS_PCA403CD_U31P,
|
||||
CDROM_TYPE_SONY_CDU76_10i,
|
||||
CDROM_TYPE_SONY_CDU311_30h,
|
||||
CDROM_TYPE_TOSHIBA_5302TA_0305,
|
||||
CDROM_TYPE_TOSHIBA_5702B_TA70,
|
||||
CDROM_TYPE_CHINON_CDS431_H42,
|
||||
CDROM_TYPE_DEC_RRD45_0436,
|
||||
CDROM_TYPE_MATSHITA_501_10b,
|
||||
CDROM_TYPE_NEC_25_10a,
|
||||
CDROM_TYPE_NEC_38_103,
|
||||
CDROM_TYPE_NEC_75_103,
|
||||
CDROM_TYPE_NEC_77_106,
|
||||
CDROM_TYPE_NEC_211_100,
|
||||
CDROM_TYPE_NEC_464_105,
|
||||
CDROM_TYPE_SONY_CDU541_10i,
|
||||
CDROM_TYPE_SONY_CDU561_18k,
|
||||
CDROM_TYPE_SONY_CDU76S_100,
|
||||
CDROM_TYPE_PHILIPS_CDD2600_107,
|
||||
CDROM_TYPE_PIONEER_DRM604X_2403,
|
||||
CDROM_TYPE_PLEXTOR_PX32TS_103,
|
||||
CDROM_TYPE_TEAC_CD50_100,
|
||||
CDROM_TYPE_TEAC_R55S_10R,
|
||||
CDROM_TYPE_TEXEL_DMXX24_100,
|
||||
CDROM_TYPE_TOSHIBA_XM_3433,
|
||||
CDROM_TYPE_TOSHIBA_XM3201B_3232,
|
||||
CDROM_TYPE_TOSHIBA_XM3301TA_0272,
|
||||
CDROM_TYPE_TOSHIBA_XM5701TA_3136,
|
||||
CDROM_TYPE_TOSHIBA_SDM1401_1008,
|
||||
CDROM_TYPES_NUM
|
||||
};
|
||||
|
||||
#define KNOWN_CDROM_DRIVE_TYPES CDROM_TYPES_NUM
|
||||
#define BUS_TYPE_IDE CDROM_BUS_ATAPI
|
||||
#define BUS_TYPE_SCSI CDROM_BUS_SCSI
|
||||
#define BUS_TYPE_BOTH -2
|
||||
#define BUS_TYPE_NONE -1
|
||||
|
||||
static const struct
|
||||
{
|
||||
const char vendor[9];
|
||||
const char model[17];
|
||||
const char revision[5];
|
||||
const char *name;
|
||||
const char *internal_name;
|
||||
const int bus_type;
|
||||
#define CDV EMU_VERSION_EX
|
||||
|
||||
static const struct cdrom_drive_types_s {
|
||||
const char vendor[9];
|
||||
const char model[17];
|
||||
const char revision[5];
|
||||
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 transfer_max[4];
|
||||
} cdrom_drive_types[] = {
|
||||
{ "86BOX", "CD-ROM", "1.00", "86BOX CD-ROM 1.00", "86BOX_CD-ROM_1.00", BUS_TYPE_BOTH },
|
||||
{ "AZT", "CDA46802I", "1.15", "AZT CDA46802I 1.15", "AZT_CDA46802I_1.15", BUS_TYPE_IDE },
|
||||
{ "BTC", "CD-ROM BCD36XH", "U1.0", "BTC CD-ROM BCD36XH U1.0", "BTC_CD-ROM_BCD36XH_U1.0", BUS_TYPE_IDE },
|
||||
{ "GOLDSTAR", "CRD-8160B", "3.14", "GOLDSTAR CRD-8160B 3.14", "GOLDSTAR_CRD-8160B_3.14", BUS_TYPE_IDE },
|
||||
{ "HITACHI", "CDR-8130", "0020", "HITACHI CDR-8130 0020", "HITACHI_CDR-8130_0020", BUS_TYPE_IDE },
|
||||
{ "KENWOOD", "CD-ROM UCR-421", "208E", "KENWOOD CD-ROM UCR-421 208E", "KENWOOD_CD-ROM_UCR-421_208E", BUS_TYPE_IDE },
|
||||
{ "MATSHITA", "CD-ROM CR-587", "7S13", "MATSHITA CD-ROM CR-587 7S13", "MATSHITA_CD-ROM_CR-587_7S13", BUS_TYPE_IDE },
|
||||
{ "MATSHITA", "CD-ROM CR-588", "LS15", "MATSHITA CD-ROM CR-588 LS15", "MATSHITA_CD-ROM_CR-588_LS15", BUS_TYPE_IDE },
|
||||
{ "MATSHITA", "CR-571", "1.0e", "MATSHITA CR-571 1.0e", "MATSHITA_CR-571_1.0e", BUS_TYPE_IDE },
|
||||
{ "MATSHITA", "CR-572", "1.0j", "MATSHITA CR-572 1.0j", "MATSHITA_CR-572_1.0j", BUS_TYPE_IDE },
|
||||
{ "MITSUMI", "CRMC-FX4820T", "D02A", "MITSUMI CRMC-FX4820T D02A", "MITSUMI_CRMC-FX4820T_D02A", BUS_TYPE_IDE },
|
||||
{ "NEC", "CD-ROM DRIVE:260", "1.00", "NEC CD-ROM DRIVE:260 1.00", "NEC_CD-ROM_DRIVE260_1.00", BUS_TYPE_IDE },
|
||||
{ "NEC", "CD-ROM DRIVE:260", "1.01", "NEC CD-ROM DRIVE:260 1.01", "NEC_CD-ROM_DRIVE260_1.01", BUS_TYPE_IDE },
|
||||
{ "NEC", "CD-ROM DRIVE:273", "4.20", "NEC CD-ROM DRIVE:273 4.20", "NEC_CD-ROM_DRIVE273_4.20", BUS_TYPE_IDE },
|
||||
{ "NEC", "CD-ROM DRIVE:280", "1.05", "NEC CD-ROM DRIVE:280 1.05", "NEC_CD-ROM_DRIVE280_1.05", BUS_TYPE_IDE },
|
||||
{ "NEC", "CD-ROM DRIVE:280", "3.08", "NEC CD-ROM DRIVE:280 3.08", "NEC_CD-ROM_DRIVE280_3.08", BUS_TYPE_IDE },
|
||||
{ "PHILIPS", "CD-ROM PCA403CD", "U31P", "PHILIPS CD-ROM PCA403CD U31P", "PHILIPS_CD-ROM_PCA403CD_U31P", BUS_TYPE_IDE },
|
||||
{ "SONY", "CD-ROM CDU76", "1.0i", "SONY CD-ROM CDU76 1.0i", "SONY_CD-ROM_CDU76_1.0i", BUS_TYPE_IDE },
|
||||
{ "SONY", "CD-ROM CDU311", "3.0h", "SONY CD-ROM CDU311 3.0h", "SONY_CD-ROM_CDU311_3.0h", BUS_TYPE_IDE },
|
||||
{ "TOSHIBA", "CD-ROM XM-5302TA", "0305", "TOSHIBA CD-ROM XM-5302TA 0305", "TOSHIBA_CD-ROM_XM-5302TA_0305", BUS_TYPE_IDE },
|
||||
{ "TOSHIBA", "CD-ROM XM-5702B", "TA70", "TOSHIBA CD-ROM XM-5702B TA70", "TOSHIBA_CD-ROM_XM-5702B_TA70", BUS_TYPE_IDE },
|
||||
{ "CHINON", "CD-ROM CDS-431", "H42 ", "CHINON CD-ROM CDS-431 H42", "CHINON_CD-ROM_CDS-431_H42", BUS_TYPE_SCSI },
|
||||
{ "DEC", "RRD45 (C) DEC", "0436", "DEC RRD45 0436", "DEC_RRD45_0436", BUS_TYPE_SCSI },
|
||||
{ "MATSHITA", "CD-ROM CR-501", "1.0b", "MATSHITA CD-ROM CR-501 1.0b", "MATSHITA_CD-ROM_CR-501_1.0b", BUS_TYPE_SCSI },
|
||||
{ "NEC", "CD-ROM DRIVE:25", "1.0a", "NEC CD-ROM DRIVE:25 1.0a", "NEC_CD-ROM_DRIVE25_1.0a", BUS_TYPE_SCSI },
|
||||
{ "NEC", "CD-ROM DRIVE:38", "1.00", "NEC CD-ROM DRIVE:38 1.00", "NEC_CD-ROM_DRIVE38_1.00", BUS_TYPE_SCSI },
|
||||
{ "NEC", "CD-ROM DRIVE:75", "1.03", "NEC CD-ROM DRIVE:75 1.03", "NEC_CD-ROM_DRIVE75_1.03", BUS_TYPE_SCSI },
|
||||
{ "NEC", "CD-ROM DRIVE:77", "1.06", "NEC CD-ROM DRIVE:77 1.06", "NEC_CD-ROM_DRIVE77_1.06", BUS_TYPE_SCSI },
|
||||
{ "NEC", "CD-ROM DRIVE:211", "1.00", "NEC CD-ROM DRIVE:211 1.00", "NEC_CD-ROM_DRIVE211_1.00", BUS_TYPE_SCSI },
|
||||
{ "NEC", "CD-ROM DRIVE:464", "1.05", "NEC CD-ROM DRIVE:464 1.05", "NEC_CD-ROM_DRIVE464_1.05", BUS_TYPE_SCSI },
|
||||
{ "SONY", "CD-ROM CDU-541", "1.0i", "SONY CD-ROM CDU-541 1.0i", "SONY_CD-ROM_CDU-541_1.0i", BUS_TYPE_SCSI },
|
||||
{ "SONY", "CD-ROM CDU-561", "1.8k", "SONY CD-ROM CDU-561 1.8k", "SONY_CD-ROM_CDU-561_1.8k", BUS_TYPE_SCSI },
|
||||
{ "SONY", "CD-ROM CDU-76S", "1.00", "SONY CD-ROM CDU-76S 1.00", "SONY_CD-ROM_CDU-76S_1.00", BUS_TYPE_SCSI },
|
||||
{ "PHILIPS", "CDD2600", "1.07", "PHILIPS CDD2600 1.07", "PHILIPS_CDD2600_1.07", BUS_TYPE_SCSI },
|
||||
{ "PIONEER", "CD-ROM DRM-604X", "2403", "PIONEER CD-ROM DRM-604X 2403", "PIONEER_CD-ROM_DRM-604X_2403", BUS_TYPE_SCSI },
|
||||
{ "PLEXTOR", "CD-ROM PX-32TS", "1.03", "PLEXTOR CD-ROM PX-32TS 1.03", "PLEXTOR_CD-ROM_PX-32TS_1.03", BUS_TYPE_SCSI },
|
||||
{ "TEAC", "CD 50", "1.00", "TEAC CD 50 1.00", "TEAC_CD_50_1.00", BUS_TYPE_SCSI },
|
||||
{ "TEAC", "CD-ROM R55S", "1.0R", "TEAC CD-ROM R55S 1.0R", "TEAC_CD-ROM_R55S_1.0R", BUS_TYPE_SCSI },
|
||||
{ "TEXEL", "CD-ROM DM-XX24", "1.00", "TEXEL CD-ROM DM-XX24 1.00", "TEXEL_CD-ROM_DM-XX24_1.00", BUS_TYPE_SCSI },
|
||||
{ "TOSHIBA", "CD-ROM DRIVE:XM", "3433", "TOSHIBA CD-ROM DRIVE:XM 3433", "TOSHIBA_CD-ROM_DRIVEXM_3433", BUS_TYPE_SCSI },
|
||||
{ "TOSHIBA", "CD-ROM XM-3201B", "3232", "TOSHIBA CD-ROM XM-3201B 3232", "TOSHIBA_CD-ROM_XM-3201B_3232", BUS_TYPE_SCSI },
|
||||
{ "TOSHIBA", "CD-ROM XM-3301TA", "0272", "TOSHIBA CD-ROM XM-3301TA 0272", "TOSHIBA_CD-ROM_XM-3301TA_0272", BUS_TYPE_SCSI },
|
||||
{ "TOSHIBA", "CD-ROM XM-5701TA", "3136", "TOSHIBA CD-ROM XM-5701TA 3136", "TOSHIBA_CD-ROM_XM-5701TA_3136", BUS_TYPE_SCSI },
|
||||
{ "TOSHIBA", "DVD-ROM SD-M1401", "1008", "TOSHIBA DVD-ROM SD-M1401 1008", "TOSHIBA_DVD-ROM_SD-M1401_1008", BUS_TYPE_SCSI },
|
||||
{ "", "", "", "", "", BUS_TYPE_NONE },
|
||||
{ EMU_NAME, "86B_CD", CDV, "86cd", BUS_TYPE_BOTH, 2, -1, 36, 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 } },
|
||||
/* 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 } },
|
||||
/* 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 } },
|
||||
/*
|
||||
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 } },
|
||||
/* 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 } },
|
||||
/* 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 } },
|
||||
/* 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 } },
|
||||
/* 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 } },
|
||||
/* 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 } },
|
||||
/* 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 } },
|
||||
/* 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 } },
|
||||
/* 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 } },
|
||||
/* 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 } },
|
||||
/*
|
||||
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. */
|
||||
/*
|
||||
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 } }
|
||||
};
|
||||
|
||||
/* To shut up the GCC compilers. */
|
||||
@@ -194,129 +241,201 @@ typedef struct track_info_t {
|
||||
uint8_t f;
|
||||
} track_info_t;
|
||||
|
||||
typedef struct raw_track_info_t {
|
||||
uint8_t session;
|
||||
uint8_t adr_ctl;
|
||||
uint8_t tno;
|
||||
uint8_t point;
|
||||
uint8_t m;
|
||||
uint8_t s;
|
||||
uint8_t f;
|
||||
uint8_t zero;
|
||||
uint8_t pm;
|
||||
uint8_t ps;
|
||||
uint8_t pf;
|
||||
} raw_track_info_t;
|
||||
|
||||
/* Define the various CD-ROM drive operations (ops). */
|
||||
typedef struct cdrom_ops_t {
|
||||
void (*get_tracks)(struct cdrom *dev, int *first, int *last);
|
||||
void (*get_track_info)(struct cdrom *dev, uint32_t track, int end, track_info_t *ti);
|
||||
void (*get_subchannel)(struct cdrom *dev, uint32_t lba, subchannel_t *subc);
|
||||
int (*is_track_pre)(struct cdrom *dev, uint32_t lba);
|
||||
int (*sector_size)(struct cdrom *dev, uint32_t lba);
|
||||
int (*read_sector)(struct cdrom *dev, int type, uint8_t *b, uint32_t lba);
|
||||
int (*track_type)(struct cdrom *dev, uint32_t lba);
|
||||
int (*ext_medium_changed)(struct cdrom *dev);
|
||||
void (*exit)(struct cdrom *dev);
|
||||
int (*get_track_info)(const void *local, const uint32_t track,
|
||||
const int end, track_info_t *ti);
|
||||
void (*get_raw_track_info)(const void *local, int *num,
|
||||
uint8_t *rti);
|
||||
int (*is_track_pre)(const void *local, const uint32_t sector);
|
||||
int (*read_sector)(const void *local, uint8_t *buffer,
|
||||
const uint32_t sector);
|
||||
uint8_t (*get_track_type)(const void *local, const uint32_t sector);
|
||||
uint32_t (*get_last_block)(const void *local);
|
||||
int (*read_dvd_structure)(const void *local, const uint8_t layer,
|
||||
const uint8_t format, uint8_t *buffer,
|
||||
uint32_t *info);
|
||||
int (*is_dvd)(const void *local);
|
||||
int (*has_audio)(const void *local);
|
||||
int (*is_empty)(const void *local);
|
||||
void (*close)(void *local);
|
||||
void (*load)(const void *local);
|
||||
} cdrom_ops_t;
|
||||
|
||||
typedef struct cdrom {
|
||||
uint8_t id;
|
||||
uint8_t id;
|
||||
|
||||
union {
|
||||
uint8_t res;
|
||||
uint8_t res0; /* Reserved for other ID's. */
|
||||
uint8_t res1;
|
||||
uint8_t ide_channel;
|
||||
uint8_t scsi_device_id;
|
||||
uint8_t res;
|
||||
uint8_t res0; /* Reserved for other ID's. */
|
||||
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 cd_status; /* Struct variable reserved for
|
||||
media status. */
|
||||
uint8_t speed;
|
||||
uint8_t cur_speed;
|
||||
uint8_t bus_type; /* 0 = ATAPI, 1 = SCSI */
|
||||
uint8_t bus_mode; /* Bit 0 = PIO suported;
|
||||
Bit 1 = DMA supportd. */
|
||||
uint8_t cd_status; /* Struct variable reserved for
|
||||
media status. */
|
||||
uint8_t speed;
|
||||
uint8_t cur_speed;
|
||||
|
||||
void *priv;
|
||||
void * priv;
|
||||
|
||||
char image_path[1024];
|
||||
char prev_image_path[1024];
|
||||
char image_path[1024];
|
||||
char prev_image_path[1024];
|
||||
|
||||
char *image_history[CD_IMAGE_HISTORY];
|
||||
char * image_history[CD_IMAGE_HISTORY];
|
||||
|
||||
uint32_t sound_on;
|
||||
uint32_t cdrom_capacity;
|
||||
uint32_t seek_pos;
|
||||
uint32_t seek_diff;
|
||||
uint32_t cd_end;
|
||||
uint32_t type;
|
||||
uint32_t sound_on;
|
||||
uint32_t cdrom_capacity;
|
||||
uint32_t seek_pos;
|
||||
uint32_t seek_diff;
|
||||
uint32_t cd_end;
|
||||
uint32_t type;
|
||||
uint32_t sector_size;
|
||||
|
||||
int cd_buflen;
|
||||
int audio_op;
|
||||
int audio_muted_soft;
|
||||
int sony_msf;
|
||||
int cd_buflen;
|
||||
int audio_op;
|
||||
int audio_muted_soft;
|
||||
int sony_msf;
|
||||
int real_speed;
|
||||
int is_early;
|
||||
int is_nec;
|
||||
|
||||
uint32_t inv_field;
|
||||
|
||||
const cdrom_ops_t *ops;
|
||||
|
||||
void *image;
|
||||
void * local;
|
||||
void * log;
|
||||
|
||||
void (*insert)(void *priv);
|
||||
void (*close)(void *priv);
|
||||
uint32_t (*get_volume)(void *p, int channel);
|
||||
uint32_t (*get_channel)(void *p, int channel);
|
||||
void (*insert)(void *priv);
|
||||
void (*close)(void *priv);
|
||||
uint32_t (*get_volume)(void *p, int channel);
|
||||
uint32_t (*get_channel)(void *p, int channel);
|
||||
|
||||
int16_t cd_buffer[BUF_SIZE];
|
||||
int16_t cd_buffer[BUF_SIZE];
|
||||
|
||||
uint8_t subch_buffer[96];
|
||||
|
||||
int cdrom_sector_size;
|
||||
|
||||
/* Needs some extra breathing space in case of overflows. */
|
||||
uint8_t raw_buffer[4096];
|
||||
uint8_t extra_buffer[296];
|
||||
} cdrom_t;
|
||||
|
||||
extern cdrom_t cdrom[CDROM_NUM];
|
||||
|
||||
extern char *cdrom_getname(int type);
|
||||
/* The addresses sent from the guest are absolute, ie. a LBA of 0 corresponds to a MSF of 00:00:00. Otherwise, the counter displayed by the guest is wrong:
|
||||
there is a seeming 2 seconds in which audio plays but counter does not move, while a data track before audio jumps to 2 seconds before the actual start
|
||||
of the audio while audio still plays. With an absolute conversion, the counter is fine. */
|
||||
#define MSFtoLBA(m, s, f) ((((m * 60) + s) * 75) + f)
|
||||
|
||||
extern char *cdrom_get_internal_name(int type);
|
||||
extern int cdrom_get_from_internal_name(char *s);
|
||||
extern void cdrom_set_type(int model, int type);
|
||||
extern int cdrom_get_type(int model);
|
||||
static __inline int
|
||||
bin2bcd(int x)
|
||||
{
|
||||
return (x % 10) | ((x / 10) << 4);
|
||||
}
|
||||
|
||||
extern int cdrom_lba_to_msf_accurate(int lba);
|
||||
extern double cdrom_seek_time(cdrom_t *dev);
|
||||
extern void cdrom_stop(cdrom_t *dev);
|
||||
extern int cdrom_is_pre(cdrom_t *dev, uint32_t lba);
|
||||
extern int cdrom_audio_callback(cdrom_t *dev, int16_t *output, int len);
|
||||
extern uint8_t cdrom_audio_play(cdrom_t *dev, uint32_t pos, uint32_t len, int ismsf);
|
||||
extern uint8_t cdrom_audio_track_search(cdrom_t *dev, uint32_t pos, int type, uint8_t playbit);
|
||||
extern uint8_t cdrom_audio_track_search_pioneer(cdrom_t *dev, uint32_t pos, uint8_t playbit);
|
||||
extern uint8_t cdrom_audio_play_pioneer(cdrom_t *dev, uint32_t pos);
|
||||
extern uint8_t cdrom_audio_play_toshiba(cdrom_t *dev, uint32_t pos, int type);
|
||||
extern void cdrom_audio_pause_resume(cdrom_t *dev, uint8_t resume);
|
||||
extern uint8_t cdrom_audio_scan(cdrom_t *dev, uint32_t pos, int type);
|
||||
extern uint8_t cdrom_get_audio_status_pioneer(cdrom_t *dev, uint8_t *b);
|
||||
extern uint8_t cdrom_get_audio_status_sony(cdrom_t *dev, uint8_t *b, int msf);
|
||||
extern uint8_t cdrom_get_current_subchannel(cdrom_t *dev, uint8_t *b, int msf);
|
||||
extern void cdrom_get_current_subchannel_sony(cdrom_t *dev, uint8_t *b, int msf);
|
||||
extern void cdrom_get_current_subcodeq(cdrom_t *dev, uint8_t *b);
|
||||
extern uint8_t cdrom_get_current_subcodeq_playstatus(cdrom_t *dev, uint8_t *b);
|
||||
extern int cdrom_read_toc(cdrom_t *dev, unsigned char *b, int type,
|
||||
unsigned char start_track, int msf, int max_len);
|
||||
extern int cdrom_read_toc_sony(cdrom_t *dev, unsigned char *b, unsigned char start_track, int msf, int max_len);
|
||||
extern void cdrom_get_track_buffer(cdrom_t *dev, uint8_t *buf);
|
||||
extern void cdrom_get_q(cdrom_t *dev, uint8_t *buf, int *curtoctrk, uint8_t mode);
|
||||
extern uint8_t cdrom_mitsumi_audio_play(cdrom_t *dev, uint32_t pos, uint32_t len);
|
||||
extern int cdrom_readsector_raw(cdrom_t *dev, uint8_t *buffer, int sector, int ismsf,
|
||||
int cdrom_sector_type, int cdrom_sector_flags, int *len, uint8_t vendor_type);
|
||||
extern uint8_t cdrom_read_disc_info_toc(cdrom_t *dev, unsigned char *b, unsigned char track, int type);
|
||||
static __inline int
|
||||
bcd2bin(int x)
|
||||
{
|
||||
return (x >> 4) * 10 + (x & 0x0f);
|
||||
}
|
||||
|
||||
extern void cdrom_seek(cdrom_t *dev, uint32_t pos, uint8_t vendor_type);
|
||||
extern char *cdrom_get_vendor(const int type);
|
||||
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_generic(const int type);
|
||||
extern int cdrom_has_date(const int type);
|
||||
extern int cdrom_is_sony(const int type);
|
||||
extern int cdrom_is_caddy(const int type);
|
||||
extern int cdrom_get_speed(const int type);
|
||||
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_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);
|
||||
extern int cdrom_get_from_internal_name(const char *s);
|
||||
/* TODO: Configuration migration, remove when no longer needed. */
|
||||
extern int cdrom_get_from_name(const char *s);
|
||||
extern void cdrom_set_type(const int model, const int type);
|
||||
extern int cdrom_get_type(const int model);
|
||||
|
||||
extern void cdrom_close_handler(uint8_t id);
|
||||
extern void cdrom_insert(uint8_t id);
|
||||
extern void cdrom_eject(uint8_t id);
|
||||
extern void cdrom_reload(uint8_t id);
|
||||
extern int cdrom_lba_to_msf_accurate(const int lba);
|
||||
extern double cdrom_seek_time(const cdrom_t *dev);
|
||||
extern void cdrom_stop(cdrom_t *dev);
|
||||
extern void cdrom_seek(cdrom_t *dev, const uint32_t pos, const uint8_t vendor_type);
|
||||
extern int cdrom_is_pre(const cdrom_t *dev, const uint32_t lba);
|
||||
|
||||
extern int cdrom_image_open(cdrom_t *dev, const char *fn);
|
||||
extern void cdrom_image_close(cdrom_t *dev);
|
||||
extern int cdrom_audio_callback(cdrom_t *dev, int16_t *output, const int len);
|
||||
extern uint8_t cdrom_audio_play(cdrom_t *dev, const uint32_t pos, const uint32_t len, const int ismsf);
|
||||
extern uint8_t cdrom_audio_track_search(cdrom_t *dev, const uint32_t pos,
|
||||
const int type, const uint8_t playbit);
|
||||
extern uint8_t cdrom_audio_track_search_pioneer(cdrom_t *dev, const uint32_t pos, const uint8_t playbit);
|
||||
extern uint8_t cdrom_audio_play_pioneer(cdrom_t *dev, const uint32_t pos);
|
||||
extern uint8_t cdrom_audio_play_toshiba(cdrom_t *dev, const uint32_t pos, const int type);
|
||||
extern uint8_t cdrom_audio_scan(cdrom_t *dev, const uint32_t pos, const int type);
|
||||
extern void cdrom_audio_pause_resume(cdrom_t *dev, const uint8_t resume);
|
||||
|
||||
extern int cdrom_ioctl_open(cdrom_t *dev, const char *drv);
|
||||
extern void cdrom_ioctl_close(cdrom_t *dev);
|
||||
extern uint8_t cdrom_get_current_status(const cdrom_t *dev);
|
||||
extern void cdrom_get_current_subchannel(cdrom_t *dev, uint8_t *b, const int msf);
|
||||
extern void cdrom_get_current_subchannel_sony(cdrom_t *dev, uint8_t *b, const int msf);
|
||||
extern uint8_t cdrom_get_audio_status_pioneer(cdrom_t *dev, uint8_t *b);
|
||||
extern uint8_t cdrom_get_audio_status_sony(cdrom_t *dev, uint8_t *b, const int msf);
|
||||
extern void cdrom_get_current_subcodeq(cdrom_t *dev, uint8_t *b);
|
||||
extern uint8_t cdrom_get_current_subcodeq_playstatus(cdrom_t *dev, uint8_t *b);
|
||||
extern int cdrom_read_toc(const cdrom_t *dev, uint8_t *b, const int type,
|
||||
const uint8_t start_track, const int msf, const int max_len);
|
||||
extern int cdrom_read_toc_sony(const cdrom_t *dev, uint8_t *b, const uint8_t start_track,
|
||||
const int msf, const int max_len);
|
||||
#ifdef USE_CDROM_MITSUMI
|
||||
extern void cdrom_get_track_buffer(cdrom_t *dev, uint8_t *buf);
|
||||
extern void cdrom_get_q(cdrom_t *dev, uint8_t *buf, int *curtoctrk, uint8_t mode);
|
||||
extern uint8_t cdrom_mitsumi_audio_play(cdrom_t *dev, uint32_t pos, uint32_t len);
|
||||
#endif
|
||||
extern uint8_t cdrom_read_disc_info_toc(cdrom_t *dev, uint8_t *b,
|
||||
const uint8_t track, const int type);
|
||||
extern int cdrom_readsector_raw(cdrom_t *dev, uint8_t *buffer, const int sector, const int ismsf,
|
||||
int cdrom_sector_type, const int cdrom_sector_flags,
|
||||
int *len, const uint8_t vendor_type);
|
||||
extern int cdrom_read_dvd_structure(const cdrom_t *dev, const uint8_t layer, const uint8_t format,
|
||||
uint8_t *buffer, uint32_t *info);
|
||||
extern void cdrom_read_disc_information(const cdrom_t *dev, uint8_t *buffer);
|
||||
extern int cdrom_read_track_information(cdrom_t *dev, const uint8_t *cdb, uint8_t *buffer);
|
||||
extern void cdrom_set_empty(cdrom_t *dev);
|
||||
extern void cdrom_update_status(cdrom_t *dev);
|
||||
extern int cdrom_load(cdrom_t *dev, const char *fn, const int skip_insert);
|
||||
|
||||
extern void cdrom_update_cdb(uint8_t *cdb, int lba_pos,
|
||||
int number_of_blocks);
|
||||
|
||||
extern int find_cdrom_for_scsi_id(uint8_t scsi_id);
|
||||
|
||||
extern void cdrom_close(void);
|
||||
extern void cdrom_global_init(void);
|
||||
extern void cdrom_global_reset(void);
|
||||
extern void cdrom_hard_reset(void);
|
||||
extern void scsi_cdrom_drive_reset(int c);
|
||||
extern void cdrom_global_init(void);
|
||||
extern void cdrom_hard_reset(void);
|
||||
extern void cdrom_close(void);
|
||||
extern void cdrom_insert(const uint8_t id);
|
||||
extern void cdrom_exit(const uint8_t id);
|
||||
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);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -6,35 +6,33 @@
|
||||
*
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* CD-ROM image file handling module header, translated to C
|
||||
* from cdrom_dosbox.h.
|
||||
* CD-ROM image file handling module header.
|
||||
*
|
||||
* Authors: RichardG,
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Authors: Miran Grca, <mgrca8@gmail.com>
|
||||
* RichardG, <richardg867@gmail.com>
|
||||
* Cacodemon345
|
||||
*
|
||||
* Copyright 2016-2022 RichardG.
|
||||
* Copyright 2016-2022 Miran Grca.
|
||||
* Copyright 2016-2025 Miran Grca.
|
||||
* Copyright 2016-2025 RichardG.
|
||||
* Copyright 2024-2025 Cacodemon345.
|
||||
*/
|
||||
#ifndef CDROM_IMAGE_H
|
||||
#define CDROM_IMAGE_H
|
||||
|
||||
/* this header file lists the functions provided by
|
||||
various platform specific cdrom-ioctl files */
|
||||
/* Track file struct. */
|
||||
typedef struct track_file_t {
|
||||
int (*read)(void *priv, uint8_t *buffer, uint64_t seek, size_t count);
|
||||
uint64_t (*get_length)(void *priv);
|
||||
void (*close)(void *priv);
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
char fn[260];
|
||||
FILE *fp;
|
||||
void *priv;
|
||||
void *log;
|
||||
|
||||
extern int image_open(uint8_t id, wchar_t *fn);
|
||||
extern void image_reset(uint8_t id);
|
||||
int motorola;
|
||||
} track_file_t;
|
||||
|
||||
extern void image_close(uint8_t id);
|
||||
|
||||
void update_status_bar_icon_state(int tag, int state);
|
||||
extern void cdrom_set_null_handler(uint8_t id);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
extern void * image_open(cdrom_t *dev, const char *path);
|
||||
|
||||
#endif /*CDROM_IMAGE_H*/
|
||||
|
||||
@@ -1,107 +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.
|
||||
*
|
||||
* CD-ROM image file handling module header , translated to C
|
||||
* from cdrom_dosbox.h.
|
||||
*
|
||||
* Authors: Miran Grca, <mgrca8@gmail.com>
|
||||
* Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* The DOSBox Team, <unknown>
|
||||
*
|
||||
* Copyright 2016-2020 Miran Grca.
|
||||
* Copyright 2017-2020 Fred N. van Kempen.
|
||||
* Copyright 2002-2020 The DOSBox Team.
|
||||
*/
|
||||
#ifndef CDROM_IMAGE_BACKEND_H
|
||||
#define CDROM_IMAGE_BACKEND_H
|
||||
|
||||
#define RAW_SECTOR_SIZE 2352
|
||||
#define COOKED_SECTOR_SIZE 2048
|
||||
|
||||
#define DATA_TRACK 0x14
|
||||
#define AUDIO_TRACK 0x10
|
||||
|
||||
#define CD_FPS 75
|
||||
#define FRAMES_TO_MSF(f, M, S, F) \
|
||||
{ \
|
||||
uint64_t value = f; \
|
||||
*(F) = (value % CD_FPS) & 0xff; \
|
||||
value /= CD_FPS; \
|
||||
*(S) = (value % 60) & 0xff; \
|
||||
value /= 60; \
|
||||
*(M) = value & 0xff; \
|
||||
}
|
||||
#define MSF_TO_FRAMES(M, S, F) ((M) *60 * CD_FPS + (S) *CD_FPS + (F))
|
||||
|
||||
typedef struct SMSF {
|
||||
uint16_t min;
|
||||
uint8_t sec;
|
||||
uint8_t fr;
|
||||
} TMSF;
|
||||
|
||||
/* Track file struct. */
|
||||
typedef struct track_file_t {
|
||||
int (*read)(void *priv, uint8_t *buffer, uint64_t seek, size_t count);
|
||||
uint64_t (*get_length)(void *priv);
|
||||
void (*close)(void *priv);
|
||||
|
||||
char fn[260];
|
||||
FILE *fp;
|
||||
void *priv;
|
||||
|
||||
int motorola;
|
||||
} track_file_t;
|
||||
|
||||
typedef struct track_t {
|
||||
int number;
|
||||
int track_number;
|
||||
int attr;
|
||||
int sector_size;
|
||||
int mode2;
|
||||
int form;
|
||||
int pre;
|
||||
int noskip; /* Do not skip by 8 bytes.*/
|
||||
uint64_t start;
|
||||
uint64_t length;
|
||||
uint64_t skip;
|
||||
track_file_t *file;
|
||||
} track_t;
|
||||
|
||||
typedef struct cd_img_t {
|
||||
int tracks_num;
|
||||
track_t *tracks;
|
||||
} cd_img_t;
|
||||
|
||||
/* Binary file functions. */
|
||||
extern void cdi_close(cd_img_t *cdi);
|
||||
extern int cdi_set_device(cd_img_t *cdi, const char *path);
|
||||
extern void cdi_get_audio_tracks(cd_img_t *cdi, int *st_track, int *end, TMSF *lead_out);
|
||||
extern void cdi_get_audio_tracks_lba(cd_img_t *cdi, int *st_track, int *end, uint32_t *lead_out);
|
||||
extern int cdi_get_audio_track_pre(cd_img_t *cdi, int track);
|
||||
extern int cdi_get_audio_track_info(cd_img_t *cdi, int end, int track, int *track_num, TMSF *start, uint8_t *attr);
|
||||
extern int cdi_get_audio_track_info_lba(cd_img_t *cdi, int end, int track, int *track_num, uint32_t *start, uint8_t *attr);
|
||||
extern int cdi_get_track(cd_img_t *cdi, uint32_t sector);
|
||||
extern int cdi_get_audio_sub(cd_img_t *cdi, uint32_t sector, uint8_t *attr, uint8_t *track, uint8_t *index, TMSF *rel_pos, TMSF *abs_pos);
|
||||
extern int cdi_read_sector(cd_img_t *cdi, uint8_t *buffer, int raw, uint32_t sector);
|
||||
extern int cdi_read_sectors(cd_img_t *cdi, uint8_t *buffer, int raw, uint32_t sector, uint32_t num);
|
||||
extern int cdi_read_sector_sub(cd_img_t *cdi, uint8_t *buffer, uint32_t sector);
|
||||
extern int cdi_get_sector_size(cd_img_t *cdi, uint32_t sector);
|
||||
extern int cdi_is_mode2(cd_img_t *cdi, uint32_t sector);
|
||||
extern int cdi_get_mode2_form(cd_img_t *cdi, uint32_t sector);
|
||||
extern int cdi_load_iso(cd_img_t *cdi, const char *filename);
|
||||
extern int cdi_load_cue(cd_img_t *cdi, const char *cuefile);
|
||||
extern int cdi_has_data_track(cd_img_t *cdi);
|
||||
extern int cdi_has_audio_track(cd_img_t *cdi);
|
||||
|
||||
/* Virtual ISO functions. */
|
||||
extern int viso_read(void *priv, uint8_t *buffer, uint64_t seek, size_t count);
|
||||
extern uint64_t viso_get_length(void *priv);
|
||||
extern void viso_close(void *priv);
|
||||
extern track_file_t *viso_init(const char *dirname, int *error);
|
||||
|
||||
#endif /*CDROM_IMAGE_BACKEND_H*/
|
||||
26
src/include/86box/cdrom_image_viso.h
Normal file
26
src/include/86box/cdrom_image_viso.h
Normal file
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
* CD-ROM image file handling module header.
|
||||
*
|
||||
* Authors: RichardG, <richardg867@gmail.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
*
|
||||
* Copyright 2016-2025 RichardG.
|
||||
* Copyright 2016-2025 Miran Grca.
|
||||
*/
|
||||
#ifndef CDROM_IMAGE_VISO_H
|
||||
#define CDROM_IMAGE_VISO_H
|
||||
|
||||
/* Virtual ISO functions. */
|
||||
extern int viso_read(void *priv, uint8_t *buffer, uint64_t seek, size_t count);
|
||||
extern uint64_t viso_get_length(void *priv);
|
||||
extern void viso_close(void *priv);
|
||||
extern track_file_t *viso_init(const uint8_t id, const char *dirname, int *error);
|
||||
|
||||
#endif /*CDROM_IMAGE_VISO_H*/
|
||||
@@ -21,11 +21,13 @@ extern int cdrom_interface_current;
|
||||
|
||||
extern void cdrom_interface_reset(void);
|
||||
|
||||
extern const char *cdrom_interface_get_internal_name(int cdinterface);
|
||||
extern int cdrom_interface_get_from_internal_name(char *s);
|
||||
extern int cdrom_interface_has_config(int cdinterface);
|
||||
extern const device_t *cdrom_interface_get_device(int cdinterface);
|
||||
extern int cdrom_interface_get_flags(int cdinterface);
|
||||
extern int cdrom_interface_available(int cdinterface);
|
||||
const char *cdrom_interface_get_internal_name(const int cdinterface);
|
||||
extern int cdrom_interface_get_from_internal_name(const char *s);
|
||||
#ifdef EMU_DEVICE_H
|
||||
extern const device_t *cdrom_interface_get_device(const int cdinterface);
|
||||
#endif
|
||||
extern int cdrom_interface_has_config(const int cdinterface);
|
||||
extern int cdrom_interface_get_flags(const int cdinterface);
|
||||
extern int cdrom_interface_available(const int cdinterface);
|
||||
|
||||
#endif /*EMU_CDROM_INTERFACE_H*/
|
||||
|
||||
@@ -1,32 +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.
|
||||
*
|
||||
* CD-ROM image file handling module header, translated to C
|
||||
* from cdrom_dosbox.h.
|
||||
*
|
||||
* Authors: RichardG,
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
*
|
||||
* Copyright 2016-2022 RichardG.
|
||||
* Copyright 2016-2022 Miran Grca.
|
||||
*/
|
||||
#ifndef CDROM_IOCTL_H
|
||||
#define CDROM_IOCTL_H
|
||||
|
||||
/* this header file lists the functions provided by
|
||||
various platform specific cdrom-ioctl files */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /*CDROM_IOCTL_H*/
|
||||
@@ -195,7 +195,7 @@ 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;
|
||||
|
||||
#if defined(DEV_BRANCH) && defined(USE_OLIVETTI)
|
||||
#ifdef USE_OLIVETTI
|
||||
extern const device_t olivetti_eva_device;
|
||||
#endif
|
||||
#endif /* USE_OLIVETTI */
|
||||
#endif /*EMU_CHIPSET_H*/
|
||||
|
||||
@@ -8,16 +8,16 @@
|
||||
*
|
||||
* Configuration file handler header.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Sarah Walker,
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Overdoze,
|
||||
* Jasmine Iwanek, <jriwanek@gmail.com>
|
||||
*
|
||||
* Copyright 2008-2017 Sarah Walker.
|
||||
* Copyright 2016-2017 Miran Grca.
|
||||
* Copyright 2017 Fred N. van Kempen.
|
||||
* Copyright 2021-2025 Jasmine Iwanek.
|
||||
*/
|
||||
#ifndef EMU_CONFIG_H
|
||||
#define EMU_CONFIG_H
|
||||
@@ -111,6 +111,7 @@ typedef struct config_t {
|
||||
# ifdef USE_SERIAL_DEVICES
|
||||
char serial_devices[SERIAL_MAX][32]; /* Serial device names */
|
||||
# endif
|
||||
char gameport_devices[GAMEPORT_MAX][32]; /* gameport device names */
|
||||
|
||||
/* Other peripherals category */
|
||||
int fdc_current[FDC_MAX]; /* Floppy disk controller type */
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
* Copyright 2016-2019 Miran Grca.
|
||||
* Copyright 2008-2019 Sarah Walker.
|
||||
* Copyright 2021 Andreas J. Reichel.
|
||||
* Copyright 2021-2022 Jasmine Iwanek.
|
||||
* Copyright 2021-2025 Jasmine Iwanek.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -79,29 +79,33 @@
|
||||
// #define CONFIG_STANDALONE 257 /* not available on the on-board variant */
|
||||
|
||||
enum {
|
||||
DEVICE_PCJR = 2, /* requires an IBM PCjr */
|
||||
DEVICE_XTKBC = 4, /* requires an XT-compatible keyboard controller */
|
||||
DEVICE_AT = 8, /* requires an AT-compatible system */
|
||||
DEVICE_ATKBC = 0x10, /* requires an AT-compatible keyboard controller */
|
||||
DEVICE_PS2 = 0x20, /* requires a PS/1 or PS/2 system */
|
||||
DEVICE_ISA = 0x40, /* requires the ISA bus */
|
||||
DEVICE_CBUS = 0x80, /* requires the C-BUS bus */
|
||||
DEVICE_PCMCIA = 0x100, /* requires the PCMCIA bus */
|
||||
DEVICE_MCA = 0x200, /* requires the MCA bus */
|
||||
DEVICE_HIL = 0x400, /* requires the HP HIL bus */
|
||||
DEVICE_EISA = 0x800, /* requires the EISA bus */
|
||||
DEVICE_AT32 = 0x1000, /* requires the Mylex AT/32 local bus */
|
||||
DEVICE_OLB = 0x2000, /* requires the OPTi local bus */
|
||||
DEVICE_VLB = 0x4000, /* requires the VLB bus */
|
||||
DEVICE_PCI = 0x8000, /* requires the PCI bus */
|
||||
DEVICE_CARDBUS = 0x10000, /* requires the CardBus bus */
|
||||
DEVICE_USB = 0x20000, /* requires the USB bus */
|
||||
DEVICE_AGP = 0x40000, /* requires the AGP bus */
|
||||
DEVICE_AC97 = 0x80000, /* requires the AC'97 bus */
|
||||
DEVICE_COM = 0x100000, /* requires a serial port */
|
||||
DEVICE_LPT = 0x200000, /* requires a parallel port */
|
||||
DEVICE_KBC = 0x400000, /* is a keyboard controller */
|
||||
DEVICE_SOFTRESET = 0x800000, /* requires to be reset on soft reset */
|
||||
DEVICE_SIDECAR = 2, /* requires an IBM PCjr */
|
||||
DEVICE_ISA = 4, /* requires the ISA bus */
|
||||
DEVICE_XT_KBC = 8, /* requires an XT-compatible keyboard controller */
|
||||
DEVICE_CBUS = 0x10, /* requires the C-BUS bus */
|
||||
DEVICE_ISA16 = 0x20, /* requires an AT-compatible system */
|
||||
DEVICE_AT_KBC = 0x40, /* requires an AT-compatible keyboard controller */
|
||||
DEVICE_MCA = 0x80, /* requires the MCA bus */
|
||||
DEVICE_MCA32 = 0x100, /* requires the MCA bus */
|
||||
DEVICE_PS2_KBC = 0x200, /* requires a PS/1 or PS/2 system */
|
||||
DEVICE_PCMCIA = 0x400, /* requires the PCMCIA bus */
|
||||
DEVICE_HIL = 0x800, /* requires the HP HIL bus */
|
||||
DEVICE_EISA = 0x1000, /* requires the EISA bus */
|
||||
DEVICE_AT32 = 0x2000, /* requires the Mylex AT/32 local bus */
|
||||
DEVICE_OLB = 0x4000, /* requires the OPTi local bus */
|
||||
DEVICE_VLB = 0x8000, /* requires the VLB bus */
|
||||
DEVICE_PCI = 0x10000, /* requires the PCI bus */
|
||||
DEVICE_CARDBUS = 0x20000, /* requires the CardBus bus */
|
||||
DEVICE_USB = 0x40000, /* requires the USB bus */
|
||||
DEVICE_AGP = 0x80000, /* requires the AGP bus */
|
||||
DEVICE_AC97 = 0x100000, /* requires the AC'97 bus */
|
||||
DEVICE_BUS = 0x1fffff, /* requires a machine bus */
|
||||
|
||||
DEVICE_COM = 0x200000, /* requires a serial port */
|
||||
DEVICE_LPT = 0x400000, /* requires a parallel port */
|
||||
|
||||
DEVICE_KBC = 0x800000, /* is a keyboard controller */
|
||||
DEVICE_SOFTRESET = 0x1000000, /* requires to be reset on soft reset */
|
||||
|
||||
DEVICE_ONBOARD = 0x40000000, /* is on-board */
|
||||
DEVICE_PIT = 0x80000000, /* device is a PIT */
|
||||
@@ -118,16 +122,6 @@ enum {
|
||||
#define BIOS_INTERLEAVED_INVERT 8
|
||||
#define BIOS_HIGH_BIT_INVERT 16
|
||||
|
||||
#define device_common_config_t \
|
||||
const char *name; \
|
||||
const char *description; \
|
||||
int type; \
|
||||
const char *default_string; \
|
||||
int default_int; \
|
||||
const char *file_filter; \
|
||||
const device_config_spinner_t spinner; \
|
||||
const device_config_selection_t selection[32]
|
||||
|
||||
typedef struct device_config_selection_t {
|
||||
const char *description;
|
||||
int value;
|
||||
@@ -139,10 +133,6 @@ typedef struct device_config_spinner_t {
|
||||
int16_t step;
|
||||
} device_config_spinner_t;
|
||||
|
||||
typedef struct _device_dep_config_ {
|
||||
device_common_config_t;
|
||||
} device_dep_config_t;
|
||||
|
||||
typedef struct device_config_bios_t {
|
||||
const char *name;
|
||||
const char *internal_name;
|
||||
@@ -153,15 +143,18 @@ typedef struct device_config_bios_t {
|
||||
void *dev1;
|
||||
void *dev2;
|
||||
const char *files[9];
|
||||
/* Configuration options that depend on the device variant.
|
||||
To prevent excessive nesting, there is no CONFIG_BIOS
|
||||
option a dep_config struct */
|
||||
const device_dep_config_t *dep_config;
|
||||
} device_config_bios_t;
|
||||
|
||||
typedef struct _device_config_ {
|
||||
device_common_config_t;
|
||||
const device_config_bios_t bios[32];
|
||||
const char *name;
|
||||
const char *description;
|
||||
int type;
|
||||
const char *default_string;
|
||||
int default_int;
|
||||
const char *file_filter;
|
||||
const device_config_spinner_t spinner;
|
||||
const device_config_selection_t selection[32];
|
||||
const device_config_bios_t bios[32];
|
||||
} device_config_t;
|
||||
|
||||
typedef struct _device_ {
|
||||
@@ -176,10 +169,7 @@ typedef struct _device_ {
|
||||
};
|
||||
void (*close)(void *priv);
|
||||
void (*reset)(void *priv);
|
||||
union {
|
||||
int (*available)(void);
|
||||
int (*poll)(void *priv);
|
||||
};
|
||||
int (*available)(void);
|
||||
void (*speed_changed)(void *priv);
|
||||
void (*force_redraw)(void *priv);
|
||||
|
||||
@@ -197,12 +187,12 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
extern void device_init(void);
|
||||
extern void device_set_context(device_context_t *c, const device_t *dev, int inst);
|
||||
extern void device_set_context(device_context_t *ctx, const device_t *dev, int inst);
|
||||
extern void device_context(const device_t *dev);
|
||||
extern void device_context_inst(const device_t *dev, int inst);
|
||||
extern void device_context_restore(void);
|
||||
extern void *device_add(const device_t *d);
|
||||
extern void *device_add_linked(const device_t *d, void *priv);
|
||||
extern void *device_add(const device_t *dev);
|
||||
extern void *device_add_linked(const device_t *dev, void *priv);
|
||||
extern void *device_add_params(const device_t *dev, void *params);
|
||||
extern void device_add_ex(const device_t *dev, void *priv);
|
||||
extern void device_add_ex_params(const device_t *dev, void *priv, void *params);
|
||||
@@ -216,34 +206,33 @@ extern void device_reset_all(uint32_t match_flags);
|
||||
extern void *device_find_first_priv(uint32_t match_flags);
|
||||
extern void *device_get_priv(const device_t *dev);
|
||||
extern int device_available(const device_t *dev);
|
||||
extern int device_poll(const device_t *dev);
|
||||
extern void device_speed_changed(void);
|
||||
extern void device_force_redraw(void);
|
||||
extern void device_get_name(const device_t *dev, int bus, char *name);
|
||||
extern int device_has_config(const device_t *dev);
|
||||
extern const char *device_get_bios_file(const device_t *dev, const char *internal_name, int file_no);
|
||||
|
||||
extern int device_is_valid(const device_t *, int m);
|
||||
extern int device_is_valid(const device_t *, int mch);
|
||||
|
||||
extern const device_t* device_context_get_device(void);
|
||||
|
||||
extern int device_get_config_int(const char *name);
|
||||
extern int device_get_config_int_ex(const char *s, int dflt_int);
|
||||
extern int device_get_config_int_ex(const char *str, int def);
|
||||
extern int device_get_config_hex16(const char *name);
|
||||
extern int device_get_config_hex20(const char *name);
|
||||
extern int device_get_config_mac(const char *name, int dflt_int);
|
||||
extern void device_set_config_int(const char *s, int val);
|
||||
extern void device_set_config_hex16(const char *s, int val);
|
||||
extern void device_set_config_hex20(const char *s, int val);
|
||||
extern void device_set_config_mac(const char *s, int val);
|
||||
extern int device_get_config_mac(const char *name, int def);
|
||||
extern void device_set_config_int(const char *str, int val);
|
||||
extern void device_set_config_hex16(const char *str, int val);
|
||||
extern void device_set_config_hex20(const char *str, int val);
|
||||
extern void device_set_config_mac(const char *str, int val);
|
||||
extern const char *device_get_config_string(const char *name);
|
||||
extern int device_get_instance(void);
|
||||
#define device_get_config_bios device_get_config_string
|
||||
|
||||
extern const char *device_get_internal_name(const device_t *dev);
|
||||
|
||||
extern int machine_get_config_int(char *s);
|
||||
extern char *machine_get_config_string(char *s);
|
||||
extern int machine_get_config_int(char *str);
|
||||
extern const char *machine_get_config_string(char *str);
|
||||
|
||||
extern const device_t device_none;
|
||||
extern const device_t device_internal;
|
||||
|
||||
@@ -41,21 +41,23 @@
|
||||
#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_PS1 0x08 /* PS/1, PS/2 ISA */
|
||||
#define FDC_FLAG_SUPERIO 0x10 /* Super I/O chips */
|
||||
#define FDC_FLAG_START_RWC_1 0x20 /* W83877F, W83977F */
|
||||
#define FDC_FLAG_MORE_TRACKS 0x40 /* W83877F, W83977F, PC87306, PC87309 */
|
||||
#define FDC_FLAG_NSC 0x80 /* PC87306, PC87309 */
|
||||
#define FDC_FLAG_TOSHIBA 0x100 /* T1000, T1200 */
|
||||
#define FDC_FLAG_AMSTRAD 0x200 /* Non-AT Amstrad machines */
|
||||
#define FDC_FLAG_UMC 0x400 /* UMC UM8398 */
|
||||
#define FDC_FLAG_ALI 0x800 /* ALi M512x / M1543C */
|
||||
#define FDC_FLAG_NO_DSR_RESET 0x1000 /* Has no DSR reset */
|
||||
#define FDC_FLAG_NEC 0x2000 /* Is NEC upd765-compatible */
|
||||
#define FDC_FLAG_PS2 0x4000 /* PS/2, PS/55 */
|
||||
#define FDC_FLAG_SEC 0x10000 /* Is Secondary */
|
||||
#define FDC_FLAG_TER 0x20000 /* Is Tertiary */
|
||||
#define FDC_FLAG_QUA 0x40000 /* Is Quaternary */
|
||||
#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 */
|
||||
|
||||
typedef struct fdc_t {
|
||||
uint8_t dor;
|
||||
@@ -245,21 +247,20 @@ extern const device_t fdc_xt_qua_device;
|
||||
extern const device_t fdc_xt_t1x00_device;
|
||||
extern const device_t fdc_xt_tandy_device;
|
||||
extern const device_t fdc_xt_amstrad_device;
|
||||
extern const device_t fdc_xt_umc_um8398_device;
|
||||
extern const device_t fdc_pcjr_device;
|
||||
extern const device_t fdc_at_device;
|
||||
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_ps1_device;
|
||||
extern const device_t fdc_at_ps1_2121_device;
|
||||
extern const device_t fdc_at_ps2_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;
|
||||
extern const device_t fdc_at_nsc_device;
|
||||
extern const device_t fdc_dp8473_device;
|
||||
extern const device_t fdc_um8398_device;
|
||||
extern const device_t fdc_at_nsc_dp8473_device;
|
||||
extern const device_t fdc_ps2_device;
|
||||
extern const device_t fdc_ps2_mca_device;
|
||||
#endif
|
||||
|
||||
#endif /*EMU_FDC_H*/
|
||||
|
||||
@@ -34,6 +34,10 @@ extern const device_t fdc_b215_device;
|
||||
extern const device_t fdc_pii151b_device;
|
||||
extern const device_t fdc_pii158b_device;
|
||||
|
||||
extern const device_t fdc_compaticard_i_device;
|
||||
extern const device_t fdc_compaticard_ii_device;
|
||||
extern const device_t fdc_compaticard_iv_device;
|
||||
|
||||
extern const device_t fdc_monster_device;
|
||||
|
||||
extern void fdc_card_init(void);
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#define EMU_FDD_H
|
||||
|
||||
#define FDD_NUM 4
|
||||
#define FLOPPY_IMAGE_HISTORY 4
|
||||
#define FLOPPY_IMAGE_HISTORY 10
|
||||
#define SEEK_RECALIBRATE -999
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -8,13 +8,11 @@
|
||||
*
|
||||
* Definitions for the 86F floppy image format.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Miran Grca, <mgrca8@gmail.com>
|
||||
* Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
*
|
||||
* Copyright 2016-2019 Miran Grca.
|
||||
* Copyright 2018-2019 Fred N. van Kempen.
|
||||
* Copyright 2016-2025 Miran Grca.
|
||||
* Copyright 2018-2025 Fred N. van Kempen.
|
||||
*/
|
||||
#ifndef EMU_FLOPPY_86F_H
|
||||
#define EMU_FLOPPY_86F_H
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
#ifndef FIFO_H
|
||||
#define FIFO_H
|
||||
|
||||
/*
|
||||
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
||||
* running old operating systems and software designed for IBM
|
||||
@@ -13,8 +10,11 @@
|
||||
*
|
||||
* Authors: Miran Grca, <mgrca8@gmail.com>
|
||||
*
|
||||
* Copyright 2023 Miran Grca.
|
||||
* Copyright 2023-2025 Miran Grca.
|
||||
*/
|
||||
#ifndef FIFO_H
|
||||
#define FIFO_H
|
||||
|
||||
#define FIFO(size) \
|
||||
typedef struct { \
|
||||
int start; \
|
||||
@@ -37,6 +37,7 @@
|
||||
void (*d_full_evt)(void *); \
|
||||
void (*d_ready_evt)(void *); \
|
||||
\
|
||||
uint8_t tag[64]; \
|
||||
uint8_t buf[size]; \
|
||||
} fifo## size ##_t;
|
||||
|
||||
@@ -50,9 +51,13 @@ FIFO(64)
|
||||
|
||||
extern int fifo_get_count(void *priv);
|
||||
extern void fifo_write(uint8_t val, void *priv);
|
||||
extern void fifo_write_tagged(uint8_t tag, uint8_t val, void *priv);
|
||||
extern void fifo_write_evt(uint8_t val, void *priv);
|
||||
extern void fifo_write_evt_tagged(uint8_t tag, uint8_t val, void *priv);
|
||||
extern uint8_t fifo_read(void *priv);
|
||||
extern uint8_t fifo_read_tagged(uint8_t *tag, void *priv);
|
||||
extern uint8_t fifo_read_evt(void *priv);
|
||||
extern uint8_t fifo_read_evt_tagged(uint8_t *tag, void *priv);
|
||||
extern void fifo_clear_overrun(void *priv);
|
||||
extern int fifo_get_full(void *priv);
|
||||
extern int fifo_get_d_full(void *priv);
|
||||
|
||||
@@ -8,19 +8,21 @@
|
||||
*
|
||||
* Definitions for the generic game port handlers.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Miran Grca, <mgrca8@gmail.com>
|
||||
* Sarah Walker, <https://pcem-emulator.co.uk/>
|
||||
* RichardG, <richardg867@gmail.com>
|
||||
* Jasmine Iwanek, <jriwanek@gmail.com>
|
||||
*
|
||||
* Copyright 2016-2018 Miran Grca.
|
||||
* Copyright 2016-2022 Miran Grca.
|
||||
* Copyright 2008-2018 Sarah Walker.
|
||||
* Copyright 2021 RichardG.
|
||||
* Copyright 2021-2025 Jasmine Iwanek.
|
||||
*/
|
||||
#ifndef EMU_GAMEPORT_H
|
||||
#define EMU_GAMEPORT_H
|
||||
|
||||
#define GAMEPORT_MAX 2
|
||||
|
||||
#define MAX_PLAT_JOYSTICKS 8
|
||||
#define MAX_JOYSTICKS 4
|
||||
|
||||
@@ -43,8 +45,11 @@
|
||||
|
||||
#define AXIS_NOT_PRESENT -99999
|
||||
|
||||
#define JOYSTICK_PRESENT(n) (joystick_state[n].plat_joystick_nr != 0)
|
||||
#define JOYSTICK_PRESENT(gp, js) (joystick_state[gp][js].plat_joystick_nr != 0)
|
||||
|
||||
#define GAMEPORT_1ADDR 0x010000
|
||||
#define GAMEPORT_6ADDR 0x060000
|
||||
#define GAMEPORT_8ADDR 0x080000
|
||||
#define GAMEPORT_SIO 0x1000000
|
||||
|
||||
typedef struct plat_joystick_t {
|
||||
@@ -105,10 +110,20 @@ typedef struct joystick_if_t {
|
||||
const char *pov_names[MAX_JOY_POVS];
|
||||
} joystick_if_t;
|
||||
|
||||
extern device_t game_ports[GAMEPORT_MAX];
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern int gameport_available(int port);
|
||||
#ifdef EMU_DEVICE_H
|
||||
extern const device_t *gameport_getdevice(int port);
|
||||
#endif
|
||||
extern int gameport_has_config(int port);
|
||||
extern const char *gameport_get_internal_name(int port);
|
||||
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_201_device;
|
||||
@@ -122,6 +137,7 @@ extern const device_t gameport_20d_device;
|
||||
extern const device_t gameport_20f_device;
|
||||
extern const device_t gameport_tm_acm_device;
|
||||
extern const device_t gameport_pnp_device;
|
||||
extern const device_t gameport_pnp_1io_device;
|
||||
extern const device_t gameport_pnp_6io_device;
|
||||
extern const device_t gameport_sio_device;
|
||||
extern const device_t gameport_sio_1io_device;
|
||||
@@ -130,7 +146,7 @@ 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[MAX_JOYSTICKS];
|
||||
extern joystick_t joystick_state[GAMEPORT_MAX][MAX_JOYSTICKS];
|
||||
extern int joysticks_present;
|
||||
|
||||
extern int joystick_type;
|
||||
@@ -167,6 +183,15 @@ extern const joystick_if_t joystick_ch_flightstick_pro;
|
||||
extern const joystick_if_t joystick_sw_pad;
|
||||
|
||||
extern const joystick_if_t joystick_tm_fcs;
|
||||
|
||||
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
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* Authors: Miran Grca, <mgrca8@gmail.com>
|
||||
* Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
*
|
||||
* Copyright 2016-2020 Miran Grca.
|
||||
* Copyright 2016-2025 Miran Grca.
|
||||
* Copyright 2017-2020 Fred N. van Kempen.
|
||||
*/
|
||||
#ifndef EMU_HDC_H
|
||||
@@ -22,11 +22,6 @@
|
||||
#define MFM_NUM 2 /* 2 drives per controller supported */
|
||||
#define ESDI_NUM 2 /* 2 drives per controller supported */
|
||||
#define XTA_NUM 2 /* 2 drives per controller supported */
|
||||
#define IDE_NUM 10 /* 8 drives per AT IDE + 2 for XT IDE */
|
||||
#define ATAPI_NUM 8 /* 8 drives per AT IDE */
|
||||
#define SCSI_NUM 16 /* theoretically the controller can have at \
|
||||
* least 7 devices, with each device being \
|
||||
* able to support 8 units, but hey... */
|
||||
|
||||
/* Controller types. */
|
||||
#define HDC_NONE 0
|
||||
@@ -56,11 +51,13 @@ extern const device_t esdi_ps2_device; /* esdi_mca */
|
||||
extern const device_t esdi_integrated_device; /* esdi_mca */
|
||||
|
||||
extern const device_t ide_isa_device; /* isa_ide */
|
||||
extern const device_t ide_isa_sec_device; /* isa_ide sec*/
|
||||
extern const device_t ide_isa_2ch_device; /* isa_ide_2ch */
|
||||
extern const device_t ide_isa_2ch_opt_device; /* isa_ide_2ch_opt */
|
||||
extern const device_t ide_vlb_device; /* vlb_ide */
|
||||
extern const device_t ide_vlb_sec_device; /* vlb_ide sec */
|
||||
extern const device_t ide_vlb_2ch_device; /* vlb_ide_2ch */
|
||||
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_ali1489_device; /* ALi M1489 */
|
||||
@@ -90,6 +87,7 @@ extern const device_t ide_w83769f_vlb_device; /* Winbond W8376
|
||||
extern const device_t ide_w83769f_vlb_34_device; /* Winbond W83769F VLB (Port 34h) */
|
||||
extern const device_t ide_w83769f_pci_device; /* Winbond W83769F PCI */
|
||||
extern const device_t ide_w83769f_pci_34_device; /* Winbond W83769F PCI (Port 34h) */
|
||||
extern const device_t ide_w83769f_pci_single_channel_device; /* Winbond W83769F PCI (Only primary channel) */
|
||||
|
||||
extern const device_t ide_ter_device;
|
||||
extern const device_t ide_ter_pnp_device;
|
||||
|
||||
@@ -19,20 +19,23 @@
|
||||
#ifndef EMU_IDE_H
|
||||
#define EMU_IDE_H
|
||||
|
||||
#define IDE_NUM 10 /* 8 drives per AT IDE + 2 for XT IDE */
|
||||
#define ATAPI_NUM 10 /* 8 drives per AT IDE + 2 for XT IDE */
|
||||
|
||||
#define IDE_BUS_MAX 4
|
||||
#define IDE_CHAN_MAX 2
|
||||
|
||||
#define HDC_PRIMARY_BASE 0x01F0
|
||||
#define HDC_PRIMARY_SIDE 0x03F6
|
||||
#define HDC_PRIMARY_BASE 0x01f0
|
||||
#define HDC_PRIMARY_SIDE 0x03f6
|
||||
#define HDC_PRIMARY_IRQ 14
|
||||
#define HDC_SECONDARY_BASE 0x0170
|
||||
#define HDC_SECONDARY_SIDE 0x0376
|
||||
#define HDC_SECONDARY_IRQ 15
|
||||
#define HDC_TERTIARY_BASE 0x01E8
|
||||
#define HDC_TERTIARY_SIDE 0x03EE
|
||||
#define HDC_TERTIARY_BASE 0x01e8
|
||||
#define HDC_TERTIARY_SIDE 0x03ee
|
||||
#define HDC_TERTIARY_IRQ 11
|
||||
#define HDC_QUATERNARY_BASE 0x0168
|
||||
#define HDC_QUATERNARY_SIDE 0x036E
|
||||
#define HDC_QUATERNARY_SIDE 0x036e
|
||||
#define HDC_QUATERNARY_IRQ 10
|
||||
|
||||
enum {
|
||||
@@ -121,11 +124,11 @@ typedef struct ide_s {
|
||||
double pending_delay;
|
||||
|
||||
#ifdef SCSI_DEVICE_H
|
||||
int (*get_max)(int ide_has_dma, int type);
|
||||
int (*get_timings)(int ide_has_dma, int type);
|
||||
void (*identify)(struct ide_s *ide, int ide_has_dma);
|
||||
void (*stop)(scsi_common_t *sc);
|
||||
void (*packet_command)(scsi_common_t *sc, uint8_t *cdb);
|
||||
int (*get_max)(const struct ide_s *ide, const int ide_has_dma, const int type);
|
||||
int (*get_timings)(const struct ide_s *ide, const int ide_has_dma, const int type);
|
||||
void (*identify)(const struct ide_s *ide, const int ide_has_dma);
|
||||
void (*stop)(const scsi_common_t *sc);
|
||||
void (*packet_command)(scsi_common_t *sc, const uint8_t *cdb);
|
||||
void (*device_reset)(scsi_common_t *sc);
|
||||
uint8_t (*phase_data_out)(scsi_common_t *sc);
|
||||
void (*command_stop)(scsi_common_t *sc);
|
||||
@@ -142,10 +145,8 @@ typedef struct ide_s {
|
||||
#endif
|
||||
} ide_t;
|
||||
|
||||
#ifdef EMU_HDC_H
|
||||
extern ide_t *ide_drives[IDE_NUM];
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Type:
|
||||
0 = PIO,
|
||||
|
||||
@@ -90,6 +90,7 @@ enum {
|
||||
typedef struct hdd_preset_t {
|
||||
const char *name;
|
||||
const char *internal_name;
|
||||
const char *model;
|
||||
uint32_t zones;
|
||||
uint32_t avg_spt;
|
||||
uint32_t heads;
|
||||
@@ -147,7 +148,7 @@ typedef struct hard_disk_t {
|
||||
uint8_t ide_channel;
|
||||
uint8_t scsi_id;
|
||||
};
|
||||
uint8_t bus;
|
||||
uint8_t bus_type;
|
||||
uint8_t bus_mode; /* Bit 0 = PIO suported;
|
||||
Bit 1 = DMA supportd. */
|
||||
uint8_t wp; /* Disk has been mounted READ-ONLY */
|
||||
@@ -165,6 +166,7 @@ typedef struct hard_disk_t {
|
||||
uint32_t spt;
|
||||
uint32_t hpc; /* Physical geometry parameters */
|
||||
uint32_t tracks;
|
||||
const char *model;
|
||||
|
||||
hdd_zone_t zones[HDD_MAX_ZONES];
|
||||
uint32_t num_zones;
|
||||
@@ -197,12 +199,12 @@ extern int hdd_is_valid(int c);
|
||||
|
||||
extern void hdd_image_init(void);
|
||||
extern int hdd_image_load(int id);
|
||||
extern void hdd_image_seek(uint8_t id, uint32_t sector);
|
||||
extern void hdd_image_read(uint8_t id, uint32_t sector, uint32_t count, uint8_t *buffer);
|
||||
extern int hdd_image_seek(uint8_t id, uint32_t sector);
|
||||
extern int hdd_image_read(uint8_t id, uint32_t sector, uint32_t count, uint8_t *buffer);
|
||||
extern int hdd_image_read_ex(uint8_t id, uint32_t sector, uint32_t count, uint8_t *buffer);
|
||||
extern void hdd_image_write(uint8_t id, uint32_t sector, uint32_t count, uint8_t *buffer);
|
||||
extern int hdd_image_write(uint8_t id, uint32_t sector, uint32_t count, uint8_t *buffer);
|
||||
extern int hdd_image_write_ex(uint8_t id, uint32_t sector, uint32_t count, uint8_t *buffer);
|
||||
extern void hdd_image_zero(uint8_t id, uint32_t sector, uint32_t count);
|
||||
extern int hdd_image_zero(uint8_t id, uint32_t sector, uint32_t count);
|
||||
extern int hdd_image_zero_ex(uint8_t id, uint32_t sector, uint32_t count);
|
||||
extern uint32_t hdd_image_get_last_sector(uint8_t id);
|
||||
extern uint32_t hdd_image_get_pos(uint8_t id);
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
* Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
*
|
||||
* Copyright 2008-2019 Sarah Walker.
|
||||
* Copyright 2016-2019 Miran Grca.
|
||||
* Copyright 2016-2025 Miran Grca.
|
||||
* Copyright 2017-2019 Fred N. van Kempen.
|
||||
*/
|
||||
|
||||
@@ -197,6 +197,8 @@ extern "C" {
|
||||
extern uint8_t keyboard_mode;
|
||||
extern int keyboard_scan;
|
||||
|
||||
extern uint16_t scancode_map[768];
|
||||
|
||||
extern void (*keyboard_send)(uint16_t val);
|
||||
extern void kbd_adddata_process(uint16_t val, void (*adddata)(uint16_t val));
|
||||
|
||||
@@ -222,34 +224,34 @@ 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;
|
||||
# if defined(DEV_BRANCH) && defined(USE_LASERXT)
|
||||
# ifdef USE_LASERXT
|
||||
extern const device_t keyboard_xt_lxt3_device;
|
||||
# endif /*defined(DEV_BRANCH) && defined(USE_LASERXT) */
|
||||
# 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_siemens_device;
|
||||
extern const device_t keyboard_at_ami_device;
|
||||
extern const device_t keyboard_at_compaq_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_at_olivetti_device;
|
||||
extern const device_t keyboard_at_ncr_device;
|
||||
extern const device_t keyboard_at_compaq_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_holtek_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_olivetti_device;
|
||||
extern const device_t keyboard_ps2_phoenix_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;
|
||||
@@ -288,6 +290,9 @@ 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);
|
||||
extern atkbc_dev_t *kbc_at_dev_init(uint8_t inst);
|
||||
/* This is so we can disambiguate scan codes that would otherwise conflict and get
|
||||
passed on incorrectly. */
|
||||
extern uint16_t convert_scan_code(uint16_t scan_code);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -6,42 +6,42 @@
|
||||
*
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Main include file for the application.
|
||||
*
|
||||
*
|
||||
* New logging system handler header.
|
||||
*
|
||||
* Authors: Miran Grca, <mgrca8@gmail.com>
|
||||
* Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Connor Hyde, <mario64crashed@gmail.com, nomorestarfrost@gmail.com>
|
||||
*
|
||||
* Copyright 2021 Miran Grca.
|
||||
* Copyright 2021 Fred N. van Kempen.
|
||||
* Copyright 2021-25 Miran Grca.
|
||||
* Copyright 2021-25 Fred N. van Kempen.
|
||||
* Copyright 2025 Connor Hyde.
|
||||
*/
|
||||
|
||||
#ifndef EMU_LOG_H
|
||||
#define EMU_LOG_H
|
||||
|
||||
#ifndef RELEASE_BUILD
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
#define LOG_SIZE_BUFFER 1024 /* 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 */
|
||||
|
||||
/* Function prototypes. */
|
||||
extern void log_set_suppr_seen(void *priv, int suppr_seen);
|
||||
extern void log_set_dev_name(void *priv, char *dev_name);
|
||||
# ifdef HAVE_STDARG_H
|
||||
#ifndef RELEASE_BUILD
|
||||
extern void log_out(void *priv, const char *fmt, va_list);
|
||||
extern void log_out_cyclic(void* priv, const char *fmt, va_list);
|
||||
#endif /*RELEASE_BUILD*/
|
||||
extern void log_fatal(void *priv, const char *fmt, ...);
|
||||
# endif
|
||||
extern void *log_open(char *dev_name);
|
||||
extern void *log_open(const char *dev_name);
|
||||
extern void *log_open_cyclic(const char *dev_name);
|
||||
extern void log_close(void *priv);
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
|
||||
#else
|
||||
# define log_fatal(priv, fmt, ...) fatal(fmt, ...)
|
||||
#endif /*RELEASE_BUILD*/
|
||||
|
||||
#endif /*EMU_LOG_H*/
|
||||
|
||||
@@ -31,33 +31,33 @@ typedef struct lpt_device_t {
|
||||
} lpt_device_t;
|
||||
|
||||
extern void lpt_init(void);
|
||||
extern void lpt_port_init(int i, uint16_t port);
|
||||
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_init(a) lpt_port_init(0, a)
|
||||
#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_init(a) lpt_port_init(1, a)
|
||||
#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_init(a) lpt_port_init(2, a)
|
||||
#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_init(a) lpt_port_init(3, a)
|
||||
#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_init(a) lpt_port_init(4, a)
|
||||
#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_init(a) lpt_port_init(5, a)
|
||||
#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
|
||||
|
||||
@@ -23,26 +23,25 @@
|
||||
#define EMU_MACHINE_H
|
||||
|
||||
/* Machine feature flags. */
|
||||
#define MACHINE_BUS_NONE 0x00000000 /* sys has no bus */
|
||||
#define MACHINE_BUS_NONE 0x00000000 /* sys has no bus */
|
||||
/* Feature flags for BUS'es. */
|
||||
#define MACHINE_BUS_ISA 0x00000001 /* sys has ISA bus */
|
||||
#define MACHINE_BUS_CASSETTE 0x00000002 /* sys has cassette port */
|
||||
#define MACHINE_BUS_CARTRIDGE 0x00000004 /* sys has two cartridge bays */
|
||||
#define MACHINE_BUS_PCJR 0x00000008 /* sys has PCjr sidecar bus */
|
||||
#define MACHINE_BUS_DM_KBC 0x00000010 /* system has keyboard controller that supports
|
||||
both XT and AT keyboards */
|
||||
#define MACHINE_BUS_CASSETTE 0x00000001 /* sys has cassette port */
|
||||
#define MACHINE_BUS_SIDECAR 0x00000002 /* sys has PCjr sidecar bus */
|
||||
#define MACHINE_BUS_ISA 0x00000004 /* sys has ISA bus */
|
||||
#define MACHINE_BUS_XT_KBD 0x00000008 /* sys has an XT keyboard port */
|
||||
#define MACHINE_BUS_CBUS 0x00000010 /* sys has C-BUS bus */
|
||||
#define MACHINE_BUS_ISA16 0x00000020 /* sys has ISA16 bus - PC/AT architecture */
|
||||
#define MACHINE_BUS_CBUS 0x00000040 /* sys has C-BUS bus */
|
||||
#define MACHINE_BUS_PCMCIA 0x00000080 /* sys has PCMCIA bus */
|
||||
#define MACHINE_BUS_PS2_LATCH 0x00000100 /* system has PS/2 keyboard controller IRQ latch */
|
||||
#define MACHINE_BUS_AT_KBD 0x00000040 /* sys has an AT keyboard port */
|
||||
#define MACHINE_BUS_MCA 0x00000080 /* sys has MCA bus */
|
||||
#define MACHINE_BUS_MCA32 0x00000100 /* sys has MCA32 bus */
|
||||
#define MACHINE_BUS_PS2_PORTS 0x00000200 /* system has PS/2 keyboard and mouse ports */
|
||||
#define MACHINE_BUS_PS2 (MACHINE_BUS_PS2_LATCH | MACHINE_BUS_PS2_PORTS)
|
||||
#define MACHINE_BUS_HIL 0x00000400 /* system has HP HIL keyboard and mouse ports */
|
||||
#define MACHINE_BUS_EISA 0x00000800 /* sys has EISA bus */
|
||||
#define MACHINE_BUS_AT32 0x00001000 /* sys has Mylex AT/32 local bus */
|
||||
#define MACHINE_BUS_OLB 0x00002000 /* sys has OPTi local bus */
|
||||
#define MACHINE_BUS_VLB 0x00004000 /* sys has VL bus */
|
||||
#define MACHINE_BUS_MCA 0x00008000 /* sys has MCA bus */
|
||||
#define MACHINE_BUS_PS2 MACHINE_BUS_PS2_PORTS
|
||||
#define MACHINE_BUS_PCMCIA 0x00000400 /* sys has PCMCIA bus */
|
||||
#define MACHINE_BUS_HIL 0x00000800 /* system has HP HIL keyboard and mouse ports */
|
||||
#define MACHINE_BUS_EISA 0x00001000 /* sys has EISA bus */
|
||||
#define MACHINE_BUS_AT32 0x00002000 /* sys has Mylex AT/32 local bus */
|
||||
#define MACHINE_BUS_OLB 0x00004000 /* sys has OPTi local bus */
|
||||
#define MACHINE_BUS_VLB 0x00008000 /* sys has VL bus */
|
||||
#define MACHINE_BUS_PCI 0x00010000 /* sys has PCI bus */
|
||||
#define MACHINE_BUS_CARDBUS 0x00020000 /* sys has CardBus bus */
|
||||
#define MACHINE_BUS_USB 0x00040000 /* sys has USB bus */
|
||||
@@ -50,7 +49,6 @@
|
||||
#define MACHINE_BUS_AC97 0x00100000 /* sys has AC97 bus (ACR/AMR/CNR slot) */
|
||||
/* Aliases. */
|
||||
#define MACHINE_CASSETTE (MACHINE_BUS_CASSETTE) /* sys has cassette port */
|
||||
#define MACHINE_CARTRIDGE (MACHINE_BUS_CARTRIDGE) /* sys has two cartridge bays */
|
||||
/* Combined flags. */
|
||||
#define MACHINE_PC (MACHINE_BUS_ISA) /* sys is PC/XT-compatible (ISA) */
|
||||
#define MACHINE_AT (MACHINE_BUS_ISA | MACHINE_BUS_ISA16) /* sys is AT-compatible (ISA + ISA16) */
|
||||
@@ -69,18 +67,18 @@
|
||||
#define MACHINE_AGP (MACHINE_BUS_AGP | MACHINE_PCI) /* sys is AT-compatible with AGP */
|
||||
#define MACHINE_AGP98 (MACHINE_BUS_AGP | MACHINE_PCI98) /* sys is NEC PC-98x1 series with AGP (did that even exist?) */
|
||||
|
||||
#define MACHINE_PC5150 (MACHINE_PC | MACHINE_CASSETTE) /* sys is IBM PC 5150 */
|
||||
#define MACHINE_PCJR (MACHINE_PC | MACHINE_CASSETTE | MACHINE_CARTRIDGE) /* sys is PCjr */
|
||||
#define MACHINE_PS2 (MACHINE_AT | MACHINE_BUS_PS2) /* sys is PS/2 */
|
||||
#define MACHINE_PS2_MCA (MACHINE_MCA | MACHINE_BUS_PS2) /* sys is MCA PS/2 */
|
||||
#define MACHINE_PS2_VLB (MACHINE_VLB | MACHINE_BUS_PS2) /* sys is VLB PS/2 */
|
||||
#define MACHINE_PS2_PCI (MACHINE_PCI | MACHINE_BUS_PS2) /* sys is PCI PS/2 */
|
||||
#define MACHINE_PS2_PCIV (MACHINE_PCIV | MACHINE_BUS_PS2) /* sys is VLB/PCI PS/2 */
|
||||
#define MACHINE_PS2_AGP (MACHINE_AGP | MACHINE_BUS_PS2) /* sys is AGP PS/2 */
|
||||
#define MACHINE_PS2_A97 (MACHINE_PS2_AGP | MACHINE_BUS_AC97) /* sys is AGP/AC97 PS/2 */
|
||||
#define MACHINE_PS2_NOISA (MACHINE_PS2_AGP & ~MACHINE_AT) /* sys is AGP PS/2 without ISA */
|
||||
#define MACHINE_PS2_PCIONLY (MACHINE_PS2_NOISA & ~MACHINE_BUS_AGP) /* sys is PCI PS/2 without ISA */
|
||||
#define MACHINE_PS2_NOI97 (MACHINE_PS2_A97 & ~MACHINE_AT) /* sys is AGP/AC97 PS/2 without ISA */
|
||||
#define MACHINE_PC5150 (MACHINE_PC | MACHINE_CASSETTE) /* sys is IBM PC 5150 */
|
||||
#define MACHINE_PCJR (MACHINE_PC | MACHINE_CASSETTE | MACHINE_BUS_SIDECAR) /* sys is PCjr */
|
||||
#define MACHINE_PS2 (MACHINE_AT | MACHINE_BUS_PS2) /* sys is PS/2 */
|
||||
#define MACHINE_PS2_MCA (MACHINE_MCA | MACHINE_BUS_PS2) /* sys is MCA PS/2 */
|
||||
#define MACHINE_PS2_VLB (MACHINE_VLB | MACHINE_BUS_PS2) /* sys is VLB PS/2 */
|
||||
#define MACHINE_PS2_PCI (MACHINE_PCI | MACHINE_BUS_PS2) /* sys is PCI PS/2 */
|
||||
#define MACHINE_PS2_PCIV (MACHINE_PCIV | MACHINE_BUS_PS2) /* sys is VLB/PCI PS/2 */
|
||||
#define MACHINE_PS2_AGP (MACHINE_AGP | MACHINE_BUS_PS2) /* sys is AGP PS/2 */
|
||||
#define MACHINE_PS2_A97 (MACHINE_PS2_AGP | MACHINE_BUS_AC97) /* sys is AGP/AC97 PS/2 */
|
||||
#define MACHINE_PS2_NOISA (MACHINE_PS2_AGP & ~MACHINE_AT) /* sys is AGP PS/2 without ISA */
|
||||
#define MACHINE_PS2_PCIONLY (MACHINE_PS2_NOISA & ~MACHINE_BUS_AGP) /* sys is PCI PS/2 without ISA */
|
||||
#define MACHINE_PS2_NOI97 (MACHINE_PS2_A97 & ~MACHINE_AT) /* sys is AGP/AC97 PS/2 without ISA */
|
||||
/* Feature flags for miscellaneous internal devices. */
|
||||
#define MACHINE_FLAGS_NONE 0x00000000 /* sys has no int devices */
|
||||
#define MACHINE_SOFTFLOAT_ONLY 0x00000001 /* sys requires SoftFloat FPU */
|
||||
@@ -93,7 +91,8 @@
|
||||
#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_LPT_QUA 0x00000400 /* sys has int qua LPT */
|
||||
#define MACHINE_PS2_KBC 0x00000400 /* 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 */
|
||||
@@ -106,7 +105,7 @@
|
||||
#define MACHINE_APM 0x00080000 /* sys has APM */
|
||||
#define MACHINE_ACPI 0x00100000 /* sys has ACPI */
|
||||
#define MACHINE_HWM 0x00200000 /* sys has hw monitor */
|
||||
#define MACHINE_COREBOOT 0x00400000 /* sys has coreboot BIOS */
|
||||
#define MACHINE_CARTRIDGE 0x00400000 /* sys has cartridge bays */
|
||||
/* Feature flags for internal storage controllers. */
|
||||
#define MACHINE_MFM 0x00800000 /* sys has int MFM/RLL */
|
||||
#define MACHINE_XTA 0x01000000 /* sys has int XTA */
|
||||
@@ -173,20 +172,21 @@ enum {
|
||||
MACHINE_TYPE_486 = 8,
|
||||
MACHINE_TYPE_486_S2 = 9,
|
||||
MACHINE_TYPE_486_S3 = 10,
|
||||
MACHINE_TYPE_486_MISC = 11,
|
||||
MACHINE_TYPE_SOCKET4 = 12,
|
||||
MACHINE_TYPE_SOCKET5 = 13,
|
||||
MACHINE_TYPE_SOCKET7_3V = 14,
|
||||
MACHINE_TYPE_SOCKET7 = 15,
|
||||
MACHINE_TYPE_SOCKETS7 = 16,
|
||||
MACHINE_TYPE_SOCKET8 = 17,
|
||||
MACHINE_TYPE_SLOT1 = 18,
|
||||
MACHINE_TYPE_SLOT1_2 = 19,
|
||||
MACHINE_TYPE_SLOT1_370 = 20,
|
||||
MACHINE_TYPE_SLOT2 = 21,
|
||||
MACHINE_TYPE_SOCKET370 = 22,
|
||||
MACHINE_TYPE_MISC = 23,
|
||||
MACHINE_TYPE_MAX = 24
|
||||
MACHINE_TYPE_486_S3_PCI = 11,
|
||||
MACHINE_TYPE_486_MISC = 12,
|
||||
MACHINE_TYPE_SOCKET4 = 13,
|
||||
MACHINE_TYPE_SOCKET5 = 14,
|
||||
MACHINE_TYPE_SOCKET7_3V = 15,
|
||||
MACHINE_TYPE_SOCKET7 = 16,
|
||||
MACHINE_TYPE_SOCKETS7 = 17,
|
||||
MACHINE_TYPE_SOCKET8 = 18,
|
||||
MACHINE_TYPE_SLOT1 = 19,
|
||||
MACHINE_TYPE_SLOT1_2 = 20,
|
||||
MACHINE_TYPE_SLOT1_370 = 21,
|
||||
MACHINE_TYPE_SLOT2 = 22,
|
||||
MACHINE_TYPE_SOCKET370 = 23,
|
||||
MACHINE_TYPE_MISC = 24,
|
||||
MACHINE_TYPE_MAX = 25
|
||||
};
|
||||
|
||||
enum {
|
||||
@@ -320,27 +320,29 @@ typedef struct _machine_ {
|
||||
int ram_granularity;
|
||||
int nvrmask;
|
||||
#ifdef EMU_DEVICE_H
|
||||
const device_t *kbc_device;
|
||||
const device_t *kbc_device;
|
||||
#else
|
||||
void *kbc_device;
|
||||
void *kbc_device;
|
||||
#endif /* EMU_DEVICE_H */
|
||||
uint8_t kbc_p1;
|
||||
uint32_t gpio;
|
||||
uint32_t gpio_acpi;
|
||||
uintptr_t kbc_params;
|
||||
/* Bits 23-16: XOR mask, bits 15-8: OR mask, bits 7-0: AND mask. */
|
||||
uint32_t kbc_p1;
|
||||
uint32_t gpio;
|
||||
uint32_t gpio_acpi;
|
||||
#ifdef EMU_DEVICE_H
|
||||
const device_t *device;
|
||||
const device_t *fdc_device;
|
||||
const device_t *sio_device;
|
||||
const device_t *vid_device;
|
||||
const device_t *snd_device;
|
||||
const device_t *net_device;
|
||||
const device_t *device;
|
||||
const device_t *fdc_device;
|
||||
const device_t *sio_device;
|
||||
const device_t *vid_device;
|
||||
const device_t *snd_device;
|
||||
const device_t *net_device;
|
||||
#else
|
||||
void *device;
|
||||
void *fdc_device;
|
||||
void *sio_device;
|
||||
void *vid_device;
|
||||
void *snd_device;
|
||||
void *net_device;
|
||||
void *device;
|
||||
void *fdc_device;
|
||||
void *sio_device;
|
||||
void *vid_device;
|
||||
void *snd_device;
|
||||
void *net_device;
|
||||
#endif
|
||||
} machine_t;
|
||||
|
||||
@@ -358,6 +360,7 @@ extern int machine_available(int m);
|
||||
extern const char *machine_getname(void);
|
||||
extern const char *machine_getname_ex(int m);
|
||||
extern const char *machine_get_internal_name(void);
|
||||
extern const char *machine_get_nvr_name(void);
|
||||
extern int machine_get_machine_from_internal_name(const char *s);
|
||||
extern void machine_init(void);
|
||||
#ifdef EMU_DEVICE_H
|
||||
@@ -370,6 +373,7 @@ extern const device_t *machine_get_snd_device(int m);
|
||||
extern const device_t *machine_get_net_device(int m);
|
||||
#endif
|
||||
extern const char *machine_get_internal_name_ex(int m);
|
||||
extern const char *machine_get_nvr_name_ex(int m);
|
||||
extern int machine_get_nvrmask(int m);
|
||||
extern int machine_has_flags(int m, int flags);
|
||||
extern int machine_has_bus(int m, int bus_flags);
|
||||
@@ -437,9 +441,9 @@ extern int machine_at_ibmxt286_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
|
||||
#if defined(DEV_BRANCH) && defined(USE_OPEN_AT)
|
||||
#ifdef USE_OPEN_AT
|
||||
extern int machine_at_openat_init(const machine_t *);
|
||||
#endif
|
||||
#endif /* USE_OPEN_AT */
|
||||
|
||||
/* m_at_286_386sx.c */
|
||||
extern int machine_at_tg286m_init(const machine_t *);
|
||||
@@ -450,6 +454,7 @@ extern int machine_at_mr286_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 *);
|
||||
|
||||
extern int machine_at_quadt386sx_init(const machine_t *);
|
||||
|
||||
@@ -468,9 +473,9 @@ extern int machine_at_deskmaster286_init(const machine_t *);
|
||||
extern int machine_at_pc8_init(const machine_t *);
|
||||
extern int machine_at_3302_init(const machine_t *);
|
||||
|
||||
#if defined(DEV_BRANCH) && defined(USE_OLIVETTI)
|
||||
#ifdef USE_OLIVETTI
|
||||
extern int machine_at_m290_init(const machine_t *);
|
||||
#endif
|
||||
#endif /* USE_OLIVETTI */
|
||||
|
||||
extern int machine_at_shuttle386sx_init(const machine_t *);
|
||||
extern int machine_at_adi386sx_init(const machine_t *);
|
||||
@@ -593,6 +598,7 @@ extern int machine_at_pcm5330_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 *);
|
||||
extern int machine_at_atc1415_init(const machine_t *);
|
||||
extern int machine_at_actionpc2600_init(const machine_t *);
|
||||
extern int machine_at_actiontower8400_init(const machine_t *);
|
||||
@@ -631,9 +637,11 @@ extern int machine_at_valuepointp60_init(const machine_t *);
|
||||
extern int machine_at_revenge_init(const machine_t *);
|
||||
extern int machine_at_586is_init(const machine_t *);
|
||||
extern int machine_at_pb520r_init(const machine_t *);
|
||||
extern int machine_at_m5pi_init(const machine_t *);
|
||||
|
||||
extern int machine_at_excalibur_init(const machine_t *);
|
||||
|
||||
extern int machine_at_globalyst330_p5_init(const machine_t *);
|
||||
extern int machine_at_p5vl_init(const machine_t *);
|
||||
|
||||
extern int machine_at_excaliburpci2_init(const machine_t *);
|
||||
@@ -643,6 +651,7 @@ extern int machine_at_p5sp4_init(const machine_t *);
|
||||
extern int machine_at_plato_init(const machine_t *);
|
||||
extern int machine_at_dellplato_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 *);
|
||||
extern int machine_at_tek932_init(const machine_t *);
|
||||
|
||||
@@ -687,7 +696,7 @@ extern int machine_at_8500tuc_init(const machine_t *);
|
||||
extern int machine_at_p55t2s_init(const machine_t *);
|
||||
|
||||
extern int machine_at_p5vxb_init(const machine_t *);
|
||||
extern int machine_at_gw2kte_init(const machine_t *);
|
||||
extern int machine_at_gw2kma_init(const machine_t *);
|
||||
|
||||
extern int machine_at_ap5s_init(const machine_t *);
|
||||
extern int machine_at_pc140_6260_init(const machine_t *);
|
||||
@@ -722,13 +731,14 @@ extern int machine_at_pb680_init(const machine_t *);
|
||||
extern int machine_at_pb810_init(const machine_t *);
|
||||
extern int machine_at_mb520n_init(const machine_t *);
|
||||
extern int machine_at_i430vx_init(const machine_t *);
|
||||
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 *);
|
||||
#if defined(DEV_BRANCH) && defined(USE_AN430TX)
|
||||
#ifdef USE_AN430TX
|
||||
extern int machine_at_an430tx_init(const machine_t *);
|
||||
#endif
|
||||
#endif /* USE_AN430TX */
|
||||
extern int machine_at_ym430tx_init(const machine_t *);
|
||||
extern int machine_at_thunderbolt_init(const machine_t *);
|
||||
extern int machine_at_mb540n_init(const machine_t *);
|
||||
@@ -740,6 +750,7 @@ extern int machine_at_tomahawk_init(const machine_t *);
|
||||
extern int machine_at_ficva502_init(const machine_t *);
|
||||
|
||||
extern int machine_at_ficpa2012_init(const machine_t *);
|
||||
extern int machine_at_via809ds_init(const machine_t *);
|
||||
|
||||
extern int machine_at_r534f_init(const machine_t *);
|
||||
extern int machine_at_ms5146_init(const machine_t *);
|
||||
@@ -802,6 +813,7 @@ extern int machine_at_p2bls_init(const machine_t *);
|
||||
extern int machine_at_lgibmx7g_init(const machine_t *);
|
||||
extern int machine_at_p3bf_init(const machine_t *);
|
||||
extern int machine_at_bf6_init(const machine_t *);
|
||||
extern int machine_at_bx6_init(const machine_t *);
|
||||
extern int machine_at_ax6bc_init(const machine_t *);
|
||||
extern int machine_at_atc6310bxii_init(const machine_t *);
|
||||
extern int machine_at_686bx_init(const machine_t *);
|
||||
@@ -841,6 +853,7 @@ extern int machine_at_6via90ap_init(const machine_t *);
|
||||
extern int machine_at_s1857_init(const machine_t *);
|
||||
extern int machine_at_p6bap_init(const machine_t *);
|
||||
extern int machine_at_p6bat_init(const machine_t *);
|
||||
extern int machine_at_prosignias31x_bx_init(const machine_t *);
|
||||
|
||||
/* m_at_misc.c */
|
||||
extern int machine_at_vpc2007_init(const machine_t *);
|
||||
@@ -848,6 +861,9 @@ extern int machine_at_vpc2007_init(const machine_t *);
|
||||
/* m_at_t3100e.c */
|
||||
extern int machine_at_t3100e_init(const machine_t *);
|
||||
|
||||
/* m_at_grid.c */
|
||||
extern int machine_at_grid1520_init(const machine_t *);
|
||||
|
||||
/* m_elt.c */
|
||||
extern int machine_elt_init(const machine_t *);
|
||||
|
||||
@@ -910,6 +926,7 @@ extern int machine_xt86_init(const machine_t *);
|
||||
|
||||
extern int machine_xt_americxt_init(const machine_t *);
|
||||
extern int machine_xt_amixt_init(const machine_t *);
|
||||
extern int machine_xt_ataripc3_init(const machine_t *);
|
||||
extern int machine_xt_dtk_init(const machine_t *);
|
||||
extern int machine_xt_jukopc_init(const machine_t *);
|
||||
extern int machine_xt_openxt_init(const machine_t *);
|
||||
@@ -937,16 +954,17 @@ extern int machine_xt_iskra3104_init(const machine_t *);
|
||||
extern int machine_xt_pravetz16_imko4_init(const machine_t *);
|
||||
extern int machine_xt_pravetz16s_cpu12p_init(const machine_t *);
|
||||
extern int machine_xt_micoms_xl7turbo_init(const machine_t *);
|
||||
extern int machine_xt_maz1016_init(const machine_t *);
|
||||
|
||||
/* m_xt_compaq.c */
|
||||
extern int machine_xt_compaq_deskpro_init(const machine_t *);
|
||||
extern int machine_xt_compaq_portable_init(const machine_t *);
|
||||
|
||||
/* m_xt_laserxt.c */
|
||||
#if defined(DEV_BRANCH) && defined(USE_LASERXT)
|
||||
#ifdef USE_LASERXT
|
||||
extern int machine_xt_laserxt_init(const machine_t *);
|
||||
extern int machine_xt_lxt3_init(const machine_t *);
|
||||
#endif
|
||||
#endif /* USE_LASERXT */
|
||||
|
||||
/* m_xt_philips.c */
|
||||
extern int machine_xt_p3105_init(const machine_t *);
|
||||
|
||||
@@ -179,6 +179,7 @@ typedef struct _mem_mapping_ {
|
||||
uint32_t base;
|
||||
uint32_t size;
|
||||
|
||||
uint32_t base_ignore;
|
||||
uint32_t mask;
|
||||
|
||||
uint8_t (*read_b)(uint32_t addr, void *priv);
|
||||
@@ -400,6 +401,7 @@ extern void mem_mapping_set_p(mem_mapping_t *, void *priv);
|
||||
|
||||
extern void mem_mapping_set_addr(mem_mapping_t *,
|
||||
uint32_t base, uint32_t size);
|
||||
extern void mem_mapping_set_base_ignore(mem_mapping_t *, uint32_t base_ignore);
|
||||
extern void mem_mapping_set_exec(mem_mapping_t *, uint8_t *exec);
|
||||
extern void mem_mapping_set_mask(mem_mapping_t *, uint32_t mask);
|
||||
extern void mem_mapping_disable(mem_mapping_t *);
|
||||
@@ -446,6 +448,7 @@ extern void mem_flush_write_page(uint32_t addr, uint32_t virt);
|
||||
extern void mem_reset_page_blocks(void);
|
||||
|
||||
extern void flushmmucache(void);
|
||||
extern void flushmmucache_pc(void);
|
||||
extern void flushmmucache_nopc(void);
|
||||
|
||||
extern void mem_debug_check_addr(uint32_t addr, int write);
|
||||
@@ -457,7 +460,9 @@ extern void mem_init(void);
|
||||
extern void mem_close(void);
|
||||
extern void mem_reset(void);
|
||||
extern void mem_remap_top_ex(int kb, uint32_t start);
|
||||
extern void mem_remap_top_ex_nomid(int kb, uint32_t start);
|
||||
extern void mem_remap_top(int kb);
|
||||
extern void mem_remap_top_nomid(int kb);
|
||||
|
||||
extern void umc_smram_recalc(uint32_t start, int set);
|
||||
|
||||
|
||||
@@ -104,18 +104,18 @@ extern void midi_in_sysex(uint8_t *buffer, uint32_t len);
|
||||
#ifdef EMU_DEVICE_H
|
||||
extern const device_t rtmidi_output_device;
|
||||
extern const device_t rtmidi_input_device;
|
||||
# if defined(DEV_BRANCH) && defined(USE_OPL4ML)
|
||||
# ifdef USE_OPL4ML
|
||||
extern const device_t opl4_midi_device;
|
||||
# endif
|
||||
# endif /* USE_OPL4ML */
|
||||
# ifdef USE_FLUIDSYNTH
|
||||
extern const device_t fluidsynth_device;
|
||||
# endif
|
||||
# endif /* USE_FLUIDSYNTH */
|
||||
# ifdef USE_MUNT
|
||||
extern const device_t mt32_old_device;
|
||||
extern const device_t mt32_new_device;
|
||||
extern const device_t cm32l_device;
|
||||
extern const device_t cm32ln_device;
|
||||
# endif
|
||||
# endif /* USE_MUNT */
|
||||
#endif
|
||||
|
||||
#endif /*EMU_SOUND_MIDI_H*/
|
||||
|
||||
@@ -9,13 +9,13 @@
|
||||
* Implementation of a generic Magneto-Optical Disk drive
|
||||
* commands, for both ATAPI and SCSI usage.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Natalia Portillo <claunia@claunia.com>
|
||||
* Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
*
|
||||
* Copyright 2020 Miran Grca.
|
||||
* Copyright 2020-2025 Natalia Portillo.
|
||||
* Copyright 2020-2025 Miran Grca.
|
||||
* Copyright 2020-2025 Fred N. van Kempen
|
||||
*/
|
||||
|
||||
#ifndef EMU_MO_H
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
#define MO_TIME 10.0
|
||||
|
||||
#define MO_IMAGE_HISTORY 4
|
||||
#define MO_IMAGE_HISTORY 10
|
||||
|
||||
typedef struct mo_type_t {
|
||||
uint32_t sectors;
|
||||
@@ -91,98 +91,87 @@ enum {
|
||||
};
|
||||
|
||||
typedef struct mo_drive_t {
|
||||
uint8_t id;
|
||||
uint8_t id;
|
||||
|
||||
union {
|
||||
uint8_t res;
|
||||
uint8_t res0; /* Reserved for other ID's. */
|
||||
uint8_t res1;
|
||||
uint8_t ide_channel;
|
||||
uint8_t scsi_device_id;
|
||||
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;
|
||||
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;
|
||||
FILE * fp;
|
||||
void * priv;
|
||||
|
||||
char image_path[1024];
|
||||
char prev_image_path[1024];
|
||||
char image_path[1024];
|
||||
char prev_image_path[1024];
|
||||
|
||||
char *image_history[MO_IMAGE_HISTORY];
|
||||
|
||||
uint32_t type;
|
||||
uint32_t medium_size;
|
||||
uint32_t base;
|
||||
uint16_t sector_size;
|
||||
char * image_history[MO_IMAGE_HISTORY];
|
||||
|
||||
uint32_t type;
|
||||
uint32_t medium_size;
|
||||
uint32_t base;
|
||||
uint16_t sector_size;
|
||||
} 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
|
||||
|
||||
uint8_t *buffer;
|
||||
uint8_t atapi_cdb[16];
|
||||
uint8_t current_cdb[16];
|
||||
uint8_t sense[256];
|
||||
void * log;
|
||||
|
||||
#ifdef ANCIENT_CODE
|
||||
/* Task file. */
|
||||
uint8_t features;
|
||||
uint8_t phase;
|
||||
uint16_t request_length;
|
||||
uint8_t status;
|
||||
uint8_t error;
|
||||
uint16_t pad;
|
||||
uint32_t pos;
|
||||
#endif
|
||||
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;
|
||||
uint8_t id;
|
||||
uint8_t cur_lun;
|
||||
uint8_t pad0;
|
||||
uint8_t pad1;
|
||||
|
||||
uint16_t max_transfer_len;
|
||||
uint16_t pad2;
|
||||
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 pad3;
|
||||
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 sector_pos;
|
||||
uint32_t sector_len;
|
||||
uint32_t packet_len;
|
||||
|
||||
double callback;
|
||||
double callback;
|
||||
|
||||
uint8_t (*ven_cmd)(void *sc, uint8_t *cdb, int32_t *BufLen);
|
||||
} mo_t;
|
||||
|
||||
extern mo_t *mo[MO_NUM];
|
||||
extern mo_drive_t mo_drives[MO_NUM];
|
||||
#if 0
|
||||
extern uint8_t atapi_mo_drives[8];
|
||||
extern uint8_t scsi_mo_drives[16];
|
||||
#endif
|
||||
extern mo_drive_t mo_drives[MO_NUM];
|
||||
|
||||
#define mo_sense_error dev->sense[0]
|
||||
#define mo_sense_key dev->sense[2]
|
||||
#define mo_info *(uint32_t *) &(dev->sense[3])
|
||||
#define mo_asc dev->sense[12]
|
||||
#define mo_ascq dev->sense[13]
|
||||
|
||||
@@ -190,15 +179,16 @@ extern uint8_t scsi_mo_drives[16];
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern void mo_disk_close(mo_t *dev);
|
||||
extern void mo_disk_reload(mo_t *dev);
|
||||
extern void mo_disk_close(const mo_t *dev);
|
||||
extern void mo_disk_reload(const mo_t *dev);
|
||||
extern void mo_insert(mo_t *dev);
|
||||
|
||||
extern void mo_global_init(void);
|
||||
extern void mo_hard_reset(void);
|
||||
|
||||
extern void mo_reset(scsi_common_t *sc);
|
||||
extern int mo_load(mo_t *dev, char *fn);
|
||||
extern int mo_is_empty(const uint8_t id);
|
||||
extern void mo_load(const mo_t *dev, const char *fn, const int skip_insert);
|
||||
extern void mo_close(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -71,8 +71,10 @@ extern const device_t mouse_mssystems_device;
|
||||
extern const device_t mouse_msserial_device;
|
||||
extern const device_t mouse_ltserial_device;
|
||||
extern const device_t mouse_ps2_device;
|
||||
# ifdef USE_WACOM
|
||||
extern const device_t mouse_wacom_device;
|
||||
extern const device_t mouse_wacom_artpad_device;
|
||||
# endif
|
||||
extern const device_t mouse_mtouch_device;
|
||||
#endif
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ enum {
|
||||
NE2K_NE2000_COMPAT = 4, /* 16-bit ISA NE2000-Compatible */
|
||||
NE2K_NE2000_COMPAT_8BIT = 5, /* 8-bit ISA NE2000-Compatible, like: https://github.com/skiselev/isa8_eth */
|
||||
NE2K_ETHERNEXT_MC = 6, /* 16-bit MCA EtherNext/MC */
|
||||
NE2K_RTL8019AS = 7, /* 16-bit ISA PnP Realtek 8019AS */
|
||||
NE2K_RTL8019AS_PNP = 7, /* 16-bit ISA PnP Realtek 8019AS */
|
||||
NE2K_DE220P = 8, /* 16-bit ISA PnP D-Link DE-220P */
|
||||
NE2K_RTL8029AS = 9, /* 32-bit PCI Realtek 8029AS */
|
||||
/* Check nic_init() if adding items after this point. */
|
||||
|
||||
@@ -213,7 +213,7 @@ extern const device_t ne2000_device;
|
||||
extern const device_t ne2000_compat_device;
|
||||
extern const device_t ne2000_compat_8bit_device;
|
||||
extern const device_t ethernext_mc_device;
|
||||
extern const device_t rtl8019as_device;
|
||||
extern const device_t rtl8019as_pnp_device;
|
||||
extern const device_t de220p_device;
|
||||
extern const device_t rtl8029as_device;
|
||||
|
||||
|
||||
84
src/include/86box/nv/vid_nv_rivatimer.h
Normal file
84
src/include/86box/nv/vid_nv_rivatimer.h
Normal file
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
* Fast, high-frequency, guest CPU-independent timer for Riva emulation.
|
||||
*
|
||||
*
|
||||
* Authors: Connor Hyde, <mario64crashed@gmail.com> I need a better email address ;^)
|
||||
*
|
||||
* Copyright 2024-2025 starfrost
|
||||
*/
|
||||
|
||||
/*
|
||||
RivaTimer
|
||||
|
||||
This is a fast, high-frequency, guest CPU-independent timer.
|
||||
|
||||
The main 86box timer is dependent on the TSC (time-stamp counter) register of the emulated CPU core.
|
||||
This is fine for most purposes and has advantages in the fields of synchronisation and integrates neatly with
|
||||
the clock dividers of the PC architecture, but in the case of the RIVA 128 it does not particularly suffice
|
||||
(although it can be made to work with various techniques) since the clock source on the RIVA 128 is on the board itself
|
||||
and the GPU has several different clocks that control different parts of the GPU (e.g., PTIMER runs on the memory clock but the core gpu is using the pixel clock).
|
||||
|
||||
As faster graphics cards that offload more and more of the 3D graphics pipeline are emulated in the future, more and more work needs to be done by the emulator and
|
||||
issues of synchronisation with a host CPU will simply make that work harder. Some features that are required for
|
||||
|
||||
Architecture Brand Name 3D Features
|
||||
NV1 (1995) NV1 Some weird URBS rectangle crap but feature set generally similar to nv3 but a bit worse
|
||||
NV3 (1997) RIVA 128 (ZX) Triangle setup, edge-slope calculations, edge interpolation, span-slope calculations, span interpolation (Color-buffer, z-buffer, texture mapping, filtering)
|
||||
NV4 (1998) RIVA TNT NV3 + 2x1 pixel pipelines + 32-bit colour + larger textures + trilinear + more ram (16mb)
|
||||
NV5 (1999) RIVA TNT2 NV4 + higher clock speed
|
||||
NV10 (1999) GeForce 256 NV5 + initial geometry transformation + lighting (8x lights) + MPEG-2 motion compensation + 4x1 pixel pipelines
|
||||
NV15 (2000) GeForce 2 NV10 + First attempt at programmability + 4x2 pixel pipelines
|
||||
NV20 (2001) GeForce 3 Programmable shaders!
|
||||
|
||||
As you can see, the performance basically exponentially increases over a period of only 4 years.
|
||||
|
||||
So I decided to create this timer that is completely separate from the CPU Core.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <86box/86box.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <Windows.h>
|
||||
// Linux & MacOS should have the same API since OSX 10.12
|
||||
#else
|
||||
#include <time.h>
|
||||
#endif
|
||||
|
||||
typedef struct rivatimer_s
|
||||
{
|
||||
struct rivatimer_s* prev; // Previous Rivatimer
|
||||
double period; // Period in uS before firing
|
||||
double value; // The current value of the rivatimer
|
||||
bool running; // Is this RivaTimer running?
|
||||
struct rivatimer_s* next; // Next RivaTimer
|
||||
void (*callback)(double real_time); // Callback to call on fire
|
||||
#ifdef _WIN32
|
||||
LARGE_INTEGER starting_time; // Starting time.
|
||||
#else
|
||||
struct timespec starting_time; // Starting time.
|
||||
#endif
|
||||
double time; // Accumulated time in uS.
|
||||
} rivatimer_t;
|
||||
|
||||
void rivatimer_init(void); // Initialise the Rivatimer.
|
||||
rivatimer_t* rivatimer_create(double period, void (*callback)(double real_time));
|
||||
void rivatimer_destroy(rivatimer_t* rivatimer_ptr);
|
||||
|
||||
void rivatimer_update_all(void);
|
||||
void rivatimer_start(rivatimer_t* rivatimer_ptr);
|
||||
void rivatimer_stop(rivatimer_t* rivatimer_ptr);
|
||||
double rivatimer_get_time(rivatimer_t* rivatimer_ptr);
|
||||
void rivatimer_set_callback(rivatimer_t* rivatimer_ptr, void (*callback)(double real_time));
|
||||
void rivatimer_set_period(rivatimer_t* rivatimer_ptr, double period);
|
||||
@@ -60,6 +60,7 @@
|
||||
#define TIME_SYNC_ENABLED 1
|
||||
#define TIME_SYNC_UTC 2
|
||||
|
||||
#ifdef _TIMER_H_
|
||||
/* Define a generic RTC/NVRAM device. */
|
||||
typedef struct _nvr_ {
|
||||
char *fn; /* pathname of image file */
|
||||
@@ -104,8 +105,6 @@ extern const device_t elt_nvr_device;
|
||||
extern void rtc_tick(void);
|
||||
|
||||
extern void nvr_init(nvr_t *);
|
||||
extern char *nvr_path(char *str);
|
||||
extern FILE *nvr_fopen(char *str, char *mode);
|
||||
extern int nvr_load(void);
|
||||
extern void nvr_close(void);
|
||||
extern void nvr_set_ven_save(void (*ven_save)(void));
|
||||
@@ -114,8 +113,8 @@ extern int nvr_save(void);
|
||||
extern int nvr_is_leap(int year);
|
||||
extern int nvr_get_days(int month, int year);
|
||||
extern void nvr_time_sync(void);
|
||||
extern void nvr_time_get(struct tm *);
|
||||
extern void nvr_time_set(struct tm *);
|
||||
extern void nvr_time_get(void *priv);
|
||||
extern void nvr_time_set(void *priv);
|
||||
|
||||
extern void nvr_reg_write(uint16_t reg, uint8_t val, void *priv);
|
||||
extern void nvr_at_handler(int set, uint16_t base, nvr_t *nvr);
|
||||
@@ -132,5 +131,9 @@ extern void nvr_irq_set(int irq, nvr_t *nvr);
|
||||
extern void nvr_smi_enable(int enable, nvr_t *nvr);
|
||||
extern uint8_t nvr_smi_status(nvr_t *nvr);
|
||||
extern void nvr_smi_status_clear(nvr_t *nvr);
|
||||
#endif
|
||||
|
||||
extern char *nvr_path(char *str);
|
||||
extern FILE *nvr_fopen(char *str, char *mode);
|
||||
|
||||
#endif /*EMU_NVR_H*/
|
||||
|
||||
@@ -32,8 +32,8 @@
|
||||
/* String ID numbers. */
|
||||
enum {
|
||||
STRING_MOUSE_CAPTURE, /* "Click to capture mouse" */
|
||||
STRING_MOUSE_RELEASE, /* "Press F8+F12/Ctrl+End to release mouse" */
|
||||
STRING_MOUSE_RELEASE_MMB, /* "Press F8+F12/Ctrl+End or middle button to release mouse" */
|
||||
STRING_MOUSE_RELEASE, /* "Press F8+F12 to release mouse" */
|
||||
STRING_MOUSE_RELEASE_MMB, /* "Press F8+F12 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" */
|
||||
@@ -47,6 +47,7 @@ enum {
|
||||
STRING_HW_NOT_AVAILABLE_MACHINE, /* "Machine \"%hs\" is not available..." */
|
||||
STRING_HW_NOT_AVAILABLE_VIDEO, /* "Video card \"%hs\" is not available..." */
|
||||
STRING_HW_NOT_AVAILABLE_VIDEO2, /* "Video card #2 \"%hs\" is not available..." */
|
||||
STRING_HW_NOT_AVAILABLE_DEVICE, /* "Device \"%hs\" is not available..." */
|
||||
STRING_MONITOR_SLEEP, /* "Monitor in sleep mode" */
|
||||
STRING_GHOSTPCL_ERROR_TITLE, /* "Unable to initialize GhostPCL" */
|
||||
STRING_GHOSTPCL_ERROR_DESC /* "gpcl6dll32.dll/gpcl6dll64.dll/libgpcl6 is required..." */
|
||||
@@ -187,9 +188,6 @@ extern void zip_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);
|
||||
extern int ioctl_open(uint8_t id, char d);
|
||||
extern void ioctl_reset(uint8_t id);
|
||||
extern void ioctl_close(uint8_t id);
|
||||
|
||||
/* Other stuff. */
|
||||
extern void startblit(void);
|
||||
|
||||
@@ -1,70 +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.
|
||||
*
|
||||
* Definitions for platform specific serial to host passthrough.
|
||||
*
|
||||
*
|
||||
* Authors: Andreas J. Reichel <webmaster@6th-dimension.com>,
|
||||
* Jasmine Iwanek <jasmine@iwanek.co.uk>
|
||||
*
|
||||
* Copyright 2021 Andreas J. Reichel.
|
||||
* Copyright 2021-2022 Jasmine Iwanek.
|
||||
*/
|
||||
|
||||
#ifndef PLAT_CDROM_H
|
||||
#define PLAT_CDROM_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define RAW_SECTOR_SIZE 2352
|
||||
#define COOKED_SECTOR_SIZE 2048
|
||||
|
||||
#define DATA_TRACK 0x14
|
||||
#define AUDIO_TRACK 0x10
|
||||
|
||||
#define CD_FPS 75
|
||||
#define FRAMES_TO_MSF(f, M, S, F) \
|
||||
{ \
|
||||
uint64_t value = f; \
|
||||
*(F) = (value % CD_FPS) & 0xff; \
|
||||
value /= CD_FPS; \
|
||||
*(S) = (value % 60) & 0xff; \
|
||||
value /= 60; \
|
||||
*(M) = value & 0xff; \
|
||||
}
|
||||
#define MSF_TO_FRAMES(M, S, F) ((M) *60 * CD_FPS + (S) *CD_FPS + (F))
|
||||
|
||||
typedef struct SMSF {
|
||||
uint16_t min;
|
||||
uint8_t sec;
|
||||
uint8_t fr;
|
||||
} TMSF;
|
||||
|
||||
extern int plat_cdrom_is_track_audio(uint32_t sector);
|
||||
extern int plat_cdrom_is_track_pre(uint32_t sector);
|
||||
extern uint32_t plat_cdrom_get_last_block(void);
|
||||
extern void plat_cdrom_get_audio_tracks(int *st_track, int *end, TMSF *lead_out);
|
||||
extern int plat_cdrom_get_audio_track_info(int end, int track, int *track_num, TMSF *start, uint8_t *attr);
|
||||
extern int plat_cdrom_get_audio_sub(uint32_t sector, uint8_t *attr, uint8_t *track, uint8_t *index, TMSF *rel_pos, TMSF *abs_pos);
|
||||
extern int plat_cdrom_get_sector_size(uint32_t sector);
|
||||
extern int plat_cdrom_read_sector(uint8_t *buffer, int raw, uint32_t sector);
|
||||
extern void plat_cdrom_eject(void);
|
||||
extern void plat_cdrom_close(void);
|
||||
extern int plat_cdrom_set_drive(const char *drv);
|
||||
extern int plat_cdrom_ext_medium_changed(void);
|
||||
extern uint32_t plat_cdrom_get_track_start(uint32_t sector, uint8_t *attr, uint8_t *track);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
34
src/include/86box/plat_cdrom_ioctl.h
Normal file
34
src/include/86box/plat_cdrom_ioctl.h
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* 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 platform specific serial to host passthrough.
|
||||
*
|
||||
*
|
||||
* Authors: Andreas J. Reichel <webmaster@6th-dimension.com>,
|
||||
* Jasmine Iwanek <jasmine@iwanek.co.uk>
|
||||
*
|
||||
* Copyright 2021 Andreas J. Reichel.
|
||||
* Copyright 2021-2022 Jasmine Iwanek.
|
||||
*/
|
||||
|
||||
#ifndef PLAT_CDROM_IOCTL_H
|
||||
#define PLAT_CDROM_IOCTL_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern void * ioctl_open(cdrom_t *dev, const char *drv);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -29,15 +29,21 @@
|
||||
#define SCSI_ID_MAX 16 /* 16 on wide buses */
|
||||
#define SCSI_LUN_MAX 8 /* always 8 */
|
||||
|
||||
extern int scsi_card_current[SCSI_CARD_MAX];
|
||||
extern int scsi_card_current[SCSI_CARD_MAX];
|
||||
|
||||
extern int scsi_card_available(int card);
|
||||
extern void scsi_reset(void);
|
||||
extern uint8_t scsi_get_bus(void);
|
||||
|
||||
extern int scsi_card_available(int card);
|
||||
#ifdef EMU_DEVICE_H
|
||||
extern const device_t *scsi_card_getdevice(int card);
|
||||
#endif
|
||||
extern int scsi_card_has_config(int card);
|
||||
extern const char *scsi_card_get_internal_name(int card);
|
||||
extern int scsi_card_get_from_internal_name(char *s);
|
||||
extern void scsi_card_init(void);
|
||||
extern int scsi_card_has_config(int card);
|
||||
extern const char *scsi_card_get_internal_name(int card);
|
||||
extern int scsi_card_get_from_internal_name(char *s);
|
||||
extern void scsi_card_init(void);
|
||||
|
||||
extern void scsi_bus_set_speed(uint8_t bus, double speed);
|
||||
extern double scsi_bus_get_speed(uint8_t bus);
|
||||
|
||||
#endif /*EMU_SCSI_H*/
|
||||
|
||||
@@ -26,55 +26,56 @@ typedef struct scsi_cdrom_t {
|
||||
/* Common block. */
|
||||
mode_sense_pages_t ms_pages_saved;
|
||||
|
||||
cdrom_t * drv;
|
||||
cdrom_t * drv;
|
||||
#ifdef EMU_IDE_H
|
||||
ide_tf_t *tf;
|
||||
ide_tf_t * tf;
|
||||
#else
|
||||
void * tf;
|
||||
void * tf;
|
||||
#endif
|
||||
|
||||
uint8_t *buffer;
|
||||
uint8_t atapi_cdb[16];
|
||||
uint8_t current_cdb[16];
|
||||
uint8_t sense[256];
|
||||
void * log;
|
||||
|
||||
#ifdef ANCIENT_CODE
|
||||
/* Task file. */
|
||||
uint8_t features;
|
||||
uint8_t phase;
|
||||
uint16_t request_length;
|
||||
uint8_t status;
|
||||
uint8_t error;
|
||||
uint16_t pad;
|
||||
uint32_t pos;
|
||||
#endif
|
||||
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 early;
|
||||
uint8_t pad1;
|
||||
uint8_t id;
|
||||
uint8_t cur_lun;
|
||||
uint8_t early;
|
||||
uint8_t sector_type;
|
||||
|
||||
uint16_t max_transfer_len;
|
||||
uint16_t pad2;
|
||||
uint16_t max_transfer_len;
|
||||
uint16_t sector_flags;
|
||||
|
||||
int requested_blocks;
|
||||
int packet_status;
|
||||
int total_length;
|
||||
int do_page_save;
|
||||
int unit_attention;
|
||||
int request_pos;
|
||||
int old_len;
|
||||
int media_status;
|
||||
int requested_blocks;
|
||||
int packet_status;
|
||||
int total_length;
|
||||
int do_page_save;
|
||||
int unit_attention;
|
||||
int request_pos;
|
||||
int old_len;
|
||||
int media_status;
|
||||
|
||||
uint32_t sector_pos;
|
||||
uint32_t sector_len;
|
||||
uint32_t packet_len;
|
||||
uint32_t sector_pos;
|
||||
uint32_t sector_len;
|
||||
uint32_t packet_len;
|
||||
|
||||
double callback;
|
||||
double callback;
|
||||
|
||||
int is_sony;
|
||||
int use_cdb_9;
|
||||
|
||||
uint8_t ven_cmd_is_data[256];
|
||||
|
||||
mode_sense_pages_t ms_pages_saved_sony;
|
||||
mode_sense_pages_t ms_drive_status_pages_saved;
|
||||
int sony_vendor;
|
||||
|
||||
uint64_t ms_page_flags;
|
||||
|
||||
mode_sense_pages_t ms_pages_default;
|
||||
mode_sense_pages_t ms_pages_changeable;
|
||||
|
||||
uint8_t (*ven_cmd)(void *sc, const uint8_t *cdb, int32_t *BufLen);
|
||||
} scsi_cdrom_t;
|
||||
#endif
|
||||
|
||||
@@ -82,10 +83,12 @@ extern scsi_cdrom_t *scsi_cdrom[CDROM_NUM];
|
||||
|
||||
#define scsi_cdrom_sense_error dev->sense[0]
|
||||
#define scsi_cdrom_sense_key dev->sense[2]
|
||||
#define scsi_cdrom_info *(uint32_t *) &(dev->sense[3])
|
||||
#define scsi_cdrom_asc dev->sense[12]
|
||||
#define scsi_cdrom_ascq dev->sense[13]
|
||||
#define scsi_cdrom_drive cdrom_drives[id].host_drive
|
||||
|
||||
extern void scsi_cdrom_reset(scsi_common_t *sc);
|
||||
extern void scsi_cdrom_drive_reset(const int c);
|
||||
|
||||
#endif /*EMU_SCSI_CDROM_H*/
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#define SCSI_DEVICE_H
|
||||
|
||||
/* Configuration. */
|
||||
#define SCSI_NUM (SCSI_BUS_MAX * SCSI_ID_MAX)
|
||||
|
||||
#define SCSI_LUN_USE_CDB 0xff
|
||||
|
||||
@@ -53,8 +54,8 @@
|
||||
#define GPCMD_SEEK_6 0x0b
|
||||
#define GPCMD_IOMEGA_SET_PROTECTION_MODE 0x0c
|
||||
#define GPCMD_IOMEGA_EJECT 0x0d /* ATAPI only? */
|
||||
#define GPCMD_NO_OPERATION_TOSHIBA 0x0d /* Toshiba Vendor Unique command */
|
||||
#define GPCMD_NO_OPERATION_NEC 0x0d /* NEC Vendor Unique command */
|
||||
#define GPCMD_NO_OPERATION_TOSHIBA 0x0d /* Toshiba Vendor Unique command. */
|
||||
#define GPCMD_NO_OPERATION_NEC 0x0d /* NEC Vendor Unique command. */
|
||||
#define GPCMD_INQUIRY 0x12
|
||||
#define GPCMD_VERIFY_6 0x13
|
||||
#define GPCMD_MODE_SELECT_6 0x15
|
||||
@@ -66,7 +67,7 @@
|
||||
#define GPCMD_PREVENT_REMOVAL 0x1e
|
||||
#define GPCMD_READ_FORMAT_CAPACITIES 0x23
|
||||
#define GPCMD_READ_CDROM_CAPACITY 0x25
|
||||
#define GPCMD_UNKNOWN_CHINON 0x26 /*Chinon Vendor Unique command*/
|
||||
#define GPCMD_UNKNOWN_CHINON 0x26 /* Chinon Vendor Unique command. */
|
||||
#define GPCMD_READ_10 0x28
|
||||
#define GPCMD_READ_GENERATION 0x29
|
||||
#define GPCMD_WRITE_10 0x2a
|
||||
@@ -100,43 +101,54 @@
|
||||
#define GPCMD_WRITE_AND_VERIFY_12 0xae
|
||||
#define GPCMD_VERIFY_12 0xaf
|
||||
#define GPCMD_PLAY_CD_OLD 0xb4
|
||||
#define GPCMD_READ_CD_OLD 0xb8
|
||||
#define GPCMD_READ_CD_OLD 0xb8 /* Should be equivalent to 0xbe */
|
||||
#define GPCMD_READ_CD_MSF 0xb9
|
||||
#define GPCMD_AUDIO_SCAN 0xba
|
||||
#define GPCMD_SET_SPEED 0xbb
|
||||
#define GPCMD_PLAY_CD 0xbc
|
||||
#define GPCMD_PLAY_CD 0xbc /* At some point, this was READ CD, according to the
|
||||
ATAPI specification */
|
||||
#define GPCMD_MECHANISM_STATUS 0xbd
|
||||
#define GPCMD_READ_CD 0xbe
|
||||
#define GPCMD_SEND_DVD_STRUCTURE 0xbf /* This is for writing only, irrelevant to 86Box. */
|
||||
#define GPCMD_EJECT_CHINON 0xc0 /* Chinon Vendor Unique command */
|
||||
#define GPCMD_AUDIO_TRACK_SEARCH_TOSHIBA 0xc0 /* Toshiba Vendor Unique command */
|
||||
#define GPCMD_UNKNOWN_SONY 0xc0 /* Sony Vendor Unique command */
|
||||
#define GPCMD_SET_ADDRESS_FORMAT_SONY 0xc0 /* Sony Vendor Unique command */
|
||||
#define GPCMD_MAGAZINE_EJECT_PIONEER 0xc0 /* Pioneer Vendor Unique command */
|
||||
#define GPCMD_PLAY_AUDIO_TOSHIBA 0xc1 /* Toshiba Vendor Unique command */
|
||||
#define GPCMD_READ_TOC_SONY 0xc1 /* Sony Vendor Unique command */
|
||||
#define GPCMD_READ_TOC_PIONEER 0xc1 /* Pioneer Vendor Unique command */
|
||||
#define GPCMD_PAUSE_RESUME_ALT 0xc2
|
||||
#define GPCMD_READ_SUBCHANNEL_MATSUSHITA 0xc2 /* Matsushita Vendor Unique command */
|
||||
#define GPCMD_READ_SUBCHANNEL_SONY 0xc2 /* Sony Vendor Unique command */
|
||||
#define GPCMD_STILL_TOSHIBA 0xc2 /* Toshiba Vendor Unique command */
|
||||
#define GPCMD_READ_SUBCODEQ_PIONEER 0xc2 /* Pioneer Vendor Unique command */
|
||||
#define GPCMD_READ_TOC_MATSUSHITA 0xc3 /* Matsushita Vendor Unique command */
|
||||
#define GPCMD_READ_HEADER_SONY 0xc3 /* Sony Vendor Unique command */
|
||||
#define GPCMD_SET_STOP_TIME_TOSHIBA 0xc3 /* Toshiba Vendor Unique command */
|
||||
#define GPCMD_READ_HEADER_MATSUSHITA 0xc4 /* Matsushita Vendor Unique command */
|
||||
#define GPCMD_PLAYBACK_STATUS_TOSHIBA 0xc4 /* Sony Vendor Unique command */
|
||||
#define GPCMD_PLAYBACK_STATUS_SONY 0xc4 /* Sony Vendor Unique command */
|
||||
#define GPCMD_CADDY_EJECT_TOSHIBA 0xc4 /* Toshiba Vendor Unique command */
|
||||
#define GPCMD_PAUSE_SONY 0xc5 /* Sony Vendor Unique command */
|
||||
#define GPCMD_PLAY_AUDIO_MATSUSHITA 0xc5 /* Matsushita Vendor Unique command */
|
||||
#define GPCMD_UNKNOWN_SCSI2_NEC 0xc5 /* NEC Vendor Unique Command */
|
||||
#define GPCMD_STOP_CHINON 0xc6 /* Chinon Vendor Unique command */
|
||||
#define GPCMD_PLAT_TRACK_SONY 0xc6 /* Sony Vendor Unique command */
|
||||
#define GPCMD_PLAY_TRACK_SONY 0xc6 /* Sony Vendor Unique command */
|
||||
#define GPCMD_READ_SUBCODEQ_PLAYING_STATUS_TOSHIBA 0xc6 /* Toshiba Vendor Unique command */
|
||||
#define GPCMD_PLAY_AUDIO_MSF_MATSUSHITA 0xc7 /* Matsushita Vendor Unique command*/
|
||||
#define GPCMD_PLAY_MSF_SONY 0xc7 /* Sony Vendor Unique command*/
|
||||
#define GPCMD_READ_DISC_INFORMATION_TOSHIBA 0xc7 /* Toshiba Vendor Unique command */
|
||||
#define GPCMD_PLAY_AUDIO_TRACK_INDEX_MATSUSHITA 0xc8 /* Matsushita Vendor Unique command */
|
||||
#define GPCMD_PLAY_AUDIO_SONY 0xc8 /* Sony Vendor Unique command */
|
||||
#define GPCMD_PLAY_AUDIO_TRACK_RELATIVE_10_MATSUSHITA 0xc9 /*Matsushita Vendor Unique command */
|
||||
#define GPCMD_AUDIO_TRACK_SEARCH_PIONEER 0xc8 /* Pioneer Vendor Unique command */
|
||||
#define GPCMD_PLAY_AUDIO_TRACK_RELATIVE_10_MATSUSHITA 0xc9 /* Matsushita Vendor Unique command */
|
||||
#define GPCMD_PLAYBACK_CONTROL_SONY 0xc9 /* Sony Vendor Unique command */
|
||||
#define GPCMD_PLAY_AUDIO_PIONEER 0xc9 /* Pioneer Vendor Unique command */
|
||||
#define GPCMD_PAUSE_PIONEER 0xca /* Pioneer Vendor Unique command */
|
||||
#define GPCMD_PAUSE_RESUME_MATSUSHITA 0xcb /* Matsushita Vendor Unique command */
|
||||
#define GPCMD_STOP_PIONEER 0xcb /* Pioneer Vendor Unique command */
|
||||
#define GPCMD_PLAYBACK_STATUS_PIONEER 0xcc /* Pioneer Vendor Unique command */
|
||||
#define GPCMD_SCAN_PIONEER 0xcd /* Should be equivalent to 0xba */
|
||||
#define GPCMD_READ_CD_MSF_OLD 0xd5 /* Should be equivalent to 0xb9 */
|
||||
#define GPCMD_AUDIO_TRACK_SEARCH_NEC 0xd8 /* NEC Vendor Unique command */
|
||||
#define GPCMD_PLAY_AUDIO_NEC 0xd9 /* NEC Vendor Unique command */
|
||||
#define GPCMD_STILL_NEC 0xda /* NEC Vendor Unique command */
|
||||
@@ -145,6 +157,7 @@
|
||||
#define GPCMD_CADDY_EJECT_NEC 0xdc /* NEC Vendor Unique command */
|
||||
#define GPCMD_READ_SUBCODEQ_PLAYING_STATUS_NEC 0xdd /* NEC Vendor Unique command */
|
||||
#define GPCMD_READ_DISC_INFORMATION_NEC 0xde /* NEC Vendor Unique command */
|
||||
#define GPCMD_DRIVE_STATUS_PIONEER 0xe0 /* Pioneer Vendor Unique command */
|
||||
#define GPCMD_PLAY_AUDIO_12_MATSUSHITA 0xe5 /* Matsushita Vendor Unique command */
|
||||
#define GPCMD_PLAY_AUDIO_TRACK_RELATIVE_12_MATSUSHITA 0xe9 /* Matsushita Vendor Unique command */
|
||||
|
||||
@@ -189,6 +202,7 @@
|
||||
/* SCSI Sense Keys */
|
||||
#define SENSE_NONE 0
|
||||
#define SENSE_NOT_READY 2
|
||||
#define SENSE_MEDIUM_ERROR 3
|
||||
#define SENSE_ILLEGAL_REQUEST 5
|
||||
#define SENSE_UNIT_ATTENTION 6
|
||||
|
||||
@@ -196,6 +210,8 @@
|
||||
#define ASC_NONE 0x00
|
||||
#define ASC_AUDIO_PLAY_OPERATION 0x00
|
||||
#define ASC_NOT_READY 0x04
|
||||
#define ASC_WRITE_ERROR 0x0c
|
||||
#define ASC_UNRECOVERED_READ_ERROR 0x11
|
||||
#define ASC_ILLEGAL_OPCODE 0x20
|
||||
#define ASC_LBA_OUT_OF_RANGE 0x21
|
||||
#define ASC_INV_FIELD_IN_CMD_PACKET 0x24
|
||||
@@ -203,7 +219,7 @@
|
||||
#define ASC_INV_FIELD_IN_PARAMETER_LIST 0x26
|
||||
#define ASC_WRITE_PROTECTED 0x27
|
||||
#define ASC_MEDIUM_MAY_HAVE_CHANGED 0x28
|
||||
#define ASC_CAPACITY_DATA_CHANGED 0x2A
|
||||
#define ASC_CAPACITY_DATA_CHANGED 0x2a
|
||||
#define ASC_INCOMPATIBLE_FORMAT 0x30
|
||||
#define ASC_MEDIUM_NOT_PRESENT 0x3a
|
||||
#define ASC_DATA_PHASE_ERROR 0x4b
|
||||
@@ -212,21 +228,18 @@
|
||||
#define ASCQ_NONE 0x00
|
||||
#define ASCQ_UNIT_IN_PROCESS_OF_BECOMING_READY 0x01
|
||||
#define ASCQ_INITIALIZING_COMMAND_REQUIRED 0x02
|
||||
#define ASCQ_CIRC_UNRECOVERED_ERROR 0x06
|
||||
#define ASCQ_CAPACITY_DATA_CHANGED 0x09
|
||||
#define ASCQ_AUDIO_PLAY_OPERATION_IN_PROGRESS 0x11
|
||||
#define ASCQ_AUDIO_PLAY_OPERATION_PAUSED 0x12
|
||||
#define ASCQ_AUDIO_PLAY_OPERATION_COMPLETED 0x13
|
||||
|
||||
/* Tell RISC OS that we have a 4x CD-ROM drive (600kb/sec data, 706kb/sec raw).
|
||||
Not that it means anything */
|
||||
#define CDROM_SPEED 706 /* 0x2C2 */
|
||||
|
||||
#define BUFFER_SIZE (256 * 1024)
|
||||
|
||||
#define RW_DELAY (TIMER_USEC * 500)
|
||||
|
||||
/* Some generally useful CD-ROM information */
|
||||
#ifdef CONSERVATIVE_MAXIMUM
|
||||
#define CD_MINS 90 /* max. minutes per CD */
|
||||
#else
|
||||
#define CD_MINS 100 /* max. minutes per CD - yes, 100-minute CD's in fact existed */
|
||||
#endif
|
||||
#define CD_SECS 60 /* seconds per minute */
|
||||
#define CD_FRAMES 75 /* frames per second */
|
||||
#define CD_FRAMESIZE 2048 /* bytes per frame, "cooked" mode */
|
||||
@@ -260,6 +273,10 @@
|
||||
|
||||
/* Profile list from MMC-6 revision 1 table 91 */
|
||||
#define MMC_PROFILE_NONE 0x0000
|
||||
#define MMC_PROFILE_REMOVABLE_DISK 0x0002
|
||||
#define MMC_PROFILE_MO 0x0003
|
||||
#define MMC_PROFILE_MO_WORM 0x0004
|
||||
#define MMC_PROFILE_AS_MO 0x0005
|
||||
#define MMC_PROFILE_CD_ROM 0x0008
|
||||
#define MMC_PROFILE_CD_R 0x0009
|
||||
#define MMC_PROFILE_CD_RW 0x000A
|
||||
@@ -288,7 +305,6 @@
|
||||
#define MMC_PROFILE_HDDVD_RW_DL 0x005A
|
||||
#define MMC_PROFILE_INVALID 0xFFFF
|
||||
|
||||
#define EARLY_ONLY 64
|
||||
#define SCSI_ONLY 32
|
||||
#define ATAPI_ONLY 16
|
||||
#define IMPLEMENTED 8
|
||||
@@ -296,8 +312,6 @@
|
||||
#define CHECK_READY 2
|
||||
#define ALLOW_UA 1
|
||||
|
||||
#define MSFtoLBA(m, s, f) ((((m * 60) + s) * 75) + f)
|
||||
|
||||
#define MSG_COMMAND_COMPLETE 0x00
|
||||
|
||||
#define BUS_DBP 0x01
|
||||
@@ -317,6 +331,20 @@
|
||||
|
||||
#define BUS_IDLE (1 << 31)
|
||||
|
||||
#define STATE_IDLE 0
|
||||
#define STATE_COMMAND 1
|
||||
#define STATE_DATAIN 2
|
||||
#define STATE_DATAOUT 3
|
||||
#define STATE_STATUS 4
|
||||
#define STATE_MESSAGEIN 5
|
||||
#define STATE_SELECT 6
|
||||
#define STATE_MESSAGEOUT 7
|
||||
#define STATE_MESSAGE_ID 8
|
||||
|
||||
#define PIO_TX_BUS 0
|
||||
#define DMA_IN_TX_BUS 1
|
||||
#define DMA_OUT_TX_BUS 2
|
||||
|
||||
#define PHASE_IDLE 0x00
|
||||
#define PHASE_COMMAND 0x01
|
||||
#define PHASE_DATA_IN 0x02
|
||||
@@ -341,7 +369,7 @@
|
||||
#define MODE_SELECT_PHASE_PAGE 4
|
||||
|
||||
typedef struct mode_sense_pages_t {
|
||||
uint8_t pages[0x40][0x40];
|
||||
uint8_t pages[0x40][0x40];
|
||||
} mode_sense_pages_t;
|
||||
|
||||
/* This is so we can access the common elements to all SCSI device structs
|
||||
@@ -349,70 +377,107 @@ typedef struct mode_sense_pages_t {
|
||||
typedef struct scsi_common_s {
|
||||
mode_sense_pages_t ms_pages_saved;
|
||||
|
||||
void * priv;
|
||||
void * priv;
|
||||
#ifdef EMU_IDE_H
|
||||
ide_tf_t *tf;
|
||||
ide_tf_t * tf;
|
||||
#else
|
||||
void * tf;
|
||||
void * tf;
|
||||
#endif
|
||||
|
||||
uint8_t *temp_buffer;
|
||||
uint8_t atapi_cdb[16]; /* This is atapi_cdb in ATAPI-supporting devices,
|
||||
and pad in SCSI-only devices. */
|
||||
uint8_t current_cdb[16];
|
||||
uint8_t sense[256];
|
||||
void * log;
|
||||
|
||||
#ifdef ANCIENT_CODE
|
||||
/* Task file. */
|
||||
uint8_t features;
|
||||
uint8_t phase;
|
||||
uint16_t request_length;
|
||||
uint8_t status;
|
||||
uint8_t error;
|
||||
uint16_t pad;
|
||||
uint32_t pos;
|
||||
#endif
|
||||
uint8_t * temp_buffer;
|
||||
/*
|
||||
This is atapi_cdb in ATAPI-supporting devices,
|
||||
and pad in SCSI-only devices.
|
||||
*/
|
||||
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;
|
||||
uint8_t id;
|
||||
uint8_t cur_lun;
|
||||
uint8_t pad0;
|
||||
uint8_t pad1;
|
||||
|
||||
uint16_t max_transfer_len;
|
||||
uint16_t pad2;
|
||||
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 media_status;
|
||||
int requested_blocks;
|
||||
int packet_status;
|
||||
int total_length;
|
||||
int do_page_save;
|
||||
int unit_attention;
|
||||
int request_pos;
|
||||
int old_len;
|
||||
int media_status;
|
||||
|
||||
uint32_t sector_pos;
|
||||
uint32_t sector_len;
|
||||
uint32_t packet_len;
|
||||
uint32_t sector_pos;
|
||||
uint32_t sector_len;
|
||||
uint32_t packet_len;
|
||||
|
||||
double callback;
|
||||
double callback;
|
||||
|
||||
uint8_t (*ven_cmd)(void *sc, uint8_t *cdb, int32_t *BufLen);
|
||||
} scsi_common_t;
|
||||
|
||||
typedef struct scsi_device_t {
|
||||
int32_t buffer_length;
|
||||
int32_t buffer_length;
|
||||
|
||||
uint8_t status;
|
||||
uint8_t phase;
|
||||
uint16_t type;
|
||||
uint8_t status;
|
||||
uint8_t phase;
|
||||
|
||||
scsi_common_t *sc;
|
||||
uint16_t type;
|
||||
|
||||
void (*command)(scsi_common_t *sc, uint8_t *cdb);
|
||||
void (*request_sense)(scsi_common_t *sc, uint8_t *buffer, uint8_t alloc_length);
|
||||
void (*reset)(scsi_common_t *sc);
|
||||
uint8_t (*phase_data_out)(scsi_common_t *sc);
|
||||
void (*command_stop)(scsi_common_t *sc);
|
||||
scsi_common_t * sc;
|
||||
|
||||
void (*command)(scsi_common_t *sc, const uint8_t *cdb);
|
||||
void (*request_sense)(scsi_common_t *sc, uint8_t *buffer,
|
||||
uint8_t alloc_length);
|
||||
void (*reset)(scsi_common_t *sc);
|
||||
uint8_t (*phase_data_out)(scsi_common_t *sc);
|
||||
void (*command_stop)(scsi_common_t *sc);
|
||||
} scsi_device_t;
|
||||
|
||||
typedef struct scsi_bus_t {
|
||||
uint8_t data;
|
||||
uint8_t msglun;
|
||||
uint8_t data_wait;
|
||||
uint8_t target_id;
|
||||
uint8_t bus_device;
|
||||
uint8_t pad;
|
||||
uint8_t pad0;
|
||||
uint8_t pad1;
|
||||
|
||||
uint8_t command[16];
|
||||
uint8_t msgout[4];
|
||||
uint8_t pad2[4];
|
||||
|
||||
int tx_mode;
|
||||
int clear_req;
|
||||
int wait_data;
|
||||
int wait_complete;
|
||||
int bus_out;
|
||||
int bus_in;
|
||||
int command_pos;
|
||||
int command_issued;
|
||||
int data_pos;
|
||||
int msgout_pos;
|
||||
int is_msgout;
|
||||
int state;
|
||||
int dma_on_pio_enabled;
|
||||
|
||||
uint32_t bus_phase;
|
||||
|
||||
double period;
|
||||
double speed;
|
||||
double divider;
|
||||
double multi;
|
||||
|
||||
void *priv;
|
||||
void (*timer)(void *priv, double period);
|
||||
} scsi_bus_t;
|
||||
|
||||
/* These are based on the INQUIRY values. */
|
||||
#define SCSI_NONE 0x0060
|
||||
#define SCSI_FIXED_DISK 0x0000
|
||||
@@ -423,15 +488,8 @@ typedef struct scsi_device_t {
|
||||
extern scsi_device_t scsi_devices[SCSI_BUS_MAX][SCSI_ID_MAX];
|
||||
#endif /* EMU_SCSI_H */
|
||||
|
||||
extern int cdrom_add_error_and_subchannel(uint8_t *b, int real_sector_type);
|
||||
extern int cdrom_LBAtoMSF_accurate(void);
|
||||
|
||||
extern int mode_select_init(uint8_t command, uint16_t pl_length, uint8_t do_save);
|
||||
extern int mode_select_terminate(int force);
|
||||
extern int mode_select_write(uint8_t val);
|
||||
|
||||
extern uint8_t *scsi_device_sense(scsi_device_t *dev);
|
||||
extern double scsi_device_get_callback(scsi_device_t *dev);
|
||||
extern uint8_t *scsi_device_sense(scsi_device_t *dev);
|
||||
extern void scsi_device_request_sense(scsi_device_t *dev, uint8_t *buffer,
|
||||
uint8_t alloc_length);
|
||||
extern void scsi_device_reset(scsi_device_t *dev);
|
||||
@@ -439,14 +497,16 @@ extern int scsi_device_present(scsi_device_t *dev);
|
||||
extern int scsi_device_valid(scsi_device_t *dev);
|
||||
extern int scsi_device_cdb_length(scsi_device_t *dev);
|
||||
extern void scsi_device_command_phase0(scsi_device_t *dev, uint8_t *cdb);
|
||||
extern void scsi_device_command_phase1(scsi_device_t *dev);
|
||||
extern void scsi_device_command_stop(scsi_device_t *dev);
|
||||
extern void scsi_device_command_phase1(scsi_device_t *dev);
|
||||
extern void scsi_device_identify(scsi_device_t *dev, uint8_t lun);
|
||||
extern void scsi_device_close_all(void);
|
||||
extern void scsi_device_init(void);
|
||||
|
||||
extern void scsi_reset(void);
|
||||
extern uint8_t scsi_get_bus(void);
|
||||
extern int scsi_bus_read(scsi_bus_t *scsi_bus);
|
||||
extern void scsi_bus_update(scsi_bus_t *scsi_bus, int bus);
|
||||
|
||||
extern void scsi_bus_set_speed(uint8_t bus, double speed);
|
||||
extern double scsi_bus_get_speed(uint8_t bus);
|
||||
|
||||
@@ -19,51 +19,44 @@
|
||||
typedef struct scsi_disk_t {
|
||||
mode_sense_pages_t ms_pages_saved;
|
||||
|
||||
hard_disk_t *drv;
|
||||
hard_disk_t * drv;
|
||||
#ifdef EMU_IDE_H
|
||||
ide_tf_t * tf;
|
||||
ide_tf_t * tf;
|
||||
#else
|
||||
void * tf;
|
||||
void * tf;
|
||||
#endif
|
||||
|
||||
uint8_t *temp_buffer;
|
||||
uint8_t atapi_cdb[16];
|
||||
uint8_t current_cdb[16];
|
||||
uint8_t sense[256];
|
||||
void * log;
|
||||
|
||||
#ifdef ANCIENT_CODE
|
||||
/* Task file. */
|
||||
uint8_t features;
|
||||
uint8_t phase;
|
||||
uint16_t request_length;
|
||||
uint8_t status;
|
||||
uint8_t error;
|
||||
uint16_t pad;
|
||||
uint32_t pos;
|
||||
#endif
|
||||
uint8_t * temp_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;
|
||||
uint8_t id;
|
||||
uint8_t cur_lun;
|
||||
uint8_t pad0;
|
||||
uint8_t pad1;
|
||||
|
||||
uint16_t max_transfer_len;
|
||||
uint16_t pad2;
|
||||
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 pad6;
|
||||
int pad7;
|
||||
int requested_blocks;
|
||||
int packet_status;
|
||||
int total_length;
|
||||
int do_page_save;
|
||||
int unit_attention;
|
||||
int request_pos;
|
||||
int pad6;
|
||||
int pad7;
|
||||
|
||||
uint32_t sector_pos;
|
||||
uint32_t sector_len;
|
||||
uint32_t packet_len;
|
||||
uint32_t sector_pos;
|
||||
uint32_t sector_len;
|
||||
uint32_t packet_len;
|
||||
|
||||
double callback;
|
||||
double callback;
|
||||
|
||||
uint8_t (*ven_cmd)(void *sc, uint8_t *cdb, int32_t *BufLen);
|
||||
} scsi_disk_t;
|
||||
|
||||
extern scsi_disk_t *scsi_disk[HDD_NUM];
|
||||
|
||||
@@ -44,6 +44,9 @@
|
||||
#define ICR_ACK 0x10
|
||||
#define ICR_ARB_LOST 0x20
|
||||
#define ICR_ARB_IN_PROGRESS 0x40
|
||||
#define ICR_RST 0x80
|
||||
#define ICR_PHASE 0x9e
|
||||
#define ICR_WRITE 0x9f
|
||||
|
||||
#define MODE_ARBITRATE 0x01
|
||||
#define MODE_DMA 0x02
|
||||
@@ -63,69 +66,34 @@
|
||||
#define TCR_REQ 0x08
|
||||
#define TCR_LAST_BYTE_SENT 0x80
|
||||
|
||||
|
||||
#define STATE_IDLE 0
|
||||
#define STATE_COMMAND 1
|
||||
#define STATE_DATAIN 2
|
||||
#define STATE_DATAOUT 3
|
||||
#define STATE_STATUS 4
|
||||
#define STATE_MESSAGEIN 5
|
||||
#define STATE_SELECT 6
|
||||
#define STATE_MESSAGEOUT 7
|
||||
#define STATE_MESSAGE_ID 8
|
||||
|
||||
#define DMA_IDLE 0
|
||||
#define DMA_SEND 1
|
||||
#define DMA_INITIATOR_RECEIVE 2
|
||||
|
||||
typedef struct ncr_t {
|
||||
uint8_t icr;
|
||||
uint8_t mode;
|
||||
uint8_t tcr;
|
||||
uint8_t data_wait;
|
||||
uint8_t isr;
|
||||
uint8_t output_data;
|
||||
uint8_t target_id;
|
||||
uint8_t tx_data;
|
||||
uint8_t msglun;
|
||||
uint8_t irq_state;
|
||||
uint8_t isr_reg;
|
||||
|
||||
uint8_t command[20];
|
||||
uint8_t msgout[4];
|
||||
uint8_t bus;
|
||||
|
||||
int msgout_pos;
|
||||
int is_msgout;
|
||||
|
||||
int dma_mode;
|
||||
int cur_bus;
|
||||
int bus_in;
|
||||
int new_phase;
|
||||
int state;
|
||||
int clear_req;
|
||||
int wait_data;
|
||||
int wait_complete;
|
||||
int command_pos;
|
||||
int data_pos;
|
||||
|
||||
int irq;
|
||||
|
||||
double period;
|
||||
|
||||
void *priv;
|
||||
void (*dma_mode_ext)(void *priv, void *ext_priv);
|
||||
void (*dma_mode_ext)(void *priv, void *ext_priv, uint8_t val);
|
||||
int (*dma_send_ext)(void *priv, void *ext_priv);
|
||||
int (*dma_initiator_receive_ext)(void *priv, void *ext_priv);
|
||||
void (*timer)(void *ext_priv, double period);
|
||||
|
||||
scsi_bus_t scsibus;
|
||||
} ncr_t;
|
||||
|
||||
extern int ncr5380_cmd_len[8];
|
||||
|
||||
extern void ncr5380_irq(ncr_t *ncr, int set_irq);
|
||||
extern void ncr5380_set_irq(ncr_t *ncr, int irq);
|
||||
extern void ncr5380_set_irq(ncr_t *ncr, int irq);
|
||||
extern uint32_t ncr5380_get_bus_host(ncr_t *ncr);
|
||||
extern void ncr5380_bus_read(ncr_t *ncr);
|
||||
extern void ncr5380_bus_update(ncr_t *ncr, int bus);
|
||||
extern void ncr5380_write(uint16_t port, uint8_t val, ncr_t *ncr);
|
||||
extern uint8_t ncr5380_read(uint16_t port, ncr_t *ncr);
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
* Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
*
|
||||
* Copyright 2008-2020 Sarah Walker.
|
||||
* Copyright 2016-2020 Miran Grca.
|
||||
* Copyright 2016-2025 Miran Grca.
|
||||
* Copyright 2017-2020 Fred N. van Kempen.
|
||||
*/
|
||||
|
||||
@@ -137,6 +137,7 @@ extern serial_t *serial_attach_ex_2(int port,
|
||||
extern void serial_remove(serial_t *dev);
|
||||
extern void serial_set_type(serial_t *dev, int type);
|
||||
extern void serial_setup(serial_t *dev, uint16_t addr, uint8_t irq);
|
||||
extern void serial_irq(serial_t *dev, uint8_t irq);
|
||||
extern void serial_clear_fifo(serial_t *dev);
|
||||
extern void serial_write_fifo(serial_t *dev, uint8_t dat);
|
||||
extern void serial_set_next_inst(int ni);
|
||||
|
||||
@@ -16,13 +16,20 @@
|
||||
#ifndef EMU_SIO_H
|
||||
#define EMU_SIO_H
|
||||
|
||||
extern void vt82c686_sio_write(uint8_t addr, uint8_t val, void *priv);
|
||||
|
||||
/* ACC Micro */
|
||||
extern const device_t acc3221_device;
|
||||
|
||||
/* Acer / ALi */
|
||||
extern const device_t ali5105_device;
|
||||
|
||||
extern const device_t ali5123_device;
|
||||
extern const device_t f82c710_device;
|
||||
|
||||
/* Chips & Technologies */
|
||||
extern const device_t f82c606_device;
|
||||
|
||||
extern const device_t f82c710_device;
|
||||
|
||||
/* SM(S)C */
|
||||
extern const device_t fdc37c651_device;
|
||||
extern const device_t fdc37c651_ide_device;
|
||||
extern const device_t fdc37c661_device;
|
||||
@@ -35,9 +42,12 @@ extern const device_t fdc37c665_ide_device;
|
||||
extern const device_t fdc37c665_ide_pri_device;
|
||||
extern const device_t fdc37c665_ide_sec_device;
|
||||
extern const device_t fdc37c666_device;
|
||||
extern const device_t fdc37c67x_device;
|
||||
|
||||
extern const device_t fdc37c669_device;
|
||||
extern const device_t fdc37c669_370_device;
|
||||
|
||||
extern const device_t fdc37c67x_device;
|
||||
|
||||
extern const device_t fdc37c931apm_device;
|
||||
extern const device_t fdc37c931apm_compaq_device;
|
||||
extern const device_t fdc37c932fr_device;
|
||||
@@ -46,22 +56,23 @@ 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;
|
||||
|
||||
extern const device_t fdc37m60x_device;
|
||||
extern const device_t fdc37m60x_370_device;
|
||||
|
||||
/* ITE */
|
||||
extern const device_t it8661f_device;
|
||||
extern const device_t it8671f_device;
|
||||
extern const device_t i82091aa_device;
|
||||
extern const device_t i82091aa_398_device;
|
||||
extern const device_t i82091aa_ide_pri_device;
|
||||
extern const device_t i82091aa_ide_device;
|
||||
extern const device_t pc87306_device;
|
||||
extern const device_t pc87307_device;
|
||||
extern const device_t pc87307_15c_device;
|
||||
extern const device_t pc87307_both_device;
|
||||
extern const device_t pc87309_device;
|
||||
extern const device_t pc87309_15c_device;
|
||||
|
||||
/* National Semiconductors */
|
||||
extern const device_t pc87310_device;
|
||||
extern const device_t pc87310_ide_device;
|
||||
|
||||
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;
|
||||
@@ -69,35 +80,66 @@ extern const device_t pc87332_398_device;
|
||||
extern const device_t pc87332_398_ide_device;
|
||||
extern const device_t pc87332_398_ide_sec_device;
|
||||
extern const device_t pc87332_398_ide_fdcon_device;
|
||||
|
||||
extern const device_t 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;
|
||||
extern const device_t prime3b_ide_device;
|
||||
extern const device_t prime3c_device;
|
||||
extern const device_t prime3c_ide_device;
|
||||
|
||||
/* IBM PS/1 */
|
||||
extern const device_t ps1_m2133_sio;
|
||||
#if defined(DEV_BRANCH) && defined(USE_SIO_DETECT)
|
||||
|
||||
/* Super I/O Detect */
|
||||
#ifdef USE_SIO_DETECT
|
||||
extern const device_t sio_detect_device;
|
||||
#endif
|
||||
#endif /* USE_SIO_DETECT */
|
||||
|
||||
/* UMC */
|
||||
extern const device_t um8663af_device;
|
||||
extern const device_t um8663af_ide_device;
|
||||
extern const device_t um8663af_sec_device;
|
||||
extern const device_t um8663bf_device;
|
||||
extern const device_t um8663bf_ide_device;
|
||||
extern const device_t um8663bf_sec_device;
|
||||
|
||||
extern const device_t um8669f_device;
|
||||
extern const device_t um8669f_ide_device;
|
||||
extern const device_t um8669f_ide_sec_device;
|
||||
|
||||
/* VIA */
|
||||
extern void vt82c686_sio_write(uint8_t addr, uint8_t val, void *priv);
|
||||
|
||||
extern const device_t via_vt82c686_sio_device;
|
||||
|
||||
/* VLSI */
|
||||
extern const device_t vl82c113_device;
|
||||
|
||||
/* Winbond */
|
||||
extern const device_t w83787f_88h_device;
|
||||
extern const device_t w83787f_device;
|
||||
extern const device_t w83787f_ide_device;
|
||||
extern const device_t w83787f_ide_en_device;
|
||||
extern const device_t w83787f_ide_sec_device;
|
||||
|
||||
extern const device_t w83877f_device;
|
||||
extern const device_t w83877f_president_device;
|
||||
extern const device_t w83877tf_device;
|
||||
extern const device_t w83877tf_acorp_device;
|
||||
|
||||
#define TYPE_W83977EF 0x52F0
|
||||
#define TYPE_W83977F 0x9771
|
||||
#define TYPE_W83977TF 0x9773
|
||||
#define TYPE_W83977ATF 0x9774
|
||||
|
||||
extern const device_t w83977f_device;
|
||||
extern const device_t w83977f_370_device;
|
||||
extern const device_t w83977tf_device;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*
|
||||
* Copyright 2008-2020 Sarah Walker.
|
||||
* Copyright 2018-2020 TheCollector1995.
|
||||
* Copyright 2021 RichardG.
|
||||
* Copyright 2021-2025 RichardG.
|
||||
*/
|
||||
|
||||
#ifndef SOUND_AD1848_H
|
||||
@@ -26,8 +26,10 @@ enum {
|
||||
AD1848_TYPE_DEFAULT = 0,
|
||||
AD1848_TYPE_CS4248 = 1,
|
||||
AD1848_TYPE_CS4231 = 2,
|
||||
AD1848_TYPE_CS4235 = 3,
|
||||
AD1848_TYPE_CS4236 = 4
|
||||
AD1848_TYPE_CS4232 = 3,
|
||||
AD1848_TYPE_CS4236 = 4,
|
||||
AD1848_TYPE_CS4236B = 5,
|
||||
AD1848_TYPE_CS4235 = 6
|
||||
};
|
||||
|
||||
typedef struct ad1848_t {
|
||||
|
||||
22
src/include/86box/snd_akm4531.h
Normal file
22
src/include/86box/snd_akm4531.h
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
* Ensoniq AudioPCI family emulation.
|
||||
*
|
||||
* Authors: Cacodemon345
|
||||
*
|
||||
* Copyright 2024-2025 Cacodemon345.
|
||||
*/
|
||||
struct akm4531_t
|
||||
{
|
||||
unsigned char registers[256];
|
||||
};
|
||||
|
||||
typedef struct akm4531_t akm4531_t;
|
||||
|
||||
double akm4531_apply_master_vol(unsigned short sample);
|
||||
@@ -18,12 +18,35 @@
|
||||
#define SOUND_OPL_H
|
||||
|
||||
enum fm_type {
|
||||
FM_YM3812 = 0, /* OPL2 */
|
||||
FM_YMF262 = 1, /* OPL3 */
|
||||
FM_YMF289B = 2, /* OPL3-L */
|
||||
FM_YMF278B = 3, /* OPL 4 */
|
||||
FM_ESFM = 4, /* ESFM */
|
||||
FM_MAX = 5
|
||||
FM_YM2149 = 0, /* SSG */
|
||||
FM_YM3526 = 1, /* OPL */
|
||||
FM_Y8950 = 2, /* MSX-Audio (OPL with ADPCM) */
|
||||
FM_YM3812 = 3, /* OPL2 */
|
||||
FM_YMF262 = 4, /* OPL3 */
|
||||
FM_YMF289B = 5, /* OPL3-L */
|
||||
FM_YMF278B = 6, /* OPL4 */
|
||||
FM_YM2413 = 7, /* OPLL */
|
||||
FM_YM2423 = 8, /* OPLL-X */
|
||||
FM_YMF281 = 9, /* OPLLP */
|
||||
FM_DS1001 = 10, /* Konami VRC7 MMC */
|
||||
FM_YM2151 = 11, /* OPM */
|
||||
FM_YM2203 = 12, /* OPN */
|
||||
FM_YM2608 = 13, /* OPNA */
|
||||
FM_YMF288 = 14, /* OPN3L */
|
||||
FM_YM2610 = 15, /* OPNB */
|
||||
FM_YM2610B = 16, /* OPNB2 */
|
||||
FM_YM2612 = 17, /* OPN2 */
|
||||
FM_YM3438 = 18, /* OPN2C */
|
||||
FM_YMF276 = 19, /* OPN2L */
|
||||
FM_YM2164 = 20, /* OPP */
|
||||
FM_YM3806 = 21, /* OPQ */
|
||||
#if 0
|
||||
FM_YMF271 = 22, /* OPX */
|
||||
#endif
|
||||
FM_YM2414 = 23, /* OPZ */
|
||||
FM_ESFM = 24, /* ESFM */
|
||||
FM_OPL2BOARD = 25, /* OPL2Board (External Device) */
|
||||
FM_MAX = 26
|
||||
};
|
||||
|
||||
enum fm_driver {
|
||||
@@ -47,17 +70,59 @@ extern uint8_t fm_driver_get(int chip_id, fm_drv_t *drv);
|
||||
extern const fm_drv_t nuked_opl_drv;
|
||||
extern const fm_drv_t ymfm_drv;
|
||||
extern const fm_drv_t esfmu_opl_drv;
|
||||
extern const fm_drv_t ymfm_opl2board_drv;
|
||||
|
||||
#ifdef EMU_DEVICE_H
|
||||
extern const device_t ym3812_nuked_device;
|
||||
extern const device_t ymf262_nuked_device;
|
||||
|
||||
extern const device_t ym2149_ymfm_device;
|
||||
|
||||
/* OPL Series */
|
||||
extern const device_t ym3526_ymfm_device;
|
||||
extern const device_t y8950_ymfm_device;
|
||||
extern const device_t ym3812_ymfm_device;
|
||||
extern const device_t ymf262_ymfm_device;
|
||||
extern const device_t ymf289b_ymfm_device;
|
||||
extern const device_t ymf278b_ymfm_device;
|
||||
extern const device_t ym2413_ymfm_device;
|
||||
extern const device_t ym2423_ymfm_device;
|
||||
extern const device_t ymf281_ymfm_device;
|
||||
extern const device_t ds1001_ymfm_device;
|
||||
|
||||
/* OPM Series */
|
||||
extern const device_t ym2151_ymfm_device;
|
||||
|
||||
/* OPN Series */
|
||||
extern const device_t ym2203_ymfm_device;
|
||||
extern const device_t ym2608_ymfm_device;
|
||||
extern const device_t ymf288_ymfm_device;
|
||||
extern const device_t ym2610_ymfm_device;
|
||||
extern const device_t ym2610b_ymfm_device;
|
||||
extern const device_t ym2612_ymfm_device;
|
||||
extern const device_t ym3438_ymfm_device;
|
||||
extern const device_t ymf276_ymfm_device;
|
||||
|
||||
/* OPP Series */
|
||||
extern const device_t ym2164_ymfm_device;
|
||||
|
||||
/* OPQ Series */
|
||||
extern const device_t ym3806_ymfm_device;
|
||||
|
||||
/* OPX Series */
|
||||
#if 0
|
||||
extern const device_t ymf271_ymfm_device;
|
||||
#endif
|
||||
|
||||
/* OPZ Series */
|
||||
extern const device_t ym2414_ymfm_device;
|
||||
|
||||
extern const device_t esfm_esfmu_device;
|
||||
|
||||
#ifdef USE_LIBSERIALPORT
|
||||
extern const device_t ym_opl2board_device;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif /*SOUND_OPL_H*/
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
void *sid_init(void);
|
||||
void *sid_init(uint8_t type);
|
||||
void sid_close(void *priv);
|
||||
void sid_reset(void *priv);
|
||||
uint8_t sid_read(uint16_t addr, void *priv);
|
||||
|
||||
@@ -11,9 +11,11 @@
|
||||
* Authors: Sarah Walker, <https://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* TheCollector1995, <mariogplayer@gmail.com>
|
||||
* Jasmine Iwanek, <jriwanek@gmail.com>
|
||||
*
|
||||
* Copyright 2008-2018 Sarah Walker.
|
||||
* Copyright 2016-2018 Miran Grca.
|
||||
* Copyright 2024-2025 Jasmine Iwanek.
|
||||
*/
|
||||
|
||||
#ifndef SOUND_SND_SB_H
|
||||
@@ -27,15 +29,19 @@
|
||||
|
||||
enum {
|
||||
SADLIB = 1, /* No DSP */
|
||||
SB1, /* DSP v1.05 */
|
||||
SB15, /* DSP v2.00 */
|
||||
SB2, /* DSP v2.01 - needed for high-speed DMA */
|
||||
SBPRO, /* DSP v3.00 */
|
||||
SBPRO2, /* DSP v3.02 + OPL3 */
|
||||
SB16, /* DSP v4.05 + OPL3 */
|
||||
SBAWE32, /* DSP v4.12 + OPL3 */
|
||||
SBAWE32PNP, /* DSP v4.13 + OPL3 */
|
||||
SBAWE64 /* DSP v4.16 + OPL3 */
|
||||
SB_DSP_105, /* DSP v1.05, Original CT1320 (Also known as CT1310) */
|
||||
SB_DSP_200, /* DSP v2.00 */
|
||||
SB_DSP_201, /* DSP v2.01 - needed for high-speed DMA, Seen on CT1350B with CT1336 */
|
||||
SB_DSP_202, /* DSP v2.02 - Seen on CT1350B with CT1336A */
|
||||
SBPRO_DSP_300, /* DSP v3.00 */
|
||||
SBPRO2_DSP_302, /* DSP v3.02 + OPL3 */
|
||||
SB16_DSP_404, /* DSP v4.05 + OPL3 */
|
||||
SB16_DSP_405, /* DSP v4.05 + OPL3 */
|
||||
SB16_DSP_406, /* DSP v4.06 + OPL3 */
|
||||
SB16_DSP_411, /* DSP v4.11 + OPL3 */
|
||||
SBAWE32_DSP_412, /* DSP v4.12 + OPL3 */
|
||||
SBAWE32_DSP_413, /* DSP v4.13 + OPL3 */
|
||||
SBAWE64_DSP_416 /* DSP v4.16 + OPL3 */
|
||||
};
|
||||
|
||||
/* SB 2.0 CD version */
|
||||
@@ -182,6 +188,7 @@ typedef struct sb_t {
|
||||
void *gameport;
|
||||
|
||||
int pnp;
|
||||
int has_ide;
|
||||
|
||||
uint8_t pos_regs[8];
|
||||
uint8_t pnp_rom[512];
|
||||
@@ -195,6 +202,12 @@ typedef struct sb_t {
|
||||
void (*opl_mix)(void*, double*, double*);
|
||||
} sb_t;
|
||||
|
||||
typedef struct goldfinch_t {
|
||||
emu8k_t emu8k;
|
||||
|
||||
uint8_t pnp_rom[512];
|
||||
} goldfinch_t;
|
||||
|
||||
extern void sb_ct1345_mixer_write(uint16_t addr, uint8_t val, void *priv);
|
||||
extern uint8_t sb_ct1345_mixer_read(uint16_t addr, void *priv);
|
||||
extern void sb_ct1345_mixer_reset(sb_t *sb);
|
||||
|
||||
@@ -20,6 +20,9 @@ typedef struct sn76489_t {
|
||||
int freqhi[4];
|
||||
int vol[4];
|
||||
uint32_t shift;
|
||||
uint32_t white_noise_tap_1;
|
||||
uint32_t white_noise_tap_2;
|
||||
uint32_t feedback_mask;
|
||||
uint8_t noise;
|
||||
int lasttone;
|
||||
uint8_t firstdat;
|
||||
|
||||
@@ -109,6 +109,8 @@ extern void givealbuffer_wt(const void *buf);
|
||||
extern void givealbuffer_cd(const void *buf);
|
||||
|
||||
#define sb_vibra16c_onboard_relocate_base sb_vibra16s_onboard_relocate_base
|
||||
#define sb_vibra16cl_onboard_relocate_base sb_vibra16s_onboard_relocate_base
|
||||
#define sb_vibra16xv_onboard_relocate_base sb_vibra16s_onboard_relocate_base
|
||||
extern void sb_vibra16s_onboard_relocate_base(uint16_t new_addr, void *priv);
|
||||
|
||||
#ifdef EMU_DEVICE_H
|
||||
@@ -143,26 +145,34 @@ extern const device_t sb_pro_v2_device;
|
||||
extern const device_t sb_pro_mcv_device;
|
||||
extern const device_t sb_pro_compat_device;
|
||||
extern const device_t sb_16_device;
|
||||
extern const device_t sb_vibra16s_onboard_device;
|
||||
extern const device_t sb_vibra16s_device;
|
||||
extern const device_t sb_vibra16xv_device;
|
||||
extern const device_t sb_vibra16c_onboard_device;
|
||||
extern const device_t sb_vibra16c_device;
|
||||
extern const device_t sb_vibra16cl_onboard_device;
|
||||
extern const device_t sb_vibra16cl_device;
|
||||
extern const device_t sb_vibra16s_onboard_device;
|
||||
extern const device_t sb_vibra16s_device;
|
||||
extern const device_t sb_vibra16xv_onboard_device;
|
||||
extern const device_t sb_vibra16xv_device;
|
||||
extern const device_t sb_16_pnp_device;
|
||||
extern const device_t sb_16_pnp_ide_device;
|
||||
extern const device_t sb_16_compat_device;
|
||||
extern const device_t sb_16_compat_nompu_device;
|
||||
extern const device_t sb_16_reply_mca_device;
|
||||
extern const device_t sb_goldfinch_device;
|
||||
extern const device_t sb_32_pnp_device;
|
||||
extern const device_t sb_awe32_device;
|
||||
extern const device_t sb_awe32_pnp_device;
|
||||
extern const device_t sb_awe64_value_device;
|
||||
extern const device_t sb_awe64_device;
|
||||
extern const device_t sb_awe64_ide_device;
|
||||
extern const device_t sb_awe64_gold_device;
|
||||
|
||||
/* Crystal CS423x */
|
||||
extern const device_t cs4235_device;
|
||||
extern const device_t cs4235_onboard_device;
|
||||
extern const device_t cs4236_onboard_device;
|
||||
extern const device_t cs4236b_device;
|
||||
extern const device_t cs4236b_onboard_device;
|
||||
extern const device_t cs4237b_device;
|
||||
extern const device_t cs4238b_device;
|
||||
|
||||
@@ -177,6 +187,7 @@ extern const device_t ess_soundpiper_32_mca_device;
|
||||
extern const device_t ess_chipchat_16_mca_device;
|
||||
|
||||
/* Ensoniq AudioPCI */
|
||||
extern const device_t es1370_device;
|
||||
extern const device_t es1371_device;
|
||||
extern const device_t es1371_onboard_device;
|
||||
extern const device_t es1373_device;
|
||||
@@ -192,6 +203,7 @@ extern const device_t ps1snd_device;
|
||||
|
||||
/* Innovation SSI-2001 */
|
||||
extern const device_t ssi2001_device;
|
||||
extern const device_t entertainer_device;
|
||||
|
||||
/* Pro Audio Spectrum Plus, 16, and 16D */
|
||||
extern const device_t pasplus_device;
|
||||
@@ -209,6 +221,11 @@ extern const device_t tndy_device;
|
||||
extern const device_t wss_device;
|
||||
extern const device_t ncr_business_audio_device;
|
||||
|
||||
#ifdef USE_LIBSERIALPORT
|
||||
/* External Audio device OPL2Board (Host Connected hardware)*/
|
||||
extern const device_t opl2board_device;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif /*EMU_SOUND_H*/
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
*
|
||||
* Copyright 2020 Miran Grca.
|
||||
*/
|
||||
#ifndef EMU_VERSION_H
|
||||
#define EMU_VERSION_H
|
||||
|
||||
#define _LSTR(s) L ## s
|
||||
#define LSTR(s) _LSTR(s)
|
||||
@@ -58,3 +60,5 @@
|
||||
# define EMU_DOCS_URL "https://86box.readthedocs.io"
|
||||
#endif
|
||||
#define EMU_DOCS_URL_W LSTR(EMU_DOCS_URL)
|
||||
|
||||
#endif /*EMU_VERSION_H*/
|
||||
|
||||
@@ -41,6 +41,10 @@ typedef union {
|
||||
|
||||
typedef struct ibm8514_t {
|
||||
rom_t bios_rom;
|
||||
rom_t bios_rom2;
|
||||
mem_mapping_t bios_mapping;
|
||||
uint8_t *rom1;
|
||||
uint8_t *rom2;
|
||||
hwcursor8514_t hwcursor;
|
||||
hwcursor8514_t hwcursor_latch;
|
||||
uint8_t pos_regs[8];
|
||||
@@ -50,7 +54,7 @@ typedef struct ibm8514_t {
|
||||
int type;
|
||||
int local;
|
||||
int bpp;
|
||||
int on[2];
|
||||
int on;
|
||||
int accel_bpp;
|
||||
|
||||
uint32_t vram_size;
|
||||
@@ -100,6 +104,8 @@ typedef struct ibm8514_t {
|
||||
uint16_t frgd_mix;
|
||||
uint16_t multifunc_cntl;
|
||||
uint16_t multifunc[16];
|
||||
uint16_t clip_right;
|
||||
uint16_t clip_bottom;
|
||||
int16_t clip_left;
|
||||
int16_t clip_top;
|
||||
uint8_t pix_trans[2];
|
||||
@@ -110,8 +116,6 @@ typedef struct ibm8514_t {
|
||||
int x3;
|
||||
int y1;
|
||||
int y2;
|
||||
int sys_cnt;
|
||||
int sys_cnt2;
|
||||
int temp_cnt;
|
||||
int16_t cx;
|
||||
int16_t cx_back;
|
||||
@@ -125,21 +129,16 @@ typedef struct ibm8514_t {
|
||||
int16_t err;
|
||||
uint32_t src;
|
||||
uint32_t dest;
|
||||
uint32_t newsrc_blt;
|
||||
uint32_t newdest_blt;
|
||||
uint32_t newdest_in;
|
||||
uint32_t newdest_out;
|
||||
uint8_t *writemono;
|
||||
uint8_t *nibbleset;
|
||||
int x_count;
|
||||
int xx_count;
|
||||
int y_count;
|
||||
int input;
|
||||
int input2;
|
||||
int output;
|
||||
int output2;
|
||||
|
||||
uint16_t cur_x_bit12;
|
||||
uint16_t cur_y_bit12;
|
||||
int ssv_len;
|
||||
int ssv_len_back;
|
||||
uint8_t ssv_dir;
|
||||
uint8_t ssv_draw;
|
||||
int odd_in;
|
||||
@@ -154,7 +153,6 @@ typedef struct ibm8514_t {
|
||||
} accel;
|
||||
|
||||
uint16_t test;
|
||||
int vendor_mode[2];
|
||||
int h_blankstart;
|
||||
int h_blank_end_val;
|
||||
int hblankstart;
|
||||
@@ -203,18 +201,23 @@ typedef struct ibm8514_t {
|
||||
int hsync_width;
|
||||
int htotal;
|
||||
int hdisp;
|
||||
int hdisp2;
|
||||
int hdisped;
|
||||
int sc;
|
||||
int vsyncstart;
|
||||
int vsyncwidth;
|
||||
int vtotal;
|
||||
int v_disp;
|
||||
int v_disp2;
|
||||
int vdisp;
|
||||
int vdisp2;
|
||||
int disp_cntl;
|
||||
int interlace;
|
||||
uint8_t subsys_cntl;
|
||||
uint8_t subsys_stat;
|
||||
|
||||
atomic_int fifo_idx;
|
||||
atomic_int ext_fifo_idx;
|
||||
atomic_int force_busy;
|
||||
atomic_int force_busy2;
|
||||
|
||||
@@ -225,6 +228,11 @@ typedef struct ibm8514_t {
|
||||
int ext_pitch;
|
||||
int ext_crt_pitch;
|
||||
int extensions;
|
||||
int linear;
|
||||
uint32_t vram_amount;
|
||||
int vram_512k_8514;
|
||||
int vendor_mode;
|
||||
PALETTE _8514pal;
|
||||
|
||||
latch8514_t latch;
|
||||
} ibm8514_t;
|
||||
|
||||
25
src/include/86box/vid_8514a_device.h
Normal file
25
src/include/86box/vid_8514a_device.h
Normal file
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* 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 8514/A card from IBM for the MCA bus and
|
||||
* generic ISA bus clones without vendor extensions.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: TheCollector1995
|
||||
*
|
||||
* Copyright 2024 TheCollector1995.
|
||||
*/
|
||||
#ifndef VIDEO_8514A_DEVICE_H
|
||||
#define VIDEO_8514A_DEVICE_H
|
||||
|
||||
#ifdef EMU_DEVICE_H
|
||||
extern const device_t ibm8514_mca_device;
|
||||
extern const device_t gen8514_isa_device;
|
||||
#endif
|
||||
#endif /*VIDEO_XGA_DEVICE_H*/
|
||||
@@ -47,7 +47,8 @@ typedef struct ati_eeprom_t {
|
||||
} ati_eeprom_t;
|
||||
|
||||
void ati_eeprom_load(ati_eeprom_t *eeprom, char *fn, int type);
|
||||
void ati_eeprom_load_mach8(ati_eeprom_t *eeprom, char *fn);
|
||||
void ati_eeprom_load_mach8(ati_eeprom_t *eeprom, char *fn, int mca);
|
||||
void ati_eeprom_load_mach8_vga(ati_eeprom_t *eeprom, char *fn);
|
||||
void ati_eeprom_write(ati_eeprom_t *eeprom, int ena, int clk, int dat);
|
||||
int ati_eeprom_read(ati_eeprom_t *eeprom);
|
||||
|
||||
|
||||
@@ -41,8 +41,6 @@ typedef struct mach_t {
|
||||
int ramdac_type;
|
||||
int old_mode;
|
||||
|
||||
uint32_t memory;
|
||||
|
||||
uint16_t config1;
|
||||
uint16_t config2;
|
||||
|
||||
@@ -73,9 +71,7 @@ typedef struct mach_t {
|
||||
uint8_t bank_r;
|
||||
uint16_t shadow_set;
|
||||
uint16_t shadow_cntl;
|
||||
int ext_on[2];
|
||||
int extended_mode;
|
||||
int compat_mode;
|
||||
int override_resolution;
|
||||
|
||||
struct {
|
||||
uint8_t line_idx;
|
||||
@@ -84,6 +80,12 @@ typedef struct mach_t {
|
||||
uint8_t patt_len;
|
||||
uint8_t pix_trans[2];
|
||||
uint8_t eeprom_control;
|
||||
uint8_t alu_bg_fn;
|
||||
uint8_t alu_fg_fn;
|
||||
uint16_t clip_left;
|
||||
uint16_t clip_right;
|
||||
uint16_t clip_top;
|
||||
uint16_t clip_bottom;
|
||||
uint16_t dest_x_end;
|
||||
uint16_t dest_x_start;
|
||||
uint16_t dest_y_end;
|
||||
@@ -102,14 +104,14 @@ typedef struct mach_t {
|
||||
uint16_t ge_offset_hi;
|
||||
uint16_t linedraw_opt;
|
||||
uint16_t max_waitstates;
|
||||
uint8_t patt_data_idx;
|
||||
uint8_t patt_data[0x18];
|
||||
uint16_t scan_to_x;
|
||||
uint16_t scratch0;
|
||||
uint16_t scratch1;
|
||||
uint16_t test;
|
||||
uint16_t pattern;
|
||||
uint16_t test2;
|
||||
int patt_data_idx_reg;
|
||||
int patt_data_idx;
|
||||
int src_y_dir;
|
||||
int cmd_type;
|
||||
int block_write_mono_pattern_enable;
|
||||
@@ -144,9 +146,8 @@ typedef struct mach_t {
|
||||
int stepx;
|
||||
int stepy;
|
||||
int src_stepx;
|
||||
uint8_t color_pattern[16];
|
||||
uint8_t color_pattern_full[32];
|
||||
uint16_t color_pattern_word[8];
|
||||
uint8_t mono_pattern_normal[16];
|
||||
uint8_t color_pattern[32];
|
||||
int mono_pattern[8][8];
|
||||
uint32_t ge_offset;
|
||||
uint32_t crt_offset;
|
||||
|
||||
@@ -31,6 +31,8 @@ typedef struct cga_t {
|
||||
uint8_t cgamode;
|
||||
uint8_t cgacol;
|
||||
|
||||
uint8_t lp_strobe;
|
||||
|
||||
int fontbase;
|
||||
int linepos;
|
||||
int displine;
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
|
||||
typedef struct ogc_t {
|
||||
cga_t cga;
|
||||
uint16_t ctrl_addr;
|
||||
/* unused in OGC, required for M19 video card structure idiom */
|
||||
uint8_t ctrl_3dd;
|
||||
uint8_t ctrl_3de;
|
||||
|
||||
@@ -79,6 +79,7 @@ typedef struct svga_t {
|
||||
uint8_t fcr;
|
||||
uint8_t hblank_overscan;
|
||||
uint8_t vidsys_ena;
|
||||
uint8_t sleep;
|
||||
|
||||
int dac_addr;
|
||||
int dac_pos;
|
||||
@@ -87,6 +88,7 @@ typedef struct svga_t {
|
||||
int dac_b;
|
||||
int vtotal;
|
||||
int dispend;
|
||||
int vdisp;
|
||||
int vsyncstart;
|
||||
int split;
|
||||
int vblankstart;
|
||||
@@ -170,9 +172,11 @@ typedef struct svga_t {
|
||||
|
||||
pc_timer_t timer;
|
||||
pc_timer_t timer8514;
|
||||
pc_timer_t timer_xga;
|
||||
|
||||
double clock;
|
||||
double clock8514;
|
||||
double clock_xga;
|
||||
|
||||
double multiplier;
|
||||
|
||||
@@ -185,6 +189,7 @@ typedef struct svga_t {
|
||||
|
||||
void (*render)(struct svga_t *svga);
|
||||
void (*render8514)(struct svga_t *svga);
|
||||
void (*render_xga)(struct svga_t *svga);
|
||||
void (*recalctimings_ex)(struct svga_t *svga);
|
||||
|
||||
void (*video_out)(uint16_t addr, uint8_t val, void *priv);
|
||||
@@ -198,6 +203,14 @@ typedef struct svga_t {
|
||||
|
||||
void (*vblank_start)(struct svga_t *svga);
|
||||
|
||||
void (*write)(uint32_t addr, uint8_t val, void *priv);
|
||||
void (*writew)(uint32_t addr, uint16_t val, void *priv);
|
||||
void (*writel)(uint32_t addr, uint32_t val, void *priv);
|
||||
|
||||
uint8_t (*read)(uint32_t addr, void *priv);
|
||||
uint16_t (*readw)(uint32_t addr, void *priv);
|
||||
uint32_t (*readl)(uint32_t addr, void *priv);
|
||||
|
||||
void (*ven_write)(struct svga_t *svga, uint8_t val, uint32_t addr);
|
||||
float (*getclock)(int clock, void *priv);
|
||||
float (*getclock8514)(int clock, void *priv);
|
||||
@@ -299,8 +312,7 @@ typedef struct svga_t {
|
||||
void * xga;
|
||||
} svga_t;
|
||||
|
||||
extern int vga_on;
|
||||
|
||||
extern void ibm8514_set_poll(svga_t *svga);
|
||||
extern void ibm8514_poll(void *priv);
|
||||
extern void ibm8514_recalctimings(svga_t *svga);
|
||||
extern uint8_t ibm8514_ramdac_in(uint16_t port, void *priv);
|
||||
@@ -315,16 +327,21 @@ extern void ibm8514_accel_out_pixtrans(svga_t *svga, uint16_t port, uint32_t
|
||||
extern void ibm8514_short_stroke_start(int count, int cpu_input, uint32_t mix_dat, uint32_t cpu_dat, svga_t *svga, uint8_t ssv, int len);
|
||||
extern void ibm8514_accel_start(int count, int cpu_input, uint32_t mix_dat, uint32_t cpu_dat, svga_t *svga, int len);
|
||||
|
||||
#ifdef ATI_8514_ULTRA
|
||||
extern void ati8514_out(uint16_t addr, uint8_t val, void *priv);
|
||||
extern uint8_t ati8514_in(uint16_t addr, void *priv);
|
||||
extern void ati8514_recalctimings(svga_t *svga);
|
||||
extern uint8_t ati8514_mca_read(int port, void *priv);
|
||||
extern void ati8514_mca_write(int port, uint8_t val, void *priv);
|
||||
extern void ati8514_pos_write(uint16_t port, uint8_t val, void *priv);
|
||||
extern void ati8514_init(svga_t *svga, void *ext8514, void *dev8514);
|
||||
#endif
|
||||
|
||||
extern void xga_poll(void *priv, svga_t *svga);
|
||||
extern void xga_recalctimings(svga_t *svga);
|
||||
extern void xga_write_test(uint32_t addr, uint8_t val, void *priv);
|
||||
extern uint8_t xga_read_test(uint32_t addr, void *priv);
|
||||
extern void xga_set_poll(svga_t *svga);
|
||||
extern void xga_poll(void *priv);
|
||||
extern void xga_recalctimings(svga_t *svga);
|
||||
|
||||
extern uint32_t svga_decode_addr(svga_t *svga, uint32_t addr, int write);
|
||||
|
||||
extern int svga_init(const device_t *info, svga_t *svga, void *priv, int memsize,
|
||||
void (*recalctimings_ex)(struct svga_t *svga),
|
||||
@@ -367,6 +384,8 @@ uint32_t svga_mask_addr(uint32_t addr, svga_t *svga);
|
||||
uint32_t svga_mask_changedaddr(uint32_t addr, svga_t *svga);
|
||||
|
||||
void svga_doblit(int wx, int wy, svga_t *svga);
|
||||
void svga_set_poll(svga_t *svga);
|
||||
void svga_poll(void *priv);
|
||||
|
||||
enum {
|
||||
RAMDAC_6BIT = 0,
|
||||
@@ -394,6 +413,9 @@ extern void att498_ramdac_out(uint16_t addr, int rs2, uint8_t val, void *priv
|
||||
extern uint8_t att498_ramdac_in(uint16_t addr, int rs2, void *priv, svga_t *svga);
|
||||
extern float av9194_getclock(int clock, void *priv);
|
||||
|
||||
extern void bt481_ramdac_out(uint16_t addr, int rs2, uint8_t val, void *priv, svga_t *svga);
|
||||
extern uint8_t bt481_ramdac_in(uint16_t addr, int rs2, void *priv, svga_t *svga);
|
||||
|
||||
extern void bt48x_ramdac_out(uint16_t addr, int rs2, int rs3, uint8_t val, void *priv, svga_t *svga);
|
||||
extern uint8_t bt48x_ramdac_in(uint16_t addr, int rs2, int rs3, void *priv, svga_t *svga);
|
||||
extern void bt48x_recalctimings(void *priv, svga_t *svga);
|
||||
@@ -450,6 +472,7 @@ extern const device_t att491_ramdac_device;
|
||||
extern const device_t att492_ramdac_device;
|
||||
extern const device_t att498_ramdac_device;
|
||||
extern const device_t av9194_device;
|
||||
extern const device_t bt481_ramdac_device;
|
||||
extern const device_t bt484_ramdac_device;
|
||||
extern const device_t att20c504_ramdac_device;
|
||||
extern const device_t bt485_ramdac_device;
|
||||
|
||||
@@ -28,10 +28,8 @@ typedef struct vga_t {
|
||||
rom_t bios_rom;
|
||||
} vga_t;
|
||||
|
||||
static video_timings_t timing_vga = { VIDEO_ISA, 8, 16, 32, 8, 16, 32 };
|
||||
|
||||
void vga_out(uint16_t addr, uint8_t val, void *priv);
|
||||
uint8_t vga_in(uint16_t addr, void *priv);
|
||||
extern void vga_out(uint16_t addr, uint8_t val, void *priv);
|
||||
extern uint8_t vga_in(uint16_t addr, void *priv);
|
||||
|
||||
void vga_disable(void* p);
|
||||
void vga_enable(void* p);
|
||||
|
||||
@@ -2157,6 +2157,12 @@ voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo_params_t *params,
|
||||
addbyte(0xc2);
|
||||
}
|
||||
|
||||
addbyte(0xf3); /*MOVQ XMM15(colbfog), XMM0 */
|
||||
addbyte(0x44);
|
||||
addbyte(0x0f);
|
||||
addbyte(0x7e);
|
||||
addbyte(0xf8);
|
||||
|
||||
if (params->fogMode & FOG_ENABLE) {
|
||||
if (params->fogMode & FOG_CONSTANT) {
|
||||
addbyte(0x66); /*MOVD XMM3, params->fogColor[ESI]*/
|
||||
@@ -2580,17 +2586,17 @@ voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo_params_t *params,
|
||||
addbyte(0xef);
|
||||
addbyte(0xe4);
|
||||
break;
|
||||
case AFUNC_ASATURATE:
|
||||
addbyte(0x66); /*PMULLW XMM4, XMM11(minus_254)*/
|
||||
case AFUNC_ACOLORBEFOREFOG:
|
||||
addbyte(0x66); /*PMULLW XMM4, XMM15(colbfog)*/
|
||||
addbyte(0x41);
|
||||
addbyte(0x0f);
|
||||
addbyte(0xd5);
|
||||
addbyte(0xe3);
|
||||
addbyte(0xe7);
|
||||
addbyte(0xf3); /*MOVQ XMM5, XMM4*/
|
||||
addbyte(0x0f);
|
||||
addbyte(0x7e);
|
||||
addbyte(0xec);
|
||||
addbyte(0x66); /*PADDW XMM4, alookup[1*8]*/
|
||||
addbyte(0x66); /*PADDW XMM4, R10(alookup)[1*8]*/
|
||||
addbyte(0x41);
|
||||
addbyte(0x0f);
|
||||
addbyte(0xfd);
|
||||
@@ -2610,6 +2616,7 @@ voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo_params_t *params,
|
||||
addbyte(0x71);
|
||||
addbyte(0xd4);
|
||||
addbyte(8);
|
||||
break;
|
||||
}
|
||||
|
||||
switch (src_afunc) {
|
||||
@@ -2762,7 +2769,36 @@ voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo_params_t *params,
|
||||
addbyte(0xef);
|
||||
addbyte(0xc0);
|
||||
break;
|
||||
case AFUNC_ACOLORBEFOREFOG:
|
||||
case AFUNC_ASATURATE:
|
||||
addbyte(0x66); /*PMULLW XMM0, XMM11(minus_254)*/
|
||||
addbyte(0x41);
|
||||
addbyte(0x0f);
|
||||
addbyte(0xd5);
|
||||
addbyte(0xc3);
|
||||
addbyte(0xf3); /*MOVQ XMM5, XMM0*/
|
||||
addbyte(0x0f);
|
||||
addbyte(0x7e);
|
||||
addbyte(0xe8);
|
||||
addbyte(0x66); /*PADDW XMM0, alookup[1*8]*/
|
||||
addbyte(0x41);
|
||||
addbyte(0x0f);
|
||||
addbyte(0xfd);
|
||||
addbyte(0x42);
|
||||
addbyte(8 * 2);
|
||||
addbyte(0x66); /*PSRLW XMM5, 8*/
|
||||
addbyte(0x0f);
|
||||
addbyte(0x71);
|
||||
addbyte(0xd5);
|
||||
addbyte(8);
|
||||
addbyte(0x66); /*PADDW XMM0, XMM5*/
|
||||
addbyte(0x0f);
|
||||
addbyte(0xfd);
|
||||
addbyte(0xc5);
|
||||
addbyte(0x66); /*PSRLW XMM0, 8*/
|
||||
addbyte(0x0f);
|
||||
addbyte(0x71);
|
||||
addbyte(0xd0);
|
||||
addbyte(8);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -408,6 +408,7 @@ typedef struct voodoo_t {
|
||||
atomic_int cmd_read;
|
||||
atomic_int cmd_written;
|
||||
atomic_int cmd_written_fifo;
|
||||
atomic_int cmd_written_fifo_2;
|
||||
|
||||
voodoo_params_t params_buffer[PARAM_SIZE];
|
||||
atomic_int params_read_idx[4];
|
||||
@@ -426,7 +427,20 @@ typedef struct voodoo_t {
|
||||
uint32_t cmdfifo_amax;
|
||||
int cmdfifo_holecount;
|
||||
|
||||
atomic_uint cmd_status;
|
||||
uint32_t cmdfifo_base_2;
|
||||
uint32_t cmdfifo_end_2;
|
||||
uint32_t cmdfifo_size_2;
|
||||
int cmdfifo_rp_2;
|
||||
int cmdfifo_ret_addr_2;
|
||||
int cmdfifo_in_sub_2;
|
||||
atomic_int cmdfifo_depth_rd_2;
|
||||
atomic_int cmdfifo_depth_wr_2;
|
||||
atomic_int cmdfifo_enabled_2;
|
||||
uint32_t cmdfifo_amin_2;
|
||||
uint32_t cmdfifo_amax_2;
|
||||
int cmdfifo_holecount_2;
|
||||
|
||||
atomic_uint cmd_status, cmd_status_2;
|
||||
|
||||
uint32_t sSetupMode;
|
||||
vert_t verts[4];
|
||||
|
||||
@@ -338,17 +338,22 @@ enum {
|
||||
};
|
||||
|
||||
enum {
|
||||
LFB_FORMAT_RGB565 = 0,
|
||||
LFB_FORMAT_RGB555 = 1,
|
||||
LFB_FORMAT_ARGB1555 = 2,
|
||||
LFB_FORMAT_ARGB8888 = 5,
|
||||
LFB_FORMAT_DEPTH = 15,
|
||||
LFB_FORMAT_MASK = 15
|
||||
LFB_FORMAT_RGB565 = 0,
|
||||
LFB_FORMAT_RGB555 = 1,
|
||||
LFB_FORMAT_ARGB1555 = 2,
|
||||
LFB_FORMAT_XRGB8888 = 4,
|
||||
LFB_FORMAT_ARGB8888 = 5,
|
||||
LFB_FORMAT_DEPTH_RGB565 = 12,
|
||||
LFB_FORMAT_DEPTH_RGB555 = 13,
|
||||
LFB_FORMAT_DEPTH_ARGB1555 = 14,
|
||||
LFB_FORMAT_DEPTH = 15,
|
||||
LFB_FORMAT_MASK = 15
|
||||
};
|
||||
|
||||
enum {
|
||||
LFB_WRITE_COLOUR = 1,
|
||||
LFB_WRITE_DEPTH = 2
|
||||
LFB_WRITE_DEPTH = 2,
|
||||
LFB_WRITE_BOTH = 4
|
||||
};
|
||||
|
||||
enum {
|
||||
|
||||
@@ -210,11 +210,10 @@ void voodoo_codegen_close(voodoo_t *voodoo);
|
||||
newdest_g = (dest_g * (255 - dest_a)) / 255; \
|
||||
newdest_b = (dest_b * (255 - dest_a)) / 255; \
|
||||
break; \
|
||||
case AFUNC_ASATURATE: \
|
||||
_a = MIN(src_a, 1 - dest_a); \
|
||||
newdest_r = (dest_r * _a) / 255; \
|
||||
newdest_g = (dest_g * _a) / 255; \
|
||||
newdest_b = (dest_b * _a) / 255; \
|
||||
case AFUNC_ACOLORBEFOREFOG: \
|
||||
newdest_r = (dest_r * colbfog_r) / 255; \
|
||||
newdest_g = (dest_g * colbfog_g) / 255; \
|
||||
newdest_b = (dest_b * colbfog_b) / 255; \
|
||||
break; \
|
||||
} \
|
||||
\
|
||||
@@ -254,8 +253,11 @@ void voodoo_codegen_close(voodoo_t *voodoo);
|
||||
src_g = (src_g * (255 - dest_a)) / 255; \
|
||||
src_b = (src_b * (255 - dest_a)) / 255; \
|
||||
break; \
|
||||
case AFUNC_ACOLORBEFOREFOG: \
|
||||
fatal("AFUNC_ACOLORBEFOREFOG\n"); \
|
||||
case AFUNC_ASATURATE: \
|
||||
_a = MIN(src_a, 255 - dest_a); \
|
||||
src_r = (dest_r * _a) / 255; \
|
||||
src_g = (dest_g * _a) / 255; \
|
||||
src_b = (dest_b * _a) / 255; \
|
||||
break; \
|
||||
} \
|
||||
\
|
||||
|
||||
@@ -35,7 +35,7 @@ typedef struct xga_t {
|
||||
mem_mapping_t linear_mapping;
|
||||
mem_mapping_t video_mapping;
|
||||
rom_t bios_rom;
|
||||
rom_t vga_bios_rom;
|
||||
rom_t bios_rom2;
|
||||
xga_hwcursor_t hwcursor;
|
||||
xga_hwcursor_t hwcursor_latch;
|
||||
PALETTE extpal;
|
||||
@@ -47,6 +47,8 @@ typedef struct xga_t {
|
||||
|
||||
uint8_t pos_regs[8];
|
||||
uint8_t disp_addr;
|
||||
uint8_t dac_mask;
|
||||
uint8_t dac_status;
|
||||
uint8_t cfg_reg;
|
||||
uint8_t instance;
|
||||
uint8_t op_mode;
|
||||
@@ -85,6 +87,8 @@ typedef struct xga_t {
|
||||
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;
|
||||
|
||||
@@ -106,6 +110,10 @@ typedef struct xga_t {
|
||||
uint16_t old_pal_addr_idx;
|
||||
uint16_t sprite_pal_addr_idx_prefetch;
|
||||
|
||||
int dac_addr;
|
||||
int dac_pos;
|
||||
int dac_r;
|
||||
int dac_g;
|
||||
int v_total;
|
||||
int dispend;
|
||||
int v_syncstart;
|
||||
@@ -143,6 +151,7 @@ typedef struct xga_t {
|
||||
int a5_test;
|
||||
int type;
|
||||
int bus;
|
||||
int busy;
|
||||
|
||||
uint32_t linear_base;
|
||||
uint32_t linear_size;
|
||||
@@ -161,6 +170,9 @@ typedef struct xga_t {
|
||||
uint32_t write_bank;
|
||||
uint32_t px_map_base;
|
||||
uint32_t pallook[512];
|
||||
uint32_t bios_diag;
|
||||
|
||||
PALETTE xgapal;
|
||||
|
||||
uint64_t dispontime;
|
||||
uint64_t dispofftime;
|
||||
@@ -228,8 +240,6 @@ typedef struct xga_t {
|
||||
uint16_t px_map_height[4];
|
||||
uint32_t px_map_base[4];
|
||||
} accel;
|
||||
|
||||
int big_endian_linear;
|
||||
} xga_t;
|
||||
|
||||
#endif /*VIDEO_XGA_H*/
|
||||
|
||||
@@ -329,13 +329,14 @@ extern const device_t ati18800_device;
|
||||
|
||||
/* ATi 28800 */
|
||||
extern const device_t ati28800_device;
|
||||
extern const device_t ati28800_wonder1024d_xl_plus_device;
|
||||
extern const device_t ati28800k_device;
|
||||
extern const device_t ati28800k_spc4620p_device;
|
||||
extern const device_t ati28800k_spc6033p_device;
|
||||
extern const device_t compaq_ati28800_device;
|
||||
# if defined(DEV_BRANCH) && defined(USE_XL24)
|
||||
# ifdef USE_XL24
|
||||
extern const device_t ati28800_wonderxl24_device;
|
||||
# endif
|
||||
# endif /* USE_XL24 */
|
||||
|
||||
/* Bochs */
|
||||
extern const device_t bochs_svga_device;
|
||||
@@ -451,7 +452,7 @@ extern const device_t mystique_220_device;
|
||||
extern const device_t millennium_ii_device;
|
||||
#ifdef USE_G100
|
||||
extern const device_t productiva_g100_device;
|
||||
#endif
|
||||
#endif /* USE_G100 */
|
||||
|
||||
/* Oak OTI-0x7 */
|
||||
extern const device_t oti037c_device;
|
||||
@@ -530,7 +531,9 @@ extern const device_t s3_trio64v2_dx_onboard_pci_device;
|
||||
|
||||
/* S3 ViRGE */
|
||||
extern const device_t s3_virge_325_pci_device;
|
||||
extern const device_t s3_virge_325_onboard_pci_device;
|
||||
extern const device_t s3_diamond_stealth_2000_pci_device;
|
||||
extern const device_t s3_mirocrystal_3d_pci_device;
|
||||
extern const device_t s3_diamond_stealth_3000_pci_device;
|
||||
extern const device_t s3_stb_velocity_3d_pci_device;
|
||||
extern const device_t s3_virge_375_pci_device;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
*
|
||||
* Authors: Miran Grca, <mgrca8@gmail.com>
|
||||
*
|
||||
* Copyright 2018-2019 Miran Grca.
|
||||
* Copyright 2018-2025 Miran Grca.
|
||||
*/
|
||||
|
||||
#ifndef EMU_ZIP_H
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
#define ZIP_250_SECTORS (489532)
|
||||
|
||||
#define ZIP_IMAGE_HISTORY 4
|
||||
#define ZIP_IMAGE_HISTORY 10
|
||||
|
||||
enum {
|
||||
ZIP_BUS_DISABLED = 0,
|
||||
@@ -39,85 +39,79 @@ enum {
|
||||
};
|
||||
|
||||
typedef struct zip_drive_t {
|
||||
uint8_t id;
|
||||
uint8_t id;
|
||||
|
||||
union {
|
||||
uint8_t res;
|
||||
uint8_t res0; /* Reserved for other ID's. */
|
||||
uint8_t res1;
|
||||
uint8_t ide_channel;
|
||||
uint8_t scsi_device_id;
|
||||
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;
|
||||
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;
|
||||
FILE * fp;
|
||||
void * priv;
|
||||
|
||||
char image_path[1024];
|
||||
char prev_image_path[1024];
|
||||
char image_path[1024];
|
||||
char prev_image_path[1024];
|
||||
|
||||
char *image_history[ZIP_IMAGE_HISTORY];
|
||||
char * image_history[ZIP_IMAGE_HISTORY];
|
||||
|
||||
uint32_t is_250;
|
||||
uint32_t medium_size;
|
||||
uint32_t base;
|
||||
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;
|
||||
zip_drive_t * drv;
|
||||
#ifdef EMU_IDE_H
|
||||
ide_tf_t * tf;
|
||||
ide_tf_t * tf;
|
||||
#else
|
||||
void * tf;
|
||||
void * tf;
|
||||
#endif
|
||||
|
||||
uint8_t *buffer;
|
||||
uint8_t atapi_cdb[16];
|
||||
uint8_t current_cdb[16];
|
||||
uint8_t sense[256];
|
||||
void * log;
|
||||
|
||||
#ifdef ANCIENT_CODE
|
||||
/* Task file. */
|
||||
uint8_t features;
|
||||
uint8_t phase;
|
||||
uint16_t request_length;
|
||||
uint8_t status;
|
||||
uint8_t error;
|
||||
uint16_t pad;
|
||||
uint32_t pos;
|
||||
#endif
|
||||
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;
|
||||
uint8_t id;
|
||||
uint8_t cur_lun;
|
||||
uint8_t pad0;
|
||||
uint8_t pad1;
|
||||
|
||||
uint16_t max_transfer_len;
|
||||
uint16_t pad2;
|
||||
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 pad3;
|
||||
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 sector_pos;
|
||||
uint32_t sector_len;
|
||||
uint32_t packet_len;
|
||||
|
||||
double callback;
|
||||
double callback;
|
||||
|
||||
uint8_t (*ven_cmd)(void *sc, uint8_t *cdb, int32_t *BufLen);
|
||||
} zip_t;
|
||||
|
||||
extern zip_t *zip[ZIP_NUM];
|
||||
@@ -127,6 +121,7 @@ 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]
|
||||
|
||||
@@ -134,15 +129,16 @@ extern uint8_t scsi_zip_drives[16];
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern void zip_disk_close(zip_t *dev);
|
||||
extern void zip_disk_reload(zip_t *dev);
|
||||
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_load(zip_t *dev, char *fn);
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user