本文整理汇总了C++中BurnDrvGetText函数的典型用法代码示例。如果您正苦于以下问题:C++ BurnDrvGetText函数的具体用法?C++ BurnDrvGetText怎么用?C++ BurnDrvGetText使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了BurnDrvGetText函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GameConfigName
static TCHAR* GameConfigName()
{
// Return the path of the config file for this game
static TCHAR szName[32];
_stprintf(szName, _T("config\\games\\%.8s.ini"), BurnDrvGetText(DRV_NAME));
return szName;
}
示例2: LoadIpsActivePatches
void LoadIpsActivePatches()
{
for (int i = 0; i < MAX_ACTIVE_PATCHES; i++) {
_stprintf(szIpsActivePatches[i], _T(""));
}
FILE* fp = _tfopen(GameIpsConfigName(), _T("rt"));
TCHAR szLine[MAX_PATH];
int nActivePatches = 0;
if (fp) {
while (_fgetts(szLine, sizeof(szLine), fp)) {
int nLen = _tcslen(szLine);
// Get rid of the linefeed at the end
if (szLine[nLen - 1] == 10) {
szLine[nLen - 1] = 0;
nLen--;
}
if (!_tcsnicmp(szLine, _T("//"), 2)) continue;
if (!_tcsicmp(szLine, _T(""))) continue;
_stprintf(szIpsActivePatches[nActivePatches], _T("%s%s\\%s"), szAppIpsPath, BurnDrvGetText(DRV_NAME), szLine);
nActivePatches++;
}
fclose(fp);
}
}
示例3: GetIpsNumPatches
int GetIpsNumPatches()
{
WIN32_FIND_DATA wfd;
HANDLE hSearch;
TCHAR szFilePath[MAX_PATH];
int Count = 0;
_stprintf(szFilePath, _T("%s%s\\"), szAppIpsPath, BurnDrvGetText(DRV_NAME));
_tcscat(szFilePath, _T("*.dat"));
hSearch = FindFirstFile(szFilePath, &wfd);
if (hSearch != INVALID_HANDLE_VALUE) {
int Done = 0;
while (!Done ) {
Count++;
Done = !FindNextFile(hSearch, &wfd);
}
FindClose(hSearch);
}
return Count;
}
示例4: StatedLoad
int StatedLoad(int nSlot)
{
TCHAR szFilter[1024];
int nRet;
int bOldPause;
if (nSlot) {
CreateStateName(nSlot);
} else {
if (bDrvOkay) {
_stprintf(szChoice, _T("%s*.fs"), BurnDrvGetText(DRV_NAME));
} else {
_stprintf(szChoice, _T("savestate"));
}
MakeOfn(szFilter);
ofn.lpstrTitle = FBALoadStringEx(hAppInst, IDS_STATE_LOAD, true);
bOldPause = bRunPause;
bRunPause = 1;
nRet = GetOpenFileName(&ofn);
bRunPause = bOldPause;
if (nRet == 0) { // Error
return 1;
}
}
nRet = BurnStateLoad(szChoice, 1, &DrvInitCallback);
if (nSlot) {
return nRet;
}
// Describe any possible errors:
if (nRet == 3) {
FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_DISK_THIS_STATE));
FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_DISK_UNAVAIL));
} else {
if (nRet == 4) {
FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_DISK_THIS_STATE));
FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_DISK_TOOOLD), _T(APP_TITLE));
} else {
if (nRet == 5) {
FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_DISK_THIS_STATE));
FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_DISK_TOONEW), _T(APP_TITLE));
} else {
if (nRet && !nSlot) {
FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_DISK_LOAD));
FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_DISK_STATE));
}
}
}
}
if (nRet) {
FBAPopupDisplay(PUF_TYPE_ERROR);
}
return nRet;
}
示例5: GameConfigName
static TCHAR* GameConfigName()
{
// Return the path of the config file for this game
static TCHAR szName[MAX_PATH];
_stprintf(szName, _T("%sconfig\\games\\%s.ini"), szCurrentPath, BurnDrvGetText(DRV_NAME));
return szName;
}
示例6: SetFavoritesIcons
void SetFavoritesIcons()
{
if(nFavDrvCount == 0) {
return;
}
if(nIconsSize == ICON_16x16) nIconsSizeXY = 16;
if(nIconsSize == ICON_24x24) nIconsSizeXY = 24;
if(nIconsSize == ICON_32x32) nIconsSizeXY = 32;
HIMAGELIST hImageList = ImageList_Create(nIconsSizeXY, nIconsSizeXY, ILC_MASK | ILC_COLORDDB, 0, 0);
ListView_SetImageList(hFavListView, hImageList, LVSIL_SMALL);
for(int nIndex = 0; nIndex < nFavDrvCount; nIndex++)
{
TCHAR szIcon[MAX_PATH];
_stprintf(szIcon, _T("%s%s.ico"), szAppIconsPath, Favorites[nIndex].szDrvName);
if((HICON)LoadImage(hAppInst, szIcon, IMAGE_ICON, nIconsSizeXY, nIconsSizeXY, LR_LOADFROMFILE)){
ImageList_AddIcon(hImageList, (HICON)LoadImage(hAppInst, szIcon, IMAGE_ICON, nIconsSizeXY, nIconsSizeXY, LR_LOADFROMFILE));
}
if(!(HICON)LoadImage(hAppInst, szIcon, IMAGE_ICON, nIconsSizeXY, nIconsSizeXY, LR_LOADFROMFILE))
{
unsigned int nTemp = nBurnDrvSelect;
nBurnDrvSelect = Favorites[nIndex].nDrvNumber;
if(BurnDrvGetText(DRV_PARENT)){
_stprintf(szIcon, _T("%s%s.ico"), szAppIconsPath, BurnDrvGetText(DRV_PARENT));
ImageList_AddIcon(hImageList, (HICON)LoadImage(hAppInst, szIcon, IMAGE_ICON, nIconsSizeXY, nIconsSizeXY, LR_LOADFROMFILE));
}
nBurnDrvSelect = nTemp;
}
if(!(HICON)LoadImage(hAppInst, szIcon, IMAGE_ICON, nIconsSizeXY, nIconsSizeXY, LR_LOADFROMFILE)) {
ImageList_AddIcon(hImageList, LoadIcon(hAppInst, MAKEINTRESOURCE(IDI_STAR)) );
}
}
}
示例7: StatedAuto
// The automatic save
int StatedAuto(int bSave)
{
static TCHAR szName[32] = _T("");
int nRet;
_stprintf(szName, _T("config/games/%s.fs"), BurnDrvGetText(DRV_NAME));
if (bSave == 0) {
nRet = BurnStateLoad(szName, bDrvSaveAll, NULL); // Load ram
if (nRet && bDrvSaveAll) {
nRet = BurnStateLoad(szName, 0, NULL); // Couldn't get all - okay just try the nvram
}
} else {
nRet = BurnStateSave(szName, bDrvSaveAll); // Save ram
}
return nRet;
}
示例8: DrvInit
int DrvInit(int nDrvNum, bool bRestore)
{
DrvExit(); // Make sure exitted
// AudSoundInit(); // Init Sound (not critical if it fails)
nBurnSoundRate = 0; // Assume no sound
pBurnSoundOut = NULL;
// if (bAudOkay) {
// nBurnSoundRate = nAudSampleRate;
// nBurnSoundLen = nAudSegLen;
// }
nBurnDrvSelect[0] = nDrvNum; // Set the driver number
// Define nMaxPlayers early; GameInpInit() needs it (normally defined in DoLibInit()).
nMaxPlayers = BurnDrvGetMaxPlayers();
// GameInpInit(); // Init game input
// ConfigGameLoad(true);
// InputMake(true);
// GameInpDefault();
SndInit();
if (DoLibInit()) { // Init the Burn library's driver
char szTemp[512];
BurnDrvExit(); // Exit the driver
_stprintf (szTemp, _T("There was an error starting '%s'.\n"), BurnDrvGetText(DRV_FULLNAME));
return 1;
}
BurnExtLoadRom = DrvLoadRom;
bDrvOkay = 1; // Okay to use all BurnDrv functions
bSaveRAM = false;
nBurnLayer = 0xFF; // show all layers
// Reset the speed throttling code, so we don't 'jump' after the load
RunReset();
return 0;
}
示例9: AddToFavorites
// Add a game to Favorites
void AddToFavorites()
{
int nIndex = ListView_GetItemCount(hFavListView); // index of the new favorite listview item
TCHAR* ItemRomname = BurnDrvGetText(DRV_NAME); // Romset Name
#if defined (_UNICODE)
TCHAR* ItemTitle = BurnDrvGetText(DRV_FULLNAME); // Unicode Game Title
#else
TCHAR* ItemTitle = BurnDrvGetText(DRV_ASCIIONLY | DRV_FULLNAME); // ASCII Game Title
#endif
TCHAR* ItemHardware = BurnDrvGetText(DRV_SYSTEM); // Game Hardware / System
TCHAR* ItemYear = BurnDrvGetText(DRV_DATE); // Year
TCHAR* ItemCompany = BurnDrvGetText(DRV_MANUFACTURER); // Manufacturer / Company
TCHAR szItemMaxPlayers[5];
_stprintf(szItemMaxPlayers, _T("%i"), BurnDrvGetMaxPlayers()); // Max Players
TCHAR* ItemMaxPlayers = szItemMaxPlayers;
TCHAR szPlayCounter[5];
_stprintf(szPlayCounter, _T("%i"), 0); // Play Counter (Zero because there isn't another counter in FBA)
TCHAR* ItemPlayCounter = szPlayCounter;
LVITEM LvItem;
memset(&LvItem, 0, sizeof(LvItem));
LvItem.mask = LVIF_TEXT;
LvItem.cchTextMax = 256;
LvItem.iItem = nIndex;
// Add Romname, Title and Hardware of the selected game to the Favorites List
for (int nColumn = 0; nColumn < LV_MAX_COLS; nColumn++) {
LvItem.iSubItem = nColumn;
switch (nColumn) {
case 1: LvItem.pszText = ItemTitle; break;
case 2: LvItem.pszText = ItemHardware; break;
case 3: LvItem.pszText = ItemYear; break;
case 4: LvItem.pszText = ItemCompany; break;
case 5: LvItem.pszText = ItemMaxPlayers; break;
case 6: LvItem.pszText = ItemPlayCounter; break;
}
if(nColumn == 0) {
LvItem.pszText = ItemRomname;
SendMessage(hFavListView, LVM_INSERTITEM,0,(LPARAM)&LvItem);
SendMessage(hFavListView, LVM_SETITEM, 0, (LPARAM)&LvItem);
} else {
SendMessage(hFavListView, LVM_SETITEM, 0, (LPARAM)&LvItem);
}
}
SaveFavListAlt(); // Save the Favorite Games List
RefreshFavGameList(); // Refresh Favorite Games List
}
示例10: StatedAuto
// The automatic save
int StatedAuto(int bSave)
{
static TCHAR szName[512] = "";
int nRet;
sprintf(szName, "%s/states/%s.fs", getDataPath(), BurnDrvGetText(DRV_NAME));
if (bSave == 0)
{
nRet = BurnStateLoad(szName, bDrvSaveAll, NULL); // Load ram
if (nRet && bDrvSaveAll)
{
nRet = BurnStateLoad(szName, 0, NULL); // Couldn't get all - okay just try the nvram
}
}
else
{
nRet = BurnStateSave(szName, bDrvSaveAll); // Save ram
}
return nRet;
}
示例11: StatedSave
int StatedSave(int nSlot)
{
TCHAR szFilter[1024];
int nRet;
int bOldPause;
if (bDrvOkay == 0) {
return 1;
}
if (nSlot) {
CreateStateName(nSlot);
} else {
_stprintf(szChoice, _T("%s"), BurnDrvGetText(DRV_NAME));
MakeOfn(szFilter);
ofn.lpstrTitle = FBALoadStringEx(hAppInst, IDS_STATE_SAVE, true);
ofn.Flags |= OFN_OVERWRITEPROMPT;
bOldPause = bRunPause;
bRunPause = 1;
nRet = GetSaveFileName(&ofn);
bRunPause = bOldPause;
if (nRet == 0) { // Error
return 1;
}
}
nRet = BurnStateSave(szChoice, 1);
if (nRet && !nSlot) {
FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_DISK_CREATE));
FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_DISK_STATE));
FBAPopupDisplay(PUF_TYPE_ERROR);
}
return nRet;
}
示例12: ProgressProc
static INT_PTR CALLBACK ProgressProc(HWND hDlg, UINT Msg, WPARAM /*wParam*/, LPARAM /*lParam*/)
{
if (Msg == WM_INITDIALOG) {
TCHAR szText[128] = _T("");
hProgressDlg = hDlg;
SendDlgItemMessage(hDlg, IDC_WAIT_PROG, PBM_SETRANGE32, nProgressMin, nProgressMax);
_stprintf(szText, FBALoadStringEx(hAppInst, IDS_PROGRESS_LOADING, true), BurnDrvGetText(DRV_NAME));
SendDlgItemMessage(hDlg, IDC_WAIT_LABEL_B1, WM_SETTEXT, 0, (LPARAM)szText);
ShowWindow(GetDlgItem(hDlg, IDC_WAIT_LABEL_B1), TRUE);
ShowWindow(GetDlgItem(hDlg, IDC_WAIT_LABEL_B2), TRUE);
WndInMid(hDlg, hScrnWnd);
SetForegroundWindow(hDlg);
SetWindowPos(hDlg, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
return TRUE;
}
return 0;
}
示例13: BurnDrvInit
// Init game emulation (loading any needed roms)
extern "C" INT32 BurnDrvInit()
{
INT32 nReturnValue;
if (nBurnDrvActive >= nBurnDrvCount) {
return 1;
}
#if defined (FBA_DEBUG)
{
TCHAR szText[1024] = _T("");
TCHAR* pszPosition = szText;
TCHAR* pszName = BurnDrvGetText(DRV_FULLNAME);
INT32 nName = 1;
while ((pszName = BurnDrvGetText(DRV_NEXTNAME | DRV_FULLNAME)) != NULL) {
nName++;
}
// Print the title
bprintf(PRINT_IMPORTANT, _T("*** Starting emulation of %s - %s.\n"), BurnDrvGetText(DRV_NAME), BurnDrvGetText(DRV_FULLNAME));
// Then print the alternative titles
if (nName > 1) {
bprintf(PRINT_IMPORTANT, _T(" Alternative %s "), (nName > 2) ? _T("titles are") : _T("title is"));
pszName = BurnDrvGetText(DRV_FULLNAME);
nName = 1;
while ((pszName = BurnDrvGetText(DRV_NEXTNAME | DRV_FULLNAME)) != NULL) {
if (pszPosition + _tcslen(pszName) - 1022 > szText) {
break;
}
if (nName > 1) {
bprintf(PRINT_IMPORTANT, _T(SEPERATOR_1));
}
bprintf(PRINT_IMPORTANT, _T("%s"), pszName);
nName++;
}
bprintf(PRINT_IMPORTANT, _T(".\n"));
}
}
#endif
BurnSetRefreshRate(60.0);
CheatInit();
HiscoreInit();
BurnStateInit();
BurnInitMemoryManager();
nReturnValue = pDriver[nBurnDrvActive]->Init(); // Forward to drivers function
nMaxPlayers = pDriver[nBurnDrvActive]->Players;
#if defined (FBA_DEBUG)
if (!nReturnValue) {
starttime = clock();
nFramesEmulated = 0;
nFramesRendered = 0;
nCurrentFrame = 0;
} else {
starttime = 0;
}
#endif
return nReturnValue;
}
示例14: ConfigGameSave
// Write out the config file for the game-specific inputs
int ConfigGameSave(bool bSave)
{
FILE* h;
if (!bSave) {
GameInpBlank(0);
ConfigGameLoad(false);
}
h = _tfopen(GameConfigName(), _T("wt"));
if (h == NULL) {
return 1;
}
// Write title
_ftprintf(h, _T("// ") _T(APP_TITLE) _T(" v%s --- Config File for %s (%s)\n\n"), szAppBurnVer, BurnDrvGetText(DRV_NAME), BurnDrvGetText(DRV_FULLNAME));
_ftprintf(h, _T("// --- Miscellaneous ----------------------------------------------------------\n\n"));
// Write version number
_ftprintf(h, _T("version 0x%06X\n\n"), nBurnVer);
// Write speed for relative analog controls
_ftprintf(h, _T("analog 0x%04X\n"), nAnalogSpeed);
// Write CPU speed adjustment
_ftprintf(h, _T("cpu 0x%04X\n"), nBurnCPUSpeedAdjust);
_ftprintf(h, _T("\n\n\n"));
_ftprintf(h, _T("// --- Inputs -----------------------------------------------------------------\n\n"));
GameInpWrite(h);
fclose(h);
return 0;
}