2017-05-30 03:38:38 +02:00
|
|
|
/*
|
2023-01-06 15:36:05 -05:00
|
|
|
* 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.
|
2017-05-30 03:38:38 +02:00
|
|
|
*
|
2023-01-06 15:36:05 -05:00
|
|
|
* This file is part of the 86Box distribution.
|
2017-05-30 03:38:38 +02:00
|
|
|
*
|
2023-01-06 15:36:05 -05:00
|
|
|
* Emulation of the old and new IBM CGA graphics cards.
|
2017-05-30 03:38:38 +02:00
|
|
|
*
|
2020-03-25 00:46:02 +02:00
|
|
|
*
|
2017-05-30 03:38:38 +02:00
|
|
|
*
|
2023-01-06 15:36:29 -05:00
|
|
|
* Authors: Sarah Walker, <https://pcem-emulator.co.uk/>
|
2023-01-06 15:36:05 -05:00
|
|
|
* Miran Grca, <mgrca8@gmail.com>
|
|
|
|
|
*
|
|
|
|
|
* Copyright 2008-2018 Sarah Walker.
|
|
|
|
|
* Copyright 2016-2018 Miran Grca.
|
2017-05-30 03:38:38 +02:00
|
|
|
*/
|
2022-02-18 19:42:21 -05:00
|
|
|
|
2022-01-30 02:11:21 -05:00
|
|
|
#ifndef VIDEO_CGA_H
|
2022-07-27 17:00:34 -04:00
|
|
|
#define VIDEO_CGA_H
|
2017-05-30 03:38:38 +02:00
|
|
|
|
2022-07-27 17:00:34 -04:00
|
|
|
typedef struct cga_t {
|
|
|
|
|
mem_mapping_t mapping;
|
2022-02-20 02:26:27 -05:00
|
|
|
|
2022-07-27 17:00:34 -04:00
|
|
|
int crtcreg;
|
|
|
|
|
uint8_t crtc[32];
|
2022-02-20 02:26:27 -05:00
|
|
|
|
2022-07-27 17:00:34 -04:00
|
|
|
uint8_t cgastat;
|
2022-02-20 02:26:27 -05:00
|
|
|
|
2023-06-09 23:46:54 -04:00
|
|
|
uint8_t cgamode;
|
|
|
|
|
uint8_t cgacol;
|
2016-06-26 00:34:39 +02:00
|
|
|
|
2022-07-27 17:00:34 -04:00
|
|
|
int fontbase;
|
2023-06-09 23:46:54 -04:00
|
|
|
int linepos;
|
|
|
|
|
int displine;
|
|
|
|
|
int sc;
|
|
|
|
|
int vc;
|
2022-07-27 17:00:34 -04:00
|
|
|
int cgadispon;
|
2023-06-09 23:46:54 -04:00
|
|
|
int con;
|
|
|
|
|
int coff;
|
|
|
|
|
int cursoron;
|
|
|
|
|
int cgablink;
|
|
|
|
|
int vsynctime;
|
|
|
|
|
int vadj;
|
|
|
|
|
uint16_t ma;
|
|
|
|
|
uint16_t maback;
|
2022-07-27 17:00:34 -04:00
|
|
|
int oddeven;
|
2016-06-26 00:34:39 +02:00
|
|
|
|
2023-06-09 23:46:54 -04:00
|
|
|
uint64_t dispontime;
|
|
|
|
|
uint64_t dispofftime;
|
2022-07-27 17:00:34 -04:00
|
|
|
pc_timer_t timer;
|
2022-02-20 02:26:27 -05:00
|
|
|
|
2023-06-09 23:46:54 -04:00
|
|
|
int firstline;
|
|
|
|
|
int lastline;
|
2022-02-20 02:26:27 -05:00
|
|
|
|
2022-07-27 17:00:34 -04:00
|
|
|
int drawcursor;
|
2022-02-20 02:26:27 -05:00
|
|
|
|
2022-07-27 17:00:34 -04:00
|
|
|
int fullchange;
|
2022-07-03 01:07:13 +06:00
|
|
|
|
2022-07-27 17:00:34 -04:00
|
|
|
uint8_t *vram;
|
2022-02-20 02:26:27 -05:00
|
|
|
|
2022-07-27 17:00:34 -04:00
|
|
|
uint8_t charbuffer[256];
|
2016-07-09 02:18:45 +02:00
|
|
|
|
2022-07-27 17:00:34 -04:00
|
|
|
int revision;
|
|
|
|
|
int composite;
|
|
|
|
|
int snow_enabled;
|
|
|
|
|
int rgb_type;
|
2024-01-08 00:09:35 +01:00
|
|
|
int double_type;
|
2016-06-26 00:34:39 +02:00
|
|
|
} cga_t;
|
|
|
|
|
|
|
|
|
|
void cga_init(cga_t *cga);
|
2023-07-31 14:37:59 -04:00
|
|
|
void cga_out(uint16_t addr, uint8_t val, void *priv);
|
|
|
|
|
uint8_t cga_in(uint16_t addr, void *priv);
|
|
|
|
|
void cga_write(uint32_t addr, uint8_t val, void *priv);
|
|
|
|
|
uint8_t cga_read(uint32_t addr, void *priv);
|
2016-06-26 00:34:39 +02:00
|
|
|
void cga_recalctimings(cga_t *cga);
|
2023-07-31 14:37:59 -04:00
|
|
|
void cga_poll(void *priv);
|
2016-06-26 00:34:39 +02:00
|
|
|
|
2018-10-02 22:54:28 +02:00
|
|
|
#ifdef EMU_DEVICE_H
|
2018-03-19 01:02:04 +01:00
|
|
|
extern const device_config_t cga_config[];
|
2022-10-20 00:33:30 +02:00
|
|
|
|
2022-11-19 08:49:04 -05:00
|
|
|
extern const device_t cga_device;
|
|
|
|
|
extern const device_t cga_pravetz_device;
|
2018-10-02 22:54:28 +02:00
|
|
|
#endif
|
2022-01-30 02:11:21 -05:00
|
|
|
|
2022-07-27 17:00:34 -04:00
|
|
|
#endif /*VIDEO_CGA_H*/
|