Skip to content

Commit

Permalink
merge main into graph_split
Browse files Browse the repository at this point in the history
  • Loading branch information
mzxrules committed Jul 10, 2024
1 parent d6c20b9 commit 8c09935
Show file tree
Hide file tree
Showing 41 changed files with 14,143 additions and 212 deletions.
11 changes: 6 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,17 @@ endif
# Version-specific settings
ifeq ($(VERSION),gc-us)
DEBUG := 0
CPP_DEFINES += -DTEXT_LANGUAGE=TEXT_LANG_US_JP
COMPARE := 0
CPP_DEFINES += -DOOT_NTSC=1 -DOOT_PAL=0 -DOOT_MQ=0
else ifeq ($(VERSION),gc-eu)
DEBUG := 0
CPP_DEFINES += -DTEXT_LANGUAGE=TEXT_LANG_EU
CPP_DEFINES += -DOOT_NTSC=0 -DOOT_PAL=1 -DOOT_MQ=0
else ifeq ($(VERSION),gc-eu-mq)
DEBUG := 0
CPP_DEFINES += -DTEXT_LANGUAGE=TEXT_LANG_EU -DOOT_MQ
CPP_DEFINES += -DOOT_NTSC=0 -DOOT_PAL=1 -DOOT_MQ=1
else ifeq ($(VERSION),gc-eu-mq-dbg)
DEBUG := 1
CPP_DEFINES += -DTEXT_LANGUAGE=TEXT_LANG_EU -DOOT_MQ
CPP_DEFINES += -DOOT_NTSC=0 -DOOT_PAL=1 -DOOT_MQ=1
else
$(error Unsupported version $(VERSION))
endif
Expand Down Expand Up @@ -451,7 +452,7 @@ $(BUILD_DIR)/assets/text/nes_message_data_static.o: $(BUILD_DIR)/assets/text/mes
$(BUILD_DIR)/assets/text/ger_message_data_static.o: $(BUILD_DIR)/assets/text/message_data.enc.nes.h
$(BUILD_DIR)/assets/text/fra_message_data_static.o: $(BUILD_DIR)/assets/text/message_data.enc.nes.h
$(BUILD_DIR)/assets/text/staff_message_data_static.o: $(BUILD_DIR)/assets/text/message_data_staff.enc.nes.h
$(BUILD_DIR)/src/code/z_message_PAL.o: assets/text/message_data.h assets/text/message_data_staff.h
$(BUILD_DIR)/src/code/z_message.o: assets/text/message_data.h assets/text/message_data_staff.h

$(BUILD_DIR)/assets/text/%.o: assets/text/%.c
ifneq ($(COMPILER),gcc)
Expand Down
6 changes: 3 additions & 3 deletions assets/text/nes_message_data_static.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
#define DEFINE_MESSAGE_JPN(textId, type, yPos, jpnMessage, nesMessage, gerMessage, fraMessage) \
/* Not Present */

#if (TEXT_LANGUAGE == TEXT_LANG_US_JP)
// On US/JP versions, the font message is with JPN
#if OOT_NTSC
// On NTSC versions, the font message is with JPN
#define DEFINE_MESSAGE_FFFC(textId, type, yPos, jpnMessage, nesMessage, gerMessage, fraMessage) \
/* Not Present */
#else
// On EU versions, the font message is with NES
// On PAL versions, the font message is with NES
#define DEFINE_MESSAGE_FFFC(textId, type, yPos, jpnMessage, nesMessage, gerMessage, fraMessage) \
/* Present */ const char _message_##textId##_nes[] = nesMessage;
#endif
Expand Down
128 changes: 64 additions & 64 deletions assets/xml/textures/icon_item_static.xml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/xml/textures/title_static.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<Texture Name="gFileSelShadowMedallionTex" OutName="shadow_medallion" Format="ia8" Width="16" Height="16" Offset="0x2D80"/>
<Texture Name="gFileSelLightMedallionTex" OutName="light_medallion" Format="ia8" Width="16" Height="16" Offset="0x2E80"/>

<Texture Name="gFileSelWhichFile1JPNTex" OutName="which_file_1_jpn" Format="ia8" Width="128" Height="16" Offset="0x2F80"/>
<Texture Name="gFileSelCopyWhichFileJPNTex" OutName="copy_which_file_jpn" Format="ia8" Width="128" Height="16" Offset="0x2F80"/>
<Texture Name="gFileSelCopyToWhichFileJPNTex" OutName="copy_to_which_file_jpn" Format="ia8" Width="128" Height="16" Offset="0x3780"/>
<Texture Name="gFileSelAreYouSureJPNTex" OutName="are_you_sure_jpn" Format="ia8" Width="128" Height="16" Offset="0x3F80"/>
<Texture Name="gFileSelFileCopiedJPNTex" OutName="file_copied_jpn" Format="ia8" Width="128" Height="16" Offset="0x4780"/>
Expand Down
6 changes: 6 additions & 0 deletions include/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,12 @@ struct GraphicsContext;

#endif /* OOT_DEBUG */

#if OOT_NTSC
#define LANGUAGE_ARRAY(jpn, nes, ger, fra) { jpn, nes }
#else
#define LANGUAGE_ARRAY(jpn, nes, ger, fra) { nes, ger, fra }
#endif

/**
* `x` vertex x
* `y` vertex y
Expand Down
3 changes: 0 additions & 3 deletions include/message_data_fmt.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
#include "z64item.h" // For item ids
#include "sfx.h" // For sfx ids

#define TEXT_LANG_US_JP 0
#define TEXT_LANG_EU 1

/*
* Text control characters
*/
Expand Down
2 changes: 1 addition & 1 deletion include/message_data_static.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ typedef struct {

/* Non-Credits Messages */

#if (TEXT_LANGUAGE == TEXT_LANG_US_JP)
#if OOT_NTSC
#define DEFINE_MESSAGE_NES(textId, type, yPos, jpnMessage, nesMessage, gerMessage, fraMessage) \
extern const char _message_##textId##_nes[];

Expand Down
22 changes: 22 additions & 0 deletions include/segment_symbols.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ DECLARE_ROM_SEGMENT(Audiobank)
DECLARE_ROM_SEGMENT(Audioseq)
DECLARE_ROM_SEGMENT(Audiotable)

#if OOT_NTSC
DECLARE_SEGMENT(kanji)
DECLARE_ROM_SEGMENT(kanji)
#endif

DECLARE_SEGMENT(link_animetion)
DECLARE_ROM_SEGMENT(link_animetion)

Expand All @@ -37,22 +42,37 @@ DECLARE_ROM_SEGMENT(icon_item_24_static)
DECLARE_ROM_SEGMENT(icon_item_field_static)
DECLARE_ROM_SEGMENT(icon_item_dungeon_static)
DECLARE_ROM_SEGMENT(icon_item_gameover_static)

#if OOT_NTSC
DECLARE_ROM_SEGMENT(icon_item_jpn_static)
DECLARE_ROM_SEGMENT(icon_item_nes_static)
#else
DECLARE_ROM_SEGMENT(icon_item_nes_static)
DECLARE_ROM_SEGMENT(icon_item_ger_static)
DECLARE_ROM_SEGMENT(icon_item_fra_static)
#endif

DECLARE_ROM_SEGMENT(item_name_static)
DECLARE_ROM_SEGMENT(map_name_static)
DECLARE_ROM_SEGMENT(do_action_static)
DECLARE_ROM_SEGMENT(message_static)
DECLARE_ROM_SEGMENT(message_texture_static)
DECLARE_ROM_SEGMENT(nes_font_static)

#if OOT_NTSC
DECLARE_SEGMENT(jpn_message_data_static)
DECLARE_ROM_SEGMENT(jpn_message_data_static)
DECLARE_SEGMENT(nes_message_data_static)
DECLARE_ROM_SEGMENT(nes_message_data_static)
#else
DECLARE_SEGMENT(nes_message_data_static)
DECLARE_ROM_SEGMENT(nes_message_data_static)
DECLARE_SEGMENT(ger_message_data_static)
DECLARE_ROM_SEGMENT(ger_message_data_static)
DECLARE_SEGMENT(fra_message_data_static)
DECLARE_ROM_SEGMENT(fra_message_data_static)
#endif

DECLARE_SEGMENT(staff_message_data_static)
DECLARE_ROM_SEGMENT(staff_message_data_static)

Expand Down Expand Up @@ -628,6 +648,7 @@ DECLARE_ROM_SEGMENT(spot20_room_0)

DECLARE_ROM_SEGMENT(ganon_tou_room_0)

#if OOT_DEBUG
DECLARE_ROM_SEGMENT(test01_room_0)

DECLARE_ROM_SEGMENT(besitu_room_0)
Expand All @@ -649,5 +670,6 @@ DECLARE_ROM_SEGMENT(testroom_room_1)
DECLARE_ROM_SEGMENT(testroom_room_2)
DECLARE_ROM_SEGMENT(testroom_room_3)
DECLARE_ROM_SEGMENT(testroom_room_4)
#endif

#endif
2 changes: 1 addition & 1 deletion include/z64item.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef Z64ITEM_H
#define Z64ITEM_H

// Note that z_kaleido_scope_PAL.c assumes that the dimensions and texture format here also matches the dimensions and
// Note that z_kaleido_scope.c assumes that the dimensions and texture format here also matches the dimensions and
// texture format for MAP_NAME_TEX1_*
#define ITEM_NAME_TEX_WIDTH 128
#define ITEM_NAME_TEX_HEIGHT 16
Expand Down
2 changes: 1 addition & 1 deletion include/z64pause.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ typedef struct {
/* 0x027C */ SkelAnime playerSkelAnime;
} PauseContext; // size = 0x2C0

// Note that z_kaleido_scope_PAL.c assumes that the dimensions and texture format here also matches the dimensions and
// Note that z_kaleido_scope.c assumes that the dimensions and texture format here also matches the dimensions and
// texture format for ITEM_NAME_TEX_*
#define MAP_NAME_TEX1_WIDTH 128
#define MAP_NAME_TEX1_HEIGHT 16
Expand Down
7 changes: 6 additions & 1 deletion include/z64save.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@
#include "z64math.h"

typedef enum {
#if OOT_NTSC
/* 0 */ LANGUAGE_JPN,
/* 1 */ LANGUAGE_ENG,
#else
/* 0 */ LANGUAGE_ENG,
/* 1 */ LANGUAGE_GER,
/* 2 */ LANGUAGE_FRA,
/* 3 */ LANGUAGE_MAX
#endif
/* */ LANGUAGE_MAX
} Language;

// `_FORCE` means that this request will respond to `forceRisingButtonAlphas`.
Expand Down
43 changes: 38 additions & 5 deletions spec
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,18 @@ beginseg
include "$(BUILD_DIR)/baserom/Audiotable.o"
endseg

#if OOT_NTSC
beginseg
name "kanji"
include "$(BUILD_DIR)/assets/textures/kanji/kanji.o"
endseg
#endif

beginseg
name "link_animetion"
#if OOT_NTSC
romalign 0x1000
#endif
include "$(BUILD_DIR)/assets/misc/link_animetion/link_animetion.o"
number 7
endseg
Expand Down Expand Up @@ -194,6 +204,16 @@ beginseg
number 12
endseg

#if OOT_NTSC
beginseg
name "icon_item_jpn_static"
compress
romalign 0x1000
include "$(BUILD_DIR)/assets/textures/icon_item_jpn_static/icon_item_jpn_static.o"
number 13
endseg
#endif

beginseg
name "icon_item_nes_static"
compress
Expand All @@ -202,6 +222,7 @@ beginseg
number 13
endseg

#if OOT_PAL
beginseg
name "icon_item_ger_static"
compress
Expand All @@ -217,6 +238,7 @@ beginseg
include "$(BUILD_DIR)/assets/textures/icon_item_fra_static/icon_item_fra_static.o"
number 13
endseg
#endif

beginseg
name "item_name_static"
Expand Down Expand Up @@ -260,13 +282,23 @@ beginseg
number 10
endseg

#if OOT_NTSC
beginseg
name "jpn_message_data_static"
romalign 0x1000
include "$(BUILD_DIR)/assets/text/jpn_message_data_static.o"
number 8
endseg
#endif

beginseg
name "nes_message_data_static"
romalign 0x1000
include "$(BUILD_DIR)/assets/text/nes_message_data_static.o"
number 7
endseg

#if OOT_PAL
beginseg
name "ger_message_data_static"
romalign 0x1000
Expand All @@ -280,6 +312,7 @@ beginseg
include "$(BUILD_DIR)/assets/text/fra_message_data_static.o"
number 7
endseg
#endif

beginseg
name "staff_message_data_static"
Expand Down Expand Up @@ -597,9 +630,9 @@ beginseg
include "$(BUILD_DIR)/src/code/__osMemmove.o"
// For some reason, the data sections of these files are placed here near the
// rodata sections of the other files
include_data_only_within_rodata "$(BUILD_DIR)/src/code/z_message_PAL.o"
include_data_only_within_rodata "$(BUILD_DIR)/src/code/z_message.o"
include_data_only_within_rodata "$(BUILD_DIR)/src/code/z_game_over.o"
include_no_data "$(BUILD_DIR)/src/code/z_message_PAL.o"
include_no_data "$(BUILD_DIR)/src/code/z_message.o"
include_no_data "$(BUILD_DIR)/src/code/z_game_over.o"
include "$(BUILD_DIR)/src/code/z_construct.o"
include "$(BUILD_DIR)/data/audio_tables.rodata.o"
Expand Down Expand Up @@ -643,7 +676,7 @@ beginseg
compress
include "$(BUILD_DIR)/src/overlays/gamestates/ovl_file_choose/z_file_nameset_data.o"
include "$(BUILD_DIR)/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.o"
include "$(BUILD_DIR)/src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL.o"
include "$(BUILD_DIR)/src/overlays/gamestates/ovl_file_choose/z_file_nameset.o"
include "$(BUILD_DIR)/src/overlays/gamestates/ovl_file_choose/z_file_choose.o"
include "$(BUILD_DIR)/src/overlays/gamestates/ovl_file_choose/ovl_file_choose_reloc.o"
endseg
Expand All @@ -655,9 +688,9 @@ beginseg
include "$(BUILD_DIR)/src/overlays/misc/ovl_kaleido_scope/z_kaleido_debug.o"
include "$(BUILD_DIR)/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.o"
include "$(BUILD_DIR)/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.o"
include "$(BUILD_DIR)/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map_PAL.o"
include "$(BUILD_DIR)/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map.o"
include "$(BUILD_DIR)/src/overlays/misc/ovl_kaleido_scope/z_kaleido_prompt.o"
include "$(BUILD_DIR)/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.o"
include "$(BUILD_DIR)/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.o"
include "$(BUILD_DIR)/src/overlays/misc/ovl_kaleido_scope/z_lmap_mark.o"
#if !OOT_MQ
include "$(BUILD_DIR)/src/overlays/misc/ovl_kaleido_scope/z_lmap_mark_data.o"
Expand Down
2 changes: 1 addition & 1 deletion src/boot/idle.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// For retail BSS ordering, the block number of sMainThread must be 0 or
// just above (the exact upper bound depends on the block numbers assigned to
// extern variables declared in headers).
#pragma increment_block_number 60
#pragma increment_block_number 79

OSThread sMainThread;
STACK(sMainStack, 0x900);
Expand Down
2 changes: 1 addition & 1 deletion src/code/fault.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
#if OOT_DEBUG
#pragma increment_block_number 28
#else
#pragma increment_block_number 33
#pragma increment_block_number 52
#endif

void FaultDrawer_Init(void);
Expand Down
4 changes: 4 additions & 0 deletions src/code/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ s32 gScreenWidth = SCREEN_WIDTH;
s32 gScreenHeight = SCREEN_HEIGHT;
u32 gSystemHeapSize = 0;

// For retail BSS ordering, the block number of gIrqMgr must be greater than the
// the block numbers assigned to extern variables above (declared in variables.h).
#pragma increment_block_number 250

PreNmiBuff* gAppNmiBufferPtr;
Scheduler gScheduler;
PadMgr gPadMgr;
Expand Down
4 changes: 4 additions & 0 deletions src/code/z_bgcheck.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#include "global.h"
#include "terminal.h"

// For retail BSS ordering, the block number of polyVerts in CollisionPoly_CheckYIntersectApprox1
// must be 0 or just above.
#pragma increment_block_number 30

u16 DynaSSNodeList_GetNextNodeIdx(DynaSSNodeList* nodeList);
void BgCheck_GetStaticLookupIndicesFromPos(CollisionContext* colCtx, Vec3f* pos, Vec3i* sector);
s32 BgCheck_PosInStaticBoundingBox(CollisionContext* colCtx, Vec3f* pos);
Expand Down
2 changes: 1 addition & 1 deletion src/code/z_camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

// For retail BSS ordering, the block number of D_8015BD7C
// must be between 88 and 123 inclusive.
#pragma increment_block_number 38
#pragma increment_block_number 60

s16 Camera_RequestSettingImpl(Camera* camera, s16 requestedSetting, s16 flags);
s32 Camera_RequestModeImpl(Camera* camera, s16 requestedMode, u8 forceModeChange);
Expand Down
2 changes: 1 addition & 1 deletion src/code/z_collision_check.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ typedef s32 (*ColChkLineFunc)(PlayState*, CollisionCheckContext*, Collider*, Vec

// For retail BSS ordering, the block number of sparkInit in CollisionCheck_BlueBlood
// must be between 183 and 255 inclusive.
#pragma increment_block_number 55
#pragma increment_block_number 80

#if OOT_DEBUG
/**
Expand Down
2 changes: 1 addition & 1 deletion src/code/z_common_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// For retail BSS ordering, the block number of D_8015FA88 must be 0 or
// just above (the exact upper bound depends on the block numbers assigned to
// extern variables declared in headers).
#pragma increment_block_number 60
#pragma increment_block_number 79

ALIGNED(16) SaveContext gSaveContext;
u32 D_8015FA88;
Expand Down
Loading

0 comments on commit 8c09935

Please sign in to comment.