summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--asm/wireless_communication_status_screen.s227
-rw-r--r--data/data_83FECCC.s74
-rw-r--r--data/data_8468C98.s21
-rw-r--r--graphics/misc/unk_8.pal19
-rw-r--r--graphics/misc/unk_846f4d0.pal19
-rw-r--r--graphics/misc/unk_846f4f0.pal19
-rw-r--r--graphics/misc/unk_846f510.pal19
-rw-r--r--graphics/misc/unk_846f530.pal19
-rw-r--r--graphics/misc/unk_846f550.pal19
-rw-r--r--graphics/misc/unk_846f570.pal19
-rw-r--r--graphics/misc/unk_846f590.pal19
-rw-r--r--graphics/misc/unk_846f5b0.pal19
-rw-r--r--graphics/misc/unk_846f5d0.pal19
-rw-r--r--graphics/misc/unk_846f5f0.pal19
-rw-r--r--graphics/misc/unk_846f610.pal19
-rw-r--r--graphics/misc/unk_846f630.pal19
-rw-r--r--graphics/misc/unk_846f650.pal19
-rw-r--r--graphics/misc/unk_846f670.pal19
-rw-r--r--graphics/misc/unk_846f690.pal19
-rw-r--r--graphics/misc/unk_846f6b0.pal19
-rw-r--r--graphics/misc/unk_846f6d0.pngbin0 -> 490 bytes
-rw-r--r--graphics/misc/unk_846f8e0.binbin0 -> 404 bytes
-rw-r--r--ld_script.txt2
-rw-r--r--src/wireless_communication_status_screen.c243
24 files changed, 641 insertions, 249 deletions
diff --git a/asm/wireless_communication_status_screen.s b/asm/wireless_communication_status_screen.s
index 451ab60b9..a8e0dce29 100644
--- a/asm/wireless_communication_status_screen.s
+++ b/asm/wireless_communication_status_screen.s
@@ -5,233 +5,6 @@
.text
- thumb_func_start sub_814F19C
-sub_814F19C: @ 814F19C
- push {lr}
- bl IsDma3ManagerBusyWithBgCopy
- lsls r0, 24
- cmp r0, 0
- bne _0814F1BC
- bl RunTasks
- bl RunTextPrinters
- bl AnimateSprites
- bl BuildOamBuffer
- bl UpdatePaletteFade
-_0814F1BC:
- pop {r0}
- bx r0
- thumb_func_end sub_814F19C
-
- thumb_func_start sub_814F1C0
-sub_814F1C0: @ 814F1C0
- push {lr}
- bl LoadOam
- bl ProcessSpriteCopyRequests
- bl TransferPlttBuffer
- pop {r0}
- bx r0
- thumb_func_end sub_814F1C0
-
- thumb_func_start sub_814F1D4
-sub_814F1D4: @ 814F1D4
- push {lr}
- ldr r0, _0814F1E0 @ =sub_814F1E4
- bl SetMainCallback2
- pop {r0}
- bx r0
- .align 2, 0
-_0814F1E0: .4byte sub_814F1E4
- thumb_func_end sub_814F1D4
-
- thumb_func_start sub_814F1E4
-sub_814F1E4: @ 814F1E4
- push {r4,r5,lr}
- sub sp, 0xC
- movs r0, 0
- movs r1, 0
- bl SetGpuReg
- ldr r5, _0814F308 @ =gUnknown_3002040
- movs r0, 0x6C
- bl AllocZeroed
- str r0, [r5]
- movs r0, 0
- bl SetVBlankCallback
- movs r0, 0
- bl ResetBgsAndClearDma3BusyFlags
- ldr r1, _0814F30C @ =gUnknown_846FA74
- movs r0, 0
- movs r2, 0x2
- bl InitBgsFromTemplates
- movs r4, 0x80
- lsls r4, 4
- adds r0, r4, 0
- bl Alloc
- adds r1, r0, 0
- movs r0, 0x1
- bl SetBgTilemapBuffer
- adds r0, r4, 0
- bl Alloc
- adds r1, r0, 0
- movs r0, 0
- bl SetBgTilemapBuffer
- ldr r1, _0814F310 @ =gUnknown_846F6D0
- movs r0, 0
- str r0, [sp]
- movs r0, 0x1
- movs r2, 0
- movs r3, 0
- bl DecompressAndLoadBgGfxUsingHeap
- ldr r1, _0814F314 @ =gUnknown_846F8E0
- movs r0, 0x1
- movs r2, 0
- movs r3, 0
- bl CopyToBgTilemapBuffer
- ldr r0, _0814F318 @ =gUnknown_846FA7C
- bl InitWindows
- bl DeactivateAllTextPrinters
- bl ResetPaletteFade
- bl ResetSpriteData
- bl ResetTasks
- bl ScanlineEffect_Stop
- bl m4aSoundVSyncOn
- ldr r0, _0814F31C @ =sub_814F1C0
- bl SetVBlankCallback
- ldr r0, _0814F320 @ =sub_814F46C
- movs r1, 0
- bl CreateTask
- ldr r1, [r5]
- adds r1, 0x60
- strb r0, [r1]
- bl sub_8116DE0
- ldr r1, [r5]
- adds r1, 0x61
- strb r0, [r1]
- ldr r1, [r5]
- movs r0, 0x1
- str r0, [r1, 0x1C]
- movs r0, 0
- movs r1, 0
- movs r2, 0
- bl ChangeBgX
- movs r0, 0
- movs r1, 0
- movs r2, 0
- bl ChangeBgY
- movs r0, 0x1
- movs r1, 0
- movs r2, 0
- bl ChangeBgX
- movs r0, 0x1
- movs r1, 0
- movs r2, 0
- bl ChangeBgY
- ldr r0, _0814F324 @ =gUnknown_846F4D0
- movs r1, 0
- movs r2, 0x20
- bl LoadPalette
- movs r0, 0xF0
- bl Menu_LoadStdPalAt
- bl UnkTextUtil_Reset
- movs r0, 0x20
- str r0, [sp]
- str r0, [sp, 0x4]
- movs r0, 0xF
- str r0, [sp, 0x8]
- movs r0, 0
- movs r1, 0
- movs r2, 0
- movs r3, 0
- bl FillBgTilemapBufferRect
- movs r0, 0x1
- bl CopyBgTilemapBufferToVram
- ldr r0, _0814F328 @ =sub_814F19C
- bl SetMainCallback2
- bl RunTasks
- bl RunTextPrinters
- bl AnimateSprites
- bl BuildOamBuffer
- bl UpdatePaletteFade
- add sp, 0xC
- pop {r4,r5}
- pop {r0}
- bx r0
- .align 2, 0
-_0814F308: .4byte gUnknown_3002040
-_0814F30C: .4byte gUnknown_846FA74
-_0814F310: .4byte gUnknown_846F6D0
-_0814F314: .4byte gUnknown_846F8E0
-_0814F318: .4byte gUnknown_846FA7C
-_0814F31C: .4byte sub_814F1C0
-_0814F320: .4byte sub_814F46C
-_0814F324: .4byte gUnknown_846F4D0
-_0814F328: .4byte sub_814F19C
- thumb_func_end sub_814F1E4
-
- thumb_func_start sub_814F32C
-sub_814F32C: @ 814F32C
- push {r4,lr}
- bl FreeAllWindowBuffers
- movs r4, 0
-_0814F334:
- lsls r0, r4, 24
- lsrs r0, 24
- bl GetBgTilemapBuffer
- bl Free
- adds r4, 0x1
- cmp r4, 0x1
- ble _0814F334
- ldr r0, _0814F35C @ =gUnknown_3002040
- ldr r0, [r0]
- bl Free
- ldr r0, _0814F360 @ =c2_exit_to_overworld_1_continue_scripts_restart_music
- bl SetMainCallback2
- pop {r4}
- pop {r0}
- bx r0
- .align 2, 0
-_0814F35C: .4byte gUnknown_3002040
-_0814F360: .4byte c2_exit_to_overworld_1_continue_scripts_restart_music
- thumb_func_end sub_814F32C
-
- thumb_func_start sub_814F364
-sub_814F364: @ 814F364
- push {lr}
- adds r2, r0, 0
- ldrh r0, [r2]
- adds r0, 0x1
- strh r0, [r2]
- lsls r0, 16
- asrs r0, 16
- cmp r0, 0x5
- ble _0814F38C
- ldrh r0, [r1]
- adds r0, 0x1
- strh r0, [r1]
- lsls r0, 16
- asrs r0, 16
- cmp r0, 0xE
- bne _0814F388
- movs r0, 0
- strh r0, [r1]
-_0814F388:
- movs r0, 0
- strh r0, [r2]
-_0814F38C:
- movs r2, 0
- ldrsh r0, [r1, r2]
- adds r0, 0x2
- lsls r0, 5
- ldr r1, _0814F3A4 @ =gUnknown_846F4D0
- adds r0, r1
- movs r1, 0
- movs r2, 0x10
- bl LoadPalette
- pop {r0}
- bx r0
- .align 2, 0
-_0814F3A4: .4byte gUnknown_846F4D0
- thumb_func_end sub_814F364
-
thumb_func_start sub_814F3A8
sub_814F3A8: @ 814F3A8
push {r4,r5,lr}
diff --git a/data/data_83FECCC.s b/data/data_83FECCC.s
index bcf6b8516..b391e56ed 100644
--- a/data/data_83FECCC.s
+++ b/data/data_83FECCC.s
@@ -2372,7 +2372,79 @@ gUnknown_841E21E:: @ 841E21E
.incbin "baserom.gba", 0x41E21E, 0x16
gUnknown_841E234:: @ 841E234
- .incbin "baserom.gba", 0x41E234, 0xF1
+ .string "From $"
+
+gUnknown_841E23A:: @ 841E23A
+ .string "$"
+
+gUnknown_841E23B:: @ 841E23B
+ .string "$"
+
+gUnknown_841E23C:: @ 841E23C
+ .string "$"
+
+gUnknown_841E23D:: @ 841E23D
+ .string "$"
+
+gUnknown_841E23E:: @ 841E23E
+ .string "$"
+
+gUnknown_841E23F:: @ 841E23F
+ .string "$"
+
+gUnknown_841E240:: @ 841E240
+ .string "$"
+
+gUnknown_841E241:: @ 841E241
+ .string "$"
+
+gUnknown_841E242:: @ 841E242
+ .string "$"
+
+gUnknown_841E243:: @ 841E243
+ .string "$"
+
+gUnknown_841E244:: @ 841E244
+ .string "$"
+
+gUnknown_841E245:: @ 841E245
+ .string "Wireless Communication Status$"
+
+gUnknown_841E263:: @ 841E263
+ .string "People trading:$"
+
+gUnknown_841E273:: @ 841E273
+ .string "People battling:$"
+
+gUnknown_841E284:: @ 841E284
+ .string "People in the UNION ROOM:$"
+
+gUnknown_841E29E:: @ 841E29E
+ .string "People communicating:$"
+
+gUnknown_841E2B4:: @ 841E2B4
+ .string "{UNKNOWN_F7 0x00} players$"
+
+gUnknown_841E2BF:: @ 841E2BF
+ .string "{UNKNOWN_F7 0x01} player$"
+
+gUnknown_841E2C9:: @ 841E2C9
+ .string "{UNKNOWN_F7 0x02} players$"
+
+gUnknown_841E2D4:: @ 841E2D4
+ .string "{UNKNOWN_F7 0x03} players$"
+
+gUnknown_841E2DF:: @ 841E2DF
+ .incbin "baserom.gba", 0x41e2df, 0xd
+
+gUnknown_841E2EC:: @ 841E2EC
+ .incbin "baserom.gba", 0x41e2ec, 0x9
+
+gUnknown_841E2F5:: @ 841E2F5
+ .incbin "baserom.gba", 0x41e2f5, 0x2d
+
+gUnknown_841E322:: @ 841E322
+ .string "{UNKNOWN_F9 0x07}$"
gUnknown_841E325:: @ 841E325
.string "Communication standby…$"
diff --git a/data/data_8468C98.s b/data/data_8468C98.s
index abb5c5cc2..5b59683b2 100644
--- a/data/data_8468C98.s
+++ b/data/data_8468C98.s
@@ -292,24 +292,3 @@ gUnknown_846F488:: @ 846F488
gUnknown_846F4B8:: @ 846F4B8
.incbin "baserom.gba", 0x46F4B8, 0x18
-
-gUnknown_846F4D0:: @ 846F4D0
- .incbin "baserom.gba", 0x46F4D0, 0x200
-
-gUnknown_846F6D0:: @ 846F6D0
- .incbin "baserom.gba", 0x46F6D0, 0x210
-
-gUnknown_846F8E0:: @ 846F8E0
- .incbin "baserom.gba", 0x46F8E0, 0x194
-
-gUnknown_846FA74:: @ 846FA74
- .incbin "baserom.gba", 0x46FA74, 0x8
-
-gUnknown_846FA7C:: @ 846FA7C
- .incbin "baserom.gba", 0x46FA7C, 0x30
-
-gUnknown_846FAAC:: @ 846FAAC
- .incbin "baserom.gba", 0x46FAAC, 0x14
-
-gUnknown_846FAC0:: @ 846FAC0
- .incbin "baserom.gba", 0x46FAC0, 0x48
diff --git a/graphics/misc/unk_8.pal b/graphics/misc/unk_8.pal
new file mode 100644
index 000000000..d7d8f43b7
--- /dev/null
+++ b/graphics/misc/unk_8.pal
@@ -0,0 +1,19 @@
+JASC-PAL
+0100
+16
+255 24 0
+0 131 213
+32 205 255
+115 106 164
+74 156 49
+16 106 65
+238 8 8
+16 164 16
+32 32 205
+74 65 90
+139 0 74
+90 32 49
+0 115 0
+255 90 65
+24 172 164
+246 106 49
diff --git a/graphics/misc/unk_846f4d0.pal b/graphics/misc/unk_846f4d0.pal
new file mode 100644
index 000000000..dd11346b7
--- /dev/null
+++ b/graphics/misc/unk_846f4d0.pal
@@ -0,0 +1,19 @@
+JASC-PAL
+0100
+16
+0 0 0
+90 90 90
+90 90 90
+90 90 90
+90 90 90
+90 90 90
+90 90 90
+90 90 90
+57 57 57
+172 123 0
+90 90 90
+57 57 57
+164 164 164
+255 180 0
+106 106 106
+74 74 74
diff --git a/graphics/misc/unk_846f4f0.pal b/graphics/misc/unk_846f4f0.pal
new file mode 100644
index 000000000..4b0812f09
--- /dev/null
+++ b/graphics/misc/unk_846f4f0.pal
@@ -0,0 +1,19 @@
+JASC-PAL
+0100
+16
+0 0 0
+0 0 0
+0 0 0
+0 0 0
+0 0 0
+0 0 0
+0 0 0
+0 0 0
+0 0 0
+0 0 0
+0 0 0
+0 0 0
+0 0 0
+0 0 0
+0 0 0
+0 0 0
diff --git a/graphics/misc/unk_846f510.pal b/graphics/misc/unk_846f510.pal
new file mode 100644
index 000000000..7779155a6
--- /dev/null
+++ b/graphics/misc/unk_846f510.pal
@@ -0,0 +1,19 @@
+JASC-PAL
+0100
+16
+0 0 0
+90 90 90
+90 90 90
+90 90 90
+90 90 90
+90 90 90
+90 90 90
+74 246 255
+57 57 57
+172 123 0
+90 90 90
+57 57 57
+164 164 164
+255 180 0
+106 106 106
+74 74 74
diff --git a/graphics/misc/unk_846f530.pal b/graphics/misc/unk_846f530.pal
new file mode 100644
index 000000000..30040b471
--- /dev/null
+++ b/graphics/misc/unk_846f530.pal
@@ -0,0 +1,19 @@
+JASC-PAL
+0100
+16
+0 0 0
+90 90 90
+90 90 90
+90 90 90
+90 90 90
+90 90 90
+74 246 255
+57 213 230
+57 57 57
+172 123 0
+90 90 90
+57 57 57
+164 164 164
+255 180 0
+106 106 106
+74 74 74
diff --git a/graphics/misc/unk_846f550.pal b/graphics/misc/unk_846f550.pal
new file mode 100644
index 000000000..3b40e7681
--- /dev/null
+++ b/graphics/misc/unk_846f550.pal
@@ -0,0 +1,19 @@
+JASC-PAL
+0100
+16
+0 0 0
+90 90 90
+90 90 90
+90 90 90
+90 90 90
+74 246 255
+57 213 230
+49 180 205
+0 32 98
+172 123 0
+90 90 90
+57 57 57
+164 164 164
+255 180 0
+106 106 106
+74 74 74
diff --git a/graphics/misc/unk_846f570.pal b/graphics/misc/unk_846f570.pal
new file mode 100644
index 000000000..b0756a995
--- /dev/null
+++ b/graphics/misc/unk_846f570.pal
@@ -0,0 +1,19 @@
+JASC-PAL
+0100
+16
+0 0 0
+90 90 90
+90 90 90
+90 90 90
+74 246 255
+57 213 230
+49 180 205
+41 148 180
+0 32 98
+172 123 0
+90 90 90
+57 57 57
+164 164 164
+255 180 0
+106 106 106
+74 74 74
diff --git a/graphics/misc/unk_846f590.pal b/graphics/misc/unk_846f590.pal
new file mode 100644
index 000000000..60916f08c
--- /dev/null
+++ b/graphics/misc/unk_846f590.pal
@@ -0,0 +1,19 @@
+JASC-PAL
+0100
+16
+0 0 0
+90 90 90
+90 90 90
+74 246 255
+57 213 230
+49 180 205
+41 148 180
+24 123 164
+0 32 98
+172 123 0
+90 90 90
+57 57 57
+164 164 164
+255 180 0
+106 106 106
+74 74 74
diff --git a/graphics/misc/unk_846f5b0.pal b/graphics/misc/unk_846f5b0.pal
new file mode 100644
index 000000000..b59dc5901
--- /dev/null
+++ b/graphics/misc/unk_846f5b0.pal
@@ -0,0 +1,19 @@
+JASC-PAL
+0100
+16
+0 0 0
+90 90 90
+74 246 255
+57 213 230
+49 180 205
+41 148 180
+24 123 164
+16 90 139
+0 32 98
+172 123 0
+90 90 90
+57 57 57
+164 164 164
+255 180 0
+106 106 106
+74 74 74
diff --git a/graphics/misc/unk_846f5d0.pal b/graphics/misc/unk_846f5d0.pal
new file mode 100644
index 000000000..3f14d81e7
--- /dev/null
+++ b/graphics/misc/unk_846f5d0.pal
@@ -0,0 +1,19 @@
+JASC-PAL
+0100
+16
+0 0 0
+74 246 255
+57 213 230
+49 180 205
+41 148 180
+24 123 164
+16 90 139
+8 57 115
+0 32 98
+172 123 0
+90 90 90
+57 57 57
+164 164 164
+255 180 0
+106 106 106
+74 74 74
diff --git a/graphics/misc/unk_846f5f0.pal b/graphics/misc/unk_846f5f0.pal
new file mode 100644
index 000000000..e3da8baa6
--- /dev/null
+++ b/graphics/misc/unk_846f5f0.pal
@@ -0,0 +1,19 @@
+JASC-PAL
+0100
+16
+0 0 0
+57 213 230
+49 180 205
+41 148 180
+24 123 164
+16 90 139
+8 57 115
+8 57 115
+57 57 57
+172 123 0
+90 90 90
+57 57 57
+164 164 164
+255 180 0
+106 106 106
+74 74 74
diff --git a/graphics/misc/unk_846f610.pal b/graphics/misc/unk_846f610.pal
new file mode 100644
index 000000000..1544a2303
--- /dev/null
+++ b/graphics/misc/unk_846f610.pal
@@ -0,0 +1,19 @@
+JASC-PAL
+0100
+16
+0 0 0
+49 180 205
+41 148 180
+24 123 164
+16 90 139
+8 57 115
+8 57 115
+90 90 90
+57 57 57
+172 123 0
+90 90 90
+57 57 57
+164 164 164
+255 180 0
+106 106 106
+74 74 74
diff --git a/graphics/misc/unk_846f630.pal b/graphics/misc/unk_846f630.pal
new file mode 100644
index 000000000..8d3b1d4bc
--- /dev/null
+++ b/graphics/misc/unk_846f630.pal
@@ -0,0 +1,19 @@
+JASC-PAL
+0100
+16
+0 0 0
+41 148 180
+24 123 164
+16 90 139
+8 57 115
+8 57 115
+90 90 90
+90 90 90
+57 57 57
+172 123 0
+90 90 90
+57 57 57
+164 164 164
+255 180 0
+106 106 106
+74 74 74
diff --git a/graphics/misc/unk_846f650.pal b/graphics/misc/unk_846f650.pal
new file mode 100644
index 000000000..5ab981ba3
--- /dev/null
+++ b/graphics/misc/unk_846f650.pal
@@ -0,0 +1,19 @@
+JASC-PAL
+0100
+16
+0 0 0
+24 123 164
+16 90 139
+8 57 115
+8 57 115
+90 90 90
+90 90 90
+90 90 90
+57 57 57
+172 123 0
+90 90 90
+57 57 57
+164 164 164
+255 180 0
+106 106 106
+74 74 74
diff --git a/graphics/misc/unk_846f670.pal b/graphics/misc/unk_846f670.pal
new file mode 100644
index 000000000..46ad15269
--- /dev/null
+++ b/graphics/misc/unk_846f670.pal
@@ -0,0 +1,19 @@
+JASC-PAL
+0100
+16
+0 0 0
+16 90 139
+8 57 115
+8 57 115
+90 90 90
+90 90 90
+90 90 90
+90 90 90
+57 57 57
+172 123 0
+90 90 90
+57 57 57
+164 164 164
+255 180 0
+106 106 106
+74 74 74
diff --git a/graphics/misc/unk_846f690.pal b/graphics/misc/unk_846f690.pal
new file mode 100644
index 000000000..d1e4bdd02
--- /dev/null
+++ b/graphics/misc/unk_846f690.pal
@@ -0,0 +1,19 @@
+JASC-PAL
+0100
+16
+0 0 0
+8 57 115
+8 57 115
+90 90 90
+90 90 90
+90 90 90
+90 90 90
+90 90 90
+57 57 57
+172 123 0
+90 90 90
+57 57 57
+164 164 164
+255 180 0
+106 106 106
+74 74 74
diff --git a/graphics/misc/unk_846f6b0.pal b/graphics/misc/unk_846f6b0.pal
new file mode 100644
index 000000000..dd11346b7
--- /dev/null
+++ b/graphics/misc/unk_846f6b0.pal
@@ -0,0 +1,19 @@
+JASC-PAL
+0100
+16
+0 0 0
+90 90 90
+90 90 90
+90 90 90
+90 90 90
+90 90 90
+90 90 90
+90 90 90
+57 57 57
+172 123 0
+90 90 90
+57 57 57
+164 164 164
+255 180 0
+106 106 106
+74 74 74
diff --git a/graphics/misc/unk_846f6d0.png b/graphics/misc/unk_846f6d0.png
new file mode 100644
index 000000000..4c453cf1a
--- /dev/null
+++ b/graphics/misc/unk_846f6d0.png
Binary files differ
diff --git a/graphics/misc/unk_846f8e0.bin b/graphics/misc/unk_846f8e0.bin
new file mode 100644
index 000000000..1665bdff1
--- /dev/null
+++ b/graphics/misc/unk_846f8e0.bin
Binary files differ
diff --git a/ld_script.txt b/ld_script.txt
index c499b5947..a2f01cea2 100644
--- a/ld_script.txt
+++ b/ld_script.txt
@@ -251,6 +251,7 @@ SECTIONS {
asm/berry_crush.o(.text);
asm/berry_crush_2.o(.text);
asm/berry_crush_3.o(.text);
+ src/wireless_communication_status_screen.o(.text);
asm/wireless_communication_status_screen.o(.text);
src/braille_text.o(.text);
asm/text_window.o(.text);
@@ -428,6 +429,7 @@ SECTIONS {
. = ALIGN(4);
src/seagallop.o(.rodata);
data/data_8468C98.o(.rodata);
+ src/wireless_communication_status_screen.o(.rodata);
src/braille_text.o(.rodata);
src/text_window_graphics.o(.rodata);
src/quest_log_8150454.o(.rodata);
diff --git a/src/wireless_communication_status_screen.c b/src/wireless_communication_status_screen.c
new file mode 100644
index 000000000..559ac2ef0
--- /dev/null
+++ b/src/wireless_communication_status_screen.c
@@ -0,0 +1,243 @@
+#include "global.h"
+#include "bg.h"
+#include "palette.h"
+#include "gpu_regs.h"
+#include "malloc.h"
+#include "task.h"
+#include "text.h"
+#include "window.h"
+#include "new_menu_helpers.h"
+#include "scanline_effect.h"
+#include "m4a.h"
+#include "unk_text_util.h"
+#include "overworld.h"
+
+struct WirelessCommunicationStatusScreenStruct
+{
+ u8 filler_00[0x1C];
+ u32 field_1C;
+ u8 filler_20[0x40];
+ u8 field_60;
+ u8 field_61;
+ u8 filler_62[0xA];
+};
+
+struct WirelessCommunicationStatusScreenStruct * gUnknown_3002040;
+
+extern const u8 gUnknown_841E2B4[];
+extern const u8 gUnknown_841E2BF[];
+extern const u8 gUnknown_841E2C9[];
+extern const u8 gUnknown_841E2D4[];
+extern const u8 gUnknown_841E245[];
+extern const u8 gUnknown_841E263[];
+extern const u8 gUnknown_841E273[];
+extern const u8 gUnknown_841E284[];
+extern const u8 gUnknown_841E29E[];
+
+void sub_814F1E4(void);
+void sub_814F46C(u8 taskId);
+u8 sub_8116DE0(void);
+
+const u16 gUnknown_846F4D0[][16] = {
+ INCBIN_U16("graphics/misc/unk_846f4d0.gbapal"),
+ INCBIN_U16("graphics/misc/unk_846f4f0.gbapal"),
+ INCBIN_U16("graphics/misc/unk_846f510.gbapal"),
+ INCBIN_U16("graphics/misc/unk_846f530.gbapal"),
+ INCBIN_U16("graphics/misc/unk_846f550.gbapal"),
+ INCBIN_U16("graphics/misc/unk_846f570.gbapal"),
+ INCBIN_U16("graphics/misc/unk_846f590.gbapal"),
+ INCBIN_U16("graphics/misc/unk_846f5b0.gbapal"),
+ INCBIN_U16("graphics/misc/unk_846f5d0.gbapal"),
+ INCBIN_U16("graphics/misc/unk_846f5f0.gbapal"),
+ INCBIN_U16("graphics/misc/unk_846f610.gbapal"),
+ INCBIN_U16("graphics/misc/unk_846f630.gbapal"),
+ INCBIN_U16("graphics/misc/unk_846f650.gbapal"),
+ INCBIN_U16("graphics/misc/unk_846f670.gbapal"),
+ INCBIN_U16("graphics/misc/unk_846f690.gbapal"),
+ INCBIN_U16("graphics/misc/unk_846f6b0.gbapal")
+};
+
+const u32 gUnknown_846F6D0[] = INCBIN_U32("graphics/misc/unk_846f6d0.4bpp.lz");
+const u16 gUnknown_846F8E0[] = INCBIN_U16("graphics/misc/unk_846f8e0.bin");
+
+const struct BgTemplate gUnknown_846FA74[] = {
+ {
+ .bg = 0,
+ .charBaseIndex = 2,
+ .mapBaseIndex = 31,
+ .screenSize = 0,
+ .paletteMode = 0,
+ .priority = 0,
+ .baseTile = 0x000
+ }, {
+ .bg = 1,
+ .charBaseIndex = 0,
+ .mapBaseIndex = 8,
+ .screenSize = 0,
+ .paletteMode = 0,
+ .priority = 1,
+ .baseTile = 0x000
+ }
+};
+
+const struct WindowTemplate gUnknown_846FA7C[] = {
+ {
+ .priority = 0x00,
+ .tilemapLeft = 0x03,
+ .tilemapTop = 0x00,
+ .width = 0x18,
+ .height = 0x03,
+ .paletteNum = 0x0f,
+ .baseBlock = 0x0001
+ }, {
+ .priority = 0x00,
+ .tilemapLeft = 0x03,
+ .tilemapTop = 0x04,
+ .width = 0x16,
+ .height = 0x0f,
+ .paletteNum = 0x0f,
+ .baseBlock = 0x0049
+ }, {
+ .priority = 0x00,
+ .tilemapLeft = 0x19,
+ .tilemapTop = 0x04,
+ .width = 0x02,
+ .height = 0x0f,
+ .paletteNum = 0x0f,
+ .baseBlock = 0x0193
+ }, DUMMY_WIN_TEMPLATE
+};
+
+const u8 *const gUnknown_846FA9C[] = {
+ gUnknown_841E2B4,
+ gUnknown_841E2BF,
+ gUnknown_841E2C9,
+ gUnknown_841E2D4
+};
+const u8 *const gUnknown_846FAAC[] = {
+ gUnknown_841E245,
+ gUnknown_841E263,
+ gUnknown_841E273,
+ gUnknown_841E284,
+ gUnknown_841E29E
+};
+
+const u8 gUnknown_846FAC0[][3] = {
+ {0x01, 0x01, 0x02},
+ {0x02, 0x01, 0x02},
+ {0x03, 0x01, 0x04},
+ {0x04, 0x00, 0x02},
+ {0x15, 0x03, 0x02},
+ {0x16, 0x03, 0x02},
+ {0x09, 0x04, 0x00},
+ {0x0a, 0x04, 0x00},
+ {0x0b, 0x04, 0x00},
+ {0x0c, 0xff, 0x00},
+ {0x0d, 0x00, 0x00},
+ {0x0e, 0xff, 0x00},
+ {0x0f, 0x04, 0x00},
+ {0x10, 0xff, 0x00},
+ {0x40, 0x02, 0x01},
+ {0x41, 0x02, 0x02},
+ {0x44, 0x02, 0x02},
+ {0x45, 0x02, 0x00},
+ {0x48, 0x02, 0x02},
+ {0x54, 0x02, 0x01},
+ {0x53, 0x02, 0x02},
+ {0x51, 0x02, 0x01},
+ {0x52, 0x02, 0x01},
+ {0x00, 0x00, 0x00}
+};
+
+void sub_814F19C(void)
+{
+ if (!IsDma3ManagerBusyWithBgCopy())
+ {
+ RunTasks();
+ RunTextPrinters();
+ AnimateSprites();
+ BuildOamBuffer();
+ UpdatePaletteFade();
+ }
+}
+
+void sub_814F1C0(void)
+{
+ LoadOam();
+ ProcessSpriteCopyRequests();
+ TransferPlttBuffer();
+}
+
+void sub_814F1D4(void)
+{
+ SetMainCallback2(sub_814F1E4);
+}
+
+void sub_814F1E4(void)
+{
+ SetGpuReg(REG_OFFSET_DISPCNT, 0);
+ gUnknown_3002040 = AllocZeroed(sizeof(*gUnknown_3002040));
+ SetVBlankCallback(NULL);
+ ResetBgsAndClearDma3BusyFlags(0);
+ InitBgsFromTemplates(0, gUnknown_846FA74, NELEMS(gUnknown_846FA74));
+ SetBgTilemapBuffer(1, Alloc(0x800));
+ SetBgTilemapBuffer(0, Alloc(0x800));
+ DecompressAndLoadBgGfxUsingHeap(1, gUnknown_846F6D0, 0, 0, 0);
+ CopyToBgTilemapBuffer(1, gUnknown_846F8E0, 0, 0);
+ InitWindows(gUnknown_846FA7C);
+ DeactivateAllTextPrinters();
+ ResetPaletteFade();
+ ResetSpriteData();
+ ResetTasks();
+ ScanlineEffect_Stop();
+ m4aSoundVSyncOn();
+ SetVBlankCallback(sub_814F1C0);
+ gUnknown_3002040->field_60 = CreateTask(sub_814F46C, 0);
+ gUnknown_3002040->field_61 = sub_8116DE0();
+ gUnknown_3002040->field_1C = 1;
+ ChangeBgX(0, 0, 0);
+ ChangeBgY(0, 0, 0);
+ ChangeBgX(1, 0, 0);
+ ChangeBgY(1, 0, 0);
+ LoadPalette(gUnknown_846F4D0, 0, 0x20);
+ Menu_LoadStdPalAt(0xf0);
+ UnkTextUtil_Reset();
+ FillBgTilemapBufferRect(0, 0x000, 0, 0, 32, 32, 0xF);
+ CopyBgTilemapBufferToVram(1);
+ SetMainCallback2(sub_814F19C);
+ RunTasks();
+ RunTextPrinters();
+ AnimateSprites();
+ BuildOamBuffer();
+ UpdatePaletteFade();
+}
+
+void sub_814F32C(void)
+{
+ s32 i;
+
+ FreeAllWindowBuffers();
+ for (i = 0; i < 2; i++)
+ {
+ Free(GetBgTilemapBuffer(i));
+ }
+ Free(gUnknown_3002040);
+ SetMainCallback2(c2_exit_to_overworld_1_continue_scripts_restart_music);
+}
+
+void sub_814F364(s16 * unk0, s16 * unk1)
+{
+ s32 idx;
+ (*unk0)++;
+ if (*unk0 > 5)
+ {
+ (*unk1)++;
+ if (*unk1 == 14)
+ {
+ *unk1 = 0;
+ }
+ *unk0 = 0;
+ }
+ idx = *unk1 + 2;
+ LoadPalette(gUnknown_846F4D0[idx], 0, 16);
+}