Make it so you can switch vbioses

This commit is contained in:
starfrost013
2024-12-02 17:40:31 +00:00
parent 8101f64165
commit 9753b0eca5
4 changed files with 121 additions and 10 deletions

View File

@@ -16,10 +16,11 @@
*/
// vid_nv3.h: NV3 Architecture Hardware Reference (open-source)
// Last updated 26 November 2024
// Last updated 2 December 2024
// The GPU base structure
extern nv3_t* nv3;
extern const device_config_t nv3_config[];
#define NV3_MMIO_SIZE 0x1000000 // Max MMIO size
@@ -34,8 +35,13 @@ extern nv3_t* nv3;
#define NV3_VBIOS_DIAMOND_V330_V162 "roms/video/nvidia/nv3/diamond_v330_rev-e.vbi" // Diamond Multimedia Systems, Inc. Viper V330 Version 1.62-CO
#define NV3_VBIOS_ASUS_V3000_V151 "roms/video/nvidia/nv3/riva128_asus.vbi" // ASUS AGP/3DP-V3000 BIOS 1.51B
#define NV3_VBIOS_STB_V128_V182 "roms/video/nvidia/nv3/riva128_stb.vbi" // STB Velocity 128 (RIVA 128) Ver.1.82
#define NV3T_VBIOS_REFERENCE_CEK_V171 "roms/video/nvidia/nv3/BIOS_49_Riva 128" // Reference BIOS: RIVA 128 ZX BIOS - V1.71B-N (C) 1996-98 NVidia Corporation
#define NV3T_VBIOS_DIAMOND_V330_V182B "roms/video/nvidia/nv3/nv3t182b.rom" // Diamond Multimedia Viper V330 8M BIOS - Version 1.82B
#define NV3T_VBIOS_ASUS_V170 "roms/video/nvidia/nv3/A170D03T.rom" // ASUS AGP-V3000 ZXTV BIOS - V1.70D.03 (C) 1996-98 Nvidia Corporation
#define NV3T_VBIOS_REFERENCE_CEK_V171 "roms/video/nvidia/nv3/BIOS_49_Riva 128" // Reference BIOS: RIVA 128 ZX BIOS - V1.71B-N (C) 1996-98 NVidia Corporation
#define NV3T_VBIOS_REFERENCE_CEK_V172 "roms/video/nvidia/nv3/vgasgram.rom" // Reference(?) BIOS: RIVA 128 ZX BIOS - V1.72B (C) 1996-98 NVidia Corporation
// The default VBIOS to use
#define NV3_VBIOS_DEFAULT NV3_VBIOS_ERAZOR_V15403
// Temporary, will be loaded from settings
#define VRAM_SIZE_2MB 0x200000 // 2MB

View File

@@ -29,7 +29,7 @@ add_library(vid OBJECT agpgart.c video.c vid_table.c vid_cga.c vid_cga_comp.c
vid_tvp3026_ramdac.c vid_att2xc498_ramdac.c vid_xga.c
vid_bochs_vbe.c
nv/nv_base.c
nv/nv3/nv3_core.c nv/nv3/nv3_core_arbiter.c nv/nv3/nv3_interrupt.c
nv/nv3/nv3_core.c nv/nv3/nv3_core_config.c nv/nv3/nv3_core_arbiter.c nv/nv3/nv3_interrupt.c
nv/nv3/subsystems/nv3_pramdac.c
nv/nv3/subsystems/nv3_pfifo.c
nv/nv3/subsystems/nv3_pgraph.c

View File

@@ -734,15 +734,22 @@ void* nv3_init(const device_t *info)
{
nv_log("NV3: initialising core\n");
// currently using ELSA VICTORY Erazor Ver. 1.54.03 [WD/VBE30/DDC2B/DPMS]
// ELSA VICTORY Erazor Ver. 1.55.00 [WD/VBE30/DDC2B/DPMS] seems to be broken :(
int32_t err = rom_init(&nv3->nvbase.vbios, NV3_VBIOS_ERAZOR_V15403, 0xC0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL);
// Figure out which vbios the user selected
const char* vbios_id = device_get_config_bios("VBIOS");
const char* vbios_file = "";
// depends on the bus we are using
if (nv3->nvbase.bus_generation == nv_bus_pci)
vbios_file = device_get_bios_file(&nv3_device_pci, vbios_id, 0);
else
vbios_file = device_get_bios_file(&nv3_device_agp, vbios_id, 0);
int32_t err = rom_init(&nv3->nvbase.vbios, vbios_file, 0xC0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL);
if (err)
nv_log("NV3: failed to load VBIOS err=%d\n", err);
else
nv_log("NV3: Successfully loaded VBIOS %s\n", NV3_VBIOS_ERAZOR_V15403);
nv_log("NV3: Successfully loaded VBIOS %s located at %s\n", vbios_id, vbios_file);
// set up the bus and start setting up SVGA core
if (nv3->nvbase.bus_generation == nv_bus_pci)
@@ -818,7 +825,8 @@ const device_t nv3_device_pci =
.init = nv3_init_pci,
.close = nv3_close,
.speed_changed = nv3_speed_changed,
.force_redraw = nv3_force_redraw
.force_redraw = nv3_force_redraw,
.config = nv3_config,
};
// NV3 (RIVA 128)
@@ -833,5 +841,6 @@ const device_t nv3_device_agp =
.init = nv3_init_agp,
.close = nv3_close,
.speed_changed = nv3_speed_changed,
.force_redraw = nv3_force_redraw
.force_redraw = nv3_force_redraw,
.config = nv3_config,
};

View File

@@ -0,0 +1,96 @@
/*
* 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.
*
* Provides NV3 configuration
*
*
* Authors: Connor Hyde, <mario64crashed@gmail.com> I need a better email address ;^)
*
* Copyright 2024 starfrost
*/
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
#include <stdio.h>
#include <86Box/86box.h>
#include <86Box/device.h>
#include <86Box/mem.h>
#include <86box/io.h>
#include <86box/pci.h>
#include <86Box/rom.h> // DEPENDENT!!!
#include <86Box/video.h>
#include <86Box/nv/vid_nv.h>
#include <86Box/nv/vid_nv3.h>
const device_config_t nv3_config[] =
{
{
.name = "VBIOS",
.description = "VBIOS",
.type = CONFIG_BIOS,
.default_string = "NV3_VBIOS_ERAZOR_V15403",
.default_int = 0,
.bios =
{
{
.name = "[NV3 - 1997-09-30] ELSA VICTORY Erazor VBE 3.0 DDC2B DPMS Video BIOS Ver. 1.47.01 (ZZ/ A/00)", .files_no = 1,
.internal_name = "NV3_VBIOS_ERAZOR_V14700",
.files = {NV3_VBIOS_ERAZOR_V14700, ""}
},
{
.name = "[NV3 - 1998-02-06] ELSA VICTORY Erazor Ver. 1.54.03 [WD/VBE30/DDC2B/DPMS]", .files_no = 1,
.internal_name = "NV3_VBIOS_ERAZOR_V15403",
.files = {NV3_VBIOS_ERAZOR_V15403, ""}
},
{
.name = "[NV3 - 1998-05-04] ELSA VICTORY Erazor Ver. 1.55.00 [WD/VBE30/DDC2B/DPMS]", .files_no = 1,
.internal_name = "NV3_VBIOS_ERAZOR_V15500",
.files = {NV3_VBIOS_ERAZOR_V15500, ""}
},
{
.name = "[NV3 - 1998-01-14] Diamond Multimedia Systems, Inc. Viper V330 Version 1.62-CO", .files_no = 1,
.internal_name = "NV3_VBIOS_DIAMOND_V330_V162",
.files = {NV3_VBIOS_DIAMOND_V330_V162, ""},
},
{
.name = "[NV3 - 1997-09-06] ASUS AGP/3DP-V3000 BIOS 1.51B", .files_no = 1,
.internal_name = "NV3_VBIOS_ASUS_V3000_V151",
.files = {NV3_VBIOS_ASUS_V3000_V151, ""},
},
{
.name = "[NV3 - 1997-12-17] STB Velocity 128 (RIVA 128) Ver.1.82", .files_no = 1,
.internal_name = "NV3_VBIOS_STB_V128_V182",
.files = {NV3_VBIOS_STB_V128_V182, ""},
},
{
.name = "[NV3T - 1998-09-15] Diamond Multimedia Viper V330 8M BIOS - Version 1.82B", .files_no = 1,
.internal_name = "NV3T_VBIOS_DIAMOND_V330_V182B",
.files = {NV3T_VBIOS_DIAMOND_V330_V182B, ""},
},
{
.name = "[NV3T - 1998-08-04] ASUS AGP-V3000 ZXTV BIOS - V1.70D.03", .files_no = 1,
.internal_name = "NV3T_VBIOS_ASUS_V170",
.files = {NV3T_VBIOS_ASUS_V170, ""},
},
{
.name = "[NV3T - 1998-07-30] RIVA 128 ZX BIOS - V1.71B-N", .files_no = 1,
.internal_name = "NV3T_VBIOS_REFERENCE_CEK_V171",
.files = {NV3T_VBIOS_REFERENCE_CEK_V171, ""},
},
{
.name = "[NV3T+SGRAM - 1998-08-15] RIVA 128 ZX BIOS - V1.72B", .files_no = 1,
.internal_name = "NV3T_VBIOS_REFERENCE_CEK_V172",
.files = {NV3T_VBIOS_REFERENCE_CEK_V172, ""},
},
}
},
{
.type = CONFIG_END
}
};