diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..e8e9c5123 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,21 @@ +root = true + +[*] +insert_final_newline = false +trim_trailing_whitespace = true +charset = utf-8 + +[*.{nix,md,MD,sh,yml}] +insert_final_newline = true +end_of_line = lf +indent_style = space +indent_size = 2 + +[*.{c,C,h,H}] +indent_style = tab +indent_size = 4 + +[Makefile] +insert_final_newline = true +end_of_line = lf +indent_style = tab \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 000000000..1730aa397 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,23 @@ +name: Build main + +on: + push: + branches: + - main + +permissions: + contents: read + pages: write + id-token: write + +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - name: Build + run: nix build -L --no-link --keep-going .#all diff --git a/.gitignore b/.gitignore index 3157e34d9..cad4f256a 100644 --- a/.gitignore +++ b/.gitignore @@ -25,7 +25,8 @@ offset.txt comport.txt gcc_out.txt overlay.ld -Makefile +rebuild_PC/result +/result # Version tracker tools/updater/.version diff --git a/decompile/General/232/232_35_AH_MaskHint_Update.c b/decompile/General/232/232_35_AH_MaskHint_Update.c index 202a728a1..4490c76eb 100644 --- a/decompile/General/232/232_35_AH_MaskHint_Update.c +++ b/decompile/General/232/232_35_AH_MaskHint_Update.c @@ -15,7 +15,7 @@ void DECOMP_AH_MaskHint_Update() sdata->AkuAkuHintState++; break; - case 1: + case 1: { int absSpeedApprox = d->speedApprox; if(absSpeedApprox < 0) absSpeedApprox = -absSpeedApprox; if(absSpeedApprox > 0x31) return; @@ -65,7 +65,7 @@ void DECOMP_AH_MaskHint_Update() D232.maskWarppadDelayFrames = FPS_DOUBLE(60); sdata->AkuAkuHintState++; - break; + } break; case 2: @@ -189,7 +189,7 @@ void DECOMP_AH_MaskHint_Update() // stay here forever stuck break; - case 4: + case 4: { int lngIndex = 0; int boolFound = 0; short* ptrLngID = &D232.hintMenu_lngIndexArr[0]; @@ -270,7 +270,7 @@ void DECOMP_AH_MaskHint_Update() // show map again gGT->hudFlags &= ~(0x10); } - break; + } break; case 5: diff --git a/decompile/General/GHOST/GhostReplay_ThTick.c b/decompile/General/GHOST/GhostReplay_ThTick.c index 1184c7a34..597e63743 100644 --- a/decompile/General/GHOST/GhostReplay_ThTick.c +++ b/decompile/General/GHOST/GhostReplay_ThTick.c @@ -316,7 +316,7 @@ void DECOMP_GhostReplay_ThTick(struct Thread *t) tape->packetID++; break; - case 0x81: // Animation + case 0x81: { // Animation int numAnimFrames = DECOMP_INSTANCE_GetNumAnimFrames(inst, buffer[1]); inst->animIndex = (numAnimFrames < 1) ? 0 : buffer[1]; inst->animFrame = (buffer[2] == 0 || numAnimFrames <= buffer[2]) @@ -333,7 +333,7 @@ void DECOMP_GhostReplay_ThTick(struct Thread *t) #endif buffer += 3; - break; + } break; case 0x82: // Boost if ( diff --git a/decompile/General/LOAD/LOAD_A27_HowlSectorChainStart.c b/decompile/General/LOAD/LOAD_A27_HowlSectorChainStart.c index 7b4a1e96b..700508395 100644 --- a/decompile/General/LOAD/LOAD_A27_HowlSectorChainStart.c +++ b/decompile/General/LOAD/LOAD_A27_HowlSectorChainStart.c @@ -40,4 +40,5 @@ int DECOMP_LOAD_HowlSectorChainStart(CdlFILE* cdlFileHWL, void* ptrDestination, DECOMP_LOAD_HowlCallback(CdlComplete); #endif + return 1; } \ No newline at end of file diff --git a/decompile/General/MAIN/MainDB_GetClipSize.c b/decompile/General/MAIN/MainDB_GetClipSize.c index 42f95e161..220d4f7bd 100644 --- a/decompile/General/MAIN/MainDB_GetClipSize.c +++ b/decompile/General/MAIN/MainDB_GetClipSize.c @@ -1,6 +1,6 @@ #include -u_int DECOMP_MainDB_GetClipSize(u_int levelID, int numPlyrCurrGame) +int DECOMP_MainDB_GetClipSize(u_int levelID, int numPlyrCurrGame) { if(levelID == PAPU_PYRAMID || levelID == POLAR_PASS) if (2 < numPlyrCurrGame) diff --git a/decompile/General/MEMPACK/MEMPACK_Init.c b/decompile/General/MEMPACK/MEMPACK_Init.c index 7dc05fa01..390c84bfb 100644 --- a/decompile/General/MEMPACK/MEMPACK_Init.c +++ b/decompile/General/MEMPACK/MEMPACK_Init.c @@ -23,6 +23,11 @@ void DECOMP_MEMPACK_Init(int ramSize) // Visual Studio -> Properties -> Linker -> Advanced -> // Base Address, Randomized Base Address, Fixed Base Address ptrMempack->start = &memory[0]; + printf( + "[CTR] Where does memory starts? (%s) %08x\n", + (ptrMempack->start < 0x01000000 ? "GOOD" : "BAD"), + ptrMempack->start + ); memset(memory, 0, 8*1024*1024); ptrMempack->endOfAllocator = &memory[8*1024*1024 - 4]; diff --git a/decompile/General/RaceFlag/RaceFlag_t11_GetOT.c b/decompile/General/RaceFlag/RaceFlag_t11_GetOT.c index 3243e328c..e87eb05ba 100644 --- a/decompile/General/RaceFlag/RaceFlag_t11_GetOT.c +++ b/decompile/General/RaceFlag/RaceFlag_t11_GetOT.c @@ -1,13 +1,13 @@ #include -int DECOMP_RaceFlag_GetOT(void) +u_int* DECOMP_RaceFlag_GetOT(void) { short sVar1; int iVar2; struct GameTracker* gGT = sdata->gGT; - int* otDrawFirst_FarthestDepth; - int* otDrawLast_ClosestDepth; + u_int* otDrawFirst_FarthestDepth; + u_int* otDrawLast_ClosestDepth; otDrawFirst_FarthestDepth = &gGT->pushBuffer[0].ptrOT[0x3FF]; otDrawLast_ClosestDepth = gGT->otSwapchainDB[gGT->swapchainIndex]; @@ -93,4 +93,4 @@ int DECOMP_RaceFlag_GetOT(void) } return otDrawLast_ClosestDepth; -} +} \ No newline at end of file diff --git a/decompile/General/RaceFlag/RaceFlag_t13_DrawLoadingString.c b/decompile/General/RaceFlag/RaceFlag_t13_DrawLoadingString.c index c18d05fdc..694834c0c 100644 --- a/decompile/General/RaceFlag/RaceFlag_t13_DrawLoadingString.c +++ b/decompile/General/RaceFlag/RaceFlag_t13_DrawLoadingString.c @@ -12,7 +12,7 @@ void DECOMP_RaceFlag_DrawLoadingString(void) char *pbVar8; int iVar9; int iVar10; - int uVar11; + u_int *uVar11; char local_30; char local_2f; @@ -49,8 +49,10 @@ void DECOMP_RaceFlag_DrawLoadingString(void) iVar10 = (sdata->RaceFlag_Transition & 0xffff) - ( - ((iVar3 << 0x10) >> 0x10) - - ((iVar3 << 0x10) >> 0x1f) >> 1 + ( + ((iVar3 << 0x10) >> 0x10) - + ((iVar3 << 0x10) >> 0x1f) + ) >> 1 ); iVar3 = FPS_HALF(sdata->RaceFlag_LoadingTextAnimFrame); diff --git a/decompile/General/RaceFlag/RaceFlag_t14_DrawSelf.c b/decompile/General/RaceFlag/RaceFlag_t14_DrawSelf.c index 4751403ea..c7c2f8b26 100644 --- a/decompile/General/RaceFlag/RaceFlag_t14_DrawSelf.c +++ b/decompile/General/RaceFlag/RaceFlag_t14_DrawSelf.c @@ -1,16 +1,16 @@ #include #ifdef REBUILD_PC -int scratchpadBuf[0x1000]; +u_int scratchpadBuf[0x1000]; #endif force_inline char RaceFlag_CalculateBrightness(u_int sine, u_char darkTile) { if (darkTile) { - return sine * -55 + 0x140000 >> 0xD; + return((sine * -55 + 0x140000) >> 0xD); } - return sine * -125 + 0x1fe000 >> 0xD; + return((sine * -125 + 0x1fe000) >> 0xD); } void DECOMP_RaceFlag_DrawSelf() @@ -20,7 +20,7 @@ void DECOMP_RaceFlag_DrawSelf() u_char toggle; short flagPos; u_long *ot; - long *scratchpad; + u_int *scratchpad; u_int screenlimit; u_int dimensions; int approx[2]; @@ -171,7 +171,7 @@ void DECOMP_RaceFlag_DrawSelf() #ifdef REBUILD_PC top = &scratchpadBuf[(toggle * 0x78 / 4) - 1]; toggle = toggle ^ 1; - bottom = &scratchpadBuf[(toggle * 0x78 / 4) - 0]; + bottom = &scratchpadBuf[(toggle * 0x78 / 4)]; #else top = (u_int *)((0x1f800000 + toggle * 0x78) - 4); toggle = toggle ^ 1; diff --git a/decompile/General/zGlobal_SDATA.c b/decompile/General/zGlobal_SDATA.c index b0654255d..6695dcc43 100644 --- a/decompile/General/zGlobal_SDATA.c +++ b/decompile/General/zGlobal_SDATA.c @@ -5,6 +5,10 @@ #include +#if __GNUC__ +char memcardBytes[0x1680]; +#endif + struct sData sdata_static = { .langBufferSize = 0x3F04, @@ -353,6 +357,9 @@ struct sData sdata_static = #if NO_BSS .ptrToMemcardBuffer1 = 0x800992e4, .ptrToMemcardBuffer2 = 0x800992e4, +#elif __GNUC__ + .ptrToMemcardBuffer1 = &memcardBytes[0], + .ptrToMemcardBuffer2 = &memcardBytes[0], #else .ptrToMemcardBuffer1 = &sdata_static.memcardBytes[0], .ptrToMemcardBuffer2 = &sdata_static.memcardBytes[0], diff --git a/flake.lock b/flake.lock new file mode 100644 index 000000000..fe48b2e23 --- /dev/null +++ b/flake.lock @@ -0,0 +1,25 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1712439257, + "narHash": "sha256-aSpiNepFOMk9932HOax0XwNxbA38GOUVOiXfUVPOrck=", + "rev": "ff0dbd94265ac470dda06a657d5fe49de93b4599", + "revCount": 608655, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.608655%2Brev-ff0dbd94265ac470dda06a657d5fe49de93b4599/018eb77a-ddbc-7dfa-9c9c-d5444d2bb52f/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/NixOS/nixpkgs/0.1.%2A.tar.gz" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 000000000..504360509 --- /dev/null +++ b/flake.nix @@ -0,0 +1,29 @@ +{ + inputs.nixpkgs.url = https://flakehub.com/f/NixOS/nixpkgs/0.1.*.tar.gz; + outputs = { self, nixpkgs }: rec { + packages.x86_64-linux = with nixpkgs.legacyPackages.x86_64-linux; rec { + native32 = with pkgsi686Linux; { + gcc = callPackage ./rebuild_PC { ctrModSDK = self; }; + clang = callPackage ./rebuild_PC { ctrModSDK = self; stdenv = clangStdenv; }; + }; + mingw32 = with pkgsCross.mingw32; { + gcc = callPackage ./rebuild_PC { ctrModSDK = self; }; + clang = callPackage ./rebuild_PC { ctrModSDK = self; stdenv = clangStdenv; }; + }; + all = stdenvNoCC.mkDerivation { + name = "ctr-join"; + dontUnpack = true; + dontBuild = true; + installPhase = '' + mkdir $out + ln -s ${native32.gcc} $out/native32-gcc + ln -s ${native32.clang} $out/native32-clang + ln -s ${mingw32.gcc} $out/mingw32-gcc + ln -s ${mingw32.clang} $out/mingw32-clang + ''; + }; + }; + # default + package.x86_64-linux = packages.x86_64-linux.native32.gcc; + }; +} diff --git a/include/common.h b/include/common.h index c339efef2..6e6bbf3c1 100644 --- a/include/common.h +++ b/include/common.h @@ -87,7 +87,7 @@ #include #include #include -#include +#include #include #ifndef REBUILD_PC diff --git a/include/math.h b/include/ctr_math.h similarity index 100% rename from include/math.h rename to include/ctr_math.h diff --git a/rebuild_PC/CrashTeamRacingPC.c b/rebuild_PC/CrashTeamRacingPC.c index 004feee5f..af1d97d10 100644 --- a/rebuild_PC/CrashTeamRacingPC.c +++ b/rebuild_PC/CrashTeamRacingPC.c @@ -1,5 +1,10 @@ - // ======= Headers ============= +#if __GNUC__ +#include +#define _EnterCriticalSection(x) +#define EnterCriticalSection(x) +#define ExitCriticalSection() +#endif #define _CRT_SECURE_NO_WARNINGS #define REBUILD_PC @@ -57,11 +62,15 @@ typedef enum { // work in PsyXKeyboardHandler, workaround: int NikoGetEnterKey() { +#if __GNUC__ + return 0; +#else // dont use Windows.h __declspec(dllimport) short __stdcall - GetAsyncKeyState(_In_ int vKey); + GetAsyncKeyState(int vKey); return GetAsyncKeyState(0xd); +#endif } void PsyXKeyboardHandler(int key, char down) @@ -90,11 +99,36 @@ int NikoCalcFPS() printf("NikoCalcFPS: %d fps\n", (1000 * frameGap) / delta); } -int main() +#ifndef CC + #if __GNUC__ + #if _WIN32 + #ifndef __clang__ + #define CC "MINGW-GCC" + #else + #define CC "MINGW-CLANG" + #endif + #else + #ifndef __clang__ + #define CC "GCC" + #else + #define CC "CLANG" + #endif + #endif + #elif defined(_MSC_VER) + #define CC "MSVC" + #else + #define CC "Unknown" + #endif +#endif + +int main(int argc, char* argv[]) { + printf("[CTR] Built with: " CC "\n"); #ifdef USE_16BY9 + printf("[CTR] USE_16BY9=1\n"); PsyX_Initialise("CTRPC", 1280, 720, 0); #else + printf("[CTR] USE_16BY9=0\n"); PsyX_Initialise("CTRPC", 800, 600, 0); #endif diff --git a/rebuild_PC/Makefile b/rebuild_PC/Makefile new file mode 100644 index 000000000..efdbf3d38 --- /dev/null +++ b/rebuild_PC/Makefile @@ -0,0 +1,20 @@ +.PHONY: all + +CFLAGS+=-std=c99 -DUSE_16BY9=1 -O2 \ + -I./PsyCross/include -I../include \ + `${PKG_CONFIG} --cflags sdl2` + +# Clang is rigorous +CFLAGS+=-Wno-int-conversion -Wno-incompatible-function-pointer-types -Wno-implicit-function-declaration -Wno-return-type + +LDLIBS+=-lpsycross \ + `${PKG_CONFIG} --libs sdl2` \ + `${PKG_CONFIG} --libs openal` \ + -lstdc++ -lm + +# Clang always needs "no-pie", some distros might add PIE to GCC too. +LDFLAGS+=-fno-pie -no-pie -Wl,-Ttext,0x00D00000 + +CrashTeamRacingPC: CrashTeamRacingPC.o + +all: CrashTeamRacingPC diff --git a/rebuild_PC/PsyCross.nix b/rebuild_PC/PsyCross.nix new file mode 100644 index 000000000..f40738b32 --- /dev/null +++ b/rebuild_PC/PsyCross.nix @@ -0,0 +1,77 @@ +{ lib +, stdenv +, pkg-config +, cmake +, SDL2 +, openal +, fetchFromGitHub +, psyCrossDebug ? false +}: + +let + isWindows = stdenv.hostPlatform.uname.system == "Windows"; + + openalWithWindows = + if isWindows then + (openal.override { + alsaSupport = false; + dbusSupport = false; + pipewireSupport = false; + pulseSupport = false; + inherit stdenv; + }).overrideAttrs (prevAttrs: { + meta = prevAttrs.meta // { inherit (SDL2.meta) platforms; }; + }) + else openal.override { inherit stdenv; }; +in +stdenv.mkDerivation (finalAttrs: { + pname = "PsyCross"; + version = "unstable-2024-02-14-0ce306d6c"; + + src = fetchFromGitHub { + owner = "OpenDriver2"; + repo = "PsyCross"; + rev = "0ce306d6c32412986037e7e5e1dbdc1bf72e066a"; + hash = "sha256-c57xyzM7GkL9SazUUxAM4DVXxb7cTcjJxgJpZ7UMBVQ="; + }; + + # Shows the proper compile date in the logs (taken from commit date) + env.SOURCE_DATE_EPOCH = "1712578640"; + + nativeBuildInputs = [ pkg-config cmake ]; + propagatedBuildInputs = [ (SDL2.override { inherit stdenv; }) openalWithWindows ]; + + hardeningDisable = [ "format" ]; + + CFLAGS = "-Wno-implicit-function-declaration" + lib.strings.optionalString psyCrossDebug "-D_DEBUG=1 -g -gdwarf-2 -O0"; + CXXFLAGS = lib.strings.optionalString psyCrossDebug "-D_DEBUG=1 -g -gdwarf-2 -O0"; + dontStrip = psyCrossDebug; + + postPatch = '' + substituteInPlace 'include/PsyX/PsyX_config.h' \ + --replace-fail 'USE_EXTENDED_PRIM_POINTERS 1' 'USE_EXTENDED_PRIM_POINTERS 0' + ''; + + installPhase = '' + runHook preInstall + + mkdir "$out" + cp -r ../include "$out/include" + cp libpsycross.a "$out/libpsycross.a" + + runHook postInstall + ''; + + passthru = { + inherit SDL2; + openal = openalWithWindows; + }; + + meta = { + description = "Compatibility framework for building and running Psy-Q SDK"; + homepage = "https://github.com/OpenDriver2/PsyCross"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ pedrohlc ]; + inherit (SDL2.meta) platforms; + }; +}) diff --git a/rebuild_PC/README.md b/rebuild_PC/README.md new file mode 100644 index 000000000..bacecd083 --- /dev/null +++ b/rebuild_PC/README.md @@ -0,0 +1,9 @@ +### Compiling + +The following are required to successfully build CTR-PC: +- Target 32-bit artifacts; +- Use 32-bit libraries; +- Needs PsyCross built with `USE_EXTENDED_PRIM=0`; +- On MSVC use "Fixed Base Address", on GCC move `-Wl,-Ttext,0x0` to the earliest position that does not conflict. + +For Windows open `CrashTeamRacingPC.c` with VisualStudio; for [Mingw](https://www.mingw-w64.org/)/Linux/Darwin use the `Makefile`; [Nix](https://nixos.org/download/#download-nix) users can use `./build-{native,mingw}-{gcc,clang}.nix` directly. diff --git a/rebuild_PC/build-all.sh b/rebuild_PC/build-all.sh new file mode 100755 index 000000000..41bdbdd61 --- /dev/null +++ b/rebuild_PC/build-all.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env sh +set -e + +if ! [ -e ./CrashTeamRacingPC.c ]; then + echo "Wrong \$PWD!" + exit 1 +fi + +if [ -e ./result ]; then + if ! [ -e ./result/native-gcc ]; then + echo "Cleanup first!" + exit 2 + fi +else + mkdir ./result +fi + +for target in {native,mingw}-{gcc,clang}; do + ./build-${target}.nix -o ./result/$target +done + +echo 'Finished successfully' diff --git a/rebuild_PC/build-mingw-clang.nix b/rebuild_PC/build-mingw-clang.nix new file mode 100755 index 000000000..c0486c34c --- /dev/null +++ b/rebuild_PC/build-mingw-clang.nix @@ -0,0 +1,6 @@ +#! /usr/bin/env nix-build +{ pkgs ? import {} +, pkgsCross ? pkgs.pkgsCross.mingw32 +}: + +pkgsCross.callPackage ./default.nix { stdenv = pkgsCross.clangStdenv; } diff --git a/rebuild_PC/build-mingw-gcc.nix b/rebuild_PC/build-mingw-gcc.nix new file mode 100755 index 000000000..03267b3bf --- /dev/null +++ b/rebuild_PC/build-mingw-gcc.nix @@ -0,0 +1,6 @@ +#! /usr/bin/env nix-build +{ pkgs ? import {} +, pkgsCross ? pkgs.pkgsCross.mingw32 +}: + +pkgsCross.callPackage ./default.nix {} diff --git a/rebuild_PC/build-native-clang.nix b/rebuild_PC/build-native-clang.nix new file mode 100755 index 000000000..6fcfc05d2 --- /dev/null +++ b/rebuild_PC/build-native-clang.nix @@ -0,0 +1,6 @@ +#! /usr/bin/env nix-build +{ pkgs ? import {} +, pkgsCross ? pkgs.pkgsi686Linux +}: + +pkgsCross.callPackage ./default.nix { stdenv = pkgsCross.clangStdenv; } diff --git a/rebuild_PC/build-native-gcc.nix b/rebuild_PC/build-native-gcc.nix new file mode 100755 index 000000000..25fb86a85 --- /dev/null +++ b/rebuild_PC/build-native-gcc.nix @@ -0,0 +1,6 @@ +#! /usr/bin/env nix-build +{ pkgs ? import {} +, pkgsCross ? pkgs.pkgsi686Linux +}: + +pkgsCross.callPackage ./default.nix {} diff --git a/rebuild_PC/default.nix b/rebuild_PC/default.nix new file mode 100644 index 000000000..8196b7b93 --- /dev/null +++ b/rebuild_PC/default.nix @@ -0,0 +1,66 @@ +{ lib +, stdenv +, callPackage +, pkg-config +, ctrModSDK ? ./.. +, psyCross ? callPackage ./PsyCross.nix { inherit psyCrossDebug; } +, psyCrossDebug ? false +}: + +let + isWindows = stdenv.hostPlatform.uname.system == "Windows"; + + mainProgram = if isWindows then "CrashTeamRacingPC.exe" else "CrashTeamRacingPC"; +in +stdenv.mkDerivation (finalAttrs: { + pname = "CTR-PC"; + version = "0.0.1"; + + src = ctrModSDK; + sourceRoot = + if ctrModSDK == ./.. then "CTR-ModSDK/rebuild_PC" + else "source/rebuild_PC"; + + nativeBuildInputs = [ pkg-config ]; + buildInputs = psyCross.propagatedBuildInputs; + + LDLIBS = "-L./PsyCross"; + + # Disables incompatible hardening + hardeningDisable = [ "format" ]; + + postPatch = '' + rm -r PsyCross + ln -s ${psyCross} PsyCross + ''; + + installPhase = '' + runHook preInstall + + mkdir -p $out/bin + '' + lib.strings.optionalString isWindows '' + cp ${psyCross.openal}/bin/*.dll $out/bin/ + cp ${psyCross.SDL2}/bin/*.dll $out/bin/ + '' + '' + cp ${mainProgram} $out/bin/ + + runHook postInstall + ''; + + # Debug + CFLAGS = "-g -gdwarf-2"; + dontStrip = true; + passthru = { inherit psyCross; }; + + # Shows the proper compile date in the logs + env.SOURCE_DATE_EPOCH = (builtins.currentTime or ctrModSDK.lastModified); + + meta = { + description = "CTR in C"; + homepage = "https://github.com/CTR-tools/CTR-ModSDK"; + license = lib.licenses.publicDomain; + maintainers = with lib.maintainers; [ pedrohlc ]; + inherit mainProgram; + inherit (psyCross.meta) platforms; + }; +}) diff --git a/rebuild_PS1/TEST_DrawInstances.c b/rebuild_PS1/TEST_DrawInstances.c index e241d49b1..ec963e602 100644 --- a/rebuild_PS1/TEST_DrawInstances.c +++ b/rebuild_PS1/TEST_DrawInstances.c @@ -3,7 +3,9 @@ int bi = 0; #ifdef REBUILD_PC -inline +#ifndef __GNUC__ +inline +#endif #endif int GetBit(unsigned int* vertData) { diff --git a/rebuild_PS1/main.c b/rebuild_PS1/main.c index f11c73f03..443515b99 100644 --- a/rebuild_PS1/main.c +++ b/rebuild_PS1/main.c @@ -78,7 +78,7 @@ #include "../decompile/General/DecalHUD/DecalHUD_DrawPolyGT4.c" #include "../decompile/General/DecalHUD/DecalHUD_Arrow2D.c" -#include "../decompile/General/DISPLAY/DISPLAY_Swap.c" +#include "../decompile/General/Display/DISPLAY_Swap.c" #include "../decompile/General/DotLights/DotLights.c" #include "../decompile/General/DropRain/DropRain.c"