summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
Diffstat (limited to 'data')
-rw-r--r--data/link_rfu_3.s21
-rw-r--r--data/mevent/script_common.inc157
-rw-r--r--data/mevent/script_ish.inc28
3 files changed, 112 insertions, 94 deletions
diff --git a/data/link_rfu_3.s b/data/link_rfu_3.s
index ed1a09b16..9235d4b62 100644
--- a/data/link_rfu_3.s
+++ b/data/link_rfu_3.s
@@ -370,7 +370,22 @@ gUnknown_8459580:: @ 8459580
.incbin "baserom.gba", 0x459580, 0x8
gUnknown_8459588:: @ 8459588
- .incbin "baserom.gba", 0x459588, 0x64
+ .incbin "baserom.gba", 0x459588, 0x28
-gUnknown_84595EC:: @ 84595EC @ referenced in mevent/script_common.inc
- .incbin "baserom.gba", 0x4595EC, 0x48
+gUnknown_84595B0::
+ .string "Canceled reading the Card.$"
+
+ .align 2
+gUnknown_84595CC::
+ .4byte 0x02, 0x15 @ RECEIVE ID(0x15)
+ .4byte 0x0c, 0x00 @ READ PACKET AND COMPUTER SOMETHING
+ .4byte 0x14, 0x00 @ SEND ALL
+ .4byte 0x01, 0x0e @ RETURN 0x0e
+
+gMEventSrvScript_OtherTrainerCanceled:: @ 84595EC @ referenced in mevent/script_common.inc
+ .4byte 0x12, 0x20, gUnknown_84595CC @ SEND
+ .4byte 0x01, 0x00, NULL @ WAIT SEND
+ .4byte 0x14, 0x1b, gUnknown_84595B0 @ SEND_STR
+ .4byte 0x01, 0x00, NULL @ WAIT SEND
+ .4byte 0x02, 0x14, NULL @ RECV
+ .4byte 0x00, 0x09, NULL @ RETURN (other trainer canceled)
diff --git a/data/mevent/script_common.inc b/data/mevent/script_common.inc
index abf03ab95..b4a811d01 100644
--- a/data/mevent/script_common.inc
+++ b/data/mevent/script_common.inc
@@ -1,84 +1,87 @@
-gUnknown_8468920::
- .4byte 0x12, 0x10, gUnknown_8468810
- .4byte 0x01, 0x00, NULL
- .4byte 0x02, 0x14, NULL
- .4byte 0x00, 0x0a, NULL
- .4byte 0x12, 0x10, gUnknown_8468820
- .4byte 0x01, 0x00, NULL
- .4byte 0x02, 0x14, NULL
- .4byte 0x00, 0x0b, NULL
- .4byte 0x12, 0x10, gUnknown_84688E0
- .4byte 0x01, 0x00, NULL
- .4byte 0x02, 0x14, NULL
- .4byte 0x00, 0x09, NULL
+gMEventSrvScript_UnableToSend::
+ .4byte 0x12, 0x10, gMEventClientScript_UnableToRecv @ SEND
+ .4byte 0x01, 0x00, NULL @ WAIT SEND
+ .4byte 0x02, 0x14, NULL @ RECV
+ .4byte 0x00, 0x0a, NULL @ RETURN (can't send)
-gUnknown_84689B0::
- .4byte 0x12, 0x10, gUnknown_8468898
- .4byte 0x01, 0x00, NULL
- .4byte 0x02, 0x14, NULL
- .4byte 0x00, 0x07, NULL
+ .4byte 0x12, 0x10, gMEventClientScript_CommError @ SEND
+ .4byte 0x01, 0x00, NULL @ WAIT SEND
+ .4byte 0x02, 0x14, NULL @ RECV
+ .4byte 0x00, 0x0b, NULL @ RETURN (comm error)
-gUnknown_84689E0::
- .4byte 0x12, 0x28, gUnknown_8468870
- .4byte 0x01, 0x00, NULL
- .4byte 0x0e, 0x00, NULL
- .4byte 0x01, 0x00, NULL
- .4byte 0x02, 0x13, NULL
- .4byte 0x08, 0x00, NULL
- .4byte 0x04, 0x01, gUnknown_84689B0
- .4byte 0x12, 0x10, gUnknown_84688A8
- .4byte 0x01, 0x00, NULL
- .4byte 0x02, 0x14, NULL
- .4byte 0x00, 0x03, NULL
+ .4byte 0x12, 0x10, gMEventClientScript_OtherTrainerCanceled @ SEND
+ .4byte 0x01, 0x00, NULL @ WAIT SEND
+ .4byte 0x02, 0x14, NULL @ RECV
+ .4byte 0x00, 0x09, NULL @ RETURN (other trn canceled)
-gUnknown_8468A64::
- .4byte 0x12, 0x30, gUnknown_8468840
- .4byte 0x01, 0x00, NULL
- .4byte 0x0d, 0x00, NULL
- .4byte 0x01, 0x00, NULL
- .4byte 0x0f, 0x00, NULL
- .4byte 0x01, 0x00, NULL
- .4byte 0x02, 0x14, NULL
- .4byte 0x00, 0x02, NULL
+gMEventSrvScript_OtherTrnHasNews::
+ .4byte 0x12, 0x10, gMEventClientScript_AlredyHadNews @ SEND
+ .4byte 0x01, 0x00, NULL @ WAIT SEND
+ .4byte 0x02, 0x14, NULL @ RECV
+ .4byte 0x00, 0x07, NULL @ RETURN (other trn has news)
-gUnknown_8468AC4::
- .4byte 0x12, 0x28, gUnknown_84688B8
- .4byte 0x01, 0x00, NULL
- .4byte 0x02, 0x13, NULL
- .4byte 0x08, 0x00, NULL
- .4byte 0x04, 0x00, gUnknown_8468A64
- .4byte 0x03, 0x00, gUnknown_84595EC
+gMEventSrvScript_SentNewsSuccess::
+ .4byte 0x12, 0x28, gMEventClientScript_ReceiveNewsAndValidate @ SEND
+ .4byte 0x01, 0x00, NULL @ WAIT SEND
+ .4byte 0x0e, 0x00, NULL @ SEND_NEWS
+ .4byte 0x01, 0x00, NULL @ WAIT SEND
+ .4byte 0x02, 0x13, NULL @ RECV
+ .4byte 0x08, 0x00, NULL @ READWORD
+ .4byte 0x04, 0x01, gMEventSrvScript_OtherTrnHasNews @ BRANCH_EQ
+ .4byte 0x12, 0x10, gMEventClientScript_RecvNewsSuccess @ SEND
+ .4byte 0x01, 0x00, NULL @ WAIT SEND
+ .4byte 0x02, 0x14, NULL @ RECV
+ .4byte 0x00, 0x03, NULL @ RETURN (news sent to)
-gUnknown_8468B0C::
- .4byte 0x12, 0x10, gUnknown_84688F0
- .4byte 0x01, 0x00, NULL
- .4byte 0x02, 0x14, NULL
- .4byte 0x00, 0x05, NULL
- .4byte 0x12, 0x10, gUnknown_8468830
- .4byte 0x01, 0x00, NULL
- .4byte 0x02, 0x14, NULL
- .4byte 0x00, 0x00, NULL
+gMEventSrvScript_SendCardSuccess::
+ .4byte 0x12, 0x30, gMEventClientScript_ReceiveCardAndReturnSuccess @ SEND
+ .4byte 0x01, 0x00, NULL @ WAIT SEND
+ .4byte 0x0d, 0x00, NULL @ SEND_CARD
+ .4byte 0x01, 0x00, NULL @ WAIT SEND
+ .4byte 0x0f, 0x00, NULL @ BUFFER_SEND
+ .4byte 0x01, 0x00, NULL @ WAIT SEND
+ .4byte 0x02, 0x14, NULL @ RECV
+ .4byte 0x00, 0x02, NULL @ RETURN (card sent to)
-gUnknown_8468B6C:: @ 8468B6C
- .4byte 0x1b, 0x00, NULL
- .4byte 0x12, 0x20, gUnknown_84687F0
- .4byte 0x01, 0x00, NULL
- .4byte 0x02, 0x11, NULL
- .4byte 0x05, 0x00, NULL
- .4byte 0x06, 0x00, NULL
- .4byte 0x04, 0x00, gUnknown_8468920
- .4byte 0x03, 0x00, gUnknown_84689E0
+gMEventSrvScript_AskClientToOverwriteCard::
+ .4byte 0x12, 0x28, gMEventClientScript_AskWouldLikeToTossCard @ SEND
+ .4byte 0x01, 0x00, NULL @ WAIT SEND
+ .4byte 0x02, 0x13, NULL @ RECV
+ .4byte 0x08, 0x00, NULL @ READWORD
+ .4byte 0x04, 0x00, gMEventSrvScript_SendCardSuccess @ BRANCH_EQ
+ .4byte 0x03, 0x00, gMEventSrvScript_OtherTrainerCanceled @ BRANCH
-gUnknown_8468BCC:: @ 8468BCC
- .4byte 0x1a, 0x00, NULL
- .4byte 0x1c, 0x00, NULL
- .4byte 0x12, 0x20, gUnknown_84687F0
- .4byte 0x01, 0x00, NULL
- .4byte 0x02, 0x11, NULL
- .4byte 0x05, 0x00, NULL
- .4byte 0x06, 0x00, NULL
- .4byte 0x04, 0x00, gUnknown_8468920
- .4byte 0x07, 0x00, NULL
- .4byte 0x04, 0x02, gUnknown_8468AC4
- .4byte 0x04, 0x00, gUnknown_8468A64
- .4byte 0x03, 0x00, gUnknown_8468B0C
+gMEventSrvScript_OtherTrnHasCard::
+ .4byte 0x12, 0x10, gMEventClientScript_AlreadyHadCard @ SEND
+ .4byte 0x01, 0x00, NULL @ WAIT SEND
+ .4byte 0x02, 0x14, NULL @ RECV
+ .4byte 0x00, 0x05, NULL @ RETURN (other trn has card)
+
+ .4byte 0x12, 0x10, gMEventClientScript_NothingSentOver @ SEND
+ .4byte 0x01, 0x00, NULL @ WAIT SEND
+ .4byte 0x02, 0x14, NULL @ RECV
+ .4byte 0x00, 0x00, NULL @ RETURN (nothing sent over)
+
+gMEventSrvScript_SendNews:: @ 8468B6C
+ .4byte 0x1b, 0x00, NULL @ BUFFER_SAVED_NEWS
+ .4byte 0x12, 0x20, gMEventClientScript_Send1442CC @ SEND
+ .4byte 0x01, 0x00, NULL @ WAIT SEND
+ .4byte 0x02, 0x11, NULL @ RECV
+ .4byte 0x05, 0x00, NULL @ READ_1442CC
+ .4byte 0x06, 0x00, NULL @ VALID_1442CC
+ .4byte 0x04, 0x00, gMEventSrvScript_UnableToSend @ BRANCH_EQ
+ .4byte 0x03, 0x00, gMEventSrvScript_SentNewsSuccess @ BRANCH
+
+gMEventSrvScript_SendCard:: @ 8468BCC
+ .4byte 0x1a, 0x00, NULL @ BUFFER_SAVED_CARD
+ .4byte 0x1c, 0x00, NULL @ RAM_SCRIPT_IF_VALID
+ .4byte 0x12, 0x20, gMEventClientScript_Send1442CC @ SEND
+ .4byte 0x01, 0x00, NULL @ WAIT SEND
+ .4byte 0x02, 0x11, NULL @ RECV
+ .4byte 0x05, 0x00, NULL @ READ_1442CC
+ .4byte 0x06, 0x00, NULL @ VALID_1442CC
+ .4byte 0x04, 0x00, gMEventSrvScript_UnableToSend @ BRANCH_EQ
+ .4byte 0x07, 0x00, NULL @ CHECK_1442CC_14
+ .4byte 0x04, 0x02, gMEventSrvScript_AskClientToOverwriteCard @ BRANCH_EQ
+ .4byte 0x04, 0x00, gMEventSrvScript_SendCardSuccess @ BRANCH_EQ
+ .4byte 0x03, 0x00, gMEventSrvScript_OtherTrnHasCard @ BRANCH
diff --git a/data/mevent/script_ish.inc b/data/mevent/script_ish.inc
index 3d79cf1ee..d96356887 100644
--- a/data/mevent/script_ish.inc
+++ b/data/mevent/script_ish.inc
@@ -1,26 +1,26 @@
-gUnknown_84687E0:: @ 84687E0
+gMEVentClientScript_IntialListen:: @ 84687E0
.4byte 0x02, 0x10 @ RECEIVE ID(0x10)
.4byte 0x04, 0x00 @ JUMP TO RECEIVE BUFFER
-gUnknown_84687F0::
+gMEventClientScript_Send1442CC::
.4byte 0x08, 0x00 @ SEND HEADER MAYBE
.4byte 0x03, 0x00 @ WAIT SEND
.4byte 0x02, 0x10 @ RECEIVE ID(0x10)
.4byte 0x04, 0x00 @ JUMP TO RECEIVE BUFFER
-gUnknown_8468810::
+gMEventClientScript_UnableToRecv:: @ can't accept card or news
.4byte 0x14, 0x00 @ SEND ALL
.4byte 0x01, 0x0a @ RETURN 0x0a
-gUnknown_8468820::
+gMEventClientScript_CommError:: @ comm error
.4byte 0x14, 0x00 @ SEND ALL
.4byte 0x01, 0x0b @ RETURN 0x0b
-gUnknown_8468830::
+gMEventClientScript_NothingSentOver:: @ nothing sent
.4byte 0x14, 0x00 @ SEND ALL
.4byte 0x01, 0x00 @ RETURN 0x00
-gUnknown_8468840::
+gMEventClientScript_ReceiveCardAndReturnSuccess:: @ card success
.4byte 0x02, 0x16 @ RECEIVE ID(0x16)
.4byte 0x0a, 0x00 @ RECEIVE_TO_SAVE_FILE
.4byte 0x02, 0x19 @ RECEIVE ID(0x19)
@@ -28,37 +28,37 @@ gUnknown_8468840::
.4byte 0x14, 0x00 @ SEND ALL
.4byte 0x01, 0x02 @ RETURN 0x02
-gUnknown_8468870::
+gMEventClientScript_ReceiveNewsAndValidate::
.4byte 0x02, 0x17 @ RECEIVE ID(0x17)
- .4byte 0x09, 0x00 @ VALIDATE BUFF3120
+ .4byte 0x09, 0x00 @ VALIDATE NEWS
.4byte 0x03, 0x00 @ WAIT SEND
.4byte 0x02, 0x10 @ RECEIVE ID(0x10)
.4byte 0x04, 0x00 @ JUMP TO RECEIVE BUFFER
-gUnknown_8468898::
+gMEventClientScript_AlredyHadNews:: @ already had news
.4byte 0x14, 0x00 @ SEND ALL
.4byte 0x01, 0x07 @ RETURN 0x07
-gUnknown_84688A8::
+gMEventClientScript_RecvNewsSuccess:: @ news success
.4byte 0x14, 0x00 @ SEND ALL
.4byte 0x01, 0x03 @ RETURN 0x03
-gUnknown_84688B8::
+gMEventClientScript_AskWouldLikeToTossCard::
.4byte 0x0d, 0x00 @ REQUEST PARAMETER
.4byte 0x0e, 0x00 @ SEND PARAMETER
.4byte 0x03, 0x00 @ WAIT SEND
.4byte 0x02, 0x10 @ RECEIVE ID(0x10)
.4byte 0x04, 0x00 @ JUMP TO RECEIVE BUFFER
-gUnknown_84688E0::
+gMEventClientScript_OtherTrainerCanceled:: @ comm cancelled
.4byte 0x14, 0x00 @ SEND ALL
.4byte 0x01, 0x09 @ RETURN 0x09
-gUnknown_84688F0::
+gMEventClientScript_AlreadyHadCard:: @ already had card
.4byte 0x14, 0x00 @ SEND ALL
.4byte 0x01, 0x05 @ RETURN 0x05
-gUnknown_8468900::
+gMEventClientScript_SuccessFromBuffer:: @ success from buffer
.4byte 0x02, 0x15 @ RECEIVE ID(0x15)
.4byte 0x0c, 0x00 @ READ PACKET AND COMPUTE SOMETHING
.4byte 0x14, 0x00 @ SEND ALL