1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-12-25 06:06:05 +00:00

Line up code segment for gc-eu-mq (#1918)

This commit is contained in:
cadmic 2024-03-29 08:11:45 -07:00 committed by GitHub
parent 93642f97bc
commit 731fe6da82
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 8 deletions

6
spec
View file

@ -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"

View file

@ -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);