Files
TeslaRel410/sda4/DPL3/VRENDER/PXPL5SUP/ENTPXMAP.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

129 lines
3.2 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 var``iables
NB use of texz - we lose top bit anyway during divide, so drop
its lsb into io area!
#endif
#define dvpx_iobits 32
#define dvpx_texz 31
#define dvpx_texzbits 19
#define dvpx_opacity 50
#define dvpx_opacitybits 4
#define dvpx_texu 54
#define dvpx_texubits 19
#define dvpx_texv 73
#define dvpx_texvbits 19
#define dvpx_zbuf 92
#define dvpx_zbufbits 20
#define dvpx_scalar 112
#define dvpx_pixcolourtype 112
#define dvpx_textype 113
#define dvpx_textypebits 3
#define dvpx_texid 116
#define dvpx_texidbits 6
#define dvpx_texrampsel 122
#define dvpx_texrampselbits 2
#define dvpx_intrinsic 124
#define dvpx_intrinsicbits 9
#define dvpx_scalarbits (dvpx_diffuse-dvpx_scalar)
#define dvpx_diffuse 133
#define dvpx_diffusebits 8
#define dvpx_specular 141
#define dvpx_specularbits 8
#define dvpx_enblpush 149
#if 0
end of scan-conversion variables
start of end-of-frame variables
#endif
#define dvpx_eofstart 151
#define dvpx_eoffog 151
#define dvpx_eoffogbits 8
#define dvpx_eofsubu 159
#define dvpx_eofsububits 5
#define dvpx_eofsubv 164
#define dvpx_eofsubvbits 5
#define dvpx_eofr 169
#define dvpx_eofrbits 8
#define dvpx_eofg 177
#define dvpx_eofgbits 8
#define dvpx_eofb 185
#define dvpx_eofbbits 8
#define dvpx_eoftexramp 193
#define dvpx_eoftexrampbits 2
#define dvpx_eofspec 195
#define dvpx_eofspecbits 8
#define dvpx_eofpixtype 203
#define dvpx_eofpixtypebits 2
#else
#endif