Пример #1
0
void CapApp::dbgFontInit(void)
{
// initialize debug font library, then open 2 consoles
int ret;

CellDbgFontConfig cfg;
memset(&cfg, 0, sizeof(CellDbgFontConfig));

cfg.bufSize = 2048;
cfg.screenWidth = mDispInfo.mWidth;
cfg.screenHeight = mDispInfo.mHeight;

ret = cellDbgFontInit(&cfg);

if (ret != CELL_OK)
{
cellMsgDialogOpen2(CELL_MSGDIALOG_DIALOG_TYPE_NORMAL, "cellDbgFontInit() failed", callbackfunction, NULL, NULL);
return;
}

CellDbgFontConsoleConfig ccfg[2];
memset(ccfg, 0, sizeof(ccfg));

ccfg[0].posLeft = 0.1f;
ccfg[0].posTop = 0.8f;
ccfg[0].cnsWidth = 32;
ccfg[0].cnsHeight = 4;
ccfg[0].scale = 1.0f;

// ABGR -> orange
ccfg[0].color = 0xff0080ff;

//mDbgFontID[0] = cellDbgFontConsoleOpen(&ccfg[0]);

if (mDbgFontID[0] < 0)
{
cellMsgDialogOpen2(CELL_MSGDIALOG_DIALOG_TYPE_NORMAL, "cellDbgFontConsoleOpen() failed", callbackfunction, NULL, NULL);
return;
}

ccfg[1].posLeft = 0.25f;
ccfg[1].posTop = 0.2f;
ccfg[1].cnsWidth = 256;
ccfg[1].cnsHeight = 64;
ccfg[1].scale = 0.5f;

// ABGR -> pale blue
ccfg[1].color = 0xffff8080;

if (mDbgFontID[1] < 0)
{
cellMsgDialogOpen2(CELL_MSGDIALOG_DIALOG_TYPE_NORMAL, "cellDbgFontConsoleOpen() failed", callbackfunction, NULL, NULL);
return;
}
}
Пример #2
0
void Emulator_Implementation_SaveCustomControls(bool showdialog)
{
	if(Settings.ControlScheme == CONTROL_SCHEME_CUSTOM)
	{
		if(showdialog)
		{
			dialog_is_running = true;
			cellMsgDialogOpen2(CELL_MSGDIALOG_DIALOG_TYPE_NORMAL|\
			CELL_MSGDIALOG_TYPE_BG_VISIBLE|\
			CELL_MSGDIALOG_TYPE_BUTTON_TYPE_YESNO|\
			CELL_MSGDIALOG_TYPE_DISABLE_CANCEL_OFF|\
			CELL_MSGDIALOG_TYPE_DEFAULT_CURSOR_YES,\
			"Do you want to save the custom controller settings?",\
			cb_save_custom_controls,NULL,NULL);
			while(dialog_is_running && Emulator_ROMRunning())
			{
				Graphics->Clear();
				Graphics->Swap();
				cellSysutilCheckCallback();	
			}
		}
		if(!showdialog || Settings.SaveCustomControlScheme)
		{
			Emulator_Implementation_ButtonMappingSettings(MAP_BUTTONS_OPTION_SETTER);
		}
	}
}
Пример #3
0
void				LibESPlatform::Error				(const std::string& aMessage, const std::string& aHeader)
{
	want_to_sleep = true;
	cellMsgDialogOpen2(CELL_MSGDIALOG_TYPE_BUTTON_TYPE_OK, aMessage.c_str(), ErrorCallback, 0, 0);

	while(LibES::WantToSleep() && !LibES::WantToDie())
	{
		ESVideo::Flip();
	}
}
Пример #4
0
bool				LibESPlatform::Confirm				(const std::string& aMessage, bool* aCancel)
{
	ErrorData result;

	want_to_sleep = true;
	cellMsgDialogOpen2(CELL_MSGDIALOG_TYPE_BUTTON_TYPE_YESNO, aMessage.c_str(), ErrorCallback, &result, 0);

	while(LibES::WantToSleep() && !LibES::WantToDie())
	{
		ESVideo::Flip();
	}

	if(aCancel)
	{
		*aCancel = result.Cancel;
	}

	return result.Accept;
}
Пример #5
0
s32 cellMsgDialogOpenErrorCode(PPUThread& CPU, u32 errorCode, vm::ptr<CellMsgDialogCallback> callback, vm::ptr<void> userData, vm::ptr<void> extParam)
{
	cellSysutil.Warning("cellMsgDialogOpenErrorCode(errorCode=0x%x, callback=*0x%x, userData=*0x%x, extParam=*0x%x)", errorCode, callback, userData, extParam);

	std::string error;

	switch (errorCode)
	{
	case 0x80010001: error = "The resource is temporarily unavailable."; break;
	case 0x80010002: error = "Invalid argument or flag."; break;
	case 0x80010003: error = "The feature is not yet implemented."; break;
	case 0x80010004: error = "Memory allocation failed."; break;
	case 0x80010005: error = "The resource with the specified identifier does not exist."; break;
	case 0x80010006: error = "The file does not exist."; break;
	case 0x80010007: error = "The file is in unrecognized format / The file is not a valid ELF file."; break;
	case 0x80010008: error = "Resource deadlock is avoided."; break;
	case 0x80010009: error = "Operation not permitted."; break;
	case 0x8001000A: error = "The device or resource is busy."; break;
	case 0x8001000B: error = "The operation is timed out."; break;
	case 0x8001000C: error = "The operation is aborted."; break;
	case 0x8001000D: error = "Invalid memory access."; break;
	case 0x8001000F: error = "State of the target thread is invalid."; break;
	case 0x80010010: error = "Alignment is invalid."; break;
	case 0x80010011: error = "Shortage of the kernel resources."; break;
	case 0x80010012: error = "The file is a directory."; break;
	case 0x80010013: error = "Operation cancelled."; break;
	case 0x80010014: error = "Entry already exists."; break;
	case 0x80010015: error = "Port is already connected."; break;
	case 0x80010016: error = "Port is not connected."; break;
	case 0x80010017: error = "Failure in authorizing SELF. Program authentication fail."; break;
	case 0x80010018: error = "The file is not MSELF."; break;
	case 0x80010019: error = "System version error."; break;
	case 0x8001001A: error = "Fatal system error occurred while authorizing SELF. SELF auth failure."; break;
	case 0x8001001B: error = "Math domain violation."; break;
	case 0x8001001C: error = "Math range violation."; break;
	case 0x8001001D: error = "Illegal multi-byte sequence in input."; break;
	case 0x8001001E: error = "File position error."; break;
	case 0x8001001F: error = "Syscall was interrupted."; break;
	case 0x80010020: error = "File too large."; break;
	case 0x80010021: error = "Too many links."; break;
	case 0x80010022: error = "File table overflow."; break;
	case 0x80010023: error = "No space left on device."; break;
	case 0x80010024: error = "Not a TTY."; break;
	case 0x80010025: error = "Broken pipe."; break;
	case 0x80010026: error = "Read-only filesystem."; break;
	case 0x80010027: error = "Illegal seek."; break;
	case 0x80010028: error = "Arg list too long."; break;
	case 0x80010029: error = "Access violation."; break;
	case 0x8001002A: error = "Invalid file descriptor."; break;
	case 0x8001002B: error = "Filesystem mounting failed."; break;
	case 0x8001002C: error = "Too many files open."; break;
	case 0x8001002D: error = "No device."; break;
	case 0x8001002E: error = "Not a directory."; break;
	case 0x8001002F: error = "No such device or IO."; break;
	case 0x80010030: error = "Cross-device link error."; break;
	case 0x80010031: error = "Bad Message."; break;
	case 0x80010032: error = "In progress."; break;
	case 0x80010033: error = "Message size error."; break;
	case 0x80010034: error = "Name too long."; break;
	case 0x80010035: error = "No lock."; break;
	case 0x80010036: error = "Not empty."; break;
	case 0x80010037: error = "Not supported."; break;
	case 0x80010038: error = "File-system specific error."; break;
	case 0x80010039: error = "Overflow occured."; break;
	case 0x8001003A: error = "Filesystem not mounted."; break;
	case 0x8001003B: error = "Not SData."; break;
	case 0x8001003C: error = "Incorrect version in sys_load_param."; break;
	case 0x8001003D: error = "Pointer is null."; break;
	case 0x8001003E: error = "Pointer is null."; break;
	default: error = "An error has occurred."; break;
	}

	error.append(fmt::format("\n(%08x)", errorCode));

	vm::stackvar<char> message(CPU, error.size() + 1);

	memcpy(message.get_ptr(), error.c_str(), message.size());

	return cellMsgDialogOpen2(CELL_MSGDIALOG_DIALOG_TYPE_ERROR | CELL_MSGDIALOG_TYPE_BUTTON_TYPE_OK, message, callback, userData, extParam);
}
Пример #6
0
void change_param_sfo_version(char *file)
{
	FILE *fp;

	fp = fopen(file, "rb");
	if (fp != NULL) {
		unsigned len, pos, str;
		unsigned char *mem = NULL;

		fseek(fp, 0, SEEK_END);
		len = ftell(fp);

		mem = (unsigned char *) malloc(len + 16);
		if (!mem) {
			fclose(fp);
			return;
		}

		memset(mem, 0, len + 16);

		fseek(fp, 0, SEEK_SET);
		fread((void *) mem, len, 1, fp);
		fclose(fp);

		str = (mem[8] + (mem[9] << 8));
		pos = (mem[0xc] + (mem[0xd] << 8));

		int indx = 0;

		while (str < len) {
			if (mem[str] == 0)
				break;

			if (!strcmp((char *) &mem[str], "PS3_SYSTEM_VER")) {
				double ver;
				ver = strtod((char *) &mem[pos], NULL);
				if (ver > 3.41) {
					char msg[128];
					snprintf(msg, sizeof(msg),
							 "This game requires PS3_SYSTEM_VER %.2f\nDo you want to try fixing PARAM.SFO by forcing 3.41 version?",
							 ver);
					dialog_ret = 0;
					cellMsgDialogOpen2(type_dialog_yes_no, msg, dialog_fun1, (void *) 0x0000aaaa, NULL);
					wait_dialog();
					if (dialog_ret == 1) {
						memcpy(&mem[pos], "03.410", 6);
						fp = fopen(file, "wb");
						fwrite(mem, len, 1, fp);
						fclose(fp);
					}
				}
				break;
			}
			while (mem[str])
				str++;
			str++;
			pos += (mem[0x1c + indx] + (mem[0x1d + indx] << 8));
			indx += 16;
		}
		if (mem)
			free(mem);
	}
}