From 0f8236575a5d391d8caa94711338e6aac9af315c Mon Sep 17 00:00:00 2001 From: Philippe Symons Date: Thu, 27 Nov 2025 20:27:35 +0100 Subject: [PATCH] Fix a couple of compile errors on latest-release branch - Fix make clean by adding -f flag when removing output.json - Fix broken compress_lz10.sh script: it had a check to avoid compressing when the input bin file hasn't changed. But the -nt operator also returns false if the output file doesn't exist. - Fix compilation error on conflicting u32 typedef: libtonc defines one and so does data-generator. We shouldn't redefine it if the one from libtonc exists. The one in data-generator exists for compiling the tool for pc. - Fix Dockerfile. For some reason the Dockerfile was now failing because Ubuntu manages the python pip packages. I fixed it with the --break-system-packages shortcut. It should be fine. --- Dockerfile | 2 +- Makefile | 2 +- compress_lz10.sh | 2 +- tools/data-generator/include/extern_pokemon_data.h | 2 ++ 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1d15c84..3f7e23b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,4 +9,4 @@ ARG GROUP_ID ENV DEBIAN_FRONTEND="noninteractive" -RUN apt update && apt install -y build-essential python3-pip && pip install pandas requests openpyxl +RUN apt update && apt install -y build-essential python3-pip && pip install pandas requests openpyxl --break-system-packages diff --git a/Makefile b/Makefile index 22047ab..ce096d0 100644 --- a/Makefile +++ b/Makefile @@ -175,7 +175,7 @@ clean: @$(MAKE) -C tools/data-generator clean @$(MAKE) -C loader clean @rm -fr $(BUILD) $(TARGET).elf $(TARGET).gba data/ to_compress/ - @rm text_helper/output.json + @rm -f text_helper/output.json diff --git a/compress_lz10.sh b/compress_lz10.sh index 79ca64f..6ca2ffc 100755 --- a/compress_lz10.sh +++ b/compress_lz10.sh @@ -1,7 +1,7 @@ #!/bin/sh infile="$1" outfile="data/$(basename "$infile" .bin)_lz10.bin" -if [ "$infile" -nt "$outfile" ]; then +if [ ! -f "$outfile" ] || [ "$infile" -nt "$outfile" ]; then gbalzss e "$infile" "$outfile" echo -n "C" else diff --git a/tools/data-generator/include/extern_pokemon_data.h b/tools/data-generator/include/extern_pokemon_data.h index 356d520..f958bf5 100644 --- a/tools/data-generator/include/extern_pokemon_data.h +++ b/tools/data-generator/include/extern_pokemon_data.h @@ -7,10 +7,12 @@ #define NUM_POKEMON 252 #define POKEMON_ARRAY_SIZE NUM_POKEMON + 1 +#ifndef TONC_TYPES typedef uint8_t u8; typedef uint8_t byte; typedef uint16_t u16; typedef uint32_t u32; +#endif void generate_pokemon_data(const char *output_path);