diff --git a/src/apm.c b/src/apm.c index 51dffeab3..59f8e40e2 100644 --- a/src/apm.c +++ b/src/apm.c @@ -21,11 +21,11 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "device.h" -#include "86box_io.h" -#include "apm.h" +#include <86box/device.h> +#include <86box/io.h> +#include <86box/apm.h> #ifdef ENABLE_APM_LOG diff --git a/src/bugger.c b/src/bugger.c index f18f0d1a4..492261fe2 100644 --- a/src/bugger.c +++ b/src/bugger.c @@ -55,12 +55,12 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "86box_io.h" -#include "device.h" -#include "plat.h" -#include "ui.h" -#include "bugger.h" +#include <86box/86box.h> +#include <86box/io.h> +#include <86box/device.h> +#include <86box/plat.h> +#include <86box/ui.h> +#include <86box/bugger.h> /* BugBugger registers. */ diff --git a/src/cdrom/cdrom.c b/src/cdrom/cdrom.c index e9655e44d..a6f57afbf 100644 --- a/src/cdrom/cdrom.c +++ b/src/cdrom/cdrom.c @@ -22,12 +22,12 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "config.h" -#include "cdrom.h" -#include "cdrom_image.h" -#include "plat.h" -#include "sound.h" +#include <86box/86box.h> +#include <86box/config.h> +#include <86box/cdrom.h> +#include <86box/cdrom_image.h> +#include <86box/plat.h> +#include <86box/sound.h> /* The addresses sent from the guest are absolute, ie. a LBA of 0 corresponds to a MSF of 00:00:00. Otherwise, the counter displayed by the guest is wrong: diff --git a/src/cdrom/cdrom_image.c b/src/cdrom/cdrom_image.c index 8990ef257..3bef1a356 100644 --- a/src/cdrom/cdrom_image.c +++ b/src/cdrom/cdrom_image.c @@ -29,13 +29,13 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "config.h" -#include "plat.h" -#include "scsi_device.h" -#include "cdrom_image_backend.h" -#include "cdrom.h" -#include "cdrom_image.h" +#include <86box/86box.h> +#include <86box/config.h> +#include <86box/plat.h> +#include <86box/scsi_device.h> +#include <86box/cdrom_image_backend.h> +#include <86box/cdrom.h> +#include <86box/cdrom_image.h> #ifdef ENABLE_CDROM_IMAGE_LOG diff --git a/src/cdrom/cdrom_image_backend.c b/src/cdrom/cdrom_image_backend.c index 42a8bfe2c..d939762d7 100644 --- a/src/cdrom/cdrom_image_backend.c +++ b/src/cdrom/cdrom_image_backend.c @@ -35,9 +35,9 @@ #endif #include #define HAVE_STDARG_H -#include "86box.h" -#include "plat.h" -#include "cdrom_image_backend.h" +#include <86box/86box.h> +#include <86box/plat.h> +#include <86box/cdrom_image_backend.h> #define CDROM_BCD(x) (((x) % 10) | (((x) / 10) << 4)) diff --git a/src/chipset/acc2168.c b/src/chipset/acc2168.c index 809eafc41..c088018a8 100644 --- a/src/chipset/acc2168.c +++ b/src/chipset/acc2168.c @@ -20,19 +20,19 @@ #include #include #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "timer.h" -#include "device.h" -#include "keyboard.h" -#include "86box_io.h" -#include "mem.h" -#include "mouse.h" -#include "port_92.h" -#include "sio.h" -#include "hdc.h" -#include "video.h" -#include "chipset.h" +#include <86box/timer.h> +#include <86box/device.h> +#include <86box/keyboard.h> +#include <86box/io.h> +#include <86box/mem.h> +#include <86box/mouse.h> +#include <86box/port_92.h> +#include <86box/sio.h> +#include <86box/hdc.h> +#include <86box/video.h> +#include <86box/chipset.h> typedef struct acc2168_t diff --git a/src/chipset/acer_m3a.c b/src/chipset/acer_m3a.c index 409618076..fc7717a11 100644 --- a/src/chipset/acer_m3a.c +++ b/src/chipset/acer_m3a.c @@ -20,14 +20,14 @@ #include #include #include -#include "86box.h" -#include "mem.h" -#include "86box_io.h" -#include "rom.h" -#include "pci.h" -#include "device.h" -#include "keyboard.h" -#include "chipset.h" +#include <86box/86box.h> +#include <86box/mem.h> +#include <86box/io.h> +#include <86box/rom.h> +#include <86box/pci.h> +#include <86box/device.h> +#include <86box/keyboard.h> +#include <86box/chipset.h> typedef struct diff --git a/src/chipset/ali1429.c b/src/chipset/ali1429.c index 82a1e1a24..5e19983c7 100644 --- a/src/chipset/ali1429.c +++ b/src/chipset/ali1429.c @@ -21,20 +21,20 @@ #include #include #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "timer.h" -#include "86box_io.h" -#include "mem.h" -#include "device.h" -#include "keyboard.h" -#include "fdd.h" -#include "fdc.h" -#include "hdc.h" -#include "hdc_ide.h" -#include "timer.h" -#include "port_92.h" -#include "chipset.h" +#include <86box/timer.h> +#include <86box/io.h> +#include <86box/mem.h> +#include <86box/device.h> +#include <86box/keyboard.h> +#include <86box/fdd.h> +#include <86box/fdc.h> +#include <86box/hdc.h> +#include <86box/hdc_ide.h> +#include <86box/timer.h> +#include <86box/port_92.h> +#include <86box/chipset.h> typedef struct diff --git a/src/chipset/cs8230.c b/src/chipset/cs8230.c index 9cd32551b..04f7817e4 100644 --- a/src/chipset/cs8230.c +++ b/src/chipset/cs8230.c @@ -19,15 +19,15 @@ #include #include #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "timer.h" -#include "86box_io.h" -#include "device.h" -#include "mem.h" -#include "fdd.h" -#include "fdc.h" -#include "chipset.h" +#include <86box/timer.h> +#include <86box/io.h> +#include <86box/device.h> +#include <86box/mem.h> +#include <86box/fdd.h> +#include <86box/fdc.h> +#include <86box/chipset.h> static struct diff --git a/src/chipset/headland.c b/src/chipset/headland.c index 75eb066bb..5d20e1fa4 100644 --- a/src/chipset/headland.c +++ b/src/chipset/headland.c @@ -25,19 +25,19 @@ #include #include #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" #include "x86.h" -#include "timer.h" -#include "86box_io.h" -#include "mem.h" -#include "rom.h" -#include "device.h" -#include "keyboard.h" -#include "fdd.h" -#include "fdc.h" -#include "port_92.h" -#include "chipset.h" +#include <86box/timer.h> +#include <86box/io.h> +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/device.h> +#include <86box/keyboard.h> +#include <86box/fdd.h> +#include <86box/fdc.h> +#include <86box/port_92.h> +#include <86box/chipset.h> typedef struct { diff --git a/src/chipset/intel_4x0.c b/src/chipset/intel_4x0.c index 53948b3b6..443090caa 100644 --- a/src/chipset/intel_4x0.c +++ b/src/chipset/intel_4x0.c @@ -20,15 +20,15 @@ #include #include #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "mem.h" -#include "86box_io.h" -#include "rom.h" -#include "pci.h" -#include "device.h" -#include "keyboard.h" -#include "chipset.h" +#include <86box/mem.h> +#include <86box/io.h> +#include <86box/rom.h> +#include <86box/pci.h> +#include <86box/device.h> +#include <86box/keyboard.h> +#include <86box/chipset.h> enum diff --git a/src/chipset/neat.c b/src/chipset/neat.c index 0bbb02990..8e4e710f2 100644 --- a/src/chipset/neat.c +++ b/src/chipset/neat.c @@ -24,16 +24,16 @@ #include #include #include -#include "86box.h" -#include "device.h" -#include "timer.h" -#include "fdd.h" -#include "fdc.h" -#include "keyboard.h" -#include "86box_io.h" -#include "mem.h" -#include "nmi.h" -#include "chipset.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/timer.h> +#include <86box/fdd.h> +#include <86box/fdc.h> +#include <86box/keyboard.h> +#include <86box/io.h> +#include <86box/mem.h> +#include <86box/nmi.h> +#include <86box/chipset.h> #define NEAT_DEBUG 0 diff --git a/src/chipset/opti495.c b/src/chipset/opti495.c index 21fa9f048..47ee25582 100644 --- a/src/chipset/opti495.c +++ b/src/chipset/opti495.c @@ -258,16 +258,16 @@ SeeAlso: #P0178,#P0187 #include #include #define HAVE_STDARG_H -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "timer.h" -#include "86box_io.h" -#include "device.h" -#include "keyboard.h" -#include "mem.h" -#include "fdd.h" -#include "fdc.h" -#include "chipset.h" +#include <86box/timer.h> +#include <86box/io.h> +#include <86box/device.h> +#include <86box/keyboard.h> +#include <86box/mem.h> +#include <86box/fdd.h> +#include <86box/fdc.h> +#include <86box/chipset.h> typedef struct diff --git a/src/chipset/scamp.c b/src/chipset/scamp.c index f22b4c607..35e97714e 100644 --- a/src/chipset/scamp.c +++ b/src/chipset/scamp.c @@ -24,15 +24,15 @@ #include #include #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "timer.h" -#include "device.h" -#include "86box_io.h" -#include "mem.h" -#include "nmi.h" -#include "port_92.h" -#include "chipset.h" +#include <86box/timer.h> +#include <86box/device.h> +#include <86box/io.h> +#include <86box/mem.h> +#include <86box/nmi.h> +#include <86box/port_92.h> +#include <86box/chipset.h> typedef struct { void *parent; diff --git a/src/chipset/scat.c b/src/chipset/scat.c index d5a29ed89..ed2daee08 100644 --- a/src/chipset/scat.c +++ b/src/chipset/scat.c @@ -23,20 +23,20 @@ #include #include #include -#include "86box.h" -#include "device.h" +#include <86box/86box.h> +#include <86box/device.h> #include "cpu.h" #include "x86.h" -#include "timer.h" -#include "fdd.h" -#include "fdc.h" -#include "keyboard.h" -#include "86box_io.h" -#include "mem.h" -#include "nmi.h" -#include "port_92.h" -#include "rom.h" -#include "chipset.h" +#include <86box/timer.h> +#include <86box/fdd.h> +#include <86box/fdc.h> +#include <86box/keyboard.h> +#include <86box/io.h> +#include <86box/mem.h> +#include <86box/nmi.h> +#include <86box/port_92.h> +#include <86box/rom.h> +#include <86box/chipset.h> #define SCAT_DMA_WAIT_STATE_CONTROL 0x01 diff --git a/src/chipset/sis_85c471.c b/src/chipset/sis_85c471.c index 0212a4854..6518cd0f3 100644 --- a/src/chipset/sis_85c471.c +++ b/src/chipset/sis_85c471.c @@ -22,21 +22,21 @@ #include #include #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "mem.h" -#include "86box_io.h" -#include "lpt.h" -#include "rom.h" -#include "pci.h" -#include "device.h" -#include "hdc_ide.h" -#include "keyboard.h" -#include "timer.h" -#include "port_92.h" -#include "serial.h" -#include "machine.h" -#include "chipset.h" +#include <86box/mem.h> +#include <86box/io.h> +#include <86box/lpt.h> +#include <86box/rom.h> +#include <86box/pci.h> +#include <86box/device.h> +#include <86box/hdc_ide.h> +#include <86box/keyboard.h> +#include <86box/timer.h> +#include <86box/port_92.h> +#include <86box/serial.h> +#include <86box/machine.h> +#include <86box/chipset.h> typedef struct { diff --git a/src/chipset/sis_85c496.c b/src/chipset/sis_85c496.c index a43925cbc..7fafa9607 100644 --- a/src/chipset/sis_85c496.c +++ b/src/chipset/sis_85c496.c @@ -21,19 +21,19 @@ #include #include #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "mem.h" -#include "86box_io.h" -#include "rom.h" -#include "pci.h" -#include "device.h" -#include "keyboard.h" -#include "timer.h" -#include "port_92.h" -#include "hdc_ide.h" -#include "machine.h" -#include "chipset.h" +#include <86box/mem.h> +#include <86box/io.h> +#include <86box/rom.h> +#include <86box/pci.h> +#include <86box/device.h> +#include <86box/keyboard.h> +#include <86box/timer.h> +#include <86box/port_92.h> +#include <86box/hdc_ide.h> +#include <86box/machine.h> +#include <86box/chipset.h> typedef struct sis_85c496_t diff --git a/src/chipset/sis_85c50x.c b/src/chipset/sis_85c50x.c index 7b2b13e48..d8ff68704 100644 --- a/src/chipset/sis_85c50x.c +++ b/src/chipset/sis_85c50x.c @@ -20,15 +20,15 @@ #include #include #include -#include "86box.h" -#include "mem.h" -#include "86box_io.h" -#include "rom.h" -#include "pci.h" -#include "device.h" -#include "keyboard.h" -#include "port_92.h" -#include "chipset.h" +#include <86box/86box.h> +#include <86box/mem.h> +#include <86box/io.h> +#include <86box/rom.h> +#include <86box/pci.h> +#include <86box/device.h> +#include <86box/keyboard.h> +#include <86box/port_92.h> +#include <86box/chipset.h> typedef struct sis_85c501_t diff --git a/src/chipset/via_apro.c b/src/chipset/via_apro.c index 573f18df8..a9d861069 100644 --- a/src/chipset/via_apro.c +++ b/src/chipset/via_apro.c @@ -28,14 +28,14 @@ just like the Intel 4x0 series. #include #include #include -#include "86box.h" -#include "mem.h" -#include "86box_io.h" -#include "rom.h" -#include "pci.h" -#include "device.h" -#include "keyboard.h" -#include "chipset.h" +#include <86box/86box.h> +#include <86box/mem.h> +#include <86box/io.h> +#include <86box/rom.h> +#include <86box/pci.h> +#include <86box/device.h> +#include <86box/keyboard.h> +#include <86box/chipset.h> typedef struct via_apro_t { diff --git a/src/chipset/via_mvp3.c b/src/chipset/via_mvp3.c index 084889c33..ab1c5877e 100644 --- a/src/chipset/via_mvp3.c +++ b/src/chipset/via_mvp3.c @@ -21,14 +21,14 @@ #include #include #include -#include "86box.h" -#include "mem.h" -#include "86box_io.h" -#include "rom.h" -#include "pci.h" -#include "device.h" -#include "keyboard.h" -#include "chipset.h" +#include <86box/86box.h> +#include <86box/mem.h> +#include <86box/io.h> +#include <86box/rom.h> +#include <86box/pci.h> +#include <86box/device.h> +#include <86box/keyboard.h> +#include <86box/chipset.h> typedef struct via_mvp3_t diff --git a/src/chipset/wd76c10.c b/src/chipset/wd76c10.c index 6264105f2..98e0d24d5 100644 --- a/src/chipset/wd76c10.c +++ b/src/chipset/wd76c10.c @@ -23,18 +23,18 @@ #include #include #include -#include "86box.h" -#include "device.h" -#include "timer.h" -#include "86box_io.h" -#include "keyboard.h" -#include "mem.h" -#include "port_92.h" -#include "serial.h" -#include "fdd.h" -#include "fdc.h" -#include "video.h" -#include "chipset.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/timer.h> +#include <86box/io.h> +#include <86box/keyboard.h> +#include <86box/mem.h> +#include <86box/port_92.h> +#include <86box/serial.h> +#include <86box/fdd.h> +#include <86box/fdc.h> +#include <86box/video.h> +#include <86box/chipset.h> typedef struct { diff --git a/src/config.c b/src/config.c index 450727344..fd820610e 100644 --- a/src/config.c +++ b/src/config.c @@ -33,35 +33,35 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "device.h" -#include "timer.h" -#include "nvr.h" -#include "config.h" -#include "isamem.h" -#include "isartc.h" -#include "lpt.h" -#include "hdd.h" -#include "hdc.h" -#include "hdc_ide.h" -#include "fdd.h" -#include "fdc.h" -#include "gameport.h" -#include "machine.h" -#include "mouse.h" -#include "network.h" -#include "scsi.h" -#include "scsi_device.h" -#include "cdrom.h" -#include "zip.h" -#include "sound.h" -#include "midi.h" -#include "snd_mpu401.h" -#include "video.h" -#include "plat.h" -#include "plat_midi.h" -#include "ui.h" +#include <86box/device.h> +#include <86box/timer.h> +#include <86box/nvr.h> +#include <86box/config.h> +#include <86box/isamem.h> +#include <86box/isartc.h> +#include <86box/lpt.h> +#include <86box/hdd.h> +#include <86box/hdc.h> +#include <86box/hdc_ide.h> +#include <86box/fdd.h> +#include <86box/fdc.h> +#include <86box/gameport.h> +#include <86box/machine.h> +#include <86box/mouse.h> +#include <86box/network.h> +#include <86box/scsi.h> +#include <86box/scsi_device.h> +#include <86box/cdrom.h> +#include <86box/zip.h> +#include <86box/sound.h> +#include <86box/midi.h> +#include <86box/snd_mpu401.h> +#include <86box/video.h> +#include <86box/plat.h> +#include <86box/plat_midi.h> +#include <86box/ui.h> typedef struct _list_ { diff --git a/src/cpu/codegen.c b/src/cpu/codegen.c index 44b1c502d..3949b8e98 100644 --- a/src/cpu/codegen.c +++ b/src/cpu/codegen.c @@ -3,8 +3,8 @@ #include #include -#include "86box.h" -#include "mem.h" +#include <86box/86box.h> +#include <86box/mem.h> #include "cpu.h" #include "x86_ops.h" #include "codegen.h" diff --git a/src/cpu/codegen.h b/src/cpu/codegen.h index 559149316..c092c445c 100644 --- a/src/cpu/codegen.h +++ b/src/cpu/codegen.h @@ -37,7 +37,7 @@ #ifndef _CODEGEN_H_ #define _CODEGEN_H_ -#include "../mem.h" +#include <86box/mem.h> #include "../cpu_common/x86_ops.h" #ifdef __amd64__ diff --git a/src/cpu/codegen_ops.c b/src/cpu/codegen_ops.c index 229fa1882..d1410346f 100644 --- a/src/cpu/codegen_ops.c +++ b/src/cpu/codegen_ops.c @@ -3,8 +3,8 @@ #include #include -#include "86box.h" -#include "mem.h" +#include <86box/86box.h> +#include <86box/mem.h> #include "cpu.h" #include "x86.h" #include "x86_ops.h" diff --git a/src/cpu/codegen_timing_486.c b/src/cpu/codegen_timing_486.c index 912bfc16b..0b0ab9c15 100644 --- a/src/cpu/codegen_timing_486.c +++ b/src/cpu/codegen_timing_486.c @@ -2,8 +2,8 @@ #include #include #include -#include "86box.h" -#include "mem.h" +#include <86box/86box.h> +#include <86box/mem.h> #include "cpu.h" #include "x86.h" #include "x86_ops.h" diff --git a/src/cpu/codegen_timing_686.c b/src/cpu/codegen_timing_686.c index dc901dddc..3563d38d9 100644 --- a/src/cpu/codegen_timing_686.c +++ b/src/cpu/codegen_timing_686.c @@ -12,8 +12,8 @@ #include #include #include -#include "86box.h" -#include "mem.h" +#include <86box/86box.h> +#include <86box/mem.h> #include "cpu.h" #include "x86.h" #include "x86_ops.h" diff --git a/src/cpu/codegen_timing_common.c b/src/cpu/codegen_timing_common.c index c9ac19766..a0e0c8787 100644 --- a/src/cpu/codegen_timing_common.c +++ b/src/cpu/codegen_timing_common.c @@ -2,7 +2,7 @@ #include #include #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" #include "codegen_timing_common.h" diff --git a/src/cpu/codegen_timing_pentium.c b/src/cpu/codegen_timing_pentium.c index 3a625ed6d..01dca954f 100644 --- a/src/cpu/codegen_timing_pentium.c +++ b/src/cpu/codegen_timing_pentium.c @@ -13,8 +13,8 @@ #include #include #include -#include "86box.h" -#include "mem.h" +#include <86box/86box.h> +#include <86box/mem.h> #include "cpu.h" #include "x86.h" #include "x86_ops.h" diff --git a/src/cpu/codegen_timing_winchip.c b/src/cpu/codegen_timing_winchip.c index 7074307ef..c05f7c28f 100644 --- a/src/cpu/codegen_timing_winchip.c +++ b/src/cpu/codegen_timing_winchip.c @@ -2,12 +2,12 @@ #include #include #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" #include "x86.h" #include "x86_ops.h" #include "x87.h" -#include "../mem.h" +#include <86box/mem.h> #include "codegen.h" #include "codegen_ops.h" #include "codegen_timing_common.h" diff --git a/src/cpu/codegen_x86-64.c b/src/cpu/codegen_x86-64.c index c0ece0ce0..7c1a9c394 100644 --- a/src/cpu/codegen_x86-64.c +++ b/src/cpu/codegen_x86-64.c @@ -5,13 +5,13 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" #include "x86.h" #include "x86_flags.h" #include "x86_ops.h" #include "x87.h" -#include "mem.h" +#include <86box/mem.h> #include "386_common.h" diff --git a/src/cpu/codegen_x86.c b/src/cpu/codegen_x86.c index 9e240b690..590e530af 100644 --- a/src/cpu/codegen_x86.c +++ b/src/cpu/codegen_x86.c @@ -43,9 +43,9 @@ #include #include #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "mem.h" +#include <86box/mem.h> #include "x86.h" #include "x86_flags.h" #include "../cpu_common/x86_ops.h" diff --git a/src/cpu/x86seg.c b/src/cpu/x86seg.c index 53df3770c..286f20817 100644 --- a/src/cpu/x86seg.c +++ b/src/cpu/x86seg.c @@ -24,13 +24,13 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "device.h" -#include "timer.h" -#include "machine.h" -#include "mem.h" -#include "nvr.h" +#include <86box/device.h> +#include <86box/timer.h> +#include <86box/machine.h> +#include <86box/mem.h> +#include <86box/nvr.h> #include "x86.h" #include "x86_flags.h" #include "386_common.h" diff --git a/src/cpu_common/386.c b/src/cpu_common/386.c index d0f05a7b7..7768b5831 100644 --- a/src/cpu_common/386.c +++ b/src/cpu_common/386.c @@ -10,17 +10,17 @@ #endif #define HAVE_STDARG_H -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "timer.h" +#include <86box/timer.h> #include "x86.h" #include "x87.h" -#include "nmi.h" -#include "mem.h" -#include "pic.h" -#include "pit.h" -#include "fdd.h" -#include "fdc.h" +#include <86box/nmi.h> +#include <86box/mem.h> +#include <86box/pic.h> +#include <86box/pit.h> +#include <86box/fdd.h> +#include <86box/fdc.h> #include "386_common.h" #ifdef USE_NEW_DYNAREC #include "codegen.h" diff --git a/src/cpu_common/386_common.c b/src/cpu_common/386_common.c index cb140c41a..cacaf8811 100644 --- a/src/cpu_common/386_common.c +++ b/src/cpu_common/386_common.c @@ -9,17 +9,17 @@ # define INFINITY (__builtin_inff()) #endif #define HAVE_STDARG_H -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "timer.h" +#include <86box/timer.h> #include "x86.h" #include "x87.h" -#include "nmi.h" -#include "mem.h" -#include "pic.h" -#include "pit.h" -#include "fdd.h" -#include "fdc.h" +#include <86box/nmi.h> +#include <86box/mem.h> +#include <86box/pic.h> +#include <86box/pit.h> +#include <86box/fdd.h> +#include <86box/fdc.h> #include "386_common.h" #include "x86_flags.h" #include "codegen.h" diff --git a/src/cpu_common/386_dynarec - Cópia (2).c b/src/cpu_common/386_dynarec - Cópia (2).c index 421381dd3..7a248b627 100644 --- a/src/cpu_common/386_dynarec - Cópia (2).c +++ b/src/cpu_common/386_dynarec - Cópia (2).c @@ -10,18 +10,18 @@ #endif #define HAVE_STDARG_H -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" #include "x86.h" #include "x86_ops.h" #include "x87.h" -#include "86box_io.h" -#include "mem.h" -#include "nmi.h" -#include "pic.h" -#include "timer.h" -#include "fdd.h" -#include "fdc.h" +#include <86box/io.h> +#include <86box/mem.h> +#include <86box/nmi.h> +#include <86box/pic.h> +#include <86box/timer.h> +#include <86box/fdd.h> +#include <86box/fdc.h> #ifdef USE_DYNAREC #include "codegen.h" #ifdef USE_NEW_DYNAREC diff --git a/src/cpu_common/386_dynarec - Cópia.c b/src/cpu_common/386_dynarec - Cópia.c index 75219e86a..337b49073 100644 --- a/src/cpu_common/386_dynarec - Cópia.c +++ b/src/cpu_common/386_dynarec - Cópia.c @@ -10,18 +10,18 @@ #endif #define HAVE_STDARG_H -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" #include "x86.h" #include "x86_ops.h" #include "x87.h" -#include "86box_io.h" -#include "mem.h" -#include "nmi.h" -#include "pic.h" -#include "timer.h" -#include "fdd.h" -#include "fdc.h" +#include <86box/io.h> +#include <86box/mem.h> +#include <86box/nmi.h> +#include <86box/pic.h> +#include <86box/timer.h> +#include <86box/fdd.h> +#include <86box/fdc.h> #ifdef USE_DYNAREC #include "codegen.h" #ifdef USE_NEW_DYNAREC diff --git a/src/cpu_common/386_dynarec.c b/src/cpu_common/386_dynarec.c index 425ffc4b2..9352b27ca 100644 --- a/src/cpu_common/386_dynarec.c +++ b/src/cpu_common/386_dynarec.c @@ -10,18 +10,18 @@ #endif #define HAVE_STDARG_H -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" #include "x86.h" #include "x86_ops.h" #include "x87.h" -#include "86box_io.h" -#include "mem.h" -#include "nmi.h" -#include "pic.h" -#include "timer.h" -#include "fdd.h" -#include "fdc.h" +#include <86box/io.h> +#include <86box/mem.h> +#include <86box/nmi.h> +#include <86box/pic.h> +#include <86box/timer.h> +#include <86box/fdd.h> +#include <86box/fdc.h> #ifdef USE_DYNAREC #include "codegen.h" #ifdef USE_NEW_DYNAREC diff --git a/src/cpu_common/386_dynarec.c.temp b/src/cpu_common/386_dynarec.c.temp index 78130f3c0..effcc7246 100644 --- a/src/cpu_common/386_dynarec.c.temp +++ b/src/cpu_common/386_dynarec.c.temp @@ -10,18 +10,18 @@ #endif #define HAVE_STDARG_H -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" #include "x86.h" #include "x86_ops.h" #include "x87.h" -#include "86box_io.h" -#include "mem.h" -#include "nmi.h" -#include "pic.h" -#include "timer.h" -#include "fdd.h" -#include "fdc.h" +#include <86box/io.h> +#include <86box/mem.h> +#include <86box/nmi.h> +#include <86box/pic.h> +#include <86box/timer.h> +#include <86box/fdd.h> +#include <86box/fdc.h> #ifdef USE_DYNAREC #include "codegen.h" #ifdef USE_NEW_DYNAREC diff --git a/src/cpu_common/386_dynarec_ops.c b/src/cpu_common/386_dynarec_ops.c index 42edfbef5..9965efdff 100644 --- a/src/cpu_common/386_dynarec_ops.c +++ b/src/cpu_common/386_dynarec_ops.c @@ -8,17 +8,17 @@ # define INFINITY (__builtin_inff()) #endif -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "timer.h" +#include <86box/timer.h> #include "x86.h" #include "x86_ops.h" #include "x87.h" #include "x86_flags.h" -#include "86box_io.h" -#include "mem.h" -#include "nmi.h" -#include "pic.h" +#include <86box/io.h> +#include <86box/mem.h> +#include <86box/nmi.h> +#include <86box/pic.h> #include "codegen.h" #define CPU_BLOCK_END() cpu_block_end = 1 diff --git a/src/cpu_common/808x.c b/src/cpu_common/808x.c index ff5f1eb7c..0c1bf21ab 100644 --- a/src/cpu_common/808x.c +++ b/src/cpu_common/808x.c @@ -25,16 +25,16 @@ #include #define HAVE_STDARG_H -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" #include "x86.h" -#include "machine.h" -#include "86box_io.h" -#include "mem.h" -#include "rom.h" -#include "nmi.h" -#include "pic.h" -#include "timer.h" +#include <86box/machine.h> +#include <86box/io.h> +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/nmi.h> +#include <86box/pic.h> +#include <86box/timer.h> /* The opcode of the instruction currently being executed. */ uint8_t opcode; diff --git a/src/cpu_common/cpu.c b/src/cpu_common/cpu.c index 3727fa857..c831f6a4f 100644 --- a/src/cpu_common/cpu.c +++ b/src/cpu_common/cpu.c @@ -43,16 +43,16 @@ #include #include #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "device.h" -#include "machine.h" -#include "86box_io.h" +#include <86box/device.h> +#include <86box/machine.h> +#include <86box/io.h> #include "x86_ops.h" -#include "mem.h" -#include "nmi.h" -#include "pic.h" -#include "pci.h" +#include <86box/mem.h> +#include <86box/nmi.h> +#include <86box/pic.h> +#include <86box/pci.h> #ifdef USE_DYNAREC # include "codegen.h" #endif diff --git a/src/cpu_common/cpu_table - Cópia.c b/src/cpu_common/cpu_table - Cópia.c index 16121561a..e3f8f3f5c 100644 --- a/src/cpu_common/cpu_table - Cópia.c +++ b/src/cpu_common/cpu_table - Cópia.c @@ -45,9 +45,9 @@ #include #include #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "machine.h" +#include <86box/machine.h> CPU cpus_8088[] = { diff --git a/src/cpu_common/cpu_table.c b/src/cpu_common/cpu_table.c index 46289be47..2a63b44b5 100644 --- a/src/cpu_common/cpu_table.c +++ b/src/cpu_common/cpu_table.c @@ -45,9 +45,9 @@ #include #include #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "machine.h" +#include <86box/machine.h> CPU cpus_8088[] = { diff --git a/src/cpu_common/x87.c b/src/cpu_common/x87.c index 8a5363cd8..23bc3f74c 100644 --- a/src/cpu_common/x87.c +++ b/src/cpu_common/x87.c @@ -6,10 +6,10 @@ #define fplog 0 #include #define HAVE_STDARG_H -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "mem.h" -#include "pic.h" +#include <86box/mem.h> +#include <86box/pic.h> #include "x86.h" #include "x86_flags.h" #include "x86_ops.h" diff --git a/src/cpu_new/codegen.c b/src/cpu_new/codegen.c index 9758788b1..96c64e2c5 100644 --- a/src/cpu_new/codegen.c +++ b/src/cpu_new/codegen.c @@ -1,7 +1,7 @@ #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "mem.h" +#include <86box/mem.h> #include "x86_ops.h" #include "codegen.h" diff --git a/src/cpu_new/codegen.h b/src/cpu_new/codegen.h index 039a34c0f..c07ca89c3 100644 --- a/src/cpu_new/codegen.h +++ b/src/cpu_new/codegen.h @@ -1,7 +1,7 @@ #ifndef _CODEGEN_H_ #define _CODEGEN_H_ -#include "mem.h" +#include <86box/mem.h> #include "../cpu_common/x86_ops.h" /*Handling self-modifying code (of which there is a lot on x86) : diff --git a/src/cpu_new/codegen_accumulate.c b/src/cpu_new/codegen_accumulate.c index 726f5258f..2a5d0956b 100644 --- a/src/cpu_new/codegen_accumulate.c +++ b/src/cpu_new/codegen_accumulate.c @@ -1,7 +1,7 @@ #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "mem.h" +#include <86box/mem.h> #include "codegen.h" #include "codegen_accumulate.h" diff --git a/src/cpu_new/codegen_allocator.c b/src/cpu_new/codegen_allocator.c index 9f5d87852..e51cdd596 100644 --- a/src/cpu_new/codegen_allocator.c +++ b/src/cpu_new/codegen_allocator.c @@ -9,9 +9,9 @@ #include #include #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "mem.h" +#include <86box/mem.h> #include "codegen.h" #include "codegen_allocator.h" diff --git a/src/cpu_new/codegen_backend_arm.c b/src/cpu_new/codegen_backend_arm.c index 8ad2d0011..c422e5989 100644 --- a/src/cpu_new/codegen_backend_arm.c +++ b/src/cpu_new/codegen_backend_arm.c @@ -2,9 +2,9 @@ #include #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "mem.h" +#include <86box/mem.h> #include "codegen.h" #include "codegen_allocator.h" diff --git a/src/cpu_new/codegen_backend_arm64.c b/src/cpu_new/codegen_backend_arm64.c index 1cfd27d9e..5f2550e23 100644 --- a/src/cpu_new/codegen_backend_arm64.c +++ b/src/cpu_new/codegen_backend_arm64.c @@ -2,9 +2,9 @@ #include #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "mem.h" +#include <86box/mem.h> #include "codegen.h" #include "codegen_allocator.h" diff --git a/src/cpu_new/codegen_backend_arm64_ops.c b/src/cpu_new/codegen_backend_arm64_ops.c index f55b0d569..3f64b8d4e 100644 --- a/src/cpu_new/codegen_backend_arm64_ops.c +++ b/src/cpu_new/codegen_backend_arm64_ops.c @@ -1,9 +1,9 @@ #ifdef __aarch64__ #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "mem.h" +#include <86box/mem.h> #include "codegen.h" #include "codegen_allocator.h" diff --git a/src/cpu_new/codegen_backend_arm64_uops.c b/src/cpu_new/codegen_backend_arm64_uops.c index b7cf12023..5710b8902 100644 --- a/src/cpu_new/codegen_backend_arm64_uops.c +++ b/src/cpu_new/codegen_backend_arm64_uops.c @@ -1,9 +1,9 @@ #ifdef __aarch64__ #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "mem.h" +#include <86box/mem.h> #include "x86.h" #include "x87.h" diff --git a/src/cpu_new/codegen_backend_arm_ops.c b/src/cpu_new/codegen_backend_arm_ops.c index 4bb86c2e7..90c095bac 100644 --- a/src/cpu_new/codegen_backend_arm_ops.c +++ b/src/cpu_new/codegen_backend_arm_ops.c @@ -1,9 +1,9 @@ #ifdef __ARM_EABI__ #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "mem.h" +#include <86box/mem.h> #include "codegen.h" #include "codegen_allocator.h" diff --git a/src/cpu_new/codegen_backend_arm_uops.c b/src/cpu_new/codegen_backend_arm_uops.c index 0ef7ed7eb..3f16554c5 100644 --- a/src/cpu_new/codegen_backend_arm_uops.c +++ b/src/cpu_new/codegen_backend_arm_uops.c @@ -2,9 +2,9 @@ #include #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "mem.h" +#include <86box/mem.h> #include "x86.h" #include "x87.h" diff --git a/src/cpu_new/codegen_backend_x86-64.c b/src/cpu_new/codegen_backend_x86-64.c index d93fce248..10abe3c72 100644 --- a/src/cpu_new/codegen_backend_x86-64.c +++ b/src/cpu_new/codegen_backend_x86-64.c @@ -1,9 +1,9 @@ #ifdef __amd64__ #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "mem.h" +#include <86box/mem.h> #include "codegen.h" #include "codegen_allocator.h" diff --git a/src/cpu_new/codegen_backend_x86-64_ops.c b/src/cpu_new/codegen_backend_x86-64_ops.c index dc1718892..1ffec61b9 100644 --- a/src/cpu_new/codegen_backend_x86-64_ops.c +++ b/src/cpu_new/codegen_backend_x86-64_ops.c @@ -1,9 +1,9 @@ #ifdef __amd64__ #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "mem.h" +#include <86box/mem.h> #include "codegen.h" #include "codegen_allocator.h" diff --git a/src/cpu_new/codegen_backend_x86-64_ops_sse.c b/src/cpu_new/codegen_backend_x86-64_ops_sse.c index 3a74910f2..00ffb2db3 100644 --- a/src/cpu_new/codegen_backend_x86-64_ops_sse.c +++ b/src/cpu_new/codegen_backend_x86-64_ops_sse.c @@ -1,9 +1,9 @@ #ifdef __amd64__ #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "mem.h" +#include <86box/mem.h> #include "codegen.h" #include "codegen_allocator.h" diff --git a/src/cpu_new/codegen_backend_x86-64_uops.c b/src/cpu_new/codegen_backend_x86-64_uops.c index f497aa569..c87ce26e1 100644 --- a/src/cpu_new/codegen_backend_x86-64_uops.c +++ b/src/cpu_new/codegen_backend_x86-64_uops.c @@ -1,9 +1,9 @@ #ifdef __amd64__ #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "mem.h" +#include <86box/mem.h> #include "x86.h" #include "x87.h" diff --git a/src/cpu_new/codegen_backend_x86.c b/src/cpu_new/codegen_backend_x86.c index d364b7634..5ac56923b 100644 --- a/src/cpu_new/codegen_backend_x86.c +++ b/src/cpu_new/codegen_backend_x86.c @@ -3,9 +3,9 @@ #include #include #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "mem.h" +#include <86box/mem.h> #include "codegen.h" #include "codegen_allocator.h" diff --git a/src/cpu_new/codegen_backend_x86_ops.c b/src/cpu_new/codegen_backend_x86_ops.c index 766ce0fc6..0c2b3870f 100644 --- a/src/cpu_new/codegen_backend_x86_ops.c +++ b/src/cpu_new/codegen_backend_x86_ops.c @@ -1,9 +1,9 @@ #if defined i386 || defined __i386 || defined __i386__ || defined _X86_ || defined WIN32 || defined _WIN32 || defined _WIN32 #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "mem.h" +#include <86box/mem.h> #include "codegen.h" #include "codegen_allocator.h" diff --git a/src/cpu_new/codegen_backend_x86_ops_fpu.c b/src/cpu_new/codegen_backend_x86_ops_fpu.c index 03734ca90..07bcb3e74 100644 --- a/src/cpu_new/codegen_backend_x86_ops_fpu.c +++ b/src/cpu_new/codegen_backend_x86_ops_fpu.c @@ -1,9 +1,9 @@ #if defined i386 || defined __i386 || defined __i386__ || defined _X86_ || defined WIN32 || defined _WIN32 || defined _WIN32 #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "mem.h" +#include <86box/mem.h> #include "codegen.h" #include "codegen_allocator.h" diff --git a/src/cpu_new/codegen_backend_x86_ops_sse.c b/src/cpu_new/codegen_backend_x86_ops_sse.c index 83a54f64a..ab292283e 100644 --- a/src/cpu_new/codegen_backend_x86_ops_sse.c +++ b/src/cpu_new/codegen_backend_x86_ops_sse.c @@ -1,9 +1,9 @@ #if defined i386 || defined __i386 || defined __i386__ || defined _X86_ || defined WIN32 || defined _WIN32 || defined _WIN32 #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "mem.h" +#include <86box/mem.h> #include "codegen.h" #include "codegen_allocator.h" diff --git a/src/cpu_new/codegen_backend_x86_uops.c b/src/cpu_new/codegen_backend_x86_uops.c index af801382c..04fdb7cdf 100644 --- a/src/cpu_new/codegen_backend_x86_uops.c +++ b/src/cpu_new/codegen_backend_x86_uops.c @@ -1,9 +1,9 @@ #if defined i386 || defined __i386 || defined __i386__ || defined _X86_ || defined WIN32 || defined _WIN32 || defined _WIN32 #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "mem.h" +#include <86box/mem.h> #include "x86.h" #include "x86_ops.h" diff --git a/src/cpu_new/codegen_block.c b/src/cpu_new/codegen_block.c index eec6d467c..a6584c03a 100644 --- a/src/cpu_new/codegen_block.c +++ b/src/cpu_new/codegen_block.c @@ -1,9 +1,9 @@ #include #include #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "mem.h" +#include <86box/mem.h> #include "x86.h" #include "x86_flags.h" diff --git a/src/cpu_new/codegen_ir.c b/src/cpu_new/codegen_ir.c index 6aa2e6546..aa27f206e 100644 --- a/src/cpu_new/codegen_ir.c +++ b/src/cpu_new/codegen_ir.c @@ -1,7 +1,7 @@ #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "mem.h" +#include <86box/mem.h> #include "codegen.h" #include "codegen_allocator.h" diff --git a/src/cpu_new/codegen_ops.c b/src/cpu_new/codegen_ops.c index 2870c2b72..a1570fc31 100644 --- a/src/cpu_new/codegen_ops.c +++ b/src/cpu_new/codegen_ops.c @@ -1,7 +1,7 @@ #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "mem.h" +#include <86box/mem.h> #include "codegen.h" #include "codegen_ir.h" diff --git a/src/cpu_new/codegen_ops_3dnow.c b/src/cpu_new/codegen_ops_3dnow.c index c2c0e85a6..2c4ecc353 100644 --- a/src/cpu_new/codegen_ops_3dnow.c +++ b/src/cpu_new/codegen_ops_3dnow.c @@ -1,7 +1,7 @@ #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "mem.h" +#include <86box/mem.h> #include "x86.h" #include "x86_flags.h" diff --git a/src/cpu_new/codegen_ops_arith.c b/src/cpu_new/codegen_ops_arith.c index f2c85eeba..576cf7719 100644 --- a/src/cpu_new/codegen_ops_arith.c +++ b/src/cpu_new/codegen_ops_arith.c @@ -1,7 +1,7 @@ #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "mem.h" +#include <86box/mem.h> #include "x86.h" #include "x86_flags.h" diff --git a/src/cpu_new/codegen_ops_branch.c b/src/cpu_new/codegen_ops_branch.c index 853b0308a..88c30f2af 100644 --- a/src/cpu_new/codegen_ops_branch.c +++ b/src/cpu_new/codegen_ops_branch.c @@ -1,7 +1,7 @@ #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "mem.h" +#include <86box/mem.h> #include "x86.h" #include "386_common.h" diff --git a/src/cpu_new/codegen_ops_fpu_arith.c b/src/cpu_new/codegen_ops_fpu_arith.c index 99384b3d4..3500397e3 100644 --- a/src/cpu_new/codegen_ops_fpu_arith.c +++ b/src/cpu_new/codegen_ops_fpu_arith.c @@ -1,7 +1,7 @@ #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "mem.h" +#include <86box/mem.h> #include "x86.h" #include "x86_flags.h" diff --git a/src/cpu_new/codegen_ops_fpu_constant.c b/src/cpu_new/codegen_ops_fpu_constant.c index cb048547c..a9888f9b3 100644 --- a/src/cpu_new/codegen_ops_fpu_constant.c +++ b/src/cpu_new/codegen_ops_fpu_constant.c @@ -1,7 +1,7 @@ #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "mem.h" +#include <86box/mem.h> #include "x86.h" #include "x86_flags.h" diff --git a/src/cpu_new/codegen_ops_fpu_loadstore.c b/src/cpu_new/codegen_ops_fpu_loadstore.c index 879760518..349d10de7 100644 --- a/src/cpu_new/codegen_ops_fpu_loadstore.c +++ b/src/cpu_new/codegen_ops_fpu_loadstore.c @@ -1,7 +1,7 @@ #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "mem.h" +#include <86box/mem.h> #include "x86.h" #include "x86_flags.h" diff --git a/src/cpu_new/codegen_ops_fpu_misc.c b/src/cpu_new/codegen_ops_fpu_misc.c index cb54ce791..2aea3678b 100644 --- a/src/cpu_new/codegen_ops_fpu_misc.c +++ b/src/cpu_new/codegen_ops_fpu_misc.c @@ -1,7 +1,7 @@ #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "mem.h" +#include <86box/mem.h> #include "x86.h" #include "x86_flags.h" diff --git a/src/cpu_new/codegen_ops_helpers.c b/src/cpu_new/codegen_ops_helpers.c index feae979bb..41450151d 100644 --- a/src/cpu_new/codegen_ops_helpers.c +++ b/src/cpu_new/codegen_ops_helpers.c @@ -1,7 +1,7 @@ #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "mem.h" +#include <86box/mem.h> #include "x86.h" #include "386_common.h" diff --git a/src/cpu_new/codegen_ops_jump.c b/src/cpu_new/codegen_ops_jump.c index 2e304abc3..f56018d76 100644 --- a/src/cpu_new/codegen_ops_jump.c +++ b/src/cpu_new/codegen_ops_jump.c @@ -1,7 +1,7 @@ #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "mem.h" +#include <86box/mem.h> #include "x86.h" #include "386_common.h" diff --git a/src/cpu_new/codegen_ops_logic.c b/src/cpu_new/codegen_ops_logic.c index 372fb2e60..5d50423c1 100644 --- a/src/cpu_new/codegen_ops_logic.c +++ b/src/cpu_new/codegen_ops_logic.c @@ -1,7 +1,7 @@ #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "mem.h" +#include <86box/mem.h> #include "x86.h" #include "x86_flags.h" diff --git a/src/cpu_new/codegen_ops_misc.c b/src/cpu_new/codegen_ops_misc.c index eb73a4f81..c4aae7598 100644 --- a/src/cpu_new/codegen_ops_misc.c +++ b/src/cpu_new/codegen_ops_misc.c @@ -1,7 +1,7 @@ #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "mem.h" +#include <86box/mem.h> #include "x86.h" #include "x86_flags.h" diff --git a/src/cpu_new/codegen_ops_mmx_arith.c b/src/cpu_new/codegen_ops_mmx_arith.c index 91c6a61d0..66124ca5e 100644 --- a/src/cpu_new/codegen_ops_mmx_arith.c +++ b/src/cpu_new/codegen_ops_mmx_arith.c @@ -1,7 +1,7 @@ #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "mem.h" +#include <86box/mem.h> #include "x86.h" #include "x86_flags.h" diff --git a/src/cpu_new/codegen_ops_mmx_cmp.c b/src/cpu_new/codegen_ops_mmx_cmp.c index 187f15fc4..29a28e14f 100644 --- a/src/cpu_new/codegen_ops_mmx_cmp.c +++ b/src/cpu_new/codegen_ops_mmx_cmp.c @@ -1,7 +1,7 @@ #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "mem.h" +#include <86box/mem.h> #include "x86.h" #include "x86_flags.h" diff --git a/src/cpu_new/codegen_ops_mmx_loadstore.c b/src/cpu_new/codegen_ops_mmx_loadstore.c index a4413478e..94c46f86a 100644 --- a/src/cpu_new/codegen_ops_mmx_loadstore.c +++ b/src/cpu_new/codegen_ops_mmx_loadstore.c @@ -1,7 +1,7 @@ #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "mem.h" +#include <86box/mem.h> #include "x86.h" #include "x86_flags.h" diff --git a/src/cpu_new/codegen_ops_mmx_logic.c b/src/cpu_new/codegen_ops_mmx_logic.c index 3bd78ec70..24dc2b4c7 100644 --- a/src/cpu_new/codegen_ops_mmx_logic.c +++ b/src/cpu_new/codegen_ops_mmx_logic.c @@ -1,7 +1,7 @@ #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "mem.h" +#include <86box/mem.h> #include "x86.h" #include "x86_flags.h" diff --git a/src/cpu_new/codegen_ops_mmx_pack.c b/src/cpu_new/codegen_ops_mmx_pack.c index 9f1ae7aed..87b562d17 100644 --- a/src/cpu_new/codegen_ops_mmx_pack.c +++ b/src/cpu_new/codegen_ops_mmx_pack.c @@ -1,7 +1,7 @@ #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "mem.h" +#include <86box/mem.h> #include "x86.h" #include "x86_flags.h" diff --git a/src/cpu_new/codegen_ops_mmx_shift.c b/src/cpu_new/codegen_ops_mmx_shift.c index 4f99050d5..bb5277ef3 100644 --- a/src/cpu_new/codegen_ops_mmx_shift.c +++ b/src/cpu_new/codegen_ops_mmx_shift.c @@ -1,7 +1,7 @@ #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "mem.h" +#include <86box/mem.h> #include "x86.h" #include "x86_flags.h" diff --git a/src/cpu_new/codegen_ops_mov.c b/src/cpu_new/codegen_ops_mov.c index d6bfc85b6..a5618f354 100644 --- a/src/cpu_new/codegen_ops_mov.c +++ b/src/cpu_new/codegen_ops_mov.c @@ -1,7 +1,7 @@ #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "mem.h" +#include <86box/mem.h> #include "x86.h" #include "386_common.h" diff --git a/src/cpu_new/codegen_ops_shift.c b/src/cpu_new/codegen_ops_shift.c index c3d5db504..de9a0fecf 100644 --- a/src/cpu_new/codegen_ops_shift.c +++ b/src/cpu_new/codegen_ops_shift.c @@ -1,7 +1,7 @@ #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "mem.h" +#include <86box/mem.h> #include "x86.h" #include "x86_flags.h" diff --git a/src/cpu_new/codegen_ops_stack.c b/src/cpu_new/codegen_ops_stack.c index eb1f4d18e..1bb791a3b 100644 --- a/src/cpu_new/codegen_ops_stack.c +++ b/src/cpu_new/codegen_ops_stack.c @@ -1,7 +1,7 @@ #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "mem.h" +#include <86box/mem.h> #include "x86.h" #include "x86_flags.h" diff --git a/src/cpu_new/codegen_reg.c b/src/cpu_new/codegen_reg.c index b5af4a050..f986104f1 100644 --- a/src/cpu_new/codegen_reg.c +++ b/src/cpu_new/codegen_reg.c @@ -1,7 +1,7 @@ #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "mem.h" +#include <86box/mem.h> #include "codegen.h" #include "codegen_backend.h" diff --git a/src/cpu_new/codegen_timing_486.c b/src/cpu_new/codegen_timing_486.c index 970514f29..14bbf34c6 100644 --- a/src/cpu_new/codegen_timing_486.c +++ b/src/cpu_new/codegen_timing_486.c @@ -1,7 +1,7 @@ #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "mem.h" +#include <86box/mem.h> #include "x86.h" #include "x86_ops.h" diff --git a/src/cpu_new/codegen_timing_686.c b/src/cpu_new/codegen_timing_686.c index 58afb7262..6e221de27 100644 --- a/src/cpu_new/codegen_timing_686.c +++ b/src/cpu_new/codegen_timing_686.c @@ -10,9 +10,9 @@ */ #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "mem.h" +#include <86box/mem.h> #include "x86.h" #include "x86_ops.h" diff --git a/src/cpu_new/codegen_timing_common.c b/src/cpu_new/codegen_timing_common.c index 5eaa7f532..926690814 100644 --- a/src/cpu_new/codegen_timing_common.c +++ b/src/cpu_new/codegen_timing_common.c @@ -1,7 +1,7 @@ #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "mem.h" +#include <86box/mem.h> #include "codegen_timing_common.h" diff --git a/src/cpu_new/codegen_timing_k6.c b/src/cpu_new/codegen_timing_k6.c index 5aa05cb87..dc37bfefe 100644 --- a/src/cpu_new/codegen_timing_k6.c +++ b/src/cpu_new/codegen_timing_k6.c @@ -1,10 +1,10 @@ /*Most of the vector instructions here are a total guess. Some of the timings are based on http://users.atw.hu/instlatx64/AuthenticAMD0000562_K6_InstLatX86.txt*/ #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "mem.h" -#include "machine.h" +#include <86box/mem.h> +#include <86box/machine.h> #include "x86.h" #include "x86_ops.h" diff --git a/src/cpu_new/codegen_timing_pentium.c b/src/cpu_new/codegen_timing_pentium.c index f923646a6..3daa7cb65 100644 --- a/src/cpu_new/codegen_timing_pentium.c +++ b/src/cpu_new/codegen_timing_pentium.c @@ -11,12 +11,12 @@ */ #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" #include "x86.h" #include "x86_ops.h" #include "x87.h" -#include "mem.h" +#include <86box/mem.h> #include "codegen.h" #include "codegen_ops.h" diff --git a/src/cpu_new/codegen_timing_winchip.c b/src/cpu_new/codegen_timing_winchip.c index 53159a375..bc48023ea 100644 --- a/src/cpu_new/codegen_timing_winchip.c +++ b/src/cpu_new/codegen_timing_winchip.c @@ -1,10 +1,10 @@ #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" #include "x86.h" #include "x86_ops.h" #include "x87.h" -#include "mem.h" +#include <86box/mem.h> #include "codegen.h" #include "codegen_ops.h" diff --git a/src/cpu_new/codegen_timing_winchip2.c b/src/cpu_new/codegen_timing_winchip2.c index 360683522..0e9226960 100644 --- a/src/cpu_new/codegen_timing_winchip2.c +++ b/src/cpu_new/codegen_timing_winchip2.c @@ -8,9 +8,9 @@ - Instructions with prefixes can pair if both instructions are fully decoded when the first instruction starts execution.*/ #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "mem.h" +#include <86box/mem.h> #include "x86.h" #include "x86_ops.h" diff --git a/src/cpu_new/x86seg.c b/src/cpu_new/x86seg.c index 7715f44f9..48e3233e9 100644 --- a/src/cpu_new/x86seg.c +++ b/src/cpu_new/x86seg.c @@ -24,13 +24,13 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "device.h" -#include "timer.h" -#include "machine.h" -#include "mem.h" -#include "nvr.h" +#include <86box/device.h> +#include <86box/timer.h> +#include <86box/machine.h> +#include <86box/mem.h> +#include <86box/nvr.h> #include "x86.h" #include "x86_flags.h" #include "386_common.h" diff --git a/src/device.c b/src/device.c index fa4f0cd8d..d3c985f8e 100644 --- a/src/device.c +++ b/src/device.c @@ -44,11 +44,11 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "config.h" -#include "device.h" -#include "machine.h" -#include "sound.h" +#include <86box/86box.h> +#include <86box/config.h> +#include <86box/device.h> +#include <86box/machine.h> +#include <86box/sound.h> #define DEVICE_MAX 256 /* max # of devices */ diff --git a/src/disk/hdc.c b/src/disk/hdc.c index ba3678670..1bd40b88f 100644 --- a/src/disk/hdc.c +++ b/src/disk/hdc.c @@ -22,12 +22,12 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "machine.h" -#include "device.h" -#include "hdc.h" -#include "hdc_ide.h" -#include "hdd.h" +#include <86box/86box.h> +#include <86box/machine.h> +#include <86box/device.h> +#include <86box/hdc.h> +#include <86box/hdc_ide.h> +#include <86box/hdd.h> int hdc_current; diff --git a/src/disk/hdc_esdi_at.c b/src/disk/hdc_esdi_at.c index ba549104c..b1c202377 100644 --- a/src/disk/hdc_esdi_at.c +++ b/src/disk/hdc_esdi_at.c @@ -28,19 +28,19 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "device.h" -#include "86box_io.h" -#include "mem.h" -#include "pic.h" -#include "rom.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/io.h> +#include <86box/mem.h> +#include <86box/pic.h> +#include <86box/rom.h> #include "cpu.h" -#include "machine.h" -#include "timer.h" -#include "plat.h" -#include "ui.h" -#include "hdc.h" -#include "hdd.h" +#include <86box/machine.h> +#include <86box/timer.h> +#include <86box/plat.h> +#include <86box/ui.h> +#include <86box/hdc.h> +#include <86box/hdd.h> #define HDC_TIME (TIMER_USEC*10LL) diff --git a/src/disk/hdc_esdi_mca.c b/src/disk/hdc_esdi_mca.c index 432385274..a675b6abf 100644 --- a/src/disk/hdc_esdi_mca.c +++ b/src/disk/hdc_esdi_mca.c @@ -67,18 +67,18 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "device.h" -#include "dma.h" -#include "86box_io.h" -#include "mca.h" -#include "mem.h" -#include "pic.h" -#include "rom.h" -#include "timer.h" -#include "ui.h" -#include "hdc.h" -#include "hdd.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/dma.h> +#include <86box/io.h> +#include <86box/mca.h> +#include <86box/mem.h> +#include <86box/pic.h> +#include <86box/rom.h> +#include <86box/timer.h> +#include <86box/ui.h> +#include <86box/hdc.h> +#include <86box/hdd.h> /* These are hardwired. */ diff --git a/src/disk/hdc_ide.c b/src/disk/hdc_ide.c index a91f7a221..72f29f21e 100644 --- a/src/disk/hdc_ide.c +++ b/src/disk/hdc_ide.c @@ -28,24 +28,24 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "machine.h" -#include "86box_io.h" -#include "mem.h" -#include "pic.h" -#include "pci.h" -#include "rom.h" -#include "timer.h" -#include "device.h" -#include "scsi_device.h" -#include "cdrom.h" -#include "plat.h" -#include "ui.h" -#include "hdc.h" -#include "hdc_ide.h" -#include "hdd.h" -#include "zip.h" +#include <86box/machine.h> +#include <86box/io.h> +#include <86box/mem.h> +#include <86box/pic.h> +#include <86box/pci.h> +#include <86box/rom.h> +#include <86box/timer.h> +#include <86box/device.h> +#include <86box/scsi_device.h> +#include <86box/cdrom.h> +#include <86box/plat.h> +#include <86box/ui.h> +#include <86box/hdc.h> +#include <86box/hdc_ide.h> +#include <86box/hdd.h> +#include <86box/zip.h> /* Bits of 'atastat' */ diff --git a/src/disk/hdc_ide_sff8038i.c b/src/disk/hdc_ide_sff8038i.c index 9d7841e40..c8ff3617d 100644 --- a/src/disk/hdc_ide_sff8038i.c +++ b/src/disk/hdc_ide_sff8038i.c @@ -25,21 +25,21 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "cdrom.h" -#include "scsi_device.h" -#include "scsi_cdrom.h" -#include "dma.h" -#include "86box_io.h" -#include "device.h" -#include "keyboard.h" -#include "mem.h" -#include "pci.h" -#include "pic.h" -#include "hdc.h" -#include "hdc_ide.h" -#include "hdc_ide_sff8038i.h" -#include "zip.h" +#include <86box/86box.h> +#include <86box/cdrom.h> +#include <86box/scsi_device.h> +#include <86box/scsi_cdrom.h> +#include <86box/dma.h> +#include <86box/io.h> +#include <86box/device.h> +#include <86box/keyboard.h> +#include <86box/mem.h> +#include <86box/pci.h> +#include <86box/pic.h> +#include <86box/hdc.h> +#include <86box/hdc_ide.h> +#include <86box/hdc_ide_sff8038i.h> +#include <86box/zip.h> static int next_id = 0; diff --git a/src/disk/hdc_st506_at.c b/src/disk/hdc_st506_at.c index 7b2ac579c..6a317db6b 100644 --- a/src/disk/hdc_st506_at.c +++ b/src/disk/hdc_st506_at.c @@ -30,17 +30,17 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "device.h" -#include "86box_io.h" -#include "pic.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/io.h> +#include <86box/pic.h> #include "cpu.h" -#include "machine.h" -#include "timer.h" -#include "plat.h" -#include "ui.h" -#include "hdc.h" -#include "hdd.h" +#include <86box/machine.h> +#include <86box/timer.h> +#include <86box/plat.h> +#include <86box/ui.h> +#include <86box/hdc.h> +#include <86box/hdd.h> #define MFM_TIME (TIMER_USEC*10) diff --git a/src/disk/hdc_st506_xt.c b/src/disk/hdc_st506_xt.c index 0f56ed35c..15e1c2a70 100644 --- a/src/disk/hdc_st506_xt.c +++ b/src/disk/hdc_st506_xt.c @@ -77,18 +77,18 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "86box_io.h" -#include "mem.h" -#include "rom.h" -#include "timer.h" -#include "device.h" -#include "ui.h" -#include "plat.h" -#include "dma.h" -#include "pic.h" -#include "hdc.h" -#include "hdd.h" +#include <86box/86box.h> +#include <86box/io.h> +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/timer.h> +#include <86box/device.h> +#include <86box/ui.h> +#include <86box/plat.h> +#include <86box/dma.h> +#include <86box/pic.h> +#include <86box/hdc.h> +#include <86box/hdd.h> #define XEBEC_BIOS_FILE L"roms/hdd/st506/ibm_xebec_62x0822_1985.bin" diff --git a/src/disk/hdc_xta.c b/src/disk/hdc_xta.c index 20e47e434..18d66d898 100644 --- a/src/disk/hdc_xta.c +++ b/src/disk/hdc_xta.c @@ -94,18 +94,18 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "86box_io.h" -#include "dma.h" -#include "pic.h" -#include "mem.h" -#include "rom.h" -#include "device.h" -#include "timer.h" -#include "plat.h" -#include "ui.h" -#include "hdc.h" -#include "hdd.h" +#include <86box/86box.h> +#include <86box/io.h> +#include <86box/dma.h> +#include <86box/pic.h> +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/device.h> +#include <86box/timer.h> +#include <86box/plat.h> +#include <86box/ui.h> +#include <86box/hdc.h> +#include <86box/hdd.h> #define HDC_TIME (50*TIMER_USEC) diff --git a/src/disk/hdc_xtide.c b/src/disk/hdc_xtide.c index d46bd65b0..c9497e120 100644 --- a/src/disk/hdc_xtide.c +++ b/src/disk/hdc_xtide.c @@ -36,13 +36,13 @@ #include #include #include -#include "86box.h" -#include "86box_io.h" -#include "mem.h" -#include "rom.h" -#include "device.h" -#include "hdc.h" -#include "hdc_ide.h" +#include <86box/86box.h> +#include <86box/io.h> +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/device.h> +#include <86box/hdc.h> +#include <86box/hdc_ide.h> #define ROM_PATH_XT L"roms/hdd/xtide/ide_xt.bin" diff --git a/src/disk/hdd.c b/src/disk/hdd.c index 353d43672..15bb5743e 100644 --- a/src/disk/hdd.c +++ b/src/disk/hdd.c @@ -20,11 +20,11 @@ #include #include #include -#include "86box.h" -#include "plat.h" -#include "ui.h" -#include "hdd.h" -#include "cdrom.h" +#include <86box/86box.h> +#include <86box/plat.h> +#include <86box/ui.h> +#include <86box/hdd.h> +#include <86box/cdrom.h> hard_disk_t hdd[HDD_NUM]; diff --git a/src/disk/hdd_image.c b/src/disk/hdd_image.c index fdb1a14a2..337265546 100644 --- a/src/disk/hdd_image.c +++ b/src/disk/hdd_image.c @@ -28,10 +28,10 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "plat.h" -#include "random.h" -#include "hdd.h" +#include <86box/86box.h> +#include <86box/plat.h> +#include <86box/random.h> +#include <86box/hdd.h> typedef struct diff --git a/src/disk/hdd_table.c b/src/disk/hdd_table.c index b9152ce9d..05eae6990 100644 --- a/src/disk/hdd_table.c +++ b/src/disk/hdd_table.c @@ -22,8 +22,8 @@ #include #include #include -#include "86box.h" -#include "hdd.h" +#include <86box/86box.h> +#include <86box/hdd.h> unsigned int hdd_table[128][3] = { diff --git a/src/disk/zip.c b/src/disk/zip.c index cea045672..850468573 100644 --- a/src/disk/zip.c +++ b/src/disk/zip.c @@ -22,19 +22,19 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "timer.h" -#include "config.h" -#include "timer.h" -#include "device.h" -#include "piix.h" -#include "scsi_device.h" -#include "nvr.h" -#include "plat.h" -#include "ui.h" -#include "hdc.h" -#include "hdc_ide.h" -#include "zip.h" +#include <86box/86box.h> +#include <86box/timer.h> +#include <86box/config.h> +#include <86box/timer.h> +#include <86box/device.h> +#include <86box/piix.h> +#include <86box/scsi_device.h> +#include <86box/nvr.h> +#include <86box/plat.h> +#include <86box/ui.h> +#include <86box/hdc.h> +#include <86box/hdc_ide.h> +#include <86box/zip.h> zip_drive_t zip_drives[ZIP_NUM]; diff --git a/src/dma.c b/src/dma.c index 33ddaf10a..8ce081bf2 100644 --- a/src/dma.c +++ b/src/dma.c @@ -22,14 +22,14 @@ #include #include #include -#include "86box.h" +#include <86box/86box.h> #include "cpu_common/cpu.h" #include "cpu_common/x86.h" -#include "machine/machine.h" -#include "mca.h" -#include "mem.h" -#include "86box_io.h" -#include "dma.h" +#include <86box/machine.h> +#include <86box/mca.h> +#include <86box/mem.h> +#include <86box/io.h> +#include <86box/dma.h> dma_t dma[8]; diff --git a/src/floppy/fdc.c b/src/floppy/fdc.c index 2dab22dcb..4703c428d 100644 --- a/src/floppy/fdc.c +++ b/src/floppy/fdc.c @@ -24,17 +24,17 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "device.h" +#include <86box/86box.h> +#include <86box/device.h> #include "cpu.h" -#include "machine.h" -#include "86box_io.h" -#include "dma.h" -#include "pic.h" -#include "timer.h" -#include "ui.h" -#include "fdd.h" -#include "fdc.h" +#include <86box/machine.h> +#include <86box/io.h> +#include <86box/dma.h> +#include <86box/pic.h> +#include <86box/timer.h> +#include <86box/ui.h> +#include <86box/fdd.h> +#include <86box/fdc.h> extern uint64_t motoron[FDD_NUM]; diff --git a/src/floppy/fdd.c b/src/floppy/fdd.c index af6c72bfd..791c82abd 100644 --- a/src/floppy/fdd.c +++ b/src/floppy/fdd.c @@ -24,19 +24,19 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "timer.h" -#include "plat.h" -#include "ui.h" -#include "fdd.h" -#include "fdd_86f.h" -#include "fdd_fdi.h" -#include "fdd_imd.h" -#include "fdd_img.h" -#include "fdd_json.h" -#include "fdd_mfm.h" -#include "fdd_td0.h" -#include "fdc.h" +#include <86box/86box.h> +#include <86box/timer.h> +#include <86box/plat.h> +#include <86box/ui.h> +#include <86box/fdd.h> +#include <86box/fdd_86f.h> +#include <86box/fdd_fdi.h> +#include <86box/fdd_imd.h> +#include <86box/fdd_img.h> +#include <86box/fdd_json.h> +#include <86box/fdd_mfm.h> +#include <86box/fdd_td0.h> +#include <86box/fdc.h> /* Flags: diff --git a/src/floppy/fdd_86f.c b/src/floppy/fdd_86f.c index c74c1fe61..d3fbd2a06 100644 --- a/src/floppy/fdd_86f.c +++ b/src/floppy/fdd_86f.c @@ -26,18 +26,18 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "timer.h" -#include "dma.h" -#include "nvr.h" -#include "random.h" -#include "plat.h" -#include "ui.h" -#include "fdd.h" -#include "fdc.h" -#include "fdd_86f.h" +#include <86box/86box.h> +#include <86box/timer.h> +#include <86box/dma.h> +#include <86box/nvr.h> +#include <86box/random.h> +#include <86box/plat.h> +#include <86box/ui.h> +#include <86box/fdd.h> +#include <86box/fdc.h> +#include <86box/fdd_86f.h> #ifdef D86F_COMPRESS -#include "lzf/lzf.h" +#include #endif diff --git a/src/floppy/fdd_common.c b/src/floppy/fdd_common.c index 64e64f349..4536a8683 100644 --- a/src/floppy/fdd_common.c +++ b/src/floppy/fdd_common.c @@ -19,10 +19,10 @@ #include #include #include -#include "86box.h" -#include "timer.h" -#include "fdd.h" -#include "fdd_common.h" +#include <86box/86box.h> +#include <86box/timer.h> +#include <86box/fdd.h> +#include <86box/fdd_common.h> const uint8_t fdd_holes[6] = { 0, 0, 0, 1, 1, 2 }; diff --git a/src/floppy/fdd_fdi.c b/src/floppy/fdd_fdi.c index dc9c85d85..51891e227 100644 --- a/src/floppy/fdd_fdi.c +++ b/src/floppy/fdd_fdi.c @@ -26,15 +26,15 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "timer.h" -#include "plat.h" -#include "fdd.h" -#include "fdd_86f.h" -#include "fdd_img.h" -#include "fdd_fdi.h" -#include "fdc.h" -#include "fdi2raw.h" +#include <86box/86box.h> +#include <86box/timer.h> +#include <86box/plat.h> +#include <86box/fdd.h> +#include <86box/fdd_86f.h> +#include <86box/fdd_img.h> +#include <86box/fdd_fdi.h> +#include <86box/fdc.h> +#include typedef struct { diff --git a/src/floppy/fdd_imd.c b/src/floppy/fdd_imd.c index 20d343a77..608805b3d 100644 --- a/src/floppy/fdd_imd.c +++ b/src/floppy/fdd_imd.c @@ -23,13 +23,13 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "timer.h" -#include "plat.h" -#include "fdd.h" -#include "fdd_86f.h" -#include "fdd_imd.h" -#include "fdc.h" +#include <86box/86box.h> +#include <86box/timer.h> +#include <86box/plat.h> +#include <86box/fdd.h> +#include <86box/fdd_86f.h> +#include <86box/fdd_imd.h> +#include <86box/fdc.h> typedef struct { diff --git a/src/floppy/fdd_img.c b/src/floppy/fdd_img.c index 25e008c04..2c008f7f9 100644 --- a/src/floppy/fdd_img.c +++ b/src/floppy/fdd_img.c @@ -30,14 +30,14 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "timer.h" -#include "config.h" -#include "plat.h" -#include "fdd.h" -#include "fdd_86f.h" -#include "fdd_img.h" -#include "fdc.h" +#include <86box/86box.h> +#include <86box/timer.h> +#include <86box/config.h> +#include <86box/plat.h> +#include <86box/fdd.h> +#include <86box/fdd_86f.h> +#include <86box/fdd_img.h> +#include <86box/fdc.h> typedef struct { diff --git a/src/floppy/fdd_json.c b/src/floppy/fdd_json.c index dc17448db..abdcc28f6 100644 --- a/src/floppy/fdd_json.c +++ b/src/floppy/fdd_json.c @@ -51,14 +51,14 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "timer.h" -#include "plat.h" -#include "fdd.h" -#include "fdd_86f.h" -#include "fdc.h" -#include "fdd_common.h" -#include "fdd_json.h" +#include <86box/86box.h> +#include <86box/timer.h> +#include <86box/plat.h> +#include <86box/fdd.h> +#include <86box/fdd_86f.h> +#include <86box/fdc.h> +#include <86box/fdd_common.h> +#include <86box/fdd_json.h> #define NTRACKS 256 diff --git a/src/floppy/fdd_mfm.c b/src/floppy/fdd_mfm.c index 19e9232de..0bf7d47a9 100644 --- a/src/floppy/fdd_mfm.c +++ b/src/floppy/fdd_mfm.c @@ -22,14 +22,14 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "timer.h" -#include "plat.h" -#include "fdd.h" -#include "fdd_86f.h" -#include "fdd_img.h" -#include "fdd_mfm.h" -#include "fdc.h" +#include <86box/86box.h> +#include <86box/timer.h> +#include <86box/plat.h> +#include <86box/fdd.h> +#include <86box/fdd_86f.h> +#include <86box/fdd_img.h> +#include <86box/fdd_mfm.h> +#include <86box/fdc.h> #pragma pack(push,1) diff --git a/src/floppy/fdd_td0.c b/src/floppy/fdd_td0.c index 0d5d8567c..118471185 100644 --- a/src/floppy/fdd_td0.c +++ b/src/floppy/fdd_td0.c @@ -35,13 +35,13 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "timer.h" -#include "plat.h" -#include "fdd.h" -#include "fdd_86f.h" -#include "fdd_td0.h" -#include "fdc.h" +#include <86box/86box.h> +#include <86box/timer.h> +#include <86box/plat.h> +#include <86box/fdd.h> +#include <86box/fdd_86f.h> +#include <86box/fdd_td0.h> +#include <86box/fdc.h> #define BUFSZ 512 /* new input buffer */ diff --git a/src/floppy/fdi2raw.c b/src/floppy/fdi2raw.c index 52bcb3d82..ffa722d74 100644 --- a/src/floppy/fdi2raw.c +++ b/src/floppy/fdi2raw.c @@ -37,8 +37,8 @@ /* ELSE */ #define xmalloc malloc #define HAVE_STDARG_H -#include "86box.h" -#include "fdi2raw.h" +#include <86box/86box.h> +#include #undef DEBUG diff --git a/src/game/gameport.c b/src/game/gameport.c index ecdf5e0d7..b9b418eeb 100644 --- a/src/game/gameport.c +++ b/src/game/gameport.c @@ -39,17 +39,17 @@ #include #include #include -#include "86box.h" -#include "machine.h" +#include <86box/86box.h> +#include <86box/machine.h> #include "cpu.h" -#include "device.h" -#include "86box_io.h" -#include "timer.h" -#include "gameport.h" -#include "joystick_ch_flightstick_pro.h" -#include "joystick_standard.h" -#include "joystick_sw_pad.h" -#include "joystick_tm_fcs.h" +#include <86box/device.h> +#include <86box/io.h> +#include <86box/timer.h> +#include <86box/gameport.h> +#include <86box/joystick_ch_flightstick_pro.h> +#include <86box/joystick_standard.h> +#include <86box/joystick_sw_pad.h> +#include <86box/joystick_tm_fcs.h> typedef struct { diff --git a/src/game/joystick_ch_flightstick_pro.c b/src/game/joystick_ch_flightstick_pro.c index 9a2754c73..0faffa7c0 100644 --- a/src/game/joystick_ch_flightstick_pro.c +++ b/src/game/joystick_ch_flightstick_pro.c @@ -39,11 +39,11 @@ #include #include #include -#include "86box.h" -#include "device.h" -#include "timer.h" -#include "gameport.h" -#include "joystick_standard.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/timer.h> +#include <86box/gameport.h> +#include <86box/joystick_standard.h> static void *ch_flightstick_pro_init(void) diff --git a/src/game/joystick_standard.c b/src/game/joystick_standard.c index 570f614a9..e72d066cb 100644 --- a/src/game/joystick_standard.c +++ b/src/game/joystick_standard.c @@ -39,11 +39,11 @@ #include #include #include -#include "86box.h" -#include "device.h" -#include "timer.h" -#include "gameport.h" -#include "joystick_standard.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/timer.h> +#include <86box/gameport.h> +#include <86box/joystick_standard.h> static void *joystick_standard_init(void) diff --git a/src/game/joystick_sw_pad.c b/src/game/joystick_sw_pad.c index 7d98f547a..b42f0d55a 100644 --- a/src/game/joystick_sw_pad.c +++ b/src/game/joystick_sw_pad.c @@ -60,11 +60,11 @@ #include #include #include -#include "86box.h" -#include "device.h" -#include "timer.h" -#include "gameport.h" -#include "joystick_sw_pad.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/timer.h> +#include <86box/gameport.h> +#include <86box/joystick_sw_pad.h> typedef struct diff --git a/src/game/joystick_tm_fcs.c b/src/game/joystick_tm_fcs.c index 8b6e1e115..9d949f3c3 100644 --- a/src/game/joystick_tm_fcs.c +++ b/src/game/joystick_tm_fcs.c @@ -39,11 +39,11 @@ #include #include #include -#include "86box.h" -#include "device.h" -#include "timer.h" -#include "gameport.h" -#include "joystick_standard.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/timer.h> +#include <86box/gameport.h> +#include <86box/joystick_standard.h> static void *tm_fcs_init(void) diff --git a/src/hwm.c b/src/hwm.c index 7c953b1ab..cac194d98 100644 --- a/src/hwm.c +++ b/src/hwm.c @@ -15,8 +15,8 @@ */ #include -#include "device.h" -#include "hwm.h" +#include <86box/device.h> +#include <86box/hwm.h> hwm_values_t hwm_values; diff --git a/src/hwm_w83781d.c b/src/hwm_w83781d.c index b80bef7d9..598513153 100644 --- a/src/hwm_w83781d.c +++ b/src/hwm_w83781d.c @@ -18,11 +18,11 @@ #include #include #include -#include "86box.h" -#include "device.h" -#include "86box_io.h" -#include "smbus.h" -#include "hwm.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/io.h> +#include <86box/smbus.h> +#include <86box/hwm.h> #define W83781D_SMBUS 0x10000 diff --git a/src/i82335.c b/src/i82335.c index 7be061601..b5594f4da 100644 --- a/src/i82335.c +++ b/src/i82335.c @@ -4,8 +4,8 @@ #include #include #include -#include "86box_io.h" -#include "mem.h" +#include <86box/io.h> +#include <86box/mem.h> typedef struct { diff --git a/src/ibm_5161.c b/src/ibm_5161.c index 61b38704b..f7658a7f5 100644 --- a/src/ibm_5161.c +++ b/src/ibm_5161.c @@ -17,18 +17,18 @@ #include #include #include -#include "86box.h" -#include "device.h" -#include "86box_io.h" -#include "apm.h" -#include "dma.h" -#include "mem.h" -#include "pci.h" -#include "timer.h" -#include "pit.h" -#include "port_92.h" -#include "machine.h" -#include "intel_sio.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/io.h> +#include <86box/apm.h> +#include <86box/dma.h> +#include <86box/mem.h> +#include <86box/pci.h> +#include <86box/timer.h> +#include <86box/pit.h> +#include <86box/port_92.h> +#include <86box/machine.h> +#include <86box/intel_sio.h> typedef struct diff --git a/src/86box.h b/src/include/86box/86box.h similarity index 100% rename from src/86box.h rename to src/include/86box/86box.h diff --git a/src/apm.h b/src/include/86box/apm.h similarity index 100% rename from src/apm.h rename to src/include/86box/apm.h diff --git a/src/network/bswap.h b/src/include/86box/bswap.h similarity index 100% rename from src/network/bswap.h rename to src/include/86box/bswap.h diff --git a/src/bugger.h b/src/include/86box/bugger.h similarity index 100% rename from src/bugger.h rename to src/include/86box/bugger.h diff --git a/src/cdrom/cdrom.h b/src/include/86box/cdrom.h similarity index 100% rename from src/cdrom/cdrom.h rename to src/include/86box/cdrom.h diff --git a/src/cdrom/cdrom_image.h b/src/include/86box/cdrom_image.h similarity index 100% rename from src/cdrom/cdrom_image.h rename to src/include/86box/cdrom_image.h diff --git a/src/cdrom/cdrom_image_backend.h b/src/include/86box/cdrom_image_backend.h similarity index 100% rename from src/cdrom/cdrom_image_backend.h rename to src/include/86box/cdrom_image_backend.h diff --git a/src/chipset/chipset.h b/src/include/86box/chipset.h similarity index 100% rename from src/chipset/chipset.h rename to src/include/86box/chipset.h diff --git a/src/config.h b/src/include/86box/config.h similarity index 100% rename from src/config.h rename to src/include/86box/config.h diff --git a/src/chipset/cs8230.h b/src/include/86box/cs8230.h similarity index 100% rename from src/chipset/cs8230.h rename to src/include/86box/cs8230.h diff --git a/src/device.h b/src/include/86box/device.h similarity index 100% rename from src/device.h rename to src/include/86box/device.h diff --git a/src/dma.h b/src/include/86box/dma.h similarity index 100% rename from src/dma.h rename to src/include/86box/dma.h diff --git a/src/floppy/fdc.h b/src/include/86box/fdc.h similarity index 100% rename from src/floppy/fdc.h rename to src/include/86box/fdc.h diff --git a/src/floppy/fdd.h b/src/include/86box/fdd.h similarity index 100% rename from src/floppy/fdd.h rename to src/include/86box/fdd.h diff --git a/src/floppy/fdd_86f.h b/src/include/86box/fdd_86f.h similarity index 100% rename from src/floppy/fdd_86f.h rename to src/include/86box/fdd_86f.h diff --git a/src/floppy/fdd_common.h b/src/include/86box/fdd_common.h similarity index 100% rename from src/floppy/fdd_common.h rename to src/include/86box/fdd_common.h diff --git a/src/floppy/fdd_fdi.h b/src/include/86box/fdd_fdi.h similarity index 100% rename from src/floppy/fdd_fdi.h rename to src/include/86box/fdd_fdi.h diff --git a/src/floppy/fdd_imd.h b/src/include/86box/fdd_imd.h similarity index 100% rename from src/floppy/fdd_imd.h rename to src/include/86box/fdd_imd.h diff --git a/src/floppy/fdd_img.h b/src/include/86box/fdd_img.h similarity index 100% rename from src/floppy/fdd_img.h rename to src/include/86box/fdd_img.h diff --git a/src/floppy/fdd_json.h b/src/include/86box/fdd_json.h similarity index 100% rename from src/floppy/fdd_json.h rename to src/include/86box/fdd_json.h diff --git a/src/floppy/fdd_mfm.h b/src/include/86box/fdd_mfm.h similarity index 100% rename from src/floppy/fdd_mfm.h rename to src/include/86box/fdd_mfm.h diff --git a/src/floppy/fdd_td0.h b/src/include/86box/fdd_td0.h similarity index 100% rename from src/floppy/fdd_td0.h rename to src/include/86box/fdd_td0.h diff --git a/src/sound/filters.h b/src/include/86box/filters.h similarity index 100% rename from src/sound/filters.h rename to src/include/86box/filters.h diff --git a/src/game/gameport.h b/src/include/86box/gameport.h similarity index 100% rename from src/game/gameport.h rename to src/include/86box/gameport.h diff --git a/src/disk/hdc.h b/src/include/86box/hdc.h similarity index 100% rename from src/disk/hdc.h rename to src/include/86box/hdc.h diff --git a/src/disk/hdc_ide.h b/src/include/86box/hdc_ide.h similarity index 100% rename from src/disk/hdc_ide.h rename to src/include/86box/hdc_ide.h diff --git a/src/disk/hdc_ide_sff8038i.h b/src/include/86box/hdc_ide_sff8038i.h similarity index 100% rename from src/disk/hdc_ide_sff8038i.h rename to src/include/86box/hdc_ide_sff8038i.h diff --git a/src/disk/hdd.h b/src/include/86box/hdd.h similarity index 100% rename from src/disk/hdd.h rename to src/include/86box/hdd.h diff --git a/src/hwm.h b/src/include/86box/hwm.h similarity index 100% rename from src/hwm.h rename to src/include/86box/hwm.h diff --git a/src/i82335.h b/src/include/86box/i82335.h similarity index 100% rename from src/i82335.h rename to src/include/86box/i82335.h diff --git a/src/ibm_5161.h b/src/include/86box/ibm_5161.h similarity index 100% rename from src/ibm_5161.h rename to src/include/86box/ibm_5161.h diff --git a/src/intel_flash.h b/src/include/86box/intel_flash.h similarity index 100% rename from src/intel_flash.h rename to src/include/86box/intel_flash.h diff --git a/src/intel_sio.h b/src/include/86box/intel_sio.h similarity index 100% rename from src/intel_sio.h rename to src/include/86box/intel_sio.h diff --git a/src/86box_io.h b/src/include/86box/io.h similarity index 100% rename from src/86box_io.h rename to src/include/86box/io.h diff --git a/src/isamem.h b/src/include/86box/isamem.h similarity index 100% rename from src/isamem.h rename to src/include/86box/isamem.h diff --git a/src/isartc.h b/src/include/86box/isartc.h similarity index 100% rename from src/isartc.h rename to src/include/86box/isartc.h diff --git a/src/game/joystick_ch_flightstick_pro.h b/src/include/86box/joystick_ch_flightstick_pro.h similarity index 100% rename from src/game/joystick_ch_flightstick_pro.h rename to src/include/86box/joystick_ch_flightstick_pro.h diff --git a/src/game/joystick_standard.h b/src/include/86box/joystick_standard.h similarity index 100% rename from src/game/joystick_standard.h rename to src/include/86box/joystick_standard.h diff --git a/src/game/joystick_sw_pad.h b/src/include/86box/joystick_sw_pad.h similarity index 100% rename from src/game/joystick_sw_pad.h rename to src/include/86box/joystick_sw_pad.h diff --git a/src/game/joystick_tm_fcs.h b/src/include/86box/joystick_tm_fcs.h similarity index 100% rename from src/game/joystick_tm_fcs.h rename to src/include/86box/joystick_tm_fcs.h diff --git a/src/keyboard.h b/src/include/86box/keyboard.h similarity index 100% rename from src/keyboard.h rename to src/include/86box/keyboard.h diff --git a/src/lang/language.h b/src/include/86box/language.h similarity index 100% rename from src/lang/language.h rename to src/include/86box/language.h diff --git a/src/lpt.h b/src/include/86box/lpt.h similarity index 100% rename from src/lpt.h rename to src/include/86box/lpt.h diff --git a/src/machine/m_amstrad.h b/src/include/86box/m_amstrad.h similarity index 100% rename from src/machine/m_amstrad.h rename to src/include/86box/m_amstrad.h diff --git a/src/machine/m_at_t3100e.h b/src/include/86box/m_at_t3100e.h similarity index 100% rename from src/machine/m_at_t3100e.h rename to src/include/86box/m_at_t3100e.h diff --git a/src/machine/m_xt_t1000.h b/src/include/86box/m_xt_t1000.h similarity index 100% rename from src/machine/m_xt_t1000.h rename to src/include/86box/m_xt_t1000.h diff --git a/src/machine/m_xt_xi8088.h b/src/include/86box/m_xt_xi8088.h similarity index 86% rename from src/machine/m_xt_xi8088.h rename to src/include/86box/m_xt_xi8088.h index 0270ed16d..f263e385d 100644 --- a/src/machine/m_xt_xi8088.h +++ b/src/include/86box/m_xt_xi8088.h @@ -1,4 +1,4 @@ -#include "../device.h" +#include <86box/device.h> extern const device_t xi8088_device; diff --git a/src/machine/machine.h b/src/include/86box/machine.h similarity index 100% rename from src/machine/machine.h rename to src/include/86box/machine.h diff --git a/src/mca.h b/src/include/86box/mca.h similarity index 100% rename from src/mca.h rename to src/include/86box/mca.h diff --git a/src/mem.h b/src/include/86box/mem.h similarity index 100% rename from src/mem.h rename to src/include/86box/mem.h diff --git a/src/sound/midi.h b/src/include/86box/midi.h similarity index 100% rename from src/sound/midi.h rename to src/include/86box/midi.h diff --git a/src/sound/midi_input.h b/src/include/86box/midi_input.h similarity index 100% rename from src/sound/midi_input.h rename to src/include/86box/midi_input.h diff --git a/src/sound/midi_system.h b/src/include/86box/midi_system.h similarity index 100% rename from src/sound/midi_system.h rename to src/include/86box/midi_system.h diff --git a/src/mouse.h b/src/include/86box/mouse.h similarity index 100% rename from src/mouse.h rename to src/include/86box/mouse.h diff --git a/src/network/net_3c503.h b/src/include/86box/net_3c503.h similarity index 100% rename from src/network/net_3c503.h rename to src/include/86box/net_3c503.h diff --git a/src/network/net_dp8390.h b/src/include/86box/net_dp8390.h similarity index 100% rename from src/network/net_dp8390.h rename to src/include/86box/net_dp8390.h diff --git a/src/network/net_ne2000.h b/src/include/86box/net_ne2000.h similarity index 100% rename from src/network/net_ne2000.h rename to src/include/86box/net_ne2000.h diff --git a/src/network/net_pcnet.h b/src/include/86box/net_pcnet.h similarity index 100% rename from src/network/net_pcnet.h rename to src/include/86box/net_pcnet.h diff --git a/src/network/net_wd8003.h b/src/include/86box/net_wd8003.h similarity index 100% rename from src/network/net_wd8003.h rename to src/include/86box/net_wd8003.h diff --git a/src/network/network.h b/src/include/86box/network.h similarity index 100% rename from src/network/network.h rename to src/include/86box/network.h diff --git a/src/nmi.h b/src/include/86box/nmi.h similarity index 100% rename from src/nmi.h rename to src/include/86box/nmi.h diff --git a/src/nvr.h b/src/include/86box/nvr.h similarity index 100% rename from src/nvr.h rename to src/include/86box/nvr.h diff --git a/src/nvr_ps2.h b/src/include/86box/nvr_ps2.h similarity index 100% rename from src/nvr_ps2.h rename to src/include/86box/nvr_ps2.h diff --git a/src/pci.h b/src/include/86box/pci.h similarity index 100% rename from src/pci.h rename to src/include/86box/pci.h diff --git a/src/pci_dummy.h b/src/include/86box/pci_dummy.h similarity index 100% rename from src/pci_dummy.h rename to src/include/86box/pci_dummy.h diff --git a/src/pic.h b/src/include/86box/pic.h similarity index 100% rename from src/pic.h rename to src/include/86box/pic.h diff --git a/src/piix.h b/src/include/86box/piix.h similarity index 100% rename from src/piix.h rename to src/include/86box/piix.h diff --git a/src/pit.h b/src/include/86box/pit.h similarity index 100% rename from src/pit.h rename to src/include/86box/pit.h diff --git a/src/plat.h b/src/include/86box/plat.h similarity index 99% rename from src/plat.h rename to src/include/86box/plat.h index cb2096d75..29414bbaa 100644 --- a/src/plat.h +++ b/src/include/86box/plat.h @@ -24,7 +24,7 @@ #endif /* String ID numbers. */ -#include "lang/language.h" +#include <86box/language.h> /* The Win32 API uses _wcsicmp. */ #ifdef _WIN32 diff --git a/src/win/plat_dir.h b/src/include/86box/plat_dir.h similarity index 100% rename from src/win/plat_dir.h rename to src/include/86box/plat_dir.h diff --git a/src/plat_dynld.h b/src/include/86box/plat_dynld.h similarity index 100% rename from src/plat_dynld.h rename to src/include/86box/plat_dynld.h diff --git a/src/plat_midi.h b/src/include/86box/plat_midi.h similarity index 100% rename from src/plat_midi.h rename to src/include/86box/plat_midi.h diff --git a/src/printer/png_struct.h b/src/include/86box/png_struct.h similarity index 100% rename from src/printer/png_struct.h rename to src/include/86box/png_struct.h diff --git a/src/port_92.h b/src/include/86box/port_92.h similarity index 100% rename from src/port_92.h rename to src/include/86box/port_92.h diff --git a/src/postcard.h b/src/include/86box/postcard.h similarity index 100% rename from src/postcard.h rename to src/include/86box/postcard.h diff --git a/src/ppi.h b/src/include/86box/ppi.h similarity index 100% rename from src/ppi.h rename to src/include/86box/ppi.h diff --git a/src/printer/printer.h b/src/include/86box/printer.h similarity index 100% rename from src/printer/printer.h rename to src/include/86box/printer.h diff --git a/src/printer/prt_devs.h b/src/include/86box/prt_devs.h similarity index 100% rename from src/printer/prt_devs.h rename to src/include/86box/prt_devs.h diff --git a/src/random.h b/src/include/86box/random.h similarity index 100% rename from src/random.h rename to src/include/86box/random.h diff --git a/src/win/resource.h b/src/include/86box/resource.h similarity index 100% rename from src/win/resource.h rename to src/include/86box/resource.h diff --git a/src/rom.h b/src/include/86box/rom.h similarity index 100% rename from src/rom.h rename to src/include/86box/rom.h diff --git a/src/scsi/scsi.h b/src/include/86box/scsi.h similarity index 100% rename from src/scsi/scsi.h rename to src/include/86box/scsi.h diff --git a/src/scsi/scsi_aha154x.h b/src/include/86box/scsi_aha154x.h similarity index 100% rename from src/scsi/scsi_aha154x.h rename to src/include/86box/scsi_aha154x.h diff --git a/src/scsi/scsi_buslogic.h b/src/include/86box/scsi_buslogic.h similarity index 100% rename from src/scsi/scsi_buslogic.h rename to src/include/86box/scsi_buslogic.h diff --git a/src/scsi/scsi_cdrom.h b/src/include/86box/scsi_cdrom.h similarity index 100% rename from src/scsi/scsi_cdrom.h rename to src/include/86box/scsi_cdrom.h diff --git a/src/scsi/scsi_device.h b/src/include/86box/scsi_device.h similarity index 100% rename from src/scsi/scsi_device.h rename to src/include/86box/scsi_device.h diff --git a/src/scsi/scsi_disk.h b/src/include/86box/scsi_disk.h similarity index 100% rename from src/scsi/scsi_disk.h rename to src/include/86box/scsi_disk.h diff --git a/src/scsi/scsi_ncr5380.h b/src/include/86box/scsi_ncr5380.h similarity index 100% rename from src/scsi/scsi_ncr5380.h rename to src/include/86box/scsi_ncr5380.h diff --git a/src/scsi/scsi_ncr53c8xx.h b/src/include/86box/scsi_ncr53c8xx.h similarity index 100% rename from src/scsi/scsi_ncr53c8xx.h rename to src/include/86box/scsi_ncr53c8xx.h diff --git a/src/scsi/scsi_spock.h b/src/include/86box/scsi_spock.h similarity index 100% rename from src/scsi/scsi_spock.h rename to src/include/86box/scsi_spock.h diff --git a/src/scsi/scsi_x54x.h b/src/include/86box/scsi_x54x.h similarity index 100% rename from src/scsi/scsi_x54x.h rename to src/include/86box/scsi_x54x.h diff --git a/src/serial.h b/src/include/86box/serial.h similarity index 100% rename from src/serial.h rename to src/include/86box/serial.h diff --git a/src/sio.h b/src/include/86box/sio.h similarity index 100% rename from src/sio.h rename to src/include/86box/sio.h diff --git a/src/smbus.h b/src/include/86box/smbus.h similarity index 100% rename from src/smbus.h rename to src/include/86box/smbus.h diff --git a/src/sound/snd_ad1848.h b/src/include/86box/snd_ad1848.h similarity index 100% rename from src/sound/snd_ad1848.h rename to src/include/86box/snd_ad1848.h diff --git a/src/sound/snd_azt2316a.h b/src/include/86box/snd_azt2316a.h similarity index 100% rename from src/sound/snd_azt2316a.h rename to src/include/86box/snd_azt2316a.h diff --git a/src/sound/snd_emu8k.h b/src/include/86box/snd_emu8k.h similarity index 100% rename from src/sound/snd_emu8k.h rename to src/include/86box/snd_emu8k.h diff --git a/src/sound/snd_mpu401.h b/src/include/86box/snd_mpu401.h similarity index 100% rename from src/sound/snd_mpu401.h rename to src/include/86box/snd_mpu401.h diff --git a/src/sound/snd_opl.h b/src/include/86box/snd_opl.h similarity index 100% rename from src/sound/snd_opl.h rename to src/include/86box/snd_opl.h diff --git a/src/sound/snd_opl_backend.h b/src/include/86box/snd_opl_backend.h similarity index 100% rename from src/sound/snd_opl_backend.h rename to src/include/86box/snd_opl_backend.h diff --git a/src/sound/snd_resid.h b/src/include/86box/snd_resid.h similarity index 100% rename from src/sound/snd_resid.h rename to src/include/86box/snd_resid.h diff --git a/src/sound/snd_sb.h b/src/include/86box/snd_sb.h similarity index 96% rename from src/sound/snd_sb.h rename to src/include/86box/snd_sb.h index b844334bf..5b33adcf5 100644 --- a/src/sound/snd_sb.h +++ b/src/include/86box/snd_sb.h @@ -18,10 +18,10 @@ #ifndef SOUND_SND_SB_H # define SOUND_SND_SB_H -#include "snd_emu8k.h" -#include "snd_mpu401.h" -#include "snd_opl.h" -#include "snd_sb_dsp.h" +#include <86box/snd_emu8k.h> +#include <86box/snd_mpu401.h> +#include <86box/snd_opl.h> +#include <86box/snd_sb_dsp.h> #define SADLIB 1 /* No DSP */ #define SB1 2 /* DSP v1.05 */ diff --git a/src/sound/snd_sb_dsp.h b/src/include/86box/snd_sb_dsp.h similarity index 100% rename from src/sound/snd_sb_dsp.h rename to src/include/86box/snd_sb_dsp.h diff --git a/src/sound/snd_sn76489.h b/src/include/86box/snd_sn76489.h similarity index 100% rename from src/sound/snd_sn76489.h rename to src/include/86box/snd_sn76489.h diff --git a/src/sound/snd_speaker.h b/src/include/86box/snd_speaker.h similarity index 100% rename from src/sound/snd_speaker.h rename to src/include/86box/snd_speaker.h diff --git a/src/sound/snd_ym7128.h b/src/include/86box/snd_ym7128.h similarity index 100% rename from src/sound/snd_ym7128.h rename to src/include/86box/snd_ym7128.h diff --git a/src/sound/sound.h b/src/include/86box/sound.h similarity index 100% rename from src/sound/sound.h rename to src/include/86box/sound.h diff --git a/src/spd.h b/src/include/86box/spd.h similarity index 100% rename from src/spd.h rename to src/include/86box/spd.h diff --git a/src/sst_flash.h b/src/include/86box/sst_flash.h similarity index 100% rename from src/sst_flash.h rename to src/include/86box/sst_flash.h diff --git a/src/timer.h b/src/include/86box/timer.h similarity index 100% rename from src/timer.h rename to src/include/86box/timer.h diff --git a/src/ui.h b/src/include/86box/ui.h similarity index 100% rename from src/ui.h rename to src/include/86box/ui.h diff --git a/src/usb.h b/src/include/86box/usb.h similarity index 100% rename from src/usb.h rename to src/include/86box/usb.h diff --git a/src/via_vt82c586b.h b/src/include/86box/via_vt82c586b.h similarity index 100% rename from src/via_vt82c586b.h rename to src/include/86box/via_vt82c586b.h diff --git a/src/video/vid_ati_eeprom.h b/src/include/86box/vid_ati_eeprom.h similarity index 100% rename from src/video/vid_ati_eeprom.h rename to src/include/86box/vid_ati_eeprom.h diff --git a/src/video/vid_cga.h b/src/include/86box/vid_cga.h similarity index 100% rename from src/video/vid_cga.h rename to src/include/86box/vid_cga.h diff --git a/src/video/vid_cga_comp.h b/src/include/86box/vid_cga_comp.h similarity index 100% rename from src/video/vid_cga_comp.h rename to src/include/86box/vid_cga_comp.h diff --git a/src/video/vid_colorplus.h b/src/include/86box/vid_colorplus.h similarity index 100% rename from src/video/vid_colorplus.h rename to src/include/86box/vid_colorplus.h diff --git a/src/video/vid_ega.h b/src/include/86box/vid_ega.h similarity index 100% rename from src/video/vid_ega.h rename to src/include/86box/vid_ega.h diff --git a/src/video/vid_mda.h b/src/include/86box/vid_mda.h similarity index 100% rename from src/video/vid_mda.h rename to src/include/86box/vid_mda.h diff --git a/src/video/vid_pgc.h b/src/include/86box/vid_pgc.h similarity index 100% rename from src/video/vid_pgc.h rename to src/include/86box/vid_pgc.h diff --git a/src/video/vid_pgc_palette.h b/src/include/86box/vid_pgc_palette.h similarity index 100% rename from src/video/vid_pgc_palette.h rename to src/include/86box/vid_pgc_palette.h diff --git a/src/video/vid_svga.h b/src/include/86box/vid_svga.h similarity index 100% rename from src/video/vid_svga.h rename to src/include/86box/vid_svga.h diff --git a/src/video/vid_svga_render.h b/src/include/86box/vid_svga_render.h similarity index 100% rename from src/video/vid_svga_render.h rename to src/include/86box/vid_svga_render.h diff --git a/src/video/vid_voodoo_codegen_x86-64.h b/src/include/86box/vid_voodoo_codegen_x86-64.h similarity index 100% rename from src/video/vid_voodoo_codegen_x86-64.h rename to src/include/86box/vid_voodoo_codegen_x86-64.h diff --git a/src/video/vid_voodoo_codegen_x86.h b/src/include/86box/vid_voodoo_codegen_x86.h similarity index 100% rename from src/video/vid_voodoo_codegen_x86.h rename to src/include/86box/vid_voodoo_codegen_x86.h diff --git a/src/video/vid_voodoo_dither.h b/src/include/86box/vid_voodoo_dither.h similarity index 100% rename from src/video/vid_voodoo_dither.h rename to src/include/86box/vid_voodoo_dither.h diff --git a/src/video/video.h b/src/include/86box/video.h similarity index 100% rename from src/video/video.h rename to src/include/86box/video.h diff --git a/src/vnc.h b/src/include/86box/vnc.h similarity index 100% rename from src/vnc.h rename to src/include/86box/vnc.h diff --git a/src/win/win.h b/src/include/86box/win.h similarity index 100% rename from src/win/win.h rename to src/include/86box/win.h diff --git a/src/win/win_d2d.h b/src/include/86box/win_d2d.h similarity index 100% rename from src/win/win_d2d.h rename to src/include/86box/win_d2d.h diff --git a/src/win/win_discord.h b/src/include/86box/win_discord.h similarity index 100% rename from src/win/win_discord.h rename to src/include/86box/win_discord.h diff --git a/src/win/win_sdl.h b/src/include/86box/win_sdl.h similarity index 100% rename from src/win/win_sdl.h rename to src/include/86box/win_sdl.h diff --git a/src/disk/zip.h b/src/include/86box/zip.h similarity index 100% rename from src/disk/zip.h rename to src/include/86box/zip.h diff --git a/src/win/discord_game_sdk.h b/src/include/discord_game_sdk.h similarity index 100% rename from src/win/discord_game_sdk.h rename to src/include/discord_game_sdk.h diff --git a/src/floppy/fdi2raw.h b/src/include/fdi2raw.h similarity index 100% rename from src/floppy/fdi2raw.h rename to src/include/fdi2raw.h diff --git a/src/include/lzf.h b/src/include/lzf.h new file mode 100644 index 000000000..919b6e6be --- /dev/null +++ b/src/include/lzf.h @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2000-2008 Marc Alexander Lehmann + * + * Redistribution and use in source and binary forms, with or without modifica- + * tion, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MER- + * CHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO + * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPE- + * CIAL, 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 OTH- + * ERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License ("GPL") version 2 or any later version, + * in which case the provisions of the GPL are applicable instead of + * the above. If you wish to allow the use of your version of this file + * only under the terms of the GPL and not to allow others to use your + * version of this file under the BSD license, indicate your decision + * by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL. If you do not delete the + * provisions above, a recipient may use your version of this file under + * either the BSD or the GPL. + */ + +#ifndef LZF_H +#define LZF_H + +/*********************************************************************** +** +** lzf -- an extremely fast/free compression/decompression-method +** http://liblzf.plan9.de/ +** +** This algorithm is believed to be patent-free. +** +***********************************************************************/ + +#define LZF_VERSION 0x0105 /* 1.5, API version */ + +/* + * Compress in_len bytes stored at the memory block starting at + * in_data and write the result to out_data, up to a maximum length + * of out_len bytes. + * + * If the output buffer is not large enough or any error occurs return 0, + * otherwise return the number of bytes used, which might be considerably + * more than in_len (but less than 104% of the original size), so it + * makes sense to always use out_len == in_len - 1), to ensure _some_ + * compression, and store the data uncompressed otherwise (with a flag, of + * course. + * + * lzf_compress might use different algorithms on different systems and + * even different runs, thus might result in different compressed strings + * depending on the phase of the moon or similar factors. However, all + * these strings are architecture-independent and will result in the + * original data when decompressed using lzf_decompress. + * + * The buffers must not be overlapping. + * + * If the option LZF_STATE_ARG is enabled, an extra argument must be + * supplied which is not reflected in this header file. Refer to lzfP.h + * and lzf_c.c. + * + */ +unsigned int +lzf_compress (const void *const in_data, unsigned int in_len, + void *out_data, unsigned int out_len); + +/* + * Decompress data compressed with some version of the lzf_compress + * function and stored at location in_data and length in_len. The result + * will be stored at out_data up to a maximum of out_len characters. + * + * If the output buffer is not large enough to hold the decompressed + * data, a 0 is returned and errno is set to E2BIG. Otherwise the number + * of decompressed bytes (i.e. the original length of the data) is + * returned. + * + * If an error in the compressed data is detected, a zero is returned and + * errno is set to EINVAL. + * + * This function is very fast, about as fast as a copying loop. + */ +unsigned int +lzf_decompress (const void *const in_data, unsigned int in_len, + void *out_data, unsigned int out_len); + +#endif + diff --git a/src/include/mt32emu/Enumerations.h b/src/include/mt32emu/Enumerations.h new file mode 100644 index 000000000..bb580ca5b --- /dev/null +++ b/src/include/mt32emu/Enumerations.h @@ -0,0 +1,187 @@ +/* Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009 Dean Beeler, Jerome Fisher + * Copyright (C) 2011-2017 Dean Beeler, Jerome Fisher, Sergey V. Mikayev + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 2.1 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +/* Using two guards since this file may be included twice with different MT32EMU_C_ENUMERATIONS define. */ + +#if (!defined MT32EMU_CPP_ENUMERATIONS_H && !defined MT32EMU_C_ENUMERATIONS) || (!defined MT32EMU_C_ENUMERATIONS_H && defined MT32EMU_C_ENUMERATIONS) + +#ifdef MT32EMU_C_ENUMERATIONS + +#define MT32EMU_C_ENUMERATIONS_H + +#define MT32EMU_DAC_INPUT_MODE_NAME mt32emu_dac_input_mode +#define MT32EMU_DAC_INPUT_MODE(ident) MT32EMU_DAC_##ident + +#define MT32EMU_MIDI_DELAY_MODE_NAME mt32emu_midi_delay_mode +#define MT32EMU_MIDI_DELAY_MODE(ident) MT32EMU_MDM_##ident + +#define MT32EMU_ANALOG_OUTPUT_MODE_NAME mt32emu_analog_output_mode +#define MT32EMU_ANALOG_OUTPUT_MODE(ident) MT32EMU_AOM_##ident + +#define MT32EMU_PARTIAL_STATE_NAME mt32emu_partial_state +#define MT32EMU_PARTIAL_STATE(ident) MT32EMU_PS_##ident + +#define MT32EMU_SAMPLERATE_CONVERSION_QUALITY_NAME mt32emu_samplerate_conversion_quality +#define MT32EMU_SAMPLERATE_CONVERSION_QUALITY(ident) MT32EMU_SRCQ_##ident + +#define MT32EMU_RENDERER_TYPE_NAME mt32emu_renderer_type +#define MT32EMU_RENDERER_TYPE(ident) MT32EMU_RT_##ident + +#else /* #ifdef MT32EMU_C_ENUMERATIONS */ + +#define MT32EMU_CPP_ENUMERATIONS_H + +#define MT32EMU_DAC_INPUT_MODE_NAME DACInputMode +#define MT32EMU_DAC_INPUT_MODE(ident) DACInputMode_##ident + +#define MT32EMU_MIDI_DELAY_MODE_NAME MIDIDelayMode +#define MT32EMU_MIDI_DELAY_MODE(ident) MIDIDelayMode_##ident + +#define MT32EMU_ANALOG_OUTPUT_MODE_NAME AnalogOutputMode +#define MT32EMU_ANALOG_OUTPUT_MODE(ident) AnalogOutputMode_##ident + +#define MT32EMU_PARTIAL_STATE_NAME PartialState +#define MT32EMU_PARTIAL_STATE(ident) PartialState_##ident + +#define MT32EMU_SAMPLERATE_CONVERSION_QUALITY_NAME SamplerateConversionQuality +#define MT32EMU_SAMPLERATE_CONVERSION_QUALITY(ident) SamplerateConversionQuality_##ident + +#define MT32EMU_RENDERER_TYPE_NAME RendererType +#define MT32EMU_RENDERER_TYPE(ident) RendererType_##ident + +namespace MT32Emu { + +#endif /* #ifdef MT32EMU_C_ENUMERATIONS */ + +/** + * Methods for emulating the connection between the LA32 and the DAC, which involves + * some hacks in the real devices for doubling the volume. + * See also http://en.wikipedia.org/wiki/Roland_MT-32#Digital_overflow + */ +enum MT32EMU_DAC_INPUT_MODE_NAME { + /** + * Produces samples at double the volume, without tricks. + * Nicer overdrive characteristics than the DAC hacks (it simply clips samples within range) + * Higher quality than the real devices + */ + MT32EMU_DAC_INPUT_MODE(NICE), + + /** + * Produces samples that exactly match the bits output from the emulated LA32. + * Nicer overdrive characteristics than the DAC hacks (it simply clips samples within range) + * Much less likely to overdrive than any other mode. + * Half the volume of any of the other modes. + * Perfect for developers while debugging :) + */ + MT32EMU_DAC_INPUT_MODE(PURE), + + /** + * Re-orders the LA32 output bits as in early generation MT-32s (according to Wikipedia). + * Bit order at DAC (where each number represents the original LA32 output bit number, and XX means the bit is always low): + * 15 13 12 11 10 09 08 07 06 05 04 03 02 01 00 XX + */ + MT32EMU_DAC_INPUT_MODE(GENERATION1), + + /** + * Re-orders the LA32 output bits as in later generations (personally confirmed on my CM-32L - KG). + * Bit order at DAC (where each number represents the original LA32 output bit number): + * 15 13 12 11 10 09 08 07 06 05 04 03 02 01 00 14 + */ + MT32EMU_DAC_INPUT_MODE(GENERATION2) +}; + +/** Methods for emulating the effective delay of incoming MIDI messages introduced by a MIDI interface. */ +enum MT32EMU_MIDI_DELAY_MODE_NAME { + /** Process incoming MIDI events immediately. */ + MT32EMU_MIDI_DELAY_MODE(IMMEDIATE), + + /** + * Delay incoming short MIDI messages as if they where transferred via a MIDI cable to a real hardware unit and immediate sysex processing. + * This ensures more accurate timing of simultaneous NoteOn messages. + */ + MT32EMU_MIDI_DELAY_MODE(DELAY_SHORT_MESSAGES_ONLY), + + /** Delay all incoming MIDI events as if they where transferred via a MIDI cable to a real hardware unit.*/ + MT32EMU_MIDI_DELAY_MODE(DELAY_ALL) +}; + +/** Methods for emulating the effects of analogue circuits of real hardware units on the output signal. */ +enum MT32EMU_ANALOG_OUTPUT_MODE_NAME { + /** Only digital path is emulated. The output samples correspond to the digital signal at the DAC entrance. */ + MT32EMU_ANALOG_OUTPUT_MODE(DIGITAL_ONLY), + /** Coarse emulation of LPF circuit. High frequencies are boosted, sample rate remains unchanged. */ + MT32EMU_ANALOG_OUTPUT_MODE(COARSE), + /** + * Finer emulation of LPF circuit. Output signal is upsampled to 48 kHz to allow emulation of audible mirror spectra above 16 kHz, + * which is passed through the LPF circuit without significant attenuation. + */ + MT32EMU_ANALOG_OUTPUT_MODE(ACCURATE), + /** + * Same as AnalogOutputMode_ACCURATE mode but the output signal is 2x oversampled, i.e. the output sample rate is 96 kHz. + * This makes subsequent resampling easier. Besides, due to nonlinear passband of the LPF emulated, it takes fewer number of MACs + * compared to a regular LPF FIR implementations. + */ + MT32EMU_ANALOG_OUTPUT_MODE(OVERSAMPLED) +}; + +enum MT32EMU_PARTIAL_STATE_NAME { + MT32EMU_PARTIAL_STATE(INACTIVE), + MT32EMU_PARTIAL_STATE(ATTACK), + MT32EMU_PARTIAL_STATE(SUSTAIN), + MT32EMU_PARTIAL_STATE(RELEASE) +}; + +enum MT32EMU_SAMPLERATE_CONVERSION_QUALITY_NAME { + /** Use this only when the speed is more important than the audio quality. */ + MT32EMU_SAMPLERATE_CONVERSION_QUALITY(FASTEST), + MT32EMU_SAMPLERATE_CONVERSION_QUALITY(FAST), + MT32EMU_SAMPLERATE_CONVERSION_QUALITY(GOOD), + MT32EMU_SAMPLERATE_CONVERSION_QUALITY(BEST) +}; + +enum MT32EMU_RENDERER_TYPE_NAME { + /** Use 16-bit signed samples in the renderer and the accurate wave generator model based on logarithmic fixed-point computations and LUTs. Maximum emulation accuracy and speed. */ + MT32EMU_RENDERER_TYPE(BIT16S), + /** Use float samples in the renderer and simplified wave generator model. Maximum output quality and minimum noise. */ + MT32EMU_RENDERER_TYPE(FLOAT) +}; + +#ifndef MT32EMU_C_ENUMERATIONS + +} // namespace MT32Emu + +#endif + +#undef MT32EMU_DAC_INPUT_MODE_NAME +#undef MT32EMU_DAC_INPUT_MODE + +#undef MT32EMU_MIDI_DELAY_MODE_NAME +#undef MT32EMU_MIDI_DELAY_MODE + +#undef MT32EMU_ANALOG_OUTPUT_MODE_NAME +#undef MT32EMU_ANALOG_OUTPUT_MODE + +#undef MT32EMU_PARTIAL_STATE_NAME +#undef MT32EMU_PARTIAL_STATE + +#undef MT32EMU_SAMPLERATE_CONVERSION_QUALITY_NAME +#undef MT32EMU_SAMPLERATE_CONVERSION_QUALITY + +#undef MT32EMU_RENDERER_TYPE_NAME +#undef MT32EMU_RENDERER_TYPE + +#endif /* #if (!defined MT32EMU_CPP_ENUMERATIONS_H && !defined MT32EMU_C_ENUMERATIONS) || (!defined MT32EMU_C_ENUMERATIONS_H && defined MT32EMU_C_ENUMERATIONS) */ diff --git a/src/include/mt32emu/Types.h b/src/include/mt32emu/Types.h new file mode 100644 index 000000000..f70e4795c --- /dev/null +++ b/src/include/mt32emu/Types.h @@ -0,0 +1,32 @@ +/* Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009 Dean Beeler, Jerome Fisher + * Copyright (C) 2011-2017 Dean Beeler, Jerome Fisher, Sergey V. Mikayev + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 2.1 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#ifndef MT32EMU_TYPES_H +#define MT32EMU_TYPES_H + +namespace MT32Emu { + +typedef unsigned int Bit32u; +typedef signed int Bit32s; +typedef unsigned short int Bit16u; +typedef signed short int Bit16s; +typedef unsigned char Bit8u; +typedef signed char Bit8s; + +} + +#endif diff --git a/src/include/mt32emu/c_interface/c_interface.h b/src/include/mt32emu/c_interface/c_interface.h new file mode 100644 index 000000000..2ca3a3b04 --- /dev/null +++ b/src/include/mt32emu/c_interface/c_interface.h @@ -0,0 +1,434 @@ +/* Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009 Dean Beeler, Jerome Fisher + * Copyright (C) 2011-2017 Dean Beeler, Jerome Fisher, Sergey V. Mikayev + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 2.1 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#ifndef MT32EMU_C_INTERFACE_H +#define MT32EMU_C_INTERFACE_H + +#include + +#include "../globals.h" +#include "c_types.h" + +#undef MT32EMU_EXPORT +#define MT32EMU_EXPORT MT32EMU_EXPORT_ATTRIBUTE + +#ifdef __cplusplus +extern "C" { +#endif + +/* == Context-independent functions == */ + +/* === Interface handling === */ + +/** Returns mt32emu_service_i interface. */ +MT32EMU_EXPORT mt32emu_service_i mt32emu_get_service_i(); + +#if MT32EMU_EXPORTS_TYPE == 2 +#undef MT32EMU_EXPORT +#define MT32EMU_EXPORT +#endif + +/** + * Returns the version ID of mt32emu_report_handler_i interface the library has been compiled with. + * This allows a client to fall-back gracefully instead of silently not receiving expected event reports. + */ +MT32EMU_EXPORT mt32emu_report_handler_version mt32emu_get_supported_report_handler_version(); + +/** + * Returns the version ID of mt32emu_midi_receiver_version_i interface the library has been compiled with. + * This allows a client to fall-back gracefully instead of silently not receiving expected MIDI messages. + */ +MT32EMU_EXPORT mt32emu_midi_receiver_version mt32emu_get_supported_midi_receiver_version(); + +/** + * Returns library version as an integer in format: 0x00MMmmpp, where: + * MM - major version number + * mm - minor version number + * pp - patch number + */ +MT32EMU_EXPORT mt32emu_bit32u mt32emu_get_library_version_int(); + +/** + * Returns library version as a C-string in format: "MAJOR.MINOR.PATCH". + */ +MT32EMU_EXPORT const char *mt32emu_get_library_version_string(); + +/** + * Returns output sample rate used in emulation of stereo analog circuitry of hardware units for particular analog_output_mode. + * See comment for mt32emu_analog_output_mode. + */ +MT32EMU_EXPORT mt32emu_bit32u mt32emu_get_stereo_output_samplerate(const mt32emu_analog_output_mode analog_output_mode); + +/** + * Returns the value of analog_output_mode for which the output signal may retain its full frequency spectrum + * at the sample rate specified by the target_samplerate argument. + * See comment for mt32emu_analog_output_mode. + */ +MT32EMU_EXPORT mt32emu_analog_output_mode mt32emu_get_best_analog_output_mode(const double target_samplerate); + +/* == Context-dependent functions == */ + +/** Initialises a new emulation context and installs custom report handler if non-NULL. */ +MT32EMU_EXPORT mt32emu_context mt32emu_create_context(mt32emu_report_handler_i report_handler, void *instance_data); + +/** Closes and destroys emulation context. */ +MT32EMU_EXPORT void mt32emu_free_context(mt32emu_context context); + +/** + * Adds new ROM identified by its SHA1 digest to the emulation context replacing previously added ROM of the same type if any. + * Argument sha1_digest can be NULL, in this case the digest will be computed using the actual ROM data. + * If sha1_digest is set to non-NULL, it is assumed being correct and will not be recomputed. + * This function doesn't immediately change the state of already opened synth. Newly added ROM will take effect upon next call of mt32emu_open_synth(). + * Returns positive value upon success. + */ +MT32EMU_EXPORT mt32emu_return_code mt32emu_add_rom_data(mt32emu_context context, const mt32emu_bit8u *data, size_t data_size, const mt32emu_sha1_digest *sha1_digest); + +/** + * Loads a ROM file, identify it by SHA1 digest, and adds it to the emulation context replacing previously added ROM of the same type if any. + * This function doesn't immediately change the state of already opened synth. Newly added ROM will take effect upon next call of mt32emu_open_synth(). + * Returns positive value upon success. + */ +MT32EMU_EXPORT mt32emu_return_code mt32emu_add_rom_file(mt32emu_context context, const char *filename); + +/** + * Fills in mt32emu_rom_info structure with identifiers and descriptions of control and PCM ROM files identified and added to the synth context. + * If one of the ROM files is not loaded and identified yet, NULL is returned in the corresponding fields of the mt32emu_rom_info structure. + */ +MT32EMU_EXPORT void mt32emu_get_rom_info(mt32emu_const_context context, mt32emu_rom_info *rom_info); + +/** + * Allows to override the default maximum number of partials playing simultaneously within the emulation session. + * This function doesn't immediately change the state of already opened synth. Newly set value will take effect upon next call of mt32emu_open_synth(). + */ +MT32EMU_EXPORT void mt32emu_set_partial_count(mt32emu_context context, const mt32emu_bit32u partial_count); + +/** + * Allows to override the default mode for emulation of analogue circuitry of the hardware units within the emulation session. + * This function doesn't immediately change the state of already opened synth. Newly set value will take effect upon next call of mt32emu_open_synth(). + */ +MT32EMU_EXPORT void mt32emu_set_analog_output_mode(mt32emu_context context, const mt32emu_analog_output_mode analog_output_mode); + +/** + * Allows to convert the synthesiser output to any desired sample rate. The samplerate conversion + * processes the completely mixed stereo output signal as it passes the analogue circuit emulation, + * so emulating the synthesiser output signal passing further through an ADC. When the samplerate + * argument is set to 0, the default output sample rate is used which depends on the current + * mode of analog circuitry emulation. See mt32emu_analog_output_mode. + * This function doesn't immediately change the state of already opened synth. + * Newly set value will take effect upon next call of mt32emu_open_synth(). + */ +MT32EMU_EXPORT void mt32emu_set_stereo_output_samplerate(mt32emu_context context, const double samplerate); + +/** + * Several samplerate conversion quality options are provided which allow to trade-off the conversion speed vs. + * the retained passband width. All the options except FASTEST guarantee full suppression of the aliasing noise + * in terms of the 16-bit integer samples. + * This function doesn't immediately change the state of already opened synth. + * Newly set value will take effect upon next call of mt32emu_open_synth(). + */ +MT32EMU_EXPORT void mt32emu_set_samplerate_conversion_quality(mt32emu_context context, const mt32emu_samplerate_conversion_quality quality); + +/** + * Selects new type of the wave generator and renderer to be used during subsequent calls to mt32emu_open_synth(). + * By default, MT32EMU_RT_BIT16S is selected. + * See mt32emu_renderer_type for details. + */ +MT32EMU_EXPORT void mt32emu_select_renderer_type(mt32emu_context context, const mt32emu_renderer_type renderer_type); + +/** + * Returns previously selected type of the wave generator and renderer. + * See mt32emu_renderer_type for details. + */ +MT32EMU_EXPORT mt32emu_renderer_type mt32emu_get_selected_renderer_type(mt32emu_context context); + +/** + * Prepares the emulation context to receive MIDI messages and produce output audio data using aforehand added set of ROMs, + * and optionally set the maximum partial count and the analog output mode. + * Returns MT32EMU_RC_OK upon success. + */ +MT32EMU_EXPORT mt32emu_return_code mt32emu_open_synth(mt32emu_const_context context); + +/** Closes the emulation context freeing allocated resources. Added ROMs remain unaffected and ready for reuse. */ +MT32EMU_EXPORT void mt32emu_close_synth(mt32emu_const_context context); + +/** Returns true if the synth is in completely initialized state, otherwise returns false. */ +MT32EMU_EXPORT mt32emu_boolean mt32emu_is_open(mt32emu_const_context context); + +/** + * Returns actual sample rate of the fully processed output stereo signal. + * If samplerate conversion is used (i.e. when mt32emu_set_stereo_output_samplerate() has been invoked with a non-zero value), + * the returned value is the desired output samplerate rounded down to the closest integer. + * Otherwise, the output samplerate is choosen depending on the emulation mode of stereo analog circuitry of hardware units. + * See comment for mt32emu_analog_output_mode for more info. + */ +MT32EMU_EXPORT mt32emu_bit32u mt32emu_get_actual_stereo_output_samplerate(mt32emu_const_context context); + +/** + * Returns the number of samples produced at the internal synth sample rate (32000 Hz) + * that correspond to the given number of samples at the output sample rate. + * Intended to facilitate audio time synchronisation. + */ +MT32EMU_EXPORT mt32emu_bit32u mt32emu_convert_output_to_synth_timestamp(mt32emu_const_context context, mt32emu_bit32u output_timestamp); + +/** + * Returns the number of samples produced at the output sample rate + * that correspond to the given number of samples at the internal synth sample rate (32000 Hz). + * Intended to facilitate audio time synchronisation. + */ +MT32EMU_EXPORT mt32emu_bit32u mt32emu_convert_synth_to_output_timestamp(mt32emu_const_context context, mt32emu_bit32u synth_timestamp); + +/** All the enqueued events are processed by the synth immediately. */ +MT32EMU_EXPORT void mt32emu_flush_midi_queue(mt32emu_const_context context); + +/** + * Sets size of the internal MIDI event queue. The queue size is set to the minimum power of 2 that is greater or equal to the size specified. + * The queue is flushed before reallocation. + * Returns the actual queue size being used. + */ +MT32EMU_EXPORT mt32emu_bit32u mt32emu_set_midi_event_queue_size(mt32emu_const_context context, const mt32emu_bit32u queue_size); + +/** + * Installs custom MIDI receiver object intended for receiving MIDI messages generated by MIDI stream parser. + * MIDI stream parser is involved when functions mt32emu_parse_stream() and mt32emu_play_short_message() or the likes are called. + * By default, parsed short MIDI messages and System Exclusive messages are sent to the synth input MIDI queue. + * This function allows to override default behaviour. If midi_receiver argument is set to NULL, the default behaviour is restored. + */ +MT32EMU_EXPORT void mt32emu_set_midi_receiver(mt32emu_context context, mt32emu_midi_receiver_i midi_receiver, void *instance_data); + +/** + * Returns current value of the global counter of samples rendered since the synth was created (at the native sample rate 32000 Hz). + * This method helps to compute accurate timestamp of a MIDI message to use with the methods below. + */ +MT32EMU_EXPORT mt32emu_bit32u mt32emu_get_internal_rendered_sample_count(mt32emu_const_context context); + +/* Enqueues a MIDI event for subsequent playback. + * The MIDI event will be processed not before the specified timestamp. + * The timestamp is measured as the global rendered sample count since the synth was created (at the native sample rate 32000 Hz). + * The minimum delay involves emulation of the delay introduced while the event is transferred via MIDI interface + * and emulation of the MCU busy-loop while it frees partials for use by a new Poly. + * Calls from multiple threads must be synchronised, although, no synchronisation is required with the rendering thread. + * onMIDIQueueOverflow callback is invoked when the MIDI event queue is full and the message cannot be enqueued. + */ + +/** + * Parses a block of raw MIDI bytes and enqueues parsed MIDI messages for further processing ASAP. + * SysEx messages are allowed to be fragmented across several calls to this method. Running status is also handled for short messages. + * When a System Realtime MIDI message is parsed, onMIDISystemRealtime callback is invoked. + * NOTE: the total length of a SysEx message being fragmented shall not exceed MT32EMU_MAX_STREAM_BUFFER_SIZE (32768 bytes). + */ +MT32EMU_EXPORT void mt32emu_parse_stream(mt32emu_const_context context, const mt32emu_bit8u *stream, mt32emu_bit32u length); + +/** + * Parses a block of raw MIDI bytes and enqueues parsed MIDI messages to play at specified time. + * SysEx messages are allowed to be fragmented across several calls to this method. Running status is also handled for short messages. + * When a System Realtime MIDI message is parsed, onMIDISystemRealtime callback is invoked. + * NOTE: the total length of a SysEx message being fragmented shall not exceed MT32EMU_MAX_STREAM_BUFFER_SIZE (32768 bytes). + */ +MT32EMU_EXPORT void mt32emu_parse_stream_at(mt32emu_const_context context, const mt32emu_bit8u *stream, mt32emu_bit32u length, mt32emu_bit32u timestamp); + +/** + * Enqueues a single mt32emu_bit32u-encoded short MIDI message with full processing ASAP. + * The short MIDI message may contain no status byte, the running status is used in this case. + * When the argument is a System Realtime MIDI message, onMIDISystemRealtime callback is invoked. + */ +MT32EMU_EXPORT void mt32emu_play_short_message(mt32emu_const_context context, mt32emu_bit32u message); + +/** + * Enqueues a single mt32emu_bit32u-encoded short MIDI message to play at specified time with full processing. + * The short MIDI message may contain no status byte, the running status is used in this case. + * When the argument is a System Realtime MIDI message, onMIDISystemRealtime callback is invoked. + */ +MT32EMU_EXPORT void mt32emu_play_short_message_at(mt32emu_const_context context, mt32emu_bit32u message, mt32emu_bit32u timestamp); + +/** Enqueues a single short MIDI message to be processed ASAP. The message must contain a status byte. */ +MT32EMU_EXPORT mt32emu_return_code mt32emu_play_msg(mt32emu_const_context context, mt32emu_bit32u msg); +/** Enqueues a single well formed System Exclusive MIDI message to be processed ASAP. */ +MT32EMU_EXPORT mt32emu_return_code mt32emu_play_sysex(mt32emu_const_context context, const mt32emu_bit8u *sysex, mt32emu_bit32u len); + +/** Enqueues a single short MIDI message to play at specified time. The message must contain a status byte. */ +MT32EMU_EXPORT mt32emu_return_code mt32emu_play_msg_at(mt32emu_const_context context, mt32emu_bit32u msg, mt32emu_bit32u timestamp); +/** Enqueues a single well formed System Exclusive MIDI message to play at specified time. */ +MT32EMU_EXPORT mt32emu_return_code mt32emu_play_sysex_at(mt32emu_const_context context, const mt32emu_bit8u *sysex, mt32emu_bit32u len, mt32emu_bit32u timestamp); + +/* WARNING: + * The methods below don't ensure minimum 1-sample delay between sequential MIDI events, + * and a sequence of NoteOn and immediately succeeding NoteOff messages is always silent. + * A thread that invokes these methods must be explicitly synchronised with the thread performing sample rendering. + */ + +/** + * Sends a short MIDI message to the synth for immediate playback. The message must contain a status byte. + * See the WARNING above. + */ +MT32EMU_EXPORT void mt32emu_play_msg_now(mt32emu_const_context context, mt32emu_bit32u msg); +/** + * Sends unpacked short MIDI message to the synth for immediate playback. The message must contain a status byte. + * See the WARNING above. + */ +MT32EMU_EXPORT void mt32emu_play_msg_on_part(mt32emu_const_context context, mt32emu_bit8u part, mt32emu_bit8u code, mt32emu_bit8u note, mt32emu_bit8u velocity); + +/** + * Sends a single well formed System Exclusive MIDI message for immediate processing. The length is in bytes. + * See the WARNING above. + */ +MT32EMU_EXPORT void mt32emu_play_sysex_now(mt32emu_const_context context, const mt32emu_bit8u *sysex, mt32emu_bit32u len); +/** + * Sends inner body of a System Exclusive MIDI message for direct processing. The length is in bytes. + * See the WARNING above. + */ +MT32EMU_EXPORT void mt32emu_write_sysex(mt32emu_const_context context, mt32emu_bit8u channel, const mt32emu_bit8u *sysex, mt32emu_bit32u len); + +/** Allows to disable wet reverb output altogether. */ +MT32EMU_EXPORT void mt32emu_set_reverb_enabled(mt32emu_const_context context, const mt32emu_boolean reverb_enabled); +/** Returns whether wet reverb output is enabled. */ +MT32EMU_EXPORT mt32emu_boolean mt32emu_is_reverb_enabled(mt32emu_const_context context); +/** + * Sets override reverb mode. In this mode, emulation ignores sysexes (or the related part of them) which control the reverb parameters. + * This mode is in effect until it is turned off. When the synth is re-opened, the override mode is unchanged but the state + * of the reverb model is reset to default. + */ +MT32EMU_EXPORT void mt32emu_set_reverb_overridden(mt32emu_const_context context, const mt32emu_boolean reverb_overridden); +/** Returns whether reverb settings are overridden. */ +MT32EMU_EXPORT mt32emu_boolean mt32emu_is_reverb_overridden(mt32emu_const_context context); +/** + * Forces reverb model compatibility mode. By default, the compatibility mode corresponds to the used control ROM version. + * Invoking this method with the argument set to true forces emulation of old MT-32 reverb circuit. + * When the argument is false, emulation of the reverb circuit used in new generation of MT-32 compatible modules is enforced + * (these include CM-32L and LAPC-I). + */ +MT32EMU_EXPORT void mt32emu_set_reverb_compatibility_mode(mt32emu_const_context context, const mt32emu_boolean mt32_compatible_mode); +/** Returns whether reverb is in old MT-32 compatibility mode. */ +MT32EMU_EXPORT mt32emu_boolean mt32emu_is_mt32_reverb_compatibility_mode(mt32emu_const_context context); +/** Returns whether default reverb compatibility mode is the old MT-32 compatibility mode. */ +MT32EMU_EXPORT mt32emu_boolean mt32emu_is_default_reverb_mt32_compatible(mt32emu_const_context context); + +/** Sets new DAC input mode. See mt32emu_dac_input_mode for details. */ +MT32EMU_EXPORT void mt32emu_set_dac_input_mode(mt32emu_const_context context, const mt32emu_dac_input_mode mode); +/** Returns current DAC input mode. See mt32emu_dac_input_mode for details. */ +MT32EMU_EXPORT mt32emu_dac_input_mode mt32emu_get_dac_input_mode(mt32emu_const_context context); + +/** Sets new MIDI delay mode. See mt32emu_midi_delay_mode for details. */ +MT32EMU_EXPORT void mt32emu_set_midi_delay_mode(mt32emu_const_context context, const mt32emu_midi_delay_mode mode); +/** Returns current MIDI delay mode. See mt32emu_midi_delay_mode for details. */ +MT32EMU_EXPORT mt32emu_midi_delay_mode mt32emu_get_midi_delay_mode(mt32emu_const_context context); + +/** + * Sets output gain factor for synth output channels. Applied to all output samples and unrelated with the synth's Master volume, + * it rather corresponds to the gain of the output analog circuitry of the hardware units. However, together with mt32emu_set_reverb_output_gain() + * it offers to the user a capability to control the gain of reverb and non-reverb output channels independently. + */ +MT32EMU_EXPORT void mt32emu_set_output_gain(mt32emu_const_context context, float gain); +/** Returns current output gain factor for synth output channels. */ +MT32EMU_EXPORT float mt32emu_get_output_gain(mt32emu_const_context context); + +/** + * Sets output gain factor for the reverb wet output channels. It rather corresponds to the gain of the output + * analog circuitry of the hardware units. However, together with mt32emu_set_output_gain() it offers to the user a capability + * to control the gain of reverb and non-reverb output channels independently. + * + * Note: We're currently emulate CM-32L/CM-64 reverb quite accurately and the reverb output level closely + * corresponds to the level of digital capture. Although, according to the CM-64 PCB schematic, + * there is a difference in the reverb analogue circuit, and the resulting output gain is 0.68 + * of that for LA32 analogue output. This factor is applied to the reverb output gain. + */ +MT32EMU_EXPORT void mt32emu_set_reverb_output_gain(mt32emu_const_context context, float gain); +/** Returns current output gain factor for reverb wet output channels. */ +MT32EMU_EXPORT float mt32emu_get_reverb_output_gain(mt32emu_const_context context); + +/** Swaps left and right output channels. */ +MT32EMU_EXPORT void mt32emu_set_reversed_stereo_enabled(mt32emu_const_context context, const mt32emu_boolean enabled); +/** Returns whether left and right output channels are swapped. */ +MT32EMU_EXPORT mt32emu_boolean mt32emu_is_reversed_stereo_enabled(mt32emu_const_context context); + +/** + * Allows to toggle the NiceAmpRamp mode. + * In this mode, we want to ensure that amp ramp never jumps to the target + * value and always gradually increases or decreases. It seems that real units + * do not bother to always check if a newly started ramp leads to a jump. + * We also prefer the quality improvement over the emulation accuracy, + * so this mode is enabled by default. + */ +MT32EMU_EXPORT void mt32emu_set_nice_amp_ramp_enabled(mt32emu_const_context context, const mt32emu_boolean enabled); +/** Returns whether NiceAmpRamp mode is enabled. */ +MT32EMU_EXPORT mt32emu_boolean mt32emu_is_nice_amp_ramp_enabled(mt32emu_const_context context); + +/** + * Renders samples to the specified output stream as if they were sampled at the analog stereo output at the desired sample rate. + * If the output sample rate is not specified explicitly, the default output sample rate is used which depends on the current + * mode of analog circuitry emulation. See mt32emu_analog_output_mode. + * The length is in frames, not bytes (in 16-bit stereo, one frame is 4 bytes). Uses NATIVE byte ordering. + */ +MT32EMU_EXPORT void mt32emu_render_bit16s(mt32emu_const_context context, mt32emu_bit16s *stream, mt32emu_bit32u len); +/** Same as above but outputs to a float stereo stream. */ +MT32EMU_EXPORT void mt32emu_render_float(mt32emu_const_context context, float *stream, mt32emu_bit32u len); + +/** + * Renders samples to the specified output streams as if they appeared at the DAC entrance. + * No further processing performed in analog circuitry emulation is applied to the signal. + * NULL may be specified in place of any or all of the stream buffers to skip it. + * The length is in samples, not bytes. Uses NATIVE byte ordering. + */ +MT32EMU_EXPORT void mt32emu_render_bit16s_streams(mt32emu_const_context context, const mt32emu_dac_output_bit16s_streams *streams, mt32emu_bit32u len); +/** Same as above but outputs to float streams. */ +MT32EMU_EXPORT void mt32emu_render_float_streams(mt32emu_const_context context, const mt32emu_dac_output_float_streams *streams, mt32emu_bit32u len); + +/** Returns true when there is at least one active partial, otherwise false. */ +MT32EMU_EXPORT mt32emu_boolean mt32emu_has_active_partials(mt32emu_const_context context); + +/** Returns true if mt32emu_has_active_partials() returns true, or reverb is (somewhat unreliably) detected as being active. */ +MT32EMU_EXPORT mt32emu_boolean mt32emu_is_active(mt32emu_const_context context); + +/** Returns the maximum number of partials playing simultaneously. */ +MT32EMU_EXPORT mt32emu_bit32u mt32emu_get_partial_count(mt32emu_const_context context); + +/** + * Returns current states of all the parts as a bit set. The least significant bit corresponds to the state of part 1, + * total of 9 bits hold the states of all the parts. If the returned bit for a part is set, there is at least one active + * non-releasing partial playing on this part. This info is useful in emulating behaviour of LCD display of the hardware units. + */ +MT32EMU_EXPORT mt32emu_bit32u mt32emu_get_part_states(mt32emu_const_context context); + +/** + * Fills in current states of all the partials into the array provided. Each byte in the array holds states of 4 partials + * starting from the least significant bits. The state of each partial is packed in a pair of bits. + * The array must be large enough to accommodate states of all the partials. + * @see getPartialCount() + */ +MT32EMU_EXPORT void mt32emu_get_partial_states(mt32emu_const_context context, mt32emu_bit8u *partial_states); + +/** + * Fills in information about currently playing notes on the specified part into the arrays provided. The arrays must be large enough + * to accommodate data for all the playing notes. The maximum number of simultaneously playing notes cannot exceed the number of partials. + * Argument partNumber should be 0..7 for Part 1..8, or 8 for Rhythm. + * Returns the number of currently playing notes on the specified part. + */ +MT32EMU_EXPORT mt32emu_bit32u mt32emu_get_playing_notes(mt32emu_const_context context, mt32emu_bit8u part_number, mt32emu_bit8u *keys, mt32emu_bit8u *velocities); + +/** + * Returns name of the patch set on the specified part. + * Argument partNumber should be 0..7 for Part 1..8, or 8 for Rhythm. + */ +MT32EMU_EXPORT const char *mt32emu_get_patch_name(mt32emu_const_context context, mt32emu_bit8u part_number); + +/** Stores internal state of emulated synth into an array provided (as it would be acquired from hardware). */ +MT32EMU_EXPORT void mt32emu_read_memory(mt32emu_const_context context, mt32emu_bit32u addr, mt32emu_bit32u len, mt32emu_bit8u *data); + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif /* #ifndef MT32EMU_C_INTERFACE_H */ diff --git a/src/include/mt32emu/c_interface/c_types.h b/src/include/mt32emu/c_interface/c_types.h new file mode 100644 index 000000000..db612e282 --- /dev/null +++ b/src/include/mt32emu/c_interface/c_types.h @@ -0,0 +1,336 @@ +/* Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009 Dean Beeler, Jerome Fisher + * Copyright (C) 2011-2017 Dean Beeler, Jerome Fisher, Sergey V. Mikayev + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 2.1 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#ifndef MT32EMU_C_TYPES_H +#define MT32EMU_C_TYPES_H + +#include +#include + +#include "../globals.h" + +#define MT32EMU_C_ENUMERATIONS +#include "../Enumerations.h" +#undef MT32EMU_C_ENUMERATIONS + +typedef unsigned int mt32emu_bit32u; +typedef signed int mt32emu_bit32s; +typedef unsigned short int mt32emu_bit16u; +typedef signed short int mt32emu_bit16s; +typedef unsigned char mt32emu_bit8u; +typedef signed char mt32emu_bit8s; + +typedef char mt32emu_sha1_digest[41]; + +typedef enum { + MT32EMU_BOOL_FALSE, MT32EMU_BOOL_TRUE +} mt32emu_boolean; + +typedef enum { + /* Operation completed normally. */ + MT32EMU_RC_OK = 0, + MT32EMU_RC_ADDED_CONTROL_ROM = 1, + MT32EMU_RC_ADDED_PCM_ROM = 2, + + /* Definite error occurred. */ + MT32EMU_RC_ROM_NOT_IDENTIFIED = -1, + MT32EMU_RC_FILE_NOT_FOUND = -2, + MT32EMU_RC_FILE_NOT_LOADED = -3, + MT32EMU_RC_MISSING_ROMS = -4, + MT32EMU_RC_NOT_OPENED = -5, + MT32EMU_RC_QUEUE_FULL = -6, + + /* Undefined error occurred. */ + MT32EMU_RC_FAILED = -100 +} mt32emu_return_code; + +/** Emulation context */ +typedef struct mt32emu_data *mt32emu_context; +typedef const struct mt32emu_data *mt32emu_const_context; + +/* Convenience aliases */ +#ifndef __cplusplus +typedef enum mt32emu_analog_output_mode mt32emu_analog_output_mode; +typedef enum mt32emu_dac_input_mode mt32emu_dac_input_mode; +typedef enum mt32emu_midi_delay_mode mt32emu_midi_delay_mode; +typedef enum mt32emu_partial_state mt32emu_partial_state; +typedef enum mt32emu_samplerate_conversion_quality mt32emu_samplerate_conversion_quality; +typedef enum mt32emu_renderer_type mt32emu_renderer_type; +#endif + +/** Contains identifiers and descriptions of ROM files being used. */ +typedef struct { + const char *control_rom_id; + const char *control_rom_description; + const char *control_rom_sha1_digest; + const char *pcm_rom_id; + const char *pcm_rom_description; + const char *pcm_rom_sha1_digest; +} mt32emu_rom_info; + +/** Set of multiplexed output bit16s streams appeared at the DAC entrance. */ +typedef struct { + mt32emu_bit16s *nonReverbLeft; + mt32emu_bit16s *nonReverbRight; + mt32emu_bit16s *reverbDryLeft; + mt32emu_bit16s *reverbDryRight; + mt32emu_bit16s *reverbWetLeft; + mt32emu_bit16s *reverbWetRight; +} mt32emu_dac_output_bit16s_streams; + +/** Set of multiplexed output float streams appeared at the DAC entrance. */ +typedef struct { + float *nonReverbLeft; + float *nonReverbRight; + float *reverbDryLeft; + float *reverbDryRight; + float *reverbWetLeft; + float *reverbWetRight; +} mt32emu_dac_output_float_streams; + +/* === Interface handling === */ + +/** Report handler interface versions */ +typedef enum { + MT32EMU_REPORT_HANDLER_VERSION_0 = 0, + MT32EMU_REPORT_HANDLER_VERSION_CURRENT = MT32EMU_REPORT_HANDLER_VERSION_0 +} mt32emu_report_handler_version; + +/** MIDI receiver interface versions */ +typedef enum { + MT32EMU_MIDI_RECEIVER_VERSION_0 = 0, + MT32EMU_MIDI_RECEIVER_VERSION_CURRENT = MT32EMU_MIDI_RECEIVER_VERSION_0 +} mt32emu_midi_receiver_version; + +/** Synth interface versions */ +typedef enum { + MT32EMU_SERVICE_VERSION_0 = 0, + MT32EMU_SERVICE_VERSION_1 = 1, + MT32EMU_SERVICE_VERSION_2 = 2, + MT32EMU_SERVICE_VERSION_CURRENT = MT32EMU_SERVICE_VERSION_2 +} mt32emu_service_version; + +/* === Report Handler Interface === */ + +typedef union mt32emu_report_handler_i mt32emu_report_handler_i; + +/** Interface for handling reported events (initial version) */ +typedef struct { + /** Returns the actual interface version ID */ + mt32emu_report_handler_version (*getVersionID)(mt32emu_report_handler_i i); + + /** Callback for debug messages, in vprintf() format */ + void (*printDebug)(void *instance_data, const char *fmt, va_list list); + /** Callbacks for reporting errors */ + void (*onErrorControlROM)(void *instance_data); + void (*onErrorPCMROM)(void *instance_data); + /** Callback for reporting about displaying a new custom message on LCD */ + void (*showLCDMessage)(void *instance_data, const char *message); + /** Callback for reporting actual processing of a MIDI message */ + void (*onMIDIMessagePlayed)(void *instance_data); + /** + * Callback for reporting an overflow of the input MIDI queue. + * Returns MT32EMU_BOOL_TRUE if a recovery action was taken + * and yet another attempt to enqueue the MIDI event is desired. + */ + mt32emu_boolean (*onMIDIQueueOverflow)(void *instance_data); + /** + * Callback invoked when a System Realtime MIDI message is detected in functions + * mt32emu_parse_stream and mt32emu_play_short_message and the likes. + */ + void (*onMIDISystemRealtime)(void *instance_data, mt32emu_bit8u system_realtime); + /** Callbacks for reporting system events */ + void (*onDeviceReset)(void *instance_data); + void (*onDeviceReconfig)(void *instance_data); + /** Callbacks for reporting changes of reverb settings */ + void (*onNewReverbMode)(void *instance_data, mt32emu_bit8u mode); + void (*onNewReverbTime)(void *instance_data, mt32emu_bit8u time); + void (*onNewReverbLevel)(void *instance_data, mt32emu_bit8u level); + /** Callbacks for reporting various information */ + void (*onPolyStateChanged)(void *instance_data, mt32emu_bit8u part_num); + void (*onProgramChanged)(void *instance_data, mt32emu_bit8u part_num, const char *sound_group_name, const char *patch_name); +} mt32emu_report_handler_i_v0; + +/** + * Extensible interface for handling reported events. + * Union intended to view an interface of any subsequent version as any parent interface not requiring a cast. + * It is caller's responsibility to check the actual interface version in runtime using the getVersionID() method. + */ +union mt32emu_report_handler_i { + const mt32emu_report_handler_i_v0 *v0; +}; + +/* === MIDI Receiver Interface === */ + +typedef union mt32emu_midi_receiver_i mt32emu_midi_receiver_i; + +/** Interface for receiving MIDI messages generated by MIDI stream parser (initial version) */ +typedef struct { + /** Returns the actual interface version ID */ + mt32emu_midi_receiver_version (*getVersionID)(mt32emu_midi_receiver_i i); + + /** Invoked when a complete short MIDI message is parsed in the input MIDI stream. */ + void (*handleShortMessage)(void *instance_data, const mt32emu_bit32u message); + + /** Invoked when a complete well-formed System Exclusive MIDI message is parsed in the input MIDI stream. */ + void (*handleSysex)(void *instance_data, const mt32emu_bit8u stream[], const mt32emu_bit32u length); + + /** Invoked when a System Realtime MIDI message is parsed in the input MIDI stream. */ + void (*handleSystemRealtimeMessage)(void *instance_data, const mt32emu_bit8u realtime); +} mt32emu_midi_receiver_i_v0; + +/** + * Extensible interface for receiving MIDI messages. + * Union intended to view an interface of any subsequent version as any parent interface not requiring a cast. + * It is caller's responsibility to check the actual interface version in runtime using the getVersionID() method. + */ +union mt32emu_midi_receiver_i { + const mt32emu_midi_receiver_i_v0 *v0; +}; + +/* === Service Interface === */ + +typedef union mt32emu_service_i mt32emu_service_i; + +/** + * Basic interface that defines all the library services (initial version). + * The members closely resemble C functions declared in c_interface.h, and the intention is to provide for easier + * access when the library is dynamically loaded in run-time, e.g. as a plugin. This way the client only needs + * to bind to mt32emu_get_service_i() function instead of binding to each function it needs to use. + * See c_interface.h for parameter description. + */ +#define MT32EMU_SERVICE_I_V0 \ + /** Returns the actual interface version ID */ \ + mt32emu_service_version (*getVersionID)(mt32emu_service_i i); \ + mt32emu_report_handler_version (*getSupportedReportHandlerVersionID)(); \ + mt32emu_midi_receiver_version (*getSupportedMIDIReceiverVersionID)(); \ +\ + mt32emu_bit32u (*getLibraryVersionInt)(); \ + const char *(*getLibraryVersionString)(); \ +\ + mt32emu_bit32u (*getStereoOutputSamplerate)(const mt32emu_analog_output_mode analog_output_mode); \ +\ + mt32emu_context (*createContext)(mt32emu_report_handler_i report_handler, void *instance_data); \ + void (*freeContext)(mt32emu_context context); \ + mt32emu_return_code (*addROMData)(mt32emu_context context, const mt32emu_bit8u *data, size_t data_size, const mt32emu_sha1_digest *sha1_digest); \ + mt32emu_return_code (*addROMFile)(mt32emu_context context, const char *filename); \ + void (*getROMInfo)(mt32emu_const_context context, mt32emu_rom_info *rom_info); \ + void (*setPartialCount)(mt32emu_context context, const mt32emu_bit32u partial_count); \ + void (*setAnalogOutputMode)(mt32emu_context context, const mt32emu_analog_output_mode analog_output_mode); \ + mt32emu_return_code (*openSynth)(mt32emu_const_context context); \ + void (*closeSynth)(mt32emu_const_context context); \ + mt32emu_boolean (*isOpen)(mt32emu_const_context context); \ + mt32emu_bit32u (*getActualStereoOutputSamplerate)(mt32emu_const_context context); \ + void (*flushMIDIQueue)(mt32emu_const_context context); \ + mt32emu_bit32u (*setMIDIEventQueueSize)(mt32emu_const_context context, const mt32emu_bit32u queue_size); \ + void (*setMIDIReceiver)(mt32emu_context context, mt32emu_midi_receiver_i midi_receiver, void *instance_data); \ +\ + void (*parseStream)(mt32emu_const_context context, const mt32emu_bit8u *stream, mt32emu_bit32u length); \ + void (*parseStream_At)(mt32emu_const_context context, const mt32emu_bit8u *stream, mt32emu_bit32u length, mt32emu_bit32u timestamp); \ + void (*playShortMessage)(mt32emu_const_context context, mt32emu_bit32u message); \ + void (*playShortMessageAt)(mt32emu_const_context context, mt32emu_bit32u message, mt32emu_bit32u timestamp); \ + mt32emu_return_code (*playMsg)(mt32emu_const_context context, mt32emu_bit32u msg); \ + mt32emu_return_code (*playSysex)(mt32emu_const_context context, const mt32emu_bit8u *sysex, mt32emu_bit32u len); \ + mt32emu_return_code (*playMsgAt)(mt32emu_const_context context, mt32emu_bit32u msg, mt32emu_bit32u timestamp); \ + mt32emu_return_code (*playSysexAt)(mt32emu_const_context context, const mt32emu_bit8u *sysex, mt32emu_bit32u len, mt32emu_bit32u timestamp); \ +\ + void (*playMsgNow)(mt32emu_const_context context, mt32emu_bit32u msg); \ + void (*playMsgOnPart)(mt32emu_const_context context, mt32emu_bit8u part, mt32emu_bit8u code, mt32emu_bit8u note, mt32emu_bit8u velocity); \ + void (*playSysexNow)(mt32emu_const_context context, const mt32emu_bit8u *sysex, mt32emu_bit32u len); \ + void (*writeSysex)(mt32emu_const_context context, mt32emu_bit8u channel, const mt32emu_bit8u *sysex, mt32emu_bit32u len); \ +\ + void (*setReverbEnabled)(mt32emu_const_context context, const mt32emu_boolean reverb_enabled); \ + mt32emu_boolean (*isReverbEnabled)(mt32emu_const_context context); \ + void (*setReverbOverridden)(mt32emu_const_context context, const mt32emu_boolean reverb_overridden); \ + mt32emu_boolean (*isReverbOverridden)(mt32emu_const_context context); \ + void (*setReverbCompatibilityMode)(mt32emu_const_context context, const mt32emu_boolean mt32_compatible_mode); \ + mt32emu_boolean (*isMT32ReverbCompatibilityMode)(mt32emu_const_context context); \ + mt32emu_boolean (*isDefaultReverbMT32Compatible)(mt32emu_const_context context); \ +\ + void (*setDACInputMode)(mt32emu_const_context context, const mt32emu_dac_input_mode mode); \ + mt32emu_dac_input_mode (*getDACInputMode)(mt32emu_const_context context); \ +\ + void (*setMIDIDelayMode)(mt32emu_const_context context, const mt32emu_midi_delay_mode mode); \ + mt32emu_midi_delay_mode (*getMIDIDelayMode)(mt32emu_const_context context); \ +\ + void (*setOutputGain)(mt32emu_const_context context, float gain); \ + float (*getOutputGain)(mt32emu_const_context context); \ + void (*setReverbOutputGain)(mt32emu_const_context context, float gain); \ + float (*getReverbOutputGain)(mt32emu_const_context context); \ +\ + void (*setReversedStereoEnabled)(mt32emu_const_context context, const mt32emu_boolean enabled); \ + mt32emu_boolean (*isReversedStereoEnabled)(mt32emu_const_context context); \ +\ + void (*renderBit16s)(mt32emu_const_context context, mt32emu_bit16s *stream, mt32emu_bit32u len); \ + void (*renderFloat)(mt32emu_const_context context, float *stream, mt32emu_bit32u len); \ + void (*renderBit16sStreams)(mt32emu_const_context context, const mt32emu_dac_output_bit16s_streams *streams, mt32emu_bit32u len); \ + void (*renderFloatStreams)(mt32emu_const_context context, const mt32emu_dac_output_float_streams *streams, mt32emu_bit32u len); \ +\ + mt32emu_boolean (*hasActivePartials)(mt32emu_const_context context); \ + mt32emu_boolean (*isActive)(mt32emu_const_context context); \ + mt32emu_bit32u (*getPartialCount)(mt32emu_const_context context); \ + mt32emu_bit32u (*getPartStates)(mt32emu_const_context context); \ + void (*getPartialStates)(mt32emu_const_context context, mt32emu_bit8u *partial_states); \ + mt32emu_bit32u (*getPlayingNotes)(mt32emu_const_context context, mt32emu_bit8u part_number, mt32emu_bit8u *keys, mt32emu_bit8u *velocities); \ + const char *(*getPatchName)(mt32emu_const_context context, mt32emu_bit8u part_number); \ + void (*readMemory)(mt32emu_const_context context, mt32emu_bit32u addr, mt32emu_bit32u len, mt32emu_bit8u *data); + +#define MT32EMU_SERVICE_I_V1 \ + mt32emu_analog_output_mode (*getBestAnalogOutputMode)(const double target_samplerate); \ + void (*setStereoOutputSampleRate)(mt32emu_context context, const double samplerate); \ + void (*setSamplerateConversionQuality)(mt32emu_context context, const mt32emu_samplerate_conversion_quality quality); \ + void (*selectRendererType)(mt32emu_context context, mt32emu_renderer_type renderer_type); \ + mt32emu_renderer_type (*getSelectedRendererType)(mt32emu_context context); \ + mt32emu_bit32u (*convertOutputToSynthTimestamp)(mt32emu_const_context context, mt32emu_bit32u output_timestamp); \ + mt32emu_bit32u (*convertSynthToOutputTimestamp)(mt32emu_const_context context, mt32emu_bit32u synth_timestamp); + +#define MT32EMU_SERVICE_I_V2 \ + mt32emu_bit32u (*getInternalRenderedSampleCount)(mt32emu_const_context context); \ + void (*setNiceAmpRampEnabled)(mt32emu_const_context context, const mt32emu_boolean enabled); \ + mt32emu_boolean (*isNiceAmpRampEnabled)(mt32emu_const_context context); + +typedef struct { + MT32EMU_SERVICE_I_V0 +} mt32emu_service_i_v0; + +typedef struct { + MT32EMU_SERVICE_I_V0 + MT32EMU_SERVICE_I_V1 +} mt32emu_service_i_v1; + +typedef struct { + MT32EMU_SERVICE_I_V0 + MT32EMU_SERVICE_I_V1 + MT32EMU_SERVICE_I_V2 +} mt32emu_service_i_v2; + +/** + * Extensible interface for all the library services. + * Union intended to view an interface of any subsequent version as any parent interface not requiring a cast. + * It is caller's responsibility to check the actual interface version in runtime using the getVersionID() method. + */ +union mt32emu_service_i { + const mt32emu_service_i_v0 *v0; + const mt32emu_service_i_v1 *v1; + const mt32emu_service_i_v2 *v2; +}; + +#undef MT32EMU_SERVICE_I_V0 +#undef MT32EMU_SERVICE_I_V1 +#undef MT32EMU_SERVICE_I_V2 + +#endif /* #ifndef MT32EMU_C_TYPES_H */ diff --git a/src/include/mt32emu/c_interface/cpp_interface.h b/src/include/mt32emu/c_interface/cpp_interface.h new file mode 100644 index 000000000..3b02c0325 --- /dev/null +++ b/src/include/mt32emu/c_interface/cpp_interface.h @@ -0,0 +1,479 @@ +/* Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009 Dean Beeler, Jerome Fisher + * Copyright (C) 2011-2017 Dean Beeler, Jerome Fisher, Sergey V. Mikayev + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 2.1 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#ifndef MT32EMU_CPP_INTERFACE_H +#define MT32EMU_CPP_INTERFACE_H + +#include + +#include "../globals.h" +#include "c_types.h" + +#include "../Types.h" +#include "../Enumerations.h" + +#if MT32EMU_API_TYPE == 2 + +extern "C" { + +/** Returns mt32emu_service_i interface. */ +mt32emu_service_i mt32emu_get_service_i(); + +} + +#define mt32emu_get_supported_report_handler_version i.v0->getSupportedReportHandlerVersionID +#define mt32emu_get_supported_midi_receiver_version i.v0->getSupportedMIDIReceiverVersionID +#define mt32emu_get_library_version_int i.v0->getLibraryVersionInt +#define mt32emu_get_library_version_string i.v0->getLibraryVersionString +#define mt32emu_get_stereo_output_samplerate i.v0->getStereoOutputSamplerate +#define mt32emu_get_best_analog_output_mode iV1()->getBestAnalogOutputMode +#define mt32emu_create_context i.v0->createContext +#define mt32emu_free_context i.v0->freeContext +#define mt32emu_add_rom_data i.v0->addROMData +#define mt32emu_add_rom_file i.v0->addROMFile +#define mt32emu_get_rom_info i.v0->getROMInfo +#define mt32emu_set_partial_count i.v0->setPartialCount +#define mt32emu_set_analog_output_mode i.v0->setAnalogOutputMode +#define mt32emu_set_stereo_output_samplerate iV1()->setStereoOutputSampleRate +#define mt32emu_set_samplerate_conversion_quality iV1()->setSamplerateConversionQuality +#define mt32emu_select_renderer_type iV1()->selectRendererType +#define mt32emu_get_selected_renderer_type iV1()->getSelectedRendererType +#define mt32emu_open_synth i.v0->openSynth +#define mt32emu_close_synth i.v0->closeSynth +#define mt32emu_is_open i.v0->isOpen +#define mt32emu_get_actual_stereo_output_samplerate i.v0->getActualStereoOutputSamplerate +#define mt32emu_convert_output_to_synth_timestamp iV1()->convertOutputToSynthTimestamp +#define mt32emu_convert_synth_to_output_timestamp iV1()->convertSynthToOutputTimestamp +#define mt32emu_flush_midi_queue i.v0->flushMIDIQueue +#define mt32emu_set_midi_event_queue_size i.v0->setMIDIEventQueueSize +#define mt32emu_set_midi_receiver i.v0->setMIDIReceiver +#define mt32emu_get_internal_rendered_sample_count iV2()->getInternalRenderedSampleCount +#define mt32emu_parse_stream i.v0->parseStream +#define mt32emu_parse_stream_at i.v0->parseStream_At +#define mt32emu_play_short_message i.v0->playShortMessage +#define mt32emu_play_short_message_at i.v0->playShortMessageAt +#define mt32emu_play_msg i.v0->playMsg +#define mt32emu_play_sysex i.v0->playSysex +#define mt32emu_play_msg_at i.v0->playMsgAt +#define mt32emu_play_sysex_at i.v0->playSysexAt +#define mt32emu_play_msg_now i.v0->playMsgNow +#define mt32emu_play_msg_on_part i.v0->playMsgOnPart +#define mt32emu_play_sysex_now i.v0->playSysexNow +#define mt32emu_write_sysex i.v0->writeSysex +#define mt32emu_set_reverb_enabled i.v0->setReverbEnabled +#define mt32emu_is_reverb_enabled i.v0->isReverbEnabled +#define mt32emu_set_reverb_overridden i.v0->setReverbOverridden +#define mt32emu_is_reverb_overridden i.v0->isReverbOverridden +#define mt32emu_set_reverb_compatibility_mode i.v0->setReverbCompatibilityMode +#define mt32emu_is_mt32_reverb_compatibility_mode i.v0->isMT32ReverbCompatibilityMode +#define mt32emu_is_default_reverb_mt32_compatible i.v0->isDefaultReverbMT32Compatible +#define mt32emu_set_dac_input_mode i.v0->setDACInputMode +#define mt32emu_get_dac_input_mode i.v0->getDACInputMode +#define mt32emu_set_midi_delay_mode i.v0->setMIDIDelayMode +#define mt32emu_get_midi_delay_mode i.v0->getMIDIDelayMode +#define mt32emu_set_output_gain i.v0->setOutputGain +#define mt32emu_get_output_gain i.v0->getOutputGain +#define mt32emu_set_reverb_output_gain i.v0->setReverbOutputGain +#define mt32emu_get_reverb_output_gain i.v0->getReverbOutputGain +#define mt32emu_set_reversed_stereo_enabled i.v0->setReversedStereoEnabled +#define mt32emu_is_reversed_stereo_enabled i.v0->isReversedStereoEnabled +#define mt32emu_set_nice_amp_ramp_enabled iV2()->setNiceAmpRampEnabled +#define mt32emu_is_nice_amp_ramp_enabled iV2()->isNiceAmpRampEnabled +#define mt32emu_render_bit16s i.v0->renderBit16s +#define mt32emu_render_float i.v0->renderFloat +#define mt32emu_render_bit16s_streams i.v0->renderBit16sStreams +#define mt32emu_render_float_streams i.v0->renderFloatStreams +#define mt32emu_has_active_partials i.v0->hasActivePartials +#define mt32emu_is_active i.v0->isActive +#define mt32emu_get_partial_count i.v0->getPartialCount +#define mt32emu_get_part_states i.v0->getPartStates +#define mt32emu_get_partial_states i.v0->getPartialStates +#define mt32emu_get_playing_notes i.v0->getPlayingNotes +#define mt32emu_get_patch_name i.v0->getPatchName +#define mt32emu_read_memory i.v0->readMemory + +#else // #if MT32EMU_API_TYPE == 2 + +#include "c_interface.h" + +#endif // #if MT32EMU_API_TYPE == 2 + +namespace MT32Emu { + +namespace CppInterfaceImpl { + +static const mt32emu_report_handler_i NULL_REPORT_HANDLER = { NULL }; +static mt32emu_report_handler_i getReportHandlerThunk(); +static mt32emu_midi_receiver_i getMidiReceiverThunk(); + +} + +/* + * The classes below correspond to the interfaces defined in c_types.h and provided for convenience when using C++. + * The approach used makes no assumption of any internal class data memory layout, since the C++ standard does not + * provide any detail in this area and leaves it up to the implementation. Therefore, this way portability is guaranteed, + * despite the implementation may be a little inefficient. + * See c_types.h and c_interface.h for description of the corresponding interface methods. + */ + +// Defines the interface for handling reported events. +// Corresponds to the current version of mt32emu_report_handler_i interface. +class IReportHandler { +public: + virtual void printDebug(const char *fmt, va_list list) = 0; + virtual void onErrorControlROM() = 0; + virtual void onErrorPCMROM() = 0; + virtual void showLCDMessage(const char *message) = 0; + virtual void onMIDIMessagePlayed() = 0; + virtual bool onMIDIQueueOverflow() = 0; + virtual void onMIDISystemRealtime(Bit8u system_realtime) = 0; + virtual void onDeviceReset() = 0; + virtual void onDeviceReconfig() = 0; + virtual void onNewReverbMode(Bit8u mode) = 0; + virtual void onNewReverbTime(Bit8u time) = 0; + virtual void onNewReverbLevel(Bit8u level) = 0; + virtual void onPolyStateChanged(Bit8u part_num) = 0; + virtual void onProgramChanged(Bit8u part_num, const char *sound_group_name, const char *patch_name) = 0; + +protected: + ~IReportHandler() {} +}; + +// Defines the interface for receiving MIDI messages generated by MIDI stream parser. +// Corresponds to the current version of mt32emu_midi_receiver_i interface. +class IMidiReceiver { +public: + virtual void handleShortMessage(const Bit32u message) = 0; + virtual void handleSysex(const Bit8u stream[], const Bit32u length) = 0; + virtual void handleSystemRealtimeMessage(const Bit8u realtime) = 0; + +protected: + ~IMidiReceiver() {} +}; + +// Defines all the library services. +// Corresponds to the current version of mt32emu_service_i interface. +class Service { +public: +#if MT32EMU_API_TYPE == 2 + explicit Service(mt32emu_service_i interface, mt32emu_context context = NULL) : i(interface), c(context) {} +#else + explicit Service(mt32emu_context context = NULL) : c(context) {} +#endif + ~Service() { if (c != NULL) mt32emu_free_context(c); } + + // Context-independent methods + +#if MT32EMU_API_TYPE == 2 + mt32emu_service_version getVersionID() { return i.v0->getVersionID(i); } +#endif + mt32emu_report_handler_version getSupportedReportHandlerVersionID() { return mt32emu_get_supported_report_handler_version(); } + mt32emu_midi_receiver_version getSupportedMIDIReceiverVersionID() { return mt32emu_get_supported_midi_receiver_version(); } + + Bit32u getLibraryVersionInt() { return mt32emu_get_library_version_int(); } + const char *getLibraryVersionString() { return mt32emu_get_library_version_string(); } + + Bit32u getStereoOutputSamplerate(const AnalogOutputMode analog_output_mode) { return mt32emu_get_stereo_output_samplerate(static_cast(analog_output_mode)); } + AnalogOutputMode getBestAnalogOutputMode(const double target_samplerate) { return static_cast(mt32emu_get_best_analog_output_mode(target_samplerate)); } + + // Context-dependent methods + + mt32emu_context getContext() { return c; } + void createContext(mt32emu_report_handler_i report_handler = CppInterfaceImpl::NULL_REPORT_HANDLER, void *instance_data = NULL) { freeContext(); c = mt32emu_create_context(report_handler, instance_data); } + void createContext(IReportHandler &report_handler) { createContext(CppInterfaceImpl::getReportHandlerThunk(), &report_handler); } + void freeContext() { if (c != NULL) { mt32emu_free_context(c); c = NULL; } } + mt32emu_return_code addROMData(const Bit8u *data, size_t data_size, const mt32emu_sha1_digest *sha1_digest = NULL) { return mt32emu_add_rom_data(c, data, data_size, sha1_digest); } + mt32emu_return_code addROMFile(const char *filename) { return mt32emu_add_rom_file(c, filename); } + void getROMInfo(mt32emu_rom_info *rom_info) { mt32emu_get_rom_info(c, rom_info); } + void setPartialCount(const Bit32u partial_count) { mt32emu_set_partial_count(c, partial_count); } + void setAnalogOutputMode(const AnalogOutputMode analog_output_mode) { mt32emu_set_analog_output_mode(c, static_cast(analog_output_mode)); } + void setStereoOutputSampleRate(const double samplerate) { mt32emu_set_stereo_output_samplerate(c, samplerate); } + void setSamplerateConversionQuality(const SamplerateConversionQuality quality) { mt32emu_set_samplerate_conversion_quality(c, static_cast(quality)); } + void selectRendererType(const RendererType newRendererType) { mt32emu_select_renderer_type(c, static_cast(newRendererType)); } + RendererType getSelectedRendererType() { return static_cast(mt32emu_get_selected_renderer_type(c)); } + mt32emu_return_code openSynth() { return mt32emu_open_synth(c); } + void closeSynth() { mt32emu_close_synth(c); } + bool isOpen() { return mt32emu_is_open(c) != MT32EMU_BOOL_FALSE; } + Bit32u getActualStereoOutputSamplerate() { return mt32emu_get_actual_stereo_output_samplerate(c); } + Bit32u convertOutputToSynthTimestamp(Bit32u output_timestamp) { return mt32emu_convert_output_to_synth_timestamp(c, output_timestamp); } + Bit32u convertSynthToOutputTimestamp(Bit32u synth_timestamp) { return mt32emu_convert_synth_to_output_timestamp(c, synth_timestamp); } + void flushMIDIQueue() { mt32emu_flush_midi_queue(c); } + Bit32u setMIDIEventQueueSize(const Bit32u queue_size) { return mt32emu_set_midi_event_queue_size(c, queue_size); } + void setMIDIReceiver(mt32emu_midi_receiver_i midi_receiver, void *instance_data) { mt32emu_set_midi_receiver(c, midi_receiver, instance_data); } + void setMIDIReceiver(IMidiReceiver &midi_receiver) { setMIDIReceiver(CppInterfaceImpl::getMidiReceiverThunk(), &midi_receiver); } + + Bit32u getInternalRenderedSampleCount() { return mt32emu_get_internal_rendered_sample_count(c); } + void parseStream(const Bit8u *stream, Bit32u length) { mt32emu_parse_stream(c, stream, length); } + void parseStream_At(const Bit8u *stream, Bit32u length, Bit32u timestamp) { mt32emu_parse_stream_at(c, stream, length, timestamp); } + void playShortMessage(Bit32u message) { mt32emu_play_short_message(c, message); } + void playShortMessageAt(Bit32u message, Bit32u timestamp) { mt32emu_play_short_message_at(c, message, timestamp); } + mt32emu_return_code playMsg(Bit32u msg) { return mt32emu_play_msg(c, msg); } + mt32emu_return_code playSysex(const Bit8u *sysex, Bit32u len) { return mt32emu_play_sysex(c, sysex, len); } + mt32emu_return_code playMsgAt(Bit32u msg, Bit32u timestamp) { return mt32emu_play_msg_at(c, msg, timestamp); } + mt32emu_return_code playSysexAt(const Bit8u *sysex, Bit32u len, Bit32u timestamp) { return mt32emu_play_sysex_at(c, sysex, len, timestamp); } + + void playMsgNow(Bit32u msg) { mt32emu_play_msg_now(c, msg); } + void playMsgOnPart(Bit8u part, Bit8u code, Bit8u note, Bit8u velocity) { mt32emu_play_msg_on_part(c, part, code, note, velocity); } + void playSysexNow(const Bit8u *sysex, Bit32u len) { mt32emu_play_sysex_now(c, sysex, len); } + void writeSysex(Bit8u channel, const Bit8u *sysex, Bit32u len) { mt32emu_write_sysex(c, channel, sysex, len); } + + void setReverbEnabled(const bool reverb_enabled) { mt32emu_set_reverb_enabled(c, reverb_enabled ? MT32EMU_BOOL_TRUE : MT32EMU_BOOL_FALSE); } + bool isReverbEnabled() { return mt32emu_is_reverb_enabled(c) != MT32EMU_BOOL_FALSE; } + void setReverbOverridden(const bool reverb_overridden) { mt32emu_set_reverb_overridden(c, reverb_overridden ? MT32EMU_BOOL_TRUE : MT32EMU_BOOL_FALSE); } + bool isReverbOverridden() { return mt32emu_is_reverb_overridden(c) != MT32EMU_BOOL_FALSE; } + void setReverbCompatibilityMode(const bool mt32_compatible_mode) { mt32emu_set_reverb_compatibility_mode(c, mt32_compatible_mode ? MT32EMU_BOOL_TRUE : MT32EMU_BOOL_FALSE); } + bool isMT32ReverbCompatibilityMode() { return mt32emu_is_mt32_reverb_compatibility_mode(c) != MT32EMU_BOOL_FALSE; } + bool isDefaultReverbMT32Compatible() { return mt32emu_is_default_reverb_mt32_compatible(c) != MT32EMU_BOOL_FALSE; } + + void setDACInputMode(const DACInputMode mode) { mt32emu_set_dac_input_mode(c, static_cast(mode)); } + DACInputMode getDACInputMode() { return static_cast(mt32emu_get_dac_input_mode(c)); } + + void setMIDIDelayMode(const MIDIDelayMode mode) { mt32emu_set_midi_delay_mode(c, static_cast(mode)); } + MIDIDelayMode getMIDIDelayMode() { return static_cast(mt32emu_get_midi_delay_mode(c)); } + + void setOutputGain(float gain) { mt32emu_set_output_gain(c, gain); } + float getOutputGain() { return mt32emu_get_output_gain(c); } + void setReverbOutputGain(float gain) { mt32emu_set_reverb_output_gain(c, gain); } + float getReverbOutputGain() { return mt32emu_get_reverb_output_gain(c); } + + void setReversedStereoEnabled(const bool enabled) { mt32emu_set_reversed_stereo_enabled(c, enabled ? MT32EMU_BOOL_TRUE : MT32EMU_BOOL_FALSE); } + bool isReversedStereoEnabled() { return mt32emu_is_reversed_stereo_enabled(c) != MT32EMU_BOOL_FALSE; } + + void setNiceAmpRampEnabled(const bool enabled) { mt32emu_set_nice_amp_ramp_enabled(c, enabled ? MT32EMU_BOOL_TRUE : MT32EMU_BOOL_FALSE); } + bool isNiceAmpRampEnabled() { return mt32emu_is_nice_amp_ramp_enabled(c) != MT32EMU_BOOL_FALSE; } + + void renderBit16s(Bit16s *stream, Bit32u len) { mt32emu_render_bit16s(c, stream, len); } + void renderFloat(float *stream, Bit32u len) { mt32emu_render_float(c, stream, len); } + void renderBit16sStreams(const mt32emu_dac_output_bit16s_streams *streams, Bit32u len) { mt32emu_render_bit16s_streams(c, streams, len); } + void renderFloatStreams(const mt32emu_dac_output_float_streams *streams, Bit32u len) { mt32emu_render_float_streams(c, streams, len); } + + bool hasActivePartials() { return mt32emu_has_active_partials(c) != MT32EMU_BOOL_FALSE; } + bool isActive() { return mt32emu_is_active(c) != MT32EMU_BOOL_FALSE; } + Bit32u getPartialCount() { return mt32emu_get_partial_count(c); } + Bit32u getPartStates() { return mt32emu_get_part_states(c); } + void getPartialStates(Bit8u *partial_states) { mt32emu_get_partial_states(c, partial_states); } + Bit32u getPlayingNotes(Bit8u part_number, Bit8u *keys, Bit8u *velocities) { return mt32emu_get_playing_notes(c, part_number, keys, velocities); } + const char *getPatchName(Bit8u part_number) { return mt32emu_get_patch_name(c, part_number); } + void readMemory(Bit32u addr, Bit32u len, Bit8u *data) { mt32emu_read_memory(c, addr, len, data); } + +private: +#if MT32EMU_API_TYPE == 2 + const mt32emu_service_i i; +#endif + mt32emu_context c; + +#if MT32EMU_API_TYPE == 2 + const mt32emu_service_i_v1 *iV1() { return (getVersionID() < MT32EMU_SERVICE_VERSION_1) ? NULL : i.v1; } + const mt32emu_service_i_v2 *iV2() { return (getVersionID() < MT32EMU_SERVICE_VERSION_2) ? NULL : i.v2; } +#endif +}; + +namespace CppInterfaceImpl { + +static mt32emu_report_handler_version getReportHandlerVersionID(mt32emu_report_handler_i) { + return MT32EMU_REPORT_HANDLER_VERSION_CURRENT; +} + +static void printDebug(void *instance_data, const char *fmt, va_list list) { + static_cast(instance_data)->printDebug(fmt, list); +} + +static void onErrorControlROM(void *instance_data) { + static_cast(instance_data)->onErrorControlROM(); +} + +static void onErrorPCMROM(void *instance_data) { + static_cast(instance_data)->onErrorPCMROM(); +} + +static void showLCDMessage(void *instance_data, const char *message) { + static_cast(instance_data)->showLCDMessage(message); +} + +static void onMIDIMessagePlayed(void *instance_data) { + static_cast(instance_data)->onMIDIMessagePlayed(); +} + +static mt32emu_boolean onMIDIQueueOverflow(void *instance_data) { + return static_cast(instance_data)->onMIDIQueueOverflow() ? MT32EMU_BOOL_TRUE : MT32EMU_BOOL_FALSE; +} + +static void onMIDISystemRealtime(void *instance_data, mt32emu_bit8u system_realtime) { + static_cast(instance_data)->onMIDISystemRealtime(system_realtime); +} + +static void onDeviceReset(void *instance_data) { + static_cast(instance_data)->onDeviceReset(); +} + +static void onDeviceReconfig(void *instance_data) { + static_cast(instance_data)->onDeviceReconfig(); +} + +static void onNewReverbMode(void *instance_data, mt32emu_bit8u mode) { + static_cast(instance_data)->onNewReverbMode(mode); +} + +static void onNewReverbTime(void *instance_data, mt32emu_bit8u time) { + static_cast(instance_data)->onNewReverbTime(time); +} + +static void onNewReverbLevel(void *instance_data, mt32emu_bit8u level) { + static_cast(instance_data)->onNewReverbLevel(level); +} + +static void onPolyStateChanged(void *instance_data, mt32emu_bit8u part_num) { + static_cast(instance_data)->onPolyStateChanged(part_num); +} + +static void onProgramChanged(void *instance_data, mt32emu_bit8u part_num, const char *sound_group_name, const char *patch_name) { + static_cast(instance_data)->onProgramChanged(part_num, sound_group_name, patch_name); +} + +static mt32emu_report_handler_i getReportHandlerThunk() { + static const mt32emu_report_handler_i_v0 REPORT_HANDLER_V0_THUNK = { + getReportHandlerVersionID, + printDebug, + onErrorControlROM, + onErrorPCMROM, + showLCDMessage, + onMIDIMessagePlayed, + onMIDIQueueOverflow, + onMIDISystemRealtime, + onDeviceReset, + onDeviceReconfig, + onNewReverbMode, + onNewReverbTime, + onNewReverbLevel, + onPolyStateChanged, + onProgramChanged + }; + + static const mt32emu_report_handler_i REPORT_HANDLER_THUNK = { &REPORT_HANDLER_V0_THUNK }; + + return REPORT_HANDLER_THUNK; +} + +static mt32emu_midi_receiver_version getMidiReceiverVersionID(mt32emu_midi_receiver_i) { + return MT32EMU_MIDI_RECEIVER_VERSION_CURRENT; +} + +static void handleShortMessage(void *instance_data, const mt32emu_bit32u message) { + static_cast(instance_data)->handleShortMessage(message); +} + +static void handleSysex(void *instance_data, const mt32emu_bit8u stream[], const mt32emu_bit32u length) { + static_cast(instance_data)->handleSysex(stream, length); +} + +static void handleSystemRealtimeMessage(void *instance_data, const mt32emu_bit8u realtime) { + static_cast(instance_data)->handleSystemRealtimeMessage(realtime); +} + +static mt32emu_midi_receiver_i getMidiReceiverThunk() { + static const mt32emu_midi_receiver_i_v0 MIDI_RECEIVER_V0_THUNK = { + getMidiReceiverVersionID, + handleShortMessage, + handleSysex, + handleSystemRealtimeMessage + }; + + static const mt32emu_midi_receiver_i MIDI_RECEIVER_THUNK = { &MIDI_RECEIVER_V0_THUNK }; + + return MIDI_RECEIVER_THUNK; +} + +} // namespace CppInterfaceImpl + +} // namespace MT32Emu + +#if MT32EMU_API_TYPE == 2 + +#undef mt32emu_get_supported_report_handler_version +#undef mt32emu_get_supported_midi_receiver_version +#undef mt32emu_get_library_version_int +#undef mt32emu_get_library_version_string +#undef mt32emu_get_stereo_output_samplerate +#undef mt32emu_get_best_analog_output_mode +#undef mt32emu_create_context +#undef mt32emu_free_context +#undef mt32emu_add_rom_data +#undef mt32emu_add_rom_file +#undef mt32emu_get_rom_info +#undef mt32emu_set_partial_count +#undef mt32emu_set_analog_output_mode +#undef mt32emu_set_stereo_output_samplerate +#undef mt32emu_set_samplerate_conversion_quality +#undef mt32emu_select_renderer_type +#undef mt32emu_get_selected_renderer_type +#undef mt32emu_open_synth +#undef mt32emu_close_synth +#undef mt32emu_is_open +#undef mt32emu_get_actual_stereo_output_samplerate +#undef mt32emu_convert_output_to_synth_timestamp +#undef mt32emu_convert_synth_to_output_timestamp +#undef mt32emu_flush_midi_queue +#undef mt32emu_set_midi_event_queue_size +#undef mt32emu_set_midi_receiver +#undef mt32emu_get_internal_rendered_sample_count +#undef mt32emu_parse_stream +#undef mt32emu_parse_stream_at +#undef mt32emu_play_short_message +#undef mt32emu_play_short_message_at +#undef mt32emu_play_msg +#undef mt32emu_play_sysex +#undef mt32emu_play_msg_at +#undef mt32emu_play_sysex_at +#undef mt32emu_play_msg_now +#undef mt32emu_play_msg_on_part +#undef mt32emu_play_sysex_now +#undef mt32emu_write_sysex +#undef mt32emu_set_reverb_enabled +#undef mt32emu_is_reverb_enabled +#undef mt32emu_set_reverb_overridden +#undef mt32emu_is_reverb_overridden +#undef mt32emu_set_reverb_compatibility_mode +#undef mt32emu_is_mt32_reverb_compatibility_mode +#undef mt32emu_is_default_reverb_mt32_compatible +#undef mt32emu_set_dac_input_mode +#undef mt32emu_get_dac_input_mode +#undef mt32emu_set_midi_delay_mode +#undef mt32emu_get_midi_delay_mode +#undef mt32emu_set_output_gain +#undef mt32emu_get_output_gain +#undef mt32emu_set_reverb_output_gain +#undef mt32emu_get_reverb_output_gain +#undef mt32emu_set_reversed_stereo_enabled +#undef mt32emu_is_reversed_stereo_enabled +#undef mt32emu_set_nice_amp_ramp_enabled +#undef mt32emu_is_nice_amp_ramp_enabled +#undef mt32emu_render_bit16s +#undef mt32emu_render_float +#undef mt32emu_render_bit16s_streams +#undef mt32emu_render_float_streams +#undef mt32emu_has_active_partials +#undef mt32emu_is_active +#undef mt32emu_get_partial_count +#undef mt32emu_get_part_states +#undef mt32emu_get_partial_states +#undef mt32emu_get_playing_notes +#undef mt32emu_get_patch_name +#undef mt32emu_read_memory + +#endif // #if MT32EMU_API_TYPE == 2 + +#endif /* #ifndef MT32EMU_CPP_INTERFACE_H */ diff --git a/src/include/mt32emu/config.h b/src/include/mt32emu/config.h new file mode 100644 index 000000000..5f5b6c9fb --- /dev/null +++ b/src/include/mt32emu/config.h @@ -0,0 +1,40 @@ +/* Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009 Dean Beeler, Jerome Fisher + * Copyright (C) 2011-2017 Dean Beeler, Jerome Fisher, Sergey V. Mikayev + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 2.1 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#ifndef MT32EMU_CONFIG_H +#define MT32EMU_CONFIG_H + +#define MT32EMU_VERSION "2.2.0" +#define MT32EMU_VERSION_MAJOR 2 +#define MT32EMU_VERSION_MINOR 2 +#define MT32EMU_VERSION_PATCH 0 + +/* Library Exports Configuration + * + * This reflects the API types actually provided by the library build. + * 0: The full-featured C++ API is only available in this build. The client application may ONLY use MT32EMU_API_TYPE 0. + * 1: The C-compatible API is only available. The library is built as a shared object, only C functions are exported, + * and thus the client application may NOT use MT32EMU_API_TYPE 0. + * 2: The C-compatible API is only available. The library is built as a shared object, only the factory function + * is exported, and thus the client application may ONLY use MT32EMU_API_TYPE 2. + * 3: All the available API types are provided by the library build. + */ +#define MT32EMU_EXPORTS_TYPE 3 + +#define MT32EMU_API_TYPE 0 + +#endif diff --git a/src/include/mt32emu/globals.h b/src/include/mt32emu/globals.h new file mode 100644 index 000000000..2d984c82b --- /dev/null +++ b/src/include/mt32emu/globals.h @@ -0,0 +1,119 @@ +/* Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009 Dean Beeler, Jerome Fisher + * Copyright (C) 2011-2017 Dean Beeler, Jerome Fisher, Sergey V. Mikayev + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 2.1 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#ifndef MT32EMU_GLOBALS_H +#define MT32EMU_GLOBALS_H + +#include "config.h" + +/* Support for compiling shared library. */ +#ifdef MT32EMU_SHARED +#if defined _WIN32 || defined __CYGWIN__ +#ifdef _MSC_VER +#ifdef mt32emu_EXPORTS +#define MT32EMU_EXPORT_ATTRIBUTE _declspec(dllexport) +#else /* #ifdef mt32emu_EXPORTS */ +#define MT32EMU_EXPORT_ATTRIBUTE _declspec(dllimport) +#endif /* #ifdef mt32emu_EXPORTS */ +#else /* #ifdef _MSC_VER */ +#ifdef mt32emu_EXPORTS +#define MT32EMU_EXPORT_ATTRIBUTE __attribute__ ((dllexport)) +#else /* #ifdef mt32emu_EXPORTS */ +#define MT32EMU_EXPORT_ATTRIBUTE __attribute__ ((dllimport)) +#endif /* #ifdef mt32emu_EXPORTS */ +#endif /* #ifdef _MSC_VER */ +#else /* #if defined _WIN32 || defined __CYGWIN__ */ +#define MT32EMU_EXPORT_ATTRIBUTE __attribute__ ((visibility("default"))) +#endif /* #if defined _WIN32 || defined __CYGWIN__ */ +#else /* #ifdef MT32EMU_SHARED */ +#define MT32EMU_EXPORT_ATTRIBUTE +#endif /* #ifdef MT32EMU_SHARED */ + +#if MT32EMU_EXPORTS_TYPE == 1 || MT32EMU_EXPORTS_TYPE == 2 +#define MT32EMU_EXPORT +#else +#define MT32EMU_EXPORT MT32EMU_EXPORT_ATTRIBUTE +#endif + +/* Useful constants */ + +/* Sample rate to use in mixing. With the progress of development, we've found way too many thing dependent. + * In order to achieve further advance in emulation accuracy, sample rate made fixed throughout the emulator, + * except the emulation of analogue path. + * The output from the synth is supposed to be resampled externally in order to convert to the desired sample rate. + */ +#define MT32EMU_SAMPLE_RATE 32000 + +/* The default value for the maximum number of partials playing simultaneously. */ +#define MT32EMU_DEFAULT_MAX_PARTIALS 32 + +/* The higher this number, the more memory will be used, but the more samples can be processed in one run - + * various parts of sample generation can be processed more efficiently in a single run. + * A run's maximum length is that given to Synth::render(), so giving a value here higher than render() is ever + * called with will give no gain (but simply waste the memory). + * Note that this value does *not* in any way impose limitations on the length given to render(), and has no effect + * on the generated audio. + * This value must be >= 1. + */ +#define MT32EMU_MAX_SAMPLES_PER_RUN 4096 + +/* The default size of the internal MIDI event queue. + * It holds the incoming MIDI events before the rendering engine actually processes them. + * The main goal is to fairly emulate the real hardware behaviour which obviously + * uses an internal MIDI event queue to gather incoming data as well as the delays + * introduced by transferring data via the MIDI interface. + * This also facilitates building of an external rendering loop + * as the queue stores timestamped MIDI events. + */ +#define MT32EMU_DEFAULT_MIDI_EVENT_QUEUE_SIZE 1024 + +/* Maximum allowed size of MIDI parser input stream buffer. + * Should suffice for any reasonable bulk dump SysEx, as the h/w units have only 32K of RAM onboard. + */ +#define MT32EMU_MAX_STREAM_BUFFER_SIZE 32768 + +/* This should correspond to the MIDI buffer size used in real h/w devices. + * CM-32L control ROM is using 1000 bytes, and MT-32 GEN0 is using only 240 bytes (semi-confirmed by now). + */ +#define MT32EMU_SYSEX_BUFFER_SIZE 1000 + +#if defined(__cplusplus) && MT32EMU_API_TYPE != 1 + +namespace MT32Emu +{ +const unsigned int SAMPLE_RATE = MT32EMU_SAMPLE_RATE; +#undef MT32EMU_SAMPLE_RATE + +const unsigned int DEFAULT_MAX_PARTIALS = MT32EMU_DEFAULT_MAX_PARTIALS; +#undef MT32EMU_DEFAULT_MAX_PARTIALS + +const unsigned int MAX_SAMPLES_PER_RUN = MT32EMU_MAX_SAMPLES_PER_RUN; +#undef MT32EMU_MAX_SAMPLES_PER_RUN + +const unsigned int DEFAULT_MIDI_EVENT_QUEUE_SIZE = MT32EMU_DEFAULT_MIDI_EVENT_QUEUE_SIZE; +#undef MT32EMU_DEFAULT_MIDI_EVENT_QUEUE_SIZE + +const unsigned int MAX_STREAM_BUFFER_SIZE = MT32EMU_MAX_STREAM_BUFFER_SIZE; +#undef MT32EMU_MAX_STREAM_BUFFER_SIZE + +const unsigned int SYSEX_BUFFER_SIZE = MT32EMU_SYSEX_BUFFER_SIZE; +#undef MT32EMU_SYSEX_BUFFER_SIZE +} + +#endif /* #if defined(__cplusplus) && MT32EMU_API_TYPE != 1 */ + +#endif /* #ifndef MT32EMU_GLOBALS_H */ diff --git a/src/include/mt32emu/mt32emu.h b/src/include/mt32emu/mt32emu.h new file mode 100644 index 000000000..6b93121be --- /dev/null +++ b/src/include/mt32emu/mt32emu.h @@ -0,0 +1,84 @@ +/* Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009 Dean Beeler, Jerome Fisher + * Copyright (C) 2011-2017 Dean Beeler, Jerome Fisher, Sergey V. Mikayev + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 2.1 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +#ifndef MT32EMU_MT32EMU_H +#define MT32EMU_MT32EMU_H + +#include "config.h" + +/* API Configuration */ + +/* 0: Use full-featured C++ API. Well suitable when the library is to be linked statically. + * When the library is shared, ABI compatibility may be an issue. Therefore, it should + * only be used within a project comprising of several modules to share the library code. + * 1: Use C-compatible API. Make the library looks as a regular C library with well-defined ABI. + * This is also crucial when the library is to be linked with modules in a different + * language, either statically or dynamically. + * 2: Use plugin-like API via C-interface wrapped in a C++ class. This is mainly intended + * for a shared library being dynamically loaded in run-time. To get access to all the library + * services, a client application only needs to bind with a single factory function. + * 3: Use optimised C++ API compatible with the plugin API (type 2). The facade class also wraps + * the C functions but they are invoked directly. This enables the compiler to generate better + * code for the library when linked statically yet being consistent with the plugin-like API. + */ + +#ifdef MT32EMU_API_TYPE +#if MT32EMU_API_TYPE == 0 && (MT32EMU_EXPORTS_TYPE == 1 || MT32EMU_EXPORTS_TYPE == 2) +#error Incompatible setting MT32EMU_API_TYPE=0 +#elif MT32EMU_API_TYPE == 1 && (MT32EMU_EXPORTS_TYPE == 0 || MT32EMU_EXPORTS_TYPE == 2) +#error Incompatible setting MT32EMU_API_TYPE=1 +#elif MT32EMU_API_TYPE == 2 && (MT32EMU_EXPORTS_TYPE == 0) +#error Incompatible setting MT32EMU_API_TYPE=2 +#elif MT32EMU_API_TYPE == 3 && (MT32EMU_EXPORTS_TYPE == 0 || MT32EMU_EXPORTS_TYPE == 2) +#error Incompatible setting MT32EMU_API_TYPE=3 +#endif +#else /* #ifdef MT32EMU_API_TYPE */ +#if 0 < MT32EMU_EXPORTS_TYPE && MT32EMU_EXPORTS_TYPE < 3 +#define MT32EMU_API_TYPE MT32EMU_EXPORTS_TYPE +#else +#define MT32EMU_API_TYPE 0 +#endif +#endif /* #ifdef MT32EMU_API_TYPE */ + +/* MT32EMU_SHARED should be defined when building shared library, especially for Windows platforms. */ +/* +#define MT32EMU_SHARED +*/ + +#include "globals.h" + +#if !defined(__cplusplus) || MT32EMU_API_TYPE == 1 + +#include "c_interface/c_interface.h" + +#elif MT32EMU_API_TYPE == 2 || MT32EMU_API_TYPE == 3 + +#include "c_interface/cpp_interface.h" + +#else /* #if !defined(__cplusplus) || MT32EMU_API_TYPE == 1 */ + +#include "Types.h" +#include "File.h" +#include "FileStream.h" +#include "ROMInfo.h" +#include "Synth.h" +#include "MidiStreamParser.h" +#include "SampleRateConverter.h" + +#endif /* #if !defined(__cplusplus) || MT32EMU_API_TYPE == 1 */ + +#endif /* #ifndef MT32EMU_MT32EMU_H */ diff --git a/src/sound/nukedopl.h b/src/include/nukedopl.h similarity index 100% rename from src/sound/nukedopl.h rename to src/include/nukedopl.h diff --git a/src/include/slirp/bootp.h b/src/include/slirp/bootp.h new file mode 100644 index 000000000..b2ee26e95 --- /dev/null +++ b/src/include/slirp/bootp.h @@ -0,0 +1,121 @@ +/* bootp/dhcp defines */ + +#define BOOTP_SERVER 67 +#define BOOTP_CLIENT 68 + +#define BOOTP_REQUEST 1 +#define BOOTP_REPLY 2 + +#define RFC1533_COOKIE 99, 130, 83, 99 +#define RFC1533_PAD 0 +#define RFC1533_NETMASK 1 +#define RFC1533_TIMEOFFSET 2 +#define RFC1533_GATEWAY 3 +#define RFC1533_TIMESERVER 4 +#define RFC1533_IEN116NS 5 +#define RFC1533_DNS 6 +#define RFC1533_LOGSERVER 7 +#define RFC1533_COOKIESERVER 8 +#define RFC1533_LPRSERVER 9 +#define RFC1533_IMPRESSSERVER 10 +#define RFC1533_RESOURCESERVER 11 +#define RFC1533_HOSTNAME 12 +#define RFC1533_BOOTFILESIZE 13 +#define RFC1533_MERITDUMPFILE 14 +#define RFC1533_DOMAINNAME 15 +#define RFC1533_SWAPSERVER 16 +#define RFC1533_ROOTPATH 17 +#define RFC1533_EXTENSIONPATH 18 +#define RFC1533_IPFORWARDING 19 +#define RFC1533_IPSOURCEROUTING 20 +#define RFC1533_IPPOLICYFILTER 21 +#define RFC1533_IPMAXREASSEMBLY 22 +#define RFC1533_IPTTL 23 +#define RFC1533_IPMTU 24 +#define RFC1533_IPMTUPLATEAU 25 +#define RFC1533_INTMTU 26 +#define RFC1533_INTLOCALSUBNETS 27 +#define RFC1533_INTBROADCAST 28 +#define RFC1533_INTICMPDISCOVER 29 +#define RFC1533_INTICMPRESPOND 30 +#define RFC1533_INTROUTEDISCOVER 31 +#define RFC1533_INTROUTESOLICIT 32 +#define RFC1533_INTSTATICROUTES 33 +#define RFC1533_LLTRAILERENCAP 34 +#define RFC1533_LLARPCACHETMO 35 +#define RFC1533_LLETHERNETENCAP 36 +#define RFC1533_TCPTTL 37 +#define RFC1533_TCPKEEPALIVETMO 38 +#define RFC1533_TCPKEEPALIVEGB 39 +#define RFC1533_NISDOMAIN 40 +#define RFC1533_NISSERVER 41 +#define RFC1533_NTPSERVER 42 +#define RFC1533_VENDOR 43 +#define RFC1533_NBNS 44 +#define RFC1533_NBDD 45 +#define RFC1533_NBNT 46 +#define RFC1533_NBSCOPE 47 +#define RFC1533_XFS 48 +#define RFC1533_XDM 49 + +#define RFC2132_REQ_ADDR 50 +#define RFC2132_LEASE_TIME 51 +#define RFC2132_MSG_TYPE 53 +#define RFC2132_SRV_ID 54 +#define RFC2132_PARAM_LIST 55 +#define RFC2132_MAX_SIZE 57 +#define RFC2132_RENEWAL_TIME 58 +#define RFC2132_REBIND_TIME 59 + +#define DHCPDISCOVER 1 +#define DHCPOFFER 2 +#define DHCPREQUEST 3 +#define DHCPACK 5 + +#define RFC1533_VENDOR_MAJOR 0 +#define RFC1533_VENDOR_MINOR 0 + +#define RFC1533_VENDOR_MAGIC 128 +#define RFC1533_VENDOR_ADDPARM 129 +#define RFC1533_VENDOR_ETHDEV 130 +#define RFC1533_VENDOR_HOWTO 132 +#define RFC1533_VENDOR_MNUOPTS 160 +#define RFC1533_VENDOR_SELECTION 176 +#define RFC1533_VENDOR_MOTD 184 +#define RFC1533_VENDOR_NUMOFMOTD 8 +#define RFC1533_VENDOR_IMG 192 +#define RFC1533_VENDOR_NUMOFIMG 16 + +#define RFC1533_END 255 +#define BOOTP_VENDOR_LEN 64 +#define DHCP_OPT_LEN 312 + +#ifdef PRAGMA_PACK_SUPPORTED +#pragma pack(1) +#endif + +struct bootp_t { + struct ip ip; + struct udphdr udp; + uint8_t bp_op; + uint8_t bp_htype; + uint8_t bp_hlen; + uint8_t bp_hops; + uint32_t bp_xid; + uint16_t bp_secs; + uint16_t unused; + struct in_addr bp_ciaddr; + struct in_addr bp_yiaddr; + struct in_addr bp_siaddr; + struct in_addr bp_giaddr; + uint8_t bp_hwaddr[16]; + uint8_t bp_sname[64]; + uint8_t bp_file[128]; + uint8_t bp_vend[DHCP_OPT_LEN]; +} PACKED__; + +#ifdef PRAGMA_PACK_SUPPORTED +#pragma pack(PACK_END) +#endif + +void bootp_input(struct SLIRPmbuf *m); diff --git a/src/include/slirp/config-host.h b/src/include/slirp/config-host.h new file mode 100644 index 000000000..2983fc727 --- /dev/null +++ b/src/include/slirp/config-host.h @@ -0,0 +1,9 @@ +/* Automatically generated by configure - do not modify */ +#define CONFIG_QEMU_SHAREDIR "/c/Program Files/Qemu" +#define HOST_I386 1 +#define HOST_LONG_BITS 32 +#define CONFIG_WIN32 1 +#define CONFIG_GDBSTUB 1 +#define CONFIG_SLIRP 1 +#define QEMU_VERSION "0.9.0" +#define CONFIG_UNAME_RELEASE "" diff --git a/src/include/slirp/config.h b/src/include/slirp/config.h new file mode 100644 index 000000000..d9043ae85 --- /dev/null +++ b/src/include/slirp/config.h @@ -0,0 +1,9 @@ +/* Automatically generated by configure - do not modify */ +#include "config-host.h" +#define CONFIG_QEMU_PREFIX "/usr/gnemul/qemu-i386" +#define TARGET_ARCH "i386" +#define TARGET_I386 1 +#define USE_KQEMU 1 +#define CONFIG_SOFTMMU 1 +#define CONFIG_SDL 1 +#define HAVE_STRDUP 1 diff --git a/src/include/slirp/ctl.h b/src/include/slirp/ctl.h new file mode 100644 index 000000000..4a8576dc1 --- /dev/null +++ b/src/include/slirp/ctl.h @@ -0,0 +1,7 @@ +#define CTL_CMD 0 +#define CTL_EXEC 1 +#define CTL_ALIAS 2 +#define CTL_DNS 3 + +#define CTL_SPECIAL "10.0.2.0" +#define CTL_LOCAL "10.0.2.15" diff --git a/src/include/slirp/debug.h b/src/include/slirp/debug.h new file mode 100644 index 000000000..a1eafa130 --- /dev/null +++ b/src/include/slirp/debug.h @@ -0,0 +1,49 @@ +/* + * Copyright (c) 1995 Danny Gasparovski. + * + * Please read the file COPYRIGHT for the + * terms and conditions of the copyright. + */ + +#define PRN_STDERR 1 +#define PRN_SPRINTF 2 + +extern FILE *dfd; +extern FILE *lfd; +extern int dostats; +extern int slirp_debug; + +#define DBG_CALL 0x1 +#define DBG_MISC 0x2 +#define DBG_ERROR 0x4 +#define DEBUG_DEFAULT DBG_CALL|DBG_MISC|DBG_ERROR + +#ifdef SLIRP_DEBUG +#define DEBUG_CALL(x) if (slirp_debug & DBG_CALL) { fprintf(dfd, "%s...\n", x); fflush(dfd); } +#define DEBUG_ARG(x, y) if (slirp_debug & DBG_CALL) { fputc(' ', dfd); fprintf(dfd, x, y); fputc('\n', dfd); fflush(dfd); } +#define DEBUG_ARGS(x) if (slirp_debug & DBG_CALL) { fprintf x ; fflush(dfd); } +#define DEBUG_MISC(x) if (slirp_debug & DBG_MISC) { fprintf x ; fflush(dfd); } +#define DEBUG_ERROR(x) if (slirp_debug & DBG_ERROR) {fprintf x ; fflush(dfd); } + + +#else + +#define DEBUG_CALL(x) +#define DEBUG_ARG(x, y) +#define DEBUG_ARGS(x) +#define DEBUG_MISC(x) +#define DEBUG_ERROR(x) + +#endif + +void debug_init _P((char *, int)); +void allttystats _P((void)); +void ipstats _P((void)); +void vjstats _P((void)); +void tcpstats _P((void)); +void udpstats _P((void)); +void icmpstats _P((void)); +void mbufstats _P((void)); +void sockstats _P((void)); +void slirp_exit _P((int)); + diff --git a/src/include/slirp/icmp_var.h b/src/include/slirp/icmp_var.h new file mode 100644 index 000000000..9af222fb7 --- /dev/null +++ b/src/include/slirp/icmp_var.h @@ -0,0 +1,65 @@ +/* + * Copyright (c) 1982, 1986, 1993 + * The Regents of the University of California. All rights reserved. + * + * 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 above copyright + * 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 University 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 REGENTS 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 REGENTS 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. + * + * @(#)icmp_var.h 8.1 (Berkeley) 6/10/93 + * icmp_var.h,v 1.4 1995/02/16 00:27:40 wollman Exp + */ + +#ifndef _NETINET_ICMP_VAR_H_ +#define _NETINET_ICMP_VAR_H_ + +/* + * Variables related to this implementation + * of the internet control message protocol. + */ +struct icmpstat { +/* statistics related to input messages processed */ + u_long icps_received; /* #ICMP packets received */ + u_long icps_tooshort; /* packet < ICMP_MINLEN */ + u_long icps_checksum; /* bad checksum */ + u_long icps_notsupp; /* #ICMP packets not supported */ + u_long icps_badtype; /* #with bad type feild */ + u_long icps_reflect; /* number of responses */ +}; + +/* + * Names for ICMP sysctl objects + */ +#define ICMPCTL_MASKREPL 1 /* allow replies to netmask requests */ +#define ICMPCTL_STATS 2 /* statistics (read-only) */ +#define ICMPCTL_MAXID 3 + +#define ICMPCTL_NAMES { \ + { 0, 0 }, \ + { "maskrepl", CTLTYPE_INT }, \ + { "stats", CTLTYPE_STRUCT }, \ +} + +extern struct icmpstat icmpstat; + +#endif diff --git a/src/include/slirp/if.h b/src/include/slirp/if.h new file mode 100644 index 000000000..85a5a96d2 --- /dev/null +++ b/src/include/slirp/if.h @@ -0,0 +1,50 @@ +/* + * Copyright (c) 1995 Danny Gasparovski. + * + * Please read the file COPYRIGHT for the + * terms and conditions of the copyright. + */ + +#ifndef _IF_H_ +#define _IF_H_ + +#define IF_COMPRESS 0x01 /* We want compression */ +#define IF_NOCOMPRESS 0x02 /* Do not do compression */ +#define IF_AUTOCOMP 0x04 /* Autodetect (default) */ +#define IF_NOCIDCOMP 0x08 /* CID compression */ + +/* Needed for FreeBSD */ +#undef if_mtu +extern int if_mtu; +extern int if_mru; /* MTU and MRU */ +extern int if_comp; /* Flags for compression */ +extern int if_maxlinkhdr; +extern int if_queued; /* Number of packets queued so far */ +extern int if_thresh; /* Number of packets queued before we start sending + * (to prevent allocing too many SLIRPmbufs) */ + +extern struct SLIRPmbuf if_fastq; /* fast queue (for interactive data) */ +extern struct SLIRPmbuf if_batchq; /* queue for non-interactive data */ +extern struct SLIRPmbuf *next_m; + +#define ifs_init(ifm) ((ifm)->ifs_next = (ifm)->ifs_prev = (ifm)) + +/* Interface statistics */ +struct slirp_ifstats { + u_int out_pkts; /* Output packets */ + u_int out_bytes; /* Output bytes */ + u_int out_errpkts; /* Output Error Packets */ + u_int out_errbytes; /* Output Error Bytes */ + u_int in_pkts; /* Input packets */ + u_int in_bytes; /* Input bytes */ + u_int in_errpkts; /* Input Error Packets */ + u_int in_errbytes; /* Input Error Bytes */ + + u_int bytes_saved; /* Number of bytes that compression "saved" */ + /* ie: number of bytes that didn't need to be sent over the link + * because of compression */ + + u_int in_mbad; /* Bad incoming packets */ +}; + +#endif diff --git a/src/include/slirp/ip.h b/src/include/slirp/ip.h new file mode 100644 index 000000000..f21178360 --- /dev/null +++ b/src/include/slirp/ip.h @@ -0,0 +1,362 @@ +/* + * Copyright (c) 1982, 1986, 1993 + * The Regents of the University of California. All rights reserved. + * + * 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 above copyright + * 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 University 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 REGENTS 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 REGENTS 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. + * + * @(#)ip.h 8.1 (Berkeley) 6/10/93 + * ip.h,v 1.3 1994/08/21 05:27:30 paul Exp + */ + +#ifndef _IP_H_ +#define _IP_H_ + +#ifdef WORDS_BIGENDIAN +# ifndef NTOHL +# define NTOHL(d) +# endif +# ifndef NTOHS +# define NTOHS(d) +# endif +# ifndef HTONL +# define HTONL(d) +# endif +# ifndef HTONS +# define HTONS(d) +# endif +#else +# ifndef NTOHL +# define NTOHL(d) ((d) = ntohl((d))) +# endif +# ifndef NTOHS +# define NTOHS(d) ((d) = ntohs((u_int16_t)(d))) +# endif +# ifndef HTONL +# define HTONL(d) ((d) = htonl((d))) +# endif +# ifndef HTONS +# define HTONS(d) ((d) = htons((u_int16_t)(d))) +# endif +#endif + +typedef u_int32_t n_long; /* long as received from the net */ + +/* + * Definitions for internet protocol version 4. + * Per RFC 791, September 1981. + */ +#define IPVERSION 4 + +#if defined(_MSC_VER) +#pragma pack(push, 1) +#endif + +/* + * Structure of an internet header, naked of options. + */ +#ifdef PRAGMA_PACK_SUPPORTED +#pragma pack(1) +#endif + +struct ip { +#ifdef WORDS_BIGENDIAN + u_char ip_v:4, /* version */ + ip_hl:4; /* header length */ +#else + u_char ip_hl:4, /* header length */ + ip_v:4; /* version */ +#endif + u_int8_t ip_tos; /* type of service */ + u_int16_t ip_len; /* total length */ + u_int16_t ip_id; /* identification */ + u_int16_t ip_off; /* fragment offset field */ +#define IP_DF 0x4000 /* don't fragment flag */ +#define IP_MF 0x2000 /* more fragments flag */ +#define IP_OFFMASK 0x1fff /* mask for fragmenting bits */ + u_int8_t ip_ttl; /* time to live */ + u_int8_t ip_p; /* protocol */ + u_int16_t ip_sum; /* checksum */ + struct in_addr ip_src,ip_dst; /* source and dest address */ +} PACKED__; + +#ifdef PRAGMA_PACK_SUPPORTED +#pragma pack(PACK_END) //WAS 0 +#endif + +#define IP_MAXPACKET 65535 /* maximum packet size */ + +/* + * Definitions for IP type of service (ip_tos) + */ +#define IPTOS_LOWDELAY 0x10 +#define IPTOS_THROUGHPUT 0x08 +#define IPTOS_RELIABILITY 0x04 + +/* + * Definitions for options. + */ +#define IPOPT_COPIED(o) ((o)&0x80) +#define IPOPT_CLASS(o) ((o)&0x60) +#define IPOPT_NUMBER(o) ((o)&0x1f) + +#define IPOPT_CONTROL 0x00 +#define IPOPT_RESERVED1 0x20 +#define IPOPT_DEBMEAS 0x40 +#define IPOPT_RESERVED2 0x60 + +#define IPOPT_EOL 0 /* end of option list */ +#define IPOPT_NOP 1 /* no operation */ + +#define IPOPT_RR 7 /* record packet route */ +#define IPOPT_TS 68 /* timestamp */ +#define IPOPT_SECURITY 130 /* provide s,c,h,tcc */ +#define IPOPT_LSRR 131 /* loose source route */ +#define IPOPT_SATID 136 /* satnet id */ +#define IPOPT_SSRR 137 /* strict source route */ + +/* + * Offsets to fields in options other than EOL and NOP. + */ +#define IPOPT_OPTVAL 0 /* option ID */ +#define IPOPT_OLEN 1 /* option length */ +#define IPOPT_OFFSET 2 /* offset within option */ +#define IPOPT_MINOFF 4 /* min value of above */ + +/* + * Time stamp option structure. + */ +#ifdef PRAGMA_PACK_SUPPORTED +#pragma pack(1) +#endif + +struct ip_timestamp { + u_int8_t ipt_code; /* IPOPT_TS */ + u_int8_t ipt_len; /* size of structure (variable) */ + u_int8_t ipt_ptr; /* index of current entry */ +#ifdef WORDS_BIGENDIAN + u_char ipt_oflw:4, /* overflow counter */ + ipt_flg:4; /* flags, see below */ +#else + u_char ipt_flg:4, /* flags, see below */ + ipt_oflw:4; /* overflow counter */ +#endif + union ipt_timestamp { + n_long ipt_time[1]; + struct ipt_ta { + struct in_addr ipt_addr; + n_long ipt_time; + } ipt_ta[1]; + } ipt_timestamp; +} PACKED__; + +#ifdef PRAGMA_PACK_SUPPORTED +#pragma pack(PACK_END) +#endif + +/* flag bits for ipt_flg */ +#define IPOPT_TS_TSONLY 0 /* timestamps only */ +#define IPOPT_TS_TSANDADDR 1 /* timestamps and addresses */ +#define IPOPT_TS_PRESPEC 3 /* specified modules only */ + +/* bits for security (not byte swapped) */ +#define IPOPT_SECUR_UNCLASS 0x0000 +#define IPOPT_SECUR_CONFID 0xf135 +#define IPOPT_SECUR_EFTO 0x789a +#define IPOPT_SECUR_MMMM 0xbc4d +#define IPOPT_SECUR_RESTR 0xaf13 +#define IPOPT_SECUR_SECRET 0xd788 +#define IPOPT_SECUR_TOPSECRET 0x6bc5 + +/* + * Internet implementation parameters. + */ +#define MAXTTL 255 /* maximum time to live (seconds) */ +#define IPDEFTTL 64 /* default ttl, from RFC 1340 */ +#define IPFRAGTTL 60 /* time to live for frags, slowhz */ +#define IPTTLDEC 1 /* subtracted when forwarding */ + +#define IP_MSS 576 /* default maximum segment size */ + +#ifdef HAVE_SYS_TYPES32_H /* Overcome some Solaris 2.x junk */ +#include +#else +#if SIZEOF_CHAR_P == 4 +typedef SLIRPcaddr_t caddr32_t; +#else +typedef u_int32_t caddr32_t; +#endif +#endif + +#if defined(__amd64__) || defined(__aarch64__) +typedef uintptr_t ipqp_32; +typedef uintptr_t ipasfragp_32; +#else +#if SIZEOF_CHAR_P == 4 +typedef struct ipq *ipqp_32; +typedef struct ipasfrag *ipasfragp_32; +#else +typedef caddr32_t ipqp_32; +typedef caddr32_t ipasfragp_32; +#endif +#endif + +/* + * Overlay for ip header used by other protocols (tcp, udp). + */ +#ifdef PRAGMA_PACK_SUPPORTED +#pragma pack(1) +#endif + +struct ipovly { +#if defined(__amd64__) || defined(__aarch64__) + uintptr_t ih_next, ih_prev; /* for protocol sequence q's */ +#else + caddr32_t ih_next, ih_prev; /* for protocol sequence q's */ +#endif + u_int8_t ih_x1; /* (unused) */ + u_int8_t ih_pr; /* protocol */ + u_int16_t ih_len; /* protocol length */ + struct in_addr ih_src; /* source internet address */ + struct in_addr ih_dst; /* destination internet address */ +} PACKED__; + +#ifdef PRAGMA_PACK_SUPPORTED +#pragma pack(PACK_END) +#endif + +#if defined(_MSC_VER) +#pragma pack(pop) +#endif + +/* + * Ip reassembly queue structure. Each fragment + * being reassembled is attached to one of these structures. + * They are timed out after ipq_ttl drops to 0, and may also + * be reclaimed if memory becomes tight. + * size 28 bytes + */ +struct ipq { +#if defined(__amd64__) || defined(__aarch64__) + uintptr_t next,prev; /* to other reass headers */ +#else + ipqp_32 next,prev; /* to other reass headers */ +#endif + u_int8_t ipq_ttl; /* time for reass q to live */ + u_int8_t ipq_p; /* protocol of this fragment */ + u_int16_t ipq_id; /* sequence id for reassembly */ + ipasfragp_32 ipq_next,ipq_prev; + /* to ip headers of fragments */ + struct in_addr ipq_src,ipq_dst; +}; + +/* + * Ip header, when holding a fragment. + * + * Note: ipf_next must be at same offset as ipq_next above + */ +#ifdef PRAGMA_PACK_SUPPORTED +#pragma pack(1) +#endif + +struct ipasfrag { +#ifdef WORDS_BIGENDIAN + u_char ip_v:4, + ip_hl:4; +#else + u_char ip_hl:4, + ip_v:4; +#endif + /* BUG : u_int changed to u_int8_t. + * sizeof(u_int)==4 on linux 2.0 + */ + u_int8_t ipf_mff; /* XXX overlays ip_tos: use low bit + * to avoid destroying tos (PPPDTRuu); + * copied from (ip_off&IP_MF) */ + u_int16_t ip_len; + u_int16_t ip_id; + u_int16_t ip_off; + u_int8_t ip_ttl; + u_int8_t ip_p; + u_int16_t ip_sum; + ipasfragp_32 ipf_next; /* next fragment */ + ipasfragp_32 ipf_prev; /* previous fragment */ +} PACKED__; + +#ifdef PRAGMA_PACK_SUPPORTED +#pragma pack(PACK_END) //WAS 0 +#endif + +/* + * Structure stored in mbuf in inpcb.ip_options + * and passed to ip_output when ip options are in use. + * The actual length of the options (including ipopt_dst) + * is in m_len. + */ +#define MAX_IPOPTLEN 40 + +struct ipoption { + struct in_addr ipopt_dst; /* first-hop dst if source routed */ + int8_t ipopt_list[MAX_IPOPTLEN]; /* options proper */ +}; + +/* + * Structure attached to inpcb.ip_moptions and + * passed to ip_output when IP multicast options are in use. + */ + +struct ipstat { + u_long ips_total; /* total packets received */ + u_long ips_badsum; /* checksum bad */ + u_long ips_tooshort; /* packet too short */ + u_long ips_toosmall; /* not enough data */ + u_long ips_badhlen; /* ip header length < data size */ + u_long ips_badlen; /* ip length < ip header length */ + u_long ips_fragments; /* fragments received */ + u_long ips_fragdropped; /* frags dropped (dups, out of space) */ + u_long ips_fragtimeout; /* fragments timed out */ + u_long ips_forward; /* packets forwarded */ + u_long ips_cantforward; /* packets rcvd for unreachable dest */ + u_long ips_redirectsent; /* packets forwarded on same net */ + u_long ips_noproto; /* unknown or unsupported protocol */ + u_long ips_delivered; /* datagrams delivered to upper level*/ + u_long ips_localout; /* total ip packets generated here */ + u_long ips_odropped; /* lost packets due to nobufs, etc. */ + u_long ips_reassembled; /* total packets reassembled ok */ + u_long ips_fragmented; /* datagrams successfully fragmented */ + u_long ips_ofragments; /* output fragments created */ + u_long ips_cantfrag; /* don't fragment flag was set, etc. */ + u_long ips_badoptions; /* error in option processing */ + u_long ips_noroute; /* packets discarded due to no route */ + u_long ips_badvers; /* ip version != 4 */ + u_long ips_rawout; /* total raw ip packets generated */ + u_long ips_unaligned; /* times the ip packet was not aligned */ +}; + +extern struct ipstat ipstat; +extern struct ipq ipq; /* ip reass. queue */ +extern u_int16_t ip_id; /* ip packet ctr, for ids */ +extern int ip_defttl; /* default IP ttl */ + +#endif diff --git a/src/include/slirp/ip_icmp.h b/src/include/slirp/ip_icmp.h new file mode 100644 index 000000000..20fcda1bd --- /dev/null +++ b/src/include/slirp/ip_icmp.h @@ -0,0 +1,168 @@ +/* + * Copyright (c) 1982, 1986, 1993 + * The Regents of the University of California. All rights reserved. + * + * 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 above copyright + * 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 University 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 REGENTS 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 REGENTS 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. + * + * @(#)ip_icmp.h 8.1 (Berkeley) 6/10/93 + * ip_icmp.h,v 1.4 1995/05/30 08:09:43 rgrimes Exp + */ + +#ifndef _NETINET_IP_ICMP_H_ +#define _NETINET_IP_ICMP_H_ + +/* + * Interface Control Message Protocol Definitions. + * Per RFC 792, September 1981. + */ + +typedef u_int32_t n_time; + +/* + * Structure of an icmp header. + */ +#ifdef PRAGMA_PACK_SUPPORTED +#pragma pack(1) +#endif + +struct icmp { + u_char icmp_type; /* type of message, see below */ + u_char icmp_code; /* type sub code */ + u_short icmp_cksum; /* ones complement cksum of struct */ + union { + u_char ih_pptr; /* ICMP_PARAMPROB */ + struct in_addr ih_gwaddr; /* ICMP_REDIRECT */ + struct ih_idseq { + u_short icd_id; + u_short icd_seq; + } ih_idseq; + int ih_void; + + /* ICMP_UNREACH_NEEDFRAG -- Path MTU Discovery (RFC1191) */ + struct ih_pmtu { + u_short ipm_void; + u_short ipm_nextmtu; + } ih_pmtu; + } icmp_hun; +#define icmp_pptr icmp_hun.ih_pptr +#define icmp_gwaddr icmp_hun.ih_gwaddr +#define icmp_id icmp_hun.ih_idseq.icd_id +#define icmp_seq icmp_hun.ih_idseq.icd_seq +#define icmp_void icmp_hun.ih_void +#define icmp_pmvoid icmp_hun.ih_pmtu.ipm_void +#define icmp_nextmtu icmp_hun.ih_pmtu.ipm_nextmtu + union { + struct id_ts { + n_time its_otime; + n_time its_rtime; + n_time its_ttime; + } id_ts; + struct id_ip { + struct ip idi_ip; + /* options and then 64 bits of data */ + } id_ip; + uint32_t id_mask; + char id_data[1]; + } icmp_dun; +#define icmp_otime icmp_dun.id_ts.its_otime +#define icmp_rtime icmp_dun.id_ts.its_rtime +#define icmp_ttime icmp_dun.id_ts.its_ttime +#define icmp_ip icmp_dun.id_ip.idi_ip +#define icmp_mask icmp_dun.id_mask +#define icmp_data icmp_dun.id_data +} PACKED__; + +#ifdef PRAGMA_PACK_SUPPORTED +#pragma pack(0) +#endif + +/* + * Lower bounds on packet lengths for various types. + * For the error advice packets must first insure that the + * packet is large enought to contain the returned ip header. + * Only then can we do the check to see if 64 bits of packet + * data have been returned, since we need to check the returned + * ip header length. + */ +#define ICMP_MINLEN 8 /* abs minimum */ +#define ICMP_TSLEN (8 + 3 * sizeof (n_time)) /* timestamp */ +#define ICMP_MASKLEN 12 /* address mask */ +#define ICMP_ADVLENMIN (8 + sizeof (struct ip) + 8) /* min */ +#define ICMP_ADVLEN(p) (8 + ((p)->icmp_ip.ip_hl << 2) + 8) + /* N.B.: must separately check that ip_hl >= 5 */ + +/* + * Definition of type and code field values. + */ +#define ICMP_ECHOREPLY 0 /* echo reply */ +#define ICMP_UNREACH 3 /* dest unreachable, codes: */ +#define ICMP_UNREACH_NET 0 /* bad net */ +#define ICMP_UNREACH_HOST 1 /* bad host */ +#define ICMP_UNREACH_PROTOCOL 2 /* bad protocol */ +#define ICMP_UNREACH_PORT 3 /* bad port */ +#define ICMP_UNREACH_NEEDFRAG 4 /* IP_DF caused drop */ +#define ICMP_UNREACH_SRCFAIL 5 /* src route failed */ +#define ICMP_UNREACH_NET_UNKNOWN 6 /* unknown net */ +#define ICMP_UNREACH_HOST_UNKNOWN 7 /* unknown host */ +#define ICMP_UNREACH_ISOLATED 8 /* src host isolated */ +#define ICMP_UNREACH_NET_PROHIB 9 /* prohibited access */ +#define ICMP_UNREACH_HOST_PROHIB 10 /* ditto */ +#define ICMP_UNREACH_TOSNET 11 /* bad tos for net */ +#define ICMP_UNREACH_TOSHOST 12 /* bad tos for host */ +#define ICMP_SOURCEQUENCH 4 /* packet lost, slow down */ +#define ICMP_REDIRECT 5 /* shorter route, codes: */ +#define ICMP_REDIRECT_NET 0 /* for network */ +#define ICMP_REDIRECT_HOST 1 /* for host */ +#define ICMP_REDIRECT_TOSNET 2 /* for tos and net */ +#define ICMP_REDIRECT_TOSHOST 3 /* for tos and host */ +#define ICMP_ECHO 8 /* echo service */ +#define ICMP_ROUTERADVERT 9 /* router advertisement */ +#define ICMP_ROUTERSOLICIT 10 /* router solicitation */ +#define ICMP_TIMXCEED 11 /* time exceeded, code: */ +#define ICMP_TIMXCEED_INTRANS 0 /* ttl==0 in transit */ +#define ICMP_TIMXCEED_REASS 1 /* ttl==0 in reass */ +#define ICMP_PARAMPROB 12 /* ip header bad */ +#define ICMP_PARAMPROB_OPTABSENT 1 /* req. opt. absent */ +#define ICMP_TSTAMP 13 /* timestamp request */ +#define ICMP_TSTAMPREPLY 14 /* timestamp reply */ +#define ICMP_IREQ 15 /* information request */ +#define ICMP_IREQREPLY 16 /* information reply */ +#define ICMP_MASKREQ 17 /* address mask request */ +#define ICMP_MASKREPLY 18 /* address mask reply */ + +#define ICMP_MAXTYPE 18 + +#define ICMP_INFOTYPE(type) \ + ((type) == ICMP_ECHOREPLY || (type) == ICMP_ECHO || \ + (type) == ICMP_ROUTERADVERT || (type) == ICMP_ROUTERSOLICIT || \ + (type) == ICMP_TSTAMP || (type) == ICMP_TSTAMPREPLY || \ + (type) == ICMP_IREQ || (type) == ICMP_IREQREPLY || \ + (type) == ICMP_MASKREQ || (type) == ICMP_MASKREPLY) + +void icmp_input _P((struct SLIRPmbuf *, int)); +void icmp_error _P((struct SLIRPmbuf *, u_char, u_char, int, char *)); +void icmp_reflect _P((struct SLIRPmbuf *)); + +#endif diff --git a/src/include/slirp/libslirp.h b/src/include/slirp/libslirp.h new file mode 100644 index 000000000..8a1aa31e6 --- /dev/null +++ b/src/include/slirp/libslirp.h @@ -0,0 +1,41 @@ +#ifndef _LIBSLIRP_H +#define _LIBSLIRP_H + +#ifdef _WIN32 +#include +int inet_aton(const char *cp, struct in_addr *ia); +#else +#include +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +int slirp_init(void); + +int slirp_select_fill(int *pnfds, + fd_set *readfds, fd_set *writefds, fd_set *xfds); + +void slirp_select_poll(fd_set *readfds, fd_set *writefds, fd_set *xfds); + +void slirp_input(const uint8 *pkt, int pkt_len); + +/* you must provide the following functions: */ +int slirp_can_output(void); +void slirp_output(const uint8 *pkt, int pkt_len); + +int slirp_redir(int is_udp, int host_port, + struct in_addr guest_addr, int guest_port); +int slirp_add_exec(int do_pty, const char *args, int addr_low_byte, + int guest_port); + +extern const char *tftp_prefix; +extern char slirp_hostname[33]; + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/include/slirp/main.h b/src/include/slirp/main.h new file mode 100644 index 000000000..181b6ae88 --- /dev/null +++ b/src/include/slirp/main.h @@ -0,0 +1,54 @@ +/* + * Copyright (c) 1995 Danny Gasparovski. + * + * Please read the file COPYRIGHT for the + * terms and conditions of the copyright. + */ + +#ifdef HAVE_SYS_SELECT_H +#include +#endif + +#define TOWRITEMAX 512 + +extern struct timeval tt; +extern int link_up; +extern int slirp_socket; +extern int slirp_socket_unit; +extern int slirp_socket_port; +extern u_int32_t slirp_socket_addr; +extern char *slirp_socket_passwd; +extern int ctty_closed; + +/* + * Get the difference in 2 times from updtim() + * Allow for wraparound times, "just in case" + * x is the greater of the 2 (current time) and y is + * what it's being compared against. + */ +#define TIME_DIFF(x,y) (x)-(y) < 0 ? ~0-(y)+(x) : (x)-(y) + +extern char *slirp_tty; +extern char *exec_shell; +extern u_int curtime; +extern fd_set *global_readfds, *global_writefds, *global_xfds; +extern struct in_addr ctl_addr; +extern struct in_addr special_addr; +extern struct in_addr alias_addr; +extern struct in_addr our_addr; +extern struct in_addr loopback_addr; +extern struct in_addr dns_addr; +extern char *username; +extern char *socket_path; +extern int towrite_max; +extern int ppp_exit; +extern int so_options; +extern int tcp_keepintvl; +extern uint8_t client_ethaddr[6]; + +#define PROTO_SLIP 0x1 +#ifdef USE_PPP +#define PROTO_PPP 0x2 +#endif + +void if_encap(const uint8_t *ip_data, int ip_data_len); diff --git a/src/include/slirp/mbuf.h b/src/include/slirp/mbuf.h new file mode 100644 index 000000000..4921506b5 --- /dev/null +++ b/src/include/slirp/mbuf.h @@ -0,0 +1,143 @@ +/* + * Copyright (c) 1982, 1986, 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * 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 above copyright + * 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 University 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 REGENTS 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 REGENTS 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. + * + * @(#)mbuf.h 8.3 (Berkeley) 1/21/94 + * mbuf.h,v 1.9 1994/11/14 13:54:20 bde Exp + */ + +#ifndef _MBUF_H_ +#define _MBUF_H_ + +#define m_freem m_free + + +#define MINCSIZE 4096 /* Amount to increase mbuf if too small */ + +/* + * Macros for type conversion + * mtod(m,t) - convert mbuf pointer to data pointer of correct type + * dtom(x) - convert data pointer within mbuf to mbuf pointer (XXX) + */ +#define mtod(m,t) ((t)(m)->m_data) +/* #define dtom(x) ((struct SLIRPmbuf *)((int)(x) & ~(M_SIZE-1))) */ + +/* XXX About mbufs for slirp: + * Only one mbuf is ever used in a chain, for each "cell" of data. + * m_nextpkt points to the next packet, if fragmented. + * If the data is too large, the M_EXT is used, and a larger block + * is alloced. Therefore, m_free[m] must check for M_EXT and if set + * free the m_ext. This is inefficient memory-wise, but who cares. + */ + +/* XXX should union some of these! */ +/* header at beginning of each mbuf: */ +struct m_hdr { + struct SLIRPmbuf *mh_next; /* Linked list of mbufs */ + struct SLIRPmbuf *mh_prev; + struct SLIRPmbuf *mh_nextpkt; /* Next packet in queue/record */ + struct SLIRPmbuf *mh_prevpkt; /* Flags aren't used in the output queue */ + int mh_flags; /* Misc flags */ + + size_t mh_size; /* Size of data */ + struct SLIRPsocket *mh_so; + + SLIRPcaddr_t mh_data; /* Location of data */ + int32_t mh_len; /* Amount of data in this mbuf */ +}; + +/* + * How much room is in the mbuf, from m_data to the end of the mbuf + */ +#define M_ROOM(m) ((m->m_flags & M_EXT)? \ + (((m)->m_ext + (m)->m_size) - (m)->m_data) \ + : \ + (((m)->m_dat + (m)->m_size) - (m)->m_data)) + +/* + * How much free room there is + */ +#define M_FREEROOM(m) (M_ROOM(m) - (m)->m_len) +#define M_TRAILINGSPACE M_FREEROOM + +struct SLIRPmbuf { + struct m_hdr m_hdr; + union M_dat { + char m_dat_[1]; /* ANSI don't like 0 sized arrays */ + char *m_ext_; + } M_dat; +}; + +#define m_next m_hdr.mh_next +#define m_prev m_hdr.mh_prev +#define m_nextpkt m_hdr.mh_nextpkt +#define m_prevpkt m_hdr.mh_prevpkt +#define m_flags m_hdr.mh_flags +#define m_len m_hdr.mh_len +#define m_data m_hdr.mh_data +#define m_size m_hdr.mh_size +#define m_dat M_dat.m_dat_ +#define m_ext M_dat.m_ext_ +#define m_so m_hdr.mh_so + +#define ifq_prev m_prev +#define ifq_next m_next +#define ifs_prev m_prevpkt +#define ifs_next m_nextpkt +#define ifq_so m_so + +#define M_EXT 0x01 /* m_ext points to more (malloced) data */ +#define M_FREELIST 0x02 /* mbuf is on free list */ +#define M_USEDLIST 0x04 /* XXX mbuf is on used list (for dtom()) */ +#define M_DOFREE 0x08 /* when m_free is called on the mbuf, free() + * it rather than putting it on the free list */ + +/* + * Mbuf statistics. XXX + */ + +struct mbstat { + int mbs_alloced; /* Number of mbufs allocated */ + +}; + +extern struct mbstat mbstat; +extern int mbuf_alloced; +extern struct SLIRPmbuf m_freelist, m_usedlist; +extern int mbuf_max; + +void m_init _P((void)); +void msize_init _P((void)); +struct SLIRPmbuf * m_get _P((void)); +void m_free _P((struct SLIRPmbuf *)); +void m_cat _P((register struct SLIRPmbuf *, register struct SLIRPmbuf *)); +void m_inc _P((struct SLIRPmbuf *, int)); +void m_adj _P((struct SLIRPmbuf *, int)); +int m_copy _P((struct SLIRPmbuf *, struct SLIRPmbuf *, int, int)); +struct SLIRPmbuf * dtom _P((void *)); + +#endif diff --git a/src/include/slirp/misc.h b/src/include/slirp/misc.h new file mode 100644 index 000000000..c509deb92 --- /dev/null +++ b/src/include/slirp/misc.h @@ -0,0 +1,87 @@ +/* + * Copyright (c) 1995 Danny Gasparovski. + * + * Please read the file COPYRIGHT for the + * terms and conditions of the copyright. + */ + +#ifndef _MISC_H_ +#define _MISC_H_ + +struct ex_list { + int ex_pty; /* Do we want a pty? */ + int ex_addr; /* The last byte of the address */ + int ex_fport; /* Port to telnet to */ + char *ex_exec; /* Command line of what to exec */ + struct ex_list *ex_next; +}; + +extern struct ex_list *exec_list; +extern u_int curtime, time_fasttimo, last_slowtimo, detach_time, detach_wait; + +extern int (*lprint_print) _P((void *, const char *, va_list)); +extern char *lprint_ptr, *lprint_ptr2, **lprint_arg; +extern struct sbuf *lprint_sb; + +#ifndef HAVE_STRDUP +char *strdup _P((const char *)); +#endif + +void do_wait _P((int)); + +#define EMU_NONE 0x0 + +/* TCP emulations */ +#define EMU_CTL 0x1 +#define EMU_FTP 0x2 +#define EMU_KSH 0x3 +#define EMU_IRC 0x4 +#define EMU_REALAUDIO 0x5 +#define EMU_RLOGIN 0x6 +#define EMU_IDENT 0x7 +#define EMU_RSH 0x8 + +#define EMU_NOCONNECT 0x10 /* Don't connect */ + +/* UDP emulations */ +#define EMU_TALK 0x1 +#define EMU_NTALK 0x2 +#define EMU_CUSEEME 0x3 + +struct tos_t { + u_int16_t lport; + u_int16_t fport; + u_int8_t tos; + u_int8_t emu; +}; + +struct emu_t { + u_int16_t lport; + u_int16_t fport; + u_int8_t tos; + u_int8_t emu; + struct emu_t *next; +}; + +extern struct emu_t *tcpemu; + +extern int x_port, x_server, x_display; + +int show_x _P((char *, struct SLIRPsocket *)); +void redir_x _P((u_int32_t, int, int, int)); +void getouraddr _P((void)); +void slirp_insque _P((void *, void *)); +void slirp_remque _P((void *)); +int add_exec _P((struct ex_list **, int, char *, int, int)); +int slirp_openpty _P((int *, int *)); +int fork_exec _P((struct SLIRPsocket *, char *, int)); +void snooze_hup _P((int)); +void snooze _P((void)); +void relay _P((int)); +void add_emu _P((char *)); +void u_sleep _P((int)); +void fd_nonblock _P((int)); +void fd_block _P((int)); +int rsh_exec _P((struct SLIRPsocket *, struct SLIRPsocket *, char *, char *, char *)); + +#endif diff --git a/src/include/slirp/queue.h b/src/include/slirp/queue.h new file mode 100644 index 000000000..786950ab7 --- /dev/null +++ b/src/include/slirp/queue.h @@ -0,0 +1,101 @@ +/* + * File: queue.h + * Author: Robert I. Pitts + * Last Modified: March 9, 2000 + * Topic: Queue - Array Implementation + * ---------------------------------------------------------------- + */ + +#ifndef _QUEUE_H +#define _QUEUE_H + +/* + * Constants + * --------- + * ERROR_* These signal error conditions in queue functions + * and are used as exit codes for the program. + */ +#define ERROR_QUEUE 2 +#define ERROR_MEMORY 3 + +/* + * Type: queueElementT + * ------------------- + * This is the type of objects held in the queue. + */ + +/*typedef char queueElementT; +typedef unsigned char *queueElementT; +*/ + +struct queuepacket{ + int len; + unsigned char data[2000]; +}; +typedef struct queuepacket *queueElementT; + +/* + * Type: queueADT + * -------------- + * The actual implementation of a queue is completely + * hidden. Client will work with queueADT which is a + * pointer to underlying queueCDT. + */ + +/* + * NOTE: need word struct below so that the compiler + * knows at least that a queueCDT will be some sort + * of struct. + */ + +typedef struct queueCDT *queueADT; + +/* + * Function: QueueCreate + * Usage: queue = QueueCreate(); + * ------------------------- + * A new empty queue is created and returned. + */ + +queueADT QueueCreate(void); + +/* Function: QueueDestroy + * Usage: QueueDestroy(queue); + * ----------------------- + * This function frees all memory associated with + * the queue. "queue" may not be used again unless + * queue = QueueCreate() is called first. + */ + +void QueueDestroy(queueADT queue); + +/* + * Functions: QueueEnter, QueueDelete + * Usage: QueueEnter(queue, element); + * element = QueueDelete(queue); + * -------------------------------------------- + * These are the fundamental queue operations that enter + * elements in and delete elements from the queue. A call + * to QueueDelete() on an empty queue or to QueueEnter() + * on a full queue is an error. Make use of QueueIsFull() + * and QueueIsEmpty() (see below) to avoid these errors. + */ + +void QueueEnter(queueADT queue, queueElementT element); +queueElementT QueueDelete(queueADT queue); + + +/* + * Functions: QueueIsEmpty, QueueIsFull + * Usage: if (QueueIsEmpty(queue)) ... + * ----------------------------------- + * These return a true/false value based on whether + * the queue is empty or full, respectively. + */ + +int QueueIsEmpty(queueADT queue); +int QueueIsFull(queueADT queue); + +int QueuePeek(queueADT queue); + +#endif /* not defined _QUEUE_H */ diff --git a/src/include/slirp/sbuf.h b/src/include/slirp/sbuf.h new file mode 100644 index 000000000..aa4724df7 --- /dev/null +++ b/src/include/slirp/sbuf.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 1995 Danny Gasparovski. + * + * Please read the file COPYRIGHT for the + * terms and conditions of the copyright. + */ + +#ifndef _SBUF_H_ +#define _SBUF_H_ + +#define sbflush(sb) sbdrop((sb),(sb)->sb_cc) +#define sbspace(sb) ((sb)->sb_datalen - (sb)->sb_cc) + +struct sbuf { + u_int sb_cc; /* actual chars in buffer */ + u_int sb_datalen; /* Length of data */ + char *sb_wptr; /* write pointer. points to where the next + * bytes should be written in the sbuf */ + char *sb_rptr; /* read pointer. points to where the next + * byte should be read from the sbuf */ + char *sb_data; /* Actual data */ +}; + +void sbfree _P((struct sbuf *)); +void sbdrop _P((struct sbuf *, int)); +void sbreserve _P((struct sbuf *, int)); +void sbappend _P((struct SLIRPsocket *, struct SLIRPmbuf *)); +void sbappendsb _P((struct sbuf *, struct SLIRPmbuf *)); +void sbcopy _P((struct sbuf *, int, int, char *)); + +#endif diff --git a/src/include/slirp/slirp.h b/src/include/slirp/slirp.h new file mode 100644 index 000000000..b78dc93a8 --- /dev/null +++ b/src/include/slirp/slirp.h @@ -0,0 +1,441 @@ +#ifndef __COMMON_H__ +#define __COMMON_H__ + +#define SLIRP_VERSION "Cockatrice special" + +#define CONFIG_QEMU + +#ifndef CONFIG_QEMU +#include "version.h" +#endif +#include "config.h" +#include "slirp_config.h" + +#ifdef _WIN32 +#ifdef __GNUC__ /* MINGW? */ +# include +typedef uint8_t u_int8_t; +typedef uint16_t u_int16_t; +typedef uint32_t u_int32_t; +typedef uint64_t u_int64_t; +typedef char *SLIRPcaddr_t; +typedef int socklen_t; +typedef unsigned long ioctlsockopt_t; +#else +typedef unsigned char u_int8_t; +typedef char int8_t; +typedef unsigned char uint8_t; +typedef unsigned short u_int16_t; +typedef unsigned short uint16_t; +typedef short int16_t; +typedef unsigned int u_int32_t; +typedef unsigned int uint32_t; +typedef int int32_t; + +typedef unsigned __int64 u_int64_t; +typedef char *SLIRPcaddr_t; +typedef int socklen_t; +typedef unsigned long ioctlsockopt_t; + +#endif + +# include /* needs to be on top otherwise, it'll pull in winsock1 */ +# include + +# include +# include + +# define USE_FIONBIO 1 +#ifndef EWOULDBLOCK +# define EWOULDBLOCK WSAEWOULDBLOCK +#endif +#ifndef EINPROGRESS +# define EINPROGRESS WSAEINPROGRESS +#endif +#ifndef ENOTCONN +# define ENOTCONN WSAENOTCONN +#endif +#ifndef EHOSTUNREACH +# define EHOSTUNREACH WSAEHOSTUNREACH +#endif +#ifndef ENETUNREACH +# define ENETUNREACH WSAENETUNREACH +#endif +#ifndef ECONNREFUSED +# define ECONNREFUSED WSAECONNREFUSED +#endif + +/* Basilisk II Router defines those */ +# define udp_read_completion slirp_udp_read_completion +# define write_udp slirp_write_udp +# define init_udp slirp_init_udp +# define final_udp slirp_final_udp +#else +# include +# define HAVE_STDINT_H +# define HAVE_STDLIB_H +# define HAVE_STRING_H +# define HAVE_UNISTD_H +# define HAVE_INET_ATON +typedef uint8_t u_int8_t; +typedef uint16_t u_int16_t; +typedef uint32_t u_int32_t; +typedef uint64_t u_int64_t; +typedef char *SLIRPcaddr_t; +typedef int ioctlsockopt_t; +# define ioctlsocket ioctl +# define closesocket(s) close(s) +# define O_BINARY 0 +#endif + +#include +#ifdef HAVE_SYS_BITYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif + +#ifndef _MSC_VER +#include +#else +#include +#endif + +#ifdef NEED_TYPEDEFS +typedef char int8_t; +typedef unsigned char u_int8_t; + +# if SIZEOF_SHORT == 2 + typedef short int16_t; + typedef unsigned short u_int16_t; +# else +# if SIZEOF_INT == 2 + typedef int int16_t; + typedef unsigned int u_int16_t; +# else + #error Cannot find a type with sizeof() == 2 +# endif +# endif + +# if SIZEOF_SHORT == 4 + typedef short int32_t; + typedef unsigned short u_int32_t; +# else +# if SIZEOF_INT == 4 + typedef int int32_t; + typedef unsigned int u_int32_t; +# else + #error Cannot find a type with sizeof() == 4 +# endif +# endif +#endif /* NEED_TYPEDEFS */ + +/* Basilisk II types glue */ +typedef u_int8_t uint8; +typedef u_int16_t uint16; +typedef u_int32_t uint32; + +#ifdef HAVE_UNISTD_H +# include +#endif + +#ifdef HAVE_STDLIB_H +# include +#endif + +#include +#include + +#ifndef HAVE_MEMMOVE +#define memmove(x, y, z) bcopy(y, x, z) +#endif + +#if TIME_WITH_SYS_TIME +# include +# include +#else +# if HAVE_SYS_TIME_H +# include +# else +# include +# endif +#endif + +#ifdef HAVE_STRING_H +# include +#else +#ifndef _MSC_VER +# include +#else +#include +#endif +#endif + +#ifndef _WIN32 +#include +#endif + +#ifndef _P +#ifndef NO_PROTOTYPES +# define _P(x) x +#else +# define _P(x) () +#endif +#endif + +#ifndef _WIN32 +#include +#include +#endif + +#ifdef GETTIMEOFDAY_ONE_ARG +#define gettimeofday(x, y) gettimeofday(x) +#endif + +/* Systems lacking strdup() definition in . */ +#if defined(ultrix) +char *strdup _P((const char *)); +#endif + +/* Systems lacking malloc() definition in . */ +#if defined(ultrix) || defined(hcx) +void *malloc _P((size_t arg)); +void free _P((void *ptr)); +#endif + +#ifndef HAVE_INET_ATON +int inet_aton _P((const char *cp, struct in_addr *ia)); +#endif + +#include +#ifndef NO_UNIX_SOCKETS +#include +#endif +#include +#ifdef HAVE_SYS_SIGNAL_H +# include +#endif +#ifndef _WIN32 +#include +#endif + +#if defined(HAVE_SYS_IOCTL_H) +# include +#endif + +#ifdef HAVE_SYS_SELECT_H +# include +#endif + +#ifdef HAVE_SYS_WAIT_H +# include +#endif + +#ifdef HAVE_SYS_FILIO_H +# include +#endif + +#ifdef USE_PPP +#include +#endif + +#ifdef __STDC__ +#include +#else +#include +#endif + +#include + +/* Avoid conflicting with the libc insque() and remque(), which + have different prototypes. */ +#define insque slirp_insque +#define remque slirp_remque + +#ifdef HAVE_SYS_STROPTS_H +#include +#endif + +#include "debug.h" + +#if defined __GNUC__ +#define PACKED__ __attribute__ ((packed)) +#elif defined __sgi +#define PRAGMA_PACK_SUPPORTED 1 +#define PACK_END 0 +#define PACKED__ +#elif _MSC_VER +#define PACKED__ +#else +#error "Packed attribute or pragma shall be supported" +#endif + +#if defined(_MSC_VER) +#pragma pack(push, 1) +#endif + +#include "ip.h" +#include "tcp.h" +#include "tcp_timer.h" +#include "tcp_var.h" +#include "tcpip.h" +#include "udp.h" +#include "icmp_var.h" +#include "mbuf.h" +#include "sbuf.h" +#include "socket.h" +#include "if.h" +#include "main.h" +#include "misc.h" +#include "ctl.h" +#ifdef USE_PPP +#include "ppp/pppd.h" +#include "ppp/ppp.h" +#endif + +#include "bootp.h" +#include "tftp.h" +#include "libslirp.h" + +extern struct ttys *ttys_unit[MAX_INTERFACES]; + +#ifndef NULL +#define NULL (void *)0 +#endif + +#ifndef FULL_BOLT +void if_start _P((void)); +#else +void if_start _P((struct ttys *)); +#endif + +#ifdef BAD_SPRINTF +# define vsprintf vsprintf_len +# define sprintf sprintf_len + extern int vsprintf_len _P((char *, const char *, va_list)); + extern int sprintf_len _P((char *, const char *, ...)); +#endif + +#ifdef DECLARE_SPRINTF +# ifndef BAD_SPRINTF + extern int vsprintf _P((char *, const char *, va_list)); +# endif + extern int vfprintf _P((FILE *, const char *, va_list)); +#endif + +#ifndef HAVE_STRERROR +#ifndef _MSC_VER + extern char *strerror _P((int error)); + #define HAVE_STRERROR +#endif +#endif + +#ifndef HAVE_INDEX + char *index _P((const char *, int)); +#endif + +#ifndef HAVE_GETHOSTID + long gethostid _P((void)); +#endif + +void lprint _P((const char *, ...)); + +extern int do_echo; + +#ifdef _MSC_VER +#define __inline +#endif + +#if SIZEOF_CHAR_P == 4 +# define insque_32 insque +# define remque_32 remque +#else +# ifdef NEED_QUE32_INLINE +extern __inline void insque_32 _P((void *, void *)); +extern __inline void remque_32 _P((void *)); +# else +extern void insque_32 _P((void *, void *)); +extern void remque_32 _P((void *)); +# endif +#endif + +#ifndef _WIN32 +#include +#endif + +#define DEFAULT_BAUD 115200 + +/* cksum.c */ +int cksum(struct SLIRPmbuf *m, int len); + +/* if.c */ +void if_init _P((void)); +void if_output _P((struct SLIRPsocket *, struct SLIRPmbuf *)); + +/* ip_input.c */ +void ip_init _P((void)); +void ip_input _P((struct SLIRPmbuf *)); +struct ip * ip_reass _P((register struct ipasfrag *, register struct ipq *)); +void ip_freef _P((struct ipq *)); +void ip_enq _P((register struct ipasfrag *, register struct ipasfrag *)); +void ip_deq _P((register struct ipasfrag *)); +void ip_slowtimo _P((void)); +void ip_stripoptions _P((register struct SLIRPmbuf *, struct SLIRPmbuf *)); + +/* ip_output.c */ +int ip_output _P((struct SLIRPsocket *, struct SLIRPmbuf *)); + +/* tcp_input.c */ +int tcp_reass _P((register struct tcpcb *, register struct tcpiphdr *, struct SLIRPmbuf *)); +void tcp_input _P((register struct SLIRPmbuf *, int, struct SLIRPsocket *)); +void tcp_dooptions _P((struct tcpcb *, u_char *, int, struct tcpiphdr *)); +void tcp_xmit_timer _P((register struct tcpcb *, int)); +int tcp_mss _P((register struct tcpcb *, u_int)); + +/* tcp_output.c */ +int tcp_output _P((register struct tcpcb *)); +void tcp_setpersist _P((register struct tcpcb *)); + +/* tcp_subr.c */ +void tcp_init _P((void)); +void tcp_template _P((struct tcpcb *)); +void tcp_respond _P((struct tcpcb *, register struct tcpiphdr *, register struct SLIRPmbuf *, tcp_seq, tcp_seq, int)); +struct tcpcb * tcp_newtcpcb _P((struct SLIRPsocket *)); +struct tcpcb * tcp_close _P((register struct tcpcb *)); +void tcp_drain _P((void)); +void tcp_sockclosed _P((struct tcpcb *)); +int tcp_fconnect _P((struct SLIRPsocket *)); +void tcp_connect _P((struct SLIRPsocket *)); +int tcp_attach _P((struct SLIRPsocket *)); +u_int8_t tcp_tos _P((struct SLIRPsocket *)); +int tcp_emu _P((struct SLIRPsocket *, struct SLIRPmbuf *)); +int tcp_ctl _P((struct SLIRPsocket *)); +struct tcpcb *tcp_drop(struct tcpcb *tp, int err); + + +#if defined(_MSC_VER) +#pragma pack(pop) +#endif + +#ifdef USE_PPP +#define MIN_MRU MINMRU +#define MAX_MRU MAXMRU +#else +#define MIN_MRU 128 +#define MAX_MRU 16384 +#endif + +#ifndef _WIN32 +#define min(x,y) ((x) < (y) ? (x) : (y)) +#define max(x,y) ((x) > (y) ? (x) : (y)) +#endif + +#ifdef _WIN32 +#undef errno +#define errno (WSAGetLastError()) +#endif + +#define PROBE_CONN + +#endif diff --git a/src/include/slirp/slirp_config.h b/src/include/slirp/slirp_config.h new file mode 100644 index 000000000..e583dcc80 --- /dev/null +++ b/src/include/slirp/slirp_config.h @@ -0,0 +1,135 @@ +/* + * User definable configuration options + */ + +/* Undefine if you don't want talk emulation */ +#undef EMULATE_TALK + +/* Define if you want the connection to be probed */ +/* XXX Not working yet, so ignore this for now */ +#undef PROBE_CONN + +/* Define to 1 if you want KEEPALIVE timers */ +#define DO_KEEPALIVE 0 + +/* Define to MAX interfaces you expect to use at once */ +/* MAX_INTERFACES determines the max. TOTAL number of interfaces (SLIP and PPP) */ +/* MAX_PPP_INTERFACES determines max. number of PPP interfaces */ +#define MAX_INTERFACES 1 +#define MAX_PPP_INTERFACES 1 + +/* Define if you want slirp's socket in /tmp */ +/* XXXXXX Do this in ./configure */ +#undef USE_TMPSOCKET + +/* Define if you want slirp to use cfsetXspeed() on the terminal */ +#undef DO_CFSETSPEED + +/* Define this if you want slirp to write to the tty as fast as it can */ +/* This should only be set if you are using load-balancing, slirp does a */ +/* pretty good job on single modems already, and seting this will make */ +/* interactive sessions less responsive */ +/* XXXXX Talk about having fast modem as unit 0 */ +#undef FULL_BOLT + +/* + * Define if you want slirp to use less CPU + * You will notice a small lag in interactive sessions, but it's not that bad + * Things like Netscape/ftp/etc. are completely unaffected + * This is mainly for sysadmins who have many slirp users + */ +#undef USE_LOWCPU + +/* Define this if your compiler doesn't like prototypes */ +#ifndef __STDC__ +#define NO_PROTOTYPES +#endif + +/*********************************************************/ +/* + * Autoconf defined configuration options + * You shouldn't need to touch any of these + */ + +/* Ignore this */ +#undef DUMMY_PPP + +/* XXX: Define according to how time.h should be included */ +#undef TIME_WITH_SYS_TIME +#define TIME_WITH_SYS_TIME 0 +#undef HAVE_SYS_TIME_H + +/* Define if your sprintf returns char * instead of int */ +#undef BAD_SPRINTF + +/* Define if you have readv */ +#undef HAVE_READV + +/* Define if iovec needs to be declared */ +#undef DECLARE_IOVEC +#ifdef _WIN32 +#define DECLARE_IOVEC +#endif + +/* Define if a declaration of sprintf/fprintf is needed */ +#undef DECLARE_SPRINTF + +/* Define if you have sys/stropts.h */ +#undef HAVE_SYS_STROPTS_H + +/* Define if your compiler doesn't like prototypes */ +#undef NO_PROTOTYPES + +/* Define if you don't have u_int32_t etc. typedef'd */ +#undef NEED_TYPEDEFS +#ifdef __sun__ +#define NEED_TYPEDEFS +#endif + +/* Define to sizeof(char *) */ +#define SIZEOF_CHAR_P SIZEOF_VOID_P + +/* Define if you have random() */ +#undef HAVE_RANDOM + +/* Define if you have srandom() */ +#undef HAVE_SRANDOM + +/* Define if you have setenv */ +#undef HAVE_SETENV + +/* Define if you have index() */ +#undef HAVE_INDEX + +/* Define if you have bcmp() */ +#undef HAVE_BCMP + +/* Define if you have drand48 */ +#undef HAVE_DRAND48 + +/* Define if you have memmove */ +#define HAVE_MEMMOVE + +/* Define if you have gethostid */ +#undef HAVE_GETHOSTID + +/* Define if you DON'T have unix-domain sockets */ +#undef NO_UNIX_SOCKETS +#ifdef _WIN32 +#define NO_UNIX_SOCKETS +#endif + +/* Define if gettimeofday only takes one argument */ +#undef GETTIMEOFDAY_ONE_ARG + +/* Define if you have revoke() */ +#undef HAVE_REVOKE + +/* Define if you have the sysv method of opening pty's (/dev/ptmx, etc.) */ +#undef HAVE_GRANTPT + +/* Define if you have fchmod */ +#undef HAVE_FCHMOD + +/* Define if you have */ +#undef HAVE_SYS_TYPES32_H diff --git a/src/include/slirp/socket.h b/src/include/slirp/socket.h new file mode 100644 index 000000000..3a777934a --- /dev/null +++ b/src/include/slirp/socket.h @@ -0,0 +1,104 @@ +/* + * Copyright (c) 1995 Danny Gasparovski. + * + * Please read the file COPYRIGHT for the + * terms and conditions of the copyright. + */ + +/* MINE */ + +#ifndef _SLIRP_SOCKET_H_ +#define _SLIRP_SOCKET_H_ + +#define SO_EXPIRE 240000 +#define SO_EXPIREFAST 10000 + +/* + * Our socket structure + */ + +struct SLIRPsocket { + struct SLIRPsocket *so_next,*so_prev; /* For a linked list of sockets */ + + int s; /* The actual socket */ + + /* XXX union these with not-yet-used sbuf params */ + struct SLIRPmbuf *so_m; /* Pointer to the original SYN packet, + * for non-blocking connect()'s, and + * PING reply's */ + struct tcpiphdr *so_ti; /* Pointer to the original ti within + * so_mconn, for non-blocking connections */ + int so_urgc; + struct in_addr so_faddr; /* foreign host table entry */ + struct in_addr so_laddr; /* local host table entry */ + u_int16_t so_fport; /* foreign port */ + u_int16_t so_lport; /* local port */ + + u_int8_t so_iptos; /* Type of service */ + u_int8_t so_emu; /* Is the socket emulated? */ + + u_char so_type; /* Type of socket, UDP or TCP */ + int so_state; /* internal state flags SS_*, below */ + + struct tcpcb *so_tcpcb; /* pointer to TCP protocol control block */ + u_int so_expire; /* When the socket will expire */ + + int so_queued; /* Number of packets queued from this socket */ + int so_nqueued; /* Number of packets queued in a row + * Used to determine when to "downgrade" a session + * from fastq to batchq */ + + struct sbuf so_rcv; /* Receive buffer */ + struct sbuf so_snd; /* Send buffer */ + void * extra; /* Extra pointer */ +}; + + +/* + * Socket state bits. (peer means the host on the Internet, + * local host means the host on the other end of the modem) + */ +#define SS_NOFDREF 0x001 /* No fd reference */ + +#define SS_ISFCONNECTING 0x002 /* Socket is connecting to peer (non-blocking connect()'s) */ +#define SS_ISFCONNECTED 0x004 /* Socket is connected to peer */ +#define SS_FCANTRCVMORE 0x008 /* Socket can't receive more from peer (for half-closes) */ +#define SS_FCANTSENDMORE 0x010 /* Socket can't send more to peer (for half-closes) */ +/* #define SS_ISFDISCONNECTED 0x020*/ /* Socket has disconnected from peer, in 2MSL state */ +#define SS_FWDRAIN 0x040 /* We received a FIN, drain data and set SS_FCANTSENDMORE */ + +#define SS_CTL 0x080 +#define SS_FACCEPTCONN 0x100 /* Socket is accepting connections from a host on the internet */ +#define SS_FACCEPTONCE 0x200 /* If set, the SS_FACCEPTCONN socket will die after one accept */ + +extern struct SLIRPsocket tcb; + + +#if defined(DECLARE_IOVEC) && !defined(HAVE_READV) +struct iovec { + char *iov_base; + size_t iov_len; +}; +#endif + +void so_init _P((void)); +struct SLIRPsocket * solookup _P((struct SLIRPsocket *, struct in_addr, u_int, struct in_addr, u_int)); +struct SLIRPsocket * socreate _P((void)); +void sofree _P((struct SLIRPsocket *)); +int soread _P((struct SLIRPsocket *)); +void sorecvoob _P((struct SLIRPsocket *)); +int sosendoob _P((struct SLIRPsocket *)); +int sowrite _P((struct SLIRPsocket *)); +void sorecvfrom _P((struct SLIRPsocket *)); +int sosendto _P((struct SLIRPsocket *, struct SLIRPmbuf *)); +struct SLIRPsocket * solisten _P((u_int, u_int32_t, u_int, int)); +void sorwakeup _P((struct SLIRPsocket *)); +void sowwakeup _P((struct SLIRPsocket *)); +void soisfconnecting _P((register struct SLIRPsocket *)); +void soisfconnected _P((register struct SLIRPsocket *)); +void sofcantrcvmore _P((struct SLIRPsocket *)); +void sofcantsendmore _P((struct SLIRPsocket *)); +void soisfdisconnected _P((struct SLIRPsocket *)); +void sofwdrain _P((struct SLIRPsocket *)); + +#endif /* _SOCKET_H_ */ diff --git a/src/include/slirp/tcp.h b/src/include/slirp/tcp.h new file mode 100644 index 000000000..5df25a8f0 --- /dev/null +++ b/src/include/slirp/tcp.h @@ -0,0 +1,185 @@ +/* + * Copyright (c) 1982, 1986, 1993 + * The Regents of the University of California. All rights reserved. + * + * 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 above copyright + * 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 University 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 REGENTS 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 REGENTS 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. + * + * @(#)tcp.h 8.1 (Berkeley) 6/10/93 + * tcp.h,v 1.3 1994/08/21 05:27:34 paul Exp + */ + +#ifndef _TCP_H_ +#define _TCP_H_ + +#if defined(__amd64__) || defined(__aarch64__) +typedef uintptr_t tcp_seq; +#else +typedef u_int32_t tcp_seq; +#endif + +#define PR_SLOWHZ 2 /* 2 slow timeouts per second (approx) */ +#define PR_FASTHZ 5 /* 5 fast timeouts per second (not important) */ + +extern int tcp_rcvspace; +extern int tcp_sndspace; +extern struct SLIRPsocket *tcp_last_so; + +#define TCP_SNDSPACE 8192 +#define TCP_RCVSPACE 8192 + +/* + * TCP header. + * Per RFC 793, September, 1981. + */ +#ifdef PRAGMA_PACK_SUPPORTED +#pragma pack(1) +#endif + +struct tcphdr { + u_int16_t th_sport; /* source port */ + u_int16_t th_dport; /* destination port */ + tcp_seq th_seq; /* sequence number */ + tcp_seq th_ack; /* acknowledgement number */ +#ifdef WORDS_BIGENDIAN + u_char th_off:4, /* data offset */ + th_x2:4; /* (unused) */ +#else + u_char th_x2:4, /* (unused) */ + th_off:4; /* data offset */ +#endif + u_int8_t th_flags; +#define TH_FIN 0x01 +#define TH_SYN 0x02 +#define TH_RST 0x04 +#define TH_PUSH 0x08 +#define TH_ACK 0x10 +#define TH_URG 0x20 + u_int16_t th_win; /* window */ + u_int16_t th_sum; /* checksum */ + u_int16_t th_urp; /* urgent pointer */ +} PACKED__; + +#ifdef PRAGMA_PACK_SUPPORTED +#pragma pack(PACK_END) +#endif + +#include "tcp_var.h" + +#define TCPOPT_EOL 0 +#define TCPOPT_NOP 1 +#define TCPOPT_MAXSEG 2 +#define TCPOLEN_MAXSEG 4 +#define TCPOPT_WINDOW 3 +#define TCPOLEN_WINDOW 3 +#define TCPOPT_SACK_PERMITTED 4 /* Experimental */ +#define TCPOLEN_SACK_PERMITTED 2 +#define TCPOPT_SACK 5 /* Experimental */ +#define TCPOPT_TIMESTAMP 8 +#define TCPOLEN_TIMESTAMP 10 +#define TCPOLEN_TSTAMP_APPA (TCPOLEN_TIMESTAMP+2) /* appendix A */ + +#define TCPOPT_TSTAMP_HDR \ + (TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP) + +/* + * Default maximum segment size for TCP. + * With an IP MSS of 576, this is 536, + * but 512 is probably more convenient. + * This should be defined as MIN(512, IP_MSS - sizeof (struct tcpiphdr)). + * + * We make this 1460 because we only care about Ethernet in the qemu context. + */ +#define TCP_MSS 1460 + +#define TCP_MAXWIN 65535 /* largest value for (unscaled) window */ + +#define TCP_MAX_WINSHIFT 14 /* maximum window shift */ + +/* + * User-settable options (used with setsockopt). + * + * We don't use the system headers on unix because we have conflicting + * local structures. We can't avoid the system definitions on Windows, + * so we undefine them. + */ +#undef TCP_NODELAY +#define TCP_NODELAY 0x01 /* don't delay send to coalesce packets */ +#undef TCP_MAXSEG +/* #define TCP_MAXSEG 0x02 */ /* set maximum segment size */ + +/* + * TCP FSM state definitions. + * Per RFC793, September, 1981. + */ + +#define TCP_NSTATES 11 + +#define TCPS_CLOSED 0 /* closed */ +#define TCPS_LISTEN 1 /* listening for connection */ +#define TCPS_SYN_SENT 2 /* active, have sent syn */ +#define TCPS_SYN_RECEIVED 3 /* have send and received syn */ +/* states < TCPS_ESTABLISHED are those where connections not established */ +#define TCPS_ESTABLISHED 4 /* established */ +#define TCPS_CLOSE_WAIT 5 /* rcvd fin, waiting for close */ +/* states > TCPS_CLOSE_WAIT are those where user has closed */ +#define TCPS_FIN_WAIT_1 6 /* have closed, sent fin */ +#define TCPS_CLOSING 7 /* closed xchd FIN; await FIN ACK */ +#define TCPS_LAST_ACK 8 /* had fin and close; await FIN ACK */ +/* states > TCPS_CLOSE_WAIT && < TCPS_FIN_WAIT_2 await ACK of FIN */ +#define TCPS_FIN_WAIT_2 9 /* have closed, fin is acked */ +#define TCPS_TIME_WAIT 10 /* in 2*msl quiet wait after close */ + +#define TCPS_HAVERCVDSYN(s) ((s) >= TCPS_SYN_RECEIVED) +#define TCPS_HAVEESTABLISHED(s) ((s) >= TCPS_ESTABLISHED) +#define TCPS_HAVERCVDFIN(s) ((s) >= TCPS_TIME_WAIT) + +/* + * TCP sequence numbers are 32 bit integers operated + * on with modular arithmetic. These macros can be + * used to compare such integers. + */ +#define SEQ_LT(a,b) ((int)((a)-(b)) < 0) +#define SEQ_LEQ(a,b) ((int)((a)-(b)) <= 0) +#define SEQ_GT(a,b) ((int)((a)-(b)) > 0) +#define SEQ_GEQ(a,b) ((int)((a)-(b)) >= 0) + +/* + * Macros to initialize tcp sequence numbers for + * send and receive from initial send and receive + * sequence numbers. + */ +#define tcp_rcvseqinit(tp) \ + (tp)->rcv_adv = (tp)->rcv_nxt = (tp)->irs + 1 + +#define tcp_sendseqinit(tp) \ + (tp)->snd_una = (tp)->snd_nxt = (tp)->snd_max = (tp)->snd_up = (tp)->iss + +#define TCP_ISSINCR (125*1024) /* increment for tcp_iss each second */ + +extern tcp_seq tcp_iss; /* tcp initial send seq # */ + +extern char *tcpstates[]; + +#endif diff --git a/src/include/slirp/tcp_timer.h b/src/include/slirp/tcp_timer.h new file mode 100644 index 000000000..0bc438c76 --- /dev/null +++ b/src/include/slirp/tcp_timer.h @@ -0,0 +1,138 @@ +/* + * Copyright (c) 1982, 1986, 1993 + * The Regents of the University of California. All rights reserved. + * + * 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 above copyright + * 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 University 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 REGENTS 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 REGENTS 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. + * + * @(#)tcp_timer.h 8.1 (Berkeley) 6/10/93 + * tcp_timer.h,v 1.4 1994/08/21 05:27:38 paul Exp + */ + +#ifndef _TCP_TIMER_H_ +#define _TCP_TIMER_H_ + +/* + * Definitions of the TCP timers. These timers are counted + * down PR_SLOWHZ times a second. + */ +#define TCPT_NTIMERS 4 + +#define TCPT_REXMT 0 /* retransmit */ +#define TCPT_PERSIST 1 /* retransmit persistence */ +#define TCPT_KEEP 2 /* keep alive */ +#define TCPT_2MSL 3 /* 2*msl quiet time timer */ + +/* + * The TCPT_REXMT timer is used to force retransmissions. + * The TCP has the TCPT_REXMT timer set whenever segments + * have been sent for which ACKs are expected but not yet + * received. If an ACK is received which advances tp->snd_una, + * then the retransmit timer is cleared (if there are no more + * outstanding segments) or reset to the base value (if there + * are more ACKs expected). Whenever the retransmit timer goes off, + * we retransmit one unacknowledged segment, and do a backoff + * on the retransmit timer. + * + * The TCPT_PERSIST timer is used to keep window size information + * flowing even if the window goes shut. If all previous transmissions + * have been acknowledged (so that there are no retransmissions in progress), + * and the window is too small to bother sending anything, then we start + * the TCPT_PERSIST timer. When it expires, if the window is nonzero, + * we go to transmit state. Otherwise, at intervals send a single byte + * into the peer's window to force him to update our window information. + * We do this at most as often as TCPT_PERSMIN time intervals, + * but no more frequently than the current estimate of round-trip + * packet time. The TCPT_PERSIST timer is cleared whenever we receive + * a window update from the peer. + * + * The TCPT_KEEP timer is used to keep connections alive. If an + * connection is idle (no segments received) for TCPTV_KEEP_INIT amount of time, + * but not yet established, then we drop the connection. Once the connection + * is established, if the connection is idle for TCPTV_KEEP_IDLE time + * (and keepalives have been enabled on the socket), we begin to probe + * the connection. We force the peer to send us a segment by sending: + * + * This segment is (deliberately) outside the window, and should elicit + * an ack segment in response from the peer. If, despite the TCPT_KEEP + * initiated segments we cannot elicit a response from a peer in TCPT_MAXIDLE + * amount of time probing, then we drop the connection. + */ + +/* + * Time constants. + */ +#define TCPTV_MSL ( 5*PR_SLOWHZ) /* max seg lifetime (hah!) */ + +#define TCPTV_SRTTBASE 0 /* base roundtrip time; + if 0, no idea yet */ +#define TCPTV_SRTTDFLT ( 3*PR_SLOWHZ) /* assumed RTT if no info */ + +#define TCPTV_PERSMIN ( 5*PR_SLOWHZ) /* retransmit persistence */ +#define TCPTV_PERSMAX ( 60*PR_SLOWHZ) /* maximum persist interval */ + +#define TCPTV_KEEP_INIT ( 75*PR_SLOWHZ) /* initial connect keep alive */ +#define TCPTV_KEEP_IDLE (120*60*PR_SLOWHZ) /* dflt time before probing */ +#define TCPTV_KEEPINTVL ( 75*PR_SLOWHZ) /* default probe interval */ +#define TCPTV_KEEPCNT 8 /* max probes before drop */ + +#define TCPTV_MIN ( 1*PR_SLOWHZ) /* minimum allowable value */ +/* #define TCPTV_REXMTMAX ( 64*PR_SLOWHZ) */ /* max allowable REXMT value */ +#define TCPTV_REXMTMAX ( 12*PR_SLOWHZ) /* max allowable REXMT value */ + +#define TCP_LINGERTIME 120 /* linger at most 2 minutes */ + +#define TCP_MAXRXTSHIFT 12 /* maximum retransmits */ + + +#ifdef TCPTIMERS +char *tcptimers[] = + { "REXMT", "PERSIST", "KEEP", "2MSL" }; +#endif + +/* + * Force a time value to be in a certain range. + */ +#define TCPT_RANGESET(tv, value, tvmin, tvmax) { \ + (tv) = (value); \ + if ((tv) < (tvmin)) \ + (tv) = (tvmin); \ + else if ((tv) > (tvmax)) \ + (tv) = (tvmax); \ +} + +extern int tcp_keepidle; /* time before keepalive probes begin */ +extern int tcp_keepintvl; /* time between keepalive probes */ +extern int tcp_maxidle; /* time to drop after starting probes */ +extern int tcp_ttl; /* time to live for TCP segs */ +extern int tcp_backoff[]; + +struct tcpcb; + +void tcp_fasttimo _P((void)); +void tcp_slowtimo _P((void)); +void tcp_canceltimers _P((struct tcpcb *)); +struct tcpcb * tcp_timers _P((register struct tcpcb *, int)); + +#endif diff --git a/src/include/slirp/tcp_var.h b/src/include/slirp/tcp_var.h new file mode 100644 index 000000000..a9606c276 --- /dev/null +++ b/src/include/slirp/tcp_var.h @@ -0,0 +1,256 @@ +/* + * Copyright (c) 1982, 1986, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * 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 above copyright + * 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 University 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 REGENTS 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 REGENTS 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. + * + * @(#)tcp_var.h 8.3 (Berkeley) 4/10/94 + * tcp_var.h,v 1.3 1994/08/21 05:27:39 paul Exp + */ + +#ifndef _TCP_VAR_H_ +#define _TCP_VAR_H_ + +#include "tcpip.h" +#include "tcp_timer.h" + +#if defined(__amd64__) || defined(__aarch64__) +typedef uintptr_t tcpiphdrp_32; +#else +#if SIZEOF_CHAR_P == 4 + typedef struct tcpiphdr *tcpiphdrp_32; +#else + typedef u_int32_t tcpiphdrp_32; +#endif +#endif + +/* + * Tcp control block, one per tcp; fields: + */ +struct tcpcb { + tcpiphdrp_32 seg_next; /* sequencing queue */ + tcpiphdrp_32 seg_prev; + short t_state; /* state of this connection */ + short t_timer[TCPT_NTIMERS]; /* tcp timers */ + short t_rxtshift; /* log(2) of rexmt exp. backoff */ + short t_rxtcur; /* current retransmit value */ + short t_dupacks; /* consecutive dup acks recd */ + u_short t_maxseg; /* maximum segment size */ + char t_force; /* 1 if forcing out a byte */ + u_short t_flags; +#define TF_ACKNOW 0x0001 /* ack peer immediately */ +#define TF_DELACK 0x0002 /* ack, but try to delay it */ +#define TF_NODELAY 0x0004 /* don't delay packets to coalesce */ +#define TF_NOOPT 0x0008 /* don't use tcp options */ +#define TF_SENTFIN 0x0010 /* have sent FIN */ +#define TF_REQ_SCALE 0x0020 /* have/will request window scaling */ +#define TF_RCVD_SCALE 0x0040 /* other side has requested scaling */ +#define TF_REQ_TSTMP 0x0080 /* have/will request timestamps */ +#define TF_RCVD_TSTMP 0x0100 /* a timestamp was received in SYN */ +#define TF_SACK_PERMIT 0x0200 /* other side said I could SACK */ + + /* Make it static for now */ +/* struct tcpiphdr *t_template; / * skeletal packet for transmit */ + struct tcpiphdr t_template; + + struct SLIRPsocket *t_socket; /* back pointer to socket */ +/* + * The following fields are used as in the protocol specification. + * See RFC783, Dec. 1981, page 21. + */ +/* send sequence variables */ + tcp_seq snd_una; /* send unacknowledged */ + tcp_seq snd_nxt; /* send next */ + tcp_seq snd_up; /* send urgent pointer */ + tcp_seq snd_wl1; /* window update seg seq number */ + tcp_seq snd_wl2; /* window update seg ack number */ + tcp_seq iss; /* initial send sequence number */ + u_int32_t snd_wnd; /* send window */ +/* receive sequence variables */ + u_int32_t rcv_wnd; /* receive window */ + tcp_seq rcv_nxt; /* receive next */ + tcp_seq rcv_up; /* receive urgent pointer */ + tcp_seq irs; /* initial receive sequence number */ +/* + * Additional variables for this implementation. + */ +/* receive variables */ + tcp_seq rcv_adv; /* advertised window */ +/* retransmit variables */ + tcp_seq snd_max; /* highest sequence number sent; + * used to recognize retransmits + */ +/* congestion control (for slow start, source quench, retransmit after loss) */ + u_int32_t snd_cwnd; /* congestion-controlled window */ + u_int32_t snd_ssthresh; /* snd_cwnd size threshold for + * for slow start exponential to + * linear switch + */ +/* + * transmit timing stuff. See below for scale of srtt and rttvar. + * "Variance" is actually smoothed difference. + */ + short t_idle; /* inactivity time */ + short t_rtt; /* round trip time */ + tcp_seq t_rtseq; /* sequence number being timed */ + short t_srtt; /* smoothed round-trip time */ + short t_rttvar; /* variance in round-trip time */ + u_short t_rttmin; /* minimum rtt allowed */ + u_int32_t max_sndwnd; /* largest window peer has offered */ + +/* out-of-band data */ + char t_oobflags; /* have some */ + char t_iobc; /* input character */ +#define TCPOOB_HAVEDATA 0x01 +#define TCPOOB_HADDATA 0x02 + short t_softerror; /* possible error not yet reported */ + +/* RFC 1323 variables */ + u_char snd_scale; /* window scaling for send window */ + u_char rcv_scale; /* window scaling for recv window */ + u_char request_r_scale; /* pending window scaling */ + u_char requested_s_scale; + u_int32_t ts_recent; /* timestamp echo data */ + u_int32_t ts_recent_age; /* when last updated */ + tcp_seq last_ack_sent; + +}; + +#define sototcpcb(so) ((so)->so_tcpcb) + +/* + * The smoothed round-trip time and estimated variance + * are stored as fixed point numbers scaled by the values below. + * For convenience, these scales are also used in smoothing the average + * (smoothed = (1/scale)sample + ((scale-1)/scale)smoothed). + * With these scales, srtt has 3 bits to the right of the binary point, + * and thus an "ALPHA" of 0.875. rttvar has 2 bits to the right of the + * binary point, and is smoothed with an ALPHA of 0.75. + */ +#define TCP_RTT_SCALE 8 /* multiplier for srtt; 3 bits frac. */ +#define TCP_RTT_SHIFT 3 /* shift for srtt; 3 bits frac. */ +#define TCP_RTTVAR_SCALE 4 /* multiplier for rttvar; 2 bits */ +#define TCP_RTTVAR_SHIFT 2 /* multiplier for rttvar; 2 bits */ + +/* + * The initial retransmission should happen at rtt + 4 * rttvar. + * Because of the way we do the smoothing, srtt and rttvar + * will each average +1/2 tick of bias. When we compute + * the retransmit timer, we want 1/2 tick of rounding and + * 1 extra tick because of +-1/2 tick uncertainty in the + * firing of the timer. The bias will give us exactly the + * 1.5 tick we need. But, because the bias is + * statistical, we have to test that we don't drop below + * the minimum feasible timer (which is 2 ticks). + * This macro assumes that the value of TCP_RTTVAR_SCALE + * is the same as the multiplier for rttvar. + */ +#define TCP_REXMTVAL(tp) \ + (((tp)->t_srtt >> TCP_RTT_SHIFT) + (tp)->t_rttvar) + +/* XXX + * We want to avoid doing m_pullup on incoming packets but that + * means avoiding dtom on the tcp reassembly code. That in turn means + * keeping an mbuf pointer in the reassembly queue (since we might + * have a cluster). As a quick hack, the source & destination + * port numbers (which are no longer needed once we've located the + * tcpcb) are overlayed with an mbuf pointer. + */ +#if defined(__amd64__) || defined(__aarch64__) +typedef uintptr_t mbufp_32; +#else +#if SIZEOF_CHAR_P == 4 +typedef struct SLIRPmbuf *mbufp_32; +#else +typedef u_int32_t mbufp_32; +#endif +#endif +#define REASS_MBUF(ti) (*(mbufp_32 *)&((ti)->ti_t)) + +/* + * TCP statistics. + * Many of these should be kept per connection, + * but that's inconvenient at the moment. + */ +struct tcpstat { + u_long tcps_connattempt; /* connections initiated */ + u_long tcps_accepts; /* connections accepted */ + u_long tcps_connects; /* connections established */ + u_long tcps_drops; /* connections dropped */ + u_long tcps_conndrops; /* embryonic connections dropped */ + u_long tcps_closed; /* conn. closed (includes drops) */ + u_long tcps_segstimed; /* segs where we tried to get rtt */ + u_long tcps_rttupdated; /* times we succeeded */ + u_long tcps_delack; /* delayed acks sent */ + u_long tcps_timeoutdrop; /* conn. dropped in rxmt timeout */ + u_long tcps_rexmttimeo; /* retransmit timeouts */ + u_long tcps_persisttimeo; /* persist timeouts */ + u_long tcps_keeptimeo; /* keepalive timeouts */ + u_long tcps_keepprobe; /* keepalive probes sent */ + u_long tcps_keepdrops; /* connections dropped in keepalive */ + + u_long tcps_sndtotal; /* total packets sent */ + u_long tcps_sndpack; /* data packets sent */ + u_long tcps_sndbyte; /* data bytes sent */ + u_long tcps_sndrexmitpack; /* data packets retransmitted */ + u_long tcps_sndrexmitbyte; /* data bytes retransmitted */ + u_long tcps_sndacks; /* ack-only packets sent */ + u_long tcps_sndprobe; /* window probes sent */ + u_long tcps_sndurg; /* packets sent with URG only */ + u_long tcps_sndwinup; /* window update-only packets sent */ + u_long tcps_sndctrl; /* control (SYN|FIN|RST) packets sent */ + + u_long tcps_rcvtotal; /* total packets received */ + u_long tcps_rcvpack; /* packets received in sequence */ + u_long tcps_rcvbyte; /* bytes received in sequence */ + u_long tcps_rcvbadsum; /* packets received with ccksum errs */ + u_long tcps_rcvbadoff; /* packets received with bad offset */ +/* u_long tcps_rcvshort; */ /* packets received too short */ + u_long tcps_rcvduppack; /* duplicate-only packets received */ + u_long tcps_rcvdupbyte; /* duplicate-only bytes received */ + u_long tcps_rcvpartduppack; /* packets with some duplicate data */ + u_long tcps_rcvpartdupbyte; /* dup. bytes in part-dup. packets */ + u_long tcps_rcvoopack; /* out-of-order packets received */ + u_long tcps_rcvoobyte; /* out-of-order bytes received */ + u_long tcps_rcvpackafterwin; /* packets with data after window */ + u_long tcps_rcvbyteafterwin; /* bytes rcvd after window */ + u_long tcps_rcvafterclose; /* packets rcvd after "close" */ + u_long tcps_rcvwinprobe; /* rcvd window probe packets */ + u_long tcps_rcvdupack; /* rcvd duplicate acks */ + u_long tcps_rcvacktoomuch; /* rcvd acks for unsent data */ + u_long tcps_rcvackpack; /* rcvd ack packets */ + u_long tcps_rcvackbyte; /* bytes acked by rcvd acks */ + u_long tcps_rcvwinupd; /* rcvd window update packets */ +/* u_long tcps_pawsdrop; */ /* segments dropped due to PAWS */ + u_long tcps_predack; /* times hdr predict ok for acks */ + u_long tcps_preddat; /* times hdr predict ok for data pkts */ + u_long tcps_socachemiss; /* tcp_last_so misses */ + u_long tcps_didnuttin; /* Times tcp_output didn't do anything XXX */ +}; + +extern struct tcpstat tcpstat; /* tcp statistics */ +extern u_int32_t tcp_now; /* for RFC 1323 timestamps */ + +#endif diff --git a/src/include/slirp/tcpip.h b/src/include/slirp/tcpip.h new file mode 100644 index 000000000..dff5a3c96 --- /dev/null +++ b/src/include/slirp/tcpip.h @@ -0,0 +1,70 @@ +/* + * Copyright (c) 1982, 1986, 1993 + * The Regents of the University of California. All rights reserved. + * + * 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 above copyright + * 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 University 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 REGENTS 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 REGENTS 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. + * + * @(#)tcpip.h 8.1 (Berkeley) 6/10/93 + * tcpip.h,v 1.3 1994/08/21 05:27:40 paul Exp + */ + +#ifndef _TCPIP_H_ +#define _TCPIP_H_ + +/* + * Tcp+ip header, after ip options removed. + */ +struct tcpiphdr { + struct ipovly ti_i; /* overlaid ip structure */ + struct tcphdr ti_t; /* tcp header */ +}; +#define ti_next ti_i.ih_next +#define ti_prev ti_i.ih_prev +#define ti_x1 ti_i.ih_x1 +#define ti_pr ti_i.ih_pr +#define ti_len ti_i.ih_len +#define ti_src ti_i.ih_src +#define ti_dst ti_i.ih_dst +#define ti_sport ti_t.th_sport +#define ti_dport ti_t.th_dport +#define ti_seq ti_t.th_seq +#define ti_ack ti_t.th_ack +#define ti_x2 ti_t.th_x2 +#define ti_off ti_t.th_off +#define ti_flags ti_t.th_flags +#define ti_win ti_t.th_win +#define ti_sum ti_t.th_sum +#define ti_urp ti_t.th_urp + +/* + * Just a clean way to get to the first byte + * of the packet + */ +struct tcpiphdr_2 { + struct tcpiphdr dummy; + char first_char; +}; + +#endif diff --git a/src/include/slirp/tftp.h b/src/include/slirp/tftp.h new file mode 100644 index 000000000..ba4174115 --- /dev/null +++ b/src/include/slirp/tftp.h @@ -0,0 +1,40 @@ +/* tftp defines */ + +#define TFTP_SESSIONS_MAX 3 + +#define TFTP_SERVER 69 + +#define TFTP_RRQ 1 +#define TFTP_WRQ 2 +#define TFTP_DATA 3 +#define TFTP_ACK 4 +#define TFTP_ERROR 5 + +#define TFTP_FILENAME_MAX 512 + +#ifdef PRAGMA_PACK_SUPPORTED +#pragma pack(1) +#endif + +struct tftp_t { + struct ip ip; + struct udphdr udp; + u_int16_t tp_op; + union { + struct { + u_int16_t tp_block_nr; + u_int8_t tp_buf[512]; + } tp_data; + struct { + u_int16_t tp_error_code; + u_int8_t tp_msg[512]; + } tp_error; + u_int8_t tp_buf[512 + 2]; + } x; +} PACKED__; + +#ifdef PRAGMA_PACK_SUPPORTED +#pragma pack(PACK_END) +#endif + +void tftp_input(struct SLIRPmbuf *m); diff --git a/src/include/slirp/udp.h b/src/include/slirp/udp.h new file mode 100644 index 000000000..2f6b1e483 --- /dev/null +++ b/src/include/slirp/udp.h @@ -0,0 +1,114 @@ +/* + * Copyright (c) 1982, 1986, 1993 + * The Regents of the University of California. All rights reserved. + * + * 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 above copyright + * 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 University 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 REGENTS 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 REGENTS 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. + * + * @(#)udp.h 8.1 (Berkeley) 6/10/93 + * udp.h,v 1.3 1994/08/21 05:27:41 paul Exp + */ + +#ifndef _UDP_H_ +#define _UDP_H_ + +#define UDP_TTL 0x60 +#define UDP_UDPDATALEN 16192 + +extern struct SLIRPsocket *udp_last_so; + +/* + * Udp protocol header. + * Per RFC 768, September, 1981. + */ +#ifdef PRAGMA_PACK_SUPPORTED +#pragma pack(1) +#endif + +struct udphdr { + u_int16_t uh_sport; /* source port */ + u_int16_t uh_dport; /* destination port */ + int16_t uh_ulen; /* udp length */ + u_int16_t uh_sum; /* udp checksum */ +} PACKED__; + +#ifdef PRAGMA_PACK_SUPPORTED +#pragma pack(PACK_END) +#endif + +/* + * UDP kernel structures and variables. + */ +struct udpiphdr { + struct ipovly ui_i; /* overlaid ip structure */ + struct udphdr ui_u; /* udp header */ +}; +#define ui_next ui_i.ih_next +#define ui_prev ui_i.ih_prev +#define ui_x1 ui_i.ih_x1 +#define ui_pr ui_i.ih_pr +#define ui_len ui_i.ih_len +#define ui_src ui_i.ih_src +#define ui_dst ui_i.ih_dst +#define ui_sport ui_u.uh_sport +#define ui_dport ui_u.uh_dport +#define ui_ulen ui_u.uh_ulen +#define ui_sum ui_u.uh_sum + +struct udpstat { + /* input statistics: */ + u_long udps_ipackets; /* total input packets */ + u_long udps_hdrops; /* packet shorter than header */ + u_long udps_badsum; /* checksum error */ + u_long udps_badlen; /* data length larger than packet */ + u_long udps_noport; /* no socket on port */ + u_long udps_noportbcast; /* of above, arrived as broadcast */ + u_long udps_fullsock; /* not delivered, input socket full */ + u_long udpps_pcbcachemiss; /* input packets missing pcb cache */ + /* output statistics: */ + u_long udps_opackets; /* total output packets */ +}; + +/* + * Names for UDP sysctl objects + */ +#define UDPCTL_CHECKSUM 1 /* checksum UDP packets */ +#define UDPCTL_MAXID 2 + +extern struct udpstat udpstat; +extern struct SLIRPsocket udb; +struct SLIRPmbuf; + +void udp_init _P((void)); +void udp_input _P((register struct SLIRPmbuf *, int)); +int udp_output _P((struct SLIRPsocket *, struct SLIRPmbuf *, struct sockaddr_in *)); +int udp_attach _P((struct SLIRPsocket *)); +void udp_detach _P((struct SLIRPsocket *)); +u_int8_t udp_tos _P((struct SLIRPsocket *)); +void udp_emu _P((struct SLIRPsocket *, struct SLIRPmbuf *)); +struct SLIRPsocket * udp_listen _P((u_int, u_int32_t, u_int, int)); +int udp_output2(struct SLIRPsocket *so, struct SLIRPmbuf *m, + struct sockaddr_in *saddr, struct sockaddr_in *daddr, + int iptos); +#endif diff --git a/src/intel_flash.c b/src/intel_flash.c index 6b32b7ed0..f0b5e9c0b 100644 --- a/src/intel_flash.c +++ b/src/intel_flash.c @@ -22,13 +22,13 @@ #include #include #include -#include "86box.h" -#include "device.h" -#include "mem.h" -#include "machine.h" -#include "timer.h" -#include "nvr.h" -#include "plat.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/mem.h> +#include <86box/machine.h> +#include <86box/timer.h> +#include <86box/nvr.h> +#include <86box/plat.h> #define FLAG_WORD 4 diff --git a/src/intel_piix.c b/src/intel_piix.c index b6952a9b4..b3f0ddb38 100644 --- a/src/intel_piix.c +++ b/src/intel_piix.c @@ -25,30 +25,30 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "cdrom.h" +#include <86box/86box.h> +#include <86box/cdrom.h> #include "cpu.h" -#include "scsi_device.h" -#include "scsi_cdrom.h" -#include "dma.h" -#include "86box_io.h" -#include "device.h" -#include "apm.h" -#include "keyboard.h" -#include "machine.h" -#include "mem.h" -#include "timer.h" -#include "nvr.h" -#include "pci.h" -#include "pic.h" -#include "port_92.h" -#include "hdc.h" -#include "hdc_ide.h" -#include "hdc_ide_sff8038i.h" -#include "zip.h" -#include "machine.h" -#include "smbus.h" -#include "piix.h" +#include <86box/scsi_device.h> +#include <86box/scsi_cdrom.h> +#include <86box/dma.h> +#include <86box/io.h> +#include <86box/device.h> +#include <86box/apm.h> +#include <86box/keyboard.h> +#include <86box/machine.h> +#include <86box/mem.h> +#include <86box/timer.h> +#include <86box/nvr.h> +#include <86box/pci.h> +#include <86box/pic.h> +#include <86box/port_92.h> +#include <86box/hdc.h> +#include <86box/hdc_ide.h> +#include <86box/hdc_ide_sff8038i.h> +#include <86box/zip.h> +#include <86box/machine.h> +#include <86box/smbus.h> +#include <86box/piix.h> #define ACPI_TIMER_FREQ 3579545 diff --git a/src/intel_sio.c b/src/intel_sio.c index 85ba3d7df..577c9ef50 100644 --- a/src/intel_sio.c +++ b/src/intel_sio.c @@ -19,18 +19,18 @@ #include #include #include -#include "86box.h" -#include "device.h" -#include "86box_io.h" -#include "apm.h" -#include "dma.h" -#include "mem.h" -#include "pci.h" -#include "timer.h" -#include "pit.h" -#include "port_92.h" -#include "machine.h" -#include "intel_sio.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/io.h> +#include <86box/apm.h> +#include <86box/dma.h> +#include <86box/mem.h> +#include <86box/pci.h> +#include <86box/timer.h> +#include <86box/pit.h> +#include <86box/port_92.h> +#include <86box/machine.h> +#include <86box/intel_sio.h> typedef struct diff --git a/src/io.c b/src/io.c index 34e26a968..e1686861f 100644 --- a/src/io.c +++ b/src/io.c @@ -24,10 +24,10 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "86box_io.h" +#include <86box/86box.h> +#include <86box/io.h> #include "cpu.h" -#include "m_amstrad.h" +#include <86box/m_amstrad.h> #define NPORTS 65536 /* PC/AT supports 64K ports */ diff --git a/src/isamem.c b/src/isamem.c index fc3c3f602..b40dee6d1 100644 --- a/src/isamem.c +++ b/src/isamem.c @@ -73,14 +73,14 @@ #include #include #include -#include "86box.h" -#include "machine.h" -#include "86box_io.h" -#include "mem.h" -#include "device.h" -#include "ui.h" -#include "plat.h" -#include "isamem.h" +#include <86box/86box.h> +#include <86box/machine.h> +#include <86box/io.h> +#include <86box/mem.h> +#include <86box/device.h> +#include <86box/ui.h> +#include <86box/plat.h> +#include <86box/isamem.h> #define ISAMEM_DEBUG 0 diff --git a/src/isartc.c b/src/isartc.c index 0e89caee5..632ac0b1f 100644 --- a/src/isartc.c +++ b/src/isartc.c @@ -70,17 +70,17 @@ #include #include #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "timer.h" -#include "machine.h" -#include "86box_io.h" -#include "device.h" -#include "nvr.h" -#include "ui.h" -#include "plat.h" -#include "pic.h" -#include "isartc.h" +#include <86box/timer.h> +#include <86box/machine.h> +#include <86box/io.h> +#include <86box/device.h> +#include <86box/nvr.h> +#include <86box/ui.h> +#include <86box/plat.h> +#include <86box/pic.h> +#include <86box/isartc.h> #define ISARTC_DEBUG 0 diff --git a/src/keyboard.c b/src/keyboard.c index 77f17d600..4aa40ae40 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -22,9 +22,9 @@ #include #include #include -#include "86box.h" -#include "machine.h" -#include "keyboard.h" +#include <86box/86box.h> +#include <86box/machine.h> +#include <86box/keyboard.h> int keyboard_scan; diff --git a/src/keyboard_at.c b/src/keyboard_at.c index 88f5b7db4..26f86762f 100644 --- a/src/keyboard_at.c +++ b/src/keyboard_at.c @@ -25,24 +25,24 @@ #include #define HAVE_STDARG_H #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "timer.h" -#include "86box_io.h" -#include "pic.h" -#include "pit.h" -#include "ppi.h" -#include "mem.h" -#include "device.h" -#include "machine.h" -#include "m_xt_xi8088.h" -#include "m_at_t3100e.h" -#include "fdd.h" -#include "fdc.h" -#include "sound.h" -#include "snd_speaker.h" -#include "video.h" -#include "keyboard.h" +#include <86box/timer.h> +#include <86box/io.h> +#include <86box/pic.h> +#include <86box/pit.h> +#include <86box/ppi.h> +#include <86box/mem.h> +#include <86box/device.h> +#include <86box/machine.h> +#include <86box/m_xt_xi8088.h> +#include <86box/m_at_t3100e.h> +#include <86box/fdd.h> +#include <86box/fdc.h> +#include <86box/sound.h> +#include <86box/snd_speaker.h> +#include <86box/video.h> +#include <86box/keyboard.h> #define STAT_PARITY 0x80 diff --git a/src/keyboard_xt.c b/src/keyboard_xt.c index bba7d3a37..0ca9fa9e9 100644 --- a/src/keyboard_xt.c +++ b/src/keyboard_xt.c @@ -23,22 +23,22 @@ #include #include #include -#include "86box.h" -#include "device.h" -#include "timer.h" -#include "fdd.h" -#include "machine.h" -#include "m_xt_t1000.h" -#include "86box_io.h" -#include "pic.h" -#include "pit.h" -#include "ppi.h" -#include "mem.h" -#include "rom.h" -#include "sound.h" -#include "snd_speaker.h" -#include "video.h" -#include "keyboard.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/timer.h> +#include <86box/fdd.h> +#include <86box/machine.h> +#include <86box/m_xt_t1000.h> +#include <86box/io.h> +#include <86box/pic.h> +#include <86box/pit.h> +#include <86box/ppi.h> +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/sound.h> +#include <86box/snd_speaker.h> +#include <86box/video.h> +#include <86box/keyboard.h> #define STAT_PARITY 0x80 diff --git a/src/lpt.c b/src/lpt.c index 646cc2cd1..9d1228082 100644 --- a/src/lpt.c +++ b/src/lpt.c @@ -5,12 +5,12 @@ #include #include #include -#include "86box.h" -#include "86box_io.h" -#include "lpt.h" -#include "pic.h" -#include "sound.h" -#include "prt_devs.h" +#include <86box/86box.h> +#include <86box/io.h> +#include <86box/lpt.h> +#include <86box/pic.h> +#include <86box/sound.h> +#include <86box/prt_devs.h> lpt_port_t lpt_ports[3]; diff --git a/src/machine/m_amstrad.c b/src/machine/m_amstrad.c index 7897f107a..46cf9a215 100644 --- a/src/machine/m_amstrad.c +++ b/src/machine/m_amstrad.c @@ -48,32 +48,32 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "timer.h" -#include "86box_io.h" -#include "nmi.h" -#include "pic.h" -#include "pit.h" -#include "ppi.h" -#include "mem.h" -#include "rom.h" -#include "device.h" -#include "nvr.h" -#include "keyboard.h" -#include "mouse.h" -#include "gameport.h" -#include "lpt.h" -#include "fdd.h" -#include "fdc.h" -#include "sound.h" -#include "snd_speaker.h" -#include "video.h" -#include "vid_cga.h" -#include "vid_ega.h" -#include "vid_mda.h" -#include "machine.h" -#include "m_amstrad.h" +#include <86box/timer.h> +#include <86box/io.h> +#include <86box/nmi.h> +#include <86box/pic.h> +#include <86box/pit.h> +#include <86box/ppi.h> +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/device.h> +#include <86box/nvr.h> +#include <86box/keyboard.h> +#include <86box/mouse.h> +#include <86box/gameport.h> +#include <86box/lpt.h> +#include <86box/fdd.h> +#include <86box/fdc.h> +#include <86box/sound.h> +#include <86box/snd_speaker.h> +#include <86box/video.h> +#include <86box/vid_cga.h> +#include <86box/vid_ega.h> +#include <86box/vid_mda.h> +#include <86box/machine.h> +#include <86box/m_amstrad.h> #define STAT_PARITY 0x80 diff --git a/src/machine/m_at.c b/src/machine/m_at.c index 43bb0f5cc..90f4fc40c 100644 --- a/src/machine/m_at.c +++ b/src/machine/m_at.c @@ -40,22 +40,22 @@ #include #include #include -#include "86box.h" -#include "timer.h" -#include "pic.h" -#include "pit.h" -#include "dma.h" -#include "mem.h" -#include "device.h" -#include "fdd.h" -#include "fdc.h" -#include "nvr.h" -#include "gameport.h" -#include "keyboard.h" -#include "lpt.h" -#include "rom.h" -#include "hdc.h" -#include "machine.h" +#include <86box/86box.h> +#include <86box/timer.h> +#include <86box/pic.h> +#include <86box/pit.h> +#include <86box/dma.h> +#include <86box/mem.h> +#include <86box/device.h> +#include <86box/fdd.h> +#include <86box/fdc.h> +#include <86box/nvr.h> +#include <86box/gameport.h> +#include <86box/keyboard.h> +#include <86box/lpt.h> +#include <86box/rom.h> +#include <86box/hdc.h> +#include <86box/machine.h> void diff --git a/src/machine/m_at_286_386sx.c b/src/machine/m_at_286_386sx.c index a43efebe4..c1ccd5d39 100644 --- a/src/machine/m_at_286_386sx.c +++ b/src/machine/m_at_286_386sx.c @@ -22,21 +22,21 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "timer.h" -#include "86box_io.h" -#include "device.h" -#include "chipset.h" -#include "keyboard.h" -#include "mem.h" -#include "rom.h" -#include "fdd.h" -#include "fdc.h" -#include "hdc.h" -#include "sio.h" -#include "video.h" -#include "machine.h" +#include <86box/timer.h> +#include <86box/io.h> +#include <86box/device.h> +#include <86box/chipset.h> +#include <86box/keyboard.h> +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/fdd.h> +#include <86box/fdc.h> +#include <86box/hdc.h> +#include <86box/sio.h> +#include <86box/video.h> +#include <86box/machine.h> static void diff --git a/src/machine/m_at_386dx_486.c b/src/machine/m_at_386dx_486.c index b0230854e..520cb62e5 100644 --- a/src/machine/m_at_386dx_486.c +++ b/src/machine/m_at_386dx_486.c @@ -22,25 +22,25 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "timer.h" -#include "86box_io.h" -#include "device.h" -#include "chipset.h" -#include "keyboard.h" -#include "mem.h" -#include "nvr.h" -#include "pci.h" -#include "fdd.h" -#include "fdc.h" -#include "rom.h" -#include "sio.h" -#include "hdc.h" -#include "video.h" -#include "intel_flash.h" -#include "intel_sio.h" -#include "machine.h" +#include <86box/timer.h> +#include <86box/io.h> +#include <86box/device.h> +#include <86box/chipset.h> +#include <86box/keyboard.h> +#include <86box/mem.h> +#include <86box/nvr.h> +#include <86box/pci.h> +#include <86box/fdd.h> +#include <86box/fdc.h> +#include <86box/rom.h> +#include <86box/sio.h> +#include <86box/hdc.h> +#include <86box/video.h> +#include <86box/intel_flash.h> +#include <86box/intel_sio.h> +#include <86box/machine.h> static void machine_at_cs8230_init(const machine_t *model) { diff --git a/src/machine/m_at_commodore.c b/src/machine/m_at_commodore.c index 39742f3f3..51f8e56b4 100644 --- a/src/machine/m_at_commodore.c +++ b/src/machine/m_at_commodore.c @@ -40,17 +40,17 @@ #include #include #include -#include "86box.h" -#include "device.h" -#include "timer.h" -#include "86box_io.h" -#include "mem.h" -#include "lpt.h" -#include "rom.h" -#include "serial.h" -#include "fdd.h" -#include "fdc.h" -#include "machine.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/timer.h> +#include <86box/io.h> +#include <86box/mem.h> +#include <86box/lpt.h> +#include <86box/rom.h> +#include <86box/serial.h> +#include <86box/fdd.h> +#include <86box/fdc.h> +#include <86box/machine.h> static serial_t *cmd_uart; diff --git a/src/machine/m_at_compaq.c b/src/machine/m_at_compaq.c index 6ba8e4f54..7cd3f254e 100644 --- a/src/machine/m_at_compaq.c +++ b/src/machine/m_at_compaq.c @@ -23,22 +23,22 @@ #include #include #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "86box_io.h" -#include "timer.h" -#include "pit.h" -#include "mem.h" -#include "rom.h" -#include "device.h" -#include "fdd.h" -#include "fdc.h" -#include "hdc.h" -#include "hdc_ide.h" -#include "machine.h" -#include "video.h" -#include "vid_cga.h" -#include "vid_cga_comp.h" +#include <86box/io.h> +#include <86box/timer.h> +#include <86box/pit.h> +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/device.h> +#include <86box/fdd.h> +#include <86box/fdc.h> +#include <86box/hdc.h> +#include <86box/hdc_ide.h> +#include <86box/machine.h> +#include <86box/video.h> +#include <86box/vid_cga.h> +#include <86box/vid_cga_comp.h> enum diff --git a/src/machine/m_at_socket4_5.c b/src/machine/m_at_socket4_5.c index da85e87c0..dc6ad9b64 100644 --- a/src/machine/m_at_socket4_5.c +++ b/src/machine/m_at_socket4_5.c @@ -21,25 +21,25 @@ #include #include #include -#include "86box.h" -#include "mem.h" -#include "86box_io.h" -#include "rom.h" -#include "pci.h" -#include "device.h" -#include "chipset.h" -#include "hdc.h" -#include "hdc_ide.h" -#include "timer.h" -#include "fdd.h" -#include "fdc.h" -#include "keyboard.h" -#include "intel_flash.h" -#include "intel_sio.h" -#include "piix.h" -#include "sio.h" -#include "video.h" -#include "machine.h" +#include <86box/86box.h> +#include <86box/mem.h> +#include <86box/io.h> +#include <86box/rom.h> +#include <86box/pci.h> +#include <86box/device.h> +#include <86box/chipset.h> +#include <86box/hdc.h> +#include <86box/hdc_ide.h> +#include <86box/timer.h> +#include <86box/fdd.h> +#include <86box/fdc.h> +#include <86box/keyboard.h> +#include <86box/intel_flash.h> +#include <86box/intel_sio.h> +#include <86box/piix.h> +#include <86box/sio.h> +#include <86box/video.h> +#include <86box/machine.h> static void diff --git a/src/machine/m_at_socket7_s7.c b/src/machine/m_at_socket7_s7.c index 372778712..1bbee25fd 100644 --- a/src/machine/m_at_socket7_s7.c +++ b/src/machine/m_at_socket7_s7.c @@ -23,24 +23,24 @@ #include #include #include -#include "86box.h" -#include "mem.h" -#include "io.h" -#include "rom.h" -#include "pci.h" -#include "device.h" -#include "chipset.h" -#include "hdc.h" -#include "hdc_ide.h" -#include "keyboard.h" -#include "intel_flash.h" -#include "intel_sio.h" -#include "piix.h" -#include "sio.h" -#include "sst_flash.h" -#include "via_vt82c586b.h" -#include "video.h" -#include "machine.h" +#include <86box/86box.h> +#include <86box/mem.h> +#include <86box/io.h> +#include <86box/rom.h> +#include <86box/pci.h> +#include <86box/device.h> +#include <86box/chipset.h> +#include <86box/hdc.h> +#include <86box/hdc_ide.h> +#include <86box/keyboard.h> +#include <86box/intel_flash.h> +#include <86box/intel_sio.h> +#include <86box/piix.h> +#include <86box/sio.h> +#include <86box/sst_flash.h> +#include <86box/via_vt82c586b.h> +#include <86box/video.h> +#include <86box/machine.h> static void diff --git a/src/machine/m_at_socket8.c b/src/machine/m_at_socket8.c index f6b900461..66084be62 100644 --- a/src/machine/m_at_socket8.c +++ b/src/machine/m_at_socket8.c @@ -19,27 +19,27 @@ #include #include #include -#include "86box.h" -#include "mem.h" -#include "86box_io.h" -#include "rom.h" -#include "pci.h" -#include "device.h" -#include "chipset.h" -#include "hdc.h" -#include "hdc_ide.h" -#include "keyboard.h" -#include "intel_flash.h" -#include "via_vt82c586b.h" -#include "intel_sio.h" -#include "piix.h" -#include "sio.h" -#include "sst_flash.h" -#include "hwm.h" -#include "spd.h" -#include "video.h" +#include <86box/86box.h> +#include <86box/mem.h> +#include <86box/io.h> +#include <86box/rom.h> +#include <86box/pci.h> +#include <86box/device.h> +#include <86box/chipset.h> +#include <86box/hdc.h> +#include <86box/hdc_ide.h> +#include <86box/keyboard.h> +#include <86box/intel_flash.h> +#include <86box/via_vt82c586b.h> +#include <86box/intel_sio.h> +#include <86box/piix.h> +#include <86box/sio.h> +#include <86box/sst_flash.h> +#include <86box/hwm.h> +#include <86box/spd.h> +#include <86box/video.h> #include "cpu.h" -#include "machine.h" +#include <86box/machine.h> #if defined(DEV_BRANCH) && defined(USE_I686) diff --git a/src/machine/m_at_t3100e.c b/src/machine/m_at_t3100e.c index 2d35c5f49..a5a7b9903 100644 --- a/src/machine/m_at_t3100e.c +++ b/src/machine/m_at_t3100e.c @@ -152,19 +152,19 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "timer.h" -#include "86box_io.h" -#include "mouse.h" -#include "mem.h" -#include "device.h" -#include "keyboard.h" -#include "rom.h" +#include <86box/86box.h> +#include <86box/timer.h> +#include <86box/io.h> +#include <86box/mouse.h> +#include <86box/mem.h> +#include <86box/device.h> +#include <86box/keyboard.h> +#include <86box/rom.h> #include "cpu.h" -#include "fdd.h" -#include "fdc.h" -#include "machine.h" -#include "m_at_t3100e.h" +#include <86box/fdd.h> +#include <86box/fdc.h> +#include <86box/machine.h> +#include <86box/m_at_t3100e.h> extern uint8_t *ram; /* Physical RAM */ diff --git a/src/machine/m_at_t3100e_vid.c b/src/machine/m_at_t3100e_vid.c index a05c93689..ecfef4437 100644 --- a/src/machine/m_at_t3100e_vid.c +++ b/src/machine/m_at_t3100e_vid.c @@ -57,15 +57,15 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "device.h" -#include "86box_io.h" -#include "mem.h" -#include "timer.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/io.h> +#include <86box/mem.h> +#include <86box/timer.h> #include "cpu.h" -#include "video.h" -#include "vid_cga.h" -#include "m_at_t3100e.h" +#include <86box/video.h> +#include <86box/vid_cga.h> +#include <86box/m_at_t3100e.h> #define T3100E_XSIZE 640 diff --git a/src/machine/m_europc.c b/src/machine/m_europc.c index 8555b514b..1ce423ee7 100644 --- a/src/machine/m_europc.c +++ b/src/machine/m_europc.c @@ -87,23 +87,23 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "86box_io.h" -#include "timer.h" -#include "nmi.h" -#include "mem.h" -#include "pit.h" -#include "rom.h" -#include "device.h" -#include "nvr.h" -#include "keyboard.h" -#include "mouse.h" -#include "gameport.h" -#include "fdd.h" -#include "fdc.h" -#include "hdc.h" -#include "video.h" -#include "machine.h" +#include <86box/86box.h> +#include <86box/io.h> +#include <86box/timer.h> +#include <86box/nmi.h> +#include <86box/mem.h> +#include <86box/pit.h> +#include <86box/rom.h> +#include <86box/device.h> +#include <86box/nvr.h> +#include <86box/keyboard.h> +#include <86box/mouse.h> +#include <86box/gameport.h> +#include <86box/fdd.h> +#include <86box/fdc.h> +#include <86box/hdc.h> +#include <86box/video.h> +#include <86box/machine.h> #define EUROPC_DEBUG 0 /* current debugging level */ diff --git a/src/machine/m_olivetti_m24.c b/src/machine/m_olivetti_m24.c index 025d4e69f..8d8c94229 100644 --- a/src/machine/m_olivetti_m24.c +++ b/src/machine/m_olivetti_m24.c @@ -24,26 +24,26 @@ #include #include #include -#include "86box.h" -#include "timer.h" -#include "86box_io.h" -#include "pic.h" -#include "pit.h" -#include "ppi.h" -#include "nmi.h" -#include "mem.h" -#include "device.h" -#include "nvr.h" -#include "keyboard.h" -#include "mouse.h" -#include "rom.h" -#include "fdd.h" -#include "fdc.h" -#include "gameport.h" -#include "sound.h" -#include "snd_speaker.h" -#include "video.h" -#include "machine.h" +#include <86box/86box.h> +#include <86box/timer.h> +#include <86box/io.h> +#include <86box/pic.h> +#include <86box/pit.h> +#include <86box/ppi.h> +#include <86box/nmi.h> +#include <86box/mem.h> +#include <86box/device.h> +#include <86box/nvr.h> +#include <86box/keyboard.h> +#include <86box/mouse.h> +#include <86box/rom.h> +#include <86box/fdd.h> +#include <86box/fdc.h> +#include <86box/gameport.h> +#include <86box/sound.h> +#include <86box/snd_speaker.h> +#include <86box/video.h> +#include <86box/machine.h> #define STAT_PARITY 0x80 diff --git a/src/machine/m_pcjr.c b/src/machine/m_pcjr.c index 735c62113..5d3c77525 100644 --- a/src/machine/m_pcjr.c +++ b/src/machine/m_pcjr.c @@ -26,26 +26,26 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "timer.h" -#include "86box_io.h" -#include "nmi.h" -#include "pic.h" -#include "pit.h" -#include "mem.h" -#include "device.h" -#include "serial.h" -#include "keyboard.h" -#include "rom.h" -#include "fdd.h" -#include "fdc.h" -#include "sound.h" -#include "snd_speaker.h" -#include "snd_sn76489.h" -#include "video.h" -#include "vid_cga_comp.h" -#include "machine.h" +#include <86box/timer.h> +#include <86box/io.h> +#include <86box/nmi.h> +#include <86box/pic.h> +#include <86box/pit.h> +#include <86box/mem.h> +#include <86box/device.h> +#include <86box/serial.h> +#include <86box/keyboard.h> +#include <86box/rom.h> +#include <86box/fdd.h> +#include <86box/fdc.h> +#include <86box/sound.h> +#include <86box/snd_speaker.h> +#include <86box/snd_sn76489.h> +#include <86box/video.h> +#include <86box/vid_cga_comp.h> +#include <86box/machine.h> #define PCJR_RGB 0 diff --git a/src/machine/m_ps1.c b/src/machine/m_ps1.c index 3afc933f2..9295b5b7b 100644 --- a/src/machine/m_ps1.c +++ b/src/machine/m_ps1.c @@ -37,30 +37,30 @@ #include #include #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "timer.h" -#include "86box_io.h" -#include "dma.h" -#include "pic.h" -#include "pit.h" -#include "mem.h" -#include "nmi.h" -#include "rom.h" -#include "device.h" -#include "nvr.h" -#include "gameport.h" -#include "lpt.h" -#include "serial.h" -#include "keyboard.h" -#include "hdc.h" -#include "hdc_ide.h" -#include "fdd.h" -#include "fdc.h" -#include "sound.h" -#include "snd_sn76489.h" -#include "video.h" -#include "machine.h" +#include <86box/timer.h> +#include <86box/io.h> +#include <86box/dma.h> +#include <86box/pic.h> +#include <86box/pit.h> +#include <86box/mem.h> +#include <86box/nmi.h> +#include <86box/rom.h> +#include <86box/device.h> +#include <86box/nvr.h> +#include <86box/gameport.h> +#include <86box/lpt.h> +#include <86box/serial.h> +#include <86box/keyboard.h> +#include <86box/hdc.h> +#include <86box/hdc_ide.h> +#include <86box/fdd.h> +#include <86box/fdc.h> +#include <86box/sound.h> +#include <86box/snd_sn76489.h> +#include <86box/video.h> +#include <86box/machine.h> typedef struct { diff --git a/src/machine/m_ps1_hdc.c b/src/machine/m_ps1_hdc.c index fe0c3d036..7bea2ef7a 100644 --- a/src/machine/m_ps1_hdc.c +++ b/src/machine/m_ps1_hdc.c @@ -92,17 +92,17 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "timer.h" -#include "86box_io.h" -#include "dma.h" -#include "pic.h" -#include "device.h" -#include "hdc.h" -#include "hdd.h" -#include "plat.h" -#include "ui.h" -#include "machine.h" +#include <86box/86box.h> +#include <86box/timer.h> +#include <86box/io.h> +#include <86box/dma.h> +#include <86box/pic.h> +#include <86box/device.h> +#include <86box/hdc.h> +#include <86box/hdd.h> +#include <86box/plat.h> +#include <86box/ui.h> +#include <86box/machine.h> #define HDC_TIME (50*TIMER_USEC) diff --git a/src/machine/m_ps2_isa.c b/src/machine/m_ps2_isa.c index fe6d3e6c4..9300d05d4 100644 --- a/src/machine/m_ps2_isa.c +++ b/src/machine/m_ps2_isa.c @@ -2,26 +2,26 @@ #include #include #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "timer.h" -#include "86box_io.h" -#include "dma.h" -#include "pic.h" -#include "pit.h" -#include "mem.h" -#include "rom.h" -#include "device.h" -#include "nvr.h" -#include "keyboard.h" -#include "lpt.h" -#include "port_92.h" -#include "serial.h" -#include "hdc.h" -#include "fdd.h" -#include "fdc.h" -#include "video.h" -#include "machine.h" +#include <86box/timer.h> +#include <86box/io.h> +#include <86box/dma.h> +#include <86box/pic.h> +#include <86box/pit.h> +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/device.h> +#include <86box/nvr.h> +#include <86box/keyboard.h> +#include <86box/lpt.h> +#include <86box/port_92.h> +#include <86box/serial.h> +#include <86box/hdc.h> +#include <86box/fdd.h> +#include <86box/fdc.h> +#include <86box/video.h> +#include <86box/machine.h> static uint8_t ps2_91, ps2_94, ps2_102, ps2_103, ps2_104, ps2_105, ps2_190; diff --git a/src/machine/m_ps2_mca.c b/src/machine/m_ps2_mca.c index 2ddccf283..5a1bf3fd5 100644 --- a/src/machine/m_ps2_mca.c +++ b/src/machine/m_ps2_mca.c @@ -42,30 +42,30 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" #include "x86.h" -#include "timer.h" -#include "86box_io.h" -#include "dma.h" -#include "pic.h" -#include "pit.h" -#include "mca.h" -#include "mem.h" -#include "nmi.h" -#include "rom.h" -#include "device.h" -#include "fdd.h" -#include "fdc.h" -#include "nvr.h" -#include "nvr_ps2.h" -#include "keyboard.h" -#include "lpt.h" -#include "mouse.h" -#include "port_92.h" -#include "serial.h" -#include "video.h" -#include "machine.h" +#include <86box/timer.h> +#include <86box/io.h> +#include <86box/dma.h> +#include <86box/pic.h> +#include <86box/pit.h> +#include <86box/mca.h> +#include <86box/mem.h> +#include <86box/nmi.h> +#include <86box/rom.h> +#include <86box/device.h> +#include <86box/fdd.h> +#include <86box/fdc.h> +#include <86box/nvr.h> +#include <86box/nvr_ps2.h> +#include <86box/keyboard.h> +#include <86box/lpt.h> +#include <86box/mouse.h> +#include <86box/port_92.h> +#include <86box/serial.h> +#include <86box/video.h> +#include <86box/machine.h> static struct diff --git a/src/machine/m_tandy.c b/src/machine/m_tandy.c index 08d55ee18..ab1260804 100644 --- a/src/machine/m_tandy.c +++ b/src/machine/m_tandy.c @@ -24,24 +24,24 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "timer.h" -#include "86box_io.h" -#include "pit.h" -#include "nmi.h" -#include "mem.h" -#include "rom.h" -#include "device.h" -#include "nvr.h" -#include "fdd.h" -#include "fdc.h" -#include "gameport.h" -#include "keyboard.h" -#include "sound.h" -#include "snd_sn76489.h" -#include "video.h" -#include "vid_cga_comp.h" -#include "machine.h" +#include <86box/86box.h> +#include <86box/timer.h> +#include <86box/io.h> +#include <86box/pit.h> +#include <86box/nmi.h> +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/device.h> +#include <86box/nvr.h> +#include <86box/fdd.h> +#include <86box/fdc.h> +#include <86box/gameport.h> +#include <86box/keyboard.h> +#include <86box/sound.h> +#include <86box/snd_sn76489.h> +#include <86box/video.h> +#include <86box/vid_cga_comp.h> +#include <86box/machine.h> enum { diff --git a/src/machine/m_xt.c b/src/machine/m_xt.c index ec9cd1da6..a570e6c85 100644 --- a/src/machine/m_xt.c +++ b/src/machine/m_xt.c @@ -2,19 +2,19 @@ #include #include #include -#include "86box.h" -#include "nmi.h" -#include "timer.h" -#include "pit.h" -#include "mem.h" -#include "device.h" -#include "fdd.h" -#include "fdc.h" -#include "gameport.h" -#include "ibm_5161.h" -#include "keyboard.h" -#include "rom.h" -#include "machine.h" +#include <86box/86box.h> +#include <86box/nmi.h> +#include <86box/timer.h> +#include <86box/pit.h> +#include <86box/mem.h> +#include <86box/device.h> +#include <86box/fdd.h> +#include <86box/fdc.h> +#include <86box/gameport.h> +#include <86box/ibm_5161.h> +#include <86box/keyboard.h> +#include <86box/rom.h> +#include <86box/machine.h> static void diff --git a/src/machine/m_xt_compaq.c b/src/machine/m_xt_compaq.c index 699aa15f7..575500ffb 100644 --- a/src/machine/m_xt_compaq.c +++ b/src/machine/m_xt_compaq.c @@ -21,20 +21,20 @@ #include #include #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "nmi.h" -#include "timer.h" -#include "pit.h" -#include "mem.h" -#include "rom.h" -#include "device.h" -#include "fdd.h" -#include "fdc.h" -#include "gameport.h" -#include "keyboard.h" -#include "lpt.h" -#include "machine.h" +#include <86box/nmi.h> +#include <86box/timer.h> +#include <86box/pit.h> +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/device.h> +#include <86box/fdd.h> +#include <86box/fdc.h> +#include <86box/gameport.h> +#include <86box/keyboard.h> +#include <86box/lpt.h> +#include <86box/machine.h> int diff --git a/src/machine/m_xt_laserxt.c b/src/machine/m_xt_laserxt.c index 41416769c..d0b0fdf81 100644 --- a/src/machine/m_xt_laserxt.c +++ b/src/machine/m_xt_laserxt.c @@ -3,21 +3,21 @@ #include #include #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "86box_io.h" -#include "mem.h" -#include "nmi.h" -#include "timer.h" -#include "pit.h" -#include "rom.h" -#include "machine.h" -#include "device.h" -#include "timer.h" -#include "fdd.h" -#include "fdc.h" -#include "gameport.h" -#include "keyboard.h" +#include <86box/io.h> +#include <86box/mem.h> +#include <86box/nmi.h> +#include <86box/timer.h> +#include <86box/pit.h> +#include <86box/rom.h> +#include <86box/machine.h> +#include <86box/device.h> +#include <86box/timer.h> +#include <86box/fdd.h> +#include <86box/fdc.h> +#include <86box/gameport.h> +#include <86box/keyboard.h> static int laserxt_emspage[4]; diff --git a/src/machine/m_xt_t1000.c b/src/machine/m_xt_t1000.c index 13e099e53..447354c3c 100644 --- a/src/machine/m_xt_t1000.c +++ b/src/machine/m_xt_t1000.c @@ -1,1142 +1,1143 @@ -/* - * 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. - * - * This file is part of the VARCem Project. - * - * Implementation of the Toshiba T1000 and T1200 portables. - * - * The T1000 is the T3100e's little brother -- a real laptop - * with a rechargeable battery. - * - * Features: 80C88 at 4.77MHz - * - 512k system RAM - * - 640x200 monochrome LCD - * - 82-key keyboard - * - Real-time clock. Not the normal 146818, but a TC8521, - * which is a 4-bit chip. - * - A ROM drive (128k, 256k or 512k) which acts as a mini - * hard drive and contains a copy of DOS 2.11. - * - 160 bytes of non-volatile RAM for the CONFIG.SYS used - * when booting from the ROM drive. Possibly physically - * located in the keyboard controller RAM. - * - * An optional memory expansion board can be fitted. This adds - * 768k of RAM, which can be used for up to three purposes: - * > Conventional memory -- 128k between 512k and 640k - * > HardRAM -- a battery-backed RAM drive. - * > EMS - * - * This means that there are up to three different - * implementations of non-volatile RAM in the same computer - * (52 nibbles in the TC8521, 160 bytes of CONFIG.SYS, and - * up to 768k of HardRAM). - * - * The T1200 is a slightly upgraded version with a turbo mode - * (double CPU clock, 9.54MHz) and an optional hard drive. - * The interface for this is proprietary both at the physical - * and programming level. - * - * 01F2h: If hard drive is present, low 4 bits are 0Ch [20Mb] - * or 0Dh [10Mb]. - * - * The hard drive is a 20MB (615/2/26) RLL 3.5" drive. - * - * The TC8521 is a 4-bit RTC, so each memory location can only - * hold a single BCD digit. Hence everything has 'ones' and - * 'tens' digits. - * - * NOTE: Still need to figure out a way to load/save ConfigSys and - * HardRAM stuff. Needs to be linked in to the NVR code. - * - * - * - * Authors: Fred N. van Kempen, - * Miran Grca, - * Sarah Walker, - * - * Copyright 2018,2019 Fred N. van Kempen. - * Copyright 2018,2019 Miran Grca. - * Copyright 2018,2019 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. - */ -#include -#include -#include -#include -#include -#include -#include -#define HAVE_STDARG_H -#include "86box.h" -#include "cpu.h" -#include "86box_io.h" -#include "timer.h" -#include "pit.h" -#include "nmi.h" -#include "mem.h" -#include "rom.h" -#include "device.h" -#include "nvr.h" -#include "keyboard.h" -#include "lpt.h" -#include "mem.h" -#include "fdd.h" -#include "fdc.h" -#include "gameport.h" -#include "video.h" -#include "plat.h" -#include "machine.h" -#include "m_xt_t1000.h" - - -#define T1000_ROMSIZE (512*1024UL) /* Maximum ROM drive size is 512k */ - - -enum TC8521_ADDR { - /* Page 0 registers */ - TC8521_SECOND1 = 0, - TC8521_SECOND10, - TC8521_MINUTE1, - TC8521_MINUTE10, - TC8521_HOUR1, - TC8521_HOUR10, - TC8521_WEEKDAY, - TC8521_DAY1, - TC8521_DAY10, - TC8521_MONTH1, - TC8521_MONTH10, - TC8521_YEAR1, - TC8521_YEAR10, - TC8521_PAGE, /* PAGE register */ - TC8521_TEST, /* TEST register */ - TC8521_RESET, /* RESET register */ - - /* Page 1 registers */ - TC8521_24HR = 0x1A, - TC8521_LEAPYEAR = 0x1B -}; - - -typedef struct { - /* ROM drive */ - uint8_t *romdrive; - uint8_t rom_ctl; - uint32_t rom_offset; - mem_mapping_t rom_mapping; - - /* CONFIG.SYS drive. */ - uint8_t t1000_nvram[160]; - uint8_t t1200_nvram[2048]; - - /* System control registers */ - uint8_t sys_ctl[16]; - uint8_t syskeys; - uint8_t turbo; - - /* NVRAM control */ - uint8_t nvr_c0; - uint8_t nvr_tick; - int nvr_addr; - uint8_t nvr_active; - mem_mapping_t nvr_mapping; /* T1200 NVRAM mapping */ - - /* EMS data */ - uint8_t ems_reg[4]; - mem_mapping_t mapping[4]; - uint32_t page_exec[4]; - uint8_t ems_port_index; - uint16_t ems_port; - uint8_t is_640k; - uint32_t ems_base; - int32_t ems_pages; - - fdc_t *fdc; - - nvr_t nvr; - int is_t1200; -} t1000_t; - - -static t1000_t t1000; - - -#ifdef ENABLE_T1000_LOG -int t1000_do_log = ENABLE_T1000_LOG; - - -static void -t1000_log(const char *fmt, ...) -{ - va_list ap; - - if (t1000_do_log) - { - va_start(ap, fmt); - pclog_ex(fmt, ap); - va_end(ap); - } -} -#else -#define t1000_log(fmt, ...) -#endif - - -/* Set the chip time. */ -static void -tc8521_time_set(uint8_t *regs, struct tm *tm) -{ - regs[TC8521_SECOND1] = (tm->tm_sec % 10); - regs[TC8521_SECOND10] = (tm->tm_sec / 10); - regs[TC8521_MINUTE1] = (tm->tm_min % 10); - regs[TC8521_MINUTE10] = (tm->tm_min / 10); - if (regs[TC8521_24HR] & 0x01) { - regs[TC8521_HOUR1] = (tm->tm_hour % 10); - regs[TC8521_HOUR10] = (tm->tm_hour / 10); - } else { - regs[TC8521_HOUR1] = ((tm->tm_hour % 12) % 10); - regs[TC8521_HOUR10] = (((tm->tm_hour % 12) / 10) | - ((tm->tm_hour >= 12) ? 2 : 0)); - } - regs[TC8521_WEEKDAY] = tm->tm_wday; - regs[TC8521_DAY1] = (tm->tm_mday % 10); - regs[TC8521_DAY10] = (tm->tm_mday / 10); - regs[TC8521_MONTH1] = ((tm->tm_mon + 1) % 10); - regs[TC8521_MONTH10] = ((tm->tm_mon + 1) / 10); - regs[TC8521_YEAR1] = ((tm->tm_year - 80) % 10); - regs[TC8521_YEAR10] = (((tm->tm_year - 80) % 100) / 10); -} - - -/* Get the chip time. */ -#define nibbles(a) (regs[(a##1)] + 10 * regs[(a##10)]) -static void -tc8521_time_get(uint8_t *regs, struct tm *tm) -{ - tm->tm_sec = nibbles(TC8521_SECOND); - tm->tm_min = nibbles(TC8521_MINUTE); - if (regs[TC8521_24HR] & 0x01) - tm->tm_hour = nibbles(TC8521_HOUR); - else - tm->tm_hour = ((nibbles(TC8521_HOUR) % 12) + - (regs[TC8521_HOUR10] & 0x02) ? 12 : 0); -//FIXME: wday - tm->tm_wday = 1; /* Dummy value so it is not uninitialized. */ - tm->tm_mday = nibbles(TC8521_DAY); - tm->tm_mon = (nibbles(TC8521_MONTH) - 1); - tm->tm_year = (nibbles(TC8521_YEAR) + 1980); -} - - -/* This is called every second through the NVR/RTC hook. */ -static void -tc8521_tick(nvr_t *nvr) -{ - t1000_log("TC8521: ping\n"); -} - - -static void -tc8521_start(nvr_t *nvr) -{ - struct tm tm; - - /* Initialize the internal and chip times. */ - if (time_sync & TIME_SYNC_ENABLED) { - /* Use the internal clock's time. */ - nvr_time_get(&tm); - tc8521_time_set(nvr->regs, &tm); - } else { - /* Set the internal clock from the chip time. */ - tc8521_time_get(nvr->regs, &tm); - nvr_time_set(&tm); - } - -#if 0 - /* Start the RTC - BIOS will do this. */ - nvr->regs[TC8521_PAGE] |= 0x80; +/* + * 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. + * + * This file is part of the VARCem Project. + * + * Implementation of the Toshiba T1000 and T1200 portables. + * + * The T1000 is the T3100e's little brother -- a real laptop + * with a rechargeable battery. + * + * Features: 80C88 at 4.77MHz + * - 512k system RAM + * - 640x200 monochrome LCD + * - 82-key keyboard + * - Real-time clock. Not the normal 146818, but a TC8521, + * which is a 4-bit chip. + * - A ROM drive (128k, 256k or 512k) which acts as a mini + * hard drive and contains a copy of DOS 2.11. + * - 160 bytes of non-volatile RAM for the CONFIG.SYS used + * when booting from the ROM drive. Possibly physically + * located in the keyboard controller RAM. + * + * An optional memory expansion board can be fitted. This adds + * 768k of RAM, which can be used for up to three purposes: + * > Conventional memory -- 128k between 512k and 640k + * > HardRAM -- a battery-backed RAM drive. + * > EMS + * + * This means that there are up to three different + * implementations of non-volatile RAM in the same computer + * (52 nibbles in the TC8521, 160 bytes of CONFIG.SYS, and + * up to 768k of HardRAM). + * + * The T1200 is a slightly upgraded version with a turbo mode + * (double CPU clock, 9.54MHz) and an optional hard drive. + * The interface for this is proprietary both at the physical + * and programming level. + * + * 01F2h: If hard drive is present, low 4 bits are 0Ch [20Mb] + * or 0Dh [10Mb]. + * + * The hard drive is a 20MB (615/2/26) RLL 3.5" drive. + * + * The TC8521 is a 4-bit RTC, so each memory location can only + * hold a single BCD digit. Hence everything has 'ones' and + * 'tens' digits. + * + * NOTE: Still need to figure out a way to load/save ConfigSys and + * HardRAM stuff. Needs to be linked in to the NVR code. + * + * + * + * Authors: Fred N. van Kempen, + * Miran Grca, + * Sarah Walker, + * + * Copyright 2018,2019 Fred N. van Kempen. + * Copyright 2018,2019 Miran Grca. + * Copyright 2018,2019 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. + */ +#include +#include +#include +#include +#include +#include +#include +#define HAVE_STDARG_H +#include <86box/86box.h> +#include "cpu.h" +#include <86box/io.h> +#include <86box/timer.h> +#include <86box/pit.h> +#include <86box/nmi.h> +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/device.h> +#include <86box/nvr.h> +#include <86box/keyboard.h> +#include <86box/lpt.h> +#include <86box/mem.h> +#include <86box/fdd.h> +#include <86box/fdc.h> +#include <86box/gameport.h> +#include <86box/video.h> +#include <86box/plat.h> +#include <86box/machine.h> +#include <86box/m_xt_t1000.h> + + +#define T1000_ROMSIZE (512*1024UL) /* Maximum ROM drive size is 512k */ + + +enum TC8521_ADDR { + /* Page 0 registers */ + TC8521_SECOND1 = 0, + TC8521_SECOND10, + TC8521_MINUTE1, + TC8521_MINUTE10, + TC8521_HOUR1, + TC8521_HOUR10, + TC8521_WEEKDAY, + TC8521_DAY1, + TC8521_DAY10, + TC8521_MONTH1, + TC8521_MONTH10, + TC8521_YEAR1, + TC8521_YEAR10, + TC8521_PAGE, /* PAGE register */ + TC8521_TEST, /* TEST register */ + TC8521_RESET, /* RESET register */ + + /* Page 1 registers */ + TC8521_24HR = 0x1A, + TC8521_LEAPYEAR = 0x1B +}; + + +typedef struct { + /* ROM drive */ + uint8_t *romdrive; + uint8_t rom_ctl; + uint32_t rom_offset; + mem_mapping_t rom_mapping; + + /* CONFIG.SYS drive. */ + uint8_t t1000_nvram[160]; + uint8_t t1200_nvram[2048]; + + /* System control registers */ + uint8_t sys_ctl[16]; + uint8_t syskeys; + uint8_t turbo; + + /* NVRAM control */ + uint8_t nvr_c0; + uint8_t nvr_tick; + int nvr_addr; + uint8_t nvr_active; + mem_mapping_t nvr_mapping; /* T1200 NVRAM mapping */ + + /* EMS data */ + uint8_t ems_reg[4]; + mem_mapping_t mapping[4]; + uint32_t page_exec[4]; + uint8_t ems_port_index; + uint16_t ems_port; + uint8_t is_640k; + uint32_t ems_base; + int32_t ems_pages; + + fdc_t *fdc; + + nvr_t nvr; + int is_t1200; +} t1000_t; + + +static t1000_t t1000; + + +#ifdef ENABLE_T1000_LOG +int t1000_do_log = ENABLE_T1000_LOG; + + +static void +t1000_log(const char *fmt, ...) +{ + va_list ap; + + if (t1000_do_log) + { + va_start(ap, fmt); + pclog_ex(fmt, ap); + va_end(ap); + } +} +#else +#define t1000_log(fmt, ...) #endif -} - - -/* Write to one of the chip registers. */ -static void -tc8521_write(uint16_t addr, uint8_t val, void *priv) -{ - nvr_t *nvr = (nvr_t *)priv; - uint8_t page; - - /* Get to the correct register page. */ - addr &= 0x0f; - page = nvr->regs[0x0d] & 0x03; - if (addr < 0x0d) - addr += (16 * page); - - if (addr >= 0x10 && nvr->regs[addr] != val) - nvr_dosave = 1; - - /* Store the new value. */ - nvr->regs[addr] = val; -} - - -/* Read from one of the chip registers. */ -static uint8_t -tc8521_read(uint16_t addr, void *priv) -{ - nvr_t *nvr = (nvr_t *)priv; - uint8_t page; - - /* Get to the correct register page. */ - addr &= 0x0f; - page = nvr->regs[0x0d] & 0x03; - if (addr < 0x0d) - addr += (16 * page); - - /* Grab and return the desired value. */ - return(nvr->regs[addr]); -} - - -/* Reset the 8521 to a default state. */ -static void -tc8521_reset(nvr_t *nvr) -{ - /* Clear the NVRAM. */ - memset(nvr->regs, 0xff, nvr->size); + + +/* Set the chip time. */ +static void +tc8521_time_set(uint8_t *regs, struct tm *tm) +{ + regs[TC8521_SECOND1] = (tm->tm_sec % 10); + regs[TC8521_SECOND10] = (tm->tm_sec / 10); + regs[TC8521_MINUTE1] = (tm->tm_min % 10); + regs[TC8521_MINUTE10] = (tm->tm_min / 10); + if (regs[TC8521_24HR] & 0x01) { + regs[TC8521_HOUR1] = (tm->tm_hour % 10); + regs[TC8521_HOUR10] = (tm->tm_hour / 10); + } else { + regs[TC8521_HOUR1] = ((tm->tm_hour % 12) % 10); + regs[TC8521_HOUR10] = (((tm->tm_hour % 12) / 10) | + ((tm->tm_hour >= 12) ? 2 : 0)); + } + regs[TC8521_WEEKDAY] = tm->tm_wday; + regs[TC8521_DAY1] = (tm->tm_mday % 10); + regs[TC8521_DAY10] = (tm->tm_mday / 10); + regs[TC8521_MONTH1] = ((tm->tm_mon + 1) % 10); + regs[TC8521_MONTH10] = ((tm->tm_mon + 1) / 10); + regs[TC8521_YEAR1] = ((tm->tm_year - 80) % 10); + regs[TC8521_YEAR10] = (((tm->tm_year - 80) % 100) / 10); +} + + +/* Get the chip time. */ +#define nibbles(a) (regs[(a##1)] + 10 * regs[(a##10)]) +static void +tc8521_time_get(uint8_t *regs, struct tm *tm) +{ + tm->tm_sec = nibbles(TC8521_SECOND); + tm->tm_min = nibbles(TC8521_MINUTE); + if (regs[TC8521_24HR] & 0x01) + tm->tm_hour = nibbles(TC8521_HOUR); + else + tm->tm_hour = ((nibbles(TC8521_HOUR) % 12) + + (regs[TC8521_HOUR10] & 0x02) ? 12 : 0); +//FIXME: wday + tm->tm_wday = 1; /* Dummy value so it is not uninitialized. */ + tm->tm_mday = nibbles(TC8521_DAY); + tm->tm_mon = (nibbles(TC8521_MONTH) - 1); + tm->tm_year = (nibbles(TC8521_YEAR) + 1980); +} + + +/* This is called every second through the NVR/RTC hook. */ +static void +tc8521_tick(nvr_t *nvr) +{ + t1000_log("TC8521: ping\n"); +} + + +static void +tc8521_start(nvr_t *nvr) +{ + struct tm tm; + + /* Initialize the internal and chip times. */ + if (time_sync & TIME_SYNC_ENABLED) { + /* Use the internal clock's time. */ + nvr_time_get(&tm); + tc8521_time_set(nvr->regs, &tm); + } else { + /* Set the internal clock from the chip time. */ + tc8521_time_get(nvr->regs, &tm); + nvr_time_set(&tm); + } + +#if 0 + /* Start the RTC - BIOS will do this. */ + nvr->regs[TC8521_PAGE] |= 0x80; +#endif +} + + +/* Write to one of the chip registers. */ +static void +tc8521_write(uint16_t addr, uint8_t val, void *priv) +{ + nvr_t *nvr = (nvr_t *)priv; + uint8_t page; + + /* Get to the correct register page. */ + addr &= 0x0f; + page = nvr->regs[0x0d] & 0x03; + if (addr < 0x0d) + addr += (16 * page); + + if (addr >= 0x10 && nvr->regs[addr] != val) + nvr_dosave = 1; + + /* Store the new value. */ + nvr->regs[addr] = val; +} + + +/* Read from one of the chip registers. */ +static uint8_t +tc8521_read(uint16_t addr, void *priv) +{ + nvr_t *nvr = (nvr_t *)priv; + uint8_t page; + + /* Get to the correct register page. */ + addr &= 0x0f; + page = nvr->regs[0x0d] & 0x03; + if (addr < 0x0d) + addr += (16 * page); + + /* Grab and return the desired value. */ + return(nvr->regs[addr]); +} + + +/* Reset the 8521 to a default state. */ +static void +tc8521_reset(nvr_t *nvr) +{ + /* Clear the NVRAM. */ + memset(nvr->regs, 0xff, nvr->size); /* Reset the RTC registers. */ - memset(nvr->regs, 0x00, 16); - nvr->regs[TC8521_WEEKDAY] = 0x01; - nvr->regs[TC8521_DAY1] = 0x01; - nvr->regs[TC8521_MONTH1] = 0x01; -} - - -static void -tc8521_init(nvr_t *nvr, int size) -{ - /* This is machine specific. */ - nvr->size = size; - nvr->irq = -1; - - /* Set up any local handlers here. */ - nvr->reset = tc8521_reset; - nvr->start = tc8521_start; - nvr->tick = tc8521_tick; - - /* Initialize the actual NVR. */ - nvr_init(nvr); - - io_sethandler(0x02c0, 16, - tc8521_read,NULL,NULL, tc8521_write,NULL,NULL, nvr); -} - - -/* Given an EMS page ID, return its physical address in RAM. */ -static uint32_t -ems_execaddr(t1000_t *sys, int pg, uint16_t val) -{ - if (!(val & 0x80)) return(0); /* Bit 7 reset => not mapped */ - if (!sys->ems_pages) return(0); /* No EMS available: all used by - * HardRAM or conventional RAM */ - val &= 0x7f; - -#if 0 - t1000_log("Select EMS page: %d of %d\n", val, sys->ems_pages); -#endif - if (val < sys->ems_pages) { + memset(nvr->regs, 0x00, 16); + nvr->regs[TC8521_WEEKDAY] = 0x01; + nvr->regs[TC8521_DAY1] = 0x01; + nvr->regs[TC8521_MONTH1] = 0x01; +} + + +static void +tc8521_init(nvr_t *nvr, int size) +{ + /* This is machine specific. */ + nvr->size = size; + nvr->irq = -1; + + /* Set up any local handlers here. */ + nvr->reset = tc8521_reset; + nvr->start = tc8521_start; + nvr->tick = tc8521_tick; + + /* Initialize the actual NVR. */ + nvr_init(nvr); + + io_sethandler(0x02c0, 16, + tc8521_read,NULL,NULL, tc8521_write,NULL,NULL, nvr); + +} + + +/* Given an EMS page ID, return its physical address in RAM. */ +static uint32_t +ems_execaddr(t1000_t *sys, int pg, uint16_t val) +{ + if (!(val & 0x80)) return(0); /* Bit 7 reset => not mapped */ + if (!sys->ems_pages) return(0); /* No EMS available: all used by + * HardRAM or conventional RAM */ + val &= 0x7f; + +#if 0 + t1000_log("Select EMS page: %d of %d\n", val, sys->ems_pages); +#endif + if (val < sys->ems_pages) { /* EMS is any memory above 512k, - with ems_base giving the start address */ - return((512 * 1024) + (sys->ems_base * 0x10000) + (0x4000 * val)); - } - - return(0); -} - - -static uint8_t -ems_in(uint16_t addr, void *priv) -{ - t1000_t *sys = (t1000_t *)priv; - -#if 0 - t1000_log("ems_in(%04x)=%02x\n", addr, sys->ems_reg[(addr >> 14) & 3]); -#endif - return(sys->ems_reg[(addr >> 14) & 3]); -} - - -static void -ems_out(uint16_t addr, uint8_t val, void *priv) -{ - t1000_t *sys = (t1000_t *)priv; - int pg = (addr >> 14) & 3; - -#if 0 - t1000_log("ems_out(%04x, %02x) pg=%d\n", addr, val, pg); -#endif - sys->ems_reg[pg] = val; - sys->page_exec[pg] = ems_execaddr(sys, pg, val); - if (sys->page_exec[pg]) { - /* Page present */ - mem_mapping_enable(&sys->mapping[pg]); - mem_mapping_set_exec(&sys->mapping[pg], ram + sys->page_exec[pg]); - } else { - mem_mapping_disable(&sys->mapping[pg]); - } -} - - -/* Hardram size is in 64k units */ -static void -ems_set_hardram(t1000_t *sys, uint8_t val) -{ - int n; - - val &= 0x1f; /* Mask off pageframe address */ - if (val && mem_size > 512) - sys->ems_base = val; - else - sys->ems_base = 0; - -#if 0 - t1000_log("EMS base set to %02x\n", val); -#endif - sys->ems_pages = ((mem_size - 512) / 16) - 4 * sys->ems_base; - if (sys->ems_pages < 0) sys->ems_pages = 0; - - /* Recalculate EMS mappings */ - for (n = 0; n < 4; n++) - ems_out(n << 14, sys->ems_reg[n], sys); -} - - -static void -ems_set_640k(t1000_t *sys, uint8_t val) -{ - if (val && mem_size >= 640) { - mem_mapping_set_addr(&ram_low_mapping, 0, 640 * 1024); - sys->is_640k = 1; - } else { - mem_mapping_set_addr(&ram_low_mapping, 0, 512 * 1024); - sys->is_640k = 0; - } -} - - -static void -ems_set_port(t1000_t *sys, uint8_t val) -{ - int n; - -#if 0 - t1000_log("ems_set_port(%d)", val & 0x0f); -#endif - if (sys->ems_port) { - for (n = 0; n <= 0xc000; n += 0x4000) { - io_removehandler(sys->ems_port+n, 1, - ems_in,NULL,NULL, ems_out,NULL,NULL, sys); - } - sys->ems_port = 0; - } - - val &= 0x0f; - sys->ems_port_index = val; - if (val == 7) { - /* No EMS */ - sys->ems_port = 0; - } else { - sys->ems_port = 0x208 | (val << 4); - for (n = 0; n <= 0xc000; n += 0x4000) { - io_sethandler(sys->ems_port+n, 1, - ems_in,NULL,NULL, ems_out,NULL,NULL, sys); - } - sys->ems_port = 0; - } - -#if 0 - t1000_log(" -> %04x\n", sys->ems_port); -#endif -} - - -static int -addr_to_page(uint32_t addr) -{ - return((addr - 0xd0000) / 0x4000); -} - - -/* Read RAM in the EMS page frame. */ -static uint8_t -ems_read_ram(uint32_t addr, void *priv) -{ - t1000_t *sys = (t1000_t *)priv; - int pg = addr_to_page(addr); - - if (pg < 0) return(0xff); - addr = sys->page_exec[pg] + (addr & 0x3fff); - - return(ram[addr]); -} - - -static uint16_t -ems_read_ramw(uint32_t addr, void *priv) -{ - t1000_t *sys = (t1000_t *)priv; - int pg = addr_to_page(addr); - - if (pg < 0) return(0xff); - -#if 0 - t1000_log("ems_read_ramw addr=%05x ", addr); -#endif - addr = sys->page_exec[pg] + (addr & 0x3FFF); - -#if 0 - t1000_log("-> %06x val=%04x\n", addr, *(uint16_t *)&ram[addr]); -#endif - - return(*(uint16_t *)&ram[addr]); -} - - -static uint32_t -ems_read_raml(uint32_t addr, void *priv) -{ - t1000_t *sys = (t1000_t *)priv; - int pg = addr_to_page(addr); - - if (pg < 0) return(0xff); - addr = sys->page_exec[pg] + (addr & 0x3fff); - - return(*(uint32_t *)&ram[addr]); -} - - -/* Write RAM in the EMS page frame. */ -static void -ems_write_ram(uint32_t addr, uint8_t val, void *priv) -{ - t1000_t *sys = (t1000_t *)priv; - int pg = addr_to_page(addr); - - if (pg < 0) return; - - addr = sys->page_exec[pg] + (addr & 0x3fff); - if (ram[addr] != val) nvr_dosave = 1; - - ram[addr] = val; -} - - -static void -ems_write_ramw(uint32_t addr, uint16_t val, void *priv) -{ - t1000_t *sys = (t1000_t *)priv; - int pg = addr_to_page(addr); - - if (pg < 0) return; - -#if 0 - t1000_log("ems_write_ramw addr=%05x ", addr); -#endif - addr = sys->page_exec[pg] + (addr & 0x3fff); - -#if 0 - t1000_log("-> %06x val=%04x\n", addr, val); -#endif - - if (*(uint16_t *)&ram[addr] != val) nvr_dosave = 1; - - *(uint16_t *)&ram[addr] = val; -} - - -static void -ems_write_raml(uint32_t addr, uint32_t val, void *priv) -{ - t1000_t *sys = (t1000_t *)priv; - int pg = addr_to_page(addr); - - if (pg < 0) return; - - addr = sys->page_exec[pg] + (addr & 0x3fff); - if (*(uint32_t *)&ram[addr] != val) nvr_dosave = 1; - - *(uint32_t *)&ram[addr] = val; -} - - -static uint8_t -read_ctl(uint16_t addr, void *priv) -{ - t1000_t *sys = (t1000_t *)priv; - uint8_t ret = 0xff; - - switch (addr & 0x0f) { + with ems_base giving the start address */ + return((512 * 1024) + (sys->ems_base * 0x10000) + (0x4000 * val)); + } + + return(0); +} + + +static uint8_t +ems_in(uint16_t addr, void *priv) +{ + t1000_t *sys = (t1000_t *)priv; + +#if 0 + t1000_log("ems_in(%04x)=%02x\n", addr, sys->ems_reg[(addr >> 14) & 3]); +#endif + return(sys->ems_reg[(addr >> 14) & 3]); +} + + +static void +ems_out(uint16_t addr, uint8_t val, void *priv) +{ + t1000_t *sys = (t1000_t *)priv; + int pg = (addr >> 14) & 3; + +#if 0 + t1000_log("ems_out(%04x, %02x) pg=%d\n", addr, val, pg); +#endif + sys->ems_reg[pg] = val; + sys->page_exec[pg] = ems_execaddr(sys, pg, val); + if (sys->page_exec[pg]) { + /* Page present */ + mem_mapping_enable(&sys->mapping[pg]); + mem_mapping_set_exec(&sys->mapping[pg], ram + sys->page_exec[pg]); + } else { + mem_mapping_disable(&sys->mapping[pg]); + } +} + + +/* Hardram size is in 64k units */ +static void +ems_set_hardram(t1000_t *sys, uint8_t val) +{ + int n; + + val &= 0x1f; /* Mask off pageframe address */ + if (val && mem_size > 512) + sys->ems_base = val; + else + sys->ems_base = 0; + +#if 0 + t1000_log("EMS base set to %02x\n", val); +#endif + sys->ems_pages = ((mem_size - 512) / 16) - 4 * sys->ems_base; + if (sys->ems_pages < 0) sys->ems_pages = 0; + + /* Recalculate EMS mappings */ + for (n = 0; n < 4; n++) + ems_out(n << 14, sys->ems_reg[n], sys); +} + + +static void +ems_set_640k(t1000_t *sys, uint8_t val) +{ + if (val && mem_size >= 640) { + mem_mapping_set_addr(&ram_low_mapping, 0, 640 * 1024); + sys->is_640k = 1; + } else { + mem_mapping_set_addr(&ram_low_mapping, 0, 512 * 1024); + sys->is_640k = 0; + } +} + + +static void +ems_set_port(t1000_t *sys, uint8_t val) +{ + int n; + +#if 0 + t1000_log("ems_set_port(%d)", val & 0x0f); +#endif + if (sys->ems_port) { + for (n = 0; n <= 0xc000; n += 0x4000) { + io_removehandler(sys->ems_port+n, 1, + ems_in,NULL,NULL, ems_out,NULL,NULL, sys); + } + sys->ems_port = 0; + } + + val &= 0x0f; + sys->ems_port_index = val; + if (val == 7) { + /* No EMS */ + sys->ems_port = 0; + } else { + sys->ems_port = 0x208 | (val << 4); + for (n = 0; n <= 0xc000; n += 0x4000) { + io_sethandler(sys->ems_port+n, 1, + ems_in,NULL,NULL, ems_out,NULL,NULL, sys); + } + sys->ems_port = 0; + } + +#if 0 + t1000_log(" -> %04x\n", sys->ems_port); +#endif +} + + +static int +addr_to_page(uint32_t addr) +{ + return((addr - 0xd0000) / 0x4000); +} + + +/* Read RAM in the EMS page frame. */ +static uint8_t +ems_read_ram(uint32_t addr, void *priv) +{ + t1000_t *sys = (t1000_t *)priv; + int pg = addr_to_page(addr); + + if (pg < 0) return(0xff); + addr = sys->page_exec[pg] + (addr & 0x3fff); + + return(ram[addr]); +} + + +static uint16_t +ems_read_ramw(uint32_t addr, void *priv) +{ + t1000_t *sys = (t1000_t *)priv; + int pg = addr_to_page(addr); + + if (pg < 0) return(0xff); + +#if 0 + t1000_log("ems_read_ramw addr=%05x ", addr); +#endif + addr = sys->page_exec[pg] + (addr & 0x3FFF); + +#if 0 + t1000_log("-> %06x val=%04x\n", addr, *(uint16_t *)&ram[addr]); +#endif + + return(*(uint16_t *)&ram[addr]); +} + + +static uint32_t +ems_read_raml(uint32_t addr, void *priv) +{ + t1000_t *sys = (t1000_t *)priv; + int pg = addr_to_page(addr); + + if (pg < 0) return(0xff); + addr = sys->page_exec[pg] + (addr & 0x3fff); + + return(*(uint32_t *)&ram[addr]); +} + + +/* Write RAM in the EMS page frame. */ +static void +ems_write_ram(uint32_t addr, uint8_t val, void *priv) +{ + t1000_t *sys = (t1000_t *)priv; + int pg = addr_to_page(addr); + + if (pg < 0) return; + + addr = sys->page_exec[pg] + (addr & 0x3fff); + if (ram[addr] != val) nvr_dosave = 1; + + ram[addr] = val; +} + + +static void +ems_write_ramw(uint32_t addr, uint16_t val, void *priv) +{ + t1000_t *sys = (t1000_t *)priv; + int pg = addr_to_page(addr); + + if (pg < 0) return; + +#if 0 + t1000_log("ems_write_ramw addr=%05x ", addr); +#endif + addr = sys->page_exec[pg] + (addr & 0x3fff); + +#if 0 + t1000_log("-> %06x val=%04x\n", addr, val); +#endif + + if (*(uint16_t *)&ram[addr] != val) nvr_dosave = 1; + + *(uint16_t *)&ram[addr] = val; +} + + +static void +ems_write_raml(uint32_t addr, uint32_t val, void *priv) +{ + t1000_t *sys = (t1000_t *)priv; + int pg = addr_to_page(addr); + + if (pg < 0) return; + + addr = sys->page_exec[pg] + (addr & 0x3fff); + if (*(uint32_t *)&ram[addr] != val) nvr_dosave = 1; + + *(uint32_t *)&ram[addr] = val; +} + + +static uint8_t +read_ctl(uint16_t addr, void *priv) +{ + t1000_t *sys = (t1000_t *)priv; + uint8_t ret = 0xff; + + switch (addr & 0x0f) { case 1: - ret = sys->syskeys; - break; - - case 0x0f: /* Detect EMS board */ - switch (sys->sys_ctl[0x0e]) { - case 0x50: - if (mem_size > 512) - ret = (0x90 | sys->ems_port_index); - break; - - case 0x51: - /* 0x60 is the page frame address: - (0xd000 - 0xc400) / 0x20 */ - ret = (sys->ems_base | 0x60); - break; - - case 0x52: - ret = (sys->is_640k ? 0x80 : 0); - break; - } - break; - - default: - ret = (sys->sys_ctl[addr & 0x0f]); - } - - return(ret); -} - - -static void -t1200_turbo_set(uint8_t value) -{ - if (value == t1000.turbo) return; - - t1000.turbo = value; - if (! value) - cpu_dynamic_switch(0); - else - cpu_dynamic_switch(cpu); -} - - -static void -write_ctl(uint16_t addr, uint8_t val, void *priv) -{ - t1000_t *sys = (t1000_t *)priv; - - sys->sys_ctl[addr & 0x0f] = val; - switch (addr & 0x0f) { - case 4: /* Video control */ - if (sys->sys_ctl[3] == 0x5A) { - t1000_video_options_set((val & 0x20) ? 1 : 0); - t1000_display_set((val & 0x40) ? 0 : 1); - if (sys->is_t1200) - t1200_turbo_set((val & 0x80) ? 1 : 0); - } - break; - - /* It looks as if the T1200, like the T3100, can disable - * its builtin video chipset if it detects the presence of - * another video card. */ - case 6: if (sys->is_t1200) - { - t1000_video_enable(val & 0x01 ? 0 : 1); - } - break; - - case 0x0f: /* EMS control */ - switch (sys->sys_ctl[0x0e]) { - case 0x50: - ems_set_port(sys, val); - break; - - case 0x51: - ems_set_hardram(sys, val); - break; - - case 0x52: - ems_set_640k(sys, val); - break; - } - break; - } -} - - -/* Ports 0xC0 to 0xC3 appear to have two purposes: - * - * > Access to the 160 bytes of non-volatile RAM containing CONFIG.SYS - * > Reading the floppy changeline. I don't know why the Toshiba doesn't - * use the normal port 0x3F7 for this, but it doesn't. - * - */ -static uint8_t -t1000_read_nvram(uint16_t addr, void *priv) -{ - t1000_t *sys = (t1000_t *)priv; - uint8_t tmp = 0xff; - - switch (addr) { - case 0xc2: /* Read next byte from NVRAM */ - if (sys->nvr_addr >= 0 && sys->nvr_addr < 160) - tmp = sys->t1000_nvram[sys->nvr_addr]; - sys->nvr_addr++; - break; - - case 0xc3: /* Read floppy changeline and NVRAM ready state */ - tmp = fdc_read(0x03f7, t1000.fdc); - - tmp = (tmp & 0x80) >> 3; /* Bit 4 is changeline */ - tmp |= (sys->nvr_active & 0xc0);/* Bits 6,7 are r/w mode */ - tmp |= 0x2e; /* Bits 5,3,2,1 always 1 */ - tmp |= (sys->nvr_active & 0x40) >> 6; /* Ready state */ - break; - } - - return(tmp); -} - - -static void -t1000_write_nvram(uint16_t addr, uint8_t val, void *priv) -{ - t1000_t *sys = (t1000_t *)priv; - - /* - * On the real T1000, port 0xC1 is only usable as the high byte - * of a 16-bit write to port 0xC0, with 0x5A in the low byte. - */ - switch (addr) { - case 0xc0: - sys->nvr_c0 = val; - break; - - case 0xc1: /* Write next byte to NVRAM */ - if (sys->nvr_addr >= 0 && sys->nvr_addr < 160) { - if (sys->t1000_nvram[sys->nvr_addr] != val) - nvr_dosave = 1; - sys->t1000_nvram[sys->nvr_addr] = val; - } - sys->nvr_addr++; - break; - - case 0xc2: - break; - - case 0xc3: - /* - * At start of NVRAM read / write, 0x80 is written to - * port 0xC3. This seems to reset the NVRAM address - * counter. A single byte is then written (0xff for - * write, 0x00 for read) which appears to be ignored. - * Simulate that by starting the address counter off - * at -1. - */ - sys->nvr_active = val; - if (val == 0x80) sys->nvr_addr = -1; - break; - } -} - - -static -uint8_t read_t1200_nvram(uint32_t addr, void *priv) -{ - t1000_t *sys = (t1000_t *)priv; - - return sys->t1200_nvram[addr & 0x7FF]; -} - - -static void write_t1200_nvram(uint32_t addr, uint8_t value, void *priv) -{ - t1000_t *sys = (t1000_t *)priv; - - if (sys->t1200_nvram[addr & 0x7FF] != value) - nvr_dosave = 1; - - sys->t1200_nvram[addr & 0x7FF] = value; -} - - -/* Port 0xC8 controls the ROM drive */ -static uint8_t -t1000_read_rom_ctl(uint16_t addr, void *priv) -{ - t1000_t *sys = (t1000_t *)priv; - - return(sys->rom_ctl); -} - - -static void -t1000_write_rom_ctl(uint16_t addr, uint8_t val, void *priv) -{ - t1000_t *sys = (t1000_t *)priv; - - sys->rom_ctl = val; - if (sys->romdrive && (val & 0x80)) { - /* Enable */ - sys->rom_offset = ((val & 0x7f) * 0x10000) % T1000_ROMSIZE; - mem_mapping_set_addr(&sys->rom_mapping, 0xa0000, 0x10000); - mem_mapping_set_exec(&sys->rom_mapping, sys->romdrive + sys->rom_offset); - mem_mapping_enable(&sys->rom_mapping); - } else { - mem_mapping_disable(&sys->rom_mapping); - } -} - - -/* Read the ROM drive */ -static uint8_t -t1000_read_rom(uint32_t addr, void *priv) -{ - t1000_t *sys = (t1000_t *)priv; - - if (! sys->romdrive) return(0xff); - - return(sys->romdrive[sys->rom_offset + (addr & 0xffff)]); -} - - -static uint16_t -t1000_read_romw(uint32_t addr, void *priv) -{ - t1000_t *sys = (t1000_t *)priv; - - if (! sys->romdrive) return(0xffff); - - return(*(uint16_t *)(&sys->romdrive[sys->rom_offset + (addr & 0xffff)])); -} - - -static uint32_t -t1000_read_roml(uint32_t addr, void *priv) -{ - t1000_t *sys = (t1000_t *)priv; - - if (! sys->romdrive) return(0xffffffff); - - return(*(uint32_t *)(&sys->romdrive[sys->rom_offset + (addr & 0xffff)])); -} - - -const device_t * -t1000_get_device(void) -{ - return(&t1000_video_device); -} - - -int -machine_xt_t1000_init(const machine_t *model) -{ - FILE *f; - int pg; - - int ret; - - ret = bios_load_linear(L"roms/machines/t1000/t1000.rom", - 0x000f8000, 32768, 0); - - if (bios_only || !ret) - return ret; - - memset(&t1000, 0x00, sizeof(t1000)); - t1000.is_t1200 = 0; - t1000.turbo = 0xff; - t1000.ems_port_index = 7; /* EMS disabled */ - - /* Load the T1000 CGA Font ROM. */ - loadfont(L"roms/machines/t1000/t1000font.rom", 2); - - /* - * The ROM drive is optional. - * - * If the file is missing, continue to boot; the BIOS will - * complain 'No ROM drive' but boot normally from floppy. - */ - f = rom_fopen(L"roms/machines/t1000/t1000dos.rom", L"rb"); - if (f != NULL) { - t1000.romdrive = malloc(T1000_ROMSIZE); - if (t1000.romdrive) { - memset(t1000.romdrive, 0xff, T1000_ROMSIZE); - if (fread(t1000.romdrive, 1, T1000_ROMSIZE, f) != T1000_ROMSIZE) - fatal("machine_xt_t1000_init(): Error reading DOS ROM data\n"); - } - fclose(f); - } - mem_mapping_add(&t1000.rom_mapping, 0xa0000, 0x10000, - t1000_read_rom,t1000_read_romw,t1000_read_roml, - NULL,NULL,NULL, NULL, MEM_MAPPING_INTERNAL, &t1000); - mem_mapping_disable(&t1000.rom_mapping); - - /* Map the EMS page frame */ - for (pg = 0; pg < 4; pg++) { - mem_mapping_add(&t1000.mapping[pg], 0xd0000 + (0x4000 * pg), 16384, - ems_read_ram,ems_read_ramw,ems_read_raml, - ems_write_ram,ems_write_ramw,ems_write_raml, - NULL, MEM_MAPPING_EXTERNAL, &t1000); - - /* Start them all off disabled */ - mem_mapping_disable(&t1000.mapping[pg]); - } - - /* Non-volatile RAM for CONFIG.SYS */ - io_sethandler(0xc0, 4, - t1000_read_nvram,NULL,NULL, - t1000_write_nvram,NULL,NULL, &t1000); - - /* ROM drive */ - io_sethandler(0xc8, 1, - t1000_read_rom_ctl,NULL,NULL, - t1000_write_rom_ctl,NULL,NULL, &t1000); - - /* System control functions, and add-on memory board */ - io_sethandler(0xe0, 16, - read_ctl,NULL,NULL, write_ctl,NULL,NULL, &t1000); - - machine_common_init(model); - - pit_ctr_set_out_func(&pit->counters[1], pit_refresh_timer_xt); - device_add(&keyboard_xt_device); - t1000.fdc = device_add(&fdc_xt_device); - nmi_init(); - - tc8521_init(&t1000.nvr, model->nvrmask + 1); - - t1000_nvr_load(); - nvr_set_ven_save(t1000_nvr_save); - - if (gfxcard == VID_INTERNAL) - device_add(&t1000_video_device); - - return ret; -} - - -const device_t * -t1200_get_device(void) -{ - return(&t1200_video_device); -} - - -int -machine_xt_t1200_init(const machine_t *model) -{ - int pg; - - int ret; - - ret = bios_load_linear(L"roms/machines/t1200/t1200_019e.ic15.bin", - 0x000f8000, 32768, 0); - - if (bios_only || !ret) - return ret; - - memset(&t1000, 0x00, sizeof(t1000)); - t1000.is_t1200 = 1; - t1000.ems_port_index = 7; /* EMS disabled */ - - /* Load the T1200 CGA Font ROM. */ - loadfont(L"roms/machines/t1200/t1000font.bin", 2); - - /* Map the EMS page frame */ - for (pg = 0; pg < 4; pg++) { - mem_mapping_add(&t1000.mapping[pg], - 0xd0000 + (0x4000 * pg), 16384, - ems_read_ram,ems_read_ramw,ems_read_raml, - ems_write_ram,ems_write_ramw,ems_write_raml, - NULL, MEM_MAPPING_EXTERNAL, &t1000); - - /* Start them all off disabled */ - mem_mapping_disable(&t1000.mapping[pg]); - } - - /* System control functions, and add-on memory board */ - io_sethandler(0xe0, 16, - read_ctl,NULL,NULL, write_ctl,NULL,NULL, &t1000); - - machine_common_init(model); - - mem_mapping_add(&t1000.nvr_mapping, - 0x000f0000, 2048, - read_t1200_nvram, NULL, NULL, - write_t1200_nvram, NULL, NULL, - NULL, 0, &t1000); - - pit_ctr_set_out_func(&pit->counters[1], pit_refresh_timer_xt); - device_add(&keyboard_xt_device); - t1000.fdc = device_add(&fdc_xt_t1x00_device); - nmi_init(); - - tc8521_init(&t1000.nvr, model->nvrmask + 1); - - t1200_nvr_load(); - nvr_set_ven_save(t1200_nvr_save); - - if (gfxcard == VID_INTERNAL) - device_add(&t1200_video_device); - - return ret; -} - - -void -t1000_syskey(uint8_t andmask, uint8_t ormask, uint8_t xormask) -{ - t1000.syskeys &= ~andmask; - t1000.syskeys |= ormask; - t1000.syskeys ^= xormask; -} - - -static void -t1000_configsys_load(void) -{ - FILE *f; - int size; - - memset(t1000.t1000_nvram, 0x1a, sizeof(t1000.t1000_nvram)); - f = plat_fopen(nvr_path(L"t1000_config.nvr"), L"rb"); - if (f != NULL) { - size = sizeof(t1000.t1000_nvram); - if (fread(t1000.t1000_nvram, size, 1, f) != size) - fatal("t1000_configsys_load(): Error reading data\n"); - fclose(f); - } -} - - -static void -t1000_configsys_save(void) -{ - FILE *f; - int size; - - f = plat_fopen(nvr_path(L"t1000_config.nvr"), L"wb"); - if (f != NULL) { - size = sizeof(t1000.t1000_nvram); - if (fwrite(t1000.t1000_nvram, 1, size, f) != size) - fatal("t1000_configsys_save(): Error writing data\n"); - fclose(f); - } -} - - -static void -t1200_state_load(void) -{ - FILE *f; - int size; - - memset(t1000.t1200_nvram, 0, sizeof(t1000.t1200_nvram)); - f = plat_fopen(nvr_path(L"t1200_state.nvr"), L"rb"); - if (f != NULL) { - size = sizeof(t1000.t1200_nvram); - if (fread(t1000.t1200_nvram, 1, size, f) != size) - fatal("t1200_state_load(): Error reading data\n"); - fclose(f); - } -} - - -static void -t1200_state_save(void) -{ - FILE *f; - int size; - - f = plat_fopen(nvr_path(L"t1200_state.nvr"), L"wb"); - if (f != NULL) { - size = sizeof(t1000.t1200_nvram); - if (fwrite(t1000.t1200_nvram, 1, size, f) != size) - fatal("t1200_state_save(): Error writing data\n"); - fclose(f); - } -} - - -/* All RAM beyond 512k is non-volatile */ -static void -t1000_emsboard_load(void) -{ - FILE *f; - - if (mem_size > 512) { - f = plat_fopen(nvr_path(L"t1000_ems.nvr"), L"rb"); - if (f != NULL) { - fread(&ram[512 * 1024], 1024, (mem_size - 512), f); - fclose(f); - } - } -} - - -static void -t1000_emsboard_save(void) -{ - FILE *f; - - if (mem_size > 512) { - f = plat_fopen(nvr_path(L"t1000_ems.nvr"), L"wb"); - if (f != NULL) { - fwrite(&ram[512 * 1024], 1024, (mem_size - 512), f); - fclose(f); - } - } -} - - -void -t1000_nvr_load(void) -{ - t1000_emsboard_load(); - t1000_configsys_load(); -} - - -void -t1000_nvr_save(void) -{ - t1000_emsboard_save(); - t1000_configsys_save(); -} - - -void -t1200_nvr_load(void) -{ - t1000_emsboard_load(); - t1200_state_load(); -} - - -void -t1200_nvr_save(void) -{ - t1000_emsboard_save(); - t1200_state_save(); -} + ret = sys->syskeys; + break; + + case 0x0f: /* Detect EMS board */ + switch (sys->sys_ctl[0x0e]) { + case 0x50: + if (mem_size > 512) + ret = (0x90 | sys->ems_port_index); + break; + + case 0x51: + /* 0x60 is the page frame address: + (0xd000 - 0xc400) / 0x20 */ + ret = (sys->ems_base | 0x60); + break; + + case 0x52: + ret = (sys->is_640k ? 0x80 : 0); + break; + } + break; + + default: + ret = (sys->sys_ctl[addr & 0x0f]); + } + + return(ret); +} + + +static void +t1200_turbo_set(uint8_t value) +{ + if (value == t1000.turbo) return; + + t1000.turbo = value; + if (! value) + cpu_dynamic_switch(0); + else + cpu_dynamic_switch(cpu); +} + + +static void +write_ctl(uint16_t addr, uint8_t val, void *priv) +{ + t1000_t *sys = (t1000_t *)priv; + + sys->sys_ctl[addr & 0x0f] = val; + switch (addr & 0x0f) { + case 4: /* Video control */ + if (sys->sys_ctl[3] == 0x5A) { + t1000_video_options_set((val & 0x20) ? 1 : 0); + t1000_display_set((val & 0x40) ? 0 : 1); + if (sys->is_t1200) + t1200_turbo_set((val & 0x80) ? 1 : 0); + } + break; + + /* It looks as if the T1200, like the T3100, can disable + * its builtin video chipset if it detects the presence of + * another video card. */ + case 6: if (sys->is_t1200) + { + t1000_video_enable(val & 0x01 ? 0 : 1); + } + break; + + case 0x0f: /* EMS control */ + switch (sys->sys_ctl[0x0e]) { + case 0x50: + ems_set_port(sys, val); + break; + + case 0x51: + ems_set_hardram(sys, val); + break; + + case 0x52: + ems_set_640k(sys, val); + break; + } + break; + } +} + + +/* Ports 0xC0 to 0xC3 appear to have two purposes: + * + * > Access to the 160 bytes of non-volatile RAM containing CONFIG.SYS + * > Reading the floppy changeline. I don't know why the Toshiba doesn't + * use the normal port 0x3F7 for this, but it doesn't. + * + */ +static uint8_t +t1000_read_nvram(uint16_t addr, void *priv) +{ + t1000_t *sys = (t1000_t *)priv; + uint8_t tmp = 0xff; + + switch (addr) { + case 0xc2: /* Read next byte from NVRAM */ + if (sys->nvr_addr >= 0 && sys->nvr_addr < 160) + tmp = sys->t1000_nvram[sys->nvr_addr]; + sys->nvr_addr++; + break; + + case 0xc3: /* Read floppy changeline and NVRAM ready state */ + tmp = fdc_read(0x03f7, t1000.fdc); + + tmp = (tmp & 0x80) >> 3; /* Bit 4 is changeline */ + tmp |= (sys->nvr_active & 0xc0);/* Bits 6,7 are r/w mode */ + tmp |= 0x2e; /* Bits 5,3,2,1 always 1 */ + tmp |= (sys->nvr_active & 0x40) >> 6; /* Ready state */ + break; + } + + return(tmp); +} + + +static void +t1000_write_nvram(uint16_t addr, uint8_t val, void *priv) +{ + t1000_t *sys = (t1000_t *)priv; + + /* + * On the real T1000, port 0xC1 is only usable as the high byte + * of a 16-bit write to port 0xC0, with 0x5A in the low byte. + */ + switch (addr) { + case 0xc0: + sys->nvr_c0 = val; + break; + + case 0xc1: /* Write next byte to NVRAM */ + if (sys->nvr_addr >= 0 && sys->nvr_addr < 160) { + if (sys->t1000_nvram[sys->nvr_addr] != val) + nvr_dosave = 1; + sys->t1000_nvram[sys->nvr_addr] = val; + } + sys->nvr_addr++; + break; + + case 0xc2: + break; + + case 0xc3: + /* + * At start of NVRAM read / write, 0x80 is written to + * port 0xC3. This seems to reset the NVRAM address + * counter. A single byte is then written (0xff for + * write, 0x00 for read) which appears to be ignored. + * Simulate that by starting the address counter off + * at -1. + */ + sys->nvr_active = val; + if (val == 0x80) sys->nvr_addr = -1; + break; + } +} + + +static +uint8_t read_t1200_nvram(uint32_t addr, void *priv) +{ + t1000_t *sys = (t1000_t *)priv; + + return sys->t1200_nvram[addr & 0x7FF]; +} + + +static void write_t1200_nvram(uint32_t addr, uint8_t value, void *priv) +{ + t1000_t *sys = (t1000_t *)priv; + + if (sys->t1200_nvram[addr & 0x7FF] != value) + nvr_dosave = 1; + + sys->t1200_nvram[addr & 0x7FF] = value; +} + + +/* Port 0xC8 controls the ROM drive */ +static uint8_t +t1000_read_rom_ctl(uint16_t addr, void *priv) +{ + t1000_t *sys = (t1000_t *)priv; + + return(sys->rom_ctl); +} + + +static void +t1000_write_rom_ctl(uint16_t addr, uint8_t val, void *priv) +{ + t1000_t *sys = (t1000_t *)priv; + + sys->rom_ctl = val; + if (sys->romdrive && (val & 0x80)) { + /* Enable */ + sys->rom_offset = ((val & 0x7f) * 0x10000) % T1000_ROMSIZE; + mem_mapping_set_addr(&sys->rom_mapping, 0xa0000, 0x10000); + mem_mapping_set_exec(&sys->rom_mapping, sys->romdrive + sys->rom_offset); + mem_mapping_enable(&sys->rom_mapping); + } else { + mem_mapping_disable(&sys->rom_mapping); + } +} + + +/* Read the ROM drive */ +static uint8_t +t1000_read_rom(uint32_t addr, void *priv) +{ + t1000_t *sys = (t1000_t *)priv; + + if (! sys->romdrive) return(0xff); + + return(sys->romdrive[sys->rom_offset + (addr & 0xffff)]); +} + + +static uint16_t +t1000_read_romw(uint32_t addr, void *priv) +{ + t1000_t *sys = (t1000_t *)priv; + + if (! sys->romdrive) return(0xffff); + + return(*(uint16_t *)(&sys->romdrive[sys->rom_offset + (addr & 0xffff)])); +} + + +static uint32_t +t1000_read_roml(uint32_t addr, void *priv) +{ + t1000_t *sys = (t1000_t *)priv; + + if (! sys->romdrive) return(0xffffffff); + + return(*(uint32_t *)(&sys->romdrive[sys->rom_offset + (addr & 0xffff)])); +} + + +const device_t * +t1000_get_device(void) +{ + return(&t1000_video_device); +} + + +int +machine_xt_t1000_init(const machine_t *model) +{ + FILE *f; + int pg; + + int ret; + + ret = bios_load_linear(L"roms/machines/t1000/t1000.rom", + 0x000f8000, 32768, 0); + + if (bios_only || !ret) + return ret; + + memset(&t1000, 0x00, sizeof(t1000)); + t1000.is_t1200 = 0; + t1000.turbo = 0xff; + t1000.ems_port_index = 7; /* EMS disabled */ + + /* Load the T1000 CGA Font ROM. */ + loadfont(L"roms/machines/t1000/t1000font.rom", 2); + + /* + * The ROM drive is optional. + * + * If the file is missing, continue to boot; the BIOS will + * complain 'No ROM drive' but boot normally from floppy. + */ + f = rom_fopen(L"roms/machines/t1000/t1000dos.rom", L"rb"); + if (f != NULL) { + t1000.romdrive = malloc(T1000_ROMSIZE); + if (t1000.romdrive) { + memset(t1000.romdrive, 0xff, T1000_ROMSIZE); + if (fread(t1000.romdrive, 1, T1000_ROMSIZE, f) != T1000_ROMSIZE) + fatal("machine_xt_t1000_init(): Error reading DOS ROM data\n"); + } + fclose(f); + } + mem_mapping_add(&t1000.rom_mapping, 0xa0000, 0x10000, + t1000_read_rom,t1000_read_romw,t1000_read_roml, + NULL,NULL,NULL, NULL, MEM_MAPPING_INTERNAL, &t1000); + mem_mapping_disable(&t1000.rom_mapping); + + /* Map the EMS page frame */ + for (pg = 0; pg < 4; pg++) { + mem_mapping_add(&t1000.mapping[pg], 0xd0000 + (0x4000 * pg), 16384, + ems_read_ram,ems_read_ramw,ems_read_raml, + ems_write_ram,ems_write_ramw,ems_write_raml, + NULL, MEM_MAPPING_EXTERNAL, &t1000); + + /* Start them all off disabled */ + mem_mapping_disable(&t1000.mapping[pg]); + } + + /* Non-volatile RAM for CONFIG.SYS */ + io_sethandler(0xc0, 4, + t1000_read_nvram,NULL,NULL, + t1000_write_nvram,NULL,NULL, &t1000); + + /* ROM drive */ + io_sethandler(0xc8, 1, + t1000_read_rom_ctl,NULL,NULL, + t1000_write_rom_ctl,NULL,NULL, &t1000); + + /* System control functions, and add-on memory board */ + io_sethandler(0xe0, 16, + read_ctl,NULL,NULL, write_ctl,NULL,NULL, &t1000); + + machine_common_init(model); + + pit_ctr_set_out_func(&pit->counters[1], pit_refresh_timer_xt); + device_add(&keyboard_xt_device); + t1000.fdc = device_add(&fdc_xt_device); + nmi_init(); + + tc8521_init(&t1000.nvr, model->nvrmask + 1); + + t1000_nvr_load(); + nvr_set_ven_save(t1000_nvr_save); + + if (gfxcard == VID_INTERNAL) + device_add(&t1000_video_device); + + return ret; +} + + +const device_t * +t1200_get_device(void) +{ + return(&t1200_video_device); +} + + +int +machine_xt_t1200_init(const machine_t *model) +{ + int pg; + + int ret; + + ret = bios_load_linear(L"roms/machines/t1200/t1200_019e.ic15.bin", + 0x000f8000, 32768, 0); + + if (bios_only || !ret) + return ret; + + memset(&t1000, 0x00, sizeof(t1000)); + t1000.is_t1200 = 1; + t1000.ems_port_index = 7; /* EMS disabled */ + + /* Load the T1200 CGA Font ROM. */ + loadfont(L"roms/machines/t1200/t1000font.bin", 2); + + /* Map the EMS page frame */ + for (pg = 0; pg < 4; pg++) { + mem_mapping_add(&t1000.mapping[pg], + 0xd0000 + (0x4000 * pg), 16384, + ems_read_ram,ems_read_ramw,ems_read_raml, + ems_write_ram,ems_write_ramw,ems_write_raml, + NULL, MEM_MAPPING_EXTERNAL, &t1000); + + /* Start them all off disabled */ + mem_mapping_disable(&t1000.mapping[pg]); + } + + /* System control functions, and add-on memory board */ + io_sethandler(0xe0, 16, + read_ctl,NULL,NULL, write_ctl,NULL,NULL, &t1000); + + machine_common_init(model); + + mem_mapping_add(&t1000.nvr_mapping, + 0x000f0000, 2048, + read_t1200_nvram, NULL, NULL, + write_t1200_nvram, NULL, NULL, + NULL, 0, &t1000); + + pit_ctr_set_out_func(&pit->counters[1], pit_refresh_timer_xt); + device_add(&keyboard_xt_device); + t1000.fdc = device_add(&fdc_xt_t1x00_device); + nmi_init(); + + tc8521_init(&t1000.nvr, model->nvrmask + 1); + + t1200_nvr_load(); + nvr_set_ven_save(t1200_nvr_save); + + if (gfxcard == VID_INTERNAL) + device_add(&t1200_video_device); + + return ret; +} + + +void +t1000_syskey(uint8_t andmask, uint8_t ormask, uint8_t xormask) +{ + t1000.syskeys &= ~andmask; + t1000.syskeys |= ormask; + t1000.syskeys ^= xormask; +} + + +static void +t1000_configsys_load(void) +{ + FILE *f; + int size; + + memset(t1000.t1000_nvram, 0x1a, sizeof(t1000.t1000_nvram)); + f = plat_fopen(nvr_path(L"t1000_config.nvr"), L"rb"); + if (f != NULL) { + size = sizeof(t1000.t1000_nvram); + if (fread(t1000.t1000_nvram, size, 1, f) != size) + fatal("t1000_configsys_load(): Error reading data\n"); + fclose(f); + } +} + + +static void +t1000_configsys_save(void) +{ + FILE *f; + int size; + + f = plat_fopen(nvr_path(L"t1000_config.nvr"), L"wb"); + if (f != NULL) { + size = sizeof(t1000.t1000_nvram); + if (fwrite(t1000.t1000_nvram, 1, size, f) != size) + fatal("t1000_configsys_save(): Error writing data\n"); + fclose(f); + } +} + + +static void +t1200_state_load(void) +{ + FILE *f; + int size; + + memset(t1000.t1200_nvram, 0, sizeof(t1000.t1200_nvram)); + f = plat_fopen(nvr_path(L"t1200_state.nvr"), L"rb"); + if (f != NULL) { + size = sizeof(t1000.t1200_nvram); + if (fread(t1000.t1200_nvram, 1, size, f) != size) + fatal("t1200_state_load(): Error reading data\n"); + fclose(f); + } +} + + +static void +t1200_state_save(void) +{ + FILE *f; + int size; + + f = plat_fopen(nvr_path(L"t1200_state.nvr"), L"wb"); + if (f != NULL) { + size = sizeof(t1000.t1200_nvram); + if (fwrite(t1000.t1200_nvram, 1, size, f) != size) + fatal("t1200_state_save(): Error writing data\n"); + fclose(f); + } +} + + +/* All RAM beyond 512k is non-volatile */ +static void +t1000_emsboard_load(void) +{ + FILE *f; + + if (mem_size > 512) { + f = plat_fopen(nvr_path(L"t1000_ems.nvr"), L"rb"); + if (f != NULL) { + fread(&ram[512 * 1024], 1024, (mem_size - 512), f); + fclose(f); + } + } +} + + +static void +t1000_emsboard_save(void) +{ + FILE *f; + + if (mem_size > 512) { + f = plat_fopen(nvr_path(L"t1000_ems.nvr"), L"wb"); + if (f != NULL) { + fwrite(&ram[512 * 1024], 1024, (mem_size - 512), f); + fclose(f); + } + } +} + + +void +t1000_nvr_load(void) +{ + t1000_emsboard_load(); + t1000_configsys_load(); +} + + +void +t1000_nvr_save(void) +{ + t1000_emsboard_save(); + t1000_configsys_save(); +} + + +void +t1200_nvr_load(void) +{ + t1000_emsboard_load(); + t1200_state_load(); +} + + +void +t1200_nvr_save(void) +{ + t1000_emsboard_save(); + t1200_state_save(); +} diff --git a/src/machine/m_xt_t1000_vid.c b/src/machine/m_xt_t1000_vid.c index 395b16276..7b298d330 100644 --- a/src/machine/m_xt_t1000_vid.c +++ b/src/machine/m_xt_t1000_vid.c @@ -42,15 +42,15 @@ #include #include #include -#include "86box.h" -#include "device.h" -#include "86box_io.h" -#include "mem.h" -#include "timer.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/io.h> +#include <86box/mem.h> +#include <86box/timer.h> #include "cpu.h" -#include "video.h" -#include "vid_cga.h" -#include "m_xt_t1000.h" +#include <86box/video.h> +#include <86box/vid_cga.h> +#include <86box/m_xt_t1000.h> #define T1000_XSIZE 640 diff --git a/src/machine/m_xt_xi8088.c b/src/machine/m_xt_xi8088.c index 42b0d2498..875a2ba11 100644 --- a/src/machine/m_xt_xi8088.c +++ b/src/machine/m_xt_xi8088.c @@ -2,27 +2,27 @@ #include #include #include -#include "86box.h" -#include "timer.h" -#include "pic.h" -#include "pit.h" -#include "dma.h" -#include "mem.h" -#include "device.h" -#include "fdd.h" -#include "fdc.h" -#include "nmi.h" -#include "nvr.h" -#include "gameport.h" -#include "keyboard.h" -#include "lpt.h" -#include "rom.h" -#include "hdc.h" -#include "video.h" -#include "machine.h" +#include <86box/86box.h> +#include <86box/timer.h> +#include <86box/pic.h> +#include <86box/pit.h> +#include <86box/dma.h> +#include <86box/mem.h> +#include <86box/device.h> +#include <86box/fdd.h> +#include <86box/fdc.h> +#include <86box/nmi.h> +#include <86box/nvr.h> +#include <86box/gameport.h> +#include <86box/keyboard.h> +#include <86box/lpt.h> +#include <86box/rom.h> +#include <86box/hdc.h> +#include <86box/video.h> +#include <86box/machine.h> #include "cpu.h" -#include "m_xt_xi8088.h" +#include <86box/m_xt_xi8088.h> typedef struct xi8088_t { diff --git a/src/machine/m_xt_zenith.c b/src/machine/m_xt_zenith.c index cfbda25c8..0d527d20b 100644 --- a/src/machine/m_xt_zenith.c +++ b/src/machine/m_xt_zenith.c @@ -24,23 +24,23 @@ #include #include #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "timer.h" -#include "dma.h" -#include "nmi.h" -#include "pic.h" -#include "pit.h" -#include "mem.h" -#include "rom.h" -#include "device.h" -#include "fdd.h" -#include "fdc.h" -#include "gameport.h" -#include "keyboard.h" -#include "lpt.h" -#include "serial.h" -#include "machine.h" +#include <86box/timer.h> +#include <86box/dma.h> +#include <86box/nmi.h> +#include <86box/pic.h> +#include <86box/pit.h> +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/device.h> +#include <86box/fdd.h> +#include <86box/fdc.h> +#include <86box/gameport.h> +#include <86box/keyboard.h> +#include <86box/lpt.h> +#include <86box/serial.h> +#include <86box/machine.h> typedef struct { diff --git a/src/machine/machine.c b/src/machine/machine.c index 016468b4a..7f91ff3c5 100644 --- a/src/machine/machine.c +++ b/src/machine/machine.c @@ -24,19 +24,19 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "device.h" -#include "timer.h" -#include "dma.h" -#include "pic.h" -#include "pit.h" -#include "mem.h" -#include "rom.h" -#include "lpt.h" -#include "serial.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/timer.h> +#include <86box/dma.h> +#include <86box/pic.h> +#include <86box/pit.h> +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/lpt.h> +#include <86box/serial.h> #include "cpu.h" -#include "video.h" -#include "machine.h" +#include <86box/video.h> +#include <86box/machine.h> int bios_only = 0; diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index d20a8ba12..c2ff25c9a 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -25,12 +25,12 @@ #include #include #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "mem.h" -#include "rom.h" -#include "device.h" -#include "machine.h" +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/device.h> +#include <86box/machine.h> #ifdef USE_NEW_DYNAREC diff --git a/src/mca.c b/src/mca.c index d2bd9270f..f067d7cdc 100644 --- a/src/mca.c +++ b/src/mca.c @@ -2,8 +2,8 @@ #include #include #include -#include "86box_io.h" -#include "mca.h" +#include <86box/io.h> +#include <86box/mca.h> void (*mca_card_write[8])(int addr, uint8_t val, void *priv); diff --git a/src/mcr.c b/src/mcr.c index 86bddcbaf..ec1931882 100644 --- a/src/mcr.c +++ b/src/mcr.c @@ -5,8 +5,8 @@ #include #include #include -#include "86box.h" -#include "mem.h" +#include <86box/86box.h> +#include <86box/mem.h> int nextreg6; diff --git a/src/mem.c b/src/mem.c index 709697f16..f08c2fc9c 100644 --- a/src/mem.c +++ b/src/mem.c @@ -29,16 +29,16 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" #include "x86_ops.h" #include "x86.h" -#include "machine.h" -#include "m_xt_xi8088.h" -#include "config.h" -#include "86box_io.h" -#include "mem.h" -#include "rom.h" +#include <86box/machine.h> +#include <86box/m_xt_xi8088.h> +#include <86box/config.h> +#include <86box/io.h> +#include <86box/mem.h> +#include <86box/rom.h> #ifdef USE_DYNAREC # include "codegen_public.h" #else diff --git a/src/mouse.c b/src/mouse.c index 609419af7..7eb3cd8f0 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -25,9 +25,9 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "device.h" -#include "mouse.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/mouse.h> typedef struct { diff --git a/src/mouse_bus.c b/src/mouse_bus.c index 8d8cceae0..e2146a5af 100644 --- a/src/mouse_bus.c +++ b/src/mouse_bus.c @@ -74,13 +74,13 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "86box_io.h" -#include "pic.h" -#include "timer.h" -#include "device.h" -#include "mouse.h" -#include "random.h" +#include <86box/86box.h> +#include <86box/io.h> +#include <86box/pic.h> +#include <86box/timer.h> +#include <86box/device.h> +#include <86box/mouse.h> +#include <86box/random.h> #define IRQ_MASK ((1 << 5) >> dev->irq) diff --git a/src/mouse_ps2.c b/src/mouse_ps2.c index 48e22bb08..9c8fae1bf 100644 --- a/src/mouse_ps2.c +++ b/src/mouse_ps2.c @@ -19,10 +19,10 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "device.h" -#include "keyboard.h" -#include "mouse.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/keyboard.h> +#include <86box/mouse.h> enum { diff --git a/src/mouse_serial.c b/src/mouse_serial.c index 53ee47b43..b89595f28 100644 --- a/src/mouse_serial.c +++ b/src/mouse_serial.c @@ -21,11 +21,11 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "device.h" -#include "timer.h" -#include "serial.h" -#include "mouse.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/timer.h> +#include <86box/serial.h> +#include <86box/mouse.h> #define SERMOUSE_PORT 0 /* attach to Serial0 */ diff --git a/src/network/net_3c503.c b/src/network/net_3c503.c index 3bc0960c9..b983ca3a3 100644 --- a/src/network/net_3c503.c +++ b/src/network/net_3c503.c @@ -48,17 +48,17 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "86box_io.h" -#include "dma.h" -#include "pic.h" -#include "mem.h" -#include "random.h" -#include "device.h" -#include "network.h" -#include "net_dp8390.h" -#include "net_3c503.h" -#include "bswap.h" +#include <86box/86box.h> +#include <86box/io.h> +#include <86box/dma.h> +#include <86box/pic.h> +#include <86box/mem.h> +#include <86box/random.h> +#include <86box/device.h> +#include <86box/network.h> +#include <86box/net_dp8390.h> +#include <86box/net_3c503.h> +#include <86box/bswap.h> typedef struct { dp8390_t *dp8390; diff --git a/src/network/net_dp8390.c b/src/network/net_dp8390.c index 0ec1ad5dc..376b4dc51 100644 --- a/src/network/net_dp8390.c +++ b/src/network/net_dp8390.c @@ -23,10 +23,10 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "device.h" -#include "network.h" -#include "net_dp8390.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/network.h> +#include <86box/net_dp8390.h> static void dp8390_tx(dp8390_t *dev, uint32_t val); diff --git a/src/network/net_ne2000.c b/src/network/net_ne2000.c index 47a2478ef..6649db62c 100644 --- a/src/network/net_ne2000.c +++ b/src/network/net_ne2000.c @@ -52,19 +52,19 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "86box_io.h" -#include "mem.h" -#include "rom.h" -#include "mca.h" -#include "pci.h" -#include "pic.h" -#include "random.h" -#include "device.h" -#include "network.h" -#include "net_dp8390.h" -#include "net_ne2000.h" -#include "bswap.h" +#include <86box/86box.h> +#include <86box/io.h> +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/mca.h> +#include <86box/pci.h> +#include <86box/pic.h> +#include <86box/random.h> +#include <86box/device.h> +#include <86box/network.h> +#include <86box/net_dp8390.h> +#include <86box/net_ne2000.h> +#include <86box/bswap.h> enum { diff --git a/src/network/net_pcap.c b/src/network/net_pcap.c index a89b37527..21a43190b 100644 --- a/src/network/net_pcap.c +++ b/src/network/net_pcap.c @@ -51,11 +51,11 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "device.h" -#include "plat.h" -#include "plat_dynld.h" -#include "network.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/plat.h> +#include <86box/plat_dynld.h> +#include <86box/network.h> typedef int bpf_int32; diff --git a/src/network/net_pcnet.c b/src/network/net_pcnet.c index db1e5c618..df7dec9e2 100644 --- a/src/network/net_pcnet.c +++ b/src/network/net_pcnet.c @@ -31,19 +31,19 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "86box_io.h" -#include "timer.h" -#include "dma.h" -#include "mem.h" -#include "rom.h" -#include "pci.h" -#include "pic.h" -#include "random.h" -#include "device.h" -#include "network.h" -#include "net_pcnet.h" -#include "bswap.h" +#include <86box/86box.h> +#include <86box/io.h> +#include <86box/timer.h> +#include <86box/dma.h> +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/pci.h> +#include <86box/pic.h> +#include <86box/random.h> +#include <86box/device.h> +#include <86box/network.h> +#include <86box/net_pcnet.h> +#include <86box/bswap.h> /* PCI info. */ #define PCI_VENDID 0x1022 /* AMD */ diff --git a/src/network/net_slirp.c b/src/network/net_slirp.c index 56e23cfbd..3adc8d6f7 100644 --- a/src/network/net_slirp.c +++ b/src/network/net_slirp.c @@ -51,12 +51,12 @@ #include #include #define HAVE_STDARG_H -#include "slirp/slirp.h" -#include "slirp/queue.h" -#include "86box.h" -#include "device.h" -#include "plat.h" -#include "network.h" +#include +#include +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/plat.h> +#include <86box/network.h> static volatile queueADT slirpq; /* SLiRP library handle */ diff --git a/src/network/net_wd8003.c b/src/network/net_wd8003.c index 89e976794..7f0b5aeeb 100644 --- a/src/network/net_wd8003.c +++ b/src/network/net_wd8003.c @@ -48,20 +48,20 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "86box_io.h" -#include "mem.h" -#include "rom.h" -#include "machine.h" -#include "mca.h" -#include "pci.h" -#include "pic.h" -#include "random.h" -#include "device.h" -#include "network.h" -#include "net_dp8390.h" -#include "net_wd8003.h" -#include "bswap.h" +#include <86box/86box.h> +#include <86box/io.h> +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/machine.h> +#include <86box/mca.h> +#include <86box/pci.h> +#include <86box/pic.h> +#include <86box/random.h> +#include <86box/device.h> +#include <86box/network.h> +#include <86box/net_dp8390.h> +#include <86box/net_wd8003.h> +#include <86box/bswap.h> /* Board type codes in card ID */ #define WE_TYPE_WD8003 0x01 diff --git a/src/network/network.c b/src/network/network.c index a8d341b41..db69227f3 100644 --- a/src/network/network.c +++ b/src/network/network.c @@ -55,15 +55,15 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "device.h" -#include "plat.h" -#include "ui.h" -#include "network.h" -#include "net_3c503.h" -#include "net_ne2000.h" -#include "net_pcnet.h" -#include "net_wd8003.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/plat.h> +#include <86box/ui.h> +#include <86box/network.h> +#include <86box/net_3c503.h> +#include <86box/net_ne2000.h> +#include <86box/net_pcnet.h> +#include <86box/net_wd8003.h> static netcard_t net_cards[] = { diff --git a/src/network/pcap_if.c b/src/network/pcap_if.c index f5a9a4111..7f08b723d 100644 --- a/src/network/pcap_if.c +++ b/src/network/pcap_if.c @@ -54,9 +54,9 @@ #include #include #include -#include "86box.h" -#include "plat.h" -#include "plat_dynld.h" +#include <86box/86box.h> +#include <86box/plat.h> +#include <86box/plat_dynld.h> static void *pcap_handle; /* handle to WinPcap DLL */ diff --git a/src/nmi.c b/src/nmi.c index 808113bfa..07742cefe 100644 --- a/src/nmi.c +++ b/src/nmi.c @@ -5,8 +5,8 @@ #include #include #include -#include "86box_io.h" -#include "nmi.h" +#include <86box/io.h> +#include <86box/nmi.h> int nmi_mask; diff --git a/src/nvr.c b/src/nvr.c index 090aa2e3c..c5752aacb 100644 --- a/src/nvr.c +++ b/src/nvr.c @@ -54,12 +54,12 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "machine.h" -#include "mem.h" -#include "timer.h" -#include "plat.h" -#include "nvr.h" +#include <86box/86box.h> +#include <86box/machine.h> +#include <86box/mem.h> +#include <86box/timer.h> +#include <86box/plat.h> +#include <86box/nvr.h> int nvr_dosave; /* NVR is dirty, needs saved */ diff --git a/src/nvr_at.c b/src/nvr_at.c index 9a2858454..0ed657760 100644 --- a/src/nvr_at.c +++ b/src/nvr_at.c @@ -225,18 +225,18 @@ #include #include #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "machine.h" -#include "86box_io.h" -#include "mem.h" -#include "nmi.h" -#include "pic.h" -#include "timer.h" -#include "pit.h" -#include "rom.h" -#include "device.h" -#include "nvr.h" +#include <86box/machine.h> +#include <86box/io.h> +#include <86box/mem.h> +#include <86box/nmi.h> +#include <86box/pic.h> +#include <86box/timer.h> +#include <86box/pit.h> +#include <86box/rom.h> +#include <86box/device.h> +#include <86box/nvr.h> /* RTC registers and bit definitions. */ diff --git a/src/nvr_ps2.c b/src/nvr_ps2.c index e222bbd09..f0203c90a 100644 --- a/src/nvr_ps2.c +++ b/src/nvr_ps2.c @@ -39,15 +39,15 @@ #include #include #include -#include "86box.h" -#include "machine.h" -#include "device.h" -#include "86box_io.h" -#include "mem.h" -#include "timer.h" -#include "nvr.h" -#include "nvr_ps2.h" -#include "rom.h" +#include <86box/86box.h> +#include <86box/machine.h> +#include <86box/device.h> +#include <86box/io.h> +#include <86box/mem.h> +#include <86box/timer.h> +#include <86box/nvr.h> +#include <86box/nvr_ps2.h> +#include <86box/rom.h> typedef struct { diff --git a/src/pc.c b/src/pc.c index 018f2744d..c720e53ac 100644 --- a/src/pc.c +++ b/src/pc.c @@ -28,54 +28,54 @@ #include #define HAVE_STDARG_H -#include "86box.h" -#include "config.h" -#include "mem.h" +#include <86box/86box.h> +#include <86box/config.h> +#include <86box/mem.h> #include "cpu.h" #ifdef USE_DYNAREC # include "codegen_public.h" #endif #include "x86_ops.h" -#include "86box_io.h" -#include "rom.h" -#include "dma.h" -#include "pci.h" -#include "pic.h" -#include "timer.h" -#include "device.h" -#include "pit.h" -#include "random.h" -#include "timer.h" -#include "nvr.h" -#include "machine.h" -#include "bugger.h" -#include "postcard.h" -#include "isamem.h" -#include "isartc.h" -#include "lpt.h" -#include "serial.h" -#include "keyboard.h" -#include "mouse.h" -#include "gameport.h" -#include "fdd.h" -#include "fdc.h" -#include "hdd.h" -#include "hdc.h" -#include "hdc_ide.h" -#include "scsi.h" -#include "scsi_device.h" -#include "cdrom.h" -#include "zip.h" -#include "scsi_disk.h" -#include "cdrom_image.h" -#include "network.h" -#include "sound.h" -#include "midi.h" -#include "snd_speaker.h" -#include "video.h" -#include "ui.h" -#include "plat.h" -#include "plat_midi.h" +#include <86box/io.h> +#include <86box/rom.h> +#include <86box/dma.h> +#include <86box/pci.h> +#include <86box/pic.h> +#include <86box/timer.h> +#include <86box/device.h> +#include <86box/pit.h> +#include <86box/random.h> +#include <86box/timer.h> +#include <86box/nvr.h> +#include <86box/machine.h> +#include <86box/bugger.h> +#include <86box/postcard.h> +#include <86box/isamem.h> +#include <86box/isartc.h> +#include <86box/lpt.h> +#include <86box/serial.h> +#include <86box/keyboard.h> +#include <86box/mouse.h> +#include <86box/gameport.h> +#include <86box/fdd.h> +#include <86box/fdc.h> +#include <86box/hdd.h> +#include <86box/hdc.h> +#include <86box/hdc_ide.h> +#include <86box/scsi.h> +#include <86box/scsi_device.h> +#include <86box/cdrom.h> +#include <86box/zip.h> +#include <86box/scsi_disk.h> +#include <86box/cdrom_image.h> +#include <86box/network.h> +#include <86box/sound.h> +#include <86box/midi.h> +#include <86box/snd_speaker.h> +#include <86box/video.h> +#include <86box/ui.h> +#include <86box/plat.h> +#include <86box/plat_midi.h> /* Commandline options. */ diff --git a/src/pci.c b/src/pci.c index ec6e6c86a..a90c8fd5b 100644 --- a/src/pci.c +++ b/src/pci.c @@ -24,16 +24,16 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "machine.h" +#include <86box/86box.h> +#include <86box/machine.h> #include "cpu.h" -#include "86box_io.h" -#include "pic.h" -#include "mem.h" -#include "device.h" -#include "pci.h" -#include "piix.h" -#include "keyboard.h" +#include <86box/io.h> +#include <86box/pic.h> +#include <86box/mem.h> +#include <86box/device.h> +#include <86box/pci.h> +#include <86box/piix.h> +#include <86box/keyboard.h> typedef struct { diff --git a/src/pci_dummy.c b/src/pci_dummy.c index 02819618b..066f18dcc 100644 --- a/src/pci_dummy.c +++ b/src/pci_dummy.c @@ -3,10 +3,10 @@ #include #include #include -#include "86box.h" -#include "86box_io.h" -#include "pci.h" -#include "pci_dummy.h" +#include <86box/86box.h> +#include <86box/io.h> +#include <86box/pci.h> +#include <86box/pci_dummy.h> static uint8_t pci_regs[256]; diff --git a/src/pic.c b/src/pic.c index 8e3a6e943..dd0fe83b0 100644 --- a/src/pic.c +++ b/src/pic.c @@ -20,14 +20,14 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "machine.h" -#include "86box_io.h" -#include "pci.h" -#include "pic.h" -#include "timer.h" -#include "pit.h" +#include <86box/machine.h> +#include <86box/io.h> +#include <86box/pci.h> +#include <86box/pic.h> +#include <86box/timer.h> +#include <86box/pit.h> int output; diff --git a/src/pit.c b/src/pit.c index b3743138f..c12108f36 100644 --- a/src/pit.c +++ b/src/pit.c @@ -23,21 +23,21 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "device.h" -#include "timer.h" -#include "dma.h" -#include "86box_io.h" -#include "nmi.h" -#include "pic.h" -#include "timer.h" -#include "pit.h" -#include "ppi.h" -#include "machine/machine.h" -#include "sound/sound.h" -#include "sound/snd_speaker.h" -#include "video/video.h" +#include <86box/device.h> +#include <86box/timer.h> +#include <86box/dma.h> +#include <86box/io.h> +#include <86box/nmi.h> +#include <86box/pic.h> +#include <86box/timer.h> +#include <86box/pit.h> +#include <86box/ppi.h> +#include <86box/machine.h> +#include <86box/sound.h> +#include <86box/snd_speaker.h> +#include <86box/video.h> pit_t *pit, *pit2; diff --git a/src/port_92.c b/src/port_92.c index f20f4f984..a575ddf26 100644 --- a/src/port_92.c +++ b/src/port_92.c @@ -20,15 +20,15 @@ #include #include #include -#include "86box.h" -#include "device.h" +#include <86box/86box.h> +#include <86box/device.h> #include "cpu.h" -#include "timer.h" -#include "86box_io.h" -#include "keyboard.h" -#include "mem.h" -#include "pit.h" -#include "port_92.h" +#include <86box/timer.h> +#include <86box/io.h> +#include <86box/keyboard.h> +#include <86box/mem.h> +#include <86box/pit.h> +#include <86box/port_92.h> #define PORT_92_INV 1 diff --git a/src/postcard.c b/src/postcard.c index b7cf3f536..134af04b7 100644 --- a/src/postcard.c +++ b/src/postcard.c @@ -19,13 +19,13 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "86box_io.h" -#include "device.h" -#include "machine.h" -#include "plat.h" -#include "ui.h" -#include "postcard.h" +#include <86box/86box.h> +#include <86box/io.h> +#include <86box/device.h> +#include <86box/machine.h> +#include <86box/plat.h> +#include <86box/ui.h> +#include <86box/postcard.h> static uint16_t postcard_port; diff --git a/src/ppi.c b/src/ppi.c index e91b445d2..d9eb03cb3 100644 --- a/src/ppi.c +++ b/src/ppi.c @@ -11,9 +11,9 @@ #include #include #include -#include "timer.h" -#include "pit.h" -#include "ppi.h" +#include <86box/timer.h> +#include <86box/pit.h> +#include <86box/ppi.h> PPI ppi; diff --git a/src/printer/png.c b/src/printer/png.c index 37951912b..dbef31a91 100644 --- a/src/printer/png.c +++ b/src/printer/png.c @@ -52,12 +52,12 @@ #include #define PNG_DEBUG 0 #include -#include "86box.h" -#include "plat.h" -#include "plat_dynld.h" -#include "ui.h" -#include "video.h" -#include "png_struct.h" +#include <86box/86box.h> +#include <86box/plat.h> +#include <86box/plat_dynld.h> +#include <86box/ui.h> +#include <86box/video.h> +#include <86box/png_struct.h> #ifdef _WIN32 # define PATH_PNG_DLL "libpng16-16.dll" diff --git a/src/printer/prt_cpmap.c b/src/printer/prt_cpmap.c index 4a1e6c995..62c00d544 100644 --- a/src/printer/prt_cpmap.c +++ b/src/printer/prt_cpmap.c @@ -53,9 +53,9 @@ #include #include #include -#include "86box.h" -#include "plat.h" -#include "printer.h" +#include <86box/86box.h> +#include <86box/plat.h> +#include <86box/printer.h> static const uint16_t cp437Map[256] = { diff --git a/src/printer/prt_escp.c b/src/printer/prt_escp.c index 9e5e1c628..93a628f5b 100644 --- a/src/printer/prt_escp.c +++ b/src/printer/prt_escp.c @@ -56,21 +56,21 @@ #include #include #include FT_FREETYPE_H -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "machine.h" -#include "timer.h" -#include "mem.h" -#include "rom.h" -#include "pit.h" -#include "plat.h" -#include "plat_dynld.h" -#include "ui.h" -#include "lpt.h" -#include "video.h" -#include "png_struct.h" -#include "printer.h" -#include "prt_devs.h" +#include <86box/machine.h> +#include <86box/timer.h> +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/pit.h> +#include <86box/plat.h> +#include <86box/plat_dynld.h> +#include <86box/ui.h> +#include <86box/lpt.h> +#include <86box/video.h> +#include <86box/png_struct.h> +#include <86box/printer.h> +#include <86box/prt_devs.h> /* Default page values (for now.) */ diff --git a/src/printer/prt_ps.c b/src/printer/prt_ps.c index e849b57c9..cfaed6892 100644 --- a/src/printer/prt_ps.c +++ b/src/printer/prt_ps.c @@ -22,15 +22,15 @@ #include #include #include -#include "86box.h" -#include "language.h" -#include "lpt.h" -#include "timer.h" -#include "pit.h" -#include "plat.h" -#include "plat_dynld.h" -#include "ui.h" -#include "prt_devs.h" +#include <86box/86box.h> +#include <86box/language.h> +#include <86box/lpt.h> +#include <86box/timer.h> +#include <86box/pit.h> +#include <86box/plat.h> +#include <86box/plat_dynld.h> +#include <86box/ui.h> +#include <86box/prt_devs.h> #if defined(_WIN32) && !defined(__WINDOWS__) #define __WINDOWS__ diff --git a/src/printer/prt_text.c b/src/printer/prt_text.c index 6bbffb34a..4024deb64 100644 --- a/src/printer/prt_text.c +++ b/src/printer/prt_text.c @@ -56,14 +56,14 @@ #include #include #include -#include "86box.h" -#include "device.h" -#include "timer.h" -#include "pit.h" -#include "plat.h" -#include "lpt.h" -#include "printer.h" -#include "prt_devs.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/timer.h> +#include <86box/pit.h> +#include <86box/plat.h> +#include <86box/lpt.h> +#include <86box/printer.h> +#include <86box/prt_devs.h> #define FULL_PAGE 1 /* set if no top/bot margins */ diff --git a/src/random.c b/src/random.c index 1d644f3e3..aa0986960 100644 --- a/src/random.c +++ b/src/random.c @@ -16,7 +16,7 @@ */ #include #include -#include "random.h" +#include <86box/random.h> #if !(defined(__i386__) || defined (__x86_64__)) #include diff --git a/src/rom.c b/src/rom.c index 3d4d6fcdf..bea052b7f 100644 --- a/src/rom.c +++ b/src/rom.c @@ -29,12 +29,12 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "mem.h" -#include "rom.h" -#include "plat.h" -#include "machine.h" -#include "m_xt_xi8088.h" +#include <86box/86box.h> +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/plat.h> +#include <86box/machine.h> +#include <86box/m_xt_xi8088.h> #ifdef ENABLE_ROM_LOG diff --git a/src/scsi/scsi.c b/src/scsi/scsi.c index 21742c469..c22d41fa9 100644 --- a/src/scsi/scsi.c +++ b/src/scsi/scsi.c @@ -24,21 +24,21 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "device.h" -#include "hdc.h" -#include "hdd.h" -#include "plat.h" -#include "scsi.h" -#include "scsi_device.h" -#include "cdrom.h" -#include "zip.h" -#include "scsi_disk.h" -#include "scsi_aha154x.h" -#include "scsi_buslogic.h" -#include "scsi_ncr5380.h" -#include "scsi_ncr53c8xx.h" -#include "scsi_spock.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/hdc.h> +#include <86box/hdd.h> +#include <86box/plat.h> +#include <86box/scsi.h> +#include <86box/scsi_device.h> +#include <86box/cdrom.h> +#include <86box/zip.h> +#include <86box/scsi_disk.h> +#include <86box/scsi_aha154x.h> +#include <86box/scsi_buslogic.h> +#include <86box/scsi_ncr5380.h> +#include <86box/scsi_ncr53c8xx.h> +#include <86box/scsi_spock.h> #ifdef WALTJE # include "scsi_wd33c93.h" #endif diff --git a/src/scsi/scsi_aha154x.c b/src/scsi/scsi_aha154x.c index f686f686b..e8342ad90 100644 --- a/src/scsi/scsi_aha154x.c +++ b/src/scsi/scsi_aha154x.c @@ -24,21 +24,21 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "86box_io.h" -#include "timer.h" -#include "mca.h" -#include "mem.h" -#include "mca.h" -#include "rom.h" -#include "device.h" -#include "nvr.h" -#include "dma.h" -#include "pic.h" -#include "plat.h" -#include "scsi.h" -#include "scsi_aha154x.h" -#include "scsi_x54x.h" +#include <86box/86box.h> +#include <86box/io.h> +#include <86box/timer.h> +#include <86box/mca.h> +#include <86box/mem.h> +#include <86box/mca.h> +#include <86box/rom.h> +#include <86box/device.h> +#include <86box/nvr.h> +#include <86box/dma.h> +#include <86box/pic.h> +#include <86box/plat.h> +#include <86box/scsi.h> +#include <86box/scsi_aha154x.h> +#include <86box/scsi_x54x.h> enum { diff --git a/src/scsi/scsi_buslogic.c b/src/scsi/scsi_buslogic.c index 737f0f192..776bd0a6b 100644 --- a/src/scsi/scsi_buslogic.c +++ b/src/scsi/scsi_buslogic.c @@ -27,23 +27,23 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "86box_io.h" -#include "timer.h" -#include "mca.h" -#include "mem.h" -#include "mca.h" -#include "rom.h" -#include "device.h" -#include "nvr.h" -#include "dma.h" -#include "pic.h" -#include "pci.h" -#include "plat.h" -#include "scsi.h" -#include "scsi_buslogic.h" -#include "scsi_device.h" -#include "scsi_x54x.h" +#include <86box/86box.h> +#include <86box/io.h> +#include <86box/timer.h> +#include <86box/mca.h> +#include <86box/mem.h> +#include <86box/mca.h> +#include <86box/rom.h> +#include <86box/device.h> +#include <86box/nvr.h> +#include <86box/dma.h> +#include <86box/pic.h> +#include <86box/pci.h> +#include <86box/plat.h> +#include <86box/scsi.h> +#include <86box/scsi_buslogic.h> +#include <86box/scsi_device.h> +#include <86box/scsi_x54x.h> /* diff --git a/src/scsi/scsi_cdrom.c b/src/scsi/scsi_cdrom.c index 7515af9ca..2944335ee 100644 --- a/src/scsi/scsi_cdrom.c +++ b/src/scsi/scsi_cdrom.c @@ -23,20 +23,20 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "config.h" -#include "timer.h" -#include "device.h" -#include "piix.h" -#include "scsi_device.h" -#include "nvr.h" -#include "hdc.h" -#include "hdc_ide.h" -#include "sound.h" -#include "plat.h" -#include "ui.h" -#include "cdrom.h" -#include "scsi_cdrom.h" +#include <86box/86box.h> +#include <86box/config.h> +#include <86box/timer.h> +#include <86box/device.h> +#include <86box/piix.h> +#include <86box/scsi_device.h> +#include <86box/nvr.h> +#include <86box/hdc.h> +#include <86box/hdc_ide.h> +#include <86box/sound.h> +#include <86box/plat.h> +#include <86box/ui.h> +#include <86box/cdrom.h> +#include <86box/scsi_cdrom.h> #pragma pack(push,1) diff --git a/src/scsi/scsi_device.c b/src/scsi/scsi_device.c index 099bd2f90..19093c0ab 100644 --- a/src/scsi/scsi_device.c +++ b/src/scsi/scsi_device.c @@ -20,11 +20,11 @@ #include #include #include -#include "86box.h" -#include "device.h" -#include "hdd.h" -#include "scsi.h" -#include "scsi_device.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/hdd.h> +#include <86box/scsi.h> +#include <86box/scsi_device.h> scsi_device_t scsi_devices[SCSI_ID_MAX]; diff --git a/src/scsi/scsi_disk.c b/src/scsi/scsi_disk.c index ad596fa31..da65d517b 100644 --- a/src/scsi/scsi_disk.c +++ b/src/scsi/scsi_disk.c @@ -19,18 +19,18 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "timer.h" -#include "device.h" -#include "nvr.h" -#include "piix.h" -#include "hdd.h" -#include "hdc.h" -#include "scsi_device.h" -#include "hdc_ide.h" -#include "plat.h" -#include "ui.h" -#include "scsi_disk.h" +#include <86box/86box.h> +#include <86box/timer.h> +#include <86box/device.h> +#include <86box/nvr.h> +#include <86box/piix.h> +#include <86box/hdd.h> +#include <86box/hdc.h> +#include <86box/scsi_device.h> +#include <86box/hdc_ide.h> +#include <86box/plat.h> +#include <86box/ui.h> +#include <86box/scsi_disk.h> #define scsi_disk_sense_error dev->sense[0] diff --git a/src/scsi/scsi_ncr5380.c b/src/scsi/scsi_ncr5380.c index e54436a2f..eca899b80 100644 --- a/src/scsi/scsi_ncr5380.c +++ b/src/scsi/scsi_ncr5380.c @@ -27,20 +27,20 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "86box_io.h" -#include "timer.h" -#include "dma.h" -#include "pic.h" -#include "mca.h" -#include "mem.h" -#include "rom.h" -#include "device.h" -#include "nvr.h" -#include "plat.h" -#include "scsi.h" -#include "scsi_device.h" -#include "scsi_ncr5380.h" +#include <86box/86box.h> +#include <86box/io.h> +#include <86box/timer.h> +#include <86box/dma.h> +#include <86box/pic.h> +#include <86box/mca.h> +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/device.h> +#include <86box/nvr.h> +#include <86box/plat.h> +#include <86box/scsi.h> +#include <86box/scsi_device.h> +#include <86box/scsi_ncr5380.h> #define LCS6821N_ROM L"roms/scsi/ncr5380/Longshine LCS-6821N - BIOS version 1.04.bin" diff --git a/src/scsi/scsi_ncr53c8xx.c b/src/scsi/scsi_ncr53c8xx.c index bd824bb9c..cf3532a02 100644 --- a/src/scsi/scsi_ncr53c8xx.c +++ b/src/scsi/scsi_ncr53c8xx.c @@ -32,20 +32,20 @@ #include #define HAVE_STDARG_H #include -#include "86box.h" -#include "86box_io.h" -#include "timer.h" -#include "dma.h" -#include "pic.h" -#include "mem.h" -#include "rom.h" -#include "pci.h" -#include "device.h" -#include "nvr.h" -#include "plat.h" -#include "scsi.h" -#include "scsi_device.h" -#include "scsi_ncr53c8xx.h" +#include <86box/86box.h> +#include <86box/io.h> +#include <86box/timer.h> +#include <86box/dma.h> +#include <86box/pic.h> +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/pci.h> +#include <86box/device.h> +#include <86box/nvr.h> +#include <86box/plat.h> +#include <86box/scsi.h> +#include <86box/scsi_device.h> +#include <86box/scsi_ncr53c8xx.h> #define NCR53C8XX_ROM L"roms/scsi/ncr53c8xx/NCR307.BIN" diff --git a/src/scsi/scsi_spock.c b/src/scsi/scsi_spock.c index f974f16cd..635cd9887 100644 --- a/src/scsi/scsi_spock.c +++ b/src/scsi/scsi_spock.c @@ -25,20 +25,20 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "86box_io.h" -#include "timer.h" -#include "dma.h" -#include "pic.h" -#include "mca.h" -#include "mem.h" -#include "rom.h" -#include "device.h" -#include "nvr.h" -#include "plat.h" -#include "scsi.h" -#include "scsi_device.h" -#include "scsi_spock.h" +#include <86box/86box.h> +#include <86box/io.h> +#include <86box/timer.h> +#include <86box/dma.h> +#include <86box/pic.h> +#include <86box/mca.h> +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/device.h> +#include <86box/nvr.h> +#include <86box/plat.h> +#include <86box/scsi.h> +#include <86box/scsi_device.h> +#include <86box/scsi_spock.h> #define SPOCK_U68_1990_ROM L"roms/scsi/ibm/64f4376.bin" #define SPOCK_U69_1990_ROM L"roms/scsi/ibm/64f4377.bin" diff --git a/src/scsi/scsi_x54x.c b/src/scsi/scsi_x54x.c index 24253f98d..91233bca1 100644 --- a/src/scsi/scsi_x54x.c +++ b/src/scsi/scsi_x54x.c @@ -28,22 +28,22 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "86box_io.h" -#include "timer.h" -#include "dma.h" -#include "pic.h" -#include "pci.h" -#include "mca.h" -#include "mem.h" -#include "rom.h" -#include "device.h" -#include "nvr.h" -#include "plat.h" -#include "scsi.h" -#include "scsi_device.h" -#include "scsi_aha154x.h" -#include "scsi_x54x.h" +#include <86box/86box.h> +#include <86box/io.h> +#include <86box/timer.h> +#include <86box/dma.h> +#include <86box/pic.h> +#include <86box/pci.h> +#include <86box/mca.h> +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/device.h> +#include <86box/nvr.h> +#include <86box/plat.h> +#include <86box/scsi.h> +#include <86box/scsi_device.h> +#include <86box/scsi_aha154x.h> +#include <86box/scsi_x54x.h> #define X54X_RESET_DURATION_US UINT64_C(50000) diff --git a/src/serial.c b/src/serial.c index 2b3ad801f..a5f673026 100644 --- a/src/serial.c +++ b/src/serial.c @@ -27,16 +27,16 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "device.h" -#include "timer.h" -#include "machine.h" -#include "86box_io.h" -#include "pic.h" -#include "mem.h" -#include "rom.h" -#include "serial.h" -#include "mouse.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/timer.h> +#include <86box/machine.h> +#include <86box/io.h> +#include <86box/pic.h> +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/serial.h> +#include <86box/mouse.h> enum diff --git a/src/sio_acc3221.c b/src/sio_acc3221.c index 870a4f702..81af15036 100644 --- a/src/sio_acc3221.c +++ b/src/sio_acc3221.c @@ -19,18 +19,18 @@ #include #include #include -#include "86box.h" -#include "86box_io.h" -#include "timer.h" -#include "device.h" -#include "pci.h" -#include "lpt.h" -#include "serial.h" -#include "hdc.h" -#include "hdc_ide.h" -#include "fdd.h" -#include "fdc.h" -#include "sio.h" +#include <86box/86box.h> +#include <86box/io.h> +#include <86box/timer.h> +#include <86box/device.h> +#include <86box/pci.h> +#include <86box/lpt.h> +#include <86box/serial.h> +#include <86box/hdc.h> +#include <86box/hdc_ide.h> +#include <86box/fdd.h> +#include <86box/fdc.h> +#include <86box/sio.h> typedef struct acc3221_t { diff --git a/src/sio_detect.c b/src/sio_detect.c index 48588740b..67723a709 100644 --- a/src/sio_detect.c +++ b/src/sio_detect.c @@ -19,13 +19,13 @@ #include #include #include -#include "86box.h" -#include "device.h" -#include "86box_io.h" -#include "timer.h" -#include "fdd.h" -#include "fdc.h" -#include "sio.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/io.h> +#include <86box/timer.h> +#include <86box/fdd.h> +#include <86box/fdc.h> +#include <86box/sio.h> typedef struct { diff --git a/src/sio_f82c710.c b/src/sio_f82c710.c index fbd7a4848..46cca26b8 100644 --- a/src/sio_f82c710.c +++ b/src/sio_f82c710.c @@ -19,17 +19,17 @@ #include #include #include -#include "86box.h" -#include "86box_io.h" -#include "timer.h" -#include "device.h" -#include "lpt.h" -#include "serial.h" -#include "disk/hdc.h" -#include "disk/hdc_ide.h" -#include "floppy/fdd.h" -#include "floppy/fdc.h" -#include "sio.h" +#include <86box/86box.h> +#include <86box/io.h> +#include <86box/timer.h> +#include <86box/device.h> +#include <86box/lpt.h> +#include <86box/serial.h> +#include <86box/hdc.h> +#include <86box/hdc_ide.h> +#include <86box/fdd.h> +#include <86box/fdc.h> +#include <86box/sio.h> typedef struct upc_t { diff --git a/src/sio_fdc37c669.c b/src/sio_fdc37c669.c index fcd4fc04d..4f6823f8f 100644 --- a/src/sio_fdc37c669.c +++ b/src/sio_fdc37c669.c @@ -18,18 +18,18 @@ #include #include #include -#include "86box.h" -#include "86box_io.h" -#include "timer.h" -#include "device.h" -#include "pci.h" -#include "lpt.h" -#include "serial.h" -#include "hdc.h" -#include "hdc_ide.h" -#include "fdd.h" -#include "fdc.h" -#include "sio.h" +#include <86box/86box.h> +#include <86box/io.h> +#include <86box/timer.h> +#include <86box/device.h> +#include <86box/pci.h> +#include <86box/lpt.h> +#include <86box/serial.h> +#include <86box/hdc.h> +#include <86box/hdc_ide.h> +#include <86box/fdd.h> +#include <86box/fdc.h> +#include <86box/sio.h> typedef struct { diff --git a/src/sio_fdc37c66x.c b/src/sio_fdc37c66x.c index 707dc24a1..eefafe083 100644 --- a/src/sio_fdc37c66x.c +++ b/src/sio_fdc37c66x.c @@ -22,18 +22,18 @@ #include #include #include -#include "86box.h" -#include "86box_io.h" -#include "timer.h" -#include "device.h" -#include "pci.h" -#include "lpt.h" -#include "serial.h" -#include "hdc.h" -#include "hdc_ide.h" -#include "fdd.h" -#include "fdc.h" -#include "sio.h" +#include <86box/86box.h> +#include <86box/io.h> +#include <86box/timer.h> +#include <86box/device.h> +#include <86box/pci.h> +#include <86box/lpt.h> +#include <86box/serial.h> +#include <86box/hdc.h> +#include <86box/hdc_ide.h> +#include <86box/fdd.h> +#include <86box/fdc.h> +#include <86box/sio.h> typedef struct { diff --git a/src/sio_fdc37c67x.c b/src/sio_fdc37c67x.c index 6e51d5028..6d7c3d44e 100644 --- a/src/sio_fdc37c67x.c +++ b/src/sio_fdc37c67x.c @@ -21,18 +21,18 @@ #include #include #include -#include "86box.h" -#include "device.h" -#include "86box_io.h" -#include "timer.h" -#include "pci.h" -#include "mem.h" -#include "rom.h" -#include "lpt.h" -#include "serial.h" -#include "fdd.h" -#include "fdc.h" -#include "sio.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/io.h> +#include <86box/timer.h> +#include <86box/pci.h> +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/lpt.h> +#include <86box/serial.h> +#include <86box/fdd.h> +#include <86box/fdc.h> +#include <86box/sio.h> #define HEFRAS (dev->regs[0x26] & 0x40) diff --git a/src/sio_fdc37c93x.c b/src/sio_fdc37c93x.c index 0342833e7..f28cf7e81 100644 --- a/src/sio_fdc37c93x.c +++ b/src/sio_fdc37c93x.c @@ -19,18 +19,18 @@ #include #include #include -#include "86box.h" -#include "86box_io.h" -#include "timer.h" -#include "device.h" -#include "pci.h" -#include "lpt.h" -#include "serial.h" -#include "hdc.h" -#include "hdc_ide.h" -#include "fdd.h" -#include "fdc.h" -#include "sio.h" +#include <86box/86box.h> +#include <86box/io.h> +#include <86box/timer.h> +#include <86box/device.h> +#include <86box/pci.h> +#include <86box/lpt.h> +#include <86box/serial.h> +#include <86box/hdc.h> +#include <86box/hdc_ide.h> +#include <86box/fdd.h> +#include <86box/fdc.h> +#include <86box/sio.h> #define AB_RST 0x80 diff --git a/src/sio_pc87306.c b/src/sio_pc87306.c index 0d21e7845..2a1305e62 100644 --- a/src/sio_pc87306.c +++ b/src/sio_pc87306.c @@ -18,21 +18,21 @@ #include #include #include -#include "86box.h" -#include "86box_io.h" -#include "timer.h" -#include "device.h" -#include "lpt.h" -#include "mem.h" -#include "nvr.h" -#include "pci.h" -#include "rom.h" -#include "serial.h" -#include "hdc.h" -#include "hdc_ide.h" -#include "fdd.h" -#include "fdc.h" -#include "sio.h" +#include <86box/86box.h> +#include <86box/io.h> +#include <86box/timer.h> +#include <86box/device.h> +#include <86box/lpt.h> +#include <86box/mem.h> +#include <86box/nvr.h> +#include <86box/pci.h> +#include <86box/rom.h> +#include <86box/serial.h> +#include <86box/hdc.h> +#include <86box/hdc_ide.h> +#include <86box/fdd.h> +#include <86box/fdc.h> +#include <86box/sio.h> typedef struct { diff --git a/src/sio_um8669f.c b/src/sio_um8669f.c index 0d7b21511..cdaf8cf72 100644 --- a/src/sio_um8669f.c +++ b/src/sio_um8669f.c @@ -26,16 +26,16 @@ PnP registers : #include #include #include -#include "86box.h" -#include "device.h" -#include "86box_io.h" -#include "timer.h" -#include "pci.h" -#include "lpt.h" -#include "serial.h" -#include "fdd.h" -#include "fdc.h" -#include "sio.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/io.h> +#include <86box/timer.h> +#include <86box/pci.h> +#include <86box/lpt.h> +#include <86box/serial.h> +#include <86box/fdd.h> +#include <86box/fdc.h> +#include <86box/sio.h> #define DEV_FDC 0 diff --git a/src/sio_w83787f.c b/src/sio_w83787f.c index 20603db8c..0af124c55 100644 --- a/src/sio_w83787f.c +++ b/src/sio_w83787f.c @@ -21,18 +21,18 @@ #include #include #include -#include "86box.h" -#include "device.h" -#include "86box_io.h" -#include "timer.h" -#include "pci.h" -#include "mem.h" -#include "rom.h" -#include "lpt.h" -#include "serial.h" -#include "fdd.h" -#include "fdc.h" -#include "sio.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/io.h> +#include <86box/timer.h> +#include <86box/pci.h> +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/lpt.h> +#include <86box/serial.h> +#include <86box/fdd.h> +#include <86box/fdc.h> +#include <86box/sio.h> #define FDDA_TYPE (dev->regs[7] & 3) diff --git a/src/sio_w83877f.c b/src/sio_w83877f.c index a6d093da3..7f562b6be 100644 --- a/src/sio_w83877f.c +++ b/src/sio_w83877f.c @@ -21,18 +21,18 @@ #include #include #include -#include "86box.h" -#include "device.h" -#include "86box_io.h" -#include "timer.h" -#include "pci.h" -#include "mem.h" -#include "rom.h" -#include "lpt.h" -#include "serial.h" -#include "fdd.h" -#include "fdc.h" -#include "sio.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/io.h> +#include <86box/timer.h> +#include <86box/pci.h> +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/lpt.h> +#include <86box/serial.h> +#include <86box/fdd.h> +#include <86box/fdc.h> +#include <86box/sio.h> #define FDDA_TYPE (dev->regs[7] & 3) diff --git a/src/sio_w83977f.c b/src/sio_w83977f.c index 401665dee..27082516d 100644 --- a/src/sio_w83977f.c +++ b/src/sio_w83977f.c @@ -21,18 +21,18 @@ #include #include #include -#include "86box.h" -#include "device.h" -#include "86box_io.h" -#include "timer.h" -#include "pci.h" -#include "mem.h" -#include "rom.h" -#include "lpt.h" -#include "serial.h" -#include "fdd.h" -#include "fdc.h" -#include "sio.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/io.h> +#include <86box/timer.h> +#include <86box/pci.h> +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/lpt.h> +#include <86box/serial.h> +#include <86box/fdd.h> +#include <86box/fdc.h> +#include <86box/sio.h> #define HEFRAS (dev->regs[0x26] & 0x40) diff --git a/src/smbus.c b/src/smbus.c index 4b2ac8c59..d24435cc7 100644 --- a/src/smbus.c +++ b/src/smbus.c @@ -21,8 +21,8 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "smbus.h" +#include <86box/86box.h> +#include <86box/smbus.h> #define NADDRS 128 /* SMBus supports 128 addresses */ diff --git a/src/sound/midi.c b/src/sound/midi.c index 35483e323..22efb56f2 100644 --- a/src/sound/midi.c +++ b/src/sound/midi.c @@ -25,12 +25,12 @@ #include #include #include -#include "86box.h" -#include "device.h" -#include "plat.h" -#include "plat_midi.h" -#include "midi.h" -#include "midi_input.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/plat.h> +#include <86box/plat_midi.h> +#include <86box/midi.h> +#include <86box/midi_input.h> int midi_device_current = 0; diff --git a/src/sound/midi_fluidsynth.c b/src/sound/midi_fluidsynth.c index 6a3f42c08..bc18027e6 100644 --- a/src/sound/midi_fluidsynth.c +++ b/src/sound/midi_fluidsynth.c @@ -5,14 +5,14 @@ #include #include #include -#include "86box.h" -#include "config.h" -#include "device.h" -#include "plat.h" -#include "plat_dynld.h" -#include "ui.h" -#include "midi.h" -#include "sound.h" +#include <86box/86box.h> +#include <86box/config.h> +#include <86box/device.h> +#include <86box/plat.h> +#include <86box/plat_dynld.h> +#include <86box/ui.h> +#include <86box/midi.h> +#include <86box/sound.h> #define FLUID_CHORUS_DEFAULT_N 3 diff --git a/src/sound/midi_mt32.c b/src/sound/midi_mt32.c index 1d6707d11..987d615a1 100644 --- a/src/sound/midi_mt32.c +++ b/src/sound/midi_mt32.c @@ -3,14 +3,14 @@ #include #include #include -#include "munt/c_interface/c_interface.h" -#include "86box.h" -#include "device.h" -#include "mem.h" -#include "rom.h" -#include "plat.h" -#include "sound.h" -#include "midi.h" +#include +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/plat.h> +#include <86box/sound.h> +#include <86box/midi.h> extern void givealbuffer_midi(void *buf, uint32_t size); diff --git a/src/sound/midi_system.c b/src/sound/midi_system.c index 90c9bc36e..071e30883 100644 --- a/src/sound/midi_system.c +++ b/src/sound/midi_system.c @@ -3,12 +3,12 @@ #include #include #include -#include "86box.h" -#include "device.h" -#include "plat.h" -#include "plat_midi.h" -#include "midi.h" -#include "midi_input.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/plat.h> +#include <86box/plat_midi.h> +#include <86box/midi.h> +#include <86box/midi_input.h> void* system_midi_init(const device_t *info) diff --git a/src/sound/munt/SampleRateConverter_dummy.cpp b/src/sound/munt/SampleRateConverter_dummy.cpp index 9094f1514..09f491338 100644 --- a/src/sound/munt/SampleRateConverter_dummy.cpp +++ b/src/sound/munt/SampleRateConverter_dummy.cpp @@ -16,7 +16,7 @@ #include #include -#include "../../plat.h" +#include <86box/plat.h> #include "SampleRateConverter.h" #include "Synth.h" diff --git a/src/sound/openal.c b/src/sound/openal.c index c63baceec..39819f591 100644 --- a/src/sound/openal.c +++ b/src/sound/openal.c @@ -29,9 +29,9 @@ # include # include # include -#include "86box.h" -#include "sound.h" -#include "midi.h" +#include <86box/86box.h> +#include <86box/sound.h> +#include <86box/midi.h> #define FREQ 48000 diff --git a/src/sound/snd_ad1848.c b/src/sound/snd_ad1848.c index 2817ed36d..e3ed09981 100644 --- a/src/sound/snd_ad1848.c +++ b/src/sound/snd_ad1848.c @@ -7,12 +7,12 @@ #include #include #include -#include "86box.h" -#include "dma.h" -#include "pic.h" -#include "timer.h" -#include "sound.h" -#include "snd_ad1848.h" +#include <86box/86box.h> +#include <86box/dma.h> +#include <86box/pic.h> +#include <86box/timer.h> +#include <86box/sound.h> +#include <86box/snd_ad1848.h> static int ad1848_vols_6bits[64]; diff --git a/src/sound/snd_adlib.c b/src/sound/snd_adlib.c index 4457e61e7..2b9dfb443 100644 --- a/src/sound/snd_adlib.c +++ b/src/sound/snd_adlib.c @@ -5,13 +5,13 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "86box_io.h" -#include "timer.h" -#include "mca.h" -#include "device.h" -#include "sound.h" -#include "snd_opl.h" +#include <86box/86box.h> +#include <86box/io.h> +#include <86box/timer.h> +#include <86box/mca.h> +#include <86box/device.h> +#include <86box/sound.h> +#include <86box/snd_opl.h> #ifdef ENABLE_ADLIB_LOG diff --git a/src/sound/snd_adlibgold.c b/src/sound/snd_adlibgold.c index c45f85b41..d69268950 100644 --- a/src/sound/snd_adlibgold.c +++ b/src/sound/snd_adlibgold.c @@ -3,17 +3,17 @@ #include #include #include -#include "86box.h" -#include "86box_io.h" -#include "timer.h" -#include "dma.h" -#include "pic.h" -#include "device.h" -#include "nvr.h" -#include "sound.h" -#include "filters.h" -#include "snd_opl.h" -#include "snd_ym7128.h" +#include <86box/86box.h> +#include <86box/io.h> +#include <86box/timer.h> +#include <86box/dma.h> +#include <86box/pic.h> +#include <86box/device.h> +#include <86box/nvr.h> +#include <86box/sound.h> +#include <86box/filters.h> +#include <86box/snd_opl.h> +#include <86box/snd_ym7128.h> typedef struct adgold_t diff --git a/src/sound/snd_audiopci.c b/src/sound/snd_audiopci.c index 5e87c993d..952152de5 100644 --- a/src/sound/snd_audiopci.c +++ b/src/sound/snd_audiopci.c @@ -5,16 +5,16 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "device.h" -#include "86box_io.h" -#include "nmi.h" -#include "mem.h" -#include "pci.h" -#include "timer.h" -#include "sound.h" -#include "midi.h" -#include "snd_mpu401.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/io.h> +#include <86box/nmi.h> +#include <86box/mem.h> +#include <86box/pci.h> +#include <86box/timer.h> +#include <86box/sound.h> +#include <86box/midi.h> +#include <86box/snd_mpu401.h> #define N 16 diff --git a/src/sound/snd_azt2316a.c b/src/sound/snd_azt2316a.c index 6131f7b8f..3c087c905 100644 --- a/src/sound/snd_azt2316a.c +++ b/src/sound/snd_azt2316a.c @@ -138,17 +138,17 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "86box_io.h" -#include "timer.h" -#include "pic.h" -#include "nvr.h" -#include "device.h" -#include "sound.h" -#include "midi.h" -#include "snd_ad1848.h" -#include "snd_azt2316a.h" -#include "snd_sb.h" +#include <86box/86box.h> +#include <86box/io.h> +#include <86box/timer.h> +#include <86box/pic.h> +#include <86box/nvr.h> +#include <86box/device.h> +#include <86box/sound.h> +#include <86box/midi.h> +#include <86box/snd_ad1848.h> +#include <86box/snd_azt2316a.h> +#include <86box/snd_sb.h> /*530, 11, 3 - 530=23*/ /*530, 11, 1 - 530=22*/ diff --git a/src/sound/snd_cms.c b/src/sound/snd_cms.c index 829399932..9a635b50e 100644 --- a/src/sound/snd_cms.c +++ b/src/sound/snd_cms.c @@ -5,10 +5,10 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "86box_io.h" -#include "device.h" -#include "sound.h" +#include <86box/86box.h> +#include <86box/io.h> +#include <86box/device.h> +#include <86box/sound.h> #define MASTER_CLOCK 7159090 diff --git a/src/sound/snd_emu8k.c b/src/sound/snd_emu8k.c index 946d8b7f6..706b0e130 100644 --- a/src/sound/snd_emu8k.c +++ b/src/sound/snd_emu8k.c @@ -7,14 +7,14 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "device.h" -#include "86box_io.h" -#include "mem.h" -#include "rom.h" -#include "timer.h" -#include "sound.h" -#include "snd_emu8k.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/io.h> +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/timer.h> +#include <86box/sound.h> +#include <86box/snd_emu8k.h> #if !defined FILTER_INITIAL && !defined FILTER_MOOG && !defined FILTER_CONSTANT diff --git a/src/sound/snd_gus.c b/src/sound/snd_gus.c index bcba6dc6f..9fa3bbdc2 100644 --- a/src/sound/snd_gus.c +++ b/src/sound/snd_gus.c @@ -5,15 +5,15 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "86box_io.h" -#include "nmi.h" -#include "pic.h" -#include "dma.h" -#include "timer.h" -#include "device.h" -#include "sound.h" -#include "midi.h" +#include <86box/86box.h> +#include <86box/io.h> +#include <86box/nmi.h> +#include <86box/pic.h> +#include <86box/dma.h> +#include <86box/timer.h> +#include <86box/device.h> +#include <86box/sound.h> +#include <86box/midi.h> enum { diff --git a/src/sound/snd_lpt_dac.c b/src/sound/snd_lpt_dac.c index 1f1d57122..b869e2d9f 100644 --- a/src/sound/snd_lpt_dac.c +++ b/src/sound/snd_lpt_dac.c @@ -3,13 +3,13 @@ #include #include #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "machine.h" -#include "lpt.h" -#include "timer.h" -#include "sound.h" -#include "filters.h" +#include <86box/machine.h> +#include <86box/lpt.h> +#include <86box/timer.h> +#include <86box/sound.h> +#include <86box/filters.h> typedef struct lpt_dac_t { diff --git a/src/sound/snd_lpt_dss.c b/src/sound/snd_lpt_dss.c index 973cb70de..c1945d4ff 100644 --- a/src/sound/snd_lpt_dss.c +++ b/src/sound/snd_lpt_dss.c @@ -3,13 +3,13 @@ #include #include #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "machine.h" -#include "timer.h" -#include "lpt.h" -#include "sound.h" -#include "filters.h" +#include <86box/machine.h> +#include <86box/timer.h> +#include <86box/lpt.h> +#include <86box/sound.h> +#include <86box/filters.h> typedef struct dss_t { diff --git a/src/sound/snd_mpu401.c b/src/sound/snd_mpu401.c index b55a05007..c17531dba 100644 --- a/src/sound/snd_mpu401.c +++ b/src/sound/snd_mpu401.c @@ -27,17 +27,17 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "device.h" -#include "plat.h" -#include "86box_io.h" -#include "machine.h" -#include "mca.h" -#include "pic.h" -#include "timer.h" -#include "sound.h" -#include "snd_mpu401.h" -#include "midi.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/plat.h> +#include <86box/io.h> +#include <86box/machine.h> +#include <86box/mca.h> +#include <86box/pic.h> +#include <86box/timer.h> +#include <86box/sound.h> +#include <86box/snd_mpu401.h> +#include <86box/midi.h> static uint32_t MPUClockBase[8] = {48,72,96,120,144,168,192}; diff --git a/src/sound/snd_opl.c b/src/sound/snd_opl.c index 6efc3fd5b..ce36078f6 100644 --- a/src/sound/snd_opl.c +++ b/src/sound/snd_opl.c @@ -6,13 +6,13 @@ #include #include #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "86box_io.h" -#include "timer.h" -#include "sound.h" -#include "snd_opl.h" -#include "snd_opl_backend.h" +#include <86box/io.h> +#include <86box/timer.h> +#include <86box/sound.h> +#include <86box/snd_opl.h> +#include <86box/snd_opl_backend.h> /*Interfaces between 86Box and the actual OPL emulator*/ diff --git a/src/sound/snd_opl_backend.c b/src/sound/snd_opl_backend.c index 2e8ae1df6..03bdbd2ea 100644 --- a/src/sound/snd_opl_backend.c +++ b/src/sound/snd_opl_backend.c @@ -6,12 +6,12 @@ #include #include -#include "86box.h" -#include "nukedopl.h" -#include "sound.h" -#include "snd_opl_backend.h" +#include <86box/86box.h> +#include +#include <86box/sound.h> +#include <86box/snd_opl_backend.h> #include "cpu.h" -#include "mem.h" +#include <86box/mem.h> int opl_type = 0; diff --git a/src/sound/snd_pas16.c b/src/sound/snd_pas16.c index 717b45122..8eccf1f6d 100644 --- a/src/sound/snd_pas16.c +++ b/src/sound/snd_pas16.c @@ -5,19 +5,19 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "86box_io.h" -#include "pic.h" -#include "timer.h" -#include "pit.h" -#include "dma.h" -#include "device.h" -#include "sound.h" -#include "filters.h" -#include "snd_mpu401.h" -#include "snd_opl.h" -#include "snd_sb_dsp.h" +#include <86box/io.h> +#include <86box/pic.h> +#include <86box/timer.h> +#include <86box/pit.h> +#include <86box/dma.h> +#include <86box/device.h> +#include <86box/sound.h> +#include <86box/filters.h> +#include <86box/snd_mpu401.h> +#include <86box/snd_opl.h> +#include <86box/snd_sb_dsp.h> /* Original PAS uses diff --git a/src/sound/snd_pssj.c b/src/sound/snd_pssj.c index 1f0000cb1..9585ff662 100644 --- a/src/sound/snd_pssj.c +++ b/src/sound/snd_pssj.c @@ -3,14 +3,14 @@ #include #include #include -#include "86box.h" -#include "86box_io.h" -#include "dma.h" -#include "pic.h" -#include "timer.h" -#include "device.h" -#include "sound.h" -#include "snd_sn76489.h" +#include <86box/86box.h> +#include <86box/io.h> +#include <86box/dma.h> +#include <86box/pic.h> +#include <86box/timer.h> +#include <86box/device.h> +#include <86box/sound.h> +#include <86box/snd_sn76489.h> typedef struct pssj_t diff --git a/src/sound/snd_resid.cc b/src/sound/snd_resid.cc index 931a4e1d0..5ca5f6804 100644 --- a/src/sound/snd_resid.cc +++ b/src/sound/snd_resid.cc @@ -3,8 +3,8 @@ #include #include #include "resid-fp/sid.h" -#include "plat.h" -#include "snd_resid.h" +#include <86box/plat.h> +#include <86box/snd_resid.h> typedef struct psid_t diff --git a/src/sound/snd_sb.c b/src/sound/snd_sb.c index f11cbbe93..7a981c098 100644 --- a/src/sound/snd_sb.c +++ b/src/sound/snd_sb.c @@ -24,18 +24,18 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "86box_io.h" -#include "timer.h" -#include "mca.h" -#include "mem.h" -#include "rom.h" -#include "device.h" -#include "pic.h" -#include "sound.h" -#include "midi.h" -#include "filters.h" -#include "snd_sb.h" +#include <86box/86box.h> +#include <86box/io.h> +#include <86box/timer.h> +#include <86box/mca.h> +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/device.h> +#include <86box/pic.h> +#include <86box/sound.h> +#include <86box/midi.h> +#include <86box/filters.h> +#include <86box/snd_sb.h> //#define SB_DSP_RECORD_DEBUG diff --git a/src/sound/snd_sb_dsp.c b/src/sound/snd_sb_dsp.c index 5006b9b25..6fccf6dd3 100644 --- a/src/sound/snd_sb_dsp.c +++ b/src/sound/snd_sb_dsp.c @@ -12,18 +12,18 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "86box_io.h" -#include "pic.h" -#include "dma.h" -#include "timer.h" -#include "device.h" -#include "filters.h" -#include "sound.h" -#include "midi.h" -#include "sound.h" -#include "snd_azt2316a.h" -#include "snd_sb.h" +#include <86box/86box.h> +#include <86box/io.h> +#include <86box/pic.h> +#include <86box/dma.h> +#include <86box/timer.h> +#include <86box/device.h> +#include <86box/filters.h> +#include <86box/sound.h> +#include <86box/midi.h> +#include <86box/sound.h> +#include <86box/snd_azt2316a.h> +#include <86box/snd_sb.h> #define ADPCM_4 1 diff --git a/src/sound/snd_sn76489.c b/src/sound/snd_sn76489.c index 1bcdcaf2d..215cea02a 100644 --- a/src/sound/snd_sn76489.c +++ b/src/sound/snd_sn76489.c @@ -4,11 +4,11 @@ #include #include #include -#include "86box.h" -#include "86box_io.h" -#include "device.h" -#include "sound.h" -#include "snd_sn76489.h" +#include <86box/86box.h> +#include <86box/io.h> +#include <86box/device.h> +#include <86box/sound.h> +#include <86box/snd_sn76489.h> int sn76489_mute; diff --git a/src/sound/snd_speaker.c b/src/sound/snd_speaker.c index 763116200..d2ed41b82 100644 --- a/src/sound/snd_speaker.c +++ b/src/sound/snd_speaker.c @@ -20,11 +20,11 @@ #include #include #include -#include "86box.h" -#include "timer.h" -#include "pit.h" -#include "sound.h" -#include "snd_speaker.h" +#include <86box/86box.h> +#include <86box/timer.h> +#include <86box/pit.h> +#include <86box/sound.h> +#include <86box/snd_speaker.h> int speaker_mute = 0, speaker_gated = 0; diff --git a/src/sound/snd_ssi2001.c b/src/sound/snd_ssi2001.c index 3f52e77a9..ee994389e 100644 --- a/src/sound/snd_ssi2001.c +++ b/src/sound/snd_ssi2001.c @@ -5,11 +5,11 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "86box_io.h" -#include "device.h" -#include "sound.h" -#include "snd_resid.h" +#include <86box/86box.h> +#include <86box/io.h> +#include <86box/device.h> +#include <86box/sound.h> +#include <86box/snd_resid.h> typedef struct ssi2001_t diff --git a/src/sound/snd_wss.c b/src/sound/snd_wss.c index 8bb23ca24..0dc3d2f6b 100644 --- a/src/sound/snd_wss.c +++ b/src/sound/snd_wss.c @@ -22,16 +22,16 @@ #include #include #include -#include "86box.h" -#include "86box_io.h" -#include "timer.h" -#include "mca.h" -#include "pic.h" -#include "dma.h" -#include "device.h" -#include "sound.h" -#include "snd_ad1848.h" -#include "snd_opl.h" +#include <86box/86box.h> +#include <86box/io.h> +#include <86box/timer.h> +#include <86box/mca.h> +#include <86box/pic.h> +#include <86box/dma.h> +#include <86box/device.h> +#include <86box/sound.h> +#include <86box/snd_ad1848.h> +#include <86box/snd_opl.h> /*530, 11, 3 - 530=23*/ diff --git a/src/sound/snd_ym7128.c b/src/sound/snd_ym7128.c index 79db28b38..42d21ba63 100644 --- a/src/sound/snd_ym7128.c +++ b/src/sound/snd_ym7128.c @@ -2,8 +2,8 @@ #include #include #include -#include "86box.h" -#include "snd_ym7128.h" +#include <86box/86box.h> +#include <86box/snd_ym7128.h> static int attenuation[32]; diff --git a/src/sound/sound.c b/src/sound/sound.c index 49655d5ac..76206998e 100644 --- a/src/sound/sound.c +++ b/src/sound/sound.c @@ -23,19 +23,19 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "device.h" -#include "timer.h" -#include "cdrom.h" -#include "hdc_ide.h" -#include "plat.h" -#include "sound.h" -#include "midi.h" -#include "snd_opl.h" -#include "snd_mpu401.h" -#include "snd_sb_dsp.h" -#include "snd_azt2316a.h" -#include "filters.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/timer.h> +#include <86box/cdrom.h> +#include <86box/hdc_ide.h> +#include <86box/plat.h> +#include <86box/sound.h> +#include <86box/midi.h> +#include <86box/snd_opl.h> +#include <86box/snd_mpu401.h> +#include <86box/snd_sb_dsp.h> +#include <86box/snd_azt2316a.h> +#include <86box/filters.h> typedef struct { diff --git a/src/spd.c b/src/spd.c index a4abca624..aa514305b 100644 --- a/src/spd.c +++ b/src/spd.c @@ -21,10 +21,10 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "device.h" -#include "smbus.h" -#include "spd.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/smbus.h> +#include <86box/spd.h> #define SPD_MAX_SLOTS 8 diff --git a/src/sst_flash.c b/src/sst_flash.c index c6a4c8471..468d5d48a 100644 --- a/src/sst_flash.c +++ b/src/sst_flash.c @@ -23,13 +23,13 @@ #include #include #include -#include "86box.h" -#include "device.h" -#include "mem.h" -#include "machine.h" -#include "timer.h" -#include "nvr.h" -#include "plat.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/mem.h> +#include <86box/machine.h> +#include <86box/timer.h> +#include <86box/nvr.h> +#include <86box/plat.h> typedef struct sst_t diff --git a/src/timer.c b/src/timer.c index 600b28c06..e7967e652 100644 --- a/src/timer.c +++ b/src/timer.c @@ -2,8 +2,8 @@ #include #include #include -#include "86box.h" -#include "timer.h" +#include <86box/86box.h> +#include <86box/timer.h> uint64_t TIMER_USEC; diff --git a/src/usb.c b/src/usb.c index f962af311..721289afb 100644 --- a/src/usb.c +++ b/src/usb.c @@ -5,9 +5,9 @@ #include #include #include -#include "86box_io.h" -#include "mem.h" -#include "usb.h" +#include <86box/io.h> +#include <86box/mem.h> +#include <86box/usb.h> void *usb_priv[32]; diff --git a/src/via_vt82c586b.c b/src/via_vt82c586b.c index 9b7d7c074..a2ff6f4d1 100644 --- a/src/via_vt82c586b.c +++ b/src/via_vt82c586b.c @@ -24,28 +24,28 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "cdrom.h" +#include <86box/86box.h> +#include <86box/cdrom.h> #include "cpu.h" -#include "scsi_device.h" -#include "scsi_cdrom.h" -#include "dma.h" -#include "86box_io.h" -#include "device.h" -#include "apm.h" -#include "keyboard.h" -#include "mem.h" -#include "timer.h" -#include "nvr.h" -#include "pci.h" -#include "pic.h" -#include "port_92.h" -#include "hdc.h" -#include "hdc_ide.h" -#include "hdc_ide_sff8038i.h" -#include "zip.h" -#include "machine.h" -#include "via_vt82c586b.h" +#include <86box/scsi_device.h> +#include <86box/scsi_cdrom.h> +#include <86box/dma.h> +#include <86box/io.h> +#include <86box/device.h> +#include <86box/apm.h> +#include <86box/keyboard.h> +#include <86box/mem.h> +#include <86box/timer.h> +#include <86box/nvr.h> +#include <86box/pci.h> +#include <86box/pic.h> +#include <86box/port_92.h> +#include <86box/hdc.h> +#include <86box/hdc_ide.h> +#include <86box/hdc_ide_sff8038i.h> +#include <86box/zip.h> +#include <86box/machine.h> +#include <86box/via_vt82c586b.h> #define ACPI_TIMER_FREQ 3579545 diff --git a/src/video/vid_ati18800.c b/src/video/vid_ati18800.c index ac39efb64..5203c4de1 100644 --- a/src/video/vid_ati18800.c +++ b/src/video/vid_ati18800.c @@ -21,16 +21,16 @@ #include #include #include -#include "86box.h" -#include "86box_io.h" -#include "mem.h" -#include "rom.h" -#include "device.h" -#include "timer.h" -#include "video.h" -#include "vid_ati_eeprom.h" -#include "vid_svga.h" -#include "vid_svga_render.h" +#include <86box/86box.h> +#include <86box/io.h> +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/device.h> +#include <86box/timer.h> +#include <86box/video.h> +#include <86box/vid_ati_eeprom.h> +#include <86box/vid_svga.h> +#include <86box/vid_svga_render.h> #if defined(DEV_BRANCH) && defined(USE_VGAWONDER) diff --git a/src/video/vid_ati28800.c b/src/video/vid_ati28800.c index 60a622980..5a02dfa82 100644 --- a/src/video/vid_ati28800.c +++ b/src/video/vid_ati28800.c @@ -25,16 +25,16 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "86box_io.h" -#include "mem.h" -#include "rom.h" -#include "device.h" -#include "timer.h" -#include "video.h" -#include "vid_ati_eeprom.h" -#include "vid_svga.h" -#include "vid_svga_render.h" +#include <86box/86box.h> +#include <86box/io.h> +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/device.h> +#include <86box/timer.h> +#include <86box/video.h> +#include <86box/vid_ati_eeprom.h> +#include <86box/vid_svga.h> +#include <86box/vid_svga_render.h> #define VGAWONDERXL 1 diff --git a/src/video/vid_ati68860_ramdac.c b/src/video/vid_ati68860_ramdac.c index cdca9ab52..e8fa1862c 100644 --- a/src/video/vid_ati68860_ramdac.c +++ b/src/video/vid_ati68860_ramdac.c @@ -41,13 +41,13 @@ #include #include #include -#include "86box.h" -#include "device.h" -#include "mem.h" -#include "timer.h" -#include "video.h" -#include "vid_svga.h" -#include "vid_svga_render.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/mem.h> +#include <86box/timer.h> +#include <86box/video.h> +#include <86box/vid_svga.h> +#include <86box/vid_svga_render.h> typedef struct ati68860_ramdac_t diff --git a/src/video/vid_ati_eeprom.c b/src/video/vid_ati_eeprom.c index 2ebb42af6..83f713c89 100644 --- a/src/video/vid_ati_eeprom.c +++ b/src/video/vid_ati_eeprom.c @@ -20,12 +20,12 @@ #include #include #include -#include "86box.h" -#include "device.h" -#include "mem.h" -#include "timer.h" -#include "nvr.h" -#include "vid_ati_eeprom.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/mem.h> +#include <86box/timer.h> +#include <86box/nvr.h> +#include <86box/vid_ati_eeprom.h> enum diff --git a/src/video/vid_ati_mach64.c b/src/video/vid_ati_mach64.c index 8552c0e52..6e4d52e42 100644 --- a/src/video/vid_ati_mach64.c +++ b/src/video/vid_ati_mach64.c @@ -23,18 +23,18 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "device.h" -#include "86box_io.h" -#include "mem.h" -#include "timer.h" -#include "pci.h" -#include "rom.h" -#include "plat.h" -#include "video.h" -#include "vid_svga.h" -#include "vid_svga_render.h" -#include "vid_ati_eeprom.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/io.h> +#include <86box/mem.h> +#include <86box/timer.h> +#include <86box/pci.h> +#include <86box/rom.h> +#include <86box/plat.h> +#include <86box/video.h> +#include <86box/vid_svga.h> +#include <86box/vid_svga_render.h> +#include <86box/vid_ati_eeprom.h> #ifdef CLAMP #undef CLAMP diff --git a/src/video/vid_att20c49x_ramdac.c b/src/video/vid_att20c49x_ramdac.c index 6bfa8a6e3..0709fd0e1 100644 --- a/src/video/vid_att20c49x_ramdac.c +++ b/src/video/vid_att20c49x_ramdac.c @@ -21,12 +21,12 @@ #include #include #include -#include "86box.h" -#include "device.h" -#include "mem.h" -#include "timer.h" -#include "video.h" -#include "vid_svga.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/mem.h> +#include <86box/timer.h> +#include <86box/video.h> +#include <86box/vid_svga.h> typedef struct diff --git a/src/video/vid_av9194.c b/src/video/vid_av9194.c index 8f372eda6..0d89b2086 100644 --- a/src/video/vid_av9194.c +++ b/src/video/vid_av9194.c @@ -21,12 +21,12 @@ #include #include #include -#include "86box.h" -#include "device.h" -#include "mem.h" -#include "timer.h" -#include "video.h" -#include "vid_svga.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/mem.h> +#include <86box/timer.h> +#include <86box/video.h> +#include <86box/vid_svga.h> float diff --git a/src/video/vid_bt48x_ramdac.c b/src/video/vid_bt48x_ramdac.c index f1a396034..310d72a2e 100644 --- a/src/video/vid_bt48x_ramdac.c +++ b/src/video/vid_bt48x_ramdac.c @@ -22,12 +22,12 @@ #include #include #include -#include "86box.h" -#include "device.h" -#include "mem.h" -#include "timer.h" -#include "video.h" -#include "vid_svga.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/mem.h> +#include <86box/timer.h> +#include <86box/video.h> +#include <86box/vid_svga.h> typedef struct diff --git a/src/video/vid_cga.c b/src/video/vid_cga.c index d1e9e22ae..c62e12582 100644 --- a/src/video/vid_cga.c +++ b/src/video/vid_cga.c @@ -22,17 +22,17 @@ #include #include #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "86box_io.h" -#include "timer.h" -#include "pit.h" -#include "mem.h" -#include "rom.h" -#include "device.h" -#include "video.h" -#include "vid_cga.h" -#include "vid_cga_comp.h" +#include <86box/io.h> +#include <86box/timer.h> +#include <86box/pit.h> +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/device.h> +#include <86box/video.h> +#include <86box/vid_cga.h> +#include <86box/vid_cga_comp.h> #define CGA_RGB 0 diff --git a/src/video/vid_cga_comp.c b/src/video/vid_cga_comp.c index 6ae084e4c..a0b5c08a8 100644 --- a/src/video/vid_cga_comp.c +++ b/src/video/vid_cga_comp.c @@ -23,11 +23,11 @@ #include #include #include -#include "86box.h" -#include "timer.h" -#include "mem.h" -#include "vid_cga.h" -#include "vid_cga_comp.h" +#include <86box/86box.h> +#include <86box/timer.h> +#include <86box/mem.h> +#include <86box/vid_cga.h> +#include <86box/vid_cga_comp.h> int CGA_Composite_Table[1024]; diff --git a/src/video/vid_cl54xx.c b/src/video/vid_cl54xx.c index 838e82a42..9df438696 100644 --- a/src/video/vid_cl54xx.c +++ b/src/video/vid_cl54xx.c @@ -23,18 +23,18 @@ #include #include #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "86box_io.h" -#include "mca.h" -#include "mem.h" -#include "pci.h" -#include "rom.h" -#include "device.h" -#include "timer.h" -#include "video.h" -#include "vid_svga.h" -#include "vid_svga_render.h" +#include <86box/io.h> +#include <86box/mca.h> +#include <86box/mem.h> +#include <86box/pci.h> +#include <86box/rom.h> +#include <86box/device.h> +#include <86box/timer.h> +#include <86box/video.h> +#include <86box/vid_svga.h> +#include <86box/vid_svga_render.h> #define BIOS_GD5402_PATH L"roms/video/cirruslogic/avga2.rom" #define BIOS_GD5402_ONBOARD_PATH L"roms/video/machines/cbm_sl386sx25/Commodore386SX-25_AVGA2.bin" diff --git a/src/video/vid_colorplus.c b/src/video/vid_colorplus.c index e281100ed..934fec827 100644 --- a/src/video/vid_colorplus.c +++ b/src/video/vid_colorplus.c @@ -22,18 +22,18 @@ #include #include #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "86box_io.h" -#include "timer.h" -#include "lpt.h" -#include "pit.h" -#include "mem.h" -#include "device.h" -#include "video.h" -#include "vid_cga.h" -#include "vid_colorplus.h" -#include "vid_cga_comp.h" +#include <86box/io.h> +#include <86box/timer.h> +#include <86box/lpt.h> +#include <86box/pit.h> +#include <86box/mem.h> +#include <86box/device.h> +#include <86box/video.h> +#include <86box/vid_cga.h> +#include <86box/vid_colorplus.h> +#include <86box/vid_cga_comp.h> /* Bits in the colorplus control register: */ diff --git a/src/video/vid_compaq_cga.c b/src/video/vid_compaq_cga.c index f4d5b89aa..007bbca09 100644 --- a/src/video/vid_compaq_cga.c +++ b/src/video/vid_compaq_cga.c @@ -24,17 +24,17 @@ #include #include #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "86box_io.h" -#include "timer.h" -#include "pit.h" -#include "mem.h" -#include "rom.h" -#include "device.h" -#include "video.h" -#include "vid_cga.h" -#include "vid_cga_comp.h" +#include <86box/io.h> +#include <86box/timer.h> +#include <86box/pit.h> +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/device.h> +#include <86box/video.h> +#include <86box/vid_cga.h> +#include <86box/vid_cga_comp.h> #define CGA_RGB 0 diff --git a/src/video/vid_ega.c b/src/video/vid_ega.c index 0f793f7bc..b740f11f0 100644 --- a/src/video/vid_ega.c +++ b/src/video/vid_ega.c @@ -22,17 +22,17 @@ #include #include #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "86box_io.h" -#include "timer.h" -#include "pit.h" -#include "mem.h" -#include "rom.h" -#include "device.h" -#include "video.h" -#include "vid_ati_eeprom.h" -#include "vid_ega.h" +#include <86box/io.h> +#include <86box/timer.h> +#include <86box/pit.h> +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/device.h> +#include <86box/video.h> +#include <86box/vid_ati_eeprom.h> +#include <86box/vid_ega.h> void ega_doblit(int y1, int y2, int wx, int wy, ega_t *ega); diff --git a/src/video/vid_ega_render.c b/src/video/vid_ega_render.c index 45a86346f..5e6337a48 100644 --- a/src/video/vid_ega_render.c +++ b/src/video/vid_ega_render.c @@ -20,13 +20,13 @@ #include #include #include -#include "86box.h" -#include "device.h" -#include "timer.h" -#include "mem.h" -#include "rom.h" -#include "video.h" -#include "vid_ega.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/timer.h> +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/video.h> +#include <86box/vid_ega.h> int diff --git a/src/video/vid_et4000.c b/src/video/vid_et4000.c index 4edff27d2..5b2a910b8 100644 --- a/src/video/vid_et4000.c +++ b/src/video/vid_et4000.c @@ -42,16 +42,16 @@ #include #include #include -#include "86box.h" -#include "86box_io.h" -#include "mca.h" -#include "mem.h" -#include "rom.h" -#include "device.h" -#include "timer.h" -#include "video.h" -#include "vid_svga.h" -#include "vid_svga_render.h" +#include <86box/86box.h> +#include <86box/io.h> +#include <86box/mca.h> +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/device.h> +#include <86box/timer.h> +#include <86box/video.h> +#include <86box/vid_svga.h> +#include <86box/vid_svga_render.h> #define BIOS_ROM_PATH L"roms/video/et4000/et4000.bin" diff --git a/src/video/vid_et4000w32.c b/src/video/vid_et4000w32.c index b6e71ae1c..565e800a1 100644 --- a/src/video/vid_et4000w32.c +++ b/src/video/vid_et4000w32.c @@ -25,17 +25,17 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "86box_io.h" -#include "mem.h" -#include "pci.h" -#include "rom.h" -#include "device.h" -#include "timer.h" -#include "plat.h" -#include "video.h" -#include "vid_svga.h" -#include "vid_svga_render.h" +#include <86box/86box.h> +#include <86box/io.h> +#include <86box/mem.h> +#include <86box/pci.h> +#include <86box/rom.h> +#include <86box/device.h> +#include <86box/timer.h> +#include <86box/plat.h> +#include <86box/video.h> +#include <86box/vid_svga.h> +#include <86box/vid_svga_render.h> #define BIOS_ROM_PATH_DIAMOND L"roms/video/et4000w32/et4000w32.bin" diff --git a/src/video/vid_genius.c b/src/video/vid_genius.c index 7d3c0bef7..befc61f71 100644 --- a/src/video/vid_genius.c +++ b/src/video/vid_genius.c @@ -21,16 +21,16 @@ #include #include #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "86box_io.h" -#include "timer.h" -#include "pit.h" -#include "mem.h" -#include "rom.h" -#include "device.h" -#include "plat.h" -#include "video.h" +#include <86box/io.h> +#include <86box/timer.h> +#include <86box/pit.h> +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/device.h> +#include <86box/plat.h> +#include <86box/video.h> #define BIOS_ROM_PATH L"roms/video/genius/8x12.bin" diff --git a/src/video/vid_hercules.c b/src/video/vid_hercules.c index 8f14670ac..5a836109f 100644 --- a/src/video/vid_hercules.c +++ b/src/video/vid_hercules.c @@ -21,16 +21,16 @@ #include #include #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "mem.h" -#include "rom.h" -#include "86box_io.h" -#include "timer.h" -#include "lpt.h" -#include "pit.h" -#include "device.h" -#include "video.h" +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/io.h> +#include <86box/timer.h> +#include <86box/lpt.h> +#include <86box/pit.h> +#include <86box/device.h> +#include <86box/video.h> typedef struct { diff --git a/src/video/vid_herculesplus.c b/src/video/vid_herculesplus.c index b24688f06..14c229d47 100644 --- a/src/video/vid_herculesplus.c +++ b/src/video/vid_herculesplus.c @@ -21,15 +21,15 @@ #include #include #include -#include "86box.h" -#include "86box_io.h" -#include "lpt.h" -#include "timer.h" -#include "pit.h" -#include "mem.h" -#include "rom.h" -#include "device.h" -#include "video.h" +#include <86box/86box.h> +#include <86box/io.h> +#include <86box/lpt.h> +#include <86box/timer.h> +#include <86box/pit.h> +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/device.h> +#include <86box/video.h> /* extended CRTC registers */ diff --git a/src/video/vid_ht216.c b/src/video/vid_ht216.c index ad291294e..2adba65f8 100644 --- a/src/video/vid_ht216.c +++ b/src/video/vid_ht216.c @@ -21,17 +21,17 @@ #include #include #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "86box_io.h" -#include "mem.h" -#include "timer.h" -#include "pic.h" -#include "rom.h" -#include "device.h" -#include "video.h" -#include "vid_svga.h" -#include "vid_svga_render.h" +#include <86box/io.h> +#include <86box/mem.h> +#include <86box/timer.h> +#include <86box/pic.h> +#include <86box/rom.h> +#include <86box/device.h> +#include <86box/video.h> +#include <86box/vid_svga.h> +#include <86box/vid_svga_render.h> typedef struct ht216_t diff --git a/src/video/vid_icd2061.c b/src/video/vid_icd2061.c index 57b791f69..460ee6242 100644 --- a/src/video/vid_icd2061.c +++ b/src/video/vid_icd2061.c @@ -25,8 +25,8 @@ #include #include #include -#include "86box.h" -#include "device.h" +#include <86box/86box.h> +#include <86box/device.h> typedef struct icd2061_t diff --git a/src/video/vid_ics2595.c b/src/video/vid_ics2595.c index 2f5dffdfe..0aaef288f 100644 --- a/src/video/vid_ics2595.c +++ b/src/video/vid_ics2595.c @@ -21,8 +21,8 @@ #include #include #include -#include "86box.h" -#include "device.h" +#include <86box/86box.h> +#include <86box/device.h> typedef struct ics2595_t diff --git a/src/video/vid_im1024.c b/src/video/vid_im1024.c index 7ea42375f..33c3d491d 100644 --- a/src/video/vid_im1024.c +++ b/src/video/vid_im1024.c @@ -54,16 +54,16 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "86box_io.h" -#include "mem.h" -#include "rom.h" -#include "timer.h" -#include "device.h" -#include "pit.h" -#include "plat.h" -#include "video.h" -#include "vid_pgc.h" +#include <86box/86box.h> +#include <86box/io.h> +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/timer.h> +#include <86box/device.h> +#include <86box/pit.h> +#include <86box/plat.h> +#include <86box/video.h> +#include <86box/vid_pgc.h> #define BIOS_ROM_PATH L"roms/video/im1024/im1024font.bin" diff --git a/src/video/vid_incolor.c b/src/video/vid_incolor.c index a438fcfb4..763b62a4e 100644 --- a/src/video/vid_incolor.c +++ b/src/video/vid_incolor.c @@ -21,15 +21,15 @@ #include #include #include -#include "86box.h" -#include "86box_io.h" -#include "timer.h" -#include "lpt.h" -#include "pit.h" -#include "mem.h" -#include "rom.h" -#include "device.h" -#include "video.h" +#include <86box/86box.h> +#include <86box/io.h> +#include <86box/timer.h> +#include <86box/lpt.h> +#include <86box/pit.h> +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/device.h> +#include <86box/video.h> /* extended CRTC registers */ diff --git a/src/video/vid_mda.c b/src/video/vid_mda.c index dbeeaa2c1..002f082e5 100644 --- a/src/video/vid_mda.c +++ b/src/video/vid_mda.c @@ -21,16 +21,16 @@ #include #include #include -#include "86box.h" -#include "86box_io.h" -#include "timer.h" -#include "lpt.h" -#include "pit.h" -#include "mem.h" -#include "rom.h" -#include "device.h" -#include "video.h" -#include "vid_mda.h" +#include <86box/86box.h> +#include <86box/io.h> +#include <86box/timer.h> +#include <86box/lpt.h> +#include <86box/pit.h> +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/device.h> +#include <86box/video.h> +#include <86box/vid_mda.h> static int mdacols[256][2][2]; diff --git a/src/video/vid_mga.c b/src/video/vid_mga.c index e0135d5d5..723546740 100644 --- a/src/video/vid_mga.c +++ b/src/video/vid_mga.c @@ -18,17 +18,17 @@ #include #include #include -#include "86box.h" -#include "86box_io.h" -#include "timer.h" -#include "mem.h" -#include "pci.h" -#include "rom.h" -#include "device.h" -#include "plat.h" -#include "video.h" -#include "vid_svga.h" -#include "vid_svga_render.h" +#include <86box/86box.h> +#include <86box/io.h> +#include <86box/timer.h> +#include <86box/mem.h> +#include <86box/pci.h> +#include <86box/rom.h> +#include <86box/device.h> +#include <86box/plat.h> +#include <86box/video.h> +#include <86box/vid_svga.h> +#include <86box/vid_svga_render.h> #define ROM_MYSTIQUE L"roms/video/matrox/MYSTIQUE.VBI" diff --git a/src/video/vid_oak_oti.c b/src/video/vid_oak_oti.c index 562674b33..39b660089 100644 --- a/src/video/vid_oak_oti.c +++ b/src/video/vid_oak_oti.c @@ -20,14 +20,14 @@ #include #include #include -#include "86box.h" -#include "86box_io.h" -#include "timer.h" -#include "mem.h" -#include "rom.h" -#include "device.h" -#include "video.h" -#include "vid_svga.h" +#include <86box/86box.h> +#include <86box/io.h> +#include <86box/timer.h> +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/device.h> +#include <86box/video.h> +#include <86box/vid_svga.h> #define BIOS_037C_PATH L"roms/video/oti/bios.bin" #define BIOS_067_AMA932J_PATH L"roms/machines/ama932j/oti067.bin" diff --git a/src/video/vid_paradise.c b/src/video/vid_paradise.c index 818ba182c..c578cc044 100644 --- a/src/video/vid_paradise.c +++ b/src/video/vid_paradise.c @@ -23,15 +23,15 @@ #include #include #include -#include "86box.h" -#include "86box_io.h" -#include "timer.h" -#include "mem.h" -#include "rom.h" -#include "device.h" -#include "video.h" -#include "vid_svga.h" -#include "vid_svga_render.h" +#include <86box/86box.h> +#include <86box/io.h> +#include <86box/timer.h> +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/device.h> +#include <86box/video.h> +#include <86box/vid_svga.h> +#include <86box/vid_svga_render.h> typedef struct paradise_t diff --git a/src/video/vid_pgc.c b/src/video/vid_pgc.c index 724c1fd85..8f92bbd0d 100644 --- a/src/video/vid_pgc.c +++ b/src/video/vid_pgc.c @@ -79,17 +79,17 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "86box_io.h" -#include "mem.h" -#include "rom.h" -#include "timer.h" -#include "device.h" -#include "pit.h" -#include "plat.h" -#include "video.h" -#include "vid_cga.h" -#include "vid_pgc.h" +#include <86box/86box.h> +#include <86box/io.h> +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/timer.h> +#include <86box/device.h> +#include <86box/pit.h> +#include <86box/plat.h> +#include <86box/video.h> +#include <86box/vid_cga.h> +#include <86box/vid_pgc.h> #define PGC_CGA_WIDTH 640 @@ -119,7 +119,7 @@ static const char *pgc_err_msgs[] = { /* Initial palettes */ static const uint32_t init_palette[6][256] = { -#include "vid_pgc_palette.h" +#include <86box/vid_pgc_palette.h> }; diff --git a/src/video/vid_s3.c b/src/video/vid_s3.c index 5f568875b..8b209530e 100644 --- a/src/video/vid_s3.c +++ b/src/video/vid_s3.c @@ -21,17 +21,17 @@ #include #include #include -#include "86box.h" -#include "device.h" -#include "86box_io.h" -#include "timer.h" -#include "mem.h" -#include "pci.h" -#include "rom.h" -#include "plat.h" -#include "video.h" -#include "vid_svga.h" -#include "vid_svga_render.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/io.h> +#include <86box/timer.h> +#include <86box/mem.h> +#include <86box/pci.h> +#include <86box/rom.h> +#include <86box/plat.h> +#include <86box/video.h> +#include <86box/vid_svga.h> +#include <86box/vid_svga_render.h> #include "cpu.h" #define ROM_ORCHID_86C911 L"roms/video/s3/BIOS.BIN" diff --git a/src/video/vid_s3_virge.c b/src/video/vid_s3_virge.c index b1534b57f..6043f8c16 100644 --- a/src/video/vid_s3_virge.c +++ b/src/video/vid_s3_virge.c @@ -23,17 +23,17 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "86box_io.h" -#include "timer.h" -#include "mem.h" -#include "pci.h" -#include "rom.h" -#include "device.h" -#include "plat.h" -#include "video.h" -#include "vid_svga.h" -#include "vid_svga_render.h" +#include <86box/86box.h> +#include <86box/io.h> +#include <86box/timer.h> +#include <86box/mem.h> +#include <86box/pci.h> +#include <86box/rom.h> +#include <86box/device.h> +#include <86box/plat.h> +#include <86box/video.h> +#include <86box/vid_svga.h> +#include <86box/vid_svga_render.h> static uint64_t virge_time = 0; diff --git a/src/video/vid_sc1502x_ramdac.c b/src/video/vid_sc1502x_ramdac.c index 1908d624e..ea4725c9c 100644 --- a/src/video/vid_sc1502x_ramdac.c +++ b/src/video/vid_sc1502x_ramdac.c @@ -23,12 +23,12 @@ #include #include #include -#include "../86box.h" -#include "../device.h" -#include "../mem.h" -#include "../timer.h" -#include "video.h" -#include "vid_svga.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/mem.h> +#include <86box/timer.h> +#include <86box/video.h> +#include <86box/vid_svga.h> typedef struct diff --git a/src/video/vid_sdac_ramdac.c b/src/video/vid_sdac_ramdac.c index 767e16d78..37bfa7104 100644 --- a/src/video/vid_sdac_ramdac.c +++ b/src/video/vid_sdac_ramdac.c @@ -21,12 +21,12 @@ #include #include #include -#include "86box.h" -#include "device.h" -#include "mem.h" -#include "timer.h" -#include "video.h" -#include "vid_svga.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/mem.h> +#include <86box/timer.h> +#include <86box/video.h> +#include <86box/vid_svga.h> typedef struct sdac_ramdac_t diff --git a/src/video/vid_sigma.c b/src/video/vid_sigma.c index 81c6c7e11..6bd475c4b 100644 --- a/src/video/vid_sigma.c +++ b/src/video/vid_sigma.c @@ -19,16 +19,16 @@ #include #include #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "86box_io.h" -#include "timer.h" -#include "pit.h" -#include "mem.h" -#include "nmi.h" -#include "rom.h" -#include "device.h" -#include "video.h" +#include <86box/io.h> +#include <86box/timer.h> +#include <86box/pit.h> +#include <86box/mem.h> +#include <86box/nmi.h> +#include <86box/rom.h> +#include <86box/device.h> +#include <86box/video.h> #define ROM_SIGMA_FONT L"roms/video/sigma/sigma400_font.rom" diff --git a/src/video/vid_stg_ramdac.c b/src/video/vid_stg_ramdac.c index d03485346..b61ee886c 100644 --- a/src/video/vid_stg_ramdac.c +++ b/src/video/vid_stg_ramdac.c @@ -21,12 +21,12 @@ #include #include #include -#include "../86box.h" -#include "../device.h" -#include "../mem.h" -#include "../timer.h" -#include "video.h" -#include "vid_svga.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/mem.h> +#include <86box/timer.h> +#include <86box/video.h> +#include <86box/vid_svga.h> typedef struct stg_ramdac_t diff --git a/src/video/vid_svga.c b/src/video/vid_svga.c index a16c65bf2..5452827f5 100644 --- a/src/video/vid_svga.c +++ b/src/video/vid_svga.c @@ -25,17 +25,17 @@ #include #include #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "machine.h" -#include "timer.h" -#include "86box_io.h" -#include "pit.h" -#include "mem.h" -#include "rom.h" -#include "video.h" -#include "vid_svga.h" -#include "vid_svga_render.h" +#include <86box/machine.h> +#include <86box/timer.h> +#include <86box/io.h> +#include <86box/pit.h> +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/video.h> +#include <86box/vid_svga.h> +#include <86box/vid_svga_render.h> void svga_doblit(int y1, int y2, int wx, int wy, svga_t *svga); diff --git a/src/video/vid_svga_render.c b/src/video/vid_svga_render.c index 812d25d74..c470d5d43 100644 --- a/src/video/vid_svga_render.c +++ b/src/video/vid_svga_render.c @@ -20,12 +20,12 @@ #include #include #include -#include "86box.h" -#include "mem.h" -#include "timer.h" -#include "video.h" -#include "vid_svga.h" -#include "vid_svga_render.h" +#include <86box/86box.h> +#include <86box/mem.h> +#include <86box/timer.h> +#include <86box/video.h> +#include <86box/vid_svga.h> +#include <86box/vid_svga_render.h> void diff --git a/src/video/vid_table.c b/src/video/vid_table.c index becbef0db..ddadb4c2c 100644 --- a/src/video/vid_table.c +++ b/src/video/vid_table.c @@ -23,19 +23,19 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "timer.h" -#include "machine.h" -#include "mem.h" -#include "device.h" -#include "plat.h" -#include "video.h" -#include "vid_svga.h" +#include <86box/86box.h> +#include <86box/timer.h> +#include <86box/machine.h> +#include <86box/mem.h> +#include <86box/device.h> +#include <86box/plat.h> +#include <86box/video.h> +#include <86box/vid_svga.h> -#include "vid_cga.h" -#include "vid_ega.h" -#include "vid_colorplus.h" -#include "vid_mda.h" +#include <86box/vid_cga.h> +#include <86box/vid_ega.h> +#include <86box/vid_colorplus.h> +#include <86box/vid_mda.h> typedef struct { diff --git a/src/video/vid_tgui9440.c b/src/video/vid_tgui9440.c index e8fd94333..10fd099ca 100644 --- a/src/video/vid_tgui9440.c +++ b/src/video/vid_tgui9440.c @@ -60,18 +60,18 @@ #include #include #include -#include "86box.h" -#include "86box_io.h" -#include "timer.h" -#include "mem.h" -#include "pci.h" -#include "rom.h" -#include "device.h" +#include <86box/86box.h> +#include <86box/io.h> +#include <86box/timer.h> +#include <86box/mem.h> +#include <86box/pci.h> +#include <86box/rom.h> +#include <86box/device.h> #include "cpu.h" -#include "plat.h" -#include "video.h" -#include "vid_svga.h" -#include "vid_svga_render.h" +#include <86box/plat.h> +#include <86box/video.h> +#include <86box/vid_svga.h> +#include <86box/vid_svga_render.h> /*TGUI9400CXi has extended write modes, controlled by extended GDC registers : diff --git a/src/video/vid_ti_cf62011.c b/src/video/vid_ti_cf62011.c index 4b46e42ea..7b982adbf 100644 --- a/src/video/vid_ti_cf62011.c +++ b/src/video/vid_ti_cf62011.c @@ -57,14 +57,14 @@ #include #include #include -#include "86box.h" -#include "86box_io.h" -#include "timer.h" -#include "mem.h" -#include "rom.h" -#include "device.h" -#include "video.h" -#include "vid_svga.h" +#include <86box/86box.h> +#include <86box/io.h> +#include <86box/timer.h> +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/device.h> +#include <86box/video.h> +#include <86box/vid_svga.h> typedef struct { diff --git a/src/video/vid_tkd8001_ramdac.c b/src/video/vid_tkd8001_ramdac.c index 2dc09606a..c02403512 100644 --- a/src/video/vid_tkd8001_ramdac.c +++ b/src/video/vid_tkd8001_ramdac.c @@ -21,12 +21,12 @@ #include #include #include -#include "86box.h" -#include "device.h" -#include "timer.h" -#include "mem.h" -#include "video.h" -#include "vid_svga.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/timer.h> +#include <86box/mem.h> +#include <86box/video.h> +#include <86box/vid_svga.h> typedef struct tkd8001_ramdac_t diff --git a/src/video/vid_tvga.c b/src/video/vid_tvga.c index 9548cb37d..b5f456772 100644 --- a/src/video/vid_tvga.c +++ b/src/video/vid_tvga.c @@ -21,15 +21,15 @@ #include #include #include -#include "86box.h" -#include "86box_io.h" -#include "timer.h" -#include "mem.h" -#include "rom.h" -#include "device.h" -#include "video.h" -#include "vid_svga.h" -#include "vid_svga_render.h" +#include <86box/86box.h> +#include <86box/io.h> +#include <86box/timer.h> +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/device.h> +#include <86box/video.h> +#include <86box/vid_svga.h> +#include <86box/vid_svga_render.h> #define TVGA8900B_ID 0x03 #define TVGA8900CLD_ID 0x33 diff --git a/src/video/vid_vga.c b/src/video/vid_vga.c index 340d6572a..f66b004d6 100644 --- a/src/video/vid_vga.c +++ b/src/video/vid_vga.c @@ -21,14 +21,14 @@ #include #include #include -#include "86box.h" -#include "86box_io.h" -#include "mem.h" -#include "rom.h" -#include "device.h" -#include "timer.h" -#include "video.h" -#include "vid_svga.h" +#include <86box/86box.h> +#include <86box/io.h> +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/device.h> +#include <86box/timer.h> +#include <86box/video.h> +#include <86box/vid_svga.h> typedef struct vga_t diff --git a/src/video/vid_voodoo.c b/src/video/vid_voodoo.c index 37afe78db..88a7e556c 100644 --- a/src/video/vid_voodoo.c +++ b/src/video/vid_voodoo.c @@ -22,19 +22,19 @@ #include #include #include -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "machine.h" -#include "device.h" -#include "mem.h" -#include "pci.h" -#include "rom.h" -#include "timer.h" -#include "device.h" -#include "plat.h" -#include "video.h" -#include "vid_svga.h" -#include "vid_voodoo_dither.h" +#include <86box/machine.h> +#include <86box/device.h> +#include <86box/mem.h> +#include <86box/pci.h> +#include <86box/rom.h> +#include <86box/timer.h> +#include <86box/device.h> +#include <86box/plat.h> +#include <86box/video.h> +#include <86box/vid_svga.h> +#include <86box/vid_voodoo_dither.h> #ifdef CLAMP #undef CLAMP @@ -2658,9 +2658,9 @@ static inline void voodoo_tmu_fetch_and_blend(voodoo_t *voodoo, voodoo_params_t } #if ((defined i386 || defined __i386 || defined __i386__ || defined _X86_ || defined _M_IX86) && !(defined __amd64__ || defined _M_X64) && (defined USE_DYNAREC)) -#include "vid_voodoo_codegen_x86.h" +#include <86box/vid_voodoo_codegen_x86.h> #elif ((defined __amd64__ || defined _M_X64) && (defined USE_DYNAREC)) -#include "vid_voodoo_codegen_x86-64.h" +#include <86box/vid_voodoo_codegen_x86-64.h> #else #define NO_CODEGEN static int voodoo_recomp = 0; diff --git a/src/video/vid_wy700.c b/src/video/vid_wy700.c index db26ee07c..b8543a6ab 100644 --- a/src/video/vid_wy700.c +++ b/src/video/vid_wy700.c @@ -21,13 +21,13 @@ #include #include #include -#include "86box.h" -#include "86box_io.h" -#include "timer.h" -#include "pit.h" -#include "mem.h" -#include "device.h" -#include "video.h" +#include <86box/86box.h> +#include <86box/io.h> +#include <86box/timer.h> +#include <86box/pit.h> +#include <86box/mem.h> +#include <86box/device.h> +#include <86box/video.h> #define WY700_XSIZE 1280 diff --git a/src/video/video.c b/src/video/video.c index 788f165ce..45fd4d675 100644 --- a/src/video/video.c +++ b/src/video/video.c @@ -58,16 +58,16 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "86box_io.h" -#include "mem.h" -#include "rom.h" -#include "config.h" -#include "timer.h" -#include "plat.h" -#include "video.h" -#include "vid_svga.h" +#include <86box/io.h> +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/config.h> +#include <86box/timer.h> +#include <86box/plat.h> +#include <86box/video.h> +#include <86box/vid_svga.h> volatile int screenshots = 0; diff --git a/src/vnc.c b/src/vnc.c index 86534a11f..55f3227d3 100644 --- a/src/vnc.c +++ b/src/vnc.c @@ -23,14 +23,14 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "device.h" -#include "video.h" -#include "keyboard.h" -#include "mouse.h" -#include "plat.h" -#include "ui.h" -#include "vnc.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/video.h> +#include <86box/keyboard.h> +#include <86box/mouse.h> +#include <86box/plat.h> +#include <86box/ui.h> +#include <86box/vnc.h> #define VNC_MIN_X 320 diff --git a/src/vnc_keymap.c b/src/vnc_keymap.c index 86a323cc2..999466c9b 100644 --- a/src/vnc_keymap.c +++ b/src/vnc_keymap.c @@ -36,10 +36,10 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "keyboard.h" -#include "plat.h" -#include "vnc.h" +#include <86box/86box.h> +#include <86box/keyboard.h> +#include <86box/plat.h> +#include <86box/vnc.h> static int keysyms_00[] = { diff --git a/src/win/86Box.rc b/src/win/86Box.rc index 6f180a212..523ae0466 100644 --- a/src/win/86Box.rc +++ b/src/win/86Box.rc @@ -19,14 +19,14 @@ */ #include #define IN_RESOURCE_H -#include "resource.h" -#include "../86box.h" -#include "../plat.h" +#include <86box/resource.h> +#include <86box/86box.h> +#include <86box/plat.h> #undef IN_RESOURCE_H #define APSTUDIO_READONLY_SYMBOLS #define APSTUDIO_HIDDEN_SYMBOLS -#include "windows.h" +#include #undef APSTUDIO_HIDDEN_SYMBOLS #undef APSTUDIO_READONLY_SYMBOLS diff --git a/src/win/Makefile.mingw b/src/win/Makefile.mingw index 4f97c13f6..d67b33764 100644 --- a/src/win/Makefile.mingw +++ b/src/win/Makefile.mingw @@ -300,17 +300,8 @@ DEPFILE := win/.depends # Set up the correct toolchain flags. OPTS := $(EXTRAS) $(STUFF) -ifeq ($(WX), y) -OPTS += -I. \ - -Icpu -Icpu_common \ - -Icdrom -Ichipset -Idisk -Ifloppy -Igame -Imachine -Inetwork \ - -Iprinter -Isound -Iscsi -Ivideo -Ilang -else -OPTS += -iquote . \ - -iquote cpu -iquote cpu_common \ - -iquote cdrom -iquote chipset -iquote disk -iquote floppy -iquote game -iquote machine -iquote network \ - -iquote printer -iquote sound -iquote scsi -iquote video -iquote lang -endif +OPTS += -Iinclude \ + -iquote cpu -iquote cpu_common ifdef EXFLAGS OPTS += $(EXFLAGS) endif @@ -360,7 +351,7 @@ ifeq ($(ARM64), y) AOPTIM := AFLAGS := -mfloat-abi=hard endif -RFLAGS := --input-format=rc -O coff +RFLAGS := --input-format=rc -O coff -Iinclude ifeq ($(RELEASE), y) OPTS += -DRELEASE_BUILD RFLAGS += -DRELEASE_BUILD diff --git a/src/win/Makefile_ndr.mingw b/src/win/Makefile_ndr.mingw index 2ab5f6216..efab536cb 100644 --- a/src/win/Makefile_ndr.mingw +++ b/src/win/Makefile_ndr.mingw @@ -300,17 +300,8 @@ DEPFILE := win/.depends # Set up the correct toolchain flags. OPTS := $(EXTRAS) $(STUFF) -ifeq ($(WX), y) -OPTS += -I. \ - -Icpu_new -Icpu_common \ - -Icdrom -Ichipset -Idisk -Ifloppy -Igame -Imachine -Inetwork \ - -Iprinter -Isound -Iscsi -Ivideo -Ilang -else -OPTS += -iquote . \ - -iquote cpu_new -iquote cpu_common \ - -iquote cdrom -iquote chipset -iquote disk -iquote floppy -iquote game -iquote machine -iquote network \ - -iquote printer -iquote sound -iquote scsi -iquote video -iquote lang -endif +OPTS += -Iinclude \ + -iquote cpu_new -iquote cpu_common ifdef EXFLAGS OPTS += $(EXFLAGS) endif @@ -360,7 +351,7 @@ ifeq ($(ARM64), y) AOPTIM := AFLAGS := -mfloat-abi=hard endif -RFLAGS := --input-format=rc -O coff +RFLAGS := --input-format=rc -O coff -Iinclude OPTS += -DUSE_NEW_DYNAREC ifeq ($(RELEASE), y) OPTS += -DRELEASE_BUILD diff --git a/src/win/win.c b/src/win/win.c index c570101f2..355f2f3f0 100644 --- a/src/win/win.c +++ b/src/win/win.c @@ -32,22 +32,22 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "config.h" -#include "device.h" -#include "keyboard.h" -#include "mouse.h" -#include "video.h" +#include <86box/86box.h> +#include <86box/config.h> +#include <86box/device.h> +#include <86box/keyboard.h> +#include <86box/mouse.h> +#include <86box/video.h> #define GLOBAL -#include "plat.h" -#include "plat_midi.h" -#include "ui.h" +#include <86box/plat.h> +#include <86box/plat_midi.h> +#include <86box/ui.h> #ifdef USE_VNC -# include "vnc.h" +# include <86box/vnc.h> #endif -# include "win_d2d.h" -# include "win_sdl.h" -#include "win.h" +# include <86box/win_d2d.h> +# include <86box/win_sdl.h> +#include <86box/win.h> typedef struct { diff --git a/src/win/win_about.c b/src/win/win_about.c index 68c215394..b0001b177 100644 --- a/src/win/win_about.c +++ b/src/win/win_about.c @@ -26,9 +26,9 @@ #include #include #include -#include "86box.h" -#include "plat.h" -#include "win.h" +#include <86box/86box.h> +#include <86box/plat.h> +#include <86box/win.h> #if defined(__amd64__) || defined(__aarch64__) diff --git a/src/win/win_cdrom.c b/src/win/win_cdrom.c index 8802615c6..d23a56706 100644 --- a/src/win/win_cdrom.c +++ b/src/win/win_cdrom.c @@ -27,15 +27,15 @@ #include #include #include -#include "config.h" -#include "hdd.h" -#include "scsi_device.h" -#include "cdrom.h" -#include "zip.h" -#include "scsi_disk.h" -#include "plat.h" -#include "ui.h" -#include "win.h" +#include <86box/config.h> +#include <86box/hdd.h> +#include <86box/scsi_device.h> +#include <86box/cdrom.h> +#include <86box/zip.h> +#include <86box/scsi_disk.h> +#include <86box/plat.h> +#include <86box/ui.h> +#include <86box/win.h> void diff --git a/src/win/win_crashdump.c b/src/win/win_crashdump.c index d7b4cd38b..6ca80963d 100644 --- a/src/win/win_crashdump.c +++ b/src/win/win_crashdump.c @@ -25,9 +25,9 @@ #include #include #include -#include "86box.h" -#include "plat.h" -#include "win.h" +#include <86box/86box.h> +#include <86box/plat.h> +#include <86box/win.h> #define ExceptionHandlerBufferSize (10240) diff --git a/src/win/win_d2d.c b/src/win/win_d2d.c index bda8d0eb2..1e8f4b3ac 100644 --- a/src/win/win_d2d.c +++ b/src/win/win_d2d.c @@ -27,14 +27,14 @@ #undef BITMAP #define HAVE_STDARG_H -#include "86box.h" -#include "device.h" -#include "video.h" -#include "plat.h" -#include "plat_dynld.h" -#include "ui.h" -#include "win.h" -#include "win_d2d.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/video.h> +#include <86box/plat.h> +#include <86box/plat_dynld.h> +#include <86box/ui.h> +#include <86box/win.h> +#include <86box/win_d2d.h> static HWND d2d_hwnd, old_hwndMain; diff --git a/src/win/win_devconf.c b/src/win/win_devconf.c index 0146be57d..d07482f46 100644 --- a/src/win/win_devconf.c +++ b/src/win/win_devconf.c @@ -21,13 +21,13 @@ #include #include #include -#include "86box.h" -#include "config.h" -#include "device.h" -#include "plat.h" -#include "plat_midi.h" -#include "ui.h" -#include "win.h" +#include <86box/86box.h> +#include <86box/config.h> +#include <86box/device.h> +#include <86box/plat.h> +#include <86box/plat_midi.h> +#include <86box/ui.h> +#include <86box/win.h> #include diff --git a/src/win/win_dialog.c b/src/win/win_dialog.c index f5bfd3c56..7844e1c8c 100644 --- a/src/win/win_dialog.c +++ b/src/win/win_dialog.c @@ -27,11 +27,11 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "device.h" -#include "plat.h" -#include "ui.h" -#include "win.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/plat.h> +#include <86box/ui.h> +#include <86box/win.h> WCHAR wopenfilestring[512]; diff --git a/src/win/win_discord.c b/src/win/win_discord.c index 087fad7b5..d374fbce8 100644 --- a/src/win/win_discord.c +++ b/src/win/win_discord.c @@ -22,13 +22,13 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" +#include <86box/86box.h> #include "cpu.h" -#include "machine.h" -#include "plat.h" -#include "plat_dynld.h" -#include "win_discord.h" -#include "discord_game_sdk.h" +#include <86box/machine.h> +#include <86box/plat.h> +#include <86box/plat_dynld.h> +#include <86box/win_discord.h> +#include #define PATH_DISCORD_DLL "discord_game_sdk.dll" diff --git a/src/win/win_dynld.c b/src/win/win_dynld.c index 4ae3b8b70..41942ba61 100644 --- a/src/win/win_dynld.c +++ b/src/win/win_dynld.c @@ -22,8 +22,8 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "plat_dynld.h" +#include <86box/86box.h> +#include <86box/plat_dynld.h> #ifdef ENABLE_DYNLD_LOG diff --git a/src/win/win_joystick.cpp b/src/win/win_joystick.cpp index 970c04b5d..b13a8893f 100644 --- a/src/win/win_joystick.cpp +++ b/src/win/win_joystick.cpp @@ -23,11 +23,11 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "device.h" -#include "plat.h" -#include "gameport.h" -#include "win.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/plat.h> +#include <86box/gameport.h> +#include <86box/win.h> plat_joystick_t plat_joystick_state[MAX_PLAT_JOYSTICKS]; diff --git a/src/win/win_joystick_rawinput.c b/src/win/win_joystick_rawinput.c index 2eb724ae0..2ce664bbb 100644 --- a/src/win/win_joystick_rawinput.c +++ b/src/win/win_joystick_rawinput.c @@ -26,11 +26,11 @@ #include #include #define HAVE_STDARG_H -#include "../86box.h" -#include "../device.h" -#include "../plat.h" -#include "../game/gameport.h" -#include "win.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/plat.h> +#include <86box/gameport.h> +#include <86box/win.h> #ifdef ENABLE_JOYSTICK_LOG int joystick_do_log = ENABLE_JOYSTICK_LOG; diff --git a/src/win/win_joystick_xinput.c b/src/win/win_joystick_xinput.c index 76526d350..3b62d449d 100644 --- a/src/win/win_joystick_xinput.c +++ b/src/win/win_joystick_xinput.c @@ -24,11 +24,11 @@ #include #include #define HAVE_STDARG_H -#include "86box.h" -#include "device.h" -#include "plat.h" -#include "gameport.h" -#include "win.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/plat.h> +#include <86box/gameport.h> +#include <86box/win.h> #define XINPUT_MAX_JOYSTICKS 4 #define XINPUT_NAME "Xinput compatiable controller" diff --git a/src/win/win_jsconf.c b/src/win/win_jsconf.c index b048afa27..f4269871b 100644 --- a/src/win/win_jsconf.c +++ b/src/win/win_jsconf.c @@ -7,12 +7,12 @@ #include #include #include -#include "86box.h" -#include "config.h" -#include "device.h" -#include "gameport.h" -#include "plat.h" -#include "win.h" +#include <86box/86box.h> +#include <86box/config.h> +#include <86box/device.h> +#include <86box/gameport.h> +#include <86box/plat.h> +#include <86box/win.h> static int joystick_nr; diff --git a/src/win/win_keyboard.c b/src/win/win_keyboard.c index d4769d9e5..8d286e297 100644 --- a/src/win/win_keyboard.c +++ b/src/win/win_keyboard.c @@ -24,11 +24,11 @@ #include #include #include -#include "86box.h" -#include "device.h" -#include "keyboard.h" -#include "plat.h" -#include "win.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/keyboard.h> +#include <86box/plat.h> +#include <86box/win.h> static uint16_t scancode_map[768]; diff --git a/src/win/win_midi.c b/src/win/win_midi.c index c38f444fd..86ff9d285 100644 --- a/src/win/win_midi.c +++ b/src/win/win_midi.c @@ -4,11 +4,11 @@ #include #include #include -#include "86box.h" -#include "config.h" -#include "midi.h" -#include "plat.h" -#include "plat_midi.h" +#include <86box/86box.h> +#include <86box/config.h> +#include <86box/midi.h> +#include <86box/plat.h> +#include <86box/plat_midi.h> typedef struct diff --git a/src/win/win_mouse.c b/src/win/win_mouse.c index 080ef0be0..f3fb44851 100644 --- a/src/win/win_mouse.c +++ b/src/win/win_mouse.c @@ -22,10 +22,10 @@ #include #include #include -#include "86box.h" -#include "mouse.h" -#include "plat.h" -#include "win.h" +#include <86box/86box.h> +#include <86box/mouse.h> +#include <86box/plat.h> +#include <86box/win.h> int mouse_capture; diff --git a/src/win/win_new_floppy.c b/src/win/win_new_floppy.c index e15a3e342..05fd207cc 100644 --- a/src/win/win_new_floppy.c +++ b/src/win/win_new_floppy.c @@ -25,13 +25,13 @@ #include #include #include -#include "86box.h" -#include "plat.h" -#include "random.h" -#include "ui.h" -#include "scsi_device.h" -#include "zip.h" -#include "win.h" +#include <86box/86box.h> +#include <86box/plat.h> +#include <86box/random.h> +#include <86box/ui.h> +#include <86box/scsi_device.h> +#include <86box/zip.h> +#include <86box/win.h> typedef struct { diff --git a/src/win/win_opendir.c b/src/win/win_opendir.c index f518ea686..1740140cc 100644 --- a/src/win/win_opendir.c +++ b/src/win/win_opendir.c @@ -25,9 +25,9 @@ #include #include #include -#include "86box.h" -#include "plat.h" -#include "plat_dir.h" +#include <86box/86box.h> +#include <86box/plat.h> +#include <86box/plat_dir.h> #ifdef UNICODE diff --git a/src/win/win_sdl.c b/src/win/win_sdl.c index a4c71c033..d80cbe222 100644 --- a/src/win/win_sdl.c +++ b/src/win/win_sdl.c @@ -15,10 +15,10 @@ * * * Authors: Fred N. van Kempen, - * Michael Drüing, + * Michael Dr�ing, * * Copyright 2018-2020 Fred N. van Kempen. - * Copyright 2018-2020 Michael Drüing. + * Copyright 2018-2020 Michael Dr�ing. * * Redistribution and use in source and binary forms, with * or without modification, are permitted provided that the @@ -62,14 +62,14 @@ /* This #undef is needed because a SDL include header redefines HAVE_STDARG_H. */ #undef HAVE_STDARG_H #define HAVE_STDARG_H -#include "86box.h" -#include "device.h" -#include "plat.h" -#include "plat_dynld.h" -#include "video.h" -#include "ui.h" -#include "win.h" -#include "win_sdl.h" +#include <86box/86box.h> +#include <86box/device.h> +#include <86box/plat.h> +#include <86box/plat_dynld.h> +#include <86box/video.h> +#include <86box/ui.h> +#include <86box/win.h> +#include <86box/win_sdl.h> #define RENDERER_FULL_SCREEN 1 diff --git a/src/win/win_settings.c b/src/win/win_settings.c index 39a330eb8..63512f6cf 100644 --- a/src/win/win_settings.c +++ b/src/win/win_settings.c @@ -30,37 +30,37 @@ #include #include #include -#include "86box.h" -#include "config.h" +#include <86box/86box.h> +#include <86box/config.h> #include "cpu.h" -#include "mem.h" -#include "rom.h" -#include "device.h" -#include "timer.h" -#include "nvr.h" -#include "machine.h" -#include "gameport.h" -#include "isamem.h" -#include "isartc.h" -#include "lpt.h" -#include "mouse.h" -#include "scsi.h" -#include "scsi_device.h" -#include "cdrom.h" -#include "hdd.h" -#include "hdc.h" -#include "hdc_ide.h" -#include "zip.h" -#include "fdd.h" -#include "network.h" -#include "sound.h" -#include "midi.h" -#include "snd_mpu401.h" -#include "video.h" -#include "plat.h" -#include "plat_midi.h" -#include "ui.h" -#include "win.h" +#include <86box/mem.h> +#include <86box/rom.h> +#include <86box/device.h> +#include <86box/timer.h> +#include <86box/nvr.h> +#include <86box/machine.h> +#include <86box/gameport.h> +#include <86box/isamem.h> +#include <86box/isartc.h> +#include <86box/lpt.h> +#include <86box/mouse.h> +#include <86box/scsi.h> +#include <86box/scsi_device.h> +#include <86box/cdrom.h> +#include <86box/hdd.h> +#include <86box/hdc.h> +#include <86box/hdc_ide.h> +#include <86box/zip.h> +#include <86box/fdd.h> +#include <86box/network.h> +#include <86box/sound.h> +#include <86box/midi.h> +#include <86box/snd_mpu401.h> +#include <86box/video.h> +#include <86box/plat.h> +#include <86box/plat_midi.h> +#include <86box/ui.h> +#include <86box/win.h> /* Icon, Bus, File, C, H, S, Size */ diff --git a/src/win/win_snd_gain.c b/src/win/win_snd_gain.c index 983c593e8..85cc9e3b8 100644 --- a/src/win/win_snd_gain.c +++ b/src/win/win_snd_gain.c @@ -25,11 +25,11 @@ #include #include #include -#include "86box.h" -#include "config.h" -#include "plat.h" -#include "sound.h" -#include "win.h" +#include <86box/86box.h> +#include <86box/config.h> +#include <86box/plat.h> +#include <86box/sound.h> +#include <86box/win.h> static uint8_t old_gain; diff --git a/src/win/win_stbar.c b/src/win/win_stbar.c index ce3f3ae17..1327c142a 100644 --- a/src/win/win_stbar.c +++ b/src/win/win_stbar.c @@ -28,28 +28,28 @@ #include #include #include -#include "86box.h" -#include "config.h" +#include <86box/86box.h> +#include <86box/config.h> #include "cpu.h" -#include "device.h" -#include "machine.h" -#include "timer.h" -#include "hdd.h" -#include "hdc.h" -#include "fdd.h" -#include "fdd_86f.h" -#include "scsi.h" -#include "scsi_device.h" -#include "cdrom.h" -#include "zip.h" -#include "cdrom_image.h" -#include "scsi_disk.h" -#include "network.h" -#include "video.h" -#include "sound.h" -#include "plat.h" -#include "ui.h" -#include "win.h" +#include <86box/device.h> +#include <86box/machine.h> +#include <86box/timer.h> +#include <86box/hdd.h> +#include <86box/hdc.h> +#include <86box/fdd.h> +#include <86box/fdd_86f.h> +#include <86box/scsi.h> +#include <86box/scsi_device.h> +#include <86box/cdrom.h> +#include <86box/zip.h> +#include <86box/cdrom_image.h> +#include <86box/scsi_disk.h> +#include <86box/network.h> +#include <86box/video.h> +#include <86box/sound.h> +#include <86box/plat.h> +#include <86box/ui.h> +#include <86box/win.h> #ifndef GWL_WNDPROC #define GWL_WNDPROC GWLP_WNDPROC diff --git a/src/win/win_thread.c b/src/win/win_thread.c index eb10b54f4..494a543c9 100644 --- a/src/win/win_thread.c +++ b/src/win/win_thread.c @@ -27,8 +27,8 @@ #include #include #include -#include "86box.h" -#include "plat.h" +#include <86box/86box.h> +#include <86box/plat.h> typedef struct { diff --git a/src/win/win_ui.c b/src/win/win_ui.c index 244eb134d..9901d9ad7 100644 --- a/src/win/win_ui.c +++ b/src/win/win_ui.c @@ -28,19 +28,19 @@ #include #include #include -#include "86box.h" -#include "config.h" -#include "device.h" -#include "keyboard.h" -#include "mouse.h" -#include "video.h" -#include "vid_ega.h" // for update_overscan -#include "plat.h" -#include "plat_midi.h" -#include "ui.h" -#include "win.h" +#include <86box/86box.h> +#include <86box/config.h> +#include <86box/device.h> +#include <86box/keyboard.h> +#include <86box/mouse.h> +#include <86box/video.h> +#include <86box/vid_ega.h> // for update_overscan +#include <86box/plat.h> +#include <86box/plat_midi.h> +#include <86box/ui.h> +#include <86box/win.h> #ifdef USE_DISCORD -# include "win_discord.h" +# include <86box/win_discord.h> #endif