mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 03:34:15 +01:00
Sync text ctrl codes with pokefirered
This commit is contained in:
parent
4736b4b14d
commit
004ce32da0
@ -416,13 +416,13 @@ SHADOW = FC 03 @ same as fc 01
|
|||||||
COLOR_HIGHLIGHT_SHADOW = FC 04 @ takes 3 bytes
|
COLOR_HIGHLIGHT_SHADOW = FC 04 @ takes 3 bytes
|
||||||
PALETTE = FC 05 @ used in credits
|
PALETTE = FC 05 @ used in credits
|
||||||
FONT = FC 06 @ Given a font id, or use font constants below instead
|
FONT = FC 06 @ Given a font id, or use font constants below instead
|
||||||
RESET_SIZE = FC 07
|
RESET_FONT = FC 07
|
||||||
PAUSE = FC 08 @ manually print the wait byte after this, havent mapped them
|
PAUSE = FC 08 @ manually print the wait byte after this, havent mapped them
|
||||||
PAUSE_UNTIL_PRESS = FC 09
|
PAUSE_UNTIL_PRESS = FC 09
|
||||||
WAIT_SE = FC 0A
|
WAIT_SE = FC 0A
|
||||||
PLAY_BGM = FC 0B
|
PLAY_BGM = FC 0B
|
||||||
ESCAPE = FC 0C
|
ESCAPE = FC 0C
|
||||||
SHIFT_TEXT = FC 0D
|
SHIFT_RIGHT = FC 0D
|
||||||
SHIFT_DOWN = FC 0E
|
SHIFT_DOWN = FC 0E
|
||||||
FILL_WINDOW = FC 0F
|
FILL_WINDOW = FC 0F
|
||||||
PLAY_SE = FC 10
|
PLAY_SE = FC 10
|
||||||
|
@ -212,13 +212,13 @@
|
|||||||
#define EXT_CTRL_CODE_COLOR_HIGHLIGHT_SHADOW 0x04
|
#define EXT_CTRL_CODE_COLOR_HIGHLIGHT_SHADOW 0x04
|
||||||
#define EXT_CTRL_CODE_PALETTE 0x05
|
#define EXT_CTRL_CODE_PALETTE 0x05
|
||||||
#define EXT_CTRL_CODE_FONT 0x06
|
#define EXT_CTRL_CODE_FONT 0x06
|
||||||
#define EXT_CTRL_CODE_RESET_SIZE 0x07
|
#define EXT_CTRL_CODE_RESET_FONT 0x07
|
||||||
#define EXT_CTRL_CODE_PAUSE 0x08
|
#define EXT_CTRL_CODE_PAUSE 0x08
|
||||||
#define EXT_CTRL_CODE_PAUSE_UNTIL_PRESS 0x09
|
#define EXT_CTRL_CODE_PAUSE_UNTIL_PRESS 0x09
|
||||||
#define EXT_CTRL_CODE_WAIT_SE 0x0A
|
#define EXT_CTRL_CODE_WAIT_SE 0x0A
|
||||||
#define EXT_CTRL_CODE_PLAY_BGM 0x0B
|
#define EXT_CTRL_CODE_PLAY_BGM 0x0B
|
||||||
#define EXT_CTRL_CODE_ESCAPE 0x0C
|
#define EXT_CTRL_CODE_ESCAPE 0x0C
|
||||||
#define EXT_CTRL_CODE_SHIFT_TEXT 0x0D
|
#define EXT_CTRL_CODE_SHIFT_RIGHT 0x0D
|
||||||
#define EXT_CTRL_CODE_SHIFT_DOWN 0x0E
|
#define EXT_CTRL_CODE_SHIFT_DOWN 0x0E
|
||||||
#define EXT_CTRL_CODE_FILL_WINDOW 0x0F
|
#define EXT_CTRL_CODE_FILL_WINDOW 0x0F
|
||||||
#define EXT_CTRL_CODE_PLAY_SE 0x10
|
#define EXT_CTRL_CODE_PLAY_SE 0x10
|
||||||
|
@ -354,7 +354,7 @@ u8 *StringExpandPlaceholders(u8 *dest, const u8 *src)
|
|||||||
|
|
||||||
switch (c)
|
switch (c)
|
||||||
{
|
{
|
||||||
case EXT_CTRL_CODE_RESET_SIZE:
|
case EXT_CTRL_CODE_RESET_FONT:
|
||||||
case EXT_CTRL_CODE_PAUSE_UNTIL_PRESS:
|
case EXT_CTRL_CODE_PAUSE_UNTIL_PRESS:
|
||||||
case EXT_CTRL_CODE_FILL_WINDOW:
|
case EXT_CTRL_CODE_FILL_WINDOW:
|
||||||
case EXT_CTRL_CODE_JPN:
|
case EXT_CTRL_CODE_JPN:
|
||||||
@ -665,13 +665,13 @@ u8 GetExtCtrlCodeLength(u8 code)
|
|||||||
[EXT_CTRL_CODE_COLOR_HIGHLIGHT_SHADOW] = 4,
|
[EXT_CTRL_CODE_COLOR_HIGHLIGHT_SHADOW] = 4,
|
||||||
[EXT_CTRL_CODE_PALETTE] = 2,
|
[EXT_CTRL_CODE_PALETTE] = 2,
|
||||||
[EXT_CTRL_CODE_FONT] = 2,
|
[EXT_CTRL_CODE_FONT] = 2,
|
||||||
[EXT_CTRL_CODE_RESET_SIZE] = 1,
|
[EXT_CTRL_CODE_RESET_FONT] = 1,
|
||||||
[EXT_CTRL_CODE_PAUSE] = 2,
|
[EXT_CTRL_CODE_PAUSE] = 2,
|
||||||
[EXT_CTRL_CODE_PAUSE_UNTIL_PRESS] = 1,
|
[EXT_CTRL_CODE_PAUSE_UNTIL_PRESS] = 1,
|
||||||
[EXT_CTRL_CODE_WAIT_SE] = 1,
|
[EXT_CTRL_CODE_WAIT_SE] = 1,
|
||||||
[EXT_CTRL_CODE_PLAY_BGM] = 3,
|
[EXT_CTRL_CODE_PLAY_BGM] = 3,
|
||||||
[EXT_CTRL_CODE_ESCAPE] = 2,
|
[EXT_CTRL_CODE_ESCAPE] = 2,
|
||||||
[EXT_CTRL_CODE_SHIFT_TEXT] = 2,
|
[EXT_CTRL_CODE_SHIFT_RIGHT] = 2,
|
||||||
[EXT_CTRL_CODE_SHIFT_DOWN] = 2,
|
[EXT_CTRL_CODE_SHIFT_DOWN] = 2,
|
||||||
[EXT_CTRL_CODE_FILL_WINDOW] = 1,
|
[EXT_CTRL_CODE_FILL_WINDOW] = 1,
|
||||||
[EXT_CTRL_CODE_PLAY_SE] = 3,
|
[EXT_CTRL_CODE_PLAY_SE] = 3,
|
||||||
|
16
gflib/text.c
16
gflib/text.c
@ -1009,7 +1009,7 @@ static u16 RenderText(struct TextPrinter *textPrinter)
|
|||||||
subStruct->fontId = *textPrinter->printerTemplate.currentChar;
|
subStruct->fontId = *textPrinter->printerTemplate.currentChar;
|
||||||
textPrinter->printerTemplate.currentChar++;
|
textPrinter->printerTemplate.currentChar++;
|
||||||
return RENDER_REPEAT;
|
return RENDER_REPEAT;
|
||||||
case EXT_CTRL_CODE_RESET_SIZE:
|
case EXT_CTRL_CODE_RESET_FONT:
|
||||||
return RENDER_REPEAT;
|
return RENDER_REPEAT;
|
||||||
case EXT_CTRL_CODE_PAUSE:
|
case EXT_CTRL_CODE_PAUSE:
|
||||||
textPrinter->delayCounter = *textPrinter->printerTemplate.currentChar;
|
textPrinter->delayCounter = *textPrinter->printerTemplate.currentChar;
|
||||||
@ -1042,7 +1042,7 @@ static u16 RenderText(struct TextPrinter *textPrinter)
|
|||||||
textPrinter->printerTemplate.currentChar++;
|
textPrinter->printerTemplate.currentChar++;
|
||||||
PlaySE(currChar);
|
PlaySE(currChar);
|
||||||
return RENDER_REPEAT;
|
return RENDER_REPEAT;
|
||||||
case EXT_CTRL_CODE_SHIFT_TEXT:
|
case EXT_CTRL_CODE_SHIFT_RIGHT:
|
||||||
textPrinter->printerTemplate.currentX = textPrinter->printerTemplate.x + *textPrinter->printerTemplate.currentChar;
|
textPrinter->printerTemplate.currentX = textPrinter->printerTemplate.x + *textPrinter->printerTemplate.currentChar;
|
||||||
textPrinter->printerTemplate.currentChar++;
|
textPrinter->printerTemplate.currentChar++;
|
||||||
return RENDER_REPEAT;
|
return RENDER_REPEAT;
|
||||||
@ -1271,7 +1271,7 @@ static u32 GetStringWidthFixedWidthFont(const u8 *str, u8 fontId, u8 letterSpaci
|
|||||||
case EXT_CTRL_CODE_FONT:
|
case EXT_CTRL_CODE_FONT:
|
||||||
case EXT_CTRL_CODE_PAUSE:
|
case EXT_CTRL_CODE_PAUSE:
|
||||||
case EXT_CTRL_CODE_ESCAPE:
|
case EXT_CTRL_CODE_ESCAPE:
|
||||||
case EXT_CTRL_CODE_SHIFT_TEXT:
|
case EXT_CTRL_CODE_SHIFT_RIGHT:
|
||||||
case EXT_CTRL_CODE_SHIFT_DOWN:
|
case EXT_CTRL_CODE_SHIFT_DOWN:
|
||||||
case EXT_CTRL_CODE_CLEAR:
|
case EXT_CTRL_CODE_CLEAR:
|
||||||
case EXT_CTRL_CODE_SKIP:
|
case EXT_CTRL_CODE_SKIP:
|
||||||
@ -1279,7 +1279,7 @@ static u32 GetStringWidthFixedWidthFont(const u8 *str, u8 fontId, u8 letterSpaci
|
|||||||
case EXT_CTRL_CODE_MIN_LETTER_SPACING:
|
case EXT_CTRL_CODE_MIN_LETTER_SPACING:
|
||||||
++strPos;
|
++strPos;
|
||||||
break;
|
break;
|
||||||
case EXT_CTRL_CODE_RESET_SIZE:
|
case EXT_CTRL_CODE_RESET_FONT:
|
||||||
case EXT_CTRL_CODE_PAUSE_UNTIL_PRESS:
|
case EXT_CTRL_CODE_PAUSE_UNTIL_PRESS:
|
||||||
case EXT_CTRL_CODE_WAIT_SE:
|
case EXT_CTRL_CODE_WAIT_SE:
|
||||||
case EXT_CTRL_CODE_FILL_WINDOW:
|
case EXT_CTRL_CODE_FILL_WINDOW:
|
||||||
@ -1413,7 +1413,7 @@ s32 GetStringWidth(u8 fontId, const u8 *str, s16 letterSpacing)
|
|||||||
case EXT_CTRL_CODE_PALETTE:
|
case EXT_CTRL_CODE_PALETTE:
|
||||||
case EXT_CTRL_CODE_PAUSE:
|
case EXT_CTRL_CODE_PAUSE:
|
||||||
case EXT_CTRL_CODE_ESCAPE:
|
case EXT_CTRL_CODE_ESCAPE:
|
||||||
case EXT_CTRL_CODE_SHIFT_TEXT:
|
case EXT_CTRL_CODE_SHIFT_RIGHT:
|
||||||
case EXT_CTRL_CODE_SHIFT_DOWN:
|
case EXT_CTRL_CODE_SHIFT_DOWN:
|
||||||
++str;
|
++str;
|
||||||
break;
|
break;
|
||||||
@ -1444,7 +1444,7 @@ s32 GetStringWidth(u8 fontId, const u8 *str, s16 letterSpacing)
|
|||||||
case EXT_CTRL_CODE_ENG:
|
case EXT_CTRL_CODE_ENG:
|
||||||
isJapanese = 0;
|
isJapanese = 0;
|
||||||
break;
|
break;
|
||||||
case EXT_CTRL_CODE_RESET_SIZE:
|
case EXT_CTRL_CODE_RESET_FONT:
|
||||||
case EXT_CTRL_CODE_PAUSE_UNTIL_PRESS:
|
case EXT_CTRL_CODE_PAUSE_UNTIL_PRESS:
|
||||||
case EXT_CTRL_CODE_WAIT_SE:
|
case EXT_CTRL_CODE_WAIT_SE:
|
||||||
case EXT_CTRL_CODE_FILL_WINDOW:
|
case EXT_CTRL_CODE_FILL_WINDOW:
|
||||||
@ -1556,7 +1556,7 @@ u8 RenderTextHandleBold(u8 *pixels, u8 fontId, u8 *str)
|
|||||||
case EXT_CTRL_CODE_PALETTE:
|
case EXT_CTRL_CODE_PALETTE:
|
||||||
case EXT_CTRL_CODE_PAUSE:
|
case EXT_CTRL_CODE_PAUSE:
|
||||||
case EXT_CTRL_CODE_ESCAPE:
|
case EXT_CTRL_CODE_ESCAPE:
|
||||||
case EXT_CTRL_CODE_SHIFT_TEXT:
|
case EXT_CTRL_CODE_SHIFT_RIGHT:
|
||||||
case EXT_CTRL_CODE_SHIFT_DOWN:
|
case EXT_CTRL_CODE_SHIFT_DOWN:
|
||||||
case EXT_CTRL_CODE_CLEAR:
|
case EXT_CTRL_CODE_CLEAR:
|
||||||
case EXT_CTRL_CODE_SKIP:
|
case EXT_CTRL_CODE_SKIP:
|
||||||
@ -1564,7 +1564,7 @@ u8 RenderTextHandleBold(u8 *pixels, u8 fontId, u8 *str)
|
|||||||
case EXT_CTRL_CODE_MIN_LETTER_SPACING:
|
case EXT_CTRL_CODE_MIN_LETTER_SPACING:
|
||||||
++strPos;
|
++strPos;
|
||||||
break;
|
break;
|
||||||
case EXT_CTRL_CODE_RESET_SIZE:
|
case EXT_CTRL_CODE_RESET_FONT:
|
||||||
case EXT_CTRL_CODE_PAUSE_UNTIL_PRESS:
|
case EXT_CTRL_CODE_PAUSE_UNTIL_PRESS:
|
||||||
case EXT_CTRL_CODE_WAIT_SE:
|
case EXT_CTRL_CODE_WAIT_SE:
|
||||||
case EXT_CTRL_CODE_FILL_WINDOW:
|
case EXT_CTRL_CODE_FILL_WINDOW:
|
||||||
|
@ -88,7 +88,7 @@ u16 FontFunc_Braille(struct TextPrinter *textPrinter)
|
|||||||
subStruct->fontId = *textPrinter->printerTemplate.currentChar;
|
subStruct->fontId = *textPrinter->printerTemplate.currentChar;
|
||||||
textPrinter->printerTemplate.currentChar++;
|
textPrinter->printerTemplate.currentChar++;
|
||||||
return RENDER_REPEAT;
|
return RENDER_REPEAT;
|
||||||
case EXT_CTRL_CODE_RESET_SIZE:
|
case EXT_CTRL_CODE_RESET_FONT:
|
||||||
return RENDER_REPEAT;
|
return RENDER_REPEAT;
|
||||||
case EXT_CTRL_CODE_PAUSE:
|
case EXT_CTRL_CODE_PAUSE:
|
||||||
textPrinter->delayCounter = *textPrinter->printerTemplate.currentChar++;
|
textPrinter->delayCounter = *textPrinter->printerTemplate.currentChar++;
|
||||||
@ -109,7 +109,7 @@ u16 FontFunc_Braille(struct TextPrinter *textPrinter)
|
|||||||
case EXT_CTRL_CODE_ESCAPE:
|
case EXT_CTRL_CODE_ESCAPE:
|
||||||
char_ = *++textPrinter->printerTemplate.currentChar;
|
char_ = *++textPrinter->printerTemplate.currentChar;
|
||||||
break;
|
break;
|
||||||
case EXT_CTRL_CODE_SHIFT_TEXT:
|
case EXT_CTRL_CODE_SHIFT_RIGHT:
|
||||||
textPrinter->printerTemplate.currentX = textPrinter->printerTemplate.x + *textPrinter->printerTemplate.currentChar++;
|
textPrinter->printerTemplate.currentX = textPrinter->printerTemplate.x + *textPrinter->printerTemplate.currentChar++;
|
||||||
return RENDER_REPEAT;
|
return RENDER_REPEAT;
|
||||||
case EXT_CTRL_CODE_SHIFT_DOWN:
|
case EXT_CTRL_CODE_SHIFT_DOWN:
|
||||||
|
@ -133,7 +133,7 @@ void PadNameString(u8 *dest, u8 padChar)
|
|||||||
while (length < PLAYER_NAME_LENGTH - 1)
|
while (length < PLAYER_NAME_LENGTH - 1)
|
||||||
{
|
{
|
||||||
dest[length] = EXT_CTRL_CODE_BEGIN;
|
dest[length] = EXT_CTRL_CODE_BEGIN;
|
||||||
dest[length + 1] = EXT_CTRL_CODE_RESET_SIZE;
|
dest[length + 1] = EXT_CTRL_CODE_RESET_FONT;
|
||||||
length += 2;
|
length += 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user