diff --git a/src/include/86box/vid_cga.h b/src/include/86box/vid_cga.h index 708879fdd..c8b1cca8c 100644 --- a/src/include/86box/vid_cga.h +++ b/src/include/86box/vid_cga.h @@ -15,6 +15,8 @@ * Copyright 2008-2018 Sarah Walker. * Copyright 2016-2018 Miran Grca. */ +#ifndef VIDEO_CGA_H +# define VIDEO_CGA_H typedef struct cga_t { @@ -65,3 +67,5 @@ void cga_poll(void *p); extern const device_config_t cga_config[]; extern const device_t cga_device; #endif + +#endif /*VIDEO_CGA_H*/ diff --git a/src/include/86box/vid_cga_comp.h b/src/include/86box/vid_cga_comp.h index 5ce52e61a..6b1dc4062 100644 --- a/src/include/86box/vid_cga_comp.h +++ b/src/include/86box/vid_cga_comp.h @@ -16,6 +16,8 @@ * Copyright 2015-2018 reenigne. * Copyright 2015-2018 Miran Grca. */ +#ifndef VIDEO_CGA_COMP_H +# define VIDEO_CGA_COMP_H #define Bit8u uint8_t #define Bit32u uint32_t @@ -25,3 +27,5 @@ void update_cga16_color(uint8_t cgamode); void cga_comp_init(int revision); Bit32u * Composite_Process(uint8_t cgamode, Bit8u border, Bit32u blocks/*, bool doublewidth*/, Bit32u *TempLine); + +#endif /*VIDEO_CGA_COMP_H*/ diff --git a/src/include/86box/vid_hercules.h b/src/include/86box/vid_hercules.h new file mode 100644 index 000000000..8d44fdfe1 --- /dev/null +++ b/src/include/86box/vid_hercules.h @@ -0,0 +1,61 @@ +/* + * 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. + * + * Emulation of the Hercules graphics cards. + * + * + * + * Author: Sarah Walker, + * Miran Grca, + * Copyright 2008-2019 Sarah Walker. + * Copyright 2016-2019 Miran Grca. + * Copyright 2021 Jasmine Iwanek. + */ +#ifndef VIDEO_HERCULES_H +# define VIDEO_HERCULES_H + +typedef struct { + mem_mapping_t mapping; + + uint8_t crtc[32], charbuffer[4096]; + int crtcreg; + + uint8_t ctrl, + ctrl2, + stat; + + uint64_t dispontime, + dispofftime; + pc_timer_t timer; + + int firstline, + lastline; + + int linepos, + displine; + int vc, + sc; + uint16_t ma, + maback; + int con, coff, + cursoron; + int dispon, + blink; + int vsynctime; + int vadj; + + int lp_ff; + + int cols[256][2][2]; + + uint8_t *vram; +} hercules_t; + +static void *hercules_init(const device_t *info); + +#endif /*VIDEO_HERCULES_H*/ diff --git a/src/include/86box/vid_svga.h b/src/include/86box/vid_svga.h index 47bb84e0f..348677477 100644 --- a/src/include/86box/vid_svga.h +++ b/src/include/86box/vid_svga.h @@ -16,6 +16,8 @@ * Copyright 2008-2020 Sarah Walker. * Copyright 2016-2020 Miran Grca. */ +#ifndef VIDEO_SVGA_H +# define VIDEO_SVGA_H #define FLAG_EXTRA_BANKS 1 @@ -306,3 +308,5 @@ extern const device_t tseng_ics5301_ramdac_device; extern const device_t tseng_ics5341_ramdac_device; extern const device_t tvp3026_ramdac_device; #endif + +#endif /*VIDEO_SVGA_H*/ diff --git a/src/include/86box/vid_vga.h b/src/include/86box/vid_vga.h new file mode 100644 index 000000000..c8a9b132e --- /dev/null +++ b/src/include/86box/vid_vga.h @@ -0,0 +1,34 @@ +/* + * 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. + * + * Emulation of the IBM MDA + VGA graphics cards. + * + * + * + * Author: Sarah Walker, + * Miran Grca, + * Copyright 2008-2018 Sarah Walker. + * Copyright 2016-2018 Miran Grca. + * Copyright 2021 Jasmine Iwanek. + */ +#ifndef VIDEO_VGA_H +# define VIDEO_VGA_H + +typedef struct vga_t +{ + svga_t svga; + + rom_t bios_rom; +} vga_t; + +static video_timings_t timing_vga = {VIDEO_ISA, 8, 16, 32, 8, 16, 32}; + +void vga_out(uint16_t addr, uint8_t val, void *p); +uint8_t vga_in(uint16_t addr, void *p); + +#endif /*VIDEO_VGA_H*/ diff --git a/src/video/vid_hercules.c b/src/video/vid_hercules.c index 6c9660bb8..1dd60a3e4 100644 --- a/src/video/vid_hercules.c +++ b/src/video/vid_hercules.c @@ -31,45 +31,9 @@ #include <86box/pit.h> #include <86box/device.h> #include <86box/video.h> +#include <86box/vid_hercules.h> -typedef struct { - mem_mapping_t mapping; - - uint8_t crtc[32], charbuffer[4096]; - int crtcreg; - - uint8_t ctrl, - ctrl2, - stat; - - uint64_t dispontime, - dispofftime; - pc_timer_t timer; - - int firstline, - lastline; - - int linepos, - displine; - int vc, - sc; - uint16_t ma, - maback; - int con, coff, - cursoron; - int dispon, - blink; - int vsynctime; - int vadj; - - int lp_ff; - - int cols[256][2][2]; - - uint8_t *vram; -} hercules_t; - static video_timings_t timing_hercules = {VIDEO_ISA, 8, 16, 32, 8, 16, 32}; diff --git a/src/video/vid_vga.c b/src/video/vid_vga.c index 3c872705b..b9f18348b 100644 --- a/src/video/vid_vga.c +++ b/src/video/vid_vga.c @@ -29,16 +29,9 @@ #include <86box/timer.h> #include <86box/video.h> #include <86box/vid_svga.h> +#include <86box/vid_vga.h> -typedef struct vga_t -{ - svga_t svga; - - rom_t bios_rom; -} vga_t; - -static video_timings_t timing_vga = {VIDEO_ISA, 8, 16, 32, 8, 16, 32}; static video_timings_t timing_ps1_svga_isa = {VIDEO_ISA, 6, 8, 16, 6, 8, 16}; static video_timings_t timing_ps1_svga_mca = {VIDEO_MCA, 6, 8, 16, 6, 8, 16};