Merge branch '86Box:master' into nec-v20

This commit is contained in:
Jasmine Iwanek
2022-05-22 22:48:46 -04:00
committed by GitHub
19 changed files with 3972 additions and 22 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 */
@@ -427,7 +428,7 @@ pc_init(int argc, char *argv[])
*p = '\0';
}
if (!strncmp(exe_path, "/private/var/folders/", 21)) {
ui_msgbox_header(MBX_FATAL, L"App Translocation", EMU_NAME_W L" cannot determine the emulated machine's location due to a macOS security feature. Please make a copy of the " EMU_NAME_W L" app and open that copy instead.");
ui_msgbox_header(MBX_FATAL, L"App Translocation", EMU_NAME_W L" cannot determine the emulated machine's location due to a macOS security feature. Please move the " EMU_NAME_W L" app to another folder (not /Applications), or make a copy of it and open that copy instead.");
return(0);
}
#elif !defined(_WIN32)

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

@@ -36,6 +36,8 @@
#include <86box/pci.h>
#include <86box/ppi.h>
#include <86box/timer.h>
#include <86box/video.h>
#include <86box/vid_svga.h>
/* The opcode of the instruction currently being executed. */
uint8_t opcode;
@@ -341,6 +343,9 @@ softresetx86(void)
if (soft_reset_mask)
return;
if (ibm8514_enabled)
vga_on = 1;
reset_common(0);
}

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

@@ -73,6 +73,7 @@ extern const device_t keyboard_xt_olivetti_device;
extern const device_t keyboard_xt_zenith_device;
extern const device_t keyboard_at_device;
extern const device_t keyboard_at_ami_device;
extern const device_t keyboard_at_samsung_device;
extern const device_t keyboard_at_toshiba_device;
extern const device_t keyboard_at_olivetti_device;
extern const device_t keyboard_at_ncr_device;

View File

@@ -0,0 +1,111 @@
/*
* 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];
int16_t clip_left, clip_top;
uint8_t pix_trans[2];
int poly_draw;
int ssv_state;
int x1, x2, y1, y2;
int sys_cnt, sys_cnt2;
int temp_cnt;
int16_t 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, xx_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;
int fill_state, fill_drop;
} 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,
@@ -167,6 +171,11 @@ typedef struct svga_t
void *ramdac, *clock_gen;
} svga_t;
extern svga_t *svga_8514;
extern int vga_on;
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

@@ -236,7 +236,7 @@ machine_at_spc6000a_init(const machine_t *model)
if (fdc_type == FDC_INTERNAL)
device_add(&fdc_at_device);
device_add(&keyboard_at_ami_device);
device_add(&keyboard_at_samsung_device);
return ret;
}

View File

@@ -752,8 +752,8 @@ machine_xt_m24_init(const machine_t *model)
int ret;
m24_kbd_t *m24_kbd;
ret = bios_load_interleaved("roms/machines/m24/olivetti_m24_version_1.43_low.bin",
"roms/machines/m24/olivetti_m24_version_1.43_high.bin",
ret = bios_load_interleaved("roms/machines/m24/olivetti_m24_bios_version_1.44_low_even.bin",
"roms/machines/m24/olivetti_m24_bios_version_1.44_high_odd.bin",
0x000fc000, 16384, 0);
if (bios_only || !ret)

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

@@ -42,11 +42,11 @@ dp8390_log(const char *fmt, ...)
{
va_list ap;
if (dp8390_do_log >= lvl) {
// if (dp8390_do_log >= lvl) {
va_start(ap, fmt);
pclog_ex(fmt, ap);
va_end(ap);
}
// }
}
#else
#define dp8390_log(lvl, fmt, ...)
@@ -97,8 +97,8 @@ dp8390_chipmem_read(dp8390_t *dev, uint32_t addr, unsigned int len)
uint32_t retval = 0;
#ifdef ENABLE_DP8390_LOG
if ((len > 1) && (addr & (len - 1))
dp3890_log("DP8390: unaligned chipmem word read\n");
if ((len > 1) && (addr & (len - 1)))
dp8390_log("DP8390: unaligned chipmem word read\n");
#endif
dp8390_log("DP8390: Chipmem Read Address=%04x\n", addr);
@@ -126,7 +126,7 @@ dp8390_chipmem_write(dp8390_t *dev, uint32_t addr, uint32_t val, unsigned len)
int i;
#ifdef ENABLE_DP8390_LOG
if ((len > 1) && (addr & (len - 1))
if ((len > 1) && (addr & (len - 1)))
dp8390_log("DP8390: unaligned chipmem word write\n");
#endif
@@ -199,7 +199,7 @@ dp8390_write_cr(dp8390_t *dev, uint32_t val)
dev->remote_start = dev->remote_dma = dev->bound_ptr * 256;
dev->remote_bytes = (uint16_t) dp8390_chipmem_read(dev, dev->bound_ptr * 256 + 2, 2);
dp8390_log("DP8390: sending buffer #x%x length %d\n",
dev->dp8390.remote_start, dev->dp8390.remote_bytes);
dev->remote_start, dev->remote_bytes);
}
/* Check for start-tx */
@@ -283,7 +283,7 @@ dp8390_rx_common(void *priv, uint8_t *buf, int io_len)
int endbytes;
if (io_len != 60)
dp8390_log("%s: rx_frame with length %d\n", dev->name, io_len);
dp8390_log("rx_frame with length %d\n", io_len);
if ((dev->CR.stop != 0) || (dev->page_start == 0))
return 0;
@@ -706,7 +706,7 @@ dp8390_page0_write(dp8390_t *dev, uint32_t off, uint32_t val, unsigned len)
dev->DCR.longaddr = ((val & 0x04) == 0x04); /* illegal ? */
dev->DCR.loop = ((val & 0x08) == 0x08);
dev->DCR.auto_rx = ((val & 0x10) == 0x10); /* also illegal ? */
dev->DCR.fifo_size = (val & 0x50) >> 5;
dev->DCR.fifo_size = (val & 0x60) >> 5;
break;
case 0x0f: /* IMR */
@@ -801,9 +801,9 @@ dp8390_page1_write(dp8390_t *dev, uint32_t off, uint32_t val, unsigned len)
dev->physaddr[off - 1] = val;
if (off == 6)
dp8390_log("DP8390: Physical address set to %02x:%02x:%02x:%02x:%02x:%02x\n",
dev->dp8390->physaddr[0], dev->dp8390.physaddr[1],
dev->dp8390->physaddr[2], dev->dp8390.physaddr[3],
dev->dp8390->physaddr[4], dev->dp8390.physaddr[5]);
dev->physaddr[0], dev->physaddr[1],
dev->physaddr[2], dev->physaddr[3],
dev->physaddr[4], dev->physaddr[5]);
break;
case 0x07: /* CURR */

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,7 +63,14 @@
</property>
</widget>
</item>
<item row="2" column="0">
<item row="2" column="0" colspan="2">
<widget class="QCheckBox" name="checkBox8514">
<property name="text">
<string>8514/A</string>
</property>
</widget>
</item>
<item row="3" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>

View File

@@ -806,7 +806,7 @@ plat_init_rom_paths()
#else
char default_rom_path[1024] = { '\0 '};
getDefaultROMPath(default_rom_path);
rom_path_add(default_rom_path);
rom_add_path(default_rom_path);
#endif
}

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

3772
src/video/vid_8514a.c Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -43,6 +43,8 @@
void svga_doblit(int wx, int wy, svga_t *svga);
svga_t *svga_8514;
extern int cyc_total;
extern uint8_t edatlookup[4][4];
@@ -51,7 +53,7 @@ uint8_t svga_rotate[8][256];
/*Primary SVGA device. As multiple video cards are not yet supported this is the
only SVGA device.*/
static svga_t *svga_pri;
int vga_on;
svga_t
*svga_get_pri()
@@ -552,8 +554,13 @@ svga_recalctimings(svga_t *svga)
} else
overscan_x = 16;
if (svga->recalctimings_ex)
svga->recalctimings_ex(svga);
if (vga_on) {
if (svga->recalctimings_ex) {
svga->recalctimings_ex(svga);
}
} else {
ibm8514_recalctimings(svga);
}
svga->y_add = (overscan_y >> 1) - (svga->crtc[8] & 0x1f);
svga->x_add = (overscan_x >> 1);
@@ -650,6 +657,11 @@ svga_poll(void *p)
int wx, wy;
int ret, old_ma;
if (!vga_on) {
ibm8514_poll(&svga->dev8514, svga);
return;
}
if (!svga->linepos) {
if (svga->displine == svga->hwcursor_latch.y && svga->hwcursor_latch.ena) {
svga->hwcursor_on = svga->hwcursor.ysize - svga->hwcursor_latch.yoff;
@@ -956,6 +968,8 @@ svga_init(const device_t *info, svga_t *svga, void *p, int memsize,
svga->translate_address = NULL;
svga->ksc5601_english_font_type = 0;
vga_on = 1;
if ((info->flags & DEVICE_PCI) || (info->flags & DEVICE_VLB) || (info->flags & DEVICE_MCA)) {
mem_mapping_add(&svga->mapping, 0xa0000, 0x20000,
svga_read, svga_readw, svga_readl,
@@ -977,6 +991,11 @@ svga_init(const device_t *info, svga_t *svga, void *p, int memsize,
svga_pri = svga;
if (ibm8514_enabled)
svga_8514 = svga;
else
svga_8514 = NULL;
svga->ramdac_type = RAMDAC_6BIT;
svga->map8 = svga->pallook;

View File

@@ -689,6 +689,7 @@ VIDOBJ := agpgart.o video.o \
vid_wy700.o \
vid_ega.o vid_ega_render.o \
vid_svga.o vid_svga_render.o \
vid_8514a.o \
vid_ddc.o \
vid_vga.o \
vid_ati_eeprom.o \