Merge branch 'master' into pc98x1

This commit is contained in:
TC1995
2024-07-10 19:41:43 +02:00
856 changed files with 81878 additions and 66645 deletions

View File

@@ -21,7 +21,7 @@
#define EMU_86BOX_H
/* Configuration values. */
#define SERIAL_MAX 4
#define SERIAL_MAX 7
#define PARALLEL_MAX 4
#define SCREEN_RES_X 640
#define SCREEN_RES_Y 480
@@ -35,6 +35,9 @@
#define MAX_PREV_IMAGES 4
#define MAX_IMAGE_PATH_LEN 2048
/* Max UUID Length */
#define MAX_UUID_LEN 64
/* Default language 0xFFFF = from system, 0x409 = en-US */
#define DEFAULT_LANGUAGE 0x0409
@@ -124,6 +127,7 @@ extern int video_framerate; /* (C) video */
extern int gfxcard[2]; /* (C) graphics/video card */
extern char video_shader[512]; /* (C) video */
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 isamem_type[]; /* (C) enable ISA mem cards */
@@ -140,10 +144,13 @@ extern int fpu_type; /* (C) fpu type */
extern int fpu_softfloat; /* (C) fpu uses softfloat */
extern int time_sync; /* (C) enable time sync */
extern int hdd_format_type; /* (C) hard disk file format */
extern int lba_enhancer_enabled; /* (C) enable Vision Systems LBA Enhancer */
extern int confirm_reset; /* (C) enable reset confirmation */
extern int confirm_exit; /* (C) enable exit confirmation */
extern int confirm_save; /* (C) enable save confirmation */
extern int enable_discord; /* (C) enable Discord integration */
extern int 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 fixed_size_x;
extern int fixed_size_y;
@@ -165,10 +172,11 @@ extern uint16_t key_prefix_2_2;
extern uint16_t key_uncapture_1;
extern uint16_t key_uncapture_2;
extern char exe_path[2048]; /* path (dir) of executable */
extern char usr_path[1024]; /* path (dir) of user data */
extern char cfg_path[1024]; /* full path of config file */
extern int open_dir_usr_path; /* default file open dialog directory of usr_path */
extern char exe_path[2048]; /* path (dir) of executable */
extern char usr_path[1024]; /* path (dir) of user data */
extern char cfg_path[1024]; /* full path of config file */
extern int open_dir_usr_path; /* default file open dialog directory of usr_path */
extern char uuid[MAX_UUID_LEN]; /* UUID or machine identifier */
#ifndef USE_NEW_DYNAREC
extern FILE *stdlog; /* file to log output to */
#endif

View File

@@ -52,12 +52,14 @@ extern "C" {
#define ACPI_ENABLE 0xf1
#define ACPI_DISABLE 0xf0
#define VEN_ALI 0x010b9
#define VEN_INTEL 0x08086
#define VEN_SIS 0x01039
#define VEN_SMC 0x01055
#define VEN_VIA 0x01106
#define VEN_VIA_596B 0x11106
#define VEN_ALI 0x010b9
#define VEN_INTEL 0x08086
#define VEN_SIS_5582 0x01039
#define VEN_SIS_5595_1997 0x11039
#define VEN_SIS_5595 0x21039
#define VEN_SMC 0x01055
#define VEN_VIA 0x01106
#define VEN_VIA_596B 0x11106
typedef struct acpi_regs_t {
uint8_t acpitst;
@@ -76,6 +78,25 @@ typedef struct acpi_regs_t {
uint8_t gporeg[4];
uint8_t extiotrapsts;
uint8_t extiotrapen;
uint8_t enter_c2_ps;
uint8_t enter_c3_ps;
uint8_t reg_12;
uint8_t reg_13;
uint8_t smi_cmd;
uint8_t reg_24;
uint8_t reg_25;
uint8_t reg_26;
uint8_t smi_en_val;
uint8_t smi_dis_val;
uint8_t mail_box;
uint8_t reg_2b;
uint8_t gp_tmr;
uint8_t leg_sts;
uint8_t leg_en;
uint8_t tst_ctl;
uint8_t reg_34;
uint8_t index;
uint8_t reg_ff;
uint16_t pmsts;
uint16_t pmen;
uint16_t pmcntrl;
@@ -91,6 +112,15 @@ typedef struct acpi_regs_t {
uint16_t gpsmien;
uint16_t pscntrl;
uint16_t gpscists;
uint16_t reg_14;
uint16_t reg_16;
uint16_t reg_18;
uint16_t reg_1a;
uint16_t reg_1c;
uint16_t gpe_mul;
uint16_t gpe_ctl;
uint16_t gpe_smi;
uint16_t gpe_rl;
int smi_lock;
int smi_active;
uint32_t pcntrl;
@@ -107,7 +137,12 @@ typedef struct acpi_regs_t {
uint32_t gpo_val;
uint32_t gpi_val;
uint32_t extsmi_val;
uint32_t pad0;
uint32_t reg_0c;
uint32_t gpe_sts;
uint32_t gpe_en;
uint32_t gpe_pin;
uint32_t gpe_io;
uint32_t gpe_pol;
} acpi_regs_t;
typedef struct acpi_t {
@@ -128,11 +163,15 @@ typedef struct acpi_t {
pc_timer_t timer;
pc_timer_t resume_timer;
pc_timer_t pwrbtn_timer;
pc_timer_t gp_timer;
pc_timer_t per_timer;
nvr_t *nvr;
apm_t *apm;
void *i2c;
void (*trap_update)(void *priv);
void *trap_priv;
void *smbus;
void *priv;
} acpi_t;
/* Global variables. */
@@ -145,6 +184,9 @@ extern const device_t acpi_intel_device;
extern const device_t acpi_smc_device;
extern const device_t acpi_via_device;
extern const device_t acpi_via_596b_device;
extern const device_t acpi_sis_5582_device;
extern const device_t acpi_sis_5595_1997_device;
extern const device_t acpi_sis_5595_device;
/* Functions */
extern void acpi_update_irq(acpi_t *dev);
@@ -163,6 +205,12 @@ extern void acpi_set_nvr(acpi_t *dev, nvr_t *nvr);
extern void acpi_set_trap_update(acpi_t *dev, void (*update)(void *priv), void *priv);
extern uint8_t acpi_ali_soft_smi_status_read(acpi_t *dev);
extern void acpi_ali_soft_smi_status_write(acpi_t *dev, uint8_t soft_smi);
extern void * acpi_get_smbus(void *priv);
extern void acpi_sis5582_pmu_event(void *priv);
extern void acpi_sis5595_smi_raise(void *priv);
extern void acpi_sis5595_pmu_event(void *priv);
extern void acpi_sis5595_smbus_event(void *priv);
extern void acpi_sis5595_software_smi(void *priv);
#ifdef __cplusplus
}

View File

@@ -40,91 +40,55 @@
#include <stdint.h>
#ifdef HAVE_BYTESWAP_H
# include <byteswap.h>
#else
# define bswap_16(x) \
( \
((uint16_t)( \
(((uint16_t)(x) & (uint16_t)0x00ffU) << 8) | \
(((uint16_t)(x) & (uint16_t)0xff00U) >> 8) )) \
)
#define bswap_16(x) \
((uint16_t)((((x) & 0x00ffu) << 8) | \
(((x) & 0xff00u) >> 8)))
# define bswap_32(x) \
( \
((uint32_t)( \
(((uint32_t)(x) & (uint32_t)0x000000ffUL) << 24) | \
(((uint32_t)(x) & (uint32_t)0x0000ff00UL) << 8) | \
(((uint32_t)(x) & (uint32_t)0x00ff0000UL) >> 8) | \
(((uint32_t)(x) & (uint32_t)0xff000000UL) >> 24) )) \
)
#define bswap_32(x) \
((uint32_t)((((x) & 0x000000fful) << 24) | \
(((x) & 0x0000ff00ul) << 8) | \
(((x) & 0x00ff0000ul) >> 8) | \
(((x) & 0xff000000ul) >> 24)))
# define bswap_64(x) \
( \
((uint64_t)( \
(uint64_t)(((uint64_t)(x) & (uint64_t)0x00000000000000ffULL) << 56) | \
(uint64_t)(((uint64_t)(x) & (uint64_t)0x000000000000ff00ULL) << 40) | \
(uint64_t)(((uint64_t)(x) & (uint64_t)0x0000000000ff0000ULL) << 24) | \
(uint64_t)(((uint64_t)(x) & (uint64_t)0x00000000ff000000ULL) << 8) | \
(uint64_t)(((uint64_t)(x) & (uint64_t)0x000000ff00000000ULL) >> 8) | \
(uint64_t)(((uint64_t)(x) & (uint64_t)0x0000ff0000000000ULL) >> 24) | \
(uint64_t)(((uint64_t)(x) & (uint64_t)0x00ff000000000000ULL) >> 40) | \
(uint64_t)(((uint64_t)(x) & (uint64_t)0xff00000000000000ULL) >> 56) )) \
)
#endif /*HAVE_BYTESWAP_H*/
# define bswap_64(x) \
((uint64_t)((((x) & 0x00000000000000ffull) << 56) | \
(((x) & 0x000000000000ff00ull) << 40) | \
(((x) & 0x0000000000ff0000ull) << 24) | \
(((x) & 0x00000000ff000000ull) << 8) | \
(((x) & 0x000000ff00000000ull) >> 8) | \
(((x) & 0x0000ff0000000000ull) >> 24) | \
(((x) & 0x00ff000000000000ull) >> 40) | \
(((x) & 0xff00000000000000ull) >> 56)))
#if __GNUC__ >= 10
#if defined __has_builtin && __has_builtin(__builtin_bswap16)
#define bswap16(x) __builtin_bswap16(x)
#else
static __inline uint16_t bswap16(uint16_t x)
{
return bswap_16(x);
}
# endif
#else
static __inline uint16_t
bswap16(uint16_t x)
{
#if defined (__GNUC__) || defined (__clang__)
return __builtin_bswap16(x);
#else
return bswap_16(x);
}
#endif
}
#if __GNUC__ >= 10
# if defined __has_builtin && __has_builtin(__builtin_bswap32)
# define bswap32(x) __builtin_bswap32(x)
# else
static __inline uint32_t
bswap32(uint32_t x)
{
return bswap_32(x);
}
# endif
#if defined (__GNUC__) || defined (__clang__)
return __builtin_bswap32(x);
#else
static __inline uint32_t
bswap32(uint32_t x)
{
return bswap_32(x);
}
#endif
}
#if __GNUC__ >= 10
# if defined __has_builtin && __has_builtin(__builtin_bswap64)
# define bswap64(x) __builtin_bswap64(x)
# else
static __inline uint64_t
bswap64(uint64_t x)
{
return bswap_64(x);
}
# endif
#if defined (__GNUC__) || defined (__clang__)
return __builtin_bswap64(x);
#else
static __inline uint64_t
bswap64(uint64_t x)
{
return bswap_64(x);
}
return bswap_16(x);
#endif
}
static __inline void
bswap16s(uint16_t *s)
@@ -198,12 +162,10 @@ CPU_CONVERT(le, 64, uint64_t)
/* unaligned versions (optimized for frequent unaligned accesses)*/
#if defined(__i386__) || defined(__powerpc__)
# define cpu_to_le16wu(p, v) cpu_to_le16w(p, v)
# define cpu_to_le32wu(p, v) cpu_to_le32w(p, v)
# define le16_to_cpupu(p) le16_to_cpup(p)
# define le32_to_cpupu(p) le32_to_cpup(p)
# define cpu_to_be16wu(p, v) cpu_to_be16w(p, v)
# define cpu_to_be32wu(p, v) cpu_to_be32w(p, v)

View File

@@ -199,10 +199,11 @@ 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 (*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);
} cdrom_ops_t;
@@ -240,8 +241,6 @@ typedef struct cdrom {
uint32_t cd_end;
uint32_t type;
int host_drive;
int prev_host_drive;
int cd_buflen;
int audio_op;
int audio_muted_soft;
@@ -305,11 +304,9 @@ extern void cdrom_reload(uint8_t id);
extern int cdrom_image_open(cdrom_t *dev, const char *fn);
extern void cdrom_image_close(cdrom_t *dev);
extern void cdrom_image_reset(cdrom_t *dev);
extern void cdrom_ioctl_eject(void);
extern void cdrom_ioctl_load(void);
extern int cdrom_ioctl_open(cdrom_t *dev, const char d);
extern int cdrom_ioctl_open(cdrom_t *dev, const char *drv);
extern void cdrom_ioctl_close(cdrom_t *dev);
extern void cdrom_update_cdb(uint8_t *cdb, int lba_pos,
int number_of_blocks);

View File

@@ -78,8 +78,8 @@ typedef struct 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 int cdi_get_audio_tracks(cd_img_t *cdi, int *st_track, int *end, TMSF *lead_out);
extern int cdi_get_audio_tracks_lba(cd_img_t *cdi, int *st_track, int *end, uint32_t *lead_out);
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);

View File

@@ -0,0 +1,32 @@
/*
* 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*/

View File

@@ -24,6 +24,7 @@ extern const device_t acc2168_device;
extern const device_t ali1217_device;
extern const device_t ali1429_device;
extern const device_t ali1429g_device;
extern const device_t ali1409_device;
extern const device_t ali1435_device;
extern const device_t ali1489_device;
extern const device_t ali1531_device;
@@ -130,8 +131,16 @@ extern const device_t sis_85c471_device;
extern const device_t sis_85c496_device;
extern const device_t sis_85c496_ls486e_device;
extern const device_t sis_85c50x_device;
extern const device_t sis_550x_85c503_device;
extern const device_t sis_85c50x_5503_device;
extern const device_t sis_550x_device;
extern const device_t sis_5511_device;
extern const device_t sis_5571_device;
extern const device_t sis_5581_device;
extern const device_t sis_5591_1997_device;
extern const device_t sis_5591_device;
extern const device_t sis_5600_1997_device;
extern const device_t sis_5600_device;
/* ST */
extern const device_t stpc_client_device;
@@ -144,6 +153,8 @@ extern const device_t stpc_lpt_device;
/* UMC */
extern const device_t umc_8886f_device;
extern const device_t umc_8886af_device;
extern const device_t umc_8886bf_device;
extern const device_t umc_8890_device;
extern const device_t umc_hb4_device;
/* VIA */

View File

@@ -114,6 +114,7 @@ typedef struct config_t {
/* Other peripherals category */
int fdc_type; /* Floppy disk controller type */
int hdc_current; /* Hard disk controller type */
int hdc; /* Hard disk controller */
int scsi_card; /* SCSI controller */
int ide_ter_enabled; /* Tertiary IDE controller enabled */

View File

@@ -57,6 +57,7 @@
#define CONFIG_MIDI_OUT (3 | CONFIG_TYPE_INT) /* config_get_int() */
#define CONFIG_SPINNER (4 | CONFIG_TYPE_INT) /* config_get_int() */
#define CONFIG_MIDI_IN (5 | CONFIG_TYPE_INT) /* config_get_int() */
#define CONFIG_MEMORY (6 | CONFIG_TYPE_INT) /* config_get_int() */
#define CONFIG_STRING (0 | CONFIG_TYPE_STRING) /* config_get_string() */
#define CONFIG_FNAME (1 | CONFIG_TYPE_STRING) /* config_get_string() */
@@ -101,9 +102,7 @@ enum {
DEVICE_LPT = 0x200000, /* requires a parallel port */
DEVICE_KBC = 0x400000, /* is a keyboard controller */
DEVICE_ONBOARD = 0x20000000, /* is on-board */
DEVICE_EXTPARAMS = 0x40000000, /* accepts extended parameters */
DEVICE_ONBOARD = 0x40000000, /* is on-board */
DEVICE_PIT = 0x80000000, /* device is a PIT */
DEVICE_ALL = 0xffffffff /* match all devices */
@@ -202,21 +201,15 @@ 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_parameters(const device_t *dev, void *params);
extern void *device_add_linked(const device_t *d, 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_parameters(const device_t *dev, void *priv, void *params);
extern void device_add_ex_params(const device_t *dev, void *priv, void *params);
extern void *device_add_inst(const device_t *dev, int inst);
extern void *device_add_inst_parameters(const device_t *dev, int inst, void *params);
extern void *device_add_inst_params(const device_t *dev, int inst, void *params);
extern void device_add_inst_ex(const device_t *dev, void *priv, int inst);
extern void device_add_inst_ex_parameters(const device_t *dev, void *priv, int inst, void *params);
extern void *device_cadd(const device_t *dev, const device_t *cd);
extern void *device_cadd_parameters(const device_t *dev, const device_t *cd, void *params);
extern void device_cadd_ex(const device_t *dev, const device_t *cd, void *priv);
extern void device_cadd_ex_parameters(const device_t *dev, const device_t *cd, void *priv, void *params);
extern void *device_cadd_inst(const device_t *dev, const device_t *cd, int inst);
extern void *device_cadd_inst_parameters(const device_t *dev, const device_t *cd, int inst, void *params);
extern void device_cadd_inst_ex(const device_t *dev, const device_t *cd, void *priv, int inst);
extern void device_cadd_inst_ex_parameters(const device_t *dev, const device_t *cd, void *priv, int inst, void *params);
extern void device_add_inst_ex_params(const device_t *dev, void *priv, int inst, void *params);
extern void *device_get_common_priv(void);
extern void device_close_all(void);
extern void device_reset_all(uint32_t match_flags);
extern void *device_find_first_priv(uint32_t match_flags);
@@ -243,7 +236,7 @@ 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 const char *device_get_config_string(const char *name);
extern const int device_get_instance(void);
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);

View File

@@ -98,6 +98,8 @@ extern void writedma2(uint8_t temp);
extern int dma_get_drq(int channel);
extern void dma_set_drq(int channel, int set);
extern int dma_channel_read_only(int channel);
extern int dma_channel_advance(int channel);
extern int dma_channel_read(int channel);
extern int dma_channel_write(int channel, uint16_t val);
@@ -120,4 +122,6 @@ void dma_high_page_init(void);
void dma_remove_sg(void);
void dma_set_sg_base(uint8_t sg_base);
extern int dma_channel_readable(int channel);
#endif /*EMU_DMA_H*/

View File

@@ -40,21 +40,23 @@ extern int fdc_type;
#define FDC_QUATERNARY_IRQ 6
#define FDC_QUATERNARY_DMA 2
#define FDC_FLAG_PCJR 0x01 /* PCjr */
#define FDC_FLAG_DISKCHG_ACTLOW 0x02 /* Amstrad, PS/1, PS/2 ISA */
#define FDC_FLAG_AT 0x04 /* AT+, PS/x */
#define FDC_FLAG_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_SEC 0x1000 /* Is Secondary */
#define FDC_FLAG_TER 0x2000 /* Is Tertiary */
#define FDC_FLAG_QUA 0x3000 /* Is Quaternary */
#define FDC_FLAG_PCJR 0x01 /* PCjr */
#define FDC_FLAG_DISKCHG_ACTLOW 0x02 /* Amstrad, PS/1, PS/2 ISA */
#define FDC_FLAG_AT 0x04 /* AT+, PS/x */
#define FDC_FLAG_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_SEC 0x10000 /* Is Secondary */
#define FDC_FLAG_TER 0x20000 /* Is Tertiary */
#define FDC_FLAG_QUA 0x40000 /* Is Quaternary */
typedef struct fdc_t {
uint8_t dor;
@@ -115,14 +117,13 @@ typedef struct fdc_t {
uint8_t rw_drive;
uint8_t lock;
uint8_t dsr;
uint8_t params[15];
uint8_t specify[2];
uint8_t res[11];
uint8_t eot[4];
uint8_t rwc[4];
uint8_t params[8];
uint8_t fifobuf[16];
uint16_t pcn[4];
@@ -145,6 +146,8 @@ typedef struct fdc_t {
int drvrate[4];
void *fifo_p;
sector_id_t read_track_sector;
sector_id_t format_sector_id;
@@ -250,6 +253,7 @@ 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_smc_device;
extern const device_t fdc_at_ali_device;
extern const device_t fdc_at_winbond_device;

View File

@@ -25,7 +25,8 @@
extern int fdc_type;
/* Controller types. */
#define FDC_INTERNAL 0
#define FDC_NONE 0
#define FDC_INTERNAL 1
extern const device_t fdc_b215_device;
extern const device_t fdc_pii151b_device;

View File

@@ -1,52 +0,0 @@
/*
* VARCem Virtual ARchaeological Computer EMulator.
* An emulator of (mostly) x86-based PC systems and devices,
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly
* spanning the era between 1981 and 1995.
*
* Definitions for the PCjs JSON floppy image format.
*
*
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
*
* Copyright 2017-2018 Fred N. van Kempen.
*
* Redistribution and use in source and binary forms, with
* or without modification, are permitted provided that the
* following conditions are met:
*
* 1. Redistributions of source code must retain the entire
* above notice, this list of conditions and the following
* disclaimer.
*
* 2. Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the
* following disclaimer in the documentation and/or other
* materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names
* of its contributors may be used to endorse or promote
* products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef EMU_FLOPPY_JSON_H
#define EMU_FLOPPY_JSON_H
extern void json_init(void);
extern void json_load(int drive, char *fn);
extern void json_close(int drive);
#endif /*EMU_FLOPPY_JSON_H*/

View File

@@ -0,0 +1,255 @@
/*
* 86Box A hypervisor and IBM PC system emulator that specializes in
* running old operating systems and software designed for IBM
* PC systems and compatibles from 1981 through fairly recent
* system designs based on the PCI bus.
*
* This file is part of the 86Box distribution.
*
* Implementation of the pcjs v2 floppy image format (read-only)
*
* Authors: cold-brewed
*
* Copyright 2024 cold-brewed
*
* More info: https://www.pcjs.org/tools/diskimage/
* pcjs disk module v2: https://github.com/jeffpar/pcjs/blob/master/machines/pcx86/modules/v2/disk.js
*/
#ifndef EMU_FLOPPY_PCJS_H
#define EMU_FLOPPY_PCJS_H
/* Currently targeting v2 of the spec */
#define PCJS_DISK_SPEC_VERSION 2
#define PCJS_MAX_TRACKS 256
#define PCJS_MAX_SIDES 2
#define PCJS_MAX_SECTORS 256
/* The json keys as defined in each sector array item */
#define PCJS_OBJECT_KEY_CYLINDER "c"
#define PCJS_OBJECT_KEY_TRACK PCJS_OBJECT_KEY_CYLINDER
#define PCJS_OBJECT_KEY_HEAD "h"
#define PCJS_OBJECT_KEY_SECTOR "s"
#define PCJS_OBJECT_KEY_LENGTH "l"
#define PCJS_OBJECT_KEY_DATA "d"
#define PCJS_OBJECT_KEY_FILE "f"
#define PCJS_OBJECT_KEY_OFFSET "d"
/* The json keys as defined in the fileTable object */
#define PCJS_OBJECT_KEY_FT_HASH "hash"
#define PCJS_OBJECT_KEY_FT_PATH "path"
#define PCJS_OBJECT_KEY_FT_ATTR "attr"
#define PCJS_OBJECT_KEY_FT_DATE "date"
#define PCJS_OBJECT_KEY_FT_SIZE "size"
/* String length defaults */
#define PCJS_IMAGE_INFO_STRING_LEN 128
#define PCJS_IMAGE_INFO_ARRAY_LEN 128
#define PCJS_FILE_TABLE_STRING_LEN 128
/* Defaults for optional json values */
#define JSON_OPTIONAL_NUMBER_DEFAULT 0
#define JSON_OPTIONAL_STRING_DEFAULT ""
/* Structure for each sector */
typedef struct pcjs_sector_t {
/* Track number */
uint8_t track;
/* Side number */
uint8_t side;
/* Sector number */
uint8_t sector;
/* Size of the sector */
uint16_t size;
/* Encoded size of the sector */
uint16_t encoded_size;
/* Pointer the the allocated data for the sector */
uint8_t *data;
/* Number of times to repeat the pattern until end of sector */
uint16_t pattern_repeat;
/* Last pattern entry to repeat */
int32_t last_entry;
/* Maps back to a file entry. -1 if not set */
int32_t file;
/* The offset in the mapped file entry. -1 if not set */
int32_t offset;
} pcjs_sector_t;
/* Cases are mixed here (some camelCase) to match the pcjs values */
typedef struct pcjs_image_info_t {
char type[PCJS_IMAGE_INFO_STRING_LEN];
char name[PCJS_IMAGE_INFO_STRING_LEN];
char format[PCJS_IMAGE_INFO_STRING_LEN];
char hash[PCJS_IMAGE_INFO_STRING_LEN];
uint32_t checksum;
uint8_t cylinders;
uint8_t heads;
uint8_t trackDefault;
uint16_t sectorDefault;
uint32_t diskSize;
uint8_t boot_sector[PCJS_IMAGE_INFO_ARRAY_LEN];
uint8_t boot_sector_array_size;
char version[PCJS_IMAGE_INFO_STRING_LEN];
char repository[PCJS_IMAGE_INFO_STRING_LEN];
} pcjs_image_info_t;
typedef struct pcjs_file_table_entry_t {
char hash[PCJS_FILE_TABLE_STRING_LEN];
char path[PCJS_FILE_TABLE_STRING_LEN];
char attr[PCJS_FILE_TABLE_STRING_LEN];
char date[PCJS_FILE_TABLE_STRING_LEN];
uint32_t size;
} pcjs_file_table_entry_t ;
typedef struct pcjs_file_table_t {
pcjs_file_table_entry_t *entries;
uint16_t num_entries;
} pcjs_file_table_t;
typedef struct pcjs_t {
/* FILE pointer for the json file */
FILE *fp;
/* These values are read in from the metadata */
/* Total number of tracks */
uint8_t total_tracks;
/* Total number of sides */
uint8_t total_sides;
/* Total number of sectors per track */
uint16_t total_sectors;
/* These values are calculated for validation */
/* Calculated number of tracks */
uint8_t calc_total_tracks;
/* Calculated number of sides */
uint8_t calc_total_sides;
/* Calculated number of sectors per track */
uint16_t calc_total_sectors;
/* Number of sectors per track */
uint8_t spt[PCJS_MAX_TRACKS][PCJS_MAX_SIDES];
/* Current track */
uint8_t current_track;
/* Current side */
uint8_t current_side;
/* Current sector */
uint8_t current_sector[PCJS_MAX_SIDES];
/* Disk is in dmf format? */
uint8_t dmf;
uint8_t interleave;
uint8_t gap2_len;
uint8_t gap3_len;
int track_width;
/* Flags for the entire disk */
uint16_t disk_flags;
/* Flags for the current track */
uint16_t track_flags;
uint8_t interleave_ordered[PCJS_MAX_TRACKS][PCJS_MAX_SIDES];
/* The main mapping of all the sectors back to each individual pcjs_sector_t item. */
pcjs_sector_t sectors[PCJS_MAX_TRACKS][PCJS_MAX_SIDES][PCJS_MAX_SECTORS];
/* Disk metadata information contained in each image */
pcjs_image_info_t image_info;
/* Optional file table mapping for each sector */
pcjs_file_table_t file_table;
} pcjs_t;
/* Errors */
enum pcjs_img_error {
E_SUCCESS = 0,
E_MISSING_KEY = 1,
E_UNEXPECTED_VALUE = 2,
E_INTEGRITY,
E_INVALID_OBJECT,
E_ALLOC,
E_PARSE,
};
typedef enum pcjs_img_error pcjs_error_t;
/* Macros */
/* Macro for getting image info metadata: strings */
#define IMAGE_INFO_GET_STRING(type) \
const cJSON * type##_json = cJSON_GetObjectItemCaseSensitive(imageInfo, #type); \
if (cJSON_IsString( type##_json) && type##_json->valuestring != NULL) { \
strncpy(dev->image_info.type, type##_json->valuestring, sizeof(dev->image_info. type) - 1); \
} else { \
pcjs_log("Required string value for \"%s\" missing from imageInfo\n", #type); \
pcjs_error = E_INVALID_OBJECT; \
return 1; \
}
/* Macro for getting image info metadata: ints */
#define IMAGE_INFO_GET_NUMBER(type) \
const cJSON * type##_json = cJSON_GetObjectItemCaseSensitive(imageInfo, #type); \
if (cJSON_IsNumber( type##_json)) { \
dev->image_info.type = type##_json->valueint; \
} else { \
pcjs_log("Required number value for \"%s\" missing from imageInfo\n", #type); \
pcjs_error = E_INVALID_OBJECT; \
return 1; \
}
/* Macro for getting required object value: number */
#define JSON_GET_OBJECT_NUMBER_REQUIRED(var, json, key) \
const cJSON *var##_json = cJSON_GetObjectItemCaseSensitive(json, key); \
if (!cJSON_IsNumber(var##_json)) { \
pcjs_log("Required number value for \"%s\" missing or invalid\n", key); \
pcjs_error = E_INVALID_OBJECT; \
goto fail; \
} else { \
var = var##_json->valueint; \
}
/* Macro for getting optional object value: number
* Default value will be used if the number does not exist */
#define JSON_GET_OBJECT_NUMBER_OPTIONAL(var, json, key) \
const cJSON *var##_json = cJSON_GetObjectItemCaseSensitive(json, key); \
if (!cJSON_IsNumber(var##_json)) { \
var = JSON_OPTIONAL_NUMBER_DEFAULT; \
} else { \
var = var##_json->valueint; \
}
/* Macro for getting optional object value: number
* Provided default value will be used if the number does not exist */
#define JSON_GET_OBJECT_NUMBER_OPTIONAL_DEFAULT(var, json, key, default) \
const cJSON *var##_json = cJSON_GetObjectItemCaseSensitive(json, key); \
if (!cJSON_IsNumber(var##_json)) { \
var = default; \
} else { \
var = var##_json->valueint; \
}
/* Macro for getting optional object value: string
* Default value will be used if the string does not exist */
#define JSON_GET_OBJECT_STRING_OPTIONAL(var, json, key) \
const cJSON * var##_json = cJSON_GetObjectItemCaseSensitive(json, key); \
if (cJSON_IsString( var##_json) && var##_json->valuestring != NULL) { \
strncpy(var, var##_json->valuestring, sizeof(var) - 1); \
} else { \
strncpy(var, JSON_OPTIONAL_STRING_DEFAULT, sizeof(var) - 1); \
}
/* Macro for getting required object value: string */
#define JSON_GET_OBJECT_STRING_REQUIRED(var, json, key) \
const cJSON * var##_json = cJSON_GetObjectItemCaseSensitive(json, key); \
if (cJSON_IsString( var##_json) && var##_json->valuestring != NULL) { \
strncpy(var, var##_json->valuestring, sizeof(var) - 1); \
} else { \
pcjs_error = E_INVALID_OBJECT; \
goto fail; \
}
extern void pcjs_init(void);
extern void pcjs_load(int drive, char *fn);
extern void pcjs_close(int drive);
extern const char* pcjs_errmsg(void);
#endif

View File

@@ -1,3 +1,6 @@
#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
@@ -71,3 +74,5 @@ extern void fifo_reset(void *priv);
extern void fifo_reset_evt(void *priv);
extern void fifo_close(void *priv);
extern void *fifo_init(int len);
#endif /*FIFO_H*/

View File

@@ -5,7 +5,7 @@
/* fc=150Hz */
static inline float
adgold_highpass_iir(int i, float NewSample)
adgold_highpass_iir(int c, int i, float NewSample)
{
float ACoef[NCoef + 1] = {
0.98657437157334349000,
@@ -19,28 +19,28 @@ adgold_highpass_iir(int i, float NewSample)
0.97261396931534050000
};
static float y[2][NCoef + 1]; /* output samples */
static float x[2][NCoef + 1]; /* input samples */
static float y[2][2][NCoef + 1]; /* output samples */
static float x[2][2][NCoef + 1]; /* input samples */
int n;
/* shift the old samples */
for (n = NCoef; n > 0; n--) {
x[i][n] = x[i][n - 1];
y[i][n] = y[i][n - 1];
x[c][i][n] = x[c][i][n - 1];
y[c][i][n] = y[c][i][n - 1];
}
/* Calculate the new output */
x[i][0] = NewSample;
y[i][0] = ACoef[0] * x[i][0];
x[c][i][0] = NewSample;
y[c][i][0] = ACoef[0] * x[c][i][0];
for (n = 1; n <= NCoef; n++)
y[i][0] += ACoef[n] * x[i][n] - BCoef[n] * y[i][n];
y[c][i][0] += ACoef[n] * x[c][i][n] - BCoef[n] * y[c][i][n];
return y[i][0];
return y[c][i][0];
}
/* fc=150Hz */
static inline float
adgold_lowpass_iir(int i, float NewSample)
adgold_lowpass_iir(int c, int i, float NewSample)
{
float ACoef[NCoef + 1] = {
0.00009159473951071446,
@@ -54,23 +54,23 @@ adgold_lowpass_iir(int i, float NewSample)
0.97261396931306277000
};
static float y[2][NCoef + 1]; /* output samples */
static float x[2][NCoef + 1]; /* input samples */
static float y[2][2][NCoef + 1]; /* output samples */
static float x[2][2][NCoef + 1]; /* input samples */
int n;
/* shift the old samples */
for (n = NCoef; n > 0; n--) {
x[i][n] = x[i][n - 1];
y[i][n] = y[i][n - 1];
x[c][i][n] = x[c][i][n - 1];
y[c][i][n] = y[c][i][n - 1];
}
/* Calculate the new output */
x[i][0] = NewSample;
y[i][0] = ACoef[0] * x[i][0];
x[c][i][0] = NewSample;
y[c][i][0] = ACoef[0] * x[c][i][0];
for (n = 1; n <= NCoef; n++)
y[i][0] += ACoef[n] * x[i][n] - BCoef[n] * y[i][n];
y[c][i][0] += ACoef[n] * x[c][i][n] - BCoef[n] * y[c][i][n];
return y[i][0];
return y[c][i][0];
}
/* fc=56Hz */
@@ -197,8 +197,8 @@ low_iir(int c, int i, double NewSample)
0.93726236021404663000
};
static double y[3][2][NCoef + 1]; /* output samples */
static double x[3][2][NCoef + 1]; /* input samples */
static double y[5][2][NCoef + 1]; /* output samples */
static double x[5][2][NCoef + 1]; /* input samples */
int n;
/* shift the old samples */
@@ -232,8 +232,8 @@ low_cut_iir(int c, int i, double NewSample)
0.93726236021916731000
};
static double y[3][2][NCoef + 1]; /* output samples */
static double x[3][2][NCoef + 1]; /* input samples */
static double y[5][2][NCoef + 1]; /* output samples */
static double x[5][2][NCoef + 1]; /* input samples */
int n;
/* shift the old samples */
@@ -266,8 +266,8 @@ high_iir(int c, int i, double NewSample)
-1.36640781670578510000,
0.52352474706139873000
};
static double y[3][2][NCoef + 1]; /* output samples */
static double x[3][2][NCoef + 1]; /* input samples */
static double y[5][2][NCoef + 1]; /* output samples */
static double x[5][2][NCoef + 1]; /* input samples */
int n;
/* shift the old samples */
@@ -300,8 +300,8 @@ high_cut_iir(int c, int i, double NewSample)
-1.36640781666419950000,
0.52352474703279628000
};
static double y[3][2][NCoef + 1]; /* output samples */
static double x[3][2][NCoef + 1]; /* input samples */
static double y[5][2][NCoef + 1]; /* output samples */
static double x[5][2][NCoef + 1]; /* input samples */
int n;
/* shift the old samples */
@@ -334,8 +334,8 @@ deemph_iir(int i, double NewSample)
-1.05429146278569141337,
0.26412280202756849290
};
static double y[3][NCoef + 1]; /* output samples */
static double x[3][NCoef + 1]; /* input samples */
static double y[5][NCoef + 1]; /* output samples */
static double x[5][NCoef + 1]; /* input samples */
int n;
/* shift the old samples */
@@ -372,8 +372,8 @@ sb_iir(int c, int i, double NewSample)
0.55326988968868285000
};
static double y[3][2][NCoef + 1]; /* output samples */
static double x[3][2][NCoef + 1]; /* input samples */
static double y[5][2][NCoef + 1]; /* output samples */
static double x[5][2][NCoef + 1]; /* input samples */
int n;
/* shift the old samples */
@@ -395,13 +395,13 @@ sb_iir(int c, int i, double NewSample)
#define NCoef 1
#define SB16_NCoef 51
extern double low_fir_sb16_coef[3][SB16_NCoef];
extern double low_fir_sb16_coef[5][SB16_NCoef];
static inline double
low_fir_sb16(int c, int i, double NewSample)
{
static double x[3][2][SB16_NCoef + 1]; // input samples
static int pos[3] = { 0, 0 };
static double x[4][2][SB16_NCoef + 1]; // input samples
static int pos[4] = { 0, 0, 0, 0 };
double out = 0.0;
int n;
@@ -422,4 +422,31 @@ low_fir_sb16(int c, int i, double NewSample)
return out;
}
extern double low_fir_pas16_coef[SB16_NCoef];
static inline double
low_fir_pas16(const int i, const double NewSample)
{
static double x[2][SB16_NCoef + 1]; // input samples
static int pos = 0;
double out = 0.0;
int n;
/* Calculate the new output */
x[i][pos] = NewSample;
for (n = 0; n < ((SB16_NCoef + 1) - pos) && n < SB16_NCoef; n++)
out += low_fir_pas16_coef[n] * x[i][n + pos];
for (; n < SB16_NCoef; n++)
out += low_fir_pas16_coef[n] * x[i][(n + pos) - (SB16_NCoef + 1)];
if (i == 1) {
pos++;
if (pos > SB16_NCoef)
pos = 0;
}
return out;
}
#endif /*EMU_FILTERS_H*/

View File

@@ -24,6 +24,10 @@
#define MAX_PLAT_JOYSTICKS 8
#define MAX_JOYSTICKS 4
#define MAX_JOY_AXES 16
#define MAX_JOY_BUTTONS 32
#define MAX_JOY_POVS 4
#define JS_TYPE_NONE 0
#define JS_TYPE_2AXIS_4BUTTON 1
#define JS_TYPE_2AXIS_6BUTTON 2
@@ -36,7 +40,6 @@
#define POV_X 0x80000000
#define POV_Y 0x40000000
#define SLIDER 0x20000000
#define AXIS_NOT_PRESENT -99999
@@ -47,46 +50,39 @@
typedef struct plat_joystick_t {
char name[260];
int a[8];
int b[32];
int p[4];
int s[2];
int a[MAX_JOY_AXES];
int b[MAX_JOY_BUTTONS];
int p[MAX_JOY_POVS];
struct {
char name[260];
int id;
} axis[8];
} axis[MAX_JOY_AXES];
struct {
char name[260];
int id;
} button[32];
} button[MAX_JOY_BUTTONS];
struct {
char name[260];
int id;
} pov[4];
struct {
char name[260];
int id;
} slider[2];
} pov[MAX_JOY_POVS];
int nr_axes;
int nr_buttons;
int nr_povs;
int nr_sliders;
} plat_joystick_t;
typedef struct joystick_t {
int axis[8];
int button[32];
int pov[4];
int axis[MAX_JOY_AXES];
int button[MAX_JOY_BUTTONS];
int pov[MAX_JOY_POVS];
int plat_joystick_nr;
int axis_mapping[8];
int button_mapping[32];
int pov_mapping[4][2];
int axis_mapping[MAX_JOY_AXES];
int button_mapping[MAX_JOY_BUTTONS];
int pov_mapping[MAX_JOY_POVS][2];
} joystick_t;
typedef struct joystick_if_t {
@@ -104,9 +100,9 @@ typedef struct joystick_if_t {
int button_count;
int pov_count;
int max_joysticks;
const char *axis_names[8];
const char *button_names[32];
const char *pov_names[4];
const char *axis_names[MAX_JOY_AXES];
const char *button_names[MAX_JOY_BUTTONS];
const char *pov_names[MAX_JOY_POVS];
} joystick_if_t;
#ifdef __cplusplus
@@ -158,6 +154,19 @@ extern void gameport_update_joystick_type(void);
extern void gameport_remap(void *priv, uint16_t address);
extern void *gameport_add(const device_t *gameport_type);
extern const joystick_if_t joystick_2axis_2button;
extern const joystick_if_t joystick_2axis_4button;
extern const joystick_if_t joystick_3axis_2button;
extern const joystick_if_t joystick_3axis_4button;
extern const joystick_if_t joystick_4axis_4button;
extern const joystick_if_t joystick_2axis_6button;
extern const joystick_if_t joystick_2axis_8button;
extern const joystick_if_t joystick_ch_flightstick_pro;
extern const joystick_if_t joystick_sw_pad;
extern const joystick_if_t joystick_tm_fcs;
#ifdef __cplusplus
}
#endif

View File

@@ -77,14 +77,24 @@ extern const device_t ide_cmd646_device; /* CMD PCI-646 *
extern const device_t ide_cmd646_legacy_only_device; /* CMD PCI-646 (Legacy Mode Only) */
extern const device_t ide_cmd646_single_channel_device; /* CMD PCI-646 (Only primary channel) */
extern const device_t ide_opti611_vlb_device; /* OPTi 82c611/611A VLB */
extern const device_t ide_opti611_vlb_sec_device; /* OPTi 82c611/611A VLB (Secondary channel) */
extern const device_t ide_opti611_vlb_device; /* OPTi 82c611/611A VLB */
extern const device_t ide_opti611_vlb_sec_device; /* OPTi 82c611/611A VLB (Secondary channel) */
extern const device_t ide_um8673f_device; /* UMC UM8673F */
extern const device_t ide_um8886af_device; /* UMC UM8886AF */
extern const device_t ide_w83769f_vlb_device; /* Winbond W83769F VLB */
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_ter_device;
extern const device_t ide_ter_pnp_device;
extern const device_t ide_qua_device;
extern const device_t ide_qua_pnp_device;
extern const device_t mcide_device;
extern const device_t xta_wdxt150_device; /* xta_wdxt150 */
extern const device_t xta_hd20_device; /* EuroPC internal */
@@ -93,6 +103,9 @@ extern const device_t xtide_at_device; /* xtide_at */
extern const device_t xtide_acculogic_device; /* xtide_ps2 */
extern const device_t xtide_at_ps2_device; /* xtide_at_ps2 */
/* Miscellaneous */
extern const device_t lba_enhancer_device;
extern void hdc_init(void);
extern void hdc_reset(void);

View File

@@ -82,7 +82,7 @@ typedef struct ide_s {
uint8_t selected;
uint8_t command;
uint8_t head;
uint8_t pad;
uint8_t params_specified;
int type;
int board;
int irqstat;
@@ -205,12 +205,14 @@ extern void win_cdrom_eject(uint8_t id);
extern void win_cdrom_reload(uint8_t id);
extern void ide_set_base_addr(int board, int base, uint16_t port);
extern void ide_set_irq(int board, int irq);
extern void ide_handlers(uint8_t board, int set);
extern void ide_board_set_force_ata3(int board, int force_ata3);
#ifdef EMU_ISAPNP_H
extern void ide_pnp_config_changed(uint8_t ld, isapnp_device_config_t *config, void *priv);
extern void ide_pnp_config_changed_1addr(uint8_t ld, isapnp_device_config_t *config, void *priv);
#endif
extern double ide_atapi_get_period(uint8_t channel);

View File

@@ -43,6 +43,7 @@ typedef struct sff8038i_t
uint8_t irq_state;
uint8_t channel;
uint8_t irq_line;
uint8_t mirq;
uint16_t base;
uint16_t pad;
uint32_t ptr;
@@ -72,10 +73,9 @@ extern void sff_bus_master_reset(sff8038i_t *dev);
extern void sff_set_slot(sff8038i_t *dev, int slot);
extern void sff_set_irq_line(sff8038i_t *dev, int irq_line);
extern void sff_set_irq_mode(sff8038i_t *dev, int irq_mode);
extern void sff_set_irq_pin(sff8038i_t *dev, int irq_pin);
extern void sff_set_irq_level(sff8038i_t *dev, int irq_level);
extern void sff_set_mirq(sff8038i_t *dev, uint8_t mirq);
#endif /*EMU_HDC_IDE_SFF8038I_H*/

View File

@@ -64,6 +64,7 @@ extern const char *isamem_get_name(int t);
extern const char *isamem_get_internal_name(int t);
extern int isamem_get_from_internal_name(const char *s);
extern const device_t *isamem_get_device(int t);
extern int isamem_has_config(int board);
#ifdef __cplusplus
}

View File

@@ -58,6 +58,7 @@ extern void isartc_reset(void);
extern const char *isartc_get_internal_name(int t);
extern int isartc_get_from_internal_name(char *s);
extern const device_t *isartc_get_device(int t);
extern int isartc_has_config(int board);
#ifdef __cplusplus
}

View File

@@ -1,43 +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 the Flight Stick Pro driver.
*
*
*
* Authors: Miran Grca, <mgrca8@gmail.com>
* Sarah Walker, <https://pcem-emulator.co.uk/>
*
* Copyright 2016-2018 Miran Grca.
* Copyright 2008-2018 Sarah Walker.
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the:
*
* Free Software Foundation, Inc.
* 59 Temple Place - Suite 330
* Boston, MA 02111-1307
* USA.
*/
#ifndef EMU_JOYSTICK_CH_FLIGHTSTICK_PRO_H
#define EMU_JOYSTICK_CH_FLIGHTSTICK_PRO_H
extern const joystick_if_t joystick_ch_flightstick_pro;
#endif /*EMU_JOYSTICK_CH_FLIGHTSTICK_PRO_H*/

View File

@@ -1,49 +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 the joystick driver.
*
*
*
* Authors: Miran Grca, <mgrca8@gmail.com>
* Sarah Walker, <https://pcem-emulator.co.uk/>
*
* Copyright 2016-2018 Miran Grca.
* Copyright 2008-2018 Sarah Walker.
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the:
*
* Free Software Foundation, Inc.
* 59 Temple Place - Suite 330
* Boston, MA 02111-1307
* USA.
*/
#ifndef EMU_JOYSTICK_STANDARD_H
#define EMU_JOYSTICK_STANDARD_H
extern const joystick_if_t joystick_2axis_2button;
extern const joystick_if_t joystick_2axis_4button;
extern const joystick_if_t joystick_3axis_2button;
extern const joystick_if_t joystick_3axis_4button;
extern const joystick_if_t joystick_4axis_4button;
extern const joystick_if_t joystick_2axis_6button;
extern const joystick_if_t joystick_2axis_8button;
#endif /*EMU_JOYSTICK_STANDARD_H*/

View File

@@ -1,43 +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 the Sidewinder Pro driver.
*
*
*
* Authors: Miran Grca, <mgrca8@gmail.com>
* Sarah Walker, <https://pcem-emulator.co.uk/>
*
* Copyright 2016-2018 Miran Grca.
* Copyright 2008-2018 Sarah Walker.
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the:
*
* Free Software Foundation, Inc.
* 59 Temple Place - Suite 330
* Boston, MA 02111-1307
* USA.
*/
#ifndef EMU_JOYSTICK_SW_PAD_H
#define EMU_JOYSTICK_SW_PAD_H
extern const joystick_if_t joystick_sw_pad;
#endif /*EMU_JOYSTICK_SW_PAD_H*/

View File

@@ -1,43 +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 the Flight Control System driver.
*
*
*
* Authors: Miran Grca, <mgrca8@gmail.com>
* Sarah Walker, <https://pcem-emulator.co.uk/>
*
* Copyright 2016-2018 Miran Grca.
* Copyright 2008-2018 Sarah Walker.
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the:
*
* Free Software Foundation, Inc.
* 59 Temple Place - Suite 330
* Boston, MA 02111-1307
* USA.
*/
#ifndef EMU_JOYSTICK_TM_FCS_H
#define EMU_JOYSTICK_TM_FCS_H
extern const joystick_if_t joystick_tm_fcs;
#endif /*EMU_JOYSTICK_TM_FCS_H*/

View File

@@ -242,9 +242,12 @@ 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_quadtel_device;
extern const device_t keyboard_ps2_pci_device;
@@ -276,6 +279,9 @@ extern int keyboard_isfsexit_up(void);
extern int keyboard_ismsexit(void);
extern void keyboard_set_is_amstrad(int ams);
extern void kbc_at_set_fast_reset(uint8_t new_fast_reset);
extern void kbc_at_handler(int set, void *priv);
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);

View File

@@ -1,284 +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 the language management module.
*
*
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
*
* Copyright 2017-2018 Fred N. van Kempen.
* Copyright 2022 Jasmine Iwanek.
*/
#ifndef LANG_UAGE_H
#define LANG_UAGE_H
/* String IDs. */
#define IDS_STRINGS 2048 // "86Box"
#define IDS_2049 2049 // "Error"
#define IDS_2050 2050 // "Fatal error"
#define IDS_2051 2051 // " - PAUSED"
#define IDS_2052 2052 // "Press Ctrl+Alt+PgDn..."
#define IDS_2053 2053 // "Speed"
#define IDS_2054 2054 // "ZIP %i (%03i): %ls"
#define IDS_2055 2055 // "ZIP images (*.IM?)\0*.IM..."
#define IDS_2056 2056 // "No usable ROM images found!"
#define IDS_2057 2057 // "(empty)"
#define IDS_2058 2058 // "ZIP images (*.IM?)\0*.IM..."
#define IDS_2059 2059 // "(Turbo)"
#define IDS_2060 2060 // "On"
#define IDS_2061 2061 // "Off"
#define IDS_2062 2062 // "All floppy images (*.DSK..."
#define IDS_2063 2063 // "Machine ""%hs"" is not..."
#define IDS_2064 2064 // "Video card ""%hs"" is not..."
#define IDS_2065 2065 // "Machine"
#define IDS_2066 2066 // "Display"
#define IDS_2067 2067 // "Input devices"
#define IDS_2068 2068 // "Sound"
#define IDS_2069 2069 // "Network"
#define IDS_2070 2070 // "Ports (COM & LPT)"
#define IDS_2071 2071 // "Storage controllers"
#define IDS_2072 2072 // "Hard disks"
#define IDS_2073 2073 // "Floppy and CD-ROM drives"
#define IDS_2074 2074 // "Other removable devices"
#define IDS_2075 2075 // "Other peripherals"
#define IDS_2076 2076 // "Surface-based images (*.8.."
#define IDS_2077 2077 // "Click to capture mouse"
#define IDS_2078 2078 // "Press F12-F8 to release mouse"
#define IDS_2079 2079 // "Press F12-F8 or middle button.."
#define IDS_2081 2081 // "Bus"
#define IDS_BUS IDS_2081 // "Bus"
#define IDS_2082 2082 // "File"
#define IDS_2083 2083 // "C"
#define IDS_2084 2084 // "H"
#define IDS_2085 2085 // "S"
#define IDS_2086 2086 // "MB"
#define IDS_MB IDS_2086 // "MB"
#define IDS_2087 2087 // "Speed"
#define IDS_2088 2088 // "Check BPB"
#define IDS_BPB IDS_2088 // "Check BPB"
#define IDS_2089 2089 // "KB"
#define IDS_KB IDS_2089 // "KB"
#define IDS_2090 2090 // "Could not initialize the video..."
#define IDS_2091 2091 // "Default"
#define IDS_DEFAULT IDS_2091 // "Default"
#define IDS_2092 2092 // "%i Wait state(s)"
#define IDS_WS IDS_2092 // "%i Wait state(s)"
#define IDS_2093 2093 // "Type"
#define IDS_TYPE IDS_2093 // "Type"
/* TODO */
#define IDS_2094 2094 // "PCap failed to set up.."
#define IDS_2095 2095 // "No PCap devices found"
#define IDS_2096 2096 // "Invalid PCap device"
#define IDS_2097 2097 // "Standard 2-button joystick(s)"
#define IDS_2098 2098 // "Standard 4-button joystick"
#define IDS_2099 2099 // "Standard 6-button joystick"
#define IDS_2100 2100 // "Standard 8-button joystick"
#define IDS_2101 2101 // "CH Flightstick Pro"
#define IDS_2102 2102 // "Microsoft SideWinder Pad"
#define IDS_2103 2103 // "Thrustmaster Flight Cont.."
#define IDS_2104 2104 // "None"
#define IDS_2105 2105 // "Unable to load keyboard..."
#define IDS_2106 2106 // "Unable to register raw input."
#define IDS_2107 2107 // "%u"
#define IDS_2108 2108 // "%u MB (CHS: %i, %i, %i)"
#define IDS_2109 2109 // "Floppy %i (%s): %ls"
#define IDS_2110 2110 // "All floppy images (*.0??;*.."
#define IDS_2112 2112 // "Unable to initialize SDL..."
#define IDS_2113 2113 // "Are you sure you want to..."
#define IDS_2114 2114 // "Are you sure you want to..."
#define IDS_2115 2115 // "Unable to initialize Ghostscript..."
#define IDS_2116 2116 // "MO %i (%03i): %ls"
#define IDS_2117 2117 // "MO images (*.IM?)\0*.IM..."
#define IDS_2118 2118 // "Welcome to 86Box!"
#define IDS_2119 2119 // "Internal controller"
#define IDS_2120 2120 // "Exit"
#define IDS_2121 2121 // "No ROMs found"
#define IDS_2122 2122 // "Do you want to save the settings?"
#define IDS_2123 2123 // "This will hard reset the emulated..."
#define IDS_2124 2124 // "Save"
#define IDS_2125 2125 // "About 86Box"
#define IDS_2126 2126 // "86Box v" EMU_VERSION
#define IDS_2127 2127 // "An emulator of old computers..."
#define IDS_2128 2128 // "OK"
#define IDS_2129 2129 // "Hardware not available"
#define IDS_2130 2130 // "Make sure " LIB_NAME_PCAP "..."
#define IDS_2131 2131 // "Invalid configuration"
#define IDS_2133 2133 // LIB_NAME_GS " is required for...
#define IDS_2135 2135 // "Entering fullscreen mode"
#define IDS_2136 2136 // "Don't show this message again"
#define IDS_2137 2137 // "Don't exit"
#define IDS_2138 2138 // "Reset"
#define IDS_2139 2139 // "Don't reset"
#define IDS_2140 2140 // "MO images (*.IM?)\0*.IM?..."
#define IDS_2141 2141 // "CD-ROM images (*.ISO;*.CU.."
#define IDS_2142 2142 // "%hs Device Configuration"
#define IDS_2143 2143 // "Monitor in sleep mode"
#define IDS_2144 2144 // "OpenGL Shaders (*.GLSL)..."
#define IDS_2145 2145 // "OpenGL options"
#define IDS_2146 2146 // "You are loading an unsupported..."
#define IDS_2147 2147 // "CPU type filtering based on..."
#define IDS_2148 2148 // "Continue"
#define IDS_2149 2149 // "Cassette: %s"
#define IDS_2150 2150 // "Cassette images (*.PCM;*.RAW;*..."
#define IDS_2151 2151 // "Cartridge %i: %ls"
#define IDS_2152 2152 // "Cartridge images (*.JRC)\0*.JRC\0..."
#define IDS_2153 2153 // "Error initializing renderer"
#define IDS_2154 2154 // "OpenGL (3.0 Core) renderer could not be initialized. Use another renderer."
#define IDS_2155 2155 // "Resume execution"
#define IDS_2156 2156 // "Pause execution"
#define IDS_2157 2157 // "Press Ctrl+Alt+Del"
#define IDS_2158 2158 // "Press Ctrl+Alt+Esc"
#define IDS_2159 2159 // "Hard reset"
#define IDS_2160 2160 // "ACPI shutdown"
#define IDS_2161 2161 // "Settings"
#define IDS_2162 2162 // "Early drive"
#define IDS_2163 2163 // "no dynarec"
#define IDS_2164 2164 // "old dynarec"
#define IDS_2165 2165 // "new dynarec"
#ifdef USE_DYNAREC
# ifdef USE_NEW_DYNAREC
# define IDS_DYNAREC IDS_2165
# else
# define IDS_DYNAREC IDS_2164
# endif
#else
# define IDS_DYNAREC IDS_2163
#endif
#define IDS_2166 2166 // "Video card #2 ""%hs"" is not..."
#define IDS_2167 2167 // "Network driver initialization failed"
#define IDS_2168 2168 // "The network configuration will be switched to the null driver"
#define IDS_4096 4096 // "Hard disk (%s)"
#define IDS_4097 4097 // "%01i:%01i"
#define IDS_4098 4098 // "%i"
#define IDS_4099 4099 // "MFM/RLL or ESDI CD-ROM driv.."
#define IDS_4100 4100 // "Custom..."
#define IDS_4101 4101 // "Custom (large)..."
#define IDS_4102 4102 // "Add New Hard Disk"
#define IDS_4103 4103 // "Add Existing Hard Disk"
#define IDS_4104 4104 // "HDI disk images cannot be..."
#define IDS_4105 4105 // "Disk images cannot be larger..."
#define IDS_4106 4106 // "Hard disk images (*.HDI;*.HD.."
#define IDS_4107 4107 // "Unable to open the file for read"
#define IDS_4108 4108 // "Unable to open the file for write"
#define IDS_4109 4109 // "HDI or HDX image with a sect.."
#define IDS_4110 4110 // "USB is not yet supported"
#define IDS_4111 4111 // "Disk image file already exists"
#define IDS_4112 4112 // "Please specify a valid file name."
#define IDS_4113 4113 // "Remember to partition and fo.."
#define IDS_4114 4114 // "Make sure the file exists and..."
#define IDS_4115 4115 // "Make sure the file is being..."
#define IDS_4116 4116 // "Disk image too large"
#define IDS_4117 4117 // "Remember to partition and format..."
#define IDS_4118 4118 // "The selected file will be..."
#define IDS_4119 4119 // "Unsupported disk image"
#define IDS_4120 4120 // "Overwrite"
#define IDS_4121 4121 // "Don't overwrite"
#define IDS_4122 4122 // "Raw image (.img)"
#define IDS_4123 4123 // "HDI image (.hdi)"
#define IDS_4124 4124 // "HDX image (.hdx)"
#define IDS_4125 4125 // "Fixed-size VHD (.vhd)"
#define IDS_4126 4126 // "Dynamic-size VHD (.vhd)"
#define IDS_4127 4127 // "Differencing VHD (.vhd)"
#define IDS_4128 4128 // "Large blocks (2 MB)"
#define IDS_4129 4129 // "Small blocks (512 KB)"
#define IDS_4130 4130 // "VHD files (*.VHD)\0*.VHD\0All..."
#define IDS_4131 4131 // "Select the parent VHD"
#define IDS_4132 4132 // "This could mean that the parent..."
#define IDS_4133 4133 // "Parent and child disk timestamps..."
#define IDS_4134 4134 // "Could not fix VHD timestamp."
#define IDS_4135 4135 // "%01i:%02i"
#define IDS_4352 4352 // "MFM/RLL"
#define IDS_4353 4353 // "XT IDE"
#define IDS_4354 4354 // "ESDI"
#define IDS_4355 4355 // "IDE"
#define IDS_4356 4356 // "ATAPI"
#define IDS_4357 4357 // "SCSI"
#define IDS_4608 4608 // "MFM/RLL (%01i:%01i)"
#define IDS_4609 4609 // "XT IDE (%01i:%01i)"
#define IDS_4610 4610 // "ESDI (%01i:%01i)"
#define IDS_4611 4611 // "IDE (%01i:%01i)"
#define IDS_4612 4612 // "ATAPI (%01i:%01i)"
#define IDS_4613 4613 // "SCSI (%02i:%02i)"
#define IDS_5120 5120 // "CD-ROM %i (%s): %s"
#define IDS_5376 5376 // "Disabled"
#define IDS_5377 5377 // <Reserved>
#define IDS_5378 5378 // <Reserved>
#define IDS_5379 5379 // <Reserved>
#define IDS_5380 5380 // <Reserved>
#define IDS_5381 5381 // "ATAPI"
#define IDS_5382 5382 // "SCSI"
#define IDS_5632 5632 // "Disabled"
#define IDS_5633 5633 // <Reserved>
#define IDS_5634 5634 // <Reserved>
#define IDS_5635 5635 // <Reserved>
#define IDS_5636 5636 // <Reserved>
#define IDS_5637 5637 // "ATAPI (%01i:%01i)"
#define IDS_5638 5638 // "SCSI (%02i:%02i)"
#define IDS_5888 5888 // "160 kB"
#define IDS_5889 5889 // "180 kB"
#define IDS_5890 5890 // "320 kB"
#define IDS_5891 5891 // "360 kB"
#define IDS_5892 5892 // "640 kB"
#define IDS_5893 5893 // "720 kB"
#define IDS_5894 5894 // "1.2 MB"
#define IDS_5895 5895 // "1.25 MB"
#define IDS_5896 5896 // "1.44 MB"
#define IDS_5897 5897 // "DMF (cluster 1024)"
#define IDS_5898 5898 // "DMF (cluster 2048)"
#define IDS_5899 5899 // "2.88 MB"
#define IDS_5900 5900 // "ZIP 100"
#define IDS_5901 5901 // "ZIP 250"
#define IDS_5902 5902 // "3.5\" 128 MB (ISO 10090)"
#define IDS_5903 5903 // "3.5\" 230 MB (ISO 13963)"
#define IDS_5904 5904 // "3.5\" 540 MB (ISO 15498)"
#define IDS_5905 5905 // "3.5\" 640 MB (ISO 15498)"
#define IDS_5906 5906 // "3.5\" 1.3 GB (GigaMO)"
#define IDS_5907 5907 // "3.5\" 2.3 GB (GigaMO 2)"
#define IDS_5908 5908 // "5.25\" 600 MB"
#define IDS_5909 5909 // "5.25\" 650 MB"
#define IDS_5910 5910 // "5.25\" 1 GB"
#define IDS_5911 5911 // "5.25\" 1.3 GB"
#define IDS_6144 6144 // "Perfect RPM"
#define IDS_6145 6145 // "1%% below perfect RPM"
#define IDS_6146 6146 // "1.5%% below perfect RPM"
#define IDS_6147 6147 // "2%% below perfect RPM"
#define IDS_7168 7168 // "(System Default)"
#define IDS_LANG_ENUS IDS_7168
#define STR_NUM_2048 121
// UNUSED: #define STR_NUM_3072 11
#define STR_NUM_4096 40
#define STR_NUM_4352 6
#define STR_NUM_4608 6
#define STR_NUM_5120 1
#define STR_NUM_5376 7
#define STR_NUM_5632 7
#define STR_NUM_5888 24
#define STR_NUM_6144 4
#define STR_NUM_7168 1
#endif /*LANG_UAGE_H*/

View File

@@ -245,8 +245,12 @@ enum {
MACHINE_CHIPSET_SIS_471,
MACHINE_CHIPSET_SIS_496,
MACHINE_CHIPSET_SIS_501,
MACHINE_CHIPSET_SIS_5501,
MACHINE_CHIPSET_SIS_5511,
MACHINE_CHIPSET_SIS_5571,
MACHINE_CHIPSET_SIS_5581,
MACHINE_CHIPSET_SIS_5591,
MACHINE_CHIPSET_SIS_5600,
MACHINE_CHIPSET_SMSC_VICTORYBX_66,
MACHINE_CHIPSET_STPC_CLIENT,
MACHINE_CHIPSET_STPC_CONSUMER_II,
@@ -457,6 +461,7 @@ extern int machine_at_quadt386sx_init(const machine_t *);
extern int machine_at_award286_init(const machine_t *);
extern int machine_at_gdc212m_init(const machine_t *);
extern int machine_at_gw286ct_init(const machine_t *);
extern int machine_at_senor_scat286_init(const machine_t *);
extern int machine_at_super286c_init(const machine_t *);
extern int machine_at_super286tr_init(const machine_t *);
extern int machine_at_spc4200p_init(const machine_t *);
@@ -486,6 +491,7 @@ extern int machine_at_325ax_init(const machine_t *);
extern int machine_at_mr1217_init(const machine_t *);
extern int machine_at_pja511m_init(const machine_t *);
extern int machine_at_prox1332_init(const machine_t *);
extern int machine_at_acer100t_init(const machine_t *);
extern int machine_at_awardsx_init(const machine_t *);
@@ -498,6 +504,7 @@ extern int machine_at_ecs386_init(const machine_t *);
extern int machine_at_spc6000a_init(const machine_t *);
extern int machine_at_micronics386_init(const machine_t *);
extern int machine_at_ecs386v_init(const machine_t *);
extern int machine_at_tandy4000_init(const machine_t *);
extern int machine_at_rycleopardlx_init(const machine_t *);
@@ -527,6 +534,7 @@ extern int machine_at_403tg_d_init(const machine_t *);
extern int machine_at_403tg_d_mr_init(const machine_t *);
extern int machine_at_pb450_init(const machine_t *);
extern int machine_at_pb450_init(const machine_t *);
extern int machine_at_aptiva510_init(const machine_t *);
extern int machine_at_pc330_6573_init(const machine_t *);
extern int machine_at_mvi486_init(const machine_t *);
@@ -651,6 +659,11 @@ extern int machine_at_p54sp4_init(const machine_t *);
extern int machine_at_sq588_init(const machine_t *);
extern int machine_at_p54sps_init(const machine_t *);
extern int machine_at_ms5109_init(const machine_t *);
extern int machine_at_torino_init(const machine_t *);
extern int machine_at_hot539_init(const machine_t *);
/* m_at_socket7_3v.c */
extern int machine_at_p54tp4xe_init(const machine_t *);
extern int machine_at_p54tp4xe_mr_init(const machine_t *);
@@ -671,14 +684,16 @@ 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_dellhannibalp_init(const machine_t *);
extern int machine_at_gw2kte_init(const machine_t *);
extern int machine_at_ap5s_init(const machine_t *);
extern int machine_at_pc140_6260_init(const machine_t *);
extern int machine_at_ms5124_init(const machine_t *);
extern int machine_at_amis727_init(const machine_t *);
extern int machine_at_vectra54_init(const machine_t *);
extern int machine_at_5sbm2_init(const machine_t *);
/* m_at_socket7.c */
extern int machine_at_acerv35n_init(const machine_t *);
extern int machine_at_p55t2p4_init(const machine_t *);
@@ -697,6 +712,7 @@ extern int machine_at_5ivg_init(const machine_t *);
extern int machine_at_8500tvxa_init(const machine_t *);
extern int machine_at_presario2240_init(const machine_t *);
extern int machine_at_presario4500_init(const machine_t *);
extern int machine_at_dellhannibalp_init(const machine_t *);
extern int machine_at_p55va_init(const machine_t *);
extern int machine_at_brio80xx_init(const machine_t *);
extern int machine_at_pb680_init(const machine_t *);
@@ -704,6 +720,7 @@ 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_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)
@@ -728,6 +745,11 @@ extern int machine_at_cb52xsi_init(const machine_t *);
extern int machine_at_m560_init(const machine_t *);
extern int machine_at_ms5164_init(const machine_t *);
extern int machine_at_sp97xv_init(const machine_t *);
extern int machine_at_sq578_init(const machine_t *);
extern int machine_at_ms5172_init(const machine_t *);
/* m_at_sockets7.c */
extern int machine_at_p5a_init(const machine_t *);
extern int machine_at_m579_init(const machine_t *);
@@ -740,6 +762,8 @@ extern int machine_at_mvp3_init(const machine_t *);
extern int machine_at_ficva503a_init(const machine_t *);
extern int machine_at_5emapro_init(const machine_t *);
extern int machine_at_5sg100_init(const machine_t *);
/* m_at_socket8.c */
extern int machine_at_ap61_init(const machine_t *);
extern int machine_at_p6rp4_init(const machine_t *);
@@ -790,6 +814,9 @@ extern int machine_at_vei8_init(const machine_t *);
extern int machine_at_borapro_init(const machine_t *);
extern int machine_at_ms6168_init(const machine_t *);
extern int machine_at_p6f99_init(const machine_t *);
extern int machine_at_m747_init(const machine_t *);
/* m_at_slot2.c */
extern int machine_at_6gxu_init(const machine_t *);
extern int machine_at_s2dge_init(const machine_t *);

View File

@@ -302,7 +302,10 @@ extern int memspeed[11];
extern int mmu_perm;
extern uint8_t high_page; /* if a high (> 4 gb) page was detected */
extern uint8_t *_mem_exec[MEM_MAPPINGS_NO];
extern uint32_t pages_sz; /* #pages in table */
extern int read_type;
extern int mem_a20_state;
extern int mem_a20_alt;

View File

@@ -102,7 +102,9 @@ 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)
extern const device_t opl4_midi_device;
# endif
# ifdef USE_FLUIDSYNTH
extern const device_t fluidsynth_device;
# endif

View File

@@ -73,6 +73,7 @@ extern const device_t mouse_ltserial_device;
extern const device_t mouse_ps2_device;
extern const device_t mouse_wacom_device;
extern const device_t mouse_wacom_artpad_device;
extern const device_t mouse_mtouch_device;
#endif
extern void mouse_clear_x(void);

View File

@@ -1,45 +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 Project.
*
* Implementation of the following network controller:
* - 3Com Etherlink 3c500/3c501 (ISA 8-bit).
*
*
*
* Based on @(#)Dev3C501.cpp Oracle (VirtualBox)
*
* Authors: TheCollector1995, <mariogplayer@gmail.com>
* Oracle
*
* Copyright 2022 TheCollector1995.
* Portions Copyright (C) 2022 Oracle and/or its affilitates.
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the:
*
* Free Software Foundation, Inc.
* 59 Temple Place - Suite 330
* Boston, MA 02111-1307
* USA.
*/
#ifndef NET_3C501_H
#define NET_3C501_H
extern const device_t threec501_device;
#endif /*NET_3C501_H*/

View File

@@ -1,49 +0,0 @@
/*
* 86Box A hypervisor and IBM PC system emulator that specializes in
* running old operating systems and software designed for IBM
* PC systems and compatibles from 1981 through fairly recent
* system designs based on the PCI bus.
*
* This file is part of the 86Box distribution.
*
* Implementation of the following network controllers:
* - 3Com Etherlink II 3c503 (ISA 8-bit).
*
*
*
* Based on @(#)3c503.cpp Carl (MAME)
*
* Authors: TheCollector1995, <mariogplayer@gmail.com>
* Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>
* Carl, <unknown e-mail address>
*
* Copyright 2018 TheCollector1995.
* Copyright 2018 Miran Grca.
* Copyright 2017-2018 Fred N. van Kempen.
* Portions Copyright (C) 2018 MAME Project
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the:
*
* Free Software Foundation, Inc.
* 59 Temple Place - Suite 330
* Boston, MA 02111-1307
* USA.
*/
#ifndef NET_3C503_H
#define NET_3C503_H
extern const device_t threec503_device;
#endif /*NET_3C503_H*/

View File

@@ -37,18 +37,15 @@
#define NET_NE2000_H
enum {
NE2K_NONE = 0,
NE2K_NE1000 = 1, /* 8-bit ISA NE1000 */
NE2K_NE2000 = 2, /* 16-bit ISA NE2000 */
NE2K_ETHERNEXT_MC = 3, /* 16-bit MCA EtherNext/MC */
NE2K_RTL8019AS = 4, /* 16-bit ISA PnP Realtek 8019AS */
NE2K_RTL8029AS = 5 /* 32-bit PCI Realtek 8029AS */
NE2K_NONE = 0,
NE2K_NE1000 = 1, /* 8-bit ISA NE1000 */
NE2K_NE1000_COMPAT = 2, /* 8-bit ISA NE1000-Compatible */
NE2K_NE2000 = 3, /* 16-bit ISA NE2000 */
NE2K_NE2000_COMPAT = 4, /* 16-bit ISA NE2000-Compatible */
NE2K_ETHERNEXT_MC = 5, /* 16-bit MCA EtherNext/MC */
NE2K_RTL8019AS = 6, /* 16-bit ISA PnP Realtek 8019AS */
NE2K_DE220P = 7, /* 16-bit ISA PnP D-Link DE-220P */
NE2K_RTL8029AS = 8 /* 32-bit PCI Realtek 8029AS */
};
extern const device_t ne1000_device;
extern const device_t ne2000_device;
extern const device_t ethernext_mc_device;
extern const device_t rtl8019as_device;
extern const device_t rtl8029as_device;
#endif /*NET_NE2000_H*/

View File

@@ -30,12 +30,4 @@ enum {
DEV_AM79C973 = 6 /* PCnet-FAST III (PCI, 10/100 Mbps) */
};
extern const device_t pcnet_am79c960_device;
extern const device_t pcnet_am79c960_eb_device;
extern const device_t pcnet_am79c960_vlb_device;
extern const device_t pcnet_am79c961_device;
extern const device_t pcnet_am79c970a_device;
extern const device_t pcnet_am79c973_device;
extern const device_t pcnet_am79c973_onboard_device;
#endif /*NET_PCNET_H*/

View File

@@ -1,26 +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 the PLIP parallel port network device.
*
*
*
* Authors: RichardG, <richardg867@gmail.com>
*
* Copyright 2020 RichardG.
*/
#ifndef NET_PLIP_H
#define NET_PLIP_H
#include <86box/device.h>
#include <86box/lpt.h>
extern const lpt_device_t lpt_plip_device;
extern const device_t plip_device;
#endif /*NET_PLIP_H*/

View File

@@ -1 +0,0 @@
extern const device_t rtl8139c_plus_device;

View File

@@ -1,4 +0,0 @@
extern const device_t dec_tulip_device;
extern const device_t dec_tulip_21140_device;
extern const device_t dec_tulip_21140_vpc_device;
extern const device_t dec_tulip_21040_device;

View File

@@ -54,11 +54,4 @@ enum {
WD8013EPA = 6
};
extern const device_t wd8003e_device;
extern const device_t wd8003eb_device;
extern const device_t wd8013ebt_device;
extern const device_t wd8003eta_device;
extern const device_t wd8003ea_device;
extern const device_t wd8013epa_device;
#endif /*NET_WD8003_H*/

View File

@@ -192,12 +192,66 @@ extern int network_card_available(int);
extern int network_card_has_config(int);
extern const char *network_card_get_internal_name(int);
extern int network_card_get_from_internal_name(char *);
#ifdef EMU_DEVICE_H
extern const device_t *network_card_getdevice(int);
#endif
extern int network_tx_pop(netcard_t *card, netpkt_t *out_pkt);
extern int network_tx_popv(netcard_t *card, netpkt_t *pkt_vec, int vec_size);
extern int network_rx_put(netcard_t *card, uint8_t *bufp, int len);
extern int network_rx_put_pkt(netcard_t *card, netpkt_t *pkt);
#ifdef EMU_DEVICE_H
/* 3Com Etherlink */
extern const device_t threec501_device;
extern const device_t threec503_device;
/* Novell NE2000 and compatibles */
extern const device_t ne1000_device;
extern const device_t ne1000_compat_device;
extern const device_t ne2000_device;
extern const device_t ne2000_compat_device;
extern const device_t ethernext_mc_device;
extern const device_t rtl8019as_device;
extern const device_t de220p_device;
extern const device_t rtl8029as_device;
/* AMD PCnet*/
extern const device_t pcnet_am79c960_device;
extern const device_t pcnet_am79c960_eb_device;
extern const device_t pcnet_am79c960_vlb_device;
extern const device_t pcnet_am79c961_device;
extern const device_t pcnet_am79c970a_device;
extern const device_t pcnet_am79c973_device;
extern const device_t pcnet_am79c973_onboard_device;
/* Modem */
extern const device_t modem_device;
/* PLIP */
#ifdef EMU_LPT_H
extern const lpt_device_t lpt_plip_device;
#endif
extern const device_t plip_device;
/* Realtek RTL8139C+ */
extern const device_t rtl8139c_plus_device;
/* DEC Tulip */
extern const device_t dec_tulip_device;
extern const device_t dec_tulip_21140_device;
extern const device_t dec_tulip_21140_vpc_device;
extern const device_t dec_tulip_21040_device;
/* WD 80x3 */
extern const device_t wd8003e_device;
extern const device_t wd8003eb_device;
extern const device_t wd8013ebt_device;
extern const device_t wd8003eta_device;
extern const device_t wd8003ea_device;
extern const device_t wd8013epa_device;
#endif
#ifdef __cplusplus
}
#endif

View File

@@ -0,0 +1,37 @@
/*
* 86Box A hypervisor and IBM PC system emulator that specializes in
* running old operating systems and software designed for IBM
* PC systems and compatibles from 1981 through fairly recent
* system designs based on the PCI bus.
*
* This file is part of the 86Box distribution.
*
* Implementation of the Novell NetWare 2.x Key Card, which
* was used for anti-piracy protection.
*
*
* Authors: Cacodemon345
*
* Copyright 2024 Cacodemon345.
*/
#ifndef NOVELL_KEYCARD_H
#define NOVELL_KEYCARD_H
/* I/O port range used. */
#define NOVELL_KEYCARD_ADDR 0x23a
#define NOVELL_KEYCARD_ADDRLEN 6
#ifdef __cplusplus
extern "C" {
#endif
/* Global variables. */
extern const device_t novell_keycard_device;
/* Functions. */
#ifdef __cplusplus
}
#endif
#endif /*BUGGER_H*/

View File

@@ -122,6 +122,8 @@ extern void nvr_at_handler(int set, uint16_t base, nvr_t *nvr);
extern void nvr_at_sec_handler(int set, uint16_t base, nvr_t *nvr);
extern void nvr_at_index_read_handler(int set, uint16_t base, nvr_t *nvr);
extern void nvr_read_addr_set(int set, nvr_t *nvr);
extern uint8_t nvr_get_index(void *priv, uint8_t addr_id);
extern void nvr_at_data_port(int set, nvr_t *nvr);
extern void nvr_wp_set(int set, int h, nvr_t *nvr);
extern void nvr_via_wp_set(int set, int reg, nvr_t *nvr);
extern void nvr_bank_set(int base, uint8_t bank, nvr_t *nvr);

View File

@@ -110,11 +110,17 @@
#define PCI_CARD_MAX (PCI_CARDS_NUM - 1)
/* The number of PCI card INT pins - always at 4 per the PCI specification. */
#define PCI_INT_PINS_NUM 4
#define PCI_INT_PINS_MAX (PCI_INT_PINS_NUM - 1)
/* The base for MIRQ lines accepted by pci_irq(). */
#define PCI_MIRQ_BASE PCI_CARDS_NUM
/* PCI MIRQ lines (currently 8, this many are needed by the ALi M1543(C). */
#define PCI_MIRQS_NUM 8
#define PCI_MIRQ_MAX (PCI_MIRQS_NUM - 1)
/* The base for internal IRQ lines accepted by pci_irq(). */
#define PCI_IIRQ_BASE 0x80
/* PCI direct IRQ lines - always at 4 per the PCI specification. */
#define PCI_IIRQS_NUM 4
#define PCI_IIRQ_MAX (PCI_IIRQS_NUM - 1)
/* The base for direct IRQ lines accepted by pci_irq(). */
#define PCI_DIRQ_BASE 0xf0
/* PCI direct IRQ lines (currently 16 because we only emulate the legacy PIC). */
@@ -148,12 +154,16 @@
#define pci_set_mirq(mirq, level, irq_state) \
pci_irq(PCI_MIRQ_BASE | (mirq), 0, level, 1, irq_state)
#define pci_set_iirq(pci_int, irq_state) \
pci_irq(PCI_IIRQ_BASE | (pci_int), 0, 0, 1, irq_state)
#define pci_set_dirq(irq, irq_state) \
pci_irq(PCI_DIRQ_BASE | (irq), 0, 1, 1, irq_state)
#define pci_set_irq(slot, pci_int, irq_state) \
pci_irq(slot, pci_int, 0, 1, irq_state)
#define pci_clear_mirq(mirq, level, irq_state) \
pci_irq(PCI_MIRQ_BASE | (mirq), 0, level, 0, irq_state)
#define pci_clear_iirq(pci_int, irq_state) \
pci_irq(PCI_IIRQ_BASE | (pci_int), 0, 0, 0, irq_state)
#define pci_clear_dirq(dirq, irq_state) \
pci_irq(PCI_DIRQ_BASE | (irq), 0, 1, 0, irq_state)
#define pci_clear_irq(slot, pci_int, irq_state) \
@@ -286,6 +296,7 @@ extern const device_t via_vp3_agp_device;
extern const device_t via_mvp3_agp_device;
extern const device_t via_apro_agp_device;
extern const device_t via_vt8601_agp_device;
extern const device_t sis_5xxx_agp_device;
#endif
#endif /*EMU_PCI_H*/

View File

@@ -42,6 +42,7 @@ typedef struct ctr_t {
int state;
int null_count;
int do_read_status;
int enable;
union {
int32_t count;
@@ -55,9 +56,11 @@ typedef struct ctr_t {
};
uint32_t l;
uint32_t lback;
uint32_t lback2;
void (*load_func)(uint8_t new_m, int new_count);
void (*out_func)(int new_out, int old_out);
void (*out_func)(int new_out, int old_out, void *priv);
} ctr_t;
typedef struct PIT {
@@ -68,8 +71,14 @@ typedef struct PIT {
ctr_t counters[3];
uint8_t ctrl;
uint64_t pit_const;
void *dev_priv;
} pit_t;
extern pit_t *ext_pit;
enum {
PIT_8253 = 0,
PIT_8254 = 1,
@@ -87,10 +96,11 @@ typedef struct pit_intf_t {
/* Sets if a counter's CLOCK input is from the timer or not - used by PCjr. */
void (*set_using_timer)(void *data, int counter_id, int using_timer);
/* Sets a counter's OUT output handler. */
void (*set_out_func)(void *data, int counter_id, void (*func)(int new_out, int old_out));
void (*set_out_func)(void *data, int counter_id, void (*func)(int new_out, int old_out, void *priv));
/* Sets a counter's load count handler. */
void (*set_load_func)(void *data, int counter_id, void (*func)(uint8_t new_m, int new_count));
void (*ctr_clock)(void *data, int counter_id);
void (*set_pit_const)(void *data, uint64_t pit_const);
void *data;
} pit_intf_t;
@@ -102,6 +112,9 @@ extern double PCICLK;
extern double AGPCLK;
extern uint64_t PITCONST;
extern uint64_t PAS16CONST;
extern uint64_t PAS16CONST2;
extern uint64_t PASSCSICONST;
extern uint64_t ISACONST;
extern uint64_t CGACONST;
extern uint64_t MDACONST;
@@ -112,21 +125,35 @@ extern uint64_t RTCCONST;
extern int refresh_at_enable;
/* Sets a counter's CLOCK input. */
extern void pit_ctr_set_clock(ctr_t *ctr, int clock);
extern void pit_device_reset(pit_t *dev);
extern pit_t *pit_common_init(int type, void (*out0)(int new_out, int old_out), void (*out1)(int new_out, int old_out));
extern void pit_change_pas16_consts(double prescale);
extern void pit_set_pit_const(void *data, uint64_t pit_const);
extern void ctr_clock(void *data, int counter_id);
/* Sets a counter's CLOCK input. */
extern void pit_ctr_set_clock(ctr_t *ctr, int clock, void *priv);
extern void pit_ctr_set_gate(void *data, int counter_id, int gate);
extern void pit_ctr_set_out_func(void *data, int counter_id, void (*func)(int new_out, int old_out, void *priv));
extern void pit_ctr_set_using_timer(void *data, int counter_id, int using_timer);
extern pit_t *pit_common_init(int type, void (*out0)(int new_out, int old_out, void *priv), void (*out1)(int new_out, int old_out, void *priv));
extern pit_t *pit_ps2_init(int type);
extern void pit_reset(pit_t *dev);
extern void pit_irq0_timer_ps2(int new_out, int old_out);
extern void pit_irq0_timer_ps2(int new_out, int old_out, void *priv);
extern void pit_refresh_timer_xt(int new_out, int old_out);
extern void pit_refresh_timer_at(int new_out, int old_out);
extern void pit_refresh_timer_xt(int new_out, int old_out, void *priv);
extern void pit_refresh_timer_at(int new_out, int old_out, void *priv);
extern void pit_speaker_timer(int new_out, int old_out);
extern void pit_speaker_timer(int new_out, int old_out, void *priv);
extern void pit_nmi_timer_ps2(int new_out, int old_out);
extern void pit_nmi_timer_ps2(int new_out, int old_out, void *priv);
extern void pit_set_clock(uint32_t clock);
extern void pit_handler(int set, uint16_t base, int size, void *priv);
@@ -136,6 +163,7 @@ extern uint8_t pit_read_reg(void *priv, uint8_t reg);
#ifdef EMU_DEVICE_H
extern const device_t i8253_device;
extern const device_t i8253_pc98_device;
extern const device_t i8253_ext_io_device;
extern const device_t i8254_device;
extern const device_t i8254_sec_device;
extern const device_t i8254_ext_io_device;

View File

@@ -56,10 +56,14 @@ typedef struct ctrf_t {
};
uint32_t l;
uint64_t pit_const;
pc_timer_t timer;
void (*load_func)(uint8_t new_m, int new_count);
void (*out_func)(int new_out, int old_out);
void (*out_func)(int new_out, int old_out, void *priv);
void *priv;
} ctrf_t;
typedef struct pitf_t {
@@ -67,8 +71,22 @@ typedef struct pitf_t {
ctrf_t counters[3];
uint8_t ctrl;
void *dev_priv;
} pitf_t;
extern void pitf_set_pit_const(void *data, uint64_t pit_const);
extern void pitf_handler(int set, uint16_t base, int size, void *priv);
extern void pitf_ctr_set_out_func(void *data, int counter_id, void (*func)(int new_out, int old_out, void *priv));
extern void pitf_ctr_set_using_timer(void *data, int counter_id, int using_timer);
extern void pitf_ctr_set_gate(void *data, int counter_id, int gate);
extern void pitf_ctr_clock(void *data, int counter_id);
extern uint8_t pitf_read_reg(void *priv, uint8_t reg);
extern const pit_intf_t pit_fast_intf;

View File

@@ -30,7 +30,27 @@
#endif
/* String ID numbers. */
#include <86box/language.h>
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_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" */
STRING_NET_ERROR_DESC, /* "The network configuration will be switched..." */
STRING_PCAP_ERROR_NO_DEVICES, /* "No PCap devices found" */
STRING_PCAP_ERROR_INVALID_DEVICE, /* "Invalid PCap device" */
STRING_PCAP_ERROR_DESC, /* "Make sure libpcap is installed..." */
STRING_GHOSTSCRIPT_ERROR_TITLE, /* "Unable to initialize Ghostscript" */
STRING_GHOSTSCRIPT_ERROR_DESC, /* "gsdll32.dll/gsdll64.dll/libgs is required..." */
STRING_HW_NOT_AVAILABLE_TITLE, /* "Hardware not available" */
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_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..." */
};
/* The Win32 API uses _wcsicmp. */
#ifdef _WIN32
@@ -107,14 +127,12 @@ extern int infocus;
extern char emu_version[200]; /* version ID string */
extern int rctrl_is_lalt;
extern int update_icons;
extern int status_icons_fullscreen;
extern int kbd_req_capture;
extern int hide_status_bar;
extern int hide_tool_bar;
/* System-related functions. */
extern char *fix_exe_path(char *str);
extern FILE *plat_fopen(const char *path, const char *mode);
extern FILE *plat_fopen64(const char *path, const char *mode);
extern void plat_remove(char *path);
@@ -122,7 +140,9 @@ extern int plat_getcwd(char *bufp, int max);
extern int plat_chdir(char *path);
extern void plat_tempfile(char *bufp, char *prefix, char *suffix);
extern void plat_get_exe_name(char *s, int size);
extern void plat_get_global_config_dir(char* strptr);
extern void plat_get_global_config_dir(char *outbuf, uint8_t len);
extern void plat_get_global_data_dir(char *outbuf, uint8_t len);
extern void plat_get_temp_dir(char *outbuf, uint8_t len);
extern void plat_init_rom_paths(void);
extern int plat_dir_check(char *path);
extern int plat_dir_create(char *path);
@@ -130,29 +150,19 @@ extern void *plat_mmap(size_t size, uint8_t executable);
extern void plat_munmap(void *ptr, size_t size);
extern uint64_t plat_timer_read(void);
extern uint32_t plat_get_ticks(void);
extern uint32_t plat_get_micro_ticks(void);
extern void plat_delay_ms(uint32_t count);
extern void plat_pause(int p);
extern void plat_mouse_capture(int on);
extern int plat_vidapi(char *name);
extern char *plat_vidapi_name(int api);
extern int plat_setvid(int api);
extern void plat_vidsize(int x, int y);
extern void plat_setfullscreen(int on);
extern void plat_resize_monitor(int x, int y, int monitor_index);
extern void plat_resize(int x, int y, int monitor_index);
extern void plat_resize_request(int x, int y, int monitor_index);
extern void plat_resize(int x, int y);
extern void plat_vidapi_enable(int enabled);
extern void plat_vidapi_reload(void);
extern void plat_vid_reload_options(void);
extern uint32_t plat_language_code(char *langcode);
extern void plat_language_code_r(uint32_t lcid, char *outbuf, int len);
extern void plat_get_cpu_string(char *outbuf, uint8_t len);
extern double plat_get_dpi(void);
extern void plat_set_thread_name(void *thread, const char *name);
/* Resource management. */
extern void set_language(uint32_t id);
extern wchar_t *plat_get_string(int id);
/* Emulator start/stop support functions. */
@@ -184,17 +194,11 @@ extern void ioctl_close(uint8_t id);
/* Other stuff. */
extern void startblit(void);
extern void endblit(void);
extern void take_screenshot(void);
/* Conversion between UTF-8 and UTF-16. */
extern size_t mbstoc16s(uint16_t dst[], const char src[], int len);
extern size_t c16stombs(char dst[], const uint16_t src[], int len);
#ifdef MTR_ENABLED
extern void init_trace(void);
extern void shutdown_trace(void);
#endif
#ifdef __cplusplus
}
#endif

View File

@@ -0,0 +1,70 @@
/*
* 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

View File

@@ -0,0 +1,23 @@
#ifndef _WIN32
# define SOCKET int
#else
# include <winsock2.h>
# include <ws2tcpip.h>
#endif
enum net_socket_types {
/* Only TCP is supported for now. */
NET_SOCKET_TCP
};
SOCKET plat_netsocket_create(int type);
SOCKET plat_netsocket_create_server(int type, unsigned short port);
void plat_netsocket_close(SOCKET socket);
SOCKET plat_netsocket_accept(SOCKET socket);
int plat_netsocket_connected(SOCKET socket); /* Returns -1 on trouble. */
int plat_netsocket_connect(SOCKET socket, const char *hostname, unsigned short port);
/* Returns 0 in case of inability to send. -1 in case of errors. */
int plat_netsocket_send(SOCKET socket, const unsigned char *data, unsigned int size, int *wouldblock);
int plat_netsocket_receive(SOCKET socket, unsigned char *data, unsigned int size, int *wouldblock);

View File

@@ -4,5 +4,6 @@
extern const lpt_device_t lpt_prt_text_device;
extern const lpt_device_t lpt_prt_escp_device;
extern const lpt_device_t lpt_prt_ps_device;
extern const lpt_device_t lpt_prt_pcl_device;
#endif /*EMU_PRT_DEVS_H*/

View File

@@ -1,524 +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.
*
* Windows resource defines.
*
*
*
* Authors: Sarah Walker, <https://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>
* David Hrdlička, <hrdlickadavid@outlook.com>
*
* Copyright 2008-2019 Sarah Walker.
* Copyright 2016-2019 Miran Grca.
* Copyright 2018-2019 David Hrdlička.
* Copyright 2021-2022 Jasmine Iwanek.
*/
#ifndef WIN_RESOURCE_H
#define WIN_RESOURCE_H
/* Dialog IDs. */
#define DLG_ABOUT 101 /* top-level dialog */
#define DLG_STATUS 102 /* top-level dialog */
#define DLG_SND_GAIN 103 /* top-level dialog */
#define DLG_NEW_FLOPPY 104 /* top-level dialog */
#define DLG_SPECIFY_DIM 105 /* top-level dialog */
#define DLG_PREFERENCES 106 /* top-level dialog */
#define DLG_CONFIG 110 /* top-level dialog */
#define DLG_CFG_MACHINE 111 /* sub-dialog of config */
#define DLG_CFG_VIDEO 112 /* sub-dialog of config */
#define DLG_CFG_INPUT 113 /* sub-dialog of config */
#define DLG_CFG_SOUND 114 /* sub-dialog of config */
#define DLG_CFG_NETWORK 115 /* sub-dialog of config */
#define DLG_CFG_PORTS 116 /* sub-dialog of config */
#define DLG_CFG_STORAGE 117 /* sub-dialog of config */
#define DLG_CFG_HARD_DISKS 118 /* sub-dialog of config */
#define DLG_CFG_HARD_DISKS_ADD 119 /* sub-dialog of config */
#define DLG_CFG_FLOPPY_AND_CDROM_DRIVES 120 /* sub-dialog of config */
#define DLG_CFG_OTHER_REMOVABLE_DEVICES 121 /* sub-dialog of config */
#define DLG_CFG_PERIPHERALS 122 /* sub-dialog of config */
/* Static text label IDs. */
/* DLG_SND_GAIN */
#define IDT_GAIN 1700 /* Gain */
/* DLG_NEW_FLOPPY */
#define IDT_FLP_FILE_NAME 1701 /* File name: */
#define IDT_FLP_DISK_SIZE 1702 /* Disk size: */
#define IDT_FLP_RPM_MODE 1703 /* RPM mode: */
#define IDT_FLP_PROGRESS 1704 /* Progress: */
/* DLG_SPECIFY_DIM */
#define IDT_WIDTH 1705 /* ??? */
#define IDT_HEIGHT 1706 /* ??? */
/* DLG_CFG_MACHINE */
#define IDT_MACHINE_TYPE 1707 /* Machine type: */
#define IDT_MACHINE 1708 /* Machine: */
#define IDT_CPU_TYPE 1709 /* CPU type: */
#define IDT_CPU_SPEED 1710 /* CPU speed: */
#define IDT_FPU 1711 /* FPU: */
#define IDT_WAIT_STATES 1712 /* Wait states: */
#define IDT_MB 1713 /* MB == IDC_TEXT_MB */
#define IDT_MEMORY 1714 /* Memory: */
/* DLG_CFG_VIDEO */
#define IDT_VIDEO 1715 /* Video: */
#define IDT_VIDEO_2 1716 /* Video 2: */
/* DLG_CFG_INPUT */
#define IDT_MOUSE 1717 /* Mouse: */
#define IDT_JOYSTICK 1718 /* Joystick: */
/* DLG_CFG_SOUND */
#define IDT_SOUND1 1719 /* Sound card #1: */
#define IDT_SOUND2 1720 /* Sound card #2: */
#define IDT_SOUND3 1721 /* Sound card #3: */
#define IDT_SOUND4 1722 /* Sound card #4: */
#define IDT_MIDI_OUT 1723 /* MIDI Out Device: */
#define IDT_MIDI_IN 1724 /* MIDI In Device: */
/* DLG_CFG_NETWORK */
#define IDT_NET_TYPE 1725 /* Network type: */
#define IDT_PCAP 1726 /* PCap device: */
#define IDT_NET 1727 /* Network adapter: */
#define IDT_NET1 1728 /* Network adapter 1: */
#define IDT_NET2 1729 /* Network adapter 2: */
#define IDT_NET3 1730 /* Network adapter 3: */
#define IDT_NET4 1731 /* Network adapter 4: */
/* DLG_CFG_PORTS */
#define IDT_COM1 1732 /* COM1 Device: */
#define IDT_COM2 1733 /* COM1 Device: */
#define IDT_COM3 1734 /* COM1 Device: */
#define IDT_COM4 1735 /* COM1 Device: */
#define IDT_LPT1 1736 /* LPT1 Device: */
#define IDT_LPT2 1737 /* LPT2 Device: */
#define IDT_LPT3 1738 /* LPT3 Device: */
#define IDT_LPT4 1739 /* LPT4 Device: */
/* DLG_CFG_STORAGE */
#define IDT_HDC 1740 /* HD Controller: */
#define IDT_FDC 1741 /* Ext FD Controller: */
#define IDT_SCSI_1 1742 /* SCSI Board #1: */
#define IDT_SCSI_2 1743 /* SCSI Board #2: */
#define IDT_SCSI_3 1744 /* SCSI Board #3: */
#define IDT_SCSI_4 1745 /* SCSI Board #4: */
/* DLG_CFG_HARD_DISKS */
#define IDT_HDD 1746 /* Hard disks: */
#define IDT_BUS 1747 /* Bus: */
#define IDT_CHANNEL 1748 /* Channel: */
#define IDT_ID 1749 /* ID: */
#define IDT_LUN 1750 /* LUN: */
#define IDT_SPEED 1751 /* Speed: */
/* DLG_CFG_HARD_DISKS_ADD */
#define IDT_SECTORS 1752 /* Sectors: */
#define IDT_HEADS 1753 /* Heads: */
#define IDT_CYLS 1754 /* Cylinders: */
#define IDT_SIZE_MB 1755 /* Size (MB): */
#define IDT_TYPE 1756 /* Type: */
#define IDT_FILE_NAME 1757 /* File name: */
#define IDT_IMG_FORMAT 1758 /* Image Format: */
#define IDT_BLOCK_SIZE 1759 /* Block Size: */
#define IDT_PROGRESS 1760 /* Progress: */
/* DLG_CFG_FLOPPY_AND_CDROM_DRIVES */
#define IDT_FLOPPY_DRIVES 1761 /* Floppy drives: */
#define IDT_FDD_TYPE 1762 /* Type: */
#define IDT_CD_DRIVES 1763 /* CD-ROM drives: */
#define IDT_CD_BUS 1764 /* Bus: */
#define IDT_CD_ID 1765 /* ID: */
#define IDT_CD_LUN 1766 /* LUN: */
#define IDT_CD_CHANNEL 1767 /* Channel: */
#define IDT_CD_SPEED 1768 /* Speed: */
#define IDT_CD_TYPE 1769 /* Type: */
/* DLG_CFG_OTHER_REMOVABLE_DEVICES */
#define IDT_MO_DRIVES 1770 /* MO drives: */
#define IDT_MO_BUS 1771 /* Bus: */
#define IDT_MO_ID 1772 /* ID: */
#define IDT_MO_CHANNEL 1773 /* Channel */
#define IDT_MO_TYPE 1774 /* Type: */
#define IDT_ZIP_DRIVES 1775 /* ZIP drives: */
#define IDT_ZIP_BUS 1776 /* Bus: */
#define IDT_ZIP_ID 1777 /* ID: */
#define IDT_ZIP_LUN 1778 /* LUN: */
#define IDT_ZIP_CHANNEL 1779 /* Channel: */
/* DLG_CFG_PERIPHERALS */
#define IDT_ISARTC 1780 /* ISA RTC: */
#define IDT_ISAMEM_1 1781 /* ISAMEM Board #1: */
#define IDT_ISAMEM_2 1782 /* ISAMEM Board #2: */
#define IDT_ISAMEM_3 1783 /* ISAMEM Board #3: */
#define IDT_ISAMEM_4 1784 /* ISAMEM Board #4: */
/*
* To try to keep these organized, we now group the
* constants per dialog, as this allows easy adding
* and deleting items.
*/
#define IDC_SETTINGSCATLIST 1001 /* generic config */
#define IDC_CFILE 1002 /* Select File dialog */
#define IDC_TIME_SYNC 1005
#define IDC_RADIO_TS_DISABLED 1006
#define IDC_RADIO_TS_LOCAL 1007
#define IDC_RADIO_TS_UTC 1008
#define IDC_COMBO_MACHINE_TYPE 1010
#define IDC_COMBO_MACHINE 1011 /* machine/cpu config */
#define IDC_CONFIGURE_MACHINE 1012
#define IDC_COMBO_CPU_TYPE 1013
#define IDC_COMBO_CPU_SPEED 1014
#define IDC_COMBO_FPU 1015
#define IDC_COMBO_WS 1016
#ifdef USE_DYNAREC
# define IDC_CHECK_DYNAREC 1017
#endif
#define IDC_CHECK_SOFTFLOAT 1018
#define IDC_MEMTEXT 1019
#define IDC_MEMSPIN 1020
#define IDC_TEXT_MB IDT_MB
#define IDC_VIDEO 1021 /* video config */
#define IDC_COMBO_VIDEO 1022
#define IDC_VIDEO_2 1023
#define IDC_COMBO_VIDEO_2 1024
#define IDC_CHECK_VOODOO 1025
#define IDC_BUTTON_VOODOO 1026
#define IDC_CHECK_IBM8514 1027
#define IDC_CHECK_XGA 1028
#define IDC_BUTTON_XGA 1029
#define IDC_INPUT 1030 /* input config */
#define IDC_COMBO_MOUSE 1031
#define IDC_COMBO_JOYSTICK 1032
#define IDC_COMBO_JOY 1033
#define IDC_CONFIGURE_MOUSE 1034
#define IDC_SOUND 1040 /* sound config */
#define IDC_COMBO_SOUND1 1041
#define IDC_COMBO_SOUND2 1042
#define IDC_COMBO_SOUND3 1043
#define IDC_COMBO_SOUND4 1044
#define IDC_COMBO_MIDI_OUT 1045
#define IDC_CHECK_MPU401 1046
#define IDC_CONFIGURE_MPU401 1047
#define IDC_CHECK_FLOAT 1048
#define IDC_CONFIGURE_GUS 1049
#define IDC_COMBO_MIDI_IN 1050
#define IDC_CONFIGURE_CMS 1051
#define IDC_CONFIGURE_SSI 1052
#define IDC_FM_DRIVER 1053
#define IDC_RADIO_FM_DRV_NUKED 1054
#define IDC_RADIO_FM_DRV_YMFM 1055
#define IDC_COMBO_NET1_TYPE 1060 /* network config */
#define IDC_COMBO_NET2_TYPE 1061
#define IDC_COMBO_NET3_TYPE 1062
#define IDC_COMBO_NET4_TYPE 1063
#define IDC_COMBO_PCAP1 1064
#define IDC_COMBO_PCAP2 1065
#define IDC_COMBO_PCAP3 1066
#define IDC_COMBO_PCAP4 1067
#define IDC_COMBO_NET1 1068
#define IDC_COMBO_NET2 1069
#define IDC_COMBO_NET3 1070
#define IDC_COMBO_NET4 1071
#define IDC_COMBO_LPT1 1080 /* ports config */
#define IDC_COMBO_LPT2 1081
#define IDC_COMBO_LPT3 1082
#define IDC_COMBO_LPT4 1083
#define IDC_CHECK_SERIAL1 1084
#define IDC_CHECK_SERIAL2 1085
#define IDC_CHECK_SERIAL3 1086
#define IDC_CHECK_SERIAL4 1087
#define IDC_CHECK_PARALLEL1 1088
#define IDC_CHECK_PARALLEL2 1089
#define IDC_CHECK_PARALLEL3 1090
#define IDC_CHECK_PARALLEL4 1091
#define IDC_CHECK_SERIAL_PASS1 1092
#define IDC_CHECK_SERIAL_PASS2 1093
#define IDC_CHECK_SERIAL_PASS3 1094
#define IDC_CHECK_SERIAL_PASS4 1095
#define IDC_OTHER_PERIPH 1110 /* storage controllers config */
#define IDC_COMBO_HDC 1111
#define IDC_CONFIGURE_HDC 1112
#define IDC_CHECK_IDE_TER 1113
#define IDC_BUTTON_IDE_TER 1114
#define IDC_CHECK_IDE_QUA 1115
#define IDC_BUTTON_IDE_QUA 1116
#define IDC_GROUP_SCSI 1117
#define IDC_COMBO_SCSI_1 1118
#define IDC_COMBO_SCSI_2 1119
#define IDC_COMBO_SCSI_3 1120
#define IDC_COMBO_SCSI_4 1121
#define IDC_CONFIGURE_SCSI_1 1122
#define IDC_CONFIGURE_SCSI_2 1123
#define IDC_CONFIGURE_SCSI_3 1124
#define IDC_CONFIGURE_SCSI_4 1125
#define IDC_CHECK_CASSETTE 1126
#define IDC_HARD_DISKS 1130 /* hard disks config */
#define IDC_LIST_HARD_DISKS 1131
#define IDC_BUTTON_HDD_ADD_NEW 1132
#define IDC_BUTTON_HDD_ADD 1133
#define IDC_BUTTON_HDD_REMOVE 1134
#define IDC_COMBO_HD_BUS 1135
#define IDC_COMBO_HD_CHANNEL 1136
#define IDC_COMBO_HD_ID 1137
#define IDC_COMBO_HD_SPEED 1138
#define IDC_COMBO_HD_CHANNEL_IDE 1139
#define IDC_EDIT_HD_FILE_NAME 1140 /* add hard disk dialog */
#define IDC_EDIT_HD_SPT 1141
#define IDC_EDIT_HD_HPC 1142
#define IDC_EDIT_HD_CYL 1143
#define IDC_EDIT_HD_SIZE 1144
#define IDC_COMBO_HD_TYPE 1145
#define IDC_PBAR_IMG_CREATE 1146
#define IDC_COMBO_HD_IMG_FORMAT 1147
#define IDC_COMBO_HD_BLOCK_SIZE 1148
#define IDC_REMOV_DEVICES 1150 /* floppy and cd-rom drives config */
#define IDC_LIST_FLOPPY_DRIVES 1151
#define IDC_COMBO_FD_TYPE 1152
#define IDC_CHECKTURBO 1153
#define IDC_CHECKBPB 1154
#define IDC_LIST_CDROM_DRIVES 1155
#define IDC_COMBO_CD_BUS 1156
#define IDC_COMBO_CD_ID 1157
#define IDC_COMBO_CD_LUN 1158
#define IDC_COMBO_CD_CHANNEL_IDE 1159
#define IDC_COMBO_CD_TYPE 1160
#define IDC_LIST_ZIP_DRIVES 1170 /* other removable devices config */
#define IDC_COMBO_ZIP_BUS 1171
#define IDC_COMBO_ZIP_ID 1172
#define IDC_COMBO_ZIP_LUN 1173
#define IDC_COMBO_ZIP_CHANNEL_IDE 1174
#define IDC_CHECK250 1175
#define IDC_COMBO_CD_SPEED 1176
#define IDC_LIST_MO_DRIVES 1177
#define IDC_COMBO_MO_BUS 1178
#define IDC_COMBO_MO_ID 1179
#define IDC_COMBO_MO_LUN 1170
#define IDC_COMBO_MO_CHANNEL_IDE 1181
#define IDC_COMBO_MO_TYPE 1182
#define IDC_CHECK_BUGGER 1190 /* other periph config */
#define IDC_CHECK_POSTCARD 1191
#define IDC_COMBO_ISARTC 1192
#define IDC_CONFIGURE_ISARTC 1193
#define IDC_COMBO_FDC 1194
#define IDC_CONFIGURE_FDC 1195
#define IDC_GROUP_ISAMEM 1196
#define IDC_COMBO_ISAMEM_1 1197
#define IDC_COMBO_ISAMEM_2 1198
#define IDC_COMBO_ISAMEM_3 1199
#define IDC_COMBO_ISAMEM_4 1200
#define IDC_CONFIGURE_ISAMEM_1 1201
#define IDC_CONFIGURE_ISAMEM_2 1202
#define IDC_CONFIGURE_ISAMEM_3 1203
#define IDC_CONFIGURE_ISAMEM_4 1204
#define IDC_SLIDER_GAIN 1210 /* sound gain dialog */
#define IDC_EDIT_FILE_NAME 1220 /* new floppy image dialog */
#define IDC_COMBO_DISK_SIZE 1221
#define IDC_COMBO_RPM_MODE 1222
#define IDC_COMBO_LANG 1009 /* change language dialog */
#define IDC_COMBO_ICON 1010
#define IDC_CHECKBOX_GLOBAL 1300
#define IDC_BUTTON_DEFAULT 1302
#define IDC_BUTTON_DEFICON 1304
/* For the DeviceConfig code, re-do later. */
#define IDC_CONFIG_BASE 1300
#define IDC_CONFIGURE_VID 1300
#define IDC_CONFIGURE_VID_2 1301
#define IDC_CONFIGURE_SND1 1302
#define IDC_CONFIGURE_SND2 1303
#define IDC_CONFIGURE_SND3 1304
#define IDC_CONFIGURE_SND4 1305
#define IDC_CONFIGURE_VOODOO 1306
#define IDC_CONFIGURE_NET1_TYPE 1310
#define IDC_CONFIGURE_NET2_TYPE 1311
#define IDC_CONFIGURE_NET3_TYPE 1312
#define IDC_CONFIGURE_NET4_TYPE 1313
#define IDC_CONFIGURE_PCAP1 1314
#define IDC_CONFIGURE_PCAP2 1315
#define IDC_CONFIGURE_PCAP3 1316
#define IDC_CONFIGURE_PCAP4 1317
#define IDC_CONFIGURE_NET1 1318
#define IDC_CONFIGURE_NET2 1319
#define IDC_CONFIGURE_NET3 1320
#define IDC_CONFIGURE_NET4 1321
#define IDC_CONFIGURE_MIDI_OUT 1322
#define IDC_CONFIGURE_MIDI_IN 1323
#define IDC_CONFIGURE_SERIAL_PASS1 1324
#define IDC_CONFIGURE_SERIAL_PASS2 1325
#define IDC_CONFIGURE_SERIAL_PASS3 1326
#define IDC_CONFIGURE_SERIAL_PASS4 1327
#define IDC_JOY1 1330
#define IDC_JOY2 1331
#define IDC_JOY3 1332
#define IDC_JOY4 1333
#define IDC_HDTYPE 1380
#define IDC_RENDER 1381
#define IDC_STATUS 1382
#define IDC_EDIT_WIDTH 1400 /* specify main window dimensions dialog */
#define IDC_WIDTHSPIN 1401
#define IDC_EDIT_HEIGHT 1402
#define IDC_HEIGHTSPIN 1403
#define IDC_CHECK_LOCK_SIZE 1404
#define IDM_ABOUT 40001
#define IDC_ABOUT_ICON 65535
#define IDM_ACTION_KBD_REQ_CAPTURE 40010
#define IDM_ACTION_RCTRL_IS_LALT 40011
#define IDM_ACTION_SCREENSHOT 40012
#define IDM_ACTION_HRESET 40013
#define IDM_ACTION_RESET_CAD 40014
#define IDM_ACTION_EXIT 40015
#define IDM_ACTION_CTRL_ALT_ESC 40016
#define IDM_ACTION_PAUSE 40017
#ifdef MTR_ENABLED
# define IDM_ACTION_BEGIN_TRACE 40018
# define IDM_ACTION_END_TRACE 40019
# define IDM_ACTION_TRACE 40020
#endif
#define IDM_CONFIG 40021
#define IDM_VID_HIDE_STATUS_BAR 40022
#define IDM_VID_HIDE_TOOLBAR 40023
#define IDM_UPDATE_ICONS 40030
#define IDM_SND_GAIN 40031
#define IDM_VID_MONITORS 40040
#define IDM_VID_RESIZE 40041
#define IDM_VID_REMEMBER 40042
#define IDM_VID_SDL_SW 40050
#define IDM_VID_SDL_HW 40051
#define IDM_VID_SDL_OPENGL 40052
#define IDM_VID_OPENGL_CORE 40053
#ifdef USE_VNC
# define IDM_VID_VNC 40054
#endif
#define IDM_VID_SCALE_1X 40055
#define IDM_VID_SCALE_2X 40056
#define IDM_VID_SCALE_3X 40057
#define IDM_VID_SCALE_4X 40058
#define IDM_VID_SCALE_5X 40059
#define IDM_VID_SCALE_6X 40060
#define IDM_VID_SCALE_7X 40061
#define IDM_VID_SCALE_8X 40062
#define IDM_VID_SCALE_9X 40063
#define IDM_VID_SCALE_10X 40064
#define IDM_VID_HIDPI 40065
#define IDM_VID_FULLSCREEN 40066
#define IDM_VID_FS_FULL 40067
#define IDM_VID_FS_43 40068
#define IDM_VID_FS_KEEPRATIO 40069
#define IDM_VID_FS_INT 40070
#define IDM_VID_SPECIFY_DIM 40071
#define IDM_VID_FORCE43 40072
#define IDM_VID_OVERSCAN 40073
#define IDM_VID_INVERT 40074
#define IDM_VID_CGACON 40075
#define IDM_VID_GRAYCT_601 40076
#define IDM_VID_GRAYCT_709 40077
#define IDM_VID_GRAYCT_AVE 40078
#define IDM_VID_GRAY_RGB 40080
#define IDM_VID_GRAY_MONO 40081
#define IDM_VID_GRAY_AMBER 40082
#define IDM_VID_GRAY_GREEN 40083
#define IDM_VID_GRAY_WHITE 40084
#define IDM_VID_FILTER_NEAREST 40085
#define IDM_VID_FILTER_LINEAR 40086
#define IDM_MEDIA 40087
#define IDM_DOCS 40088
#define IDM_DISCORD 40090
#define IDM_PREFERENCES 40091
#define IDM_VID_GL_FPS_BLITTER 40100
#define IDM_VID_GL_FPS_25 40101
#define IDM_VID_GL_FPS_30 40102
#define IDM_VID_GL_FPS_50 40103
#define IDM_VID_GL_FPS_60 40104
#define IDM_VID_GL_FPS_75 40105
#define IDM_VID_GL_VSYNC 40106
#define IDM_VID_GL_SHADER 40107
#define IDM_VID_GL_NOSHADER 40108
/*
* We need 7 bits for CDROM (2 bits ID and 5 bits for host drive),
* and 5 bits for Removable Disks (5 bits for ID), so we use an
* 8bit (256 entries) space for these devices.
*/
#define IDM_CASSETTE_IMAGE_NEW 0x1200
#define IDM_CASSETTE_IMAGE_EXISTING 0x1300
#define IDM_CASSETTE_IMAGE_EXISTING_WP 0x1400
#define IDM_CASSETTE_RECORD 0x1500
#define IDM_CASSETTE_PLAY 0x1600
#define IDM_CASSETTE_REWIND 0x1700
#define IDM_CASSETTE_FAST_FORWARD 0x1800
#define IDM_CASSETTE_EJECT 0x1900
#define IDM_CARTRIDGE_IMAGE 0x2200
#define IDM_CARTRIDGE_EJECT 0x2300
#define IDM_FLOPPY_IMAGE_NEW 0x3200
#define IDM_FLOPPY_IMAGE_EXISTING 0x3300
#define IDM_FLOPPY_IMAGE_EXISTING_WP 0x3400
#define IDM_FLOPPY_EXPORT_TO_86F 0x3500
#define IDM_FLOPPY_EJECT 0x3600
#define IDM_CDROM_MUTE 0x4200
#define IDM_CDROM_EMPTY 0x4300
#define IDM_CDROM_RELOAD 0x4400
#define IDM_CDROM_IMAGE 0x4500
#define IDM_CDROM_DIR 0x4600
#define IDM_CDROM_HOST_DRIVE 0x4700
#define IDM_ZIP_IMAGE_NEW 0x5200
#define IDM_ZIP_IMAGE_EXISTING 0x5300
#define IDM_ZIP_IMAGE_EXISTING_WP 0x5400
#define IDM_ZIP_EJECT 0x5500
#define IDM_ZIP_RELOAD 0x5600
#define IDM_MO_IMAGE_NEW 0x6200
#define IDM_MO_IMAGE_EXISTING 0x6300
#define IDM_MO_IMAGE_EXISTING_WP 0x6400
#define IDM_MO_EJECT 0x6500
#define IDM_MO_RELOAD 0x6600
/* Next default values for new objects */
#ifdef APSTUDIO_INVOKED
# ifndef APSTUDIO_READONLY_SYMBOLS
# define _APS_NO_MFC 1
# define _APS_NEXT_RESOURCE_VALUE 1400
# define _APS_NEXT_COMMAND_VALUE 55000
# define _APS_NEXT_CONTROL_VALUE 1800
# define _APS_NEXT_SYMED_VALUE 200
# endif
#endif
#endif /*WIN_RESOURCE_H*/

View File

@@ -22,12 +22,14 @@
#define EMU_SCSI_H
/* Configuration. */
#define SCSI_BUS_MAX 4 /* currently we support up to 4 controllers */
#define SCSI_CARD_MAX 4
#define SCSI_BUS_MAX 9 /* currently we support up to 9 controllers:
up to 1 on-board + up to 4x pas plus/16 + up to 4 scsi controllers */
#define SCSI_ID_MAX 16 /* 16 on wide buses */
#define SCSI_LUN_MAX 8 /* always 8 */
#define SCSI_ID_MAX 16 /* 16 on wide buses */
#define SCSI_LUN_MAX 8 /* always 8 */
extern int scsi_card_current[SCSI_BUS_MAX];
extern int scsi_card_current[SCSI_CARD_MAX];
extern int scsi_card_available(int card);
#ifdef EMU_DEVICE_H

View File

@@ -173,8 +173,8 @@
#define GPMODEP_RIGID_DISK_PAGE 0x0000000000000010LL
#define GPMODEP_FLEXIBLE_DISK_PAGE 0x0000000000000020LL
#define GPMODEP_CACHING_PAGE 0x0000000000000100LL
#define GPMODEP_CDROM_PAGE_SONY 0x0000000000000200LL
#define GPMODEP_CDROM_AUDIO_PAGE_SONY 0x0000000000000400LL
#define GPMODEP_CDROM_PAGE_SONY 0x0000000000000100LL
#define GPMODEP_CDROM_AUDIO_PAGE_SONY 0x0000000000000200LL
#define GPMODEP_CDROM_PAGE 0x0000000000002000LL
#define GPMODEP_CDROM_AUDIO_PAGE 0x0000000000004000LL
#define GPMODEP_CAPABILITIES_PAGE 0x0000040000000000LL
@@ -308,7 +308,7 @@
#define BUS_REQ 0x20
#define BUS_BSY 0x40
#define BUS_RST 0x80
#define BUS_ACK 0x200
#define BUS_ACK 0x100
#define BUS_ATN 0x200
#define BUS_ARB 0x8000
#define BUS_SETDATA(val) ((uint32_t) val << 16)

View File

@@ -6,9 +6,8 @@
*
* This file is part of the 86Box distribution.
*
* Implementation of the NCR 5380 series of SCSI Host Adapters
* made by NCR. These controllers were designed for
* the ISA bus.
* Implementation of the NCR 5380 chip made by NCR
* and used in various controllers.
*
*
*
@@ -17,21 +16,131 @@
* Fred N. van Kempen, <decwiz@yahoo.com>
*
* Copyright 2017-2018 Sarah Walker.
* Copyright 2017-2018 TheCollector1995.
* Copyright 2017-2018 Fred N. van Kempen.
* Copyright 2017-2024 TheCollector1995.
*/
#ifndef SCSI_NCR5380_H
#define SCSI_NCR5380_H
#define NCR_CURDATA 0 /* current SCSI data (read only) */
#define NCR_OUTDATA 0 /* output data (write only) */
#define NCR_INITCOMMAND 1 /* initiator command (read/write) */
#define NCR_MODE 2 /* mode (read/write) */
#define NCR_TARGETCMD 3 /* target command (read/write) */
#define NCR_SELENABLE 4 /* select enable (write only) */
#define NCR_BUSSTATUS 4 /* bus status (read only) */
#define NCR_STARTDMA 5 /* start DMA send (write only) */
#define NCR_BUSANDSTAT 5 /* bus and status (read only) */
#define NCR_DMATARGET 6 /* DMA target (write only) */
#define NCR_INPUTDATA 6 /* input data (read only) */
#define NCR_DMAINIRECV 7 /* DMA initiator receive (write only) */
#define NCR_RESETPARITY 7 /* reset parity/interrupt (read only) */
#define ICR_DBP 0x01
#define ICR_ATN 0x02
#define ICR_SEL 0x04
#define ICR_BSY 0x08
#define ICR_ACK 0x10
#define ICR_ARB_LOST 0x20
#define ICR_ARB_IN_PROGRESS 0x40
#define MODE_ARBITRATE 0x01
#define MODE_DMA 0x02
#define MODE_MONITOR_BUSY 0x04
#define MODE_ENA_EOP_INT 0x08
#define STATUS_ACK 0x01
#define STATUS_BUSY_ERROR 0x04
#define STATUS_PHASE_MATCH 0x08
#define STATUS_INT 0x10
#define STATUS_DRQ 0x40
#define STATUS_END_OF_DMA 0x80
#define TCR_IO 0x01
#define TCR_CD 0x02
#define TCR_MSG 0x04
#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 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);
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);
} 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 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);
#ifdef EMU_DEVICE_H
extern const device_t scsi_lcs6821n_device;
extern const device_t scsi_pas_device;
extern const device_t scsi_rt1000b_device;
extern const device_t scsi_rt1000mc_device;
extern const device_t scsi_t128_device;
extern const device_t scsi_t228_device;
extern const device_t scsi_t130b_device;
extern const device_t scsi_ls2000_device;
#if defined(DEV_BRANCH) && defined(USE_SUMO)
extern const device_t scsi_scsiat_device;
#endif
#endif
#endif /*SCSI_NCR5380_H*/

View File

@@ -0,0 +1,51 @@
/*
* 86Box A hypervisor and IBM PC system emulator that specializes in
* running old operating systems and software designed for IBM
* PC systems and compatibles from 1981 through fairly recent
* system designs based on the PCI bus.
*
* This file is part of the 86Box distribution.
*
* Implementation of the NCR 53c400 series of SCSI Host Adapters
* made by NCR. These controllers were designed for the ISA and MCA bus.
*
* Authors: Sarah Walker, <https://pcem-emulator.co.uk/>
* TheCollector1995, <mariogplayer@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>
*
* Copyright 2017-2018 Sarah Walker.
* Copyright 2017-2018 Fred N. van Kempen.
* Copyright 2017-2024 TheCollector1995.
*/
#ifndef SCSI_T128_H
#define SCSI_T128_H
typedef struct t128_t {
ncr_t ncr;
rom_t bios_rom;
mem_mapping_t mapping;
uint8_t ctrl;
uint8_t status;
uint8_t buffer[512];
uint8_t ext_ram[0x80];
uint8_t block_count;
int block_loaded;
int pos, host_pos;
uint32_t rom_addr;
int bios_enabled;
uint8_t pos_regs[8];
pc_timer_t timer;
} t128_t;
extern void t128_write(uint32_t addr, uint8_t val, void *priv);
extern uint8_t t128_read(uint32_t addr, void *priv);
extern void t128_callback(void *priv);
#endif /*SCSI_T128_H*/

View File

@@ -43,6 +43,18 @@
#define COM3_IRQ 4
#define COM4_ADDR 0x02e8
#define COM4_IRQ 3
// The following support being assingned IRQ 3, 4, 5, 9, 10, 11, 12 or 15
// There doesn't appear to be any specific standard however
// So defaults have been chosen arbitarily
// TODO: Allow configuration of the IRQ in the UI
//#define COM5_ADDR 0x03f0
//#define COM5_IRQ 3
#define COM5_ADDR 0x02f0
#define COM5_IRQ 11
#define COM6_ADDR 0x03e0
#define COM6_IRQ 10
#define COM7_ADDR 0x02e0
#define COM7_IRQ 9
struct serial_device_s;
struct serial_s;
@@ -92,6 +104,7 @@ typedef struct serial_s {
typedef struct serial_device_s {
void (*rcr_callback)(struct serial_s *serial, void *priv);
void (*dtr_callback)(struct serial_s *serial, int status, void *priv);
void (*dev_write)(struct serial_s *serial, void *priv, uint8_t data);
void (*lcr_callback)(struct serial_s *serial, void *priv, uint8_t lcr);
void (*transmit_period_callback)(struct serial_s *serial, void *priv, double transmit_period);
@@ -112,6 +125,12 @@ extern serial_t *serial_attach_ex(int port,
void (*lcr_callback)(struct serial_s *serial, void *priv, uint8_t data_bits),
void *priv);
extern serial_t *serial_attach_ex_2(int port,
void (*rcr_callback)(struct serial_s *serial, void *priv),
void (*dev_write)(struct serial_s *serial, void *priv, uint8_t data),
void (*dtr_callback)(struct serial_s *serial, int status, void *priv),
void *priv);
#define serial_attach(port, rcr_callback, dev_write, priv) \
serial_attach_ex(port, rcr_callback, dev_write, NULL, NULL, priv);
@@ -129,6 +148,8 @@ extern void serial_device_timeout(void *priv);
extern void serial_set_cts(serial_t *dev, uint8_t enabled);
extern void serial_set_dsr(serial_t *dev, uint8_t enabled);
extern void serial_set_dcd(serial_t *dev, uint8_t enabled);
extern void serial_set_ri(serial_t *dev, uint8_t enabled);
extern int serial_get_ri(serial_t *dev);
extern const device_t ns8250_device;
extern const device_t ns8250_pcjr_device;

View File

@@ -43,6 +43,8 @@ extern const device_t fdc37c931apm_compaq_device;
extern const device_t fdc37c932fr_device;
extern const device_t fdc37c932qf_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;
extern const device_t it8661f_device;
@@ -75,6 +77,12 @@ extern const device_t ps1_m2133_sio;
#if defined(DEV_BRANCH) && defined(USE_SIO_DETECT)
extern const device_t sio_detect_device;
#endif
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;

View File

@@ -0,0 +1,78 @@
/*
* 86Box A hypervisor and IBM PC system emulator that specializes in
* running old operating systems and software designed for IBM
* PC systems and compatibles from 1981 through fairly recent
* system designs based on the PCI bus.
*
* This file is part of the 86Box distribution.
*
* Header for the implementation of the SiS 55xx Pentium
* PCI/ISA Chipsets.
*
* Authors: Miran Grca, <mgrca8@gmail.com>
*
* Copyright 2019-2020 Miran Grca.
*/
#ifndef EMU_SIS_55XX_H
#define EMU_SIS_55XX_H
typedef struct
{
uint8_t sb_pci_slot;
uint8_t ide_bits_1_3_writable;
uint8_t usb_enabled;
uint8_t *pmu_regs;
sff8038i_t *bm[2];
acpi_t *acpi;
} sis_55xx_common_t;
extern void sis_5511_host_to_pci_write(int addr, uint8_t val, void *priv);
extern uint8_t sis_5511_host_to_pci_read(int addr, void *priv);
extern void sis_5571_host_to_pci_write(int addr, uint8_t val, void *priv);
extern uint8_t sis_5571_host_to_pci_read(int addr, void *priv);
extern void sis_5581_host_to_pci_write(int addr, uint8_t val, void *priv);
extern uint8_t sis_5581_host_to_pci_read(int addr, void *priv);
extern void sis_5591_host_to_pci_write(int addr, uint8_t val, void *priv);
extern uint8_t sis_5591_host_to_pci_read(int addr, void *priv);
extern void sis_5600_host_to_pci_write(int addr, uint8_t val, void *priv);
extern uint8_t sis_5600_host_to_pci_read(int addr, void *priv);
extern void sis_5513_pci_to_isa_write(int addr, uint8_t val, void *priv);
extern uint8_t sis_5513_pci_to_isa_read(int addr, void *priv);
extern void sis_5513_ide_write(int addr, uint8_t val, void *priv);
extern uint8_t sis_5513_ide_read(int addr, void *priv);
extern void sis_5572_usb_write(int addr, uint8_t val, void *priv);
extern uint8_t sis_5572_usb_read(int addr, void *priv);
extern void sis_5595_pmu_write(int addr, uint8_t val, void *priv);
extern uint8_t sis_5595_pmu_read(int addr, void *priv);
extern const device_t sis_5511_h2p_device;
extern const device_t sis_5571_h2p_device;
extern const device_t sis_5581_h2p_device;
extern const device_t sis_5591_h2p_device;
extern const device_t sis_5600_h2p_device;
extern const device_t sis_5513_p2i_device;
extern const device_t sis_5572_p2i_device;
extern const device_t sis_5582_p2i_device;
extern const device_t sis_5595_1997_p2i_device;
extern const device_t sis_5595_p2i_device;
extern const device_t sis_5513_ide_device;
extern const device_t sis_5572_ide_device;
extern const device_t sis_5582_ide_device;
extern const device_t sis_5591_5600_ide_device;
extern const device_t sis_5572_usb_device;
extern const device_t sis_5582_usb_device;
extern const device_t sis_5595_usb_device;
extern const device_t sis_5595_pmu_device;
extern const device_t sis_5595_1997_pmu_device;
extern const device_t sis_55xx_common_device;
#endif /*EMU_SIS_55XX_H*/

View File

@@ -15,8 +15,8 @@
* Copyright 2020 RichardG.
*/
#ifndef EMU_SMBUS_PIIX4_H
#define EMU_SMBUS_PIIX4_H
#ifndef EMU_SMBUS_H
#define EMU_SMBUS_H
#define SMBUS_PIIX4_BLOCK_DATA_SIZE 32
#define SMBUS_PIIX4_BLOCK_DATA_MASK (SMBUS_PIIX4_BLOCK_DATA_SIZE - 1)
@@ -24,6 +24,9 @@
#define SMBUS_ALI7101_BLOCK_DATA_SIZE 32
#define SMBUS_ALI7101_BLOCK_DATA_MASK (SMBUS_ALI7101_BLOCK_DATA_SIZE - 1)
#define SMBUS_SIS5595_BLOCK_DATA_SIZE 32
#define SMBUS_SIS5595_BLOCK_DATA_MASK (SMBUS_ALI7101_BLOCK_DATA_SIZE - 1)
enum {
SMBUS_PIIX4 = 0,
SMBUS_VIA = 1
@@ -63,16 +66,47 @@ typedef struct smbus_ali7101_t {
void *i2c;
} smbus_ali7101_t;
extern void smbus_piix4_remap(smbus_piix4_t *dev, uint16_t new_io_base, uint8_t enable);
extern void smbus_piix4_setclock(smbus_piix4_t *dev, int clock);
typedef struct smbus_sis5595_t {
uint32_t local;
uint16_t stat;
uint16_t next_stat;
uint16_t ctl;
uint8_t cmd;
uint8_t addr;
uint8_t saved_addr;
uint8_t block_ptr;
uint8_t count;
uint8_t data0;
uint8_t data1;
uint8_t alias;
uint8_t reg_ff;
uint8_t index;
uint8_t irq_enable;
uint8_t irq_state;
uint8_t data[SMBUS_SIS5595_BLOCK_DATA_SIZE];
pc_timer_t response_timer;
void *i2c;
} smbus_sis5595_t;
extern void smbus_ali7101_remap(smbus_ali7101_t *dev, uint16_t new_io_base, uint8_t enable);
extern void smbus_piix4_remap(smbus_piix4_t *dev, uint16_t new_io_base, uint8_t enable);
extern void smbus_piix4_setclock(smbus_piix4_t *dev, int clock);
extern void smbus_ali7101_remap(smbus_ali7101_t *dev, uint16_t new_io_base, uint8_t enable);
extern void smbus_sis5595_irq_enable(void *priv, uint8_t enable);
extern uint8_t smbus_sis5595_read_index(void *priv);
extern uint8_t smbus_sis5595_read_data(void *priv);
extern void smbus_sis5595_write_index(void *priv, uint8_t val);
extern void smbus_sis5595_write_data(void *priv, uint8_t val);
#ifdef EMU_DEVICE_H
extern const device_t piix4_smbus_device;
extern const device_t via_smbus_device;
extern const device_t ali7101_smbus_device;
extern const device_t sis5595_smbus_device;
#endif
#endif /*EMU_SMBUS_PIIX4_H*/
#endif /*EMU_SMBUS_H*/

View File

@@ -61,6 +61,9 @@ typedef struct ad1848_t {
int adpcm_data;
int adpcm_pos;
uint8_t dma_ff;
uint32_t dma_data;
pc_timer_t timer_count;
uint64_t timer_latch;

View File

@@ -390,12 +390,12 @@ typedef struct emu8k_t {
int16_t out_r;
emu8k_chorus_eng_t chorus_engine;
int32_t chorus_in_buffer[SOUNDBUFLEN];
int32_t chorus_in_buffer[WTBUFLEN];
emu8k_reverb_eng_t reverb_engine;
int32_t reverb_in_buffer[SOUNDBUFLEN];
int32_t reverb_in_buffer[WTBUFLEN];
int pos;
int32_t buffer[SOUNDBUFLEN * 2];
int32_t buffer[WTBUFLEN * 2];
uint16_t addr;
} emu8k_t;
@@ -406,6 +406,8 @@ void emu8k_close(emu8k_t *emu8k);
void emu8k_update(emu8k_t *emu8k);
#define EMU8K_ROM_PATH "roms/sound/creative/awe32.raw"
/*
Section E - Introduction to the EMU8000 Chip

View File

@@ -22,7 +22,8 @@ enum fm_type {
FM_YMF262 = 1, /* OPL3 */
FM_YMF289B = 2, /* OPL3-L */
FM_YMF278B = 3, /* OPL 4 */
FM_MAX = 4
FM_ESFM = 4, /* ESFM */
FM_MAX = 5
};
enum fm_driver {
@@ -45,6 +46,7 @@ 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;
#ifdef EMU_DEVICE_H
extern const device_t ym3812_nuked_device;
@@ -54,6 +56,8 @@ 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 esfm_esfmu_device;
#endif
#endif /*SOUND_OPL_H*/

View File

@@ -126,6 +126,43 @@ typedef struct sb_ct1745_mixer_t {
int output_filter; /* for clones */
} sb_ct1745_mixer_t;
/* ESS AudioDrive */
typedef struct ess_mixer_t {
double master_l;
double master_r;
double voice_l;
double voice_r;
double fm_l;
double fm_r;
double cd_l;
double cd_r;
double line_l;
double line_r;
double mic_l;
double mic_r;
double auxb_l;
double auxb_r;
double speaker;
/*see sb_ct1745_mixer for values for input selector*/
int32_t input_selector;
/* extra values for input selector */
#define INPUT_MIXER_L 128
#define INPUT_MIXER_R 256
int input_filter;
int in_filter_freq;
int output_filter;
int stereo;
int stereo_isleft;
uint8_t index;
uint8_t regs[256];
uint8_t ess_id_str[4];
uint8_t ess_id_str_pos;
} ess_mixer_t;
typedef struct sb_t {
uint8_t cms_enabled;
uint8_t opl_enabled;
@@ -138,12 +175,12 @@ typedef struct sb_t {
sb_ct1335_mixer_t mixer_sb2;
sb_ct1345_mixer_t mixer_sbpro;
sb_ct1745_mixer_t mixer_sb16;
ess_mixer_t mixer_ess;
};
mpu_t *mpu;
emu8k_t emu8k;
void *gameport;
int pos;
int pnp;
uint8_t pos_regs[8];
@@ -164,7 +201,12 @@ extern void sb_ct1745_mixer_write(uint16_t addr, uint8_t val, void *priv);
extern uint8_t sb_ct1745_mixer_read(uint16_t addr, void *priv);
extern void sb_ct1745_mixer_reset(sb_t *sb);
extern void sb_ess_mixer_write(uint16_t addr, uint8_t val, void *priv);
extern uint8_t sb_ess_mixer_read(uint16_t addr, void *priv);
extern void sb_ess_mixer_reset(sb_t *sb);
extern void sb_get_buffer_sbpro(int32_t *buffer, int len, void *priv);
extern void sb_get_music_buffer_sbpro(int32_t *buffer, int len, void *priv);
extern void sbpro_filter_cd_audio(int channel, double *buffer, void *priv);
extern void sb16_awe32_filter_cd_audio(int channel, double *buffer, void *priv);
extern void sb_close(void *priv);

View File

@@ -1,10 +1,19 @@
#ifndef SOUND_SND_SB_DSP_H
#define SOUND_SND_SB_DSP_H
#include <86box/fifo.h>
/*Sound Blaster Clones, for quirks*/
#define SB_SUBTYPE_DEFAULT 0 /*Handle as a Creative card*/
#define SB_SUBTYPE_CLONE_AZT2316A_0X11 1 /*Aztech Sound Galaxy Pro 16 AB, DSP 3.1 - SBPRO2 clone*/
#define SB_SUBTYPE_CLONE_AZT1605_0X0C 2 /*Aztech Sound Galaxy Nova 16 Extra / Packard Bell Forte 16, DSP 2.1 - SBPRO2 clone*/
#define SB_SUBTYPE_DEFAULT 0 /* Handle as a Creative card */
#define SB_SUBTYPE_CLONE_AZT2316A_0X11 1 /* Aztech Sound Galaxy Pro 16 AB, DSP 3.1 - SBPRO2 clone */
#define SB_SUBTYPE_CLONE_AZT1605_0X0C 2 /* Aztech Sound Galaxy Nova 16 Extra /
Packard Bell Forte 16, DSP 2.1 - SBPRO2 clone */
#define SB_SUBTYPE_ESS_ES688 3 /* ESS Technology ES688 */
#define SB_SUBTYPE_ESS_ES1688 4 /* ESS Technology ES1688 */
/* ESS-related */
#define IS_ESS(dsp) ((dsp)->sb_subtype >= SB_SUBTYPE_ESS_ES688) /* Check for future ESS cards here */
#define IS_NOT_ESS(dsp) ((dsp)->sb_subtype < SB_SUBTYPE_ESS_ES688) /* Check for future ESS cards here */
/* aztech-related */
#define IS_AZTECH(dsp) ((dsp)->sb_subtype == SB_SUBTYPE_CLONE_AZT2316A_0X11 || (dsp)->sb_subtype == SB_SUBTYPE_CLONE_AZT1605_0X0C) /* check for future AZT cards here */
@@ -45,6 +54,10 @@ typedef struct sb_dsp_t {
void *dma_priv;
uint8_t sb_read_data[256];
uint8_t dma_ff;
int dma_data;
int sb_read_wp;
int sb_read_rp;
int sb_speaker;
@@ -97,6 +110,8 @@ typedef struct sb_dsp_t {
int sb_irqm16;
int sb_irqm401;
uint8_t sb_has_real_opl;
uint8_t sb_asp_regs[256];
uint8_t sb_asp_mode;
@@ -108,6 +123,8 @@ typedef struct sb_dsp_t {
int sbenable;
int sb_enable_i;
int state;
pc_timer_t output_timer;
pc_timer_t input_timer;
@@ -123,6 +140,8 @@ typedef struct sb_dsp_t {
pc_timer_t wb_timer;
int wb_full;
pc_timer_t irq_timer;
int busy_count;
int record_pos_read;
@@ -133,6 +152,28 @@ typedef struct sb_dsp_t {
uint8_t azt_eeprom[AZTECH_EEPROM_SIZE]; /* the eeprom in the Aztech cards is attached to the DSP */
uint8_t ess_regs[256]; /* ESS registers. */
uint8_t ess_playback_mode;
uint8_t ess_extended_mode;
uint8_t ess_reload_len;
uint32_t ess_dma_counter;
/* IRQ status flags (0x22C) */
uint8_t ess_irq_generic;
uint8_t ess_irq_dmactr;
/* ESPCM */
fifo64_t *espcm_fifo;
uint8_t espcm_fifo_reset;
uint8_t espcm_mode; /* see ESPCM in "NON-PCM SAMPLE FORMATS" deflist in snd_sb_dsp.c */
uint8_t espcm_sample_idx;
uint8_t espcm_range;
uint8_t espcm_byte_buffer[4];
uint8_t espcm_code_buffer[19]; /* used for ESPCM_3 and for ESPCM_4 recording */
int8_t espcm_sample_buffer[19]; /* used for ESPCM_4 recording */
uint8_t espcm_table_index; /* used for ESPCM_3 */
uint8_t espcm_last_value; /* used for ESPCM_3 */
mpu_t *mpu;
} sb_dsp_t;
@@ -158,6 +199,8 @@ extern void sb_dsp_speed_changed(sb_dsp_t *dsp);
extern void sb_dsp_poll(sb_dsp_t *dsp, int16_t *l, int16_t *r);
extern void sb_dsp_set_real_opl(sb_dsp_t *dsp, uint8_t has_real_opl);
extern void sb_dsp_set_stereo(sb_dsp_t *dsp, int stereo);
extern void sb_dsp_update(sb_dsp_t *dsp);

View File

@@ -33,9 +33,15 @@ extern int sound_gain;
#define SOUND_FREQ FREQ_48000
#define SOUNDBUFLEN (SOUND_FREQ / 50)
#define MUSIC_FREQ FREQ_49716
#define MUSICBUFLEN (MUSIC_FREQ / 36)
#define CD_FREQ FREQ_44100
#define CD_BUFLEN (CD_FREQ / 10)
#define WT_FREQ FREQ_44100
#define WTBUFLEN (MUSIC_FREQ / 45)
enum {
SOUND_NONE = 0,
SOUND_INTERNAL
@@ -47,12 +53,24 @@ extern int speakval;
extern int speakon;
extern int sound_pos_global;
extern int music_pos_global;
extern int wavetable_pos_global;
extern int sound_card_current[SOUND_CARD_MAX];
extern void sound_add_handler(void (*get_buffer)(int32_t *buffer,
int len, void *priv),
void *priv);
extern void music_add_handler(void (*get_buffer)(int32_t *buffer,
int len, void *priv),
void *priv);
extern void wavetable_add_handler(void (*get_buffer)(int32_t *buffer,
int len, void *priv),
void *priv);
extern void sound_set_cd_audio_filter(void (*filter)(int channel,
double *buffer, void *priv),
void *priv);
@@ -85,8 +103,10 @@ extern void sound_cd_thread_reset(void);
extern void closeal(void);
extern void inital(void);
extern void givealbuffer(void *buf);
extern void givealbuffer_cd(void *buf);
extern void givealbuffer(const void *buf);
extern void givealbuffer_music(const void *buf);
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
extern void sb_vibra16s_onboard_relocate_base(uint16_t new_addr, void *priv);
@@ -103,31 +123,16 @@ extern const device_t acermagic_s20_device;
extern const device_t mirosound_pcm10_device;
extern const device_t azt1605_device;
/* Ensoniq AudioPCI */
extern const device_t es1371_device;
extern const device_t es1371_onboard_device;
/* C-Media CMI8x38 */
extern const device_t cmi8338_device;
extern const device_t cmi8338_onboard_device;
extern const device_t cmi8738_device;
extern const device_t cmi8738_onboard_device;
extern const device_t cmi8738_6ch_onboard_device;
/* Creative Labs Game Blaster */
extern const device_t cms_device;
/* Gravis UltraSound and UltraSound Max */
extern const device_t gus_device;
# if defined(DEV_BRANCH) && defined(USE_PAS16)
/* Pro Audio Spectrum 16 */
extern const device_t pas16_device;
# endif
/* IBM PS/1 Audio Card */
extern const device_t ps1snd_device;
/* Tandy PSSJ */
extern const device_t pssj_device;
extern const device_t pssj_isa_device;
/* Tandy PSG */
extern const device_t tndy_device;
/* Creative Labs Sound Blaster */
extern const device_t sb_1_device;
extern const device_t sb_15_device;
@@ -154,13 +159,6 @@ extern const device_t sb_awe64_value_device;
extern const device_t sb_awe64_device;
extern const device_t sb_awe64_gold_device;
/* Innovation SSI-2001 */
extern const device_t ssi2001_device;
/* Windows Sound System */
extern const device_t wss_device;
extern const device_t ncr_business_audio_device;
/* Crystal CS423x */
extern const device_t cs4235_device;
extern const device_t cs4235_onboard_device;
@@ -168,12 +166,49 @@ extern const device_t cs4236b_device;
extern const device_t cs4237b_device;
extern const device_t cs4238b_device;
/* C-Media CMI8x38 */
extern const device_t cmi8338_device;
extern const device_t cmi8338_onboard_device;
extern const device_t cmi8738_device;
extern const device_t cmi8738_onboard_device;
extern const device_t cmi8738_6ch_onboard_device;
/* ESS Technology */
extern const device_t ess_688_device;
extern const device_t ess_ess0100_pnp_device;
extern const device_t ess_1688_device;
extern const device_t ess_ess0102_pnp_device;
extern const device_t ess_ess0968_pnp_device;
extern const device_t ess_soundpiper_16_mca_device;
extern const device_t ess_soundpiper_32_mca_device;
extern const device_t ess_chipchat_16_mca_device;
/* Ensoniq AudioPCI */
extern const device_t es1371_device;
extern const device_t es1371_onboard_device;
extern const device_t es1373_device;
extern const device_t es1373_onboard_device;
extern const device_t ct5880_device;
extern const device_t ct5880_onboard_device;
/* Gravis UltraSound and UltraSound Max */
extern const device_t gus_device;
/* IBM PS/1 Audio Card */
extern const device_t ps1snd_device;
/* Innovation SSI-2001 */
extern const device_t ssi2001_device;
/* Pro Audio Spectrum Plus, 16, and 16D */
extern const device_t pasplus_device;
extern const device_t pas16_device;
extern const device_t pas16d_device;
/* Tandy PSSJ */
extern const device_t pssj_device;
extern const device_t pssj_isa_device;
/* Tandy PSG */
extern const device_t tndy_device;
/* Windows Sound System */
extern const device_t wss_device;
extern const device_t ncr_business_audio_device;
#endif
#endif /*EMU_SOUND_H*/

View File

@@ -43,7 +43,7 @@ typedef struct pc_timer_t {
ts_t ts;
#endif
int flags; /* The flags are defined above. */
int pad;
int in_callback;
double period; /* This is used for large period timers to count
the microseconds and split the period. */
@@ -185,6 +185,9 @@ timer_set_p(pc_timer_t *timer, void *priv)
extern void timer_stop(pc_timer_t *timer);
extern void timer_on_auto(pc_timer_t *timer, double period);
/* Change TSC, taking into account the timers. */
extern void timer_set_new_tsc(uint64_t new_tsc);
#ifdef __cplusplus
}
#endif

View File

@@ -42,9 +42,6 @@ extern "C" {
extern int ui_msgbox(int flags, void *message);
extern int ui_msgbox_header(int flags, void *header, void *message);
extern int ui_msgbox_ex(int flags, void *header, void *message, void *btn1, void *btn2, void *btn3);
extern void ui_check_menu_item(int id, int checked);
/* Status Bar functions. */
#define SB_ICON_WIDTH 24
@@ -60,16 +57,13 @@ extern void ui_check_menu_item(int id, int checked);
#define SB_TEXT 0x90
extern wchar_t *ui_window_title(wchar_t *s);
extern void ui_status_update(void);
extern void ui_hard_reset_completed(void);
extern void ui_init_monitor(int monitor_index);
extern void ui_deinit_monitor(int monitor_index);
extern int ui_sb_find_part(int tag);
extern void ui_sb_set_ready(int ready);
extern void ui_sb_update_panes(void);
extern void ui_sb_update_text(void);
extern void ui_sb_update_tip(int meaning);
extern void ui_sb_timer_callback(int pane);
extern void ui_sb_update_icon(int tag, int active);
extern void ui_sb_update_icon_state(int tag, int state);
extern void ui_sb_set_text_w(wchar_t *wstr);

View File

@@ -32,12 +32,19 @@ typedef struct hwcursor8514_t {
uint32_t pitch;
} hwcursor8514_t;
typedef union {
uint64_t q;
uint32_t d[2];
uint16_t w[4];
uint8_t b[8];
} latch8514_t;
typedef struct ibm8514_t {
rom_t bios_rom;
rom_t bios_rom2;
hwcursor8514_t hwcursor;
hwcursor8514_t hwcursor_latch;
uint8_t pos_regs[8];
char *rom_path;
int force_old_addr;
int type;
@@ -49,6 +56,7 @@ typedef struct ibm8514_t {
uint32_t vram_size;
uint32_t vram_mask;
uint32_t pallook[512];
uint32_t bios_addr;
PALETTE vgapal;
uint8_t hwcursor_oddeven;
@@ -217,6 +225,8 @@ typedef struct ibm8514_t {
int ext_pitch;
int ext_crt_pitch;
int extensions;
latch8514_t latch;
} ibm8514_t;
#endif /*VIDEO_8514A_H*/

View File

@@ -74,6 +74,7 @@ typedef struct mach_t {
uint16_t shadow_set;
uint16_t shadow_cntl;
int ext_on[2];
int extended_mode;
int compat_mode;
struct {

View File

@@ -26,6 +26,6 @@
void update_cga16_color(uint8_t cgamode);
void cga_comp_init(int revision);
Bit32u *Composite_Process(uint8_t cgamode, uint8_t border, uint32_t blocks /*, bool doublewidth*/, uint32_t *TempLine);
uint32_t *Composite_Process(uint8_t cgamode, uint8_t border, uint32_t blocks /*, bool doublewidth*/, uint32_t *TempLine);
#endif /*VIDEO_CGA_COMP_H*/

View File

@@ -29,6 +29,7 @@
# define FLAG_ATI 128
# define FLAG_S3_911_16BIT 256
# define FLAG_512K_MASK 512
# define FLAG_NO_SHIFT3 1024 /* Needed for Bochs VBE. */
struct monitor_t;
typedef struct hwcursor_t {
@@ -77,6 +78,7 @@ typedef struct svga_t {
uint8_t overlay_oddeven;
uint8_t fcr;
uint8_t hblank_overscan;
uint8_t vidsys_ena;
int dac_addr;
int dac_pos;
@@ -129,6 +131,7 @@ typedef struct svga_t {
int hblank_end_mask;
int hblank_sub;
int packed_4bpp;
int ps_bit_bug;
int ati_4color;
/*The three variables below allow us to implement memory maps like that seen on a 1MB Trio64 :
@@ -171,6 +174,8 @@ typedef struct svga_t {
double clock;
double clock8514;
double multiplier;
hwcursor_t hwcursor;
hwcursor_t hwcursor_latch;
hwcursor_t dac_hwcursor;
@@ -195,6 +200,7 @@ typedef struct svga_t {
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);
/* Called when VC=R18 and friends. If this returns zero then MA resetting
is skipped. Matrox Mystique in Power mode reuses this counter for
@@ -284,26 +290,32 @@ typedef struct svga_t {
void * dev8514;
void * ext8514;
void * clock_gen8514;
void * xga;
} svga_t;
extern int vga_on;
extern int vga_on;
extern void ibm8514_poll(void *priv);
extern void ibm8514_recalctimings(svga_t *svga);
extern uint8_t ibm8514_ramdac_in(uint16_t port, void *priv);
extern void ibm8514_ramdac_out(uint16_t port, uint8_t val, void *priv);
extern int ibm8514_cpu_src(svga_t *svga);
extern int ibm8514_cpu_dest(svga_t *svga);
extern void ibm8514_accel_out_pixtrans(svga_t *svga, uint16_t port, uint32_t val, int len);
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);
extern void ibm8514_poll(void *priv);
extern void ibm8514_recalctimings(svga_t *svga);
extern uint8_t ibm8514_ramdac_in(uint16_t port, void *priv);
extern void ibm8514_ramdac_out(uint16_t port, uint8_t val, void *priv);
extern void ibm8514_accel_out_fifo(svga_t *svga, uint16_t port, uint32_t val, int len);
extern void ibm8514_accel_out(uint16_t port, uint32_t val, svga_t *svga, int len);
extern uint16_t ibm8514_accel_in_fifo(svga_t *svga, uint16_t port, int len);
extern uint8_t ibm8514_accel_in(uint16_t port, svga_t *svga);
extern int ibm8514_cpu_src(svga_t *svga);
extern int ibm8514_cpu_dest(svga_t *svga);
extern void ibm8514_accel_out_pixtrans(svga_t *svga, uint16_t port, uint32_t val, int len);
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_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_init(svga_t *svga, void *ext8514, void *dev8514);
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);

View File

@@ -223,7 +223,7 @@ extern void video_screenshot_monitor(uint32_t *buf, int start_x, int start_y, in
extern void video_screenshot(uint32_t *buf, int start_x, int start_y, int row_len);
#ifdef _WIN32
extern void *__cdecl (*video_copy)(void *_Dst, const void *_Src, size_t _Size);
extern void * (__cdecl *video_copy)(void *_Dst, const void *_Src, size_t _Size);
extern void *__cdecl video_transform_copy(void *_Dst, const void *_Src, size_t _Size);
#else
extern void *(*video_copy)(void *__restrict _Dst, const void *__restrict _Src, size_t _Size);
@@ -320,9 +320,7 @@ extern const device_t mach64gx_pci_device;
extern const device_t mach64vt2_device;
/* ATi 18800 */
# if defined(DEV_BRANCH) && defined(USE_VGAWONDER)
extern const device_t ati18800_wonder_device;
# endif
extern const device_t ati18800_vga88_device;
extern const device_t ati18800_device;
@@ -336,6 +334,13 @@ extern const device_t compaq_ati28800_device;
extern const device_t ati28800_wonderxl24_device;
# endif
/* Bochs */
extern const device_t bochs_svga_device;
/* Chips & Technologies */
extern const device_t chips_69000_device;
extern const device_t chips_69000_onboard_device;
/* Cirrus Logic GD54xx */
extern const device_t gd5401_isa_device;
extern const device_t gd5402_isa_device;
@@ -368,8 +373,9 @@ extern const device_t gd5434_onboard_pci_device;
extern const device_t gd5434_vlb_device;
extern const device_t gd5434_pci_device;
extern const device_t gd5436_pci_device;
extern const device_t gd5440_onboard_pci_device;
extern const device_t gd5436_onboard_pci_device;
extern const device_t gd5440_pci_device;
extern const device_t gd5440_onboard_pci_device;
extern const device_t gd5446_pci_device;
extern const device_t gd5446_stb_pci_device;
extern const device_t gd5480_pci_device;
@@ -447,6 +453,7 @@ extern const device_t oti037c_device;
extern const device_t oti067_device;
extern const device_t oti067_acer386_device;
extern const device_t oti067_ama932j_device;
extern const device_t oti077_acer100t_device;
extern const device_t oti077_device;
/* Paradise/WD (S)VGA */
@@ -490,6 +497,7 @@ extern const device_t s3_spea_mirage_p64_vlb_device;
extern const device_t s3_phoenix_trio64_vlb_device;
extern const device_t s3_phoenix_trio64_onboard_pci_device;
extern const device_t s3_phoenix_trio64_pci_device;
extern const device_t s3_stb_powergraph_64_video_vlb_device;
extern const device_t s3_phoenix_trio64vplus_pci_device;
extern const device_t s3_phoenix_trio64vplus_onboard_pci_device;
extern const device_t s3_cardex_trio64vplus_pci_device;
@@ -500,15 +508,15 @@ extern const device_t s3_phoenix_vision864_pci_device;
extern const device_t s3_phoenix_vision864_vlb_device;
extern const device_t s3_9fx_531_pci_device;
extern const device_t s3_phoenix_vision868_pci_device;
extern const device_t s3_phoenix_vision868_vlb_device;
extern const device_t s3_diamond_stealth64_pci_device;
extern const device_t s3_diamond_stealth64_vlb_device;
extern const device_t s3_diamond_stealth64_964_pci_device;
extern const device_t s3_diamond_stealth64_964_vlb_device;
extern const device_t s3_diamond_stealth64_968_pci_device;
extern const device_t s3_diamond_stealth64_968_vlb_device;
extern const device_t s3_mirovideo_40sv_ergo_968_pci_device;
extern const device_t s3_9fx_771_pci_device;
extern const device_t s3_phoenix_vision968_pci_device;
extern const device_t s3_phoenix_vision968_vlb_device;
extern const device_t s3_spea_mercury_p64v_pci_device;
extern const device_t s3_elsa_winner2000_pro_x_964_pci_device;
extern const device_t s3_elsa_winner2000_pro_x_pci_device;
@@ -521,6 +529,7 @@ extern const device_t s3_diamond_stealth_2000_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;
extern const device_t s3_virge_375_onboard_pci_device;
extern const device_t s3_diamond_stealth_2000pro_pci_device;
extern const device_t s3_virge_385_pci_device;
extern const device_t s3_virge_357_pci_device;
@@ -539,6 +548,7 @@ extern const device_t tgui9440_vlb_device;
extern const device_t tgui9440_pci_device;
extern const device_t tgui9440_onboard_pci_device;
extern const device_t tgui9660_pci_device;
extern const device_t tgui9660_onboard_pci_device;
extern const device_t tgui9680_pci_device;
/* IBM PS/1 (S)VGA */
@@ -547,6 +557,7 @@ extern const device_t ibm_ps1_2121_device;
/* Trident TVGA 8900 */
extern const device_t tvga8900b_device;
extern const device_t tvga8900d_device;
extern const device_t tvga8900dr_device;
extern const device_t tvga9000b_device;
extern const device_t nec_sv9000_device;

View File

@@ -26,50 +26,7 @@
#ifndef UNICODE
# define UNICODE
#endif
#define BITMAP WINDOWS_BITMAP
#if 0
# ifdef _WIN32_WINNT
# undef _WIN32_WINNT
# define _WIN32_WINNT 0x0501
# endif
#endif
#include "resource.h"
#include <windows.h>
#undef BITMAP
/* DPI Awareness Context, copied from MinGW-w64 windef.h */
#ifndef _DPI_AWARENESS_CONTEXTS_
DECLARE_HANDLE(DPI_AWARENESS_CONTEXT);
# define DPI_AWARENESS_CONTEXT_UNAWARE ((DPI_AWARENESS_CONTEXT) -1)
# define DPI_AWARENESS_CONTEXT_SYSTEM_AWARE ((DPI_AWARENESS_CONTEXT) -2)
# define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE ((DPI_AWARENESS_CONTEXT) -3)
# define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 ((DPI_AWARENESS_CONTEXT) -4)
# define DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED ((DPI_AWARENESS_CONTEXT) -5)
#endif
#ifndef WM_DPICHANGED_AFTERPARENT
# define WM_DPICHANGED_AFTERPARENT 0x02E3
#endif
/* Class names and such. */
#define CLASS_NAME L"86BoxMainWnd"
#define MENU_NAME L"MainMenu"
#define ACCEL_NAME L"MainAccel"
#define SUB_CLASS_NAME L"86BoxSubWnd"
#define SB_CLASS_NAME L"86BoxStatusBar"
#define SB_MENU_NAME L"StatusBarMenu"
#define FS_CLASS_NAME L"86BoxFullScreen"
#define SDL_CLASS_NAME L"86BoxSDLWnd"
#define SDL_SUB_CLASS_NAME L"86BoxSDLSubWnd"
#define CASSETTE_SUBMENU_NAME L"CassetteSubmenu"
#define CARTRIDGE_SUBMENU_NAME L"CartridgeSubmenu"
#define FLOPPY_SUBMENU_NAME L"FloppySubmenu"
#define CDROM_SUBMENU_NAME L"CdromSubmenu"
#define ZIP_SUBMENU_NAME L"ZIPSubmenu"
#define MO_SUBMENU_NAME L"MOSubmenu"
#define VID_GL_SUBMENU L"VidGLSubMenu"
/* Application-specific window messages.
@@ -92,163 +49,4 @@ DECLARE_HANDLE(DPI_AWARENESS_CONTEXT);
/* The emulator has shut down. */
#define WM_HAS_SHUTDOWN 0x8897
#ifdef USE_VNC
# define RENDERERS_NUM 5
#else
# define RENDERERS_NUM 4
#endif
#ifdef __cplusplus
extern "C" {
#endif
extern HINSTANCE hinstance;
extern HWND hwndMain;
extern HWND hwndRender;
extern HWND hwndRender2;
extern HANDLE ghMutex;
extern HICON hIcon[256];
extern int dpi;
extern RECT oldclip;
extern int sbar_height;
extern int tbar_height;
extern int user_resize;
extern int acp_utf8;
#if 0
extern int status_is_open;
#endif
extern char openfilestring[512];
extern WCHAR wopenfilestring[512];
extern uint8_t filterindex;
extern void ResizeWindowByClientArea(HWND hwnd, int width, int height);
/* Emulator start/stop support functions. */
extern void do_start(void);
extern void do_stop(void);
/* Internal platform support functions. */
extern int has_language_changed(uint32_t id);
extern void set_language(uint32_t id);
extern int get_vidpause(void);
extern void show_cursor(int);
extern void keyboard_getkeymap(void);
extern void keyboard_handle(PRAWINPUT raw);
extern void win_mouse_init(void);
extern void win_mouse_close(void);
extern void win_mouse_handle(PRAWINPUT raw);
extern void win_joystick_handle(PRAWINPUT raw);
extern void win_notify_dlg_open(void);
extern void win_notify_dlg_closed(void);
extern int win_get_dpi(HWND hwnd);
extern int win_get_system_metrics(int i, int dpi);
extern LPARAM win_get_string(int id);
extern void win_clear_icon_set(void);
extern void win_system_icon_set(void);
extern void win_load_icon_set(void);
extern void win_get_icons_path(char *path_root);
extern intptr_t fdd_type_to_icon(int type);
#ifdef EMU_DEVICE_H
extern uint8_t deviceconfig_open(HWND hwnd, const device_t *device);
extern uint8_t deviceconfig_inst_open(HWND hwnd, const device_t *device, int inst);
#endif
extern uint8_t joystickconfig_open(HWND hwnd, int joy_nr, int type);
extern int getfile(HWND hwnd, char *f, char *fn);
extern int getsfile(HWND hwnd, char *f, char *fn);
extern void hard_disk_add_open(HWND hwnd, int is_existing);
extern int hard_disk_was_added(void);
/* Platform UI support functions. */
extern int ui_init(int nCmdShow);
/* Functions in win_about.c: */
extern void AboutDialogCreate(HWND hwnd);
/* Functions in win_snd_gain.c: */
extern void SoundGainDialogCreate(HWND hwnd);
/* Functions in win_new_floppy.c: */
extern void NewFloppyDialogCreate(HWND hwnd, int id, int part);
/* Functions in win_specify_dim.c: */
extern void SpecifyDimensionsDialogCreate(HWND hwnd);
/* Functions in win_preferences.c: */
extern void PreferencesDlgCreate(HWND hwnd);
/* Functions in win_settings.c: */
#define SETTINGS_PAGE_MACHINE 0
#define SETTINGS_PAGE_VIDEO 1
#define SETTINGS_PAGE_INPUT 2
#define SETTINGS_PAGE_SOUND 3
#define SETTINGS_PAGE_NETWORK 4
#define SETTINGS_PAGE_PORTS 5
#define SETTINGS_PAGE_STORAGE 6
#define SETTINGS_PAGE_HARD_DISKS 7
#define SETTINGS_PAGE_FLOPPY_AND_CDROM_DRIVES 8
#define SETTINGS_PAGE_OTHER_REMOVABLE_DEVICES 9
#define SETTINGS_PAGE_PERIPHERALS 10
extern void win_settings_open(HWND hwnd);
extern void win_settings_open_ex(HWND hwnd, int category);
/* Functions in win_stbar.c: */
extern HWND hwndSBAR;
extern void StatusBarCreate(HWND hwndParent, uintptr_t idStatus, HINSTANCE hInst);
extern int MediaMenuHandler(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
/* Functions in win_toolbar.c */
extern HWND hwndRebar;
extern void ToolBarCreate(HWND hwndParent, HINSTANCE hInst);
extern void ToolBarLoadIcons(void);
extern void ToolBarUpdatePause(int paused);
/* Functions in win_dialog.c: */
/* Pass NULL in the title param to use the default title. */
extern int file_dlg_w(HWND hwnd, WCHAR *f, WCHAR *fn, WCHAR *title, int save);
extern int file_dlg(HWND hwnd, WCHAR *f, char *fn, char *title, int save);
extern int file_dlg_mb(HWND hwnd, char *f, char *fn, char *title, int save);
extern int file_dlg_w_st(HWND hwnd, int i, WCHAR *fn, char *title, int save);
extern int file_dlg_st(HWND hwnd, int i, char *fn, char *title, int save);
extern wchar_t *BrowseFolder(wchar_t *saved_path, wchar_t *title);
/* Functions in win_media_menu.c */
extern void media_menu_init(void);
extern void media_menu_reset(void);
extern int media_menu_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
extern HMENU media_menu_get_cassette(void);
extern HMENU media_menu_get_cartridge(int id);
extern HMENU media_menu_get_floppy(int id);
extern HMENU media_menu_get_cdrom(int id);
extern HMENU media_menu_get_zip(int id);
extern HMENU media_menu_get_mo(int id);
extern void media_menu_update_cassette(void);
extern void media_menu_update_cartridge(int id);
extern void media_menu_update_floppy(int id);
extern void media_menu_update_cdrom(int id);
extern void media_menu_update_zip(int id);
extern void media_menu_update_mo(int id);
/* Functions in win_ui.c */
extern HMENU menuMain;
extern void ResetAllMenus(void);
#ifdef __cplusplus
}
#endif
#endif /*PLAT_WIN_H*/

View File

@@ -1,29 +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.
*
* Header file for OpenGL rendering module
*
* Authors: Teemu Korhonen
*
* Copyright 2021 Teemu Korhonen
*/
#ifndef WIN_OPENGL_H
#define WIN_OPENGL_H
#define UNICODE
#include <windows.h>
extern int opengl_init(HWND hwnd);
extern int opengl_pause(void);
extern void opengl_close(void);
extern void opengl_set_fs(int fs);
extern void opengl_resize(int w, int h);
extern void opengl_reload(void);
#endif /*!WIN_OPENGL_H*/

View File

@@ -1,24 +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.
*
* Header file for shader file parser.
*
* Authors: Teemu Korhonen
*
* Copyright 2021 Teemu Korhonen
*/
#ifndef WIN_OPENGL_GLSLP_H
#define WIN_OPENGL_GLSLP_H
#include <glad/glad.h>
GLuint load_custom_shaders(const char *path);
GLuint load_default_shaders(void);
#endif /*!WIN_OPENGL_GLSLP_H*/

View File

@@ -1,63 +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 the libSDL2 rendering module.
*
*
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Michael Drüing, <michael@drueing.de>
*
* Copyright 2018-2019 Fred N. van Kempen.
* Copyright 2018-2019 Michael Drüing.
*
* Redistribution and use in source and binary forms, with
* or without modification, are permitted provided that the
* following conditions are met:
*
* 1. Redistributions of source code must retain the entire
* above notice, this list of conditions and the following
* disclaimer.
*
* 2. Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the
* following disclaimer in the documentation and/or other
* materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names
* of its contributors may be used to endorse or promote
* products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef WIN_SDL_H
#define WIN_SDL_H
extern void sdl_close(void);
extern int sdl_inits(HWND h);
extern int sdl_inith(HWND h);
extern int sdl_initho(HWND h);
extern int sdl_pause(void);
extern void sdl_resize(int x, int y);
extern void sdl_enable(int enable);
extern void sdl_set_fs(int fs);
extern void sdl_reload(void);
#endif /*WIN_SDL_H*/