Move class globals to pgraph.

This commit is contained in:
starfrost013
2025-03-13 13:38:09 +00:00
parent 0b62b32527
commit fae3d10238
26 changed files with 55 additions and 94 deletions

View File

@@ -132,7 +132,9 @@ typedef struct nv3_color_16_a4r4g4b4_s
uint8_t b : 4;
} nv3_color_16_a4r4g4b4_t;
/* A1R5G5B5 format */
/* A1R5G5B5 format
Can also be used for R5G5B5
*/
typedef struct nv3_color_16_a1r5g5b5_s
{
uint8_t a : 1;
@@ -233,6 +235,31 @@ typedef struct nv3_object_class_001
// Put the rest of it here
} nv3_beta_factor_t;
/* Note: This is not used in the class, there are "special" rops that do certain things. So they need to be defined for code readability. It all gets optimised away
by the compiler anyway */
typedef enum nv3_render_operation_type_e
{
// Black
nv3_rop_blackness = 0x00,
// dst = !src
nv3_rop_dstinvert = 0x55,
// pattern invert
nv3_rop_patinvert = 0x5A,
// src ^ dst
nv3_rop_xor = 0x66,
// src & dst
nv3_rop_srcand = 0x88,
// dst = src (?)
nv3_rop_dstcopy = 0xAA,
// src = dst (?)
nv3_rop_srccopy = 0xCC,
// paint source
nv3_rop_srcpaint = 0xEE,
// pattern copy
nv3_rop_patcopy = 0xF0,
// White
nv3_rop_whiteness = 0xFF,
} nv3_render_operation_type;
/*
Object class 0x02 (real hardware)
0x14/0x43 (drivers)
@@ -1152,30 +1179,4 @@ typedef struct nv3_grobj_s
// PIO Subchannel info
#define NV3_SUBCHANNEL_PIO_IS_PFIFO_FREE 0x0010
#define NV3_SUBCHANNEL_PIO_ALWAYS_ZERO_START 0x0012
#define NV3_SUBCHANNEL_PIO_ALWAYS_ZERO_END 0x0017
// This area is used for holding universal representations of the U* registers...
extern struct nv3_object_class_001 nv3_beta_factor;
extern struct nv3_object_class_002 nv3_rop;
extern struct nv3_object_class_003 nv3_chroma_key;
extern struct nv3_object_class_004 nv3_plane_mask;
extern struct nv3_object_class_005 nv3_clipping_rectangle;
extern struct nv3_object_class_006 nv3_pattern;
extern struct nv3_object_class_007 nv3_rectangle;
extern struct nv3_object_class_008 nv3_point;
extern struct nv3_object_class_009 nv3_line;
extern struct nv3_object_class_00A nv3_lin;
extern struct nv3_object_class_00B nv3_triangle;
extern struct nv3_object_class_00C nv3_win95_gdi_text;
extern struct nv3_object_class_00D nv3_m2mf;
extern struct nv3_object_class_00E nv3_scaled_image_from_memory;
extern struct nv3_object_class_010 nv3_blit;
extern struct nv3_object_class_011 nv3_image;
extern struct nv3_object_class_012 nv3_bitmap;
extern struct nv3_object_class_014 nv3_transfer2memory;
extern struct nv3_object_class_015 nv3_stretched_image_from_cpu;
extern struct nv3_object_class_017 nv3_d3d5_tri;
extern struct nv3_object_class_018 nv3_point_zeta_buffer;
extern struct nv3_object_class_01C nv3_image_in_memory;
#define NV3_SUBCHANNEL_PIO_ALWAYS_ZERO_END 0x0017

View File

@@ -15,5 +15,5 @@
* Copyright 2024-2025 Connor Hyde
*/
#pragma once
#pragma once

View File

@@ -23,6 +23,7 @@
#pragma once
#include <86box/nv/classes/vid_nv3_classes.h>
#include <86box/nv/render/vid_nv3_render.h>
// The GPU base structure
extern const device_config_t nv3_config[];
@@ -818,7 +819,6 @@ extern const device_config_t nv3_config[];
#define NV3_CRTC_REGISTER_RMA_MODE_MAX 0x0F
/*
STRUCTURES FOR THE GPU START HERE
OBJECT CLASS & RENDERING RELATED STUFF IS IN VID_NV3_CLASSES.H
@@ -1130,6 +1130,30 @@ typedef struct nv3_pgraph_s
uint32_t trapped_address;
uint32_t trapped_data;
uint32_t trapped_instance;
/* This area is used for holding universal representations of the U* registers, which are actually mapped into MMIO */
struct nv3_object_class_001 beta_factor;
struct nv3_object_class_002 rop;
struct nv3_object_class_003 chroma_key;
struct nv3_object_class_004 plane_mask;
struct nv3_object_class_005 clipping_rectangle;
struct nv3_object_class_006 pattern;
struct nv3_object_class_007 rectangle;
struct nv3_object_class_008 point;
struct nv3_object_class_009 line;
struct nv3_object_class_00A lin;
struct nv3_object_class_00B triangle;
struct nv3_object_class_00C win95_gdi_text;
struct nv3_object_class_00D m2mf;
struct nv3_object_class_00E scaled_image_from_memory;
struct nv3_object_class_010 blit;
struct nv3_object_class_011 image;
struct nv3_object_class_012 bitmap;
struct nv3_object_class_014 transfer2memory;
struct nv3_object_class_015 stretched_image_from_cpu;
struct nv3_object_class_017 d3d5_tri;
struct nv3_object_class_018 point_zeta_buffer;
struct nv3_object_class_01C image_in_memory;
} nv3_pgraph_t;

View File

@@ -27,9 +27,6 @@
#include <86box/video.h>
#include <86box/nv/vid_nv.h>
#include <86box/nv/vid_nv3.h>
#include <86box/nv/classes/vid_nv3_classes.h>
struct nv3_object_class_001 beta_factor;
void nv3_class_001_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj)
{

View File

@@ -27,9 +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>
struct nv3_object_class_002 nv3_rop;
void nv3_class_002_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj)
{

View File

@@ -27,9 +27,6 @@
#include <86box/video.h>
#include <86box/nv/vid_nv.h>
#include <86box/nv/vid_nv3.h>
#include <86box/nv/classes/vid_nv3_classes.h>
struct nv3_object_class_003 nv3_chroma_key;
void nv3_class_003_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj)
{

View File

@@ -27,9 +27,6 @@
#include <86box/video.h>
#include <86box/nv/vid_nv.h>
#include <86box/nv/vid_nv3.h>
#include <86box/nv/classes/vid_nv3_classes.h>
struct nv3_object_class_004 nv3_plane_mask;
void nv3_class_004_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj)
{

View File

@@ -26,9 +26,6 @@
#include <86box/video.h>
#include <86box/nv/vid_nv.h>
#include <86box/nv/vid_nv3.h>
#include <86box/nv/classes/vid_nv3_classes.h>
struct nv3_object_class_005 nv3_clipping_rectangle;
void nv3_class_005_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj)
{

View File

@@ -27,9 +27,6 @@
#include <86box/video.h>
#include <86box/nv/vid_nv.h>
#include <86box/nv/vid_nv3.h>
#include <86box/nv/classes/vid_nv3_classes.h>
struct nv3_object_class_006 nv3_pattern;
void nv3_class_006_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj)
{

View File

@@ -27,9 +27,6 @@
#include <86box/video.h>
#include <86box/nv/vid_nv.h>
#include <86box/nv/vid_nv3.h>
#include <86box/nv/classes/vid_nv3_classes.h>
struct nv3_object_class_007 nv3_rectangle;
void nv3_class_007_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj)
{

View File

@@ -27,9 +27,6 @@
#include <86box/video.h>
#include <86box/nv/vid_nv.h>
#include <86box/nv/vid_nv3.h>
#include <86box/nv/classes/vid_nv3_classes.h>
struct nv3_object_class_008 nv3_point;
void nv3_class_008_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj)
{

View File

@@ -27,9 +27,6 @@
#include <86box/video.h>
#include <86box/nv/vid_nv.h>
#include <86box/nv/vid_nv3.h>
#include <86box/nv/classes/vid_nv3_classes.h>
struct nv3_object_class_009 nv3_line;
void nv3_class_009_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj)
{

View File

@@ -28,9 +28,6 @@
#include <86box/video.h>
#include <86box/nv/vid_nv.h>
#include <86box/nv/vid_nv3.h>
#include <86box/nv/classes/vid_nv3_classes.h>
struct nv3_object_class_00A nv3_lin;
void nv3_class_00a_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj)
{

View File

@@ -27,9 +27,6 @@
#include <86box/video.h>
#include <86box/nv/vid_nv.h>
#include <86box/nv/vid_nv3.h>
#include <86box/nv/classes/vid_nv3_classes.h>
struct nv3_object_class_00B nv3_triangle;
void nv3_class_00b_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj)
{

View File

@@ -27,9 +27,6 @@
#include <86box/video.h>
#include <86box/nv/vid_nv.h>
#include <86box/nv/vid_nv3.h>
#include <86box/nv/classes/vid_nv3_classes.h>
struct nv3_object_class_00C nv3_win95_gdi_text;
void nv3_class_00c_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj)
{

View File

@@ -27,9 +27,6 @@
#include <86box/video.h>
#include <86box/nv/vid_nv.h>
#include <86box/nv/vid_nv3.h>
#include <86box/nv/classes/vid_nv3_classes.h>
struct nv3_object_class_00D nv3_m2mf;
void nv3_class_00d_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj)
{

View File

@@ -27,9 +27,6 @@
#include <86box/video.h>
#include <86box/nv/vid_nv.h>
#include <86box/nv/vid_nv3.h>
#include <86box/nv/classes/vid_nv3_classes.h>
struct nv3_object_class_00E nv3_scaled_image_from_mem;
void nv3_class_00e_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj)
{

View File

@@ -27,9 +27,6 @@
#include <86box/video.h>
#include <86box/nv/vid_nv.h>
#include <86box/nv/vid_nv3.h>
#include <86box/nv/classes/vid_nv3_classes.h>
struct nv3_object_class_010 nv3_blit;
void nv3_class_010_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj)
{

View File

@@ -27,9 +27,6 @@
#include <86box/video.h>
#include <86box/nv/vid_nv.h>
#include <86box/nv/vid_nv3.h>
#include <86box/nv/classes/vid_nv3_classes.h>
struct nv3_object_class_011 nv3_image;
void nv3_class_011_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj)
{

View File

@@ -28,9 +28,6 @@
#include <86box/video.h>
#include <86box/nv/vid_nv.h>
#include <86box/nv/vid_nv3.h>
#include <86box/nv/classes/vid_nv3_classes.h>
struct nv3_object_class_012 nv3_bitmap;
void nv3_class_012_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj)
{

View File

@@ -28,9 +28,6 @@
#include <86box/video.h>
#include <86box/nv/vid_nv.h>
#include <86box/nv/vid_nv3.h>
#include <86box/nv/classes/vid_nv3_classes.h>
struct nv3_object_class_014 nv3_transfer2memory;
void nv3_class_014_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj)
{

View File

@@ -27,9 +27,6 @@
#include <86box/video.h>
#include <86box/nv/vid_nv.h>
#include <86box/nv/vid_nv3.h>
#include <86box/nv/classes/vid_nv3_classes.h>
struct nv3_object_class_015 nv3_stretched_image_from_cpu;
void nv3_class_015_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj)
{

View File

@@ -27,9 +27,6 @@
#include <86box/video.h>
#include <86box/nv/vid_nv.h>
#include <86box/nv/vid_nv3.h>
#include <86box/nv/classes/vid_nv3_classes.h>
struct nv3_object_class_017 nv3_d3d5_tri;
void nv3_class_017_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj)
{

View File

@@ -27,7 +27,6 @@
#include <86box/video.h>
#include <86box/nv/vid_nv.h>
#include <86box/nv/vid_nv3.h>
#include <86box/nv/classes/vid_nv3_classes.h>
struct nv3_object_class_018 nv3_d3d5_point_zeta_buffer;

View File

@@ -27,9 +27,6 @@
#include <86box/video.h>
#include <86box/nv/vid_nv.h>
#include <86box/nv/vid_nv3.h>
#include <86box/nv/classes/vid_nv3_classes.h>
struct nv3_object_class_01C nv3_image_in_memory;
void nv3_class_01c_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj)
{

View File

@@ -27,7 +27,6 @@
#include <86box/video.h>
#include <86box/nv/vid_nv.h>
#include <86box/nv/vid_nv3.h>
#include <86box/nv/classes/vid_nv3_classes.h>
void nv3_generic_method(uint32_t name, uint32_t method_id, nv3_ramin_context_t context, nv3_grobj_t grobj)
{