Merge branch 'master' of ssh://github.com/86Box/86Box into cleanup30
This commit is contained in:
@@ -112,7 +112,8 @@ extern int sound_is_float, /* (C) sound uses FP values */
|
||||
GUS, GUSMAX, /* (C) sound option */
|
||||
SSI2001, /* (C) sound option */
|
||||
voodoo_enabled, /* (C) video option */
|
||||
ibm8514_enabled; /* (C) video option */
|
||||
ibm8514_enabled, /* (C) video option */
|
||||
xga_enabled; /* (C) video option */
|
||||
extern uint32_t mem_size; /* (C) memory size (Installed on system board) */
|
||||
extern uint32_t isa_mem_size; /* (C) memory size (ISA Memory Cards) */
|
||||
extern int cpu, /* (C) cpu type */
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
* Copyright 2008-2019 Sarah Walker.
|
||||
* Copyright 2016-2019 Miran Grca.
|
||||
* Copyright 2018,2019 David Hrdlička.
|
||||
* Copyright 2021-2022 Jasmine Iwanek.
|
||||
*/
|
||||
|
||||
#ifndef WIN_RESOURCE_H
|
||||
@@ -184,6 +185,8 @@
|
||||
#define IDC_CHECK_VOODOO 1022
|
||||
#define IDC_BUTTON_VOODOO 1023
|
||||
#define IDC_CHECK_IBM8514 1024
|
||||
#define IDC_CHECK_XGA 1025
|
||||
#define IDC_BUTTON_XGA 1026
|
||||
|
||||
#define IDC_INPUT 1030 /* input config */
|
||||
#define IDC_COMBO_MOUSE 1031
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
#define EMU_VERSION "@CMAKE_PROJECT_VERSION@"
|
||||
#define EMU_VERSION_W LSTR(EMU_VERSION)
|
||||
#define EMU_VERSION_EX "@EMU_VERSION_EX@"
|
||||
#define EMU_VERSION_EX "3.50" /* frozen due to IDE re-detection behavior on Windows */
|
||||
#define EMU_VERSION_MAJ @CMAKE_PROJECT_VERSION_MAJOR@
|
||||
#define EMU_VERSION_MIN @CMAKE_PROJECT_VERSION_MINOR@
|
||||
#define EMU_VERSION_PATCH @CMAKE_PROJECT_VERSION_PATCH@
|
||||
|
||||
@@ -63,8 +63,9 @@ typedef struct ibm8514_t
|
||||
int sys_cnt, sys_cnt2;
|
||||
int temp_cnt;
|
||||
int16_t cx, cy;
|
||||
int sx, sy;
|
||||
int dx, dy;
|
||||
int16_t sx, sy;
|
||||
int16_t dx, dy;
|
||||
int16_t err;
|
||||
uint32_t src, dest;
|
||||
uint32_t newsrc_blt, newdest_blt;
|
||||
uint32_t newdest_in, newdest_out;
|
||||
|
||||
@@ -65,6 +65,9 @@ typedef struct ega_t {
|
||||
|
||||
double clock;
|
||||
|
||||
int remap_required;
|
||||
uint32_t (*remap_func)(struct ega_t *ega, uint32_t in_addr);
|
||||
|
||||
void (*render)(struct ega_t *svga);
|
||||
|
||||
void *eeprom;
|
||||
@@ -94,6 +97,7 @@ extern int update_overscan;
|
||||
#if defined(EMU_MEM_H) && defined(EMU_ROM_H)
|
||||
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
|
||||
|
||||
extern void ega_out(uint16_t addr, uint8_t val, void *p);
|
||||
|
||||
111
src/include/86box/vid_ega_render_remap.h
Normal file
111
src/include/86box/vid_ega_render_remap.h
Normal file
@@ -0,0 +1,111 @@
|
||||
#ifndef VIDEO_EGA_RENDER_REMAP_H
|
||||
# define VIDEO_EGA_RENDER_REMAP_H
|
||||
|
||||
#define VAR_BYTE_MODE (0 << 0)
|
||||
#define VAR_WORD_MODE_MA13 (1 << 0)
|
||||
#define VAR_WORD_MODE_MA15 (2 << 0)
|
||||
#define VAR_DWORD_MODE (3 << 0)
|
||||
#define VAR_MODE_MASK (3 << 0)
|
||||
#define VAR_ROW0_MA13 (1 << 2)
|
||||
#define VAR_ROW1_MA14 (1 << 3)
|
||||
|
||||
#define ADDRESS_REMAP_FUNC(nr) \
|
||||
static uint32_t address_remap_func_ ## nr(ega_t *ega, uint32_t in_addr) \
|
||||
{ \
|
||||
uint32_t out_addr; \
|
||||
\
|
||||
switch (nr & VAR_MODE_MASK) \
|
||||
{ \
|
||||
case VAR_BYTE_MODE: \
|
||||
out_addr = in_addr; \
|
||||
break; \
|
||||
\
|
||||
case VAR_WORD_MODE_MA13: \
|
||||
out_addr = ((in_addr << 1) & 0x1fff8) | \
|
||||
((in_addr >> 13) & 0x4) | \
|
||||
(in_addr & ~0x1ffff); \
|
||||
break; \
|
||||
\
|
||||
case VAR_WORD_MODE_MA15: \
|
||||
out_addr = ((in_addr << 1) & 0x1fff8) | \
|
||||
((in_addr >> 15) & 0x4) | \
|
||||
(in_addr & ~0x1ffff); \
|
||||
break; \
|
||||
\
|
||||
case VAR_DWORD_MODE: \
|
||||
out_addr = ((in_addr << 2) & 0x3fff0) | \
|
||||
((in_addr >> 14) & 0xc) | \
|
||||
(in_addr & ~0x3ffff); \
|
||||
break; \
|
||||
} \
|
||||
\
|
||||
if (nr & VAR_ROW0_MA13) \
|
||||
out_addr = (out_addr & ~0x8000) | \
|
||||
((ega->sc & 1) ? 0x8000 : 0); \
|
||||
if (nr & VAR_ROW1_MA14) \
|
||||
out_addr = (out_addr & ~0x10000) | \
|
||||
((ega->sc & 2) ? 0x10000 : 0); \
|
||||
\
|
||||
return out_addr; \
|
||||
}
|
||||
|
||||
ADDRESS_REMAP_FUNC(0)
|
||||
ADDRESS_REMAP_FUNC(1)
|
||||
ADDRESS_REMAP_FUNC(2)
|
||||
ADDRESS_REMAP_FUNC(3)
|
||||
ADDRESS_REMAP_FUNC(4)
|
||||
ADDRESS_REMAP_FUNC(5)
|
||||
ADDRESS_REMAP_FUNC(6)
|
||||
ADDRESS_REMAP_FUNC(7)
|
||||
ADDRESS_REMAP_FUNC(8)
|
||||
ADDRESS_REMAP_FUNC(9)
|
||||
ADDRESS_REMAP_FUNC(10)
|
||||
ADDRESS_REMAP_FUNC(11)
|
||||
ADDRESS_REMAP_FUNC(12)
|
||||
ADDRESS_REMAP_FUNC(13)
|
||||
ADDRESS_REMAP_FUNC(14)
|
||||
ADDRESS_REMAP_FUNC(15)
|
||||
|
||||
static uint32_t (*address_remap_funcs[16])(ega_t *ega, uint32_t in_addr) =
|
||||
{
|
||||
address_remap_func_0,
|
||||
address_remap_func_1,
|
||||
address_remap_func_2,
|
||||
address_remap_func_3,
|
||||
address_remap_func_4,
|
||||
address_remap_func_5,
|
||||
address_remap_func_6,
|
||||
address_remap_func_7,
|
||||
address_remap_func_8,
|
||||
address_remap_func_9,
|
||||
address_remap_func_10,
|
||||
address_remap_func_11,
|
||||
address_remap_func_12,
|
||||
address_remap_func_13,
|
||||
address_remap_func_14,
|
||||
address_remap_func_15
|
||||
};
|
||||
|
||||
void ega_recalc_remap_func(ega_t *ega)
|
||||
{
|
||||
int func_nr;
|
||||
|
||||
if (ega->crtc[0x14] & 0x40)
|
||||
func_nr = VAR_DWORD_MODE;
|
||||
else if (ega->crtc[0x17] & 0x40)
|
||||
func_nr = VAR_BYTE_MODE;
|
||||
else if (ega->crtc[0x17] & 0x20)
|
||||
func_nr = VAR_WORD_MODE_MA15;
|
||||
else
|
||||
func_nr = VAR_WORD_MODE_MA13;
|
||||
|
||||
if (!(ega->crtc[0x17] & 0x01))
|
||||
func_nr |= VAR_ROW0_MA13;
|
||||
if (!(ega->crtc[0x17] & 0x02))
|
||||
func_nr |= VAR_ROW1_MA14;
|
||||
|
||||
ega->remap_required = (func_nr != 0);
|
||||
ega->remap_func = address_remap_funcs[func_nr];
|
||||
}
|
||||
|
||||
#endif /*VIDEO_RENDER_REMAP_H*/
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
#include <86box/thread.h>
|
||||
#include <86box/vid_8514a.h>
|
||||
#include <86box/vid_xga.h>
|
||||
|
||||
#ifndef VIDEO_SVGA_H
|
||||
# define VIDEO_SVGA_H
|
||||
@@ -49,6 +50,7 @@ typedef union {
|
||||
typedef struct svga_t
|
||||
{
|
||||
ibm8514_t dev8514;
|
||||
xga_t xga;
|
||||
mem_mapping_t mapping;
|
||||
|
||||
uint8_t fast, chain4, chain2_write, chain2_read,
|
||||
@@ -171,12 +173,14 @@ typedef struct svga_t
|
||||
void *ramdac, *clock_gen;
|
||||
} svga_t;
|
||||
|
||||
extern svga_t *svga_8514;
|
||||
extern int vga_on;
|
||||
extern int vga_on, ibm8514_on;
|
||||
|
||||
extern void ibm8514_poll(ibm8514_t *dev, svga_t *svga);
|
||||
extern void ibm8514_recalctimings(svga_t *svga);
|
||||
|
||||
extern void xga_poll(xga_t *xga, svga_t *svga);
|
||||
extern void xga_recalctimings(svga_t *svga);
|
||||
|
||||
extern int svga_init(const device_t *info, svga_t *svga, void *p, int memsize,
|
||||
void (*recalctimings_ex)(struct svga_t *svga),
|
||||
uint8_t (*video_in) (uint16_t addr, void *p),
|
||||
|
||||
164
src/include/86box/vid_xga.h
Normal file
164
src/include/86box/vid_xga.h
Normal file
@@ -0,0 +1,164 @@
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
* IBM XGA emulation.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: TheCollector1995.
|
||||
*
|
||||
* Copyright 2022 TheCollector1995.
|
||||
*/
|
||||
|
||||
#ifndef VIDEO_XGA_H
|
||||
# define VIDEO_XGA_H
|
||||
|
||||
#include <86box/rom.h>
|
||||
|
||||
typedef struct {
|
||||
int ena;
|
||||
int x, y, xoff, yoff, xsize, ysize;
|
||||
uint32_t addr;
|
||||
} xga_hwcursor_t;
|
||||
|
||||
typedef struct xga_t
|
||||
{
|
||||
mem_mapping_t memio_mapping;
|
||||
mem_mapping_t linear_mapping;
|
||||
mem_mapping_t video_mapping;
|
||||
rom_t bios_rom;
|
||||
xga_hwcursor_t hwcursor, hwcursor_latch;
|
||||
PALETTE extpal;
|
||||
|
||||
uint8_t test, atest[2], testpixel;;
|
||||
uint8_t pos_regs[8];
|
||||
uint8_t disp_addr;
|
||||
uint8_t cfg_reg;
|
||||
uint8_t instance;
|
||||
uint8_t op_mode;
|
||||
uint8_t aperture_cntl;
|
||||
uint8_t ap_idx;
|
||||
uint8_t access_mode;
|
||||
uint8_t regs[0x100];
|
||||
uint8_t regs_idx;
|
||||
uint8_t hwc_hotspot_x;
|
||||
uint8_t hwc_hotspot_y;
|
||||
uint8_t disp_cntl_1, disp_cntl_2;
|
||||
uint8_t clk_sel_1, clk_sel_2;
|
||||
uint8_t hwc_control;
|
||||
uint8_t bus_arb;
|
||||
uint8_t select_pos_isa;
|
||||
uint8_t hwcursor_oddeven;
|
||||
uint8_t cfg_reg_instance;
|
||||
uint8_t rowcount;
|
||||
uint8_t pal_idx, pal_idx_prefetch;
|
||||
uint8_t pal_seq;
|
||||
uint8_t pal_mask;
|
||||
uint8_t pal_r, pal_r_prefetch;
|
||||
uint8_t pal_g, pal_g_prefetch;
|
||||
uint8_t pal_b, pal_b_prefetch;
|
||||
uint8_t sprite_data[1024];
|
||||
uint8_t scrollcache;
|
||||
uint8_t direct_color;
|
||||
uint8_t *vram, *changedvram;
|
||||
|
||||
int16_t hwc_pos_x;
|
||||
int16_t hwc_pos_y;
|
||||
|
||||
uint16_t pos_idx;
|
||||
uint16_t htotal;
|
||||
uint16_t sprite_idx, sprite_idx_prefetch;
|
||||
uint16_t hdisp;
|
||||
uint16_t vtotal;
|
||||
uint16_t vdispend;
|
||||
uint16_t vblankstart;
|
||||
uint16_t vsyncstart;
|
||||
uint16_t linecmp;
|
||||
uint16_t pix_map_width;
|
||||
uint16_t sprite_pal_addr_idx, old_pal_addr_idx;
|
||||
uint16_t sprite_pal_addr_idx_prefetch;
|
||||
|
||||
int v_total, dispend, v_syncstart, split, v_blankstart,
|
||||
h_disp, h_disp_old, h_total, h_disp_time, rowoffset,
|
||||
dispon, h_disp_on, vc, sc, linepos, oddeven, firstline, lastline,
|
||||
firstline_draw, lastline_draw, displine, fullchange, interlace,
|
||||
char_width, hwcursor_on;
|
||||
int pal_pos, pal_pos_prefetch;
|
||||
int on;
|
||||
int op_mode_reset, linear_endian_reverse;
|
||||
int sprite_pos, sprite_pos_prefetch, cursor_data_on;
|
||||
int pal_test;
|
||||
int type, bus;
|
||||
|
||||
uint32_t linear_base, linear_size, banked_mask;
|
||||
uint32_t base_addr_1mb;
|
||||
uint32_t hwc_color0, hwc_color1;
|
||||
uint32_t disp_start_addr;
|
||||
uint32_t ma_latch;
|
||||
uint32_t vram_size;
|
||||
uint32_t vram_mask;
|
||||
uint32_t rom_addr;
|
||||
uint32_t ma, maback;
|
||||
uint32_t extpallook[256];
|
||||
uint32_t read_bank, write_bank;
|
||||
uint32_t px_map_base;
|
||||
|
||||
uint64_t dispontime, dispofftime;
|
||||
|
||||
struct
|
||||
{
|
||||
uint8_t control;
|
||||
uint8_t px_map_idx;
|
||||
uint8_t frgd_mix, bkgd_mix;
|
||||
uint8_t cc_cond;
|
||||
uint8_t octant;
|
||||
uint8_t draw_mode;
|
||||
uint8_t mask_mode;
|
||||
uint8_t short_stroke_vector1;
|
||||
uint8_t short_stroke_vector2;
|
||||
uint8_t short_stroke_vector3;
|
||||
uint8_t short_stroke_vector4;
|
||||
|
||||
int16_t bres_err_term;
|
||||
int16_t bres_k1, bres_k2;
|
||||
|
||||
uint16_t blt_width;
|
||||
uint16_t blt_height;
|
||||
uint16_t mask_map_origin_x_off;
|
||||
uint16_t mask_map_origin_y_off;
|
||||
uint16_t src_map_x, src_map_y;
|
||||
uint16_t dst_map_x, dst_map_y;
|
||||
uint16_t pat_map_x, pat_map_y;
|
||||
|
||||
int ssv_state;
|
||||
int pat_src;
|
||||
int src_map;
|
||||
int dst_map;
|
||||
int bkgd_src;
|
||||
int fore_src;
|
||||
int x, y, sx, sy, dx, dy, px, py;
|
||||
int pattern;
|
||||
int command_len;
|
||||
|
||||
uint32_t short_stroke;
|
||||
uint32_t color_cmp;
|
||||
uint32_t carry_chain;
|
||||
uint32_t plane_mask;
|
||||
uint32_t frgd_color, bkgd_color;
|
||||
uint32_t command;
|
||||
uint32_t dir_cmd;
|
||||
|
||||
uint8_t px_map_format[4];
|
||||
uint16_t px_map_width[4];
|
||||
uint16_t px_map_height[4];
|
||||
uint32_t px_map_base[4];
|
||||
} accel;
|
||||
|
||||
volatile int force_busy;
|
||||
} xga_t;
|
||||
#endif /*VIDEO_XGA_H*/
|
||||
22
src/include/86box/vid_xga_device.h
Normal file
22
src/include/86box/vid_xga_device.h
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
* IBM XGA emulation.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: TheCollector1995.
|
||||
*
|
||||
* Copyright 2022 TheCollector1995.
|
||||
*/
|
||||
|
||||
#ifndef VIDEO_XGA_DEVICE_H
|
||||
# define VIDEO_XGA_DEVICE_H
|
||||
extern const device_t xga_device;
|
||||
extern const device_t xga_isa_device;
|
||||
#endif /*VIDEO_XGA_DEVICE_H*/
|
||||
@@ -200,6 +200,9 @@ extern void agpgart_set_gart(void *handle, uint32_t base);
|
||||
|
||||
|
||||
#ifdef EMU_DEVICE_H
|
||||
/* IBM XGA */
|
||||
extern void xga_device_add(void);
|
||||
|
||||
/* IBM 8514/A and generic clones*/
|
||||
extern void ibm8514_device_add(void);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user