From b001ba7eacf1588f93a5df486d7637ce43f8d3f0 Mon Sep 17 00:00:00 2001 From: rsn8887 Date: Wed, 10 Jan 2018 19:45:44 -0600 Subject: [PATCH 1/8] PFBA: display preview images correctly (thanks SoftechSoftware) --- pfba/gui/gui.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pfba/gui/gui.cpp b/pfba/gui/gui.cpp index 433f18e..8315cba 100644 --- a/pfba/gui/gui.cpp +++ b/pfba/gui/gui.cpp @@ -827,13 +827,13 @@ int Gui::TitleLoad(RomList::Rom *rom) { char path[MAX_PATH]; sprintf(path, "%s/%s.png", szAppPreviewPath, rom->zip); if (io->Exist(path)) { - title = new Texture(renderer, path); + title = (Texture *) new C2DTexture(renderer, path); return title != NULL; } else if (rom->parent) { memset(path, 0, MAX_PATH); sprintf(path, "%s/%s.png", szAppPreviewPath, rom->parent); if (io->Exist(path)) { - title = new Texture(renderer, path); + title = (Texture *) new C2DTexture(renderer, path); return title != NULL; } } From d012608e04bda9e03b79d6d64f8d4c3fdf62c6cf Mon Sep 17 00:00:00 2001 From: rsn8887 Date: Wed, 10 Jan 2018 19:57:18 -0600 Subject: [PATCH 2/8] PSP2: link SceHid_stub as required for latest SDL2 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d45561f..d76f190 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -345,7 +345,7 @@ if (BUILD_PSP2) cross2d SDL2 SceDisplay_stub SceGxm_stub SceSysmodule_stub SceCtrl_stub ScePgf_stub ScePower_stub SceCommonDialog_stub - SceAudio_stub SceTouch_stub + SceAudio_stub SceTouch_stub SceHid_stub freetype png jpeg z m c) elseif (BUILD_PS3) ############## From 3a3cdec9e30dc9c625dad36068e2a6506e7e4b8b Mon Sep 17 00:00:00 2001 From: "Davide Calabro' - www.SoftechSoftware.it" Date: Thu, 11 Jan 2018 22:41:22 +0100 Subject: [PATCH 3/8] Fix for the PC-Engine, TurboGrafx 16, SuperGrafx emulator. Games now load and work correctly. --- pfba/input.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/pfba/input.cpp b/pfba/input.cpp index 965356e..90f6ba0 100644 --- a/pfba/input.cpp +++ b/pfba/input.cpp @@ -6,6 +6,9 @@ unsigned char inputP1P2Switch; #define MAX_INPUT_inp (17) +/// www.SoftechSoftware.it +#define MAX_GAME_INPUT (6) + struct GameInput { //unsigned char *pVal; // Destination for the Input Value union { @@ -24,7 +27,8 @@ struct DIPInfo { struct GameInput *DIPData; } DIPInfo; // Mapping of PC inputs to game inputs -struct GameInput GameInput[4][MAX_INPUT_inp]; +/// www.SoftechSoftware.it +struct GameInput GameInput[MAX_GAME_INPUT/*4*/][MAX_INPUT_inp]; unsigned int nGameInpCount = 0; static bool bInputOk = false; unsigned char *ServiceDip = 0; @@ -63,7 +67,11 @@ int DoInputBlank(int /*bDipSwitch*/) { } if ((bii.szInfo[0] == 'p') || (bii.szInfo[0] == 'm')) + { if (bii.szInfo[0] == 'm') iJoyNum = 0; else iJoyNum = bii.szInfo[1] - '1'; + /// www.SoftechSoftware.it + ///if (iJoyNum > 3) iJoyNum = 3; // Sperimental fix + } else { if (strcmp(bii.szInfo, "diag") == 0 || strcmp(bii.szInfo, "test") == 0) { ServiceDip = bii.pVal; @@ -253,7 +261,8 @@ int InpInit() { } } - memset(GameInput, 0, MAX_INPUT_inp * 4 * sizeof(struct GameInput)); + /// www.SoftechSoftware.it + memset(GameInput, 0, MAX_INPUT_inp * MAX_GAME_INPUT/*4*/ * sizeof(struct GameInput)); DoInputBlank(1); bInputOk = true; From f29a805dede3976ee6e8f756364d0fececfc3b03 Mon Sep 17 00:00:00 2001 From: "Davide Calabro' - www.SoftechSoftware.it" Date: Sat, 13 Jan 2018 17:08:52 +0100 Subject: [PATCH 4/8] no message --- pfba/deps/libcross2d | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pfba/deps/libcross2d b/pfba/deps/libcross2d index e966ba0..0dc75d6 160000 --- a/pfba/deps/libcross2d +++ b/pfba/deps/libcross2d @@ -1 +1 @@ -Subproject commit e966ba0d2580284d1d62a05eb55f62af2b95d815 +Subproject commit 0dc75d630a460b827459ba8bf6a9629ff10c1026 From eae015a59f34620c80385a8db1535fe291e8a8d5 Mon Sep 17 00:00:00 2001 From: "Davide Calabro' - www.SoftechSoftware.it" Date: Sat, 13 Jan 2018 17:30:04 +0100 Subject: [PATCH 5/8] no message --- pfba/gui/gui.h | 2 +- pfba/input.cpp | 16 ---------------- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/pfba/gui/gui.h b/pfba/gui/gui.h index 9993ca8..b448d16 100644 --- a/pfba/gui/gui.h +++ b/pfba/gui/gui.h @@ -17,7 +17,7 @@ class Option; #define INPUT_DELAY 150 -#define STANDARD_LAYOUT +//#define STANDARD_LAYOUT class Gui { diff --git a/pfba/input.cpp b/pfba/input.cpp index f8e5a5e..90f6ba0 100644 --- a/pfba/input.cpp +++ b/pfba/input.cpp @@ -6,10 +6,7 @@ unsigned char inputP1P2Switch; #define MAX_INPUT_inp (17) -<<<<<<< HEAD /// www.SoftechSoftware.it -======= ->>>>>>> 4a6bb8f3ad3ed65809dd5b66925413038876d94b #define MAX_GAME_INPUT (6) struct GameInput { @@ -30,10 +27,7 @@ struct DIPInfo { struct GameInput *DIPData; } DIPInfo; // Mapping of PC inputs to game inputs -<<<<<<< HEAD /// www.SoftechSoftware.it -======= ->>>>>>> 4a6bb8f3ad3ed65809dd5b66925413038876d94b struct GameInput GameInput[MAX_GAME_INPUT/*4*/][MAX_INPUT_inp]; unsigned int nGameInpCount = 0; static bool bInputOk = false; @@ -72,19 +66,12 @@ int DoInputBlank(int /*bDipSwitch*/) { DIPInfo.DIPData[i - DIPInfo.nFirstDIP].nBit = 0; } -<<<<<<< HEAD if ((bii.szInfo[0] == 'p') || (bii.szInfo[0] == 'm')) { if (bii.szInfo[0] == 'm') iJoyNum = 0; else iJoyNum = bii.szInfo[1] - '1'; /// www.SoftechSoftware.it ///if (iJoyNum > 3) iJoyNum = 3; // Sperimental fix } -======= - if ((bii.szInfo[0] == 'p') || (bii.szInfo[0] == 'm')) { - if (bii.szInfo[0] == 'm') iJoyNum = 0; else iJoyNum = bii.szInfo[1] - '1'; - ///if (iJoyNum > 3) iJoyNum = 3; // Sperimental fix - } ->>>>>>> 4a6bb8f3ad3ed65809dd5b66925413038876d94b else { if (strcmp(bii.szInfo, "diag") == 0 || strcmp(bii.szInfo, "test") == 0) { ServiceDip = bii.pVal; @@ -274,10 +261,7 @@ int InpInit() { } } -<<<<<<< HEAD /// www.SoftechSoftware.it -======= ->>>>>>> 4a6bb8f3ad3ed65809dd5b66925413038876d94b memset(GameInput, 0, MAX_INPUT_inp * MAX_GAME_INPUT/*4*/ * sizeof(struct GameInput)); DoInputBlank(1); From e179ab57b68e9f8b6c56fee8c2d9788a3ee7c96d Mon Sep 17 00:00:00 2001 From: "Davide Calabro' - www.SoftechSoftware.it" Date: Sat, 20 Jan 2018 22:25:27 +0100 Subject: [PATCH 6/8] Fix to avoid crashes when exiting from MSX emulator. --- src/burn/drv/msx/d_msx.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/burn/drv/msx/d_msx.cpp b/src/burn/drv/msx/d_msx.cpp index 256015c..ebe4847 100644 --- a/src/burn/drv/msx/d_msx.cpp +++ b/src/burn/drv/msx/d_msx.cpp @@ -1342,9 +1342,9 @@ static INT32 MemIndex() RamEnd = Next; - pAY8910Buffer[0] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[1] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); - pAY8910Buffer[2] = (INT16*)Next; Next += nBurnSoundLen * sizeof(INT16); + pAY8910Buffer[0] = (INT16*)Next; Next += (nBurnSoundLen+256) * sizeof(INT16); + pAY8910Buffer[1] = (INT16*)Next; Next += (nBurnSoundLen+256) * sizeof(INT16); + pAY8910Buffer[2] = (INT16*)Next; Next += (nBurnSoundLen+256) * sizeof(INT16); MemEnd = Next; From aa4d10cfee68083122d8d673643fb15273d10b7a Mon Sep 17 00:00:00 2001 From: "Davide Calabro' - www.SoftechSoftware.it" Date: Tue, 23 Jan 2018 21:18:06 +0100 Subject: [PATCH 7/8] Splash screen with some animation while searching for available ROMs. --- pfba/gui/romlist.cpp | 54 ++++++++++++++++++++++++++++++++++++++++++-- pfba/gui/romlist.h | 6 ++++- pfba/main.cpp | 6 ++--- 3 files changed, 60 insertions(+), 6 deletions(-) diff --git a/pfba/gui/romlist.cpp b/pfba/gui/romlist.cpp index fe04d64..4a0f249 100644 --- a/pfba/gui/romlist.cpp +++ b/pfba/gui/romlist.cpp @@ -10,25 +10,41 @@ #include "burner.h" #include "romlist.h" -RomList::RomList(Io *io, std::vector *hwList, const std::vector &paths) { +RomList::RomList(Io *io, std::vector *hwList, const std::vector &paths, Renderer *rdr, Skin *skin) { hardwareList = hwList; printf("RomList: building list...\n"); clock_t begin = clock(); + char szText[512]; + Rect rcText; + + memset(szText, 0, sizeof(szText)); + + rcText.x = 20; + rcText.w = rdr->width - 20 - 10; + rcText.y = rdr->height - 10 - skin->font->size; + rcText.h = skin->font->size; + std::vector files[DIRS_MAX]; for (unsigned int i = 0; i < paths.size(); i++) { if (!paths[i].empty()) { files[i] = io->GetDirList(paths[i].c_str()); printf("RomList: found %i files in `%s`\n", (int) files[i].size(), paths[i].c_str()); + + sprintf(szText, "Found %i files in %s", (int) files[i].size(), paths[i].c_str()); + rdr->Clear(); + DrawSplashScreen(rdr, skin); + skin->font->Draw(rcText, C2D_COL_WHITE, szText); + rdr->Flip(); } } char path[MAX_PATH]; char pathUppercase[MAX_PATH]; // sometimes on FAT32 short files appear as all uppercase // TODO: fix sorting speed so we don't skip first 24 roms - for (UINT32 i = 24; i < nBurnDrvCount; i++) { + for (UINT32 i = 0/*24*/; i < nBurnDrvCount; i++) { nBurnDrvActive = i; @@ -98,6 +114,17 @@ RomList::RomList(Io *io, std::vector *hwList, const std::vectorat(0).supported_count % 250 == 0) + { + sprintf(szText, "Roms: %i/%i | Clones: %i/%i", + hardwareList->at(0).available_count, hardwareList->at(0).supported_count, + hardwareList->at(0).available_clone_count, hardwareList->at(0).clone_count); + rdr->Clear(); + DrawSplashScreen(rdr, skin); + skin->font->Draw(rcText, C2D_COL_WHITE, szText); + rdr->Flip(); + } // if } /* @@ -113,6 +140,15 @@ RomList::RomList(Io *io, std::vector *hwList, const std::vectorat(0).available_count, hardwareList->at(0).supported_count, + hardwareList->at(0).available_clone_count, hardwareList->at(0).clone_count); + rdr->Clear(); + DrawSplashScreen(rdr, skin); + skin->font->Draw(rcText, C2D_COL_WHITE, szText); + rdr->Flip(); + rdr->Delay(2000); + clock_t end = clock(); double time_spent = (double) (end - begin) / CLOCKS_PER_SEC; printf("RomList: list built in %f\n", time_spent); @@ -121,3 +157,17 @@ RomList::RomList(Io *io, std::vector *hwList, const std::vectorwidth, rdr->height}; + + rdr->DrawRect(rcScreen, C2D_COL_GRAY); + rdr->DrawRect(rcScreen, C2D_COL_ORANGE, false); + if (skin->tex_title->available) + { + rcScreen.h -= 32; + skin->tex_title->Draw(rcScreen, true); + } // if +} // End of DrawSplashScreen + diff --git a/pfba/gui/romlist.h b/pfba/gui/romlist.h index 50e5592..078f3d9 100644 --- a/pfba/gui/romlist.h +++ b/pfba/gui/romlist.h @@ -10,6 +10,8 @@ #include "burner.h" #define HARDWARE_PREFIX_ALL 0xffffffff +#include "skin.h" + class RomList { public: @@ -32,9 +34,11 @@ class RomList { }; RomList(Io *io, std::vector *hwList, - const std::vector &paths); + const std::vector &paths, Renderer *rdr, Skin *skin); ~RomList(); + void DrawSplashScreen(Renderer *rdr, Skin *skin); + enum RomState { NOT_WORKING = 0, MISSING, diff --git a/pfba/main.cpp b/pfba/main.cpp index 9a9bb77..edb77c6 100644 --- a/pfba/main.cpp +++ b/pfba/main.cpp @@ -115,13 +115,13 @@ int main(int argc, char **argv) { cfgPath += "pfba.cfg"; config = new Config(cfgPath, renderer); - // build/init roms list - romList = new RomList(io, &config->hardwareList, config->GetRomPaths()); - // skin int size = config->GetGuiValue(Option::Index::SKIN_FONT_SIZE); Skin *skin = new Skin(renderer, szAppSkinPath, size, buttons); + // build/init roms list + romList = new RomList(io, &config->hardwareList, config->GetRomPaths(), renderer, skin); + // run gui gui = new Gui(io, renderer, skin, romList, config, inp); #ifdef __PSP2__ // prevent rom list scrolling lag on psp2 From 2f0080dec1b962a174de66257b98a95c5a4a3baa Mon Sep 17 00:00:00 2001 From: "Davide Calabro' - www.SoftechSoftware.it" Date: Sat, 6 Oct 2018 21:10:20 +0200 Subject: [PATCH 8/8] no message --- pfba/input.cpp | 19 +++++++++++++++++++ pfba/run.cpp | 15 +++++++++++++++ src/burn/drv/snes/d_snes.cpp | 10 ++++++---- 3 files changed, 40 insertions(+), 4 deletions(-) diff --git a/pfba/input.cpp b/pfba/input.cpp index 90f6ba0..1075b47 100644 --- a/pfba/input.cpp +++ b/pfba/input.cpp @@ -35,6 +35,17 @@ unsigned char *ServiceDip = 0; unsigned char *P1Start = 0; unsigned char *P2Start = 0; +void WriteToLog2(char *lpszText) +{ + FILE *stream = fopen("ux0:/ROMs/a.txt", "at"); + + if(stream != NULL) + { + fprintf(stream, lpszText); + fclose(stream); + } // if +} // End of WriteToLog + int DoInputBlank(int /*bDipSwitch*/) { int iJoyNum = 0; unsigned int i = 0; @@ -54,6 +65,7 @@ int DoInputBlank(int /*bDipSwitch*/) { //if (bDipSwitch==0 && bii.nType==2) continue; // Don't blank the dip switches if (bii.nType == BIT_DIPSWITCH) { +WriteToLog2("BIT_DIPSWITCH\r\n"); if (DIPInfo.nDIP == 0) { DIPInfo.nFirstDIP = i; DIPInfo.nDIP = nGameInpCount - i; @@ -356,6 +368,7 @@ void InpDIP() { struct GameInput *pgi; int i, j; int nDIPOffset = 0; +WriteToLog2("Step 1.0\r\n"); // get dip switch offset for (i = 0; BurnDrvGetDIPInfo(&bdi, i) == 0; i++) @@ -363,15 +376,18 @@ void InpDIP() { nDIPOffset = bdi.nInput; break; } +WriteToLog2("Step 1.1\r\n"); // set DIP to default i = 0; bool bDifficultyFound = false; while (BurnDrvGetDIPInfo(&bdi, i) == 0) { +WriteToLog2("Step 1.2\r\n"); //printf("%2d. %02x '%s'\n", bdi.nInput, bdi.nFlags, bdi.szText); if (bdi.nFlags == 0xFF) { +WriteToLog2("Step 1.3\r\n"); pgi = DIPInfo.DIPData + (bdi.nInput + nDIPOffset - DIPInfo.nFirstDIP); pgi->nConst = (pgi->nConst & ~bdi.nMask) | (bdi.nSetting & bdi.nMask); } else if (bdi.nFlags == 0xFE) { @@ -384,6 +400,7 @@ void InpDIP() { } else { if (bDifficultyFound) { if (bdi.nFlags == 0x01) { +WriteToLog2("Step 1.4\r\n"); // use GameScreenMode store pgi = DIPInfo.DIPData + (bdi.nInput + nDIPOffset - DIPInfo.nFirstDIP); @@ -399,9 +416,11 @@ void InpDIP() { } i++; } +WriteToLog2("Step 1.5\r\n"); for (i = 0, pgi = DIPInfo.DIPData; i < (int) DIPInfo.nDIP; i++, pgi++) { if (pgi->pVal == NULL) continue; *(pgi->pVal) = pgi->nConst; } +WriteToLog2("Step 1.6\r\n"); } \ No newline at end of file diff --git a/pfba/run.cpp b/pfba/run.cpp index 74a64b0..d51d0b1 100644 --- a/pfba/run.cpp +++ b/pfba/run.cpp @@ -40,6 +40,17 @@ int InpMake(Input::Player *players); struct timeval start; +void WriteToLog(char *lpszText) +{ + FILE *stream = fopen("ux0:/ROMs/a.txt", "at"); + + if(stream != NULL) + { + fprintf(stream, lpszText); + fclose(stream); + } // if +} // End of WriteToLog + void StartTicks(void) { gettimeofday(&start, NULL); } @@ -302,9 +313,12 @@ void RunEmulator(Gui *g, int drvnum) { if (gui->GetConfig()->GetRomValue(Option::Index::ROM_AUDIO)) { nBurnSoundRate = 48000; } +WriteToLog("Step 1\r\n"); InpInit(); +WriteToLog("Step 2\r\n"); InpDIP(); +WriteToLog("Step 3\r\n"); printf("Initialize rom driver\n"); if (DrvInit(drvnum, false) != 0) { @@ -316,6 +330,7 @@ void RunEmulator(Gui *g, int drvnum) { InpExit(); return; } +WriteToLog("Step 4\r\n"); printf("bForce60Hz = %i, nBurnFPS = %d\n", bForce60Hz, nBurnFPS); diff --git a/src/burn/drv/snes/d_snes.cpp b/src/burn/drv/snes/d_snes.cpp index b3ef41b..54c5d39 100644 --- a/src/burn/drv/snes/d_snes.cpp +++ b/src/burn/drv/snes/d_snes.cpp @@ -1,6 +1,7 @@ #include "snes.h" unsigned char DoSnesReset = 0; +UINT8 DrvDips[1]; unsigned char SnesJoy1[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; static struct BurnInputInfo SnesInputList[] = @@ -18,6 +19,7 @@ static struct BurnInputInfo SnesInputList[] = {"P1 Button Z", BIT_DIGITAL, SnesJoy1 + 8, "p1 fire 6" }, {"P1 Mode", BIT_DIGITAL, SnesJoy1 + 11, "p1 select" }, {"Reset" , BIT_DIGITAL , &DoSnesReset , "reset" }, + {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip"}, }; STDINPUTINFO(Snes) @@ -38,7 +40,7 @@ static struct BurnRomInfo rSuperMarioWorldEuropeRev1RomDesc[] = { STD_ROM_PICK(rSuperMarioWorldEuropeRev1) STD_ROM_FN(rSuperMarioWorldEuropeRev1) -struct BurnDriverD BurnDrvrSMW = { +struct BurnDriver BurnDrvrSMW = { "smw", NULL, NULL, NULL, "1986", "Super Mario World (Europe) (Rev 1)\0", NULL, "Nintendo", "Miscellaneous", L"Super Mario World (Europe) (Rev 1)", NULL, NULL, NULL, @@ -56,7 +58,7 @@ static struct BurnRomInfo rSuperMarioWorldEuropeRomDesc[] = { STD_ROM_PICK(rSuperMarioWorldEurope) STD_ROM_FN(rSuperMarioWorldEurope) -struct BurnDriverD BurnDrvrSuperMarioWorldEurope = { +struct BurnDriver BurnDrvrSuperMarioWorldEurope = { "smwa", NULL, NULL, NULL, "1986", "Super Mario World (Europe)\0", NULL, "Nintendo", "Miscellaneous", L"Super Mario World (Europe)", NULL, NULL, NULL, @@ -74,7 +76,7 @@ static struct BurnRomInfo rSuperMarioWorldJapanRomDesc[] = { STD_ROM_PICK(rSuperMarioWorldJapan) STD_ROM_FN(rSuperMarioWorldJapan) -struct BurnDriverD BurnDrvrSuperMarioWorldJapan = { +struct BurnDriver BurnDrvrSuperMarioWorldJapan = { "smwj", NULL, NULL, NULL, "1986", "Super Mario World (Japan)\0", NULL, "Nintendo", "Miscellaneous", L"Super Mario World (Japan)", NULL, NULL, NULL, @@ -92,7 +94,7 @@ static struct BurnRomInfo rSuperMarioWorldUSARomDesc[] = { STD_ROM_PICK(rSuperMarioWorldUSA) STD_ROM_FN(rSuperMarioWorldUSA) -struct BurnDriverD BurnDrvrSuperMarioWorldUSA = { +struct BurnDriver BurnDrvrSuperMarioWorldUSA = { "smwu", NULL, NULL, NULL, "1986", "Super Mario World (USA)\0", NULL, "Nintendo", "Miscellaneous", L"Super Mario World (USA)", NULL, NULL, NULL,