diff --git a/doc/nvidia_notes/2025-01-24.txt b/doc/nvidia_notes/2025-01-24.txt new file mode 100644 index 000000000..e35818dc0 --- /dev/null +++ b/doc/nvidia_notes/2025-01-24.txt @@ -0,0 +1 @@ +THIS IS FIFOSERVICE!!!!!!!!!!!! \ No newline at end of file diff --git a/doc/nvidia_notes/How to optimise riva 128 applications.txt b/doc/nvidia_notes/How to optimise riva 128 applications.txt new file mode 100644 index 000000000..1c20aef2a --- /dev/null +++ b/doc/nvidia_notes/How to optimise riva 128 applications.txt @@ -0,0 +1,4 @@ +How to optimise riva 128 applications: +* Ensure any set of polygons with one texture is close to a multiple of 128 polygons. +* Try to sort areas of a model with one texture to as close to 128 polygons as possible for efficient submission due to the lack of texturing. +* Try to have around (32*128) for nv3 or (64*128) for nv3t polygons \ No newline at end of file diff --git a/doc/nvidia_notes/multithreading.pdn b/doc/nvidia_notes/multithreading.pdn new file mode 100644 index 000000000..427d4bab8 Binary files /dev/null and b/doc/nvidia_notes/multithreading.pdn differ diff --git a/doc/nvidia_notes/multithreading.png b/doc/nvidia_notes/multithreading.png new file mode 100644 index 000000000..592fe64e9 Binary files /dev/null and b/doc/nvidia_notes/multithreading.png differ diff --git a/src/video/nv/nv3/nv3_core.c b/src/video/nv/nv3/nv3_core.c index 4f317a325..08a51bca7 100644 --- a/src/video/nv/nv3/nv3_core.c +++ b/src/video/nv/nv3/nv3_core.c @@ -8,8 +8,6 @@ * * NV3 bringup and device emulation. * - * Notes: - * xfree86 ref has INVERTED bit numbering? What? * * Authors: Connor Hyde, I need a better email address ;^) * @@ -747,13 +745,13 @@ uint8_t nv3_prom_read(uint32_t address) // Does this mirror on real hardware? if (rom_address >= real_rom_size) { - nv_log("PROM VBIOS Read to INVALID address 0x%05x, returning 0xFF", rom_address); + nv_log("NV3: PROM VBIOS Read to INVALID address 0x%05x, returning 0xFF", rom_address); return 0xFF; } else { uint8_t val = nv3->nvbase.vbios.rom[rom_address]; - nv_log("PROM VBIOS Read 0x%05x <- 0x%05x", val, rom_address); + nv_log("NV3: PROM VBIOS Read 0x%05x <- 0x%05x", val, rom_address); return val; } } @@ -761,7 +759,7 @@ uint8_t nv3_prom_read(uint32_t address) void nv3_prom_write(uint32_t address, uint32_t value) { uint32_t real_addr = address & 0x1FFFF; - nv_log("What's going on here? Tried to write to the Video BIOS ROM? (Address=0x%05x, value=0x%02x)", address, value); + nv_log("NV3: What's going on here? Tried to write to the Video BIOS ROM? (Address=0x%05x, value=0x%02x)", address, value); } // Initialise the MMIO mappings diff --git a/src/video/nv/nv3/nv3_core_config.c b/src/video/nv/nv3/nv3_core_config.c index ca4c3bf38..d32a7dfd7 100644 --- a/src/video/nv/nv3/nv3_core_config.c +++ b/src/video/nv/nv3/nv3_core_config.c @@ -225,6 +225,14 @@ const device_config_t nv3_config[] = }, }, }, +#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 } diff --git a/src/video/nv/nv3/subsystems/nv3_pfifo.c b/src/video/nv/nv3/subsystems/nv3_pfifo.c index db657b63e..aaf27ab25 100644 --- a/src/video/nv/nv3/subsystems/nv3_pfifo.c +++ b/src/video/nv/nv3/subsystems/nv3_pfifo.c @@ -35,6 +35,7 @@ nv_register_t pfifo_registers[] = { { NV3_PFIFO_INTR, "PFIFO - Interrupt Status", NULL, NULL}, { NV3_PFIFO_INTR_EN, "PFIFO - Interrupt Enable", NULL, NULL,}, + { NV3_PFIFO_DEBUG_0, "PFIFO - Debug 0", NULL, NULL, }, { NV3_PFIFO_CONFIG_RAMFC, "PFIFO - RAMIN RAMFC Config", NULL, NULL }, { NV3_PFIFO_CONFIG_RAMHT, "PFIFO - RAMIN RAMHT Config", NULL, NULL }, { NV3_PFIFO_CONFIG_RAMRO, "PFIFO - RAMIN RAMRO Config", NULL, NULL }, diff --git a/src/video/nv/nv_base.c b/src/video/nv/nv_base.c index 96e011430..af17bd3a7 100644 --- a/src/video/nv/nv_base.c +++ b/src/video/nv/nv_base.c @@ -18,12 +18,14 @@ // Common NV1/3/4... init #define HAVE_STDARG_H // wtf is this crap #include +#include #include #include - -#include <86box/log.h> -#include <86box/86box.h> -#include <86box/nv/vid_nv.h> +#include <86Box/86box.h> +#ifndef RELEASE_BUILD +#include <86Box/device.h> +#endif +#include <86Box/log.h> // Common logging @@ -32,9 +34,19 @@ int nv_do_log = ENABLE_NV_LOG; // A bit of kludge so that in the future we can abstract this function acorss multiple generations of Nvidia GPUs void* nv_log_device; +bool nv_log_full = false; void nv_log_set_device(void* device) { + // in case the cyclical logger doesn't show you the full context of what went on, you can enable this debug feature + #ifndef RELEASE_BUILD + if (device + && device_get_config_int("nv_debug_fulllog")) + { + nv_log_full = true; + } + #endif + nv_log_device = device; } @@ -48,7 +60,14 @@ void nv_log(const char *fmt, ...) if (nv_do_log) { va_start(ap, fmt); - log_out_cyclic(nv_log_device, fmt, ap); + // If our debug config option is configured, full log. Otherwise log with cyclical detection. + #ifndef RELEASE_BUILD + if (nv_log_full) + log_out(nv_log_device, fmt, ap); + else + #endif + log_out_cyclic(nv_log_device, fmt, ap); + va_end(ap); } }