The first half of the completely insane object class system's structs.

This commit is contained in:
starfrost013
2025-01-03 01:05:49 +00:00
parent ee0dfda9ee
commit f83153a2ee
14 changed files with 2702 additions and 38 deletions

View File

@@ -0,0 +1,81 @@
Memory map (RIVA 128)
32 megabytes of MMIO starting at <nvAddr> 0x0000000-0x01FFFFFF
MC (Master Control) 0x00000000-0x00000FFF
Config/Boot 0x00000000-0x000000FF
Master Config 0x00000100-0x00000FFF
Also used to define DMA channel IDs?
MPU-401 I/O 0x00000330-0x00000331 Probably NV1 leftover, NV1 has mpu401 emulation -- no audio in nv3
VGA emulated ports 0x000003B0-0x000003DF Emulated I/O ports for VGA
Bus Control (PBUS) 0x00001000-0x00001FFF
FIFO (PFIFO) 0x00002000-0x00003FFF Submit starting at 0x00800000. Used to configure RAMHT,RAMFC,RAMRO structures & cache
PRM 0x00004000-0x00005FFF Realmode DOS device support
PRMIO 0x00007000-0x00007FFF Realmode access to PCI BAR (Base Address Register) + PCI I/O
PTIMER 0x00009000-0x00009FFF Timer
VGA emulation 0x0000A000-0x0000BFFF
VGA vram emulation 0x000A0000-0x000BFFFF (PRMVGA)
VGA 0x000C0000-0x000C7FFF VGA sequencer + graph controller registers (PRMVIO)
(All of this up to 0x0000FFFF can be traced)
PFB (Framebuffer) 0x00100000-0x00100FFF Interface to vram
PEXTDEV 0x00101000-0x00101FFF External device interface - contains straps
Straps 0x00101000 11 bits of cfg
ROM (VBIOS?) 0x00110000-0x0011FFFF
PALT (?) 0x00120000-0x00120FFF
PEXTDEV 0x00101000-0x00101FFF External Devices
Media Engine (PME) 0x00200000-0x00200FFF Allows for external video capture according to envytools?
PGRAPH (3D rendering) 0x00400000-0x00401FFF
PGRAPH objects (using RAMHT???)
*i assume that when you submit an object these are the registers used to actually draw the current object
Beta blending factor 0x00410000-0x00411FFF
ROP 0x00420000-0x00421FFF Global bitwise operation (Render OPeration) for filtering the final pixel
Color Key 0x00430000-0x00431FFF
Plane Switch 0x00440000-0x00441FFF Something to do with color formats and objects?
Clipping 0x00450000-0x00451FFF
Blend Pattern 0x00460000-0x00461FFF Used for specific blending modes
Quad [OBSOLETE] 0x00470000-0x00471FFF A rectangle. NV1 LEFTOVER, OBSOLETE
Point 0x00480000-0x00481FFF A single point
Line 0x00490000-0x00491FFF A line (with an optional colour). Can also draw a polygon made out of lines - polyline
Lin 0x004A0000-0x004A1FFF A line, without starting or ending pixel (with an optional colour). Can also draw a "polylin"
Triangle [OBSOLETE] 0x004B0000-0x004B1FFF A triangle. NV1 LEFTOVER, OBSOLETE?
Win95 GDI text 0x004C0000-0x004C1FFF Win95 text acceleration
Memory to memory xfer 0x004D0000-0x004D1FFF Represents a memory to memory transfer
Scaled image from vram 0x004E0000-0x004E1FFF Scaled image from GPU VRAM
Image blit from vram 0x00500000-0x00501FFF Image from GPU VRAM
Image blit from cpu 0x00510000-0x00511FFF Image from CPU
Bitmap from cpu 0x00520000-0x00521FFF Bitmap from CPU
Image to memory 0x00540000-0x00541FFF Image to GPU VRAM
Stretch image from cpu 0x00550000-0x00551FFF Stretched image from CPU
Direct3D 5.0 triangle 0x00570000-0x00571FFF A triangle optimised explicitly for directx3/directx5 rendering - supercedes UTRI
PointZ 0x00580000-0x00581FFF A single point with "zeta factor" (not sure what this is yet)
Image in memory 0x005C0000-0x005C0FFF Image in vram(?)
PVIDEO (Video Control) 0x00680000-0x006802FF
External DAC 0x00680000-0x006800FF
PRMCIO 0x00601000-0x00601FFF VGA emulation - CRTC + attribute controller
PRAMDAC 0x00680300-0x00680FFF (used for color lookup tables, hardware cursor, video overlay, PLL for clocking and pixel generation)
"USER" DAC 0x00681200-0x00681FFF
DMA submission w/FIFO 0x00800000-0x00FFFFFF NV_USER - uses FIFO buffer
PNVM / PDFB / VRAM 0x01000000-0x017FFFFF (actual VRAM amount depends on card, but max is 8MB)
RAMIN 0x01C00000-0x01FFFFFF (note that this is actually mapped in the last 1mb of vram)
contains ramht that has obj parameters for submission, configurable

View File

@@ -0,0 +1,29 @@
NV_PFB_CONFIG_0
Observed Valus:
Drivers 0x1000
BIOS 0x1114
Bits
5:0 Resolution
9:8 Pixel depth
12:12 Tiling
13:13 Tiling Debug
14:14 Tiling Debug Tile Size
17:15 "Tetris" tiling
19:18 "Tetris" tiling shift
22:20 Bank Swap
23 Unused
NV_PFB_CONFIG_1
2:0 CAS Latency
3:3 NEC Mode (PC-98?)
7:4 RAS Default / 9 Cycles
10:8 RAS PCHG
14:12 RAS Low
18:16 MRS to RAS
22:20 Write to Read
26:24 RAS to CAS
30:28 Read to Write
31:31 Read to PCFg

View File

@@ -0,0 +1,38 @@
PIO VS dma
driver is DIRECTLY modifying pfifo
8X8 channel setup
Names are 32-bit integers >4096
RAMFC - DMA Context object 0,0 to 8,8
context = channel, render object, object type, offset in instance memory
for a rectangle (type 0x47), object render = 1, channel 0, at 0x0400 in the ramht memory
=0x00c70400 as the context
the ramht hash :
xor every byte of the hash individually and then xor that with the channel number
so obj id 01020304 in channel 0 is 1 xor 2 xor 3 xor 4 xor 0
Store in RAMHT at <subchannel start within RAMHT> + 4*16 = name
Store in RAMHT at <subchannel start within RAMHT> + 4*16 + 4 = context
then the ramin stuff starts at *0xc04000 since c00000 is the start of ramin [PCI BAR1] which is where you put the contents of the class struct
nv_user
Consider the 8x8 channels as 64 subchannels.
Now you can do:
They seem to end at 0x880000
(0x880000)/64 = 0x2000 for each channel
FAILURE -> RAMRO!

View File

@@ -0,0 +1,24 @@
RIVA fansites (?????):
RIVA User's Group http://tiger.tnstate.edu:8080/
RIVA 128 Homepage http://pages.prodigy.net/babblin5/Main.html -> Riva3D (riva3d.com)
Zone 128 http://www.tc.umn.edu/~reda0003/zone128/
RIVAZone https://web.archive.org/web/19981212032348/http://www.rivazone.com/ (Launched January 2, 1998)
Dimension 128 (early domain name that was never archived) -> d128.com (1999-2001)
Riva3D https://web.archive.org/web/20000525110305/http://riva3d.gxnetwork.com/s3.html
nVNews https://web.archive.org/web/20001205171202/http://www.nvnews.net/ (1999-2015)
BluesNews has stuff https://www.bluesnews.com/archives/
(July 1996-present!)
https://www.bluesnews.com/archives/july97-3.html July 21, 1997 ("unreleased nvidia RIVA chipset is indeed faster than 3dfx" (carmack)
"However, using the nvidia RIVA 128 chip it runs 1 f/s faster"
https://web.archive.org/web/19980615024744/http://www.ogr.com/columns/techtalk/technology_talk_0611_2.shtml First mention of NV10 (June 1998)
"RIVA 128 Turbo" early ZX name
"Riva4" early TNT name
https://web.archive.org/web/20001002193706/http://www.rivazone.com/files/rivalog.txt
https://web.archive.org/web/20010422044820/http://www.rivazone.com/finger/finger.cgi?nick@finger.nvidia.com nvidia .plan files

View File

@@ -0,0 +1,8 @@
Name Base Version Notes Date API Support Platform
0.75_nt4 Version 0.75 No Resource Manager (miniport) 1997-08-15 GDI NT4.0
0.77_win9x Version 0.77 Symbols (COFF/VXD) 1997-09-02 GDI, D3D5
nv3quake.zip Version 1.21 OpenGL Alpha 1 1997-11-14 GDI, D3D5, OpenGL 1.1 (alpha; Build 151) Win9x
quakea2f.zip Version 1.21 OpenGL Alpha 2 1997-12-02 GDI, D3D5, OpenGL 1.1 (alpha; Build 258) Win9x
win95_131.zip Version 1.31 OpenGL Beta 1 1998-02-04 GDI, D3D5, OpenGL 1.1 (beta; Build 661) Win9x

View File

@@ -0,0 +1,63 @@
GPU companies (the period they made gpus)
DEC 19xx-1998
HP 19xx-2000+ (possibly until present)
IBM 19xx-2002+ (possibly until present)
E&S 1968-2006
Intergraph 1969-2000
Apple 1976-present (some break)
Motorola 1977-1994+ (???)
TI 1979-1988+
Matrox 1979-2014
Hitachi 1981-1986
SGI 1981-2009
Intel 1983-present
Number Nine 1983-2000
Tseng Labs 1983-1997
Cirrus Logic 1984-1998
Video 7 1985-1991
C&T 1985-1999
Imagination 1985-present
NCR 1986-1993
Paradise/WD 1986-1996
Gemini 1987-1990
Genoa Systems 1987-1991
Trident 1987-2003
Oak Technology 1988-1997
Realtek 1988-1997
Compaq 1989-1991
Sun 1989-2002(+?)
S3 Graphics 1989-2010
Macronix 1989-1998
Winbond 1989-1996+
Tamarack 198x-1991+
UMC 198x-1993
Sigma Designs 198x-1996
Acer 198x-1998 (roughly)
Fujitsu 198x-1998
AMD 1991-present (really starting in 2006)
HMC 1991-1994
Avance Logic 1991-1995
Weitek <1991-1996
Bitboys 1991-2006
IIT 1992-1994
Weitek 1992-1996(?)
Rendition 1993-1998
ARK Logic 1993-1999
S-MOS/Stellar 1994-1999
Nvidia 1993-present
Alliance 1994-1997
iGS 1994-1999
3dfx 1994-2000
3dlabs 1994-2006
Silicon Motion 1995-200?
SiS 1995-2007
Dynamic Pictures1996-1997
NeoMagic 1996-2000
GigaPixel 1997-2000
Philips 1997-199x
Tatung 199x-199x
ASPEED 2004-present
Jingjia 2006-present

View File

@@ -0,0 +1,112 @@
Driver version: Windows 2000 Version 3.37 (23 March 1999) - SDK: Windows 2000 build 1996.1
Features:
Resource Manager Yes
DirectDraw Yes
OpenGL Yes
Direct3D No
get started:
MUST USE X86 WINDBG
Does older windbg support coff???
sxe ld nv3_mini.sys
bp nv3_mini + 0x409ac - 0x10000 (nv3_mini+0x309ac)
offset purpose
30a1a RmInitRm call
6be7 initClientInfo call
6878 initClientInfo
6bec Check for initClientInfo success
6bf4 initGrPatchPool call
6bf9 Check for initGrPatchPool success
6c01 initDmaListElementPool call
6c06 Check for initDmaListElementPool
6c1c initDisplayInfo call
6c26 rmInitRm End
Success: eax=FFFFFFFFh / -1
6c26 Fail eax=0
30c8b NvFindAdapter
30cb6 NvFindAdapter -> NVIsPresent call
1010 NVIsPresent function
102f NVIsPresent VideoPortGetAccessRanges call
103b NVIsPresent VideoPortGetAccessRanges call success check (only possible way to fail)
127c NVIsPresent end
30cbb NvFindAdapter -> NVIsPresent success check
Success: al=1
Failure: al=0
30cca NVIsPresent NVMapMemoryRanges call
e9e NVIsPresent NVMapMemoryRanges VideoPortGetDeviceBase call #1 [PCI Space]
ea4 NVIsPresent NVMapMemoryRanges VideoPortGetDeviceBase call #1 success check [PCI Space]
ebd NVIsPresent NVMapMemoryRanges VideoPortFreeDeviceBase [conditional]
ec3 NVIsPresent NVMapMemoryRanges VideoPortFreeDeviceBase [conditional] success check
ed6 NVIsPresent NVMapMemoryRanges VideoPortGetDeviceBase call #2 [MMIO]
edc NVIsPresent NVMapMemoryRanges VideoPortGetDeviceBase call #2 success check [MMIO]
f0c NVIsPresent NVMapMemoryRanges VideoPortGetDeviceBase call #3 [LFB/RAMIN?]
f12 NVIsPresent NVMapMemoryRanges VideoPortGetDeviceBase call #3 success check [LFB/RAMIN?]
30ccf NvFindAdapter NVMapMemoryRanges success check
Success: eax=0
Failure: eax=87
30cf1 NvFindAdapter RmInitNvMapping call
6ce6 NvFindAdapter RmInitNvMapping
30cf6 NVIsPresent RmInitNvMapping success check
Success: eax!=0 (in practice 0xFFFFFFFF/-1)
Failure: eax=0
30d5c NvFindAdapter
30d64 NvFindAdapter RmPostNvDevice call
6d88 RmPostNvDevice function
6d91 NvFindAdapter DevinitInitializeDevice call
6d96 NvFindAdapter DevinitInitializeDevice success check
Success: eax=0 (?)
Failure: eax=1
e546 DevinitInitializeDevice function
[very complicated]
[several register reads]
e61d DevinitPrepDeviceForInit call
e641 DevinitPrepDeviceForInit function
e627 InitNV call
e67a InitNV function
30d64 NVIsPresent RmPostNvDevice success check
Success: eax=0 (?)
Failure: eax=1
30d78 NVIsPresent NVGetNVInfo call
30d7d NVIsPresent NVGetNVInfo success check
3e9a NvFindAdapter end
Success: eax=0
Fail eax=55 (RmInitNvMapping or NVIsPresent failed)
Fail eax=87 (NVMapMemoryRanges or NVMapFrameBuffer failed)
30ea3 NVInitialize
30f02 NVStartIO
2aa6 NVInterrupt
30a2d NVGetChildDescriptor
30a9c NVGetPowerState
30b20 NVSetPowerState
Driver Init Status:
DriverEntry Success
rmInitRm -> initClientInfo Success
rmInitRm -> initGrPatchPool Success
rmInitRm -> initDmaListElementPool Success
rmInitRm -> initDisplayInfo Success
rmInitRm overall Success
NvFindAdapter Success 17:32 27/11/2024
NvFindAdapter -> NvIsPresent Success 16:19 24/11/2024
NvFindAdapter -> NvMapMemoryRanges Success 19:15 26/11/2024
NvFindAdapter -> RmInitNvMapping Success 19:18 26/11/2024
NvFindAdapter -> RmPostNvDevice Success 17:32 27/11/2024
NvFindAdapter -> NVGetNVInfo Success 17:32 27/11/2024
NvFindAdapter -> NVMapFrameBuffer Success 17:32 27/11/2024
00:00 30/12/2024: stateGr -> i2c_Write
22:31 31/12/2024: fifoService
fix ptimer issue

View File

@@ -0,0 +1,37 @@
Object classes as understood by the GPU.
(May be represented, in RAMFC, as 0x40+ 22:16)
0x00 = Invalid
0x01 = beta factor
0x02 = ROP5 operation
0x03 = Chroma key
0x04 = Plane mask
0x05 = Clipping rectangle
0x06 = Pattern
0x07 = Rectangle
0x08 = Point
0x09 = Line
0x0A = Lin (line without starting or ending pixel)
0x0B = Triangle
0x0C = Windows 95 GDI text acceleration
0x0D = Memory to memory format
0x0E = Scaled image from memory
0x0F = INVALID
0x10 = Blit
0x11 = Image
0x12 = Bitmap
0x13 = INVALID
0x14 = Transfer to Memory
0x15 = Stretched image from CPU
0x16 = INVALID
0x17 = Direct3D 5.0 accelerated textured triangle w/zeta buffer
0x18 = INVALID
0x19 = INVALID
0x1A = INVALID
0x1B = INVALID
0x1C = Image in memory
0x1D = INVALID
0x1E = INVALID
0x1F = INVALID

View File

@@ -0,0 +1,57 @@
Object classes
NOT represented by the GPU. These are the ones the drivers recognise. Most of them are faked.
Version 0.77_win95 (!!!)
object class 1 = "general" methods shared across all objects
object class 2 = DMA from memory
object class 3 = DMA to memory
object class 4 = timer
object class 5 = chip ID
object class 6 = "context ordinal"
object class 10/0Ah = patchcord (links objects together)
object class 11/0Bh = video sink
object class 12/0Ch = video switch
object class 13/0Dh = video colormap
object class 14/0Eh = patchcord...again
object class 15/0Fh = image to video
object class 16/10h = image stencil buffer
object class 17/11h = image blending methods
object class 18/12h = beta solid
object class 19/13h = image -> render operation
object class 20/14h = ROP5 (2^5 = 32bit rop)
object class 21/15h = color key
object class 22/16h = plane switch
object class 23/17h = "solid image"
object class 24/18h = pattern
object class 25/19h = black rectangle
object class 26/1Ah = solid point
object class 27/1Bh = solid line
object class 28/1Ch = solid lin (line without its ending or starting pixel)
object class 29/1Dh = triangle
object class 30/1Eh = solid rectangle
object class 31/1Fh = blit image
object class 33/21h = get image from cpu
object class 34/22h = get image from cpu, monochrome
object class 37/25h = get image from local GPU memory
object class 49/31h and 51/33h = patchcord, again
object class 54/36h = get image from cpu, stretched
object class 55/37h = get image from vram, scaled
object class 56/38h = get image from vram, scaled, YUV 420 color space (probably internal colour space used for rendering)
object class 57/39h = convert image(?) between formats in place in vram, allows you to set an in and out buffer and all that jazz
object class 61/3Dh = In-Memory DMA (vram to vram?)
object class 62/3Eh = get image from vram
object class 63/3Fh = get video from vram
object class 64/40h = video scaler
object class 65/41h = video color key (as opposed to image)
object class 66/42h = capture video to memory
object class 67/43h = Solid ROP5
object class 68/44h = zeta buffer (something to do with how the gpu internally renders 3d stuff) from CPU(?)
object class 69/45h = zeta buffer in VRAM
object class 70/46h = zeta buffer patchcord
object class 71/47h = render solid point into zeta buffer (Also rectangle0
object class 72/48h = render Direct3D 5.x ("D3D0") accelerated triangle into zeta buffer
object class 73/49h = render Direct3D 5.x ("D3D0") accelerated triangle
object class 74/4Ah = video source
object class 75/4Bh = render Windows GDI accelerated rectangle and text

View File

@@ -0,0 +1,161 @@
12=unk_int12
16=unk_short16
22=unk_short22 (seems to determine if nv_sys_ptr is valid)
24=unk_short24
26=unk_short26
44=unk_int44
56=unk_int56
60=unk_int60
64=unk_short64
66=unk_short66
82=unk_short82
362..822:
big_struct
(weird alignment?)
477
489
505
1140=nv_sys_ptr
<very big structure - add when we add this structure>
1156=unk_int1156 [start of structure]
1160=unk_int1160
1168=unk_int1168 [possibly a byte array of up to 16 bytes)
1184=unk_int1184
1208=unk_int1208
1212=unk_int1212
1216=unk_int1216
1220=unk_int1220
1224=unk_int1224
1236=unk_int1236
1240=unk_int1240
1244=unk_int1244
1248=unk_int1248
1256=unk_int1256
1260=fog_table_enable
1264=unk_int1264
1270=unk_int1270
1272=unk_byte1272
1273=unk_byte1273
1274=unk_byte1274 (?)
1275=unk_byte1275
1316=unk_int1316
1320=unk_int1320
1332=unk_int1332
1340=unk_int1340
1344=unk_int1344
1356=unk_int1356
1360=d3d_clear_enabled
1364=texture_enabled
1368=mipmap_size_max
1372=mipmap_levels
1376=user_mipmaps
1380=zoh_mode (bool)
1384=tex_heap
1388=text_size
1392=video_texture
1396=min_video_tex_size
1400=draw_prim
1404=spread_x
1408=spread_y
1412=size_adj
1416=turbo_adj
1420=dma_min_push_count
1424=dma_push_enable
1436=unk_int1436
1440=unk_int1440
1448=unk_int1448
1452=unk_int1452 (set to value of unk_int1908)
1456=unk_int1456 (set to value of unk_int1956)
1460=unk_int1460 (set to value of unk_int2020)
1516=unk_int1516
1520=unk_int1520
1524=unk_int1524
1528=unk_int1528
1532=unk_int1532
1548=unk_int1548
1552=unk_int1552
1556=unk_int1556
1560=unk_int1560
1564=unk_int1564
1600=unk_int1600
1612=unk_int1612
1616=unk_int1616
1620=unk_int1620
1632=unk_int1632
1640=unk_int1640
1644=unk_ptr1644
1676=unk_int1676
1680=unk_int1680
1684=unk_int1684
1688=unk_int1688
1692=unk_int1692
1696=unk_int1696
1700=unk_int1700
1716=unk_int1716
1720=unk_int1720
1724=unk_int1724
1728=unk_ptr1728
1848=unk_int1848
1852=unk_int1852
1856=unk_int1856 (unk_int1552 | 0x800)
1864=unk_func_ptr1864
1868=unk_int1868
1884=unk_int1884
1888=ptr_to_start_of_structure?
1892=hInstDll
1896=unk_int1896
1900=unk_int1900
1908=unk_int1908
1912=unk_int1912
1916=unk_func_ptr1916
1920=unk_func_ptr1920
1932=unk_func_ptr1932
1936=unk_func_ptr1936
1944=unk_func_ptr1944
1956..2020: Set of function pointrs
1956=unk_int1956
1960=unk_int1960
1960=unk_func_ptr1960
1964=unk_func_ptr1964
1968=unk_func_ptr1968
1976=unk_func_ptr1976
1980=unk_func_ptr1980
1988=unk_func_ptr1988
1996=unk_func_ptr1996
2000=unk_func_ptr2000
2004=unk_func_ptr2004
2008=unk_func_ptr2008
2020=unk_int2020
2024=unk_int2024
2028=unk_int2028
2032=unk_int2032

View File

@@ -0,0 +1,9 @@
old nouveau wiki:
real VRAM address = VRAM_size - (ramin_address - (ramin_address % reversal_unit_size)) - reversal_unit_size + (ramin_address % reversal_unit_size)
nv3=16 bytes
0x400000 - ((0x100000) - (0x100000 % 16)) - 16 + (0x100000 % 16) = 2ffff0

File diff suppressed because it is too large Load Diff