mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-13 07:03:40 +01:00
through sub_8009734
This commit is contained in:
parent
f90106ae6c
commit
9029fb27c1
120
asm/link.s
120
asm/link.s
@ -5,126 +5,6 @@
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start sub_80096BC
|
||||
sub_80096BC: @ 80096BC
|
||||
push {lr}
|
||||
bl LoadOam
|
||||
bl ProcessSpriteCopyRequests
|
||||
bl TransferPlttBuffer
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_80096BC
|
||||
|
||||
thumb_func_start sub_80096D0
|
||||
sub_80096D0: @ 80096D0
|
||||
push {lr}
|
||||
ldr r3, =gUnknown_020229C4
|
||||
ldr r1, =gUnknown_03003110
|
||||
ldr r2, =0x0000efff
|
||||
adds r0, r1, 0
|
||||
adds r0, 0xE
|
||||
_080096DC:
|
||||
strh r2, [r0]
|
||||
subs r0, 0x2
|
||||
cmp r0, r1
|
||||
bge _080096DC
|
||||
movs r0, 0x1
|
||||
strb r0, [r3]
|
||||
bl sub_800B594
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_80096D0
|
||||
|
||||
thumb_func_start task02_080097CC
|
||||
task02_080097CC: @ 80096FC
|
||||
push {lr}
|
||||
lsls r0, 24
|
||||
lsrs r2, r0, 24
|
||||
ldr r0, =gTasks
|
||||
lsls r1, r2, 2
|
||||
adds r1, r2
|
||||
lsls r1, 3
|
||||
adds r1, r0
|
||||
ldrh r0, [r1, 0x8]
|
||||
adds r0, 0x1
|
||||
strh r0, [r1, 0x8]
|
||||
lsls r0, 16
|
||||
asrs r0, 16
|
||||
cmp r0, 0x5
|
||||
bne _08009726
|
||||
ldr r1, =gUnknown_03003144
|
||||
movs r0, 0x1
|
||||
strb r0, [r1]
|
||||
adds r0, r2, 0
|
||||
bl DestroyTask
|
||||
_08009726:
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end task02_080097CC
|
||||
|
||||
thumb_func_start sub_8009734
|
||||
sub_8009734: @ 8009734
|
||||
push {r4-r6,lr}
|
||||
ldr r0, =gLinkVSyncDisabled
|
||||
ldrb r4, [r0]
|
||||
cmp r4, 0
|
||||
bne _080097A8
|
||||
bl sub_800B628
|
||||
bl sub_80096D0
|
||||
ldr r1, =gUnknown_03003140
|
||||
ldr r0, =sub_800A824
|
||||
str r0, [r1]
|
||||
ldr r0, =gUnknown_03002748
|
||||
strb r4, [r0]
|
||||
ldr r0, =gUnknown_0300306C
|
||||
strb r4, [r0]
|
||||
ldr r0, =gUnknown_030030F8
|
||||
strb r4, [r0]
|
||||
bl ResetBlockReceivedFlags
|
||||
bl sub_800A2E0
|
||||
ldr r0, =gUnknown_03000D54
|
||||
str r4, [r0]
|
||||
ldr r0, =gUnknown_030030E8
|
||||
strb r4, [r0]
|
||||
ldr r0, =gUnknown_030030E4
|
||||
strb r4, [r0]
|
||||
ldr r0, =gUnknown_030030F4
|
||||
strh r4, [r0]
|
||||
ldr r0, =task02_080097CC
|
||||
movs r1, 0x2
|
||||
bl CreateTask
|
||||
b _080097AC
|
||||
.pool
|
||||
_080097A8:
|
||||
bl sub_800E700
|
||||
_080097AC:
|
||||
ldr r1, =gReceivedRemoteLinkPlayers
|
||||
movs r0, 0
|
||||
strb r0, [r1]
|
||||
movs r1, 0
|
||||
ldr r6, =gUnknown_03003078
|
||||
movs r2, 0
|
||||
movs r5, 0x1
|
||||
ldr r4, =gUnknown_030030F0
|
||||
ldr r3, =gUnknown_030030EC
|
||||
_080097BE:
|
||||
adds r0, r1, r6
|
||||
strb r5, [r0]
|
||||
adds r0, r1, r4
|
||||
strb r2, [r0]
|
||||
adds r0, r1, r3
|
||||
strb r2, [r0]
|
||||
adds r1, 0x1
|
||||
cmp r1, 0x3
|
||||
ble _080097BE
|
||||
pop {r4-r6}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_8009734
|
||||
|
||||
thumb_func_start sub_80097E8
|
||||
sub_80097E8: @ 80097E8
|
||||
push {r4,lr}
|
||||
|
@ -194,8 +194,20 @@ u8 sub_800ABAC(void);
|
||||
u8 sub_800ABBC(void);
|
||||
void sub_800AC34(void);
|
||||
|
||||
void sub_800B628(void);
|
||||
void sub_80097E8(void);
|
||||
|
||||
extern IWRAM_DATA u8 gUnknown_0300306C;
|
||||
extern IWRAM_DATA u8 gUnknown_03003078[4];
|
||||
extern IWRAM_DATA u8 gUnknown_030030E4;
|
||||
extern IWRAM_DATA u8 gUnknown_030030E8;
|
||||
extern IWRAM_DATA u8 gUnknown_030030EC[4];
|
||||
extern IWRAM_DATA u8 gUnknown_030030F0[4];
|
||||
extern IWRAM_DATA u16 gUnknown_030030F4;
|
||||
extern IWRAM_DATA u8 gUnknown_030030F8;
|
||||
extern IWRAM_DATA u16 gUnknown_03003110[8];
|
||||
extern IWRAM_DATA struct LinkTestBGInfo gUnknown_03003130; // common
|
||||
extern IWRAM_DATA void (*gUnknown_03003140)(void);
|
||||
extern IWRAM_DATA bool8 gUnknown_03003144;
|
||||
|
||||
#endif // GUARD_LINK_H
|
||||
|
@ -50,6 +50,8 @@ extern bool8 gLinkVSyncDisabled;
|
||||
extern const u8 gGameVersion;
|
||||
extern const u8 gGameLanguage;
|
||||
|
||||
extern IWRAM_DATA u8 gUnknown_03002748;
|
||||
|
||||
void AgbMain(void);
|
||||
void SetMainCallback2(MainCallback callback);
|
||||
void InitKeys(void);
|
||||
|
64
src/link.c
64
src/link.c
@ -57,6 +57,7 @@ IWRAM_DATA void *gUnknown_03000DA8;
|
||||
IWRAM_DATA void *gUnknown_03000DAC;
|
||||
IWRAM_DATA bool32 gUnknown_03000DB0;
|
||||
|
||||
bool8 gUnknown_020229C4 = 0;
|
||||
u16 gUnknown_020229C6 = 0;
|
||||
struct LinkPlayer gUnknown_020229CC = {};
|
||||
|
||||
@ -67,6 +68,8 @@ void sub_80096BC(void);
|
||||
void c2_08009A8C(void);
|
||||
void sub_800A2E0(void);
|
||||
void task00_link_test(u8 taskId);
|
||||
void sub_800A824(void);
|
||||
void sub_800B594(void);
|
||||
void sub_800B4A4(void);
|
||||
u32 sub_800BEC0(void);
|
||||
void sub_800E700(void);
|
||||
@ -202,3 +205,64 @@ void sub_8009638(void)
|
||||
gUnknown_020229CC.name[8] |= 0x10;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80096BC(void)
|
||||
{
|
||||
LoadOam();
|
||||
ProcessSpriteCopyRequests();
|
||||
TransferPlttBuffer();
|
||||
}
|
||||
|
||||
void sub_80096D0(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 8; i ++)
|
||||
{
|
||||
gUnknown_03003110[i] = 0xefff;
|
||||
}
|
||||
gUnknown_020229C4 = TRUE;
|
||||
sub_800B594();
|
||||
}
|
||||
|
||||
void task02_080097CC(u8 taskId)
|
||||
{
|
||||
if (++ gTasks[taskId].data[0] == 5)
|
||||
{
|
||||
gUnknown_03003144 = TRUE;
|
||||
DestroyTask(taskId);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8009734(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (!gLinkVSyncDisabled)
|
||||
{
|
||||
sub_800B628();
|
||||
sub_80096D0();
|
||||
gUnknown_03003140 = sub_800A824;
|
||||
gUnknown_03002748 = 0;
|
||||
gUnknown_0300306C = 0;
|
||||
gUnknown_030030F8 = 0;
|
||||
ResetBlockReceivedFlags();
|
||||
sub_800A2E0();
|
||||
gUnknown_03000D54 = 0;
|
||||
gUnknown_030030E8 = 0;
|
||||
gUnknown_030030E4 = 0;
|
||||
gUnknown_030030F4 = 0;
|
||||
CreateTask(task02_080097CC, 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
sub_800E700();
|
||||
}
|
||||
gReceivedRemoteLinkPlayers = 0;
|
||||
for (i = 0; i < 4; i ++)
|
||||
{
|
||||
gUnknown_03003078[i] = 1;
|
||||
gUnknown_030030F0[i] = 0;
|
||||
gUnknown_030030EC[i] = 0;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user