Skip to content

Commit f28101e

Browse files
authored
rebuild_PC: support more systems (Mingw and Linux) (#111)
* pc: support more systems * move to %08x * include SDL2 only for us * no critical session only for us * make it playable in clang * clang fixes, adopt my PsyCross PR, and flakenize * add CI building them all * make -O2 the default
1 parent 6a35996 commit f28101e

28 files changed

+394
-26
lines changed

.editorconfig

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
root = true
2+
3+
[*]
4+
insert_final_newline = false
5+
trim_trailing_whitespace = true
6+
charset = utf-8
7+
8+
[*.{nix,md,MD,sh,yml}]
9+
insert_final_newline = true
10+
end_of_line = lf
11+
indent_style = space
12+
indent_size = 2
13+
14+
[*.{c,C,h,H}]
15+
indent_style = tab
16+
indent_size = 4
17+
18+
[Makefile]
19+
insert_final_newline = true
20+
end_of_line = lf
21+
indent_style = tab

.github/workflows/main.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Build main
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
jobs:
14+
check:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
- uses: DeterminateSystems/nix-installer-action@main
21+
- uses: DeterminateSystems/magic-nix-cache-action@main
22+
- name: Build
23+
run: nix build -L --no-link --keep-going .#all

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ offset.txt
2525
comport.txt
2626
gcc_out.txt
2727
overlay.ld
28-
Makefile
28+
rebuild_PC/result
29+
/result
2930

3031
# Version tracker
3132
tools/updater/.version

decompile/General/232/232_35_AH_MaskHint_Update.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ void DECOMP_AH_MaskHint_Update()
1515
sdata->AkuAkuHintState++;
1616
break;
1717

18-
case 1:
18+
case 1: {
1919
int absSpeedApprox = d->speedApprox;
2020
if(absSpeedApprox < 0) absSpeedApprox = -absSpeedApprox;
2121
if(absSpeedApprox > 0x31) return;
@@ -65,7 +65,7 @@ void DECOMP_AH_MaskHint_Update()
6565
D232.maskWarppadDelayFrames = FPS_DOUBLE(60);
6666

6767
sdata->AkuAkuHintState++;
68-
break;
68+
} break;
6969

7070
case 2:
7171

@@ -189,7 +189,7 @@ void DECOMP_AH_MaskHint_Update()
189189
// stay here forever stuck
190190
break;
191191

192-
case 4:
192+
case 4: {
193193
int lngIndex = 0;
194194
int boolFound = 0;
195195
short* ptrLngID = &D232.hintMenu_lngIndexArr[0];
@@ -270,7 +270,7 @@ void DECOMP_AH_MaskHint_Update()
270270
// show map again
271271
gGT->hudFlags &= ~(0x10);
272272
}
273-
break;
273+
} break;
274274

275275
case 5:
276276

decompile/General/GHOST/GhostReplay_ThTick.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ void DECOMP_GhostReplay_ThTick(struct Thread *t)
316316
tape->packetID++;
317317
break;
318318

319-
case 0x81: // Animation
319+
case 0x81: { // Animation
320320
int numAnimFrames = DECOMP_INSTANCE_GetNumAnimFrames(inst, buffer[1]);
321321
inst->animIndex = (numAnimFrames < 1) ? 0 : buffer[1];
322322
inst->animFrame = (buffer[2] == 0 || numAnimFrames <= buffer[2])
@@ -333,7 +333,7 @@ void DECOMP_GhostReplay_ThTick(struct Thread *t)
333333
#endif
334334

335335
buffer += 3;
336-
break;
336+
} break;
337337

338338
case 0x82: // Boost
339339
if (

decompile/General/LOAD/LOAD_A27_HowlSectorChainStart.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,5 @@ int DECOMP_LOAD_HowlSectorChainStart(CdlFILE* cdlFileHWL, void* ptrDestination,
4040
DECOMP_LOAD_HowlCallback(CdlComplete);
4141

4242
#endif
43+
return 1;
4344
}

decompile/General/MAIN/MainDB_GetClipSize.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include <common.h>
22

3-
u_int DECOMP_MainDB_GetClipSize(u_int levelID, int numPlyrCurrGame)
3+
int DECOMP_MainDB_GetClipSize(u_int levelID, int numPlyrCurrGame)
44
{
55
if(levelID == PAPU_PYRAMID || levelID == POLAR_PASS)
66
if (2 < numPlyrCurrGame)

decompile/General/MEMPACK/MEMPACK_Init.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ void DECOMP_MEMPACK_Init(int ramSize)
2323
// Visual Studio -> Properties -> Linker -> Advanced ->
2424
// Base Address, Randomized Base Address, Fixed Base Address
2525
ptrMempack->start = &memory[0];
26+
printf(
27+
"[CTR] Where does memory starts? (%s) %08x\n",
28+
(ptrMempack->start < 0x01000000 ? "GOOD" : "BAD"),
29+
ptrMempack->start
30+
);
2631
memset(memory, 0, 8*1024*1024);
2732

2833
ptrMempack->endOfAllocator = &memory[8*1024*1024 - 4];

decompile/General/RaceFlag/RaceFlag_t11_GetOT.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#include <common.h>
22

3-
int DECOMP_RaceFlag_GetOT(void)
3+
u_int* DECOMP_RaceFlag_GetOT(void)
44
{
55
short sVar1;
66
int iVar2;
77
struct GameTracker* gGT = sdata->gGT;
88

9-
int* otDrawFirst_FarthestDepth;
10-
int* otDrawLast_ClosestDepth;
9+
u_int* otDrawFirst_FarthestDepth;
10+
u_int* otDrawLast_ClosestDepth;
1111

1212
otDrawFirst_FarthestDepth = &gGT->pushBuffer[0].ptrOT[0x3FF];
1313
otDrawLast_ClosestDepth = gGT->otSwapchainDB[gGT->swapchainIndex];
@@ -93,4 +93,4 @@ int DECOMP_RaceFlag_GetOT(void)
9393
}
9494

9595
return otDrawLast_ClosestDepth;
96-
}
96+
}

decompile/General/RaceFlag/RaceFlag_t13_DrawLoadingString.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ void DECOMP_RaceFlag_DrawLoadingString(void)
1212
char *pbVar8;
1313
int iVar9;
1414
int iVar10;
15-
int uVar11;
15+
u_int *uVar11;
1616
char local_30;
1717
char local_2f;
1818

@@ -49,8 +49,10 @@ void DECOMP_RaceFlag_DrawLoadingString(void)
4949
iVar10 =
5050
(sdata->RaceFlag_Transition & 0xffff) -
5151
(
52-
((iVar3 << 0x10) >> 0x10) -
53-
((iVar3 << 0x10) >> 0x1f) >> 1
52+
(
53+
((iVar3 << 0x10) >> 0x10) -
54+
((iVar3 << 0x10) >> 0x1f)
55+
) >> 1
5456
);
5557

5658
iVar3 = FPS_HALF(sdata->RaceFlag_LoadingTextAnimFrame);

0 commit comments

Comments
 (0)