1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-03 06:24:30 +00:00

Automate fixing BSS ordering (#2009)

* Automate fixing BSS ordering

* Typo

* Some cleanups

* Move pragma check after printing BSS info

* Some proofreading

* multiprocessing, require version, some colors

* Tweak output

* Black + mypy

* Move logging and sys.exit out of helper functions

* Use stdout instead of stderr in fix_bss.py

* Add suggestion to conflicting offsets error

Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>

* Remove var = list[T]()

* Improve error handling

Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>

* Add error if no pointers to BSS

* Add comment about process_file_worker

* Only print updates if stdout is a tty

* Use new binary-search-esque candidate generation algorithm

Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>

* Add Wikipedia link

* More comment tweaks

---------

Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
This commit is contained in:
cadmic 2024-08-02 17:31:15 -07:00 committed by GitHub
parent 078e21f6c6
commit 0da402b9de
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 1071 additions and 352 deletions

View file

@ -100,21 +100,19 @@ static ColliderCylinderInit sLightBallCylinderInit = {
static u8 D_808E4C58[] = { 0, 12, 10, 12, 14, 16, 12, 14, 16, 12, 14, 16, 12, 14, 16, 10, 16, 14 };
static Vec3f sZeroVec = { 0.0f, 0.0f, 0.0f };
// For retail BSS ordering, the block number of sGanondorf must be 0 or just above.
// TODO: There's probably a way to do this with less padding by spreading the variables out and moving
// data around. It would be easier if we had more options for controlling BSS ordering in debug.
#pragma increment_block_number 50
#pragma increment_block_number "gc-eu:128 gc-eu-mq:128"
static EnGanonMant* sCape;
#pragma increment_block_number 200
// TODO: There's probably a way to match BSS ordering with less padding by spreading the variables out and moving
// data around. It would be easier if we had more options for controlling BSS ordering in debug.
#pragma increment_block_number "gc-eu:128 gc-eu-mq:128"
static s32 sSeed1;
static s32 sSeed2;
static s32 sSeed3;
#pragma increment_block_number 200
#pragma increment_block_number "gc-eu:192 gc-eu-mq:192"
static BossGanon* sGanondorf;

View file

@ -53,7 +53,7 @@ ActorProfile En_Wonder_Item_Profile = {
/**/ NULL,
};
#pragma increment_block_number 1
#pragma increment_block_number "gc-eu:0 gc-eu-mq:0"
static Vec3f sTagPointsFree[9];
static Vec3f sTagPointsOrdered[9];

View file

@ -14,8 +14,7 @@
#include "assets/scenes/dungeons/ice_doukutu/ice_doukutu_scene.h"
#include "terminal.h"
// For retail BSS ordering, the block number of sSfxPos
// must be between 0 and 213 inclusive.
#pragma increment_block_number "gc-eu:0 gc-eu-mq:0"
#define FLAGS ACTOR_FLAG_4
@ -1396,7 +1395,7 @@ void func_80B3F3D8(void) {
Sfx_PlaySfxCentered2(NA_SE_PL_SKIP);
}
#pragma increment_block_number 20
#pragma increment_block_number "gc-eu:128 gc-eu-mq:128"
void EnXc_PlayDiveSFX(Vec3f* src, PlayState* play) {
static Vec3f D_80B42DA0;

View file

@ -11,8 +11,7 @@
#include "ichain.h"
#include "terminal.h"
// For retail BSS ordering, the block number of sStreamSfxProjectedPos must be 0.
#pragma increment_block_number 206
#pragma increment_block_number "gc-eu:206 gc-eu-mq:206"
#define FLAGS ACTOR_FLAG_4

View file

@ -354,22 +354,19 @@ void Player_Action_CsAction(Player* this, PlayState* play);
// .bss part 1
// For retail BSS ordering, the block number of sDogSpawnPos in Player_Update
// must be between 0 and 53 inclusive.
// TODO: There's probably a way to do this with less padding by spreading the variables out and moving
// data around. It would be easier if we had more options for controlling BSS ordering in debug.
#pragma increment_block_number 30
#pragma increment_block_number "gc-eu:0 gc-eu-mq:0"
static s32 D_80858AA0;
#pragma increment_block_number 250
// TODO: There's probably a way to match BSS ordering with less padding by spreading the variables out and moving
// data around. It would be easier if we had more options for controlling BSS ordering in debug.
#pragma increment_block_number "gc-eu:128 gc-eu-mq:128"
static s32 D_80858AA4;
static Vec3f sInteractWallCheckResult;
static Input* sControlInput;
#pragma increment_block_number 50
#pragma increment_block_number "gc-eu:192 gc-eu-mq:192"
// .data