Merge pull request #2219 from jriwanek-forks/macros

Macros and hardcoding
This commit is contained in:
Miran Grča
2022-03-13 03:01:08 +01:00
committed by GitHub
35 changed files with 312 additions and 280 deletions

View File

@@ -108,12 +108,12 @@ typedef struct {
char network_host[520]; /* PCap device */
/* Ports category */
char parallel_devices[3][32]; /* LPT device names */
char parallel_devices[PARALLEL_MAX][32]; /* LPT device names */
#ifdef USE_SERIAL_DEVICES
char serial_devices[4][32]; /* Serial device names */
char serial_devices[SERIAL_MAX][32]; /* Serial device names */
#endif
int serial_enabled[4], /* Serial ports 1 and 2 enabled */
parallel_enabled[3]; /* LPT1, LPT2, LPT3 enabled */
int serial_enabled[SERIAL_MAX], /* Serial ports 1, 2, 3, 4 enabled */
parallel_enabled[PARALLEL_MAX]; /* LPT1, LPT2, LPT3, LPT4 enabled */
/* Other peripherals category */
int fdc_type, /* Floppy disk controller type */

View File

@@ -19,6 +19,18 @@
#ifndef EMU_IDE_H
# define EMU_IDE_H
#define HDC_PRIMARY_BASE 0x01F0
#define HDC_PRIMARY_SIDE 0x03F6
#define HDC_PRIMARY_IRQ 14
#define HDC_SECONDARY_BASE 0x0170
#define HDC_SECONDARY_SIDE 0x0376
#define HDC_SECONDARY_IRQ 15
#define HDC_TERTIARY_BASE 0x0168
#define HDC_TERTIARY_SIDE 0x036E
#define HDC_TERTIARY_IRQ 10
#define HDC_QUATERNARY_BASE 0x01E8
#define HDC_QUATERNARY_SIDE 0x03EE
#define HDC_QUATERNARY_IRQ 11
enum
{

View File

@@ -1,6 +1,22 @@
#ifndef EMU_LPT_H
# define EMU_LPT_H
#define LPT1_ADDR 0x0378
#define LPT1_IRQ 7
#define LPT2_ADDR 0x0278
#define LPT2_IRQ 5
// LPT 1 on machines when installed
#define LPT_MDA_ADDR 0x03bc
#define LPT_MDA_IRQ 7
#define LPT4_ADDR 0x0268
#define LPT4_IRQ 5
/*
#define LPT5_ADDR 0x027c
#define LPT5_IRQ 7
#define LPT6_ADDR 0x026c
#define LPT6_IRQ 5
*/
typedef struct
{
const char *name;

View File

@@ -35,14 +35,14 @@
#define SERIAL_FIFO_SIZE 16
/* Default settings for the standard ports. */
#define SERIAL1_ADDR 0x03f8
#define SERIAL1_IRQ 4
#define SERIAL2_ADDR 0x02f8
#define SERIAL2_IRQ 3
#define SERIAL3_ADDR 0x03e8
#define SERIAL3_IRQ 4
#define SERIAL4_ADDR 0x02e8
#define SERIAL4_IRQ 3
#define COM1_ADDR 0x03f8
#define COM1_IRQ 4
#define COM2_ADDR 0x02f8
#define COM2_IRQ 3
#define COM3_ADDR 0x03e8
#define COM3_IRQ 4
#define COM4_ADDR 0x02e8
#define COM4_IRQ 3
struct serial_device_s;