This commit is contained in:
OBattler
2023-07-06 19:59:54 +02:00
140 changed files with 2899 additions and 1754 deletions

View File

@@ -59,8 +59,7 @@ extern "C" {
#define VEN_VIA 0x01106
#define VEN_VIA_596B 0x11106
typedef struct
{
typedef struct acpi_regs_t {
uint8_t acpitst;
uint8_t auxen;
uint8_t auxsts;
@@ -111,8 +110,7 @@ typedef struct
uint32_t pad0;
} acpi_regs_t;
typedef struct
{
typedef struct acpi_t {
acpi_regs_t regs;
uint8_t gpireg2_default;
uint8_t pad[3];

View File

@@ -21,8 +21,7 @@
extern "C" {
#endif
typedef struct
{
typedef struct apm_t {
uint8_t cmd;
uint8_t stat;
uint8_t do_smi;

View File

@@ -114,7 +114,7 @@ static const struct {
/* To shut up the GCC compilers. */
struct cdrom;
typedef struct {
typedef struct subchannel_t {
uint8_t attr;
uint8_t track;
uint8_t index;
@@ -126,7 +126,7 @@ typedef struct {
uint8_t rel_f;
} subchannel_t;
typedef struct {
typedef struct track_info_t {
int number;
uint8_t attr;
uint8_t m;
@@ -135,7 +135,7 @@ typedef struct {
} track_info_t;
/* Define the various CD-ROM drive operations (ops). */
typedef struct {
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);

View File

@@ -27,7 +27,7 @@ extern "C" {
#endif
#if 0
typedef struct {
typedef struct storage_cfg_t {
uint8_t id;
uint8_t bus_type; /* Bus type: IDE, SCSI, etc. */
uint8_t bus, : 4; /* ID of the bus (for example, for IDE,
@@ -47,7 +47,7 @@ typedef struct {
uint32_t tracks;
} storage_cfg_t;
typedef struct {
typedef struct config_t {
/* General configuration */
int vid_resize; /* Window is resizable or not */
int vid_renderer; /* Renderer */

View File

@@ -21,15 +21,13 @@
extern "C" {
#endif
typedef struct
{
typedef struct ddma_channel_t {
uint16_t io_base;
int channel;
int enable;
} ddma_channel_t;
typedef struct
{
typedef struct ddma_t {
ddma_channel_t channels[8];
} ddma_t;

View File

@@ -86,12 +86,12 @@ enum {
#define BIOS_INTERLEAVED_INVERT 8
#define BIOS_HIGH_BIT_INVERT 16
typedef struct {
typedef struct device_config_selection_t {
const char *description;
int value;
} device_config_selection_t;
typedef struct {
typedef struct device_config_bios_t {
const char *name;
const char *internal_name;
int bios_type;
@@ -103,13 +103,13 @@ typedef struct {
const char *files[9];
} device_config_bios_t;
typedef struct {
typedef struct device_config_spinner_t {
int16_t min;
int16_t max;
int16_t step;
} device_config_spinner_t;
typedef struct {
typedef struct device_config_t {
const char *name;
const char *description;
int type;
@@ -144,7 +144,7 @@ typedef struct _device_ {
const device_config_t *config;
} device_t;
typedef struct {
typedef struct device_context_t {
const device_t *dev;
char name[2048];
int instance;

View File

@@ -22,7 +22,7 @@
extern "C" {
#endif
typedef struct {
typedef struct disk_size_t {
int hole;
int sides;
int data_rate;

View File

@@ -43,7 +43,7 @@
#define DMA_OVER 0x10000
#define DMA_VERIFY 0x20000
typedef struct {
typedef struct dma_t {
uint8_t m;
uint8_t mode;
uint8_t page;

View File

@@ -56,7 +56,7 @@ extern int fdc_type;
#define FDC_FLAG_TER 0x2000 /* Is Tertiary */
#define FDC_FLAG_QUA 0x3000 /* Is Quaternary */
typedef struct {
typedef struct fdc_t {
uint8_t dor;
uint8_t stat;
uint8_t command;

View File

@@ -65,7 +65,7 @@ extern int fdd_get_from_internal_name(char *s);
extern int fdd_current_track(int drive);
typedef struct {
typedef struct DRIVE {
int id;
void (*seek)(int drive, int track);

View File

@@ -1,7 +1,7 @@
#ifndef EMU_FIFO8_H
#define EMU_FIFO8_H
typedef struct {
typedef struct Fifo8 {
/* All fields are private */
uint8_t *data;
uint32_t capacity;

View File

@@ -34,7 +34,7 @@
#define GAMEPORT_SIO 0x1000000
typedef struct {
typedef struct plat_joystick_t {
char name[260];
int a[8];
@@ -68,7 +68,7 @@ typedef struct {
int nr_sliders;
} plat_joystick_t;
typedef struct {
typedef struct joystick_t {
int axis[8];
int button[32];
int pov[4];
@@ -79,7 +79,7 @@ typedef struct {
int pov_mapping[4][2];
} joystick_t;
typedef struct {
typedef struct joystick_if_t {
const char *name;
const char *internal_name;

View File

@@ -20,8 +20,7 @@
#ifndef EMU_HDC_IDE_SFF8038I_H
#define EMU_HDC_IDE_SFF8038I_H
typedef struct
{
typedef struct sff8038i_t {
uint8_t command;
uint8_t status;
uint8_t ptr0;

View File

@@ -87,7 +87,7 @@ enum {
#define HDD_MAX_ZONES 16
#define HDD_MAX_CACHE_SEG 16
typedef struct {
typedef struct hdd_preset_t {
const char *name;
const char *internal_name;
uint32_t zones;
@@ -101,7 +101,7 @@ typedef struct {
double track_seek_ms;
} hdd_preset_t;
typedef struct {
typedef struct hdd_cache_seg_t {
uint32_t id;
uint32_t lba_addr;
uint32_t ra_addr;
@@ -110,7 +110,7 @@ typedef struct {
uint8_t valid;
} hdd_cache_seg_t;
typedef struct {
typedef struct hdd_cache_t {
// Read cache
hdd_cache_seg_t segments[HDD_MAX_CACHE_SEG];
uint32_t num_segments;
@@ -126,7 +126,7 @@ typedef struct {
uint64_t write_start_time;
} hdd_cache_t;
typedef struct {
typedef struct hdd_zone_t {
uint32_t cylinders;
uint32_t sectors_per_track;
double sector_time_usec;
@@ -136,7 +136,7 @@ typedef struct {
} hdd_zone_t;
/* Define the virtual Hard Disk. */
typedef struct {
typedef struct hard_disk_t {
uint8_t id;
union {
uint8_t channel; /* Needed for Settings to reduce the number of if's */

View File

@@ -31,25 +31,25 @@ enum {
ISAPNP_CARD_NO_KEY = 3 /* cheat code for Crystal CS423x */
};
typedef struct {
typedef struct isapnp_device_config_t {
uint8_t activate;
struct {
struct pnp_mem_t {
uint32_t base : 24;
uint32_t size : 24;
} mem[4];
struct {
struct pnp_mem32_t {
uint32_t base;
uint32_t size;
} mem32[4];
struct {
struct pnp_io_t {
uint16_t base;
} io[8];
struct {
struct pnp_irq_t {
uint8_t irq : 4;
uint8_t level : 1;
uint8_t type : 1;
} irq[2];
struct {
struct pnp_dma_t {
uint8_t dma : 3;
} dma[2];
} isapnp_device_config_t;

View File

@@ -39,7 +39,7 @@ enum {
};
/* Used by the AT / PS/2 keyboard controller, common device, keyboard, and mouse. */
typedef struct {
typedef struct kbc_at_port_t {
uint8_t wantcmd;
uint8_t dat;
@@ -51,7 +51,7 @@ typedef struct {
} kbc_at_port_t;
/* Used by the AT / PS/2 common device, keyboard, and mouse. */
typedef struct {
typedef struct atkbc_dev_t {
const char *name; /* name of this device */
uint8_t type;
@@ -88,7 +88,7 @@ typedef struct {
kbc_at_port_t *port;
} atkbc_dev_t;
typedef struct {
typedef struct scancode {
const uint8_t mk[4];
const uint8_t brk[4];
} scancode;

View File

@@ -17,8 +17,7 @@
#define LPT6_IRQ 5
#endif
typedef struct
{
typedef struct lpt_device_t {
const char *name;
const char *internal_name;

View File

@@ -1,20 +1,20 @@
#ifndef EMU_MACHINE_STATUS_H
#define EMU_MACHINE_STATUS_H
typedef struct {
typedef struct dev_status_empty_active_t {
atomic_bool_t empty;
atomic_bool_t active;
} dev_status_empty_active_t;
typedef struct {
typedef struct dev_status_active_t {
atomic_bool_t active;
} dev_status_active_t;
typedef struct {
typedef struct dev_status_empty_t {
atomic_bool_t empty;
} dev_status_empty_t;
typedef struct {
typedef struct machine_status_t {
dev_status_empty_active_t fdd[FDD_NUM];
dev_status_empty_active_t cdrom[CDROM_NUM];
dev_status_empty_active_t zip[ZIP_NUM];

View File

@@ -158,20 +158,21 @@
#define mem_set_access_smram_bus(smm, base, size, is_smram) \
mem_set_access((smm ? ACCESS_BUS_SMM : ACCESS_BUS), 1, base, size, is_smram)
typedef struct {
typedef struct state_t {
uint16_t x : 5;
uint16_t w : 5;
uint16_t r : 5;
uint16_t pad : 1;
} state_t;
typedef union {
typedef union mem_state_t {
uint16_t vals[4];
state_t states[4];
} mem_state_t;
typedef struct _mem_mapping_ {
struct _mem_mapping_ *prev, *next;
struct _mem_mapping_ *prev;
struct _mem_mapping_ *next;
int enable;

View File

@@ -27,7 +27,7 @@
#define MO_TIME 10.0
typedef struct {
typedef struct mo_type_t {
uint32_t sectors;
uint16_t bytes_per_sector;
} mo_type_t;
@@ -48,8 +48,7 @@ static const mo_type_t mo_types[KNOWN_MO_TYPES] = {
{ 637041, 1024},
};
typedef struct
{
typedef struct mo_drive_type_t {
const char vendor[9];
const char model[16];
const char revision[5];
@@ -89,7 +88,7 @@ enum {
MO_BUS_USB = 7
};
typedef struct {
typedef struct mo_drive_t {
uint8_t id;
union {
@@ -121,7 +120,7 @@ typedef struct {
} mo_drive_t;
typedef struct {
typedef struct mo_t {
mode_sense_pages_t ms_pages_saved;
mo_drive_t *drv;

View File

@@ -36,7 +36,7 @@
#define DP8390_FLAG_CHECK_CR 0x02
#define DP8390_FLAG_CLEAR_IRQ 0x04
typedef struct {
typedef struct dp8390_t {
/* Page 0 */
/* Command Register - 00h read/write */

View File

@@ -1,7 +1,7 @@
#ifndef EMU_NET_EVENT_H
#define EMU_NET_EVENT_H
typedef struct {
typedef struct net_evt_t {
#ifdef _WIN32
HANDLE handle;
#else

View File

@@ -93,7 +93,7 @@ enum {
NET_QUEUE_TX_HOST = 2
};
typedef struct {
typedef struct netcard_conf_t {
uint16_t device_num;
int net_type;
char host_dev_name[128];
@@ -111,7 +111,7 @@ typedef struct netpkt {
int len;
} netpkt_t;
typedef struct {
typedef struct netqueue_t {
netpkt_t packets[NET_QUEUE_LEN];
int head;
int tail;

View File

@@ -19,7 +19,7 @@
#ifndef EMU_PIT_H
#define EMU_PIT_H
typedef struct {
typedef struct ctr_t {
uint8_t m;
uint8_t ctrl;
uint8_t read_status;
@@ -44,13 +44,13 @@ typedef struct {
int do_read_status;
union {
int count;
int32_t count;
struct {
int units : 4;
int tens : 4;
int hundreds : 4;
int thousands : 4;
int myriads : 4;
int32_t units : 4;
int32_t tens : 4;
int32_t hundreds : 4;
int32_t thousands : 4;
int32_t myriads : 4;
};
};
@@ -77,7 +77,7 @@ enum {
PIT_8254_FAST = 3
};
typedef struct {
typedef struct pit_intf_t {
uint8_t (*read)(uint16_t addr, void *priv);
void (*write)(uint16_t addr, uint8_t val, void *priv);
/* Gets a counter's count. */

View File

@@ -19,7 +19,7 @@
#ifndef EMU_PIT_FAST_H
#define EMU_PIT_FAST_H
typedef struct {
typedef struct ctrf_t {
uint8_t m;
uint8_t ctrl;
uint8_t read_status;
@@ -45,13 +45,13 @@ typedef struct {
int rereadlatch;
union {
int count;
int32_t count;
struct {
int units : 4;
int tens : 4;
int hundreds : 4;
int thousands : 4;
int myriads : 4;
int32_t units : 4;
int32_t tens : 4;
int32_t hundreds : 4;
int32_t thousands : 4;
int32_t myriads : 4;
};
};
@@ -62,7 +62,7 @@ typedef struct {
void (*out_func)(int new_out, int old_out);
} ctrf_t;
typedef struct {
typedef struct pitf_t {
int flags;
ctrf_t counters[3];

View File

@@ -39,7 +39,7 @@ struct dirent {
};
# define d_namlen d_reclen
typedef struct {
typedef struct DIR_t {
short flags; /* internal flags */
short offset; /* offset of entry into dir */
long handle; /* open handle to Win32 system */

View File

@@ -18,7 +18,7 @@
#ifndef PLAT_DYNLD_H
#define PLAT_DYNLD_H
typedef struct {
typedef struct dllimp_t {
const char *name;
void *func;
} dllimp_t;

View File

@@ -20,8 +20,7 @@
#define EMU_PORT_6X_H
#ifdef _TIMER_H_
typedef struct
{
typedef struct port_6x_t {
uint8_t refresh;
uint8_t flags;

View File

@@ -20,8 +20,7 @@
#define EMU_PORT_92_H
#ifdef _TIMER_H_
typedef struct
{
typedef struct port_92_t {
uint8_t reg;
uint8_t flags;

View File

@@ -32,7 +32,7 @@
#define bios_load_interleavedr(a, b, c, d, e) bios_load(a, b, c, d, e, FLAG_INT | FLAG_REP)
#define bios_load_aux_interleaved(a, b, c, d, e) bios_load(a, b, c, d, e, FLAG_INT | FLAG_AUX)
typedef struct {
typedef struct rom_t {
uint8_t *rom;
int sz;
uint32_t mask;

View File

@@ -22,7 +22,7 @@
#define CDROM_TIME 10.0
#ifdef SCSI_DEVICE_H
typedef struct {
typedef struct scsi_cdrom_t {
/* Common block. */
mode_sense_pages_t ms_pages_saved;

View File

@@ -338,7 +338,7 @@
#define MODE_SELECT_PHASE_PAGE_HEADER 3
#define MODE_SELECT_PHASE_PAGE 4
typedef struct {
typedef struct mode_sense_pages_t {
uint8_t pages[0x40][0x40];
} mode_sense_pages_t;
@@ -384,7 +384,7 @@ typedef struct scsi_common_s {
double callback;
} scsi_common_t;
typedef struct {
typedef struct scsi_device_t {
int32_t buffer_length;
uint8_t status;

View File

@@ -16,7 +16,7 @@
#ifndef SCSI_DISK_H
#define SCSI_DISK_H
typedef struct {
typedef struct scsi_disk_t {
mode_sense_pages_t ms_pages_saved;
hard_disk_t *drv;

View File

@@ -203,13 +203,13 @@ typedef struct addr24_s {
} addr24_t;
/* Structure for the INQUIRE_SETUP_INFORMATION reply. */
typedef struct {
typedef struct ReplyInquireSetupInformationSynchronousValue_t {
uint8_t uOffset : 4;
uint8_t uTransferPeriod : 3;
uint8_t fSynchronous : 1;
} ReplyInquireSetupInformationSynchronousValue;
typedef struct {
typedef struct ReplyInquireSetupInformation_t {
uint8_t fSynchronousInitiationEnabled : 1;
uint8_t fParityCheckingEnabled : 1;
uint8_t uReserved1 : 6;
@@ -223,24 +223,24 @@ typedef struct {
uint8_t VendorSpecificData[28];
} ReplyInquireSetupInformation;
typedef struct {
typedef struct MailboxInit_t {
uint8_t Count;
addr24_t Address;
} MailboxInit_t;
typedef struct {
typedef struct Mailbox_t {
uint8_t CmdStatus;
addr24_t CCBPointer;
} Mailbox_t;
typedef struct {
typedef struct Mailbox32_t {
uint32_t CCBPointer;
union {
struct {
struct out_t {
uint8_t Reserved[3];
uint8_t ActionCode;
} out;
struct {
struct in_t {
uint8_t HostStatus;
uint8_t TargetStatus;
uint8_t Reserved;
@@ -255,7 +255,7 @@ typedef struct {
Bytes 16 and 17 Reserved (must be 0)
Bytes 18 through 18+n-1, where n=size of CDB Command Descriptor Block */
typedef struct {
typedef struct CCB32_t {
uint8_t Opcode;
uint8_t Reserved1 : 3,
ControlByte : 2,
@@ -277,7 +277,7 @@ typedef struct {
uint32_t SensePointer;
} CCB32;
typedef struct {
typedef struct CCB_t {
uint8_t Opcode;
uint8_t Lun : 3;
uint8_t ControlByte : 2;
@@ -294,7 +294,7 @@ typedef struct {
uint8_t Cdb[12];
} CCB;
typedef struct {
typedef struct CCBC_t {
uint8_t Opcode;
uint8_t Pad1 : 3,
ControlByte : 2,
@@ -309,7 +309,7 @@ typedef struct {
uint8_t Cdb[12];
} CCBC;
typedef union {
typedef union CCBU_t {
CCB32 new;
CCB old;
CCBC common;
@@ -320,26 +320,25 @@ typedef struct {
uint8_t *RequestSenseBuffer;
uint32_t CCBPointer;
int Is24bit;
uint8_t TargetID,
LUN,
HostStatus,
TargetStatus,
MailboxCompletionCode;
uint8_t TargetID;
uint8_t LUN;
uint8_t HostStatus;
uint8_t TargetStatus;
uint8_t MailboxCompletionCode;
} Req_t;
typedef struct
{
typedef struct BIOSCMD_t {
uint8_t command;
uint8_t lun : 3,
reserved : 2,
id : 3;
union {
struct {
struct chs_t {
uint16_t cyl;
uint8_t head;
uint8_t sec;
} chs;
struct {
struct lba_t {
uint8_t lba0; /* MSB */
uint8_t lba1;
uint8_t lba2;
@@ -350,12 +349,12 @@ typedef struct
addr24_t dma_address;
} BIOSCMD;
typedef struct {
typedef struct SGE32_t {
uint32_t Segment;
uint32_t SegmentPointer;
} SGE32;
typedef struct {
typedef struct SGE_t {
addr24_t Segment;
addr24_t SegmentPointer;
} SGE;
@@ -368,92 +367,111 @@ typedef struct {
#define X54X_MBX_24BIT 16
#define X54X_ISAPNP 32
typedef struct {
typedef struct x54x_t {
/* 32 bytes */
char vendor[16], /* name of device vendor */
name[16]; /* name of device */
char vendor[16]; /* name of device vendor */
char name[16]; /* name of device */
/* 24 bytes */
int8_t type, /* type of device */
IrqEnabled, Irq,
DmaChannel,
HostID;
int8_t type; /* type of device */
int8_t IrqEnabled;
int8_t Irq;
int8_t DmaChannel;
int8_t HostID;
uint8_t callback_phase : 4,
callback_sub_phase : 4,
scsi_cmd_phase, bus,
sync,
parity, shram_mode,
Geometry, Control,
Command, CmdParam,
BusOnTime, BusOffTime,
ATBusSpeed, setup_info_len,
max_id, pci_slot,
temp_cdb[12];
uint8_t callback_phase : 4;
uint8_t callback_sub_phase : 4;
uint8_t scsi_cmd_phase;
uint8_t bus;
uint8_t sync;
uint8_t parity;
uint8_t shram_mode;
uint8_t Geometry;
uint8_t Control;
uint8_t Command;
uint8_t CmdParam;
uint8_t BusOnTime;
uint8_t BusOffTime;
uint8_t ATBusSpeed;
uint8_t setup_info_len;
uint8_t max_id;
uint8_t pci_slot;
uint8_t temp_cdb[12];
volatile uint8_t /* for multi-threading, keep */
Status,
Interrupt, /* these volatile */
MailboxIsBIOS, ToRaise,
flags;
/* for multi-threading, keep these volatile */
volatile uint8_t Status;
volatile uint8_t Interrupt;
volatile uint8_t MailboxIsBIOS;
volatile uint8_t ToRaise;
volatile uint8_t flags;
/* 65928 bytes */
uint8_t pos_regs[8], /* MCA */
CmdBuf[128],
DataBuf[65536],
shadow_ram[128],
dma_buffer[128],
cmd_33_buf[4096];
uint8_t pos_regs[8]; /* MCA */
uint8_t CmdBuf[128];
uint8_t DataBuf[65536];
uint8_t shadow_ram[128];
uint8_t dma_buffer[128];
uint8_t cmd_33_buf[4096];
/* 16 bytes */
char *fw_rev; /* The 4 bytes of the revision command information + 2 extra bytes for BusLogic */
uint8_t *rom1, /* main BIOS image */
*rom2, /* SCSI-Select image */
*nvr; /* EEPROM buffer */
uint8_t *rom1; /* main BIOS image */
uint8_t *rom2; /* SCSI-Select image */
uint8_t *nvr; /* EEPROM buffer */
/* 6 words = 12 bytes */
uint16_t DataReply, DataReplyLeft,
rom_ioaddr, /* offset in BIOS of I/O addr */
rom_shram, /* index to shared RAM */
rom_shramsz, /* size of shared RAM */
rom_fwhigh, /* offset in BIOS of ver ID */
pnp_len, /* length of the PnP ROM */
pnp_offset, /* offset in the microcode ROM of the PnP ROM */
cmd_33_len, /* length of the SCSISelect code decompressor program */
cmd_33_offset; /* offset in the microcode ROM of the SCSISelect code decompressor program */
uint16_t DataReply;
uint16_t DataReplyLeft;
uint16_t rom_ioaddr; /* offset in BIOS of I/O addr */
uint16_t rom_shram; /* index to shared RAM */
uint16_t rom_shramsz; /* size of shared RAM */
uint16_t rom_fwhigh; /* offset in BIOS of ver ID */
uint16_t pnp_len; /* length of the PnP ROM */
uint16_t pnp_offset; /* offset in the microcode ROM of the PnP ROM */
uint16_t cmd_33_len; /* length of the SCSISelect code decompressor program */
uint16_t cmd_33_offset; /* offset in the microcode ROM of the SCSISelect code decompressor program */
/* 16 + 20 + 52 = 88 bytes */
volatile int
MailboxOutInterrupts,
PendingInterrupt, Lock,
target_data_len, pad0;
volatile int MailboxOutInterrupts;
volatile int PendingInterrupt;
volatile int Lock;
volatile int target_data_len;
volatile int pad0;
uint32_t Base, fdc_address, rom_addr, /* address of BIOS ROM */
CmdParamLeft, Outgoing,
transfer_size;
uint32_t Base;
uint32_t fdc_address;
uint32_t rom_addr; /* address of BIOS ROM */
uint32_t CmdParamLeft;
uint32_t Outgoing;
uint32_t transfer_size;
volatile uint32_t
MailboxInit,
MailboxCount,
MailboxOutAddr, MailboxOutPosCur,
MailboxInAddr, MailboxInPosCur,
MailboxReq,
BIOSMailboxInit, BIOSMailboxCount,
BIOSMailboxOutAddr, BIOSMailboxOutPosCur,
BIOSMailboxReq,
Residue, card_bus; /* Basically a copy of device flags */
volatile uint32_t MailboxInit;
volatile uint32_t MailboxCount;
volatile uint32_t MailboxOutAddr;
volatile uint32_t MailboxOutPosCur;
volatile uint32_t MailboxInAddr;
volatile uint32_t MailboxInPosCur;
volatile uint32_t MailboxReq;
volatile uint32_t BIOSMailboxInit;
volatile uint32_t BIOSMailboxCount;
volatile uint32_t BIOSMailboxOutAddr;
volatile uint32_t BIOSMailboxOutPosCur;
volatile uint32_t BIOSMailboxReq;
volatile uint32_t Residue;
volatile uint32_t card_bus; /* Basically a copy of device flags */
/* 8 bytes */
uint64_t temp_period;
/* 16 bytes */
double media_period, ha_bps; /* bytes per second */
double media_period;
double ha_bps; /* bytes per second */
/* 8 bytes */
char *bios_path, /* path to BIOS image file */
*mcode_path, /* path to microcode image file, needed by the AHA-1542CP */
*nvr_path; /* path to NVR image file */
char *bios_path; /* path to BIOS image file */
char *mcode_path; /* path to microcode image file, needed by the AHA-1542CP */
char *nvr_path; /* path to NVR image file */
/* 56 bytes */
/* Pointer to a structure of vendor-specific data that only the vendor-specific code can understand */
@@ -486,12 +504,13 @@ typedef struct {
/* Pointer to a function that resets vendor-specific data */
void (*ven_reset)(void *p);
rom_t bios, /* BIOS memory descriptor */
uppersck; /* BIOS memory descriptor */
rom_t bios; /* BIOS memory descriptor */
rom_t uppersck; /* BIOS memory descriptor */
mem_mapping_t mmio_mapping;
pc_timer_t timer, ResetCB;
pc_timer_t timer;
pc_timer_t ResetCB;
Req_t Req;

View File

@@ -107,7 +107,7 @@ typedef struct serial_device_s {
serial_t *serial;
} serial_device_t;
typedef struct {
typedef struct serial_port_s {
uint8_t enabled;
} serial_port_t;

View File

@@ -29,7 +29,7 @@ enum {
SMBUS_VIA = 1
};
typedef struct {
typedef struct smbus_piix4_t {
uint32_t local;
uint16_t io_base;
int clock;
@@ -47,7 +47,7 @@ typedef struct {
void *i2c;
} smbus_piix4_t;
typedef struct {
typedef struct smbus_ali7101_t {
uint32_t local;
uint16_t io_base;
uint8_t stat;

View File

@@ -103,21 +103,21 @@ enum {
AC97_CODEC_AK4540 = 7
};
typedef struct {
typedef struct ac97_vendor_reg_t {
const uint16_t index;
const uint16_t value;
const uint16_t write_mask;
} ac97_vendor_reg_t;
typedef struct {
uint32_t vendor_id;
uint32_t min_rate;
uint32_t max_rate;
uint32_t misc_flags;
uint16_t reset_flags;
uint16_t extid_flags;
uint16_t powerdown_mask;
uint16_t regs[64];
typedef struct ac97_codec_t {
uint32_t vendor_id;
uint32_t min_rate;
uint32_t max_rate;
uint32_t misc_flags;
uint16_t reset_flags;
uint16_t extid_flags;
uint16_t powerdown_mask;
uint16_t regs[64];
uint8_t codec_id;
uint8_t vendor_reg_page_max;
const ac97_vendor_reg_t *vendor_regs;

View File

@@ -30,7 +30,7 @@ enum {
AD1848_TYPE_CS4236 = 4
};
typedef struct {
typedef struct ad1848_t {
uint8_t type;
uint8_t index;
uint8_t xindex;

View File

@@ -31,7 +31,7 @@ enum fm_driver {
FM_DRV_MAX = 2
};
typedef struct {
typedef struct fm_drv_t {
uint8_t (*read)(uint16_t port, void *priv);
void (*write)(uint16_t port, uint8_t val, void *priv);
int32_t *(*update)(void *priv);

View File

@@ -56,16 +56,14 @@ typedef struct usb_params_t
void* parent_priv;
} usb_params_t;
typedef union
{
typedef union {
uint32_t l;
uint16_t w[2];
uint8_t b[4];
} ohci_mmio_t;
/* USB Host Controller device struct */
typedef struct usb_t
{
typedef struct usb_t {
uint8_t uhci_io[32];
ohci_mmio_t ohci_mmio[1024];
uint16_t uhci_io_base;
@@ -88,14 +86,12 @@ typedef struct usb_t
#pragma pack(push, 1)
/* Base USB descriptor struct. */
typedef struct usb_desc_base_t
{
typedef struct usb_desc_base_t {
uint8_t bLength;
uint8_t bDescriptorType;
} usb_desc_base_t;
enum usb_desc_setup_req_types
{
enum usb_desc_setup_req_types {
USB_SETUP_TYPE_DEVICE = 0x0,
USB_SETUP_TYPE_INTERFACE = 0x1,
USB_SETUP_TYPE_ENDPOING = 0x2,
@@ -106,8 +102,7 @@ enum usb_desc_setup_req_types
#define USB_SETUP_DEV_TO_HOST 0x80
typedef struct usb_desc_setup_t
{
typedef struct usb_desc_setup_t {
uint8_t bmRequestType;
uint8_t bRequest;
uint16_t wValue;
@@ -115,8 +110,7 @@ typedef struct usb_desc_setup_t
uint16_t wLength;
} usb_desc_setup_t;
typedef struct usb_desc_endpoint_t
{
typedef struct usb_desc_endpoint_t {
usb_desc_base_t base;
uint8_t bEndpointAddress;
uint8_t bmAttributes;
@@ -124,8 +118,7 @@ typedef struct usb_desc_endpoint_t
uint8_t bInterval;
} usb_desc_endpoint_t;
typedef struct usb_desc_hid_t
{
typedef struct usb_desc_hid_t {
usb_desc_base_t base;
uint16_t bcdHID;
@@ -135,8 +128,7 @@ typedef struct usb_desc_hid_t
uint16_t wDescriptorLength;
} usb_desc_hid_t;
typedef struct usb_desc_interface_t
{
typedef struct usb_desc_interface_t {
usb_desc_base_t base;
uint8_t bInterfaceNumber;
@@ -148,14 +140,12 @@ typedef struct usb_desc_interface_t
uint8_t iInterface;
} usb_desc_interface_t;
typedef struct usb_desc_string_t
{
typedef struct usb_desc_string_t {
usb_desc_base_t base;
uint16_t bString[];
} usb_desc_string_t;
typedef struct usb_desc_conf_t
{
typedef struct usb_desc_conf_t {
usb_desc_base_t base;
uint16_t wTotalLength;
@@ -166,8 +156,7 @@ typedef struct usb_desc_conf_t
uint8_t bMaxPower;
} usb_desc_conf_t;
typedef struct usb_desc_device_t
{
typedef struct usb_desc_device_t {
usb_desc_base_t base;
uint16_t bcdUSB;
@@ -187,8 +176,7 @@ typedef struct usb_desc_device_t
#pragma pack(pop)
/* USB endpoint device struct. Incomplete and unused. */
typedef struct usb_device_t
{
typedef struct usb_device_t {
usb_desc_device_t device_desc;
struct {
usb_desc_conf_t conf_desc;

View File

@@ -63,47 +63,54 @@ enum {
#define VIDEO_FLAG_TYPE_NONE 3
#define VIDEO_FLAG_TYPE_MASK 3
typedef struct {
typedef struct video_timings_t {
int type;
int write_b, write_w, write_l;
int read_b, read_w, read_l;
int write_b;
int write_w;
int write_l;
int read_b;
int read_w;
int read_l;
} video_timings_t;
typedef struct {
int w, h;
typedef struct bitmap_t {
int w;
int h;
uint32_t *dat;
uint32_t *line[2112];
} bitmap_t;
typedef struct {
uint8_t r, g, b;
typedef struct rgb_t {
uint8_t r;
uint8_t g;
uint8_t b;
} rgb_t;
typedef struct {
typedef struct dbcs_font_t {
uint8_t chr[32];
} dbcs_font_t;
struct blit_data_struct;
typedef struct monitor_t {
char name[512];
int mon_xsize;
int mon_ysize;
int mon_scrnsz_x;
int mon_scrnsz_y;
int mon_efscrnsz_y;
int mon_unscaled_size_x;
int mon_unscaled_size_y;
int mon_res_x;
int mon_res_y;
int mon_bpp;
bitmap_t *target_buffer;
int mon_video_timing_read_b,
mon_video_timing_read_w,
mon_video_timing_read_l;
int mon_video_timing_write_b,
mon_video_timing_write_w,
mon_video_timing_write_l;
char name[512];
int mon_xsize;
int mon_ysize;
int mon_scrnsz_x;
int mon_scrnsz_y;
int mon_efscrnsz_y;
int mon_unscaled_size_x;
int mon_unscaled_size_y;
int mon_res_x;
int mon_res_y;
int mon_bpp;
bitmap_t *target_buffer;
int mon_video_timing_read_b;
int mon_video_timing_read_w;
int mon_video_timing_read_l;
int mon_video_timing_write_b;
int mon_video_timing_write_w;
int mon_video_timing_write_l;
int mon_overscan_x;
int mon_overscan_y;
int mon_force_resize;
@@ -137,10 +144,14 @@ extern int video_fullscreen_scale_maximized;
typedef rgb_t PALETTE[256];
// extern int changeframecount;
#if 0
extern int changeframecount;
#endif
extern volatile int screenshots;
// extern bitmap_t *buffer32;
#if 0
extern bitmap_t *buffer32;
#endif
#define buffer32 (monitors[monitor_index_global].target_buffer)
#define pal_lookup (monitors[monitor_index_global].mon_pal_lookup)
#define overscan_x (monitors[monitor_index_global].mon_overscan_x)
@@ -163,12 +174,14 @@ extern volatile int screenshots;
#define efscrnsz_y (monitors[monitor_index_global].mon_efscrnsz_y)
#define unscaled_size_x (monitors[monitor_index_global].mon_unscaled_size_x)
#define unscaled_size_y (monitors[monitor_index_global].mon_unscaled_size_y)
extern PALETTE cgapal;
extern PALETTE cgapal_mono[6];
// extern uint32_t pal_lookup[256];
extern int video_fullscreen;
extern int video_fullscreen_scale;
extern int video_fullscreen_first;
extern PALETTE cgapal;
extern PALETTE cgapal_mono[6];
#if 0
extern uint32_t pal_lookup[256];
#endif
extern int video_fullscreen;
extern int video_fullscreen_scale;
extern int video_fullscreen_first;
extern uint8_t fontdat[2048][8];
extern uint8_t fontdatm[2048][16];
extern uint8_t fontdatw[512][32];
@@ -176,18 +189,18 @@ extern uint8_t fontdat8x12[256][16];
extern uint8_t fontdat12x18[256][36];
extern dbcs_font_t *fontdatksc5601;
extern dbcs_font_t *fontdatksc5601_user;
extern uint32_t *video_6to8,
*video_8togs,
*video_8to32,
*video_15to32,
*video_16to32;
extern int enable_overscan;
extern int force_43;
extern int vid_resize;
extern int herc_blend;
extern int vid_cga_contrast;
extern int video_grayscale;
extern int video_graytype;
extern uint32_t *video_6to8;
extern uint32_t *video_8togs;
extern uint32_t *video_8to32;
extern uint32_t *video_15to32;
extern uint32_t *video_16to32;
extern int enable_overscan;
extern int force_43;
extern int vid_resize;
extern int herc_blend;
extern int vid_cga_contrast;
extern int video_grayscale;
extern int video_graytype;
extern double cpuclock;
extern int emu_fps;