Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fragment16 #153

Merged
merged 1 commit into from
Oct 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/libleo/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ typedef struct {
} block_param_form; // size = 0x10

typedef union {
/* 0x00 */ struct {
struct {
/* 0x00 */ u32 country;
/* 0x04 */ u8 fmt_type;
/* 0x05 */ u8 disk_type;
Expand Down
4 changes: 2 additions & 2 deletions include/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
#define CLAMP_MAX(x, max) ((x) > (max) ? (max) : (x))
#define CLAMP_MIN(x, min) ((x) < (min) ? (min) : (x))

#define ROUND_MAX(x) (((x) > 0.0f ? 0.5f : -0.5f) + (x))
#define ROUND_MAX(x) ((x) + ((x) > 0.0f ? 0.5f : -0.5f))

#define ABS(x) ((x) < 0 ? -(x) : (x))
#define ABS_ALT(x) ((x) >= 0 ? (x) : -(x))
Expand All @@ -72,7 +72,7 @@
func_80004258(ASSET_ID(vram), rom##_ROM_START, rom##_ROM_END, arg0) \
)

#define ASSET_LOAD2(vram, rom, arg0, arg1) (\
#define ASSET_LOAD2(rom, arg0, arg1) (\
func_800044F4(rom##_ROM_START, rom##_ROM_END, arg0, arg1) \
)
#endif
83 changes: 83 additions & 0 deletions include/prevent_bss_reordering.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
#ifndef PREVENT_BSS_REORDERING_H
#define PREVENT_BSS_REORDERING_H

/**
* To determine variable order for .bss, the compiler sorts variables by their
* "name index" mod 256, where name index is something that, with -g, gets
* incremented by struct and variable declarations, typedefs, and file markers,
* among else. (Without -g, only variable declarations affects the index.)
* This file contains enough dummy declarations to bump the index by 128.
* Including it, or removing the include, should fix bss reordering problems
* for a file, assuming the name index distance between its first and last bss
* variable is at most 128.
* Note that if a variable is declared "extern" within a header file, the name
* index is taken at that point of the extern declaration. Thus, this include
* must come before any such header.
*/

struct Dummy0 { int x; };
struct Dummy1 { int x; };
struct Dummy2 { int x; };
struct Dummy3 { int x; };
struct Dummy4 { int x; };
struct Dummy5 { int x; };
struct Dummy6 { int x; };
struct Dummy7 { int x; };
struct Dummy8 { int x; };
struct Dummy9 { int x; };
struct Dummy10 { int x; };
struct Dummy11 { int x; };
struct Dummy12 { int x; };
struct Dummy13 { int x; };
struct Dummy14 { int x; };
struct Dummy15 { int x; };
struct Dummy16 { int x; };
struct Dummy17 { int x; };
struct Dummy18 { int x; };
struct Dummy19 { int x; };
struct Dummy20 { int x; };
struct Dummy21 { int x; };
struct Dummy22 { int x; };
struct Dummy23 { int x; };
struct Dummy24 { int x; };
struct Dummy25 { int x; };
struct Dummy26 { int x; };
struct Dummy27 { int x; };
struct Dummy28 { int x; };
struct Dummy29 { int x; };
struct Dummy30 { int x; };
struct Dummy31 { int x; };
struct Dummy32 { int x; };
struct Dummy33 { int x; };
struct Dummy34 { int x; };
struct Dummy35 { int x; };
struct Dummy36 { int x; };
struct Dummy37 { int x; };
struct Dummy38 { int x; };
struct Dummy39 { int x; };
struct Dummy40 { int x; };
struct Dummy41 { int x; };
struct Dummy42 { int x; };
struct Dummy43 { int x; };
struct Dummy44 { int x; };
struct Dummy45 { int x; };
struct Dummy46 { int x; };
struct Dummy47 { int x; };
struct Dummy48 { int x; };
struct Dummy49 { int x; };
struct Dummy50 { int x; };
struct Dummy51 { int x; };
struct Dummy52 { int x; };
struct Dummy53 { int x; };
struct Dummy54 { int x; };
struct Dummy55 { int x; };
struct Dummy56 { int x; };
struct Dummy57 { int x; };
struct Dummy58 { int x; };
struct Dummy59 { int x; };
struct Dummy60 { int x; };
struct Dummy61 { int x; };
struct Dummy62 { int x; };
typedef int Dummy63;

#endif
3 changes: 3 additions & 0 deletions linker_scripts/us/symbol_addrs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -341,3 +341,6 @@ D_8007596C = 0x8007596C;
D_8690B360 = 0x8690B360; // size:0x18
D_8690B390 = 0x8690B390; // size:0x24
D_8690B5D0 = 0x8690B5D0; // size:0x24
D_86A06228 = 0x86A06228; // size:0xC
D_86A06238 = 0x86A06238; // size:0xC
D_86A06248 = 0x86A06248; // size:0xC
2 changes: 1 addition & 1 deletion src/11BA0.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ void func_80010FDC(unk_D_86002F34_000* arg0, func_D_86002F34_000_010 arg1, unk_D
}
}

unk_D_86002F34_000* func_8001103C(MainPoolState* arg0, void* arg1) {
unk_D_86002F34_000* func_8001103C(MainPoolState* arg0, unk_D_86002F34_000* arg1) {
if (arg0 != NULL) {
arg1 = func_80002DCC(arg0, sizeof(unk_D_86002F34_000), 4);
}
Expand Down
2 changes: 1 addition & 1 deletion src/11BA0.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ typedef struct unk_D_8690A610 {

void func_80010FA0(unk_D_86002F34_000* arg0, u8 arg1);
void func_80010FDC(unk_D_86002F34_000* arg0, func_D_86002F34_000_010 arg1, unk_D_86002F34_000_014* arg2);
unk_D_86002F34_000* func_8001103C(MainPoolState* arg0, void* arg1);
unk_D_86002F34_000* func_8001103C(MainPoolState* arg0, unk_D_86002F34_000* arg1);
unk_D_86002F34_alt2* func_80011088(MainPoolState* arg0, unk_D_86002F34_alt2* arg1, unk_D_86002F34_000* arg2);
unk_D_86002F34_00C* func_800110E0(MemoryBlock* arg0, unk_D_86002F34_00C* arg1, s16 arg2, s16 arg3, s16 arg4, s16 arg5);
unk_D_86002F34_alt13* func_800111A4(MemoryBlock* arg0, unk_D_86002F34_alt13* arg1, s16 arg2);
Expand Down
Loading
Loading