Initial emulation of the IBM 8514/A coprocessor for both the MCA and ISA buses.

Currently the GUI option is on the QT frontend.
This commit is contained in:
TC1995
2022-05-14 18:55:00 +02:00
parent e15eade178
commit d0335e9679
11 changed files with 3360 additions and 2 deletions

View File

@@ -171,6 +171,7 @@ int GAMEBLASTER = 0; /* (C) sound option */
int GUS = 0; /* (C) sound option */
int SSI2001 = 0; /* (C) sound option */
int voodoo_enabled = 0; /* (C) video option */
int ibm8514_enabled = 0; /* (C) video option */
uint32_t mem_size = 0; /* (C) memory size (Installed on system board)*/
uint32_t isa_mem_size = 0; /* (C) memory size (ISA Memory Cards) */
int cpu_use_dynarec = 0; /* (C) cpu uses/needs Dyna */

View File

@@ -924,6 +924,7 @@ load_video(void)
}
voodoo_enabled = !!config_get_int(cat, "voodoo", 0);
ibm8514_enabled = !!config_get_int(cat, "8514a", 0);
}
@@ -2457,6 +2458,11 @@ save_video(void)
else
config_set_int(cat, "voodoo", voodoo_enabled);
if (ibm8514_enabled == 0)
config_delete_var(cat, "8514a");
else
config_set_int(cat, "8514a", ibm8514_enabled);
delete_section_if_empty(cat);
}

View File

@@ -111,7 +111,8 @@ extern int sound_is_float, /* (C) sound uses FP values */
GAMEBLASTER, /* (C) sound option */
GUS, GUSMAX, /* (C) sound option */
SSI2001, /* (C) sound option */
voodoo_enabled; /* (C) video option */
voodoo_enabled, /* (C) video option */
ibm8514_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 */

View File

@@ -0,0 +1,109 @@
/*
* 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 8514/A card from IBM for the MCA bus and
* generic ISA bus clones without vendor extensions.
*
*
*
* Authors: TheCollector1995
*
* Copyright 2022 TheCollector1995.
*/
#ifndef VIDEO_8514A_H
# define VIDEO_8514A_H
typedef struct ibm8514_t
{
uint8_t pos_regs[8];
int force_old_addr;
int type;
uint32_t vram_size;
uint32_t vram_mask;
PALETTE vgapal;
uint8_t dac_mask, dac_status;
uint32_t *map8;
int dac_addr, dac_pos, dac_r, dac_g;
struct {
uint16_t subsys_cntl;
uint16_t setup_md;
uint8_t advfunc_cntl, ext_advfunc_cntl;
uint16_t cur_y, cur_y_bitres;
uint16_t cur_x, cur_x_bitres;
int16_t desty_axstp;
int16_t destx_distp;
int16_t err_term;
int16_t maj_axis_pcnt;
uint16_t cmd, cmd_back;
uint16_t short_stroke;
uint16_t bkgd_color;
uint16_t frgd_color;
uint16_t wrt_mask;
uint16_t rd_mask;
uint16_t color_cmp;
uint16_t bkgd_mix;
uint16_t frgd_mix;
uint16_t multifunc_cntl;
uint16_t multifunc[16];
uint8_t pix_trans[2];
int poly_draw;
int ssv_state;
int x1, x2, y1, y2;
int sys_cnt, sys_cnt2;
int temp_cnt;
int cx, cy;
int sx, sy;
int dx, dy;
uint32_t src, dest;
uint32_t newsrc_blt, newdest_blt;
uint32_t newdest_in, newdest_out;
uint8_t *writemono, *nibbleset;
int x_count, y_count;
int input, output;
uint16_t cur_x_bit12, cur_y_bit12;
int ssv_len;
uint8_t ssv_dir;
uint8_t ssv_draw;
int odd_in, odd_out;
uint16_t scratch;
} accel;
uint16_t test;
int v_total, dispend, v_syncstart, split,
h_disp, h_disp_old, h_total, h_disp_time, rowoffset,
dispon, hdisp_on, linecountff,
vc, linepos, oddeven, cursoron, blink, scrollcache,
firstline, lastline, firstline_draw, lastline_draw,
displine, fullchange, x_add, y_add;
uint32_t ma, maback;
uint8_t *vram, *changedvram, linedbl;
uint8_t data_available, data_available2;
uint8_t scanmodulos, rowcount;
int htotal, hdisp, vtadj, vdadj, vsadj, sc,
vtb, vdb, vsb, vsyncstart, vsyncwidth;
int vtotal, vdisp;
int disp_cntl, interlace;
uint8_t subsys_cntl, subsys_stat;
volatile int force_busy, force_busy2;
int blitter_busy;
uint64_t blitter_time;
uint64_t status_time;
} ibm8514_t;
#endif /*VIDEO_8514A_H*/

View File

@@ -17,6 +17,9 @@
* Copyright 2016-2020 Miran Grca.
*/
#include <86box/thread.h>
#include <86box/vid_8514a.h>
#ifndef VIDEO_SVGA_H
# define VIDEO_SVGA_H
@@ -45,6 +48,7 @@ typedef union {
typedef struct svga_t
{
ibm8514_t dev8514;
mem_mapping_t mapping;
uint8_t fast, chain4, chain2_write, chain2_read,
@@ -161,12 +165,18 @@ typedef struct svga_t
int force_old_addr;
int vga_on;
int remap_required;
uint32_t (*remap_func)(struct svga_t *svga, uint32_t in_addr);
void *ramdac, *clock_gen;
} svga_t;
extern svga_t *svga_8514;
extern void ibm8514_poll(ibm8514_t *dev, svga_t *svga);
extern void ibm8514_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),

View File

@@ -200,6 +200,9 @@ extern void agpgart_set_gart(void *handle, uint32_t base);
#ifdef EMU_DEVICE_H
/* IBM 8514/A and generic clones*/
extern void ibm8514_device_add(void);
/* ATi Mach64 */
extern const device_t mach64gx_isa_device;
extern const device_t mach64gx_vlb_device;

View File

@@ -114,6 +114,12 @@ machine_init_ex(int m)
if (bios_only || !ret)
return ret;
if (gfxcard != VID_NONE) {
if (ibm8514_enabled) {
ibm8514_device_add();
}
}
/* Reset the graphics card (or do nothing if it was already done
by the machine's init function). */
video_reset(gfxcard);

View File

@@ -46,6 +46,7 @@ SettingsDisplay::~SettingsDisplay()
void SettingsDisplay::save() {
gfxcard = ui->comboBoxVideo->currentData().toInt();
voodoo_enabled = ui->checkBoxVoodoo->isChecked() ? 1 : 0;
ibm8514_enabled = ui->checkBox8514->isChecked() ? 1 : 0;
}
void SettingsDisplay::onCurrentMachineChanged(int machineId) {
@@ -113,6 +114,13 @@ void SettingsDisplay::on_comboBoxVideo_currentIndexChanged(int index) {
ui->checkBoxVoodoo->setChecked(voodoo_enabled);
}
ui->pushButtonConfigureVoodoo->setEnabled(machineHasPci && ui->checkBoxVoodoo->isChecked());
bool hasIsa16 = machine_has_bus(machineId, MACHINE_BUS_ISA | MACHINE_AT) > 0;
bool has_MCA = machine_has_bus(machineId, MACHINE_BUS_MCA) > 0;
ui->checkBox8514->setEnabled(hasIsa16 || has_MCA);
if (hasIsa16 || has_MCA) {
ui->checkBox8514->setChecked(ibm8514_enabled > 0);
}
}
void SettingsDisplay::on_checkBoxVoodoo_stateChanged(int state) {

View File

@@ -63,6 +63,13 @@
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QCheckBox" name="checkBox8514">
<property name="text">
<string>8514/A</string>
</property>
</widget>
</item>
<item row="2" column="0">
<spacer name="verticalSpacer">
<property name="orientation">

View File

@@ -16,7 +16,7 @@
add_library(vid OBJECT agpgart.c video.c vid_table.c vid_cga.c vid_cga_comp.c
vid_compaq_cga.c vid_mda.c vid_hercules.c vid_herculesplus.c
vid_incolor.c vid_colorplus.c vid_genius.c vid_pgc.c vid_im1024.c
vid_sigma.c vid_wy700.c vid_ega.c vid_ega_render.c vid_svga.c
vid_sigma.c vid_wy700.c vid_ega.c vid_ega_render.c vid_svga.c vid_8514a.c
vid_svga_render.c vid_ddc.c vid_vga.c vid_ati_eeprom.c vid_ati18800.c
vid_ati28800.c vid_ati_mach64.c vid_ati68860_ramdac.c vid_bt48x_ramdac.c
vid_av9194.c vid_icd2061.c vid_ics2494.c vid_ics2595.c vid_cl54xx.c

3207
src/video/vid_8514a.c Normal file

File diff suppressed because it is too large Load Diff