You've already forked Microtransactions64
mirror of
https://github.com/Print-and-Panic/Microtransactions64.git
synced 2026-01-21 10:17:19 -08:00
Merge branch 'master' of https://github.com/Reonu/ultrasm64-extbounds into puppycamera2
This commit is contained in:
@@ -52,6 +52,9 @@ This is a fork of the ultrasm64 repo by CrashOveride which includes the followin
|
||||
- There is a `gIsConsole` variable that is 1 when running on console and 0 when running on emulator. This way you can wrap your code in a console check.
|
||||
- Expanded audio heap allows for a larger concurrent note count and the importing of more m64 sequences and sound banks (By ArcticJaguar725) *
|
||||
- You can set a test level in config.h in order to boot straight into it, so you can quickly test the level you're working on. *
|
||||
- Colored ia4 text support. Format: `"@XXXXXXXX[YOUR TEXT]@--------"` (By ArcticJaguar725)
|
||||
- Example Text: `"@FF0000FFRED @00FF00FFGREEN @0000FFFFBLUE @FFFFFF00INVISIBLE @--------NORMAL"`
|
||||
- NOTE: It is not mandatory to reset the text color with `"@--------"`, but text will need to be recolored each time it scrolls in a dialog box, or the custom color will reset.
|
||||
|
||||
**Other Bugfixes:**
|
||||
- Castle music fix (Fixes the castle music sometimes triggering after getting a dialog) *
|
||||
|
||||
@@ -220,6 +220,7 @@
|
||||
'ィ' = 0xD6
|
||||
'ゥ' = 0xD7
|
||||
'ォ' = 0xD8
|
||||
'@' = 0xDF
|
||||
'[%]' = 0xE0
|
||||
'(' = 0xE1
|
||||
'(' = 0xE1
|
||||
|
||||
@@ -271,10 +271,53 @@ void print_generic_string(s16 x, s16 y, const u8 *str) {
|
||||
s32 strPos = 0;
|
||||
u8 lineNum = 1;
|
||||
|
||||
s16 colorLoop;
|
||||
u8 rgbaColors[4] = {0, 0, 0, 0};
|
||||
u8 customColor = FALSE;
|
||||
u8 diffTmp = 0;
|
||||
|
||||
create_dl_translation_matrix(MENU_MTX_PUSH, x, y, 0.0f);
|
||||
|
||||
while (str[strPos] != DIALOG_CHAR_TERMINATOR) {
|
||||
if (customColor == TRUE) {
|
||||
gDPSetEnvColor(gDisplayListHead++, rgbaColors[0], rgbaColors[1], rgbaColors[2], rgbaColors[3]);
|
||||
}
|
||||
else {
|
||||
if (customColor == 2) {
|
||||
gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, 255); // TODO: Is it possible to retrieve the original color that was set before print_generic_string was called?
|
||||
customColor = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
switch (str[strPos]) {
|
||||
case DIALOG_CHAR_COLOR:
|
||||
customColor = TRUE;
|
||||
strPos++;
|
||||
for (colorLoop = strPos + 8; strPos < colorLoop; ++strPos) {
|
||||
diffTmp = 0;
|
||||
if (str[strPos] >= 0x24 && str[strPos] <= 0x29) {
|
||||
diffTmp = 0x1A;
|
||||
}
|
||||
else if (str[strPos] >= 0x10) {
|
||||
customColor = 2;
|
||||
strPos = colorLoop - 8;
|
||||
for (diffTmp = 0; diffTmp < 8; ++diffTmp) {
|
||||
if (str[strPos + diffTmp] != 0x9F)
|
||||
break;
|
||||
}
|
||||
if (diffTmp == 8)
|
||||
strPos += diffTmp;
|
||||
break;
|
||||
}
|
||||
if ((8 - (colorLoop - strPos)) % 2 == 0) {
|
||||
rgbaColors[(8 - (colorLoop - strPos)) / 2] = ((str[strPos] - diffTmp) & 0x0F) << 4;
|
||||
}
|
||||
else {
|
||||
rgbaColors[(8 - (colorLoop - strPos)) / 2] += ((str[strPos] - diffTmp) & 0x0F);
|
||||
}
|
||||
}
|
||||
strPos--;
|
||||
break;
|
||||
case DIALOG_CHAR_DAKUTEN:
|
||||
mark = DIALOG_MARK_DAKUTEN;
|
||||
break;
|
||||
@@ -672,7 +715,7 @@ void render_dialog_box_type(struct DialogEntry *dialog, s8 linesPerBox) {
|
||||
gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
|
||||
}
|
||||
|
||||
void change_and_flash_dialog_text_color_lines(s8 colorMode, s8 lineNum) {
|
||||
void change_and_flash_dialog_text_color_lines(s8 colorMode, s8 lineNum, u8 *customColor) {
|
||||
u8 colorFade;
|
||||
|
||||
if (colorMode == 1) {
|
||||
@@ -689,6 +732,10 @@ void change_and_flash_dialog_text_color_lines(s8 colorMode, s8 lineNum) {
|
||||
} else {
|
||||
switch (gDialogBoxType) {
|
||||
case DIALOG_TYPE_ROTATE:
|
||||
if (*customColor == 2) {
|
||||
gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, 255);
|
||||
*customColor = FALSE;
|
||||
}
|
||||
break;
|
||||
case DIALOG_TYPE_ZOOM:
|
||||
gDPSetEnvColor(gDisplayListHead++, 0, 0, 0, 255);
|
||||
@@ -781,6 +828,11 @@ void handle_dialog_text_and_pages(s8 colorMode, struct DialogEntry *dialog, s8 l
|
||||
|
||||
u8 strChar;
|
||||
|
||||
s16 colorLoop;
|
||||
u8 rgbaColors[4] = {0, 0, 0, 0};
|
||||
u8 customColor = FALSE;
|
||||
u8 diffTmp = 0;
|
||||
|
||||
u8 *str = segmented_to_virtual(dialog->str);
|
||||
s8 lineNum = 1;
|
||||
|
||||
@@ -813,7 +865,12 @@ void handle_dialog_text_and_pages(s8 colorMode, struct DialogEntry *dialog, s8 l
|
||||
create_dl_translation_matrix(MENU_MTX_PUSH, X_VAL3, 2 - lineNum * Y_VAL3, 0);
|
||||
|
||||
while (pageState == DIALOG_PAGE_STATE_NONE) {
|
||||
change_and_flash_dialog_text_color_lines(colorMode, lineNum);
|
||||
if (customColor == TRUE) {
|
||||
gDPSetEnvColor(gDisplayListHead++, rgbaColors[0], rgbaColors[1], rgbaColors[2], rgbaColors[3]);
|
||||
}
|
||||
else {
|
||||
change_and_flash_dialog_text_color_lines(colorMode, lineNum, &customColor);
|
||||
}
|
||||
strChar = str[strIdx];
|
||||
|
||||
switch (strChar) {
|
||||
@@ -821,6 +878,34 @@ void handle_dialog_text_and_pages(s8 colorMode, struct DialogEntry *dialog, s8 l
|
||||
pageState = DIALOG_PAGE_STATE_END;
|
||||
gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
|
||||
break;
|
||||
case DIALOG_CHAR_COLOR:
|
||||
customColor = TRUE;
|
||||
strIdx++;
|
||||
for (colorLoop = strIdx + 8; strIdx < colorLoop; ++strIdx) {
|
||||
diffTmp = 0;
|
||||
if (str[strIdx] >= 0x24 && str[strIdx] <= 0x29) {
|
||||
diffTmp = 0x1A;
|
||||
}
|
||||
else if (str[strIdx] >= 0x10) {
|
||||
customColor = 2;
|
||||
strIdx = colorLoop - 8;
|
||||
for (diffTmp = 0; diffTmp < 8; ++diffTmp) {
|
||||
if (str[strIdx + diffTmp] != 0x9F)
|
||||
break;
|
||||
}
|
||||
if (diffTmp == 8)
|
||||
strIdx += diffTmp;
|
||||
break;
|
||||
}
|
||||
if ((8 - (colorLoop - strIdx)) % 2 == 0) {
|
||||
rgbaColors[(8 - (colorLoop - strIdx)) / 2] = ((str[strIdx] - diffTmp) & 0x0F) << 4;
|
||||
}
|
||||
else {
|
||||
rgbaColors[(8 - (colorLoop - strIdx)) / 2] += ((str[strIdx] - diffTmp) & 0x0F);
|
||||
}
|
||||
}
|
||||
strIdx--;
|
||||
break;
|
||||
case DIALOG_CHAR_NEWLINE:
|
||||
lineNum++;
|
||||
handle_dialog_scroll_page_state(lineNum, totalLines, &pageState, &xMatrix, &linePos);
|
||||
|
||||
@@ -98,6 +98,7 @@ enum DialogSpecialChars {
|
||||
#endif
|
||||
DIALOG_CHAR_PERIOD = 0x6E,
|
||||
DIALOG_CHAR_COMMA = 0x6F,
|
||||
DIALOG_CHAR_COLOR = 0xDF,
|
||||
DIALOG_CHAR_SPACE = 0x9E,
|
||||
DIALOG_CHAR_STAR_COUNT = 0xE0, // number of stars
|
||||
DIALOG_CHAR_UMLAUT = 0xE9,
|
||||
|
||||
Reference in New Issue
Block a user