Skip to content

Commit d09f6d5

Browse files
committed
Merge 'Use separate text component for multiworld item recipient' (#2035)
2 parents c2c66c5 + 5f135a2 commit d09f6d5

File tree

13 files changed

+28944
-28866
lines changed

13 files changed

+28944
-28866
lines changed

ASM/build/asm_symbols.txt

Lines changed: 995 additions & 998 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ASM/build/bundle.o

764 Bytes
Binary file not shown.

ASM/build/c_symbols.txt

Lines changed: 125 additions & 122 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ASM/c/item_table.c

Lines changed: 46 additions & 46 deletions
Large diffs are not rendered by default.

ASM/c/message.c

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,29 @@
22
#include "stdbool.h"
33
#include "save.h"
44

5+
// no support for kana since they're not part of the message charset
6+
char FILENAME_ENCODING[256] = {
7+
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '?', '?', '?', '?', '?', '?',
8+
'?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?',
9+
'?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?',
10+
'?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?',
11+
'?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?',
12+
'?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?',
13+
'?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?',
14+
'?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?',
15+
'?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?',
16+
'?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?',
17+
'?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', 'A', 'B', 'C', 'D', 'E',
18+
'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U',
19+
'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k',
20+
'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', ' ',
21+
'?', '?', '!', ':', '-', '(', ')', '?', '?', ',', '.', '/', '?', '?', '?', '?',
22+
'?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?',
23+
};
24+
25+
extern uint8_t PLAYER_NAMES[256][8];
26+
extern uint8_t PLAYER_NAME_ID;
27+
528
// Helper function for adding characters to the decoded message buffer
629
void Message_AddCharacter(MessageContext *msgCtx, void *pFont, uint32_t *pDecodedBufPos, uint32_t *pCharTexIdx, uint8_t charToAdd) {
730
uint32_t decodedBufPosVal = *pDecodedBufPos;
@@ -43,6 +66,18 @@ void Message_AddString(MessageContext *msgCtx, void *pFont, uint32_t *pDecodedBu
4366
}
4467
}
4568

69+
// Helper function for adding a filename to the decoded message buffer. Filenames use a different character set from other text.
70+
void Message_AddFileName(MessageContext *msgCtx, void *pFont, uint32_t *pDecodedBufPos, uint32_t *pCharTexIdx, uint8_t *filenameToAdd) {
71+
int end = 8;
72+
while (filenameToAdd[end - 1] == 0xDF) {
73+
// trim trailing space
74+
end--;
75+
}
76+
for (int i = 0; i < end; i++) {
77+
Message_AddCharacter(msgCtx, pFont, pDecodedBufPos, pCharTexIdx, FILENAME_ENCODING[filenameToAdd[i]]);
78+
}
79+
}
80+
4681
// Hack to add additional text control codes.
4782
// If additional codes need to be read after the primary code, increment msgCtx->msgBufPos and index msgRaw
4883
// To add a new control code:
@@ -75,6 +110,12 @@ bool Message_Decode_Additional_Control_Codes(uint8_t currChar, uint32_t *pDecode
75110
(*pDecodedBufPos)--;
76111
return true;
77112
}
113+
case 0xF2: {
114+
// Outgoing item filename
115+
Message_AddFileName(msgCtx, pFont, pDecodedBufPos, pCharTexIdx, PLAYER_NAMES[PLAYER_NAME_ID]);
116+
(*pDecodedBufPos)--;
117+
return true;
118+
}
78119
default: {
79120
return false;
80121
}

ASM/src/build.asm

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ RANDO_CONTEXT:
6565
.include "scarecrow.asm"
6666
.include "empty_bomb.asm"
6767
.include "initial_save.asm"
68-
.include "textbox.asm"
6968
.include "fishing.asm"
7069
.include "bgs_fix.asm"
7170
.include "chus_in_logic.asm"

ASM/src/hacks.asm

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1587,37 +1587,6 @@ nop
15871587
.orga 0xB55A64 ; In memory 800DFB04
15881588
jal save_scarecrow_song
15891589

1590-
;==================================================================================================
1591-
; Override Player Name Text
1592-
;==================================================================================================
1593-
1594-
; Replaces
1595-
; lui t2,0x8012
1596-
; addu t2,t2,s3
1597-
; lbu t2,-23053(t2)
1598-
.orga 0xB51694
1599-
jal get_name_char_1
1600-
;addi a0, s3, -1
1601-
;ori t2, v0, 0
1602-
1603-
; Replaces
1604-
; lui s0,0x8012
1605-
; addu s0,s0,s2
1606-
; lbu s0,-23052(s0)
1607-
.orga 0xB516C4
1608-
jal get_name_char_2
1609-
;ori a0, s2, 0
1610-
;ori s0, v0, 0
1611-
1612-
; Replaces
1613-
; lw s6,48(sp)
1614-
; lw s7,52(sp)
1615-
; lw s8,56(sp)
1616-
.orga 0xB52784
1617-
jal reset_player_name_id
1618-
nop
1619-
lw ra, 0x3C (sp)
1620-
16211590
;==================================================================================================
16221591
; Text Fixes
16231592
;==================================================================================================

ASM/src/textbox.asm

Lines changed: 0 additions & 61 deletions
This file was deleted.

0 commit comments

Comments
 (0)