mirror of
https://github.com/86Box/86Box.git
synced 2026-02-23 18:08:20 -07:00
fix grobj, rename name to param, fix compile
This commit is contained in:
@@ -1142,30 +1142,7 @@ typedef struct nv3_grobj_s
|
||||
#define NV3_SUBCHANNEL_PIO_ALWAYS_ZERO_START 0x0012
|
||||
#define NV3_SUBCHANNEL_PIO_ALWAYS_ZERO_END 0x0017
|
||||
|
||||
// Class methods
|
||||
void nv3_generic_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj);
|
||||
void nv3_class_001_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj);
|
||||
void nv3_class_002_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj);
|
||||
void nv3_class_003_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj);
|
||||
void nv3_class_004_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj);
|
||||
void nv3_class_005_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj);
|
||||
void nv3_class_006_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj);
|
||||
void nv3_class_007_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj);
|
||||
void nv3_class_008_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj);
|
||||
void nv3_class_009_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj);
|
||||
void nv3_class_00a_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj);
|
||||
void nv3_class_00b_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj);
|
||||
void nv3_class_00c_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj);
|
||||
void nv3_class_00d_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj);
|
||||
void nv3_class_00e_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj);
|
||||
void nv3_class_010_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj);
|
||||
void nv3_class_011_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj);
|
||||
void nv3_class_012_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj);
|
||||
void nv3_class_014_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj);
|
||||
void nv3_class_015_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj);
|
||||
void nv3_class_017_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj);
|
||||
void nv3_class_018_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj);
|
||||
void nv3_class_01c_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj);
|
||||
|
||||
|
||||
// This area is used for holding universal representations of the U* registers...
|
||||
extern struct nv3_object_class_001 nv3_beta_factor;
|
||||
|
||||
@@ -1142,6 +1142,7 @@ typedef struct nv3_pgraph_s
|
||||
uint32_t trapped_instance;
|
||||
} nv3_pgraph_t;
|
||||
|
||||
|
||||
// GPU Manufacturing Configuration (again)
|
||||
// In the future this will be configurable
|
||||
typedef struct nv3_pextdev_s
|
||||
@@ -1455,8 +1456,33 @@ void nv3_pgraph_init();
|
||||
uint32_t nv3_pgraph_read(uint32_t address);
|
||||
void nv3_pgraph_write(uint32_t address, uint32_t value);
|
||||
void nv3_pgraph_vblank_start(svga_t* svga);
|
||||
void nv3_pgraph_submit(uint32_t name, uint16_t method, uint8_t channel, uint8_t subchannel, uint8_t class_id, nv3_ramin_context_t context);
|
||||
void nv3_pgraph_submit(uint32_t param, uint16_t method, uint8_t channel, uint8_t subchannel, uint8_t class_id, nv3_ramin_context_t context);
|
||||
|
||||
// PGRAPH class methods
|
||||
// this should be in "vid_nv3_classes.h", but before that can happen, some things need to be rejigged
|
||||
void nv3_generic_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj);
|
||||
void nv3_class_001_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj);
|
||||
void nv3_class_002_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj);
|
||||
void nv3_class_003_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj);
|
||||
void nv3_class_004_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj);
|
||||
void nv3_class_005_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj);
|
||||
void nv3_class_006_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj);
|
||||
void nv3_class_007_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj);
|
||||
void nv3_class_008_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj);
|
||||
void nv3_class_009_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj);
|
||||
void nv3_class_00a_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj);
|
||||
void nv3_class_00b_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj);
|
||||
void nv3_class_00c_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj);
|
||||
void nv3_class_00d_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj);
|
||||
void nv3_class_00e_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj);
|
||||
void nv3_class_010_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj);
|
||||
void nv3_class_011_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj);
|
||||
void nv3_class_012_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj);
|
||||
void nv3_class_014_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj);
|
||||
void nv3_class_015_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj);
|
||||
void nv3_class_017_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj);
|
||||
void nv3_class_018_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj);
|
||||
void nv3_class_01c_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj);
|
||||
|
||||
// NV3 PFIFO
|
||||
void nv3_pfifo_init();
|
||||
|
||||
@@ -678,7 +678,7 @@ void nv3_pfifo_cache0_pull()
|
||||
// There is only one entry for cache0
|
||||
uint8_t current_channel = nv3->pfifo.cache0_settings.channel;
|
||||
uint8_t current_subchannel = nv3->pfifo.cache0_entry.subchannel;
|
||||
uint32_t current_name = nv3->pfifo.cache0_entry.data;
|
||||
uint32_t current_param = nv3->pfifo.cache0_entry.data;
|
||||
uint16_t current_method = nv3->pfifo.cache0_entry.method;
|
||||
|
||||
// i.e. there is no method in cache0, so we have to find the object.
|
||||
@@ -687,7 +687,7 @@ void nv3_pfifo_cache0_pull()
|
||||
// flip the get address over
|
||||
nv3->pfifo.cache0_settings.get_address ^= 0x04;
|
||||
|
||||
if (!nv3_ramin_find_object(current_name, 0, current_channel, current_subchannel))
|
||||
if (!nv3_ramin_find_object(current_param, 0, current_channel, current_subchannel))
|
||||
return; // interrupt was fired, and we went to ramro
|
||||
}
|
||||
|
||||
@@ -713,9 +713,9 @@ void nv3_pfifo_cache0_pull()
|
||||
|
||||
nv3_ramin_context_t context_structure = *(nv3_ramin_context_t*)¤t_context;
|
||||
|
||||
nv3_debug_ramin_print_context_info(current_name, context_structure);
|
||||
nv3_debug_ramin_print_context_info(current_param, context_structure);
|
||||
|
||||
nv3_pgraph_submit(current_name, current_method, current_channel, current_subchannel, class_id & 0x1F, context_structure);
|
||||
nv3_pgraph_submit(current_param, current_method, current_channel, current_subchannel, class_id & 0x1F, context_structure);
|
||||
#endif
|
||||
|
||||
}
|
||||
@@ -841,13 +841,13 @@ void nv3_pfifo_cache1_pull()
|
||||
|
||||
uint8_t current_channel = nv3->pfifo.cache1_settings.channel;
|
||||
uint8_t current_subchannel = nv3->pfifo.cache1_entries[get_index].subchannel;
|
||||
uint32_t current_name = nv3->pfifo.cache1_entries[get_index].data;
|
||||
uint32_t current_param = nv3->pfifo.cache1_entries[get_index].data;
|
||||
uint16_t current_method = nv3->pfifo.cache1_entries[get_index].method;
|
||||
|
||||
// NV_ROOT
|
||||
if (!current_method)
|
||||
{
|
||||
if (!nv3_ramin_find_object(current_name, 1, current_channel, current_subchannel))
|
||||
if (!nv3_ramin_find_object(current_param, 1, current_channel, current_subchannel))
|
||||
return; // interrupt was fired, and we went to ramro
|
||||
}
|
||||
|
||||
@@ -882,9 +882,9 @@ void nv3_pfifo_cache1_pull()
|
||||
#ifndef RELEASE_BUILD
|
||||
nv3_ramin_context_t context_structure = *(nv3_ramin_context_t*)¤t_context;
|
||||
|
||||
nv3_debug_ramin_print_context_info(current_name, context_structure);
|
||||
nv3_debug_ramin_print_context_info(current_param, context_structure);
|
||||
|
||||
nv3_pgraph_submit(current_name, current_method, current_channel, current_subchannel, class_id & 0x1F, context_structure);
|
||||
nv3_pgraph_submit(current_param, current_method, current_channel, current_subchannel, class_id & 0x1F, context_structure);
|
||||
#endif
|
||||
|
||||
//Todo: finish it
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include <86box/video.h>
|
||||
#include <86box/nv/vid_nv.h>
|
||||
#include <86box/nv/vid_nv3.h>
|
||||
|
||||
#include <86box/nv/classes/vid_nv3_classes.h>
|
||||
|
||||
// Initialise the PGRAPH subsystem.
|
||||
void nv3_pgraph_init()
|
||||
@@ -474,12 +474,15 @@ void nv3_pgraph_arbitrate_method(uint32_t name, uint16_t method, uint8_t channel
|
||||
/* Obtain the grobj information from the context in ramin */
|
||||
nv3_grobj_t grobj = {0};
|
||||
|
||||
grobj.grobj_0 = nv3_ramin_read32(context.ramin_offset, nv3);
|
||||
grobj.grobj_1 = nv3_ramin_read32(context.ramin_offset + 4, nv3);
|
||||
grobj.grobj_2 = nv3_ramin_read32(context.ramin_offset + 8, nv3);
|
||||
grobj.grobj_3 = nv3_ramin_read32(context.ramin_offset + 12, nv3);
|
||||
// we need to shift left by 4 to get the real address, something to do with the 16 byte unit of reversal
|
||||
uint32_t real_ramin_base = context.ramin_offset << 4;
|
||||
|
||||
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",
|
||||
grobj.grobj_0 = nv3_ramin_read32(real_ramin_base, nv3);
|
||||
grobj.grobj_1 = nv3_ramin_read32(real_ramin_base + 4, nv3);
|
||||
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);
|
||||
|
||||
// By this point, we already ANDed the class ID to 0x1F.
|
||||
@@ -559,7 +562,7 @@ void nv3_pgraph_arbitrate_method(uint32_t name, uint16_t method, uint8_t channel
|
||||
}
|
||||
|
||||
/* Arbitrates graphics object submission to the right object types */
|
||||
void nv3_pgraph_submit(uint32_t name, uint16_t method, uint8_t channel, uint8_t subchannel, uint8_t class_id, nv3_ramin_context_t context)
|
||||
void nv3_pgraph_submit(uint32_t param, uint16_t method, uint8_t channel, uint8_t subchannel, uint8_t class_id, nv3_ramin_context_t context)
|
||||
{
|
||||
// class id can be derived from the context but we debug log it before we get here
|
||||
// Do we need to read grobj here?
|
||||
@@ -568,12 +571,12 @@ void nv3_pgraph_submit(uint32_t name, uint16_t method, uint8_t channel, uint8_t
|
||||
{
|
||||
// This method is how we figure out which methods exist.
|
||||
case NV3_ROOT_HI_IM_OBJECT_MCOBJECTYFACE:
|
||||
nv_log("I'm an Nvidia Object! name=0x%08x channel=%d.%d class=0x%02x (%s) method=0x%04x, context=0x%08x\n",
|
||||
name, channel, subchannel, class_id, nv3_class_names[class_id], method, context);
|
||||
nv_log("I'm an Nvidia Object! channel=%d.%d class=0x%02x (%s) method=0x%04x parameter=0x%08x, context=0x%08x\n",
|
||||
channel, subchannel, class_id, nv3_class_names[class_id], method, param, context);
|
||||
break;
|
||||
default:
|
||||
// Object Method orchestration
|
||||
nv3_pgraph_arbitrate_method(name, method, channel, subchannel, class_id, context);
|
||||
nv3_pgraph_arbitrate_method(param, method, channel, subchannel, class_id, context);
|
||||
break;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user