add ability to disable cyclical logging

This commit is contained in:
starfrost013
2025-01-24 23:05:40 +00:00
parent 334dbeb883
commit 3edc11a682
8 changed files with 41 additions and 10 deletions

View File

@@ -0,0 +1 @@
THIS IS FIFOSERVICE!!!!!!!!!!!!

View File

@@ -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

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

View File

@@ -8,8 +8,6 @@
*
* NV3 bringup and device emulation.
*
* Notes:
* xfree86 ref has INVERTED bit numbering? What?
*
* Authors: Connor Hyde, <mario64crashed@gmail.com> 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

View File

@@ -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
}

View File

@@ -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 },

View File

@@ -18,12 +18,14 @@
// Common NV1/3/4... init
#define HAVE_STDARG_H // wtf is this crap
#include <stdarg.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdint.h>
#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);
}
}