Page 1 of 1

EASY Program Request! Will take 30 minutes!

Posted: Sun Aug 17, 2008 5:34 pm
by Jaxel
Seriously, the program I'm asking for its VERY SIMPLE, you could probably write it in under 30 minutes... I need an ELF that I can run from uLaunchELF. What this program will do is count from 0.000 to 9.999 seconds in MILLISECONDS... Thats all this program has to do! Of course, I'm asking for the counter to be in extremely large text on the screen, and when it hits 9.999 it should loop back around to 0.000 and start over.

I need this program to test the lag on LCD televisions (I am a fighting game tournament director, so minimum lag televisions are essential). I plan on taking my PS2, splitting the signal between a no-lag CRT television and a test LCD television. When I run the program, the counter will display on both TVs. I will then take a digital camera and photograph both TVs side by side. When I look at the photograph, I can subtract the numbers and know exactly how much lag is on the LCD television in milliseconds.

See? Easy program... someone could write it quick... but I need it soon...

* Count from 0.000 to 9.999 seconds in milliseconds
* Loop from 9.999 to 0.000 and repeat forever
* Large text to be visible in the viewer of a digicam

Now I understand there will be logistical issues because of the 60hz/30hz restriction, but I can ignore that for now as what I am really looking for is frame delay... with 60 frames in a second in the games we play, the 60hz restriction wont be an issue.

But while I am at it... could I ask for a second program, which is a slight variation on this one? This second one is exactly the same, but instead of counting from 0.000 to 9.999 in milliseconds, it will count from 0 to 59 in a single second. So it will take exactly 1 second to go from 0 to 59, then loop again.

Posted: Mon Aug 18, 2008 12:58 am
by ps2devman
I can do a ps2 program that displays stuff at 60fps, no more than that.
Then if you tell me a LCD will miss half the frames (and thus only show 30fps) then I would be very estonished...

You can change a line in this source in order to get a frame counter :
http://home.tele2.fr/~fr-51785/ps2_initial_fantasy.zip
(250000 vertices/frame 3D rendering loop, at 60fps)
It already displays vu0 and vu1 activity for each frame

Also the way inits are done in that code (based on SMS boot method)
allows to burn stuff on a CD-R (if you create cue+bin via cdgenps2.exe).
So you just boot cd-r and it runs (but should work thru elf launching stuff).
in cdgenps2, drag'n drop (in that order) : system.cnf, test.elf,
the mesh subdirectory and a big dummy file (30Mb).
burn method : alcohol 120% DAO/SAO 16x

contents of system.cnf (taken from ps2link iso) :
BOOT2 = cdrom0:\test.elf;1
VER = 1.10
VMODE = NTSC


So, for a millisecond counter the ps2 will send a display with 0, then 16.67, then 33.33... (I think). So, just stick to a frame counter.
At least you can measure delays between screens since numeric treatments often cost time.

Posted: Mon Aug 18, 2008 3:33 am
by Jaxel
I guess a 60fps frame counter is perfect then...

can you give me the already compiled ELF?

Posted: Mon Aug 18, 2008 6:39 pm
by ps2devman
Here is the compiled elf :
http://home.tele2.fr/~fr-51785/ps2_frame_counter.zip
best viewed through component cable in 16/9 format
triangle to quit (other buttons and stick to play with 3D mesh)
I was wrong you don't need mesh subdirectory on cd-r (mesh inside elf)

Changed source that way (where stats are displayed each frame) :

Code: Select all


	{
	static unsigned long fc=0;
		pb_print("%lu",fc++);
	}
	
Text is 4 times bigger thanks to this change :

Code: Select all

void pb_draw_text_screen(void)
{
	int i,j,k,l,m,x1,x2,y;
	unsigned char c;
	int Kf=4;
//TODO: use a font texture instead of quads
//Jbit clue : UV(0.5, 0.5) XY(0,0) to UV(W-0.375, H-0.375) XY(W-0.9375, H-0.9375).
//To remember the day I use texture mapping... (improves pixels sharpness)

	//convert debugscreen characters into GS primitives
	for&#40;i=0;i<ROWS;i++&#41;
	for&#40;j=0;j<COLS;j++&#41;
	&#123;
		c=debugscreen&#91;i&#93;&#91;j&#93;;
		if &#40;c&#41;
		&#123;
			for&#40;l=0,x1=-1,x2=-1;l<8;l++,x1=-1,x2=-1&#41;
			for&#40;k=0,m=0x80;k<8;k++,m>>=1&#41;					
			if &#40;systemFont&#91;c*8+l&#93;&m&#41;
			&#123;
				if &#40;x1>=0&#41; 
					x2=20+j*10+k;
				else
					x1=20+j*10+k;
			&#125;
			else
			&#123;
				if &#40;x2>=0&#41;
				&#123;
					y=25+i*25+l*2;
					//gsKit_prim_quad&#40;gsGlobal,x1,y,x1,y+2,x2+1,y,x2+1,y+2,1,White&#41;;
					gsKit_prim_quad&#40;gsGlobal,Kf*x1,Kf*y,Kf*x1,Kf*&#40;y+2&#41;,Kf*&#40;x2+1&#41;,Kf*y,Kf*&#40;x2+1&#41;,Kf*&#40;y+2&#41;,1,White&#41;;
					x1=x2=-1;
				&#125;
				else
				if &#40;x1>=0&#41;
				&#123;
					y=25+i*25+l*2;
					//gsKit_prim_line&#40;gsGlobal,x1,y,x1,y+2,1,White&#41;;
					gsKit_prim_quad&#40;gsGlobal,Kf*x1,Kf*y,Kf*x1,Kf*&#40;y+2&#41;,Kf*&#40;x1+1&#41;,Kf*y,Kf*&#40;x1+1&#41;,Kf*&#40;y+2&#41;,1,White&#41;;
					x1=-1;
				&#125;
			&#125;
		&#125;
	&#125;	
&#125;