git.y1.nz

gbdk-2020

GameBoy Development Kit
download: https://git.y1.nz/archives/gbdk.tar.gz
README | Files | Log | Refs | LICENSE

commit 4a535f5532c461c57626d7ed252123527beb1b49
parent ff0e55bd3b4de4d41a9484bf65631117af2ffc88
Author: Toxa <untoxa@mail.ru>
Date:   Wed,  4 Feb 2026 19:23:47 +0300

Merge branch 'develop' of https://github.com/gbdk-2020/gbdk-2020 into develop

Diffstat:
Mgbdk-support/bankpack/files.c6+++---
Mgbdk-support/bankpack/obj_data.c12++++++++----
2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/gbdk-support/bankpack/files.c b/gbdk-support/bankpack/files.c @@ -97,10 +97,10 @@ static int linkerfile_order_compare(const void* a, const void* b) { // Set linkerfile order // -// Helps ensure fixed bank areas (hopefully) get linked/placed before autobank. +// Helps ensure fixed bank areas get linked/placed before autobank via linkerfile output order. // Intended to facilitate alignment assumptions for size padded object files. // - Files that only have non-banked data ("_CODE", "_HOME") will always be first in the order -// - See area_item_compare() for full details of how linkerfile_order gets set +// - See obj_data_process() and area_item_compare() for full details of how linkerfile_order gets set static void linkerfile_output_order_sort(const file_item * p_files, file_order_t * p_filelist_order, const uint32_t count) { uint32_t c; @@ -274,7 +274,7 @@ static unsigned int get_obj_file_format(FILE * obj_file, const char * str_filena } -// Extract areas from files, then collected assign them to banks +// Extract areas from files, once collected assign them to banks void files_extract(void) { uint32_t c; char strline_in[OBJ_NAME_MAX_STR_LEN] = ""; diff --git a/gbdk-support/bankpack/obj_data.c b/gbdk-support/bankpack/obj_data.c @@ -408,8 +408,12 @@ void obj_data_process(list_type * p_filelist) { for (c = 0; c < arealist.count; c++) { banks_assign_area(&(areas[c])); // Set linkerfile order based on sort order above - // The + 1 is to separate banked from non-banked files so non-banked always go first - // (non-banked files aren't passed into this function, so stay at default [0]) + // + // All files get processed here, including Fixed bank files. + // The Fixed vs Auto sorting guarantees Fixed are always before Auto, + // they are then sub-sorted by size + // + // The + 1 differentiates it from the default LINKERFILE_ORDER_FIRST files[ areas[c].file_id ].linkerfile_order = c + 1; // If area was auto-banked then set bank number in associated file @@ -427,8 +431,8 @@ void obj_data_process(list_type * p_filelist) { } } - // Check all symbols for matches to banked entries, flag if match found - // TODO: ineffecient to loop over symbols for all files + // Check all symbols for matching banked entries ("b<symbol>"), flag if match found + // TODO: inefficient to loop over symbols for all files for (c = 0; c < symbollist.count; c++) { if (symbols[c].is_banked_def) { for (s = 0; s < symbollist.count; s++) {

This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.