diff --git a/src/include/86box/nv/vid_nv3.h b/src/include/86box/nv/vid_nv3.h index 2a635e8b4..aa719a7d2 100644 --- a/src/include/86box/nv/vid_nv3.h +++ b/src/include/86box/nv/vid_nv3.h @@ -1101,7 +1101,6 @@ typedef struct nv3_ramin_ramht_s nv3_ramin_ramht_subchannel_t subchannels[NV3_DMA_CHANNELS][NV3_DMA_SUBCHANNELS_PER_CHANNEL]; } nv3_ramin_ramht_t; -uint32_t nv3_ramht_hash(nv3_ramin_name_t name, uint32_t channel); typedef enum nv3_ramin_ramro_reason_e { @@ -1152,8 +1151,6 @@ typedef struct nv3_ramin_s } nv3_ramin_t; -// RAMIN functions -void nv3_ramin_find_object(uint32_t name, uint32_t cache_id, uint32_t channel_id, uint32_t subchannel_id); typedef struct nv3_pvideo_s { @@ -1231,6 +1228,10 @@ void nv3_ramin_write32(uint32_t addr, uint32_t val, void* priv); bool nv3_ramin_arbitrate_read(uint32_t address, uint32_t* value); // Read arbitration so we can read/write to the structures in the first 64k of ramin bool nv3_ramin_arbitrate_write(uint32_t address, uint32_t value); // Write arbitration so we can read/write to the structures in the first 64k of ramin +// RAMIN functions +uint32_t nv3_ramht_hash(nv3_ramin_name_t name, uint32_t channel); +void nv3_ramin_find_object(uint32_t name, uint32_t cache_id, uint32_t channel_id, uint32_t subchannel_id); + uint32_t nv3_ramfc_read(uint32_t address); void nv3_ramfc_write(uint32_t address, uint32_t value); uint32_t nv3_ramro_read(uint32_t address); diff --git a/src/video/CMakeLists.txt b/src/video/CMakeLists.txt index b99f4fc4b..2135213fb 100644 --- a/src/video/CMakeLists.txt +++ b/src/video/CMakeLists.txt @@ -11,8 +11,11 @@ # Authors: David Hrdlička, # # Copyright 2020-2021 David Hrdlička. +# Copyright 2025 Connor Hyde # +# todo: Split nv stuff into its own file... + add_library(vid OBJECT agpgart.c video.c vid_table.c vid_cga.c vid_cga_comp.c vid_compaq_cga.c vid_mda.c vid_hercules.c vid_herculesplus.c vid_incolor.c vid_colorplus.c vid_genius.c vid_pgc.c vid_im1024.c @@ -43,6 +46,29 @@ add_library(vid OBJECT agpgart.c video.c vid_table.c vid_cga.c vid_cga_comp.c nv/nv3/subsystems/nv3_pvideo.c nv/nv3/classes/nv3_class_names.c + nv/nv3/classes/nv3_class_001_beta_factor.c + nv/nv3/classes/nv3_class_002_rop.c + nv/nv3/classes/nv3_class_003_chroma_key.c + nv/nv3/classes/nv3_class_004_plane_mask.c + nv/nv3/classes/nv3_class_005_clipping_rectangle.c + nv/nv3/classes/nv3_class_006_pattern.c + nv/nv3/classes/nv3_class_007_rectangle.c + nv/nv3/classes/nv3_class_008_point.c + nv/nv3/classes/nv3_class_009_line.c + nv/nv3/classes/nv3_class_00a_lin.c + nv/nv3/classes/nv3_class_00b_triangle.c + nv/nv3/classes/nv3_class_00c_win95_gdi_text.c + nv/nv3/classes/nv3_class_00d_m2mf.c + nv/nv3/classes/nv3_class_00e_scaled_image_from_mem.c + nv/nv3/classes/nv3_class_010_blit.c + nv/nv3/classes/nv3_class_011_image.c + nv/nv3/classes/nv3_class_012_bitmap.c + nv/nv3/classes/nv3_class_014_transfer2memory.c + nv/nv3/classes/nv3_class_015_stretched_image_from_cpu.c + nv/nv3/classes/nv3_class_017_d3d5_tri_zeta_buffer.c + nv/nv3/classes/nv3_class_018_point_zeta_buffer.c + nv/nv3/classes/nv3_class_01c_image_in_memory.c + ) if(G100) diff --git a/src/video/nv/nv3/classes/nv3_class_001_beta_factor.c b/src/video/nv/nv3/classes/nv3_class_001_beta_factor.c new file mode 100644 index 000000000..2f9cdb066 --- /dev/null +++ b/src/video/nv/nv3/classes/nv3_class_001_beta_factor.c @@ -0,0 +1,16 @@ +/* + * 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: Methods for class 0x01 (Beta factor) + * + * + * + * Authors: Connor Hyde, I need a better email address ;^) + * + * Copyright 2024-2025 Connor Hyde + */ \ No newline at end of file diff --git a/src/video/nv/nv3/classes/nv3_class_002_rop.c b/src/video/nv/nv3/classes/nv3_class_002_rop.c new file mode 100644 index 000000000..e3256d699 --- /dev/null +++ b/src/video/nv/nv3/classes/nv3_class_002_rop.c @@ -0,0 +1,16 @@ +/* + * 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: Methods for class 0x02 (Render operation) + * + * + * + * Authors: Connor Hyde, I need a better email address ;^) + * + * Copyright 2024-2025 Connor Hyde + */ \ No newline at end of file diff --git a/src/video/nv/nv3/classes/nv3_class_003_chroma_key.c b/src/video/nv/nv3/classes/nv3_class_003_chroma_key.c new file mode 100644 index 000000000..188f5f94e --- /dev/null +++ b/src/video/nv/nv3/classes/nv3_class_003_chroma_key.c @@ -0,0 +1,16 @@ +/* + * 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: Methods for class 0x02 (Chroma/color key) + * + * + * + * Authors: Connor Hyde, I need a better email address ;^) + * + * Copyright 2024-2025 Connor Hyde + */ \ No newline at end of file diff --git a/src/video/nv/nv3/classes/nv3_class_004_plane_mask.c b/src/video/nv/nv3/classes/nv3_class_004_plane_mask.c new file mode 100644 index 000000000..0797819d7 --- /dev/null +++ b/src/video/nv/nv3/classes/nv3_class_004_plane_mask.c @@ -0,0 +1,16 @@ +/* + * 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: Methods for class 0x02 (Plane mask) + * + * + * + * Authors: Connor Hyde, I need a better email address ;^) + * + * Copyright 2024-2025 Connor Hyde + */ \ No newline at end of file diff --git a/src/video/nv/nv3/classes/nv3_class_005_clipping_rectangle.c b/src/video/nv/nv3/classes/nv3_class_005_clipping_rectangle.c new file mode 100644 index 000000000..c675be6e8 --- /dev/null +++ b/src/video/nv/nv3/classes/nv3_class_005_clipping_rectangle.c @@ -0,0 +1,16 @@ +/* + * 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: Methods for class 0x05 (Clipping rectangle) + * + * + * + * Authors: Connor Hyde, I need a better email address ;^) + * + * Copyright 2024-2025 Connor Hyde + */ \ No newline at end of file diff --git a/src/video/nv/nv3/classes/nv3_class_006_pattern.c b/src/video/nv/nv3/classes/nv3_class_006_pattern.c new file mode 100644 index 000000000..d75307a24 --- /dev/null +++ b/src/video/nv/nv3/classes/nv3_class_006_pattern.c @@ -0,0 +1,16 @@ +/* + * 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: Methods for class 0x06 (Pattern) + * + * + * + * Authors: Connor Hyde, I need a better email address ;^) + * + * Copyright 2024-2025 Connor Hyde + */ \ No newline at end of file diff --git a/src/video/nv/nv3/classes/nv3_class_007_rectangle.c b/src/video/nv/nv3/classes/nv3_class_007_rectangle.c new file mode 100644 index 000000000..513f19496 --- /dev/null +++ b/src/video/nv/nv3/classes/nv3_class_007_rectangle.c @@ -0,0 +1,16 @@ +/* + * 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: Methods for class 0x07 (Rectangle) + * + * + * + * Authors: Connor Hyde, I need a better email address ;^) + * + * Copyright 2024-2025 Connor Hyde + */ \ No newline at end of file diff --git a/src/video/nv/nv3/classes/nv3_class_008_point.c b/src/video/nv/nv3/classes/nv3_class_008_point.c new file mode 100644 index 000000000..92561591a --- /dev/null +++ b/src/video/nv/nv3/classes/nv3_class_008_point.c @@ -0,0 +1,16 @@ +/* + * 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: Methods for class 0x08 (Point) + * + * + * + * Authors: Connor Hyde, I need a better email address ;^) + * + * Copyright 2024-2025 Connor Hyde + */ \ No newline at end of file diff --git a/src/video/nv/nv3/classes/nv3_class_009_line.c b/src/video/nv/nv3/classes/nv3_class_009_line.c new file mode 100644 index 000000000..d10501558 --- /dev/null +++ b/src/video/nv/nv3/classes/nv3_class_009_line.c @@ -0,0 +1,16 @@ +/* + * 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: Methods for class 0x09 (Line) + * + * + * + * Authors: Connor Hyde, I need a better email address ;^) + * + * Copyright 2024-2025 Connor Hyde + */ \ No newline at end of file diff --git a/src/video/nv/nv3/classes/nv3_class_00a_lin.c b/src/video/nv/nv3/classes/nv3_class_00a_lin.c new file mode 100644 index 000000000..372a56e92 --- /dev/null +++ b/src/video/nv/nv3/classes/nv3_class_00a_lin.c @@ -0,0 +1,16 @@ +/* + * 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: Methods for class 0x0A (Lin - a line without starting or ending pixels) + * + * + * + * Authors: Connor Hyde, I need a better email address ;^) + * + * Copyright 2024-2025 Connor Hyde + */ \ No newline at end of file diff --git a/src/video/nv/nv3/classes/nv3_class_00b_triangle.c b/src/video/nv/nv3/classes/nv3_class_00b_triangle.c new file mode 100644 index 000000000..1b8c23f03 --- /dev/null +++ b/src/video/nv/nv3/classes/nv3_class_00b_triangle.c @@ -0,0 +1,16 @@ +/* + * 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: Methods for class 0x0B (Basic triangle) + * + * + * + * Authors: Connor Hyde, I need a better email address ;^) + * + * Copyright 2024-2025 Connor Hyde + */ \ No newline at end of file diff --git a/src/video/nv/nv3/classes/nv3_class_00c_win95_gdi_text.c b/src/video/nv/nv3/classes/nv3_class_00c_win95_gdi_text.c new file mode 100644 index 000000000..9c58cf250 --- /dev/null +++ b/src/video/nv/nv3/classes/nv3_class_00c_win95_gdi_text.c @@ -0,0 +1,16 @@ +/* + * 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: Methods for class 0x0C (Windows 95 GDI text acceleration) + * + * + * + * Authors: Connor Hyde, I need a better email address ;^) + * + * Copyright 2024-2025 Connor Hyde + */ \ No newline at end of file diff --git a/src/video/nv/nv3/classes/nv3_class_00d_m2mf.c b/src/video/nv/nv3/classes/nv3_class_00d_m2mf.c new file mode 100644 index 000000000..0b6c48cc1 --- /dev/null +++ b/src/video/nv/nv3/classes/nv3_class_00d_m2mf.c @@ -0,0 +1,16 @@ +/* + * 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: Methods for class 0x0D (Reformat image in memory) + * + * + * + * Authors: Connor Hyde, I need a better email address ;^) + * + * Copyright 2024-2025 Connor Hyde + */ \ No newline at end of file diff --git a/src/video/nv/nv3/classes/nv3_class_00e_scaled_image_from_mem.c b/src/video/nv/nv3/classes/nv3_class_00e_scaled_image_from_mem.c new file mode 100644 index 000000000..6e90a552a --- /dev/null +++ b/src/video/nv/nv3/classes/nv3_class_00e_scaled_image_from_mem.c @@ -0,0 +1,16 @@ +/* + * 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: Methods for class 0x0E (Get image from vram and scale it) + * + * + * + * Authors: Connor Hyde, I need a better email address ;^) + * + * Copyright 2024-2025 Connor Hyde + */ \ No newline at end of file diff --git a/src/video/nv/nv3/classes/nv3_class_010_blit.c b/src/video/nv/nv3/classes/nv3_class_010_blit.c new file mode 100644 index 000000000..5e6f19aff --- /dev/null +++ b/src/video/nv/nv3/classes/nv3_class_010_blit.c @@ -0,0 +1,16 @@ +/* + * 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: Methods for class 0x10 (Blit something) + * + * + * + * Authors: Connor Hyde, I need a better email address ;^) + * + * Copyright 2024-2025 Connor Hyde + */ \ No newline at end of file diff --git a/src/video/nv/nv3/classes/nv3_class_011_image.c b/src/video/nv/nv3/classes/nv3_class_011_image.c new file mode 100644 index 000000000..3334b4185 --- /dev/null +++ b/src/video/nv/nv3/classes/nv3_class_011_image.c @@ -0,0 +1,16 @@ +/* + * 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: Methods for class 0x11 (Color image) + * + * + * + * Authors: Connor Hyde, I need a better email address ;^) + * + * Copyright 2024-2025 Connor Hyde + */ \ No newline at end of file diff --git a/src/video/nv/nv3/classes/nv3_class_012_bitmap.c b/src/video/nv/nv3/classes/nv3_class_012_bitmap.c new file mode 100644 index 000000000..b5c62f5f4 --- /dev/null +++ b/src/video/nv/nv3/classes/nv3_class_012_bitmap.c @@ -0,0 +1,16 @@ +/* + * 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: Methods for class 0x12 (Monochrome bitmap) + * + * + * + * Authors: Connor Hyde, I need a better email address ;^) + * + * Copyright 2024-2025 Connor Hyde + */ \ No newline at end of file diff --git a/src/video/nv/nv3/classes/nv3_class_014_transfer2memory.c b/src/video/nv/nv3/classes/nv3_class_014_transfer2memory.c new file mode 100644 index 000000000..c4b97a98a --- /dev/null +++ b/src/video/nv/nv3/classes/nv3_class_014_transfer2memory.c @@ -0,0 +1,16 @@ +/* + * 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: Methods for class 0x14 (Transfer to Memory) + * + * + * + * Authors: Connor Hyde, I need a better email address ;^) + * + * Copyright 2024-2025 Connor Hyde + */ \ No newline at end of file diff --git a/src/video/nv/nv3/classes/nv3_class_015_stretched_image_from_cpu.c b/src/video/nv/nv3/classes/nv3_class_015_stretched_image_from_cpu.c new file mode 100644 index 000000000..951d77bce --- /dev/null +++ b/src/video/nv/nv3/classes/nv3_class_015_stretched_image_from_cpu.c @@ -0,0 +1,16 @@ +/* + * 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: Methods for class 0x15 (stretched image to memory) + * + * + * + * Authors: Connor Hyde, I need a better email address ;^) + * + * Copyright 2024-2025 Connor Hyde + */ \ No newline at end of file diff --git a/src/video/nv/nv3/classes/nv3_class_017_d3d5_tri_zeta_buffer.c b/src/video/nv/nv3/classes/nv3_class_017_d3d5_tri_zeta_buffer.c new file mode 100644 index 000000000..4e0463104 --- /dev/null +++ b/src/video/nv/nv3/classes/nv3_class_017_d3d5_tri_zeta_buffer.c @@ -0,0 +1,16 @@ +/* + * 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: Methods for class 0x17 (Direct3D 5.0 accelerated triangle with zeta buffer) + * + * + * + * Authors: Connor Hyde, I need a better email address ;^) + * + * Copyright 2024-2025 Connor Hyde + */ \ No newline at end of file diff --git a/src/video/nv/nv3/classes/nv3_class_018_point_zeta_buffer.c b/src/video/nv/nv3/classes/nv3_class_018_point_zeta_buffer.c new file mode 100644 index 000000000..0440c39fe --- /dev/null +++ b/src/video/nv/nv3/classes/nv3_class_018_point_zeta_buffer.c @@ -0,0 +1,16 @@ +/* + * 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: Methods for class 0x18 (Point with zeta buffer) + * + * + * + * Authors: Connor Hyde, I need a better email address ;^) + * + * Copyright 2024-2025 Connor Hyde + */ \ No newline at end of file diff --git a/src/video/nv/nv3/classes/nv3_class_01c_image_in_memory.c b/src/video/nv/nv3/classes/nv3_class_01c_image_in_memory.c new file mode 100644 index 000000000..daea3e0bb --- /dev/null +++ b/src/video/nv/nv3/classes/nv3_class_01c_image_in_memory.c @@ -0,0 +1,16 @@ +/* + * 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: Methods for class 0x1C (Image in memory) + * + * + * + * Authors: Connor Hyde, I need a better email address ;^) + * + * Copyright 2024-2025 Connor Hyde + */ \ No newline at end of file diff --git a/src/video/nv/nv3/classes/nv3_class_names.c b/src/video/nv/nv3/classes/nv3_class_names.c index 0ee56443b..3604d147b 100644 --- a/src/video/nv/nv3/classes/nv3_class_names.c +++ b/src/video/nv/nv3/classes/nv3_class_names.c @@ -12,7 +12,7 @@ * * Authors: Connor Hyde, I need a better email address ;^) * - * Copyright 2024-2025 starfrost + * Copyright 2024-2025 Connor Hyde */ #include #include @@ -34,7 +34,7 @@ const char* nv3_class_names[] = { "NV3 INVALID class 0x00", "NV3 class 0x01: Beta factor", - "NV3 class 0x02: ROP5 (32-bit) operation", + "NV3 class 0x02: Render operation", "NV3 class 0x03: Chroma key", "NV3 class 0x04: Plane mask", "NV3 class 0x05: Clipping rectangle", diff --git a/src/video/nv/nv3/subsystems/nv3_pramin.c b/src/video/nv/nv3/subsystems/nv3_pramin.c index 9e013f4aa..f27ca0415 100644 --- a/src/video/nv/nv3/subsystems/nv3_pramin.c +++ b/src/video/nv/nv3/subsystems/nv3_pramin.c @@ -331,4 +331,10 @@ bool nv3_ramin_arbitrate_write(uint32_t address, uint32_t value) } return false; +} + +// THIS IS THE MOST IMPORTANT FUNCTION! +void nv3_ramin_find_object(uint32_t name, uint32_t cache_id, uint32_t channel_id, uint32_t subchannel_id) +{ + // TODO: WRITE IT!!! } \ No newline at end of file