Merge pull request #657 from aarant/master
Linkerscript now tracks RAM/ROM usage
This commit is contained in:
@@ -335,7 +335,7 @@ LD_SCRIPT_DEPS :=
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
$(ELF): $(LD_SCRIPT) $(LD_SCRIPT_DEPS) $(OBJS)
|
$(ELF): $(LD_SCRIPT) $(LD_SCRIPT_DEPS) $(OBJS)
|
||||||
@cd $(OBJ_DIR) && $(LD) $(LDFLAGS) -T ../../$< -o ../../$@ $(OBJS_REL) $(LIB)
|
@cd $(OBJ_DIR) && $(LD) $(LDFLAGS) -T ../../$< --print-memory-usage -o ../../$@ $(OBJS_REL) $(LIB) | cat
|
||||||
$(FIX) $@ -t"$(TITLE)" -c$(GAME_CODE) -m$(MAKER_CODE) -r$(GAME_REVISION) --silent
|
$(FIX) $@ -t"$(TITLE)" -c$(GAME_CODE) -m$(MAKER_CODE) -r$(GAME_REVISION) --silent
|
||||||
|
|
||||||
$(ROM): $(ELF)
|
$(ROM): $(ELF)
|
||||||
|
|||||||
@@ -72,6 +72,8 @@
|
|||||||
#define TILE_SIZE_4BPP 32
|
#define TILE_SIZE_4BPP 32
|
||||||
#define TILE_SIZE_8BPP 64
|
#define TILE_SIZE_8BPP 64
|
||||||
|
|
||||||
|
#define BG_TILE_ADDR_4BPP(n) (void *)(BG_VRAM + (TILE_SIZE_4BPP * (n)))
|
||||||
|
|
||||||
#define TILE_OFFSET_4BPP(n) ((n) * TILE_SIZE_4BPP)
|
#define TILE_OFFSET_4BPP(n) ((n) * TILE_SIZE_4BPP)
|
||||||
#define TILE_OFFSET_8BPP(n) ((n) * TILE_SIZE_8BPP)
|
#define TILE_OFFSET_8BPP(n) ((n) * TILE_SIZE_8BPP)
|
||||||
|
|
||||||
|
|||||||
+24
-22
@@ -1,10 +1,16 @@
|
|||||||
gNumMusicPlayers = 4;
|
gNumMusicPlayers = 4;
|
||||||
gMaxLines = 0;
|
gMaxLines = 0;
|
||||||
|
|
||||||
SECTIONS {
|
MEMORY
|
||||||
. = 0x2000000;
|
{
|
||||||
|
EWRAM (rwx) : ORIGIN = 0x2000000, LENGTH = 256K
|
||||||
|
IWRAM (rwx) : ORIGIN = 0x3000000, LENGTH = 32K
|
||||||
|
ROM (rx) : ORIGIN = 0x8000000, LENGTH = 32M
|
||||||
|
}
|
||||||
|
|
||||||
ewram (NOLOAD) :
|
SECTIONS {
|
||||||
|
|
||||||
|
ewram 0x2000000 (NOLOAD) :
|
||||||
ALIGN(4)
|
ALIGN(4)
|
||||||
{
|
{
|
||||||
gHeap = .;
|
gHeap = .;
|
||||||
@@ -17,12 +23,9 @@ SECTIONS {
|
|||||||
*libc.a:impure.o(.data);
|
*libc.a:impure.o(.data);
|
||||||
*libc.a:locale.o(.data);
|
*libc.a:locale.o(.data);
|
||||||
*libc.a:mallocr.o(.data);
|
*libc.a:mallocr.o(.data);
|
||||||
. = 0x40000;
|
} > EWRAM
|
||||||
}
|
|
||||||
|
|
||||||
. = 0x3000000;
|
iwram 0x3000000 (NOLOAD) :
|
||||||
|
|
||||||
iwram (NOLOAD) :
|
|
||||||
ALIGN(4)
|
ALIGN(4)
|
||||||
{
|
{
|
||||||
/* .bss starts at 0x3000000 */
|
/* .bss starts at 0x3000000 */
|
||||||
@@ -38,10 +41,9 @@ SECTIONS {
|
|||||||
|
|
||||||
*libc.a:sbrkr.o(COMMON);
|
*libc.a:sbrkr.o(COMMON);
|
||||||
end = .;
|
end = .;
|
||||||
|
} > IWRAM
|
||||||
|
|
||||||
. = 0x8000;
|
/* BEGIN ROM DATA */
|
||||||
}
|
|
||||||
|
|
||||||
. = 0x8000000;
|
. = 0x8000000;
|
||||||
|
|
||||||
.text :
|
.text :
|
||||||
@@ -307,7 +309,7 @@ SECTIONS {
|
|||||||
src/berry_powder.o(.text);
|
src/berry_powder.o(.text);
|
||||||
src/minigame_countdown.o(.text);
|
src/minigame_countdown.o(.text);
|
||||||
src/berry_fix_program.o(.text);
|
src/berry_fix_program.o(.text);
|
||||||
} =0
|
} > ROM =0
|
||||||
|
|
||||||
script_data :
|
script_data :
|
||||||
ALIGN(4)
|
ALIGN(4)
|
||||||
@@ -319,7 +321,7 @@ SECTIONS {
|
|||||||
data/battle_scripts_2.o(script_data);
|
data/battle_scripts_2.o(script_data);
|
||||||
data/battle_ai_scripts.o(script_data);
|
data/battle_ai_scripts.o(script_data);
|
||||||
data/mystery_event_script_cmd_table.o(script_data);
|
data/mystery_event_script_cmd_table.o(script_data);
|
||||||
} =0
|
} > ROM =0
|
||||||
|
|
||||||
lib_text :
|
lib_text :
|
||||||
ALIGN(4)
|
ALIGN(4)
|
||||||
@@ -388,7 +390,7 @@ SECTIONS {
|
|||||||
*libc.a:libcfunc.o(.text);
|
*libc.a:libcfunc.o(.text);
|
||||||
*libc.a:lseekr.o(.text);
|
*libc.a:lseekr.o(.text);
|
||||||
*libc.a:readr.o(.text);
|
*libc.a:readr.o(.text);
|
||||||
} =0
|
} > ROM =0
|
||||||
|
|
||||||
.rodata :
|
.rodata :
|
||||||
SUBALIGN(4)
|
SUBALIGN(4)
|
||||||
@@ -608,7 +610,7 @@ SECTIONS {
|
|||||||
data/mystery_event_msg.o(.rodata);
|
data/mystery_event_msg.o(.rodata);
|
||||||
src/m4a_tables.o(.rodata);
|
src/m4a_tables.o(.rodata);
|
||||||
data/sound_data.o(.rodata);
|
data/sound_data.o(.rodata);
|
||||||
} =0
|
} > ROM =0
|
||||||
|
|
||||||
song_data :
|
song_data :
|
||||||
ALIGN(4)
|
ALIGN(4)
|
||||||
@@ -960,7 +962,7 @@ SECTIONS {
|
|||||||
sound/songs/midi/mus_trainer_tower.o(.rodata);
|
sound/songs/midi/mus_trainer_tower.o(.rodata);
|
||||||
sound/songs/midi/mus_slow_pallet.o(.rodata);
|
sound/songs/midi/mus_slow_pallet.o(.rodata);
|
||||||
sound/songs/midi/mus_teachy_tv_menu.o(.rodata);
|
sound/songs/midi/mus_teachy_tv_menu.o(.rodata);
|
||||||
}
|
} > ROM =0
|
||||||
|
|
||||||
lib_rodata :
|
lib_rodata :
|
||||||
SUBALIGN(4)
|
SUBALIGN(4)
|
||||||
@@ -1013,7 +1015,7 @@ SECTIONS {
|
|||||||
*libc.a:readr.o(.rodata);
|
*libc.a:readr.o(.rodata);
|
||||||
|
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
} =0
|
} > ROM =0
|
||||||
|
|
||||||
multiboot_data :
|
multiboot_data :
|
||||||
ALIGN(4)
|
ALIGN(4)
|
||||||
@@ -1021,14 +1023,13 @@ SECTIONS {
|
|||||||
data/multiboot_ereader.o(.rodata);
|
data/multiboot_ereader.o(.rodata);
|
||||||
data/multiboot_berry_glitch_fix.o(.rodata);
|
data/multiboot_berry_glitch_fix.o(.rodata);
|
||||||
data/multiboot_pokemon_colosseum.o(.rodata);
|
data/multiboot_pokemon_colosseum.o(.rodata);
|
||||||
} =0
|
} > ROM =0
|
||||||
|
|
||||||
. = 0x08D00000;
|
gfx_data 0x08D00000 :
|
||||||
gfx_data :
|
|
||||||
ALIGN(4)
|
ALIGN(4)
|
||||||
{
|
{
|
||||||
src/graphics.o(.rodata);
|
src/graphics.o(.rodata);
|
||||||
} =0
|
} > ROM =0
|
||||||
|
|
||||||
extra :
|
extra :
|
||||||
ALIGN(4)
|
ALIGN(4)
|
||||||
@@ -1036,7 +1037,8 @@ SECTIONS {
|
|||||||
src/*.o(.text);
|
src/*.o(.text);
|
||||||
src/*.o(.rodata);
|
src/*.o(.rodata);
|
||||||
data/*.o(.rodata);
|
data/*.o(.rodata);
|
||||||
} = 0
|
} > ROM =0
|
||||||
|
|
||||||
|
|
||||||
/* DWARF 2 sections */
|
/* DWARF 2 sections */
|
||||||
.debug_aranges 0 : { *(.debug_aranges) }
|
.debug_aranges 0 : { *(.debug_aranges) }
|
||||||
|
|||||||
+16
-15
@@ -1,10 +1,16 @@
|
|||||||
gNumMusicPlayers = 4;
|
gNumMusicPlayers = 4;
|
||||||
gMaxLines = 0;
|
gMaxLines = 0;
|
||||||
|
|
||||||
SECTIONS {
|
MEMORY
|
||||||
. = 0x2000000;
|
{
|
||||||
|
EWRAM (rwx) : ORIGIN = 0x2000000, LENGTH = 256K
|
||||||
|
IWRAM (rwx) : ORIGIN = 0x3000000, LENGTH = 32K
|
||||||
|
ROM (rx) : ORIGIN = 0x8000000, LENGTH = 32M
|
||||||
|
}
|
||||||
|
|
||||||
ewram (NOLOAD) :
|
SECTIONS {
|
||||||
|
|
||||||
|
ewram 0x2000000 (NOLOAD) :
|
||||||
ALIGN(4)
|
ALIGN(4)
|
||||||
{
|
{
|
||||||
gHeap = .;
|
gHeap = .;
|
||||||
@@ -12,13 +18,9 @@ SECTIONS {
|
|||||||
. = 0x1C000;
|
. = 0x1C000;
|
||||||
|
|
||||||
*(ewram_data);
|
*(ewram_data);
|
||||||
|
} > EWRAM
|
||||||
|
|
||||||
. = 0x40000;
|
iwram 0x3000000 (NOLOAD) :
|
||||||
}
|
|
||||||
|
|
||||||
. = 0x3000000;
|
|
||||||
|
|
||||||
iwram (NOLOAD) :
|
|
||||||
ALIGN(4)
|
ALIGN(4)
|
||||||
{
|
{
|
||||||
/* .bss starts at 0x3000000 */
|
/* .bss starts at 0x3000000 */
|
||||||
@@ -30,8 +32,7 @@ SECTIONS {
|
|||||||
*(COMMON);
|
*(COMMON);
|
||||||
end = .;
|
end = .;
|
||||||
__end__ = .;
|
__end__ = .;
|
||||||
. = 0x8000;
|
} > IWRAM
|
||||||
}
|
|
||||||
|
|
||||||
. = 0x8000000;
|
. = 0x8000000;
|
||||||
|
|
||||||
@@ -43,25 +44,25 @@ SECTIONS {
|
|||||||
src/crt0.o(.text);
|
src/crt0.o(.text);
|
||||||
src/main.o(.text);
|
src/main.o(.text);
|
||||||
*(.text*);
|
*(.text*);
|
||||||
} =0
|
} > ROM =0
|
||||||
|
|
||||||
script_data :
|
script_data :
|
||||||
ALIGN(4)
|
ALIGN(4)
|
||||||
{
|
{
|
||||||
*(script_data);
|
*(script_data);
|
||||||
} =0
|
} > ROM =0
|
||||||
|
|
||||||
.data :
|
.data :
|
||||||
ALIGN(4)
|
ALIGN(4)
|
||||||
{
|
{
|
||||||
*(.data*);
|
*(.data*);
|
||||||
} =0
|
} > ROM =0
|
||||||
|
|
||||||
.rodata :
|
.rodata :
|
||||||
ALIGN(4)
|
ALIGN(4)
|
||||||
{
|
{
|
||||||
*(.rodata*);
|
*(.rodata*);
|
||||||
} =0
|
} > ROM =0
|
||||||
|
|
||||||
/* DWARF 2 sections */
|
/* DWARF 2 sections */
|
||||||
.debug_aranges 0 : { *(.debug_aranges) }
|
.debug_aranges 0 : { *(.debug_aranges) }
|
||||||
|
|||||||
Reference in New Issue
Block a user