diff --git a/src/include/86box/vid_svga.h b/src/include/86box/vid_svga.h index e0ae5ed6f..814a986c3 100644 --- a/src/include/86box/vid_svga.h +++ b/src/include/86box/vid_svga.h @@ -449,6 +449,8 @@ extern void ibm_rgb528_hwcursor_draw(svga_t *svga, int displine); extern float ibm_rgb528_getclock(int clock, void *priv); extern void ibm_rgb528_ramdac_set_ref_clock(void *priv, svga_t *svga, float ref_clock); +extern float icd2047_getclock(int clock, void *priv); + extern void icd2061_write(void *priv, int val); extern float icd2061_getclock(int clock, void *priv); extern void icd2061_set_ref_clock(void *priv, float ref_clock); @@ -457,8 +459,13 @@ extern void icd2061_set_ref_clock(void *priv, float ref_clock); # define ics9161_write icd2061_write # define ics9161_getclock icd2061_getclock +extern float ics1494_getclock(int clock, void *priv); + extern float ics2494_getclock(int clock, void *priv); +extern float ics90c64a_vclk_getclock(int clock, void *priv); +extern float ics90c64a_mclk_getclock(int clock, void *priv); + extern void ics2595_write(void *priv, int strobe, int dat); extern double ics2595_getclock(void *priv); extern void ics2595_setclock(void *priv, double clock); @@ -507,6 +514,8 @@ extern const device_t att20c505_ramdac_device; extern const device_t bt485a_ramdac_device; extern const device_t gendac_ramdac_device; extern const device_t ibm_rgb528_ramdac_device; +extern const device_t ics1494m_540_device; +extern const device_t ics1494m_540_radius_ht209_device; extern const device_t ics2494an_305_device; extern const device_t ics2494an_324_device; extern const device_t ati18810_28800_device; @@ -516,7 +525,9 @@ extern const device_t ati18810_mach32_device; extern const device_t ati18811_0_mach32_device; extern const device_t ati18811_1_mach32_device; extern const device_t ics2595_device; +extern const device_t icd2047_20_device; extern const device_t icd2061_device; +extern const device_t ics90c64a_903_device; extern const device_t ics9161_device; extern const device_t sc11483_ramdac_device; extern const device_t sc11487_ramdac_device; diff --git a/src/video/CMakeLists.txt b/src/video/CMakeLists.txt index 98a9cb385..201ef4a40 100644 --- a/src/video/CMakeLists.txt +++ b/src/video/CMakeLists.txt @@ -38,9 +38,12 @@ add_library(vid OBJECT # Clock generator chips clockgen/vid_clockgen_av9194.c + clockgen/vid_clockgen_icd2047.c clockgen/vid_clockgen_icd2061.c + clockgen/vid_clockgen_ics1494.c clockgen/vid_clockgen_ics2494.c clockgen/vid_clockgen_ics2595.c + clockgen/vid_clockgen_ics90c64a.c # DDC / monitor identification stuff vid_ddc.c diff --git a/src/video/clockgen/vid_clockgen_icd2047.c b/src/video/clockgen/vid_clockgen_icd2047.c new file mode 100644 index 000000000..cc2e003bf --- /dev/null +++ b/src/video/clockgen/vid_clockgen_icd2047.c @@ -0,0 +1,131 @@ +/* + * 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. + * + * ICD2047 clock generator emulation. + * + * Used by the V7 chips. + * + * Authors: TheCollector1995. + * + * Copyright 2025 TheCollector1995. + */ +#include +#include +#include +#include +#include +#include +#define HAVE_STDARG_H +#include <86box/86box.h> +#include <86box/device.h> + +typedef struct icd2047_t { + float freq[32]; +} icd2047_t; + +#ifdef ENABLE_ICD2047_LOG +int icd2047_do_log = ENABLE_ICD2047_LOG; + +static void +icd2047_log(const char *fmt, ...) +{ + va_list ap; + + if (icd2047_do_log) { + va_start(ap, fmt); + pclog_ex(fmt, ap); + va_end(ap); + } +} +#else +# define icd2047_log(fmt, ...) +#endif + +float +icd2047_getclock(int clock, void *priv) +{ + const icd2047_t *icd2047 = (icd2047_t *) priv; + + if (clock > 31) + clock = 31; + + return icd2047->freq[clock]; +} + +static void * +icd2047_init(const device_t *info) +{ + icd2047_t *icd2047 = (icd2047_t *) malloc(sizeof(icd2047_t)); + memset(icd2047, 0, sizeof(icd2047_t)); + + switch (info->local) { + case 20: + /* ICD2047-20 for Headland series */ + icd2047->freq[0x00] = 25175000.0; + icd2047->freq[0x01] = 28322000.0; + icd2047->freq[0x02] = 40000000.0; + icd2047->freq[0x03] = 32500000.0; + icd2047->freq[0x04] = 50350000.0; + icd2047->freq[0x05] = 65000000.0; + icd2047->freq[0x06] = 38000000.0; + icd2047->freq[0x07] = 44900000.0; + icd2047->freq[0x08] = 25175000.0; + icd2047->freq[0x09] = 28322000.0; + icd2047->freq[0x0a] = 80000000.0; + icd2047->freq[0x0b] = 32500000.0; + icd2047->freq[0x0c] = 50350000.0; + icd2047->freq[0x0d] = 65000000.0; + icd2047->freq[0x0e] = 76000000.0; + icd2047->freq[0x0f] = 44900000.0; + icd2047->freq[0x10] = 25175000.0; + icd2047->freq[0x11] = 44900000.0; + icd2047->freq[0x12] = 28322000.0; + icd2047->freq[0x13] = 38000000.0; + icd2047->freq[0x14] = 40000000.0; + icd2047->freq[0x15] = 46000000.0; + icd2047->freq[0x16] = 48000000.0; + icd2047->freq[0x17] = 60000000.0; + icd2047->freq[0x18] = 65000000.0; + icd2047->freq[0x19] = 72000000.0; + icd2047->freq[0x1a] = 74000000.0; + icd2047->freq[0x1b] = 76000000.0; + icd2047->freq[0x1c] = 78000000.0; + icd2047->freq[0x1d] = 80000000.0; + icd2047->freq[0x1e] = 100000000.0; + icd2047->freq[0x1f] = 110000000.0; + break; + + default: + break; + } + + return icd2047; +} + +static void +icd2047_close(void *priv) +{ + icd2047_t *icd2047 = (icd2047_t *) priv; + + if (icd2047) + free(icd2047); +} + +const device_t icd2047_20_device = { + .name = "ICD2047-20 Clock Generator", + .internal_name = "icd2047_20", + .flags = 0, + .local = 20, + .init = icd2047_init, + .close = icd2047_close, + .reset = NULL, + .available = NULL, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; diff --git a/src/video/clockgen/vid_clockgen_ics1494.c b/src/video/clockgen/vid_clockgen_ics1494.c new file mode 100644 index 000000000..62af66bcd --- /dev/null +++ b/src/video/clockgen/vid_clockgen_ics1494.c @@ -0,0 +1,157 @@ +/* + * 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. + * + * ICS1494 clock generator emulation. + * + * Used by the V7 and PVGA chips. + * + * Authors: TheCollector1995. + * + * Copyright 2025 TheCollector1995. + */ +#include +#include +#include +#include +#include +#include +#define HAVE_STDARG_H +#include <86box/86box.h> +#include <86box/device.h> + +typedef struct ics1494_t { + float freq[32]; +} ics1494_t; + +#ifdef ENABLE_ICS1494_LOG +int ics1494_do_log = ENABLE_ICS1494_LOG; + +static void +ics1494_log(const char *fmt, ...) +{ + va_list ap; + + if (ics1494_do_log) { + va_start(ap, fmt); + pclog_ex(fmt, ap); + va_end(ap); + } +} +#else +# define ics1494_log(fmt, ...) +#endif + +float +ics1494_getclock(int clock, void *priv) +{ + const ics1494_t *ics1494 = (ics1494_t *) priv; + + if (clock > 31) + clock = 31; + + return ics1494->freq[clock]; +} + +static void * +ics1494_init(const device_t *info) +{ + ics1494_t *ics1494 = (ics1494_t *) malloc(sizeof(ics1494_t)); + memset(ics1494, 0, sizeof(ics1494_t)); + + switch (info->local) { + case 540: + /* ICS1494(M)-540 for Radius series */ + ics1494->freq[0x00] = 57283000.0; + ics1494->freq[0x01] = 12273000.0; + ics1494->freq[0x02] = 14500000.0; + ics1494->freq[0x03] = 15667000.0; + ics1494->freq[0x04] = 112000000.0; + ics1494->freq[0x05] = 126000000.0; + ics1494->freq[0x06] = 30240000.0; + ics1494->freq[0x07] = 91200000.0; + ics1494->freq[0x08] = 120000000.0; + ics1494->freq[0x09] = 48000000.0; + ics1494->freq[0x0a] = 50675000.0; + ics1494->freq[0x0b] = 55300000.0; + ics1494->freq[0x0c] = 64000000.0; + ics1494->freq[0x0d] = 68750000.0; + ics1494->freq[0x0e] = 88500000.0; + ics1494->freq[0x0f] = 51270000.0; + ics1494->freq[0x10] = 100000000.0; + ics1494->freq[0x11] = 95200000.0; + ics1494->freq[0x12] = 55000000.0; + ics1494->freq[0x13] = 60000000.0; + ics1494->freq[0x14] = 63000000.0; + ics1494->freq[0x15] = 99522000.0; + ics1494->freq[0x16] = 130000000.0; + ics1494->freq[0x17] = 80000000.0; + ics1494->freq[0x18] = 25175000.0; + ics1494->freq[0x19] = 28322000.0; + ics1494->freq[0x1a] = 48000000.0; + ics1494->freq[0x1b] = 76800000.0; + ics1494->freq[0x1c] = 38400000.0; + ics1494->freq[0x1d] = 43200000.0; + ics1494->freq[0x1e] = 61440000.0; + ics1494->freq[0x1f] = 0.0; + break; + + case 541: + /* ICS1494(M)-540 for Radius HT209 */ + ics1494->freq[0x00] = 25175000.0; + ics1494->freq[0x01] = 28322000.0; + ics1494->freq[0x02] = 61440000.0; /*FCLK*/ + ics1494->freq[0x03] = 74000000.0; /*XRESM*/ + ics1494->freq[0x04] = 50350000.0; + ics1494->freq[0x05] = 65000000.0; + ics1494->freq[0x06] = 37575000.0; /*FCLK*/ + ics1494->freq[0x07] = 40000000.0; + break; + + default: + break; + } + + return ics1494; +} + +static void +ics1494_close(void *priv) +{ + ics1494_t *ics1494 = (ics1494_t *) priv; + + if (ics1494) + free(ics1494); +} + +const device_t ics1494m_540_device = { + .name = "ICS2494M-540 Clock Generator", + .internal_name = "ics1494m_540", + .flags = 0, + .local = 540, + .init = ics1494_init, + .close = ics1494_close, + .reset = NULL, + .available = NULL, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; + +const device_t ics1494m_540_radius_ht209_device = { + .name = "ICS2494M-540 (Radius HT209) Clock Generator", + .internal_name = "ics1494m_540_radius_ht209", + .flags = 0, + .local = 541, + .init = ics1494_init, + .close = ics1494_close, + .reset = NULL, + .available = NULL, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; diff --git a/src/video/clockgen/vid_clockgen_ics90c64a.c b/src/video/clockgen/vid_clockgen_ics90c64a.c new file mode 100644 index 000000000..fd97201ce --- /dev/null +++ b/src/video/clockgen/vid_clockgen_ics90c64a.c @@ -0,0 +1,135 @@ +/* + * 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. + * + * ICS90C64A clock generator emulation. + * + * Used by the PVGA chips. + * + * Authors: TheCollector1995. + * + * Copyright 2025 TheCollector1995. + */ +#include +#include +#include +#include +#include +#include +#define HAVE_STDARG_H +#include <86box/86box.h> +#include <86box/device.h> + +typedef struct ics90c64a_t { + float freq[32]; +} ics90c64a_t; + +#ifdef ENABLE_ICS90C64A_LOG +int ics90c64a_do_log = ENABLE_ICS90C64A_LOG; + +static void +ics90c64a_log(const char *fmt, ...) +{ + va_list ap; + + if (ics90c64a_do_log) { + va_start(ap, fmt); + pclog_ex(fmt, ap); + va_end(ap); + } +} +#else +# define ics90c64a_log(fmt, ...) +#endif + +float +ics90c64a_vclk_getclock(int clock, void *priv) +{ + const ics90c64a_t *ics90c64a = (ics90c64a_t *) priv; + + if (clock > 15) + clock = 15; + + return ics90c64a->freq[clock]; +} + +float +ics90c64a_mclk_getclock(int clock, void *priv) +{ + const ics90c64a_t *ics90c64a = (ics90c64a_t *) priv; + + if (clock > 7) + clock = 7; + + return ics90c64a->freq[clock + 0x10]; +} + +static void * +ics90c64a_init(const device_t *info) +{ + ics90c64a_t *ics90c64a = (ics90c64a_t *) malloc(sizeof(ics90c64a_t)); + memset(ics90c64a, 0, sizeof(ics90c64a_t)); + + switch (info->local) { + case 903: + /* ICS90C64A-903 for PVGA chip series */ + ics90c64a->freq[0x0] = 30000000.0; + ics90c64a->freq[0x1] = 77250000.0; + ics90c64a->freq[0x2] = 0.0; + ics90c64a->freq[0x3] = 80000000.0; + ics90c64a->freq[0x4] = 31500000.0; + ics90c64a->freq[0x5] = 36000000.0; + ics90c64a->freq[0x6] = 75000000.0; + ics90c64a->freq[0x7] = 50000000.0; + ics90c64a->freq[0x8] = 40000000.0; + ics90c64a->freq[0x9] = 50000000.0; + ics90c64a->freq[0xa] = 32000000.0; + ics90c64a->freq[0xb] = 44900000.0; + ics90c64a->freq[0xc] = 25175000.0; + ics90c64a->freq[0xd] = 28322000.0; + ics90c64a->freq[0xe] = 65000000.0; + ics90c64a->freq[0xf] = 36000000.0; + + ics90c64a->freq[0x10] = 33000000.0; + ics90c64a->freq[0x11] = 49218000.0; + ics90c64a->freq[0x12] = 60000000.0; + ics90c64a->freq[0x13] = 30500000.0; + ics90c64a->freq[0x14] = 41612000.0; + ics90c64a->freq[0x15] = 37500000.0; + ics90c64a->freq[0x16] = 36000000.0; + ics90c64a->freq[0x17] = 44296000.0; + break; + + default: + break; + } + + return ics90c64a; +} + +static void +ics90c64a_close(void *priv) +{ + ics90c64a_t *ics90c64a = (ics90c64a_t *) priv; + + if (ics90c64a) + free(ics90c64a); +} + +const device_t ics90c64a_903_device = { + .name = "ICS90C64A-903 Clock Generator", + .internal_name = "ics90c64a_903", + .flags = 0, + .local = 903, + .init = ics90c64a_init, + .close = ics90c64a_close, + .reset = NULL, + .available = NULL, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; diff --git a/src/video/vid_ht216.c b/src/video/vid_ht216.c index 005cc6dfa..128f85b36 100644 --- a/src/video/vid_ht216.c +++ b/src/video/vid_ht216.c @@ -49,6 +49,7 @@ typedef struct ht216_t { uint32_t vram_mask, linear_base; uint8_t adjust_cursor, monitor_type; + uint8_t clk_sel; int ext_reg_enable; int isabus; @@ -100,7 +101,8 @@ void ht216_out(uint16_t addr, uint8_t val, void *priv); uint8_t ht216_in(uint16_t addr, void *priv); #define BIOS_G2_GC205_PATH "roms/video/video7/BIOS.BIN" -#define BIOS_VIDEO7_VGA_1024I_PATH "roms/video/video7/Video Seven VGA 1024i - BIOS - v2.19 - 435-0062-05 - U17 - 27C256.BIN" +#define BIOS_VIDEO7_VGA_1024I_219_PATH "roms/video/video7/Video Seven VGA 1024i - BIOS - v2.19 - 435-0062-05 - U17 - 27C256.BIN" +#define BIOS_VIDEO7_VGA_1024I_700_PATH "roms/video/video7/Headland Video7 VGA 1024i v7.0 32x8 (IP) NMC27C256B@DIP28.BIN" #define BIOS_RADIUS_SVGA_MULTIVIEW_PATH "roms/video/video7/U18.BIN" #define BIOS_HT216_32_PATH "roms/video/video7/HT21632.BIN" @@ -132,6 +134,7 @@ dword_remap(svga_t *svga, uint32_t in_addr) { if (svga->packed_chain4) return in_addr; + return ((in_addr & 0xfffc) << 2) | ((in_addr & 0x30000) >> 14) | (in_addr & ~0x3ffff); } @@ -182,8 +185,8 @@ ht216_out(uint16_t addr, uint8_t val, void *priv) switch (addr) { case 0x3c2: /*Bit 17 of the display memory address, only active on odd/even modes, has no effect on graphics modes.*/ + ht216->clk_sel = (ht216->clk_sel & ~0x03) | ((val & 0x0c) >> 2); ht216->misc = val; - svga->miscout = val; ht216_log("HT216 misc val = %02x, mode = 0, chain4 = %x\n", val, svga->chain4); ht216_recalc_bank_regs(ht216, 0); ht216_remap(ht216); @@ -251,10 +254,11 @@ ht216_out(uint16_t addr, uint8_t val, void *priv) ht216->ht_regs[0xfc], ht216->ht_regs[0xfd], ht216->ht_regs[0xfe], ht216->ht_regs[0xff]); return; #endif - } else if (svga->seqaddr >= 0x80 && ht216->ext_reg_enable) { + } else if ((svga->seqaddr >= 0x80) && ht216->ext_reg_enable) { old = ht216->ht_regs[svga->seqaddr & 0xff]; ht216->ht_regs[svga->seqaddr & 0xff] = val; + ht216_log("SeqAddr=%02x, val=%02x.\n", svga->seqaddr & 0xff, val); switch (svga->seqaddr & 0xff) { case 0x83: svga->attraddr = val & 0x1f; @@ -291,7 +295,29 @@ ht216_out(uint16_t addr, uint8_t val, void *priv) break; case 0xa4: + if (ht216->id == 0x7861) + ht216->clk_sel = (val >> 2) & 0x0f; + else { + if (svga->getclock == ics1494_getclock) { + if (val & 0x10) + val &= ~0x10; + else if (!(val & 0x10)) + val |= 0x10; + } + ht216->clk_sel = (val >> 2) & 0x07; + } + svga->miscout = (svga->miscout & ~0x0c) | ((ht216->clk_sel & 0x03) << 2); + svga->fullchange = changeframecount; + svga_recalctimings(svga); + break; case 0xf8: + if (ht216->id != 0x7861) { + if ((val & 0x06) == 0x06) + ht216->clk_sel = (val >> 5) & 0x07; + } else { + if ((val & 0x05) == 0x05) + ht216->clk_sel = (val >> 4) & 0x0f; + } svga->fullchange = changeframecount; svga_recalctimings(svga); break; @@ -555,6 +581,7 @@ ht216_in(uint16_t addr, void *priv) case 0x3c9: if (ht216->id == 0x7152) return sc1148x_ramdac_in(addr, 0, svga->ramdac, svga); + return svga_in(addr, svga); case 0x3cb: @@ -562,9 +589,6 @@ ht216_in(uint16_t addr, void *priv) return ht216->reg_3cb; break; - case 0x3cc: - return svga->miscout; - case 0x3D4: return svga->crtcreg; case 0x3D5: @@ -628,8 +652,7 @@ ht216_recalctimings(svga_t *svga) ht216_t *ht216 = (ht216_t *) svga->priv; ibm8514_t *dev = (ibm8514_t *) svga->dev8514; mach_t *mach = (mach_t *) svga->ext8514; - int high_res_256 = 0; - + int high_res_256 = 0; if (ht216->id == 0x7861) { if (ht216->ht_regs[0xe0] & 0x20) { @@ -640,23 +663,8 @@ ht216_recalctimings(svga_t *svga) } } - switch ((((((svga->miscout >> 2) & 3) || ((ht216->ht_regs[0xa4] >> 2) & 3)) | ((ht216->ht_regs[0xa4] >> 2) & 4)) || ((ht216->ht_regs[0xf8] >> 5) & 0x0f)) | ((ht216->ht_regs[0xf8] << 1) & 8)) { - case 0: - case 1: - break; - case 4: - svga->clock = (cpuclock * (double) (1ULL << 32)) / 50350000.0; - break; - case 5: - svga->clock = (cpuclock * (double) (1ULL << 32)) / 65000000.0; - break; - case 7: - svga->clock = (cpuclock * (double) (1ULL << 32)) / 40000000.0; - break; - default: - svga->clock = (cpuclock * (double) (1ULL << 32)) / 36000000.0; - break; - } + svga->clock = (cpuclock * (double) (1ULL << 32)) / svga->getclock(ht216->clk_sel, svga->clock_gen); + ht216_log("ClkSel V7=%02x, regf8=%02x, rega4=%02x, miscout=%x, vidclock=%02x.\n", ht216->clk_sel, ht216->ht_regs[0xf8], ht216->ht_regs[0xa4], (svga->miscout >> 2) & 0x03, svga->vidclock); svga->memaddr_latch |= ((ht216->ht_regs[0xf6] & 0x30) << 12); @@ -697,7 +705,6 @@ ht216_recalctimings(svga_t *svga) if (high_res_256) { svga->hdisp >>= 1; svga->dots_per_clock >>= 1; - svga->clock /= 2; ht216->adjust_cursor = 1; } svga->render = svga_render_8bpp_highres; @@ -705,7 +712,6 @@ ht216_recalctimings(svga_t *svga) if (high_res_256) { svga->hdisp >>= 1; svga->dots_per_clock >>= 1; - svga->clock /= 2; ht216->adjust_cursor = 1; svga->render = svga_render_8bpp_highres; } else { @@ -729,7 +735,6 @@ ht216_recalctimings(svga_t *svga) svga->rowoffset <<= 1; svga->hdisp >>= 1; svga->dots_per_clock >>= 1; - svga->clock /= 2; if ((svga->crtc[0x17] & 0x60) == 0x20) /*Would result in a garbled screen with trailing cursor glitches*/ svga->crtc[0x17] |= 0x40; svga->render = svga_render_15bpp_highres; @@ -1513,10 +1518,16 @@ ht216_init(const device_t *info, uint32_t mem_size, int has_rom) { ht216_t *ht216 = malloc(sizeof(ht216_t)); svga_t *svga; + const char *bios_ver = NULL; + const char *fn = NULL; memset(ht216, 0, sizeof(ht216_t)); svga = &ht216->svga; + ht216->id = info->local; + ht216->isabus = (info->flags & DEVICE_ISA) || (info->flags & DEVICE_ISA16); + ht216->mca = (info->flags & DEVICE_MCA); + if (info->flags & DEVICE_VLB) video_inform(VIDEO_FLAG_TYPE_SPECIAL, &timing_v7vga_vlb); else if (info->flags & DEVICE_MCA) @@ -1535,7 +1546,9 @@ ht216_init(const device_t *info, uint32_t mem_size, int has_rom) rom_init(&ht216->bios_rom, BIOS_G2_GC205_PATH, 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL); break; case 2: - rom_init(&ht216->bios_rom, BIOS_VIDEO7_VGA_1024I_PATH, 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL); + bios_ver = (char *) device_get_config_bios("bios_ver"); + fn = (char *) device_get_bios_file(info, bios_ver, 0); + rom_init(&ht216->bios_rom, fn, 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL); break; case 3: ht216->monitor_type = device_get_config_int("monitor_type"); @@ -1583,13 +1596,20 @@ ht216_init(const device_t *info, uint32_t mem_size, int has_rom) break; } + svga->bpp = 8; + svga->miscout = 1; svga->hwcursor.cur_ysize = 32; ht216->vram_mask = mem_size - 1; svga->decode_mask = mem_size - 1; - if (has_rom == 4) + if (ht216->id == 0x7152) { svga->ramdac = device_add(&sc11484_nors2_ramdac_device); - + svga->clock_gen = device_add(&ics1494m_540_radius_ht209_device); + svga->getclock = ics1494_getclock; + } else { + svga->clock_gen = device_add(&icd2047_20_device); + svga->getclock = icd2047_getclock; + } svga->read = ht216_read; svga->readw = NULL; svga->readl = NULL; @@ -1607,16 +1627,9 @@ ht216_init(const device_t *info, uint32_t mem_size, int has_rom) mem_mapping_set_p(&svga->mapping, ht216); mem_mapping_disable(&ht216->linear_mapping); - ht216->id = info->local; - ht216->isabus = (info->flags & DEVICE_ISA) || (info->flags & DEVICE_ISA16); - ht216->mca = (info->flags & DEVICE_MCA); - io_sethandler(0x03c0, 0x0020, ht216_in, NULL, NULL, ht216_out, NULL, NULL, ht216); io_sethandler(0x46e8, 0x0001, ht216_in, NULL, NULL, ht216_out, NULL, NULL, ht216); - svga->bpp = 8; - svga->miscout = 1; - if (ht216->id == 0x7861) ht216->ht_regs[0xb4] = 0x08; /*32-bit DRAM bus*/ @@ -1681,7 +1694,7 @@ g2_gc205_available(void) static int v7_vga_1024i_available(void) { - return rom_present(BIOS_VIDEO7_VGA_1024I_PATH); + return rom_present(BIOS_VIDEO7_VGA_1024I_219_PATH); } static int @@ -1724,6 +1737,37 @@ ht216_force_redraw(void *priv) // clang-format off static const device_config_t v7_vga_1024i_config[] = { + { + .name = "bios_ver", + .description = "BIOS Revision", + .type = CONFIG_BIOS, + .default_string = "v2_19", + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { + { + .name = "Version 2.19", + .internal_name = "v2_19", + .bios_type = BIOS_NORMAL, + .files_no = 1, + .local = 0, + .size = 32768, + .files = { BIOS_VIDEO7_VGA_1024I_219_PATH, "" } + }, + { + .name = "Version 7.00", + .internal_name = "v7_00", + .bios_type = BIOS_NORMAL, + .files_no = 1, + .local = 0, + .size = 32768, + .files = { BIOS_VIDEO7_VGA_1024I_700_PATH, "" } + }, + { .files_no = 0 } + } + }, { .name = "memory", .description = "Memory size",