Files
TeslaRel410/sda4/DPL3/VRENDER/PXPL5SUP/DIVPXOLD.H
T
CydandClaude Fable 5 db7745fcd0 sda4: commit the Glaze developer hard-drive dump
Un-ignored: the dev drive is the ground truth the restoration and
emulator work constantly reference (DPL3/LIBDPL + VRENDER i860 renderer
source, BT/RP live+dev game trees, VGL_LABS pod boot, scene/audio
content). Kept in-repo for the pod-owner community.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-04 19:41:15 -05:00

139 lines
3.4 KiB
C++

#ifndef divpxmap_h
#define divpxmap_h
#if 0
W A R N I N G
DONT USE C-comments - this is included by assembly code!
hence the horrible if 0s
pixel map allocation for pazpl5
#endif
#if 0
The pixel map has 2 distinct regions, scan-conversion variables and
shading variables. The scan-conversion variables are written during
polygon processing. At end-of-frame time some computation is performed,
and what data is left is shifted into the shading variables.
It is important to try to put all 'scalar' information together, so it
can be sent to pxpl5 in a single operation. The material entry should
contain a (up to ) 32-bit word of scalar information written in a single
operation
Note that an unpleasant side-effect of the pipelining of texture lookup
with scan-conversion is that we have to duplicate some information, such
as r,g,b, specularity, sub-texel coordinates etc. Its the price you pay.
NBB we use the z-buffer to perform texture division; this compromises accuracy
as we only have 20 bits of intermediate precision. In order to buy back 2 more
bits of precision (to make wrapping of textures not eat up precious bits) we
actually use 24 bits for the divide. This means that we H A V E to copy
the 4 bits above the z-buffer into the (now vacant) end-of-frame area, and
then after the divide copy them back.
#endif
#if 0
i/o area, defined by hardware
#endif
#define dvpx_io 0
#if 0
start of scan-conversion variables
#endif
#define dvpx_iobits 32
#define dvpx_texz 32
#define dvpx_texzbits 18
#define dvpx_texu 50
#define dvpx_texubits 18
#define dvpx_texv 68
#define dvpx_texvbits 18
#define dvpx_zbuf 86
#define dvpx_zbufbits 20
#define dvpx_opaque_50 106
#define dvpx_opaque_25 107
#define dvpx_opaque_12 108
#define dvpx_scalar 109
#define dvpx_pixcolourtype 109
#define dvpx_texsize 110
#define dvpx_texsizebits 3
#define dvpx_texid 113
#define dvpx_texidbits 8
#define dvpx_texrampsel 121
#define dvpx_texrampselbits 3
#define dvpx_intrinsic 124
#define dvpx_intrinsicbits 9
#define dvpx_ks 133
#define dvpx_ksbits 4
#define dvpx_r24 124
#define dvpx_g24 132
#define dvpx_diffuse 141
#define dvpx_diffusebits 8
#define dvpx_b24 149
#define dvpx_scalarbits 32
#define dvpx_specular 149
#define dvpx_specularbits 8
#if 0
end of scan-conversion variables
#endif
#if 0
start of end-of-frame variables
#endif
#define dvpx_eofstart 157
#define dvpx_eofenblsave 157
#define dvpx_eofsubu 158
#define dvpx_eofsububits 5
#define dvpx_eofsubv 163
#define dvpx_eofsubvbits 5
#define dvpx_eofr 168
#define dvpx_eofrbits 8
#define dvpx_eofg 176
#define dvpx_eofgbits 8
#define dvpx_eofb 184
#define dvpx_eofbbits 8
#define dvpx_eoftexramp 192
#define dvpx_eoftexrampbits 3
#define dvpx_eofspec 195
#define dvpx_eofspecbits 8
#define dvpx_eofpixtype 203
#define dvpx_eofpixtypebits 2
#define dvpx_punchsave 205
#define dvpx_eoffog 206
#define dvpx_eoffogbits 8
#else
#endif