This commit is contained in:
YamaArashi 2016-06-03 23:27:19 -07:00
parent 2405230037
commit 2998cc719a
24 changed files with 2384 additions and 4602 deletions

View File

@ -35,7 +35,7 @@ PREPROC := tools/preproc/preproc
C_SRCS := $(wildcard src/*.c)
C_OBJS := $(C_SRCS:%.c=%.o)
ASM_OBJS := asm/crt0.o asm/rom2.o asm/rom3.o asm/rom4.o asm/rom5.o \
ASM_OBJS := asm/crt0.o asm/rom3.o asm/rom4.o asm/rom5.o \
asm/libgcnmultiboot.o asm/m4a_1.o asm/m4a_3.o asm/libagbsyscall.o asm/libc.o
DATA_ASM_OBJS := data/data1.o data/data2.o data/graphics.o data/sound_data.o

4313
asm/rom2.s

File diff suppressed because it is too large Load Diff

View File

@ -4249,7 +4249,7 @@ sub_800B858: @ 800B858
ands r0, r1
cmp r0, 0
beq _0800B876
bl sub_8007378
bl OpenLink
ldr r0, _0800B880
movs r1, 0
bl CreateTask
@ -4619,7 +4619,7 @@ _0800BB84: .4byte 0x02024a72
_0800BB88: .4byte sub_8037510
_0800BB8C: .4byte 0x02024a68
_0800BB90:
bl link_get_multiplayer_id
bl GetMultiplayerId
lsls r0, 24
lsrs r5, r0, 24
ldrh r1, [r6]
@ -5462,8 +5462,8 @@ _0800C21A:
adds r0, 0x1
b _0800C352
_0800C220:
bl sub_8008300
bl sub_8008310
bl GetLinkPlayerCount_2
bl IsLinkMaster
lsls r0, 24
cmp r0, 0
beq _0800C248
@ -5544,7 +5544,7 @@ _0800C28C:
adds r5, r2
adds r1, r5
adds r2, r6, 0
bl sub_8007E88
bl SendBlock
ldrh r0, [r4, 0x1E]
adds r0, 0x1
strh r0, [r4, 0x1E]
@ -5649,7 +5649,7 @@ _0800C394: .4byte 0x03002970
_0800C398: .4byte 0x00002211
_0800C39C: .4byte 0x03002b80
_0800C3A0:
bl sub_8007EE4
bl GetBlockRecievedStatus
lsls r0, 24
lsrs r0, 24
ldr r2, _0800C468
@ -5662,7 +5662,7 @@ _0800C3A0:
cmp r0, 0
beq _0800C446
adds r0, r4, 0
bl sub_8007F30
bl ResetBlockReceivedFlag
lsls r0, r4, 8
mov r2, r10
adds r3, r0, r2
@ -5738,7 +5738,7 @@ _0800C446:
lsls r0, r1, 24
lsrs r4, r0, 24
_0800C44C:
bl sub_8007B78
bl GetLinkPlayerCount
lsls r0, 24
lsrs r0, 24
cmp r4, r0
@ -10871,7 +10871,7 @@ sub_800EC9C: @ 800EC9C
bl RunTasks
bl AnimateSprites
bl BuildOamBuffer
bl link_get_multiplayer_id
bl GetMultiplayerId
lsls r0, 24
lsrs r4, r0, 24
ldr r0, _0800ECD4
@ -10939,7 +10939,7 @@ _0800ED2E:
lsrs r0, 24
adds r1, r4, 0
movs r2, 0x20
bl sub_8007E88
bl SendBlock
ldr r0, _0800ED60
strb r5, [r0]
b _0800F008
@ -10960,14 +10960,14 @@ _0800ED64:
.align 2, 0
_0800ED78: .4byte 0x02024d1e
_0800ED7C:
bl sub_8007EE4
bl GetBlockRecievedStatus
movs r1, 0x3
ands r1, r0
cmp r1, 0x3
beq _0800ED8A
b _0800F008
_0800ED8A:
bl sub_8007F18
bl ResetBlockReceivedFlags
movs r3, 0
ldr r0, _0800EDA8
ldrh r1, [r0]
@ -11108,19 +11108,19 @@ _0800EE94:
lsrs r0, 24
ldr r1, _0800EEA8
movs r2, 0xC8
bl sub_8007E88
bl SendBlock
b _0800EF96
.align 2, 0
_0800EEA8: .4byte 0x03004360
_0800EEAC:
bl sub_8007EE4
bl GetBlockRecievedStatus
movs r1, 0x3
ands r1, r0
cmp r1, 0x3
beq _0800EEBA
b _0800F008
_0800EEBA:
bl sub_8007F18
bl ResetBlockReceivedFlags
ldr r0, _0800EED0
lsls r1, r5, 8
ldr r2, _0800EED4
@ -11143,19 +11143,19 @@ _0800EEE4:
lsrs r0, 24
ldr r1, _0800EEF8
movs r2, 0xC8
bl sub_8007E88
bl SendBlock
b _0800EF96
.align 2, 0
_0800EEF8: .4byte 0x03004428
_0800EEFC:
bl sub_8007EE4
bl GetBlockRecievedStatus
movs r1, 0x3
ands r1, r0
cmp r1, 0x3
beq _0800EF0A
b _0800F008
_0800EF0A:
bl sub_8007F18
bl ResetBlockReceivedFlags
ldr r0, _0800EF20
lsls r1, r5, 8
ldr r2, _0800EF24
@ -11176,17 +11176,17 @@ _0800EF28:
lsrs r0, 24
ldr r1, _0800EF44
movs r2, 0xC8
bl sub_8007E88
bl SendBlock
b _0800EF96
.align 2, 0
_0800EF44: .4byte 0x030044f0
_0800EF48:
bl sub_8007EE4
bl GetBlockRecievedStatus
movs r1, 0x3
ands r1, r0
cmp r1, 0x3
bne _0800F008
bl sub_8007F18
bl ResetBlockReceivedFlags
ldr r4, _0800EFA0
lsls r1, r5, 8
ldr r0, _0800EFA4
@ -11383,7 +11383,7 @@ sub_800F104: @ 800F104
mov r7, r9
mov r6, r8
push {r6,r7}
bl link_get_multiplayer_id
bl GetMultiplayerId
lsls r0, 24
lsrs r6, r0, 24
ldr r4, _0800F148
@ -11441,7 +11441,7 @@ _0800F17E:
lsrs r0, 24
adds r1, r4, 0
movs r2, 0x60
bl sub_8007E88
bl SendBlock
ldrb r0, [r5]
adds r0, 0x1
strb r0, [r5]
@ -11449,12 +11449,12 @@ _0800F17E:
.align 2, 0
_0800F19C: .4byte 0x03002fa4
_0800F1A0:
bl sub_8007EE4
bl GetBlockRecievedStatus
movs r1, 0xF
ands r1, r0
cmp r1, 0xF
bne _0800F27A
bl sub_8007F18
bl ResetBlockReceivedFlags
movs r4, 0
lsls r0, r6, 3
subs r0, r6
@ -11571,7 +11571,7 @@ sub_800F298: @ 800F298
push {r4-r7,lr}
mov r7, r8
push {r7}
bl link_get_multiplayer_id
bl GetMultiplayerId
lsls r0, 24
lsrs r6, r0, 24
ldr r0, _0800F2D0
@ -11631,20 +11631,20 @@ _0800F316:
lsrs r0, 24
adds r1, r4, 0
movs r2, 0x20
bl sub_8007E88
bl SendBlock
b _0800F770
.align 2, 0
_0800F338: .4byte 0x03002fa4
_0800F33C: .4byte 0x02000000
_0800F340:
bl sub_8007EE4
bl GetBlockRecievedStatus
movs r1, 0xF
ands r1, r0
cmp r1, 0xF
beq _0800F34E
b _0800F7E0
_0800F34E:
bl sub_8007F18
bl ResetBlockReceivedFlags
movs r4, 0
ldr r0, _0800F36C
ldrh r1, [r0]
@ -11864,20 +11864,20 @@ _0800F4EA:
lsrs r0, 24
ldr r1, _0800F500
movs r2, 0xC8
bl sub_8007E88
bl SendBlock
b _0800F770
.align 2, 0
_0800F4FC: .4byte 0x02024d1e
_0800F500: .4byte 0x0201d000
_0800F504:
bl sub_8007EE4
bl GetBlockRecievedStatus
movs r1, 0xF
ands r1, r0
cmp r1, 0xF
beq _0800F512
b _0800F7E0
_0800F512:
bl sub_8007F18
bl ResetBlockReceivedFlags
movs r4, 0
lsls r0, r6, 3
subs r0, r6
@ -12014,19 +12014,19 @@ _0800F604:
lsrs r0, 24
ldr r1, _0800F618
movs r2, 0x64
bl sub_8007E88
bl SendBlock
b _0800F770
.align 2, 0
_0800F618: .4byte 0x0201d0c8
_0800F61C:
bl sub_8007EE4
bl GetBlockRecievedStatus
movs r1, 0xF
ands r1, r0
cmp r1, 0xF
beq _0800F62A
b _0800F7E0
_0800F62A:
bl sub_8007F18
bl ResetBlockReceivedFlags
movs r4, 0
lsls r0, r6, 3
subs r0, r6
@ -23791,7 +23791,7 @@ _080155C0:
str r0, [r5]
adds r4, 0x1
_080155CE:
bl sub_8007B78
bl GetLinkPlayerCount
lsls r0, 24
lsrs r0, 24
cmp r4, r0
@ -68499,7 +68499,7 @@ dp01_tbl1_exec_completed: @ 802BF9C
ands r0, r1
cmp r0, 0
beq _0802BFF0
bl link_get_multiplayer_id
bl GetMultiplayerId
mov r1, sp
strb r0, [r1]
movs r0, 0x2
@ -92136,7 +92136,7 @@ dp01_tbl4_exec_completed: @ 8038004
ands r0, r1
cmp r0, 0
beq _08038058
bl link_get_multiplayer_id
bl GetMultiplayerId
mov r1, sp
strb r0, [r1]
movs r0, 0x2
@ -94857,7 +94857,7 @@ _08039710: .4byte 0x03002970
_08039714:
movs r5, 0
ldr r4, _0803986C
bl link_get_multiplayer_id
bl GetMultiplayerId
movs r1, 0x1
eors r0, r1
lsls r0, 24
@ -101911,7 +101911,7 @@ _0803CE42:
strb r0, [r1]
adds r0, r7, 0
adds r1, r3, 0
bl SetStringCharset
bl ConvertInternationalString
_0803CE50:
adds r0, r7, 0
bl StringLength
@ -107816,7 +107816,7 @@ sub_803FBBC: @ 803FBBC
push {r4,r5,lr}
movs r5, 0
ldr r4, _0803FBE4
bl link_get_multiplayer_id
bl GetMultiplayerId
lsls r0, 24
lsrs r0, 24
lsls r1, r0, 3
@ -110106,7 +110106,7 @@ _08040D04: .4byte 0x0000ffff
thumb_func_start sub_8040D08
sub_8040D08: @ 8040D08
push {r4,lr}
bl link_get_multiplayer_id
bl GetMultiplayerId
lsls r0, 24
lsrs r0, 24
ldr r4, _08040D38
@ -113036,7 +113036,7 @@ sub_80422C4: @ 80422C4
bl PokemonGetEncryptedField
adds r0, r5, 0
adds r1, r4, 0
bl SetStringCharset
bl ConvertInternationalString
_080422FC:
adds r4, r6, 0
adds r4, 0x50
@ -124512,7 +124512,7 @@ sub_8047CE8: @ 8047CE8
adds r0, r6, 0
movs r3, 0xC
bl sub_804AFB8
bl link_get_multiplayer_id
bl GetMultiplayerId
lsls r0, 24
ldr r1, [r5, 0xC]
movs r3, 0x80
@ -124598,7 +124598,7 @@ _08047D86:
adds r5, 0x1
cmp r5, 0x2
ble _08047D86
bl link_get_multiplayer_id
bl GetMultiplayerId
lsls r0, 24
movs r1, 0x80
lsls r1, 17
@ -124888,7 +124888,7 @@ _08048048:
ldr r3, _0804809C
adds r0, r3, 0
strh r0, [r1]
bl sub_8007378
bl OpenLink
movs r6, 0
movs r4, 0
_08048058:
@ -124954,7 +124954,7 @@ _080480CE:
_080480D8: .4byte 0x03004824
_080480DC: .4byte 0x0000043c
_080480E0:
bl sub_8008300
bl GetLinkPlayerCount_2
adds r4, r0, 0
bl sub_800820C
lsls r4, 24
@ -124963,7 +124963,7 @@ _080480E0:
bcs _080480F4
b _080484C6
_080480F4:
bl sub_8008310
bl IsLinkMaster
lsls r0, 24
cmp r0, 0
beq _08048120
@ -124998,7 +124998,7 @@ _08048130:
beq _0804813A
b _080484C6
_0804813A:
bl sub_8007C48
bl IsLinkPlayerDataExchangeComplete
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@ -126420,7 +126420,7 @@ _08048D3E:
sub_8048D44: @ 8048D44
push {r4-r7,lr}
sub sp, 0xC
bl link_get_multiplayer_id
bl GetMultiplayerId
lsls r0, 24
lsrs r7, r0, 24
ldr r6, _08048D90
@ -126440,7 +126440,7 @@ sub_8048D44: @ 8048D44
lsls r1, 24
lsrs r1, 24
adds r0, r4, 0
bl sub_8008184
bl SetLinkDebugValues
ldr r0, [r6]
adds r0, 0x75
ldrb r0, [r0]
@ -126494,7 +126494,7 @@ _08048DF8:
bne _08048E04
b _0804907C
_08048E04:
bl sub_8007EE4
bl GetBlockRecievedStatus
lsls r0, 24
cmp r0, 0
bne _08048E18
@ -126504,7 +126504,7 @@ _08048E04:
.align 2, 0
_08048E14: .4byte 0x03004824
_08048E18:
bl sub_8007F18
bl ResetBlockReceivedFlags
ldr r0, _08048E24
ldr r1, [r0]
b _08049006
@ -126522,7 +126522,7 @@ _08048E32:
.align 2, 0
_08048E38: .4byte 0x03004824
_08048E3C:
bl sub_8007EE4
bl GetBlockRecievedStatus
lsls r0, 24
lsrs r0, 24
cmp r0, 0x3
@ -126538,7 +126538,7 @@ _08048E4A:
adds r1, r2
movs r2, 0xC8
bl sub_8048D24
bl sub_8007F18
bl ResetBlockReceivedFlags
ldr r0, _08048E70
ldr r1, [r0]
b _08049006
@ -126570,7 +126570,7 @@ _08048E9A:
.align 2, 0
_08048EA0: .4byte 0x03004824
_08048EA4:
bl sub_8007EE4
bl GetBlockRecievedStatus
lsls r0, 24
lsrs r0, 24
cmp r0, 0x3
@ -126586,7 +126586,7 @@ _08048EB2:
adds r1, r2
movs r2, 0xC8
bl sub_8048D24
bl sub_8007F18
bl ResetBlockReceivedFlags
ldr r0, _08048ED8
ldr r1, [r0]
b _08049006
@ -126618,7 +126618,7 @@ _08048F02:
.align 2, 0
_08048F08: .4byte 0x03004824
_08048F0C:
bl sub_8007EE4
bl GetBlockRecievedStatus
lsls r0, 24
lsrs r0, 24
cmp r0, 0x3
@ -126634,7 +126634,7 @@ _08048F1A:
adds r1, r2
movs r2, 0xC8
bl sub_8048D24
bl sub_8007F18
bl ResetBlockReceivedFlags
ldr r0, _08048F40
ldr r1, [r0]
b _08049006
@ -126666,7 +126666,7 @@ _08048F6A:
.align 2, 0
_08048F70: .4byte 0x03004824
_08048F74:
bl sub_8007EE4
bl GetBlockRecievedStatus
lsls r0, 24
lsrs r0, 24
cmp r0, 0x3
@ -126682,7 +126682,7 @@ _08048F82:
adds r1, r2
movs r2, 0xD8
bl sub_8048D24
bl sub_8007F18
bl ResetBlockReceivedFlags
ldr r0, _08048FA8
ldr r1, [r0]
b _08049006
@ -126714,7 +126714,7 @@ _08048FD2:
.align 2, 0
_08048FD8: .4byte 0x03004824
_08048FDC:
bl sub_8007EE4
bl GetBlockRecievedStatus
lsls r0, 24
lsrs r0, 24
cmp r0, 0x3
@ -126730,7 +126730,7 @@ _08048FDC:
adds r1, r2
movs r2, 0xB
bl sub_8048D24
bl sub_8007F18
bl ResetBlockReceivedFlags
ldr r1, [r4]
_08049006:
adds r1, 0x75
@ -126889,7 +126889,7 @@ _0804913E:
strb r1, [r0]
_08049142:
movs r0, 0
bl sub_8007F30
bl ResetBlockReceivedFlag
_08049148:
movs r2, 0x2
adds r0, r4, 0
@ -126963,7 +126963,7 @@ _080491D2:
strb r2, [r0]
_080491D4:
movs r0, 0x1
bl sub_8007F30
bl ResetBlockReceivedFlag
_080491DA:
pop {r4}
pop {r0}
@ -127079,14 +127079,14 @@ _080492B6:
strb r1, [r0]
_080492B8:
movs r0, 0
bl sub_8007F30
bl ResetBlockReceivedFlag
_080492BE:
movs r0, 0x2
ands r0, r5
cmp r0, 0
beq _080492CC
movs r0, 0x1
bl sub_8007F30
bl ResetBlockReceivedFlag
_080492CC:
add sp, 0x4
pop {r4,r5}
@ -127350,10 +127350,10 @@ _080494D4: .4byte 0x0000ddee
thumb_func_start sub_80494D8
sub_80494D8: @ 80494D8
push {r4,lr}
bl link_get_multiplayer_id
bl GetMultiplayerId
lsls r0, 24
lsrs r4, r0, 24
bl sub_8007EE4
bl GetBlockRecievedStatus
lsls r0, 24
lsrs r1, r0, 24
cmp r1, 0
@ -127367,7 +127367,7 @@ _080494FA:
adds r0, r4, 0
bl sub_80491E4
_08049500:
bl sub_8007F18
bl ResetBlockReceivedFlags
_08049504:
cmp r4, 0
bne _0804950C
@ -127528,7 +127528,7 @@ sub_8049620: @ 8049620
adds r0, 0x7B
movs r1, 0x5
strb r1, [r0]
bl link_get_multiplayer_id
bl GetMultiplayerId
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@ -127549,7 +127549,7 @@ sub_8049620: @ 8049620
ldr r1, [r4]
adds r1, 0x8C
movs r2, 0x14
bl sub_8007E88
bl SendBlock
b _08049678
.align 2, 0
_08049668: .4byte 0x03004824
@ -127735,7 +127735,7 @@ _080497C8:
ldr r1, [r1]
adds r1, 0x8C
movs r2, 0x14
bl sub_8007E88
bl SendBlock
_080497EC:
add sp, 0x8
pop {r4}
@ -128092,7 +128092,7 @@ _08049A88:
ldr r1, [r5]
adds r1, 0x8C
movs r2, 0x14
bl sub_8007E88
bl SendBlock
_08049AB4:
add sp, 0xC
pop {r4,r5}
@ -128169,7 +128169,7 @@ _08049B28:
ldr r1, [r4]
adds r1, 0x8C
movs r2, 0x14
bl sub_8007E88
bl SendBlock
_08049B56:
ldr r0, _08049B5C
ldr r0, [r0]
@ -128207,7 +128207,7 @@ _08049B8C:
ldr r1, [r4]
adds r1, 0x8C
movs r2, 0x14
bl sub_8007E88
bl SendBlock
ldr r0, [r4]
_08049BAA:
adds r0, 0x7B
@ -128322,7 +128322,7 @@ _08049C84:
thumb_func_start sub_8049C8C
sub_8049C8C: @ 8049C8C
push {r4,lr}
bl link_get_multiplayer_id
bl GetMultiplayerId
lsls r0, 24
cmp r0, 0
bne _08049CAE
@ -130249,7 +130249,7 @@ _0804AB98:
ldr r1, [r1]
adds r1, 0x8C
movs r2, 0x14
bl sub_8007E88
bl SendBlock
b _0804ABD2
.align 2, 0
_0804ABB0: .4byte 0x03004824
@ -131201,7 +131201,7 @@ sub_804B2B0: @ 804B2B0
.align 2, 0
_0804B2C0: .4byte 0x03002fa4
_0804B2C4:
bl link_get_multiplayer_id
bl GetMultiplayerId
lsls r0, 24
lsrs r0, 24
_0804B2CC:
@ -131408,7 +131408,7 @@ _0804B47C:
movs r0, 0
strh r0, [r1]
bl ResetTasks
bl AllocZeroed
bl CloseLink
ldr r6, _0804B570
ldr r5, _0804B574
str r5, [r6]
@ -131527,7 +131527,7 @@ _0804B5A0: .4byte 0x040000d4
_0804B5A4: .4byte 0x80000280
_0804B5A8: .4byte gUnknown_08D004E0
_0804B5AC:
bl sub_8007378
bl OpenLink
ldr r1, _0804B5C8
ldr r2, _0804B5CC
adds r1, r2
@ -131565,13 +131565,13 @@ _0804B5E8:
_0804B5F4: .4byte 0x03004828
_0804B5F8: .4byte 0x0000043c
_0804B5FC:
bl sub_8008310
bl IsLinkMaster
lsls r0, 24
cmp r0, 0
bne _0804B608
b _0804B746
_0804B608:
bl sub_8008300
bl GetLinkPlayerCount_2
adds r4, r0, 0
bl sub_800820C
lsls r4, 24
@ -131607,7 +131607,7 @@ _0804B648:
beq _0804B656
b _0804B76E
_0804B656:
bl sub_8007C48
bl IsLinkPlayerDataExchangeComplete
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@ -132060,7 +132060,7 @@ _0804BA60: .4byte 0x03004360
thumb_func_start sub_804BA64
sub_804BA64: @ 804BA64
push {lr}
bl link_get_multiplayer_id
bl GetMultiplayerId
lsls r0, 24
ldr r2, _0804BA90
movs r1, 0x80
@ -132214,7 +132214,7 @@ _0804BB90:
ldr r1, [r4]
adds r1, 0x9E
movs r2, 0x14
bl sub_8007E88
bl SendBlock
ldr r1, [r4]
adds r1, 0xBD
ldrb r0, [r1]
@ -132929,7 +132929,7 @@ sub_804C1A8: @ 804C1A8
ldrb r0, [r0]
cmp r0, 0
beq _0804C23C
bl link_get_multiplayer_id
bl GetMultiplayerId
lsls r0, 24
ldr r3, _0804C220
movs r2, 0x80
@ -135210,7 +135210,7 @@ _0804D60E:
_0804D612:
strb r0, [r1]
_0804D614:
bl sub_8008710
bl HasLinkErrorOccurred
lsls r0, 24
cmp r0, 0
bne _0804D622
@ -135232,7 +135232,7 @@ _0804D638: .4byte 0x020297d8
sub_804D63C: @ 804D63C
push {r4-r6,lr}
bl sub_804B2B0
bl sub_8007EE4
bl GetBlockRecievedStatus
lsls r0, 24
lsrs r5, r0, 24
movs r6, 0x1
@ -135258,7 +135258,7 @@ _0804D664:
strb r6, [r0]
_0804D674:
movs r0, 0
bl sub_8007F30
bl ResetBlockReceivedFlag
_0804D67A:
movs r0, 0x2
ands r0, r5
@ -135279,7 +135279,7 @@ _0804D67A:
strb r1, [r0]
_0804D69C:
movs r0, 0x1
bl sub_8007F30
bl ResetBlockReceivedFlag
_0804D6A2:
pop {r4-r6}
pop {r0}
@ -135979,7 +135979,7 @@ sub_804DC18: @ 804DC18
ldr r1, [r4]
adds r1, 0x9E
movs r2, 0x14
bl sub_8007E88
bl SendBlock
ldr r0, [r4]
adds r0, 0x9C
movs r1, 0x2
@ -136460,7 +136460,7 @@ _0804E10C:
ldr r0, _0804E140
bl SetMainCallback2
_0804E11A:
bl sub_8008710
bl HasLinkErrorOccurred
lsls r0, 24
cmp r0, 0
bne _0804E128
@ -137883,8 +137883,8 @@ _0804ED94:
bne _0804EDA0
b _0804F0CE
_0804EDA0:
bl sub_8007F18
bl link_get_multiplayer_id
bl ResetBlockReceivedFlags
bl GetMultiplayerId
lsls r0, 24
cmp r0, 0
beq _0804EDB0
@ -137907,7 +137907,7 @@ _0804EDB8:
b _0804F0CE
_0804EDCE:
bl sub_8071EF4
bl sub_8007EE4
bl GetBlockRecievedStatus
adds r4, r0, 0
bl sub_8008198
lsls r4, 24
@ -137942,12 +137942,12 @@ _0804EDF0:
strh r0, [r1]
adds r5, 0x1
_0804EE18:
bl sub_8007B78
bl GetLinkPlayerCount
lsls r0, 24
lsrs r0, 24
cmp r5, r0
blt _0804EDF0
bl sub_8007F18
bl ResetBlockReceivedFlags
b _0804F0AA
.align 2, 0
_0804EE2C: .4byte 0x03002b80
@ -137963,7 +137963,7 @@ _0804EE30:
bl sub_804E7C0
b _0804EE7A
_0804EE46:
bl sub_8007B78
bl GetLinkPlayerCount
ldr r2, _0804EE98
ldr r1, [r2]
adds r1, 0x88
@ -138576,7 +138576,7 @@ _0804F2B6:
lsls r1, r6, 24
lsrs r1, 24
bl StartSpriteAnim
bl link_get_multiplayer_id
bl GetMultiplayerId
lsls r0, 24
ldr r1, [r7]
adds r1, 0x9A
@ -140271,7 +140271,7 @@ sub_80500A8: @ 80500A8
movs r6, 0
ldr r5, _080500EC
ldr r4, [r5]
bl link_get_multiplayer_id
bl GetMultiplayerId
lsls r0, 24
lsrs r0, 23
adds r4, 0xA2
@ -140337,7 +140337,7 @@ _0805010A:
ldr r0, [r4]
adds r0, 0x54
ldrh r4, [r0]
bl link_get_multiplayer_id
bl GetMultiplayerId
adds r1, r0, 0
lsls r1, 24
lsrs r1, 24
@ -140453,7 +140453,7 @@ _08050218:
lsls r5, 1
adds r1, r5
ldrh r1, [r1]
bl sub_8008184
bl SetLinkDebugValues
bl sub_804FE70
ldr r0, [r4]
adds r0, r5
@ -141437,7 +141437,7 @@ _08050950: .4byte gUnknown_0842D2C5
sub_8050954: @ 8050954
push {r4-r7,lr}
bl sub_8051474
bl link_get_multiplayer_id
bl GetMultiplayerId
ldr r0, _08050978
ldr r0, [r0]
adds r0, 0x6F
@ -141471,7 +141471,7 @@ _08050980:
.4byte _08050C64
.4byte _08050C98
_080509B4:
bl sub_8007B60
bl ClearLinkCallback
ldr r0, _080509C8
movs r1, 0x80
lsls r1, 1
@ -141544,7 +141544,7 @@ _08050A40:
.align 2, 0
_08050A48: .4byte 0x03007400
_08050A4C:
bl link_get_multiplayer_id
bl GetMultiplayerId
lsls r0, 24
cmp r0, 0
beq _08050A58
@ -141574,13 +141574,13 @@ _08050A64:
strh r2, [r0]
movs r0, 0
movs r2, 0x28
bl sub_8007E88
bl SendBlock
ldr r1, [r4]
b _08050C86
.align 2, 0
_08050A90: .4byte 0x03004854
_08050A94:
bl sub_8007EE4
bl GetBlockRecievedStatus
lsls r0, 24
cmp r0, 0
bne _08050AA0
@ -141603,7 +141603,7 @@ _08050AA0:
ldrb r0, [r1]
adds r0, 0x1
strb r0, [r1]
bl sub_8007F18
bl ResetBlockReceivedFlags
b _08050CB6
.align 2, 0
_08050AC8: .4byte 0x03002b80
@ -142582,7 +142582,7 @@ _080512B8:
_080512C4:
strh r1, [r0]
_080512C6:
bl link_get_multiplayer_id
bl GetMultiplayerId
lsls r0, 24
cmp r0, 0
beq _080512D2
@ -142651,7 +142651,7 @@ _08051348:
lsls r0, 24
lsrs r4, r0, 24
_0805134E:
bl sub_8007B78
bl GetLinkPlayerCount
lsls r0, 24
lsrs r0, 24
cmp r4, r0
@ -142666,7 +142666,7 @@ _08051368:
lsls r0, 24
lsrs r4, r0, 24
_0805136E:
bl sub_8007B78
bl GetLinkPlayerCount
lsls r0, 24
lsrs r0, 24
cmp r4, r0
@ -142680,7 +142680,7 @@ _0805136E:
cmp r0, 0
bne _08051368
_0805138A:
bl sub_8007B78
bl GetLinkPlayerCount
lsls r0, 24
lsrs r0, 24
cmp r4, r0
@ -142696,7 +142696,7 @@ _080513A4:
lsls r0, 24
lsrs r4, r0, 24
_080513AA:
bl sub_8007B78
bl GetLinkPlayerCount
lsls r0, 24
lsrs r0, 24
cmp r4, r0
@ -142714,7 +142714,7 @@ _080513C6:
movs r6, 0
ldr r0, _080513E8
strh r0, [r5]
bl sub_8007B78
bl GetLinkPlayerCount
lsls r0, 24
lsrs r0, 24
cmp r4, r0
@ -143154,7 +143154,7 @@ sub_80516F8: @ 80516F8
ldrb r0, [r6]
cmp r0, 0
beq _0805180C
bl link_get_multiplayer_id
bl GetMultiplayerId
lsls r0, 24
lsrs r1, r0, 24
cmp r1, 0
@ -144021,7 +144021,7 @@ _08051D56:
adds r0, r4, r1
ldrb r1, [r0, 0x1A]
adds r0, r7, 0
bl SetStringCharset
bl ConvertInternationalString
adds r0, r7, 0
ldr r1, _08051F20
bl StringAppend

View File

@ -12738,7 +12738,7 @@ _08081078:
beq _080810B4
b _080810CC
_0808107E:
bl sub_8007B6C
bl ClearLinkCallback_2
movs r0, 0x1
movs r1, 0
bl fade_screen
@ -16562,7 +16562,7 @@ sub_8082D9C: @ 8082D9C
lsrs r4, r0, 24
lsls r1, 24
lsrs r5, r1, 24
bl sub_8007BA4
bl GetLinkPlayerDataExchangeStatusTimed
lsls r0, 24
lsrs r0, 24
cmp r0, 0x2
@ -16577,7 +16577,7 @@ _08082DBC:
beq _08082DE8
b _08082DEC
_08082DC2:
bl sub_8008300
bl GetLinkPlayerCount_2
lsls r0, 24
lsrs r1, r0, 24
cmp r4, r1
@ -16611,7 +16611,7 @@ sub_8082DF4: @ 8082DF4
push {r4,lr}
lsls r0, 24
lsrs r4, r0, 24
bl sub_8008710
bl HasLinkErrorOccurred
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@ -16647,7 +16647,7 @@ sub_8082E28: @ 8082E28
ands r0, r1
cmp r0, 0
beq _08082E64
bl sub_80086F4
bl IsLinkConnectionEstablished
lsls r0, 24
cmp r0, 0
bne _08082E64
@ -16677,12 +16677,12 @@ sub_8082E6C: @ 8082E6C
push {r4,lr}
lsls r0, 24
lsrs r4, r0, 24
bl sub_80086F4
bl IsLinkConnectionEstablished
lsls r0, 24
cmp r0, 0
beq _08082E82
movs r0, 0x1
bl sub_8008704
bl SetSuppressLinkErrorMessage
_08082E82:
ldr r0, _08082E94
ldrh r1, [r0, 0x2E]
@ -16717,7 +16717,7 @@ sub_8082EB8: @ 8082EB8
push {r4,lr}
lsls r0, 24
lsrs r4, r0, 24
bl sub_80086BC
bl GetSioMultiSI
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@ -16785,9 +16785,9 @@ sub_8082F20: @ 8082F20
ldrsh r2, [r4, r3]
cmp r2, 0
bne _08082F4C
bl sub_8007B88
bl OpenLinkTimed
bl sub_80082EC
bl sub_8007CC8
bl ResetLinkPlayers
b _08082F58
.align 2, 0
_08082F48: .4byte 0x03004b28
@ -16814,7 +16814,7 @@ sub_8082F68: @ 8082F68
push {r4,r5,lr}
lsls r0, 24
lsrs r4, r0, 24
bl sub_8008300
bl GetLinkPlayerCount_2
lsls r0, 24
lsrs r5, r0, 24
adds r0, r4, 0
@ -16828,7 +16828,7 @@ sub_8082F68: @ 8082F68
cmp r5, 0x1
bls _08082FDC
movs r0, 0x1
bl sub_8008704
bl SetSuppressLinkErrorMessage
ldr r1, _08082FC0
lsls r0, r4, 2
adds r0, r4
@ -16836,7 +16836,7 @@ sub_8082F68: @ 8082F68
adds r4, r0, r1
movs r0, 0
strh r0, [r4, 0xE]
bl sub_8008310
bl IsLinkMaster
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@ -16923,7 +16923,7 @@ sub_808303C: @ 808303C
mov r9, r0
mov r7, r8
add r7, r9
bl sub_8008300
bl GetLinkPlayerCount_2
lsls r0, 24
lsrs r5, r0, 24
adds r0, r4, 0
@ -17006,7 +17006,7 @@ sub_80830E4: @ 80830E4
bne _08083178
bl sub_800820C
adds r4, r0, 0
bl sub_8008300
bl GetLinkPlayerCount_2
lsls r4, 24
lsls r0, 24
cmp r4, r0
@ -17079,7 +17079,7 @@ sub_8083188: @ 8083188
lsrs r0, 24
cmp r0, 0x1
beq _080831EA
bl sub_8008300
bl GetLinkPlayerCount_2
adds r4, r0, 0
bl sub_800820C
lsls r4, 24
@ -17152,10 +17152,10 @@ _08083244: .4byte 0x03004b20
_08083248: .4byte 0x0202e8dc
_0808324C: .4byte sub_80833C4
_08083250:
bl sub_8008300
bl GetLinkPlayerCount_2
ldr r4, _08083278
strb r0, [r4]
bl link_get_multiplayer_id
bl GetMultiplayerId
ldr r1, _0808327C
strb r0, [r1]
ldrb r0, [r4]
@ -17205,10 +17205,10 @@ _080832BC: .4byte 0x0202e8dc
_080832C0: .4byte 0x03004b20
_080832C4: .4byte sub_80833C4
_080832C8:
bl sub_8008300
bl GetLinkPlayerCount_2
ldr r4, _08083300
strb r0, [r4]
bl link_get_multiplayer_id
bl GetMultiplayerId
ldr r1, _08083304
strb r0, [r1]
ldrb r0, [r4]
@ -17245,7 +17245,7 @@ sub_8083314: @ 8083314
bl sub_8082DF4
cmp r0, 0x1
beq _080833B6
bl sub_8007EE4
bl GetBlockRecievedStatus
adds r4, r0, 0
bl sub_8008198
lsls r4, 24
@ -17271,14 +17271,14 @@ _08083340:
lsls r0, 24
lsrs r4, r0, 24
_0808335A:
bl sub_8007B78
bl GetLinkPlayerCount
lsls r0, 24
lsrs r0, 24
cmp r4, r0
bcc _08083340
movs r0, 0
bl sub_8008704
bl sub_8007F18
bl SetSuppressLinkErrorMessage
bl ResetBlockReceivedFlags
bl textbox_close
ldr r0, _08083398
ldrh r0, [r0]
@ -17536,7 +17536,7 @@ _08083560:
ldrh r0, [r0]
cmp r0, 0x1
bne _08083586
bl sub_8007B78
bl GetLinkPlayerCount
lsls r0, 24
lsrs r0, 24
movs r1, 0
@ -17759,8 +17759,8 @@ sub_8083710: @ 8083710
ldrsh r2, [r4, r3]
cmp r2, 0
bne _08083744
bl sub_8007378
bl sub_8007CC8
bl OpenLink
bl ResetLinkPlayers
ldr r0, _08083740
movs r1, 0x50
bl CreateTask
@ -17792,12 +17792,12 @@ sub_8083760: @ 8083760
lsls r0, 24
lsrs r4, r0, 24
adds r5, r4, 0
bl sub_8008300
bl GetLinkPlayerCount_2
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
bls _080837A6
bl sub_8008310
bl IsLinkMaster
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@ -17837,7 +17837,7 @@ sub_80837B4: @ 80837B4
lsrs r5, r0, 24
bl sub_800820C
adds r4, r0, 0
bl sub_8008300
bl GetLinkPlayerCount_2
lsls r4, 24
lsls r0, 24
cmp r4, r0
@ -17868,7 +17868,7 @@ sub_80837EC: @ 80837EC
ldrb r0, [r0]
cmp r0, 0x1
bne _08083814
bl sub_8007C48
bl IsLinkPlayerDataExchangeComplete
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@ -17933,7 +17933,7 @@ _08083870:
ldr r2, _0808388C
adds r0, r2, 0
strh r0, [r1]
bl sub_8007B6C
bl ClearLinkCallback_2
b _080838BE
.align 2, 0
_08083888: .4byte 0x03002b74
@ -18240,7 +18240,7 @@ _08083ADE:
movs r0, 0x1
movs r1, 0
bl fade_screen
bl sub_8007B6C
bl ClearLinkCallback_2
b _08083B14
_08083AF0:
ldr r0, _08083B00
@ -18445,7 +18445,7 @@ sub_8083C50: @ 8083C50
lsls r0, 17
cmp r1, r0
ble _08083C82
bl AllocZeroed
bl CloseLink
ldr r0, _08083C9C
bl SetMainCallback2
adds r0, r4, 0
@ -18463,7 +18463,7 @@ _08083C90:
bx r0
.align 2, 0
_08083C98: .4byte 0x03004b20
_08083C9C: .4byte sub_80085BC
_08083C9C: .4byte CB2_LinkError
_08083CA0: .4byte 0x03002fa4
thumb_func_end sub_8083C50
@ -51607,7 +51607,7 @@ sub_8094140: @ 8094140
bl StringCopy
ldrb r1, [r5, 0x8]
adds r0, r4, 0
bl SetStringCharset
bl ConvertInternationalString
adds r0, r4, 0
movs r1, 0x7
movs r2, 0x5
@ -51812,7 +51812,7 @@ sub_80942F8: @ 80942F8
bl StringCopy
ldrb r1, [r5, 0x8]
adds r0, r4, 0
bl SetStringCharset
bl ConvertInternationalString
ldr r1, _08094330
adds r0, r4, 0
bl StringAppend
@ -75411,7 +75411,7 @@ _0809FD1C:
lsls r1, 24
lsrs r1, 24
adds r0, r4, 0
bl SetStringCharset
bl ConvertInternationalString
ldr r5, _0809FD68
adds r0, r5, 0
movs r1, 0xD
@ -76528,7 +76528,7 @@ sub_80A0664: @ 80A0664
ldr r0, _080A06A4
cmp r1, r0
bne _080A06B0
bl link_get_multiplayer_id
bl GetMultiplayerId
movs r1, 0x1
eors r0, r1
lsls r0, 24
@ -96228,7 +96228,7 @@ sub_80A9E3C: @ 80A9E3C
push {r4,lr}
lsls r0, 24
lsrs r4, r0, 24
bl sub_8007378
bl OpenLink
movs r1, 0
ldr r3, _080A9E74
movs r2, 0xFF
@ -96280,14 +96280,14 @@ sub_80A9E80: @ 80A9E80
.align 2, 0
_080A9EA0: .4byte 0x03004b20
_080A9EA4:
bl sub_8008300
bl GetLinkPlayerCount_2
lsls r0, 24
lsrs r0, 24
cmp r0, 0x3
bls _080A9ECC
movs r0, 0
strh r0, [r4, 0x8]
bl sub_8008310
bl IsLinkMaster
lsls r0, 24
cmp r0, 0
beq _080A9EC8
@ -96347,10 +96347,10 @@ sub_80A9F10: @ 80A9F10
ldrb r0, [r0]
cmp r0, 0
beq _080A9F3E
bl link_get_multiplayer_id
bl GetMultiplayerId
ldr r1, _080A9F48
strb r0, [r1]
bl sub_8007B78
bl GetLinkPlayerCount
lsls r0, 24
lsrs r0, 24
cmp r0, 0x4
@ -99307,7 +99307,7 @@ sub_80AB6B4: @ 80AB6B4
lsls r1, 16
cmp r1, 0
bgt _080AB6F2
bl link_get_multiplayer_id
bl GetMultiplayerId
adds r0, r4, 0
bl DestroyTask
ldr r0, _080AB6FC
@ -127938,7 +127938,7 @@ sub_80B92AC: @ 80B92AC
ldr r1, [r1]
movs r2, 0xA4
bl memcpy
bl link_get_multiplayer_id
bl GetMultiplayerId
lsls r0, 24
cmp r0, 0
bne _080B935C
@ -128300,7 +128300,7 @@ _080B9650:
movs r0, 0xC8
lsls r0, 1
strh r0, [r5, 0x8]
bl sub_8007B6C
bl ClearLinkCallback_2
b _080B97D6
.align 2, 0
_080B9674: .4byte gUnknown_0842C89A
@ -128319,10 +128319,10 @@ _080B9688:
movs r0, 0x65
b _080B97D4
_080B9690:
bl sub_8008300
bl GetLinkPlayerCount_2
lsls r0, 24
lsrs r4, r0, 24
bl sub_8008310
bl IsLinkMaster
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@ -128351,7 +128351,7 @@ _080B96CC: .4byte 0x0000012d
_080B96D0:
bl sub_800820C
adds r4, r0, 0
bl sub_8008300
bl GetLinkPlayerCount_2
lsls r4, 24
lsls r0, 24
cmp r4, r0
@ -128361,7 +128361,7 @@ _080B96D0:
strh r4, [r5, 0x20]
lsls r4, 16
asrs r4, 16
bl sub_8008300
bl GetLinkPlayerCount_2
lsls r0, 24
lsrs r0, 24
lsls r1, r0, 4
@ -128375,7 +128375,7 @@ _080B96D0:
_080B9706:
bl sub_800820C
adds r4, r0, 0
bl sub_8008300
bl GetLinkPlayerCount_2
lsls r4, 24
lsls r0, 24
cmp r4, r0
@ -128415,7 +128415,7 @@ _080B9734:
_080B9758: .4byte 0x03002fa4
_080B975C: .4byte 0x020231cc
_080B9760:
bl sub_8008300
bl GetLinkPlayerCount_2
lsls r0, 24
lsrs r0, 24
movs r1, 0
@ -128521,7 +128521,7 @@ _080B981C:
.align 2, 0
_080B983C: .4byte 0x03002a70
_080B9840:
bl link_get_multiplayer_id
bl GetMultiplayerId
lsls r0, 24
cmp r0, 0
bne _080B9860
@ -128583,7 +128583,7 @@ sub_80B9890: @ 80B9890
ldr r1, _080B98D0
adds r0, r1
mov r10, r0
bl sub_8007EE4
bl GetBlockRecievedStatus
lsls r0, 24
lsrs r0, 24
str r0, [sp, 0x4]
@ -128651,7 +128651,7 @@ _080B9934:
bl memcpy
_080B993C:
mov r0, r9
bl sub_8007F30
bl ResetBlockReceivedFlag
mov r2, r8
lsls r1, r2, 1
adds r1, r5, r1
@ -128673,7 +128673,7 @@ _080B9960:
lsrs r0, 24
_080B9966:
mov r9, r0
bl sub_8007B78
bl GetLinkPlayerCount
lsls r0, 24
lsrs r0, 24
cmp r9, r0
@ -128690,7 +128690,7 @@ _080B9966:
adds r1, 0x1
strh r1, [r0, 0x8]
_080B998A:
bl sub_8007B78
bl GetLinkPlayerCount
lsls r0, 24
lsrs r0, 24
ldr r1, [sp, 0x8]
@ -128810,7 +128810,7 @@ sub_80B9A50: @ 80B9A50
thumb_func_start sub_80B9A58
sub_80B9A58: @ 80B9A58
push {lr}
bl link_get_multiplayer_id
bl GetMultiplayerId
lsls r0, 24
lsrs r0, 24
pop {r1}
@ -128843,7 +128843,7 @@ _080B9A84: .4byte 0x00001230
sub_80B9A88: @ 80B9A88
push {r4,lr}
adds r4, r0, 0
bl sub_8007B78
bl GetLinkPlayerCount
lsls r0, 24
lsrs r0, 24
cmp r0, 0x3
@ -128873,7 +128873,7 @@ _080B9AAC:
_080B9ABC: .4byte gUnknown_083D0288
_080B9AC0:
movs r0, 0
bl sub_8007CB0
bl GetLinkPlayerTrainerId
adds r3, r0, 0
movs r0, 0x1
ands r3, r0
@ -128895,7 +128895,7 @@ _080B9AD6:
_080B9AE8: .4byte gUnknown_083D028A
_080B9AEC:
movs r0, 0
bl sub_8007CB0
bl GetLinkPlayerTrainerId
movs r1, 0x9
bl __umodsi3
adds r3, r0, 0
@ -129117,7 +129117,7 @@ sub_80B9C6C: @ 80B9C6C
ldr r0, _080B9DA8
ldrh r0, [r0, 0x4]
bl SeedRng
bl sub_8007B78
bl GetLinkPlayerCount
lsls r0, 24
lsrs r0, 24
mov r8, r0
@ -136497,7 +136497,7 @@ sub_80BD674: @ 80BD674
bne _080BD68C
b _080BD790
_080BD68C:
bl sub_8007B78
bl GetLinkPlayerCount
lsls r0, 24
lsrs r0, 24
cmp r0, 0x2
@ -141675,7 +141675,7 @@ sub_80BFE24: @ 80BFE24
str r0, [sp, 0x8]
add r0, sp, 0x1C
str r0, [sp, 0xC]
bl sub_8007B78
bl GetLinkPlayerCount
ldr r1, _080BFEA0
strb r0, [r1]
_080BFE50:
@ -141943,7 +141943,7 @@ sub_80C004C: @ 80C004C
adds r4, r1, 0
lsls r0, r2, 24
lsrs r0, 24
bl sub_8007CB0
bl GetLinkPlayerTrainerId
adds r5, r0, 0
movs r2, 0xFF
ands r0, r2
@ -141999,7 +141999,7 @@ sub_80C00B4: @ 80C00B4
adds r4, r1, 0
lsls r0, r2, 24
lsrs r0, 24
bl sub_8007CB0
bl GetLinkPlayerTrainerId
adds r2, r0, 0
movs r3, 0xFF
ands r0, r3
@ -142069,7 +142069,7 @@ sub_80C0134: @ 80C0134
adds r4, r1, 0
lsls r0, r2, 24
lsrs r0, 24
bl sub_8007CB0
bl GetLinkPlayerTrainerId
adds r5, r0, 0
movs r2, 0xFF
ands r0, r2
@ -142666,7 +142666,7 @@ sub_80C05C4: @ 80C05C4
str r0, [sp, 0x8]
add r0, sp, 0x1C
str r0, [sp, 0xC]
bl sub_8007B78
bl GetLinkPlayerCount
ldr r1, _080C0600
strb r0, [r1]
movs r0, 0
@ -143054,7 +143054,7 @@ sub_80C08FC: @ 80C08FC
bhi _080C0914
adds r0, r5, 0
movs r1, 0x1
bl SetStringCharset
bl ConvertInternationalString
_080C0914:
pop {r4,r5}
pop {r0}
@ -146216,7 +146216,7 @@ sub_80C255C: @ 80C255C
ldrb r0, [r0]
cmp r0, 0
beq _080C258C
bl sub_8007B78
bl GetLinkPlayerCount
lsls r0, 24
lsrs r0, 24
cmp r0, 0x4
@ -150457,7 +150457,7 @@ sub_80C4674: @ 80C4674
bne _080C4690
adds r0, r4, 0
movs r1, 0x1
bl SetStringCharset
bl ConvertInternationalString
_080C4690:
pop {r4}
pop {r0}
@ -150495,7 +150495,7 @@ sub_80C4698: @ 80C4698
lsls r1, 24
lsrs r1, 24
adds r0, r5, 0
bl SetStringCharset
bl ConvertInternationalString
_080C46DA:
pop {r4,r5}
pop {r0}
@ -152003,7 +152003,7 @@ sub_80C5228: @ 80C5228
cmp r0, 0
beq _080C524C
ldr r4, _080C5248
bl link_get_multiplayer_id
bl GetMultiplayerId
lsls r0, 24
lsrs r0, 24
strh r0, [r4]
@ -158659,7 +158659,7 @@ sub_80C857C: @ 80C857C
lsrs r0, 24
adds r1, r5, 0
adds r2, r4, 0
bl sub_8007E88
bl SendBlock
pop {r4,r5}
pop {r0}
bx r0
@ -158676,13 +158676,13 @@ sub_80C85AC: @ 80C85AC
lsls r1, 17
lsls r1, r0
lsrs r4, r1, 24
bl sub_8007EE4
bl GetBlockRecievedStatus
adds r1, r4, 0
ands r1, r0
cmp r1, 0
beq _080C85D0
adds r0, r4, 0
bl sub_8007F30
bl ResetBlockReceivedFlag
movs r0, 0x1
b _080C85D2
_080C85D0:
@ -158698,7 +158698,7 @@ sub_80C85D8: @ 80C85D8
push {r4,lr}
movs r4, 0
_080C85DC:
bl sub_8007EE4
bl GetBlockRecievedStatus
lsls r0, 24
lsrs r0, 24
asrs r0, r4
@ -158712,7 +158712,7 @@ _080C85F2:
adds r4, 0x1
cmp r4, 0x3
ble _080C85DC
bl sub_8007F18
bl ResetBlockReceivedFlags
movs r0, 0x1
_080C85FE:
pop {r4}
@ -158781,10 +158781,10 @@ sub_80C8660: @ 80C8660
ldrb r0, [r0]
cmp r0, 0
beq _080C868E
bl link_get_multiplayer_id
bl GetMultiplayerId
ldr r1, _080C8698
strb r0, [r1]
bl sub_8007B78
bl GetLinkPlayerCount
lsls r0, 24
lsrs r0, 24
cmp r0, 0x4
@ -158916,7 +158916,7 @@ sub_80C8734: @ 80C8734
.align 2, 0
_080C8768: .4byte 0x03004b20
_080C876C:
bl link_get_multiplayer_id
bl GetMultiplayerId
lsls r0, 24
cmp r0, 0
bne _080C87A8
@ -158990,7 +158990,7 @@ _080C87EA:
lsls r1, 24
lsrs r1, 24
adds r0, r4, 0
bl SetStringCharset
bl ConvertInternationalString
b _080C883E
.align 2, 0
_080C8818: .4byte 0x02038570
@ -159003,7 +159003,7 @@ _080C8828:
bne _080C8838
adds r0, r4, 0
movs r1, 0x1
bl SetStringCharset
bl ConvertInternationalString
b _080C883E
_080C8838:
strb r0, [r4, 0x5]
@ -159092,7 +159092,7 @@ sub_80C88AC: @ 80C88AC
.align 2, 0
_080C88D4: .4byte 0x03004b20
_080C88D8:
bl link_get_multiplayer_id
bl GetMultiplayerId
lsls r0, 24
cmp r0, 0
bne _080C891E
@ -159166,7 +159166,7 @@ _080C896C:
ldr r1, _080C8994
ldrh r0, [r4, 0x1A]
strb r0, [r1]
bl link_get_multiplayer_id
bl GetMultiplayerId
lsls r0, 24
cmp r0, 0
bne _080C898C
@ -159765,7 +159765,7 @@ _080C8E50:
ldr r1, _080C8E78
movs r0, 0x64
strb r0, [r1]
bl link_get_multiplayer_id
bl GetMultiplayerId
lsls r0, 24
cmp r0, 0
bne _080C8E70
@ -261633,7 +261633,7 @@ sub_80FA4E4: @ 80FA4E4
sub sp, 0x4
adds r6, r0, 0
adds r5, r1, 0
bl sub_8007B78
bl GetLinkPlayerCount
lsls r0, 24
lsrs r0, 24
mov r8, r0
@ -306954,7 +306954,7 @@ _0810FED0:
bne _0810FEF2
adds r0, r4, 0
movs r1, 0x1
bl SetStringCharset
bl ConvertInternationalString
_0810FEF2:
pop {r4}
pop {r0}
@ -335630,7 +335630,7 @@ dp01_tbl3_exec_completed: @ 811E314
ands r0, r1
cmp r0, 0
beq _0811E368
bl link_get_multiplayer_id
bl GetMultiplayerId
mov r1, sp
strb r0, [r1]
movs r0, 0x2
@ -338474,7 +338474,7 @@ _0811FB20: .4byte 0x03002970
_0811FB24:
movs r5, 0
ldr r4, _0811FC08
bl link_get_multiplayer_id
bl GetMultiplayerId
movs r1, 0x1
eors r0, r1
lsls r0, 24
@ -341124,7 +341124,7 @@ sub_8120FFC: @ 8120FFC
mov r8, r1
movs r6, 0
movs r4, 0
bl link_get_multiplayer_id
bl GetMultiplayerId
lsls r0, 24
lsrs r7, r0, 24
mov r0, r9
@ -363132,7 +363132,7 @@ dp01_tbl6_exec_completed: @ 812B7C0
ands r0, r1
cmp r0, 0
beq _0812B814
bl link_get_multiplayer_id
bl GetMultiplayerId
mov r1, sp
strb r0, [r1]
movs r0, 0x2
@ -387949,7 +387949,7 @@ dp01_tbl5_exec_completed: @ 813796C
ands r0, r1
cmp r0, 0
beq _081379C0
bl link_get_multiplayer_id
bl GetMultiplayerId
mov r1, sp
strb r0, [r1]
movs r0, 0x2
@ -395915,7 +395915,7 @@ _0813BA2E:
movs r0, 0
b _0813BA3A
.align 2, 0
_0813BA34: .4byte sub_8008C6C
_0813BA34: .4byte SerialCB
_0813BA38:
movs r0, 0x1
_0813BA3A:
@ -396208,7 +396208,7 @@ task_intro_2: @ 813BC8C
movs r0, 0xCF
lsls r0, 1
bl m4aSongNumStart
bl sub_8008838
bl ResetSerial
add sp, 0x4
pop {r4,r5}
pop {r0}
@ -418178,7 +418178,7 @@ _08146AA8:
ldr r2, _08146AD0
adds r0, r2, 0
strh r0, [r1]
bl sub_8007378
bl OpenLink
b _08146DA4
.align 2, 0
_08146AC4: .4byte 0x03001770
@ -418225,7 +418225,7 @@ _08146B18:
_08146B24:
b _08146D7C
_08146B26:
bl sub_8008300
bl GetLinkPlayerCount_2
lsls r0, 24
lsrs r2, r0, 24
cmp r2, 0x2
@ -418264,14 +418264,14 @@ _08146B70:
_08146B7A:
movs r0, 0x5
bl audio_play
bl AllocZeroed
bl CloseLink
ldr r0, _08146B8C
adds r1, r4, r0
b _08146C54
.align 2, 0
_08146B8C: .4byte 0x0000043c
_08146B90:
bl sub_80086F4
bl IsLinkConnectionEstablished
lsls r0, 24
cmp r0, 0
beq _08146C38
@ -418281,7 +418281,7 @@ _08146B90:
bne _08146BA4
b _08146DA4
_08146BA4:
bl sub_8007BA4
bl GetLinkPlayerDataExchangeStatusTimed
lsls r0, 24
lsrs r0, 24
cmp r0, 0x3
@ -418318,7 +418318,7 @@ _08146BE8:
.align 2, 0
_08146BFC: .4byte gUnknown_0842C535
_08146C00:
bl AllocZeroed
bl CloseLink
movs r0, 0x6
movs r1, 0x5
movs r2, 0x17
@ -418353,7 +418353,7 @@ _08146C38:
_08146C46:
movs r0, 0x5
bl audio_play
bl AllocZeroed
bl CloseLink
ldr r2, _08146C60
adds r1, r4, r2
_08146C54:
@ -418372,13 +418372,13 @@ _08146C64:
_08146C70:
b _08146D7C
_08146C72:
bl sub_8007EE4
bl GetBlockRecievedStatus
lsls r0, 24
cmp r0, 0
bne _08146C7E
b _08146DA4
_08146C7E:
bl sub_8007F18
bl ResetBlockReceivedFlags
ldr r1, _08146C8C
ldr r2, _08146C90
adds r1, r2
@ -418515,11 +418515,11 @@ _08146DA4:
ands r0, r1
cmp r0, 0
beq _08146DE4
bl sub_8008310
bl IsLinkMaster
lsls r0, 24
cmp r0, 0
bne _08146DE4
bl AllocZeroed
bl CloseLink
movs r0, 0x6
movs r1, 0x5
movs r2, 0x17
@ -425426,7 +425426,7 @@ sub_814A568: @ 814A568
bhi _0814A582
adds r0, r4, 0
movs r1, 0x1
bl SetStringCharset
bl ConvertInternationalString
b _0814A588
_0814A582:
adds r0, r4, 0

View File

@ -313,6 +313,7 @@ TALL_PLUS = FC 0C FB
'ッ' = A0
@ Japanese punctuation
' ' = 00
'ー' = AE
'·' = AF
'‥' = B0

View File

@ -5,22 +5,6 @@
.section .rodata
.global gUnknown_081E7330
gUnknown_081E7330: @ 81E7330
.incbin "baserom.gba", 0x001e7330, 0x20
.global gUnknown_081E7350
gUnknown_081E7350: @ 81E7350
.incbin "baserom.gba", 0x001e7350, 0x27c
.global gUnknown_081E75CC
gUnknown_081E75CC: @ 81E75CC
.incbin "baserom.gba", 0x001e75cc, 0x30
.global gUnknown_081E75FC
gUnknown_081E75FC: @ 81E75FC
.incbin "baserom.gba", 0x001e75fc, 0x14
@ 81E7610
.include "data/rtc.s"

View File

@ -1,7 +1,12 @@
unk_2000000 = 0x2000000;
unk_2004000 = 0x2004000;
gUnknown_020239F8 = 0x20239F8;
gSaveBlock2 = 0x2024EA4;
word_203855E = 0x203855E;
gUnknown_0203869A = 0x203869A;
gTileBuffer = 0x2039360;
gSaveBlock2 = 0x2024EA4;

View File

@ -10,7 +10,9 @@ include/fonts/down_arrow_tiles.h \
include/fonts/unknown_palette_81E6692.h \
include/fonts/default_palette.h
generated: $(GEN_FONT_HEADERS)
LINK_HEADERS := include/link/digit_tiles.h include/link/digit_palette.h
generated: $(GEN_FONT_HEADERS) $(LINK_HEADERS)
include/fonts/font0_lat_glyphs.h: graphics/fonts/font0_lat.1bpp
$(BIN2C) $< sFont0LatinGlyphs >$@ -static -col 8 -pad 4
@ -35,3 +37,9 @@ include/fonts/unknown_palette_81E6692.h: graphics/fonts/unknown_81E6692.gbapal
include/fonts/default_palette.h: graphics/fonts/default.gbapal
$(BIN2C) $< gFontDefaultPalette >$@ -size 2 -pad 6
include/link/digit_tiles.h: graphics/interface/link_test_digits.4bpp
$(BIN2C) $< sLinkTestDigitTiles >$@ -static -size 4 -pad 10
include/link/digit_palette.h: graphics/interface/link_test_digits.gbapal
$(BIN2C) $< sLinkTestDigitPalette >$@ -static -size 2 -pad 6

View File

@ -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 255 255

Binary file not shown.

After

Width:  |  Height:  |  Size: 269 B

View File

@ -350,6 +350,7 @@
#define REG_BG2VOFS (*(vu16 *)REG_ADDR_BG2VOFS)
#define REG_BG3HOFS (*(vu16 *)REG_ADDR_BG3HOFS)
#define REG_BG3VOFS (*(vu16 *)REG_ADDR_BG3VOFS)
#define REG_BLDALPHA (*(vu16 *)REG_ADDR_BLDALPHA)
#define REG_SOUND1CNT_L (*(vu16 *)REG_ADDR_SOUND1CNT_L)
#define REG_NR10 (*(vu8 *)REG_ADDR_NR10)
@ -433,9 +434,21 @@
#define REG_TM3CNT_L (*(vu16 *)REG_ADDR_TM3CNT_L)
#define REG_TM3CNT_H (*(vu16 *)REG_ADDR_TM3CNT_H)
#define REG_SIOCNT (*(vu16 *)REG_ADDR_SIOCNT)
#define REG_SIODATA8 (*(vu16 *)REG_ADDR_SIODATA8)
#define REG_SIODATA32 (*(vu32 *)REG_ADDR_SIODATA32)
#define REG_SIOMLT_SEND (*(vu16 *)REG_ADDR_SIOMLT_SEND)
#define REG_SIOMLT_RECV (*(vu64 *)REG_ADDR_SIOMLT_RECV)
#define REG_SIOMULTI0 (*(vu16 *)REG_ADDR_SIOMULTI0)
#define REG_SIOMULTI1 (*(vu16 *)REG_ADDR_SIOMULTI1)
#define REG_SIOMULTI2 (*(vu16 *)REG_ADDR_SIOMULTI2)
#define REG_SIOMULTI3 (*(vu16 *)REG_ADDR_SIOMULTI3)
#define REG_KEYINPUT (*(vu16 *)REG_ADDR_KEYINPUT)
#define REG_KEYCNT (*(vu16 *)REG_ADDR_KEYCNT)
#define REG_RCNT (*(vu16 *)REG_ADDR_RCNT)
#define REG_IME (*(vu16 *)REG_ADDR_IME)
#define REG_IE (*(vu16 *)REG_ADDR_IE)
#define REG_IF (*(vu16 *)REG_ADDR_IF)
@ -526,6 +539,31 @@
#define TIMER_INTR_ENABLE 0x40
#define TIMER_ENABLE 0x80
// serial
#define SIO_8BIT_MODE 0x0000 // Normal 8-bit communication mode
#define SIO_32BIT_MODE 0x1000 // Normal 32-bit communication mode
#define SIO_MULTI_MODE 0x2000 // Multi-player communication mode
#define SIO_UART_MODE 0x3000 // UART communication mode
#define SIO_9600_BPS 0x0000 // baud rate 9600 bps
#define SIO_38400_BPS 0x0001 // 38400 bps
#define SIO_57600_BPS 0x0002 // 57600 bps
#define SIO_115200_BPS 0x0003 // 115200 bps
#define SIO_MULTI_SI 0x0004 // Multi-player communication SI terminal
#define SIO_MULTI_SD 0x0008 // SD terminal
#define SIO_ERROR 0x0040 // Detect error
#define SIO_START 0x0080 // Start transfer
#define SIO_ENABLE 0x0080 // Enable SIO
#define SIO_INTR_ENABLE 0x4000
#define SIO_MULTI_SI_SHIFT 2
#define SIO_MULTI_SI_MASK 0x1
#define SIO_MULTI_DI_SHIFT 3
#define SIO_MULTI_DI_MASK 0x1
// keys
#define A_BUTTON 0x0001
#define B_BUTTON 0x0002

View File

@ -1,19 +1,23 @@
#ifndef GUARD_GBA_TYPES_H
#define GUARD_GBA_TYPES_H
typedef unsigned char u8;
typedef unsigned short u16;
typedef unsigned int u32;
typedef signed char s8;
typedef signed short s16;
typedef signed int s32;
typedef unsigned char u8;
typedef unsigned short u16;
typedef unsigned int u32;
typedef unsigned long long u64;
typedef signed char s8;
typedef signed short s16;
typedef signed int s32;
typedef signed long long s64;
typedef volatile u8 vu8;
typedef volatile u8 vu8;
typedef volatile u16 vu16;
typedef volatile u32 vu32;
typedef volatile s8 vs8;
typedef volatile u64 vu64;
typedef volatile s8 vs8;
typedef volatile s16 vs16;
typedef volatile s32 vs32;
typedef volatile s64 vs64;
typedef float f32;
typedef double f64;
@ -67,4 +71,28 @@ struct ObjAffineSrcData
u16 rotation;
};
// Multi-player SIO Control Structure
struct SioMultiCnt
{
u16 baudRate:2; // baud rate
u16 si:1; // SI terminal
u16 sd:1; // SD terminal
u16 id:2; // ID
u16 error:1; // error flag
u16 enable:1; // SIO enable
u16 unused_11_8:4;
u16 mode:2; // communication mode (should equal 2)
u16 intrEnable:1; // IRQ enable
u16 unused_15:1;
u16 data; // data
};
#define ST_SIO_MULTI_MODE 2 // Multi-player communication mode
// baud rate
#define ST_SIO_9600_BPS 0 // 9600 bps
#define ST_SIO_38400_BPS 1 // 38400 bps
#define ST_SIO_57600_BPS 2 // 57600 bps
#define ST_SIO_115200_BPS 3 // 115200 bps
#endif // GUARD_GBA_TYPES_H

View File

@ -10,6 +10,8 @@
// Prevent cross-jump optimization.
#define BLOCK_CROSS_JUMP asm("");
#define ARRAY_COUNT(array) (sizeof(array) / sizeof((array)[0]))
extern u8 gStringVar1[];
extern u8 gStringVar2[];
extern u8 gStringVar3[];
@ -38,8 +40,8 @@ struct SaveBlock2
{
u8 playerName[8];
u8 playerGender;
u16 playerTrainerId;
u16 playerSecretId;
u8 sb2_field_9;
u8 playerTrainerId[4];
u16 playTimeHours;
u8 playTimeMinutes;
u8 playTimeSeconds;

182
include/link.h Normal file
View File

@ -0,0 +1,182 @@
#ifndef GUARD_LINK_H
#define GUARD_LINK_H
#include "global.h"
#define MAX_LINK_PLAYERS 4
#define CMD_LENGTH 8
#define QUEUE_CAPACITY 50
#define BLOCK_BUFFER_SIZE 0x100
#define LINK_STAT_LOCAL_ID 0x00000003
#define LINK_STAT_PLAYER_COUNT 0x0000001C
#define LINK_STAT_PLAYER_COUNT_SHIFT 2
#define LINK_STAT_MASTER 0x00000020
#define LINK_STAT_MASTER_SHIFT 5
#define LINK_STAT_CONN_ESTABLISHED 0x00000040
#define LINK_STAT_CONN_ESTABLISHED_SHIFT 6
#define LINK_STAT_RECEIVED_NOTHING 0x00000100
#define LINK_STAT_RECEIVED_NOTHING_SHIFT 8
#define LINK_STAT_ERRORS 0x0007F000
#define EXTRACT_PLAYER_COUNT(status) \
(((status) & LINK_STAT_PLAYER_COUNT) >> LINK_STAT_PLAYER_COUNT_SHIFT)
#define EXTRACT_MASTER(status) \
(((status) >> LINK_STAT_MASTER_SHIFT) & 1)
#define EXTRACT_CONN_ESTABLISHED(status) \
(((status) >> LINK_STAT_CONN_ESTABLISHED_SHIFT) & 1)
#define EXTRACT_RECEIVED_NOTHING(status) \
(((status) >> LINK_STAT_RECEIVED_NOTHING_SHIFT) & 1)
#define MASTER_HANDSHAKE 0x8FFF
#define SLAVE_HANDSHAKE 0xB9A0
enum
{
LINK_STATE_START0,
LINK_STATE_START1,
LINK_STATE_HANDSHAKE,
LINK_STATE_INIT_TIMER,
LINK_STATE_CONN_ESTABLISHED,
};
enum
{
EXCHANGE_NOT_STARTED,
EXCHANGE_COMPLETE,
EXCHANGE_TIMED_OUT,
EXCHANGE_IN_PROGRESS,
};
enum
{
QUEUE_FULL_NONE,
QUEUE_FULL_SEND,
QUEUE_FULL_RECV,
};
enum
{
LAG_NONE,
LAG_MASTER,
LAG_SLAVE,
};
struct LinkPlayer
{
u16 version;
u16 lp_field_2;
u32 trainerId;
u8 name[11];
u8 gender;
u32 linkType;
u16 lp_field_18;
u16 language;
};
struct LinkPlayerBlock
{
u8 magic1[16];
struct LinkPlayer linkPlayer;
u8 magic2[16];
};
// circular queues
struct SendQueue
{
u16 data[CMD_LENGTH][QUEUE_CAPACITY];
u8 pos;
u8 count;
};
struct RecvQueue
{
u16 data[MAX_LINK_PLAYERS][CMD_LENGTH][QUEUE_CAPACITY];
u8 pos;
u8 count;
};
struct Link
{
u8 isMaster; // 0: slave, 8: master
u8 state;
u8 localId; // local multi-player ID
u8 playerCount;
u16 tempRecvBuffer[4];
bool8 receivedNothing;
s8 serialIntrCounter;
bool8 handshakeAsMaster;
u8 link_field_F;
// error conditions
bool8 hardwareError; // hardware reported an error
bool8 badChecksum; // checksum didn't match between devices
u8 queueFull; // send or recv queue out of space
u8 lag; // connection is lagging
u16 checksum;
u8 sendCmdIndex;
u8 recvCmdIndex;
struct SendQueue sendQueue;
struct RecvQueue recvQueue;
};
extern struct Link gLink;
extern u16 gRecvCmds[CMD_LENGTH][MAX_LINK_PLAYERS];
extern u32 gLinkStatus;
extern u16 gSendCmd[CMD_LENGTH];
extern u8 gShouldAdvanceLinkState;
void Task_DestroySelf(u8);
void sub_8007270(u8);
void OpenLink(void);
void CloseLink(void);
u16 LinkMain2(u16 *);
void sub_8007B14(void);
bool32 sub_8007B24(void);
void ClearLinkCallback(void);
void ClearLinkCallback_2(void);
u8 GetLinkPlayerCount(void);
void OpenLinkTimed(void);
u8 GetLinkPlayerDataExchangeStatusTimed(void);
bool8 IsLinkPlayerDataExchangeComplete(void);
u32 GetLinkPlayerTrainerId(u8);
void ResetLinkPlayers(void);
void sub_8007E24(void);
void sub_8007E4C(void);
u8 GetMultiplayerId(void);
u8 bitmask_all_link_players_but_self(void);
bool8 SendBlock(u8, void *, u16);
bool8 sub_8007E9C(u8);
bool8 sub_8007ECC(void);
u8 GetBlockRecievedStatus(void);
void ResetBlockReceivedFlags(void);
void ResetBlockReceivedFlag(u8);
void sub_8007F4C(void);
void SetLinkDebugValues(u32, u32);
u8 sub_8008198(void);
void sub_80081C8(u8);
u8 sub_800820C(void);
u8 sub_8008218(void);
void sub_800826C(void);
void sub_80082EC(void);
u8 GetLinkPlayerCount_2(void);
bool8 IsLinkMaster(void);
void sub_800832C(void);
void sub_8008480(void);
void sub_80084A4(void);
void CB2_LinkError(void);
u8 GetSioMultiSI(void);
bool8 IsLinkConnectionEstablished(void);
void SetSuppressLinkErrorMessage(bool8);
bool8 HasLinkErrorOccurred(void);
void ResetSerial(void);
u32 LinkMain1(u8 *, u16 *, u16[CMD_LENGTH][MAX_LINK_PLAYERS]);
void LinkVSync(void);
void Timer3Intr(void);
void SerialCB(void);
#endif // GUARD_LINK_H

2
include/link/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
digit_tiles.h
digit_palette.h

View File

@ -42,6 +42,12 @@ struct Main
u8 oamLoadDisabled:1;
};
extern u8 gUnknown_3001764;
extern struct Main gMain;
extern u8 gUnknown_3001BB4;
extern bool8 gLinkVSyncDisabled;
extern const u8 gGameVersion;
extern const u8 gGameLanguage;
#endif // GUARD_MAIN_H

View File

@ -10,9 +10,11 @@ struct Task
u8 prev;
u8 next;
u8 priority;
u16 data[16];
s16 data[16];
};
extern struct Task gTasks[];
void ResetTasks();
u8 CreateTask(TaskFunc func, u8 priority);
void DestroyTask(u8 taskId);

View File

@ -76,5 +76,6 @@ extern const struct WindowConfig gWindowConfig_81E7278;
extern const struct WindowConfig gWindowConfig_81E7294;
u8 GetExtCtrlCodeLength(u8 code);
void ConvertInternationalString(u8 *s, u8 language);
#endif // GUARD_TEXT_H

View File

@ -23,6 +23,8 @@ gLocalTime = 0x3004038;
gUnknown_3004820 = 0x3004820;
word_3004858 = 0x3004858;
gTasks = 0x3004B20;
gMPlayMemAccArea = 0x3007440;

View File

@ -12,6 +12,9 @@ SECTIONS {
src/main.o(ewram_data);
src/sprite.o(ewram_data);
src/text.o(ewram_data);
src/string_util.o(ewram_data);
. += 0x2E8; /* big gap */
src/link.o(ewram_data);
}
. = 0x3000000;
@ -19,18 +22,26 @@ SECTIONS {
iwram (NOLOAD) :
ALIGN(4)
{
src/main.o(.bss);
src/sprite.o(.bss);
src/text.o(.bss);
src/string_util.o(.bss);
src/link.o(.bss);
. = 0xF28;
src/agb_flash.o(.bss);
. = 0xF36;
src/siirtc.o(.bss);
tools/agbcc/lib/libgcc.a:dp-bit.o(.bss);
tools/agbcc/lib/libgcc.a:fp-bit.o(.bss);
src/m4a_2.o(.bss.code);
src/main.o(iwram_data);
src/sprite.o(iwram_data);
src/text.o(iwram_data);
src/string_util.o(iwram_data);
src/link.o(iwram_data);
. = 0x5FD0;
src/m4a_2.o(iwram_data);
}
@ -45,7 +56,7 @@ SECTIONS {
src/sprite.o(.text);
src/text.o(.text);
src/string_util.o(.text);
asm/rom2.o(.text);
src/link.o(.text);
src/rtc.o(.text);
asm/rom3.o(.text);
src/play_time.o(.text);
@ -98,6 +109,7 @@ SECTIONS {
. += 0x8; /* Why the gap? */
src/text.o(.rodata);
src/string_util.o(.rodata);
src/link.o(.rodata);
data/data2.o(.rodata);
src/m4a_tables.o(.rodata);
data/sound_data.o(.rodata);

1810
src/link.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -2,15 +2,11 @@
#include "gba/m4a_internal.h"
#include "gba/flash_internal.h"
#include "siirtc.h"
#include "rtc.h"
#include "main.h"
#include "rtc.h"
#include "link.h"
extern struct SoundInfo gSoundInfo;
extern u16 gUnknown_3002A20;
extern u32 gUnknown_3002A60;
extern u16 gUnknown_3002F90;
extern u8 gUnknown_3003040;
extern u8 gUnknown_30033A9[];
extern u32 gUnknown_3004820;
extern u32 IntrMain[];
@ -53,20 +49,17 @@ COMM_4(struct Main gMain)
COMM_2(u16 gKeyRepeatContinueDelay)
COMM_2(u8 gUnknown_3001BB4)
COMM_4(IntrFunc gIntrTable[INTR_COUNT])
COMM_2(u8 gUnknown_3001BF8)
COMM_2(bool8 gLinkVSyncDisabled)
COMM_4(u32 IntrMain_Buffer[0x200])
COMM_2(u8 gPcmDmaCounter)
EWRAM_DATA void (*gFlashTimerIntrFunc)(void) = NULL;
extern void sub_8008BEC(void);
extern void sub_800C35C(void);
extern u16 Random(void);
extern void SeedRng(u16);
extern void remove_some_task(void);
extern void c2_copyright_1();
extern u32 sub_8008848(u8 *, u16 *, u16 *);
extern void sub_80075F0(u16 *);
extern u32 sub_80558AC(void);
extern u32 sub_8055910(void);
extern u32 sub_8055940(void);
@ -74,7 +67,7 @@ extern void sound_something(void);
extern void CheckForFlashMemory(void);
extern void sound_sources_off(void);
void CallCallbacksWrapper(void);
void UpdateLinkAndCallCallbacks(void);
void InitMainCallbacks(void);
void CallCallbacks(void);
void SetMainCallback2(MainCallback callback);
@ -120,24 +113,24 @@ void AgbMain()
&& (gMain.heldKeysRaw & B_START_SELECT) == B_START_SELECT)
DoSoftReset();
if (gUnknown_30033A9[0] > 1 && sub_8055910() == 1)
if (gLink.sendQueue.count > 1 && sub_8055910() == 1)
{
gUnknown_3001764 = 1;
CallCallbacksWrapper();
UpdateLinkAndCallCallbacks();
gUnknown_3001764 = 0;
}
else
{
gUnknown_3001764 = 0;
CallCallbacksWrapper();
UpdateLinkAndCallCallbacks();
if (gUnknown_30033A9[0xC84] > 1)
if (gLink.recvQueue.count > 1)
{
if (sub_80558AC() == 1)
{
gMain.newKeys = 0;
gUnknown_3001764 = 1;
CallCallbacksWrapper();
UpdateLinkAndCallCallbacks();
gUnknown_3001764 = 0;
}
}
@ -149,12 +142,11 @@ void AgbMain()
}
}
// The conditions seem to be related to serial communication.
void CallCallbacksWrapper(void)
void UpdateLinkAndCallCallbacks(void)
{
gUnknown_3002A60 = sub_8008848(&gUnknown_3003040, &gUnknown_3002F90, &gUnknown_3002A20);
sub_80075F0(&gMain.heldKeys);
if (!(gUnknown_3002A60 & 0x100) || sub_8055940() != 1)
gLinkStatus = LinkMain1(&gShouldAdvanceLinkState, gSendCmd, gRecvCmds);
LinkMain2(&gMain.heldKeys);
if (!(gLinkStatus & LINK_STAT_RECEIVED_NOTHING) || sub_8055940() != 1)
CallCallbacks();
}
@ -289,8 +281,8 @@ void VBlankIntr(void)
{
u16 savedIme;
if (gUnknown_3001BF8 == 0)
sub_8008BEC();
if (!gLinkVSyncDisabled)
LinkVSync();
savedIme = REG_IME;
REG_IME = 0;

View File

@ -19,11 +19,14 @@ static u8 *ExpandPlaceholder_GoodLeader(void);
static u8 *ExpandPlaceholder_EvilLegendary(void);
static u8 *ExpandPlaceholder_GoodLegendary(void);
COMM_4(u8 gUnknownStringVar[16])
const u8 gEmptyString_81E72B0[] = _"";
const u8 gRightPointingTriangleString[] = _"";
const u8 sDigits[] = @"0123456789ABCDEF";
const s32 sPowersOfTen[] =
static const u8 sDigits[] = @"0123456789ABCDEF";
static const s32 sPowersOfTen[] =
{
1,
10,
@ -37,12 +40,12 @@ const s32 sPowersOfTen[] =
1000000000,
};
const u8 sSetBrailleFont[] = { 0xFC, 0x06, 0x06, 0xFF };
const u8 sGotoLine2[] = { 0xFE, 0xFC, 0x0E, 0x02, 0xFF };
static const u8 sSetBrailleFont[] = { 0xFC, 0x06, 0x06, 0xFF };
static const u8 sGotoLine2[] = { 0xFE, 0xFC, 0x0E, 0x02, 0xFF };
typedef u8 *(*ExpandPlaceholderFunc)(void);
const ExpandPlaceholderFunc sExpandPlaceholderFuncs[] =
static const ExpandPlaceholderFunc sExpandPlaceholderFuncs[] =
{
ExpandPlaceholder_UnknownStringVar,
ExpandPlaceholder_PlayerName,
@ -74,8 +77,6 @@ extern u8 gExpandedPlaceholder_Groudon[];
extern u8 gExpandedPlaceholder_Brendan[];
extern u8 gExpandedPlaceholder_May[];
extern u8 gUnknownStringVar[];
u8 *StringCopy10(u8 *dest, u8 *src)
{
u8 i;

View File

@ -3720,9 +3720,9 @@ u8 GetStringWidthGivenWindowConfig(struct WindowConfig *winConfig, u8 *s)
return GetStringWidth(&sTempWindow, s);
}
void SetStringCharset(u8 *s, u8 charset)
void ConvertInternationalString(u8 *s, u8 language)
{
if (charset == CHARSET_JAPANESE)
if (language == CHARSET_JAPANESE)
{
u8 i;
u8 length;