From 7fc893bdb000bdc092e4d42b1906c617b576d1a7 Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Fri, 18 Feb 2022 19:42:21 -0500 Subject: [PATCH] Include guards on our headers --- src/include/86box/bswap.h | 5 +- src/include/86box/cassette.h | 4 +- src/include/86box/cdrom.h | 2 +- src/include/86box/cdrom_image.h | 5 +- src/include/86box/cdrom_image_backend.h | 5 +- src/include/86box/filters.h | 5 + src/include/86box/flash.h | 7 +- src/include/86box/hdc_ide_sff8038i.h | 5 + src/include/86box/i82335.h | 5 + src/include/86box/ibm_5161.h | 5 + src/include/86box/isamem.h | 7 +- src/include/86box/isapnp.h | 1 + src/include/86box/isartc.h | 7 +- .../86box/joystick_ch_flightstick_pro.h | 5 + src/include/86box/joystick_standard.h | 5 + src/include/86box/joystick_sw_pad.h | 5 + src/include/86box/joystick_tm_fcs.h | 5 + src/include/86box/keyboard.h | 1 + src/include/86box/language.h | 1 + src/include/86box/log.h | 1 + src/include/86box/m_amstrad.h | 6 + src/include/86box/m_at_t3100e.h | 1 + src/include/86box/m_xt_t1000.h | 1 + src/include/86box/m_xt_xi8088.h | 5 + src/include/86box/machine.h | 1 + src/include/86box/mca.h | 7 +- src/include/86box/mem.h | 1 + src/include/86box/midi_rtmidi.h | 7 +- src/include/86box/mo.h | 4 +- src/include/86box/mouse.h | 2 +- src/include/86box/net_3c503.h | 1 - src/include/86box/net_dp8390.h | 1 + src/include/86box/net_ne2000.h | 1 + src/include/86box/net_pcnet.h | 1 + src/include/86box/net_plip.h | 1 + src/include/86box/net_wd8003.h | 1 + src/include/86box/network.h | 1 + src/include/86box/nmi.h | 6 + src/include/86box/nvr.h | 261 +++++++++--------- src/include/86box/nvr_ps2.h | 1 + src/include/86box/pci.h | 2 +- src/include/86box/pci_dummy.h | 5 + src/include/86box/pic.h | 2 +- src/include/86box/pit.h | 1 + src/include/86box/plat.h | 1 + src/include/86box/plat_dir.h | 2 +- src/include/86box/plat_dynld.h | 2 +- src/include/86box/png_struct.h | 1 + src/include/86box/port_6x.h | 2 +- src/include/86box/port_92.h | 1 + src/include/86box/postcard.h | 2 +- src/include/86box/printer.h | 2 +- src/include/86box/prt_devs.h | 7 +- src/include/86box/random.h | 3 +- src/include/86box/resource.h | 2 +- src/include/86box/rom.h | 2 +- src/include/86box/scsi.h | 2 +- src/include/86box/scsi_aha154x.h | 3 +- src/include/86box/scsi_buslogic.h | 4 +- src/include/86box/scsi_cdrom.h | 2 +- src/include/86box/scsi_device.h | 2 +- src/include/86box/scsi_disk.h | 4 + src/include/86box/scsi_ncr5380.h | 3 +- src/include/86box/scsi_ncr53c8xx.h | 2 +- src/include/86box/scsi_pcscsi.h | 4 +- src/include/86box/scsi_spock.h | 3 +- src/include/86box/scsi_x54x.h | 5 +- src/include/86box/serial.h | 3 +- src/include/86box/sio.h | 3 +- src/include/86box/smbus.h | 2 +- src/include/86box/smbus_piix4.h | 53 ---- src/include/86box/smram.h | 3 +- src/include/86box/snd_ac97.h | 8 +- src/include/86box/snd_ad1848.h | 5 + src/include/86box/snd_azt2316a.h | 7 +- src/include/86box/snd_cms.h | 6 +- src/include/86box/snd_emu8k.h | 4 + src/include/86box/snd_mpu401.h | 2 +- src/include/86box/snd_opl.h | 2 - src/include/86box/snd_opl_nuked.h | 2 +- src/include/86box/snd_resid.h | 5 + src/include/86box/snd_sb_dsp.h | 4 +- src/include/86box/snd_sn76489.h | 5 + src/include/86box/snd_speaker.h | 6 + src/include/86box/snd_ym7128.h | 5 + src/include/86box/spd.h | 3 +- src/include/86box/ui.h | 2 - src/include/86box/unix_sdl.h | 6 +- src/include/86box/usb.h | 2 +- src/include/86box/vid_ati_eeprom.h | 5 + src/include/86box/vid_cga.h | 1 + src/include/86box/vid_cga_comp.h | 1 + src/include/86box/vid_colorplus.h | 5 + src/include/86box/vid_ddc.h | 1 + src/include/86box/vid_ega.h | 2 +- src/include/86box/vid_hercules.h | 1 + src/include/86box/vid_mda.h | 6 + src/include/86box/vid_nga.h | 5 + src/include/86box/vid_ogc.h | 5 + src/include/86box/vid_pgc.h | 2 - src/include/86box/vid_pgc_palette.h | 2 +- src/include/86box/vid_svga.h | 2 +- src/include/86box/vid_svga_render.h | 5 + src/include/86box/vid_svga_render_remap.h | 5 + src/include/86box/vid_vga.h | 1 + src/include/86box/vid_voodoo_banshee.h | 5 + .../86box/vid_voodoo_banshee_blitter.h | 5 + src/include/86box/vid_voodoo_blitter.h | 5 + src/include/86box/vid_voodoo_codegen_x86-64.h | 5 + src/include/86box/vid_voodoo_codegen_x86.h | 5 + src/include/86box/vid_voodoo_common.h | 5 + src/include/86box/vid_voodoo_display.h | 5 + src/include/86box/vid_voodoo_dither.h | 5 + src/include/86box/vid_voodoo_fb.h | 5 + src/include/86box/vid_voodoo_fifo.h | 5 + src/include/86box/vid_voodoo_reg.h | 5 + src/include/86box/vid_voodoo_regs.h | 7 +- src/include/86box/vid_voodoo_render.h | 5 + src/include/86box/vid_voodoo_setup.h | 6 + src/include/86box/vid_voodoo_texture.h | 6 + src/include/86box/video.h | 2 +- src/include/86box/vnc.h | 2 +- src/include/86box/win.h | 2 +- src/include/86box/win_opengl.h | 3 +- src/include/86box/win_opengl_glslp.h | 3 +- src/include/86box/win_sdl.h | 1 + src/include/86box/zip.h | 3 +- 127 files changed, 472 insertions(+), 277 deletions(-) delete mode 100644 src/include/86box/smbus_piix4.h diff --git a/src/include/86box/bswap.h b/src/include/86box/bswap.h index a49c4f1bc..cd5a71425 100644 --- a/src/include/86box/bswap.h +++ b/src/include/86box/bswap.h @@ -34,8 +34,9 @@ * Boston, MA 02111-1307 * USA. */ + #ifndef BSWAP_H -#define BSWAP_H +# define BSWAP_H #include @@ -228,4 +229,4 @@ static __inline void cpu_to_be32wu(uint32_t *p, uint32_t v) #undef le_bswaps #undef be_bswaps -#endif /* BSWAP_H */ +#endif /*BSWAP_H*/ diff --git a/src/include/86box/cassette.h b/src/include/86box/cassette.h index a22b4c41f..524c5d055 100644 --- a/src/include/86box/cassette.h +++ b/src/include/86box/cassette.h @@ -21,7 +21,7 @@ #ifndef PCE_IBMPC_CASSETTE_H -#define PCE_IBMPC_CASSETTE_H 1 +# define PCE_IBMPC_CASSETTE_H 1 #include @@ -170,4 +170,4 @@ extern int cassette_ui_writeprot; extern const device_t cassette_device; -#endif +#endif /*PCE_IBMPC_CASSETTE_H*/ diff --git a/src/include/86box/cdrom.h b/src/include/86box/cdrom.h index 4245a0a66..ad9b23886 100644 --- a/src/include/86box/cdrom.h +++ b/src/include/86box/cdrom.h @@ -15,7 +15,7 @@ * Copyright 2016-2019 Miran Grca. */ #ifndef EMU_CDROM_H -#define EMU_CDROM_H +# define EMU_CDROM_H #define CDROM_NUM 4 diff --git a/src/include/86box/cdrom_image.h b/src/include/86box/cdrom_image.h index 415956e56..db3e903f8 100644 --- a/src/include/86box/cdrom_image.h +++ b/src/include/86box/cdrom_image.h @@ -1,8 +1,9 @@ /* Copyright holders: RichardG867, Tenshi see COPYING for more details */ + #ifndef CDROM_IMAGE_H -#define CDROM_IMAGE_H +# define CDROM_IMAGE_H /* this header file lists the functions provided by various platform specific cdrom-ioctl files */ @@ -23,4 +24,4 @@ extern void cdrom_set_null_handler(uint8_t id); } #endif -#endif /* ! CDROM_IMAGE_H */ +#endif /*CDROM_IMAGE_H*/ diff --git a/src/include/86box/cdrom_image_backend.h b/src/include/86box/cdrom_image_backend.h index 74be1df69..d447dc559 100644 --- a/src/include/86box/cdrom_image_backend.h +++ b/src/include/86box/cdrom_image_backend.h @@ -19,8 +19,9 @@ * Copyright 2017-2020 Fred N. van Kempen. * Copyright 2002-2020 The DOSBox Team. */ + #ifndef CDROM_IMAGE_BACKEND_H -#define CDROM_IMAGE_BACKEND_H +# define CDROM_IMAGE_BACKEND_H #define RAW_SECTOR_SIZE 2352 #define COOKED_SECTOR_SIZE 2048 @@ -93,4 +94,4 @@ extern int cdi_has_audio_track(cd_img_t *cdi); -#endif /* ! CDROM_IMAGE_BACKEND_H */ +#endif /*CDROM_IMAGE_BACKEND_H*/ diff --git a/src/include/86box/filters.h b/src/include/86box/filters.h index 98eff66e2..011a37929 100644 --- a/src/include/86box/filters.h +++ b/src/include/86box/filters.h @@ -1,3 +1,6 @@ +#ifndef EMU_FILTERS_H +# define EMU_FILTERS_H + #define NCoef 2 /* fc=150Hz */ @@ -399,3 +402,5 @@ static inline double low_fir_sb16(int c, int i, double NewSample) return out; } + +#endif /*EMU_FILTERS_H*/ diff --git a/src/include/86box/flash.h b/src/include/86box/flash.h index d16814b75..531cc7037 100644 --- a/src/include/86box/flash.h +++ b/src/include/86box/flash.h @@ -14,6 +14,9 @@ * Copyright 2020 Miran Grca. */ +#ifndef EMU_FLASH_H +# define EMU_FLASH_H + extern const device_t catalyst_flash_device; extern const device_t intel_flash_bxt_ami_device; @@ -25,4 +28,6 @@ extern const device_t sst_flash_29ee020_device; extern const device_t winbond_flash_w29c020_device; extern const device_t sst_flash_39sf010_device; extern const device_t sst_flash_39sf020_device; -extern const device_t sst_flash_39sf040_device; \ No newline at end of file +extern const device_t sst_flash_39sf040_device; + +#endif /*EMU_FLASH_H*/ diff --git a/src/include/86box/hdc_ide_sff8038i.h b/src/include/86box/hdc_ide_sff8038i.h index 700684dae..1c058772c 100644 --- a/src/include/86box/hdc_ide_sff8038i.h +++ b/src/include/86box/hdc_ide_sff8038i.h @@ -16,6 +16,9 @@ * Copyright 2016-2020 Miran Grca. */ +#ifndef EMU_HDC_IDE_SFF8038I_H +# define EMU_HDC_IDE_SFF8038I_H + typedef struct { uint8_t command, status, @@ -56,3 +59,5 @@ extern void sff_set_irq_mode(sff8038i_t *dev, int channel, int irq_mode); extern void sff_set_irq_pin(sff8038i_t *dev, int irq_pin); extern void sff_set_irq_level(sff8038i_t *dev, int channel, int irq_level); + +#endif /*EMU_HDC_IDE_SFF8038I_H*/ diff --git a/src/include/86box/i82335.h b/src/include/86box/i82335.h index 7cb4c4ef3..705f1b085 100644 --- a/src/include/86box/i82335.h +++ b/src/include/86box/i82335.h @@ -1 +1,6 @@ +#ifndef EMU_I82335_H +# define EMU_I82335_H + extern void i82335_init(void); + +#endif /*EMU_I82335_H*/ diff --git a/src/include/86box/ibm_5161.h b/src/include/86box/ibm_5161.h index 69f9d23a8..858c18786 100644 --- a/src/include/86box/ibm_5161.h +++ b/src/include/86box/ibm_5161.h @@ -12,4 +12,9 @@ * Copyright 2016-2018 Miran Grca. */ +#ifndef EMU_IBM_5161_H +# define EMU_IBM_5161_H + extern const device_t ibm_5161_device; + +#endif /*EMU_IBM_5151_H*/ diff --git a/src/include/86box/isamem.h b/src/include/86box/isamem.h index 90d7666ec..b02c27374 100644 --- a/src/include/86box/isamem.h +++ b/src/include/86box/isamem.h @@ -44,8 +44,9 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef ISAMEM_H -# define ISAMEM_H + +#ifndef EMU_ISAMEM_H +# define EMU_ISAMEM_H #define ISAMEM_MAX 4 /* max #cards in system */ @@ -74,4 +75,4 @@ extern const device_t *isamem_get_device(int t); #endif -#endif /*ISAMEM_H*/ +#endif /*EMU_ISAMEM_H*/ diff --git a/src/include/86box/isapnp.h b/src/include/86box/isapnp.h index 87272d86a..3b2aa1859 100644 --- a/src/include/86box/isapnp.h +++ b/src/include/86box/isapnp.h @@ -14,6 +14,7 @@ * * Copyright 2021 RichardG. */ + #ifndef EMU_ISAPNP_H # define EMU_ISAPNP_H # include diff --git a/src/include/86box/isartc.h b/src/include/86box/isartc.h index e2cb82b97..391b9f642 100644 --- a/src/include/86box/isartc.h +++ b/src/include/86box/isartc.h @@ -44,8 +44,9 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef ISARTC_H -# define ISARTC_H + +#ifndef EMU_ISARTC_H +# define EMU_ISARTC_H #ifdef __cplusplus @@ -67,4 +68,4 @@ extern const device_t *isartc_get_device(int t); #endif -#endif /*ISARTC_H*/ +#endif /*EMU_ISARTC_H*/ diff --git a/src/include/86box/joystick_ch_flightstick_pro.h b/src/include/86box/joystick_ch_flightstick_pro.h index 1358f9d69..bd2984438 100644 --- a/src/include/86box/joystick_ch_flightstick_pro.h +++ b/src/include/86box/joystick_ch_flightstick_pro.h @@ -35,4 +35,9 @@ * USA. */ +#ifndef EMU_JOYSTICK_CH_FLIGHTSTICK_PRO_H +# define EMU_JOYSTICK_CH_FLIGHTSTICK_PRO_H + extern const joystick_if_t joystick_ch_flightstick_pro; + +#endif /*EMU_JOYSTICK_CH_FLIGHTSTICK_PRO_H*/ diff --git a/src/include/86box/joystick_standard.h b/src/include/86box/joystick_standard.h index 9bc86b204..c60828afb 100644 --- a/src/include/86box/joystick_standard.h +++ b/src/include/86box/joystick_standard.h @@ -35,6 +35,9 @@ * USA. */ +#ifndef EMU_JOYSTICK_STANDARD_H +# define EMU_JOYSTICK_STANDARD_H + extern const joystick_if_t joystick_2axis_2button; extern const joystick_if_t joystick_2axis_4button; extern const joystick_if_t joystick_3axis_2button; @@ -42,3 +45,5 @@ extern const joystick_if_t joystick_3axis_4button; extern const joystick_if_t joystick_4axis_4button; extern const joystick_if_t joystick_2axis_6button; extern const joystick_if_t joystick_2axis_8button; + +#endif /*EMU_JOYSTICK_STANDARD_H*/ diff --git a/src/include/86box/joystick_sw_pad.h b/src/include/86box/joystick_sw_pad.h index 2f62aab19..daa671028 100644 --- a/src/include/86box/joystick_sw_pad.h +++ b/src/include/86box/joystick_sw_pad.h @@ -35,4 +35,9 @@ * USA. */ +#ifndef EMU_JOYSTICK_SW_PAD_H +# define EMU_JOYSTICK_SW_PAD_H + extern const joystick_if_t joystick_sw_pad; + +#endif /*EMU_JOYSTICK_SW_PAD_H*/ diff --git a/src/include/86box/joystick_tm_fcs.h b/src/include/86box/joystick_tm_fcs.h index 60067d88a..78b85e9a0 100644 --- a/src/include/86box/joystick_tm_fcs.h +++ b/src/include/86box/joystick_tm_fcs.h @@ -35,4 +35,9 @@ * USA. */ +#ifndef EMU_JOYSTICK_TM_FCS_H +# define EMU_JOYSTICK_TM_FCS_H + extern const joystick_if_t joystick_tm_fcs; + +#endif /*EMU_JOYSTICK_TM_FCS_H*/ diff --git a/src/include/86box/keyboard.h b/src/include/86box/keyboard.h index 206feeefc..b87f2552a 100644 --- a/src/include/86box/keyboard.h +++ b/src/include/86box/keyboard.h @@ -18,6 +18,7 @@ * Copyright 2016-2019 Miran Grca. * Copyright 2017-2019 Fred N. van Kempen. */ + #ifndef EMU_KEYBOARD_H # define EMU_KEYBOARD_H diff --git a/src/include/86box/language.h b/src/include/86box/language.h index 9a5397c6b..6090ee611 100644 --- a/src/include/86box/language.h +++ b/src/include/86box/language.h @@ -16,6 +16,7 @@ * * Copyright 2017,2018 Fred N. van Kempen. */ + #ifndef LANG_UAGE_H # define LANG_UAGE_H diff --git a/src/include/86box/log.h b/src/include/86box/log.h index 210f2c5a7..3b4235b2c 100644 --- a/src/include/86box/log.h +++ b/src/include/86box/log.h @@ -16,6 +16,7 @@ * Copyright 2021 Miran Grca. * Copyright 2021 Fred N. van Kempen. */ + #ifndef EMU_LOG_H # define EMU_LOG_H diff --git a/src/include/86box/m_amstrad.h b/src/include/86box/m_amstrad.h index b190ab0a5..d498be6c3 100644 --- a/src/include/86box/m_amstrad.h +++ b/src/include/86box/m_amstrad.h @@ -16,6 +16,10 @@ * * Copyright 2008-2019 Sarah Walker. */ + +#ifndef MACHINE_AMSTRAD_H +# define MACHINE_AMSTRAD_H + extern int amstrad_latch; enum @@ -24,3 +28,5 @@ enum AMSTRAD_SW9, AMSTRAD_SW10 }; + +#endif /*MACHINE_AMSTRAD.H*/ diff --git a/src/include/86box/m_at_t3100e.h b/src/include/86box/m_at_t3100e.h index 216f490e2..8943f7f2f 100644 --- a/src/include/86box/m_at_t3100e.h +++ b/src/include/86box/m_at_t3100e.h @@ -36,6 +36,7 @@ * Boston, MA 02111-1307 * USA. */ + #ifndef MACHINE_T3100E_H # define MACHINE_T3100E_H diff --git a/src/include/86box/m_xt_t1000.h b/src/include/86box/m_xt_t1000.h index 8945b24e8..4220f1548 100644 --- a/src/include/86box/m_xt_t1000.h +++ b/src/include/86box/m_xt_t1000.h @@ -36,6 +36,7 @@ * Boston, MA 02111-1307 * USA. */ + #ifndef MACHINE_T1000_H # define MACHINE_T1000_H diff --git a/src/include/86box/m_xt_xi8088.h b/src/include/86box/m_xt_xi8088.h index f263e385d..e2421fa0a 100644 --- a/src/include/86box/m_xt_xi8088.h +++ b/src/include/86box/m_xt_xi8088.h @@ -1,3 +1,6 @@ +#ifndef MACHINE_XI80888_H +# define MACHINE_XI80888_H + #include <86box/device.h> extern const device_t xi8088_device; @@ -6,3 +9,5 @@ uint8_t xi8088_turbo_get(); void xi8088_turbo_set(uint8_t value); void xi8088_bios_128kb_set(int val); int xi8088_bios_128kb(); + +#endif /*MACHINE_XI80888_H*/ diff --git a/src/include/86box/machine.h b/src/include/86box/machine.h index f3fb0928f..cefa0f4d2 100644 --- a/src/include/86box/machine.h +++ b/src/include/86box/machine.h @@ -18,6 +18,7 @@ * Copyright 2016-2020 Miran Grca. * Copyright 2017-2020 Fred N. van Kempen. */ + #ifndef EMU_MACHINE_H # define EMU_MACHINE_H diff --git a/src/include/86box/mca.h b/src/include/86box/mca.h index e0def3fe5..68aa2563f 100644 --- a/src/include/86box/mca.h +++ b/src/include/86box/mca.h @@ -1,3 +1,6 @@ +#ifndef EMU_MCA_H +# define EMU_MCA_H + extern void mca_init(int nr_cards); extern void mca_add(uint8_t (*read)(int addr, void *priv), void (*write)(int addr, uint8_t val, void *priv), uint8_t (*feedb)(void *priv), void (*reset)(void *priv), void *priv); extern void mca_set_index(int index); @@ -6,4 +9,6 @@ extern void mca_write(uint16_t port, uint8_t val); extern uint8_t mca_feedb(void); extern void mca_reset(void); -extern void ps2_cache_clean(void); \ No newline at end of file +extern void ps2_cache_clean(void); + +#endif /*EMU_MCA_H*/ diff --git a/src/include/86box/mem.h b/src/include/86box/mem.h index 5d1f6848c..d9dd8bafb 100644 --- a/src/include/86box/mem.h +++ b/src/include/86box/mem.h @@ -18,6 +18,7 @@ * Copyright 2017-2020 Fred N. van Kempen. * Copyright 2016-2020 Miran Grca. */ + #ifndef EMU_MEM_H # define EMU_MEM_H diff --git a/src/include/86box/midi_rtmidi.h b/src/include/86box/midi_rtmidi.h index beaccdf54..5224b83e9 100644 --- a/src/include/86box/midi_rtmidi.h +++ b/src/include/86box/midi_rtmidi.h @@ -1,3 +1,6 @@ +#ifndef EMU_SOUND_RTMIDI_H +# define EMU_SOUND_RTMIDI_H + #ifdef __cplusplus extern "C" { @@ -10,4 +13,6 @@ extern void rtmidi_in_get_dev_name(int num, char *s); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif + +#endif /*EMU_SOUND_RTMIDI*/ diff --git a/src/include/86box/mo.h b/src/include/86box/mo.h index caf5f2417..7d0eed904 100644 --- a/src/include/86box/mo.h +++ b/src/include/86box/mo.h @@ -17,9 +17,9 @@ * * Copyright 2020 Miran Grca. */ -#ifndef EMU_MO_H -#define EMU_MO_H +#ifndef EMU_MO_H +# define EMU_MO_H #define MO_NUM 4 diff --git a/src/include/86box/mouse.h b/src/include/86box/mouse.h index a3e192c46..a5519139a 100644 --- a/src/include/86box/mouse.h +++ b/src/include/86box/mouse.h @@ -16,10 +16,10 @@ * Copyright 2016-2019 Miran Grca. * Copyright 2017-2019 Fred N. van Kempen. */ + #ifndef EMU_MOUSE_H # define EMU_MOUSE_H - #define MOUSE_TYPE_NONE 0 /* no mouse configured */ #define MOUSE_TYPE_INTERNAL 1 /* machine has internal mouse */ #define MOUSE_TYPE_LOGIBUS 2 /* Logitech/ATI Bus Mouse */ diff --git a/src/include/86box/net_3c503.h b/src/include/86box/net_3c503.h index 6cc656b9f..4f3a2b20e 100644 --- a/src/include/86box/net_3c503.h +++ b/src/include/86box/net_3c503.h @@ -3,5 +3,4 @@ extern const device_t threec503_device; - #endif /*NET_3C503_H*/ diff --git a/src/include/86box/net_dp8390.h b/src/include/86box/net_dp8390.h index 1365f7ec8..53c4ee4ba 100644 --- a/src/include/86box/net_dp8390.h +++ b/src/include/86box/net_dp8390.h @@ -16,6 +16,7 @@ * Copyright 2016-2018 Miran Grca. * Copyright 2008-2018 Bochs project. */ + #ifndef NET_DP8390_H # define NET_DP8390_H diff --git a/src/include/86box/net_ne2000.h b/src/include/86box/net_ne2000.h index b2581e98e..23870b989 100644 --- a/src/include/86box/net_ne2000.h +++ b/src/include/86box/net_ne2000.h @@ -32,6 +32,7 @@ * Boston, MA 02111-1307 * USA. */ + #ifndef NET_NE2000_H # define NET_NE2000_H diff --git a/src/include/86box/net_pcnet.h b/src/include/86box/net_pcnet.h index 651a62198..e6ae84eff 100644 --- a/src/include/86box/net_pcnet.h +++ b/src/include/86box/net_pcnet.h @@ -16,6 +16,7 @@ * Copyright 2004-2019 Antony T Curtis * Copyright 2016-2019 Miran Grca. */ + #ifndef NET_PCNET_H # define NET_PCNET_H diff --git a/src/include/86box/net_plip.h b/src/include/86box/net_plip.h index d45b80091..69cb80da0 100644 --- a/src/include/86box/net_plip.h +++ b/src/include/86box/net_plip.h @@ -13,6 +13,7 @@ * Author: RichardG, * Copyright 2020 RichardG. */ + #ifndef NET_PLIP_H # define NET_PLIP_H # include <86box/device.h> diff --git a/src/include/86box/net_wd8003.h b/src/include/86box/net_wd8003.h index 5b6e2113e..8fc89a88b 100644 --- a/src/include/86box/net_wd8003.h +++ b/src/include/86box/net_wd8003.h @@ -40,6 +40,7 @@ * Boston, MA 02111-1307 * USA. */ + #ifndef NET_WD8003_H # define NET_WD8003_H diff --git a/src/include/86box/network.h b/src/include/86box/network.h index 015eb6a34..df04343ca 100644 --- a/src/include/86box/network.h +++ b/src/include/86box/network.h @@ -44,6 +44,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + #ifndef EMU_NETWORK_H # define EMU_NETWORK_H # include diff --git a/src/include/86box/nmi.h b/src/include/86box/nmi.h index 72c2f507f..b2378af93 100644 --- a/src/include/86box/nmi.h +++ b/src/include/86box/nmi.h @@ -1,6 +1,10 @@ /* Copyright holders: Sarah Walker see COPYING for more details */ + +#ifndef EMU_NMI_H +# define EMU_NMI_H + extern int nmi_mask; extern int nmi; extern int nmi_auto_clear; @@ -9,3 +13,5 @@ extern int nmi_auto_clear; extern void nmi_init(void); extern void nmi_write(uint16_t port, uint8_t val, void *p); + +#endif /*EMU_NMI_H*/ diff --git a/src/include/86box/nvr.h b/src/include/86box/nvr.h index b841d7e6a..3a5dd7039 100644 --- a/src/include/86box/nvr.h +++ b/src/include/86box/nvr.h @@ -1,130 +1,131 @@ -/* - * 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. - * - * Definitions for the generic NVRAM/CMOS driver. - * - * - * - * Author: Fred N. van Kempen, , - * David Hrdlička, - * - * Copyright 2017-2020 Fred N. van Kempen. - * Copyright 2018-2020 David Hrdlička. - * - * Redistribution and use in source and binary forms, with - * or without modification, are permitted provided that the - * following conditions are met: - * - * 1. Redistributions of source code must retain the entire - * above notice, this list of conditions and the following - * disclaimer. - * - * 2. Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the - * following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of the copyright holder nor the names - * of its contributors may be used to endorse or promote - * products derived from this software without specific - * prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -#ifndef EMU_NVR_H -# define EMU_NVR_H - - -#define NVR_MAXSIZE 512 /* max size of NVR data */ - -/* Conversion from BCD to Binary and vice versa. */ -#define RTC_BCD(x) (((x) % 10) | (((x) / 10) << 4)) -#define RTC_DCB(x) ((((x) & 0xf0) >> 4) * 10 + ((x) & 0x0f)) -#define RTC_BCDINC(x,y) RTC_BCD(RTC_DCB(x) + y) - -/* Time sync options */ -#define TIME_SYNC_DISABLED 0 -#define TIME_SYNC_ENABLED 1 -#define TIME_SYNC_UTC 2 - - -/* Define a generic RTC/NVRAM device. */ -typedef struct _nvr_ { - char *fn; /* pathname of image file */ - uint16_t size; /* device configuration */ - int8_t irq, is_new; - - uint8_t onesec_cnt; - pc_timer_t onesec_time; - - void *data; /* local data */ - - /* Hooks to device functions. */ - void (*reset)(struct _nvr_ *); - void (*start)(struct _nvr_ *); - void (*tick)(struct _nvr_ *); - void (*ven_save)(void); - - uint8_t regs[NVR_MAXSIZE]; /* these are the registers */ -} nvr_t; - - -extern int nvr_dosave; -#ifdef EMU_DEVICE_H -extern const device_t at_nvr_old_device; -extern const device_t at_nvr_device; -extern const device_t ps_nvr_device; -extern const device_t amstrad_nvr_device; -extern const device_t ibmat_nvr_device; -extern const device_t piix4_nvr_device; -extern const device_t ami_1992_nvr_device; -extern const device_t ami_1994_nvr_device; -extern const device_t ami_1995_nvr_device; -extern const device_t via_nvr_device; -extern const device_t p6rp4_nvr_device; -#endif - - -extern void rtc_tick(void); - -extern void nvr_init(nvr_t *); -extern char *nvr_path(char *str); -extern FILE *nvr_fopen(char *str, char *mode); -extern int nvr_load(void); -extern void nvr_close(void); -extern void nvr_set_ven_save(void (*ven_save)(void)); -extern int nvr_save(void); - -extern int nvr_is_leap(int year); -extern int nvr_get_days(int month, int year); -extern void nvr_time_sync(); -extern void nvr_time_get(struct tm *); -extern void nvr_time_set(struct tm *); - -extern void nvr_reg_write(uint16_t reg, uint8_t val, void *priv); -extern void nvr_at_handler(int set, uint16_t base, nvr_t *nvr); -extern void nvr_at_sec_handler(int set, uint16_t base, nvr_t *nvr); -extern void nvr_read_addr_set(int set, nvr_t *nvr); -extern void nvr_wp_set(int set, int h, nvr_t *nvr); -extern void nvr_via_wp_set(int set, int reg, nvr_t *nvr); -extern void nvr_bank_set(int base, uint8_t bank, nvr_t *nvr); -extern void nvr_lock_set(int base, int size, int lock, nvr_t *nvr); -extern void nvr_irq_set(int irq, nvr_t *nvr); - - -#endif /*EMU_NVR_H*/ +/* + * 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. + * + * Definitions for the generic NVRAM/CMOS driver. + * + * + * + * Author: Fred N. van Kempen, , + * David Hrdlička, + * + * Copyright 2017-2020 Fred N. van Kempen. + * Copyright 2018-2020 David Hrdlička. + * + * Redistribution and use in source and binary forms, with + * or without modification, are permitted provided that the + * following conditions are met: + * + * 1. Redistributions of source code must retain the entire + * above notice, this list of conditions and the following + * disclaimer. + * + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names + * of its contributors may be used to endorse or promote + * products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef EMU_NVR_H +# define EMU_NVR_H + + +#define NVR_MAXSIZE 512 /* max size of NVR data */ + +/* Conversion from BCD to Binary and vice versa. */ +#define RTC_BCD(x) (((x) % 10) | (((x) / 10) << 4)) +#define RTC_DCB(x) ((((x) & 0xf0) >> 4) * 10 + ((x) & 0x0f)) +#define RTC_BCDINC(x,y) RTC_BCD(RTC_DCB(x) + y) + +/* Time sync options */ +#define TIME_SYNC_DISABLED 0 +#define TIME_SYNC_ENABLED 1 +#define TIME_SYNC_UTC 2 + + +/* Define a generic RTC/NVRAM device. */ +typedef struct _nvr_ { + char *fn; /* pathname of image file */ + uint16_t size; /* device configuration */ + int8_t irq, is_new; + + uint8_t onesec_cnt; + pc_timer_t onesec_time; + + void *data; /* local data */ + + /* Hooks to device functions. */ + void (*reset)(struct _nvr_ *); + void (*start)(struct _nvr_ *); + void (*tick)(struct _nvr_ *); + void (*ven_save)(void); + + uint8_t regs[NVR_MAXSIZE]; /* these are the registers */ +} nvr_t; + + +extern int nvr_dosave; +#ifdef EMU_DEVICE_H +extern const device_t at_nvr_old_device; +extern const device_t at_nvr_device; +extern const device_t ps_nvr_device; +extern const device_t amstrad_nvr_device; +extern const device_t ibmat_nvr_device; +extern const device_t piix4_nvr_device; +extern const device_t ami_1992_nvr_device; +extern const device_t ami_1994_nvr_device; +extern const device_t ami_1995_nvr_device; +extern const device_t via_nvr_device; +extern const device_t p6rp4_nvr_device; +#endif + + +extern void rtc_tick(void); + +extern void nvr_init(nvr_t *); +extern char *nvr_path(char *str); +extern FILE *nvr_fopen(char *str, char *mode); +extern int nvr_load(void); +extern void nvr_close(void); +extern void nvr_set_ven_save(void (*ven_save)(void)); +extern int nvr_save(void); + +extern int nvr_is_leap(int year); +extern int nvr_get_days(int month, int year); +extern void nvr_time_sync(); +extern void nvr_time_get(struct tm *); +extern void nvr_time_set(struct tm *); + +extern void nvr_reg_write(uint16_t reg, uint8_t val, void *priv); +extern void nvr_at_handler(int set, uint16_t base, nvr_t *nvr); +extern void nvr_at_sec_handler(int set, uint16_t base, nvr_t *nvr); +extern void nvr_read_addr_set(int set, nvr_t *nvr); +extern void nvr_wp_set(int set, int h, nvr_t *nvr); +extern void nvr_via_wp_set(int set, int reg, nvr_t *nvr); +extern void nvr_bank_set(int base, uint8_t bank, nvr_t *nvr); +extern void nvr_lock_set(int base, int size, int lock, nvr_t *nvr); +extern void nvr_irq_set(int irq, nvr_t *nvr); + + +#endif /*EMU_NVR_H*/ diff --git a/src/include/86box/nvr_ps2.h b/src/include/86box/nvr_ps2.h index f0058d9b1..7cb37a625 100644 --- a/src/include/86box/nvr_ps2.h +++ b/src/include/86box/nvr_ps2.h @@ -34,6 +34,7 @@ * Boston, MA 02111-1307 * USA. */ + #ifndef EMU_NVRPS2_H # define EMU_NVRPS2_H diff --git a/src/include/86box/pci.h b/src/include/86box/pci.h index 919f14ac2..98aac3436 100644 --- a/src/include/86box/pci.h +++ b/src/include/86box/pci.h @@ -18,10 +18,10 @@ * Copyright 2017-2020 Fred N. van Kempen. * Copyright 2008-2020 Sarah Walker. */ + #ifndef EMU_PCI_H # define EMU_PCI_H - #define PCI_REG_COMMAND 0x04 #define PCI_COMMAND_IO 0x01 diff --git a/src/include/86box/pci_dummy.h b/src/include/86box/pci_dummy.h index 45e1299bc..a2ae4b8d0 100644 --- a/src/include/86box/pci_dummy.h +++ b/src/include/86box/pci_dummy.h @@ -1 +1,6 @@ +#ifndef EMU_PCI_DUMMY_H +# define EMU_PCI_DUMMY_H + extern void pci_dummy_init(void); + +#endif /*EMU_PCI_DUMMY_H*/ diff --git a/src/include/86box/pic.h b/src/include/86box/pic.h index 73b316f2e..3720f17d1 100644 --- a/src/include/86box/pic.h +++ b/src/include/86box/pic.h @@ -15,10 +15,10 @@ * Copyright 2015-2020 Andrew Jenner. * Copyright 2016-2020 Miran Grca. */ + #ifndef EMU_PIC_H # define EMU_PIC_H - typedef struct pic { uint8_t icw1, icw2, icw3, icw4, imr, isr, irr, ocw2, diff --git a/src/include/86box/pit.h b/src/include/86box/pit.h index bf8d71048..c560fae12 100644 --- a/src/include/86box/pit.h +++ b/src/include/86box/pit.h @@ -14,6 +14,7 @@ * Author: Miran Grca, * Copyright 2019,2020 Miran Grca. */ + #ifndef EMU_PIT_H # define EMU_PIT_H diff --git a/src/include/86box/plat.h b/src/include/86box/plat.h index c60e6d922..0c9485461 100644 --- a/src/include/86box/plat.h +++ b/src/include/86box/plat.h @@ -17,6 +17,7 @@ * Copyright 2017-2019 Fred N. van Kempen. * Copyright 2021 Laci bá' */ + #ifndef EMU_PLAT_H # define EMU_PLAT_H diff --git a/src/include/86box/plat_dir.h b/src/include/86box/plat_dir.h index b8280404c..41bd7fe62 100644 --- a/src/include/86box/plat_dir.h +++ b/src/include/86box/plat_dir.h @@ -13,10 +13,10 @@ * Author: Fred N. van Kempen, * Copyright 2017 Fred N. van Kempen. */ + #ifndef PLAT_DIR_H # define PLAT_DIR_H - #ifdef _MAX_FNAME # define MAXNAMLEN _MAX_FNAME #else diff --git a/src/include/86box/plat_dynld.h b/src/include/86box/plat_dynld.h index 0eb8f33c2..b4be8d09e 100644 --- a/src/include/86box/plat_dynld.h +++ b/src/include/86box/plat_dynld.h @@ -13,10 +13,10 @@ * Author: Fred N. van Kempen, * Copyright 2017 Fred N. van Kempen */ + #ifndef PLAT_DYNLD_H # define PLAT_DYNLD_H - typedef struct { const char *name; void *func; diff --git a/src/include/86box/png_struct.h b/src/include/86box/png_struct.h index 893cc5f64..0bb0e5e1b 100644 --- a/src/include/86box/png_struct.h +++ b/src/include/86box/png_struct.h @@ -44,6 +44,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + #ifndef EMU_PNG_STRUCT_H # define EMU_PNG_STRUCT_H diff --git a/src/include/86box/port_6x.h b/src/include/86box/port_6x.h index 74172728a..a478e8390 100644 --- a/src/include/86box/port_6x.h +++ b/src/include/86box/port_6x.h @@ -15,10 +15,10 @@ * * Copyright 2021 Miran Grca. */ + #ifndef EMU_PORT_6X_H # define EMU_PORT_6X_H - #ifdef _TIMER_H_ typedef struct { diff --git a/src/include/86box/port_92.h b/src/include/86box/port_92.h index 52812edb8..78e0a0002 100644 --- a/src/include/86box/port_92.h +++ b/src/include/86box/port_92.h @@ -15,6 +15,7 @@ * * Copyright 2019 Miran Grca. */ + #ifndef EMU_PORT_92_H # define EMU_PORT_92_H diff --git a/src/include/86box/postcard.h b/src/include/86box/postcard.h index 8cf1d1c54..ee179eb3d 100644 --- a/src/include/86box/postcard.h +++ b/src/include/86box/postcard.h @@ -14,10 +14,10 @@ * * Copyright 2020 RichardG. */ + #ifndef POSTCARD_H # define POSTCARD_H - #ifdef __cplusplus extern "C" { #endif diff --git a/src/include/86box/printer.h b/src/include/86box/printer.h index 78193e18e..4cd5e898d 100644 --- a/src/include/86box/printer.h +++ b/src/include/86box/printer.h @@ -44,10 +44,10 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + #ifndef PRINTER_H # define PRINTER_H - #define FONT_FILE_DOTMATRIX "dotmatrix.ttf" #define FONT_FILE_ROMAN "roman.ttf" diff --git a/src/include/86box/prt_devs.h b/src/include/86box/prt_devs.h index 7ef25e5cd..e8d56fe24 100644 --- a/src/include/86box/prt_devs.h +++ b/src/include/86box/prt_devs.h @@ -1,3 +1,8 @@ +#ifndef EMU_PRT_DEVS_H +# define EMU_PRT_DEVS_H + extern const lpt_device_t lpt_prt_text_device; extern const lpt_device_t lpt_prt_escp_device; -extern const lpt_device_t lpt_prt_ps_device; \ No newline at end of file +extern const lpt_device_t lpt_prt_ps_device; + +#endif /*EMU_PRT_DEVS_H*/ diff --git a/src/include/86box/random.h b/src/include/86box/random.h index 75ceb4c13..bf123375f 100644 --- a/src/include/86box/random.h +++ b/src/include/86box/random.h @@ -14,12 +14,11 @@ * Author: Miran Grca, * Copyright 2016,2017 Miran Grca. */ + #ifndef EMU_RANDOM_H # define EMU_RANDOM_H - extern uint8_t random_generate(void); extern void random_init(void); - #endif /*EMU_RANDOM_H*/ diff --git a/src/include/86box/resource.h b/src/include/86box/resource.h index 242b6c9b4..a01abc1e9 100644 --- a/src/include/86box/resource.h +++ b/src/include/86box/resource.h @@ -19,10 +19,10 @@ * Copyright 2016-2019 Miran Grca. * Copyright 2018,2019 David Hrdlička. */ + #ifndef WIN_RESOURCE_H # define WIN_RESOURCE_H - /* Dialog IDs. */ #define DLG_ABOUT 101 /* top-level dialog */ #define DLG_STATUS 102 /* top-level dialog */ diff --git a/src/include/86box/rom.h b/src/include/86box/rom.h index 08ab241cf..dfea9f0b5 100644 --- a/src/include/86box/rom.h +++ b/src/include/86box/rom.h @@ -13,10 +13,10 @@ * Author: Fred N. van Kempen, * Copyright 2018,2019 Fred N. van Kempen. */ + #ifndef EMU_ROM_H # define EMU_ROM_H - #define FLAG_INT 1 #define FLAG_INV 2 #define FLAG_AUX 4 diff --git a/src/include/86box/scsi.h b/src/include/86box/scsi.h index 16d10bb98..03de1a4ac 100644 --- a/src/include/86box/scsi.h +++ b/src/include/86box/scsi.h @@ -19,7 +19,7 @@ * Copyright 2017,2018 Fred N. van Kempen. */ #ifndef EMU_SCSI_H -#define EMU_SCSI_H +# define EMU_SCSI_H extern int scsi_card_current[4]; diff --git a/src/include/86box/scsi_aha154x.h b/src/include/86box/scsi_aha154x.h index ed9002ae7..6a98d100e 100644 --- a/src/include/86box/scsi_aha154x.h +++ b/src/include/86box/scsi_aha154x.h @@ -9,6 +9,5 @@ extern const device_t aha154xcp_device; extern const device_t aha1640_device; extern void aha_device_reset(void *p); - - + #endif /*SCSI_AHA154X_H*/ diff --git a/src/include/86box/scsi_buslogic.h b/src/include/86box/scsi_buslogic.h index 27ea5c10b..fa075d964 100644 --- a/src/include/86box/scsi_buslogic.h +++ b/src/include/86box/scsi_buslogic.h @@ -19,7 +19,6 @@ #ifndef SCSI_BUSLOGIC_H # define SCSI_BUSLOGIC_H - extern const device_t buslogic_542b_device; extern const device_t buslogic_545s_device; extern const device_t buslogic_542bh_device; @@ -30,6 +29,5 @@ extern const device_t buslogic_445c_device; extern const device_t buslogic_958d_pci_device; extern void BuslogicDeviceReset(void *p); - - + #endif /*SCSI_BUSLOGIC_H*/ diff --git a/src/include/86box/scsi_cdrom.h b/src/include/86box/scsi_cdrom.h index 95f3634bf..fac93eada 100644 --- a/src/include/86box/scsi_cdrom.h +++ b/src/include/86box/scsi_cdrom.h @@ -15,10 +15,10 @@ * * Copyright 2018,2019 Miran Grca. */ + #ifndef EMU_SCSI_CDROM_H #define EMU_SCSI_CDROM_H - #define CDROM_TIME 10.0 diff --git a/src/include/86box/scsi_device.h b/src/include/86box/scsi_device.h index 6e9223648..a24e92932 100644 --- a/src/include/86box/scsi_device.h +++ b/src/include/86box/scsi_device.h @@ -16,10 +16,10 @@ * Copyright 2016-2019 Miran Grca. * Copyright 2017-2019 Fred N. van Kempen. */ + #ifndef SCSI_DEVICE_H # define SCSI_DEVICE_H - /* Configuration. */ #define SCSI_BUS_MAX 4 /* currently we support up to 4 controllers */ diff --git a/src/include/86box/scsi_disk.h b/src/include/86box/scsi_disk.h index 0caef4d26..bb782a098 100644 --- a/src/include/86box/scsi_disk.h +++ b/src/include/86box/scsi_disk.h @@ -12,6 +12,8 @@ * Copyright 2017,2018 Miran Grca. */ +#ifndef SCSI_DISK_H +# define SCSI_DISK_H typedef struct { mode_sense_pages_t ms_pages_saved; @@ -48,3 +50,5 @@ extern scsi_disk_t *scsi_disk[HDD_NUM]; extern void scsi_disk_hard_reset(void); extern void scsi_disk_close(void); + +#endif /*SCSI_DISK_H*/ diff --git a/src/include/86box/scsi_ncr5380.h b/src/include/86box/scsi_ncr5380.h index b939162fd..380f379e6 100644 --- a/src/include/86box/scsi_ncr5380.h +++ b/src/include/86box/scsi_ncr5380.h @@ -20,10 +20,10 @@ * Copyright 2017-2018 TheCollector1995. * Copyright 2017,2018 Fred N. van Kempen. */ + #ifndef SCSI_NCR5380_H # define SCSI_NCR5380_H - extern const device_t scsi_lcs6821n_device; extern const device_t scsi_rt1000b_device; extern const device_t scsi_t128_device; @@ -32,5 +32,4 @@ extern const device_t scsi_t130b_device; extern const device_t scsi_scsiat_device; #endif - #endif /*SCSI_NCR5380_H*/ diff --git a/src/include/86box/scsi_ncr53c8xx.h b/src/include/86box/scsi_ncr53c8xx.h index 730da5fed..1ee248c14 100644 --- a/src/include/86box/scsi_ncr53c8xx.h +++ b/src/include/86box/scsi_ncr53c8xx.h @@ -21,10 +21,10 @@ * Copyright 2009-2018 Artyom Tarasenko. * Copyright 2017,2018 Miran Grca. */ + #ifndef SCSI_NCR53C8XX_H # define SCSI_NCR53C8XX_H - extern const device_t ncr53c810_pci_device; extern const device_t ncr53c810_onboard_pci_device; extern const device_t ncr53c815_pci_device; diff --git a/src/include/86box/scsi_pcscsi.h b/src/include/86box/scsi_pcscsi.h index e21fa3801..e188f8f0e 100644 --- a/src/include/86box/scsi_pcscsi.h +++ b/src/include/86box/scsi_pcscsi.h @@ -25,9 +25,7 @@ #ifndef SCSI_PCSCSI_H # define SCSI_PCSCSI_H - extern const device_t dc390_pci_device; extern const device_t ncr53c90_mca_device; - - + #endif /*SCSI_BUSLOGIC_H*/ diff --git a/src/include/86box/scsi_spock.h b/src/include/86box/scsi_spock.h index 959fe3d04..469472c8f 100644 --- a/src/include/86box/scsi_spock.h +++ b/src/include/86box/scsi_spock.h @@ -17,9 +17,10 @@ * Copyright 2020 Sarah Walker. * Copyright 2020 TheCollector1995. */ + #ifndef SCSI_SPOCK_H # define SCSI_SPOCK_H extern const device_t spock_device; - + #endif /*SCSI_SPOCK_H*/ \ No newline at end of file diff --git a/src/include/86box/scsi_x54x.h b/src/include/86box/scsi_x54x.h index af91ee7d2..83773597b 100644 --- a/src/include/86box/scsi_x54x.h +++ b/src/include/86box/scsi_x54x.h @@ -20,9 +20,9 @@ * Copyright 2016-2018 Miran Grca. * Copyright 2017,2018 Fred N. van Kempen. */ -#ifndef SCSI_X54X_H -#define SCSI_X54X_H +#ifndef SCSI_X54X_H +# define SCSI_X54X_H #define SCSI_DELAY_TM 1 /* was 50 */ @@ -511,5 +511,4 @@ extern void *x54x_init(const device_t *info); extern void x54x_close(void *priv); extern void x54x_device_reset(void *priv); - #endif diff --git a/src/include/86box/serial.h b/src/include/86box/serial.h index 5203c17f8..7770ebb1b 100644 --- a/src/include/86box/serial.h +++ b/src/include/86box/serial.h @@ -19,10 +19,10 @@ * Copyright 2016-2020 Miran Grca. * Copyright 2017-2020 Fred N. van Kempen. */ + #ifndef EMU_SERIAL_H # define EMU_SERIAL_H - #define SERIAL_8250 0 #define SERIAL_8250_PCJR 1 #define SERIAL_16450 2 @@ -101,5 +101,4 @@ extern const device_t ns16750_device; extern const device_t ns16850_device; extern const device_t ns16950_device; - #endif /*EMU_SERIAL_H*/ diff --git a/src/include/86box/sio.h b/src/include/86box/sio.h index 667f39276..a9ee018cb 100644 --- a/src/include/86box/sio.h +++ b/src/include/86box/sio.h @@ -11,10 +11,10 @@ * Author: Fred N. van Kempen, * Copyright 2017-2020 Fred N. van Kempen. */ + #ifndef EMU_SIO_H # define EMU_SIO_H - extern void vt82c686_sio_write(uint8_t addr, uint8_t val, void *priv); @@ -83,5 +83,4 @@ extern const device_t w83977tf_device; extern const device_t w83977ef_device; extern const device_t w83977ef_370_device; - #endif /*EMU_SIO_H*/ diff --git a/src/include/86box/smbus.h b/src/include/86box/smbus.h index 6661a25c6..4c2c00c17 100644 --- a/src/include/86box/smbus.h +++ b/src/include/86box/smbus.h @@ -14,6 +14,7 @@ * * Copyright 2020 RichardG. */ + #ifndef EMU_SMBUS_PIIX4_H # define EMU_SMBUS_PIIX4_H @@ -66,5 +67,4 @@ extern const device_t via_smbus_device; extern const device_t ali7101_smbus_device; #endif - #endif /*EMU_SMBUS_PIIX4_H*/ diff --git a/src/include/86box/smbus_piix4.h b/src/include/86box/smbus_piix4.h deleted file mode 100644 index cf55dd210..000000000 --- a/src/include/86box/smbus_piix4.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * 86Box A hypervisor and IBM PC system emulator that specializes in - * running old operating systems and software designed for IBM - * PC systems and compatibles from 1981 through fairly recent - * system designs based on the PCI bus. - * - * This file is part of the 86Box distribution. - * - * Definitions for the generic PIIX4-compatible SMBus host controller. - * - * - * - * Authors: RichardG, - * - * Copyright 2020 RichardG. - */ -#ifndef EMU_SMBUS_PIIX4_H -# define EMU_SMBUS_PIIX4_H - - -#define SMBUS_PIIX4_BLOCK_DATA_SIZE 32 -#define SMBUS_PIIX4_BLOCK_DATA_MASK (SMBUS_PIIX4_BLOCK_DATA_SIZE - 1) - - -enum { - SMBUS_PIIX4 = 0, - SMBUS_VIA -}; - -typedef struct { - uint32_t local; - uint16_t io_base; - int clock; - double bit_period; - uint8_t stat, next_stat, ctl, cmd, addr, - data0, data1, - index, data[SMBUS_PIIX4_BLOCK_DATA_SIZE]; - pc_timer_t response_timer; - void *i2c; -} smbus_piix4_t; - - -extern void smbus_piix4_remap(smbus_piix4_t *dev, uint16_t new_io_base, uint8_t enable); -extern void smbus_piix4_setclock(smbus_piix4_t *dev, int clock); - - -#ifdef EMU_DEVICE_H -extern const device_t piix4_smbus_device; -extern const device_t via_smbus_device; -#endif - - -#endif /*EMU_SMBUS_PIIX4_H*/ diff --git a/src/include/86box/smram.h b/src/include/86box/smram.h index 996e5df30..7cc2e1a05 100644 --- a/src/include/86box/smram.h +++ b/src/include/86box/smram.h @@ -14,10 +14,10 @@ * * Copyright 2016-2020 Miran Grca. */ + #ifndef EMU_SMRAM_H # define EMU_SMRAM_H - typedef struct _smram_ { struct _smram_ *prev, *next; @@ -62,5 +62,4 @@ extern void smram_state_change(smram_t *smr, int smm, int flags); /* Enables or disables the use of a separate SMRAM for addresses below A0000. */ extern void smram_set_separate_smram(uint8_t set); - #endif /*EMU_SMRAM_H*/ diff --git a/src/include/86box/snd_ac97.h b/src/include/86box/snd_ac97.h index 0690cb52b..a9341f8ef 100644 --- a/src/include/86box/snd_ac97.h +++ b/src/include/86box/snd_ac97.h @@ -14,9 +14,8 @@ * * Copyright 2021 RichardG. */ -#ifndef EMU_SND_AC97_H -# define EMU_SND_AC97_H - +#ifndef SOUND_AC97_H +# define SOUND_AC97_H #define AC97_VENDOR_ID(f, s, t, dev) ((((f) & 0xff) << 24) | (((s) & 0xff) << 16) | (((t) & 0xff) << 8) | ((dev) & 0xff)) @@ -153,5 +152,4 @@ extern const device_t wm9701a_device; extern const device_t ac97_via_device; #endif - -#endif +#endif /*SOUND_AC97_H*/ diff --git a/src/include/86box/snd_ad1848.h b/src/include/86box/snd_ad1848.h index 17e7b5050..513425322 100644 --- a/src/include/86box/snd_ad1848.h +++ b/src/include/86box/snd_ad1848.h @@ -19,6 +19,9 @@ * Copyright 2021 RichardG. */ +#ifndef SOUND_AD1848_H +# define SOUND_AD1848_H + enum { AD1848_TYPE_DEFAULT = 0, AD1848_TYPE_CS4248, @@ -66,3 +69,5 @@ extern void ad1848_speed_changed(ad1848_t *ad1848); extern void ad1848_filter_cd_audio(int channel, double *buffer, void *priv); extern void ad1848_init(ad1848_t *ad1848, uint8_t type); + +#endif /*SOUND_AD1848_H*/ diff --git a/src/include/86box/snd_azt2316a.h b/src/include/86box/snd_azt2316a.h index 852de6c92..9dafa13f9 100644 --- a/src/include/86box/snd_azt2316a.h +++ b/src/include/86box/snd_azt2316a.h @@ -1 +1,6 @@ -extern void azt2316a_enable_wss(uint8_t enable, void *p); \ No newline at end of file +#ifndef SOUND_AZT2316A_H +# define SOUND_AZT2316A_H + +extern void azt2316a_enable_wss(uint8_t enable, void *p); + +#endif /*SOUND_AZT2316A*/ diff --git a/src/include/86box/snd_cms.h b/src/include/86box/snd_cms.h index 8700bf873..a400a026c 100644 --- a/src/include/86box/snd_cms.h +++ b/src/include/86box/snd_cms.h @@ -1,5 +1,5 @@ -#ifndef SOUND_SND_CMS_H -# define SOUND_SND_CMS_H +#ifndef SOUND_CMS_H +# define SOUND_CMS_H #include #include <86box/sound.h> @@ -32,4 +32,4 @@ extern void cms_update(cms_t *cms); extern void cms_write(uint16_t addr, uint8_t val, void *p); extern uint8_t cms_read(uint16_t addr, void *p); -#endif /*SOUND_SND_CMS_H*/ +#endif /*SOUND_CMS_H*/ diff --git a/src/include/86box/snd_emu8k.h b/src/include/86box/snd_emu8k.h index effab0f79..fa5212765 100644 --- a/src/include/86box/snd_emu8k.h +++ b/src/include/86box/snd_emu8k.h @@ -1,3 +1,5 @@ +#ifndef SOUND_EMU8K_H +# define SOUND_EMU8K_H /* All these defines are in samples, not in bytes. */ #define EMU8K_MEM_ADDRESS_MASK 0xFFFFFF @@ -776,3 +778,5 @@ Treble Parameters: 0xD308 0xD308 0xD308 0xD308 0xD308 0xD308 0xD3019 0xD32A 0xD34C 0xD36E 0xD36E 0xD36E 0x0001 0x0001 0x0001 0x0001 0x0001 0x0002 0x0002 0x0002 0x0002 0x0002 0x0002 0x0002 */ + +#endif /*SOUND_EMU8K_H*/ diff --git a/src/include/86box/snd_mpu401.h b/src/include/86box/snd_mpu401.h index 433bf09a1..736380aa3 100644 --- a/src/include/86box/snd_mpu401.h +++ b/src/include/86box/snd_mpu401.h @@ -19,6 +19,7 @@ * Copyright 2016-2020 Miran Grca. * Copyright 2016-2020 TheCollector1995. */ + #ifndef SOUND_MPU401_H # define SOUND_MPU401_H @@ -163,5 +164,4 @@ extern void mpu401_irq_attach(mpu_t *mpu, void (*ext_irq_update)(void *priv, int extern int MPU401_InputSysex(void *p, uint8_t *buffer, uint32_t len, int abort); extern void MPU401_InputMsg(void *p, uint8_t *msg, uint32_t len); - #endif /*SOUND_MPU401_H*/ diff --git a/src/include/86box/snd_opl.h b/src/include/86box/snd_opl.h index f6e533e4a..6145376ec 100644 --- a/src/include/86box/snd_opl.h +++ b/src/include/86box/snd_opl.h @@ -17,7 +17,6 @@ #ifndef SOUND_OPL_H # define SOUND_OPL_H - typedef void (*tmrfunc)(void *priv, int timer, uint64_t period); /* Define an OPLx chip. */ @@ -53,5 +52,4 @@ extern void opl3_write(uint16_t port, uint8_t val, void *); extern void opl3_init(opl_t *); extern void opl3_update(opl_t *); - #endif /*SOUND_OPL_H*/ diff --git a/src/include/86box/snd_opl_nuked.h b/src/include/86box/snd_opl_nuked.h index ff2e1db30..827b52fc2 100644 --- a/src/include/86box/snd_opl_nuked.h +++ b/src/include/86box/snd_opl_nuked.h @@ -16,6 +16,7 @@ * Copyright 2017-2020 Fred N. van Kempen. * Copyright 2016-2019 Miran Grca. */ + #ifndef SOUND_OPL_NUKED_H # define SOUND_OPL_NUKED_H @@ -31,5 +32,4 @@ extern void nuked_generate(void *, int32_t *buf); extern void nuked_generate_resampled(void *, int32_t *buf); extern void nuked_generate_stream(void *, int32_t *sndptr, uint32_t num); - #endif /*SOUND_OPL_NUKED_H*/ diff --git a/src/include/86box/snd_resid.h b/src/include/86box/snd_resid.h index 402ee0ceb..0a8b2edcd 100644 --- a/src/include/86box/snd_resid.h +++ b/src/include/86box/snd_resid.h @@ -1,3 +1,6 @@ +#ifndef SOUND_RESID_H +# define SOUND_RESID_H + #ifdef __cplusplus extern "C" { #endif @@ -10,3 +13,5 @@ extern "C" { #ifdef __cplusplus } #endif + +#endif /*SOUND_RESID_H*/ diff --git a/src/include/86box/snd_sb_dsp.h b/src/include/86box/snd_sb_dsp.h index 067e05b3e..740d05ca0 100644 --- a/src/include/86box/snd_sb_dsp.h +++ b/src/include/86box/snd_sb_dsp.h @@ -1,5 +1,5 @@ #ifndef SOUND_SND_SB_DSP_H -#define SOUND_SND_SB_DSP_H +# define SOUND_SND_SB_DSP_H /*Sound Blaster Clones, for quirks*/ #define SB_SUBTYPE_DEFAULT 0 /*Handle as a Creative card*/ @@ -125,4 +125,4 @@ void sb_dsp_set_stereo(sb_dsp_t *dsp, int stereo); void sb_dsp_update(sb_dsp_t *dsp); void sb_update_mask(sb_dsp_t *dsp, int irqm8, int irqm16, int irqm401); -#endif /* SOUND_SND_SB_DSP_H */ \ No newline at end of file +#endif /* SOUND_SND_SB_DSP_H */ diff --git a/src/include/86box/snd_sn76489.h b/src/include/86box/snd_sn76489.h index 01d19e0e5..a21dce5d4 100644 --- a/src/include/86box/snd_sn76489.h +++ b/src/include/86box/snd_sn76489.h @@ -1,3 +1,6 @@ +#ifndef SOUND_SN76489_H +# define SOUND_SN76489_H + enum { SN76496, @@ -31,3 +34,5 @@ typedef struct sn76489_t void sn76489_init(sn76489_t *sn76489, uint16_t base, uint16_t size, int type, int freq); void sn74689_set_extra_divide(sn76489_t *sn76489, int enable); + +#endif /*SOUND_SN76489_H*/ diff --git a/src/include/86box/snd_speaker.h b/src/include/86box/snd_speaker.h index 91e3edfe3..534696208 100644 --- a/src/include/86box/snd_speaker.h +++ b/src/include/86box/snd_speaker.h @@ -16,6 +16,10 @@ * Copyright 2008-2019 Sarah Walker. * Copyright 2016-2019 Miran Grca. */ + +#ifndef SOUND_SPEAKER_H +# define SOUND_SPEAKER_H + extern int speaker_mute; extern int speaker_gated; @@ -26,3 +30,5 @@ extern void speaker_init(); extern void speaker_set_count(uint8_t new_m, int new_count); extern void speaker_update(void); + +#endif /*SOUND_SPEAKER_H*/ diff --git a/src/include/86box/snd_ym7128.h b/src/include/86box/snd_ym7128.h index f71aa2f86..c3dbe5559 100644 --- a/src/include/86box/snd_ym7128.h +++ b/src/include/86box/snd_ym7128.h @@ -1,3 +1,6 @@ +#ifndef SOUND_YM7128_H +# define SOUND_YM7128_H + typedef struct ym7128_t { int a0, sci; @@ -23,3 +26,5 @@ typedef struct ym7128_t void ym7128_init(ym7128_t *ym7128); void ym7128_write(ym7128_t *ym7128, uint8_t val); void ym7128_apply(ym7128_t *ym7128, int16_t *buffer, int len); + +#endif /*SOUND_YM7128_H*/ diff --git a/src/include/86box/spd.h b/src/include/86box/spd.h index 0e17d0da3..76a336d8b 100644 --- a/src/include/86box/spd.h +++ b/src/include/86box/spd.h @@ -14,10 +14,10 @@ * * Copyright 2020 RichardG. */ + #ifndef EMU_SPD_H # define EMU_SPD_H - #define SPD_BASE_ADDR 0x50 #define SPD_MAX_SLOTS 8 #define SPD_DATA_SIZE 256 @@ -110,5 +110,4 @@ extern void spd_write_drbs_with_ext(uint8_t *regs, uint8_t reg_min, uint8_t reg_ extern void spd_write_drbs_interleaved(uint8_t *regs, uint8_t reg_min, uint8_t reg_max, uint8_t drb_unit); extern void spd_write_drbs_ali1621(uint8_t *regs, uint8_t reg_min, uint8_t reg_max); - #endif /*EMU_SPD_H*/ diff --git a/src/include/86box/ui.h b/src/include/86box/ui.h index 61e251eeb..6d3946d1c 100644 --- a/src/include/86box/ui.h +++ b/src/include/86box/ui.h @@ -19,7 +19,6 @@ #ifndef EMU_UI_H # define EMU_UI_H - #ifdef __cplusplus extern "C" { #endif @@ -80,5 +79,4 @@ extern void ui_sb_mt32lcd(char *str); } #endif - #endif /*EMU_UI_H*/ diff --git a/src/include/86box/unix_sdl.h b/src/include/86box/unix_sdl.h index 7019f0b85..24214ec31 100644 --- a/src/include/86box/unix_sdl.h +++ b/src/include/86box/unix_sdl.h @@ -1,5 +1,6 @@ #ifndef _UNIX_SDL_H -#define _UNIX_SDL_H +# define _UNIX_SDL_H + extern void sdl_close(void); extern int sdl_inits(); extern int sdl_inith(); @@ -9,4 +10,5 @@ extern void sdl_resize(int x, int y); extern void sdl_enable(int enable); extern void sdl_set_fs(int fs); extern void sdl_reload(void); -#endif \ No newline at end of file + +#endif /*_UNIX_SDL_H*/ diff --git a/src/include/86box/usb.h b/src/include/86box/usb.h index 375fc89e7..68c1fc88a 100644 --- a/src/include/86box/usb.h +++ b/src/include/86box/usb.h @@ -14,6 +14,7 @@ * * Copyright 2020 Miran Grca. */ + #ifndef USB_H # define USB_H @@ -44,5 +45,4 @@ extern void ohci_update_mem_mapping(usb_t *dev, uint8_t base1, uint8_t base2, u } #endif - #endif /*USB_H*/ diff --git a/src/include/86box/vid_ati_eeprom.h b/src/include/86box/vid_ati_eeprom.h index 24e0bff96..cb501cc87 100644 --- a/src/include/86box/vid_ati_eeprom.h +++ b/src/include/86box/vid_ati_eeprom.h @@ -1,3 +1,6 @@ +#ifndef VIDEO_ATI_EEPROM_H +# define VIDEO_ATI_EEPROM_H + /* Copyright holders: Sarah Walker see COPYING for more details */ @@ -47,3 +50,5 @@ typedef struct ati_eeprom_t void ati_eeprom_load(ati_eeprom_t *eeprom, char *fn, int type); void ati_eeprom_write(ati_eeprom_t *eeprom, int ena, int clk, int dat); int ati_eeprom_read(ati_eeprom_t *eeprom); + +#endif /*VIDEO_ATI_EEPROM_H*/ diff --git a/src/include/86box/vid_cga.h b/src/include/86box/vid_cga.h index c8b1cca8c..6194cb9f6 100644 --- a/src/include/86box/vid_cga.h +++ b/src/include/86box/vid_cga.h @@ -15,6 +15,7 @@ * Copyright 2008-2018 Sarah Walker. * Copyright 2016-2018 Miran Grca. */ + #ifndef VIDEO_CGA_H # define VIDEO_CGA_H diff --git a/src/include/86box/vid_cga_comp.h b/src/include/86box/vid_cga_comp.h index 6b1dc4062..b221e96a4 100644 --- a/src/include/86box/vid_cga_comp.h +++ b/src/include/86box/vid_cga_comp.h @@ -16,6 +16,7 @@ * Copyright 2015-2018 reenigne. * Copyright 2015-2018 Miran Grca. */ + #ifndef VIDEO_CGA_COMP_H # define VIDEO_CGA_COMP_H diff --git a/src/include/86box/vid_colorplus.h b/src/include/86box/vid_colorplus.h index 07a96ff4f..8466a3e43 100644 --- a/src/include/86box/vid_colorplus.h +++ b/src/include/86box/vid_colorplus.h @@ -1,3 +1,6 @@ +#ifndef VIDEO_COLORPLUS_H +# define VIDEO_COLORPLUS_H + typedef struct colorplus_t { cga_t cga; @@ -13,3 +16,5 @@ void colorplus_recalctimings(colorplus_t *colorplus); void colorplus_poll(void *p); extern const device_t colorplus_device; + +#endif /*VIDEO_COLORPLUS_H*/ diff --git a/src/include/86box/vid_ddc.h b/src/include/86box/vid_ddc.h index 223861436..297ad65bf 100644 --- a/src/include/86box/vid_ddc.h +++ b/src/include/86box/vid_ddc.h @@ -16,6 +16,7 @@ * Copyright 2008-2020 Sarah Walker. * Copyright 2020 RichardG. */ + #ifndef EMU_VID_DDC_H # define EMU_VID_DDC_H diff --git a/src/include/86box/vid_ega.h b/src/include/86box/vid_ega.h index bc378704b..5c0cffd05 100644 --- a/src/include/86box/vid_ega.h +++ b/src/include/86box/vid_ega.h @@ -17,6 +17,7 @@ * Copyright 2008-2020 Sarah Walker. * Copyright 2016-2020 Miran Grca. */ + #ifndef VIDEO_EGA_H # define VIDEO_EGA_H @@ -129,5 +130,4 @@ void ega_render_4bpp_lowres(ega_t *ega); void ega_render_4bpp_highres(ega_t *ega); #endif - #endif /*VIDEO_EGA_H*/ diff --git a/src/include/86box/vid_hercules.h b/src/include/86box/vid_hercules.h index 8d44fdfe1..f97a8fa18 100644 --- a/src/include/86box/vid_hercules.h +++ b/src/include/86box/vid_hercules.h @@ -16,6 +16,7 @@ * Copyright 2016-2019 Miran Grca. * Copyright 2021 Jasmine Iwanek. */ + #ifndef VIDEO_HERCULES_H # define VIDEO_HERCULES_H diff --git a/src/include/86box/vid_mda.h b/src/include/86box/vid_mda.h index 82a8f5e19..21a5cc3ae 100644 --- a/src/include/86box/vid_mda.h +++ b/src/include/86box/vid_mda.h @@ -1,6 +1,10 @@ /* Copyright holders: Sarah Walker see COPYING for more details */ + +#ifndef VIDEO_MDA_H +# define VIDEO_MDA_H + typedef struct mda_t { mem_mapping_t mapping; @@ -38,3 +42,5 @@ void mda_poll(void *p); #ifdef EMU_DEVICE_H extern const device_t mda_device; #endif + +#endif /*VIDEO_MDA_H*/ diff --git a/src/include/86box/vid_nga.h b/src/include/86box/vid_nga.h index 1c8bd786e..3f32e9374 100644 --- a/src/include/86box/vid_nga.h +++ b/src/include/86box/vid_nga.h @@ -22,6 +22,9 @@ * Copyright 2020 EngiNerd. */ +#ifndef VIDEO_NGA_H +# define VIDEO_NGA_H + typedef struct nga_t { cga_t cga; /* unused in OGC, required for M19 video card structure idiom */ @@ -46,3 +49,5 @@ void nga_mdaattr_rebuild(); extern const device_config_t nga_config[]; extern const device_t nga_device; #endif + +#endif /*VIDEO_NGA_H*/ diff --git a/src/include/86box/vid_ogc.h b/src/include/86box/vid_ogc.h index 2fffa65c3..4630023f5 100644 --- a/src/include/86box/vid_ogc.h +++ b/src/include/86box/vid_ogc.h @@ -22,6 +22,9 @@ * Copyright 2020 EngiNerd. */ +#ifndef VIDEO_OGC_H +# define VIDEO_OGC_H + typedef struct ogc_t { cga_t cga; /* unused in OGC, required for M19 video card structure idiom */ @@ -46,3 +49,5 @@ void ogc_mdaattr_rebuild(); extern const device_config_t ogc_config[]; extern const device_t ogc_device; #endif + +#endif /*VIDEO_OGC_H*/ diff --git a/src/include/86box/vid_pgc.h b/src/include/86box/vid_pgc.h index ecfc61c2b..5f707aa61 100644 --- a/src/include/86box/vid_pgc.h +++ b/src/include/86box/vid_pgc.h @@ -19,7 +19,6 @@ #ifndef VID_PGC_H # define VID_PGC_H - #define PGC_ERROR_RANGE 0x01 #define PGC_ERROR_INTEGER 0x02 #define PGC_ERROR_MEMORY 0x03 @@ -181,5 +180,4 @@ extern int pgc_result_coord(pgc_t *, int32_t val); extern void pgc_hndl_lut8(pgc_t *); extern void pgc_hndl_lut8rd(pgc_t *); - #endif /*VID_PGC_H*/ diff --git a/src/include/86box/vid_pgc_palette.h b/src/include/86box/vid_pgc_palette.h index ccc9ac2bd..8f2a96a5a 100644 --- a/src/include/86box/vid_pgc_palette.h +++ b/src/include/86box/vid_pgc_palette.h @@ -16,6 +16,7 @@ * Copyright 2019 Fred N. van Kempen. * Copyright 2019 John Elliott. */ + #ifndef VID_PGC_PALETTE_H # define VID_PGC_PALETTE_H @@ -1575,5 +1576,4 @@ makecol(0x00,0x00,0x00), }, - #endif /*VID_PGC_PALETTE_H*/ diff --git a/src/include/86box/vid_svga.h b/src/include/86box/vid_svga.h index 348677477..79d8d6b22 100644 --- a/src/include/86box/vid_svga.h +++ b/src/include/86box/vid_svga.h @@ -16,10 +16,10 @@ * Copyright 2008-2020 Sarah Walker. * Copyright 2016-2020 Miran Grca. */ + #ifndef VIDEO_SVGA_H # define VIDEO_SVGA_H - #define FLAG_EXTRA_BANKS 1 #define FLAG_ADDR_BY8 2 #define FLAG_EXT_WRITE 4 diff --git a/src/include/86box/vid_svga_render.h b/src/include/86box/vid_svga_render.h index 1bae05385..e480e81f7 100644 --- a/src/include/86box/vid_svga_render.h +++ b/src/include/86box/vid_svga_render.h @@ -16,6 +16,9 @@ * Copyright 2016-2018 Miran Grca. */ +#ifndef VIDEO_SVGA_RENDER_H +# define VIDEO_SVGA_RENDER_H + extern int firstline_draw, lastline_draw; extern int displine; extern int sc; @@ -66,3 +69,5 @@ void svga_render_RGBA8888_lowres(svga_t *svga); void svga_render_RGBA8888_highres(svga_t *svga); extern void (*svga_render)(svga_t *svga); + +#endif /*VID_SVGA_RENDER_H*/ diff --git a/src/include/86box/vid_svga_render_remap.h b/src/include/86box/vid_svga_render_remap.h index 5b7f0fe18..19e8607ae 100644 --- a/src/include/86box/vid_svga_render_remap.h +++ b/src/include/86box/vid_svga_render_remap.h @@ -6,6 +6,9 @@ row 1 -> MA14 */ +#ifndef VIDEO_SVGA_RENDER_REMAP_H +# define VIDEO_SVGA_RENDER_REMAP_H + //S3 - enhanced mode mappings CR31.3 can force doubleword mode //Cirrus Logic handles SVGA writes seperately //S3, CL, TGUI blitters need checking @@ -124,3 +127,5 @@ void svga_recalc_remap_func(svga_t *svga) svga->remap_required = (func_nr != 0); svga->remap_func = address_remap_funcs[func_nr]; } + +#endif /*VIDEO_RENDER_REMAP_H*/ diff --git a/src/include/86box/vid_vga.h b/src/include/86box/vid_vga.h index c8a9b132e..0bfa482f4 100644 --- a/src/include/86box/vid_vga.h +++ b/src/include/86box/vid_vga.h @@ -16,6 +16,7 @@ * Copyright 2016-2018 Miran Grca. * Copyright 2021 Jasmine Iwanek. */ + #ifndef VIDEO_VGA_H # define VIDEO_VGA_H diff --git a/src/include/86box/vid_voodoo_banshee.h b/src/include/86box/vid_voodoo_banshee.h index 808c861c8..b56caac88 100644 --- a/src/include/86box/vid_voodoo_banshee.h +++ b/src/include/86box/vid_voodoo_banshee.h @@ -15,4 +15,9 @@ * Copyright 2008-2020 Sarah Walker. */ +#ifndef VIDEO_VOODOO_BANSHEE_H +# define VIDEO_VOODOO_BANSHEE_H + void banshee_set_overlay_addr(void *p, uint32_t addr); + +#endif /*VIDEO_VOODOO_BANSHEE_H*/ diff --git a/src/include/86box/vid_voodoo_banshee_blitter.h b/src/include/86box/vid_voodoo_banshee_blitter.h index 3d8c16a1b..ad4d68218 100644 --- a/src/include/86box/vid_voodoo_banshee_blitter.h +++ b/src/include/86box/vid_voodoo_banshee_blitter.h @@ -15,4 +15,9 @@ * Copyright 2008-2020 Sarah Walker. */ +#ifndef VIDEO_VOODOO_BANSHEE_BLITTER_H +# define VIDEO_VOODOO_BANSHEE_BLITTER_H + void voodoo_2d_reg_writel(voodoo_t *voodoo, uint32_t addr, uint32_t val); + +#endif /*VIDEO_VOODOO_BANSHEE_BLITTER_H*/ diff --git a/src/include/86box/vid_voodoo_blitter.h b/src/include/86box/vid_voodoo_blitter.h index 63bd0a99e..20d845874 100644 --- a/src/include/86box/vid_voodoo_blitter.h +++ b/src/include/86box/vid_voodoo_blitter.h @@ -15,6 +15,11 @@ * Copyright 2008-2020 Sarah Walker. */ +#ifndef VIDEO_VOODOO_BLITTER_H +# define VIDEO_VOODOO_BLITTER_H + void voodoo_v2_blit_start(voodoo_t *voodoo); void voodoo_v2_blit_data(voodoo_t *voodoo, uint32_t data); void voodoo_fastfill(voodoo_t *voodoo, voodoo_params_t *params); + +#endif /*VIDEO_VOODOO_BLITTER_H*/ diff --git a/src/include/86box/vid_voodoo_codegen_x86-64.h b/src/include/86box/vid_voodoo_codegen_x86-64.h index 443edc2cd..b0a8a4b8f 100644 --- a/src/include/86box/vid_voodoo_codegen_x86-64.h +++ b/src/include/86box/vid_voodoo_codegen_x86-64.h @@ -5,6 +5,9 @@ fbzColorPath */ +#ifndef VIDEO_VOODOO_CODEGEN_X86_64_H +# define VIDEO_VOODOO_CODEGEN_X86_64_H + #ifdef _MSC_VER #include #else @@ -3450,3 +3453,5 @@ void voodoo_codegen_close(voodoo_t *voodoo) { plat_munmap(voodoo->codegen_data, sizeof(voodoo_x86_data_t) * BLOCK_NUM*4); } + +#endif /*VIDEO_VOODOO_CODEGEN_X86_64_H*/ diff --git a/src/include/86box/vid_voodoo_codegen_x86.h b/src/include/86box/vid_voodoo_codegen_x86.h index b6d60e5ff..0ec324c3f 100644 --- a/src/include/86box/vid_voodoo_codegen_x86.h +++ b/src/include/86box/vid_voodoo_codegen_x86.h @@ -5,6 +5,9 @@ fbzColorPath */ +#ifndef VIDEO_VOODOO_CODEGEN_X86_H +# define VIDEO_VOODOO_CODEGEN_X86_H + #ifdef _MSC_VER #include #else @@ -3390,3 +3393,5 @@ void voodoo_codegen_close(voodoo_t *voodoo) { plat_munmap(voodoo->codegen_data, sizeof(voodoo_x86_data_t) * BLOCK_NUM*4); } + +#endif /*VIDEO_VOODOO_CODEGEN_X86_H*/ diff --git a/src/include/86box/vid_voodoo_common.h b/src/include/86box/vid_voodoo_common.h index 8000f30c9..fdb0e8a75 100644 --- a/src/include/86box/vid_voodoo_common.h +++ b/src/include/86box/vid_voodoo_common.h @@ -16,6 +16,9 @@ * Copyright 2008-2020 Sarah Walker. */ +#ifndef VIDEO_VOODOO_COMMON_H +# define VIDEO_VOODOO_COMMON_H + #ifdef CLAMP #undef CLAMP #endif @@ -528,3 +531,5 @@ void voodoo_update_ncc(voodoo_t *voodoo, int tmu); void *voodoo_2d3d_card_init(int type); void voodoo_card_close(voodoo_t *voodoo); + +#endif /*VIDEO_VOODOO_COMMON_H*/ diff --git a/src/include/86box/vid_voodoo_display.h b/src/include/86box/vid_voodoo_display.h index 4768a2b62..522584e3f 100644 --- a/src/include/86box/vid_voodoo_display.h +++ b/src/include/86box/vid_voodoo_display.h @@ -16,9 +16,14 @@ * Copyright 2008-2020 Sarah Walker. */ +#ifndef VIDEO_VOODOO_DISPLAY_H +# define VIDEO_VOODOO_DISPLAY_H + void voodoo_update_ncc(voodoo_t *voodoo, int tmu); void voodoo_pixelclock_update(voodoo_t *voodoo); void voodoo_generate_filter_v1(voodoo_t *voodoo); void voodoo_generate_filter_v2(voodoo_t *voodoo); void voodoo_threshold_check(voodoo_t *voodoo); void voodoo_callback(void *p); + +#endif /*VIDEO_VOODOO_DISPLAY_H*/ diff --git a/src/include/86box/vid_voodoo_dither.h b/src/include/86box/vid_voodoo_dither.h index 6457ac8c6..1b95e7e80 100644 --- a/src/include/86box/vid_voodoo_dither.h +++ b/src/include/86box/vid_voodoo_dither.h @@ -16,6 +16,9 @@ * Copyright 2008-2020 Sarah Walker. */ +#ifndef VIDEO_VOODOO_DITHER_H +# define VIDEO_VOODOO_DITHER_H + static const uint8_t dither_rb[256][4][4] = { { @@ -10288,3 +10291,5 @@ static const uint8_t dithersub_rb2x2[256][2][2] = {253, 255}, }, }; + +#endif /* VIDEO_VOODOO_DITHER_H*/ diff --git a/src/include/86box/vid_voodoo_fb.h b/src/include/86box/vid_voodoo_fb.h index 95a223324..6acf624aa 100644 --- a/src/include/86box/vid_voodoo_fb.h +++ b/src/include/86box/vid_voodoo_fb.h @@ -16,7 +16,12 @@ * Copyright 2008-2020 Sarah Walker. */ +#ifndef VIDEO_VOODOO_FB_H +# define VIDEO_VOODOO_FB_H + uint16_t voodoo_fb_readw(uint32_t addr, void *p); uint32_t voodoo_fb_readl(uint32_t addr, void *p); void voodoo_fb_writew(uint32_t addr, uint16_t val, void *p); void voodoo_fb_writel(uint32_t addr, uint32_t val, void *p); + +#endif /*VIDEO_VOODOO_FB_H*/ diff --git a/src/include/86box/vid_voodoo_fifo.h b/src/include/86box/vid_voodoo_fifo.h index 0ba2f6920..54b6567e8 100644 --- a/src/include/86box/vid_voodoo_fifo.h +++ b/src/include/86box/vid_voodoo_fifo.h @@ -16,6 +16,9 @@ * Copyright 2008-2020 Sarah Walker. */ +#ifndef VIDEO_VOODOO_FIFO_H +# define VIDEO_VOODOO_FIFO_H + void voodoo_wake_fifo_thread(voodoo_t *voodoo); void voodoo_wake_fifo_thread_now(voodoo_t *voodoo); void voodoo_wake_timer(void *p); @@ -24,3 +27,5 @@ void voodoo_flush(voodoo_t *voodoo); void voodoo_wake_fifo_threads(voodoo_set_t *set, voodoo_t *voodoo); void voodoo_wait_for_swap_complete(voodoo_t *voodoo); void voodoo_fifo_thread(void *param); + +#endif /*VIDEO_VOODOO_FIFO_H*/ diff --git a/src/include/86box/vid_voodoo_reg.h b/src/include/86box/vid_voodoo_reg.h index 49fac4877..c535c7a18 100644 --- a/src/include/86box/vid_voodoo_reg.h +++ b/src/include/86box/vid_voodoo_reg.h @@ -16,4 +16,9 @@ * Copyright 2008-2020 Sarah Walker. */ +#ifndef VIDEO_VOODOO_REG_H +# define VIDEO_VOODOO_REG_H + void voodoo_reg_writel(uint32_t addr, uint32_t val, void *p); + +#endif /*VIDEO_VOODOO_REG_H*/ diff --git a/src/include/86box/vid_voodoo_regs.h b/src/include/86box/vid_voodoo_regs.h index dfb924acf..67b0c8f3f 100644 --- a/src/include/86box/vid_voodoo_regs.h +++ b/src/include/86box/vid_voodoo_regs.h @@ -1,3 +1,6 @@ +#ifndef VIDEO_VOODOO_REGS_H +# define VIDEO_VOODOO_REGS_H + enum { SST_status = 0x000, @@ -690,4 +693,6 @@ enum #define depth_op ( (params->fbzMode >> 5) & 7) #define dither ( params->fbzMode & FBZ_DITHER) #define dither2x2 (params->fbzMode & FBZ_DITHER_2x2) -#define dithersub (params->fbzMode & FBZ_DITHER_SUB) \ No newline at end of file +#define dithersub (params->fbzMode & FBZ_DITHER_SUB) + +#endif /*VIDEO_VOODOO_REGS_H*/ diff --git a/src/include/86box/vid_voodoo_render.h b/src/include/86box/vid_voodoo_render.h index 4596c59bb..5fb10d231 100644 --- a/src/include/86box/vid_voodoo_render.h +++ b/src/include/86box/vid_voodoo_render.h @@ -1,3 +1,6 @@ +#ifndef VIDEO_VOODOO_RENDER_H +# define VIDEO_VOODOO_RENDER_H + #if !(defined i386 || defined __i386 || defined __i386__ || defined _X86_ || defined _M_IX86 || defined __amd64__ || defined _M_X64) #define NO_CODEGEN #endif @@ -336,3 +339,5 @@ static __inline void voodoo_wait_for_render_thread_idle(voodoo_t *voodoo) thread_wait_event(voodoo->render_not_full_event[3], 1); } } + +#endif /*VIDEO_VOODOO_RENDER_H*/ diff --git a/src/include/86box/vid_voodoo_setup.h b/src/include/86box/vid_voodoo_setup.h index 19056dd6b..047118701 100644 --- a/src/include/86box/vid_voodoo_setup.h +++ b/src/include/86box/vid_voodoo_setup.h @@ -15,4 +15,10 @@ * * Copyright 2008-2020 Sarah Walker. */ + +#ifndef VIDEO_VOODOO_SETUP_H +# define VIDEO_VOODOO_SETUP_H + void voodoo_triangle_setup(voodoo_t *voodoo); + +#endif /*VIDEO_VOODOO_SETUP_H*/ diff --git a/src/include/86box/vid_voodoo_texture.h b/src/include/86box/vid_voodoo_texture.h index 40c2b739a..cc2b13201 100644 --- a/src/include/86box/vid_voodoo_texture.h +++ b/src/include/86box/vid_voodoo_texture.h @@ -15,6 +15,10 @@ * * Copyright 2008-2020 Sarah Walker. */ + +#ifndef VIDEO_VOODOO_TEXTURE_H +# define VIDEO_VOODOO_TEXTURE_H + static const uint32_t texture_offset[LOD_MAX+3] = { 0, @@ -34,3 +38,5 @@ void voodoo_recalc_tex(voodoo_t *voodoo, int tmu); void voodoo_use_texture(voodoo_t *voodoo, voodoo_params_t *params, int tmu); void voodoo_tex_writel(uint32_t addr, uint32_t val, void *p); void flush_texture_cache(voodoo_t *voodoo, uint32_t dirty_addr, int tmu); + +#endif /* VIDEO_VOODOO_TEXTURE_H*/ diff --git a/src/include/86box/video.h b/src/include/86box/video.h index 05b7055b3..349d8f7b2 100644 --- a/src/include/86box/video.h +++ b/src/include/86box/video.h @@ -18,6 +18,7 @@ * Copyright 2016-2019 Miran Grca. * Copyright 2017-2019 Fred N. van Kempen. */ + #ifndef EMU_VIDEO_H # define EMU_VIDEO_H @@ -445,5 +446,4 @@ extern const device_t wy700_device; extern const device_t agpgart_device; #endif - #endif /*EMU_VIDEO_H*/ diff --git a/src/include/86box/vnc.h b/src/include/86box/vnc.h index 2d3dea3cd..1e0ddebba 100644 --- a/src/include/86box/vnc.h +++ b/src/include/86box/vnc.h @@ -14,6 +14,7 @@ * * Copyright 2017 Fred N. van Kempen. */ + #ifndef EMU_VNC_H # define EMU_VNC_H @@ -35,5 +36,4 @@ extern void vnc_take_screenshot(wchar_t *fn); } #endif - #endif /*EMU_VNC_H*/ diff --git a/src/include/86box/win.h b/src/include/86box/win.h index 4fb6a7d00..5e9f67b36 100644 --- a/src/include/86box/win.h +++ b/src/include/86box/win.h @@ -19,6 +19,7 @@ * Copyright 2017-2019 Fred N. van Kempen. * Copyright 2021 Laci bá' */ + #ifndef PLAT_WIN_H # define PLAT_WIN_H @@ -256,5 +257,4 @@ extern void ResetAllMenus(); } #endif - #endif /*PLAT_WIN_H*/ diff --git a/src/include/86box/win_opengl.h b/src/include/86box/win_opengl.h index 9e78c0aed..e05e99eb4 100644 --- a/src/include/86box/win_opengl.h +++ b/src/include/86box/win_opengl.h @@ -12,6 +12,7 @@ * * Copyright 2021 Teemu Korhonen */ + #ifndef WIN_OPENGL_H #define WIN_OPENGL_H @@ -25,4 +26,4 @@ extern void opengl_set_fs(int fs); extern void opengl_resize(int w, int h); extern void opengl_reload(void); -#endif /*!WIN_OPENGL_H*/ \ No newline at end of file +#endif /*!WIN_OPENGL_H*/ diff --git a/src/include/86box/win_opengl_glslp.h b/src/include/86box/win_opengl_glslp.h index dcc098635..9faf20705 100644 --- a/src/include/86box/win_opengl_glslp.h +++ b/src/include/86box/win_opengl_glslp.h @@ -12,6 +12,7 @@ * * Copyright 2021 Teemu Korhonen */ + #ifndef WIN_OPENGL_GLSLP_H #define WIN_OPENGL_GLSLP_H @@ -20,4 +21,4 @@ GLuint load_custom_shaders(const char* path); GLuint load_default_shaders(); -#endif /*!WIN_OPENGL_GLSLP_H*/ \ No newline at end of file +#endif /*!WIN_OPENGL_GLSLP_H*/ diff --git a/src/include/86box/win_sdl.h b/src/include/86box/win_sdl.h index aa082fe6c..bd510dbf1 100644 --- a/src/include/86box/win_sdl.h +++ b/src/include/86box/win_sdl.h @@ -46,6 +46,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + #ifndef WIN_SDL_H # define WIN_SDL_H diff --git a/src/include/86box/zip.h b/src/include/86box/zip.h index 4a7c05cbd..722d51d91 100644 --- a/src/include/86box/zip.h +++ b/src/include/86box/zip.h @@ -15,10 +15,10 @@ * * Copyright 2018,2019 Miran Grca. */ + #ifndef EMU_ZIP_H #define EMU_ZIP_H - #define ZIP_NUM 4 #define BUF_SIZE 32768 @@ -123,5 +123,4 @@ extern void zip_close(); } #endif - #endif /*EMU_ZIP_H*/