diff --git a/.github/workflows/windows-release.yml b/.github/workflows/windows-release.yml index a585a696..c5d232f6 100644 --- a/.github/workflows/windows-release.yml +++ b/.github/workflows/windows-release.yml @@ -32,7 +32,7 @@ jobs: - name: Build pfbneo run: | mkdir cmake-build-pfbneo && cd cmake-build-pfbneo - cmake -G "MSYS Makefiles" -DPLATFORM_WINDOWS=ON -DOPTION_EMU=pfbneo -DCMAKE_BUILD_TYPE=Debug .. + cmake -G "MSYS Makefiles" -DPLATFORM_WINDOWS=ON -DOPTION_EMU=pfbneo -DCMAKE_BUILD_TYPE=Release .. make pfbneo.deps make pfbneo_windows_release mv *.zip $GITHUB_WORKSPACE @@ -40,21 +40,21 @@ jobs: - name: Build pgen run: | mkdir cmake-build-pgen && cd cmake-build-pgen - cmake -G "MSYS Makefiles" -DPLATFORM_WINDOWS=ON -DOPTION_EMU=pgen -DCMAKE_BUILD_TYPE=Debug .. + cmake -G "MSYS Makefiles" -DPLATFORM_WINDOWS=ON -DOPTION_EMU=pgen -DCMAKE_BUILD_TYPE=Release .. make pgen_windows_release mv *.zip $GITHUB_WORKSPACE - name: Build pnes run: | mkdir cmake-build-pnes && cd cmake-build-pnes - cmake -G "MSYS Makefiles" -DPLATFORM_WINDOWS=ON -DOPTION_EMU=pnes -DCMAKE_BUILD_TYPE=Debug .. + cmake -G "MSYS Makefiles" -DPLATFORM_WINDOWS=ON -DOPTION_EMU=pnes -DCMAKE_BUILD_TYPE=Release .. make pnes_windows_release mv *.zip $GITHUB_WORKSPACE - name: Build psnes run: | mkdir cmake-build-psnes && cd cmake-build-psnes - cmake -G "MSYS Makefiles" -DPLATFORM_WINDOWS=ON -DOPTION_EMU=psnes -DCMAKE_BUILD_TYPE=Debug .. + cmake -G "MSYS Makefiles" -DPLATFORM_WINDOWS=ON -DOPTION_EMU=psnes -DCMAKE_BUILD_TYPE=Release .. make psnes_windows_release mv *.zip $GITHUB_WORKSPACE diff --git a/.gitignore b/.gitignore index 5eea5461..a3958ed2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ cmake-build* -build* .idea ss_dev_id.key ss_dev_pwd.key diff --git a/CMakeLists.txt b/CMakeLists.txt index e7d0ec85..3a42f968 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,7 +30,7 @@ add_subdirectory(sscrap) project(pemu) set(PROJECT_AUTHOR cpasjuste) set(VERSION_MAJOR 6) -set(VERSION_MINOR 0) +set(VERSION_MINOR 1) # pemu (ui) add_subdirectory(ui) diff --git a/android/app/.gitignore b/android/app/.gitignore index 42afabfd..67e07b8f 100644 --- a/android/app/.gitignore +++ b/android/app/.gitignore @@ -1 +1,2 @@ -/build \ No newline at end of file +/build +/release diff --git a/android/app/build.gradle b/android/app/build.gradle new file mode 100644 index 00000000..52525434 --- /dev/null +++ b/android/app/build.gradle @@ -0,0 +1,53 @@ +plugins { + id 'com.android.application' +} + +android { + compileSdk 32 + + defaultConfig { + applicationId "fr.mydedibox.pemu" + minSdk 26 + targetSdk 32 + versionCode 1 + versionName "1.0" + + ndk { + abiFilters 'arm64-v8a' + } + + externalNativeBuild { + cmake { + cppFlags '-std=c++17' + arguments "-DPLATFORM_ANDROID=ON", "-DANDROID_ASSETS_PATH=${sourceSets.main.assets.srcDirs[0]}", "-DOPTION_EMU=psnes" + } + } + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + externalNativeBuild { + cmake { + path file('../../CMakeLists.txt') + version '3.18.1' + } + } + buildFeatures { + viewBinding true + } +} + +dependencies { + + implementation 'androidx.appcompat:appcompat:1.4.1' + implementation 'com.google.android.material:material:1.5.0' + implementation 'androidx.constraintlayout:constraintlayout:2.1.3' +} \ No newline at end of file diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index f6ab9e8a..4689c57c 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,6 +1,6 @@ @@ -39,7 +39,7 @@ android:theme="@android:style/Theme.NoTitleBar.Fullscreen"> - Game + pEMU diff --git a/android/build.gradle b/android/build.gradle new file mode 100644 index 00000000..3858e872 --- /dev/null +++ b/android/build.gradle @@ -0,0 +1,9 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +plugins { + id 'com.android.application' version '7.1.3' apply false + id 'com.android.library' version '7.1.3' apply false +} + +task clean(type: Delete) { + delete rootProject.buildDir +} diff --git a/data/windows/datadir/libcrypto-1_1-x64.dll b/data/windows/datadir/libcrypto-1_1-x64.dll new file mode 100644 index 00000000..4e02398e Binary files /dev/null and b/data/windows/datadir/libcrypto-1_1-x64.dll differ diff --git a/libcross2d b/libcross2d index a0d226d4..8673f9a2 160000 --- a/libcross2d +++ b/libcross2d @@ -1 +1 @@ -Subproject commit a0d226d4cee83d57dbb04289553567bda58ed549 +Subproject commit 8673f9a2b64bf079f423ab3ecd8bba295d21b3e9 diff --git a/pfbneo/CMakeLists.txt b/pfbneo/CMakeLists.txt index fa57fc9f..9c056538 100644 --- a/pfbneo/CMakeLists.txt +++ b/pfbneo/CMakeLists.txt @@ -331,6 +331,8 @@ include(${CMAKE_SOURCE_DIR}/libcross2d/cmake/targets.cmake) # add common skin data add_custom_target(${PROJECT_NAME}.data.skin + COMMAND ${CMAKE_COMMAND} -D SRC=${CMAKE_CURRENT_SOURCE_DIR}/../data/common/datadir -D DST=${CMAKE_CURRENT_BINARY_DIR}/data_datadir -P ${CMAKE_CURRENT_LIST_DIR}/../libcross2d/cmake/copy_directory_custom.cmake + COMMAND ${CMAKE_COMMAND} -D SRC=${CMAKE_CURRENT_SOURCE_DIR}/../data/${TARGET_PLATFORM}/datadir -D DST=${CMAKE_CURRENT_BINARY_DIR}/data_datadir -P ${CMAKE_CURRENT_LIST_DIR}/../libcross2d/cmake/copy_directory_custom.cmake COMMAND ${CMAKE_COMMAND} -D SRC=${CMAKE_CURRENT_SOURCE_DIR}/../data/common/romfs -D DST=${CMAKE_CURRENT_BINARY_DIR}/data_romfs -P ${CMAKE_CURRENT_LIST_DIR}/../libcross2d/cmake/copy_directory_custom.cmake COMMAND ${CMAKE_COMMAND} -D SRC=${CMAKE_CURRENT_SOURCE_DIR}/../data/${TARGET_PLATFORM}/romfs -D DST=${CMAKE_CURRENT_BINARY_DIR}/data_romfs -P ${CMAKE_CURRENT_LIST_DIR}/../libcross2d/cmake/copy_directory_custom.cmake ) diff --git a/pgen/CMakeLists.txt b/pgen/CMakeLists.txt index a1034108..eb13aaf3 100644 --- a/pgen/CMakeLists.txt +++ b/pgen/CMakeLists.txt @@ -88,6 +88,8 @@ include(${CMAKE_SOURCE_DIR}/libcross2d/cmake/targets.cmake) # add common skin data add_custom_target(${PROJECT_NAME}.data.skin + COMMAND ${CMAKE_COMMAND} -D SRC=${CMAKE_CURRENT_SOURCE_DIR}/../data/common/datadir -D DST=${CMAKE_CURRENT_BINARY_DIR}/data_datadir -P ${CMAKE_CURRENT_LIST_DIR}/../libcross2d/cmake/copy_directory_custom.cmake + COMMAND ${CMAKE_COMMAND} -D SRC=${CMAKE_CURRENT_SOURCE_DIR}/../data/${TARGET_PLATFORM}/datadir -D DST=${CMAKE_CURRENT_BINARY_DIR}/data_datadir -P ${CMAKE_CURRENT_LIST_DIR}/../libcross2d/cmake/copy_directory_custom.cmake COMMAND ${CMAKE_COMMAND} -D SRC=${CMAKE_CURRENT_SOURCE_DIR}/../data/common/romfs -D DST=${CMAKE_CURRENT_BINARY_DIR}/data_romfs -P ${CMAKE_CURRENT_LIST_DIR}/../libcross2d/cmake/copy_directory_custom.cmake COMMAND ${CMAKE_COMMAND} -D SRC=${CMAKE_CURRENT_SOURCE_DIR}/../data/${TARGET_PLATFORM}/romfs -D DST=${CMAKE_CURRENT_BINARY_DIR}/data_romfs -P ${CMAKE_CURRENT_LIST_DIR}/../libcross2d/cmake/copy_directory_custom.cmake ) diff --git a/pgen/data/common/title.xcf b/pgen/data/common/title.xcf index ddd02a4b..ab64545e 100644 Binary files a/pgen/data/common/title.xcf and b/pgen/data/common/title.xcf differ diff --git a/pgen/data/ps4/romfs/sce_sys/icon0.png b/pgen/data/ps4/romfs/sce_sys/icon0.png index bf2dc37b..c3332893 100644 Binary files a/pgen/data/ps4/romfs/sce_sys/icon0.png and b/pgen/data/ps4/romfs/sce_sys/icon0.png differ diff --git a/pgen/data/switch/icon.jpg b/pgen/data/switch/icon.jpg index cf1bd54d..ed8e1416 100644 Binary files a/pgen/data/switch/icon.jpg and b/pgen/data/switch/icon.jpg differ diff --git a/pgen/data/vita/romfs/sce_sys/icon0.png b/pgen/data/vita/romfs/sce_sys/icon0.png index ad001f09..ee53ac3a 100644 Binary files a/pgen/data/vita/romfs/sce_sys/icon0.png and b/pgen/data/vita/romfs/sce_sys/icon0.png differ diff --git a/pgen/data/vita/romfs/sce_sys/livearea/contents/bg.png b/pgen/data/vita/romfs/sce_sys/livearea/contents/bg.png index b5233a18..44d8808a 100644 Binary files a/pgen/data/vita/romfs/sce_sys/livearea/contents/bg.png and b/pgen/data/vita/romfs/sce_sys/livearea/contents/bg.png differ diff --git a/pgen/data/vita/romfs/sce_sys/livearea/contents/startup.png b/pgen/data/vita/romfs/sce_sys/livearea/contents/startup.png index 969b09a9..7b7a2694 100644 Binary files a/pgen/data/vita/romfs/sce_sys/livearea/contents/startup.png and b/pgen/data/vita/romfs/sce_sys/livearea/contents/startup.png differ diff --git a/pgen/sources/main.cpp b/pgen/sources/main.cpp index 6e5b9235..b33bb726 100644 --- a/pgen/sources/main.cpp +++ b/pgen/sources/main.cpp @@ -63,10 +63,13 @@ int main(int argc, char **argv) { // create paths io->create(io->getDataPath()); io->create(io->getDataPath() + "bios"); - io->create(io->getDataPath() + "roms"); io->create(io->getDataPath() + "rams"); io->create(io->getDataPath() + "configs"); io->create(io->getDataPath() + "saves"); + io->create(io->getDataPath() + "megadrive"); + io->create(io->getDataPath() + "sms"); + io->create(io->getDataPath() + "gamegear"); + io->create(io->getDataPath() + "megacd"); Vector2f screenSize = cfg->getScreenSize(); ui = new UiMain(screenSize, io, cfg); diff --git a/pnes/CMakeLists.txt b/pnes/CMakeLists.txt index 6d3f50bb..1e4491c0 100644 --- a/pnes/CMakeLists.txt +++ b/pnes/CMakeLists.txt @@ -105,6 +105,8 @@ include(${CMAKE_SOURCE_DIR}/libcross2d/cmake/targets.cmake) # add common skin data add_custom_target(${PROJECT_NAME}.data.skin + COMMAND ${CMAKE_COMMAND} -D SRC=${CMAKE_CURRENT_SOURCE_DIR}/../data/common/datadir -D DST=${CMAKE_CURRENT_BINARY_DIR}/data_datadir -P ${CMAKE_CURRENT_LIST_DIR}/../libcross2d/cmake/copy_directory_custom.cmake + COMMAND ${CMAKE_COMMAND} -D SRC=${CMAKE_CURRENT_SOURCE_DIR}/../data/${TARGET_PLATFORM}/datadir -D DST=${CMAKE_CURRENT_BINARY_DIR}/data_datadir -P ${CMAKE_CURRENT_LIST_DIR}/../libcross2d/cmake/copy_directory_custom.cmake COMMAND ${CMAKE_COMMAND} -D SRC=${CMAKE_CURRENT_SOURCE_DIR}/../data/common/romfs -D DST=${CMAKE_CURRENT_BINARY_DIR}/data_romfs -P ${CMAKE_CURRENT_LIST_DIR}/../libcross2d/cmake/copy_directory_custom.cmake COMMAND ${CMAKE_COMMAND} -D SRC=${CMAKE_CURRENT_SOURCE_DIR}/../data/${TARGET_PLATFORM}/romfs -D DST=${CMAKE_CURRENT_BINARY_DIR}/data_romfs -P ${CMAKE_CURRENT_LIST_DIR}/../libcross2d/cmake/copy_directory_custom.cmake ) @@ -123,24 +125,3 @@ add_custom_target(${PROJECT_NAME}.data.extra ) add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}.data.extra) -#[[ -if (PLATFORM_WINDOWS) - # TODO: fix curl/nghttp2 static linking... - add_custom_target(${PROJECT_NAME}.data.extra.win64 - DEPENDS ${PROJECT_NAME}.data.extra - COMMAND ${CMAKE_COMMAND} -E copy "/msys64/mingw64/bin/libwinpthread-1.dll" ${CMAKE_CURRENT_BINARY_DIR}/ - COMMAND ${CMAKE_COMMAND} -E copy "/msys64/mingw64/bin/libnghttp2-14.dll" ${CMAKE_CURRENT_BINARY_DIR}/ - COMMAND ${CMAKE_COMMAND} -E copy "/msys64/mingw64/bin/libunistring-2.dll" ${CMAKE_CURRENT_BINARY_DIR}/ - COMMAND ${CMAKE_COMMAND} -E copy "/msys64/mingw64/bin/libstdc++-6.dll" ${CMAKE_CURRENT_BINARY_DIR}/ - COMMAND ${CMAKE_COMMAND} -E copy "/msys64/mingw64/bin/libiconv-2.dll" ${CMAKE_CURRENT_BINARY_DIR}/ - COMMAND ${CMAKE_COMMAND} -E copy "/msys64/mingw64/bin/libgcc_s_seh-1.dll" ${CMAKE_CURRENT_BINARY_DIR}/ - COMMAND ${CMAKE_COMMAND} -E copy "/msys64/mingw64/bin/libwinpthread-1.dll" ${CMAKE_CURRENT_BINARY_DIR}/data_read_write/ - COMMAND ${CMAKE_COMMAND} -E copy "/msys64/mingw64/bin/libnghttp2-14.dll" ${CMAKE_CURRENT_BINARY_DIR}/data_read_write/ - COMMAND ${CMAKE_COMMAND} -E copy "/msys64/mingw64/bin/libunistring-2.dll" ${CMAKE_CURRENT_BINARY_DIR}/data_read_write/ - COMMAND ${CMAKE_COMMAND} -E copy "/msys64/mingw64/bin/libstdc++-6.dll" ${CMAKE_CURRENT_BINARY_DIR}/data_read_write/ - COMMAND ${CMAKE_COMMAND} -E copy "/msys64/mingw64/bin/libiconv-2.dll" ${CMAKE_CURRENT_BINARY_DIR}/data_read_write/ - COMMAND ${CMAKE_COMMAND} -E copy "/msys64/mingw64/bin/libgcc_s_seh-1.dll" ${CMAKE_CURRENT_BINARY_DIR}/data_read_write/ - ) - add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}.data.extra.win64) -endif () -]] diff --git a/psnes/CMakeLists.txt b/psnes/CMakeLists.txt index b0626200..5e9f7cdb 100644 --- a/psnes/CMakeLists.txt +++ b/psnes/CMakeLists.txt @@ -128,12 +128,14 @@ include(${CMAKE_SOURCE_DIR}/libcross2d/cmake/targets.cmake) # add common skin data add_custom_target(${PROJECT_NAME}.data.skin -COMMAND ${CMAKE_COMMAND} -D SRC=${CMAKE_CURRENT_SOURCE_DIR}/../data/common/romfs -D DST=${CMAKE_CURRENT_BINARY_DIR}/data_romfs -P ${CMAKE_CURRENT_LIST_DIR}/../libcross2d/cmake/copy_directory_custom.cmake -COMMAND ${CMAKE_COMMAND} -D SRC=${CMAKE_CURRENT_SOURCE_DIR}/../data/${TARGET_PLATFORM}/romfs -D DST=${CMAKE_CURRENT_BINARY_DIR}/data_romfs -P ${CMAKE_CURRENT_LIST_DIR}/../libcross2d/cmake/copy_directory_custom.cmake -) + COMMAND ${CMAKE_COMMAND} -D SRC=${CMAKE_CURRENT_SOURCE_DIR}/../data/common/datadir -D DST=${CMAKE_CURRENT_BINARY_DIR}/data_datadir -P ${CMAKE_CURRENT_LIST_DIR}/../libcross2d/cmake/copy_directory_custom.cmake + COMMAND ${CMAKE_COMMAND} -D SRC=${CMAKE_CURRENT_SOURCE_DIR}/../data/${TARGET_PLATFORM}/datadir -D DST=${CMAKE_CURRENT_BINARY_DIR}/data_datadir -P ${CMAKE_CURRENT_LIST_DIR}/../libcross2d/cmake/copy_directory_custom.cmake + COMMAND ${CMAKE_COMMAND} -D SRC=${CMAKE_CURRENT_SOURCE_DIR}/../data/common/romfs -D DST=${CMAKE_CURRENT_BINARY_DIR}/data_romfs -P ${CMAKE_CURRENT_LIST_DIR}/../libcross2d/cmake/copy_directory_custom.cmake + COMMAND ${CMAKE_COMMAND} -D SRC=${CMAKE_CURRENT_SOURCE_DIR}/../data/${TARGET_PLATFORM}/romfs -D DST=${CMAKE_CURRENT_BINARY_DIR}/data_romfs -P ${CMAKE_CURRENT_LIST_DIR}/../libcross2d/cmake/copy_directory_custom.cmake + ) add_dependencies(${PROJECT_NAME}.data.skin ${PROJECT_NAME}.data) if (PLATFORM_LINUX) -add_dependencies(${PROJECT_NAME}-romfs ${PROJECT_NAME}.data.skin) + add_dependencies(${PROJECT_NAME}-romfs ${PROJECT_NAME}.data.skin) else () -add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}.data.skin) + add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}.data.skin) endif () diff --git a/psnes/sources/uiEmu.cpp b/psnes/sources/uiEmu.cpp index ea3175f0..60415e77 100644 --- a/psnes/sources/uiEmu.cpp +++ b/psnes/sources/uiEmu.cpp @@ -143,13 +143,15 @@ int PSNESUiEmu::load(const ss_api::Game &game) { } printf("Settings.SkipFrames: %i\n", Settings.SkipFrames); Settings.TurboMode = ui->getConfig()->get(Option::ROM_PSNES_TURBO_MODE, true)->getIndex(); - Settings.TurboSkipFrames = ui->getConfig()->get(Option::ROM_PSNES_TURBO_FRAMESKIP, true)->getIndex(); + Settings.TurboSkipFrames = ui->getConfig()->get(Option::ROM_PSNES_TURBO_FRAMESKIP, + true)->getIndex(); Settings.CartAName[0] = 0; Settings.CartBName[0] = 0; // big boost when SupportHiRes disabled - Settings.SupportHiRes = (bool8) ui->getConfig()->get(Option::ROM_PSNES_HIGH_RES, true)->getIndex(); + Settings.SupportHiRes = (bool8) ui->getConfig()->get(Option::ROM_PSNES_HIGH_RES, + true)->getIndex(); printf("Settings.SupportHiRes: %i\n", Settings.SupportHiRes); CPU.Flags = 0; @@ -233,19 +235,22 @@ int PSNESUiEmu::load(const ss_api::Game &game) { auto v = new PSNESVideo(getUi(), &gfx_video_buffer, nullptr, Vector2i(SNES_WIDTH * 2, SNES_HEIGHT_EXTENDED * 2)); addVideo(v); - memset(gfx_video_buffer, 0, (size_t) getVideo()->getTexture()->m_pitch * getVideo()->getTextureRect().height); + memset(gfx_video_buffer, 0, + (size_t) getVideo()->getTexture()->m_pitch * getVideo()->getTextureRect().height); } else { GFX.Pitch = SNES_WIDTH * 2; snes9x_game_size = {SNES_WIDTH, SNES_HEIGHT_EXTENDED}; auto v = new PSNESVideo(getUi(), (uint8_t **) &GFX.Screen, (int *) &GFX.Pitch, Vector2i(SNES_WIDTH, SNES_HEIGHT_EXTENDED)); addVideo(v); - memset(GFX.Screen, 0, (size_t) getVideo()->getTexture()->m_pitch * getVideo()->getTextureRect().height); + memset(GFX.Screen, 0, + (size_t) getVideo()->getTexture()->m_pitch * getVideo()->getTextureRect().height); } S9xGraphicsInit(); - int samples = Audio::toSamples((int) Settings.SoundPlaybackRate, (float) Memory.ROMFramesPerSecond); + int samples = Audio::toSamples((int) Settings.SoundPlaybackRate, + (float) Memory.ROMFramesPerSecond); addAudio((int) Settings.SoundPlaybackRate, samples); audio_buffer = malloc(getAudio()->getSamplesSize() * 2); @@ -383,7 +388,8 @@ bool8 S9xDeinitUpdate(int width, int height) { #ifdef __SOFT_SCALERS__ if (effect == VIDEOMODE_BLOCKY || effect == VIDEOMODE_TV || effect == VIDEOMODE_SMOOTH) { #endif - if ((width <= SNES_WIDTH) && ((snes9x_prev_width != width) || (snes9x_prev_height != height))) { + if ((width <= SNES_WIDTH) && + ((snes9x_prev_width != width) || (snes9x_prev_height != height))) { printf("S9xBlitClearDelta\n"); S9xBlitClearDelta(); } @@ -439,7 +445,8 @@ bool8 S9xDeinitUpdate(int width, int height) { blit = S9xBlitPixSimple1x1; } - blit((uint8 *) GFX.Screen, GFX.Pitch, gfx_video_buffer, video->getTexture()->m_pitch, width, height); + blit((uint8 *) GFX.Screen, GFX.Pitch, gfx_video_buffer, video->getTexture()->m_pitch, width, + height); if (height < snes9x_prev_height) { int p = video->getTexture()->m_pitch >> 2;