From 59eb766f47ca0f144447b13aabf7c4b9135fc0f3 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Tue, 7 Nov 2017 21:45:44 -0500 Subject: [PATCH] sub_80094EC --- asm/link.s | 56 -------------------------------------------------- data/link.s | 19 ----------------- include/link.h | 1 + src/link.c | 28 +++++++++++++++++++++++++ 4 files changed, 29 insertions(+), 75 deletions(-) diff --git a/asm/link.s b/asm/link.s index d4b76a96e5..6926c065c4 100644 --- a/asm/link.s +++ b/asm/link.s @@ -5,62 +5,6 @@ .text - thumb_func_start sub_80094EC -sub_80094EC: @ 80094EC - push {r4-r6,lr} - mov r6, r8 - push {r6} - mov r8, r0 - adds r6, r1, 0 - adds r4, r2, 0 - adds r5, r3, 0 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r6, 24 - lsrs r6, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =gLinkTestDigitsPal - mov r2, r8 - lsls r1, r2, 4 - movs r2, 0x20 - bl LoadPalette - ldr r2, =0x040000d4 - ldr r0, =gLinkTestDigitsGfx - str r0, [r2] - lsls r0, r5, 14 - movs r1, 0xC0 - lsls r1, 19 - adds r0, r1 - str r0, [r2, 0x4] - ldr r0, =0x80000110 - str r0, [r2, 0x8] - ldr r0, [r2, 0x8] - ldr r0, =gUnknown_03003130 - str r4, [r0] - mov r1, r8 - str r1, [r0, 0x4] - movs r1, 0 - str r1, [r0, 0x8] - ldr r0, =gUnknown_082ED1D0 - adds r6, r0 - ldrb r0, [r6] - lsls r4, 8 - lsls r5, 2 - orrs r4, r5 - adds r1, r4, 0 - bl SetGpuReg - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80094EC - thumb_func_start sub_8009570 sub_8009570: @ 8009570 push {r4,lr} diff --git a/data/link.s b/data/link.s index 578ae0256e..51e9d0c70b 100644 --- a/data/link.s +++ b/data/link.s @@ -5,26 +5,7 @@ .section .rodata - .string "{HIGHLIGHT TRANSPARENT}{COLOR WHITE}$" - .align 2 -g2BlankTilesGfx:: @ 82ED168 - .incbin "graphics/interface/blank_1x2.4bpp" - -gUnknown_082ED1A8:: @ 82ED1A8 - .4byte gUnknown_020228C4 - .4byte 0x000000C8 - .4byte gUnknown_020228C4 - .4byte 0x000000C8 - .4byte gUnknown_020228C4 - .4byte 0x00000064 - .4byte gUnknown_020228C4 - .4byte 0x000000DC - .4byte gUnknown_020228C4 - .4byte 0x00000028 - -gUnknown_082ED1D0:: @ 82ED1D0 - .byte 0x8, 0xA, 0xC, 0xE gASCIIGameFreakInc:: @ 82ED1D4 .ascii "GameFreak inc." diff --git a/include/link.h b/include/link.h index 64bb8ff47a..c8eece572e 100644 --- a/include/link.h +++ b/include/link.h @@ -132,6 +132,7 @@ extern const struct BlockRequest sBlockRequestLookupTable[5]; extern struct Link gLink; extern u16 gRecvCmds[CMD_LENGTH][MAX_LINK_PLAYERS]; +extern u8 gUnknown_020228C4[BLOCK_BUFFER_SIZE]; // gBlockSendBuffer extern u8 gBlockSendBuffer[BLOCK_BUFFER_SIZE]; extern u16 gLinkType; extern u32 gLinkStatus; diff --git a/src/link.c b/src/link.c index 0b70021249..7955f4427d 100644 --- a/src/link.c +++ b/src/link.c @@ -67,6 +67,24 @@ const u8 gWirelessLinkDisplayGfx[] = INCBIN_U8("graphics/interface/wireless_link const u8 gWirelessLinkDisplayTilemap[] = INCBIN_U8("graphics/interface/wireless_link_display.bin.lz"); const u16 gLinkTestDigitsPal[] = INCBIN_U16("graphics/interface/link_test_digits.gbapal"); const u16 gLinkTestDigitsGfx[] = INCBIN_U16("graphics/interface/link_test_digits.4bpp"); +const u8 unkstring_82ed160[] = _("{HIGHLIGHT TRANSPARENT}{COLOR WHITE}"); +const u16 g2BlankTilesGfx[] = INCBIN_U16("graphics/interface/blank_1x2.4bpp"); +const struct { + void *data; + u16 size; +} gUnknown_082ED1A8[] = { + {gUnknown_020228C4, 200}, + {gUnknown_020228C4, 200}, + {gUnknown_020228C4, 100}, + {gUnknown_020228C4, 220}, + {gUnknown_020228C4, 40} +}; +const u8 gUnknown_082ED1D0[] = { + REG_OFFSET_BG0CNT, + REG_OFFSET_BG1CNT, + REG_OFFSET_BG2CNT, + REG_OFFSET_BG3CNT +}; // .text @@ -113,3 +131,13 @@ void sub_8009414(u8 a0, u8 a1, u8 a2, u8 a3, u16 a4) SetGpuReg(REG_OFFSET_BG0HOFS + a1 * 4, 0); SetGpuReg(REG_OFFSET_BG0VOFS + a1 * 4, 0); } + +void sub_80094EC(u8 a0, u8 a1, u8 a2, u8 a3) +{ + LoadPalette(gLinkTestDigitsPal, a0 * 16, 0x20); + DmaCopy16(3, gLinkTestDigitsGfx, (u16 *)BG_CHAR_ADDR(a3), sizeof gLinkTestDigitsGfx); + gUnknown_03003130[0] = a2; + gUnknown_03003130[1] = a0; + gUnknown_03003130[2] = 0; + SetGpuReg(gUnknown_082ED1D0[a1], BGCNT_SCREENBASE(a2) | BGCNT_CHARBASE(a3)); +}