Add NEC SV9000 (Trident TVGA9000B)

This commit is contained in:
Cacodemon345
2022-10-02 01:35:17 +06:00
parent d8fa6ca2ca
commit a6c9af3064
3 changed files with 32 additions and 9 deletions

View File

@@ -509,6 +509,7 @@ extern const device_t ibm_ps1_2121_device;
extern const device_t tvga8900b_device; extern const device_t tvga8900b_device;
extern const device_t tvga8900d_device; extern const device_t tvga8900d_device;
extern const device_t tvga9000b_device; extern const device_t tvga9000b_device;
extern const device_t nec_sv9000_device;
/* IBM VGA */ /* IBM VGA */
extern const device_t vga_device; extern const device_t vga_device;

View File

@@ -139,6 +139,7 @@ video_cards[] = {
{ &tvga8900b_device }, { &tvga8900b_device },
{ &tvga8900d_device }, { &tvga8900d_device },
{ &tvga9000b_device }, { &tvga9000b_device },
{ &nec_sv9000_device },
{ &et4000k_isa_device }, { &et4000k_isa_device },
{ &et2000_device }, { &et2000_device },
{ &et4000_isa_device }, { &et4000_isa_device },

View File

@@ -38,6 +38,7 @@
#define ROM_TVGA_8900B "roms/video/tvga/tvga8900b.vbi" #define ROM_TVGA_8900B "roms/video/tvga/tvga8900b.vbi"
#define ROM_TVGA_8900CLD "roms/video/tvga/trident.bin" #define ROM_TVGA_8900CLD "roms/video/tvga/trident.bin"
#define ROM_TVGA_9000B "roms/video/tvga/tvga9000b.bin" #define ROM_TVGA_9000B "roms/video/tvga/tvga9000b.bin"
#define ROM_TVGA_9000B_NEC_SV9000 "roms/video/tvga/SV9000.VBI"
typedef struct tvga_t { typedef struct tvga_t {
mem_mapping_t linear_mapping; mem_mapping_t linear_mapping;
@@ -389,7 +390,9 @@ tvga_init(const device_t *info)
tvga_t *tvga = malloc(sizeof(tvga_t)); tvga_t *tvga = malloc(sizeof(tvga_t));
memset(tvga, 0, sizeof(tvga_t)); memset(tvga, 0, sizeof(tvga_t));
if (info->local == TVGA9000B_ID) { tvga->card_id = info->local & 0xFF;
if (tvga->card_id == TVGA9000B_ID) {
video_inform(VIDEO_FLAG_TYPE_SPECIAL, &timing_tvga9000); video_inform(VIDEO_FLAG_TYPE_SPECIAL, &timing_tvga9000);
tvga->vram_size = 512 << 10; tvga->vram_size = 512 << 10;
} else { } else {
@@ -399,9 +402,7 @@ tvga_init(const device_t *info)
tvga->vram_mask = tvga->vram_size - 1; tvga->vram_mask = tvga->vram_size - 1;
tvga->card_id = info->local; switch (tvga->card_id) {
switch (info->local) {
case TVGA8900B_ID: case TVGA8900B_ID:
bios_fn = ROM_TVGA_8900B; bios_fn = ROM_TVGA_8900B;
break; break;
@@ -409,7 +410,7 @@ tvga_init(const device_t *info)
bios_fn = ROM_TVGA_8900CLD; bios_fn = ROM_TVGA_8900CLD;
break; break;
case TVGA9000B_ID: case TVGA9000B_ID:
bios_fn = ROM_TVGA_9000B; bios_fn = (info->local & 0x100) ? ROM_TVGA_9000B_NEC_SV9000 : ROM_TVGA_9000B;
break; break;
default: default:
free(tvga); free(tvga);
@@ -424,7 +425,7 @@ tvga_init(const device_t *info)
NULL, NULL,
NULL); NULL);
if (info->local != TVGA9000B_ID) if (tvga->card_id != TVGA9000B_ID)
tvga->svga.ramdac = device_add(&tkd8001_ramdac_device); tvga->svga.ramdac = device_add(&tkd8001_ramdac_device);
io_sethandler(0x03c0, 0x0020, tvga_in, NULL, NULL, tvga_out, NULL, NULL, tvga); io_sethandler(0x03c0, 0x0020, tvga_in, NULL, NULL, tvga_out, NULL, NULL, tvga);
@@ -450,6 +451,12 @@ tvga9000b_available(void)
return rom_present(ROM_TVGA_9000B); return rom_present(ROM_TVGA_9000B);
} }
static int
tvga9000b_nec_sv9000_available(void)
{
return rom_present(ROM_TVGA_9000B_NEC_SV9000);
}
void void
tvga_close(void *p) tvga_close(void *p)
{ {
@@ -549,3 +556,17 @@ const device_t tvga9000b_device = {
.force_redraw = tvga_force_redraw, .force_redraw = tvga_force_redraw,
.config = NULL .config = NULL
}; };
const device_t nec_sv9000_device = {
.name = "NEC SV9000 (Trident TVGA 9000B)",
.internal_name = "tvga9000b",
.flags = DEVICE_ISA,
.local = TVGA9000B_ID | 0x100,
.init = tvga_init,
.close = tvga_close,
.reset = NULL,
{ .available = tvga9000b_nec_sv9000_available },
.speed_changed = tvga_speed_changed,
.force_redraw = tvga_force_redraw,
.config = NULL
};