diff options
Diffstat (limited to 'data')
-rw-r--r-- | data/data_8466FB8.s | 12 | ||||
-rw-r--r-- | data/mevent/script_common.inc | 165 | ||||
-rw-r--r-- | data/mevent/script_ish.inc | 118 |
3 files changed, 153 insertions, 142 deletions
diff --git a/data/data_8466FB8.s b/data/data_8466FB8.s deleted file mode 100644 index 9436bc4fd..000000000 --- a/data/data_8466FB8.s +++ /dev/null @@ -1,12 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .section .rodata - - .align 2 -gUnknown_84687A0:: - .string "You have collected all STAMPs!\n" - .string "Want to input a CARD as a prize?$" - - .include "data/mevent/script_ish.inc" - .include "data/mevent/script_common.inc" diff --git a/data/mevent/script_common.inc b/data/mevent/script_common.inc index f3ca09e3d..e84a79ad3 100644 --- a/data/mevent/script_common.inc +++ b/data/mevent/script_common.inc @@ -1,87 +1,98 @@ -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) +const struct mevent_server_cmd gMEventSrvScript_UnableToSend[] = { + SRV_SEND(0x10, gMEventClientScript_UnableToRecv), + SRV_WAITSND, + SRV_RECV(0x14), + SRV_RETURN(0x0a) +}; - .4byte 0x12, 0x10, gMEventClientScript_CommError @ SEND - .4byte 0x01, 0x00, NULL @ WAIT SEND - .4byte 0x02, 0x14, NULL @ RECV - .4byte 0x00, 0x0b, NULL @ RETURN (comm error) + SRV_SEND(0x10, gMEventClientScript_CommError), + SRV_WAITSND, + SRV_RECV(0x14), + SRV_RETURN(0x0b) +}; - .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) + SRV_SEND(0x10, gMEventClientScript_OtherTrainerCanceled), + SRV_WAITSND, + SRV_RECV(0x14), + SRV_RETURN(0x09) +}; -gMEventSrvScript_OtherTrnHasNews:: - .4byte 0x12, 0x10, gMEventClientScript_AlreadyHadNews @ SEND - .4byte 0x01, 0x00, NULL @ WAIT SEND - .4byte 0x02, 0x14, NULL @ RECV - .4byte 0x00, 0x07, NULL @ RETURN (other trn has news) +const struct mevent_server_cmd gMEventSrvScript_OtherTrnHasNews[] = { + SRV_SEND(0x10, gMEventClientScript_AlreadyHadNews), + SRV_WAITSND, + SRV_RECV(0x14), + SRV_RETURN(0x07) +}; -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) +const struct mevent_server_cmd gMEventSrvScript_SentNewsSuccess[] = { + SRV_SEND(0x28, gMEventClientScript_ReceiveNewsAndValidate), + SRV_WAITSND, + SRV_SEND_NEWS, + SRV_WAITSND, + SRV_RECV(0x13), + SRV_READWORD, + SRV_BRANCHIF(0x01, gMEventSrvScript_OtherTrnHasNews), + SRV_SEND(0x10, gMEventClientScript_RecvNewsSuccess), + SRV_WAITSND, + SRV_RECV(0x14), + SRV_RETURN(0x03) +}; -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) +const struct mevent_server_cmd gMEventSrvScript_SendCardSuccess[] = { + SRV_SEND(0x30, gMEventClientScript_ReceiveCardAndReturnSuccess), + SRV_WAITSND, + SRV_SEND_CARD, + SRV_WAITSND, + SRV_BUFFER_SEND, + SRV_WAITSND, + SRV_RECV(0x14), + SRV_RETURN(0x02) +}; -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 +const struct mevent_server_cmd gMEventSrvScript_AskClientToOverwriteCard[] = { + SRV_SEND(0x28, gMEventClientScript_AskWouldLikeToTossCard), + SRV_WAITSND, + SRV_RECV(0x13), + SRV_READWORD, + SRV_BRANCHIF(0x00, gMEventSrvScript_SendCardSuccess), + SRV_BRANCH(gMEventSrvScript_OtherTrainerCanceled) +}; -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) +const struct mevent_server_cmd gMEventSrvScript_OtherTrnHasCard[] = { + SRV_SEND(0x10, gMEventClientScript_AlreadyHadCard), + SRV_WAITSND, + SRV_RECV(0x14), + SRV_RETURN(0x05) +}; - .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) + SRV_SEND(0x10, gMEventClientScript_NothingSentOver), + SRV_WAITSND, + SRV_RECV(0x14), + SRV_RETURN(0x00) +}; -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 +const struct mevent_server_cmd gMEventSrvScript_SendNews[] = { + SRV_BUFFER_NEWS, + SRV_SEND(0x20, gMEventClientScript_Send1442CC), + SRV_WAITSND, + SRV_RECV(0x11), + SRV_READ_1442CC, + SRV_VALID_1442CC, + SRV_BRANCHIF(0x00, gMEventSrvScript_UnableToSend), + SRV_BRANCH(gMEventSrvScript_SentNewsSuccess) +}; -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 +const struct mevent_server_cmd gMEventSrvScript_SendCard[] = { + SRV_BUFFER_CARD, + SRV_RAM_SCRIPT_IF_VALID, + SRV_SEND(0x20, gMEventClientScript_Send1442CC), + SRV_WAITSND, + SRV_RECV(0x11), + SRV_READ_1442CC, + SRV_VALID_1442CC, + SRV_BRANCHIF(0x00, gMEventSrvScript_UnableToSend), + SRV_CHECK_1442CC_14, + SRV_BRANCHIF(0x02, gMEventSrvScript_AskClientToOverwriteCard), + SRV_BRANCHIF(0x00, gMEventSrvScript_SendCardSuccess), + SRV_BRANCH(gMEventSrvScript_OtherTrnHasCard) +}; diff --git a/data/mevent/script_ish.inc b/data/mevent/script_ish.inc index ed6b639da..40f6a58cd 100644 --- a/data/mevent/script_ish.inc +++ b/data/mevent/script_ish.inc @@ -1,65 +1,77 @@ -gMEventClientScript_InotialListen:: @ 84687E0 - .4byte 0x02, 0x10 @ RECEIVE ID(0x10) - .4byte 0x04, 0x00 @ JUMP TO RECEIVE BUFFER +const struct mevent_client_cmd gMEventClientScript_InitialListen[] = { // 84687E0 + CLI_RECEIVE(0x10), + CLI_JUMPBUF +}; -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 +const struct mevent_client_cmd gMEventClientScript_Send1442CC[] = { + CLI_SNDHEAD, + CLI_WAITSND, + CLI_RECEIVE(0x10), + CLI_JUMPBUF +}; -gMEventClientScript_UnableToRecv:: @ can't accept card or news - .4byte 0x14, 0x00 @ SEND ALL - .4byte 0x01, 0x0a @ RETURN 0x0a +const struct mevent_client_cmd gMEventClientScript_UnableToRecv[] = { // can't accept card or news + CLI_SENDALL, + CLI_RETURN(0x0a) +}; -gMEventClientScript_CommError:: @ comm error - .4byte 0x14, 0x00 @ SEND ALL - .4byte 0x01, 0x0b @ RETURN 0x0b +const struct mevent_client_cmd gMEventClientScript_CommError[] = { // comm error + CLI_SENDALL, + CLI_RETURN(0x0b) +}; -gMEventClientScript_NothingSentOver:: @ nothing sent - .4byte 0x14, 0x00 @ SEND ALL - .4byte 0x01, 0x00 @ RETURN 0x00 +const struct mevent_client_cmd gMEventClientScript_NothingSentOver[] = { // nothing sent + CLI_SENDALL, + CLI_RETURN(0x00) +}; -gMEventClientScript_ReceiveCardAndReturnSuccess:: @ card success - .4byte 0x02, 0x16 @ RECEIVE ID(0x16) - .4byte 0x0a, 0x00 @ RECEIVE_TO_SAVE_FILE - .4byte 0x02, 0x19 @ RECEIVE ID(0x19) - .4byte 0x11, 0x00 @ RECEIVE_TO_RAM_SCRIPT - .4byte 0x14, 0x00 @ SEND ALL - .4byte 0x01, 0x02 @ RETURN 0x02 +const struct mevent_client_cmd gMEventClientScript_ReceiveCardAndReturnSuccess[] = { // card success + CLI_RECEIVE(0x16), + CLI_RECVSAV, + CLI_RECEIVE(0x19), + CLI_RECVRAM, + CLI_SENDALL, + CLI_RETURN(0x02) +}; -gMEventClientScript_ReceiveNewsAndValidate:: - .4byte 0x02, 0x17 @ RECEIVE ID(0x17) - .4byte 0x09, 0x00 @ VALIDATE NEWS - .4byte 0x03, 0x00 @ WAIT SEND - .4byte 0x02, 0x10 @ RECEIVE ID(0x10) - .4byte 0x04, 0x00 @ JUMP TO RECEIVE BUFFER +const struct mevent_client_cmd gMEventClientScript_ReceiveNewsAndValidate[] = { + CLI_RECEIVE(0x17), + CLI_VLDNEWS, + CLI_WAITSND, + CLI_RECEIVE(0x10), + CLI_JUMPBUF +}; -gMEventClientScript_AlreadyHadNews:: @ already had news - .4byte 0x14, 0x00 @ SEND ALL - .4byte 0x01, 0x07 @ RETURN 0x07 +const struct mevent_client_cmd gMEventClientScript_AlreadyHadNews[] = { // already had news + CLI_SENDALL, + CLI_RETURN(0x07) +}; -gMEventClientScript_RecvNewsSuccess:: @ news success - .4byte 0x14, 0x00 @ SEND ALL - .4byte 0x01, 0x03 @ RETURN 0x03 +const struct mevent_client_cmd gMEventClientScript_RecvNewsSuccess[] = { // news success + CLI_SENDALL, + CLI_RETURN(0x03) +}; -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 +const struct mevent_client_cmd gMEventClientScript_AskWouldLikeToTossCard[] = { + CLI_REQWORD, + CLI_SNDWORD, + CLI_WAITSND, + CLI_RECEIVE(0x10), + CLI_JUMPBUF +}; -gMEventClientScript_OtherTrainerCanceled:: @ comm canceled - .4byte 0x14, 0x00 @ SEND ALL - .4byte 0x01, 0x09 @ RETURN 0x09 +const struct mevent_client_cmd gMEventClientScript_OtherTrainerCanceled[] = { // comm canceled + CLI_SENDALL, + CLI_RETURN(0x09) +}; -gMEventClientScript_AlreadyHadCard:: @ already had card - .4byte 0x14, 0x00 @ SEND ALL - .4byte 0x01, 0x05 @ RETURN 0x05 +const struct mevent_client_cmd gMEventClientScript_AlreadyHadCard[] = { // already had card + CLI_SENDALL, + CLI_RETURN(0x05) +}; -gMEventClientScript_SuccessFromBuffer:: @ success from buffer - .4byte 0x02, 0x15 @ RECEIVE ID(0x15) - .4byte 0x0c, 0x00 @ READ PACKET AND COMPUTE SOMETHING - .4byte 0x14, 0x00 @ SEND ALL - .4byte 0x01, 0x0d @ RETURN 0x0d +const struct mevent_client_cmd gMEventClientScript_SuccessFromBuffer[] = { // success from buffer + CLI_RECEIVE(0x15), + CLI_RECVBUF, + CLI_SENDALL, + CLI_RETURN(0x0d) |