Fixed video card init order.
Re-added the TI CF62011 SVGA controller, used by PS/1 and some PS/2 machines.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Define all known video cards.
|
||||
*
|
||||
* Version: @(#)vid_table.c 1.0.5 2017/11/04
|
||||
* Version: @(#)vid_table.c 1.0.6 2017/11/05
|
||||
*
|
||||
* Authors: Miran Grca, <mgrca8@gmail.com>
|
||||
* Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
@@ -62,6 +62,7 @@
|
||||
#include "vid_tgui9440.h"
|
||||
#include "vid_tvga.h"
|
||||
#include "vid_vga.h"
|
||||
#include "vid_ti_cf62011.h"
|
||||
#include "vid_wy700.h"
|
||||
|
||||
|
||||
@@ -112,6 +113,8 @@ video_cards[] = {
|
||||
{ "[ISA] OAK OTI-077", "oti077", &oti077_device, GFX_OTI077 },
|
||||
{ "[ISA] Paradise WD90C11", "wd90c11", ¶dise_wd90c11_device, GFX_WD90C11 },
|
||||
{ "[ISA] Plantronics ColorPlus", "plantronics", &colorplus_device, GFX_COLORPLUS },
|
||||
{"[ISA] TI CF62011 SVGA", "ti_cf62011",
|
||||
&ti_cf62011_device, GFX_TICF62011 },
|
||||
{ "[ISA] Trident TVGA8900D", "tvga8900d", &tvga8900d_device, GFX_TVGA },
|
||||
{ "[ISA] Tseng ET4000AX", "et4000ax", &et4000_device, GFX_ET4000 },
|
||||
{"[ISA] VGA", "vga", &vga_device, GFX_VGA },
|
||||
@@ -170,9 +173,6 @@ video_reset_card(int card)
|
||||
device_add(video_cards[video_old_to_new(card)].device);
|
||||
|
||||
#if 0
|
||||
switch (rs) {
|
||||
case ROM_IBMPCJR:
|
||||
case ROM_OLIM24:
|
||||
case ROM_PC1512:
|
||||
device_add(&pc1512_device);
|
||||
case ROM_PC1640:
|
||||
@@ -190,20 +190,6 @@ video_reset_card(int card)
|
||||
device_add(&tandy_device);
|
||||
case ROM_TANDY1000SL2:
|
||||
device_add(&tandysl_device);
|
||||
case ROM_IBMPS1_2011:
|
||||
device_add(&ps1vga_device);
|
||||
case ROM_IBMPS1_2121:
|
||||
case ROM_IBMPS2_M30_286:
|
||||
case ROM_IBMPS2_M50:
|
||||
case ROM_IBMPS2_M55SX:
|
||||
case ROM_IBMPS2_M80:
|
||||
device_add(&ps1_m2121_svga_device);
|
||||
/* Handled by the machine. */
|
||||
break;
|
||||
|
||||
default:
|
||||
device_add(video_cards[video_old_to_new(gc)].device);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
300
src/video/vid_ti_cf62011.c
Normal file
300
src/video/vid_ti_cf62011.c
Normal file
@@ -0,0 +1,300 @@
|
||||
/*
|
||||
* 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 TI CF62011 SVGA chip.
|
||||
*
|
||||
* This chip was used in several of IBM's later machines, such
|
||||
* as the PS/1 Model 2121, and a number of PS/2 models. As noted
|
||||
* in an article on Usenet:
|
||||
*
|
||||
* "In the early 90s IBM looked for some cheap VGA card to
|
||||
* substitute the (relatively) expensive XGA-2 adapter for
|
||||
* *servers*, where the primary purpose is supervision of the
|
||||
* machine rather than real *work* with it in Hi-Res. It was
|
||||
* just to supply a base video, where a XGA-2 were a waste of
|
||||
* potential. They had a contract with TI for some DSPs in
|
||||
* multimedia already (the MWave for instance is based on
|
||||
* TI-DSPs as well as many Thinkpad internal chipsets) and TI
|
||||
* offered them a rather cheap – and inexpensive – chipset
|
||||
* and combined it with a cheap clock oscillator and an Inmos
|
||||
* RAMDAC. That chipset was already pretty much outdated at
|
||||
* that time but IBM decided it would suffice for that low
|
||||
* end purpose.
|
||||
*
|
||||
* Driver support was given under DOS and OS/2 only for base
|
||||
* functions like selection of the vertical refresh and few
|
||||
* different modes only. Not even the Win 3.x support has
|
||||
* been finalized. Technically the adapter could do better
|
||||
* than VGA, but its video BIOS is largely undocumented and
|
||||
* intentionally crippled down to a few functions."
|
||||
*
|
||||
* This chip is reportedly the same one as used in the MCA
|
||||
* IBM SVGA Adapter/A (ID 090EEh), which mostly had faster
|
||||
* VRAM and RAMDAC. The VESA DOS graphics driver for that
|
||||
* card can be used: m95svga.exe
|
||||
*
|
||||
* The controller responds at ports in the range 0x2100-0x210F,
|
||||
* which are the same as the XGA. It supports up to 1MB of VRAM,
|
||||
* but we lock it down to 512K. The PS/1 2122 had 256K.
|
||||
*
|
||||
* Version: @(#)vid_ti_cf62011.c 1.0.2 2017/11/05
|
||||
*
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
*
|
||||
* Copyright 2008-2017 Sarah Walker.
|
||||
* Copyright 2016,2017 Miran Grca.
|
||||
* Copyright 2017 Fred N. van Kempen.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include "../86box.h"
|
||||
#include "../config.h"
|
||||
#include "../io.h"
|
||||
#include "../mem.h"
|
||||
#include "../rom.h"
|
||||
#include "../device.h"
|
||||
#include "../video/video.h"
|
||||
#include "../video/vid_vga.h"
|
||||
#include "../video/vid_svga.h"
|
||||
#include "vid_ti_cf62011.h"
|
||||
|
||||
|
||||
typedef struct {
|
||||
svga_t svga;
|
||||
|
||||
rom_t bios_rom;
|
||||
|
||||
uint32_t vram_size;
|
||||
|
||||
uint8_t banking;
|
||||
uint8_t reg_2100;
|
||||
uint8_t reg_210a;
|
||||
} tivga_t;
|
||||
|
||||
|
||||
static void
|
||||
vid_out(uint16_t addr, uint8_t val, void *priv)
|
||||
{
|
||||
tivga_t *ti = (tivga_t *)priv;
|
||||
svga_t *svga = &ti->svga;
|
||||
uint8_t old;
|
||||
|
||||
if (((addr & 0xfff0) == 0x3d0 ||
|
||||
(addr & 0xfff0) == 0x3b0) && !(svga->miscout & 1)) addr ^= 0x60;
|
||||
|
||||
switch (addr) {
|
||||
case 0x3D4:
|
||||
svga->crtcreg = val & 0x1f;
|
||||
return;
|
||||
|
||||
case 0x3D5:
|
||||
if ((svga->crtcreg < 7) && (svga->crtc[0x11] & 0x80))
|
||||
return;
|
||||
if ((svga->crtcreg == 7) && (svga->crtc[0x11] & 0x80))
|
||||
val = (svga->crtc[7] & ~0x10) | (val & 0x10);
|
||||
old = svga->crtc[svga->crtcreg];
|
||||
svga->crtc[svga->crtcreg] = val;
|
||||
if (old != val) {
|
||||
if (svga->crtcreg < 0xe || svga->crtcreg > 0x10) {
|
||||
svga->fullchange = changeframecount;
|
||||
svga_recalctimings(svga);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x2100:
|
||||
ti->reg_2100 = val;
|
||||
if ((val & 7) < 4)
|
||||
svga->write_bank = 0;
|
||||
else
|
||||
svga->write_bank = (ti->banking & 0x7) * 0x10000;
|
||||
svga->read_bank = svga->write_bank;
|
||||
break;
|
||||
|
||||
case 0x2108:
|
||||
if ((ti->reg_2100 & 7) >= 4)
|
||||
svga->write_bank = (val & 0x7) * 0x10000;
|
||||
svga->read_bank = svga->write_bank;
|
||||
ti->banking = val;
|
||||
break;
|
||||
|
||||
case 0x210a:
|
||||
ti->reg_210a = val;
|
||||
break;
|
||||
}
|
||||
|
||||
svga_out(addr, val, svga);
|
||||
}
|
||||
|
||||
|
||||
static uint8_t
|
||||
vid_in(uint16_t addr, void *priv)
|
||||
{
|
||||
tivga_t *ti = (tivga_t *)priv;
|
||||
svga_t *svga = &ti->svga;
|
||||
uint8_t ret;
|
||||
|
||||
if (((addr & 0xfff0) == 0x3d0 ||
|
||||
(addr & 0xfff0) == 0x3b0) && !(svga->miscout & 1)) addr ^= 0x60;
|
||||
|
||||
switch (addr) {
|
||||
case 0x100:
|
||||
ret = 0xfe;
|
||||
break;
|
||||
|
||||
case 0x101:
|
||||
ret = 0xe8;
|
||||
break;
|
||||
|
||||
case 0x3D4:
|
||||
ret = svga->crtcreg;
|
||||
break;
|
||||
|
||||
case 0x3D5:
|
||||
ret = svga->crtc[svga->crtcreg];
|
||||
break;
|
||||
|
||||
case 0x2108:
|
||||
ret = ti->banking;
|
||||
break;
|
||||
|
||||
case 0x210a:
|
||||
ret = ti->reg_210a;
|
||||
break;
|
||||
|
||||
default:
|
||||
ret = svga_in(addr, svga);
|
||||
break;
|
||||
}
|
||||
|
||||
return(ret);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
vid_speed_changed(void *priv)
|
||||
{
|
||||
tivga_t *ti = (tivga_t *)priv;
|
||||
|
||||
svga_recalctimings(&ti->svga);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
vid_force_redraw(void *priv)
|
||||
{
|
||||
tivga_t *ti = (tivga_t *)priv;
|
||||
|
||||
ti->svga.fullchange = changeframecount;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
vid_add_status_info(char *s, int max_len, void *priv)
|
||||
{
|
||||
tivga_t *ti = (tivga_t *)priv;
|
||||
|
||||
svga_add_status_info(s, max_len, &ti->svga);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
vid_close(void *priv)
|
||||
{
|
||||
tivga_t *ti = (tivga_t *)priv;
|
||||
|
||||
svga_close(&ti->svga);
|
||||
|
||||
free(ti);
|
||||
}
|
||||
|
||||
|
||||
static void *
|
||||
vid_init(device_t *info)
|
||||
{
|
||||
tivga_t *ti;
|
||||
|
||||
/* Allocate control block and initialize. */
|
||||
ti = (tivga_t *)malloc(sizeof(tivga_t));
|
||||
memset(ti, 0x00, sizeof(tivga_t));
|
||||
|
||||
/* Set amount of VRAM in KB. */
|
||||
if (info->local == 0)
|
||||
ti->vram_size = device_get_config_int("vram_size");
|
||||
else
|
||||
ti->vram_size = info->local;
|
||||
|
||||
pclog("VIDEO: initializing %s, %dK VRAM\n", info->name, ti->vram_size);
|
||||
|
||||
svga_init(&ti->svga, ti, ti->vram_size<<10, NULL, vid_in, vid_out, NULL, NULL);
|
||||
|
||||
io_sethandler(0x0100, 2, vid_in, NULL, NULL, vid_out, NULL, NULL, ti);
|
||||
io_sethandler(0x03c0, 32, vid_in, NULL, NULL, vid_out, NULL, NULL, ti);
|
||||
io_sethandler(0x2100, 16, vid_in, NULL, NULL, vid_out, NULL, NULL, ti);
|
||||
|
||||
ti->svga.bpp = 8;
|
||||
ti->svga.miscout = 1;
|
||||
|
||||
return(ti);
|
||||
}
|
||||
|
||||
|
||||
static device_config_t vid_config[] =
|
||||
{
|
||||
{
|
||||
"vram_size", "Memory Size", CONFIG_SELECTION, "", 256,
|
||||
{
|
||||
{
|
||||
"256K", 256
|
||||
},
|
||||
{
|
||||
"512K", 512
|
||||
},
|
||||
{
|
||||
"1024K", 1024
|
||||
},
|
||||
{
|
||||
""
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"", "", -1
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
device_t ti_cf62011_device = {
|
||||
"TI CF62011 SVGA",
|
||||
0,
|
||||
0,
|
||||
vid_init, vid_close, NULL,
|
||||
NULL,
|
||||
vid_speed_changed,
|
||||
vid_force_redraw,
|
||||
vid_add_status_info,
|
||||
vid_config
|
||||
};
|
||||
|
||||
|
||||
device_t ibm_ps1_2121_device = {
|
||||
"IBM PS/1 Model 2121 SVGA",
|
||||
0,
|
||||
256,
|
||||
vid_init, vid_close, NULL,
|
||||
NULL,
|
||||
vid_speed_changed,
|
||||
vid_force_redraw,
|
||||
vid_add_status_info,
|
||||
NULL
|
||||
};
|
||||
2
src/video/vid_ti_cf62011.h
Normal file
2
src/video/vid_ti_cf62011.h
Normal file
@@ -0,0 +1,2 @@
|
||||
extern device_t ti_cf62011_device;
|
||||
extern device_t ibm_ps1_2121_device;
|
||||
@@ -40,7 +40,7 @@
|
||||
* W = 3 bus clocks
|
||||
* L = 4 bus clocks
|
||||
*
|
||||
* Version: @(#)video.c 1.0.8 2017/11/04
|
||||
* Version: @(#)video.c 1.0.9 2017/11/05
|
||||
*
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -477,8 +477,6 @@ video_init(void)
|
||||
{
|
||||
int c, d, e;
|
||||
|
||||
pclog("VIDEO: initializing..\n");
|
||||
|
||||
/* Account for overscan. */
|
||||
buffer32 = create_bitmap(2048, 2048);
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Definitions for the video controller module.
|
||||
*
|
||||
* Version: @(#)video.h 1.0.2 2017/11/04
|
||||
* Version: @(#)video.h 1.0.3 2017/11/05
|
||||
*
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -91,6 +91,7 @@ enum {
|
||||
GFX_CL_GD5434, /* Cirrus Logic CL-GD5434 */
|
||||
GFX_CL_GD5436, /* Cirrus Logic CL-GD5436 */
|
||||
GFX_CL_GD5440, /* Cirrus Logic CL-GD5440 */
|
||||
GFX_TICF62011, /* TI CF62011 */
|
||||
|
||||
GFX_MAX
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user