Skip to content

Commit 5270445

Browse files
authored
Merge branch 'main' into wine-b-gone
2 parents d61f3b2 + 1c90e90 commit 5270445

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+1672
-855
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
frontend/ @bates64

.github/ISSUE_TEMPLATE/create-or-update-a-compiler-preset.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ assignees: ''
77

88
---
99

10-
I would like to create/update (delete as applicable) a compiler preset on decomp.me.
10+
I would like to create/update a compiler preset on decomp.me.
1111

1212
- **Preset Name:** e.g. `Superfrog 64`
1313
- **Preset ID (when updating):** e.g. `13` (see [Compiler Presets API](https://decomp.me/api/preset))

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ jobs:
169169
--build-arg ENABLE_GC_WII_SUPPORT=YES \
170170
--build-arg ENABLE_PS2_SUPPORT=YES \
171171
--build-arg ENABLE_SATURN_SUPPORT=YES \
172+
--build-arg ENABLE_DREAMCAST_SUPPORT=YES \
172173
--build-arg ENABLE_WIN32_SUPPORT=YES
173174
- name: Run tests
174175
run: |-
@@ -181,7 +182,6 @@ jobs:
181182
-v $(pwd)/local_files:/local_files \
182183
-v $(pwd)/compilers:/compilers \
183184
-v $(pwd)/libraries:/libraries \
184-
--tmpfs /dev/shm:exec,uid=1000,gid=1000,size=64M,mode=0700 \
185185
--security-opt apparmor=unconfined \
186186
--security-opt seccomp=unconfined \
187187
--entrypoint /bin/bash \
@@ -197,6 +197,7 @@ jobs:
197197
poetry install --no-root && \
198198
poetry run compilers/download.py --compilers-dir ${COMPILER_BASE_PATH} && \
199199
poetry run libraries/download.py --libraries-dir ${LIBRARY_BASE_PATH} && \
200+
for r in wine/*.reg; do regedit $r; done && \
200201
poetry run python manage.py test'
201202
202203
frontend_lint:

backend/Dockerfile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ RUN apt-get -y update && apt-get install -y \
6161
&& rm -rf /var/lib/apt/lists/*
6262

6363
RUN curl -sSL https://install.python-poetry.org/ | \
64-
POETRY_VERSION=1.6.1 POETRY_HOME=/etc/poetry python3.10 -
64+
POETRY_VERSION=1.8.3 POETRY_HOME=/etc/poetry python3.10 -
6565

6666
COPY --from=nsjail /nsjail/nsjail /bin/nsjail
6767

@@ -77,16 +77,20 @@ RUN add-apt-repository -y ppa:dosemu2/ppa && \
7777
ARG ENABLE_MSDOS_SUPPORT
7878
ARG ENABLE_PS2_SUPPORT
7979
ARG ENABLE_WIN32_SUPPORT
80+
ARG ENABLE_DREAMCAST_SUPPORT
8081
RUN if [ "${ENABLE_MSDOS_SUPPORT}" = "YES" ] || \
8182
[ "${ENABLE_PS2_SUPPORT}" = "YES" ] || \
83+
[ "${ENABLE_DREAMCAST_SUPPORT}" = "YES" ] || \
8284
[ "${ENABLE_WIN32_SUPPORT}" = "YES" ]; then \
8385
dpkg --add-architecture i386 && apt-get update && \
8486
apt-get install -y -o APT::Immediate-Configure=false \
8587
wine; \
8688
fi
8789

90+
ARG ENABLE_PSP_SUPPORT
91+
8892
# Patched mips binutils
89-
RUN if [ "${ENABLE_PS2_SUPPORT}" = "YES" ]; then \
93+
RUN if [ "${ENABLE_PS2_SUPPORT}" = "YES" ] || [ "${ENABLE_PSP_SUPPORT}" = "YES" ]; then \
9094
wget "https://github.com/decompals/binutils-mips-ps2-decompals/releases/download/v0.4/binutils-mips-ps2-decompals-linux-x86-64.tar.gz" && \
9195
tar xvzf binutils-mips-ps2-decompals-linux-x86-64.tar.gz -C /usr/bin mips-ps2-decompals-as mips-ps2-decompals-nm mips-ps2-decompals-objdump && \
9296
rm binutils-mips-ps2-decompals-linux-x86-64.tar.gz && \
@@ -128,6 +132,7 @@ USER user
128132
RUN if [ "${ENABLE_MSDOS_SUPPORT}" = "YES" ] || \
129133
[ "${ENABLE_NDS_ARM9_SUPPORT}" = "YES" ] || \
130134
[ "${ENABLE_PS2_SUPPORT}" = "YES" ] || \
135+
[ "${ENABLE_DREAMCAST_SUPPORT}" = "YES" ] || \
131136
[ "${ENABLE_WIN32_SUPPORT}" = "YES" ]; then \
132137
wineboot --init; \
133138
fi
@@ -141,7 +146,6 @@ ARG ENABLE_N3DS_SUPPORT
141146
ARG ENABLE_N64_SUPPORT
142147
ARG ENABLE_NDS_ARM9_SUPPORT
143148
ARG ENABLE_PS1_SUPPORT
144-
ARG ENABLE_PSP_SUPPORT
145149
ARG ENABLE_SATURN_SUPPORT
146150
ARG ENABLE_SWITCH_SUPPORT
147151

@@ -150,6 +154,7 @@ ENV ENABLE_GC_WII_SUPPORT=${ENABLE_GC_WII_SUPPORT}
150154
ENV ENABLE_MACOSX_SUPPORT=${ENABLE_MACOSX_SUPPORT}
151155
ENV ENABLE_MSDOS_SUPPORT=${ENABLE_MSDOS_SUPPORT}
152156
ENV ENABLE_N3DS_SUPPORT=${ENABLE_N3DS_SUPPORT}
157+
ENV ENABLE_DREAMCAST_SUPPORT=${ENABLE_DREAMCAST_SUPPORT}
153158
ENV ENABLE_N64_SUPPORT=${ENABLE_N64_SUPPORT}
154159
ENV ENABLE_NDS_ARM9_SUPPORT=${ENABLE_NDS_ARM9_SUPPORT}
155160
ENV ENABLE_PS1_SUPPORT=${ENABLE_PS1_SUPPORT}

backend/compilers/compilers.linux.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ gc_wii:
88
- mwcc_233_163
99
- mwcc_233_163e
1010
- mwcc_233_163n
11+
- mwcc_242_53
1112
- mwcc_242_81
1213
- mwcc_242_81r
1314
- mwcc_247_92
15+
- mwcc_247_92p1
1416
- mwcc_247_105
1517
- mwcc_247_107
1618
- mwcc_247_108
@@ -24,9 +26,10 @@ gc_wii:
2426
- mwcc_42_140
2527
- mwcc_42_142
2628
- mwcc_43_145
27-
- mwcc_43_188
2829
- mwcc_43_151
2930
- mwcc_43_172
31+
- mwcc_43_188
32+
- mwcc_43_202
3033
- mwcc_43_213
3134
- prodg_35
3235
- prodg_37
@@ -99,6 +102,7 @@ ps1:
99102
- psyq4.4
100103
- psyq4.5
101104
- psyq4.6
105+
- psyq_263_221
102106
- gcc2.5.7-psx
103107
- gcc2.6.3-psx
104108
- gcc2.6.0-mipsel
@@ -111,6 +115,7 @@ ps1:
111115
- gcc2.7.2.3-mipsel
112116
- gcc2.8.0-mipsel
113117
- gcc2.8.1-mipsel
118+
- gcc2.8.1-psx
114119
- gcc2.91.66-mipsel
115120
- gcc2.95.2-mipsel
116121

@@ -168,6 +173,9 @@ psp:
168173
saturn:
169174
- cygnus-2.7-96Q3
170175

176+
dreamcast:
177+
- shc-v5.1r11
178+
171179
macosx:
172180
- gcc-5026
173181
- gcc-5363
@@ -191,3 +199,4 @@ win32:
191199
- msvc6.6
192200
- msvc7.0
193201
- msvc7.1
202+
- msvc8.0

backend/coreapp/admin.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
22

33
from .models.course import Course, CourseChapter, CourseScenario
44
from .models.github import GitHubUser
5-
from .models.preset import Preset
5+
from .models.preset import Preset, PresetAdmin
66
from .models.profile import Profile
77
from .models.project import Project, ProjectMember
88
from .models.scratch import (
99
Asm,
1010
Assembly,
1111
AssemblyAdmin,
12-
CompilerConfig,
1312
Scratch,
1413
ScratchAdmin,
1514
)
@@ -19,8 +18,7 @@
1918
admin.site.register(Asm)
2019
admin.site.register(Assembly, AssemblyAdmin)
2120
admin.site.register(Scratch, ScratchAdmin)
22-
admin.site.register(CompilerConfig)
23-
admin.site.register(Preset)
21+
admin.site.register(Preset, PresetAdmin)
2422
admin.site.register(Project)
2523
admin.site.register(ProjectMember)
2624
admin.site.register(Course)

backend/coreapp/asm_preludes/ps2.s

Lines changed: 55 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,67 @@
1-
.macro glabel label
2-
.global \label
3-
.type \label, @function
4-
\label:
1+
.macro glabel name, visibility=global
2+
.\visibility "\name"
3+
.type "\name", @function
4+
"\name":
55
.endm
66

7-
.macro dlabel label
8-
.global \label
9-
\label:
7+
.macro dlabel name, visibility=global
8+
.\visibility "\name"
9+
.type "\name", @object
10+
"\name":
1011
.endm
1112

12-
.macro jlabel label
13-
\label:
13+
.macro jlabel name, visibility=local
14+
.\visibility "\name"
15+
"\name":
1416
.endm
1517

1618
.macro .late_rodata
1719
.section .rodata
1820
.endm
1921

22+
# Defines a sized symbol with function type.
23+
# Usage:
24+
# .fn my_function, local
25+
# /* asm here */
26+
# .endfn my_function
27+
.macro .fn name, visibility=global
28+
.\visibility "\name"
29+
.type "\name", @function
30+
"\name":
31+
.endm
32+
33+
.macro .endfn name
34+
.size "\name", . - "\name"
35+
.endm
36+
37+
# Defines a sized symbol with object type.
38+
# Usage:
39+
# .obj my_object, local
40+
# /* data here */
41+
# .endobj my_object
42+
.macro .obj name, visibility=global
43+
.\visibility "\name"
44+
.type "\name", @object
45+
"\name":
46+
.endm
47+
48+
.macro .endobj name
49+
.size "\name", . - "\name"
50+
.endm
51+
52+
# Defines a sized symbol without a type.
53+
# Usage:
54+
# .sym my_sym, local
55+
# /* anything here */
56+
# .endsym my_sym
57+
.macro .sym name, visibility=global
58+
.\visibility "\name"
59+
"\name":
60+
.endm
61+
62+
.macro .endsym name
63+
.size "\name", . - "\name"
64+
.endm
65+
2066
.set noat
2167
.set noreorder

backend/coreapp/compiler_wrapper.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ def lru_cache(maxsize: int = 128, typed: bool = False) -> Callable[[F], F]:
5353

5454
@dataclass
5555
class DiffResult:
56-
result: Dict[str, Any]
57-
errors: str
56+
result: Optional[Dict[str, Any]] = None
57+
errors: Optional[str] = None
5858

5959

6060
@dataclass
@@ -255,7 +255,6 @@ def assemble_asm(platform: Platform, asm: Asm) -> Assembly:
255255
hash=hash,
256256
arch=platform.arch,
257257
source_asm=asm,
258-
elf_object=f"assembled({asm.data})".encode("UTF-8"),
259258
)
260259
assembly.save()
261260
return assembly

0 commit comments

Comments
 (0)