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

Farore's Wind Textbox states Dungeon Name #2302

Open
wants to merge 1 commit into
base: Dev
Choose a base branch
from
Open
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
860 changes: 430 additions & 430 deletions ASM/build/asm_symbols.txt

Large diffs are not rendered by default.

Binary file modified ASM/build/bundle.o
Binary file not shown.
825 changes: 413 additions & 412 deletions ASM/build/c_symbols.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ASM/c/actor.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void Actor_BuildFlag(z64_actor_t* actor, xflag_t* flag, uint16_t actor_index, ui
flag->scene = z64_game.scene_index;
if (z64_game.scene_index == 0x3E) {
flag->grotto.room = actor->room_index;
flag->grotto.grotto_id = z64_file.grotto_id & 0x1F;
flag->grotto.grotto_id = z64_file.respawn[RESPAWN_MODE_RETURN].data & 0x1F;
flag->grotto.flag = actor_index;
flag->grotto.subflag = subflag;
} else {
Expand Down
2 changes: 1 addition & 1 deletion ASM/c/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ void draw_debug_menu(z64_disp_buf_t *db) {

// Shoutouts to OoTMM
z64_Play_SetupRespawnPoint(&z64_game, 1, 0xDFF);
z64_file.void_flag = 2;
z64_file.respawn_flag = 2;

z64_game.scene_load_flag = 0x14;
z64_game.fadeout_transition = 0x02;
Expand Down
4 changes: 2 additions & 2 deletions ASM/c/get_items.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ override_key_t get_override_search_key(z64_actor_t *actor, uint8_t scene, uint8_
};
} else if (scene == 0x3E && actor->actor_id == 0x011A) {
return (override_key_t){
.scene = z64_file.grotto_id,
.scene = z64_file.respawn[RESPAWN_MODE_RETURN].data,
.type = OVR_GROTTO_SCRUB,
.pad = 0,
.flag = item_id,
Expand Down Expand Up @@ -762,7 +762,7 @@ bool Item00_KillActorIfFlagIsSet(z64_actor_t* actor) {
flag.scene = z64_game.scene_index;
if (z64_game.scene_index == 0x3E) {
flag.grotto.room = actor->room_index;
flag.grotto.grotto_id = z64_file.grotto_id & 0x1F;
flag.grotto.grotto_id = z64_file.respawn[RESPAWN_MODE_RETURN].data & 0x1F;
flag.grotto.flag = CURR_ACTOR_SPAWN_INDEX;
flag.grotto.subflag = 0;
} else {
Expand Down
91 changes: 91 additions & 0 deletions ASM/c/message.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "z64.h"
#include "stdbool.h"
#include "save.h"
#include "dungeon_info.h"

// no support for kana since they're not part of the message charset
char FILENAME_ENCODING[256] = {
Expand Down Expand Up @@ -117,6 +118,96 @@ bool Message_Decode_Additional_Control_Codes(uint8_t currChar, uint32_t* pDecode
(*pDecodedBufPos)--;
return true;
}
case 0xF3: {
// Farore's Wind destination
switch (z64_file.respawn[RESPAWN_MODE_TOP].entranceIndex) {
case 0x000:
case 0x252: {
// Deku Tree
Message_AddString(msgCtx, pFont, pDecodedBufPos, pCharTexIdx, dungeons[0].name);
break;
}
case 0x004:
case 0x0C5: {
// DC
Message_AddString(msgCtx, pFont, pDecodedBufPos, pCharTexIdx, dungeons[1].name);
break;
}
case 0x028:
case 0x407: {
// Jabu
Message_AddString(msgCtx, pFont, pDecodedBufPos, pCharTexIdx, dungeons[2].name);
break;
}
case 0x169:
case 0x24E: {
// Forest Temple
Message_AddString(msgCtx, pFont, pDecodedBufPos, pCharTexIdx, dungeons[3].name);
break;
}
case 0x165:
case 0x175: {
// Fire Temple
Message_AddString(msgCtx, pFont, pDecodedBufPos, pCharTexIdx, dungeons[4].name);
break;
}
case 0x010:
case 0x423: {
// Water Temple
Message_AddString(msgCtx, pFont, pDecodedBufPos, pCharTexIdx, dungeons[5].name);
break;
}
case 0x037:
case 0x2B2: {
// Shadow Temple
Message_AddString(msgCtx, pFont, pDecodedBufPos, pCharTexIdx, dungeons[6].name);
break;
}
case 0x082:
case 0x2F5:
case 0x3F0:
case 0x3F4: {
// Spirit Temple
Message_AddString(msgCtx, pFont, pDecodedBufPos, pCharTexIdx, dungeons[7].name);
break;
}
case 0x098: {
// BotW
Message_AddString(msgCtx, pFont, pDecodedBufPos, pCharTexIdx, dungeons[8].name);
break;
}
case 0x088: {
// Ice
Message_AddString(msgCtx, pFont, pDecodedBufPos, pCharTexIdx, dungeons[9].name);
break;
}
case 0x008: {
// GTG
Message_AddString(msgCtx, pFont, pDecodedBufPos, pCharTexIdx, dungeons[11].name);
break;
}
case 0x41B:
case 0x467:
case 0x534:
case 0x538:
case 0x53C:
case 0x540:
case 0x544:
case 0x548:
case 0x54C: {
// Ganon
Message_AddString(msgCtx, pFont, pDecodedBufPos, pCharTexIdx, dungeons[12].name);
break;
}
default: {
// Vanilla text
Message_AddString(msgCtx, pFont, pDecodedBufPos, pCharTexIdx, "the Warp Point");
break;
}
}
(*pDecodedBufPos)--;
return true;
}
default: {
return false;
}
Expand Down
45 changes: 33 additions & 12 deletions ASM/c/z64.h
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,30 @@ typedef struct {
int16_t copyDestFileIndex; /* 0x1CA50 */
} z64_FileChooseContext_t;

/**
* The respawn mode names refer to the perceived player movement when respawning
* "down": being on ground
* "return": coming from the ground
* "top": coming from the air
*/
typedef enum {
/* 0x00 */ RESPAWN_MODE_DOWN, /* Normal Void Outs */
/* 0x01 */ RESPAWN_MODE_RETURN, /* Grotto Returnpoints */
/* 0x02 */ RESPAWN_MODE_TOP, /* Farore's Wind */
/* 0x03 */ RESPAWN_MODE_MAX
} RespawnMode;

typedef struct {
/* 0x00 */ z64_xyzf_t pos;
/* 0x0C */ int16_t yaw;
/* 0x0E */ int16_t playerParams;
/* 0x10 */ int16_t entranceIndex;
/* 0x12 */ uint8_t roomIndex;
/* 0x13 */ int8_t data;
/* 0x14 */ uint32_t tempSwchFlags;
/* 0x18 */ uint32_t tempCollectFlags;
} RespawnData; // size = 0x1C

typedef struct {
int32_t entrance_index; /* 0x0000 */
int32_t link_age; /* 0x0004 */
Expand Down Expand Up @@ -737,18 +761,15 @@ typedef struct {
char unk_0F_[0x0004]; /* 0x1358 */
int32_t game_mode; /* 0x135C */
uint32_t scene_setup_index; /* 0x1360 */
int32_t void_flag; /* 0x1364 */
z64_xyzf_t void_pos; /* 0x1368 */
z64_angle_t void_yaw; /* 0x1374 */
int16_t void_var; /* 0x1376 */
int16_t void_entrance; /* 0x1378 */
int8_t void_room_index; /* 0x137A */
int8_t unk_10_; /* 0x137B */
uint32_t temp_swch_flags; /* 0x137C */
uint32_t temp_collect_flags; /* 0x1380 */
char unk_11_[0x0013]; /* 0x1384 */
uint8_t grotto_id; /* 0x1397 */
char unk_12_[0x0030]; /* 0x1398 */
int32_t respawn_flag; /* 0x1364 */
RespawnData respawn[RESPAWN_MODE_MAX];/* 0x1368 */
float entranceSpeed; /* 0x13BC */
uint16_t entranceSound; /* 0x13C0 */
char unk_10_[0x0001]; /* 0x13C2 */
uint8_t retainWeatherMode; /* 0x13C3 */
int16_t dogParams; /* 0x13C4 */
uint8_t envHazardTextTriggerFlags;/* 0x13C6 */
uint8_t showTitleCard; /* 0x13C7 */
uint16_t nayrus_love_timer; /* 0x13C8 */
char unk_13_[0x0004]; /* 0x13CA */
int16_t timer_1_state; /* 0x13CE */
Expand Down
2 changes: 2 additions & 0 deletions Messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
0xF0: ('silver_rupee', 1, lambda d: '<silver rupee count ' + "{:02x}".format(d) + '>' ),
0xF1: ('key_count', 1, lambda d: '<key count ' + "{:02x}".format(d) + '>' ),
0xF2: ('outgoing_item_filename', 0, lambda _: '<outgoing item filename>' ),
0xF3: ('farores_wind_destination', 0, lambda _: '<farores_wind_destination>' ),
}

# Maps unicode characters to corresponding bytes in OOTR's character set.
Expand Down Expand Up @@ -161,6 +162,7 @@
(0x0038, "\x08\x13\x11You found the \x05\x41Megaton Hammer\x05\x40!\x01It's so heavy, you need to\x01use two hands to swing it!"),
(0x0039, "\x08\x13\x0FYou found the \x05\x41Lens of Truth\x05\x40!\x01Mysterious things are hidden\x01everywhere!"),
(0x003A, "\x08\x13\x08You found the \x05\x41Ocarina of Time\x05\x40!\x01It glows with a mystical light..."),
(0x003B, "\x08You cast Farore's Wind!\x01\x1C\x05\x42Return to \xF3\x01Dispel the Warp Point\x01Exit\x05\x40"),
(0x003C, "\x08\x13\x67You received the \x05\x41Fire\x01Medallion\x05\x40!\x01Darunia awakens as a Sage and\x01adds his power to yours!"),
(0x003D, "\x08\x13\x68You received the \x05\x43Water\x01Medallion\x05\x40!\x01Ruto awakens as a Sage and\x01adds her power to yours!"),
(0x003E, "\x08\x13\x66You received the \x05\x42Forest\x01Medallion\x05\x40!\x01Saria awakens as a Sage and\x01adds her power to yours!"),
Expand Down
Loading
Loading