├── .clang-format ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.yml │ └── config.yml └── workflows │ └── build.yml ├── .gitignore ├── .gitmodules ├── Android.mk ├── FAQ.md ├── LICENSE.md ├── Makefile ├── Makefile.msys2 ├── README.md ├── RSDKv3 ios.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcshareddata │ └── xcschemes │ └── RSDKv3.xcscheme ├── RSDKv3.sln ├── RSDKv3.vita ├── CMakeLists.txt ├── build-internal.sh ├── build.sh └── sce_sys │ └── livearea │ └── contents │ └── template.xml ├── RSDKv3.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcshareddata │ └── xcschemes │ └── RSDKv3.xcscheme ├── RSDKv3 ├── Animation.cpp ├── Animation.hpp ├── Audio.cpp ├── Audio.hpp ├── Collision.cpp ├── Collision.hpp ├── Debug.cpp ├── Debug.hpp ├── Drawing.cpp ├── Drawing.hpp ├── Ini.cpp ├── Ini.hpp ├── Input.cpp ├── Input.hpp ├── Math.cpp ├── Math.hpp ├── ModAPI.cpp ├── ModAPI.hpp ├── Object.cpp ├── Object.hpp ├── Palette.cpp ├── Palette.hpp ├── Player.cpp ├── Player.hpp ├── RSDKv3 Decomp Icon.ico ├── RSDKv3.rc ├── RSDKv3.vcxproj ├── RSDKv3.vcxproj.filters ├── RSDKv3SDL1.vcxproj ├── RSDKv3SDL1.vcxproj.filters ├── Reader.cpp ├── Reader.hpp ├── RetroEngine.cpp ├── RetroEngine.hpp ├── Scene.cpp ├── Scene.hpp ├── Scene3D.cpp ├── Scene3D.hpp ├── Script.cpp ├── Script.hpp ├── Sprite.cpp ├── Sprite.hpp ├── String.cpp ├── String.hpp ├── Text.cpp ├── Text.hpp ├── Userdata.cpp ├── Userdata.hpp ├── Video.cpp ├── Video.hpp ├── fcaseopen.c ├── fcaseopen.h ├── main.cpp └── resource.h ├── RSDKv3SDL1.sln ├── RSDKv3UWP.sln ├── RSDKv3UWP ├── Package.appxmanifest ├── PropertySheet.props ├── RSDKv3UWP.vcxproj ├── RSDKv3UWP.vcxproj.filters ├── WinRTIncludes.hpp ├── main.cpp └── packages.config ├── android ├── app │ ├── build.gradle │ ├── jni │ │ ├── Android.mk │ │ ├── Application.mk │ │ ├── CMakeLists.txt │ │ ├── SDL │ │ └── src │ ├── proguard-rules.pro │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ ├── com │ │ │ └── decomp │ │ │ │ └── rsdkv3 │ │ │ │ └── RSDKv3.java │ │ └── org │ │ │ └── libsdl │ │ │ └── app │ │ │ ├── HIDDevice.java │ │ │ ├── HIDDeviceBLESteamController.java │ │ │ ├── HIDDeviceManager.java │ │ │ ├── HIDDeviceUSB.java │ │ │ ├── SDL.java │ │ │ ├── SDLActivity.java │ │ │ ├── SDLAudioManager.java │ │ │ └── SDLControllerManager.java │ │ └── res │ │ ├── mipmap-anydpi-v26 │ │ └── ic_launcher.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_background.png │ │ ├── ic_launcher_foreground.png │ │ └── ic_launcher_monochrome.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_background.png │ │ ├── ic_launcher_foreground.png │ │ └── ic_launcher_monochrome.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_background.png │ │ ├── ic_launcher_foreground.png │ │ └── ic_launcher_monochrome.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_background.png │ │ ├── ic_launcher_foreground.png │ │ └── ic_launcher_monochrome.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_background.png │ │ ├── ic_launcher_foreground.png │ │ └── ic_launcher_monochrome.png │ │ ├── values-v27 │ │ └── styles.xml │ │ └── values │ │ ├── colors.xml │ │ ├── ic_launcher_background.xml │ │ ├── strings.xml │ │ └── styles.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle ├── dependencies ├── all │ └── theoraplay │ │ ├── .hg_archival.txt │ │ ├── .hgignore │ │ ├── LICENSE.txt │ │ ├── test │ │ ├── maketest.sh │ │ ├── sdltheoraplay.c │ │ ├── simplesdl.c │ │ └── testtheoraplay.c │ │ ├── theoraplay.c │ │ ├── theoraplay.h │ │ └── theoraplay_cvtrgb.h ├── android │ ├── config_types.h │ └── dependencies.txt ├── ios │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── Contents.json │ ├── Base.lproj │ │ └── LaunchScreen.storyboard │ ├── Default.png │ ├── Info.plist │ └── dependencies.txt ├── mac │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── RSDKv3 Decomp Icon-1024.png │ │ │ ├── RSDKv3 Decomp Icon-128.png │ │ │ ├── RSDKv3 Decomp Icon-16.png │ │ │ ├── RSDKv3 Decomp Icon-256.png │ │ │ ├── RSDKv3 Decomp Icon-257.png │ │ │ ├── RSDKv3 Decomp Icon-32.png │ │ │ ├── RSDKv3 Decomp Icon-33.png │ │ │ ├── RSDKv3 Decomp Icon-512.png │ │ │ ├── RSDKv3 Decomp Icon-513.png │ │ │ └── RSDKv3 Decomp Icon-64.png │ │ └── Contents.json │ ├── Info.plist │ ├── RSDKv3.entitlements │ ├── cocoaHelpers.hpp │ ├── cocoaHelpers.mm │ ├── dependencies.txt │ └── icons │ │ ├── RSDKv3 Decomp Icon-1024.png │ │ ├── RSDKv3 Decomp Icon-128.png │ │ ├── RSDKv3 Decomp Icon-16.png │ │ ├── RSDKv3 Decomp Icon-256.png │ │ ├── RSDKv3 Decomp Icon-32.png │ │ ├── RSDKv3 Decomp Icon-512.png │ │ └── RSDKv3 Decomp Icon-64.png ├── win-uwp │ └── dependencies.txt └── windows │ ├── ValveFileVDF │ └── vdf_parser.hpp │ └── dependencies.txt ├── flatpak ├── README.md ├── com.sega.SonicCD.appdata.xml ├── com.sega.SonicCD.desktop ├── com.sega.SonicCD.svg ├── com.sega.SonicCDAndroid.json ├── com.sega.SonicCDOrigins.json ├── com.sega.SonicCDSteam.json └── run.sh ├── header.png └── props ├── winactions.props └── winactions_x64.props /.clang-format: -------------------------------------------------------------------------------- 1 | IndentWidth: 4 2 | Language: Cpp 3 | AlignAfterOpenBracket: Align 4 | SortIncludes: false 5 | ColumnLimit: 150 6 | PointerAlignment: Right 7 | AccessModifierOffset: -4 8 | AllowShortFunctionsOnASingleLine: All 9 | AllowShortCaseLabelsOnASingleLine: true 10 | #AllowShortLambdasOnASingleLine: All 11 | AllowShortLoopsOnASingleLine: true 12 | BinPackArguments: true 13 | BinPackParameters: true 14 | SpaceAfterCStyleCast: false 15 | BreakBeforeBraces: Attach 16 | BreakBeforeTernaryOperators: true 17 | BreakBeforeBinaryOperators: NonAssignment 18 | Cpp11BracedListStyle: false 19 | IndentCaseLabels: true 20 | AlignTrailingComments: true 21 | AlignOperands: true 22 | AlignConsecutiveAssignments: true 23 | AlignConsecutiveDeclarations: false 24 | AlignConsecutiveMacros: true 25 | UseTab: Never 26 | BreakBeforeBraces: Custom 27 | BraceWrapping: 28 | AfterClass: true 29 | AfterControlStatement: false 30 | AfterEnum: false 31 | AfterFunction: true 32 | AfterNamespace: true 33 | AfterObjCDeclaration: false 34 | AfterStruct: false 35 | AfterUnion: false 36 | BeforeCatch: false 37 | BeforeElse: true 38 | IndentBraces: false 39 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.yml: -------------------------------------------------------------------------------- 1 | name: Bug Report 2 | description: Something isn't working 3 | labels: [bug] 4 | body: 5 | - type: markdown 6 | attributes: 7 | value: | 8 | Before opening an issue, please read the following: 9 | - Check the [FAQ](https://github.com/Rubberduckycooly/Sonic-CD-11-Decompilation/blob/master/FAQ.md) to see if your issue is addressed there. 10 | - Check **both open and closed** issues to see if your bug has already been reported. Duplicates will be closed. 11 | - Do not ask for help for making mods. 12 | - Do not report bugs for unofficial branches of the decompilation. 13 | - If your bug does not seem to be related to any mods you're using, test if it occurs without any mods enabled. 14 | - type: input 15 | validations: 16 | required: true 17 | attributes: 18 | label: Expected Behavior 19 | description: What behavior is supposed to occur? 20 | - type: input 21 | validations: 22 | required: true 23 | attributes: 24 | label: Actual Behavior 25 | description: What actually happens? 26 | - type: textarea 27 | validations: 28 | required: true 29 | attributes: 30 | label: Steps to Reproduce 31 | description: How can you reproduce the bug? Please give clear instructions. 32 | placeholder: | 33 | 1. Do this 34 | 2. Do that 35 | 3. This happens 36 | - type: textarea 37 | validations: 38 | required: false 39 | attributes: 40 | label: Screenshots 41 | description: Provide screenshots if applicable. 42 | - type: textarea 43 | validations: 44 | required: false 45 | attributes: 46 | label: Log File 47 | description: If EngineDebugMode is enabled in settings.ini, the decompilation will write to a log file named log.txt. You can provide it here if you believe it will be helpful. 48 | - type: input 49 | validations: 50 | required: true 51 | attributes: 52 | label: Decompilation Version 53 | description: The decompilation version. If you built it manually or are using an autobuild, please specify the commit if possible. 54 | - type: dropdown 55 | id: gameversion 56 | validations: 57 | required: true 58 | attributes: 59 | label: "Game Version" 60 | description: What version of Sonic CD is being played? 61 | multiple: false 62 | options: 63 | - Blit Release (Steam/XBOX 360/PS3) 64 | - Mobile (Sega Forever) 65 | - Mobile (Pre-Sega Forever) 66 | - Sonic Origins 67 | - type: input 68 | validations: 69 | required: false 70 | attributes: 71 | label: Game Revision 72 | description: If you know the specific version number of the game, provide it here. 73 | - type: dropdown 74 | id: scriptplatform 75 | validations: 76 | required: true 77 | attributes: 78 | label: "Script Platform Type" 79 | description: What is the Platform setting in settings.ini set to? 80 | multiple: false 81 | options: 82 | - Standard 83 | - Mobile 84 | - type: dropdown 85 | id: renderer 86 | validations: 87 | required: true 88 | attributes: 89 | label: "Renderer Type" 90 | description: Are you using the Software Renderer or the Hardware Renderer? (If unsure, check the HardwareRenderer setting in settings.ini.) 91 | multiple: false 92 | options: 93 | - Software Renderer 94 | - Hardware Renderer 95 | - type: input 96 | validations: 97 | required: true 98 | attributes: 99 | label: Platform 100 | description: The platform/OS you're running the decompilation on. 101 | - type: textarea 102 | validations: 103 | required: false 104 | attributes: 105 | label: Additional Comments 106 | description: Provide any additional information if needed. 107 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: Retro Engine Modding Server 4 | url: https://dc.railgun.works/retroengine 5 | about: If you have any questions about the decompilation or want help with modding, ask here. 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # VitaSDK artifacts 5 | dependencies/vita 6 | *.self* 7 | *.vpk* 8 | *.velf 9 | 10 | # CMake artifacts 11 | CMakeFiles/ 12 | cmake_install.cmake 13 | CMakeCache.txt 14 | SonicCD.Vita/Makefile 15 | 16 | # User-specific files 17 | *.suo 18 | *.user 19 | *.userosscache 20 | *.sln.docstates 21 | 22 | # User-specific files (MonoDevelop/Xamarin Studio) 23 | *.userprefs 24 | 25 | # Build results 26 | [Dd]ebug/ 27 | [Dd]ebugPublic/ 28 | [Rr]elease/ 29 | [Rr]eleases/ 30 | [Bb]uild/ 31 | x64/ 32 | x86/ 33 | bld/ 34 | bin/ 35 | [Bb]in/ 36 | [Oo]bj/ 37 | 38 | #Safety 39 | *.rsdk 40 | *.ogv 41 | 42 | # Visual Studio Debugging 43 | RSDKv3/[Dd]ata/ 44 | RSDKv3/[Mm]ods/ 45 | RSDKv3/[Ss]cripts/ 46 | RSDKv3/[Vv]ideos/ 47 | RSDKv3/log.txt 48 | RSDKv3/usage.txt 49 | RSDKv3/[Ss]ettings.ini 50 | RSDKv3/[Ss][Dd]ata.bin 51 | RSDKv3/[Ss][Gg]ame.bin 52 | RSDKv3/[Uu][Dd]ata.bin 53 | 54 | #OSX files 55 | *.DS_Store 56 | .DS_Store 57 | *.xactivitylog 58 | *.xcuserstate 59 | *.dia 60 | *.xbuild 61 | *.db 62 | *.plist 63 | *.idx 64 | *.pcm 65 | *.timestamp 66 | *.xcbkptlist 67 | *.xcsettings 68 | 69 | #dependencies 70 | [Dd]ependencies/win-uwp/** 71 | [Dd]ependencies/windows/* 72 | [Dd]ependencies/android/* 73 | [Dd]ependencies/mac/libogg/ 74 | [Dd]ependencies/mac/libtheora/ 75 | [Dd]ependencies/mac/libvorbis/ 76 | [Dd]ependencies/mac/SDL2.framework/ 77 | ![Dd]ependencies/mac/[Ii]nfo.plist 78 | [Dd]ependencies/ios/Ogg.Framework/ 79 | [Dd]ependencies/ios/Theora.framework/ 80 | [Dd]ependencies/ios/Vorbis.framework/ 81 | [Dd]ependencies/ios/SDL2.framework/ 82 | [Dd]ependencies/ios/libSDLMain.a 83 | ![Dd]ependencies/ios/[Ii]nfo.plist 84 | [Dd]ependencies/all/* 85 | ![Dd]ependencies/all/tinyxml2 86 | ![Dd]ependencies/all/dependencies.txt 87 | ![Dd]ependencies/windows/dependencies.txt 88 | ![Dd]ependencies/ios/dependencies.txt 89 | ![Dd]ependencies/mac/dependencies.txt 90 | ![Dd]ependencies/windows-uwp/dependencies.txt 91 | ![Dd]ependencies/android/dependencies.txt 92 | ![Dd]ependencies/android/libogg/include/ogg/config_types.h 93 | 94 | RSDKv3UWP/Generated Files 95 | RSDKv3UWP/BundleArtifacts 96 | RSDKv3UWP/Assets/*.png 97 | 98 | # Visual Studio 2015 cache/options directory 99 | .vs/ 100 | 101 | # MSTest test Results 102 | [Tt]est[Rr]esult*/ 103 | [Bb]uild[Ll]og.* 104 | 105 | # NUNIT 106 | *.VisualState.xml 107 | TestResult.xml 108 | 109 | # Build Results of an ATL Project 110 | [Dd]ebugPS/ 111 | [Rr]eleasePS/ 112 | dlldata.c 113 | 114 | # DNX 115 | project.lock.json 116 | artifacts/ 117 | 118 | *_i.c 119 | *_p.c 120 | *_i.h 121 | *.ilk 122 | *.meta 123 | *.obj 124 | *.pch 125 | *.pdb 126 | *.pgc 127 | *.pgd 128 | *.rsp 129 | *.sbr 130 | *.tlb 131 | *.tli 132 | *.tlh 133 | *.tmp 134 | *.tmp_proj 135 | *.log 136 | *.vspscc 137 | *.vssscc 138 | .builds 139 | *.pidb 140 | *.svclog 141 | *.scc 142 | 143 | # Chutzpah Test files 144 | _Chutzpah* 145 | 146 | # Visual C++ cache files 147 | ipch/ 148 | *.aps 149 | *.ncb 150 | *.opensdf 151 | *.sdf 152 | *.cachefile 153 | 154 | # Visual Studio profiler 155 | *.psess 156 | *.vsp 157 | *.vspx 158 | 159 | # TFS 2012 Local Workspace 160 | $tf/ 161 | 162 | # Guidance Automation Toolkit 163 | *.gpState 164 | 165 | # ReSharper is a .NET coding add-in 166 | _ReSharper*/ 167 | *.[Rr]e[Ss]harper 168 | *.DotSettings.user 169 | 170 | # JustCode is a .NET coding add-in 171 | .JustCode 172 | 173 | # TeamCity is a build add-in 174 | _TeamCity* 175 | 176 | # DotCover is a Code Coverage Tool 177 | *.dotCover 178 | 179 | # NCrunch 180 | _NCrunch_* 181 | .*crunch*.local.xml 182 | 183 | # MightyMoose 184 | *.mm.* 185 | AutoTest.Net/ 186 | 187 | # Web workbench (sass) 188 | .sass-cache/ 189 | 190 | # Installshield output folder 191 | [Ee]xpress/ 192 | 193 | # DocProject is a documentation generator add-in 194 | DocProject/buildhelp/ 195 | DocProject/Help/*.HxT 196 | DocProject/Help/*.HxC 197 | DocProject/Help/*.hhc 198 | DocProject/Help/*.hhk 199 | DocProject/Help/*.hhp 200 | DocProject/Help/Html2 201 | DocProject/Help/html 202 | 203 | # Click-Once directory 204 | publish/ 205 | 206 | # Publish Web Output 207 | *.[Pp]ublish.xml 208 | *.azurePubxml 209 | ## TODO: Comment the next line if you want to checkin your 210 | ## web deploy settings but do note that will include unencrypted 211 | ## passwords 212 | #*.pubxml 213 | 214 | *.publishproj 215 | 216 | # NuGet Packages 217 | *.nupkg 218 | # The packages folder can be ignored because of Package Restore 219 | **/packages/* 220 | # except build/, which is used as an MSBuild target. 221 | !**/packages/build/ 222 | # Uncomment if necessary however generally it will be regenerated when needed 223 | #!**/packages/repositories.config 224 | 225 | # Windows Azure Build Output 226 | csx/ 227 | *.build.csdef 228 | 229 | # Windows Store app package directory 230 | AppPackages/ 231 | 232 | # Visual Studio cache files 233 | # files ending in .cache can be ignored 234 | *.[Cc]ache 235 | # but keep track of directories ending in .cache 236 | !*.[Cc]ache/ 237 | 238 | # Others 239 | ClientBin/ 240 | [Ss]tyle[Cc]op.* 241 | ~$* 242 | *~ 243 | *.dbmdl 244 | *.dbproj.schemaview 245 | *.pfx 246 | *.publishsettings 247 | node_modules/ 248 | orleans.codegen.cs 249 | 250 | # RIA/Silverlight projects 251 | Generated_Code/ 252 | 253 | # Backup & report files from converting an old project file 254 | # to a newer Visual Studio version. Backup files are not needed, 255 | # because we have git ;-) 256 | _UpgradeReport_Files/ 257 | Backup*/ 258 | UpgradeLog*.XML 259 | UpgradeLog*.htm 260 | 261 | # SQL Server files 262 | *.mdf 263 | *.ldf 264 | 265 | # Business Intelligence projects 266 | *.rdl.data 267 | *.bim.layout 268 | *.bim_*.settings 269 | 270 | # Microsoft Fakes 271 | FakesAssemblies/ 272 | 273 | # Node.js Tools for Visual Studio 274 | .ntvs_analysis.dat 275 | 276 | # Visual Studio 6 build log 277 | *.plg 278 | 279 | # Visual Studio 6 workspace options file 280 | *.opt 281 | 282 | # LightSwitch generated files 283 | GeneratedArtifacts/ 284 | _Pvt_Extensions/ 285 | ModelManifest.xml 286 | 287 | Ignored/ 288 | 289 | # Android specific 290 | .gradle/ 291 | .idea/ 292 | android/key/ 293 | android/local.properties 294 | *.apk 295 | 296 | # Linux 297 | .flatpak-builder 298 | flatpak/*.apk 299 | build-dir 300 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "dependencies/all/tinyxml2"] 2 | path = dependencies/all/tinyxml2 3 | url = https://github.com/leethomason/tinyxml2 4 | [submodule "flatpak/shared-modules"] 5 | path = flatpak/shared-modules 6 | url = https://github.com/flathub/shared-modules.git 7 | -------------------------------------------------------------------------------- /Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | OGG_DIR := dependencies/android/libogg 4 | VORBIS_DIR := dependencies/android/libvorbis 5 | THEORA_DIR := dependencies/android/libtheora 6 | 7 | OGG_INCLUDES := $(LOCAL_PATH)/$(OGG_DIR)/include 8 | VORBIS_INCLUDES := $(LOCAL_PATH)/$(VORBIS_DIR)/include \ 9 | $(LOCAL_PATH)/$(VORBIS_DIR)/lib 10 | THEORA_INCLUDES := $(LOCAL_PATH)/$(THEORA_DIR)/include \ 11 | $(LOCAL_PATH)/$(THEORA_DIR)/lib 12 | 13 | ###################################################################### 14 | # OGG 15 | include $(CLEAR_VARS) 16 | 17 | LOCAL_ARM_MODE := arm 18 | LOCAL_MODULE := libogg 19 | LOCAL_CFLAGS := -ffast-math -fsigned-char -O2 -fPIC -DPIC \ 20 | -DBYTE_ORDER=LITTLE_ENDIAN -D_ARM_ASSEM_ 21 | 22 | LOCAL_C_INCLUDES := $(OGG_INCLUDES) 23 | 24 | WILDCARD_SETUP := \ 25 | $(wildcard $(LOCAL_PATH)/$(OGG_DIR)/src/*.c) 26 | 27 | 28 | LOCAL_SRC_FILES := \ 29 | $(subst jni/src/, , $(WILDCARD_SETUP)) 30 | 31 | include $(BUILD_STATIC_LIBRARY) 32 | 33 | ###################################################################### 34 | # VORBIS 35 | include $(CLEAR_VARS) 36 | 37 | LOCAL_ARM_MODE := arm 38 | LOCAL_MODULE := libvorbis 39 | LOCAL_CFLAGS := -ffast-math -fsigned-char -O2 -fPIC -DPIC \ 40 | -DBYTE_ORDER=LITTLE_ENDIAN -D_ARM_ASSEM_ 41 | 42 | LOCAL_C_INCLUDES := $(OGG_INCLUDES) $(VORBIS_INCLUDES) 43 | 44 | WILDCARD_SETUP := \ 45 | $(wildcard $(LOCAL_PATH)/$(VORBIS_DIR)/lib/*.c) 46 | FILTERED := $(filter-out $(LOCAL_PATH)/$(VORBIS_DIR)/lib/psytune.c, $(WILDCARD_SETUP)) 47 | 48 | LOCAL_SRC_FILES := \ 49 | $(subst jni/src/, , $(FILTERED)) 50 | 51 | include $(BUILD_STATIC_LIBRARY) 52 | 53 | ###################################################################### 54 | # THEORA 55 | include $(CLEAR_VARS) 56 | 57 | LOCAL_ARM_MODE := arm 58 | LOCAL_MODULE := libtheora 59 | LOCAL_CFLAGS := -ffast-math -fsigned-char -O2 -fPIC -DPIC \ 60 | -DBYTE_ORDER=LITTLE_ENDIAN -D_ARM_ASSEM_ 61 | 62 | LOCAL_C_INCLUDES := $(OGG_INCLUDES) $(THEORA_INCLUDES) 63 | 64 | WILDCARD_SETUP := \ 65 | $(wildcard $(LOCAL_PATH)/$(THEORA_DIR)/lib/*.c) 66 | 67 | LOCAL_SRC_FILES := \ 68 | $(subst jni/src/, , $(WILDCARD_SETUP)) 69 | 70 | include $(BUILD_STATIC_LIBRARY) 71 | 72 | ###################################################################### 73 | 74 | include $(CLEAR_VARS) 75 | 76 | LOCAL_MODULE := main 77 | 78 | SDL_PATH := ../SDL 79 | 80 | LOCAL_CFLAGS := -fexceptions 81 | LOCAL_CPPFLAGS := -std=c++17 82 | APP_CPPFLAGS := -std=c++17 83 | 84 | LOCAL_C_INCLUDES := \ 85 | $(LOCAL_PATH)/$(SDL_PATH)/include \ 86 | $(LOCAL_PATH)/dependencies/all \ 87 | $(LOCAL_PATH)/$(VORBIS_DIR)/include \ 88 | $(LOCAL_PATH)/$(OGG_DIR)/include \ 89 | $(LOCAL_PATH)/$(THEORA_DIR)/include \ 90 | $(LOCAL_PATH)/dependencies/all/theoraplay \ 91 | $(LOCAL_PATH)/dependencies/all/tinyxml2 \ 92 | 93 | 94 | WILDCARD_SETUP := \ 95 | $(wildcard $(LOCAL_PATH)/dependencies/all/theoraplay/*.c) \ 96 | $(wildcard $(LOCAL_PATH)/dependencies/all/tinyxml2/*.cpp) \ 97 | $(wildcard $(LOCAL_PATH)/RSDKv3/*.cpp) 98 | 99 | LOCAL_SRC_FILES := $(subst jni/src/, , $(WILDCARD_SETUP)) 100 | 101 | LOCAL_LDLIBS := -lGLESv1_CM -llog 102 | 103 | LOCAL_SHARED_LIBRARIES := SDL2 libogg libvorbis libtheora 104 | 105 | include $(BUILD_SHARED_LIBRARY) 106 | -------------------------------------------------------------------------------- /FAQ.md: -------------------------------------------------------------------------------- 1 | # General 2 | ### Q: How do I set this up? 3 | A: You can find a tutorial for setting up both the game and mods [here](https://gamebanana.com/tuts/14111). Alternatively, opening the decompilation without any game assets present will generate a TXT file containing a brief guide to setting them up. 4 | 5 | ### Q: Why don't some buttons in the menu work? 6 | A: Buttons like Leaderboards & Achievements require code to be added to support online functionality & menus (though they are still saved in the Udata.bin file), and other buttons like the Controls button in the Blit versions or the Privacy button in the mobile version have no scripts and are instead hardcoded. I just didn't feel like going through the effort to decompile all that, since it's not really worth it. 7 | 8 | ### Q: The screen is tearing, how do I fix it? 9 | A: Try turning on VSync in settings.ini. 10 | 11 | ### Q: I found a bug! 12 | A: Submit an issue in the issues tab and we _might_ fix it in the master branch. Don't expect any major future releases, however. 13 | 14 | # Using Blit/Steam RSDK Files 15 | ### Q: Why is the titlecard text slightly offset when playing in widescreen? 16 | A: This is a known issue that is caused by the scripts from this version of the game. You can either use a mod that modifies `TitleCards/R[X]_TitleCard.txt` to fix it, or simply set the `screenWidth` option in settings.ini to 400 to match the intended value used in the original release. 17 | 18 | ### Q: Why is there a weird spot on the title screen when playing in widescreen? 19 | A: Similar to above, this is a script issue. You can fix it via a mod or by changing the screen width. 20 | 21 | # Using Mobile RSDK Files 22 | ### Q: Why does pressing B pause the game during gameplay? 23 | A: This is a known script issue with most Sega Forever versions of the game. Using the [decompiled scripts](https://github.com/Rubberduckycooly/Sonic-CD-2011-Script-Decompilation) should fix it. 24 | 25 | ### Q: Why are the SEGA and Christian Whitehead logos in the title screen so low resolution? 26 | A: This happens when using the Software Renderer, you can fix this by setting `HardwareRenderer` in settings.ini to true. 27 | 28 | ### Q: Why don't the video files from the mobile version of the game work? 29 | A: The decompilation only supports the OGV video files from the Blit/Steam versions of the game. 30 | 31 | # Using Origins RSDK Files 32 | ### Q: Why doesn't using the datafile work? 33 | A: The RSDK file from Sonic Origins is encrypted in the RSDKv5 datapack format, not the RSDKv3 format. Repacking the files in the correct format or using Data Folder Mode will fix the issue. 34 | 35 | ### Q: Why is there no audio? 36 | A: Sonic Origins doesn't have any music or sound effects contained in the game's data file, instead storing and handling all in-game audio itself through Hedgehog Engine 2. You can fix this by simply inserting the audio files from another version of the game. 37 | 38 | ### Q: Why is the Drop Dash disabled by default? How do I turn it on? 39 | A: By default, the game mode is set to Classic Mode, which disables the Drop Dash. The only way to change this is through a mod, either by changing the default value of the `game.playMode` global variable in `GameConfig.bin` or by setting the variable to another value via scripts. 40 | 41 | # Miscellaneous 42 | ### Q: Will you do a decompilation for Sonic 1/Sonic 2? 43 | A: I already have! You can find it [here](https://github.com/Rubberduckycooly/Sonic-1-2-2013-Decompilation). 44 | 45 | ### Q: Will you do a decompilation for Sonic Mania? 46 | A: I already have! You can find the source code for Sonic Mania [here](https://github.com/Rubberduckycooly/Sonic-Mania-Decompilation) and RSDKv5 which is used to run it [here](https://github.com/Rubberduckycooly/RSDKv5-Decompilation). 47 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | # RSDKv3/v4 DECOMPILATION SOURCE CODE LICENSE v1 2 | 3 | The code in this repository is a decompilation of RSDK (Retro-Engine) version 3 or 4. 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. 5 | 6 | This code is provided as-is, that is to say, without liability or warranty. 7 | Original authors of RSDK and authors of the decompilation are not held responsible for any damages or other claims said. 8 | 9 | You may copy, modify, contribute, and distribute, for public or private use, **as long as the following are followed:** 10 | - You may not use the decompilation for commercial (any sort of profit) use. 11 | - You must clearly specify that the decompilation and original code are not yours: the developers of both must be credited. 12 | - You may not distribute assets used to run the game not directly provided by the repository (other than unique, modded assets). 13 | - This license must be in all modified copies of source code, and all forks must follow this license. 14 | 15 | Original RSDK author: Christian "Taxman" Whitehead 16 | 17 | Decompilation authors: Rubberduckycooly and RMGRich 18 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | ifeq ($(STATIC),1) 2 | PKG_CONFIG_STATIC_FLAG = --static 3 | CXXFLAGS_ALL += -static 4 | endif 5 | 6 | CXXFLAGS_ALL += -MMD -MP -MF objects/$*.d $(shell pkg-config --cflags $(PKG_CONFIG_STATIC_FLAG) vorbisfile vorbis theoradec sdl2 glew) $(CXXFLAGS) \ 7 | -DBASE_PATH='"$(BASE_PATH)"' \ 8 | -Idependencies/all/filesystem/include \ 9 | -Idependencies/all/theoraplay \ 10 | -Idependencies/all/tinyxml2/ 11 | LDFLAGS_ALL += $(LDFLAGS) 12 | LIBS_ALL += $(shell pkg-config --libs $(PKG_CONFIG_STATIC_FLAG) vorbisfile vorbis theoradec sdl2 glew) -pthread $(LIBS) 13 | 14 | SOURCES = \ 15 | dependencies/all/tinyxml2/tinyxml2.cpp \ 16 | dependencies/all/theoraplay/theoraplay.c \ 17 | RSDKv3/Animation.cpp \ 18 | RSDKv3/Audio.cpp \ 19 | RSDKv3/Collision.cpp \ 20 | RSDKv3/Debug.cpp \ 21 | RSDKv3/Drawing.cpp \ 22 | RSDKv3/Ini.cpp \ 23 | RSDKv3/Input.cpp \ 24 | RSDKv3/main.cpp \ 25 | RSDKv3/ModAPI.cpp \ 26 | RSDKv3/Math.cpp \ 27 | RSDKv3/Object.cpp \ 28 | RSDKv3/Palette.cpp \ 29 | RSDKv3/Player.cpp \ 30 | RSDKv3/Reader.cpp \ 31 | RSDKv3/RetroEngine.cpp \ 32 | RSDKv3/Scene.cpp \ 33 | RSDKv3/Scene3D.cpp \ 34 | RSDKv3/Script.cpp \ 35 | RSDKv3/Sprite.cpp \ 36 | RSDKv3/String.cpp \ 37 | RSDKv3/Text.cpp \ 38 | RSDKv3/Userdata.cpp \ 39 | RSDKv3/Video.cpp 40 | 41 | 42 | ifeq ($(FORCE_CASE_INSENSITIVE),1) 43 | CXXFLAGS_ALL += -DFORCE_CASE_INSENSITIVE 44 | SOURCES += RSDKv3/fcaseopen.c 45 | endif 46 | 47 | OBJECTS = $(SOURCES:%=objects/%.o) 48 | DEPENDENCIES = $(SOURCES:%=objects/%.d) 49 | 50 | all: bin/RSDKv3 51 | 52 | include $(wildcard $(DEPENDENCIES)) 53 | 54 | objects/%.o: % 55 | mkdir -p $(@D) 56 | $(CXX) $(CXXFLAGS_ALL) -std=c++17 $< -o $@ -c 57 | 58 | bin/RSDKv3: $(OBJECTS) 59 | mkdir -p $(@D) 60 | $(CXX) $(CXXFLAGS_ALL) $(LDFLAGS_ALL) $^ -o $@ $(LIBS_ALL) 61 | 62 | install: bin/RSDKv3 63 | install -Dp -m755 bin/RSDKv3 $(prefix)/bin/RSDKv3 64 | 65 | clean: 66 | rm -r -f bin && rm -r -f objects 67 | -------------------------------------------------------------------------------- /Makefile.msys2: -------------------------------------------------------------------------------- 1 | ifeq ($(STATIC),1) 2 | PKG_CONFIG_STATIC_FLAG = --static 3 | CXXFLAGS_ALL += -static 4 | endif 5 | 6 | CXXFLAGS_ALL += -MMD -MP -MF objects/$*.d $(shell pkg-config --cflags $(PKG_CONFIG_STATIC_FLAG) vorbisfile vorbis theoradec sdl2 glew) $(CXXFLAGS) \ 7 | -DGLEW_STATIC \ 8 | -Idependencies/all/filesystem/include \ 9 | -Idependencies/all/theoraplay \ 10 | -Idependencies/all/tinyxml2/ 11 | LDFLAGS_ALL += $(LDFLAGS) 12 | LIBS_ALL += $(shell pkg-config --libs $(PKG_CONFIG_STATIC_FLAG) vorbisfile vorbis theoradec sdl2 glew) -lopengl32 -lws2_32 -pthread $(LIBS) 13 | 14 | SOURCES = \ 15 | dependencies/all/tinyxml2/tinyxml2.cpp \ 16 | dependencies/all/theoraplay/theoraplay.c \ 17 | RSDKv3/Animation.cpp \ 18 | RSDKv3/Audio.cpp \ 19 | RSDKv3/Collision.cpp \ 20 | RSDKv3/Debug.cpp \ 21 | RSDKv3/Drawing.cpp \ 22 | RSDKv3/Ini.cpp \ 23 | RSDKv3/Input.cpp \ 24 | RSDKv3/main.cpp \ 25 | RSDKv3/ModAPI.cpp \ 26 | RSDKv3/Math.cpp \ 27 | RSDKv3/Object.cpp \ 28 | RSDKv3/Palette.cpp \ 29 | RSDKv3/Player.cpp \ 30 | RSDKv3/Reader.cpp \ 31 | RSDKv3/RetroEngine.cpp \ 32 | RSDKv3/Scene.cpp \ 33 | RSDKv3/Scene3D.cpp \ 34 | RSDKv3/Script.cpp \ 35 | RSDKv3/Sprite.cpp \ 36 | RSDKv3/String.cpp \ 37 | RSDKv3/Text.cpp \ 38 | RSDKv3/Userdata.cpp \ 39 | RSDKv3/Video.cpp 40 | 41 | 42 | ifeq ($(FORCE_CASE_INSENSITIVE),1) 43 | CXXFLAGS_ALL += -DFORCE_CASE_INSENSITIVE 44 | SOURCES += RSDKv3/fcaseopen.c 45 | endif 46 | 47 | OBJECTS = $(SOURCES:%=objects/%.o) 48 | DEPENDENCIES = $(SOURCES:%=objects/%.d) 49 | 50 | all: bin/RSDKv3 51 | 52 | include $(wildcard $(DEPENDENCIES)) 53 | 54 | objects/%.o: % 55 | mkdir -p $(@D) 56 | $(CXX) $(CXXFLAGS_ALL) -std=c++17 $< -o $@ -c 57 | 58 | bin/RSDKv3: $(OBJECTS) 59 | mkdir -p $(@D) 60 | $(CXX) $(CXXFLAGS_ALL) $(LDFLAGS_ALL) $^ -o $@ $(LIBS_ALL) 61 | 62 | install: bin/RSDKv3 63 | install -Dp -m755 bin/RSDKv3 $(prefix)/bin/RSDKv3 64 | chmod -x $(prefix)/bin/RSDKv3 65 | 66 | clean: 67 | rm -r -f bin && rm -r -f objects 68 | -------------------------------------------------------------------------------- /RSDKv3 ios.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /RSDKv3 ios.xcodeproj/xcshareddata/xcschemes/RSDKv3.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 45 | 51 | 52 | 53 | 54 | 60 | 62 | 68 | 69 | 70 | 71 | 73 | 74 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /RSDKv3.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.29806.167 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RSDKv3", "RSDKv3\RSDKv3.vcxproj", "{BD4A4266-8ED9-491E-B4CC-3F63F0D39C1B}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {BD4A4266-8ED9-491E-B4CC-3F63F0D39C1B}.Debug|x64.ActiveCfg = Debug|x64 17 | {BD4A4266-8ED9-491E-B4CC-3F63F0D39C1B}.Debug|x64.Build.0 = Debug|x64 18 | {BD4A4266-8ED9-491E-B4CC-3F63F0D39C1B}.Debug|x86.ActiveCfg = Debug|Win32 19 | {BD4A4266-8ED9-491E-B4CC-3F63F0D39C1B}.Debug|x86.Build.0 = Debug|Win32 20 | {BD4A4266-8ED9-491E-B4CC-3F63F0D39C1B}.Release|x64.ActiveCfg = Release|x64 21 | {BD4A4266-8ED9-491E-B4CC-3F63F0D39C1B}.Release|x64.Build.0 = Release|x64 22 | {BD4A4266-8ED9-491E-B4CC-3F63F0D39C1B}.Release|x86.ActiveCfg = Release|Win32 23 | {BD4A4266-8ED9-491E-B4CC-3F63F0D39C1B}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {CEEC6B21-D41E-4C5C-8B97-9FAAD7974615} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /RSDKv3.vita/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## This file is a quick tutorial on writing CMakeLists for targeting the Vita 2 | cmake_minimum_required(VERSION 2.8) 3 | 4 | ## This includes the Vita toolchain, must go before project definition 5 | # It is a convenience so you do not have to type 6 | # -DCMAKE_TOOLCHAIN_FILE=$VITASDK/share/vita.toolchain.cmake for cmake. It is 7 | # highly recommended that you include this block for all projects. 8 | if(NOT DEFINED CMAKE_TOOLCHAIN_FILE) 9 | if(DEFINED ENV{VITASDK}) 10 | set(CMAKE_TOOLCHAIN_FILE "$ENV{VITASDK}/share/vita.toolchain.cmake" CACHE PATH "toolchain file") 11 | else() 12 | message(FATAL_ERROR "Please define VITASDK to point to your SDK path!") 13 | endif() 14 | endif() 15 | 16 | ## Define project parameters here 17 | # Name of the project 18 | project(RSDKv3) 19 | # This line adds Vita helper macros, must go after project definition in order 20 | # to build Vita specific artifacts (self/vpk). 21 | include("${VITASDK}/share/vita.cmake" REQUIRED) 22 | 23 | ## Configuration options for this app 24 | # Display name (under bubble in LiveArea) 25 | set(VITA_APP_NAME "Sonic CD") 26 | # Unique ID must be exactly 9 characters. Recommended: XXXXYYYYY where X = 27 | # unique string of developer and Y = a unique number for this app 28 | set(VITA_TITLEID "RSDK00001") 29 | # Optional version string to show in LiveArea's more info screen 30 | set(VITA_VERSION "1.3.0") 31 | 32 | ## Flags and includes for building 33 | # Note that we make sure not to overwrite previous flags 34 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -O3 -fsigned-char -fno-lto") 35 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -O3 -fsigned-char -fno-lto -fno-rtti -fno-exceptions") 36 | # Optional. You can specify more param.sfo flags this way. 37 | set(VITA_MKSFOEX_FLAGS "${VITA_MKSFOEX_FLAGS} -d PARENTAL_LEVEL=1") 38 | 39 | # Add any additional include paths here 40 | include_directories( 41 | ../dependencies/all/theoraplay 42 | ../dependencies/all/tinyxml2 43 | /home/user/vitasdk/arm-vita-eabi/include 44 | ) 45 | 46 | # Add any additional library paths here 47 | # ${CMAKE_CURRENT_BINARY_DIR} lets you use any library currently being built 48 | link_directories( 49 | ${CMAKE_CURRENT_BINARY_DIR} 50 | ) 51 | 52 | ## Build and link 53 | # Add all the files needed to compile here 54 | add_executable(${PROJECT_NAME} 55 | ../dependencies/all/theoraplay/theoraplay.c 56 | ../RSDKv3/Animation.cpp 57 | ../RSDKv3/Audio.cpp 58 | ../RSDKv3/Collision.cpp 59 | ../RSDKv3/Debug.cpp 60 | ../RSDKv3/Drawing.cpp 61 | ../RSDKv3/Ini.cpp 62 | ../RSDKv3/Input.cpp 63 | ../RSDKv3/Math.cpp 64 | ../RSDKv3/ModAPI.cpp 65 | ../RSDKv3/Object.cpp 66 | ../RSDKv3/Palette.cpp 67 | ../RSDKv3/Player.cpp 68 | ../RSDKv3/Reader.cpp 69 | ../RSDKv3/RetroEngine.cpp 70 | ../RSDKv3/Scene.cpp 71 | ../RSDKv3/Scene3D.cpp 72 | ../RSDKv3/Script.cpp 73 | ../RSDKv3/Sprite.cpp 74 | ../RSDKv3/String.cpp 75 | ../RSDKv3/Text.cpp 76 | ../RSDKv3/Userdata.cpp 77 | ../RSDKv3/Video.cpp 78 | ../RSDKv3/main.cpp 79 | ) 80 | 81 | # Library to link to (drop the -l prefix). This will mostly be stubs. 82 | target_link_libraries(${PROJECT_NAME} 83 | SDL2 84 | vita2d 85 | vorbisfile 86 | vorbis 87 | ogg 88 | theora 89 | glew 90 | tinyxml2 91 | pthread 92 | SceDisplay_stub 93 | SceAudio_stub 94 | SceCtrl_stub 95 | SceSysmodule_stub 96 | SceGxm_stub 97 | SceCommonDialog_stub 98 | SceAppMgr_stub 99 | SceTouch_stub 100 | SceHid_stub 101 | SceAudio_stub 102 | SceMotion_stub 103 | m 104 | ) 105 | 106 | ## Create Vita files 107 | vita_create_self(${PROJECT_NAME}.self ${PROJECT_NAME}) 108 | # The FILE directive lets you add additional files to the VPK, the syntax is 109 | # FILE src_path dst_path_in_vpk. In this case, we add the LiveArea paths. 110 | vita_create_vpk(${PROJECT_NAME}.vpk ${VITA_TITLEID} ${PROJECT_NAME}.self 111 | VERSION ${VITA_VERSION} 112 | NAME ${VITA_APP_NAME} 113 | # FILE sce_sys/icon0.png sce_sys/icon0.png 114 | # FILE sce_sys/livearea/contents/bg.png sce_sys/livearea/contents/bg.png 115 | # FILE sce_sys/livearea/contents/startup.png sce_sys/livearea/contents/startup.png 116 | FILE sce_sys/livearea/contents/template.xml sce_sys/livearea/contents/template.xml 117 | ) 118 | -------------------------------------------------------------------------------- /RSDKv3.vita/build-internal.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | apk add --no-cache make cmake 3 | 4 | function getSdl2() { 5 | wget https://github.com/rsn8887/SDL-Vita/releases/download/2.0.8dev_vita_rsn8887_git_20180523/sdl2_vita_20180523.tar.xz && \ 6 | mkdir -p ../dependencies/vita/sdl2 || true && \ 7 | tar -xf sdl2_vita_20180523.tar.xz -C ../dependencies/vita/sdl2 8 | rm sdl2_vita_20180523.tar.xz 9 | } 10 | 11 | function getLibTheora() { 12 | wget https://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.bz2 && \ 13 | tar -xf libtheora-1.1.1.tar.bz2 -C ../dependencies/vita && \ 14 | (cd ../dependencies/vita/libtheora || \ 15 | (mv ../dependencies/vita/libtheora-1.1.1 ../dependencies/vita/libtheora && cd ../dependencies/vita/libtheora)) && \ 16 | cd ../dependencies/vita/libtheora && \ 17 | (./configure --host=arm-vita-eabi --prefix=${VITASDK}/arm-vita-eabi --disable-shared --enable-static --disable-spec --disable-examples) || 18 | cd - 19 | rm libtheora-1.1.1.tar.bz2 20 | } 21 | 22 | function installLibTheora() { 23 | cd ../dependencies/vita/libtheora && \ 24 | make install && \ 25 | cd - 26 | } 27 | 28 | # Download dependencies 29 | [ ! -d ../dependencies/vita/sdl2 ] && getSdl2 30 | [ ! -d ../dependencies/vita/libtheora ] && getLibTheora 31 | installLibTheora 32 | 33 | cmake . && \ 34 | make 35 | rm RSDKv3 # this is not ignored by .gitignore 36 | -------------------------------------------------------------------------------- /RSDKv3.vita/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | sudo docker run \ 3 | --rm \ 4 | -v $PWD/..:/work \ 5 | -w /work/RSDKv3.vita \ 6 | vitasdk/vitasdk \ 7 | /bin/sh -C "./build-internal.sh" 8 | -------------------------------------------------------------------------------- /RSDKv3.vita/sce_sys/livearea/contents/template.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | bg.png 6 | 7 | 8 | 9 | startup.png 10 | 11 | 12 | -------------------------------------------------------------------------------- /RSDKv3.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /RSDKv3.xcodeproj/xcshareddata/xcschemes/RSDKv3.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 45 | 51 | 52 | 53 | 54 | 60 | 62 | 68 | 69 | 70 | 71 | 73 | 74 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /RSDKv3/Animation.cpp: -------------------------------------------------------------------------------- 1 | #include "RetroEngine.hpp" 2 | 3 | AnimationFile animationFileList[ANIFILE_COUNT]; 4 | int animationFileCount = 0; 5 | 6 | SpriteFrame scriptFrames[SPRITEFRAME_COUNT]; 7 | int scriptFrameCount = 0; 8 | 9 | SpriteFrame animFrames[SPRITEFRAME_COUNT]; 10 | int animFrameCount = 0; 11 | SpriteAnimation animationList[ANIMATION_COUNT]; 12 | int animationCount = 0; 13 | Hitbox hitboxList[HITBOX_COUNT]; 14 | int hitboxCount = 0; 15 | 16 | void LoadAnimationFile(const char *filePath) 17 | { 18 | FileInfo info; 19 | if (LoadFile(filePath, &info)) { 20 | byte fileBuffer = 0; 21 | char strBuf[0x21]; 22 | byte sheetIDs[0x18]; 23 | sheetIDs[0] = 0; 24 | 25 | byte sheetCount = 0; 26 | FileRead(&sheetCount, 1); 27 | 28 | // Read & load each spritesheet 29 | for (int s = 0; s < sheetCount; ++s) { 30 | FileRead(&fileBuffer, 1); 31 | if (fileBuffer) { 32 | int i = 0; 33 | for (; i < fileBuffer; ++i) FileRead(&strBuf[i], 1); 34 | strBuf[i] = 0; 35 | GetFileInfo(&info); 36 | CloseFile(); 37 | sheetIDs[s] = AddGraphicsFile(strBuf); 38 | SetFileInfo(&info); 39 | } 40 | } 41 | 42 | byte animCount = 0; 43 | FileRead(&animCount, 1); 44 | AnimationFile *animFile = &animationFileList[animationFileCount]; 45 | animFile->animCount = animCount; 46 | animFile->aniListOffset = animationCount; 47 | 48 | // Read animations 49 | for (int a = 0; a < animCount; ++a) { 50 | SpriteAnimation *anim = &animationList[animationCount++]; 51 | anim->frameListOffset = animFrameCount; 52 | FileRead(&fileBuffer, 1); 53 | FileRead(anim->name, fileBuffer); 54 | anim->name[fileBuffer] = 0; 55 | FileRead(&anim->frameCount, 1); 56 | FileRead(&anim->speed, 1); 57 | FileRead(&anim->loopPoint, 1); 58 | FileRead(&anim->rotationStyle, 1); 59 | 60 | for (int j = 0; j < anim->frameCount; ++j) { 61 | SpriteFrame *frame = &animFrames[animFrameCount++]; 62 | FileRead(&frame->sheetID, 1); 63 | frame->sheetID = sheetIDs[frame->sheetID]; 64 | FileRead(&frame->hitboxID, 1); 65 | FileRead(&fileBuffer, 1); 66 | frame->sprX = fileBuffer; 67 | FileRead(&fileBuffer, 1); 68 | frame->sprY = fileBuffer; 69 | FileRead(&fileBuffer, 1); 70 | frame->width = fileBuffer; 71 | FileRead(&fileBuffer, 1); 72 | frame->height = fileBuffer; 73 | 74 | sbyte buffer = 0; 75 | FileRead(&buffer, 1); 76 | frame->pivotX = buffer; 77 | FileRead(&buffer, 1); 78 | frame->pivotY = buffer; 79 | } 80 | 81 | // 90 Degree (Extra rotation Frames) rotation 82 | if (anim->rotationStyle == ROTSTYLE_STATICFRAMES) 83 | anim->frameCount >>= 1; 84 | } 85 | 86 | // Read Hitboxes 87 | animFile->hitboxListOffset = hitboxCount; 88 | FileRead(&fileBuffer, 1); 89 | for (int i = 0; i < fileBuffer; ++i) { 90 | Hitbox *hitbox = &hitboxList[hitboxCount++]; 91 | for (int d = 0; d < HITBOX_DIR_COUNT; ++d) { 92 | FileRead(&hitbox->left[d], 1); 93 | FileRead(&hitbox->top[d], 1); 94 | FileRead(&hitbox->right[d], 1); 95 | FileRead(&hitbox->bottom[d], 1); 96 | } 97 | } 98 | 99 | CloseFile(); 100 | } 101 | } 102 | void ClearAnimationData() 103 | { 104 | for (int f = 0; f < SPRITEFRAME_COUNT; ++f) MEM_ZERO(scriptFrames[f]); 105 | for (int f = 0; f < SPRITEFRAME_COUNT; ++f) MEM_ZERO(animFrames[f]); 106 | for (int h = 0; h < HITBOX_COUNT; ++h) MEM_ZERO(hitboxList[h]); 107 | for (int a = 0; a < ANIMATION_COUNT; ++a) MEM_ZERO(animationList[a]); 108 | for (int a = 0; a < ANIFILE_COUNT; ++a) MEM_ZERO(animationFileList[a]); 109 | 110 | scriptFrameCount = 0; 111 | animFrameCount = 0; 112 | animationCount = 0; 113 | animationFileCount = 0; 114 | hitboxCount = 0; 115 | } 116 | 117 | AnimationFile *AddAnimationFile(const char *filePath) 118 | { 119 | char path[0x80]; 120 | StrCopy(path, "Data/Animations/"); 121 | StrAdd(path, filePath); 122 | 123 | // If matching anim is found return that, otherwise load a new anim 124 | for (int a = 0; a < 0x100; ++a) { 125 | if (StrLength(animationFileList[a].fileName) <= 0) { 126 | StrCopy(animationFileList[a].fileName, filePath); 127 | LoadAnimationFile(path); 128 | ++animationFileCount; 129 | return &animationFileList[a]; 130 | } 131 | if (StrComp(animationFileList[a].fileName, filePath)) 132 | return &animationFileList[a]; 133 | } 134 | return NULL; 135 | } 136 | 137 | void ProcessObjectAnimation(void *objScr, void *ent) 138 | { 139 | ObjectScript *objectScript = (ObjectScript *)objScr; 140 | Entity *entity = (Entity *)ent; 141 | SpriteAnimation *sprAnim = &animationList[objectScript->animFile->aniListOffset + entity->animation]; 142 | 143 | if (entity->animationSpeed <= 0) { 144 | entity->animationTimer += sprAnim->speed; 145 | } 146 | else { 147 | if (entity->animationSpeed > 0xF0) 148 | entity->animationSpeed = 0xF0; 149 | entity->animationTimer += entity->animationSpeed; 150 | } 151 | 152 | if (entity->animation != entity->prevAnimation) { 153 | entity->prevAnimation = entity->animation; 154 | entity->frame = 0; 155 | entity->animationTimer = 0; 156 | entity->animationSpeed = 0; 157 | } 158 | 159 | if (entity->animationTimer >= 0xF0) { 160 | entity->animationTimer -= 0xF0; 161 | ++entity->frame; 162 | } 163 | 164 | if (entity->frame >= sprAnim->frameCount) 165 | entity->frame = sprAnim->loopPoint; 166 | } 167 | -------------------------------------------------------------------------------- /RSDKv3/Animation.hpp: -------------------------------------------------------------------------------- 1 | #ifndef ANIMATION_H 2 | #define ANIMATION_H 3 | 4 | #define ANIFILE_COUNT (0x100) 5 | #define ANIMATION_COUNT (0x400) 6 | #define SPRITEFRAME_COUNT (0x1000) 7 | 8 | #define HITBOX_COUNT (0x20) 9 | #define HITBOX_DIR_COUNT (0x8) 10 | 11 | enum AnimrotationFlags { ROTSTYLE_NONE, ROTSTYLE_FULL, ROTSTYLE_45DEG, ROTSTYLE_STATICFRAMES }; 12 | 13 | struct AnimationFile { 14 | char fileName[0x20]; 15 | int animCount; 16 | int aniListOffset; 17 | int hitboxListOffset; 18 | }; 19 | 20 | struct SpriteAnimation { 21 | char name[16]; 22 | byte frameCount; 23 | byte speed; 24 | byte loopPoint; 25 | byte rotationStyle; 26 | int frameListOffset; 27 | }; 28 | 29 | struct SpriteFrame { 30 | int sprX; 31 | int sprY; 32 | int width; 33 | int height; 34 | int pivotX; 35 | int pivotY; 36 | byte sheetID; 37 | byte hitboxID; 38 | }; 39 | 40 | struct Hitbox { 41 | sbyte left[HITBOX_DIR_COUNT]; 42 | sbyte top[HITBOX_DIR_COUNT]; 43 | sbyte right[HITBOX_DIR_COUNT]; 44 | sbyte bottom[HITBOX_DIR_COUNT]; 45 | }; 46 | 47 | extern AnimationFile animationFileList[ANIFILE_COUNT]; 48 | extern int animationFileCount; 49 | 50 | extern SpriteFrame scriptFrames[SPRITEFRAME_COUNT]; 51 | extern int scriptFrameCount; 52 | 53 | extern SpriteFrame animFrames[SPRITEFRAME_COUNT]; 54 | extern int animFrameCount; 55 | extern SpriteAnimation animationList[ANIMATION_COUNT]; 56 | extern int animationCount; 57 | extern Hitbox hitboxList[HITBOX_COUNT]; 58 | extern int hitboxCount; 59 | 60 | void LoadAnimationFile(const char *FilePath); 61 | void ClearAnimationData(); 62 | 63 | AnimationFile *AddAnimationFile(const char *FilePath); 64 | 65 | inline AnimationFile *GetDefaultAnimationRef() { return &animationFileList[0]; } 66 | 67 | void ProcessObjectAnimation(void *objScr, void *ent); 68 | 69 | #endif // !ANIMATION_H 70 | -------------------------------------------------------------------------------- /RSDKv3/Audio.hpp: -------------------------------------------------------------------------------- 1 | #ifndef AUDIO_H 2 | #define AUDIO_H 3 | 4 | #include 5 | 6 | #include 7 | 8 | #if RETRO_PLATFORM != RETRO_VITA && RETRO_PLATFORM != RETRO_OSX 9 | #include "SDL.h" 10 | #endif 11 | 12 | #if RETRO_USING_SDL1 || RETRO_USING_SDL2 13 | 14 | #define LockAudioDevice() SDL_LockAudio() 15 | #define UnlockAudioDevice() SDL_UnlockAudio() 16 | 17 | #else 18 | #define LockAudioDevice() ; 19 | #define UnlockAudioDevice() ; 20 | #endif 21 | 22 | #define TRACK_COUNT (0x10) 23 | #define SFX_COUNT (0x100) 24 | #define CHANNEL_COUNT (0x4) 25 | #define SFXDATA_COUNT (0x400000) 26 | 27 | #define MAX_VOLUME (100) 28 | 29 | #define STREAMFILE_COUNT (2) 30 | 31 | #define MIX_BUFFER_SAMPLES (256) 32 | 33 | struct TrackInfo { 34 | char fileName[0x40]; 35 | bool trackLoop; 36 | uint loopPoint; 37 | }; 38 | 39 | struct StreamInfo { 40 | OggVorbis_File vorbisFile; 41 | int vorbBitstream; 42 | #if RETRO_USING_SDL1 43 | SDL_AudioSpec spec; 44 | #endif 45 | #if RETRO_USING_SDL2 46 | SDL_AudioStream *stream; 47 | #endif 48 | Sint16 buffer[MIX_BUFFER_SAMPLES]; 49 | bool trackLoop; 50 | uint loopPoint; 51 | bool loaded; 52 | }; 53 | 54 | struct SFXInfo { 55 | char name[0x40]; 56 | Sint16 *buffer; 57 | size_t length; 58 | bool loaded; 59 | }; 60 | 61 | struct ChannelInfo { 62 | size_t sampleLength; 63 | Sint16 *samplePtr; 64 | int sfxID; 65 | byte loopSFX; 66 | sbyte pan; 67 | }; 68 | 69 | struct StreamFile { 70 | byte *buffer; 71 | int fileSize; 72 | int filePos; 73 | }; 74 | 75 | enum MusicStatuses { 76 | MUSIC_STOPPED = 0, 77 | MUSIC_PLAYING = 1, 78 | MUSIC_PAUSED = 2, 79 | MUSIC_LOADING = 3, 80 | MUSIC_READY = 4, 81 | }; 82 | 83 | extern int globalSFXCount; 84 | extern int stageSFXCount; 85 | 86 | extern int masterVolume; 87 | extern int trackID; 88 | extern int sfxVolume; 89 | extern int bgmVolume; 90 | extern bool audioEnabled; 91 | 92 | extern int nextChannelPos; 93 | extern bool musicEnabled; 94 | extern int musicStatus; 95 | extern TrackInfo musicTracks[TRACK_COUNT]; 96 | extern SFXInfo sfxList[SFX_COUNT]; 97 | 98 | extern ChannelInfo sfxChannels[CHANNEL_COUNT]; 99 | 100 | extern int currentStreamIndex; 101 | extern StreamFile streamFile[STREAMFILE_COUNT]; 102 | extern StreamInfo streamInfo[STREAMFILE_COUNT]; 103 | extern StreamFile *streamFilePtr; 104 | extern StreamInfo *streamInfoPtr; 105 | 106 | #if RETRO_USING_SDL1 || RETRO_USING_SDL2 107 | extern SDL_AudioSpec audioDeviceFormat; 108 | #endif 109 | 110 | int InitAudioPlayback(); 111 | void LoadGlobalSfx(); 112 | 113 | #if RETRO_USING_SDL1 || RETRO_USING_SDL2 114 | void ProcessMusicStream(void *data, Sint16 *stream, int len); 115 | void ProcessAudioPlayback(void *data, Uint8 *stream, int len); 116 | void ProcessAudioMixing(Sint32 *dst, const Sint16 *src, int len, int volume, sbyte pan); 117 | 118 | inline void FreeMusInfo() 119 | { 120 | LockAudioDevice(); 121 | 122 | #if RETRO_USING_SDL2 123 | if (streamInfo[currentStreamIndex].stream) 124 | SDL_FreeAudioStream(streamInfo[currentStreamIndex].stream); 125 | #endif 126 | ov_clear(&streamInfo[currentStreamIndex].vorbisFile); 127 | #if RETRO_USING_SDL2 128 | streamInfo[currentStreamIndex].stream = nullptr; 129 | #endif 130 | if (streamFile[currentStreamIndex].buffer) 131 | free(streamFile[currentStreamIndex].buffer); 132 | streamFile[currentStreamIndex].buffer = NULL; 133 | 134 | UnlockAudioDevice(); 135 | } 136 | #else 137 | void ProcessMusicStream() {} 138 | void ProcessAudioPlayback() {} 139 | void ProcessAudioMixing() {} 140 | 141 | inline void FreeMusInfo() { ov_clear(&streamInfo[currentStreamIndex].vorbisFile); } 142 | #endif 143 | 144 | #if RETRO_USE_MOD_LOADER 145 | extern char globalSfxNames[SFX_COUNT][0x40]; 146 | extern char stageSfxNames[SFX_COUNT][0x40]; 147 | void SetSfxName(const char *sfxName, int sfxID, bool global); 148 | #endif 149 | 150 | void LoadMusic(); 151 | void SetMusicTrack(char *filePath, byte trackID, bool loop, uint loopPoint); 152 | bool PlayMusic(int track); 153 | inline void StopMusic() 154 | { 155 | musicStatus = MUSIC_STOPPED; 156 | FreeMusInfo(); 157 | } 158 | 159 | void LoadSfx(char *filePath, byte sfxID); 160 | void PlaySfx(int sfx, bool loop); 161 | inline void StopSfx(int sfx) 162 | { 163 | for (int i = 0; i < CHANNEL_COUNT; ++i) { 164 | if (sfxChannels[i].sfxID == sfx) { 165 | MEM_ZERO(sfxChannels[i]); 166 | sfxChannels[i].sfxID = -1; 167 | } 168 | } 169 | } 170 | void SetSfxAttributes(int sfx, int loopCount, sbyte pan); 171 | 172 | inline void SetMusicVolume(int volume) 173 | { 174 | if (volume < 0) 175 | volume = 0; 176 | if (volume > MAX_VOLUME) 177 | volume = MAX_VOLUME; 178 | masterVolume = volume; 179 | } 180 | 181 | inline bool PauseSound() 182 | { 183 | if (musicStatus == MUSIC_PLAYING) { 184 | musicStatus = MUSIC_PAUSED; 185 | return true; 186 | } 187 | return false; 188 | } 189 | 190 | inline void ResumeSound() 191 | { 192 | if (musicStatus == MUSIC_PAUSED) 193 | musicStatus = MUSIC_PLAYING; 194 | } 195 | 196 | inline void StopAllSfx() 197 | { 198 | for (int i = 0; i < CHANNEL_COUNT; ++i) sfxChannels[i].sfxID = -1; 199 | } 200 | inline void ReleaseGlobalSfx() 201 | { 202 | StopAllSfx(); 203 | for (int i = globalSFXCount - 1; i >= 0; --i) { 204 | if (sfxList[i].loaded) { 205 | StrCopy(sfxList[i].name, ""); 206 | free(sfxList[i].buffer); 207 | sfxList[i].length = 0; 208 | sfxList[i].loaded = false; 209 | } 210 | } 211 | globalSFXCount = 0; 212 | } 213 | inline void ReleaseStageSfx() 214 | { 215 | for (int i = stageSFXCount + globalSFXCount; i >= globalSFXCount; --i) { 216 | if (sfxList[i].loaded) { 217 | StrCopy(sfxList[i].name, ""); 218 | free(sfxList[i].buffer); 219 | sfxList[i].length = 0; 220 | sfxList[i].loaded = false; 221 | } 222 | } 223 | stageSFXCount = 0; 224 | } 225 | 226 | inline void ReleaseAudioDevice() 227 | { 228 | StopMusic(); 229 | StopAllSfx(); 230 | ReleaseStageSfx(); 231 | ReleaseGlobalSfx(); 232 | } 233 | 234 | #endif // !AUDIO_H 235 | -------------------------------------------------------------------------------- /RSDKv3/Collision.hpp: -------------------------------------------------------------------------------- 1 | #ifndef COLLISION_H 2 | #define COLLISION_H 3 | 4 | enum CollisionSides { 5 | CSIDE_FLOOR = 0, 6 | CSIDE_LWALL = 1, 7 | CSIDE_RWALL = 2, 8 | CSIDE_ROOF = 3, 9 | }; 10 | 11 | enum CollisionModes { 12 | CMODE_FLOOR = 0, 13 | CMODE_LWALL = 1, 14 | CMODE_ROOF = 2, 15 | CMODE_RWALL = 3, 16 | }; 17 | 18 | enum CollisionSolidity { 19 | SOLID_ALL = 0, 20 | SOLID_TOP = 1, 21 | SOLID_LRB = 2, 22 | SOLID_NONE = 3, 23 | }; 24 | 25 | enum ObjectCollisionTypes { 26 | C_TOUCH = 0, 27 | C_BOX = 1, 28 | C_BOX2 = 2, 29 | C_PLATFORM = 3, 30 | C_ENEMY = 5, // Introduced in Origins Plus 31 | }; 32 | 33 | struct CollisionSensor { 34 | int XPos; 35 | int YPos; 36 | int angle; 37 | bool collided; 38 | }; 39 | 40 | #if !RETRO_USE_ORIGINAL_CODE 41 | #define DEBUG_HITBOX_COUNT (0x400) 42 | 43 | struct DebugHitboxInfo { 44 | byte type; 45 | byte collision; 46 | short left; 47 | short top; 48 | short right; 49 | short bottom; 50 | int XPos; 51 | int YPos; 52 | Entity *entity; 53 | }; 54 | 55 | enum DebugHitboxTypes { H_TYPE_TOUCH, H_TYPE_BOX, H_TYPE_PLAT, H_TYPE_FINGER }; 56 | 57 | extern byte showHitboxes; 58 | extern int debugHitboxCount; 59 | extern DebugHitboxInfo debugHitboxList[DEBUG_HITBOX_COUNT]; 60 | 61 | int AddDebugHitbox(byte type, Entity *entity, int left, int top, int right, int bottom); 62 | #endif 63 | 64 | extern int collisionLeft; 65 | extern int collisionTop; 66 | extern int collisionRight; 67 | extern int collisionBottom; 68 | 69 | extern CollisionSensor sensors[6]; 70 | 71 | void FindFloorPosition(Player *player, CollisionSensor *sensor, int startYPos); 72 | void FindLWallPosition(Player *player, CollisionSensor *sensor, int startXPos); 73 | void FindRoofPosition(Player *player, CollisionSensor *sensor, int startYPos); 74 | void FindRWallPosition(Player *player, CollisionSensor *sensor, int startXPos); 75 | void FloorCollision(Player *player, CollisionSensor *sensor); 76 | void LWallCollision(Player *player, CollisionSensor *sensor); 77 | void RoofCollision(Player *player, CollisionSensor *sensor); 78 | void RWallCollision(Player *player, CollisionSensor *sensor); 79 | void SetPathGripSensors(Player *player); 80 | 81 | void ProcessPathGrip(Player *player); 82 | void ProcessAirCollision(Player *player); 83 | 84 | void ProcessPlayerTileCollisions(Player *player); 85 | 86 | void TouchCollision(int left, int top, int right, int bottom); 87 | void BoxCollision(int left, int top, int right, int bottom); // Standard 88 | void BoxCollision2(int left, int top, int right, int bottom); // Updated (?) 89 | void PlatformCollision(int left, int top, int right, int bottom); 90 | 91 | void ObjectFloorCollision(int xOffset, int yOffset, int cPath); 92 | void ObjectLWallCollision(int xOffset, int yOffset, int cPath); 93 | void ObjectRoofCollision(int xOffset, int yOffset, int cPath); 94 | void ObjectRWallCollision(int xOffset, int yOffset, int cPath); 95 | 96 | void ObjectFloorGrip(int xOffset, int yOffset, int cPath); 97 | void ObjectLWallGrip(int xOffset, int yOffset, int cPath); 98 | void ObjectRoofGrip(int xOffset, int yOffset, int cPath); 99 | void ObjectRWallGrip(int xOffset, int yOffset, int cPath); 100 | 101 | #endif // !COLLISION_H 102 | -------------------------------------------------------------------------------- /RSDKv3/Debug.hpp: -------------------------------------------------------------------------------- 1 | #ifndef DEBUG_H 2 | #define DEBUG_H 3 | 4 | #if RETRO_PLATFORM == RETRO_ANDROID 5 | #include 6 | #endif 7 | 8 | inline void PrintLog(const char *msg, ...) 9 | { 10 | if (engineDebugMode) { 11 | char buffer[0x100]; 12 | 13 | // make the full string 14 | va_list args; 15 | va_start(args, msg); 16 | vsprintf(buffer, msg, args); 17 | printf("%s\n", buffer); 18 | sprintf(buffer, "%s\n", buffer); 19 | 20 | char pathBuffer[0x100]; 21 | #if RETRO_PLATFORM == RETRO_OSX || RETRO_PLATFORM == RETRO_UWP 22 | if (!usingCWD) 23 | sprintf(pathBuffer, "%s/log.txt", getResourcesPath()); 24 | else 25 | sprintf(pathBuffer, "log.txt"); 26 | #elif RETRO_PLATFORM == RETRO_ANDROID 27 | sprintf(pathBuffer, "%s/log.txt", gamePath); 28 | __android_log_print(ANDROID_LOG_INFO, "RSDKv3", "%s", buffer); 29 | #else 30 | sprintf(pathBuffer, BASE_PATH "log.txt"); 31 | #endif 32 | FileIO *file = fOpen(pathBuffer, "a"); 33 | if (file) { 34 | fWrite(&buffer, 1, StrLength(buffer), file); 35 | fClose(file); 36 | } 37 | } 38 | } 39 | 40 | enum DevMenuMenus { 41 | DEVMENU_MAIN, 42 | DEVMENU_PLAYERSEL, 43 | DEVMENU_STAGELISTSEL, 44 | DEVMENU_STAGESEL, 45 | DEVMENU_SCRIPTERROR, 46 | #if RETRO_USE_MOD_LOADER 47 | DEVMENU_MODMENU, 48 | #endif 49 | }; 50 | 51 | void InitDevMenu(); 52 | void InitErrorMessage(); 53 | void ProcessStageSelect(); 54 | 55 | #endif //! DEBUG_H 56 | -------------------------------------------------------------------------------- /RSDKv3/Ini.hpp: -------------------------------------------------------------------------------- 1 | #ifndef INI_H 2 | #define INI_H 3 | 4 | #include 5 | 6 | class IniParser 7 | { 8 | public: 9 | enum ItemType { 10 | INI_ITEM_STRING, 11 | INI_ITEM_INT, 12 | INI_ITEM_FLOAT, 13 | INI_ITEM_BOOL, 14 | INI_ITEM_COMMENT, 15 | }; 16 | 17 | struct ConfigItem { 18 | ConfigItem() 19 | { 20 | sprintf(section, "%s", ""); 21 | sprintf(key, "%s", ""); 22 | sprintf(value, "%s", ""); 23 | hasSection = false; 24 | type = INI_ITEM_STRING; 25 | } 26 | char section[0x20]; 27 | bool hasSection = false; 28 | char key[0x40]; 29 | char value[0x100]; 30 | byte type = INI_ITEM_STRING; 31 | }; 32 | 33 | IniParser() { items.clear(); } 34 | IniParser(const char *filename, bool addPath = true); 35 | 36 | int GetString(const char *section, const char *key, char *dest); 37 | int GetInteger(const char *section, const char *key, int *dest); 38 | int GetFloat(const char *section, const char *key, float *dest); 39 | int GetBool(const char *section, const char *key, bool *dest); 40 | int SetString(const char *section, const char *key, char *value); 41 | int SetInteger(const char *section, const char *key, int value); 42 | int SetFloat(const char *section, const char *key, float value); 43 | int SetBool(const char *section, const char *key, bool value); 44 | int SetComment(const char *section, const char *key, const char *comment); 45 | void Write(const char *filename, bool addPath = true); 46 | 47 | std::vector items; 48 | }; 49 | #endif // !INI_H 50 | -------------------------------------------------------------------------------- /RSDKv3/Input.hpp: -------------------------------------------------------------------------------- 1 | #ifndef INPUT_H 2 | #define INPUT_H 3 | 4 | enum InputButtons { 5 | INPUT_UP, 6 | INPUT_DOWN, 7 | INPUT_LEFT, 8 | INPUT_RIGHT, 9 | INPUT_BUTTONA, 10 | INPUT_BUTTONB, 11 | INPUT_BUTTONC, 12 | INPUT_START, 13 | INPUT_ANY, 14 | INPUT_BUTTONCOUNT, 15 | }; 16 | 17 | struct InputData { 18 | bool up; 19 | bool down; 20 | bool left; 21 | bool right; 22 | bool A; 23 | bool B; 24 | bool C; 25 | bool start; 26 | }; 27 | 28 | struct InputButton { 29 | bool press, hold; 30 | int keyMappings, contMappings; 31 | 32 | inline void setHeld() 33 | { 34 | press = !hold; 35 | hold = true; 36 | } 37 | inline void setReleased() 38 | { 39 | press = false; 40 | hold = false; 41 | } 42 | 43 | inline bool down() { return (press || hold); } 44 | }; 45 | 46 | enum DefaultHapticIDs { 47 | HAPTIC_NONE = -2, 48 | HAPTIC_STOP = -1, 49 | }; 50 | 51 | extern InputData keyPress; 52 | extern InputData keyDown; 53 | 54 | extern bool anyPress; 55 | 56 | extern int touchDown[8]; 57 | extern int touchX[8]; 58 | extern int touchY[8]; 59 | extern int touchID[8]; 60 | extern int touches; 61 | 62 | extern int hapticEffectNum; 63 | 64 | #if !RETRO_USE_ORIGINAL_CODE 65 | extern InputButton inputDevice[INPUT_BUTTONCOUNT]; 66 | extern int inputType; 67 | 68 | extern float LSTICK_DEADZONE; 69 | extern float RSTICK_DEADZONE; 70 | extern float LTRIGGER_DEADZONE; 71 | extern float RTRIGGER_DEADZONE; 72 | 73 | extern int mouseHideTimer; 74 | #endif 75 | 76 | #if !RETRO_USE_ORIGINAL_CODE 77 | #if RETRO_USING_SDL2 78 | // Easier this way 79 | enum ExtraSDLButtons { 80 | SDL_CONTROLLER_BUTTON_ZL = SDL_CONTROLLER_BUTTON_MAX + 1, 81 | SDL_CONTROLLER_BUTTON_ZR, 82 | SDL_CONTROLLER_BUTTON_LSTICK_UP, 83 | SDL_CONTROLLER_BUTTON_LSTICK_DOWN, 84 | SDL_CONTROLLER_BUTTON_LSTICK_LEFT, 85 | SDL_CONTROLLER_BUTTON_LSTICK_RIGHT, 86 | SDL_CONTROLLER_BUTTON_RSTICK_UP, 87 | SDL_CONTROLLER_BUTTON_RSTICK_DOWN, 88 | SDL_CONTROLLER_BUTTON_RSTICK_LEFT, 89 | SDL_CONTROLLER_BUTTON_RSTICK_RIGHT, 90 | SDL_CONTROLLER_BUTTON_MAX_EXTRA, 91 | }; 92 | 93 | void ControllerInit(byte controllerID); 94 | void ControllerClose(byte controllerID); 95 | #endif 96 | 97 | #if RETRO_USING_SDL1 98 | extern byte keyState[SDLK_LAST]; 99 | 100 | extern SDL_Joystick *controller; 101 | #endif 102 | 103 | void ProcessInput(); 104 | #endif 105 | 106 | void CheckKeyPress(InputData *input, byte Flags); 107 | void CheckKeyDown(InputData *input, byte Flags); 108 | 109 | #if RETRO_USE_HAPTICS 110 | inline int GetHapticEffectNum() 111 | { 112 | int num = hapticEffectNum; 113 | hapticEffectNum = HAPTIC_NONE; 114 | return num; 115 | } 116 | void QueueHapticEffect(int hapticID); 117 | void PlayHaptics(int left, int right, int power); 118 | void PlayHapticsID(int hapticID); 119 | void StopHaptics(int hapticID); 120 | #endif 121 | 122 | #endif // !INPUT_H 123 | -------------------------------------------------------------------------------- /RSDKv3/Math.cpp: -------------------------------------------------------------------------------- 1 | #include "RetroEngine.hpp" 2 | #include 3 | #include 4 | 5 | #ifndef M_PI 6 | #define M_PI 3.14159265358979323846264338327950288 7 | #endif 8 | 9 | int sinMLookupTable[512]; 10 | int cosMLookupTable[512]; 11 | 12 | int sin512LookupTable[512]; 13 | int cos512LookupTable[512]; 14 | 15 | int sin256LookupTable[256]; 16 | int cos256LookupTable[256]; 17 | 18 | byte arcTan256LookupTable[0x100 * 0x100]; 19 | 20 | void CalculateTrigAngles() 21 | { 22 | srand((unsigned)time(NULL)); 23 | 24 | for (int i = 0; i < 0x200; ++i) { 25 | sinMLookupTable[i] = (sin((i / 256.0) * M_PI) * 4096.0); 26 | cosMLookupTable[i] = (cos((i / 256.0) * M_PI) * 4096.0); 27 | } 28 | 29 | cosMLookupTable[0x00] = 0x1000; 30 | cosMLookupTable[0x80] = 0; 31 | cosMLookupTable[0x100] = -0x1000; 32 | cosMLookupTable[0x180] = 0; 33 | 34 | sinMLookupTable[0x00] = 0; 35 | sinMLookupTable[0x80] = 0x1000; 36 | sinMLookupTable[0x100] = 0; 37 | sinMLookupTable[0x180] = -0x1000; 38 | 39 | for (int i = 0; i < 0x200; ++i) { 40 | sin512LookupTable[i] = (sinf((i / 256.0) * M_PI) * 512.0); 41 | cos512LookupTable[i] = (cosf((i / 256.0) * M_PI) * 512.0); 42 | } 43 | 44 | cos512LookupTable[0x00] = 0x200; 45 | cos512LookupTable[0x80] = 0; 46 | cos512LookupTable[0x100] = -0x200; 47 | cos512LookupTable[0x180] = 0; 48 | 49 | sin512LookupTable[0x00] = 0; 50 | sin512LookupTable[0x80] = 0x200; 51 | sin512LookupTable[0x100] = 0; 52 | sin512LookupTable[0x180] = -0x200; 53 | 54 | for (int i = 0; i < 0x100; i++) { 55 | sin256LookupTable[i] = (sin512LookupTable[i * 2] >> 1); 56 | cos256LookupTable[i] = (cos512LookupTable[i * 2] >> 1); 57 | } 58 | 59 | for (int Y = 0; Y < 0x100; ++Y) { 60 | byte *atan = (byte *)&arcTan256LookupTable[Y]; 61 | for (int X = 0; X < 0x100; ++X) { 62 | float angle = atan2f(Y, X); 63 | *atan = (angle * 40.743664f); 64 | atan += 0x100; 65 | } 66 | } 67 | } 68 | 69 | byte ArcTanLookup(int X, int Y) 70 | { 71 | int x = 0; 72 | int y = 0; 73 | 74 | x = abs(X); 75 | y = abs(Y); 76 | 77 | if (x <= y) { 78 | while (y > 0xFF) { 79 | x >>= 4; 80 | y >>= 4; 81 | } 82 | } 83 | else { 84 | while (x > 0xFF) { 85 | x >>= 4; 86 | y >>= 4; 87 | } 88 | } 89 | if (X <= 0) { 90 | if (Y <= 0) 91 | return arcTan256LookupTable[(x << 8) + y] + -0x80; 92 | else 93 | return -0x80 - arcTan256LookupTable[(x << 8) + y]; 94 | } 95 | else if (Y <= 0) 96 | return -arcTan256LookupTable[(x << 8) + y]; 97 | else 98 | return arcTan256LookupTable[(x << 8) + y]; 99 | } 100 | -------------------------------------------------------------------------------- /RSDKv3/Math.hpp: -------------------------------------------------------------------------------- 1 | #ifndef MATH_H 2 | #define MATH_H 3 | 4 | #ifndef M_PI 5 | #define M_PI 3.14159265358979323846264338327950288 6 | #endif 7 | 8 | //#define M_PI (3.1415927) 9 | 10 | #define MEM_ZERO(x) memset(&(x), 0, sizeof((x))) 11 | #define MEM_ZEROP(x) memset((x), 0, sizeof(*(x))) 12 | 13 | extern int sinMLookupTable[0x200]; 14 | extern int cosMLookupTable[0x200]; 15 | 16 | extern int sin512LookupTable[0x200]; 17 | extern int cos512LookupTable[0x200]; 18 | 19 | extern int sin256LookupTable[0x100]; 20 | extern int cos256LookupTable[0x100]; 21 | 22 | extern byte arcTan256LookupTable[0x100 * 0x100]; 23 | 24 | // Setup Angles 25 | void CalculateTrigAngles(); 26 | 27 | inline int Sin512(int angle) 28 | { 29 | if (angle < 0) 30 | angle = 0x200 - angle; 31 | angle &= 0x1FF; 32 | return sin512LookupTable[angle]; 33 | } 34 | 35 | inline int Cos512(int angle) 36 | { 37 | if (angle < 0) 38 | angle = 0x200 - angle; 39 | angle &= 0x1FF; 40 | return cos512LookupTable[angle]; 41 | } 42 | 43 | inline int Sin256(int angle) 44 | { 45 | if (angle < 0) 46 | angle = 0x100 - angle; 47 | angle &= 0xFFu; 48 | return sin256LookupTable[angle]; 49 | } 50 | 51 | inline int Cos256(int angle) 52 | { 53 | if (angle < 0) 54 | angle = 0x100 - angle; 55 | angle &= 0xFFu; 56 | return cos256LookupTable[angle]; 57 | } 58 | 59 | // Get Arc Tan value 60 | byte ArcTanLookup(int X, int Y); 61 | 62 | #endif // !MATH_H 63 | -------------------------------------------------------------------------------- /RSDKv3/ModAPI.hpp: -------------------------------------------------------------------------------- 1 | #ifndef MOD_API_H 2 | #define MOD_API_H 3 | 4 | #if RETRO_USE_MOD_LOADER 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #define PLAYERNAME_COUNT (0x10) 11 | 12 | struct ModInfo { 13 | std::string name; 14 | std::string desc; 15 | std::string author; 16 | std::string version; 17 | std::map fileMap; 18 | std::string folder; 19 | bool useScripts; 20 | int disableFocusPause; 21 | bool redirectSave; 22 | bool disableSaveIniOverride; 23 | std::string savePath; 24 | bool active; 25 | }; 26 | 27 | extern std::vector modList; 28 | extern int activeMod; 29 | 30 | extern char modsPath[0x100]; 31 | 32 | extern bool redirectSave; 33 | extern bool disableSaveIniOverride; 34 | 35 | extern char modTypeNames[OBJECT_COUNT][0x40]; 36 | extern char modScriptPaths[OBJECT_COUNT][0x40]; 37 | extern byte modScriptFlags[OBJECT_COUNT]; 38 | extern byte modObjCount; 39 | 40 | extern char playerNames[PLAYERNAME_COUNT][0x20]; 41 | extern byte playerCount; 42 | 43 | inline void SetActiveMod(int id) { activeMod = id; } 44 | 45 | void InitMods(); 46 | bool LoadMod(ModInfo *info, std::string modsPath, std::string folder, bool active); 47 | void ScanModFolder(ModInfo *info); 48 | void SaveMods(); 49 | 50 | int OpenModMenu(); 51 | 52 | void RefreshEngine(); 53 | 54 | #endif 55 | 56 | #if RETRO_USE_MOD_LOADER || !RETRO_USE_ORIGINAL_CODE 57 | extern char savePath[0x100]; 58 | int GetSceneID(byte listID, const char *sceneName); 59 | #endif 60 | 61 | #endif -------------------------------------------------------------------------------- /RSDKv3/Object.cpp: -------------------------------------------------------------------------------- 1 | #include "RetroEngine.hpp" 2 | 3 | int objectLoop = 0; 4 | int curObjectType = 0; 5 | Entity objectEntityList[ENTITY_COUNT]; 6 | 7 | char typeNames[OBJECT_COUNT][0x40]; 8 | 9 | int OBJECT_BORDER_X1 = 0x80; 10 | int OBJECT_BORDER_X2 = 0; 11 | const int OBJECT_BORDER_Y1 = 0x100; 12 | const int OBJECT_BORDER_Y2 = SCREEN_YSIZE + 0x100; 13 | 14 | void SetObjectTypeName(const char *objectName, int objectID) 15 | { 16 | int objNameID = 0; 17 | int typeNameID = 0; 18 | while (objectName[objNameID]) { 19 | if (objectName[objNameID] != ' ') 20 | typeNames[objectID][typeNameID++] = objectName[objNameID]; 21 | ++objNameID; 22 | } 23 | typeNames[objectID][typeNameID] = 0; 24 | PrintLog("Set Object (%d) name to: %s", objectID, objectName); 25 | } 26 | 27 | void ProcessStartupObjects() 28 | { 29 | scriptFrameCount = 0; 30 | ClearAnimationData(); 31 | activePlayer = 0; 32 | activePlayerCount = 1; 33 | scriptEng.arrayPosition[2] = TEMPENTITY_START; 34 | Entity *entity = &objectEntityList[TEMPENTITY_START]; 35 | for (int i = 0; i < OBJECT_COUNT; ++i) { 36 | ObjectScript *scriptInfo = &objectScriptList[i]; 37 | objectLoop = TEMPENTITY_START; 38 | curObjectType = i; 39 | scriptInfo->frameListOffset = scriptFrameCount; 40 | scriptInfo->spriteSheetID = 0; 41 | entity->type = i; 42 | if (scriptCode[scriptInfo->subStartup.scriptCodePtr] > 0) 43 | ProcessScript(scriptInfo->subStartup.scriptCodePtr, scriptInfo->subStartup.jumpTablePtr, SUB_SETUP); 44 | scriptInfo->frameCount = scriptFrameCount - scriptInfo->frameListOffset; 45 | } 46 | entity->type = 0; 47 | curObjectType = 0; 48 | } 49 | 50 | void ProcessObjects() 51 | { 52 | for (int i = 0; i < DRAWLAYER_COUNT; ++i) drawListEntries[i].listSize = 0; 53 | 54 | for (objectLoop = 0; objectLoop < ENTITY_COUNT; ++objectLoop) { 55 | bool active = false; 56 | int x = 0, y = 0; 57 | Entity *entity = &objectEntityList[objectLoop]; 58 | switch (entity->priority) { 59 | case PRIORITY_BOUNDS: 60 | x = entity->XPos >> 16; 61 | y = entity->YPos >> 16; 62 | active = x > xScrollOffset - OBJECT_BORDER_X1 && x < OBJECT_BORDER_X2 + xScrollOffset && y > yScrollOffset - OBJECT_BORDER_Y1 63 | && y < yScrollOffset + OBJECT_BORDER_Y2; 64 | break; 65 | 66 | case PRIORITY_ACTIVE: 67 | case PRIORITY_ALWAYS: active = true; break; 68 | 69 | case PRIORITY_XBOUNDS: 70 | x = entity->XPos >> 16; 71 | active = x > xScrollOffset - OBJECT_BORDER_X1 && x < OBJECT_BORDER_X2 + xScrollOffset; 72 | break; 73 | 74 | case PRIORITY_BOUNDS_DESTROY: 75 | x = entity->XPos >> 16; 76 | y = entity->YPos >> 16; 77 | if (x <= xScrollOffset - OBJECT_BORDER_X1 || x >= OBJECT_BORDER_X2 + xScrollOffset || y <= yScrollOffset - OBJECT_BORDER_Y1 78 | || y >= yScrollOffset + OBJECT_BORDER_Y2) { 79 | active = false; 80 | entity->type = OBJ_TYPE_BLANKOBJECT; 81 | } 82 | else { 83 | active = true; 84 | } 85 | break; 86 | 87 | case PRIORITY_INACTIVE: active = false; break; 88 | 89 | default: break; 90 | } 91 | 92 | if (active && entity->type > OBJ_TYPE_BLANKOBJECT) { 93 | ObjectScript *scriptInfo = &objectScriptList[entity->type]; 94 | activePlayer = 0; 95 | if (scriptCode[scriptInfo->subMain.scriptCodePtr] > 0) 96 | ProcessScript(scriptInfo->subMain.scriptCodePtr, scriptInfo->subMain.jumpTablePtr, SUB_MAIN); 97 | if (scriptCode[scriptInfo->subPlayerInteraction.scriptCodePtr] > 0) { 98 | while (activePlayer < activePlayerCount) { 99 | if (playerList[activePlayer].objectInteractions) 100 | ProcessScript(scriptInfo->subPlayerInteraction.scriptCodePtr, scriptInfo->subPlayerInteraction.jumpTablePtr, 101 | SUB_PLAYERINTERACTION); 102 | ++activePlayer; 103 | } 104 | } 105 | 106 | if (entity->drawOrder < DRAWLAYER_COUNT) 107 | drawListEntries[entity->drawOrder].entityRefs[drawListEntries[entity->drawOrder].listSize++] = objectLoop; 108 | } 109 | } 110 | } 111 | 112 | void ProcessPausedObjects() 113 | { 114 | for (int i = 0; i < DRAWLAYER_COUNT; ++i) drawListEntries[i].listSize = 0; 115 | 116 | for (objectLoop = 0; objectLoop < ENTITY_COUNT; ++objectLoop) { 117 | Entity *entity = &objectEntityList[objectLoop]; 118 | 119 | if (entity->priority == PRIORITY_ALWAYS && entity->type > OBJ_TYPE_BLANKOBJECT) { 120 | ObjectScript *scriptInfo = &objectScriptList[entity->type]; 121 | activePlayer = 0; 122 | if (scriptCode[scriptInfo->subMain.scriptCodePtr] > 0) 123 | ProcessScript(scriptInfo->subMain.scriptCodePtr, scriptInfo->subMain.jumpTablePtr, SUB_MAIN); 124 | if (scriptCode[scriptInfo->subPlayerInteraction.scriptCodePtr] > 0) { 125 | while (activePlayer < PLAYER_COUNT) { 126 | if (playerList[activePlayer].objectInteractions) 127 | ProcessScript(scriptInfo->subPlayerInteraction.scriptCodePtr, scriptInfo->subPlayerInteraction.jumpTablePtr, 128 | SUB_PLAYERINTERACTION); 129 | ++activePlayer; 130 | } 131 | } 132 | 133 | if (entity->drawOrder < DRAWLAYER_COUNT) 134 | drawListEntries[entity->drawOrder].entityRefs[drawListEntries[entity->drawOrder].listSize++] = objectLoop; 135 | } 136 | } 137 | } -------------------------------------------------------------------------------- /RSDKv3/Object.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OBJECT_H 2 | #define OBJECT_H 3 | 4 | #define ENTITY_COUNT (0x4A0) 5 | #define TEMPENTITY_START (ENTITY_COUNT - 0x80) 6 | #define OBJECT_COUNT (0x100) 7 | 8 | struct Entity { 9 | int XPos; 10 | int YPos; 11 | int values[8]; 12 | int scale; 13 | int rotation; 14 | int animationTimer; 15 | int animationSpeed; 16 | byte type; 17 | byte propertyValue; 18 | byte state; 19 | byte priority; 20 | byte drawOrder; 21 | byte direction; 22 | byte inkEffect; 23 | byte alpha; 24 | byte animation; 25 | byte prevAnimation; 26 | byte frame; 27 | }; 28 | 29 | enum ObjectTypes { 30 | OBJ_TYPE_BLANKOBJECT = 0 // 0 is always blank obj 31 | }; 32 | 33 | enum ObjectPriority { 34 | // The entity is active if the entity is on screen or within 128 pixels of the screen borders on any axis 35 | PRIORITY_BOUNDS, 36 | // The entity is always active, unless the stage state is PAUSED or FROZEN 37 | PRIORITY_ACTIVE, 38 | // Same as PRIORITY_ACTIVE, the entity even runs when the stage state is PAUSED or FROZEN 39 | PRIORITY_ALWAYS, 40 | // Same as PRIORITY_BOUNDS, however it only does checks on the x-axis, so when in bounds on the x-axis, the y position doesn't matter 41 | PRIORITY_XBOUNDS, 42 | // Same as PRIORITY_BOUNDS, however the entity's type will be set to BLANK OBJECT when it becomes inactive 43 | PRIORITY_BOUNDS_DESTROY, 44 | // Never Active. 45 | PRIORITY_INACTIVE, 46 | }; 47 | 48 | extern int objectLoop; 49 | extern int curObjectType; 50 | extern Entity objectEntityList[ENTITY_COUNT]; 51 | 52 | extern char typeNames[OBJECT_COUNT][0x40]; 53 | 54 | extern int OBJECT_BORDER_X1; 55 | extern int OBJECT_BORDER_X2; 56 | extern const int OBJECT_BORDER_Y1; 57 | extern const int OBJECT_BORDER_Y2; 58 | 59 | void ProcessStartupObjects(); 60 | void ProcessObjects(); 61 | void ProcessPausedObjects(); 62 | 63 | void SetObjectTypeName(const char *objectName, int objectID); 64 | 65 | #endif // !OBJECT_H 66 | -------------------------------------------------------------------------------- /RSDKv3/Palette.cpp: -------------------------------------------------------------------------------- 1 | #include "RetroEngine.hpp" 2 | 3 | // Palettes (as RGB888 Colours) 4 | PaletteEntry fullPalette32[PALETTE_COUNT][PALETTE_SIZE]; 5 | PaletteEntry *activePalette32 = fullPalette32[0]; 6 | 7 | // Palettes (as RGB565 Colours) 8 | ushort fullPalette[PALETTE_COUNT][PALETTE_SIZE]; 9 | ushort *activePalette = fullPalette[0]; // Ptr to the 256 colour set thats active 10 | 11 | byte gfxLineBuffer[SCREEN_YSIZE]; // Pointers to active palette 12 | int GFX_LINESIZE; 13 | int GFX_LINESIZE_MINUSONE; 14 | int GFX_LINESIZE_DOUBLE; 15 | int GFX_FRAMEBUFFERSIZE; 16 | int GFX_FBUFFERMINUSONE; 17 | 18 | int fadeMode = 0; 19 | byte fadeA = 0; 20 | byte fadeR = 0; 21 | byte fadeG = 0; 22 | byte fadeB = 0; 23 | 24 | int paletteMode = 0; 25 | 26 | int texPaletteNum = 0; 27 | 28 | uint gfxPalette16to32[0x10000]; 29 | 30 | void LoadPalette(const char *filePath, int paletteID, int startPaletteIndex, int startIndex, int endIndex) 31 | { 32 | FileInfo info; 33 | char fullPath[0x80]; 34 | 35 | StrCopy(fullPath, "Data/Palettes/"); 36 | StrAdd(fullPath, filePath); 37 | 38 | if (LoadFile(fullPath, &info)) { 39 | SetFilePosition(3 * startIndex); 40 | if (paletteID >= PALETTE_COUNT || paletteID < 0) 41 | paletteID = 0; 42 | 43 | byte colour[3]; 44 | if (paletteID) { 45 | for (int i = startIndex; i < endIndex; ++i) { 46 | FileRead(&colour, 3); 47 | SetPaletteEntry(paletteID, startPaletteIndex++, colour[0], colour[1], colour[2]); 48 | } 49 | } 50 | else { 51 | for (int i = startIndex; i < endIndex; ++i) { 52 | FileRead(&colour, 3); 53 | SetPaletteEntry(-1, startPaletteIndex++, colour[0], colour[1], colour[2]); 54 | } 55 | } 56 | CloseFile(); 57 | } 58 | } 59 | 60 | void SetLimitedFade(byte paletteID, byte R, byte G, byte B, ushort alpha, int startIndex, int endIndex) 61 | { 62 | if (paletteID >= PALETTE_COUNT) 63 | return; 64 | paletteMode = 1; 65 | activePalette = fullPalette[paletteID]; 66 | activePalette32 = fullPalette32[paletteID]; 67 | 68 | if (alpha >= 0x100) 69 | alpha = 0xFF; 70 | 71 | if (startIndex >= endIndex) 72 | return; 73 | 74 | uint alpha2 = 0xFF - alpha; 75 | for (int i = startIndex; i < endIndex; ++i) { 76 | PACK_RGB888(activePalette[i], (byte)((ushort)(R * alpha + alpha2 * activePalette32[i].r) >> 8), 77 | (byte)((ushort)(G * alpha + alpha2 * activePalette32[i].g) >> 8), 78 | (byte)((ushort)(B * alpha + alpha2 * activePalette32[i].b) >> 8)); 79 | activePalette32[i].r = (byte)((ushort)(R * alpha + alpha2 * activePalette32[i].r) >> 8); 80 | activePalette32[i].g = (byte)((ushort)(G * alpha + alpha2 * activePalette32[i].g) >> 8); 81 | activePalette32[i].b = (byte)((ushort)(B * alpha + alpha2 * activePalette32[i].b) >> 8); 82 | if (renderType == RENDER_HW) 83 | activePalette[i] |= 1; 84 | } 85 | } -------------------------------------------------------------------------------- /RSDKv3/Palette.hpp: -------------------------------------------------------------------------------- 1 | #ifndef PALETTE_H 2 | #define PALETTE_H 3 | 4 | #define PALETTE_COUNT (0x8) 5 | #define PALETTE_SIZE (0x100) 6 | 7 | struct Colour { 8 | byte r; 9 | byte g; 10 | byte b; 11 | byte a; 12 | }; 13 | 14 | struct PaletteEntry { 15 | byte r; 16 | byte g; 17 | byte b; 18 | }; 19 | 20 | // Palettes (as RGB565 Colours) 21 | extern PaletteEntry fullPalette32[PALETTE_COUNT][PALETTE_SIZE]; 22 | extern ushort fullPalette[PALETTE_COUNT][PALETTE_SIZE]; 23 | extern ushort *activePalette; // Ptr to the 256 colour set thats active 24 | extern PaletteEntry *activePalette32; 25 | 26 | extern byte gfxLineBuffer[SCREEN_YSIZE]; // Pointers to active palette 27 | extern int GFX_LINESIZE; 28 | extern int GFX_LINESIZE_MINUSONE; 29 | extern int GFX_LINESIZE_DOUBLE; 30 | extern int GFX_FRAMEBUFFERSIZE; 31 | extern int GFX_FBUFFERMINUSONE; 32 | 33 | extern int fadeMode; 34 | extern byte fadeA; 35 | extern byte fadeR; 36 | extern byte fadeG; 37 | extern byte fadeB; 38 | 39 | extern int paletteMode; 40 | 41 | extern int texPaletteNum; 42 | 43 | extern uint gfxPalette16to32[0x10000]; 44 | 45 | #define RGB888_TO_RGB5551(r, g, b) ((((b) >> 3) << 1) | (((g) >> 3) << 6) | (((r) >> 3) << 11) | 0) // used in mobile vers 46 | #define RGB888_TO_RGB565(r, g, b) ((b) >> 3) | (((g) >> 2) << 5) | (((r) >> 3) << 11) // used in pc vers 47 | 48 | #define PACK_RGB888(colour, r, g, b) \ 49 | if (renderType == RENDER_SW) \ 50 | colour = RGB888_TO_RGB565(r, g, b); \ 51 | else if (renderType == RENDER_HW) \ 52 | colour = RGB888_TO_RGB5551(r, g, b); 53 | 54 | void LoadPalette(const char *filePath, int paletteID, int startPaletteIndex, int startIndex, int endIndex); 55 | 56 | inline void SetActivePalette(byte newActivePal, int startLine, int endLine) 57 | { 58 | if (renderType == RENDER_SW) { 59 | if (newActivePal < PALETTE_COUNT) 60 | for (int l = startLine; l < endLine && l < SCREEN_YSIZE; l++) gfxLineBuffer[l] = newActivePal; 61 | 62 | activePalette = fullPalette[gfxLineBuffer[0]]; 63 | activePalette32 = fullPalette32[gfxLineBuffer[0]]; 64 | } 65 | 66 | if (renderType == RENDER_HW) { 67 | if (newActivePal < PALETTE_COUNT) 68 | texPaletteNum = newActivePal; 69 | } 70 | } 71 | 72 | inline void SetPaletteEntry(byte paletteIndex, byte index, byte r, byte g, byte b) 73 | { 74 | if (paletteIndex != 0xFF) { 75 | PACK_RGB888(fullPalette[paletteIndex][index], r, g, b); 76 | fullPalette32[paletteIndex][index].r = r; 77 | fullPalette32[paletteIndex][index].g = g; 78 | fullPalette32[paletteIndex][index].b = b; 79 | 80 | if (renderType == RENDER_HW) { 81 | if (index) 82 | fullPalette[paletteIndex][index] |= 1; 83 | } 84 | } 85 | else { 86 | PACK_RGB888(activePalette[index], r, g, b); 87 | activePalette32[index].r = r; 88 | activePalette32[index].g = g; 89 | activePalette32[index].b = b; 90 | 91 | if (renderType == RENDER_HW) { 92 | if (index) 93 | activePalette[index] |= 1; 94 | } 95 | } 96 | } 97 | 98 | inline void CopyPalette(byte src, byte dest) 99 | { 100 | if (src < PALETTE_COUNT && dest < PALETTE_COUNT) { 101 | for (int i = 0; i < PALETTE_SIZE; ++i) { 102 | fullPalette[dest][i] = fullPalette[src][i]; 103 | fullPalette32[dest][i] = fullPalette32[src][i]; 104 | } 105 | } 106 | } 107 | 108 | inline void RotatePalette(byte startIndex, byte endIndex, bool right) 109 | { 110 | if (right) { 111 | ushort startClr = activePalette[endIndex]; 112 | PaletteEntry startClr32 = activePalette32[endIndex]; 113 | for (int i = endIndex; i > startIndex; --i) { 114 | activePalette[i] = activePalette[i - 1]; 115 | activePalette32[i] = activePalette32[i - 1]; 116 | } 117 | activePalette[startIndex] = startClr; 118 | activePalette32[startIndex] = startClr32; 119 | } 120 | else { 121 | ushort startClr = activePalette[startIndex]; 122 | PaletteEntry startClr32 = activePalette32[startIndex]; 123 | for (int i = startIndex; i < endIndex; ++i) { 124 | activePalette[i] = activePalette[i + 1]; 125 | activePalette32[i] = activePalette32[i + 1]; 126 | } 127 | activePalette[endIndex] = startClr; 128 | activePalette32[endIndex] = startClr32; 129 | } 130 | } 131 | 132 | inline void SetFade(byte R, byte G, byte B, ushort A) 133 | { 134 | fadeMode = 1; 135 | fadeR = R; 136 | fadeG = G; 137 | fadeB = B; 138 | fadeA = A > 0xFF ? 0xFF : A; 139 | } 140 | void SetLimitedFade(byte paletteID, byte R, byte G, byte B, ushort alpha, int startIndex, int endIndex); 141 | 142 | #endif // !PALETTE_H 143 | -------------------------------------------------------------------------------- /RSDKv3/Player.cpp: -------------------------------------------------------------------------------- 1 | #include "RetroEngine.hpp" 2 | 3 | Player playerList[PLAYER_COUNT]; 4 | int playerListPos = 0; 5 | int activePlayer = 0; 6 | int activePlayerCount = 1; 7 | 8 | ushort upBuffer = 0; 9 | ushort downBuffer = 0; 10 | ushort leftBuffer = 0; 11 | ushort rightBuffer = 0; 12 | ushort jumpPressBuffer = 0; 13 | ushort jumpHoldBuffer = 0; 14 | 15 | void ProcessPlayerControl(Player *player) 16 | { 17 | switch (player->controlMode) { 18 | default: 19 | case CONTROLMODE_NORMAL: 20 | player->up = keyDown.up; 21 | player->down = keyDown.down; 22 | if (!keyDown.left || !keyDown.right) { 23 | player->left = keyDown.left; 24 | player->right = keyDown.right; 25 | } 26 | else { 27 | player->left = false; 28 | player->right = false; 29 | } 30 | player->jumpHold = keyDown.C | keyDown.B | keyDown.A; 31 | player->jumpPress = keyPress.C | keyPress.B | keyPress.A; 32 | upBuffer <<= 1; 33 | upBuffer |= (byte)player->up; 34 | downBuffer <<= 1; 35 | downBuffer |= (byte)player->down; 36 | leftBuffer <<= 1; 37 | leftBuffer |= (byte)player->left; 38 | rightBuffer <<= 1; 39 | rightBuffer |= (byte)player->right; 40 | jumpPressBuffer <<= 1; 41 | jumpPressBuffer |= (byte)player->jumpPress; 42 | jumpHoldBuffer <<= 1; 43 | jumpHoldBuffer |= (byte)player->jumpHold; 44 | break; 45 | 46 | case CONTROLMODE_NONE: 47 | upBuffer <<= 1; 48 | upBuffer |= (byte)player->up; 49 | downBuffer <<= 1; 50 | downBuffer |= (byte)player->down; 51 | leftBuffer <<= 1; 52 | leftBuffer |= (byte)player->left; 53 | rightBuffer <<= 1; 54 | rightBuffer |= (byte)player->right; 55 | jumpPressBuffer <<= 1; 56 | jumpPressBuffer |= (byte)player->jumpPress; 57 | jumpHoldBuffer <<= 1; 58 | jumpHoldBuffer |= (byte)player->jumpHold; 59 | break; 60 | 61 | case CONTROLMODE_SIDEKICK: 62 | player->up = upBuffer >> 15; 63 | player->down = downBuffer >> 15; 64 | player->left = leftBuffer >> 15; 65 | player->right = rightBuffer >> 15; 66 | player->jumpPress = jumpPressBuffer >> 15; 67 | player->jumpHold = jumpHoldBuffer >> 15; 68 | break; 69 | } 70 | } -------------------------------------------------------------------------------- /RSDKv3/Player.hpp: -------------------------------------------------------------------------------- 1 | #ifndef PLAYER_H 2 | #define PLAYER_H 3 | 4 | #define PLAYER_COUNT (2) 5 | 6 | enum PlayerControlModes { 7 | CONTROLMODE_NONE = -1, 8 | CONTROLMODE_NORMAL = 0, 9 | CONTROLMODE_SIDEKICK = 1, 10 | }; 11 | 12 | struct Player { 13 | int entityNo; 14 | int XPos; 15 | int YPos; 16 | int XVelocity; 17 | int YVelocity; 18 | int speed; 19 | int screenXPos; 20 | int screenYPos; 21 | int angle; 22 | int timer; 23 | int lookPos; 24 | int values[8]; 25 | byte collisionMode; 26 | byte skidding; 27 | byte pushing; 28 | byte collisionPlane; 29 | sbyte controlMode; 30 | byte controlLock; 31 | int topSpeed; 32 | int acceleration; 33 | int deceleration; 34 | int airAcceleration; 35 | int airDeceleration; 36 | int gravityStrength; 37 | int jumpStrength; 38 | int jumpCap; 39 | int rollingAcceleration; 40 | int rollingDeceleration; 41 | byte visible; 42 | byte tileCollisions; 43 | byte objectInteractions; 44 | byte left; 45 | byte right; 46 | byte up; 47 | byte down; 48 | byte jumpPress; 49 | byte jumpHold; 50 | byte followPlayer1; 51 | byte trackScroll; 52 | byte gravity; 53 | byte water; 54 | byte flailing[3]; 55 | AnimationFile *animationFile; 56 | Entity *boundEntity; 57 | }; 58 | 59 | extern Player playerList[PLAYER_COUNT]; 60 | extern int playerListPos; 61 | extern int activePlayer; 62 | extern int activePlayerCount; 63 | 64 | extern ushort upBuffer; 65 | extern ushort downBuffer; 66 | extern ushort leftBuffer; 67 | extern ushort rightBuffer; 68 | extern ushort jumpPressBuffer; 69 | extern ushort jumpHoldBuffer; 70 | 71 | void ProcessPlayerControl(Player *player); 72 | 73 | #endif // !PLAYER_H 74 | -------------------------------------------------------------------------------- /RSDKv3/RSDKv3 Decomp Icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SonicMastr/Sonic-CD-Vita/525b0e6035e4b10135cd043e479c96b1f937b9a9/RSDKv3/RSDKv3 Decomp Icon.ico -------------------------------------------------------------------------------- /RSDKv3/RSDKv3.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #include "resource.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | #include "winres.h" 11 | 12 | ///////////////////////////////////////////////////////////////////////////// 13 | #undef APSTUDIO_READONLY_SYMBOLS 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // English (United Kingdom) resources 17 | 18 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG) 19 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK 20 | #pragma code_page(1252) 21 | 22 | #ifdef APSTUDIO_INVOKED 23 | ///////////////////////////////////////////////////////////////////////////// 24 | // 25 | // TEXTINCLUDE 26 | // 27 | 28 | 1 TEXTINCLUDE 29 | BEGIN 30 | "resource.h\0" 31 | END 32 | 33 | 2 TEXTINCLUDE 34 | BEGIN 35 | "#include ""winres.h""\r\n" 36 | "\0" 37 | END 38 | 39 | 3 TEXTINCLUDE 40 | BEGIN 41 | "\r\n" 42 | "\0" 43 | END 44 | 45 | #endif // APSTUDIO_INVOKED 46 | 47 | #endif // English (United Kingdom) resources 48 | ///////////////////////////////////////////////////////////////////////////// 49 | 50 | 51 | ///////////////////////////////////////////////////////////////////////////// 52 | // English (Australia) resources 53 | 54 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENA) 55 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_AUS 56 | #pragma code_page(1252) 57 | 58 | ///////////////////////////////////////////////////////////////////////////// 59 | // 60 | // Version 61 | // 62 | 63 | VS_VERSION_INFO VERSIONINFO 64 | FILEVERSION 1,0,0,0 65 | PRODUCTVERSION 1,0,0,0 66 | FILEFLAGSMASK 0x3fL 67 | #ifdef _DEBUG 68 | FILEFLAGS 0x1L 69 | #else 70 | FILEFLAGS 0x0L 71 | #endif 72 | FILEOS 0x40004L 73 | FILETYPE 0x1L 74 | FILESUBTYPE 0x0L 75 | BEGIN 76 | BLOCK "StringFileInfo" 77 | BEGIN 78 | BLOCK "0c0904b0" 79 | BEGIN 80 | VALUE "CompanyName", "RSDKv3/Sonic CD (2011) By Christian 'The Taxman' Whitehead, Decompilation by Rubberduckycooly" 81 | VALUE "FileDescription", "RSDKv3" 82 | VALUE "FileVersion", "1.0.0" 83 | VALUE "InternalName", "RSDKv3.exe" 84 | VALUE "OriginalFilename", "RSDKv3.exe" 85 | VALUE "ProductName", "RSDKv3" 86 | VALUE "ProductVersion", "1.0.0" 87 | END 88 | END 89 | BLOCK "VarFileInfo" 90 | BEGIN 91 | VALUE "Translation", 0xc09, 1200 92 | END 93 | END 94 | 95 | 96 | ///////////////////////////////////////////////////////////////////////////// 97 | // 98 | // Icon 99 | // 100 | 101 | // Icon with lowest ID value placed first to ensure application icon 102 | // remains consistent on all systems. 103 | IDI_ICON1 ICON "RSDKv3 Decomp Icon.ico" 104 | 105 | #endif // English (Australia) resources 106 | ///////////////////////////////////////////////////////////////////////////// 107 | 108 | 109 | 110 | #ifndef APSTUDIO_INVOKED 111 | ///////////////////////////////////////////////////////////////////////////// 112 | // 113 | // Generated from the TEXTINCLUDE 3 resource. 114 | // 115 | 116 | 117 | ///////////////////////////////////////////////////////////////////////////// 118 | #endif // not APSTUDIO_INVOKED 119 | 120 | -------------------------------------------------------------------------------- /RSDKv3/RSDKv3SDL1.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | {bda859b2-1d03-47c3-acf5-677bf22c1541} 18 | 19 | 20 | {53c7d13e-21a9-454c-8d5d-8576328532f8} 21 | 22 | 23 | {508c825f-9a6b-4ced-8588-bfa55ba16df8} 24 | 25 | 26 | 27 | 28 | Header Files 29 | 30 | 31 | Header Files\theoraPlay 32 | 33 | 34 | Header Files\theoraPlay 35 | 36 | 37 | Header Files 38 | 39 | 40 | Header Files 41 | 42 | 43 | Header Files 44 | 45 | 46 | Header Files 47 | 48 | 49 | Header Files 50 | 51 | 52 | Header Files 53 | 54 | 55 | Header Files 56 | 57 | 58 | Header Files 59 | 60 | 61 | Header Files 62 | 63 | 64 | Header Files 65 | 66 | 67 | Header Files 68 | 69 | 70 | Header Files 71 | 72 | 73 | Header Files 74 | 75 | 76 | Header Files 77 | 78 | 79 | Header Files 80 | 81 | 82 | Header Files 83 | 84 | 85 | Header Files 86 | 87 | 88 | Header Files 89 | 90 | 91 | Header Files 92 | 93 | 94 | Header Files 95 | 96 | 97 | Header Files 98 | 99 | 100 | Header Files\vdf_parser 101 | 102 | 103 | 104 | 105 | Source Files 106 | 107 | 108 | Source Files 109 | 110 | 111 | Source Files 112 | 113 | 114 | Source Files 115 | 116 | 117 | Source Files 118 | 119 | 120 | Source Files 121 | 122 | 123 | Source Files 124 | 125 | 126 | Source Files 127 | 128 | 129 | Source Files 130 | 131 | 132 | Source Files 133 | 134 | 135 | Source Files 136 | 137 | 138 | Source Files 139 | 140 | 141 | Source Files 142 | 143 | 144 | Source Files 145 | 146 | 147 | Source Files 148 | 149 | 150 | Source Files 151 | 152 | 153 | Source Files 154 | 155 | 156 | Source Files 157 | 158 | 159 | Source Files 160 | 161 | 162 | Source Files 163 | 164 | 165 | Source Files\theoraPlay 166 | 167 | 168 | Source Files 169 | 170 | 171 | Source Files 172 | 173 | 174 | 175 | 176 | Resource Files 177 | 178 | 179 | 180 | 181 | Resource Files 182 | 183 | 184 | -------------------------------------------------------------------------------- /RSDKv3/Reader.hpp: -------------------------------------------------------------------------------- 1 | #ifndef READER_H 2 | #define READER_H 3 | 4 | #ifdef FORCE_CASE_INSENSITIVE 5 | 6 | #include "fcaseopen.h" 7 | #define FileIO FILE 8 | #define fOpen(path, mode) fcaseopen(path, mode) 9 | #define fRead(buffer, elementSize, elementCount, file) fread(buffer, elementSize, elementCount, file) 10 | #define fSeek(file, offset, whence) fseek(file, offset, whence) 11 | #define fTell(file) ftell(file) 12 | #define fClose(file) fclose(file) 13 | #define fWrite(buffer, elementSize, elementCount, file) fwrite(buffer, elementSize, elementCount, file) 14 | 15 | #else 16 | 17 | #if RETRO_USING_SDL2 18 | #define FileIO SDL_RWops 19 | #define fOpen(path, mode) SDL_RWFromFile(path, mode) 20 | #define fRead(buffer, elementSize, elementCount, file) SDL_RWread(file, buffer, elementSize, elementCount) 21 | #define fSeek(file, offset, whence) SDL_RWseek(file, offset, whence) 22 | #define fTell(file) SDL_RWtell(file) 23 | #define fClose(file) SDL_RWclose(file) 24 | #define fWrite(buffer, elementSize, elementCount, file) SDL_RWwrite(file, buffer, elementSize, elementCount) 25 | #else 26 | #define FileIO FILE 27 | #define fOpen(path, mode) fopen(path, mode) 28 | #define fRead(buffer, elementSize, elementCount, file) fread(buffer, elementSize, elementCount, file) 29 | #define fSeek(file, offset, whence) fseek(file, offset, whence) 30 | #define fTell(file) ftell(file) 31 | #define fClose(file) fclose(file) 32 | #define fWrite(buffer, elementSize, elementCount, file) fwrite(buffer, elementSize, elementCount, file) 33 | #endif 34 | 35 | #endif 36 | 37 | struct FileInfo { 38 | char fileName[0x100]; 39 | int fileSize; 40 | int vFileSize; 41 | int readPos; 42 | int bufferPosition; 43 | int virtualFileOffset; 44 | byte eStringPosA; 45 | byte eStringPosB; 46 | byte eStringNo; 47 | byte eNybbleSwap; 48 | FileIO *cFileHandle; 49 | byte *fileBuffer; 50 | #if RETRO_USE_MOD_LOADER 51 | byte isMod; 52 | #endif 53 | }; 54 | 55 | extern char rsdkName[0x400]; 56 | 57 | extern char fileName[0x100]; 58 | extern byte fileBuffer[0x2000]; 59 | extern int fileSize; 60 | extern int vFileSize; 61 | extern int readPos; 62 | extern int readSize; 63 | extern int bufferPosition; 64 | extern int virtualFileOffset; 65 | extern byte eStringPosA; 66 | extern byte eStringPosB; 67 | extern byte eStringNo; 68 | extern byte eNybbleSwap; 69 | extern char encryptionStringA[21]; 70 | extern char encryptionStringB[13]; 71 | #if RETRO_USE_MOD_LOADER 72 | extern byte isModdedFile; 73 | #endif 74 | 75 | extern FileIO *cFileHandle; 76 | 77 | inline void CopyFilePath(char *dest, const char *src) 78 | { 79 | strcpy(dest, src); 80 | for (int i = 0;; ++i) { 81 | if (i >= strlen(dest)) { 82 | break; 83 | } 84 | 85 | if (dest[i] == '/') 86 | dest[i] = '\\'; 87 | } 88 | } 89 | bool CheckRSDKFile(const char *filePath); 90 | 91 | bool LoadFile(const char *filePath, FileInfo *fileInfo); 92 | inline bool CloseFile() 93 | { 94 | int result = 0; 95 | if (cFileHandle) 96 | result = fClose(cFileHandle); 97 | 98 | cFileHandle = NULL; 99 | return result; 100 | } 101 | 102 | void FileRead(void *dest, int size); 103 | 104 | bool ParseVirtualFileSystem(FileInfo *fileInfo); 105 | 106 | inline size_t FillFileBuffer() 107 | { 108 | if (readPos + 0x2000 <= fileSize) 109 | readSize = 0x2000; 110 | else 111 | readSize = fileSize - readPos; 112 | 113 | size_t result = fRead(fileBuffer, 1, readSize, cFileHandle); 114 | readPos += readSize; 115 | bufferPosition = 0; 116 | return result; 117 | } 118 | 119 | inline void GetFileInfo(FileInfo *fileInfo) 120 | { 121 | StrCopy(fileInfo->fileName, fileName); 122 | fileInfo->bufferPosition = bufferPosition; 123 | fileInfo->readPos = readPos - readSize; 124 | fileInfo->fileSize = fileSize; 125 | fileInfo->vFileSize = vFileSize; 126 | fileInfo->virtualFileOffset = virtualFileOffset; 127 | fileInfo->eStringPosA = eStringPosA; 128 | fileInfo->eStringPosB = eStringPosB; 129 | fileInfo->eStringNo = eStringNo; 130 | fileInfo->eNybbleSwap = eNybbleSwap; 131 | #if RETRO_USE_MOD_LOADER 132 | fileInfo->isMod = isModdedFile; 133 | #endif 134 | } 135 | void SetFileInfo(FileInfo *fileInfo); 136 | size_t GetFilePosition(); 137 | void SetFilePosition(int newPos); 138 | bool ReachedEndOfFile(); 139 | 140 | #endif // !READER_H 141 | -------------------------------------------------------------------------------- /RSDKv3/Scene3D.hpp: -------------------------------------------------------------------------------- 1 | #ifndef DRAWING3D_H 2 | #define DRAWING3D_H 3 | 4 | #define VERTEXBUFFER_SIZE (0x1000) 5 | #define FACEBUFFER_SIZE (0x400) 6 | 7 | enum FaceFlags { 8 | FACE_FLAG_TEXTURED_3D = 0, 9 | FACE_FLAG_TEXTURED_2D = 1, 10 | FACE_FLAG_COLOURED_3D = 2, 11 | FACE_FLAG_COLOURED_2D = 3, 12 | }; 13 | 14 | enum MatrixTypes { 15 | MAT_WORLD = 0, 16 | MAT_VIEW = 1, 17 | MAT_TEMP = 2, 18 | }; 19 | 20 | struct Matrix { 21 | int values[4][4]; 22 | }; 23 | 24 | struct Vertex { 25 | int x; 26 | int y; 27 | int z; 28 | int u; 29 | int v; 30 | }; 31 | 32 | struct Face { 33 | int a; 34 | int b; 35 | int c; 36 | int d; 37 | int colour; 38 | int flags; 39 | }; 40 | 41 | struct DrawListEntry3D { 42 | int faceID; 43 | int depth; 44 | }; 45 | 46 | extern int vertexCount; 47 | extern int faceCount; 48 | 49 | extern Matrix matFinal; 50 | extern Matrix matWorld; 51 | extern Matrix matView; 52 | extern Matrix matTemp; 53 | 54 | extern Face faceBuffer[FACEBUFFER_SIZE]; 55 | extern Vertex vertexBuffer[VERTEXBUFFER_SIZE]; 56 | extern Vertex vertexBufferT[VERTEXBUFFER_SIZE]; 57 | 58 | extern DrawListEntry3D drawList3D[FACEBUFFER_SIZE]; 59 | 60 | extern int projectionX; 61 | extern int projectionY; 62 | 63 | extern int faceLineStart[SCREEN_YSIZE]; 64 | extern int faceLineEnd[SCREEN_YSIZE]; 65 | extern int faceLineStartU[SCREEN_YSIZE]; 66 | extern int faceLineEndU[SCREEN_YSIZE]; 67 | extern int faceLineStartV[SCREEN_YSIZE]; 68 | extern int faceLineEndV[SCREEN_YSIZE]; 69 | 70 | void SetIdentityMatrix(Matrix *matrix); 71 | void MatrixMultiply(Matrix *matrixA, Matrix *matrixB); 72 | void MatrixTranslateXYZ(Matrix *Matrix, int x, int y, int z); 73 | void MatrixScaleXYZ(Matrix *matrix, int scaleX, int scaleY, int scaleZ); 74 | void MatrixRotateX(Matrix *matrix, int rotationX); 75 | void MatrixRotateY(Matrix *matrix, int rotationY); 76 | void MatrixRotateZ(Matrix *matrix, int rotationZ); 77 | void MatrixRotateXYZ(Matrix *matrix, int rotationX, int rotationY, int rotationZ); 78 | void TransformVertexBuffer(); 79 | void TransformVerticies(Matrix *matrix, int startIndex, int endIndex); 80 | void Sort3DDrawList(); 81 | void Draw3DScene(int spriteSheetID); 82 | 83 | void ProcessScanEdge(Vertex *vertA, Vertex *vertB); 84 | void ProcessScanEdgeUV(Vertex *vertA, Vertex *vertB); 85 | 86 | #endif // !DRAWING3D_H 87 | -------------------------------------------------------------------------------- /RSDKv3/Script.hpp: -------------------------------------------------------------------------------- 1 | #ifndef SCRIPT_H 2 | #define SCRIPT_H 3 | 4 | #define SCRIPTDATA_COUNT (0x40000) 5 | #define JUMPTABLE_COUNT (0x4000) 6 | #define FUNCTION_COUNT (0x200) 7 | 8 | #define JUMPSTACK_COUNT (0x400) 9 | #define FUNCSTACK_COUNT (0x400) 10 | 11 | #define RETRO_USE_COMPILER (1) 12 | 13 | struct ScriptPtr { 14 | int scriptCodePtr; 15 | int jumpTablePtr; 16 | }; 17 | 18 | struct ScriptFunction { 19 | #if RETRO_USE_COMPILER 20 | char name[0x20]; 21 | #endif 22 | ScriptPtr ptr; 23 | }; 24 | 25 | struct ObjectScript { 26 | int frameCount; 27 | int spriteSheetID; 28 | ScriptPtr subMain; 29 | ScriptPtr subPlayerInteraction; 30 | ScriptPtr subDraw; 31 | ScriptPtr subStartup; 32 | int frameListOffset; 33 | AnimationFile *animFile; 34 | #if !RETRO_USE_ORIGINAL_CODE 35 | bool mobile; // flag for detecting mobile/updated bytecode 36 | #endif 37 | }; 38 | 39 | struct ScriptEngine { 40 | int operands[10]; 41 | int tempValue[8]; 42 | int arrayPosition[3]; 43 | int checkResult; 44 | }; 45 | 46 | enum ScriptSubs { SUB_MAIN = 0, SUB_PLAYERINTERACTION = 1, SUB_DRAW = 2, SUB_SETUP = 3 }; 47 | 48 | extern ObjectScript objectScriptList[OBJECT_COUNT]; 49 | 50 | extern ScriptFunction scriptFunctionList[FUNCTION_COUNT]; 51 | extern int scriptFunctionCount; 52 | 53 | extern int scriptCode[SCRIPTDATA_COUNT]; 54 | extern int jumpTableData[JUMPTABLE_COUNT]; 55 | 56 | extern int jumpTableStack[JUMPSTACK_COUNT]; 57 | extern int functionStack[FUNCSTACK_COUNT]; 58 | 59 | extern int scriptCodePos; 60 | extern int scriptCodeOffset; 61 | extern int jumpTablePos; 62 | extern int jumpTableOffset; 63 | 64 | extern int jumpTableStackPos; 65 | extern int functionStackPos; 66 | 67 | extern ScriptEngine scriptEng; 68 | extern char scriptText[0x100]; 69 | 70 | 71 | extern int aliasCount; 72 | extern int lineID; 73 | 74 | bool ConvertStringToInteger(char *text, int *value); 75 | 76 | #if RETRO_USE_COMPILER 77 | 78 | void CheckAliasText(char *text); 79 | void ConvertArithmaticSyntax(char *text); 80 | void ConvertIfWhileStatement(char *text); 81 | bool ConvertSwitchStatement(char *text); 82 | void ConvertFunctionText(char *text); 83 | void CheckCaseNumber(char *text); 84 | bool ReadSwitchCase(char *text); 85 | void AppendIntegerToString(char *text, int value); 86 | void CopyAliasStr(char *dest, char *text, bool arrayIndex); 87 | bool CheckOpcodeType(char *text); // Never actually used 88 | 89 | void ParseScriptFile(char *scriptName, int scriptID); 90 | #endif 91 | void LoadBytecode(int stageListID, int scriptID); 92 | 93 | void ProcessScript(int scriptCodeStart, int jumpTableStart, byte scriptSub); 94 | 95 | void ClearScriptData(); 96 | 97 | #endif // !SCRIPT_H 98 | -------------------------------------------------------------------------------- /RSDKv3/Sprite.hpp: -------------------------------------------------------------------------------- 1 | #ifndef SPRITE_H 2 | #define SPRITE_H 3 | 4 | int AddGraphicsFile(const char *filePath); 5 | void RemoveGraphicsFile(const char *filePath, int sheetID); 6 | 7 | int LoadBMPFile(const char *filePath, byte sheetID); 8 | int LoadGIFFile(const char *filePath, byte sheetID); 9 | int LoadGFXFile(const char *filePath, byte sheetID); 10 | int LoadRSVFile(const char *filePath, byte sheetID); 11 | int LoadPVRFile(const char *filePath, byte sheetID); 12 | 13 | void ReadGifPictureData(int width, int height, bool interlaced, byte *gfxData, int offset); 14 | 15 | #endif // !SPRITE_H 16 | -------------------------------------------------------------------------------- /RSDKv3/String.cpp: -------------------------------------------------------------------------------- 1 | #include "RetroEngine.hpp" 2 | 3 | int FindStringToken(const char *string, const char *token, sbyte stopID) 4 | { 5 | int tokenCharID = 0; 6 | bool tokenMatch = true; 7 | int stringCharID = 0; 8 | int foundTokenID = 0; 9 | 10 | while (string[stringCharID]) { 11 | tokenCharID = 0; 12 | tokenMatch = true; 13 | while (token[tokenCharID]) { 14 | if (!string[tokenCharID + stringCharID]) 15 | return -1; 16 | 17 | if (string[tokenCharID + stringCharID] != token[tokenCharID]) 18 | tokenMatch = false; 19 | 20 | ++tokenCharID; 21 | } 22 | if (tokenMatch && ++foundTokenID == stopID) 23 | return stringCharID; 24 | 25 | ++stringCharID; 26 | } 27 | return -1; 28 | } -------------------------------------------------------------------------------- /RSDKv3/String.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STRING_H 2 | #define STRING_H 3 | 4 | inline void StrCopy(char *dest, const char *src) 5 | { 6 | int i = 0; 7 | 8 | for (; src[i]; ++i) dest[i] = src[i]; 9 | 10 | dest[i] = 0; 11 | } 12 | 13 | inline void StrAdd(char *dest, const char *src) 14 | { 15 | int destStrPos = 0; 16 | int srcStrPos = 0; 17 | while (dest[destStrPos]) ++destStrPos; 18 | while (true) { 19 | if (!src[srcStrPos]) { 20 | break; 21 | } 22 | dest[destStrPos++] = src[srcStrPos++]; 23 | } 24 | dest[destStrPos] = 0; 25 | } 26 | 27 | inline bool StrComp(const char *stringA, const char *stringB) 28 | { 29 | bool match = true; 30 | bool finished = false; 31 | while (!finished) { 32 | if (*stringA == *stringB || *stringA == *stringB + ' ' || *stringA == *stringB - ' ') { 33 | if (*stringA) { 34 | ++stringA; 35 | ++stringB; 36 | } 37 | else { 38 | finished = true; 39 | } 40 | } 41 | else { 42 | match = false; 43 | finished = true; 44 | } 45 | } 46 | return match; 47 | } 48 | 49 | inline int StrLength(const char *string) 50 | { 51 | int len = 0; 52 | for (len = 0; string[len]; len++) 53 | ; 54 | return len; 55 | } 56 | int FindStringToken(const char *string, const char *token, sbyte stopID); 57 | 58 | #endif // !STRING_H 59 | -------------------------------------------------------------------------------- /RSDKv3/Text.hpp: -------------------------------------------------------------------------------- 1 | #ifndef TEXTSYSTEM_H 2 | #define TEXTSYSTEM_H 3 | 4 | #define TEXTDATA_COUNT (0x2800) 5 | #define TEXTENTRY_COUNT (0x200) 6 | #define TEXTMENU_COUNT (0x2) 7 | 8 | #define FONTCHAR_COUNT (0x400) 9 | 10 | enum TextInfoTypes { TEXTINFO_TEXTDATA = 0, TEXTINFO_TEXTSIZE = 1, TEXTINFO_ROWCOUNT = 2 }; 11 | 12 | struct TextMenu { 13 | ushort textData[TEXTDATA_COUNT]; 14 | int entryStart[TEXTENTRY_COUNT]; 15 | int entrySize[TEXTENTRY_COUNT]; 16 | byte entryHighlight[TEXTENTRY_COUNT]; 17 | int textDataPos; 18 | int selection1; 19 | int selection2; 20 | ushort rowCount; 21 | ushort visibleRowCount; 22 | ushort visibleRowOffset; 23 | byte alignment; 24 | byte selectionCount; 25 | sbyte timer; 26 | }; 27 | 28 | struct FontCharacter { 29 | int id; 30 | short srcX; 31 | short srcY; 32 | short width; 33 | short height; 34 | short pivotX; 35 | short pivotY; 36 | short xAdvance; 37 | }; 38 | 39 | extern TextMenu gameMenu[TEXTMENU_COUNT]; 40 | extern int textMenuSurfaceNo; 41 | 42 | extern FontCharacter fontCharacterList[FONTCHAR_COUNT]; 43 | 44 | void LoadFontFile(const char *filePath); 45 | void LoadTextFile(TextMenu *menu, const char *filePath, byte mapCode); 46 | void LoadConfigListText(TextMenu *menu, int listNo); 47 | 48 | void SetupTextMenu(TextMenu *menu, int rowCount); 49 | void AddTextMenuEntry(TextMenu *menu, const char *text); 50 | void AddTextMenuEntryMapped(TextMenu *menu, const char *text); 51 | void SetTextMenuEntry(TextMenu *menu, const char *text, int rowID); 52 | void EditTextMenuEntry(TextMenu *menu, const char *text, int rowID); 53 | 54 | #endif // !TEXTSYSTEM_H 55 | -------------------------------------------------------------------------------- /RSDKv3/Userdata.hpp: -------------------------------------------------------------------------------- 1 | #ifndef USERDATA_H 2 | #define USERDATA_H 3 | 4 | #define GLOBALVAR_COUNT (0x100) 5 | 6 | #define ACHIEVEMENT_COUNT (0x40) 7 | #define LEADERBOARD_COUNT (0x80) 8 | 9 | #define MOD_COUNT (0x100) 10 | 11 | #define SAVEDATA_SIZE (0x2000) 12 | 13 | enum OnlineMenuTypes { 14 | ONLINEMENU_ACHIEVEMENTS = 0, 15 | ONLINEMENU_LEADERBOARDS = 1, 16 | }; 17 | 18 | struct Achievement { 19 | char name[0x40]; 20 | int status; 21 | }; 22 | 23 | struct LeaderboardEntry { 24 | int score; 25 | }; 26 | 27 | extern int globalVariablesCount; 28 | extern int globalVariables[GLOBALVAR_COUNT]; 29 | extern char globalVariableNames[GLOBALVAR_COUNT][0x20]; 30 | 31 | extern char gamePath[0x100]; 32 | extern int saveRAM[SAVEDATA_SIZE]; 33 | extern Achievement achievements[ACHIEVEMENT_COUNT]; 34 | extern LeaderboardEntry leaderboards[LEADERBOARD_COUNT]; 35 | 36 | extern int controlMode; 37 | extern bool disableTouchControls; 38 | extern int disableFocusPause; 39 | extern int disableFocusPause_Config; 40 | 41 | #if RETRO_USE_MOD_LOADER || !RETRO_USE_ORIGINAL_CODE 42 | extern bool forceUseScripts; 43 | extern bool forceUseScripts_Config; 44 | #endif 45 | 46 | inline int GetGlobalVariableByName(const char *name) 47 | { 48 | for (int v = 0; v < globalVariablesCount; ++v) { 49 | if (StrComp(name, globalVariableNames[v])) 50 | return globalVariables[v]; 51 | } 52 | return 0; 53 | } 54 | 55 | inline void SetGlobalVariableByName(const char *name, int value) 56 | { 57 | for (int v = 0; v < globalVariablesCount; ++v) { 58 | if (StrComp(name, globalVariableNames[v])) { 59 | globalVariables[v] = value; 60 | break; 61 | } 62 | } 63 | } 64 | 65 | extern bool useSGame; 66 | bool ReadSaveRAMData(); 67 | bool WriteSaveRAMData(); 68 | 69 | void InitUserdata(); 70 | void WriteSettings(); 71 | void ReadUserdata(); 72 | void WriteUserdata(); 73 | 74 | void AwardAchievement(int id, int status); 75 | void SetAchievement(int achievementID, int achievementDone); 76 | void SetLeaderboard(int leaderboardID, int result); 77 | inline void LoadAchievementsMenu() { ReadUserdata(); } 78 | inline void LoadLeaderboardsMenu() { ReadUserdata(); } 79 | 80 | #endif //! USERDATA_H 81 | -------------------------------------------------------------------------------- /RSDKv3/Video.hpp: -------------------------------------------------------------------------------- 1 | #ifndef VIDEO_H 2 | #define VIDEO_H 3 | 4 | #include "theoraplay.h" 5 | 6 | extern int currentVideoFrame; 7 | extern int videoFrameCount; 8 | extern int videoWidth; 9 | extern int videoHeight; 10 | extern float videoAR; 11 | 12 | extern THEORAPLAY_Decoder *videoDecoder; 13 | extern const THEORAPLAY_VideoFrame *videoVidData; 14 | extern const THEORAPLAY_AudioPacket *videoAudioData; 15 | extern THEORAPLAY_Io callbacks; 16 | 17 | extern byte videoSurface; 18 | extern int videoFilePos; 19 | extern int videoPlaying; // 0 = not playing, 1 = playing OGV, 2 = playing RSV 20 | extern int vidFrameMS; 21 | extern int vidBaseticks; 22 | extern float videoAR; 23 | 24 | void PlayVideoFile(char *filepath); 25 | void UpdateVideoFrame(); 26 | int ProcessVideo(); 27 | void StopVideoPlayback(); 28 | 29 | void SetupVideoBuffer(int width, int height); 30 | void CloseVideoBuffer(); 31 | 32 | #endif // !VIDEO_H 33 | -------------------------------------------------------------------------------- /RSDKv3/fcaseopen.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2009 Keith Bauer 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | */ 22 | 23 | #include "fcaseopen.h" 24 | 25 | #if !defined(_WIN32) 26 | #include 27 | #include 28 | 29 | #include 30 | #include 31 | #include 32 | 33 | // r must have strlen(path) + 2 bytes 34 | static int casepath(char const *path, char *r) 35 | { 36 | size_t l = strlen(path); 37 | char *p = (char *)alloca(l + 1); 38 | strcpy(p, path); 39 | size_t rl = 0; 40 | 41 | DIR *d; 42 | if (p[0] == '/') { 43 | d = opendir("/"); 44 | p = p + 1; 45 | } 46 | else { 47 | d = opendir("."); 48 | r[0] = '.'; 49 | r[1] = 0; 50 | rl = 1; 51 | } 52 | 53 | int last = 0; 54 | char *c = strsep(&p, "/"); 55 | while (c) { 56 | if (!d) { 57 | return 0; 58 | } 59 | 60 | if (last) { 61 | closedir(d); 62 | return 0; 63 | } 64 | 65 | r[rl] = '/'; 66 | rl += 1; 67 | r[rl] = 0; 68 | 69 | struct dirent *e = readdir(d); 70 | while (e) { 71 | if (strcasecmp(c, e->d_name) == 0) { 72 | strcpy(r + rl, e->d_name); 73 | rl += strlen(e->d_name); 74 | 75 | closedir(d); 76 | d = opendir(r); 77 | 78 | break; 79 | } 80 | 81 | e = readdir(d); 82 | } 83 | 84 | if (!e) { 85 | strcpy(r + rl, c); 86 | rl += strlen(c); 87 | last = 1; 88 | } 89 | 90 | c = strsep(&p, "/"); 91 | } 92 | 93 | if (d) 94 | closedir(d); 95 | return 1; 96 | } 97 | #endif 98 | 99 | FILE *fcaseopen(char const *path, char const *mode) 100 | { 101 | FILE *f = fopen(path, mode); 102 | #if !defined(_WIN32) 103 | if (!f) { 104 | char *r = (char *)alloca(strlen(path) + 2); 105 | if (casepath(path, r)) { 106 | f = fopen(r, mode); 107 | } 108 | } 109 | #endif 110 | return f; 111 | } 112 | 113 | void casechdir(char const *path) 114 | { 115 | #if !defined(_WIN32) 116 | char *r = (char *)alloca(strlen(path) + 2); 117 | if (casepath(path, r)) { 118 | chdir(r); 119 | } 120 | else { 121 | errno = ENOENT; 122 | } 123 | #else 124 | chdir(path); 125 | #endif 126 | } 127 | -------------------------------------------------------------------------------- /RSDKv3/fcaseopen.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2009 Keith Bauer 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | */ 22 | 23 | #ifndef fcaseopen_h 24 | #define fcaseopen_h 25 | 26 | #include 27 | 28 | #if defined(__cplusplus) 29 | extern "C" { 30 | #endif 31 | 32 | extern FILE *fcaseopen(char const *path, char const *mode); 33 | 34 | extern void casechdir(char const *path); 35 | 36 | #if defined(__cplusplus) 37 | } 38 | #endif 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /RSDKv3/main.cpp: -------------------------------------------------------------------------------- 1 | #include "RetroEngine.hpp" 2 | 3 | #if !RETRO_USE_ORIGINAL_CODE 4 | 5 | #if RETRO_PLATFORM == RETRO_WIN && _MSC_VER 6 | #include "Windows.h" 7 | #endif 8 | 9 | void parseArguments(int argc, char *argv[]) 10 | { 11 | for (int a = 0; a < argc; ++a) { 12 | const char *find = ""; 13 | 14 | find = strstr(argv[a], "stage="); 15 | if (find) { 16 | int b = 0; 17 | int c = 6; 18 | while (find[c] && find[c] != ';') Engine.startSceneFolder[b++] = find[c++]; 19 | Engine.startSceneFolder[b] = 0; 20 | } 21 | 22 | find = strstr(argv[a], "scene="); 23 | if (find) { 24 | int b = 0; 25 | int c = 6; 26 | while (find[c] && find[c] != ';') Engine.startSceneID[b++] = find[c++]; 27 | Engine.startSceneID[b] = 0; 28 | } 29 | 30 | find = strstr(argv[a], "console=true"); 31 | if (find) { 32 | engineDebugMode = true; 33 | Engine.devMenu = true; 34 | Engine.consoleEnabled = true; 35 | #if RETRO_PLATFORM == RETRO_WIN && _MSC_VER 36 | AllocConsole(); 37 | freopen_s((FILE **)stdin, "CONIN$", "w", stdin); 38 | freopen_s((FILE **)stdout, "CONOUT$", "w", stdout); 39 | freopen_s((FILE **)stderr, "CONOUT$", "w", stderr); 40 | #endif 41 | } 42 | 43 | find = strstr(argv[a], "usingCWD=true"); 44 | if (find) { 45 | usingCWD = true; 46 | } 47 | } 48 | } 49 | #endif 50 | 51 | int main(int argc, char *argv[]) 52 | { 53 | #if !RETRO_USE_ORIGINAL_CODE 54 | parseArguments(argc, argv); 55 | #endif 56 | 57 | Engine.Init(); 58 | Engine.Run(); 59 | 60 | #if !RETRO_USE_ORIGINAL_CODE 61 | if (Engine.consoleEnabled) { 62 | #if RETRO_PLATFORM == RETRO_WIN && _MSC_VER 63 | FreeConsole(); 64 | #endif 65 | } 66 | #endif 67 | 68 | return 0; 69 | } 70 | -------------------------------------------------------------------------------- /RSDKv3/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by RSDKv3.rc 4 | // 5 | #define IDI_ICON1 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 104 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /RSDKv3SDL1.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.29806.167 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RSDKv3", "RSDKv3\RSDKv3SDL1.vcxproj", "{BD4A4266-8ED9-491E-B4CC-3F63F0D39C1B}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {BD4A4266-8ED9-491E-B4CC-3F63F0D39C1B}.Debug|x64.ActiveCfg = Debug|x64 17 | {BD4A4266-8ED9-491E-B4CC-3F63F0D39C1B}.Debug|x64.Build.0 = Debug|x64 18 | {BD4A4266-8ED9-491E-B4CC-3F63F0D39C1B}.Debug|x86.ActiveCfg = Debug|Win32 19 | {BD4A4266-8ED9-491E-B4CC-3F63F0D39C1B}.Debug|x86.Build.0 = Debug|Win32 20 | {BD4A4266-8ED9-491E-B4CC-3F63F0D39C1B}.Release|x64.ActiveCfg = Release|x64 21 | {BD4A4266-8ED9-491E-B4CC-3F63F0D39C1B}.Release|x64.Build.0 = Release|x64 22 | {BD4A4266-8ED9-491E-B4CC-3F63F0D39C1B}.Release|x86.ActiveCfg = Release|Win32 23 | {BD4A4266-8ED9-491E-B4CC-3F63F0D39C1B}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {CEEC6B21-D41E-4C5C-8B97-9FAAD7974615} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /RSDKv3UWP.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.30804.86 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RSDKv3UWP", "RSDKv3UWP\RSDKv3UWP.vcxproj", "{7376A5B2-E65D-4CC8-A0CF-5AE96BBA84A5}" 7 | EndProject 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2-UWP", "dependencies\win-uwp\SDL2\VisualC-WinRT\UWP_VS2015\SDL-UWP.vcxproj", "{89E9B32E-A86A-47C3-A948-D2B1622925CE}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|ARM = Debug|ARM 13 | Debug|ARM64 = Debug|ARM64 14 | Debug|x64 = Debug|x64 15 | Debug|x86 = Debug|x86 16 | Release|ARM = Release|ARM 17 | Release|ARM64 = Release|ARM64 18 | Release|x64 = Release|x64 19 | Release|x86 = Release|x86 20 | EndGlobalSection 21 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 22 | {7376A5B2-E65D-4CC8-A0CF-5AE96BBA84A5}.Debug|ARM.ActiveCfg = Debug|ARM 23 | {7376A5B2-E65D-4CC8-A0CF-5AE96BBA84A5}.Debug|ARM.Build.0 = Debug|ARM 24 | {7376A5B2-E65D-4CC8-A0CF-5AE96BBA84A5}.Debug|ARM.Deploy.0 = Debug|ARM 25 | {7376A5B2-E65D-4CC8-A0CF-5AE96BBA84A5}.Debug|ARM64.ActiveCfg = Debug|ARM64 26 | {7376A5B2-E65D-4CC8-A0CF-5AE96BBA84A5}.Debug|ARM64.Build.0 = Debug|ARM64 27 | {7376A5B2-E65D-4CC8-A0CF-5AE96BBA84A5}.Debug|ARM64.Deploy.0 = Debug|ARM64 28 | {7376A5B2-E65D-4CC8-A0CF-5AE96BBA84A5}.Debug|x64.ActiveCfg = Debug|x64 29 | {7376A5B2-E65D-4CC8-A0CF-5AE96BBA84A5}.Debug|x64.Build.0 = Debug|x64 30 | {7376A5B2-E65D-4CC8-A0CF-5AE96BBA84A5}.Debug|x64.Deploy.0 = Debug|x64 31 | {7376A5B2-E65D-4CC8-A0CF-5AE96BBA84A5}.Debug|x86.ActiveCfg = Debug|Win32 32 | {7376A5B2-E65D-4CC8-A0CF-5AE96BBA84A5}.Debug|x86.Build.0 = Debug|Win32 33 | {7376A5B2-E65D-4CC8-A0CF-5AE96BBA84A5}.Debug|x86.Deploy.0 = Debug|Win32 34 | {7376A5B2-E65D-4CC8-A0CF-5AE96BBA84A5}.Release|ARM.ActiveCfg = Release|ARM 35 | {7376A5B2-E65D-4CC8-A0CF-5AE96BBA84A5}.Release|ARM.Build.0 = Release|ARM 36 | {7376A5B2-E65D-4CC8-A0CF-5AE96BBA84A5}.Release|ARM.Deploy.0 = Release|ARM 37 | {7376A5B2-E65D-4CC8-A0CF-5AE96BBA84A5}.Release|ARM64.ActiveCfg = Release|ARM64 38 | {7376A5B2-E65D-4CC8-A0CF-5AE96BBA84A5}.Release|ARM64.Build.0 = Release|ARM64 39 | {7376A5B2-E65D-4CC8-A0CF-5AE96BBA84A5}.Release|ARM64.Deploy.0 = Release|ARM64 40 | {7376A5B2-E65D-4CC8-A0CF-5AE96BBA84A5}.Release|x64.ActiveCfg = Release|x64 41 | {7376A5B2-E65D-4CC8-A0CF-5AE96BBA84A5}.Release|x64.Build.0 = Release|x64 42 | {7376A5B2-E65D-4CC8-A0CF-5AE96BBA84A5}.Release|x64.Deploy.0 = Release|x64 43 | {7376A5B2-E65D-4CC8-A0CF-5AE96BBA84A5}.Release|x86.ActiveCfg = Release|Win32 44 | {7376A5B2-E65D-4CC8-A0CF-5AE96BBA84A5}.Release|x86.Build.0 = Release|Win32 45 | {7376A5B2-E65D-4CC8-A0CF-5AE96BBA84A5}.Release|x86.Deploy.0 = Release|Win32 46 | {89E9B32E-A86A-47C3-A948-D2B1622925CE}.Debug|ARM.ActiveCfg = Debug|ARM 47 | {89E9B32E-A86A-47C3-A948-D2B1622925CE}.Debug|ARM.Build.0 = Debug|ARM 48 | {89E9B32E-A86A-47C3-A948-D2B1622925CE}.Debug|ARM64.ActiveCfg = Debug|Win32 49 | {89E9B32E-A86A-47C3-A948-D2B1622925CE}.Debug|x64.ActiveCfg = Debug|x64 50 | {89E9B32E-A86A-47C3-A948-D2B1622925CE}.Debug|x64.Build.0 = Debug|x64 51 | {89E9B32E-A86A-47C3-A948-D2B1622925CE}.Debug|x86.ActiveCfg = Debug|Win32 52 | {89E9B32E-A86A-47C3-A948-D2B1622925CE}.Debug|x86.Build.0 = Debug|Win32 53 | {89E9B32E-A86A-47C3-A948-D2B1622925CE}.Release|ARM.ActiveCfg = Release|ARM 54 | {89E9B32E-A86A-47C3-A948-D2B1622925CE}.Release|ARM.Build.0 = Release|ARM 55 | {89E9B32E-A86A-47C3-A948-D2B1622925CE}.Release|ARM64.ActiveCfg = Release|Win32 56 | {89E9B32E-A86A-47C3-A948-D2B1622925CE}.Release|x64.ActiveCfg = Release|x64 57 | {89E9B32E-A86A-47C3-A948-D2B1622925CE}.Release|x64.Build.0 = Release|x64 58 | {89E9B32E-A86A-47C3-A948-D2B1622925CE}.Release|x86.ActiveCfg = Release|Win32 59 | {89E9B32E-A86A-47C3-A948-D2B1622925CE}.Release|x86.Build.0 = Release|Win32 60 | EndGlobalSection 61 | GlobalSection(SolutionProperties) = preSolution 62 | HideSolutionNode = FALSE 63 | EndGlobalSection 64 | GlobalSection(ExtensibilityGlobals) = postSolution 65 | SolutionGuid = {536DEE70-A1FC-47D8-9763-410FBD1A2958} 66 | EndGlobalSection 67 | EndGlobal 68 | -------------------------------------------------------------------------------- /RSDKv3UWP/Package.appxmanifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | Sonic CD 10 | SEGA 11 | Assets\StoreLogo.png 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /RSDKv3UWP/PropertySheet.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /RSDKv3UWP/WinRTIncludes.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | 6 | inline char *getResourcesPath() 7 | { 8 | static char resourcePath[256] = { 0 }; 9 | 10 | if (strlen(resourcePath) == 0) { 11 | auto folder = winrt::Windows::Storage::ApplicationData::Current().LocalFolder(); 12 | auto path = to_string(folder.Path()); 13 | 14 | std::copy(path.begin(), path.end(), resourcePath); 15 | } 16 | 17 | return resourcePath; 18 | } 19 | 20 | inline uint UAP_GetRetroGamePlatform() 21 | { 22 | auto touchCaps = winrt::Windows::Devices::Input::TouchCapabilities(); 23 | return touchCaps.TouchPresent() ? RETRO_MOBILE : RETRO_STANDARD; 24 | } 25 | 26 | inline uint UAP_GetRetroGamePlatformId() 27 | { 28 | auto touchCaps = winrt::Windows::Devices::Input::TouchCapabilities(); 29 | return touchCaps.TouchPresent() ? RETRO_ANDROID : RETRO_WIN; 30 | } 31 | -------------------------------------------------------------------------------- /RSDKv3UWP/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | #include "SDL_main.h" 14 | #include 15 | 16 | int SDL_main(int argc, char *argv[]) 17 | { 18 | SDL_SetHint(SDL_HINT_WINRT_HANDLE_BACK_BUTTON, "1"); 19 | Engine.Init(); 20 | Engine.Run(); 21 | 22 | return 0; 23 | } 24 | 25 | 26 | int __stdcall wWinMain(HINSTANCE, HINSTANCE, PWSTR, int) { return SDL_WinRTRunApp(SDL_main, NULL); } 27 | -------------------------------------------------------------------------------- /RSDKv3UWP/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def buildAsLibrary = project.hasProperty('BUILD_AS_LIBRARY') 2 | def buildAsApplication = !buildAsLibrary 3 | if (buildAsApplication) { 4 | apply plugin: 'com.android.application' 5 | } 6 | else { 7 | apply plugin: 'com.android.library' 8 | } 9 | 10 | android { 11 | ndkVersion "22.1.7171670" 12 | compileSdkVersion 29 13 | defaultConfig { 14 | if (buildAsApplication) { 15 | applicationId "com.decomp.rsdkv3" 16 | } 17 | minSdkVersion 23 18 | targetSdkVersion 29 19 | versionCode 1 20 | versionName "1.0" 21 | externalNativeBuild { 22 | ndkBuild { 23 | arguments "APP_PLATFORM=android-23" 24 | abiFilters = [] 25 | abiFilters.addAll(ABIFILTERS.split(';').collect{it as String}) 26 | } 27 | //cmake { 28 | // arguments "-DANDROID_APP_PLATFORM=android-16", "-DANDROID_STL=c++_static" 29 | // // abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64' 30 | // abiFilters 'arm64-v8a' 31 | //} 32 | } 33 | } 34 | buildTypes { 35 | release { 36 | minifyEnabled false 37 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 38 | } 39 | } 40 | if (!project.hasProperty('EXCLUDE_NATIVE_LIBS')) { 41 | sourceSets.main { 42 | jniLibs.srcDir 'libs' 43 | } 44 | externalNativeBuild { 45 | ndkBuild { 46 | path 'jni/Android.mk' 47 | } 48 | //cmake { 49 | // path 'jni/CMakeLists.txt' 50 | //} 51 | } 52 | 53 | } 54 | lintOptions { 55 | abortOnError false 56 | } 57 | 58 | if (buildAsLibrary) { 59 | libraryVariants.all { variant -> 60 | variant.outputs.each { output -> 61 | def outputFile = output.outputFile 62 | if (outputFile != null && outputFile.name.endsWith(".aar")) { 63 | def fileName = "com.decomp.rsdkv3.aar" 64 | output.outputFile = new File(outputFile.parent, fileName) 65 | } 66 | } 67 | } 68 | } 69 | } 70 | 71 | dependencies { 72 | implementation fileTree(include: ['*.jar'], dir: 'libs') 73 | } 74 | -------------------------------------------------------------------------------- /android/app/jni/Android.mk: -------------------------------------------------------------------------------- 1 | include $(call all-subdir-makefiles) 2 | -------------------------------------------------------------------------------- /android/app/jni/Application.mk: -------------------------------------------------------------------------------- 1 | 2 | # Uncomment this if you're using STL in your project 3 | # You can find more information here: 4 | # https://developer.android.com/ndk/guides/cpp-support 5 | APP_STL := c++_shared 6 | 7 | APP_ABI := armeabi-v7a arm64-v8a x86 x86_64 8 | 9 | # Min runtime API level 10 | APP_PLATFORM=android-23 11 | -------------------------------------------------------------------------------- /android/app/jni/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.6) 2 | 3 | project(GAME) 4 | 5 | # armeabi-v7a requires cpufeatures library 6 | # include(AndroidNdkModules) 7 | # android_ndk_import_module_cpufeatures() 8 | 9 | 10 | # SDL sources are in a subfolder named "SDL" 11 | add_subdirectory(SDL) 12 | 13 | # Compilation of companion libraries 14 | #add_subdirectory(SDL_image) 15 | #add_subdirectory(SDL_mixer) 16 | #add_subdirectory(SDL_ttf) 17 | 18 | # Your game and its CMakeLists.txt are in a subfolder named "src" 19 | add_subdirectory(src) 20 | 21 | -------------------------------------------------------------------------------- /android/app/jni/SDL: -------------------------------------------------------------------------------- 1 | ../../../dependencies/android/SDL -------------------------------------------------------------------------------- /android/app/jni/src: -------------------------------------------------------------------------------- 1 | ../../.. -------------------------------------------------------------------------------- /android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in [sdk]/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 8 | 9 | 10 | 12 | 13 | 14 | 16 | 17 | 18 | 19 | 20 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 51 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/decomp/rsdkv3/RSDKv3.java: -------------------------------------------------------------------------------- 1 | package com.decomp.rsdkv3; 2 | 3 | import android.Manifest; 4 | import android.content.Context; 5 | import android.os.Environment; 6 | 7 | import java.io.File; 8 | 9 | import org.libsdl.app.*; 10 | 11 | 12 | public class RSDKv3 extends SDLActivity { 13 | @Override 14 | protected void onStart() { 15 | super.onStart(); 16 | getBasePath(); 17 | } 18 | 19 | //Idk what the hell "has multi window" is, but I do NOT have multiple windows and therefore DO wanna pause/resume these threads 20 | @Override 21 | protected void onPause() { 22 | super.onPause(); 23 | if (mHasMultiWindow) { 24 | pauseNativeThread(); 25 | } 26 | } 27 | 28 | @Override 29 | protected void onResume() { 30 | super.onResume(); 31 | 32 | if (mHasMultiWindow) { 33 | resumeNativeThread(); 34 | } 35 | } 36 | 37 | public String getBasePath() { 38 | Context c = getApplicationContext(); 39 | requestPermissions(new String[]{Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE}, 0); 40 | String p = Environment.getExternalStorageDirectory().getAbsolutePath() + "/RSDK/v3"; 41 | //getExternalStorageDirectory is deprecated. I do not care. 42 | new File(p).mkdirs(); 43 | return p + "/"; 44 | } 45 | } -------------------------------------------------------------------------------- /android/app/src/main/java/org/libsdl/app/HIDDevice.java: -------------------------------------------------------------------------------- 1 | package org.libsdl.app; 2 | 3 | import android.hardware.usb.UsbDevice; 4 | 5 | interface HIDDevice 6 | { 7 | public int getId(); 8 | public int getVendorId(); 9 | public int getProductId(); 10 | public String getSerialNumber(); 11 | public int getVersion(); 12 | public String getManufacturerName(); 13 | public String getProductName(); 14 | public UsbDevice getDevice(); 15 | public boolean open(); 16 | public int sendFeatureReport(byte[] report); 17 | public int sendOutputReport(byte[] report); 18 | public boolean getFeatureReport(byte[] report); 19 | public void setFrozen(boolean frozen); 20 | public void close(); 21 | public void shutdown(); 22 | } 23 | -------------------------------------------------------------------------------- /android/app/src/main/java/org/libsdl/app/SDL.java: -------------------------------------------------------------------------------- 1 | package org.libsdl.app; 2 | 3 | import android.content.Context; 4 | 5 | import java.lang.Class; 6 | import java.lang.reflect.Method; 7 | 8 | /** 9 | SDL library initialization 10 | */ 11 | public class SDL { 12 | 13 | // This function should be called first and sets up the native code 14 | // so it can call into the Java classes 15 | public static void setupJNI() { 16 | SDLActivity.nativeSetupJNI(); 17 | SDLAudioManager.nativeSetupJNI(); 18 | SDLControllerManager.nativeSetupJNI(); 19 | } 20 | 21 | // This function should be called each time the activity is started 22 | public static void initialize() { 23 | setContext(null); 24 | 25 | SDLActivity.initialize(); 26 | SDLAudioManager.initialize(); 27 | SDLControllerManager.initialize(); 28 | } 29 | 30 | // This function stores the current activity (SDL or not) 31 | public static void setContext(Context context) { 32 | mContext = context; 33 | } 34 | 35 | public static Context getContext() { 36 | return mContext; 37 | } 38 | 39 | public static void loadLibrary(String libraryName) throws UnsatisfiedLinkError, SecurityException, NullPointerException { 40 | 41 | if (libraryName == null) { 42 | throw new NullPointerException("No library name provided."); 43 | } 44 | 45 | try { 46 | // Let's see if we have ReLinker available in the project. This is necessary for 47 | // some projects that have huge numbers of local libraries bundled, and thus may 48 | // trip a bug in Android's native library loader which ReLinker works around. (If 49 | // loadLibrary works properly, ReLinker will simply use the normal Android method 50 | // internally.) 51 | // 52 | // To use ReLinker, just add it as a dependency. For more information, see 53 | // https://github.com/KeepSafe/ReLinker for ReLinker's repository. 54 | // 55 | Class> relinkClass = mContext.getClassLoader().loadClass("com.getkeepsafe.relinker.ReLinker"); 56 | Class> relinkListenerClass = mContext.getClassLoader().loadClass("com.getkeepsafe.relinker.ReLinker$LoadListener"); 57 | Class> contextClass = mContext.getClassLoader().loadClass("android.content.Context"); 58 | Class> stringClass = mContext.getClassLoader().loadClass("java.lang.String"); 59 | 60 | // Get a 'force' instance of the ReLinker, so we can ensure libraries are reinstalled if 61 | // they've changed during updates. 62 | Method forceMethod = relinkClass.getDeclaredMethod("force"); 63 | Object relinkInstance = forceMethod.invoke(null); 64 | Class> relinkInstanceClass = relinkInstance.getClass(); 65 | 66 | // Actually load the library! 67 | Method loadMethod = relinkInstanceClass.getDeclaredMethod("loadLibrary", contextClass, stringClass, stringClass, relinkListenerClass); 68 | loadMethod.invoke(relinkInstance, mContext, libraryName, null, null); 69 | } 70 | catch (final Throwable e) { 71 | // Fall back 72 | try { 73 | System.loadLibrary(libraryName); 74 | } 75 | catch (final UnsatisfiedLinkError ule) { 76 | throw ule; 77 | } 78 | catch (final SecurityException se) { 79 | throw se; 80 | } 81 | } 82 | } 83 | 84 | protected static Context mContext; 85 | } 86 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SonicMastr/Sonic-CD-Vita/525b0e6035e4b10135cd043e479c96b1f937b9a9/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SonicMastr/Sonic-CD-Vita/525b0e6035e4b10135cd043e479c96b1f937b9a9/android/app/src/main/res/mipmap-hdpi/ic_launcher_background.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SonicMastr/Sonic-CD-Vita/525b0e6035e4b10135cd043e479c96b1f937b9a9/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher_monochrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SonicMastr/Sonic-CD-Vita/525b0e6035e4b10135cd043e479c96b1f937b9a9/android/app/src/main/res/mipmap-hdpi/ic_launcher_monochrome.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SonicMastr/Sonic-CD-Vita/525b0e6035e4b10135cd043e479c96b1f937b9a9/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SonicMastr/Sonic-CD-Vita/525b0e6035e4b10135cd043e479c96b1f937b9a9/android/app/src/main/res/mipmap-mdpi/ic_launcher_background.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SonicMastr/Sonic-CD-Vita/525b0e6035e4b10135cd043e479c96b1f937b9a9/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher_monochrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SonicMastr/Sonic-CD-Vita/525b0e6035e4b10135cd043e479c96b1f937b9a9/android/app/src/main/res/mipmap-mdpi/ic_launcher_monochrome.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SonicMastr/Sonic-CD-Vita/525b0e6035e4b10135cd043e479c96b1f937b9a9/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SonicMastr/Sonic-CD-Vita/525b0e6035e4b10135cd043e479c96b1f937b9a9/android/app/src/main/res/mipmap-xhdpi/ic_launcher_background.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SonicMastr/Sonic-CD-Vita/525b0e6035e4b10135cd043e479c96b1f937b9a9/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher_monochrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SonicMastr/Sonic-CD-Vita/525b0e6035e4b10135cd043e479c96b1f937b9a9/android/app/src/main/res/mipmap-xhdpi/ic_launcher_monochrome.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SonicMastr/Sonic-CD-Vita/525b0e6035e4b10135cd043e479c96b1f937b9a9/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SonicMastr/Sonic-CD-Vita/525b0e6035e4b10135cd043e479c96b1f937b9a9/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_background.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SonicMastr/Sonic-CD-Vita/525b0e6035e4b10135cd043e479c96b1f937b9a9/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher_monochrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SonicMastr/Sonic-CD-Vita/525b0e6035e4b10135cd043e479c96b1f937b9a9/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_monochrome.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SonicMastr/Sonic-CD-Vita/525b0e6035e4b10135cd043e479c96b1f937b9a9/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SonicMastr/Sonic-CD-Vita/525b0e6035e4b10135cd043e479c96b1f937b9a9/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SonicMastr/Sonic-CD-Vita/525b0e6035e4b10135cd043e479c96b1f937b9a9/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_monochrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SonicMastr/Sonic-CD-Vita/525b0e6035e4b10135cd043e479c96b1f937b9a9/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_monochrome.png -------------------------------------------------------------------------------- /android/app/src/main/res/values-v27/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #231F20 4 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | RSDKv3 3 | 4 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | google() 7 | } 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:7.1.0-alpha05' 10 | 11 | // NOTE: Do not place your application dependencies here; they belong 12 | // in the individual module build.gradle files 13 | } 14 | } 15 | 16 | allprojects { 17 | repositories { 18 | jcenter() 19 | google() 20 | } 21 | } 22 | 23 | 24 | task clean(type: Delete) { 25 | delete rootProject.buildDir 26 | } 27 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | org.gradle.jvmargs=-Xmx1536m 13 | ABIFILTERS=armeabi-v7a;arm64-v8a;x86;x86_64 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SonicMastr/Sonic-CD-Vita/525b0e6035e4b10135cd043e479c96b1f937b9a9/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Aug 03 23:47:29 CDT 2021 2 | distributionBase=GRADLE_USER_HOME 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-rc-1-bin.zip 4 | distributionPath=wrapper/dists 5 | zipStorePath=wrapper/dists 6 | zipStoreBase=GRADLE_USER_HOME 7 | -------------------------------------------------------------------------------- /android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /dependencies/all/theoraplay/.hg_archival.txt: -------------------------------------------------------------------------------- 1 | repo: 2cd9243072f0470e51d658b7ef978870d4468af3 2 | node: 99e5fc74603e70d99e8b189eb58d02496f9a0457 3 | branch: default 4 | latesttag: null 5 | latesttagdistance: 67 6 | changessincelatesttag: 67 7 | -------------------------------------------------------------------------------- /dependencies/all/theoraplay/.hgignore: -------------------------------------------------------------------------------- 1 | syntax:glob 2 | test/*.dSYM 3 | test/*.exe 4 | test/testtheoraplay 5 | test/sdltheoraplay 6 | -------------------------------------------------------------------------------- /dependencies/all/theoraplay/LICENSE.txt: -------------------------------------------------------------------------------- 1 | 2 | Copyright (c) 2011-2019 Ryan C. Gordon. 3 | 4 | This software is provided 'as-is', without any express or implied warranty. 5 | In no event will the authors be held liable for any damages arising from 6 | the use of this software. 7 | 8 | Permission is granted to anyone to use this software for any purpose, 9 | including commercial applications, and to alter it and redistribute it 10 | freely, subject to the following restrictions: 11 | 12 | 1. The origin of this software must not be misrepresented; you must not 13 | claim that you wrote the original software. If you use this software in a 14 | product, an acknowledgment in the product documentation would be 15 | appreciated but is not required. 16 | 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 20 | 3. This notice may not be removed or altered from any source distribution. 21 | 22 | Ryan C. Gordon 23 | 24 | -------------------------------------------------------------------------------- /dependencies/all/theoraplay/test/maketest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -x 4 | set -e 5 | 6 | OSTYPE=`uname -s` 7 | if [ "$OSTYPE" = "Linux" ]; then 8 | LINKFLAGS="-lpthread" 9 | LINKGLFLAGS="-lGL" 10 | fi 11 | if [ "$OSTYPE" = "Darwin" ]; then 12 | LINKGLFLAGS="-framework OpenGL" 13 | fi 14 | 15 | CFLAGS="-O0 -ggdb3 -Wall -I.." 16 | gcc -o ./testtheoraplay $CFLAGS ../theoraplay.c ./testtheoraplay.c -logg -lvorbis -ltheoradec $LINKFLAGS 17 | gcc -o ./simplesdl $CFLAGS ../theoraplay.c ./simplesdl.c `sdl-config --cflags --libs` -logg -lvorbis -ltheoradec $LINKFLAGS 18 | gcc -o ./sdltheoraplay $CFLAGS ../theoraplay.c ./sdltheoraplay.c `sdl-config --cflags --libs` -logg -lvorbis -ltheoradec $LINKFLAGS $LINKGLFLAGS 19 | 20 | -------------------------------------------------------------------------------- /dependencies/all/theoraplay/test/testtheoraplay.c: -------------------------------------------------------------------------------- 1 | /** 2 | * TheoraPlay; multithreaded Ogg Theora/Ogg Vorbis decoding. 3 | * 4 | * Please see the file LICENSE.txt in the source's root directory. 5 | * 6 | * This file written by Ryan C. Gordon. 7 | */ 8 | 9 | #include 10 | #include 11 | #include 12 | #include "theoraplay.h" 13 | 14 | static void dofile(const char *fname, const THEORAPLAY_VideoFormat vidfmt) 15 | { 16 | THEORAPLAY_Decoder *decoder = NULL; 17 | const THEORAPLAY_VideoFrame *video = NULL; 18 | const THEORAPLAY_AudioPacket *audio = NULL; 19 | 20 | printf("Trying file '%s' ...\n", fname); 21 | decoder = THEORAPLAY_startDecodeFile(fname, 20, vidfmt); 22 | while (THEORAPLAY_isDecoding(decoder)) 23 | { 24 | video = THEORAPLAY_getVideo(decoder); 25 | if (video) 26 | { 27 | printf("Got video frame (%u ms)!\n", video->playms); 28 | THEORAPLAY_freeVideo(video); 29 | } // if 30 | 31 | audio = THEORAPLAY_getAudio(decoder); 32 | if (audio) 33 | { 34 | printf("Got %d frames of audio (%u ms)!\n", audio->frames, audio->playms); 35 | THEORAPLAY_freeAudio(audio); 36 | } // if 37 | 38 | if (!video && !audio) 39 | usleep(10000); 40 | } // while 41 | 42 | if (THEORAPLAY_decodingError(decoder)) 43 | printf("There was an error decoding this file!\n"); 44 | else 45 | printf("done with this file!\n"); 46 | 47 | THEORAPLAY_stopDecode(decoder); 48 | } // dofile 49 | 50 | int main(int argc, char **argv) 51 | { 52 | THEORAPLAY_VideoFormat vidfmt = THEORAPLAY_VIDFMT_YV12; 53 | int i; 54 | 55 | for (i = 1; i < argc; i++) 56 | { 57 | if (strcmp(argv[i], "--rgb") == 0) 58 | vidfmt = THEORAPLAY_VIDFMT_RGB; 59 | else if (strcmp(argv[i], "--rgba") == 0) 60 | vidfmt = THEORAPLAY_VIDFMT_RGBA; 61 | else if (strcmp(argv[i], "--yv12") == 0) 62 | vidfmt = THEORAPLAY_VIDFMT_YV12; 63 | else 64 | dofile(argv[i], vidfmt); 65 | } // for 66 | 67 | printf("done all files!\n"); 68 | return 0; 69 | } // main 70 | 71 | // end of testtheoraplay.c ... 72 | 73 | -------------------------------------------------------------------------------- /dependencies/all/theoraplay/theoraplay.h: -------------------------------------------------------------------------------- 1 | /** 2 | * TheoraPlay; multithreaded Ogg Theora/Ogg Vorbis decoding. 3 | * 4 | * Please see the file LICENSE.txt in the source's root directory. 5 | * 6 | * This file written by Ryan C. Gordon. 7 | */ 8 | 9 | #ifndef _INCL_THEORAPLAY_H_ 10 | #define _INCL_THEORAPLAY_H_ 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | typedef struct THEORAPLAY_Io THEORAPLAY_Io; 17 | struct THEORAPLAY_Io 18 | { 19 | long (*read)(THEORAPLAY_Io *io, void *buf, long buflen); 20 | void (*close)(THEORAPLAY_Io *io); 21 | void *userdata; 22 | }; 23 | 24 | typedef struct THEORAPLAY_Decoder THEORAPLAY_Decoder; 25 | 26 | /* YV12 is YCrCb, not YCbCr; that's what SDL uses for YV12 overlays. */ 27 | typedef enum THEORAPLAY_VideoFormat 28 | { 29 | THEORAPLAY_VIDFMT_YV12, /* NTSC colorspace, planar YCrCb 4:2:0 */ 30 | THEORAPLAY_VIDFMT_IYUV, /* NTSC colorspace, planar YCbCr 4:2:0 */ 31 | THEORAPLAY_VIDFMT_RGB, /* 24 bits packed pixel RGB */ 32 | THEORAPLAY_VIDFMT_RGBA /* 32 bits packed pixel RGBA (full alpha). */ 33 | } THEORAPLAY_VideoFormat; 34 | 35 | typedef struct THEORAPLAY_VideoFrame 36 | { 37 | unsigned int playms; 38 | double fps; 39 | unsigned int width; 40 | unsigned int height; 41 | THEORAPLAY_VideoFormat format; 42 | unsigned char *pixels; 43 | struct THEORAPLAY_VideoFrame *next; 44 | } THEORAPLAY_VideoFrame; 45 | 46 | typedef struct THEORAPLAY_AudioPacket 47 | { 48 | unsigned int playms; /* playback start time in milliseconds. */ 49 | int channels; 50 | int freq; 51 | int frames; 52 | float *samples; /* frames * channels float32 samples. */ 53 | struct THEORAPLAY_AudioPacket *next; 54 | } THEORAPLAY_AudioPacket; 55 | 56 | THEORAPLAY_Decoder *THEORAPLAY_startDecodeFile(const char *fname, 57 | const unsigned int maxframes, 58 | THEORAPLAY_VideoFormat vidfmt, 59 | unsigned int audio_bitstream); 60 | THEORAPLAY_Decoder *THEORAPLAY_startDecode(THEORAPLAY_Io *io, 61 | const unsigned int maxframes, 62 | THEORAPLAY_VideoFormat vidfmt, 63 | unsigned int audio_bitstream); 64 | void THEORAPLAY_stopDecode(THEORAPLAY_Decoder *decoder); 65 | 66 | int THEORAPLAY_isDecoding(THEORAPLAY_Decoder *decoder); 67 | int THEORAPLAY_decodingError(THEORAPLAY_Decoder *decoder); 68 | int THEORAPLAY_isInitialized(THEORAPLAY_Decoder *decoder); 69 | int THEORAPLAY_hasVideoStream(THEORAPLAY_Decoder *decoder); 70 | int THEORAPLAY_hasAudioStream(THEORAPLAY_Decoder *decoder); 71 | unsigned int THEORAPLAY_availableVideo(THEORAPLAY_Decoder *decoder); 72 | unsigned int THEORAPLAY_availableAudio(THEORAPLAY_Decoder *decoder); 73 | 74 | const THEORAPLAY_AudioPacket *THEORAPLAY_getAudio(THEORAPLAY_Decoder *decoder); 75 | void THEORAPLAY_freeAudio(const THEORAPLAY_AudioPacket *item); 76 | 77 | const THEORAPLAY_VideoFrame *THEORAPLAY_getVideo(THEORAPLAY_Decoder *decoder); 78 | void THEORAPLAY_freeVideo(const THEORAPLAY_VideoFrame *item); 79 | 80 | #ifdef __cplusplus 81 | } 82 | #endif 83 | 84 | #endif /* include-once blocker. */ 85 | 86 | /* end of theoraplay.h ... */ 87 | 88 | -------------------------------------------------------------------------------- /dependencies/all/theoraplay/theoraplay_cvtrgb.h: -------------------------------------------------------------------------------- 1 | /** 2 | * TheoraPlay; multithreaded Ogg Theora/Ogg Vorbis decoding. 3 | * 4 | * Please see the file LICENSE.txt in the source's root directory. 5 | * 6 | * This file written by Ryan C. Gordon. 7 | */ 8 | 9 | #if !THEORAPLAY_INTERNAL 10 | #error Do not include this in your app. It is used internally by TheoraPlay. 11 | #endif 12 | 13 | static unsigned char *THEORAPLAY_CVT_FNNAME_420(const th_info *tinfo, 14 | const th_ycbcr_buffer ycbcr) 15 | { 16 | const int w = tinfo->pic_width; 17 | const int h = tinfo->pic_height; 18 | const int halfw = w / 2; 19 | unsigned char *pixels = (unsigned char *) malloc(w * h * 4); 20 | 21 | // http://www.theora.org/doc/Theora.pdf, 1.1 spec, 22 | // chapter 4.2 (Y'CbCr -> Y'PbPr -> R'G'B') 23 | // These constants apparently work for NTSC _and_ PAL/SECAM. 24 | const float yoffset = 16.0f; 25 | const float yexcursion = 219.0f; 26 | const float cboffset = 128.0f; 27 | const float cbexcursion = 224.0f; 28 | const float croffset = 128.0f; 29 | const float crexcursion = 224.0f; 30 | const float kr = 0.299f; 31 | const float kb = 0.114f; 32 | 33 | if (pixels) 34 | { 35 | unsigned char *dst = pixels; 36 | const int ystride = ycbcr[0].stride; 37 | const int cbstride = ycbcr[1].stride; 38 | const int crstride = ycbcr[2].stride; 39 | const int yoff = (tinfo->pic_x & ~1) + ystride * (tinfo->pic_y & ~1); 40 | const int cboff = (tinfo->pic_x / 2) + (cbstride) * (tinfo->pic_y / 2); 41 | const unsigned char *py = ycbcr[0].data + yoff; 42 | const unsigned char *pcb = ycbcr[1].data + cboff; 43 | const unsigned char *pcr = ycbcr[2].data + cboff; 44 | int posy; 45 | 46 | for (posy = 0; posy < h; posy++) 47 | { 48 | int posx, poshalfx; 49 | 50 | posx = 0; 51 | for (poshalfx = 0; poshalfx < halfw; poshalfx++, posx += 2) 52 | { 53 | const float y1 = (((float) py[posx]) - yoffset) / yexcursion; 54 | const float y2 = (((float) py[posx+1]) - yoffset) / yexcursion; 55 | const float pb = (((float) pcb[poshalfx]) - cboffset) / cbexcursion; 56 | const float pr = (((float) pcr[poshalfx]) - croffset) / crexcursion; 57 | const float r1 = (y1 + (2.0f * (1.0f - kr) * pr)) * 255.0f; 58 | const float g1 = (y1 - ((2.0f * (((1.0f - kb) * kb) / ((1.0f - kb) - kr))) * pb) - ((2.0f * (((1.0f - kr) * kr) / ((1.0f - kb) - kr))) * pr)) * 255.0f; 59 | const float b1 = (y1 + (2.0f * (1.0f - kb) * pb)) * 255.0f; 60 | const float r2 = (y2 + (2.0f * (1.0f - kr) * pr)) * 255.0f; 61 | const float g2 = (y2 - ((2.0f * (((1.0f - kb) * kb) / ((1.0f - kb) - kr))) * pb) - ((2.0f * (((1.0f - kr) * kr) / ((1.0f - kb) - kr))) * pr)) * 255.0f; 62 | const float b2 = (y2 + (2.0f * (1.0f - kb) * pb)) * 255.0f; 63 | 64 | *(dst++) = (unsigned char) ((r1 < 0.0f) ? 0.0f : (r1 > 255.0f) ? 255.0f : r1); 65 | *(dst++) = (unsigned char) ((g1 < 0.0f) ? 0.0f : (g1 > 255.0f) ? 255.0f : g1); 66 | *(dst++) = (unsigned char) ((b1 < 0.0f) ? 0.0f : (b1 > 255.0f) ? 255.0f : b1); 67 | #if THEORAPLAY_CVT_RGB_ALPHA 68 | *(dst++) = 0xFF; 69 | #endif 70 | 71 | *(dst++) = (unsigned char) ((r2 < 0.0f) ? 0.0f : (r2 > 255.0f) ? 255.0f : r2); 72 | *(dst++) = (unsigned char) ((g2 < 0.0f) ? 0.0f : (g2 > 255.0f) ? 255.0f : g2); 73 | *(dst++) = (unsigned char) ((b2 < 0.0f) ? 0.0f : (b2 > 255.0f) ? 255.0f : b2); 74 | #if THEORAPLAY_CVT_RGB_ALPHA 75 | *(dst++) = 0xFF; 76 | #endif 77 | } // for 78 | 79 | // adjust to the start of the next line. 80 | py += ystride; 81 | pcb += cbstride * (posy % 2); 82 | pcr += crstride * (posy % 2); 83 | } // for 84 | } // if 85 | 86 | return pixels; 87 | } // THEORAPLAY_CVT_FNNAME_420 88 | 89 | // end of theoraplay_cvtrgb.h ... 90 | 91 | -------------------------------------------------------------------------------- /dependencies/android/config_types.h: -------------------------------------------------------------------------------- 1 | #ifndef __CONFIG_TYPES_H__ 2 | #define __CONFIG_TYPES_H__ 3 | 4 | #include 5 | typedef int16_t ogg_int16_t; 6 | typedef uint16_t ogg_uint16_t; 7 | typedef int32_t ogg_int32_t; 8 | typedef uint32_t ogg_uint32_t; 9 | typedef int64_t ogg_int64_t; 10 | typedef uint64_t ogg_uint64_t; 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /dependencies/android/dependencies.txt: -------------------------------------------------------------------------------- 1 | SDL2: https://www.libsdl.org/download-2.0.php 2 | Download the source code and unzip it in "./SDL/". 3 | 4 | libogg: https://xiph.org/downloads/ (libogg) 5 | Download libogg and unzip it in "./libogg/". Then, copy "config_types.h" from here and paste it in "./libogg/include/ogg/". 6 | 7 | libvorbis: https://xiph.org/downloads/ (libvorbis) 8 | Download libvorbis and unzip it in "./libvorbis/". 9 | 10 | libtheora: https://xiph.org/downloads/ (libtheora) 11 | Download libtheora and unzip it in "./libtheora/". 12 | -------------------------------------------------------------------------------- /dependencies/ios/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "scale" : "2x", 6 | "size" : "20x20" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "scale" : "3x", 11 | "size" : "20x20" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "scale" : "2x", 16 | "size" : "29x29" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "scale" : "3x", 21 | "size" : "29x29" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "scale" : "2x", 26 | "size" : "40x40" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "scale" : "3x", 31 | "size" : "40x40" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "scale" : "2x", 36 | "size" : "60x60" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "scale" : "3x", 41 | "size" : "60x60" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "scale" : "1x", 46 | "size" : "20x20" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "scale" : "2x", 51 | "size" : "20x20" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "scale" : "1x", 56 | "size" : "29x29" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "scale" : "2x", 61 | "size" : "29x29" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "scale" : "1x", 66 | "size" : "40x40" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "scale" : "2x", 71 | "size" : "40x40" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "scale" : "1x", 76 | "size" : "76x76" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "scale" : "2x", 81 | "size" : "76x76" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "scale" : "2x", 86 | "size" : "83.5x83.5" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "scale" : "1x", 91 | "size" : "1024x1024" 92 | } 93 | ], 94 | "info" : { 95 | "author" : "xcode", 96 | "version" : 1 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /dependencies/ios/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /dependencies/ios/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /dependencies/ios/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SonicMastr/Sonic-CD-Vita/525b0e6035e4b10135cd043e479c96b1f937b9a9/dependencies/ios/Default.png -------------------------------------------------------------------------------- /dependencies/ios/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | $(MARKETING_VERSION) 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIRequiredDeviceCapabilities 26 | 27 | armv7 28 | metal 29 | 30 | UIRequiresFullScreen 31 | 32 | UIStatusBarHidden 33 | 34 | UISupportedInterfaceOrientations 35 | 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /dependencies/ios/dependencies.txt: -------------------------------------------------------------------------------- 1 | SDL2: https://www.libsdl.org/download-2.0.php 2 | Download the source for the latest SDL2 version and open the Xcode project in Xcode/, from there you need to build the "Framework-iOS" target to a generic iOS device, then place the built frameworks (hidapi.framework & SDL2.framework) in "./SDL2/" 3 | NOTE: you will need to create a project to build libSDL2Main.a manually, otherwise there will be "undefined references to _main" errors in the main Xcode project 4 | 5 | libogg: https://xiph.org/downloads/ (libogg) 6 | Download the source and create an Xcode project to build the library as a framework, once the framework is built (Ogg.framework), place it in ./ 7 | 8 | libvorbis: https://xiph.org/downloads/ (libvorbis) 9 | Download the source and create an Xcode project to build the library as a framework, once the framework is built (vorbis.framework), place it in ./ 10 | 11 | libtheora: https://xiph.org/downloads/ (libtheora) 12 | Download the source and create an Xcode project to build the library as a framework, once the framework is built (theora.framework), place it in ./ -------------------------------------------------------------------------------- /dependencies/mac/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "RSDKv3 Decomp Icon-16.png", 5 | "idiom" : "mac", 6 | "scale" : "1x", 7 | "size" : "16x16" 8 | }, 9 | { 10 | "filename" : "RSDKv3 Decomp Icon-32.png", 11 | "idiom" : "mac", 12 | "scale" : "2x", 13 | "size" : "16x16" 14 | }, 15 | { 16 | "filename" : "RSDKv3 Decomp Icon-33.png", 17 | "idiom" : "mac", 18 | "scale" : "1x", 19 | "size" : "32x32" 20 | }, 21 | { 22 | "filename" : "RSDKv3 Decomp Icon-64.png", 23 | "idiom" : "mac", 24 | "scale" : "2x", 25 | "size" : "32x32" 26 | }, 27 | { 28 | "filename" : "RSDKv3 Decomp Icon-128.png", 29 | "idiom" : "mac", 30 | "scale" : "1x", 31 | "size" : "128x128" 32 | }, 33 | { 34 | "filename" : "RSDKv3 Decomp Icon-256.png", 35 | "idiom" : "mac", 36 | "scale" : "2x", 37 | "size" : "128x128" 38 | }, 39 | { 40 | "filename" : "RSDKv3 Decomp Icon-257.png", 41 | "idiom" : "mac", 42 | "scale" : "1x", 43 | "size" : "256x256" 44 | }, 45 | { 46 | "filename" : "RSDKv3 Decomp Icon-512.png", 47 | "idiom" : "mac", 48 | "scale" : "2x", 49 | "size" : "256x256" 50 | }, 51 | { 52 | "filename" : "RSDKv3 Decomp Icon-513.png", 53 | "idiom" : "mac", 54 | "scale" : "1x", 55 | "size" : "512x512" 56 | }, 57 | { 58 | "filename" : "RSDKv3 Decomp Icon-1024.png", 59 | "idiom" : "mac", 60 | "scale" : "2x", 61 | "size" : "512x512" 62 | } 63 | ], 64 | "info" : { 65 | "author" : "xcode", 66 | "version" : 1 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /dependencies/mac/Assets.xcassets/AppIcon.appiconset/RSDKv3 Decomp Icon-1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SonicMastr/Sonic-CD-Vita/525b0e6035e4b10135cd043e479c96b1f937b9a9/dependencies/mac/Assets.xcassets/AppIcon.appiconset/RSDKv3 Decomp Icon-1024.png -------------------------------------------------------------------------------- /dependencies/mac/Assets.xcassets/AppIcon.appiconset/RSDKv3 Decomp Icon-128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SonicMastr/Sonic-CD-Vita/525b0e6035e4b10135cd043e479c96b1f937b9a9/dependencies/mac/Assets.xcassets/AppIcon.appiconset/RSDKv3 Decomp Icon-128.png -------------------------------------------------------------------------------- /dependencies/mac/Assets.xcassets/AppIcon.appiconset/RSDKv3 Decomp Icon-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SonicMastr/Sonic-CD-Vita/525b0e6035e4b10135cd043e479c96b1f937b9a9/dependencies/mac/Assets.xcassets/AppIcon.appiconset/RSDKv3 Decomp Icon-16.png -------------------------------------------------------------------------------- /dependencies/mac/Assets.xcassets/AppIcon.appiconset/RSDKv3 Decomp Icon-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SonicMastr/Sonic-CD-Vita/525b0e6035e4b10135cd043e479c96b1f937b9a9/dependencies/mac/Assets.xcassets/AppIcon.appiconset/RSDKv3 Decomp Icon-256.png -------------------------------------------------------------------------------- /dependencies/mac/Assets.xcassets/AppIcon.appiconset/RSDKv3 Decomp Icon-257.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SonicMastr/Sonic-CD-Vita/525b0e6035e4b10135cd043e479c96b1f937b9a9/dependencies/mac/Assets.xcassets/AppIcon.appiconset/RSDKv3 Decomp Icon-257.png -------------------------------------------------------------------------------- /dependencies/mac/Assets.xcassets/AppIcon.appiconset/RSDKv3 Decomp Icon-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SonicMastr/Sonic-CD-Vita/525b0e6035e4b10135cd043e479c96b1f937b9a9/dependencies/mac/Assets.xcassets/AppIcon.appiconset/RSDKv3 Decomp Icon-32.png -------------------------------------------------------------------------------- /dependencies/mac/Assets.xcassets/AppIcon.appiconset/RSDKv3 Decomp Icon-33.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SonicMastr/Sonic-CD-Vita/525b0e6035e4b10135cd043e479c96b1f937b9a9/dependencies/mac/Assets.xcassets/AppIcon.appiconset/RSDKv3 Decomp Icon-33.png -------------------------------------------------------------------------------- /dependencies/mac/Assets.xcassets/AppIcon.appiconset/RSDKv3 Decomp Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SonicMastr/Sonic-CD-Vita/525b0e6035e4b10135cd043e479c96b1f937b9a9/dependencies/mac/Assets.xcassets/AppIcon.appiconset/RSDKv3 Decomp Icon-512.png -------------------------------------------------------------------------------- /dependencies/mac/Assets.xcassets/AppIcon.appiconset/RSDKv3 Decomp Icon-513.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SonicMastr/Sonic-CD-Vita/525b0e6035e4b10135cd043e479c96b1f937b9a9/dependencies/mac/Assets.xcassets/AppIcon.appiconset/RSDKv3 Decomp Icon-513.png -------------------------------------------------------------------------------- /dependencies/mac/Assets.xcassets/AppIcon.appiconset/RSDKv3 Decomp Icon-64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SonicMastr/Sonic-CD-Vita/525b0e6035e4b10135cd043e479c96b1f937b9a9/dependencies/mac/Assets.xcassets/AppIcon.appiconset/RSDKv3 Decomp Icon-64.png -------------------------------------------------------------------------------- /dependencies/mac/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /dependencies/mac/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 19 | CFBundleShortVersionString 20 | $(MARKETING_VERSION) 21 | CFBundleVersion 22 | 1 23 | LSApplicationCategoryType 24 | public.app-category.games 25 | LSMinimumSystemVersion 26 | $(MACOSX_DEPLOYMENT_TARGET) 27 | NSHumanReadableCopyright 28 | Copyright © 2021 Rubberduckycooly. All rights reserved. 29 | NSMainStoryboardFile 30 | Main 31 | NSPrincipalClass 32 | NSApplication 33 | NSSupportsAutomaticTermination 34 | 35 | NSSupportsSuddenTermination 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /dependencies/mac/RSDKv3.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.cs.disable-library-validation 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /dependencies/mac/cocoaHelpers.hpp: -------------------------------------------------------------------------------- 1 | #ifndef COCOA_HELPERS_H 2 | #define COCOA_HELPERS_H 3 | 4 | const char* getResourcesPath(void); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /dependencies/mac/cocoaHelpers.mm: -------------------------------------------------------------------------------- 1 | #ifdef __APPLE__ 2 | 3 | #import 4 | #include "cocoaHelpers.hpp" 5 | 6 | const char* getResourcesPath(void) 7 | { 8 | @autoreleasepool 9 | { 10 | NSArray *paths = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES); 11 | NSString *applicationSupportDirectory = [paths firstObject]; 12 | 13 | return (char*)[applicationSupportDirectory UTF8String]; 14 | } 15 | } 16 | #endif 17 | -------------------------------------------------------------------------------- /dependencies/mac/dependencies.txt: -------------------------------------------------------------------------------- 1 | SDL2: https://www.libsdl.org/download-2.0.php 2 | just download the appropriate development library for your compiler and place it in "./SDL2/" 3 | 4 | libogg: https://xiph.org/downloads/ (libogg) 5 | download the libogg .zip file and unzip it in "./libogg/", then build the library as a framework, and include it in the xcode proj 6 | 7 | libvorbis: https://xiph.org/downloads/ (libvorbis) 8 | download the libvorbis .zip file and unzip it in "./libvorbis/", then build the library as a framework, and include it in the xcode proj 9 | 10 | libtheora: https://xiph.org/downloads/ (libtheora) 11 | download the libtheora .zip file and unzip it in "./libtheora/", then build the library as a framework, and include it in the xcode proj -------------------------------------------------------------------------------- /dependencies/mac/icons/RSDKv3 Decomp Icon-1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SonicMastr/Sonic-CD-Vita/525b0e6035e4b10135cd043e479c96b1f937b9a9/dependencies/mac/icons/RSDKv3 Decomp Icon-1024.png -------------------------------------------------------------------------------- /dependencies/mac/icons/RSDKv3 Decomp Icon-128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SonicMastr/Sonic-CD-Vita/525b0e6035e4b10135cd043e479c96b1f937b9a9/dependencies/mac/icons/RSDKv3 Decomp Icon-128.png -------------------------------------------------------------------------------- /dependencies/mac/icons/RSDKv3 Decomp Icon-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SonicMastr/Sonic-CD-Vita/525b0e6035e4b10135cd043e479c96b1f937b9a9/dependencies/mac/icons/RSDKv3 Decomp Icon-16.png -------------------------------------------------------------------------------- /dependencies/mac/icons/RSDKv3 Decomp Icon-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SonicMastr/Sonic-CD-Vita/525b0e6035e4b10135cd043e479c96b1f937b9a9/dependencies/mac/icons/RSDKv3 Decomp Icon-256.png -------------------------------------------------------------------------------- /dependencies/mac/icons/RSDKv3 Decomp Icon-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SonicMastr/Sonic-CD-Vita/525b0e6035e4b10135cd043e479c96b1f937b9a9/dependencies/mac/icons/RSDKv3 Decomp Icon-32.png -------------------------------------------------------------------------------- /dependencies/mac/icons/RSDKv3 Decomp Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SonicMastr/Sonic-CD-Vita/525b0e6035e4b10135cd043e479c96b1f937b9a9/dependencies/mac/icons/RSDKv3 Decomp Icon-512.png -------------------------------------------------------------------------------- /dependencies/mac/icons/RSDKv3 Decomp Icon-64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SonicMastr/Sonic-CD-Vita/525b0e6035e4b10135cd043e479c96b1f937b9a9/dependencies/mac/icons/RSDKv3 Decomp Icon-64.png -------------------------------------------------------------------------------- /dependencies/win-uwp/dependencies.txt: -------------------------------------------------------------------------------- 1 | Download the latest SDL2 source tarball from https://www.libsdl.org/download-2.0.php, and extract it's contents to a folder called `SDL2`. 2 | 3 | If you wish to build ARM/ARM64 architecture variants, be sure to retarget and build libogg, libtheora and libvorbis for these platforms. 4 | You will need to undefine OC_X86_ASM for libtheora to build correctly, and resulting binaries aren't particularly fast, but do run. -------------------------------------------------------------------------------- /dependencies/windows/dependencies.txt: -------------------------------------------------------------------------------- 1 | SDL2: https://www.libsdl.org/download-2.0.php 2 | download the appropriate development library for your compiler and unzip it in "./SDL2/" 3 | 4 | SDL1 (optional, use SDL2 if you're unsure): https://libsdl.org/download-1.2.php 5 | download the appropriate development library for your compiler and unzip it in "./SDL1/" 6 | 7 | libogg: https://xiph.org/downloads/ (libogg) 8 | download libogg and unzip it in "./libogg/", then build the static library 9 | 10 | libvorbis: https://xiph.org/downloads/ (libvorbis) 11 | download libvorbis and unzip it in "./libvorbis/", then build the VS2010 static library (win32/VS2010/vorbis_static.sln) 12 | 13 | libtheora: https://xiph.org/downloads/ (libtheora) 14 | download libtheora and unzip it in "./libtheora/", then build the VS2008 static library (win32/VS2008/libtheora_static.sln) 15 | ignore any building errors you may get, you should at least build the library itself which is all you need 16 | 17 | glew: http://glew.sourceforge.net/ download binaries, place the unzipped folder into "./" and rename it to "glew" -------------------------------------------------------------------------------- /flatpak/README.md: -------------------------------------------------------------------------------- 1 | # Flatpak 2 | 3 | You will need the FreeDesktop.org 21.08 SDK installed, if you don't have it, 4 | install [Flathub](https://flathub.org/) which provides it. 5 | 6 | # Sonic CD (Original Steam Version) Flatpak 7 | 8 | First, go to your Steam library, right click on Sonic CD and click `Manage` > `Browse local files`. 9 | Copy the `Data.rsdk` file and the `videos` folder into this directory. 10 | 11 | To build and install the flatpak, run: 12 | 13 | **System-wide:** 14 | ``` 15 | $ sudo flatpak-builder --install --force-clean soniccd com.sega.SonicCDSteam.json 16 | ``` 17 | **User:** 18 | ``` 19 | $ flatpak-builder --user --install --force-clean soniccd com.sega.SonicCDSteam.json 20 | ``` 21 | 22 | # Sonic CD (Origins Version) Flatpak 23 | 24 | **This method will not install the video files, as the decompilation 25 | only supports video files from the Steam version. This method will 26 | also not include music or sound effects, as the RSDK file from Origins 27 | does not contain them.** 28 | 29 | First, you need to install Sonic Origins. 30 | To get it, visit https://store.steampowered.com/app/1794960 for the Steam version or https://store.epicgames.com/en-US/p/sonic-origins for the Epic Games version. 31 | 32 | Once you have the game, you need to navigate to the game's files. 33 | If you have the Steam version, go to your Steam library, right click on Sonic Origins and click `Manage` > `Browse local files`. 34 | 35 | Once you're in the game's files, navigate to `image/x64/raw/retro`. Copy the `SonicCDu.rsdk` file into this directory. 36 | 37 | To build and install the flatpak, run: 38 | 39 | **System-wide:** 40 | ``` 41 | $ sudo flatpak-builder --install --force-clean soniccd com.sega.SonicCDOrigins.json 42 | ``` 43 | **User:** 44 | ``` 45 | $ flatpak-builder --user --install --force-clean soniccd com.sega.SonicCDOrigins.json 46 | ``` 47 | 48 | # Sonic CD (Android Version) Flatpak 49 | 50 | **This method will not install the video files, as the decompilation 51 | only supports video files from the Steam version.** 52 | 53 | First, you need to install the game on an Android device. 54 | To get it, visit https://www.sega.com/games/sonic-cd. 55 | 56 | Once you have the game, use a file manager on your device to navigate 57 | to the directory `Android/obb/com.sega.soniccd.classic` and copy the 58 | `patch.[number].com.sega.soniccd.classic.obb` file into this directory as `Data.rsdk`. 59 | 60 | To build and install the flatpak, run: 61 | 62 | **System-wide:** 63 | ``` 64 | $ sudo flatpak-builder --install --force-clean soniccd com.sega.SonicCDAndroid.json 65 | ``` 66 | **User:** 67 | ``` 68 | $ flatpak-builder --user --install --force-clean soniccd com.sega.SonicCDAndroid.json 69 | ``` 70 | 71 | -------------------------------------------------------------------------------- /flatpak/com.sega.SonicCD.appdata.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.sega.SonicCD 4 | Sonic CD 5 | CC0-1.0 6 | It’s time to usher the past into the future in this enhanced recreation of Sonic CD! 7 | 8 | The fate of the world is determined by the choices you make throughout your adventure! Fight through the past, recover the Time Stones, and defeat the evil Metal Sonic in order to save the future from Dr. Eggman's nefarious schemes! 9 | 10 | https://www.sega.com/games/sonic-cd 11 | 12 | https://cdn.sega.com/img_0329.jpg 13 | https://cdn.sega.com/img_0334.jpg 14 | https://cdn.sega.com/img_0340.jpg 15 | https://cdn.sega.com/img_0350.jpg 16 | https://cdn.sega.com/img_0368.jpg 17 | 18 | com.sega.SonicCD.desktop 19 | LicenseRef-proprietary 20 | SEGA 21 | 22 | moderate 23 | none 24 | none 25 | none 26 | none 27 | none 28 | none 29 | none 30 | none 31 | none 32 | none 33 | none 34 | none 35 | intense 36 | none 37 | none 38 | none 39 | none 40 | none 41 | none 42 | 43 | 44 | -------------------------------------------------------------------------------- /flatpak/com.sega.SonicCD.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Type=Application 3 | Name=Sonic CD 4 | Icon=com.sega.SonicCD 5 | Exec=RSDKv3 6 | Categories=Game; 7 | -------------------------------------------------------------------------------- /flatpak/com.sega.SonicCDAndroid.json: -------------------------------------------------------------------------------- 1 | { 2 | "app-id": "com.sega.SonicCD", 3 | "runtime": "org.freedesktop.Platform", 4 | "runtime-version": "21.08", 5 | "sdk": "org.freedesktop.Sdk", 6 | "command": "run.sh", 7 | "finish-args": [ 8 | "--share=ipc", 9 | "--socket=x11", 10 | "--socket=wayland", 11 | "--socket=pulseaudio", 12 | "--persist=.", 13 | "--device=all" 14 | ], 15 | "modules": [ 16 | "shared-modules/glew/glew.json", 17 | "shared-modules/glu/glu-9.json", 18 | { 19 | "name": "soniccd", 20 | "no-autogen": true, 21 | "make-args": [ 22 | "prefix=/app" 23 | ], 24 | "make-install-args": [ 25 | "prefix=/app" 26 | ], 27 | "post-install": [ 28 | "install -Dp -m 644 Data.rsdk /app/share/soniccd/Data.rsdk", 29 | "install -Dp -m 744 run.sh /app/bin/run.sh", 30 | "install -Dp -m 644 com.sega.SonicCD.desktop /app/share/applications/com.sega.SonicCD.desktop", 31 | "install -Dp -m 644 com.sega.SonicCD.svg /app/share/icons/hicolor/256x256/apps/com.sega.SonicCD.svg", 32 | "install -Dp -m 644 com.sega.SonicCD.appdata.xml /app/share/appdata/com.sega.SonicCD.appdata.xml" 33 | ], 34 | "sources": [ 35 | { 36 | "type": "git", 37 | "url": "https://github.com/Rubberduckycooly/Sonic-CD-11-Decompilation.git", 38 | "branch": "master" 39 | }, 40 | { 41 | "type": "file", 42 | "path": "Data.rsdk" 43 | }, 44 | { 45 | "type": "file", 46 | "path": "run.sh" 47 | }, 48 | { 49 | "type": "file", 50 | "path": "com.sega.SonicCD.desktop" 51 | }, 52 | { 53 | "type": "file", 54 | "path": "com.sega.SonicCD.svg" 55 | }, 56 | { 57 | "type": "file", 58 | "path": "com.sega.SonicCD.appdata.xml" 59 | } 60 | ] 61 | } 62 | ] 63 | } 64 | -------------------------------------------------------------------------------- /flatpak/com.sega.SonicCDOrigins.json: -------------------------------------------------------------------------------- 1 | { 2 | "app-id": "com.sega.SonicCD", 3 | "runtime": "org.freedesktop.Platform", 4 | "runtime-version": "21.08", 5 | "sdk": "org.freedesktop.Sdk", 6 | "command": "run.sh", 7 | "finish-args": [ 8 | "--share=ipc", 9 | "--socket=x11", 10 | "--socket=wayland", 11 | "--socket=pulseaudio", 12 | "--persist=.", 13 | "--device=all" 14 | ], 15 | "modules": [ 16 | "shared-modules/glew/glew.json", 17 | "shared-modules/glu/glu-9.json", 18 | { 19 | "name": "soniccd", 20 | "no-autogen": true, 21 | "make-args": [ 22 | "prefix=/app" 23 | ], 24 | "make-install-args": [ 25 | "prefix=/app" 26 | ], 27 | "post-install": [ 28 | "install -Dp -m 644 SonicCDu.rsdk /app/share/soniccd/Data.rsdk", 29 | "install -Dp -m 744 run.sh /app/bin/run.sh", 30 | "install -Dp -m 644 com.sega.SonicCD.desktop /app/share/applications/com.sega.SonicCD.desktop", 31 | "install -Dp -m 644 com.sega.SonicCD.svg /app/share/icons/hicolor/256x256/apps/com.sega.SonicCD.svg", 32 | "install -Dp -m 644 com.sega.SonicCD.appdata.xml /app/share/appdata/com.sega.SonicCD.appdata.xml" 33 | ], 34 | "sources": [ 35 | { 36 | "type": "git", 37 | "url": "https://github.com/Rubberduckycooly/Sonic-CD-11-Decompilation.git", 38 | "branch": "master" 39 | }, 40 | { 41 | "type": "file", 42 | "path": "SonicCDu.rsdk" 43 | }, 44 | { 45 | "type": "file", 46 | "path": "run.sh" 47 | }, 48 | { 49 | "type": "file", 50 | "path": "com.sega.SonicCD.desktop" 51 | }, 52 | { 53 | "type": "file", 54 | "path": "com.sega.SonicCD.svg" 55 | }, 56 | { 57 | "type": "file", 58 | "path": "com.sega.SonicCD.appdata.xml" 59 | } 60 | ] 61 | } 62 | ] 63 | } 64 | -------------------------------------------------------------------------------- /flatpak/com.sega.SonicCDSteam.json: -------------------------------------------------------------------------------- 1 | { 2 | "app-id": "com.sega.SonicCD", 3 | "runtime": "org.freedesktop.Platform", 4 | "runtime-version": "21.08", 5 | "sdk": "org.freedesktop.Sdk", 6 | "command": "run.sh", 7 | "finish-args": [ 8 | "--share=ipc", 9 | "--socket=x11", 10 | "--socket=wayland", 11 | "--socket=pulseaudio", 12 | "--persist=.", 13 | "--device=all" 14 | ], 15 | "modules": [ 16 | "shared-modules/glew/glew.json", 17 | "shared-modules/glu/glu-9.json", 18 | { 19 | "name": "soniccd", 20 | "no-autogen": true, 21 | "make-args": [ 22 | "prefix=/app" 23 | ], 24 | "make-install-args": [ 25 | "prefix=/app" 26 | ], 27 | "post-install": [ 28 | "install -Dp -m 644 Data.rsdk /app/share/soniccd/Data.rsdk", 29 | "install -Dp -m 744 run.sh /app/bin/run.sh", 30 | "install -Dp -m 644 Bad_Ending.ogv /app/share/soniccd/videos/Bad_Ending.ogv", 31 | "install -Dp -m 644 Good_Ending.ogv /app/share/soniccd/videos/Good_Ending.ogv", 32 | "install -Dp -m 644 Opening.ogv /app/share/soniccd/videos/Opening.ogv", 33 | "install -Dp -m 644 Pencil_Test.ogv /app/share/soniccd/videos/Pencil_Test.ogv", 34 | "install -Dp -m 644 com.sega.SonicCD.desktop /app/share/applications/com.sega.SonicCD.desktop", 35 | "install -Dp -m 644 com.sega.SonicCD.svg /app/share/icons/hicolor/256x256/apps/com.sega.SonicCD.svg", 36 | "install -Dp -m 644 com.sega.SonicCD.appdata.xml /app/share/appdata/com.sega.SonicCD.appdata.xml" 37 | ], 38 | "sources": [ 39 | { 40 | "type": "git", 41 | "url": "https://github.com/Rubberduckycooly/Sonic-CD-11-Decompilation.git", 42 | "branch": "master" 43 | }, 44 | { 45 | "type": "file", 46 | "path": "Data.rsdk" 47 | }, 48 | { 49 | "type": "file", 50 | "path": "run.sh" 51 | }, 52 | { 53 | "type": "dir", 54 | "path": "videos" 55 | }, 56 | { 57 | "type": "file", 58 | "path": "com.sega.SonicCD.desktop" 59 | }, 60 | { 61 | "type": "file", 62 | "path": "com.sega.SonicCD.svg" 63 | }, 64 | { 65 | "type": "file", 66 | "path": "com.sega.SonicCD.appdata.xml" 67 | } 68 | ] 69 | } 70 | ] 71 | } 72 | -------------------------------------------------------------------------------- /flatpak/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | [ -f /app/share/soniccd/Data.rsdk ] && ln -sf /app/share/soniccd/Data.rsdk . 4 | 5 | RSDKv3 -------------------------------------------------------------------------------- /header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SonicMastr/Sonic-CD-Vita/525b0e6035e4b10135cd043e479c96b1f937b9a9/header.png -------------------------------------------------------------------------------- /props/winactions.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | C:/vcpkg/installed/x86-windows-static/lib/;$(SolutionDir)dependencies/windows/SDL2/lib/$(PlatformTargetAsMSBuildArchitecture)/;$(SolutionDir)dependencies/windows/glew/lib/Release/$(Platform)/ 6 | SDL2.lib;SDL2main.lib;ogg.lib;vorbis.lib;vorbisfile.lib;theora.lib;Opengl32.lib;glu32.lib;glew32.lib;Shell32.lib;Advapi32.lib 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /props/winactions_x64.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | C:/vcpkg/installed/x64-windows-static/lib/;$(SolutionDir)dependencies/windows/SDL2/lib/$(PlatformTargetAsMSBuildArchitecture)/;$(SolutionDir)dependencies/windows/glew/lib/Release/$(Platform)/ 6 | SDL2.lib;SDL2main.lib;ogg.lib;vorbis.lib;vorbisfile.lib;theora.lib;Opengl32.lib;glu32.lib;glew32.lib;Shell32.lib;Advapi32.lib 7 | 8 | 9 | 10 | --------------------------------------------------------------------------------
The fate of the world is determined by the choices you make throughout your adventure! Fight through the past, recover the Time Stones, and defeat the evil Metal Sonic in order to save the future from Dr. Eggman's nefarious schemes!