summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/text.c4
-rw-r--r--src/trade.c16
2 files changed, 18 insertions, 2 deletions
diff --git a/src/text.c b/src/text.c
index 1dc81df0c..35f74b339 100644
--- a/src/text.c
+++ b/src/text.c
@@ -2342,7 +2342,7 @@ u8 sub_8003490(struct Window *win, u8 c, u16 tileDataStartOffset, u8 left, u8 to
void sub_80034D4(u8 *tileData, const u8 *text)
{
- sub_8004E3C((struct WindowConfig *)&gWindowConfig_81E6C74, tileData, text);
+ sub_8004E3C(&gWindowConfig_81E6C74, tileData, text);
}
u8 sub_80034EC(u8 *str)
@@ -3645,7 +3645,7 @@ void sub_8004E28(struct Window *win, u8 *foreground, u8 *background, u8 *shadow)
*shadow = win->shadowColor;
}
-void sub_8004E3C(struct WindowConfig *winConfig, u8 *tileData, const u8 *text)
+void sub_8004E3C(const struct WindowConfig *winConfig, u8 *tileData, const u8 *text)
{
sTempWindow.config = winConfig;
InitWindow(&sTempWindow, text, 0, 0, 0);
diff --git a/src/trade.c b/src/trade.c
index 13811336e..3cb292a1b 100644
--- a/src/trade.c
+++ b/src/trade.c
@@ -3511,6 +3511,22 @@ static bool8 sub_804ABF8(void)
asm(".section .text.sub_804DAD4");
+void sub_804AFB8(const struct WindowConfig *windowConfig, u8 *dest, const u8 *src, u8 size)
+{
+ u8 i;
+ u8 *tileBuffer;
+ size = (size + 3) / 4;
+ tileBuffer = gTileBuffer;
+ CpuFill16(0, tileBuffer, size * 0x80);
+ CpuFill16(0, tileBuffer + windowConfig->width * 0x20, size * 0x80);
+ sub_8004E3C(windowConfig, tileBuffer, src);
+ for (i = 0; i < size; i ++)
+ {
+ CpuCopy16(&tileBuffer[32 * (i * 4)], &dest[32 * (i * 8)], 0x80);
+ CpuCopy16(&tileBuffer[32 * (i * 4 + windowConfig->width)], &dest[32 * (i * 8 + 4)], 0x80);
+ }
+}
+
void sub_804B058(struct Sprite *sprite)
{
if (++ sprite->data0 == 10)