2021-10-17 09:00:48 +02:00
|
|
|
#ifndef GUARD_MYSTERY_GIFT_CLIENT_H
|
|
|
|
#define GUARD_MYSTERY_GIFT_CLIENT_H
|
2019-03-31 21:50:25 +02:00
|
|
|
|
2021-10-17 09:00:48 +02:00
|
|
|
#include "mystery_gift_link.h"
|
2019-04-02 17:43:29 +02:00
|
|
|
|
2021-10-14 21:36:51 +02:00
|
|
|
// Return values for client functions called by MysteryGiftClient_Run
|
|
|
|
enum {
|
|
|
|
CLI_RET_INIT,
|
2021-10-15 18:56:14 +02:00
|
|
|
CLI_RET_ACTIVE,
|
|
|
|
CLI_RET_YES_NO,
|
|
|
|
CLI_RET_PRINT_MSG,
|
2021-10-14 21:36:51 +02:00
|
|
|
CLI_RET_ASK_TOSS,
|
2021-10-15 18:56:14 +02:00
|
|
|
CLI_RET_COPY_MSG,
|
2021-10-14 21:36:51 +02:00
|
|
|
CLI_RET_END,
|
|
|
|
};
|
|
|
|
|
|
|
|
// IDs for client script instructions
|
|
|
|
enum {
|
|
|
|
CLI_NONE,
|
|
|
|
CLI_RETURN,
|
|
|
|
CLI_RECV,
|
|
|
|
CLI_SEND_LOADED,
|
|
|
|
CLI_COPY_RECV,
|
2021-10-15 18:56:14 +02:00
|
|
|
CLI_YES_NO,
|
2021-10-14 21:36:51 +02:00
|
|
|
CLI_COPY_RECV_IF_N,
|
|
|
|
CLI_COPY_RECV_IF,
|
2021-10-15 18:56:14 +02:00
|
|
|
CLI_LOAD_GAME_DATA,
|
|
|
|
CLI_SAVE_NEWS,
|
|
|
|
CLI_SAVE_CARD,
|
|
|
|
CLI_PRINT_MSG,
|
|
|
|
CLI_COPY_MSG,
|
2021-10-14 21:36:51 +02:00
|
|
|
CLI_ASK_TOSS,
|
|
|
|
CLI_LOAD_TOSS_RESPONSE,
|
2021-10-17 09:00:48 +02:00
|
|
|
CLI_RUN_MEVENT_SCRIPT,
|
2021-10-15 18:56:14 +02:00
|
|
|
CLI_SAVE_STAMP,
|
|
|
|
CLI_SAVE_RAM_SCRIPT,
|
2021-10-14 21:36:51 +02:00
|
|
|
CLI_RECV_EREADER_TRAINER,
|
|
|
|
CLI_SEND_STAT,
|
2021-10-15 18:56:14 +02:00
|
|
|
CLI_SEND_READY_END,
|
|
|
|
CLI_RUN_BUFFER_SCRIPT,
|
2021-10-14 21:36:51 +02:00
|
|
|
};
|
|
|
|
|
2021-10-15 18:56:14 +02:00
|
|
|
// IDs for client messages when ending a script.
|
|
|
|
// Given as the parameter to CLI_RETURN, and resolved to text in GetClientResultMessage
|
|
|
|
enum {
|
|
|
|
CLI_MSG_NOTHING_SENT,
|
|
|
|
CLI_MSG_RECORD_UPLOADED,
|
|
|
|
CLI_MSG_CARD_RECEIVED,
|
|
|
|
CLI_MSG_NEWS_RECEIVED,
|
|
|
|
CLI_MSG_STAMP_RECEIVED,
|
|
|
|
CLI_MSG_HAD_CARD,
|
|
|
|
CLI_MSG_HAD_STAMP,
|
|
|
|
CLI_MSG_HAD_NEWS,
|
|
|
|
CLI_MSG_NO_ROOM_STAMPS,
|
|
|
|
CLI_MSG_COMM_CANCELED,
|
|
|
|
CLI_MSG_CANT_ACCEPT,
|
|
|
|
CLI_MSG_COMM_ERROR,
|
|
|
|
CLI_MSG_TRAINER_RECEIVED,
|
|
|
|
CLI_MSG_BUFFER_SUCCESS,
|
|
|
|
CLI_MSG_BUFFER_FAILURE,
|
|
|
|
};
|
|
|
|
|
|
|
|
#define CLIENT_MAX_MSG_SIZE 64
|
|
|
|
|
2021-10-14 21:36:51 +02:00
|
|
|
struct MysteryGiftClientCmd
|
2019-04-02 17:43:29 +02:00
|
|
|
{
|
|
|
|
u32 instr;
|
|
|
|
u32 parameter;
|
|
|
|
};
|
|
|
|
|
2021-10-14 21:36:51 +02:00
|
|
|
struct MysteryGiftClient
|
2019-04-02 17:43:29 +02:00
|
|
|
{
|
2021-10-15 18:56:14 +02:00
|
|
|
u32 unused;
|
2019-04-02 17:43:29 +02:00
|
|
|
u32 param;
|
2021-10-14 21:36:51 +02:00
|
|
|
u32 funcId;
|
|
|
|
u32 funcState;
|
2019-04-02 17:43:29 +02:00
|
|
|
u32 cmdidx;
|
|
|
|
void * sendBuffer;
|
|
|
|
void * recvBuffer;
|
2021-10-15 18:56:14 +02:00
|
|
|
struct MysteryGiftClientCmd * script;
|
|
|
|
void * msg;
|
2021-10-14 21:36:51 +02:00
|
|
|
struct MysteryGiftLink link;
|
|
|
|
bool32 isWonderNews;
|
2019-04-02 17:43:29 +02:00
|
|
|
};
|
|
|
|
|
2021-10-14 21:36:51 +02:00
|
|
|
void MysteryGiftClient_Create(bool32 isWonderNews);
|
2021-10-15 18:56:14 +02:00
|
|
|
u32 MysteryGiftClient_Run(u16 * endVal);
|
2021-10-14 21:36:51 +02:00
|
|
|
void MysteryGiftClient_AdvanceState(void);
|
2021-10-15 18:56:14 +02:00
|
|
|
void * MysteryGiftClient_GetMsg(void);
|
2021-10-14 21:36:51 +02:00
|
|
|
void MysteryGiftClient_SetParam(u32 value);
|
2019-03-31 21:50:25 +02:00
|
|
|
|
2021-10-17 09:00:48 +02:00
|
|
|
#endif //GUARD_MYSTERY_GIFT_CLIENT_H
|