diff --git a/doc/nvidia_notes/NV128.xlsx b/doc/nvidia_notes/NV128.xlsx new file mode 100644 index 000000000..e293a97eb Binary files /dev/null and b/doc/nvidia_notes/NV128.xlsx differ diff --git a/src/include/86box/nv/classes/vid_nv3_classes.h b/src/include/86box/nv/classes/vid_nv3_classes.h index 632f99342..c33927090 100644 --- a/src/include/86box/nv/classes/vid_nv3_classes.h +++ b/src/include/86box/nv/classes/vid_nv3_classes.h @@ -68,6 +68,18 @@ typedef enum nv3_pgraph_class_e nv3_pgraph_class1c_image_in_memory = 0x1c, } nv3_pgraph_class; +/* + OBJECT METHODS +*/ + +// Global stuff +#define NV3_ROOT_HI_IM_OBJECT_MCOBJECTYFACE 0x0 // I'm going insane at 00:48 14/02/2025 +#define NV3_SET_NOTIFY_CONTEXT_FOR_DMA 0x100 // Set object ctx for dma...see nv3_dma_context_t structure +#define NV3_SET_NOTIFY 0x104 + +#define NV3_IMAGE_IN_MEMORY_IN_MEMORY_DMA_CTX_TYPE 0x304 +#define NV3_W95TXT_COLORA 0x3FC // It's the colour of the text. This is used to submit a dummy object so the notifier can be used to sync in Win2000 DDraw6 drivers. + /* Class context switch method */ typedef struct nv3_class_ctx_switch_method_s { diff --git a/src/include/86box/nv/vid_nv3.h b/src/include/86box/nv/vid_nv3.h index 3c696bf92..6a316e928 100644 --- a/src/include/86box/nv/vid_nv3.h +++ b/src/include/86box/nv/vid_nv3.h @@ -627,16 +627,6 @@ extern const device_config_t nv3_config[]; #define NV3_PGRAPH_CLASS1C_MEM2IMAGE_START 0x5C0000 // class 55, 56, 62, 63? #define NV3_PGRAPH_CLASS1C_MEM2IMAGE_END 0x5C1FFF -/* - OBJECT METHODS -*/ - -// Global stuff -#define NV3_ROOT_HI_IM_OBJECT_MCOBJECTYFACE 0x0 // I'm going insane at 00:48 14/02/2025 -#define NV3_SET_NOTIFY_CONTEXT_FOR_DMA 0x100 // Set object ctx for dma...see nv3_dma_context_t structure -#define NV3_SET_NOTIFY 0x104 - -#define NV3_W95TXT_COLORA 0x3FC // It's the colour of the text. This is used to submit a dummy object so the notifier can be used to sync in Win2000 DDraw6 drivers. #define NV3_PGRAPH_REGISTER_END 0x401FFF // end of pgraph registers #define NV3_PGRAPH_REAL_END 0x5C1FFF diff --git a/src/video/CMakeLists.txt b/src/video/CMakeLists.txt index db6b8de2d..03d2b504a 100644 --- a/src/video/CMakeLists.txt +++ b/src/video/CMakeLists.txt @@ -124,6 +124,8 @@ add_library(vid OBJECT 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 + + nv/nv3/render/nv3_render_core.c ) diff --git a/src/video/nv/nv3/render/nv3_render.h b/src/video/nv/nv3/render/nv3_render.h new file mode 100644 index 000000000..98131680d --- /dev/null +++ b/src/video/nv/nv3/render/nv3_render.h @@ -0,0 +1,19 @@ +/* + * 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 headers for rendering + * + * + * + * Authors: Connor Hyde, I need a better email address ;^) + * + * Copyright 2024-2025 Connor Hyde + */ + + #pragma once + diff --git a/src/video/nv/nv3/render/nv3_render_core.c b/src/video/nv/nv3/render/nv3_render_core.c new file mode 100644 index 000000000..a26d7ef15 --- /dev/null +++ b/src/video/nv/nv3/render/nv3_render_core.c @@ -0,0 +1,32 @@ +/* + * 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 Core rendering code (Software version) + * + * + * + * Authors: Connor Hyde, I need a better email address ;^) + * + * Copyright 2024-2025 Connor Hyde + */ + + #include + #include + #include + #include + #include <86box/86box.h> + #include <86box/device.h> + #include <86box/mem.h> + #include <86box/pci.h> + #include <86box/rom.h> + #include <86box/video.h> + #include <86box/nv/vid_nv.h> + #include <86box/nv/vid_nv3.h> + #include <86box/nv/classes/vid_nv3_classes.h> + + \ No newline at end of file diff --git a/src/video/nv/nv3/subsystems/nv3_pgraph.c b/src/video/nv/nv3/subsystems/nv3_pgraph.c index 3cae7b872..35e5c8e0d 100644 --- a/src/video/nv/nv3/subsystems/nv3_pgraph.c +++ b/src/video/nv/nv3/subsystems/nv3_pgraph.c @@ -469,7 +469,7 @@ void nv3_pgraph_vblank_start(svga_t* svga) } /* Sends off method execution to the right class */ -void nv3_pgraph_arbitrate_method(uint32_t name, uint16_t method, uint8_t channel, uint8_t subchannel, uint8_t class_id, nv3_ramin_context_t context) +void nv3_pgraph_arbitrate_method(uint32_t param, uint16_t method, uint8_t channel, uint8_t subchannel, uint8_t class_id, nv3_ramin_context_t context) { /* Obtain the grobj information from the context in ramin */ nv3_grobj_t grobj = {0}; @@ -482,78 +482,78 @@ void nv3_pgraph_arbitrate_method(uint32_t name, uint16_t method, uint8_t channel grobj.grobj_2 = nv3_ramin_read32(real_ramin_base + 8, nv3); grobj.grobj_3 = nv3_ramin_read32(real_ramin_base + 12, nv3); - nv_log("**** About to execute method **** obj name=0x%08x, method=0x%04x, channel=%d.%d, class=%s, grobj=0x%08x 0x%08x 0x%08x 0x%08x\n", - name, method, channel, subchannel, nv3_class_names[class_id], grobj.grobj_0, grobj.grobj_1, grobj.grobj_2, grobj.grobj_3); + nv_log("**** About to execute method **** method=0x%04x param=0x%08x, channel=%d.%d, class=%s, grobj=0x%08x 0x%08x 0x%08x 0x%08x\n", + method, param, channel, subchannel, nv3_class_names[class_id], grobj.grobj_0, grobj.grobj_1, grobj.grobj_2, grobj.grobj_3); // By this point, we already ANDed the class ID to 0x1F. // Send the grobj, the context, the method and the name off to actually be acted upon. switch (class_id) { case nv3_pgraph_class01_beta_factor: - nv3_class_001_method(name, method, context, grobj); + nv3_class_001_method(param, method, context, grobj); break; case nv3_pgraph_class02_rop: - nv3_class_002_method(name, method, context, grobj); + nv3_class_002_method(param, method, context, grobj); break; case nv3_pgraph_class03_chroma_key: - nv3_class_003_method(name, method, context, grobj); + nv3_class_003_method(param, method, context, grobj); break; case nv3_pgraph_class04_plane_mask: - nv3_class_004_method(name, method, context, grobj); + nv3_class_004_method(param, method, context, grobj); break; case nv3_pgraph_class05_clipping_rectangle: - nv3_class_005_method(name, method, context, grobj); + nv3_class_005_method(param, method, context, grobj); break; case nv3_pgraph_class06_pattern: - nv3_class_006_method(name, method, context, grobj); + nv3_class_006_method(param, method, context, grobj); break; case nv3_pgraph_class07_rectangle: - nv3_class_007_method(name, method, context, grobj); + nv3_class_007_method(param, method, context, grobj); break; case nv3_pgraph_class08_point: - nv3_class_008_method(name, method, context, grobj); + nv3_class_008_method(param, method, context, grobj); break; case nv3_pgraph_class09_line: - nv3_class_009_method(name, method, context, grobj); + nv3_class_009_method(param, method, context, grobj); break; case nv3_pgraph_class0a_lin: - nv3_class_00a_method(name, method, context, grobj); + nv3_class_00a_method(param, method, context, grobj); break; case nv3_pgraph_class0b_triangle: - nv3_class_00b_method(name, method, context, grobj); + nv3_class_00b_method(param, method, context, grobj); break; case nv3_pgraph_class0c_w95txt: - nv3_class_00c_method(name, method, context, grobj); + nv3_class_00c_method(param, method, context, grobj); break; case nv3_pgraph_class0d_m2mf: - nv3_class_00d_method(name, method, context, grobj); + nv3_class_00d_method(param, method, context, grobj); break; case nv3_pgraph_class0e_scaled_image_from_memory: - nv3_class_00e_method(name, method, context, grobj); + nv3_class_00e_method(param, method, context, grobj); break; case nv3_pgraph_class10_blit: - nv3_class_010_method(name, method, context, grobj); + nv3_class_010_method(param, method, context, grobj); break; case nv3_pgraph_class11_image: - nv3_class_011_method(name, method, context, grobj); + nv3_class_011_method(param, method, context, grobj); break; case nv3_pgraph_class12_bitmap: - nv3_class_012_method(name, method, context, grobj); + nv3_class_012_method(param, method, context, grobj); break; case nv3_pgraph_class14_transfer2memory: - nv3_class_014_method(name, method, context, grobj); + nv3_class_014_method(param, method, context, grobj); break; case nv3_pgraph_class15_stretched_image_from_cpu: - nv3_class_015_method(name, method, context, grobj); + nv3_class_015_method(param, method, context, grobj); break; case nv3_pgraph_class17_d3d5tri_zeta_buffer: - nv3_class_017_method(name, method, context, grobj); + nv3_class_017_method(param, method, context, grobj); break; case nv3_pgraph_class18_point_zeta_buffer: - nv3_class_018_method(name, method, context, grobj); + nv3_class_018_method(param, method, context, grobj); break; case nv3_pgraph_class1c_image_in_memory: - nv3_class_01c_method(name, method, context, grobj); + nv3_class_01c_method(param, method, context, grobj); break; default: fatal("NV3 (nv3_pgraph_arbitrate_method): Attempted to execute method on invalid, or unimplemented, class ID %s", nv3_class_names[class_id]);