mirror of
https://github.com/zeldaret/oot.git
synced 2025-08-10 17:00:19 +00:00
[iQue] Match makerom (#2397)
This commit is contained in:
parent
9dafc2f2e4
commit
4c88cfd08a
4 changed files with 70 additions and 14 deletions
|
@ -4,21 +4,38 @@
|
|||
|
||||
.text
|
||||
|
||||
#if defined(__sgi) && !defined(AVOID_UB)
|
||||
/* IDO assembler workaround: The makerom tool in the N64 SDK was given the bss segment size as a const
|
||||
#if defined(NON_MATCHING) || defined(__sgi)
|
||||
/* Non-matching builds or IDO */
|
||||
#define PAD_TO 0x60
|
||||
#define LA(reg, sym) la reg, sym
|
||||
#define BOOT_STACK_TOP sBootThreadStack + BOOT_STACK_SIZE
|
||||
#else
|
||||
/* EGCS */
|
||||
#define PAD_TO 0x50
|
||||
#define LA(reg, sym) \
|
||||
lui reg, %lo(sym##_HI); \
|
||||
ori reg, %lo(sym)
|
||||
#endif
|
||||
|
||||
#if !defined(AVOID_UB)
|
||||
/* Old assembler workarounds: The makerom tool in the N64 SDK was given the bss segment size as a const
|
||||
* literal, and since this literal was < 0x10000 it was loaded in one instruction. We don't have access
|
||||
* to the bss segment size until we link everything so we cannot do the same thing. Instead we must load
|
||||
* only the lower 16 bits of the bss size for matching.
|
||||
* When AVOID_UB is enabled, don't do this and instead load the full symbol value, otherwise not all of
|
||||
* bss may be cleared. */
|
||||
#if defined(__sgi)
|
||||
#define LOAD_BSS_SIZE(reg) li reg, %half(_bootSegmentBssSize)
|
||||
#else
|
||||
#define LOAD_BSS_SIZE(reg) la reg, _bootSegmentBssSize
|
||||
#define LOAD_BSS_SIZE(reg) ori reg, zero, %lo(_bootSegmentBssSize)
|
||||
#endif
|
||||
#else
|
||||
#define LOAD_BSS_SIZE(reg) LA(reg, _bootSegmentBssSize)
|
||||
#endif
|
||||
|
||||
LEAF(entrypoint)
|
||||
/* Clear boot segment .bss */
|
||||
la t0, _bootSegmentBssStart
|
||||
LA( t0, _bootSegmentBssStart)
|
||||
LOAD_BSS_SIZE(t1)
|
||||
.clear_bss:
|
||||
sw zero, 0(t0)
|
||||
|
@ -28,17 +45,17 @@ LEAF(entrypoint)
|
|||
bnez t1, .clear_bss
|
||||
|
||||
/* Set up stack and enter program code */
|
||||
la sp, sBootThreadStack + BOOT_STACK_SIZE
|
||||
la t2, bootproc
|
||||
LA( sp, BOOT_STACK_TOP)
|
||||
LA( t2, bootproc)
|
||||
jr t2
|
||||
END(entrypoint)
|
||||
|
||||
#ifdef __GNUC__
|
||||
/* Pad to a total size of 0x60 */
|
||||
.fill 0x60 - (. - entrypoint)
|
||||
#else
|
||||
/* IDO can't take absolute differences of symbols.. */
|
||||
#ifdef __sgi
|
||||
/* IDO can't take absolute differences of symbols so the size of the above is hardcoded */
|
||||
.repeat (0x60 - 0x34)
|
||||
.byte 0
|
||||
.endr
|
||||
#else
|
||||
/* Pad to a total size taking into account the size of the above */
|
||||
.fill PAD_TO - (. - entrypoint)
|
||||
#endif
|
||||
|
|
|
@ -9,6 +9,9 @@
|
|||
/* 0x08 */ ENTRYPOINT(0x80000400)
|
||||
/* 0x0C */ OS_VERSION(2, 0, LIBULTRA_VERSION)
|
||||
/* 0x10 */ CHECKSUM()
|
||||
|
||||
#if !PLATFORM_IQUE
|
||||
|
||||
/* 0x18 */ PADDING(8)
|
||||
/* 0x20 */ ROM_NAME("THE LEGEND OF ZELDA")
|
||||
/* 0x34 */ PADDING(7)
|
||||
|
@ -26,3 +29,9 @@
|
|||
/* 0x3E */ REGION(PAL)
|
||||
#endif
|
||||
/* 0x3F */ GAME_REVISION(OOT_REVISION)
|
||||
|
||||
#else
|
||||
|
||||
.fill 0x40 - 0x18
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue