Revert "Merge branch 'bugfixes' into master"

This reverts commit 8250b57325, reversing
changes made to 6c643d05b8.
This commit is contained in:
Daniel Gurney
2025-07-01 03:04:14 +03:00
parent 8250b57325
commit aef9d1ed94
25 changed files with 616 additions and 412 deletions

View File

@@ -18,8 +18,6 @@
#ifndef VIDEO_8514A_H
#define VIDEO_8514A_H
#include <stdbool.h>
#define INT_VSY (1 << 0)
#define INT_GE_BSY (1 << 1)
#define INT_FIFO_OVR (1 << 2)
@@ -46,34 +44,39 @@ typedef enum {
MODE_MAX
} ibm8514_mode_t;
typedef struct ibm8514_hwcursor_s {
int enable;
typedef struct hwcursor8514_t {
int ena;
int x;
int y;
int xoff;
int yoff;
int cur_xsize;
int cur_ysize;
int v_acc;
int h_acc;
uint32_t addr;
uint32_t pitch;
} ibm8514_hwcursor_t;
} hwcursor8514_t;
typedef union {
uint64_t q;
uint32_t d[2];
uint16_t w[4];
uint8_t b[8];
} ibm8514_latch_t;
} latch8514_t;
typedef struct ibm8514_t {
rom_t bios_rom;
rom_t bios_rom2;
mem_mapping_t bios_mapping;
ibm8514_hwcursor_t hwcursor;
ibm8514_hwcursor_t hwcursor_latch;
uint8_t *rom1;
uint8_t *rom2;
hwcursor8514_t hwcursor;
hwcursor8514_t hwcursor_latch;
uint8_t pos_regs[8];
char *rom_path;
int force_old_addr;
int type;
ibm8514_card_type local;
int bpp;
@@ -96,14 +99,18 @@ typedef struct ibm8514_t {
int dac_r;
int dac_g;
int dac_b;
int internal_pitch;
int hwcursor_on;
int modechange;
uint64_t dispontime;
uint64_t dispofftime;
struct {
uint16_t subsys_cntl;
uint16_t setup_md;
uint16_t advfunc_cntl;
uint16_t advfunc_cntl_old;
uint16_t cur_y;
uint16_t cur_x;
int16_t destx;
@@ -131,51 +138,84 @@ typedef struct ibm8514_t {
uint16_t clip_bottom;
int16_t clip_left;
int16_t clip_top;
uint8_t pix_trans[2];
int poly_draw;
int ssv_state;
int x1;
int x2;
int x3;
int y1;
int y2;
int temp_cnt;
int16_t dx_ibm;
int16_t dy_ibm;
int16_t cx;
int16_t cx_back;
int16_t cy;
/* oldcx was not used! */
int16_t oldcx;
int16_t oldcy;
int16_t sx;
int16_t sy;
int16_t dx;
int16_t dy;
int16_t err;
uint32_t src;
uint32_t dest;
int x_count;
/* y_count not used */
int xx_count;
int y_count;
int input;
int input2;
int output;
int output2;
int ssv_len;
int ssv_len_back;
uint8_t ssv_dir;
uint8_t ssv_draw;
int odd_in;
int odd_out;
uint16_t scratch;
int fill_state;
int xdir;
int ydir;
int linedraw;
uint32_t ge_offset;
uint32_t src_ge_offset;
uint32_t dst_ge_offset;
uint16_t src_pitch;
uint16_t dst_pitch;
int64_t cur_x_24bpp;
int64_t cur_y_24bpp;
int64_t dest_x_24bpp;
int64_t dest_y_24bpp;
} accel;
uint16_t test;
int h_blankstart;
int h_blank_end_val;
int hblankstart;
int hblank_end_val;
int hblankend;
int vtotal_reg;
int vtotal_8514;
int hblank_ext;
int hblank_sub;
int v_total_reg;
int v_total;
int dispend;
int vsyncstart;
int v_sync_start;
int v_syncstart;
int split;
int hdisp_8514;
int htotal_8514;
int h_disp;
int h_total;
int h_sync_start;
int h_sync_width;
int h_disp_time;
int rowoffset;
int dispon;
int hdispon;
int hdisp_on;
int linecountff;
int vc;
int linepos;
int oddeven;
@@ -196,27 +236,34 @@ typedef struct ibm8514_t {
uint8_t linedbl;
uint8_t data_available;
uint8_t data_available2;
uint8_t rowcount;
int hsync_start;
int hsync_width;
int htotal;
int hdisp_vga;
int hdisp;
int hdisp2;
int hdisped;
int scanline;
int vsyncstart;
int vsyncwidth;
int vtotal;
int vdisp_8514;
int vdisp_vga;
int v_disp;
int v_disp2;
int vdisp;
int vdisp2;
int disp_cntl;
int interlace;
uint16_t subsys_cntl;
uint8_t subsys_stat;
atomic_int force_busy;
atomic_int force_busy2;
atomic_int fifo_idx;
int blitter_busy;
uint64_t blitter_time;
uint64_t status_time;
int pitch;
int ext_pitch;
int ext_crt_pitch;
@@ -224,15 +271,14 @@ typedef struct ibm8514_t {
ibm8514_mode_t mode;
int onboard;
int linear;
bool vram_is_512k;
uint32_t vram_amount;
int vram_512k_8514;
int vendor_mode;
int _8514on;
int _8514crt;
PALETTE _8514pal;
ibm8514_latch_t latch;
latch8514_t latch;
void (*vblank_start)(void *priv);
void (*accel_out_fifo)(void *priv, uint16_t port, uint16_t val, int len);

View File

@@ -49,7 +49,7 @@ typedef struct ati_eeprom_t {
void ati_eeprom_load(ati_eeprom_t *eeprom, char *fn, int type);
void ati_eeprom_load_mach8(ati_eeprom_t *eeprom, char *fn, int mca);
void ati_eeprom_load_mach8_vga(ati_eeprom_t *eeprom, char *fn);
void ati_eeprom_write(ati_eeprom_t *eeprom, int enable, int clk, int dat);
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*/

View File

@@ -13,18 +13,14 @@
*
* Authors: Sarah Walker, <https://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
* Connor Hyde / starfrost, <mario64crashed@gmail.com>
*
* Copyright 2008-2020 Sarah Walker.
* Copyright 2016-2020 Miran Grca.
* Copyright 2025 Connor Hyde.
*/
#ifndef VIDEO_EGA_H
#define VIDEO_EGA_H
#include <stdbool.h>
#if defined(EMU_MEM_H) && defined(EMU_ROM_H)
typedef struct ega_t {
mem_mapping_t mapping;
@@ -61,52 +57,65 @@ typedef struct ega_t {
uint16_t light_pen;
int32_t vidclock;
int32_t vres;
int32_t readmode;
int32_t writemode;
int32_t readplane;
int32_t vrammask;
int32_t chain4;
int32_t chain2_read;
int32_t chain2_write;
int32_t cursorvisible;
int32_t vc;
int32_t real_vc;
int32_t scanline;
int32_t dispon;
int32_t cursoron;
int32_t blink;
int32_t fullchange;
int32_t linepos;
int32_t vslines;
int32_t linecountff;
int32_t oddeven;
int32_t interlace;
int32_t linedbl;
int32_t rowcount;
int32_t vtotal;
int32_t dispend;
int32_t vsyncstart;
int32_t split;
int32_t hdisp;
int32_t htotal;
int32_t rowoffset;
int32_t vblankstart;
int32_t scrollcache;
int32_t firstline;
int32_t lastline;
int32_t firstline_draw;
int32_t lastline_draw;
int32_t x_add;
int32_t y_add;
int32_t displine;
int32_t index;
bool remap_required;
int32_t actual_type;
int32_t chipset;
int vidclock;
int fast;
int extvram;
int vres;
int readmode;
int writemode;
int readplane;
int vrammask;
int chain4;
int chain2_read;
int chain2_write;
int cursorvisible;
int oddeven_page;
int oddeven_chain;
int vc;
int real_vc;
int scanline;
int dispon;
int hdisp_on;
int cursoron;
int blink;
int fullchange;
int linepos;
int vslines;
int linecountff;
int oddeven;
int lowres;
int interlace;
int linedbl;
int lindebl;
int rowcount;
int vtotal;
int dispend;
int vsyncstart;
int split;
int hdisp;
int hdisp_old;
int htotal;
int hdisp_time;
int rowoffset;
int vblankstart;
int scrollcache;
int firstline;
int lastline;
int firstline_draw;
int lastline_draw;
int x_add;
int y_add;
int displine;
int res_x;
int res_y;
int bpp;
int index;
int remap_required;
int actual_type;
int chipset;
int mono_display;
int32_t mda_attr_to_color_table[256][2][2];
int mda_attr_to_color_table[256][2][2];
uint32_t charseta;
uint32_t charsetb;
@@ -155,7 +164,7 @@ extern const device_t jega_device;
extern const device_t jvga_device;
#endif
extern int32_t update_overscan;
extern int update_overscan;
#define DISPLAY_RGB 0
#define DISPLAY_COMPOSITE 1
@@ -165,7 +174,7 @@ extern int32_t update_overscan;
#define DISPLAY_WHITE 5
#if defined(EMU_MEM_H) && defined(EMU_ROM_H)
extern void ega_init(ega_t *ega, int32_t monitor_type, int32_t is_mono);
extern void ega_init(ega_t *ega, int monitor_type, int is_mono);
extern void ega_recalctimings(struct ega_t *ega);
extern void ega_recalc_remap_func(struct ega_t *ega);
#endif
@@ -177,18 +186,18 @@ extern void ega_write(uint32_t addr, uint8_t val, void *priv);
extern uint8_t ega_read(uint32_t addr, void *priv);
extern void ega_set_type(void *priv, uint32_t local);
extern int32_t firstline_draw;
extern int32_t lastline_draw;
extern int32_t displine;
extern int32_t scanline;
extern int firstline_draw;
extern int lastline_draw;
extern int displine;
extern int scanline;
extern uint32_t memaddr;
extern uint32_t cursoraddr;
extern int32_t cursorvisible;
extern int32_t cursoron;
extern int32_t cgablink;
extern int cursorvisible;
extern int cursoron;
extern int cgablink;
extern int32_t scrollcache;
extern int scrollcache;
extern uint8_t edatlookup[4][4];
extern uint8_t egaremap2bpp[256];

View File

@@ -34,7 +34,7 @@
struct monitor_t;
typedef struct hwcursor_t {
int enable;
int ena;
int x;
int y;
int xoff;
@@ -99,6 +99,7 @@ typedef struct svga_t {
int hdisp_time;
int rowoffset;
int dispon;
int hdisp_on;
int vc;
int scanline;
int linepos;

View File

@@ -20,7 +20,7 @@
#include <86box/rom.h>
typedef struct xga_hwcursor_t {
int enable;
int ena;
int x;
int y;
int xoff;
@@ -114,16 +114,18 @@ typedef struct xga_t {
int dac_pos;
int dac_r;
int dac_g;
int vtotal_xga;
int v_total;
int dispend;
int v_syncstart;
int split;
int vblankstart_xga;
int hdisp_xga;
int hdispold_xga;
int htotal_xga;
int v_blankstart;
int h_disp;
int h_disp_old;
int h_total;
int h_disp_time;
int rowoffset;
int dispon;
int hdispon_xga;
int h_disp_on;
int vc;
int scanline;
int linepos;