void GraphicsManager::SetupDraw()
{
  //drawing settings
	glEnable(GL_DEPTH_TEST);
	glEnable(GL_CULL_FACE);
  glEnable(GL_VSYNC_SCE);

  //clear screen settings
	glClearColor (1.0f, 0.0f, 0.0f, 1.0f);
	glClearStencil (0);
	glClearDepthf (1.0f);

  //do a first clear and swap - probably redundant
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
	psglSwap();	

  //setup drawing mode
	//note: it's common to have to keep changing some of this, 
	//but right now we have only one model  
	glMatrixMode(GL_MODELVIEW);
	glEnableClientState(GL_VERTEX_ARRAY);
	glEnableClientState(GL_COLOR_ARRAY);
  glEnableClientState(GL_NORMAL_ARRAY);
  glEnable(GL_COLOR_MATERIAL);
	glShadeModel(GL_FLAT);

  // Enable transparency PSGL things
  glEnable(GL_BLEND);
  glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
} // SetUpDraw
//-----------------------------------------------------------------------------
// Purpose: End the current frame
//-----------------------------------------------------------------------------
void CGameEnginePS3::EndFrame()
{
	if ( BShuttingDown() )
		return;

	if ( !m_pPSGLDevice )
		return;

	if ( !m_pPSGLContext )
		return;

	// Flush point buffer
	BFlushPointBuffer();

	// Flush line buffer
	BFlushLineBuffer();

	// Flush quad buffer
	BFlushQuadBuffer();

	// Flush dbg font data
	cellDbgFontDraw();

	// Swap buffers now that everything is flushed
	psglSwap();
}
Exemple #3
0
void PS3Graphics::Refresh()
{
	// Is this sufficient for a callback redraw?

	glClear(GL_COLOR_BUFFER_BIT);
	glDrawArrays(GL_QUADS, 0, 4); 
	DrawHUD();
	psglSwap();
	last_redraw = sys_time_get_system_time();
}
Exemple #4
0
static void gfx_ctx_swap_buffers(void)
{
#ifdef HAVE_LIBDBGFONT
   cellDbgFontDraw();
#endif
#ifdef HAVE_PSGL
   psglSwap();
#endif
#ifdef HAVE_SYSUTILS
   cellSysutilCheckCallback();
#endif
}
Exemple #5
0
void menu_loop(void)
{
	menuStack[0] = menu_filebrowser;
	menuStack[0].enum_id = FILE_BROWSER_MENU;

	menu_is_running = true;

	menu_reinit_settings();

	do
	{
		glClear(GL_COLOR_BUFFER_BIT);
		ps3graphics_draw_menu();

		switch(menuStack[menuStackindex].enum_id)
		{
			case FILE_BROWSER_MENU:
				select_rom();
				break;
			case GENERAL_VIDEO_MENU:
			case GENERAL_AUDIO_MENU:
			case EMU_GENERAL_MENU:
			case EMU_VIDEO_MENU:
			case EMU_AUDIO_MENU:
			case PATH_MENU:
			case CONTROLS_MENU:
				select_setting(&menuStack[menuStackindex]);
				break;
#ifdef HAVE_GAMEAWARE
			case GAME_AWARE_SHADER_CHOICE:
#endif
			case SHADER_CHOICE:
			case PRESET_CHOICE:
			case BORDER_CHOICE:
			case INPUT_PRESET_CHOICE:
				select_file(menuStack[menuStackindex].enum_id);
				break;
			case PATH_SAVESTATES_DIR_CHOICE:
			case PATH_DEFAULT_ROM_DIR_CHOICE:
			case PATH_CHEATS_DIR_CHOICE:
			case PATH_SRAM_DIR_CHOICE:
				select_directory(menuStack[menuStackindex].enum_id);
				break;
		}

		psglSwap();
		cell_console_poll();
		cellSysutilCheckCallback();
	}while (menu_is_running);
}
Exemple #6
0
void CapApp::initGraphics(PSGLdevice */*device*/)
{
	textures[TEX_MAIN_MENU]		= new c_tex(nTextures, g_opt_szTextures[TEX_MAIN_MENU]);
	nTextures++;
	textures[TEX_GAME_LIST]		= new c_tex(nTextures, g_opt_szTextures[TEX_GAME_LIST]);
	nTextures++;
	textures[TEX_ZIP_INFO]		= new c_tex(nTextures, g_opt_szTextures[TEX_ZIP_INFO]);
	nTextures++;
	textures[TEX_OPTIONS]		= new c_tex(nTextures, g_opt_szTextures[TEX_OPTIONS]);
	nTextures++;
	textures[TEX_FILEBROWSER]	= new c_tex(nTextures, g_opt_szTextures[TEX_FILEBROWSER]);
	nTextures++;

	textures[TEX_PREVIEW]		= new c_tex(TEX_PREVIEW, g_opt_szTextures[TEX_PREVIEW]);

	// clear the screen on startup
	glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
	psglSwap();
}
void										ESVideoPlatform::Flip					()
{
    psglSwap();
}
Exemple #8
0
bool CapApp::onInit(int argc, char* argv[])
{
	(void)argc;
	(void)argv;

	// ----------------------------------------------
	// FTP	
	cellSysmoduleLoadModule(CELL_SYSMODULE_NET);
	cellNetCtlInit();
	cellSysmoduleLoadModule(CELL_SYSMODULE_HTTP);
	sys_net_initialize_network();
	ftp_on();

	// Load settings...
	if(!iniRead()) {
		iniWrite(); // create settings file...
	}

	cellSysmoduleLoadModule(CELL_SYSMODULE_FS);

	cellSysmoduleLoadModule(CELL_SYSMODULE_SYSUTIL_SCREENSHOT);
	cellScreenShotEnable();

	InputInit();

	while(!videoOutIsReady())
	{
		// ...
	}


	PSGLinitOptions options = 
	{
		enable:					PSGL_INIT_MAX_SPUS | PSGL_INIT_INITIALIZE_SPUS,
		maxSPUs:				1,
		initializeSPUs:			GL_FALSE,
		persistentMemorySize:	0,
		transientMemorySize:	0,
		errorConsole:			0,
		fifoSize:				0,  
		hostMemorySize:			128* 1024*1024,  // 128 mbs for host memory 
	};

#if CELL_SDK_VERSION < 0x340000
	options.enable |=	PSGL_INIT_HOST_MEMORY_SIZE;
#endif

	// Initialize 6 SPUs but reserve 1 SPU as a raw SPU for PSGL
	sys_spu_initialize(6, 1);
	psglInit(&options);

	const unsigned int resolutions[] = { 
		CELL_VIDEO_OUT_RESOLUTION_1080, 
		CELL_VIDEO_OUT_RESOLUTION_960x1080, 
		CELL_VIDEO_OUT_RESOLUTION_720, 
		CELL_VIDEO_OUT_RESOLUTION_480 
	};

	const int numResolutions = sizeof(resolutions) / sizeof(resolutions[0]);

	int bestResolution = chooseBestResolution(resolutions,numResolutions);

	getResolutionWidthHeight(bestResolution, deviceWidth, deviceHeight);

	if(bestResolution)
	{
		PSGLdeviceParameters params;

		params.enable				= PSGL_DEVICE_PARAMETERS_COLOR_FORMAT |
									  PSGL_DEVICE_PARAMETERS_DEPTH_FORMAT |
									  PSGL_DEVICE_PARAMETERS_MULTISAMPLING_MODE;
		params.colorFormat			= GL_ARGB_SCE;
		params.depthFormat			= GL_NONE;
		params.multisamplingMode	= GL_MULTISAMPLING_NONE_SCE;
		params.enable				|= PSGL_DEVICE_PARAMETERS_WIDTH_HEIGHT;
		params.width				= deviceWidth;
		params.height				= deviceHeight;

		device						= psglCreateDeviceExtended(&params);
		context						= psglCreateContext();

		psglMakeCurrent(context, device);
		psglResetCurrentContext();

		initGraphics();

		if( cellSysutilRegisterCallback( 0, callback_sysutil_exit, NULL ) < 0 ) {
			//...
		}

		dbgFontInit();

		fbaRL = new c_fbaRL();

		while(bRun)
		{
			onRender();
			onUpdate();
			cellSysutilCheckCallback();
		}

	} else {
		// resolution error...
	}

	ftp_off();

	onShutdown();

	return false;
}

void CapApp::onRender()
{
	if(fbaRL) { fbaRL->DlgDisplayFrame(); }

	// get render target buffer dimensions and set viewport	
	psglGetRenderBufferDimensions(device,&app.renderWidth,&app.renderHeight);

	glViewport(0, 0, app.renderWidth, app.renderHeight);

	glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

	if(fbaRL) { fbaRL->RenderBackground(); }
	if(fbaRL) { fbaRL->nFrameStep = 0; fbaRL->DisplayFrame(); }
	if(fbaRL) { fbaRL->nFrameStep = 1; fbaRL->DisplayFrame(); }
	dbgFontDraw();

	psglSwap();
}

bool CapApp::onUpdate()
{
	if(!mFrame) mFrame = 0;
	mFrame++;

	InputFrameStart();
	if(fbaRL) fbaRL->InputFrame();
	InputFrameEnd();	

	return true;
}

void CapApp::onShutdown()
{
	iniWrite(); // save settings

	if(context) psglDestroyContext(context);
	if(device) psglDestroyDevice(device);

	InputExit();
	psglExit();
}
//-----------------------------------------------------------------------------
// Purpose: Initialize the PSGL rendering interfaces and default state
//-----------------------------------------------------------------------------
bool CGameEnginePS3::BInitializePSGL()
{
	// Clear any errors
	glGetError();

	// First, initialize PSGL
	// Note that since we initialized the SPUs ourselves earlier we should
	// make sure that PSGL doesn't try to do so as well.
	PSGLinitOptions initOpts = {
		enable: PSGL_INIT_MAX_SPUS | PSGL_INIT_INITIALIZE_SPUS | PSGL_INIT_HOST_MEMORY_SIZE,
		maxSPUs: 1,
		initializeSPUs: false,
						// We're not specifying values for these options, the code is only here
						// to alleviate compiler warnings.
		persistentMemorySize: 0,
		transientMemorySize: 0,
		errorConsole: 0,
		fifoSize: 0,	
		hostMemorySize: 128*1024*1024,  // 128 mbs for host memory 
	};

	psglInit( &initOpts );

	m_pPSGLDevice = psglCreateDeviceAuto( GL_ARGB_SCE, GL_DEPTH_COMPONENT24, GL_MULTISAMPLING_4X_SQUARE_ROTATED_SCE );
	if ( !m_pPSGLDevice )
	{
		OutputDebugString( "!! Failed to init the device \n" ); 
		return false;
	}

	GLuint width, height;
	psglGetDeviceDimensions( m_pPSGLDevice, &width, &height );
	m_nWindowHeight = height;
	m_nWindowWidth = width;

	// Now create a PSGL context
	m_pPSGLContext = psglCreateContext();
	if ( !m_pPSGLContext ) 
	{
		OutputDebugString( "Error creating PSGL context\n" );
		return false;
	}

	// Make this context current for the device we initialized
	psglMakeCurrent( m_pPSGLContext, m_pPSGLDevice );

	// Since we're using fixed function stuff (i.e. not using our own shader
	// yet), we need to load shaders.bin that contains the fixed function 
	// shaders.
	psglLoadShaderLibrary( SYS_APP_HOME"/shaders.bin" );

	// Reset the context
	psglResetCurrentContext();

	glViewport( 0, 0, width, height );
	glScissor( 0, 0, width, height );
	glClearDepthf(1.0f);
	glClearColor( 0.0f, 0.0f, 0.0f, 1.0f );
	glEnable( GL_VSYNC_SCE );

	glEnable( GL_BLEND );
	glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );

	glDisable( GL_CULL_FACE );
	glDisable( GL_ALPHA_TEST );
	glDisable( GL_STENCIL_TEST );
	glDisable( GL_SCISSOR_TEST );
	glDisable( GL_LIGHTING );
	glDisable( GL_DEPTH_TEST );
	glDisable( GL_FOG );

	glDepthMask( GL_FALSE );

	// We always need these two
	glEnableClientState( GL_COLOR_ARRAY );
	glEnableClientState( GL_VERTEX_ARRAY );

	// This we'll enable as needed
	glDisableClientState( GL_TEXTURE_COORD_ARRAY );

	glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );

	glMatrixMode( GL_PROJECTION );
	glLoadIdentity();
	glOrthof( 0, width, height, 0, -1.0f, 1.0f );
	glTranslatef( 0, 0, 0 );

	glMatrixMode( GL_MODELVIEW );
	glLoadIdentity();
	glTranslatef( 0, 0, 0 );

	glMatrixMode( GL_TEXTURE );
	glLoadIdentity();
	glTranslatef( 0, 0, 0 );

	glDepthRangef( 0.0f, 1.0f );

	// PSGL doesn't clear the screen on startup, so let's do that here.
	glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT );
	psglSwap();

	return true;
}


//-----------------------------------------------------------------------------
// Purpose: Initialize the debug font library
//-----------------------------------------------------------------------------
bool CGameEnginePS3::BInitializeCellDbgFont()
{
	// initialize debug font library, then open 2 consoles
	CellDbgFontConfig cfg;
	cfg.bufSize      = 4096;
	cfg.screenWidth  = m_nWindowWidth;
	cfg.screenHeight = m_nWindowHeight;
	if ( cellDbgFontInit( &cfg) != CELL_OK )
	{
		OutputDebugString( "Failed initializing CellDbgFont\n" );
	}

	CellDbgFontConsoleConfig ccfg0;
	ccfg0.posLeft     = 0.18f;
	ccfg0.posTop      = 0.82f;
	ccfg0.cnsWidth    = 128;
	ccfg0.cnsHeight   = 8;
	ccfg0.scale       = 0.65f;
	ccfg0.color       = 0xff0080ff;  // ABGR -> orange
	g_DbgFontConsoleID = m_DbgFontConsoleID = cellDbgFontConsoleOpen( &ccfg0 );
	if ( g_DbgFontConsoleID < 0 )
	{
		OutputDebugString( "Failed creating CellDbgFontConsole\n" );
	}

	return true;
}
Exemple #10
0
void gfx_ctx_swap_buffers(void)
{
   psglSwap();
}
Exemple #11
0
static void gfx_ctx_swap_buffers(void)
{
#if defined(HAVE_PSGL)
   psglSwap();
#endif
}
Exemple #12
0
static void						CalculateUnderscan				()
{
	/* Setup libpad for our needs */
	CellPadData data;
	uint32_t buttons = 0;

	/* Get the current button state */
	if(CELL_OK == cellPadGetData(0, &data) && data.len >= 8)
	{
		buttons = data.button[2] | (data.button[3] << 8);
	}

	/* If we didn't get anything from the rcfile, or the user is holding select */
	if(!GotUnderscanValues || buttons & 1)
	{
		UnderscanX = 0;
		UnderscanY = 0;

		/* Get the screen size */
		uint32_t width, height;
		psglGetDeviceDimensions(psglGetCurrentDevice(), &width, &height);

		/* Generate image */
		uint32_t* img = malloc((width / 10) * (height / 10) * 4);
		for(int i = 0; i != height / 10; i ++)
		{
			for(int j = 0; j != width / 10; j ++)
			{
				img[i * (width / 10) + j] = (i == 0 || j == 0 || i == (height / 10 - 1) || j == (width / 10 - 1)) ? 0xFF0000FF : 0xFF000000;
			}
		}

		CELL_IMAGE_Load(&overimage, 0, 0, width, height, img, width / 10, height / 10);

		free(img);

		CELL_IMAGE_Load(&helpimage, width / 2 - OVER_WIDTH / 2, height / 2 - OVER_HEIGHT / 2, OVER_WIDTH, OVER_HEIGHT, OverscanHelpImage, OVER_WIDTH, OVER_HEIGHT);

		/* Setup drawing */
		glMatrixMode(GL_PROJECTION);
		glLoadIdentity();
		glOrthof(0, width, height, 0, -1, 1);

		/* Loop */
		while(1)
		{
			/* Draw screen */
			float widthP = ((float)width) * (((float)(UnderscanX)) / 100.0f);
			float heightP = ((float)height) * (((float)(UnderscanY)) / 100.0f);
			glViewport(widthP, heightP, width - widthP * 2, height - heightP * 2);
			glClear(GL_COLOR_BUFFER_BIT);
			CELL_IMAGE_Draw(&overimage);
			CELL_IMAGE_Draw(&helpimage);
			psglSwap();

			/* Update buttons */
			if(CELL_OK == cellPadGetData(0, &data) && data.len >= 8)
			{
				buttons = data.button[2] | (data.button[3] << 8);
			}

			/* Update state */
			if(buttons & 0x4000)		break;
			if(buttons & 0x10)			UnderscanY --;
			if(buttons & 0x40)			UnderscanY ++;
			if(buttons & 0x20)			UnderscanX --;
			if(buttons & 0x80)			UnderscanX ++;

			UnderscanX = (UnderscanX < -5) ? -5 : UnderscanX;
			UnderscanY = (UnderscanY < -5) ? -5 : UnderscanY;
			UnderscanX = (UnderscanX > 25) ? 25 : UnderscanX;
			UnderscanY = (UnderscanY > 25) ? 25 : UnderscanY;

			SDL_Delay(50);
		}

		/* Release the image */
//		CELL_IMAGE_Free(&overimage);
		CELL_IMAGE_Free(&helpimage);
	}

	CELL_PSGL_SetUnderscan(UnderscanX, UnderscanY);
}
Exemple #13
0
int32_t PS3Graphics::PSGLInit()
{
	glDisable(GL_DEPTH_TEST);
	glDisable(GL_SCISSOR_TEST);
	glDisable(GL_CULL_FACE);
	glDisable(GL_LIGHTING);
	glDisable(GL_FOG);
	glDisable(GL_DITHER);
	glShadeModel(GL_FLAT);
	glEnable(GL_VSYNC_SCE);
	glEnable(GL_TEXTURE_2D);

	/*
	//glEnable(GL_BLEND);
	//glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_ADD);
	//glBlendColor(0, 0, 0, 0);
	//glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
	 */

	context_width = SCREEN_RENDER_TEXTURE_WIDTH;
	context_height = SCREEN_RENDER_TEXTURE_HEIGHT;

	InitCg();

	SetViewports();

	glMatrixMode(GL_MODELVIEW);
	glLoadIdentity();

	glGenBuffers(2, vbo);

	glBindBuffer(GL_TEXTURE_REFERENCE_BUFFER_SCE, vbo[0]);
	glBufferData(GL_TEXTURE_REFERENCE_BUFFER_SCE, SCREEN_RENDER_TEXTURE_HEIGHT * SCREEN_RENDER_TEXTURE_PITCH, NULL, GL_STREAM_DRAW);
	glTextureReferenceSCE(GL_TEXTURE_2D, 1, SCREEN_RENDER_TEXTURE_WIDTH, SCREEN_RENDER_TEXTURE_HEIGHT, 0, GL_RGB5_A1, SCREEN_RENDER_TEXTURE_PITCH, 0);

	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER);

	SetSmooth(m_smooth);

	// PSGL doesn't clear the screen on startup, so let's do that here.
	glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
	glColor4f(1.0, 1.0, 1.0, 1.0);
	glClear(GL_COLOR_BUFFER_BIT);
	psglSwap();

	// Use some initial values for the screen quad.
	GLfloat vertexes[] = {
		0, 0, 0,
		0, 1, 0,
		1, 1, 0,
		1, 0, 0,
		0, 1,
		0, 0,
		1, 0,
		1, 1
	};

	GLfloat vertex_buf[128];
	__builtin_memcpy(vertex_buf, vertexes, 12 * sizeof(GLfloat));
	__builtin_memcpy(vertex_buf + 32, vertexes + 12, 8 * sizeof(GLfloat));
	__builtin_memcpy(vertex_buf + 32 * 3, vertexes + 12, 8 * sizeof(GLfloat));

	glBindBuffer(GL_ARRAY_BUFFER, vbo[1]);
	glBufferData(GL_ARRAY_BUFFER, 256, vertex_buf, GL_STATIC_DRAW);

	glEnableClientState(GL_VERTEX_ARRAY);
	glEnableClientState(GL_TEXTURE_COORD_ARRAY);
	glVertexPointer(3, GL_FLOAT, 0, 0);
	glTexCoordPointer(2, GL_FLOAT, 0, (void*)128);

	return CELL_OK;
}
Exemple #14
0
void FceuGraphics::Swap() const
{
	psglSwap();
}
void render(bool bClearOnly)
{
	glClearColor(0.0, 0.0, 0.0, 0.0);
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

	if(bClearOnly == false)
	{
		textures[0]->Render(0,0,0,0);

		// =============================================================================================
		// TITLE
		// =============================================================================================

		double xPos, yPos;

		xPos = DbgFontCenterX( 
			0,									// x left (as in RECT)
			render_width,						// x right (as in RECT)
			FONT_SIZE_1,						// font size (in pixels)		
			strlen(szTitle),					// text length (num. chars)
			REFERENCE_WIDTH, REFERENCE_HEIGHT,	// reference width / height (should not be changed)
			render_width, render_height			// currently active resolution
		);
		yPos = DbgFontY(50.0, render_height);

		cellDbgFontPrintf(xPos, yPos, debug_font_size(FONT_SIZE_1), 0xFFFFFFFF, "%s", szTitle);
		
		yPos += DbgFontY(FONT_SIZE_1 + FONT_SPACING, render_height);

		// =============================================================================================
		// DATE
		// =============================================================================================

		char szDate[128];
		char szTime[128];
		memset(&szDate, 0, sizeof(szDate));
		memset(&szTime, 0, sizeof(szTime));

		GetDateTimeStr((char*)szDate, (char*)szTime, false);

		xPos = DbgFontCenterX(
			0,									// x left (as in RECT)
			render_width,						// x right (as in RECT)
			FONT_SIZE_2,						// font size (in pixels)
			strlen(szDate),						// text length (num. chars)
			REFERENCE_WIDTH, REFERENCE_HEIGHT,	// reference width / height (should not be changed)
			render_width, render_height			// currently active resolution
		);
		
		cellDbgFontPrintf(xPos, yPos, debug_font_size(FONT_SIZE_2), 0xFFFFFFFF, "%s", szDate);
		
		yPos += DbgFontY(FONT_SIZE_2 + FONT_SPACING, render_height);
		
		// =============================================================================================
		// TIME
		// =============================================================================================

		xPos = DbgFontCenterX(
			0,									// x left (as in RECT)
			render_width,						// x right (as in RECT)
			FONT_SIZE_1,						// font size (in pixels)
			strlen(szTime),						// text length (num. chars)
			REFERENCE_WIDTH, REFERENCE_HEIGHT,	// reference width / height (should not be changed)
			render_width, render_height			// currently active resolution
		);
		
		cellDbgFontPrintf(xPos, yPos, debug_font_size(FONT_SIZE_1), 0xFFFFFFFF, "%s", szTime);
		
		yPos += DbgFontY(FONT_SIZE_1 + FONT_SPACING, render_height);

		// =============================================================================================
		
		static uint64_t nInterval = 30;				// 0.5 second @ 60 FPS
		static uint64_t nFrameCheckpoint = nFrame;
		
		if(nFrame >= (nFrameCheckpoint + nInterval)) 
		{
			nFrameCheckpoint = nFrame;
			
			sys_game_get_temperature(0, &temp_cpu);
			sys_game_get_temperature(1, &temp_rsx);
		}

		char szTemperature[256];
		memset(&szTemperature, 0, sizeof(szTemperature));

		sprintf(szTemperature, "Temperature: (CPU: %d' C) (RSX: %d' C)", temp_cpu, temp_rsx);

		xPos = DbgFontCenterX(
			0,									// x left (as in RECT)
			render_width,						// x right (as in RECT)
			FONT_SIZE_2,						// font size (in pixels)
			strlen(szTemperature),				// text length (num. chars)
			REFERENCE_WIDTH, REFERENCE_HEIGHT,	// reference width / height (should not be changed)
			render_width, render_height			// currently active resolution
		);
		
		cellDbgFontPrintf(xPos, yPos, debug_font_size(FONT_SIZE_2), 0xFFFFFFFF, "%s", szTemperature);
		
		yPos += DbgFontY(FONT_SIZE_2 + FONT_SPACING, render_height);

		// ===
		yPos += DbgFontY(FONT_SIZE_2 + FONT_SPACING, render_height);
		yPos += DbgFontY(FONT_SIZE_2 + FONT_SPACING, render_height);
		// ===

		//xPos = DbgFontCenterX(
		//	0,									// x left (as in RECT)
		//	render_width,						// x right (as in RECT)
		//	FONT_SIZE_2,						// font size (in pixels)
		//	strlen((char*)"..::[ ISO LIST ] [ PS3ISO / PSXISO / BDISO / DVDISO ] ::.."),				// text length (num. chars)
		//	REFERENCE_WIDTH, REFERENCE_HEIGHT,	// reference width / height (should not be changed)
		//	render_width, render_height			// currently active resolution
		//);
		//
		//cellDbgFontPrintf(xPos, yPos, debug_font_size(FONT_SIZE_2), 0xFFFFFFFF, "%s", (char*)"..::[ ISO LIST ] [ PS3ISO / PSXISO / BDISO / DVDISO ] ::..");
		//
		yPos += DbgFontY(FONT_SIZE_2 + FONT_SPACING, render_height);
		yPos += DbgFontY(FONT_SIZE_2 + FONT_SPACING, render_height);

		// ================

		xPos = DbgFontX(100.0, render_width);

		int nMenuItem = main_menu->UpdateTopItem();	

		while(nMenuItem <= (main_menu->nTopItem + main_menu->nListMax))
		{
			if(nMenuItem == main_menu->nTotalItem) break;
			if(main_menu->nTotalItem <= 0) break;

			// normal
			unsigned int nColor = 0xFFFFFFFF;

			// selected
			if(nMenuItem == main_menu->nSelectedItem) {
				nColor = 0xFF00CCFF;
			}
		
			//if(nFrameStep == 0) { nColor = g_opt_nFontShadowColor; } // Shadow color

			cellDbgFontPrintf(xPos, yPos, debug_font_size(FONT_SIZE_2), nColor, "%s", main_menu->item[nMenuItem]->szMenuLabel/*, main_menu->item[nMenuItem]->szData_1*/);
			yPos += DbgFontY(FONT_SIZE_2 + FONT_SPACING, render_height);

			nMenuItem++;
		}

		(void)font_render();		
	}
	
	nFrame++;
	psglSwap();
}