Exemple #1
0
void CD_disco(int type)
{
	
	putScreen(0, 0, "");
	putScreen(0, 0, "");
	
	unsigned discColor = 0;
	char discName[256];
		
	if(type==4)
	{
		sprintf(discName, "%s", "USE SWAP");
		discColor = GS_SET_RGBA(0x5A,0xD2,0x43,0x80);
	}
	if(type==2)
	{
		sprintf(discName, "%s", "PS2 CD-ROM");
		discColor = GS_SET_RGBA(0x12,0x00,0xFF,0x80);
	}
	if(type==3)
	{
		sprintf(discName, "%s", "PS2 DVD-ROM");
		discColor = GS_SET_RGBA(0xE3,0xCD,0x3B,0x80);
	}
	if(type==1)
	{
		sprintf(discName, "%s", "PSX CD-ROM");
		discColor = GS_SET_RGBA(0x00,0x00,0x00,0x80);
	}
	
	putBackground(img_fondo);
	myGsDriver->drawPipe.RectFlat(0,0,tvmx,60,0,colorNegro);
	myGsDriver->drawPipe.RectGouraud(0,420,colorNegro,tvmx,tvmy,colorAzul,0);
	myFont.uploadFont(fontTex, myGsDriver->getTextureBufferBase(), fontTex->TexWidth, 0, 0 );
	myFont.Print(420, tvmx, 15, 1, colorBlanco, GSFONT_ALIGN_LEFT, txt_1);
	myFont.Print(420, tvmx, 30, 1, colorNaranja, GSFONT_ALIGN_LEFT, "http://ps2dev.siirlabs.com");
	myGsDriver->drawPipe.RectFlat(55,125,591,367,0,colorBlanco);
	myGsDriver->drawPipe.Line(0,59,tvmx,59,0,colorGris2);
	myGsDriver->drawPipe.Line(0,420,tvmx,420,0,colorGris2);
	
	myFont.Print(53, tvmx, 97, 1, colorBlanco, GSFONT_ALIGN_LEFT, "CogSwap Loader");
	
	if(type > 0)
	{
		fillCircle(175, 245, 100, discColor);
		fillCircle(175, 245, 20, GS_SET_RGBA(0xFF,0xFF,0xFF,0x80));
		myFont.Print(304, 640, 196, 1, GS_SET_RGBA(0x0E,0x23,0xA1,0x80), GSFONT_ALIGN_LEFT, "Formato del disco:");
		myFont.Print(304, 640, 216, 1, GS_SET_RGBA(0x00,0x00,0x00,0x80), GSFONT_ALIGN_LEFT, (char *)discName);
	}
	else
	{
		myFont.Print(230, 640, 216, 1, GS_SET_RGBA(0x00,0x00,0x00,0x80), GSFONT_ALIGN_LEFT, "No Hay Disco");
	}
	
	putImage(img_logo, 21, 18);
	myFont.uploadFont(fontTex, myGsDriver->getTextureBufferBase(), fontTex->TexWidth, 0, 0 );
	myFont.Print(15, tvmx-15, 435, 1, colorGris2, GSFONT_ALIGN_LEFT, txt_40);
	
	myGsDriver->drawPipe.Flush();
	myGsDriver->WaitForVSync();
	myGsDriver->swapBuffers();
}
Exemple #2
0
// Show the contexts on the screen.
// Must be called from the main thread.
void
debugContexts (void)
{
	static volatile bool inDebugContexts = false;
			// Prevent this function from being called from within itself.
	
	CONTEXT orgContext;
	CONTEXT debugDrawContext;
			// We're going to use this context to draw in.
	FRAME debugDrawFrame;
	double hueIncrement;
	size_t visibleContextI;
	CONTEXT context;
	size_t contextCount;
	FRAME savedScreen;

	// Prevent this function from being called from within itself.
	if (inDebugContexts)
		return;
	inDebugContexts = true;

	contextCount = countVisibleContexts ();
	if (contextCount == 0)
	{
		goto out;
	}
	
	savedScreen = getScreen ();
	FlushGraphics ();
			// Make sure that the screen has actually been captured,
			// before we use the frame.

	// Create a new frame to draw on.
	debugDrawContext = CreateContext ("debugDrawContext");
	// New work frame is a copy of the original.
	debugDrawFrame = CaptureDrawable (CloneFrame (savedScreen));
	orgContext = SetContext (debugDrawContext);
	SetContextFGFrame (debugDrawFrame);

	hueIncrement = 360.0 / contextCount;

	visibleContextI = 0;
	for (context = GetFirstContext (); context != NULL;
			context = GetNextContext (context))
	{
		if (context == debugDrawContext) {
			// Skip our own context.
			continue;
		}
	
		if (isContextVisible (context))
		{
			// Only draw the visible contexts.
			drawContext (context, visibleContextI * hueIncrement);
			visibleContextI++;
		}

		describeContext (stderr, context);
	}

	// Blit the final debugging frame to the screen.
	putScreen (debugDrawFrame);

	// Wait for a key:
	{
		WAIT_STATE state;
		state.InputFunc = waitForKey;
		DoInput(&state, TRUE);
	}

	SetContext (orgContext);

	// Destroy the debugging frame and context.
	DestroyContext (debugDrawContext);
			// This does nothing with the drawable set with
			// SetContextFGFrame().
	DestroyDrawable (ReleaseDrawable (debugDrawFrame));
	
	putScreen (savedScreen);

	DestroyDrawable (ReleaseDrawable (savedScreen));

out:
	inDebugContexts = false;
}