Post
by Shadow » June 11th, 2013, 7:59 pm
Welcome Deinyon! I'm impressed by your work in MAX, VRay and the PSX.
Anyway, it works fine under PSXeven and XEBRA. PSXFIN (pSX) is just having the problem.
Looking at your code, I can see why. You should use a complete isolated/separate function for doing the drawing and not an unsigned long as a pointer in defined structure, but you can try just adding in a VSync(0) to your drawing routine.
This
display function works perfect and has double-buffering:
Code: Select all
void display()
{
// refresh the font
if (DEBUG) FntFlush(-1);
// get the current buffer
CurrentBuffer=GsGetActiveBuff();
// setup the packet workbase
GsSetWorkBase((PACKET*)GPUOutputPacket[CurrentBuffer]);
// clear the ordering table
GsClearOt(0,0,&WorldOrderingTable[CurrentBuffer]);
// insert sprites into the ordering table
GsSortSprite(&ImageTIM[0], &WorldOrderingTable[CurrentBuffer], 0);
// wait for all drawing to finish
DrawSync(0);
// wait for v_blank interrupt
VSync(0);
// flip double buffers
GsSwapDispBuff();
// clear the ordering table with a background colour
GsSortClear(0,0,0,&WorldOrderingTable[CurrentBuffer]);
// Draw the ordering table for the CurrentBuffer
GsDrawOt(&WorldOrderingTable[CurrentBuffer]);
}
Take a look at this code to get your other prototypes and functions declared accordingly:
http://www.psxdev.net/help/hello-world_source/MAIN.C
Note that
Code: Select all
// clear the ordering table with a background colour
GsSortClear(0,0,0,&WorldOrderingTable[CurrentBuffer]);
will actually clear all OT's. If you have several of them, it can cause a flicker effect once on a re-draw period.
Development Console: SCPH-5502 with 8MB RAM, MM3 Modchip, PAL 60 Colour Modification (for NTSC), PSIO Switch Board, DB-9 breakout headers for both RGB and Serial output and an Xplorer with CAETLA 0.34.
PlayStation Development PC: Windows 98 SE, Pentium 3 at 400MHz, 128MB SDRAM, DTL-H2000, DTL-H2010, DTL-H201A, DTL-S2020 (with 4GB SCSI-2 HDD), 21" Sony G420, CD-R burner, 3.25" and 5.25" Floppy Diskette Drives, ZIP 100 Diskette Drive and an IBM Model M keyboard.