summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPikalaxALT <pikalaxalt@gmail.com>2017-11-10 19:06:06 -0500
committerPikalaxALT <pikalaxalt@gmail.com>2017-11-10 19:06:06 -0500
commit27f9dd0a97cf6e0a2528ec3744a34a0732ff97fd (patch)
treed304765817ec063feffaef05f74db9dc583b2210 /src
parentd76901ff6412c319a1044db36e6ab0b98f530d25 (diff)
sub_800A0C8
Diffstat (limited to 'src')
-rw-r--r--src/link.c74
1 files changed, 74 insertions, 0 deletions
diff --git a/src/link.c b/src/link.c
index 66c7c5801..5d5d22cf5 100644
--- a/src/link.c
+++ b/src/link.c
@@ -13,6 +13,7 @@
#include "gpu_regs.h"
#include "palette.h"
#include "task.h"
+#include "trade.h"
#include "link.h"
// Static type declarations
@@ -768,3 +769,76 @@ void sub_800A0AC(void)
gUnknown_020229C8 = 0;
sub_8009734();
}
+
+u8 sub_800A0C8(int lower, int upper)
+{
+ int i;
+ int count;
+ u32 index;
+ u8 cmpVal;
+ u32 linkType1;
+ u32 linkType2;
+
+ count = 0;
+ if (gReceivedRemoteLinkPlayers == TRUE)
+ {
+ cmpVal = sub_800ABAC();
+ if (lower > cmpVal || cmpVal > upper)
+ {
+ gUnknown_03000D5C = 6;
+ return 6;
+ }
+ else
+ {
+ if (GetLinkPlayerCount() == 0)
+ {
+ gUnknown_0300306C = TRUE;
+ sub_80097E8();
+ }
+ for (i = 0, index = 0; i < GetLinkPlayerCount(); index ++, i ++)
+ {
+ if (gLinkPlayers[index].linkType == gLinkPlayers[0].linkType)
+ {
+ count ++;
+ }
+ }
+ if (count == GetLinkPlayerCount())
+ {
+ if (gLinkPlayers[0].linkType == 0x1133)
+ {
+ switch (sub_807A728())
+ {
+ case 1:
+ gUnknown_03000D5C = 4;
+ break;
+ case 2:
+ gUnknown_03000D5C = 5;
+ break;
+ case 0:
+ gUnknown_03000D5C = 1;
+ break;
+ }
+ }
+ else
+ {
+ gUnknown_03000D5C = 1;
+ }
+ }
+ else
+ {
+ gUnknown_03000D5C = 3;
+ linkType1 = gLinkPlayers[GetMultiplayerId()].linkType;
+ linkType2 = gLinkPlayers[GetMultiplayerId() ^ 1].linkType;
+ if ((linkType1 == 0x2266 && linkType2 == 0x2277) || (linkType1 == 0x2277 && linkType2 == 0x2266))
+ {
+ gSpecialVar_0x8005 = 3;
+ }
+ }
+ }
+ }
+ else if (++ gUnknown_020229C8 > 600)
+ {
+ gUnknown_03000D5C = 2;
+ }
+ return gUnknown_03000D5C;
+}