Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions backend/coreapp/decompiler_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ def decompile(
if len(asm.splitlines()) > MAX_M2C_ASM_LINES:
return "/* Too many lines to decompile; please run m2c manually */"
try:
if platform.id == "gba" and "thumb_func_start" in asm:
asm = f".syntax unified\n{asm}"
ret = M2CWrapper.decompile(asm, context, compiler, platform.arch)
except M2CError as e:
# Attempt to decompile the source without context as a last-ditch effort
Expand Down
2 changes: 0 additions & 2 deletions backend/coreapp/m2c_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ def get_triple(compiler: Compiler, arch: str) -> str:

if compiler.type != CompilerType.OTHER:
triple += f"-{compiler.type.value}"
else:
raise M2CError(f"Unsupported compiler '{compiler}'")

return triple

Expand Down
3 changes: 3 additions & 0 deletions backend/coreapp/platforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ def from_id(platform_id: str) -> Platform:
assemble_cmd='sed -i -e "s/;/;@/" "$INPUT" && arm-none-eabi-as -march=armv5te -mthumb -o "$OUTPUT" "$PRELUDE" "$INPUT"',
objdump_cmd="arm-none-eabi-objdump",
nm_cmd="arm-none-eabi-nm",
has_decompiler=True,
)

GBA = Platform(
Expand All @@ -236,6 +237,7 @@ def from_id(platform_id: str) -> Platform:
assemble_cmd='sed -i -e "s/;/;@/" "$INPUT" && arm-none-eabi-as -mcpu=arm7tdmi -mthumb -o "$OUTPUT" "$PRELUDE" "$INPUT"',
objdump_cmd="arm-none-eabi-objdump",
nm_cmd="arm-none-eabi-nm",
has_decompiler=True,
)

N3DS = Platform(
Expand All @@ -246,6 +248,7 @@ def from_id(platform_id: str) -> Platform:
assemble_cmd='sed -i -e "s/;/;@/" "$INPUT" && arm-none-eabi-as -mfpu=vfpv2 -march=armv6k -o "$OUTPUT" "$PRELUDE" "$INPUT"',
objdump_cmd="arm-none-eabi-objdump",
nm_cmd="arm-none-eabi-nm",
has_decompiler=True,
)

_platforms: OrderedDict[str, Platform] = OrderedDict(
Expand Down