Skip to content

Commit

Permalink
updated build methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Leonx254 committed Sep 13, 2023
1 parent 9497456 commit 6cb38d8
Show file tree
Hide file tree
Showing 38 changed files with 3,258 additions and 884 deletions.
36 changes: 17 additions & 19 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ name: Build RSDKv4
on:
push:
branches:
- master
- main
- win-actions
- linux-actions
- continuous-delivery

jobs:
v4-windows:
Expand All @@ -32,21 +30,21 @@ jobs:
Rename-Item ./dependencies/windows/glew-2.2.0 glew
- name: Download SDL2
run: |
Invoke-WebRequest -Uri "https://libsdl.org/release/SDL2-devel-2.0.14-VC.zip" -OutFile "SDL2.zip"
Invoke-WebRequest -Uri "https://libsdl.org/release/SDL2-devel-2.28.3-VC.zip" -OutFile "SDL2.zip"
Expand-Archive -Path SDL2.zip -DestinationPath ./dependencies/windows/
Rename-Item ./dependencies/windows/SDL2-2.0.14 SDL2
Rename-Item ./dependencies/windows/SDL2-2.28.3 SDL2
- name: Run vcpkg
run: |
vcpkg install libogg:x86-windows-static-md libvorbis:x86-windows-static-md
vcpkg integrate install
- name: Build RSDKv4
run: |
msbuild RSDKv4.sln /p:Configuration=Release /p:Platform=x86 /p:ForceImportBeforeCppTargets="$env:GITHUB_WORKSPACE/props/winactions.props"
msbuild RSDKv4.sln -target:RSDKv4-ogl /p:Configuration=Release /p:Platform=x86 /p:ForceImportBeforeCppTargets="$env:GITHUB_WORKSPACE/props/winactions.props"
- name: Move artifacts
run: |
mkdir artifacts
move ./build/Win32/Release/*.dll ./artifacts
move ./build/Win32/Release/*.exe ./artifacts
move ./build/Win32/Release/OGL/*.dll ./artifacts
move ./build/Win32/Release/OGL/*.exe ./artifacts
- name: Upload artifacts
uses: actions/[email protected]
with:
Expand Down Expand Up @@ -76,21 +74,21 @@ jobs:
Rename-Item ./dependencies/windows/glew-2.2.0 glew
- name: Download SDL2
run: |
Invoke-WebRequest -Uri "https://libsdl.org/release/SDL2-devel-2.0.14-VC.zip" -OutFile "SDL2.zip"
Invoke-WebRequest -Uri "https://libsdl.org/release/SDL2-devel-2.28.3-VC.zip" -OutFile "SDL2.zip"
Expand-Archive -Path SDL2.zip -DestinationPath ./dependencies/windows/
Rename-Item ./dependencies/windows/SDL2-2.0.14 SDL2
Rename-Item ./dependencies/windows/SDL2-2.28.3 SDL2
- name: Run vcpkg
run: |
vcpkg install libogg:x64-windows-static-md libvorbis:x64-windows-static-md
vcpkg integrate install
- name: Build RSDKv4
run: |
msbuild RSDKv4.sln /p:Configuration=Release /p:Platform=x64 /p:ForceImportBeforeCppTargets="$env:GITHUB_WORKSPACE/props/winactions_x64.props"
msbuild RSDKv4.sln -target:RSDKv4-ogl /p:Configuration=Release /p:Platform=x64 /p:ForceImportBeforeCppTargets="$env:GITHUB_WORKSPACE/props/winactions_x64.props"
- name: Move artifacts
run: |
mkdir artifacts
move ./build/x64/Release/*.dll ./artifacts
move ./build/x64/Release/*.exe ./artifacts
move ./build/x64/Release/OGL/*.dll ./artifacts
move ./build/x64/Release/OGL/*.exe ./artifacts
- name: Upload artifacts
uses: actions/[email protected]
with:
Expand Down Expand Up @@ -124,9 +122,9 @@ jobs:
Rename-Item ./dependencies/android/glew-2.2.0 glew
- name: Download SDL2
run: |
Invoke-WebRequest -Uri "https://libsdl.org/release/SDL2-2.0.16.zip" -OutFile "SDL2.zip"
Expand-Archive -Path SDL2.zip -DestinationPath ./dependencies/android/
Rename-Item ./dependencies/android/SDL2-2.0.16 SDL
Invoke-WebRequest -Uri "https://libsdl.org/release/SDL2-2.28.3.zip" -OutFile "SDL2.zip"
Expand-Archive -Path SDL2.zip -DestinationPath ./android/app/jni/
Rename-Item ./android/app/jni/SDL2-2.28.3 SDL
- name: Move & Copy stuff
run: |
Copy-Item -Path ./dependencies/android/app/jni/src/dependencies/android\* -Destination ./dependencies/
Expand All @@ -140,7 +138,7 @@ jobs:
- name: Build RSDKv4 Android
working-directory: ./android
run: |
./gradlew.bat Build --no-daemon -PABIFILTERS="armeabi-v7a;arm64-v8a"
./gradlew.bat assembleDebug --no-daemon -PABIFILTERS="armeabi-v7a;arm64-v8a" -PRETRO_DISABLE_PLUS
- name: Upload artifact Android
uses: actions/upload-artifact@v2
with:
Expand All @@ -156,10 +154,10 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install libogg-dev libvorbis-dev libsdl1.2-dev libsdl2-dev libglew-dev
sudo apt-get install libogg-dev libvorbis-dev libsdl2-dev libglew-dev libtheora-dev
ls ./dependencies/all
- name: Build RSDKv4
run: make
run: make RETRO_DISABLE_PLUS=1
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ cmake/
![Dd]ependencies/ios/dependencies.txt
![Dd]ependencies/mac/dependencies.txt
![Dd]ependencies/windows-uwp/dependencies.txt
![Dd]ependencies/android/dependencies.txt
![Dd]ependencies/android/README.md
![Dd]ependencies/android/libogg/include/ogg/config_types.h

# UWP
Expand Down
194 changes: 194 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
cmake_minimum_required(VERSION 3.7)

project(RetroEngine)

set(DECOMP_VERSION 1.3.1)

set(RETRO_REVISION 3 CACHE STRING "What revision to compile for. Defaults to Origins = 3")
option(RETRO_FORCE_CASE_INSENSITIVE "Forces case insensivity." OFF)
option(RETRO_MOD_LOADER "Enables or disables the mod loader." ON)
option(RETRO_NETWORKING "Enables or disables networking features used for Sonic 2's 2P VS mode." ON)
option(RETRO_USE_HW_RENDER "Enables usage of the Hardware Render, menus are unplayable without it." ON)
option(RETRO_DISABLE_PLUS "Disables Plus. Should be set on for any public releases." OFF)
option(RETRO_ORIGINAL_CODE "Removes any change that differs from the original code, a playable game can't be built this way." OFF)

set(RETRO_SDL_VERSION 2 CACHE STRING "Select between SDL2 and SDL1, defaults to SDL2")

if(RETRO_ORIGINAL_CODE)
set(RETRO_MOD_LOADER OFF)
set(RETRO_NETWORKING OFF)
endif()

set(RETRO_NAME "RSDKv4")

set(RETRO_OUTPUT_NAME ${RETRO_NAME} CACHE STRING "The exported name of the executable.")

set(RETRO_FILES
dependencies/all/tinyxml2/tinyxml2.cpp
RSDKv4/Animation.cpp
RSDKv4/Audio.cpp
RSDKv4/Collision.cpp
RSDKv4/Debug.cpp
RSDKv4/Drawing.cpp
RSDKv4/Ini.cpp
RSDKv4/Input.cpp
RSDKv4/fcaseopen.c
RSDKv4/main.cpp
RSDKv4/Math.cpp
RSDKv4/ModAPI.cpp
RSDKv4/Networking.cpp
RSDKv4/Object.cpp
RSDKv4/Palette.cpp
RSDKv4/Reader.cpp
RSDKv4/Renderer.cpp
RSDKv4/RetroEngine.cpp
RSDKv4/Scene.cpp
RSDKv4/Scene3D.cpp
RSDKv4/Script.cpp
RSDKv4/Sprite.cpp
RSDKv4/String.cpp
RSDKv4/Text.cpp
RSDKv4/Userdata.cpp
RSDKv4/NativeObjects/AboutScreen.cpp
RSDKv4/NativeObjects/AchievementDisplay.cpp
RSDKv4/NativeObjects/AchievementsButton.cpp
RSDKv4/NativeObjects/AchievementsMenu.cpp
RSDKv4/NativeObjects/BackButton.cpp
RSDKv4/NativeObjects/CWSplash.cpp
RSDKv4/NativeObjects/CreditText.cpp
RSDKv4/NativeObjects/DialogPanel.cpp
RSDKv4/NativeObjects/FadeScreen.cpp
RSDKv4/NativeObjects/InstructionsScreen.cpp
RSDKv4/NativeObjects/LeaderboardsButton.cpp
RSDKv4/NativeObjects/MenuBG.cpp
RSDKv4/NativeObjects/MenuControl.cpp
RSDKv4/NativeObjects/ModInfoButton.cpp
RSDKv4/NativeObjects/ModsButton.cpp
RSDKv4/NativeObjects/ModsMenu.cpp
RSDKv4/NativeObjects/MultiplayerButton.cpp
RSDKv4/NativeObjects/MultiplayerHandler.cpp
RSDKv4/NativeObjects/MultiplayerScreen.cpp
RSDKv4/NativeObjects/OptionsButton.cpp
RSDKv4/NativeObjects/OptionsMenu.cpp
RSDKv4/NativeObjects/PauseMenu.cpp
RSDKv4/NativeObjects/PlayerSelectScreen.cpp
RSDKv4/NativeObjects/PushButton.cpp
RSDKv4/NativeObjects/RecordsScreen.cpp
RSDKv4/NativeObjects/RetroGameLoop.cpp
RSDKv4/NativeObjects/SaveSelect.cpp
RSDKv4/NativeObjects/SegaIDButton.cpp
RSDKv4/NativeObjects/SegaSplash.cpp
RSDKv4/NativeObjects/SettingsScreen.cpp
RSDKv4/NativeObjects/StaffCredits.cpp
RSDKv4/NativeObjects/StartGameButton.cpp
RSDKv4/NativeObjects/SubMenuButton.cpp
RSDKv4/NativeObjects/TextLabel.cpp
RSDKv4/NativeObjects/TimeAttack.cpp
RSDKv4/NativeObjects/TimeAttackButton.cpp
RSDKv4/NativeObjects/TitleScreen.cpp
RSDKv4/NativeObjects/VirtualDPad.cpp
RSDKv4/NativeObjects/VirtualDPadM.cpp
RSDKv4/NativeObjects/ZoneButton.cpp
)

if(NOT PLATFORM)
if(WIN32) # THIS ASSUMES VCPKG OR SOURCES !!!!!!!
set(PLATFORM "Windows" CACHE STRING "The platform to compile for.")
elseif(ANDROID)
set(PLATFORM "Android" CACHE STRING "The platform to compile for.")
else()
set(PLATFORM ${CMAKE_SYSTEM_NAME} CACHE STRING "The platform to compile for.")
endif()
endif()

include(platforms/${PLATFORM}.cmake)

set_target_properties(RetroEngine PROPERTIES OUTPUT_NAME ${RETRO_OUTPUT_NAME})

if(COMPILE_OGG)
set(OGG_DIR dependencies/${DEP_PATH}/libogg)
add_library(
libogg
STATIC
${OGG_DIR}/src/bitwise.c
${OGG_DIR}/src/framing.c
)

target_compile_options(libogg PRIVATE ${OGG_FLAGS})

target_include_directories(libogg PRIVATE ${OGG_DIR}/include)
target_include_directories(RetroEngine PRIVATE ${OGG_DIR}/include)
target_link_libraries(RetroEngine libogg)
endif()

if(COMPILE_VORBIS)
set(VORBIS_DIR dependencies/${DEP_PATH}/libvorbis)
set(OGG_DIR dependencies/${DEP_PATH}/libogg)
add_library(libvorbis STATIC
${VORBIS_DIR}/lib/analysis.c
${VORBIS_DIR}/lib/barkmel.c
${VORBIS_DIR}/lib/bitrate.c
${VORBIS_DIR}/lib/block.c
${VORBIS_DIR}/lib/codebook.c
${VORBIS_DIR}/lib/envelope.c
${VORBIS_DIR}/lib/floor0.c
${VORBIS_DIR}/lib/floor1.c
${VORBIS_DIR}/lib/info.c
${VORBIS_DIR}/lib/lookup.c
${VORBIS_DIR}/lib/lpc.c
${VORBIS_DIR}/lib/lsp.c
${VORBIS_DIR}/lib/mapping0.c
${VORBIS_DIR}/lib/mdct.c
${VORBIS_DIR}/lib/psy.c
${VORBIS_DIR}/lib/registry.c
${VORBIS_DIR}/lib/res0.c
${VORBIS_DIR}/lib/sharedbook.c
${VORBIS_DIR}/lib/smallft.c
${VORBIS_DIR}/lib/synthesis.c
${VORBIS_DIR}/lib/tone.c
${VORBIS_DIR}/lib/vorbisenc.c
${VORBIS_DIR}/lib/vorbisfile.c
${VORBIS_DIR}/lib/window.c
)

target_compile_options(libvorbis PRIVATE ${VORBIS_FLAGS})

target_include_directories(libvorbis
PRIVATE
${VORBIS_DIR}/include
${VORBIS_DIR}/lib
${OGG_DIR}/include
)
target_include_directories(RetroEngine PRIVATE ${VORBIS_DIR}/include)
target_link_libraries(RetroEngine libvorbis libogg)
endif()

target_include_directories(RetroEngine PRIVATE
RSDKv4/
RSDKv4/NativeObjects/
dependencies/all/asio/asio/include/
dependencies/all/stb-image/
dependencies/all/tinyxml2/
)

if(DEFINED DEP_PATH)
target_include_directories(RetroEngine PRIVATE
dependencies/${DEP_PATH}/
)
endif()


target_compile_definitions(RetroEngine PRIVATE
RSDK_REVISION=${RETRO_REVISION}
RETRO_USE_MOD_LOADER=$<BOOL:${RETRO_MOD_LOADER}>
RETRO_USE_NETWORKING=$<BOOL:${RETRO_NETWORKING}>
RETRO_USING_OPENGL=$<BOOL:${RETRO_USE_HW_RENDER}>
RETRO_USE_SDL${RETRO_SDL_VERSION}=1
FORCE_CASE_INSENSITIVE=$<BOOL:${RETRO_FORCE_CASE_INSENSITIVE}>
RETRO_USE_ORIGINAL_CODE=$<BOOL:${RETRO_ORIGINAL_CODE}>

RSDK_AUTOBUILD=$<BOOL:${RETRO_DISABLE_PLUS}>

RETRO_DEV_EXTRA="${PLATFORM} - ${CMAKE_CXX_COMPILER_ID}"
DECOMP_VERSION="${DECOMP_VERSION}"
)
4 changes: 4 additions & 0 deletions FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
### Q: How do I set this up?
A: You can find a tutorial for setting up both the game and mods [here](https://gamebanana.com/tuts/14066). Alternatively, opening the decompilation without any game assets present will generate a TXT file containing a brief guide to setting them up.

### Q: Why is the DLC disabled in release builds and autobuilds?
A: Long story short, it's to minimize piracy and ensure an extra layer of legal protection for Sonic Origins Plus. Giving players paid content for free is not the goal of this project.

### Q: The screen is tearing, how do I fix it?
A: Try turning on VSync in settings.ini.

Expand Down Expand Up @@ -33,6 +36,7 @@ A: By default, the game mode is set to Classic Mode, which disables the Drop Das

### Q: How do I play as Amy?
A: Sonic Team implemented Amy in a way where she isn't playable on the decomp out of the box. This can be fixed via mods. **Do not ask about this in an issue, as we will not be able to help you.**
There are also checks implemented in the engine to prevent playing as Amy on release builds and autobuilds.

### Q: Why doesn't local 2P VS work in Sonic 2?
A: In the version of the Retro Engine that Origins uses (RSDKv5U), certain features that local multiplayer uses, such as splitscreen and multiple controller support, rely on tech found in RSDKv5. This is a decompilation of standalone RSDKv4, and recreating this tech is outside of the scope of the project.
Expand Down
10 changes: 7 additions & 3 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
# RSDKv3/v4 DECOMPILATION SOURCE CODE LICENSE v1
# RSDKv3/v4 DECOMPILATION SOURCE CODE LICENSE v2

The code in this repository is a decompilation of RSDK (Retro-Engine) version 3 or 4.
There is original code in this repo, but most of the code is to be functionally the same as the version of RSDK this repo specifies.


This code is provided as-is, that is to say, without liability or warranty.
Original authors of RSDK and authors of the decompilation are not held responsible for any damages or other claims said.

You may copy, modify, contribute, and distribute, for public or private use, **as long as the following are followed:**
- All pre-built executables provided TO ANYONE *PRIVATE OR OTHERWISE* **must be built with DLC disabled by __default.__**
- A define, `RSDK_AUTOBUILD`, and a CMake flag, `RETRO_DISABLE_PLUS`, are already provided for you to force DLC off.
- Creating a configuration setting *is allowed,* so long as it is set to off by default.
- *No such configuration will be pushed to the master repository.*
- This is to ensure an extra layer of legal protection for Sonic Origins Plus.
- You may not use the decompilation for commercial (any sort of profit) use.
- You must clearly specify that the decompilation and original code are not yours: the developers of both must be credited.
- You may not distribute assets used to run the game not directly provided by the repository (other than unique, modded assets).
- This license must be in all modified copies of source code, and all forks must follow this license.

Original RSDK author: Christian "Taxman" Whitehead

Decompilation authors: Rubberduckycooly and RMGRich
Decompilation authors: Rubberduckycooly and st×tic
Loading

0 comments on commit 6cb38d8

Please sign in to comment.