Document mevent scripts

This commit is contained in:
PikalaxALT
2019-11-03 19:16:53 -05:00
parent 977925a9ee
commit 89e0168cce
9 changed files with 149 additions and 135 deletions
BIN
View File
Binary file not shown.
+18 -3
View File
@@ -370,7 +370,22 @@ gUnknown_8459580:: @ 8459580
.incbin "baserom.gba", 0x459580, 0x8 .incbin "baserom.gba", 0x459580, 0x8
gUnknown_8459588:: @ 8459588 gUnknown_8459588:: @ 8459588
.incbin "baserom.gba", 0x459588, 0x64 .incbin "baserom.gba", 0x459588, 0x28
gUnknown_84595EC:: @ 84595EC @ referenced in mevent/script_common.inc gUnknown_84595B0::
.incbin "baserom.gba", 0x4595EC, 0x48 .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)
+80 -77
View File
@@ -1,84 +1,87 @@
gUnknown_8468920:: gMEventSrvScript_UnableToSend::
.4byte 0x12, 0x10, gUnknown_8468810 .4byte 0x12, 0x10, gMEventClientScript_UnableToRecv @ SEND
.4byte 0x01, 0x00, NULL .4byte 0x01, 0x00, NULL @ WAIT SEND
.4byte 0x02, 0x14, NULL .4byte 0x02, 0x14, NULL @ RECV
.4byte 0x00, 0x0a, NULL .4byte 0x00, 0x0a, NULL @ RETURN (can't send)
.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
gUnknown_84689B0:: .4byte 0x12, 0x10, gMEventClientScript_CommError @ SEND
.4byte 0x12, 0x10, gUnknown_8468898 .4byte 0x01, 0x00, NULL @ WAIT SEND
.4byte 0x01, 0x00, NULL .4byte 0x02, 0x14, NULL @ RECV
.4byte 0x02, 0x14, NULL .4byte 0x00, 0x0b, NULL @ RETURN (comm error)
.4byte 0x00, 0x07, NULL
gUnknown_84689E0:: .4byte 0x12, 0x10, gMEventClientScript_OtherTrainerCanceled @ SEND
.4byte 0x12, 0x28, gUnknown_8468870 .4byte 0x01, 0x00, NULL @ WAIT SEND
.4byte 0x01, 0x00, NULL .4byte 0x02, 0x14, NULL @ RECV
.4byte 0x0e, 0x00, NULL .4byte 0x00, 0x09, NULL @ RETURN (other trn canceled)
.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
gUnknown_8468A64:: gMEventSrvScript_OtherTrnHasNews::
.4byte 0x12, 0x30, gUnknown_8468840 .4byte 0x12, 0x10, gMEventClientScript_AlredyHadNews @ SEND
.4byte 0x01, 0x00, NULL .4byte 0x01, 0x00, NULL @ WAIT SEND
.4byte 0x0d, 0x00, NULL .4byte 0x02, 0x14, NULL @ RECV
.4byte 0x01, 0x00, NULL .4byte 0x00, 0x07, NULL @ RETURN (other trn has news)
.4byte 0x0f, 0x00, NULL
.4byte 0x01, 0x00, NULL
.4byte 0x02, 0x14, NULL
.4byte 0x00, 0x02, NULL
gUnknown_8468AC4:: gMEventSrvScript_SentNewsSuccess::
.4byte 0x12, 0x28, gUnknown_84688B8 .4byte 0x12, 0x28, gMEventClientScript_ReceiveNewsAndValidate @ SEND
.4byte 0x01, 0x00, NULL .4byte 0x01, 0x00, NULL @ WAIT SEND
.4byte 0x02, 0x13, NULL .4byte 0x0e, 0x00, NULL @ SEND_NEWS
.4byte 0x08, 0x00, NULL .4byte 0x01, 0x00, NULL @ WAIT SEND
.4byte 0x04, 0x00, gUnknown_8468A64 .4byte 0x02, 0x13, NULL @ RECV
.4byte 0x03, 0x00, gUnknown_84595EC .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:: gMEventSrvScript_SendCardSuccess::
.4byte 0x12, 0x10, gUnknown_84688F0 .4byte 0x12, 0x30, gMEventClientScript_ReceiveCardAndReturnSuccess @ SEND
.4byte 0x01, 0x00, NULL .4byte 0x01, 0x00, NULL @ WAIT SEND
.4byte 0x02, 0x14, NULL .4byte 0x0d, 0x00, NULL @ SEND_CARD
.4byte 0x00, 0x05, NULL .4byte 0x01, 0x00, NULL @ WAIT SEND
.4byte 0x12, 0x10, gUnknown_8468830 .4byte 0x0f, 0x00, NULL @ BUFFER_SEND
.4byte 0x01, 0x00, NULL .4byte 0x01, 0x00, NULL @ WAIT SEND
.4byte 0x02, 0x14, NULL .4byte 0x02, 0x14, NULL @ RECV
.4byte 0x00, 0x00, NULL .4byte 0x00, 0x02, NULL @ RETURN (card sent to)
gUnknown_8468B6C:: @ 8468B6C gMEventSrvScript_AskClientToOverwriteCard::
.4byte 0x1b, 0x00, NULL .4byte 0x12, 0x28, gMEventClientScript_AskWouldLikeToTossCard @ SEND
.4byte 0x12, 0x20, gUnknown_84687F0 .4byte 0x01, 0x00, NULL @ WAIT SEND
.4byte 0x01, 0x00, NULL .4byte 0x02, 0x13, NULL @ RECV
.4byte 0x02, 0x11, NULL .4byte 0x08, 0x00, NULL @ READWORD
.4byte 0x05, 0x00, NULL .4byte 0x04, 0x00, gMEventSrvScript_SendCardSuccess @ BRANCH_EQ
.4byte 0x06, 0x00, NULL .4byte 0x03, 0x00, gMEventSrvScript_OtherTrainerCanceled @ BRANCH
.4byte 0x04, 0x00, gUnknown_8468920
.4byte 0x03, 0x00, gUnknown_84689E0
gUnknown_8468BCC:: @ 8468BCC gMEventSrvScript_OtherTrnHasCard::
.4byte 0x1a, 0x00, NULL .4byte 0x12, 0x10, gMEventClientScript_AlreadyHadCard @ SEND
.4byte 0x1c, 0x00, NULL .4byte 0x01, 0x00, NULL @ WAIT SEND
.4byte 0x12, 0x20, gUnknown_84687F0 .4byte 0x02, 0x14, NULL @ RECV
.4byte 0x01, 0x00, NULL .4byte 0x00, 0x05, NULL @ RETURN (other trn has card)
.4byte 0x02, 0x11, NULL
.4byte 0x05, 0x00, NULL .4byte 0x12, 0x10, gMEventClientScript_NothingSentOver @ SEND
.4byte 0x06, 0x00, NULL .4byte 0x01, 0x00, NULL @ WAIT SEND
.4byte 0x04, 0x00, gUnknown_8468920 .4byte 0x02, 0x14, NULL @ RECV
.4byte 0x07, 0x00, NULL .4byte 0x00, 0x00, NULL @ RETURN (nothing sent over)
.4byte 0x04, 0x02, gUnknown_8468AC4
.4byte 0x04, 0x00, gUnknown_8468A64 gMEventSrvScript_SendNews:: @ 8468B6C
.4byte 0x03, 0x00, gUnknown_8468B0C .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
+14 -14
View File
@@ -1,26 +1,26 @@
gUnknown_84687E0:: @ 84687E0 gMEVentClientScript_IntialListen:: @ 84687E0
.4byte 0x02, 0x10 @ RECEIVE ID(0x10) .4byte 0x02, 0x10 @ RECEIVE ID(0x10)
.4byte 0x04, 0x00 @ JUMP TO RECEIVE BUFFER .4byte 0x04, 0x00 @ JUMP TO RECEIVE BUFFER
gUnknown_84687F0:: gMEventClientScript_Send1442CC::
.4byte 0x08, 0x00 @ SEND HEADER MAYBE .4byte 0x08, 0x00 @ SEND HEADER MAYBE
.4byte 0x03, 0x00 @ WAIT SEND .4byte 0x03, 0x00 @ WAIT SEND
.4byte 0x02, 0x10 @ RECEIVE ID(0x10) .4byte 0x02, 0x10 @ RECEIVE ID(0x10)
.4byte 0x04, 0x00 @ JUMP TO RECEIVE BUFFER .4byte 0x04, 0x00 @ JUMP TO RECEIVE BUFFER
gUnknown_8468810:: gMEventClientScript_UnableToRecv:: @ can't accept card or news
.4byte 0x14, 0x00 @ SEND ALL .4byte 0x14, 0x00 @ SEND ALL
.4byte 0x01, 0x0a @ RETURN 0x0a .4byte 0x01, 0x0a @ RETURN 0x0a
gUnknown_8468820:: gMEventClientScript_CommError:: @ comm error
.4byte 0x14, 0x00 @ SEND ALL .4byte 0x14, 0x00 @ SEND ALL
.4byte 0x01, 0x0b @ RETURN 0x0b .4byte 0x01, 0x0b @ RETURN 0x0b
gUnknown_8468830:: gMEventClientScript_NothingSentOver:: @ nothing sent
.4byte 0x14, 0x00 @ SEND ALL .4byte 0x14, 0x00 @ SEND ALL
.4byte 0x01, 0x00 @ RETURN 0x00 .4byte 0x01, 0x00 @ RETURN 0x00
gUnknown_8468840:: gMEventClientScript_ReceiveCardAndReturnSuccess:: @ card success
.4byte 0x02, 0x16 @ RECEIVE ID(0x16) .4byte 0x02, 0x16 @ RECEIVE ID(0x16)
.4byte 0x0a, 0x00 @ RECEIVE_TO_SAVE_FILE .4byte 0x0a, 0x00 @ RECEIVE_TO_SAVE_FILE
.4byte 0x02, 0x19 @ RECEIVE ID(0x19) .4byte 0x02, 0x19 @ RECEIVE ID(0x19)
@@ -28,37 +28,37 @@ gUnknown_8468840::
.4byte 0x14, 0x00 @ SEND ALL .4byte 0x14, 0x00 @ SEND ALL
.4byte 0x01, 0x02 @ RETURN 0x02 .4byte 0x01, 0x02 @ RETURN 0x02
gUnknown_8468870:: gMEventClientScript_ReceiveNewsAndValidate::
.4byte 0x02, 0x17 @ RECEIVE ID(0x17) .4byte 0x02, 0x17 @ RECEIVE ID(0x17)
.4byte 0x09, 0x00 @ VALIDATE BUFF3120 .4byte 0x09, 0x00 @ VALIDATE NEWS
.4byte 0x03, 0x00 @ WAIT SEND .4byte 0x03, 0x00 @ WAIT SEND
.4byte 0x02, 0x10 @ RECEIVE ID(0x10) .4byte 0x02, 0x10 @ RECEIVE ID(0x10)
.4byte 0x04, 0x00 @ JUMP TO RECEIVE BUFFER .4byte 0x04, 0x00 @ JUMP TO RECEIVE BUFFER
gUnknown_8468898:: gMEventClientScript_AlredyHadNews:: @ already had news
.4byte 0x14, 0x00 @ SEND ALL .4byte 0x14, 0x00 @ SEND ALL
.4byte 0x01, 0x07 @ RETURN 0x07 .4byte 0x01, 0x07 @ RETURN 0x07
gUnknown_84688A8:: gMEventClientScript_RecvNewsSuccess:: @ news success
.4byte 0x14, 0x00 @ SEND ALL .4byte 0x14, 0x00 @ SEND ALL
.4byte 0x01, 0x03 @ RETURN 0x03 .4byte 0x01, 0x03 @ RETURN 0x03
gUnknown_84688B8:: gMEventClientScript_AskWouldLikeToTossCard::
.4byte 0x0d, 0x00 @ REQUEST PARAMETER .4byte 0x0d, 0x00 @ REQUEST PARAMETER
.4byte 0x0e, 0x00 @ SEND PARAMETER .4byte 0x0e, 0x00 @ SEND PARAMETER
.4byte 0x03, 0x00 @ WAIT SEND .4byte 0x03, 0x00 @ WAIT SEND
.4byte 0x02, 0x10 @ RECEIVE ID(0x10) .4byte 0x02, 0x10 @ RECEIVE ID(0x10)
.4byte 0x04, 0x00 @ JUMP TO RECEIVE BUFFER .4byte 0x04, 0x00 @ JUMP TO RECEIVE BUFFER
gUnknown_84688E0:: gMEventClientScript_OtherTrainerCanceled:: @ comm cancelled
.4byte 0x14, 0x00 @ SEND ALL .4byte 0x14, 0x00 @ SEND ALL
.4byte 0x01, 0x09 @ RETURN 0x09 .4byte 0x01, 0x09 @ RETURN 0x09
gUnknown_84688F0:: gMEventClientScript_AlreadyHadCard:: @ already had card
.4byte 0x14, 0x00 @ SEND ALL .4byte 0x14, 0x00 @ SEND ALL
.4byte 0x01, 0x05 @ RETURN 0x05 .4byte 0x01, 0x05 @ RETURN 0x05
gUnknown_8468900:: gMEventClientScript_SuccessFromBuffer:: @ success from buffer
.4byte 0x02, 0x15 @ RECEIVE ID(0x15) .4byte 0x02, 0x15 @ RECEIVE ID(0x15)
.4byte 0x0c, 0x00 @ READ PACKET AND COMPUTE SOMETHING .4byte 0x0c, 0x00 @ READ PACKET AND COMPUTE SOMETHING
.4byte 0x14, 0x00 @ SEND ALL .4byte 0x14, 0x00 @ SEND ALL
+6 -6
View File
@@ -10,15 +10,15 @@ struct MEventStruct_Unk1442CC
u32 unk_08; u32 unk_08;
u16 unk_0C; u16 unk_0C;
u32 unk_10; u32 unk_10;
u16 unk_14; u16 id;
u16 unk_16[4]; u16 unk_16[4];
struct MEventBuffer_3430_Sub unk_20; struct MEventBuffer_3430_Sub unk_20;
u8 unk_44; u8 unk_44;
u8 unk_45[7]; u8 playerName[7];
u8 unk_4C[4]; u8 playerTrainerId[4];
u16 unk_50[6]; u16 easyChatProfile[6];
u8 unk_5C[4]; u8 gameCode[4];
u8 unk_60; u8 version;
}; };
struct MEvent_Str_1 struct MEvent_Str_1
+2 -2
View File
@@ -66,8 +66,8 @@ struct mevent_srv_common
u32 cmdidx; u32 cmdidx;
const struct mevent_cmd * cmdBuffer; const struct mevent_cmd * cmdBuffer;
void * recvBuffer; void * recvBuffer;
struct MEventBuffer_32E0_Sub * mevent_32e0; struct MEventBuffer_32E0_Sub * card;
struct MEventBuffer_3120_Sub * mevent_3120; struct MEventBuffer_3120_Sub * news;
struct MEventStruct_Unk1442CC * mevent_unk1442cc; struct MEventStruct_Unk1442CC * mevent_unk1442cc;
void * sendBuffer1; void * sendBuffer1;
u32 sendBuffer1Size; u32 sendBuffer1Size;
+9 -9
View File
@@ -761,20 +761,20 @@ void sub_81442CC(struct MEventStruct_Unk1442CC * data)
data->unk_10 = 1; data->unk_10 = 1;
if (ValidateReceivedWonderCard()) if (ValidateReceivedWonderCard())
{ {
data->unk_14 = GetSavedWonderCard()->unk_00; data->id = GetSavedWonderCard()->unk_00;
data->unk_20 = *sav1_get_mevent_buffer_2(); data->unk_20 = *sav1_get_mevent_buffer_2();
data->unk_44 = GetSavedWonderCard()->unk_09; data->unk_44 = GetSavedWonderCard()->unk_09;
} }
else else
data->unk_14 = 0; data->id = 0;
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
data->unk_16[i] = gSaveBlock1Ptr->unk_3120.unk_338[i]; data->unk_16[i] = gSaveBlock1Ptr->unk_3120.unk_338[i];
CopyTrainerId(data->unk_4C, gSaveBlock2Ptr->playerTrainerId); CopyTrainerId(data->playerTrainerId, gSaveBlock2Ptr->playerTrainerId);
StringCopy(data->unk_45, gSaveBlock2Ptr->playerName); StringCopy(data->playerName, gSaveBlock2Ptr->playerName);
for (i = 0; i < 6; i++) for (i = 0; i < 6; i++)
data->unk_50[i] = gSaveBlock1Ptr->easyChatProfile[i]; data->easyChatProfile[i] = gSaveBlock1Ptr->easyChatProfile[i];
memcpy(data->unk_5C, RomHeaderGameCode, 4); memcpy(data->gameCode, RomHeaderGameCode, 4);
data->unk_60 = RomHeaderSoftwareVersion; data->version = RomHeaderSoftwareVersion;
} }
bool32 sub_81443D4(const struct MEventStruct_Unk1442CC * data) bool32 sub_81443D4(const struct MEventStruct_Unk1442CC * data)
@@ -794,9 +794,9 @@ bool32 sub_81443D4(const struct MEventStruct_Unk1442CC * data)
u32 sub_8144418(const u16 * a0, const struct MEventStruct_Unk1442CC * a1, void * unused) u32 sub_8144418(const u16 * a0, const struct MEventStruct_Unk1442CC * a1, void * unused)
{ {
if (a1->unk_14 == 0) if (a1->id == 0)
return 0; return 0;
if (*a0 == a1->unk_14) if (*a0 == a1->id)
return 1; return 1;
return 2; return 2;
} }
+18 -21
View File
@@ -1,9 +1,6 @@
#include "global.h" #include "global.h"
#include "malloc.h" #include "malloc.h"
#include "decompress.h" #include "decompress.h"
#include "util.h"
#include "link.h"
#include "link_rfu.h"
#include "overworld.h" #include "overworld.h"
#include "script.h" #include "script.h"
#include "battle_tower.h" #include "battle_tower.h"
@@ -21,9 +18,9 @@ static void mevent_srv_init_common(struct mevent_srv_common *, const void *, u32
static void mevent_srv_free_resources(struct mevent_srv_common *); static void mevent_srv_free_resources(struct mevent_srv_common *);
static u32 mevent_srv_exec_common(struct mevent_srv_common *); static u32 mevent_srv_exec_common(struct mevent_srv_common *);
extern const u8 gUnknown_84687E0[]; extern const u8 gMEVentClientScript_IntialListen[];
extern const struct mevent_cmd gUnknown_8468B6C[]; extern const struct mevent_cmd gMEventSrvScript_SendNews[];
extern const struct mevent_cmd gUnknown_8468BCC[]; extern const struct mevent_cmd gMEventSrvScript_SendCard[];
void mevent_client_do_init(void) void mevent_client_do_init(void)
{ {
@@ -98,7 +95,7 @@ static void mevent_client_send_word(struct mevent_client * svr, u32 ident, u32 w
static u32 ish_mainseq_0(struct mevent_client * svr) static u32 ish_mainseq_0(struct mevent_client * svr)
{ {
// init // init
memcpy(svr->cmdBuffer, gUnknown_84687E0, ME_SEND_BUF_SIZE); memcpy(svr->cmdBuffer, gMEVentClientScript_IntialListen, ME_SEND_BUF_SIZE);
svr->cmdidx = 0; svr->cmdidx = 0;
svr->mainseqno = 4; svr->mainseqno = 4;
svr->flag = 0; svr->flag = 0;
@@ -300,13 +297,13 @@ static u32 mevent_client_exec(struct mevent_client * svr)
void mevent_srv_init_wnews(void) void mevent_srv_init_wnews(void)
{ {
s_mevent_srv_common_ptr = AllocZeroed(sizeof(struct mevent_srv_common)); s_mevent_srv_common_ptr = AllocZeroed(sizeof(struct mevent_srv_common));
mevent_srv_init_common(s_mevent_srv_common_ptr, gUnknown_8468B6C, 0, 1); mevent_srv_init_common(s_mevent_srv_common_ptr, gMEventSrvScript_SendNews, 0, 1);
} }
void mevent_srv_new_wcard(void) void mevent_srv_new_wcard(void)
{ {
s_mevent_srv_common_ptr = AllocZeroed(sizeof(struct mevent_srv_common)); s_mevent_srv_common_ptr = AllocZeroed(sizeof(struct mevent_srv_common));
mevent_srv_init_common(s_mevent_srv_common_ptr, gUnknown_8468BCC, 0, 1); mevent_srv_init_common(s_mevent_srv_common_ptr, gMEventSrvScript_SendCard, 0, 1);
} }
u32 mevent_srv_common_do_exec(u16 * a0) u32 mevent_srv_common_do_exec(u16 * a0)
@@ -329,8 +326,8 @@ static void mevent_srv_init_common(struct mevent_srv_common * svr, const void *
{ {
svr->unk_00 = 0; svr->unk_00 = 0;
svr->mainseqno = 0; svr->mainseqno = 0;
svr->mevent_32e0 = AllocZeroed(sizeof(struct MEventBuffer_32E0_Sub)); svr->card = AllocZeroed(sizeof(struct MEventBuffer_32E0_Sub));
svr->mevent_3120 = AllocZeroed(sizeof(struct MEventBuffer_3120_Sub)); svr->news = AllocZeroed(sizeof(struct MEventBuffer_3120_Sub));
svr->recvBuffer = AllocZeroed(ME_SEND_BUF_SIZE); svr->recvBuffer = AllocZeroed(ME_SEND_BUF_SIZE);
svr->mevent_unk1442cc = AllocZeroed(sizeof(struct MEventStruct_Unk1442CC)); svr->mevent_unk1442cc = AllocZeroed(sizeof(struct MEventStruct_Unk1442CC));
svr->cmdBuffer = cmdBuffer; svr->cmdBuffer = cmdBuffer;
@@ -340,8 +337,8 @@ static void mevent_srv_init_common(struct mevent_srv_common * svr, const void *
static void mevent_srv_free_resources(struct mevent_srv_common * svr) static void mevent_srv_free_resources(struct mevent_srv_common * svr)
{ {
Free(svr->mevent_32e0); Free(svr->card);
Free(svr->mevent_3120); Free(svr->news);
Free(svr->recvBuffer); Free(svr->recvBuffer);
Free(svr->mevent_unk1442cc); Free(svr->mevent_unk1442cc);
} }
@@ -445,7 +442,7 @@ static u32 common_mainseq_4(struct mevent_srv_common * svr)
break; break;
case 7: case 7:
AGB_ASSERT_EX(cmd->flag == FALSE, "C:/WORK/POKeFRLG/src/pm_lgfr_ose/source/mevent_server.c", 396); AGB_ASSERT_EX(cmd->flag == FALSE, "C:/WORK/POKeFRLG/src/pm_lgfr_ose/source/mevent_server.c", 396);
ptr = mevent_first_if_not_null_else_second(cmd->parameter, svr->mevent_32e0); ptr = mevent_first_if_not_null_else_second(cmd->parameter, svr->card);
svr->param = sub_8144418(ptr, svr->mevent_unk1442cc, ptr); svr->param = sub_8144418(ptr, svr->mevent_unk1442cc, ptr);
break; break;
case 8: case 8:
@@ -472,11 +469,11 @@ static u32 common_mainseq_4(struct mevent_srv_common * svr)
break; break;
case 14: case 14:
AGB_ASSERT_EX(cmd->flag == FALSE, "C:/WORK/POKeFRLG/src/pm_lgfr_ose/source/mevent_server.c", 432); AGB_ASSERT_EX(cmd->flag == FALSE, "C:/WORK/POKeFRLG/src/pm_lgfr_ose/source/mevent_server.c", 432);
mevent_srv_common_init_send(svr, 0x17, mevent_first_if_not_null_else_second(cmd->parameter, svr->mevent_3120), sizeof(struct MEventBuffer_3120_Sub)); mevent_srv_common_init_send(svr, 0x17, mevent_first_if_not_null_else_second(cmd->parameter, svr->news), sizeof(struct MEventBuffer_3120_Sub));
break; break;
case 13: case 13:
AGB_ASSERT_EX(cmd->flag == FALSE, "C:/WORK/POKeFRLG/src/pm_lgfr_ose/source/mevent_server.c", 438); AGB_ASSERT_EX(cmd->flag == FALSE, "C:/WORK/POKeFRLG/src/pm_lgfr_ose/source/mevent_server.c", 438);
mevent_srv_common_init_send(svr, 0x16, mevent_first_if_not_null_else_second(cmd->parameter, svr->mevent_32e0), sizeof(struct MEventBuffer_32E0_Sub)); mevent_srv_common_init_send(svr, 0x16, mevent_first_if_not_null_else_second(cmd->parameter, svr->card), sizeof(struct MEventBuffer_32E0_Sub));
break; break;
case 16: case 16:
AGB_ASSERT_EX(cmd->flag == FALSE, "C:/WORK/POKeFRLG/src/pm_lgfr_ose/source/mevent_server.c", 444); AGB_ASSERT_EX(cmd->flag == FALSE, "C:/WORK/POKeFRLG/src/pm_lgfr_ose/source/mevent_server.c", 444);
@@ -506,11 +503,11 @@ static u32 common_mainseq_4(struct mevent_srv_common * svr)
break; break;
case 22: case 22:
AGB_ASSERT_EX(cmd->flag == FALSE, "C:/WORK/POKeFRLG/src/pm_lgfr_ose/source/mevent_server.c", 481); AGB_ASSERT_EX(cmd->flag == FALSE, "C:/WORK/POKeFRLG/src/pm_lgfr_ose/source/mevent_server.c", 481);
memcpy(svr->mevent_32e0, cmd->parameter, 332); memcpy(svr->card, cmd->parameter, 332);
break; break;
case 23: case 23:
AGB_ASSERT_EX(cmd->flag == FALSE, "C:/WORK/POKeFRLG/src/pm_lgfr_ose/source/mevent_server.c", 486); AGB_ASSERT_EX(cmd->flag == FALSE, "C:/WORK/POKeFRLG/src/pm_lgfr_ose/source/mevent_server.c", 486);
memcpy(svr->mevent_3120, cmd->parameter, 444); memcpy(svr->news, cmd->parameter, 444);
break; break;
case 21: case 21:
AGB_ASSERT_EX(cmd->flag == FALSE, "C:/WORK/POKeFRLG/src/pm_lgfr_ose/source/mevent_server.c", 491); AGB_ASSERT_EX(cmd->flag == FALSE, "C:/WORK/POKeFRLG/src/pm_lgfr_ose/source/mevent_server.c", 491);
@@ -526,12 +523,12 @@ static u32 common_mainseq_4(struct mevent_srv_common * svr)
break; break;
case 26: case 26:
AGB_ASSERT_EX(cmd->flag == FALSE && cmd->parameter == NULL, "C:/WORK/POKeFRLG/src/pm_lgfr_ose/source/mevent_server.c", 506); AGB_ASSERT_EX(cmd->flag == FALSE && cmd->parameter == NULL, "C:/WORK/POKeFRLG/src/pm_lgfr_ose/source/mevent_server.c", 506);
memcpy(svr->mevent_32e0, GetSavedWonderCard(), 332); memcpy(svr->card, GetSavedWonderCard(), 332);
sub_814410C(svr->mevent_32e0); sub_814410C(svr->card);
break; break;
case 27: case 27:
AGB_ASSERT_EX(cmd->flag == FALSE && cmd->parameter == NULL, "C:/WORK/POKeFRLG/src/pm_lgfr_ose/source/mevent_server.c", 512); AGB_ASSERT_EX(cmd->flag == FALSE && cmd->parameter == NULL, "C:/WORK/POKeFRLG/src/pm_lgfr_ose/source/mevent_server.c", 512);
memcpy(svr->mevent_3120, GetSavedWonderNews(), 444); memcpy(svr->news, GetSavedWonderNews(), 444);
break; break;
case 28: case 28:
AGB_ASSERT_EX(cmd->flag == FALSE && cmd->parameter == NULL, "C:/WORK/POKeFRLG/src/pm_lgfr_ose/source/mevent_server.c", 517); AGB_ASSERT_EX(cmd->flag == FALSE && cmd->parameter == NULL, "C:/WORK/POKeFRLG/src/pm_lgfr_ose/source/mevent_server.c", 517);
+2 -3
View File
@@ -1,6 +1,5 @@
#include "global.h" #include "global.h"
#include "palette.h" #include "palette.h"
#include "dma3.h"
#include "gpu_regs.h" #include "gpu_regs.h"
#include "bg.h" #include "bg.h"
#include "task.h" #include "task.h"
@@ -1095,7 +1094,7 @@ const u8 * mevent_message_stamp_card_etc_send_status(u32 * a0, u8 unused, u32 ms
return result; return result;
} }
bool32 PrintMGSendStatus(u8 * state, u16 * arg1, u8 arg2, u32 msgId) static bool32 PrintMGSendStatus(u8 * state, u16 * arg1, u8 arg2, u32 msgId)
{ {
u32 flag; u32 flag;
const u8 * str = mevent_message_stamp_card_etc_send_status(&flag, arg2, msgId); const u8 * str = mevent_message_stamp_card_etc_send_status(&flag, arg2, msgId);
@@ -1278,7 +1277,7 @@ void task00_mystery_gift(u8 taskId)
case 8: case 8:
switch (mevent_client_do_exec(&data->curPromptWindowId)) switch (mevent_client_do_exec(&data->curPromptWindowId))
{ {
case 6: case 6: // done
task_add_05_task_del_08FA224_when_no_RfuFunc(); task_add_05_task_del_08FA224_when_no_RfuFunc();
data->prevPromptWindowId = data->curPromptWindowId; data->prevPromptWindowId = data->curPromptWindowId;
data->state = 13; data->state = 13;