Using the TV out in homebrew, whatever cable, full screen

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

moonlight
Posts: 567
Joined: Wed Oct 26, 2005 7:46 pm

Post by moonlight »

J.F. wrote:
moonlight wrote:And believe me, composite cable is slower than component-interlace. But obviously, fast enough for videos.
That doesn't make any sense. Composite should be identical to component interlaced. There's no difference in the signals other than component using Y/Pb/Pr and composite using Y+C. I can't imagine that making any difference in program speed. No one has reported this with the GBA emu I mentioned. The timing is the same, the memory is laid out the same, so why should one be faster than the other?
This is what i saw with the vsh menu that i've ported for this resolutions. The exact same code is working flawlessly in component-interlace, and in composite it has refresh problems.
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

You have a google page for it now? Even better! :) No more hunting around that board for the latest post. :D
SamuraiX
Posts: 76
Joined: Tue Jan 31, 2006 6:28 am
Location: USA
Contact:

Post by SamuraiX »

I need help with incorporating tvout. I have been trying to use the dve sample as a basis but for the life of me i can't seem to figure out how to get the image to display full screen properly. I seem to get only the upper portion of the screen displaying the image.


Here is the initialization of the GU.

Code: Select all

void initGraphics()
{
	int cable=0, u=0, width=0, height=0, displaymode=0;
    dispBufferNumber = 0;

    sceGuInit();

    guStart();
    sceGuDrawBuffer(GU_PSM_8888, (void*)FRAMEBUFFER_SIZE, LINESIZE);
    sceGuDispBuffer(SCREEN_WIDTH, SCREEN_HEIGHT, (void*)0, LINESIZE);
    sceGuClear(GU_COLOR_BUFFER_BIT | GU_DEPTH_BUFFER_BIT);
    sceGuDepthBuffer((void*) (FRAMEBUFFER_SIZE*2), LINESIZE);
    sceGuOffset(2048 - (SCREEN_WIDTH / 2), 2048 - (SCREEN_HEIGHT / 2));
    sceGuViewport(2048, 2048, SCREEN_WIDTH, SCREEN_HEIGHT);
    sceGuDepthRange(0xc350, 0x2710);
    sceGuScissor(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
    sceGuEnable(GU_SCISSOR_TEST);
    sceGuAlphaFunc(GU_GREATER, 0, 0xff);
    sceGuEnable(GU_ALPHA_TEST);
    sceGuDepthFunc(GU_GEQUAL);
    sceGuEnable(GU_DEPTH_TEST);
    sceGuFrontFace(GU_CW);
    sceGuShadeModel(GU_SMOOTH);
    sceGuEnable(GU_CULL_FACE);
    sceGuEnable(GU_TEXTURE_2D);
    sceGuEnable(GU_CLIP_PLANES);
    sceGuTexMode(GU_PSM_8888, 0, 0, 0);
    sceGuTexFunc(GU_TFX_REPLACE, GU_TCC_RGBA);
    sceGuTexFilter(GU_NEAREST, GU_NEAREST);
    sceGuAmbientColor(0xffffffff);
    sceGuEnable(GU_BLEND);
    sceGuBlendFunc(GU_ADD, GU_SRC_ALPHA, GU_ONE_MINUS_SRC_ALPHA, 0, 0);
    sceGuFinish();
    sceGuSync(0, 0);

    sceDisplayWaitVblankStart();
    sceGuDisplay(GU_TRUE);
    
	if(kuKernelGetModel() == PSP_MODEL_SLIM_AND_LITE)
	{
		cable = pspDveMgrCheckVideoOut();
		switch(cable)
		{
			case 0: 
				// No Cable
				break;
			case 1:
				// composite, sdtv
				u = 2;
				width = 720;
				height = 503;
				displaymode = 0x1D1;
				break;
			case 2:
				// component, (and probably d-terminal too)
				u = 0;
				width = 720;
				height = 480;
				displaymode = 0x1D2;
				break;
			default:
				writeToLogFile("Unknown cable %d.\n", cable);
				sceKernelDelayThread(5*1000000);
				borExit(0);
				break;
		}
		if(cable == 1 || cable == 2)
		{
			pspDveMgrSetVideoOut(u, displaymode, width, height, 1, 15, 0);
			sceDisplaySetFrameBuf((void*)(FRAMEBUFFER_SIZE*2), 1024, PSP_DISPLAY_PIXEL_FORMAT_8888, PSP_DISPLAY_SETBUF_NEXTFRAME);
		}
	}
	initialized = 1;
}

Here is one of the functions used for blitting.

Code: Select all

void blitImageToScreen(int sx, int sy, int width, int height, Image* source, int dx, int dy)
{
    if (!initialized) return;
    Color* vram = getVramDrawBuffer();
    sceKernelDcacheWritebackInvalidateAll();
    guStart();
    sceGuCopyImage(GU_PSM_8888, sx, sy, width, height, source->textureWidth, source->data, dx, dy, LINESIZE, vram);
    sceGuFinish();
    sceGuSync(0,0);
}

Now does the blitting require some extra work for TvOut support that I'm not aware of?

Here is a snapshot of what is happening:

Image
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

You probably haven't changed any of the defines in graphic.c/.h from 480x272 into 720x480. You might want to get the latest source for pmplayer advance - cooleyes has already added TV support to graphics.c/.h.

http://code.google.com/p/pmplayer-advance
SamuraiX
Posts: 76
Joined: Tue Jan 31, 2006 6:28 am
Location: USA
Contact:

Post by SamuraiX »

Hmm... Still not having any luck but it seems, correct me if I'm wrong. In order to support 720x480 some type of scaling needs to be put in place.

While I'm far from being a video expert it seems he is scaling the video to fit the TV's resolution via his texture_subdivision lib.


If that is the case then that seems to be what I'm missing. What I don't understand is why I see multiple images....


** Updated **

Yep, It seems that was the problem as I'm see much better results after manipulating the vertexs.
User avatar
Wally
Posts: 663
Joined: Mon Sep 26, 2005 11:25 am

Post by Wally »

is there any chance that there could be some sort of plugin to just allow the homebrew to run?
gambiting
Posts: 154
Joined: Thu Aug 17, 2006 5:39 pm

Post by gambiting »

SamuraiX wrote:Hmm... Still not having any luck but it seems, correct me if I'm wrong. In order to support 720x480 some type of scaling needs to be put in place.

While I'm far from being a video expert it seems he is scaling the video to fit the TV's resolution via his texture_subdivision lib.


If that is the case then that seems to be what I'm missing. What I don't understand is why I see multiple images....


** Updated **

Yep, It seems that was the problem as I'm see much better results after manipulating the vertexs.
I have EXACTLY the same problem - can you guide me how to do it???
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

Wally4000 wrote:is there any chance that there could be some sort of plugin to just allow the homebrew to run?
No. Every program is different, so you have to tailor the TV support to the program.
User avatar
Wally
Posts: 663
Joined: Mon Sep 26, 2005 11:25 am

Post by Wally »

J.F. wrote:
Wally4000 wrote:is there any chance that there could be some sort of plugin to just allow the homebrew to run?
No. Every program is different, so you have to tailor the TV support to the program.
Thanks JF :)
MysticWhiteDragon
Posts: 30
Joined: Thu Feb 16, 2006 8:46 am

Post by MysticWhiteDragon »

Couldn't it be possible to grab the screen data like remotejoy does, but instead of sending it via USB, resize it and send it through the video out?
User avatar
Wally
Posts: 663
Joined: Mon Sep 26, 2005 11:25 am

Post by Wally »

maybe eloader instead of having 1.50 kernel could tailor for all the TV support :D
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

MysticWhiteDragon wrote:Couldn't it be possible to grab the screen data like remotejoy does, but instead of sending it via USB, resize it and send it through the video out?
In theory, yes. You could make a plugin to copy (and scale) the video from where the app drew it to the real framebuffer outputting to the TV. But why? It won't hardly be any better than the existing mechanism for displaying games, the scaling would look ugly, would slow things down, and it wouldn't work with everything. It's like slapping a band-aide on a severed arm. It's better to have program authors add proper TV support to the program.

I suppose someone will eventually make a plugin for that. You'll just have to be patient and hope somebody feels it worthwhile enough to spend the time.
moonlight
Posts: 567
Joined: Wed Oct 26, 2005 7:46 pm

Post by moonlight »

MysticWhiteDragon wrote:Couldn't it be possible to grab the screen data like remotejoy does, but instead of sending it via USB, resize it and send it through the video out?
The data is not "sent". The tv-out gets it directly from the framebuffer.
The thing can be achieved by setting the DmaLcdcBaseAddr to your memory, destroying the function to avoid it being set again, and painting the screen (copying it to the true framebuffer that you set) in each vertical sync interrupt from the framebuffer that was set by sceDisplaySetFrameBuf but that didn't arrived to sceDmaLcdcSetBaseAddr because you avoided it.

I've done a test in which i simply copied the game framebuffer to my framebuffer (the "real" one), without scaling, just copying it like it is. It was TERRIBLY SLOW, even skipping some frames. Only in psx games the speed was fine (they use 16 bits color mode), but when i tried to do some scaling, the psx game also got slow.

Project canceled :)
SamuraiX
Posts: 76
Joined: Tue Jan 31, 2006 6:28 am
Location: USA
Contact:

Post by SamuraiX »

gambiting wrote:
SamuraiX wrote:Hmm... Still not having any luck but it seems, correct me if I'm wrong. In order to support 720x480 some type of scaling needs to be put in place.

While I'm far from being a video expert it seems he is scaling the video to fit the TV's resolution via his texture_subdivision lib.


If that is the case then that seems to be what I'm missing. What I don't understand is why I see multiple images....


** Updated **

Yep, It seems that was the problem as I'm see much better results after manipulating the vertexs.
I have EXACTLY the same problem - can you guide me how to do it???



You can grab the source here: http://openbor.svn.sourceforge.net/viewvc/openbor/

Goto PSP directory then take a look at graphics.c/h

The implementation is based off of Cooleyes' graphic lib. But I found there was alot of overhead that was not needed for what I am doing. I also like having my Blit(s)toScreen perform their own start and flush unlike his version where he manages it within his application (Outside of graphics lib). Lastly, I did like how he managed his pointers for LCD or TV-Out and found it extremely efficient and easy to read!

Good Luck!
MysticWhiteDragon
Posts: 30
Joined: Thu Feb 16, 2006 8:46 am

Post by MysticWhiteDragon »

I managed to get 32Bit interlaced mode to work in a test program at 10 frames per second using memcpy from the framebuffer to VRAM. Is there any speed advantage by pointing the VRAM to the framebuffer that is drawn and if so then how would I go about doing I do it?

It's based off of a port of the NeHe-GU tutorial on another site so I will just add the graphics.c I used.

graphics.c

Code: Select all

#include <string.h>
#include <stdio.h>
#include <malloc.h>
#include <pspkernel.h>
#include <pspdisplay.h>
#include <pspdebug.h>
#include <pspgu.h>
#include <pspgum.h>
#include <pspctrl.h>
#include <psprtc.h>
#include "graphics.h"
#include "CTimer.h"

u32* globalVramBase = &#40;u32*&#41;&#40;0x40000000|0x04000000&#41;;

unsigned int __attribute__&#40;&#40;aligned&#40;16&#41;&#41;&#41; dList&#91;262144&#93;;
static void* frameBuffer&#91;2&#93;;
static int displayBufferNumber;
static int interlaced;
int BUFFER_WIDTH  = 512;
int SCREEN_WIDTH  = 480;
int SCREEN_HEIGHT = 272;
int tvmode = 0;
int cable = 0;

int pspDveMgrCheckVideoOut&#40;&#41;;
int pspDveMgrSetVideoOut&#40;int,int,int,int,int,int,int&#41;;

void initGraphics&#40;&#41;
&#123;
	displayBufferNumber = 0;
	frameBuffer&#91;0&#93; = &#40;void*&#41;0x0a000000;
	frameBuffer&#91;1&#93; = &#40;void*&#41;&#40;0x0a000000 + 1572864&#41;;

	sceGuInit&#40;&#41;;
	sceGuStart&#40;GU_DIRECT,dList&#41;;

	sceGuDrawBuffer&#40;GU_PSM_8888,&#40;void*&#41;0,BUFFER_WIDTH&#41;;
	sceGuDispBuffer&#40;SCREEN_WIDTH,SCREEN_HEIGHT,&#40;void*&#41;0, BUFFER_WIDTH&#41;;
	sceGuDepthBuffer&#40;&#40;void*&#41;&#40;BUFFER_WIDTH * SCREEN_HEIGHT * 4&#41;,BUFFER_WIDTH&#41;;

	sceGuOffset&#40;2048 - &#40;SCREEN_WIDTH/2&#41;,2048 - &#40;SCREEN_HEIGHT/2&#41;&#41;;
	sceGuViewport&#40;2048,2048,SCREEN_WIDTH,SCREEN_HEIGHT&#41;;
	sceGuDepthRange&#40;65535,0&#41;;

	sceGuScissor&#40;0,0,SCREEN_WIDTH,SCREEN_HEIGHT&#41;;
	sceGuEnable&#40;GU_SCISSOR_TEST&#41;;
	sceGuDepthFunc&#40;GU_GEQUAL&#41;;
	sceGuEnable&#40;GU_DEPTH_TEST&#41;;
	sceGuFrontFace&#40;GU_CW&#41;;
	sceGuEnable&#40;GU_CULL_FACE&#41;;
	sceGuShadeModel&#40;GU_SMOOTH&#41;;
	sceGuEnable&#40;GU_CLIP_PLANES&#41;;

	sceGuFinish&#40;&#41;;
	sceGuSync&#40;0,0&#41;;

	memset&#40;frameBuffer&#91;0&#93;,0,1572864&#41;;
	memset&#40;frameBuffer&#91;1&#93;,0,1572864&#41;;

	sceDisplayWaitVblankStart&#40;&#41;;
	sceGuDisplay&#40;GU_TRUE&#41;;
	sceDisplaySetFrameBuf&#40;frameBuffer&#91;displayBufferNumber&#93;,768, PSP_DISPLAY_PIXEL_FORMAT_8888,PSP_DISPLAY_SETBUF_IMMEDIATE&#41;;
&#125;

void checkCable&#40;&#41;
&#123;
	cable = pspDveMgrCheckVideoOut&#40;&#41;;
&#125;

void setTVMode&#40;int mode&#41;
&#123;
	switch&#40;mode&#41;
	&#123;
		case 0&#58;
			SCREEN_WIDTH = 480; SCREEN_HEIGHT = 272; BUFFER_WIDTH = 512; interlaced = 0;
			pspDveMgrSetVideoOut&#40;0,0,480,272,1,15,0&#41;;
			break;
		case 1&#58;
			SCREEN_WIDTH = 720; SCREEN_HEIGHT = 480; BUFFER_WIDTH = 768; interlaced = 1;
			pspDveMgrSetVideoOut&#40;0,0x1d1,720,503,1,15,0&#41;;
			break;
		case 2&#58;
			SCREEN_WIDTH = 720; SCREEN_HEIGHT = 480; BUFFER_WIDTH = 768; interlaced = 0;
			pspDveMgrSetVideoOut&#40;0,0x1d2,720,480,1,15,0&#41;;
			break;
		case 3&#58;
			SCREEN_WIDTH = 720; SCREEN_HEIGHT = 480; BUFFER_WIDTH = 768; interlaced = 1;
			pspDveMgrSetVideoOut&#40;2,0x1d1,720,503,1,15,0&#41;;
			break;
	&#125;
&#125;

void SetupProjection&#40;&#41;
&#123;
	sceGuStart&#40;GU_DIRECT,dList&#41;;

	sceGumMatrixMode&#40;GU_PROJECTION&#41;;
	sceGumLoadIdentity&#40;&#41;;
	sceGumPerspective&#40;75.0f,16.0f/9.0f,0.5f,1000.0f&#41;;

	sceGumMatrixMode&#40;GU_VIEW&#41;;
	sceGumLoadIdentity&#40;&#41;;

	sceGuClearColor&#40;GU_COLOR&#40;0.0f,0.0f,0.0f,1.0f&#41;&#41;;
	sceGuClearDepth&#40;0&#41;;

	sceGuFinish&#40;&#41;;
&#125;

void flipScreen&#40;&#41;
&#123;
//	if &#40;!initialized&#41; return;
	sceKernelDcacheWritebackInvalidateAll&#40;&#41;;

	if&#40;interlaced&#41;
	&#123;
		void* s0 = globalVramBase;
		void* d0 = frameBuffer&#91;displayBufferNumber&#93;;
		void* d1 = d0 + 262*3072;
		int i;
		for&#40;i = 0;i < 240;i++&#41;
		&#123;
			memcpy&#40;d1,s0,3072&#41;;
			d1 += 3072;
			s0 += 3072;
			memcpy&#40;d0,s0,3072&#41;;
			d0 += 3072;
			s0 += 3072; 
		&#125;		
	&#125;
	else memcpy&#40;frameBuffer&#91;displayBufferNumber&#93;,globalVramBase,1474560&#41;;

	sceDisplayWaitVblankStart&#40;&#41;;
	sceDisplaySetFrameBuf&#40;frameBuffer&#91;displayBufferNumber&#93;, 768, PSP_DISPLAY_PIXEL_FORMAT_8888, PSP_DISPLAY_SETBUF_IMMEDIATE&#41;;
	displayBufferNumber ^= 1;
&#125;

void guStart&#40;&#41;
&#123;
	sceGuStart&#40;GU_DIRECT,dList&#41;;
&#125;

SamuraiX
Posts: 76
Joined: Tue Jan 31, 2006 6:28 am
Location: USA
Contact:

Post by SamuraiX »

MysticWhiteDragon,

I have completed my update of the Graphics lib. It will now display Composite, Progressive and Interlaced modes. Feel free to reference my version. I ran a few test to see the performance of my graphics lib. Mind you these results are based on my own application.

LCD Screen: 200 fps
Component P: 197 fps
Component I: 120 fps
Composite: 120 fps


You will see that you get better fps with my implementation for Interlaced modes but there is no way to make it as fast as Progressive mode due to using system ram for interlacing and vram for progressive.


http://openbor.svn.sourceforge.net/viewvc/openbor/psp/

Good Luck!
el_yind
Posts: 1
Joined: Fri Feb 08, 2008 10:12 am

Post by el_yind »

SamuraiX wrote:MysticWhiteDragon,

I have completed my update of the Graphics lib. It will now display Composite, Progressive and Interlaced modes. Feel free to reference my version. I ran a few test to see the performance of my graphics lib. Mind you these results are based on my own application.

LCD Screen: 200 fps
Component P: 197 fps
Component I: 120 fps
Composite: 120 fps


You will see that you get better fps with my implementation for Interlaced modes but there is no way to make it as fast as Progressive mode due to using system ram for interlacing and vram for progressive.


http://openbor.svn.sourceforge.net/viewvc/openbor/psp/

Good Luck!
So, using your library could someone make a plug for the CFW to play games using the composite cable in TV.
I only have televisors that support composite and I'm sure there are a lot of people too, so that could be really good to could connect it to those tvs.
At least don't stop trying to do that project as I read DAX gave up with that.

Thanks!
gambiting
Posts: 154
Joined: Thu Aug 17, 2006 5:39 pm

Post by gambiting »

el_yind wrote:
SamuraiX wrote:MysticWhiteDragon,

I have completed my update of the Graphics lib. It will now display Composite, Progressive and Interlaced modes. Feel free to reference my version. I ran a few test to see the performance of my graphics lib. Mind you these results are based on my own application.

LCD Screen: 200 fps
Component P: 197 fps
Component I: 120 fps
Composite: 120 fps


You will see that you get better fps with my implementation for Interlaced modes but there is no way to make it as fast as Progressive mode due to using system ram for interlacing and vram for progressive.


http://openbor.svn.sourceforge.net/viewvc/openbor/psp/

Good Luck!
So, using your library could someone make a plug for the CFW to play games using the composite cable in TV.
I only have televisors that support composite and I'm sure there are a lot of people too, so that could be really good to could connect it to those tvs.
At least don't stop trying to do that project as I read DAX gave up with that.

Thanks!
No,no,no - his library only changes functions in graphic.h file,which I bet sony doesn't use :P And as for enabling composite output in official games....someone already did it,but result was something like 2-3 fps,so completely unplayable.You see,interlacing takes processor time,and cannot be used while simultaniously playing games.
Snigel
Posts: 5
Joined: Mon Jan 28, 2008 7:24 am

Post by Snigel »

Would it be possible to render just the even lines and then just the odd lines at next frame?
So instead of interlacing frame 1 into odd lines and even lines and then rendering it,
Render frame 1 with odd lines, render frame 2 with even lines. Output the interlaced picture directly.

Of course this will lower image quality but, this would not require any memory copying nor as much cpu-processing. Since the renderer would just render half of lines every time, the render speed would possibly make up for the sloppy "interlace".
The hard part to implement is a renderer that will be able to switch between rendering odd and even lines.

Just for fun:
The Voodoo 2 cards was able to render odd or even lines from a picture. This was used in SLI-mode where the odd and even lines from the cards were put together into the progressive image on screen.
OldPrisoneR
Posts: 53
Joined: Thu Mar 20, 2008 2:33 am

Post by OldPrisoneR »

moonlight wrote:
MysticWhiteDragon wrote:Couldn't it be possible to grab the screen data like remotejoy does, but instead of sending it via USB, resize it and send it through the video out?
The data is not "sent". The tv-out gets it directly from the framebuffer.
The thing can be achieved by setting the DmaLcdcBaseAddr to your memory, destroying the function to avoid it being set again, and painting the screen (copying it to the true framebuffer that you set) in each vertical sync interrupt from the framebuffer that was set by sceDisplaySetFrameBuf but that didn't arrived to sceDmaLcdcSetBaseAddr because you avoided it.

I've done a test in which i simply copied the game framebuffer to my framebuffer (the "real" one), without scaling, just copying it like it is. It was TERRIBLY SLOW, even skipping some frames. Only in psx games the speed was fine (they use 16 bits color mode), but when i tried to do some scaling, the psx game also got slow.

Project canceled :)
Moonlight, couldn't you provide source code of ur test programm?

P.S: I've just written a little plugin which switches the psp TVout On (in composite mode), when you are in the game.
But the picture is not good :p
because of the FrameBuffer :(
For interlace mode we need interlaced frmbuffer(240,22,240,1), Am I right?)

P.S.S:I've tested it with God of War, FlatOut and Patapon.
Speed was fine, surely playable!
With PS1 games (Tekken3) speed was not perfect (I think I now why :P)

All tests were done with 222MHz!
fiorello
Posts: 14
Joined: Sat Jun 21, 2008 11:01 pm

Post by fiorello »

Hello,

the case is that i used moonlight dve sample for making my homebrew display on a big screen but compilers say that:

main.c:(.text+0xd04): undefined reference to `pspDveMgrCheckVideoOut'
main.c:(.text+0xd6c): undefined reference to `pspDveMgrSetVideoOut'
main.c:(.text+0x10b0): undefined reference to `pspDveMgrCheckVideoOut'

but those functions are included here:

int pspDveMgrCheckVideoOut();
int pspDveMgrSetVideoOut(int u, int mode, int width, int height, int x, int y, int z);

But im not sure excatly what part of code is important to changing to TV(coz' the sample display some random colors that I don't need anyway).

here's the psp-to-tv-changing-code:

Code: Select all

//tv
        int pspDveMgrCheckVideoOut&#40;&#41;;
        int pspDveMgrSetVideoOut&#40;int u, int mode, int width, int height, int x, int y, int z&#41;;
        
        int cable, u, width, height, displaymode;
        
        pspDebugScreenInit&#40;&#41;;
        
        if &#40;sceKernelDevkitVersion&#40;&#41; < 0x03070110&#41;
	&#123;
		oslFatalError&#40;"This program requires 3.71+.\n"&#41;;
	&#125;

	if &#40;pspSdkLoadStartModule&#40;"dvemgr.prx", PSP_MEMORY_PARTITION_KERNEL&#41; < 0&#41;
	&#123;
		oslFatalError&#40;"Error in load/start module.\n"&#41;;
	&#125;
        
        cable = pspDveMgrCheckVideoOut&#40;&#41;;
        
        if &#40;cable == 0&#41;
	&#123;
		printf&#40;"Insert a videoout cable.\n"&#41;;

		while &#40;cable == 0&#41;
		&#123;
			sceKernelDelayThread&#40;10000&#41;;
			cable = pspDveMgrCheckVideoOut&#40;&#41;;			
		&#125;
	&#125;
        
        
        
        if &#40;cable != 1 && cable != 2&#41;
	&#123;
		oslFatalError&#40;"Unknown cable %d.\n", cable&#41;;
	&#125;
        
        if &#40;cable == 1&#41; // composite, sdtv
	&#123;
		u = 2;
		width = 720;
		height = 503;
		displaymode = 0x1D1;
	&#125;
	else // 2, component, &#40;and probably d-terminal too&#41;
	&#123;
		u = 0;
		width = 720;
		height = 480;
		displaymode = 0x1D2;
	&#125;
        
        pspDveMgrSetVideoOut&#40;u, displaymode, width, height, 1, 15, 0&#41;;
             
Post Reply