mirror of
https://github.com/86Box/86Box.git
synced 2026-02-23 01:48:21 -07:00
Merge alls hit from nvplayground
This commit is contained in:
161
src/include/86box/nv/vid_nv1.h
Normal file
161
src/include/86box/nv/vid_nv1.h
Normal file
@@ -0,0 +1,161 @@
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
* Quadratic Heaven
|
||||
*
|
||||
* Authors: Connor Hyde <mario64crashed@gmail.com>
|
||||
*
|
||||
* Copyright 2024-2025 Connor Hyde
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
extern const device_config_t nv1_config[]; // Config for RIVA 128 (revision A/B)
|
||||
|
||||
//
|
||||
// PCI Bus Information
|
||||
//
|
||||
|
||||
#define NV1_PCI_BAR0_SIZE 0xFFFFFF
|
||||
|
||||
//
|
||||
// VRAM
|
||||
//
|
||||
#define NV1_VRAM_SIZE_1MB 0x100000
|
||||
#define NV1_VRAM_SIZE_2MB 0x200000
|
||||
#define NV1_VRAM_SIZE_4MB 0x400000
|
||||
|
||||
// Video BIOS
|
||||
#define NV1_VBIOS_E3D_2X00 "roms/video/nvidia/nv1/Diamond_Edge_3D_2x00.BIN"
|
||||
#define NV1_VBIOS_E3D_3X00 "roms/video/nvidia/nv1/Diamond_Edge_3D_3400_BIOS_M27C256.BIN"
|
||||
|
||||
//
|
||||
// PMC
|
||||
//
|
||||
#define NV1_PMC_BOOT_0 0x0
|
||||
#define NV1_PMC_BOOT_0_REVISION 0
|
||||
|
||||
#define NV1_PMC_BOOT_0_REVISION_A 0x0 // Prototype (1994)
|
||||
#define NV1_PMC_BOOT_0_REVISION_B1 0x0 // Prototype (early 1995)
|
||||
#define NV1_PMC_BOOT_0_REVISION_B2 0x0 // Prototype (mid 1995)
|
||||
#define NV1_PMC_BOOT_0_REVISION_B3 0x0 // Final?
|
||||
#define NV1_PMC_BOOT_0_REVISION_C 0x0 // Final?
|
||||
|
||||
#define NV1_PMC_BOOT_0_IMPLEMENTATION 8
|
||||
#define NV1_PMC_BOOT_0_IMPLEMENTATION_NV0 0x1 // Nvidia Hardware Simulator (1993-1994)
|
||||
#define NV1_PMC_BOOT_0_IMPLEMENTATION_NV1_D32 0x2 // NV1 + DRAM + SGS-Thomson STG-1732/1764 DAC
|
||||
#define NV1_PMC_BOOT_0_IMPLEMENTATION_NV1_V32 0x3 // NV1 + VRAM + SGS-Thomson STG-1732/1764 DAC
|
||||
#define NV1_PMC_BOOT_0_IMPLEMENTATION_PICASSO 0x4 // NV1 + VRAM + NV 128-bit DAC
|
||||
|
||||
|
||||
// Defines the NV architecture version (NV1/NV2/...)
|
||||
#define NV1_PMC_BOOT_0_ARCHITECTURE 16
|
||||
#define NV1_PMC_BOOT_0_ARCHITECTURE_NV0 0x0 // Nvidia Hardware Simulator (1993-1994)
|
||||
#define NV1_PMC_BOOT_0_ARCHITECTURE_NV1 0x1 // NV1 (1995)
|
||||
#define NV1_PMC_BOOT_0_ARCHITECTURE_NV2 0x2 // Mutara (1996, cancelled)
|
||||
|
||||
#define NV1_PMC_DEBUG_0 0x80
|
||||
|
||||
#define NV1_PMC_INTR_0 0x100
|
||||
#define NV1_PMC_INTR_EN_0 0x140
|
||||
|
||||
#define NV1_PMC_INTR_EN_0_INTA 0
|
||||
#define NV1_PMC_INTR_EN_0_INTB 4
|
||||
#define NV1_PMC_INTR_EN_0_INTC 8
|
||||
#define NV1_PMC_INTR_EN_0_INTD 12
|
||||
|
||||
#define NV1_PMC_INTR_EN_0_DISABLED 0x0
|
||||
#define NV1_PMC_INTR_EN_0_HARDWARE 0x1
|
||||
#define NV1_PMC_INTR_EN_0_SOFTWARE 0x2
|
||||
#define NV1_PMC_INTR_EN_0_ALL 0x3 // (HARDWARE | SOFTWARE)
|
||||
|
||||
#define NV1_PMC_INTR_READ 0x160
|
||||
|
||||
//TODO: DEFINE bits
|
||||
#define NV1_PMC_ENABLE 0x200
|
||||
|
||||
//
|
||||
// PRAMIN
|
||||
//
|
||||
|
||||
#define NV1_RAMIN_START 0x100000
|
||||
|
||||
//
|
||||
// PAUTH
|
||||
// Scary nvidia mode
|
||||
//
|
||||
|
||||
// Read only
|
||||
#define NV1_PAUTH_DEBUG_0 0x605080
|
||||
#define NV1_PAUTH_DEBUG_0_BREACH_DETECTED 0
|
||||
#define NV1_PAUTH_DEBUG_0_EEPROM_INVALID 4
|
||||
|
||||
#define NV1_PAUTH_CHIP_TOKEN_0 0x605400
|
||||
#define NV1_PAUTH_CHIP_TOKEN_1 0x605404
|
||||
#define NV1_PAUTH_PASSWORD_0(i) 0x605800+(i*16)
|
||||
#define NV1_PAUTH_PASSWORD_1(i) 0x605804+(i*16)
|
||||
#define NV1_PAUTH_PASSWORD_2(i) 0x605808+(i*16)
|
||||
#define NV1_PAUTH_PASSWORD_3(i) 0x60580C+(i*16)
|
||||
|
||||
#define NV1_PAUTH_PASSWORD_SIZE 128
|
||||
|
||||
//
|
||||
// PFB
|
||||
//
|
||||
|
||||
#define NV1_PFB_BOOT_0 0x600000
|
||||
|
||||
#define NV1_PFB_BOOT_0_RAM_AMOUNT 0
|
||||
#define NV1_PFB_BOOT_0_RAM_AMOUNT_1MB 0x0
|
||||
#define NV1_PFB_BOOT_0_RAM_AMOUNT_2MB 0x1
|
||||
#define NV1_PFB_BOOT_0_RAM_AMOUNT_4MB 0x2
|
||||
|
||||
//
|
||||
// PEXTDEV
|
||||
//
|
||||
|
||||
#define NV1_STRAPS 0x608000
|
||||
#define NV1_STRAPS_STRAP_VENDOR 0
|
||||
|
||||
//
|
||||
// PRAM+RAMIN
|
||||
//
|
||||
|
||||
#define NV1_PRAM_CONFIG 0x602200
|
||||
#define NV1_PRAM_CONFIG_SIZE 0
|
||||
#define NV1_PRAM_CONFIG_12KB 0
|
||||
#define NV1_PRAM_CONFIG_20KB 1
|
||||
#define NV1_PRAM_CONFIG_36KB 2
|
||||
#define NV1_PRAM_CONFIG_68KB 3
|
||||
|
||||
// Position of RAMPW in RAMIN
|
||||
#define NV1_RAMPW_POSITION_CONFIG0 0x2c00
|
||||
#define NV1_RAMPW_POSITION_CONFIG1 0x4c00
|
||||
#define NV1_RAMPW_POSITION_CONFIG2 0x8c00
|
||||
#define NV1_RAMPW_POSITION_CONFIG3 0x10c00
|
||||
|
||||
// Static RAMPW mirror
|
||||
#define NV1_PRAMPW 0x606000
|
||||
#define NV1_RAMPW_SIZE 0x400
|
||||
|
||||
//
|
||||
// PROM
|
||||
//
|
||||
#define NV1_PROM 0x601000
|
||||
#define NV1_PROM_SIZE 32768
|
||||
|
||||
// Device Core
|
||||
void nv1_init();
|
||||
void nv1_close(void* priv);
|
||||
void nv1_speed_changed(void *priv);
|
||||
void nv1_draw_cursor(svga_t* svga, int32_t drawline);
|
||||
void nv1_recalc_timings(svga_t* svga);
|
||||
void nv1_force_redraw(void* priv);
|
||||
141
src/include/86box/nv/vid_nv4.h
Normal file
141
src/include/86box/nv/vid_nv4.h
Normal file
@@ -0,0 +1,141 @@
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
* Riva TNT hardware defines
|
||||
*
|
||||
* Authors: Connor Hyde <mario64crashed@gmail.com>
|
||||
*
|
||||
* Copyright 2024-2025 Connor Hyde
|
||||
*/
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
extern const device_config_t nv4_config[]; // Config for RIVA 128 (revision A/B)
|
||||
|
||||
//
|
||||
// General
|
||||
//
|
||||
#define NV4_VRAM_SIZE_2MB 0x200000 // 2MB (never used; NV4 only)
|
||||
#define NV4_VRAM_SIZE_4MB 0x400000 // 4MB (never used)
|
||||
#define NV4_VRAM_SIZE_8MB 0x800000 // 8MB
|
||||
#define NV4_VRAM_SIZE_16MB 0x1000000 // 16MB
|
||||
#define NV5_VRAM_SIZE_32MB 0x2000000 // NV5 only
|
||||
|
||||
#define NV4_MMIO_SIZE 0x1000000 // not sure. May be larger!!!!
|
||||
|
||||
//
|
||||
// VBIOS
|
||||
//
|
||||
#define NV4_VBIOS_STB_REVA "roms/video/nvidia/nv4/NV4_STB_velocity.rom"
|
||||
|
||||
//
|
||||
// PMC
|
||||
//
|
||||
|
||||
#define NV4_PMC_START 0x0
|
||||
|
||||
#define NV4_PMC_INTR 0x100
|
||||
#define NV4_PMC_INTR_PMEDIA_PENDING 4
|
||||
#define NV4_PMC_INTR_PFIFO_PENDING 8
|
||||
#define NV4_PMC_INTR_PGRAPH_PENDING 12
|
||||
#define NV4_PMC_INTR_PVIDEO_PENDING 16
|
||||
#define NV4_PMC_INTR_PTIMER_PENDING 20
|
||||
#define NV4_PMC_INTR_PCRTC_PENDING 24
|
||||
#define NV4_PMC_INTR_PBUS_PENDING 28
|
||||
#define NV4_PMC_INTR_SOFTWARE_PENDING 31
|
||||
|
||||
#define NV4_PMC_INTR_EN 0x140
|
||||
#define NV4_PMC_INTR_EN_DISABLED 0x0
|
||||
#define NV4_PMC_INTR_EN_SOFTWARE 0x1
|
||||
#define NV4_PMC_INTR_EN_HARDWARE 0x2
|
||||
#define NV4_PMC_INTR_EN_ALL 0x3
|
||||
|
||||
#define NV4_PMC_BOOT 0x0
|
||||
#define NV4_PMC_ENABLE 0x200
|
||||
#define NV4_PMC_ENABLE_PMEDIA 4 // Enable mediaport external MPEG decoder engine
|
||||
#define NV4_PMC_ENABLE_PFIFO 8 // Enable FIFO
|
||||
#define NV4_PMC_ENABLE_PGRAPH 12
|
||||
#define NV4_PMC_ENABLE_PPMI 16
|
||||
#define NV4_PMC_ENABLE_PFB 20
|
||||
#define NV4_PMC_ENABLE_PCRTC 24
|
||||
#define NV4_PMC_ENABLE_PVIDEO 28
|
||||
|
||||
//
|
||||
// PFB
|
||||
//
|
||||
|
||||
#define NV4_PFB_START 0x100000
|
||||
#define NV4_PFB_BOOT 0x100000
|
||||
#define NV4_PFB_BOOT_RAM_AMOUNT 0
|
||||
#define NV4_PFB_BOOT_RAM_AMOUNT_2MB 0x0
|
||||
#define NV4_PFB_BOOT_RAM_AMOUNT_4MB 0x1
|
||||
#define NV4_PFB_BOOT_RAM_AMOUNT_8MB 0x2
|
||||
#define NV4_PFB_BOOT_RAM_AMOUNT_16MB 0x3
|
||||
#define NV5_PFB_BOOT_RAM_AMOUNT_32MB 0x0
|
||||
|
||||
#define NV4_PSTRAPS 0x101000
|
||||
|
||||
#define NV4_PSTRAPS_CRYSTAL 6
|
||||
#define NV4_PSTRAPS_CRYSTAL_13500K 0x0
|
||||
#define NV4_PSTRAPS_CRYSTAL_14318180 0x1
|
||||
|
||||
//
|
||||
// PRAMDAC
|
||||
//
|
||||
|
||||
#define NV4_PRAMDAC_START 0x680300
|
||||
#define NV4_PRAMDAC_CURSOR_START_POSITION 0x680300
|
||||
|
||||
#define NV4_PRAMDAC_CURSOR_SIZE_X 32
|
||||
#define NV4_PRAMDAC_CURSOR_SIZE_Y 32
|
||||
|
||||
// Same for all 3 clocks
|
||||
#define NV4_PRAMDAC_CLOCK_VDIV 0
|
||||
#define NV4_PRAMDAC_CLOCK_NDIV 8
|
||||
#define NV4_PRAMDAC_CLOCK_PDIV 16
|
||||
|
||||
#define NV4_PRAMDAC_CLOCK_CORE 0x680500 // NVPLL
|
||||
#define NV4_PRAMDAC_CLOCK_MEMORY 0x680504
|
||||
#define NV4_PRAMDAC_CLOCK_PIXEL 0x680508
|
||||
#define NV4_PRAMDAC_COEFF_SELECT 0x68050C
|
||||
#define NV4_PRAMDAC_COEFF_SELECT_VPLL_SOURCE 0
|
||||
#define NV4_PRAMDAC_COEFF_SELECT_VPLL_SOURCE_XTAL 0x0
|
||||
#define NV4_PRAMDAC_COEFF_SELECT_VPLL_SOURCE_VIP 0x1
|
||||
#define NV4_PRAMDAC_COEFF_SELECT_SOURCE 8 // Bit not set = hardware, otherwise software
|
||||
#define NV4_PRAMDAC_COEFF_SELECT_MPLL_IS_SOFTWARE 0x1
|
||||
#define NV4_PRAMDAC_COEFF_SELECT_VPLL_IS_SOFTWARE 0x2
|
||||
#define NV4_PRAMDAC_COEFF_SELECT_NVPLL_IS_SOFTWARE 0x4
|
||||
#define NV4_PRAMDAC_COEFF_SELECT_ALL_SOFTWARE 0x7
|
||||
#define NV4_PRAMDAC_COEFF_SELECT_VS_PCLK_TV 16
|
||||
#define NV4_PRAMDAC_COEFF_SELECT_VS_PCLK_TV_NONE 0x0
|
||||
#define NV4_PRAMDAC_COEFF_SELECT_VS_PCLK_TV_VSCLK 0x1
|
||||
#define NV4_PRAMDAC_COEFF_SELECT_VS_PCLK_TV_PCLK 0x2
|
||||
#define NV4_PRAMDAC_COEFF_SELECT_VS_PCLK_TV_BOTH 0x3
|
||||
#define NV4_PRAMDAC_COEFF_SELECT_TVCLK_SOURCE 20
|
||||
#define NV4_PRAMDAC_COEFF_SELECT_TVCLK_SOURCE_EXT 0x0
|
||||
#define NV4_PRAMDAC_COEFF_SELECT_TVCLK_SOURCE_VIP 0x1 // VIP = Video Interface Port / Mediaport
|
||||
#define NV4_PRAMDAC_COEFF_SELECT_TVCLK_RATIO 24
|
||||
#define NV4_PRAMDAC_COEFF_SELECT_TVCLK_RATIO_DB1 0x0
|
||||
#define NV4_PRAMDAC_COEFF_SELECT_TVCLK_RATIO_DB2 0x1
|
||||
#define NV4_PRAMDAC_COEFF_SELECT_VCLK_RATIO 28
|
||||
#define NV4_PRAMDAC_COEFF_SELECT_VCLK_RATIO_DB1 0x0
|
||||
#define NV4_PRAMDAC_COEFF_SELECT_VCLK_RATIO_DB2 0x1
|
||||
|
||||
#define NV4_PRAMDAC_GENERAL_CONTROL 0x680600
|
||||
#define NV4_PRAMDAC_GENERAL_CONTROL_ALT_MODE 12
|
||||
|
||||
#define NV4_RAMIN_START 0x700000 // Nominal. In reality PROM is here on real NV4
|
||||
|
||||
// Device Core
|
||||
void nv4_init();
|
||||
void nv4_close(void* priv);
|
||||
void nv4_speed_changed(void *priv);
|
||||
void nv4_draw_cursor(svga_t* svga, int32_t drawline);
|
||||
void nv4_recalc_timings(svga_t* svga);
|
||||
void nv4_force_redraw(void* priv);
|
||||
@@ -626,10 +626,13 @@ extern const device_t voodoo_3_3500_se_agp_device;
|
||||
extern const device_t voodoo_3_3500_si_agp_device;
|
||||
extern const device_t velocity_100_agp_device;
|
||||
extern const device_t velocity_200_agp_device;
|
||||
extern const device_t nv1_device_edge2k;
|
||||
extern const device_t nv1_device_edge3k;
|
||||
extern const device_t nv3_device_pci;
|
||||
extern const device_t nv3_device_agp;
|
||||
extern const device_t nv3t_device_pci;
|
||||
extern const device_t nv3t_device_agp;
|
||||
extern const device_t nv4_device_agp;
|
||||
|
||||
/* Wyse 700 */
|
||||
extern const device_t wy700_device;
|
||||
|
||||
@@ -139,6 +139,10 @@ add_library(vid OBJECT
|
||||
nv/nv_base.c
|
||||
nv/nv_rivatimer.c
|
||||
|
||||
# NVidia NV1
|
||||
nv/nv1/nv1_core.c
|
||||
nv/nv1/nv1_core_config.c
|
||||
|
||||
# NVidia RIVA 128 - Subsystems
|
||||
nv/nv3/nv3_core.c
|
||||
nv/nv3/nv3_core_config.c
|
||||
@@ -192,6 +196,10 @@ add_library(vid OBJECT
|
||||
nv/nv3/render/nv3_render_primitives.c
|
||||
nv/nv3/render/nv3_render_blit.c
|
||||
|
||||
# NVidia RIVA TNT/TNT2 - Core
|
||||
nv/nv4/nv4_core.c
|
||||
nv/nv4/nv4_core_config.c
|
||||
|
||||
# Generic
|
||||
vid_bochs_vbe.c
|
||||
)
|
||||
|
||||
110
src/video/nv/nv1/nv1_core.c
Normal file
110
src/video/nv/nv1/nv1_core.c
Normal file
@@ -0,0 +1,110 @@
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
* NV3 bringup and device emulation.
|
||||
*
|
||||
*
|
||||
* Authors: Connor Hyde, <mario64crashed@gmail.com> I need a better email address ;^)
|
||||
*
|
||||
* Copyright 2024-2025 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_nv1.h>
|
||||
|
||||
|
||||
void nv1_init()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void* nv1_init_edge2k(const device_t *info)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void* nv1_init_edge3k(const device_t *info)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void nv1_close(void* priv)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void nv1_speed_changed(void *priv)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void nv1_draw_cursor(svga_t* svga, int32_t drawline)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void nv1_recalc_timings(svga_t* svga)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void nv1_force_redraw(void* priv)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// See if the bios rom is available.
|
||||
int32_t nv1_available(void)
|
||||
{
|
||||
return (rom_present(NV1_VBIOS_E3D_2X00)
|
||||
|| rom_present(NV1_VBIOS_E3D_3X00));
|
||||
}
|
||||
|
||||
// NV3 (RIVA 128)
|
||||
// PCI
|
||||
// 2MB or 4MB VRAM
|
||||
const device_t nv1_device_edge2k =
|
||||
{
|
||||
.name = "nVIDIA NV1 [Diamond Edge 3D 2x00] [Not Direct3D Compatible]",
|
||||
.internal_name = "nv1_edge2k",
|
||||
.flags = DEVICE_PCI,
|
||||
.local = 0,
|
||||
.init = nv1_init_edge2k,
|
||||
.close = nv1_close,
|
||||
.speed_changed = nv1_speed_changed,
|
||||
.force_redraw = nv1_force_redraw,
|
||||
.available = nv1_available,
|
||||
.config = nv1_config,
|
||||
};
|
||||
|
||||
// NV3 (RIVA 128)
|
||||
// AGP
|
||||
// 2MB or 4MB VRAM
|
||||
const device_t nv1_device_edge3k =
|
||||
{
|
||||
.name = "nVIDIA NV1 [Diamond Edge 3D 3x00] [Not Direct3D Compatible]",
|
||||
.internal_name = "nv1_edge3k",
|
||||
.flags = DEVICE_PCI,
|
||||
.local = 0,
|
||||
.init = nv1_init_edge3k,
|
||||
.close = nv1_close,
|
||||
.speed_changed = nv1_speed_changed,
|
||||
.force_redraw = nv1_force_redraw,
|
||||
.available = nv1_available,
|
||||
.config = nv1_config,
|
||||
};
|
||||
133
src/video/nv/nv1/nv1_core_config.c
Normal file
133
src/video/nv/nv1/nv1_core_config.c
Normal file
@@ -0,0 +1,133 @@
|
||||
/*
|
||||
* 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 NV4 configuration
|
||||
*
|
||||
*
|
||||
* Authors: Connor Hyde, <mario64crashed@gmail.com> I need a better email address ;^)
|
||||
*
|
||||
* Copyright 2024-2025 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_nv1.h>
|
||||
|
||||
const device_config_t nv1_config[] =
|
||||
{
|
||||
// Memory configuration
|
||||
{
|
||||
.name = "vram_size",
|
||||
.description = "VRAM Size",
|
||||
.type = CONFIG_SELECTION,
|
||||
.default_int = NV1_VRAM_SIZE_4MB,
|
||||
.selection =
|
||||
{
|
||||
// I thought this was never released, but it seems that at least one was released:
|
||||
// The card was called the "NEC G7AGK"
|
||||
{
|
||||
.description = "1 MB",
|
||||
.value = NV1_VRAM_SIZE_1MB,
|
||||
},
|
||||
{
|
||||
.description = "2 MB",
|
||||
.value = NV1_VRAM_SIZE_2MB,
|
||||
},
|
||||
{
|
||||
.description = "4 MB",
|
||||
.value = NV1_VRAM_SIZE_4MB,
|
||||
},
|
||||
}
|
||||
|
||||
},
|
||||
// Multithreading configuration
|
||||
{
|
||||
|
||||
.name = "pgraph_threads",
|
||||
#ifndef RELEASE_BUILD
|
||||
.description = "PFIFO/PGRAPH - Number of threads to split large object method execution into",
|
||||
#else
|
||||
.description = "Render threads",
|
||||
#endif
|
||||
.type = CONFIG_SELECTION,
|
||||
.default_int = 1, // todo: change later
|
||||
.selection =
|
||||
{
|
||||
{
|
||||
.description = "1 thread (Only use if issues appear with more threads)",
|
||||
.value = 1,
|
||||
},
|
||||
{
|
||||
.description = "2 threads",
|
||||
.value = 2,
|
||||
},
|
||||
{
|
||||
.description = "4 threads",
|
||||
.value = 4,
|
||||
},
|
||||
{
|
||||
.description = "8 threads",
|
||||
.value = 8,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
.name = "RAMDAC Type",
|
||||
.description = "SGS-Thomson RAMDAC type",
|
||||
.default_int = 0x1764,
|
||||
.type = CONFIG_SELECTION,
|
||||
.selection =
|
||||
{
|
||||
{
|
||||
.description = "SGS-Thomson STG-1732X",
|
||||
.value = 0x1732,
|
||||
},
|
||||
{
|
||||
.description = "SGS-Thomson STG-1764X/NVDAC64",
|
||||
.value = 0x1764,
|
||||
},
|
||||
}
|
||||
},
|
||||
{
|
||||
.name = "Chip type",
|
||||
.description = "Chip type",
|
||||
.default_int = 0x1,
|
||||
.type = CONFIG_SELECTION,
|
||||
.selection =
|
||||
{
|
||||
{
|
||||
.description = "SGS-Thomson STG-2000",
|
||||
.value = 0x2000,
|
||||
},
|
||||
{
|
||||
.description = "Nvidia NV1",
|
||||
.value = 0x1,
|
||||
},
|
||||
}
|
||||
},
|
||||
#ifndef RELEASE_BUILD
|
||||
{
|
||||
.name = "nv_debug_fulllog",
|
||||
.description = "Disable Cyclical Lines Detection for nv_log (Use for getting full context at cost of VERY large log files)",
|
||||
.type = CONFIG_BINARY,
|
||||
.default_int = 0,
|
||||
},
|
||||
#endif
|
||||
{
|
||||
.type = CONFIG_END
|
||||
}
|
||||
};
|
||||
86
src/video/nv/nv4/nv4_core.c
Normal file
86
src/video/nv/nv4/nv4_core.c
Normal file
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
* NV3 bringup and device emulation.
|
||||
*
|
||||
*
|
||||
* Authors: Connor Hyde, <mario64crashed@gmail.com> I need a better email address ;^)
|
||||
*
|
||||
* Copyright 2024-2025 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_nv4.h>
|
||||
|
||||
void nv4_init()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void* nv4_init_stb4400(const device_t *info)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void nv4_close(void* priv)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void nv4_speed_changed(void *priv)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void nv4_draw_cursor(svga_t* svga, int32_t drawline)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void nv4_recalc_timings(svga_t* svga)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void nv4_force_redraw(void* priv)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// See if the bios rom is available.
|
||||
int32_t nv4_available(void)
|
||||
{
|
||||
return (rom_present(NV4_VBIOS_STB_REVA));
|
||||
}
|
||||
|
||||
// NV3 (RIVA 128)
|
||||
// AGP
|
||||
// 8MB or 16MB VRAM
|
||||
const device_t nv4_device_agp =
|
||||
{
|
||||
.name = "nVIDIA RIVA TNT [STB Velocity 4400]",
|
||||
.internal_name = "nv4_stb4400",
|
||||
.flags = DEVICE_AGP,
|
||||
.local = 0,
|
||||
.init = nv4_init_stb4400,
|
||||
.close = nv4_close,
|
||||
.speed_changed = nv4_speed_changed,
|
||||
.force_redraw = nv4_force_redraw,
|
||||
.available = nv4_available,
|
||||
.config = nv4_config,
|
||||
};
|
||||
96
src/video/nv/nv4/nv4_core_config.c
Normal file
96
src/video/nv/nv4/nv4_core_config.c
Normal 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 NV4 configuration
|
||||
*
|
||||
*
|
||||
* Authors: Connor Hyde, <mario64crashed@gmail.com> I need a better email address ;^)
|
||||
*
|
||||
* Copyright 2024-2025 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_nv4.h>
|
||||
|
||||
const device_config_t nv4_config[] =
|
||||
{
|
||||
// Memory configuration
|
||||
{
|
||||
.name = "vram_size",
|
||||
.description = "VRAM Size",
|
||||
.type = CONFIG_SELECTION,
|
||||
.default_int = NV4_VRAM_SIZE_16MB,
|
||||
.selection =
|
||||
{
|
||||
// I thought this was never released, but it seems that at least one was released:
|
||||
// The card was called the "NEC G7AGK"
|
||||
{
|
||||
.description = "8 MB",
|
||||
.value = NV4_VRAM_SIZE_8MB,
|
||||
},
|
||||
|
||||
{
|
||||
.description = "16 MB",
|
||||
.value = NV4_VRAM_SIZE_16MB,
|
||||
},
|
||||
}
|
||||
|
||||
},
|
||||
// Multithreading configuration
|
||||
{
|
||||
|
||||
.name = "pgraph_threads",
|
||||
#ifndef RELEASE_BUILD
|
||||
.description = "PFIFO/PGRAPH - Number of threads to split large object method execution into",
|
||||
#else
|
||||
.description = "Render threads",
|
||||
#endif
|
||||
.type = CONFIG_SELECTION,
|
||||
.default_int = 1, // todo: change later
|
||||
.selection =
|
||||
{
|
||||
{
|
||||
.description = "1 thread (Only use if issues appear with more threads)",
|
||||
.value = 1,
|
||||
},
|
||||
{
|
||||
.description = "2 threads",
|
||||
.value = 2,
|
||||
},
|
||||
{
|
||||
.description = "4 threads",
|
||||
.value = 4,
|
||||
},
|
||||
{
|
||||
.description = "8 threads",
|
||||
.value = 8,
|
||||
},
|
||||
},
|
||||
},
|
||||
#ifndef RELEASE_BUILD
|
||||
{
|
||||
.name = "nv_debug_fulllog",
|
||||
.description = "Disable Cyclical Lines Detection for nv_log (Use for getting full context at cost of VERY large log files)",
|
||||
.type = CONFIG_BINARY,
|
||||
.default_int = 0,
|
||||
},
|
||||
#endif
|
||||
{
|
||||
.type = CONFIG_END
|
||||
}
|
||||
};
|
||||
@@ -261,10 +261,13 @@ video_cards[] = {
|
||||
{ .device = &compaq_voodoo_3_3500_agp_device, .flags = VIDEO_FLAG_TYPE_NONE },
|
||||
{ .device = &voodoo_3_3500_se_agp_device, .flags = VIDEO_FLAG_TYPE_NONE },
|
||||
{ .device = &voodoo_3_3500_si_agp_device, .flags = VIDEO_FLAG_TYPE_NONE },
|
||||
{ .device = &nv1_device_edge2k, .flags = VIDEO_FLAG_TYPE_NONE },
|
||||
{ .device = &nv1_device_edge3k, .flags = VIDEO_FLAG_TYPE_NONE },
|
||||
{ .device = &nv3_device_agp, .flags = VIDEO_FLAG_TYPE_NONE },
|
||||
{ .device = &nv3_device_pci, .flags = VIDEO_FLAG_TYPE_NONE },
|
||||
{ .device = &nv3t_device_agp, .flags = VIDEO_FLAG_TYPE_NONE },
|
||||
{ .device = &nv3t_device_pci, .flags = VIDEO_FLAG_TYPE_NONE },
|
||||
{ .device = &nv4_device_agp, .flags = VIDEO_FLAG_TYPE_NONE },
|
||||
{ .device = NULL, .flags = VIDEO_FLAG_TYPE_NONE }
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user