diff --git a/spec b/spec index 028814f5dd..287659d1b9 100644 --- a/spec +++ b/spec @@ -318,6 +318,7 @@ beginseg name "code" compress after "dmadata" + align 0x20 include "$(BUILD_DIR)/src/code/z_en_a_keep.o" include "$(BUILD_DIR)/src/code/z_en_item00.o" include "$(BUILD_DIR)/src/code/z_eff_blure.o" @@ -455,7 +456,7 @@ beginseg #if OOT_DEBUG include "$(BUILD_DIR)/src/code/ucode_disas.o" #endif - pad_text // audio library aligned to 32 bytes? + pad_text // on GameCube, NTSC 1.0 and "0.9" prerelease include "$(BUILD_DIR)/src/audio/lib/data.o" include "$(BUILD_DIR)/src/audio/lib/synthesis.o" include "$(BUILD_DIR)/src/audio/lib/heap.o" @@ -467,6 +468,9 @@ beginseg include "$(BUILD_DIR)/src/audio/lib/effects.o" include "$(BUILD_DIR)/src/audio/lib/seqplayer.o" include "$(BUILD_DIR)/src/audio/general.o" +#if !OOT_DEBUG + pad_text // on retail GameCube +#endif include "$(BUILD_DIR)/src/audio/sfx_params.o" include "$(BUILD_DIR)/src/audio/sfx.o" include "$(BUILD_DIR)/src/audio/sequence.o" diff --git a/tools/mkldscript.c b/tools/mkldscript.c index 05ecdfd353..9157bc79dc 100644 --- a/tools/mkldscript.c +++ b/tools/mkldscript.c @@ -51,11 +51,13 @@ static void write_ld_script(FILE *fout) " ..%s ", seg->name, seg->name, seg->name, seg->name); if (seg->fields & (1 << STMT_after)) - fprintf(fout, "_%sSegmentEnd ", seg->after); + fprintf(fout, "(_%sSegmentEnd + %i) & ~ %i ", seg->after, seg->align - 1, seg->align - 1); else if (seg->fields & (1 << STMT_number)) fprintf(fout, "0x%02X000000 ", seg->number); else if (seg->fields & (1 << STMT_address)) fprintf(fout, "0x%08X ", seg->address); + else + fprintf(fout, "ALIGN(0x%X) ", seg->align); // (AT(_RomSize) isn't necessary, but adds useful "load address" lines to the map file) fprintf(fout, ": AT(_RomSize)\n {\n" @@ -64,9 +66,6 @@ static void write_ld_script(FILE *fout) " _%sSegmentTextStart = .;\n", seg->name, seg->name); - if (seg->fields & (1 << STMT_align)) - fprintf(fout, " . = ALIGN(0x%X);\n", seg->align); - for (j = 0; j < seg->includesCount; j++) { fprintf(fout, " %s (.text)\n", seg->includes[j].fpath); @@ -166,9 +165,6 @@ static void write_ld_script(FILE *fout) " _%sSegmentBssStart = .;\n", seg->name, seg->name, seg->name, seg->name); - if (seg->fields & (1 << STMT_align)) - fprintf(fout, " . = ALIGN(0x%X);\n", seg->align); - for (j = 0; j < seg->includesCount; j++) fprintf(fout, " %s (.sbss)\n" " . = ALIGN(0x10);\n", seg->includes[j].fpath);