Some video related cleanups

This commit is contained in:
Jasmine Iwanek
2022-01-30 02:11:21 -05:00
parent a0c90097e4
commit 23b84127cd
7 changed files with 109 additions and 45 deletions

View File

@@ -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*/

View File

@@ -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*/

View File

@@ -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, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
* 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*/

View File

@@ -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*/

View File

@@ -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, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
* 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*/

View File

@@ -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};

View File

@@ -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};