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>
64 lines
1.7 KiB
Plaintext
64 lines
1.7 KiB
Plaintext
|
|
To render a scene using the dma engine -
|
|
|
|
|
|
void renderScene()
|
|
{
|
|
start_up_frame();
|
|
tile=0;
|
|
|
|
|
|
scan_convert(tile, 0);
|
|
|
|
/* now wait for 1 interrupt from DMA engine */
|
|
|
|
tile++;
|
|
|
|
while (tile < tiles_in_frame) {
|
|
scan_convert(tile, 1);
|
|
/*
|
|
now wait for 2 interrupts from DMA engine, from scan-converter
|
|
and from end-of-texture
|
|
*/
|
|
VRAMwritetoFrameStore(tile);
|
|
tile++;
|
|
}
|
|
|
|
scan_convert ( -1, 1 );
|
|
/*
|
|
again wait for 2 interrupts from DMA engine, 1 of which
|
|
appears real soon since there are no triangles in the NULL image!
|
|
*/
|
|
VRAMwritetoFrameStore(tile);
|
|
|
|
/*
|
|
and we know that the last tile is at the bottom-right
|
|
of the screen, so we can flip frames at any point from here
|
|
*/
|
|
}
|
|
|
|
The sync point is the end of texture() AND end of scan_convert().
|
|
How do i organise this sync? The tranny needs to see 2 events (is there a
|
|
race condition potentially in the event hardware?) before walking to the
|
|
next tile. The code for 'texture tile' needs to do the end-of-frame code
|
|
up to and including the VRAMwrite(), then GOTO scan-convert (next tile).
|
|
|
|
The trick is to move the end-of-frame code to the BEGINNING of each tile.
|
|
So tile 0 doesnt execute any end-of-frame code (achieved via a jump). All
|
|
other tiles begin by executing the end-of-frame code for the previous
|
|
tile. The end-of-frame code consists of
|
|
|
|
|
|
computing a 24-bit pixel from intrinsic
|
|
moving all variables into eof area
|
|
perspective divide
|
|
put texture address into bits 0..31
|
|
VRAMwrite (for texture lookup)
|
|
configure EMC's to new tileXY
|
|
clear out scan-converting area
|
|
start scan-converting polygons
|
|
|
|
|
|
|
|
|