2017-09-02 20:39:57 +02:00
|
|
|
/*
|
|
|
|
|
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
|
|
|
|
* running old operating systems and software designed for IBM
|
|
|
|
|
* PC systems and compatibles from 1981 through fairly recent
|
|
|
|
|
* system designs based on the PCI bus.
|
|
|
|
|
*
|
|
|
|
|
* This file is part of the 86Box distribution.
|
|
|
|
|
*
|
|
|
|
|
* Handling of the emulated machines.
|
|
|
|
|
*
|
2018-03-19 01:02:04 +01:00
|
|
|
* Version: @(#)machine.h 1.0.22 2018/03/18
|
2017-09-02 20:39:57 +02:00
|
|
|
*
|
|
|
|
|
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
|
|
|
|
* Miran Grca, <mgrca8@gmail.com>
|
2017-10-07 22:18:30 -04:00
|
|
|
* Fred N. van Kempen, <decwiz@yahoo.com>
|
|
|
|
|
*
|
2018-01-04 07:44:33 +01:00
|
|
|
* Copyright 2008-2018 Sarah Walker.
|
2018-01-24 00:35:52 +01:00
|
|
|
* Copyright 2016-2018 Miran Grca.
|
|
|
|
|
* Copyright 2017,2018 Fred N. van Kempen.
|
2017-09-02 20:39:57 +02:00
|
|
|
*/
|
|
|
|
|
#ifndef EMU_MACHINE_H
|
|
|
|
|
# define EMU_MACHINE_H
|
|
|
|
|
|
|
|
|
|
|
2017-10-07 22:18:30 -04:00
|
|
|
/* Machine feature flags. */
|
|
|
|
|
#define MACHINE_PC 0x000000 /* PC architecture */
|
|
|
|
|
#define MACHINE_AT 0x000001 /* PC/AT architecture */
|
|
|
|
|
#define MACHINE_PS2 0x000002 /* PS/2 architecture */
|
2017-11-05 01:57:04 -05:00
|
|
|
#define MACHINE_ISA 0x000010 /* sys has ISA bus */
|
|
|
|
|
#define MACHINE_CBUS 0x000020 /* sys has C-BUS bus */
|
|
|
|
|
#define MACHINE_EISA 0x000040 /* sys has EISA bus */
|
|
|
|
|
#define MACHINE_VLB 0x000080 /* sys has VL bus */
|
|
|
|
|
#define MACHINE_MCA 0x000100 /* sys has MCA bus */
|
|
|
|
|
#define MACHINE_PCI 0x000200 /* sys has PCI bus */
|
|
|
|
|
#define MACHINE_AGP 0x000400 /* sys has AGP bus */
|
|
|
|
|
#define MACHINE_HDC 0x001000 /* sys has int HDC */
|
|
|
|
|
#define MACHINE_HDC_PS2 0x002000 /* sys has int PS/2 HDC */
|
|
|
|
|
#define MACHINE_MOUSE 0x004000 /* sys has int mouse */
|
|
|
|
|
#define MACHINE_VIDEO 0x008000 /* sys has int video */
|
2017-09-02 20:39:57 +02:00
|
|
|
|
2017-10-13 02:41:17 -04:00
|
|
|
#define IS_ARCH(m, a) (machines[(m)].flags & (a)) ? 1 : 0;
|
|
|
|
|
|
2017-09-02 20:39:57 +02:00
|
|
|
|
2017-10-07 22:18:30 -04:00
|
|
|
typedef struct _machine_ {
|
2017-11-08 16:27:10 -05:00
|
|
|
const char *name;
|
2017-09-02 20:39:57 +02:00
|
|
|
int id;
|
2017-11-08 16:27:10 -05:00
|
|
|
const char *internal_name;
|
2017-09-02 20:39:57 +02:00
|
|
|
struct {
|
2017-11-08 16:27:10 -05:00
|
|
|
const char *name;
|
2017-10-07 22:18:30 -04:00
|
|
|
#ifdef EMU_CPU_H
|
2017-09-02 20:39:57 +02:00
|
|
|
CPU *cpus;
|
2017-10-07 22:18:30 -04:00
|
|
|
#else
|
|
|
|
|
void *cpus;
|
|
|
|
|
#endif
|
2017-09-02 20:39:57 +02:00
|
|
|
} cpu[5];
|
|
|
|
|
int fixed_gfxcard;
|
|
|
|
|
int flags;
|
|
|
|
|
int min_ram, max_ram;
|
|
|
|
|
int ram_granularity;
|
|
|
|
|
int nvrmask;
|
2018-03-19 01:02:04 +01:00
|
|
|
void (*init)(const struct _machine_ *);
|
2017-10-07 22:18:30 -04:00
|
|
|
#ifdef EMU_DEVICE_H
|
2018-03-19 01:02:04 +01:00
|
|
|
const device_t *(*get_device)(void);
|
2017-10-07 22:18:30 -04:00
|
|
|
#else
|
|
|
|
|
void *get_device;
|
|
|
|
|
#endif
|
2017-11-22 18:14:27 +01:00
|
|
|
void (*nvr_close)(void);
|
2017-09-02 20:39:57 +02:00
|
|
|
} machine_t;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Global variables. */
|
2018-03-19 01:02:04 +01:00
|
|
|
extern const machine_t machines[];
|
2017-09-02 20:39:57 +02:00
|
|
|
extern int machine;
|
2017-11-02 02:28:00 -05:00
|
|
|
extern int romset;
|
2017-11-05 01:57:04 -05:00
|
|
|
extern int AT, PCI;
|
2017-09-02 20:39:57 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Core functions. */
|
|
|
|
|
extern int machine_count(void);
|
|
|
|
|
extern int machine_getromset(void);
|
|
|
|
|
extern int machine_getmachine(int romset);
|
|
|
|
|
extern char *machine_getname(void);
|
|
|
|
|
extern char *machine_get_internal_name(void);
|
|
|
|
|
extern int machine_get_machine_from_internal_name(char *s);
|
|
|
|
|
extern void machine_init(void);
|
2017-10-07 22:18:30 -04:00
|
|
|
#ifdef EMU_DEVICE_H
|
2018-03-19 01:02:04 +01:00
|
|
|
extern const device_t *machine_getdevice(int machine);
|
2017-10-07 22:18:30 -04:00
|
|
|
#endif
|
2017-09-02 20:39:57 +02:00
|
|
|
extern int machine_getromset_ex(int m);
|
|
|
|
|
extern char *machine_get_internal_name_ex(int m);
|
|
|
|
|
extern int machine_get_nvrmask(int m);
|
2017-11-22 18:14:27 +01:00
|
|
|
extern void machine_close(void);
|
2017-09-02 20:39:57 +02:00
|
|
|
|
|
|
|
|
|
2017-10-07 22:18:30 -04:00
|
|
|
/* Initialization functions for boards and systems. */
|
2018-03-19 01:02:04 +01:00
|
|
|
extern void machine_common_init(const machine_t *);
|
2017-10-07 22:18:30 -04:00
|
|
|
|
2018-03-19 01:02:04 +01:00
|
|
|
extern void machine_at_common_init(const machine_t *);
|
|
|
|
|
extern void machine_at_init(const machine_t *);
|
|
|
|
|
extern void machine_at_ps2_init(const machine_t *);
|
|
|
|
|
extern void machine_at_common_ide_init(const machine_t *);
|
|
|
|
|
extern void machine_at_ide_init(const machine_t *);
|
|
|
|
|
extern void machine_at_ps2_ide_init(const machine_t *);
|
|
|
|
|
extern void machine_at_top_remap_init(const machine_t *);
|
|
|
|
|
extern void machine_at_ide_top_remap_init(const machine_t *);
|
2017-10-07 22:18:30 -04:00
|
|
|
|
2018-03-19 01:02:04 +01:00
|
|
|
extern void machine_at_ibm_init(const machine_t *);
|
2018-01-24 00:35:52 +01:00
|
|
|
|
2018-03-19 01:02:04 +01:00
|
|
|
extern void machine_at_t3100e_init(const machine_t *);
|
2017-12-31 06:37:19 +01:00
|
|
|
|
2018-03-19 01:02:04 +01:00
|
|
|
extern void machine_at_p54tp4xe_init(const machine_t *);
|
|
|
|
|
extern void machine_at_endeavor_init(const machine_t *);
|
|
|
|
|
extern void machine_at_zappa_init(const machine_t *);
|
|
|
|
|
extern void machine_at_mb500n_init(const machine_t *);
|
|
|
|
|
extern void machine_at_president_init(const machine_t *);
|
|
|
|
|
extern void machine_at_thor_init(const machine_t *);
|
2017-10-07 22:18:30 -04:00
|
|
|
|
2018-03-19 01:02:04 +01:00
|
|
|
extern void machine_at_acerm3a_init(const machine_t *);
|
|
|
|
|
extern void machine_at_acerv35n_init(const machine_t *);
|
|
|
|
|
extern void machine_at_ap53_init(const machine_t *);
|
|
|
|
|
extern void machine_at_p55t2p4_init(const machine_t *);
|
|
|
|
|
extern void machine_at_p55t2s_init(const machine_t *);
|
2017-10-07 22:18:30 -04:00
|
|
|
|
2018-03-19 01:02:04 +01:00
|
|
|
extern void machine_at_batman_init(const machine_t *);
|
|
|
|
|
extern void machine_at_plato_init(const machine_t *);
|
2017-10-07 22:18:30 -04:00
|
|
|
|
2018-03-19 01:02:04 +01:00
|
|
|
extern void machine_at_p55tvp4_init(const machine_t *);
|
|
|
|
|
extern void machine_at_i430vx_init(const machine_t *);
|
|
|
|
|
extern void machine_at_p55va_init(const machine_t *);
|
2017-10-07 22:18:30 -04:00
|
|
|
|
2018-01-28 17:56:32 +01:00
|
|
|
#if defined(DEV_BRANCH) && defined(USE_I686)
|
2018-03-19 01:02:04 +01:00
|
|
|
extern void machine_at_i440fx_init(const machine_t *);
|
|
|
|
|
extern void machine_at_s1668_init(const machine_t *);
|
2018-01-01 03:40:59 +01:00
|
|
|
#endif
|
2018-03-19 01:02:04 +01:00
|
|
|
extern void machine_at_ali1429_init(const machine_t *);
|
|
|
|
|
extern void machine_at_cmdpc_init(const machine_t *);
|
2017-10-07 22:18:30 -04:00
|
|
|
|
2018-03-19 01:02:04 +01:00
|
|
|
extern void machine_at_headland_init(const machine_t *);
|
|
|
|
|
extern void machine_at_neat_init(const machine_t *);
|
|
|
|
|
extern void machine_at_neat_ami_init(const machine_t *);
|
|
|
|
|
extern void machine_at_opti495_init(const machine_t *);
|
|
|
|
|
extern void machine_at_opti495_ami_init(const machine_t *);
|
|
|
|
|
extern void machine_at_scat_init(const machine_t *);
|
|
|
|
|
extern void machine_at_scatsx_init(const machine_t *);
|
|
|
|
|
extern void machine_at_compaq_init(const machine_t *);
|
2017-10-07 22:18:30 -04:00
|
|
|
|
2018-03-19 01:02:04 +01:00
|
|
|
extern void machine_at_dtk486_init(const machine_t *);
|
|
|
|
|
extern void machine_at_r418_init(const machine_t *);
|
2017-10-07 22:18:30 -04:00
|
|
|
|
2018-03-19 01:02:04 +01:00
|
|
|
extern void machine_at_wd76c10_init(const machine_t *);
|
2017-10-07 22:18:30 -04:00
|
|
|
|
2018-01-28 17:56:32 +01:00
|
|
|
#if defined(DEV_BRANCH) && defined(USE_GREENB)
|
2018-03-19 01:02:04 +01:00
|
|
|
extern void machine_at_4gpv31_init(const machine_t *);
|
2017-12-25 17:57:05 +01:00
|
|
|
#endif
|
2017-12-04 14:50:41 -05:00
|
|
|
|
2018-03-19 01:02:04 +01:00
|
|
|
extern void machine_pcjr_init(const machine_t *);
|
2017-11-10 23:47:04 -05:00
|
|
|
|
2018-03-19 01:02:04 +01:00
|
|
|
extern void machine_ps1_m2011_init(const machine_t *);
|
|
|
|
|
extern void machine_ps1_m2121_init(const machine_t *);
|
|
|
|
|
extern void machine_ps1_m2133_init(const machine_t *);
|
2017-10-07 22:18:30 -04:00
|
|
|
|
2018-03-19 01:02:04 +01:00
|
|
|
extern void machine_ps2_m30_286_init(const machine_t *);
|
|
|
|
|
extern void machine_ps2_model_50_init(const machine_t *);
|
|
|
|
|
extern void machine_ps2_model_55sx_init(const machine_t *);
|
|
|
|
|
extern void machine_ps2_model_70_type3_init(const machine_t *);
|
|
|
|
|
extern void machine_ps2_model_70_type4_init(const machine_t *);
|
|
|
|
|
extern void machine_ps2_model_80_init(const machine_t *);
|
2017-12-25 17:57:05 +01:00
|
|
|
#ifdef WALTJE
|
2018-03-19 01:02:04 +01:00
|
|
|
extern void machine_ps2_model_80_486_init(const machine_t *);
|
2017-12-25 17:57:05 +01:00
|
|
|
#endif
|
2017-10-07 22:18:30 -04:00
|
|
|
|
2018-03-19 01:02:04 +01:00
|
|
|
extern void machine_amstrad_init(const machine_t *);
|
2017-10-07 22:18:30 -04:00
|
|
|
|
2018-03-19 01:02:04 +01:00
|
|
|
extern void machine_europc_init(const machine_t *);
|
2017-11-19 21:59:38 -05:00
|
|
|
#ifdef EMU_DEVICE_H
|
2018-03-19 01:02:04 +01:00
|
|
|
extern const device_t europc_device,
|
2017-11-19 21:59:38 -05:00
|
|
|
europc_hdc_device;
|
|
|
|
|
#endif
|
2017-10-07 22:18:30 -04:00
|
|
|
|
2018-03-19 01:02:04 +01:00
|
|
|
extern void machine_olim24_init(const machine_t *);
|
2017-11-22 18:14:27 +01:00
|
|
|
extern void machine_olim24_video_init(void);
|
2017-10-07 22:18:30 -04:00
|
|
|
|
2018-03-19 01:02:04 +01:00
|
|
|
extern void machine_tandy1k_init(const machine_t *);
|
2017-11-10 23:47:04 -05:00
|
|
|
extern int tandy1k_eeprom_read(void);
|
2017-10-07 22:18:30 -04:00
|
|
|
|
2018-03-19 01:02:04 +01:00
|
|
|
extern void machine_xt_init(const machine_t *);
|
|
|
|
|
extern void machine_xt_compaq_init(const machine_t *);
|
2018-01-28 17:56:32 +01:00
|
|
|
#if defined(DEV_BRANCH) && defined(USE_LASERXT)
|
2018-03-19 01:02:04 +01:00
|
|
|
extern void machine_xt_laserxt_init(const machine_t *);
|
2018-01-28 17:56:32 +01:00
|
|
|
#endif
|
2017-10-07 22:18:30 -04:00
|
|
|
|
2018-03-19 01:02:04 +01:00
|
|
|
extern void machine_xt_t1000_init(const machine_t *);
|
|
|
|
|
extern void machine_xt_t1200_init(const machine_t *);
|
2018-03-02 19:33:02 +01:00
|
|
|
|
2018-03-19 01:02:04 +01:00
|
|
|
extern void machine_xt_xi8088_init(const machine_t *);
|
2018-03-02 20:47:18 +01:00
|
|
|
|
2018-02-09 05:42:40 +01:00
|
|
|
#ifdef EMU_DEVICE_H
|
2018-03-19 01:02:04 +01:00
|
|
|
extern const device_t *xi8088_get_device(void);
|
2018-03-02 20:47:18 +01:00
|
|
|
|
2018-03-19 01:02:04 +01:00
|
|
|
extern const device_t *pcjr_get_device(void);
|
2018-02-09 05:42:40 +01:00
|
|
|
|
2018-03-19 01:02:04 +01:00
|
|
|
extern const device_t *tandy1k_get_device(void);
|
|
|
|
|
extern const device_t *tandy1k_hx_get_device(void);
|
2018-02-09 05:42:40 +01:00
|
|
|
|
2018-03-19 01:02:04 +01:00
|
|
|
extern const device_t *t1000_get_device(void);
|
|
|
|
|
extern const device_t *t1200_get_device(void);
|
2018-03-02 19:33:02 +01:00
|
|
|
|
2018-03-19 01:02:04 +01:00
|
|
|
extern const device_t *at_endeavor_get_device(void);
|
2018-02-09 05:42:40 +01:00
|
|
|
#endif
|
|
|
|
|
|
2017-10-07 22:18:30 -04:00
|
|
|
|
2017-09-02 20:39:57 +02:00
|
|
|
#endif /*EMU_MACHINE_H*/
|