Merge pull request #142 from PikalaxALT/dism_more_data
Dism more data still
This commit is contained in:
-3442
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -3570,7 +3570,7 @@ _080FEED8:
|
||||
_080FEEE4: .4byte gSaveBlock1Ptr
|
||||
_080FEEE8: .4byte 0x00002cc4
|
||||
_080FEEEC:
|
||||
bl sub_8143DA8
|
||||
bl GetMEventProfileECWordsMaybe
|
||||
adds r1, r0, 0
|
||||
b _080FEF08
|
||||
_080FEEF4:
|
||||
|
||||
@@ -3339,7 +3339,7 @@ sub_81360D4: @ 81360D4
|
||||
bl GetMonData
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
bl sub_8043F90
|
||||
bl SpeciesToPokedexNum
|
||||
lsls r0, 16
|
||||
lsrs r4, r0, 16
|
||||
ldr r0, _08136110 @ =0x0000ffff
|
||||
|
||||
@@ -17,14 +17,14 @@ Special_HallOfFame: @ 80CA2E4
|
||||
lsrs r1, r0, 24
|
||||
cmp r1, 0x1
|
||||
bne _080CA30C
|
||||
ldr r0, _080CA308 @ =gUnknown_203AB44
|
||||
ldr r0, _080CA308 @ =gHasHallOfFameRecords
|
||||
strb r1, [r0]
|
||||
b _080CA318
|
||||
.align 2, 0
|
||||
_080CA304: .4byte 0x0000082c
|
||||
_080CA308: .4byte gUnknown_203AB44
|
||||
_080CA308: .4byte gHasHallOfFameRecords
|
||||
_080CA30C:
|
||||
ldr r1, _080CA3B0 @ =gUnknown_203AB44
|
||||
ldr r1, _080CA3B0 @ =gHasHallOfFameRecords
|
||||
movs r0, 0
|
||||
strb r0, [r1]
|
||||
adds r0, r4, 0
|
||||
@@ -99,7 +99,7 @@ _080CA39E:
|
||||
pop {r1}
|
||||
bx r1
|
||||
.align 2, 0
|
||||
_080CA3B0: .4byte gUnknown_203AB44
|
||||
_080CA3B0: .4byte gHasHallOfFameRecords
|
||||
_080CA3B4: .4byte gSaveBlock2Ptr
|
||||
_080CA3B8: .4byte gPlayerParty
|
||||
_080CA3BC: .4byte 0x0000083b
|
||||
|
||||
BIN
Binary file not shown.
+56
@@ -353,6 +353,62 @@ DEFENDING_TRAINER = FD 09
|
||||
ATTACKING_MON = FD 0C
|
||||
DEFENDING_MON = FD 0D
|
||||
|
||||
@ battle string placeholders
|
||||
|
||||
B_BUFF1 = FD 00
|
||||
B_BUFF2 = FD 01
|
||||
B_COPY_VAR_1 = FD 02
|
||||
B_COPY_VAR_2 = FD 03
|
||||
B_COPY_VAR_3 = FD 04
|
||||
B_PLAYER_MON1_NAME = FD 05
|
||||
B_OPPONENT_MON1_NAME = FD 06
|
||||
B_PLAYER_MON2_NAME = FD 07
|
||||
B_OPPONENT_MON2_NAME = FD 08
|
||||
B_LINK_PLAYER_MON1_NAME = FD 09
|
||||
B_LINK_OPPONENT_MON1_NAME = FD 0A
|
||||
B_LINK_PLAYER_MON2_NAME = FD 0B
|
||||
B_LINK_OPPONENT_MON2_NAME = FD 0C
|
||||
B_ATK_NAME_WITH_PREFIX_MON1 = FD 0D
|
||||
B_ATK_PARTNER_NAME = FD 0E
|
||||
B_ATK_NAME_WITH_PREFIX = FD 0F
|
||||
B_DEF_NAME_WITH_PREFIX = FD 10
|
||||
B_EFF_NAME_WITH_PREFIX = FD 11 @ EFF = short for gEffectBattler
|
||||
B_ACTIVE_NAME_WITH_PREFIX = FD 12
|
||||
B_SCR_ACTIVE_NAME_WITH_PREFIX = FD 13
|
||||
B_CURRENT_MOVE = FD 14
|
||||
B_LAST_MOVE = FD 15
|
||||
B_LAST_ITEM = FD 16
|
||||
B_LAST_ABILITY = FD 17
|
||||
B_ATK_ABILITY = FD 18
|
||||
B_DEF_ABILITY = FD 19
|
||||
B_SCR_ACTIVE_ABILITY = FD 1A
|
||||
B_EFF_ABILITY = FD 1B
|
||||
B_TRAINER1_CLASS = FD 1C
|
||||
B_TRAINER1_NAME = FD 1D
|
||||
B_LINK_PLAYER_NAME = FD 1E
|
||||
B_LINK_PARTNER_NAME = FD 1F
|
||||
B_LINK_OPPONENT1_NAME = FD 20
|
||||
B_LINK_OPPONENT2_NAME = FD 21
|
||||
B_LINK_SCR_TRAINER_NAME = FD 22
|
||||
B_PLAYER_NAME = FD 23
|
||||
B_TRAINER1_LOSE_TEXT = FD 24
|
||||
B_TRAINER1_WIN_TEXT = FD 25
|
||||
B_26 = FD 26
|
||||
B_PC_CREATOR_NAME = FD 27
|
||||
B_ATK_PREFIX1 = FD 28
|
||||
B_DEF_PREFIX1 = FD 29
|
||||
B_ATK_PREFIX2 = FD 2A
|
||||
B_DEF_PREFIX2 = FD 2B
|
||||
B_ATK_PREFIX3 = FD 2C
|
||||
B_DEF_PREFIX3 = FD 2D
|
||||
B_TRAINER2_CLASS = FD 2E
|
||||
B_TRAINER2_NAME = FD 2F
|
||||
B_TRAINER2_LOSE_TEXT = FD 30
|
||||
B_TRAINER2_WIN_TEXT = FD 31
|
||||
B_PARTNER_CLASS = FD 32
|
||||
B_PARTNER_NAME = FD 33
|
||||
B_BUFF3 = FD 34
|
||||
|
||||
@ indicates the end of a town/city name (before " TOWN" or " CITY")
|
||||
NAME_END = FC 00
|
||||
|
||||
|
||||
+455
-455
File diff suppressed because it is too large
Load Diff
@@ -1,43 +0,0 @@
|
||||
#include "constants/region_map.h"
|
||||
#include "constants/flags.h"
|
||||
#include "constants/moves.h"
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
.section .rodata
|
||||
.align 2
|
||||
|
||||
gUnknown_840C228:: @ 840C228
|
||||
.incbin "baserom.gba", 0x40C228, 0xC
|
||||
|
||||
gUnknown_840C234:: @ 840C234
|
||||
.incbin "baserom.gba", 0x40C234, 0x8
|
||||
|
||||
gUnknown_840C23C:: @ 840C23C
|
||||
.incbin "baserom.gba", 0x40C23C, 0x4
|
||||
|
||||
gUnknown_840C240:: @ 840C240
|
||||
.incbin "baserom.gba", 0x40C240, 0x8
|
||||
|
||||
gUnknown_840C248:: @ 840C248
|
||||
.incbin "baserom.gba", 0x40C248, 0x10
|
||||
|
||||
gUnknown_840C258:: @ 840C258
|
||||
.incbin "baserom.gba", 0x40C258, 0x10
|
||||
|
||||
gUnknown_840C268:: @ 840C268
|
||||
.incbin "baserom.gba", 0x40C268, 0x6
|
||||
|
||||
gUnknown_840C26E:: @ 840C26E
|
||||
.incbin "baserom.gba", 0x40C26E, 0x2A
|
||||
|
||||
gUnknown_840C298:: @ 840C298
|
||||
.incbin "baserom.gba", 0x40C298, 0xEC
|
||||
|
||||
gUnknown_840C384:: @ 840C384
|
||||
.incbin "baserom.gba", 0x40C384, 0x18
|
||||
|
||||
gUnknown_840C39C:: @ 840C39C
|
||||
.incbin "baserom.gba", 0x40C39C, 0x20
|
||||
|
||||
gUnknown_840C3BC:: @ 840C3BC
|
||||
.incbin "baserom.gba", 0x40C3BC, 0x1E8
|
||||
+18
-3
@@ -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)
|
||||
|
||||
@@ -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_AlreadyHadNews @ 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
|
||||
|
||||
+14
-14
@@ -1,26 +1,26 @@
|
||||
gUnknown_84687E0:: @ 84687E0
|
||||
gMEventClientScript_InotialListen:: @ 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_AlreadyHadNews:: @ 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 canceled
|
||||
.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
|
||||
|
||||
+9
-9
@@ -122,7 +122,7 @@ gUnknown_8415CD9:: @ 0x8415CD9
|
||||
gUnknown_8415CE0:: @ 0x8415CE0
|
||||
.string "ポケモンずかん$"
|
||||
|
||||
gUnknown_8415CE8:: @ 8415CE8
|
||||
gText_MainMenuTime:: @ 8415CE8
|
||||
.string "TIME$"
|
||||
|
||||
gUnknown_8415CED:: @ 0x8415CED
|
||||
@@ -330,7 +330,7 @@ gUnknown_8416002:: @ 8416002
|
||||
.string "PAGE$"
|
||||
|
||||
.align 2
|
||||
gUnknown_8416008:: @ 8416008
|
||||
gText_WelcomeToHOF:: @ 8416008
|
||||
.string "Welcome to the HALL OF FAME!$"
|
||||
|
||||
gUnknown_8416025:: @ 0x8416025
|
||||
@@ -346,31 +346,31 @@ gUnknown_8416067:: @ 0x8416067
|
||||
.string "でんげんを きらないでください$"
|
||||
|
||||
.align 2
|
||||
gUnknown_8416090:: @ 8416090
|
||||
gText_HOFCorrupted:: @ 8416090
|
||||
.string "The HALL OF FAME data is\n"
|
||||
.string "corrupted.$"
|
||||
|
||||
gUnknown_84160B4:: @ 84160B4
|
||||
gText_HOFNumber:: @ 84160B4
|
||||
.string "HALL OF FAME No. {STR_VAR_1}$"
|
||||
|
||||
gUnknown_84160C8:: @ 84160C8
|
||||
gText_LeagueChamp:: @ 84160C8
|
||||
.string "LEAGUE CHAMPION!\n"
|
||||
.string "CONGRATULATIONS!$"
|
||||
|
||||
.align 2
|
||||
gUnknown_84160EC:: @ 84160EC
|
||||
gText_Number:: @ 84160EC
|
||||
.string "No. $"
|
||||
|
||||
.align 2
|
||||
gUnknown_84160F4:: @ 84160F4
|
||||
gText_Level:: @ 84160F4
|
||||
.string "Lv. $"
|
||||
|
||||
.align 2
|
||||
gUnknown_84160FC:: @ 84160FC
|
||||
gText_Name:: @ 84160FC
|
||||
.string "NAME$"
|
||||
|
||||
.align 2
|
||||
gUnknown_8416104:: @ 8416104
|
||||
gText_IDNumber:: @ 8416104
|
||||
.string "IDNo.$"
|
||||
|
||||
gUnknown_841610A:: @ 0x841610A
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 481 B |
@@ -0,0 +1,6 @@
|
||||
#ifndef GUARD_CREDITS_H
|
||||
#define GUARD_CREDITS_H
|
||||
|
||||
extern bool8 gHasHallOfFameRecords;
|
||||
|
||||
#endif //GUARD_CREDITS_H
|
||||
+1
-1
@@ -34,7 +34,7 @@ void InitEasyChatPhrases(void);
|
||||
u8 *CopyEasyChatWord(u8 *dest, u16 word);
|
||||
u8 *ConvertEasyChatWordsToString(u8 *dest, const u16 *src, u16 length1, u16 length2);
|
||||
bool8 EC_DoesEasyChatStringFitOnLine(const u16 *easyChatWords, u8 columns, u8 rows, u16 maxLength);
|
||||
void ResetSomeMEventECBuffer_3120_338(void);
|
||||
void EC_ResetMEventProfileMaybe(void);
|
||||
void InitEasyChatPhrases(void);
|
||||
void EnableRareWord(u8);
|
||||
bool8 InitEasyChatSelection(void);
|
||||
|
||||
+11
-11
@@ -636,7 +636,7 @@ struct FameCheckerSaveData
|
||||
#define NUM_EASY_CHAT_EXTRA_PHRASES 33
|
||||
#define EASY_CHAT_EXTRA_PHRASES_SIZE ((NUM_EASY_CHAT_EXTRA_PHRASES >> 3) + (NUM_EASY_CHAT_EXTRA_PHRASES % 8 ? 1 : 0))
|
||||
|
||||
struct MEventBuffer_3120_Sub
|
||||
struct MEWonderNewsData
|
||||
{
|
||||
u16 unk_00;
|
||||
u8 unk_02;
|
||||
@@ -645,13 +645,13 @@ struct MEventBuffer_3120_Sub
|
||||
u8 unk_2C[10][40];
|
||||
};
|
||||
|
||||
struct MEventBuffer_3120
|
||||
struct MEWonderNewsStruct
|
||||
{
|
||||
u32 crc;
|
||||
struct MEventBuffer_3120_Sub data;
|
||||
struct MEWonderNewsData data;
|
||||
};
|
||||
|
||||
struct MEventBuffer_32E0_Sub
|
||||
struct MEWonderCardData
|
||||
{
|
||||
u16 unk_00;
|
||||
u16 unk_02;
|
||||
@@ -667,10 +667,10 @@ struct MEventBuffer_32E0_Sub
|
||||
u8 unk_122[40];
|
||||
};
|
||||
|
||||
struct MEventBuffer_32E0
|
||||
struct MEWonderCardStruct
|
||||
{
|
||||
u32 crc;
|
||||
struct MEventBuffer_32E0_Sub data;
|
||||
struct MEWonderCardData data;
|
||||
};
|
||||
|
||||
struct MEventBuffer_3430_Sub
|
||||
@@ -690,11 +690,11 @@ struct MEventBuffer_3430
|
||||
|
||||
struct MEventBuffers
|
||||
{
|
||||
/*0x000 0x3120*/ struct MEventBuffer_3120 buffer_000;
|
||||
/*0x1c0 0x32e0*/ struct MEventBuffer_32E0 buffer_1c0;
|
||||
/*0x000 0x3120*/ struct MEWonderNewsStruct menews;
|
||||
/*0x1c0 0x32e0*/ struct MEWonderCardStruct mecard;
|
||||
/*0x310 0x3430*/ struct MEventBuffer_3430 buffer_310;
|
||||
/*0x338 0x3458*/ u16 unk_338[4];
|
||||
/*0x340 0x3460*/ struct MENewsJisanStruct unk_340;
|
||||
/*0x338 0x3458*/ u16 ec_profile_maybe[4];
|
||||
/*0x340 0x3460*/ struct MENewsJisanStruct me_jisan;
|
||||
/*0x344 0x3464*/ u32 unk_344[2][5];
|
||||
}; // 0x36C 0x348C
|
||||
|
||||
@@ -766,7 +766,7 @@ struct SaveBlock1
|
||||
/*0x309C*/ u8 giftRibbons[52];
|
||||
/*0x30D0*/ struct Roamer roamer;
|
||||
/*0x30EC*/ struct EnigmaBerry enigmaBerry;
|
||||
/*0x3120*/ struct MEventBuffers unk_3120;
|
||||
/*0x3120*/ struct MEventBuffers mysteryEventBuffers;
|
||||
/*0x348C*/ u8 filler_348C[400];
|
||||
/*0x361C*/ struct RamScript ramScript;
|
||||
/*0x3A08*/ u8 filler3A08[12];
|
||||
|
||||
@@ -4226,4 +4226,7 @@ extern const u16 gTradeMenuMonBox_Tilemap[];
|
||||
extern const u16 gUnknown_8E9CBBC[];
|
||||
extern const u16 gUnknown_8E9CB9C[];
|
||||
|
||||
extern const u32 gFile_graphics_misc_confetti_sheet[];
|
||||
extern const u32 gFile_graphics_misc_confetti_palette[];
|
||||
|
||||
#endif //GUARD_GRAPHICS_H
|
||||
|
||||
@@ -7,7 +7,7 @@ void CB2_DoHallOfFameScreen(void);
|
||||
void CB2_DoHallOfFameScreenDontSaveData(void);
|
||||
void CB2_DoHallOfFamePC(void);
|
||||
void sub_8175280(void);
|
||||
void sub_80F2978(void);
|
||||
void CB2_InitHofPC(void);
|
||||
void HallOfFamePCBeginFade(void);
|
||||
void ReturnFromHallOfFamePC(void);
|
||||
|
||||
|
||||
+21
-21
@@ -3,22 +3,22 @@
|
||||
|
||||
#include "global.h"
|
||||
|
||||
struct MEventStruct_Unk1442CC
|
||||
struct MEventClientHeaderStruct
|
||||
{
|
||||
u32 unk_00;
|
||||
u16 unk_04;
|
||||
u32 unk_08;
|
||||
u16 unk_0C;
|
||||
u32 unk_10;
|
||||
u16 unk_14;
|
||||
u16 id;
|
||||
u16 unk_16[4];
|
||||
struct MEventBuffer_3430_Sub unk_20;
|
||||
u8 unk_44;
|
||||
u8 unk_45[7];
|
||||
u8 unk_4C[4];
|
||||
u16 unk_50[6];
|
||||
u8 unk_5C[4];
|
||||
u8 unk_60;
|
||||
u8 playerName[7];
|
||||
u8 playerTrainerId[4];
|
||||
u16 easyChatProfile[6];
|
||||
u8 gameCode[4];
|
||||
u8 version;
|
||||
};
|
||||
|
||||
struct MEvent_Str_1
|
||||
@@ -33,25 +33,25 @@ struct MEvent_Str_2
|
||||
u8 fill_00[0x40];
|
||||
};
|
||||
|
||||
struct MEventBuffer_3120_Sub * GetSavedWonderNews(void);
|
||||
struct MEventBuffer_32E0_Sub * GetSavedWonderCard(void);
|
||||
struct MEWonderNewsData * GetSavedWonderNews(void);
|
||||
struct MEWonderCardData * GetSavedWonderCard(void);
|
||||
struct MEventBuffer_3430_Sub * sav1_get_mevent_buffer_2(void);
|
||||
struct MENewsJisanStruct * GetMENewsJisanStructPtr(void);
|
||||
bool32 sub_8143DC8(const struct MEventBuffer_3120_Sub * src);
|
||||
bool32 sub_8143DC8(const struct MEWonderNewsData * src);
|
||||
bool32 ValidateReceivedWonderNews(void);
|
||||
bool32 ValidateReceivedWonderCard(void);
|
||||
bool32 sub_8143EF4(const u8 * src);
|
||||
bool32 sub_8143F68(const struct MEventBuffer_32E0_Sub * data);
|
||||
void sub_814410C(struct MEventBuffer_32E0_Sub * buffer);
|
||||
bool32 sub_8143F68(const struct MEWonderCardData * data);
|
||||
void sub_814410C(struct MEWonderCardData * buffer);
|
||||
bool32 sub_8144254(const u16 * data);
|
||||
void sub_81442CC(struct MEventStruct_Unk1442CC * data);
|
||||
bool32 sub_81443D4(const struct MEventStruct_Unk1442CC * data);
|
||||
u32 sub_8144418(const u16 * a0, const struct MEventStruct_Unk1442CC * a1, void * unused);
|
||||
u32 sub_8144434(const u16 * a0, const struct MEventStruct_Unk1442CC * a1, void * unused);
|
||||
bool32 sub_8144474(const struct MEventStruct_Unk1442CC * a0, const u16 * a1);
|
||||
u16 sub_81444B0(const struct MEventStruct_Unk1442CC * a0, u32 command);
|
||||
bool32 InitWonderCardResources(struct MEventBuffer_32E0_Sub * r5, struct MEventBuffer_3430_Sub * r6);
|
||||
bool32 InitWonderNewsResources(const struct MEventBuffer_3120_Sub * a0);
|
||||
void BuildMEventClientHeader(struct MEventClientHeaderStruct * data);
|
||||
bool32 ValidateMEventClientHeader(const struct MEventClientHeaderStruct * data);
|
||||
u32 sub_8144418(const u16 * a0, const struct MEventClientHeaderStruct * a1, void * unused);
|
||||
u32 sub_8144434(const u16 * a0, const struct MEventClientHeaderStruct * a1, void * unused);
|
||||
bool32 sub_8144474(const struct MEventClientHeaderStruct * a0, const u16 * a1);
|
||||
u16 sub_81444B0(const struct MEventClientHeaderStruct * a0, u32 command);
|
||||
bool32 InitWonderCardResources(struct MEWonderCardData * r5, struct MEventBuffer_3430_Sub * r6);
|
||||
bool32 InitWonderNewsResources(const struct MEWonderNewsData * a0);
|
||||
s32 FadeToWonderCardMenu(void);
|
||||
s32 FadeToWonderNewsMenu(void);
|
||||
void DestroyWonderCard(void);
|
||||
@@ -69,6 +69,6 @@ u32 MENews_GetInput(u16 input);
|
||||
void sub_8143D24(void);
|
||||
u16 sub_81445C0(u32 command);
|
||||
void sub_8144714(u32 a0, u32 a1);
|
||||
u16 *sub_8143DA8(void);
|
||||
u16 *GetMEventProfileECWordsMaybe(void);
|
||||
|
||||
#endif //GUARD_MEVENT_H
|
||||
|
||||
@@ -31,7 +31,7 @@ struct send_recv_header
|
||||
u16 size;
|
||||
};
|
||||
|
||||
struct mevent_cmd_ish
|
||||
struct mevent_client_cmd
|
||||
{
|
||||
u32 instr;
|
||||
u32 parameter;
|
||||
@@ -46,12 +46,12 @@ struct mevent_client
|
||||
u32 cmdidx;
|
||||
void * sendBuffer;
|
||||
void * recvBuffer;
|
||||
struct mevent_cmd_ish * cmdBuffer;
|
||||
struct mevent_client_cmd * cmdBuffer;
|
||||
void * buffer;
|
||||
struct mevent_srv_sub manager;
|
||||
};
|
||||
|
||||
struct mevent_cmd
|
||||
struct mevent_server_cmd
|
||||
{
|
||||
u32 instr;
|
||||
bool32 flag;
|
||||
@@ -64,11 +64,11 @@ struct mevent_srv_common
|
||||
u32 param;
|
||||
u32 mainseqno;
|
||||
u32 cmdidx;
|
||||
const struct mevent_cmd * cmdBuffer;
|
||||
const struct mevent_server_cmd * cmdBuffer;
|
||||
void * recvBuffer;
|
||||
struct MEventBuffer_32E0_Sub * mevent_32e0;
|
||||
struct MEventBuffer_3120_Sub * mevent_3120;
|
||||
struct MEventStruct_Unk1442CC * mevent_unk1442cc;
|
||||
struct MEWonderCardData * card;
|
||||
struct MEWonderNewsData * news;
|
||||
struct MEventClientHeaderStruct * mevent_unk1442cc;
|
||||
void * sendBuffer1;
|
||||
u32 sendBuffer1Size;
|
||||
void * sendBuffer2;
|
||||
|
||||
@@ -7,7 +7,7 @@ u32 RunMysteryEventScript(u8 *);
|
||||
void SetMysteryEventScriptStatus(u32 val);
|
||||
u16 GetRecordMixingGift(void);
|
||||
|
||||
void sub_80DA89C(u8 *);
|
||||
bool32 sub_80DA8B0(u32 *);
|
||||
void MEventScript_InitContext(u8 *);
|
||||
bool32 MEventScript_Run(u32 *);
|
||||
|
||||
#endif // GUARD_MYSTERY_EVENT_SCRIPT_H
|
||||
|
||||
+1
-1
@@ -609,7 +609,7 @@ u32 CanMonLearnTMHM(struct Pokemon *mon, u8 tm);
|
||||
u8 GetMoveRelearnerMoves(struct Pokemon *mon, u16 *moves);
|
||||
u8 GetLevelUpMovesBySpecies(u16 species, u16 *moves);
|
||||
u8 GetNumberOfRelearnableMoves(struct Pokemon *mon);
|
||||
u16 sub_8043F90(u16 species);
|
||||
u16 SpeciesToPokedexNum(u16 species);
|
||||
void ClearBattleMonForms(void);
|
||||
void PlayBattleBGM(void);
|
||||
void PlayMapChosenOrBattleBGM(u16 songId);
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
// Exported ROM declarations
|
||||
|
||||
void sub_8079B7C(void);
|
||||
void ResetSaveHeap(void);
|
||||
|
||||
#endif //GUARD_RESET_SAVE_HEAP_H
|
||||
|
||||
|
||||
+6
-12
@@ -54,6 +54,11 @@ struct SaveSectionOffsets
|
||||
|
||||
#define UNKNOWN_CHECK_VALUE 0x8012025
|
||||
|
||||
#define SECTOR_SAVE1(n) (n)
|
||||
#define SECTOR_SAVE2(n) ((n) + NUM_SECTORS_PER_SAVE_SLOT)
|
||||
#define SECTOR_HOF(n) ((n) + 2 * NUM_SECTORS_PER_SAVE_SLOT)
|
||||
#define SECTOR_TTOWER(n) ((n) + 2 * NUM_SECTORS_PER_SAVE_SLOT + 2)
|
||||
|
||||
// SetSectorDamagedStatus states
|
||||
enum
|
||||
{
|
||||
@@ -62,17 +67,6 @@ enum
|
||||
CHECK // unused
|
||||
};
|
||||
|
||||
// Do save types
|
||||
enum
|
||||
{
|
||||
NORMAL_SAVE,
|
||||
LINK_SAVE,
|
||||
EREADER_SAVE,
|
||||
HOF_SAVE,
|
||||
DIFFERENT_FILE_SAVE,
|
||||
HOF_DELETE_SAVE // unused
|
||||
};
|
||||
|
||||
extern u16 gFirstSaveSector;
|
||||
extern u32 gPrevSaveCounter;
|
||||
extern u16 gLastKnownGoodSector;
|
||||
@@ -117,7 +111,7 @@ u8 sub_80DA40C(void);
|
||||
u8 sub_80DA434(void);
|
||||
u8 sub_80DA45C(void);
|
||||
bool8 sub_80DA4A0(void);
|
||||
u8 Save_LoadGameData(u8 a1);
|
||||
u8 Save_LoadGameData(u8 saveType);
|
||||
u32 TryCopySpecialSaveSection(u8 sector, u8* dst);
|
||||
u32 sub_8153634(u8 sector, u8* src);
|
||||
void sub_8153688(u8 taskId);
|
||||
|
||||
+1
-1
@@ -63,7 +63,7 @@ bool32 sub_80991F8(void);
|
||||
u8 *sub_8099244(void);
|
||||
void sub_80992A0(u8 *script, u16 scriptSize);
|
||||
bool32 sub_8069DFC(void);
|
||||
void sub_8069EA4(u8 * script, u16 scriptSize);
|
||||
void MEventSetRamScript(u8 * script, u16 scriptSize);
|
||||
u8 * sub_8069E48(void);
|
||||
void sub_8069998(u8 var);
|
||||
void sub_80699F8(void);
|
||||
|
||||
@@ -710,4 +710,18 @@ extern const u8 gEasyChatGroupName_TrendySaying[];
|
||||
extern const u8 gEasyChatGroupName_Pokemon2[];
|
||||
extern const u8 gText_ThreeQuestionMarks[];
|
||||
|
||||
// hall_of_fame
|
||||
extern const u8 gText_LeagueChamp[];
|
||||
extern const u8 gText_HOFNumber[];
|
||||
extern const u8 gText_UPDOWNPick_ABUTTONBBUTTONCancel[];
|
||||
extern const u8 gText_UPDOWNPick_ABUTTONNext_BBUTTONBack[];
|
||||
extern const u8 gText_ABUTTONExit[];
|
||||
extern const u8 gText_HOFCorrupted[];
|
||||
extern const u8 gText_WelcomeToHOF[];
|
||||
extern const u8 gText_Number[];
|
||||
extern const u8 gText_Level[];
|
||||
extern const u8 gText_IDNumber[];
|
||||
extern const u8 gText_Name[];
|
||||
extern const u8 gText_MainMenuTime[];
|
||||
|
||||
#endif //GUARD_STRINGS_H
|
||||
|
||||
@@ -12,6 +12,7 @@ u16 sub_818D8F0(u16 spriteId);
|
||||
u16 sub_818D938(u16 species, bool8 isFrontPic, u16 destX, u16 destY, u8 paletteSlot, u8 windowId);
|
||||
u8 sub_818D97C(u8 a0, u8 a1);
|
||||
u16 CreateTrainerPicSprite(u16 species, bool8 isFrontPic, s16 x, s16 y, u8 paletteSlot, u16 paletteTag);
|
||||
u16 FreeAndDestroyMonPicSprite(u16);
|
||||
u16 FreeAndDestroyTrainerPicSprite(u16);
|
||||
u16 PlayerGenderToFrontTrainerPicId_Debug(u8 gender, bool8 getClass);
|
||||
u16 CreateMonPicSprite_HandleDeoxys(u16 species, u32 otId, u32 personality, bool8 isFrontPic, s16 x, s16 y, u8 paletteSlot, u16 paletteTag);
|
||||
|
||||
+4
-2
@@ -213,7 +213,7 @@ SECTIONS {
|
||||
src/player_pc.o(.text);
|
||||
src/intro.o(.text);
|
||||
asm/battle_anim_special.o(.text);
|
||||
asm/hall_of_fame.o(.text);
|
||||
src/hall_of_fame.o(.text);
|
||||
src/credits.o(.text);
|
||||
src/diploma.o(.text);
|
||||
asm/save_failed_screen.o(.text);
|
||||
@@ -261,6 +261,7 @@ SECTIONS {
|
||||
src/mystery_gift_menu.o(.text);
|
||||
src/mevent.o(.text);
|
||||
src/mevent_server_helpers.o(.text);
|
||||
src/mevent_client.o(.text);
|
||||
src/mevent_server.o(.text);
|
||||
src/mevent_8145654.o(.text);
|
||||
src/menews_jisan.o(.text);
|
||||
@@ -483,7 +484,7 @@ SECTIONS {
|
||||
src/player_pc.o(.rodata);
|
||||
src/intro.o(.rodata);
|
||||
data/battle_anim_special.o(.rodata);
|
||||
data/hall_of_fame.o(.rodata);
|
||||
src/hall_of_fame.o(.rodata);
|
||||
src/credits.o(.rodata);
|
||||
src/diploma.o(.rodata);
|
||||
data/strings.o(.rodata);
|
||||
@@ -532,6 +533,7 @@ SECTIONS {
|
||||
src/mystery_gift_menu.o(.rodata);
|
||||
src/mevent.o(.rodata);
|
||||
src/mevent_server_helpers.o(.rodata);
|
||||
src/mevent_client.o(.rodata);
|
||||
src/mevent_server.o(.rodata);
|
||||
src/mevent_8145654.o(.rodata);
|
||||
data/data_8466FB8.o(.rodata);
|
||||
|
||||
+4
-4
@@ -47,11 +47,11 @@ static bool32 CEReaderTool_SaveTrainerTower_r(struct EReaderTrainerHillSet * ttd
|
||||
memset(buffer, 0, 0x1000);
|
||||
memcpy(buffer, ttdata, SEC30_SIZE);
|
||||
buffer[1] = sub_815D654();
|
||||
if (TryWriteSpecialSaveSection(30, buffer) != TRUE)
|
||||
if (TryWriteSpecialSaveSection(SECTOR_TTOWER(0), buffer) != TRUE)
|
||||
return FALSE;
|
||||
memset(buffer, 0, 0x1000);
|
||||
memcpy(buffer, (u8 *)ttdata + SEC30_SIZE, SEC31_SIZE);
|
||||
if (TryWriteSpecialSaveSection(31, buffer) != TRUE)
|
||||
if (TryWriteSpecialSaveSection(SECTOR_TTOWER(1), buffer) != TRUE)
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
@@ -66,11 +66,11 @@ bool32 CEReaderTool_SaveTrainerTower(struct EReaderTrainerHillSet * ttdata)
|
||||
|
||||
static bool32 CEReaderTool_LoadTrainerTower_r(struct EReaderTrainerHillSet * ttdata, void * buffer)
|
||||
{
|
||||
if (TryCopySpecialSaveSection(30, buffer) != 1)
|
||||
if (TryCopySpecialSaveSection(SECTOR_TTOWER(0), buffer) != 1)
|
||||
return FALSE;
|
||||
memcpy(ttdata + 0x000, buffer, SEC30_SIZE);
|
||||
|
||||
if (TryCopySpecialSaveSection(31, buffer) != 1)
|
||||
if (TryCopySpecialSaveSection(SECTOR_TTOWER(1), buffer) != 1)
|
||||
return FALSE;
|
||||
memcpy((u8 *)ttdata + SEC30_SIZE, buffer, SEC31_SIZE);
|
||||
|
||||
|
||||
@@ -188,6 +188,7 @@ struct CreditsTaskData
|
||||
};
|
||||
|
||||
static EWRAM_DATA struct CreditsResources * sCreditsMgr = NULL;
|
||||
EWRAM_DATA bool8 gHasHallOfFameRecords = FALSE;
|
||||
|
||||
static void CB2_Credits(void);
|
||||
static s32 RollCredits(void);
|
||||
|
||||
+2
-2
@@ -485,10 +485,10 @@ void InitEasyChatPhrases(void)
|
||||
gSaveBlock1Ptr->additionalPhrases[i] = 0;
|
||||
}
|
||||
|
||||
void ResetSomeMEventECBuffer_3120_338(void)
|
||||
void EC_ResetMEventProfileMaybe(void)
|
||||
{
|
||||
s32 i;
|
||||
u16 *ptr = sub_8143DA8();
|
||||
u16 *ptr = GetMEventProfileECWordsMaybe();
|
||||
for (i = 0; i < 4; i++)
|
||||
ptr[i] = EC_WORD_UNDEFINED;
|
||||
}
|
||||
|
||||
+1293
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -19,7 +19,7 @@ static void Task_WaitFadeAndSetCallback(u8 taskId)
|
||||
FreeAllWindowBuffers();
|
||||
ResetBgsAndClearDma3BusyFlags(0);
|
||||
DestroyTask(taskId);
|
||||
SetMainCallback2(sub_80F2978);
|
||||
SetMainCallback2(CB2_InitHofPC);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -574,7 +574,7 @@ void c2_copyright_1(void)
|
||||
{
|
||||
ResetMenuAndMonGlobals();
|
||||
Save_ResetSaveCounters();
|
||||
Save_LoadGameData(0);
|
||||
Save_LoadGameData(SAVE_NORMAL);
|
||||
if (gSaveFileStatus == SAVE_STATUS_EMPTY || gSaveFileStatus == SAVE_STATUS_INVALID)
|
||||
Sav2_ClearSetDefault();
|
||||
SetPokemonCryStereo(gSaveBlock2Ptr->optionsSound);
|
||||
|
||||
+2
-2
@@ -464,7 +464,7 @@ void LinkTestProcessKeyInput(void)
|
||||
}
|
||||
if (JOY_NEW(R_BUTTON))
|
||||
{
|
||||
TrySavingData(1);
|
||||
TrySavingData(SAVE_LINK);
|
||||
}
|
||||
if (JOY_NEW(SELECT_BUTTON))
|
||||
{
|
||||
@@ -1581,7 +1581,7 @@ static void CB2_PrintErrorMessage(void)
|
||||
PlaySE(SE_PIN);
|
||||
gWirelessCommType = 0;
|
||||
sLinkErrorBuffer.unk_06 = 0;
|
||||
sub_8079B7C();
|
||||
ResetSaveHeap();
|
||||
}
|
||||
}
|
||||
else if (gWirelessCommType == 2)
|
||||
|
||||
+98
-90
@@ -39,12 +39,12 @@ struct MEventTaskData1
|
||||
};
|
||||
|
||||
void sub_8143910(u8 taskId);
|
||||
bool32 sub_8143E64(const struct MEventBuffer_3120_Sub * src);
|
||||
bool32 sub_8143E64(const struct MEWonderNewsData * src);
|
||||
void sub_8143E9C(void);
|
||||
void sub_8143ED0(void);
|
||||
bool32 sub_8144018(const struct MEventBuffer_32E0_Sub * src);
|
||||
void sub_814407C(void);
|
||||
void sub_81440B4(void);
|
||||
bool32 sub_8144018(const struct MEWonderCardData * src);
|
||||
void BlankSavedWonderCard(void);
|
||||
void BlankMEventBuffer2(void);
|
||||
void sub_8144824(u32, u32, u32 *, s32);
|
||||
void sub_8144790(void);
|
||||
|
||||
@@ -485,34 +485,34 @@ void sub_8143910(u8 taskId)
|
||||
|
||||
void sub_8143D24(void)
|
||||
{
|
||||
CpuFill32(0, &gSaveBlock1Ptr->unk_3120, sizeof(gSaveBlock1Ptr->unk_3120));
|
||||
CpuFill32(0, &gSaveBlock1Ptr->mysteryEventBuffers, sizeof(gSaveBlock1Ptr->mysteryEventBuffers));
|
||||
sub_8143ED0();
|
||||
ResetSomeMEventECBuffer_3120_338();
|
||||
EC_ResetMEventProfileMaybe();
|
||||
}
|
||||
|
||||
struct MEventBuffer_3120_Sub * GetSavedWonderNews(void)
|
||||
struct MEWonderNewsData * GetSavedWonderNews(void)
|
||||
{
|
||||
return &gSaveBlock1Ptr->unk_3120.buffer_000.data;
|
||||
return &gSaveBlock1Ptr->mysteryEventBuffers.menews.data;
|
||||
}
|
||||
|
||||
struct MEventBuffer_32E0_Sub * GetSavedWonderCard(void)
|
||||
struct MEWonderCardData * GetSavedWonderCard(void)
|
||||
{
|
||||
return &gSaveBlock1Ptr->unk_3120.buffer_1c0.data;
|
||||
return &gSaveBlock1Ptr->mysteryEventBuffers.mecard.data;
|
||||
}
|
||||
|
||||
struct MEventBuffer_3430_Sub * sav1_get_mevent_buffer_2(void)
|
||||
{
|
||||
return &gSaveBlock1Ptr->unk_3120.buffer_310.data;
|
||||
return &gSaveBlock1Ptr->mysteryEventBuffers.buffer_310.data;
|
||||
}
|
||||
|
||||
struct MENewsJisanStruct * GetMENewsJisanStructPtr(void)
|
||||
{
|
||||
return &gSaveBlock1Ptr->unk_3120.unk_340;
|
||||
return &gSaveBlock1Ptr->mysteryEventBuffers.me_jisan;
|
||||
}
|
||||
|
||||
u16 * sub_8143DA8(void)
|
||||
u16 * GetMEventProfileECWordsMaybe(void)
|
||||
{
|
||||
return gSaveBlock1Ptr->unk_3120.unk_338;
|
||||
return gSaveBlock1Ptr->mysteryEventBuffers.ec_profile_maybe;
|
||||
}
|
||||
|
||||
void DestroyWonderNews(void)
|
||||
@@ -520,26 +520,26 @@ void DestroyWonderNews(void)
|
||||
sub_8143E9C();
|
||||
}
|
||||
|
||||
bool32 sub_8143DC8(const struct MEventBuffer_3120_Sub * src)
|
||||
bool32 sub_8143DC8(const struct MEWonderNewsData * src)
|
||||
{
|
||||
if (!sub_8143E64(src))
|
||||
return FALSE;
|
||||
sub_8143E9C();
|
||||
gSaveBlock1Ptr->unk_3120.buffer_000.data = *src;
|
||||
gSaveBlock1Ptr->unk_3120.buffer_000.crc = CalcCRC16WithTable((void *)&gSaveBlock1Ptr->unk_3120.buffer_000.data, sizeof(struct MEventBuffer_3120_Sub));
|
||||
gSaveBlock1Ptr->mysteryEventBuffers.menews.data = *src;
|
||||
gSaveBlock1Ptr->mysteryEventBuffers.menews.crc = CalcCRC16WithTable((void *)&gSaveBlock1Ptr->mysteryEventBuffers.menews.data, sizeof(struct MEWonderNewsData));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool32 ValidateReceivedWonderNews(void)
|
||||
{
|
||||
if (CalcCRC16WithTable((void *)&gSaveBlock1Ptr->unk_3120.buffer_000.data, sizeof(struct MEventBuffer_3120_Sub)) != gSaveBlock1Ptr->unk_3120.buffer_000.crc)
|
||||
if (CalcCRC16WithTable((void *)&gSaveBlock1Ptr->mysteryEventBuffers.menews.data, sizeof(struct MEWonderNewsData)) != gSaveBlock1Ptr->mysteryEventBuffers.menews.crc)
|
||||
return FALSE;
|
||||
if (!sub_8143E64(&gSaveBlock1Ptr->unk_3120.buffer_000.data))
|
||||
if (!sub_8143E64(&gSaveBlock1Ptr->mysteryEventBuffers.menews.data))
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool32 sub_8143E64(const struct MEventBuffer_3120_Sub * data)
|
||||
bool32 sub_8143E64(const struct MEWonderNewsData * data)
|
||||
{
|
||||
if (data->unk_00 == 0)
|
||||
return FALSE;
|
||||
@@ -548,7 +548,7 @@ bool32 sub_8143E64(const struct MEventBuffer_3120_Sub * data)
|
||||
|
||||
bool32 WonderNews_Test_Unk_02(void)
|
||||
{
|
||||
const struct MEventBuffer_3120_Sub * data = &gSaveBlock1Ptr->unk_3120.buffer_000.data;
|
||||
const struct MEWonderNewsData * data = &gSaveBlock1Ptr->mysteryEventBuffers.menews.data;
|
||||
if (data->unk_02 == 0)
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
@@ -556,8 +556,8 @@ bool32 WonderNews_Test_Unk_02(void)
|
||||
|
||||
void sub_8143E9C(void)
|
||||
{
|
||||
CpuFill32(0, GetSavedWonderNews(), sizeof(gSaveBlock1Ptr->unk_3120.buffer_000.data));
|
||||
gSaveBlock1Ptr->unk_3120.buffer_000.crc = 0;
|
||||
CpuFill32(0, GetSavedWonderNews(), sizeof(gSaveBlock1Ptr->mysteryEventBuffers.menews.data));
|
||||
gSaveBlock1Ptr->mysteryEventBuffers.menews.crc = 0;
|
||||
}
|
||||
|
||||
void sub_8143ED0(void)
|
||||
@@ -568,11 +568,11 @@ void sub_8143ED0(void)
|
||||
|
||||
bool32 sub_8143EF4(const u8 * src)
|
||||
{
|
||||
const u8 * r5 = (const u8 *)&gSaveBlock1Ptr->unk_3120.buffer_000.data;
|
||||
const u8 * r5 = (const u8 *)&gSaveBlock1Ptr->mysteryEventBuffers.menews.data;
|
||||
u32 i;
|
||||
if (!ValidateReceivedWonderNews())
|
||||
return FALSE;
|
||||
for (i = 0; i < sizeof(struct MEventBuffer_3120_Sub); i++)
|
||||
for (i = 0; i < sizeof(struct MEWonderNewsData); i++)
|
||||
{
|
||||
if (r5[i] != src[i])
|
||||
return FALSE;
|
||||
@@ -582,8 +582,8 @@ bool32 sub_8143EF4(const u8 * src)
|
||||
|
||||
void DestroyWonderCard(void)
|
||||
{
|
||||
sub_814407C();
|
||||
sub_81440B4();
|
||||
BlankSavedWonderCard();
|
||||
BlankMEventBuffer2();
|
||||
sub_8144790();
|
||||
ClearRamScript();
|
||||
sub_806E2D0();
|
||||
@@ -591,33 +591,33 @@ void DestroyWonderCard(void)
|
||||
sub_80E7524(&gSaveBlock2Ptr->unk_B0.field_3F0);
|
||||
}
|
||||
|
||||
bool32 sub_8143F68(const struct MEventBuffer_32E0_Sub * data)
|
||||
bool32 sub_8143F68(const struct MEWonderCardData * data)
|
||||
{
|
||||
struct MEventBuffer_3430_Sub * r2;
|
||||
struct MEventBuffer_32E0_Sub * r1;
|
||||
struct MEWonderCardData * r1;
|
||||
if (!sub_8144018(data))
|
||||
return FALSE;
|
||||
DestroyWonderCard();
|
||||
memcpy(&gSaveBlock1Ptr->unk_3120.buffer_1c0.data, data, sizeof(struct MEventBuffer_32E0_Sub));
|
||||
gSaveBlock1Ptr->unk_3120.buffer_1c0.crc = CalcCRC16WithTable((void *)&gSaveBlock1Ptr->unk_3120.buffer_1c0.data, sizeof(struct MEventBuffer_32E0_Sub));
|
||||
r2 = &gSaveBlock1Ptr->unk_3120.buffer_310.data;
|
||||
r1 = &gSaveBlock1Ptr->unk_3120.buffer_1c0.data;
|
||||
memcpy(&gSaveBlock1Ptr->mysteryEventBuffers.mecard.data, data, sizeof(struct MEWonderCardData));
|
||||
gSaveBlock1Ptr->mysteryEventBuffers.mecard.crc = CalcCRC16WithTable((void *)&gSaveBlock1Ptr->mysteryEventBuffers.mecard.data, sizeof(struct MEWonderCardData));
|
||||
r2 = &gSaveBlock1Ptr->mysteryEventBuffers.buffer_310.data;
|
||||
r1 = &gSaveBlock1Ptr->mysteryEventBuffers.mecard.data;
|
||||
r2->unk_06 = r1->unk_02;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool32 ValidateReceivedWonderCard(void)
|
||||
{
|
||||
if (gSaveBlock1Ptr->unk_3120.buffer_1c0.crc != CalcCRC16WithTable((void *)&gSaveBlock1Ptr->unk_3120.buffer_1c0.data, sizeof(struct MEventBuffer_32E0_Sub)))
|
||||
if (gSaveBlock1Ptr->mysteryEventBuffers.mecard.crc != CalcCRC16WithTable((void *)&gSaveBlock1Ptr->mysteryEventBuffers.mecard.data, sizeof(struct MEWonderCardData)))
|
||||
return FALSE;
|
||||
if (!sub_8144018(&gSaveBlock1Ptr->unk_3120.buffer_1c0.data))
|
||||
if (!sub_8144018(&gSaveBlock1Ptr->mysteryEventBuffers.mecard.data))
|
||||
return FALSE;
|
||||
if (!sub_8069DFC())
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool32 sub_8144018(const struct MEventBuffer_32E0_Sub * data)
|
||||
bool32 sub_8144018(const struct MEWonderCardData * data)
|
||||
{
|
||||
if (data->unk_00 == 0)
|
||||
return FALSE;
|
||||
@@ -634,32 +634,32 @@ bool32 sub_8144018(const struct MEventBuffer_32E0_Sub * data)
|
||||
|
||||
bool32 WonderCard_Test_Unk_08_6(void)
|
||||
{
|
||||
const struct MEventBuffer_32E0_Sub * data = &gSaveBlock1Ptr->unk_3120.buffer_1c0.data;
|
||||
const struct MEWonderCardData * data = &gSaveBlock1Ptr->mysteryEventBuffers.mecard.data;
|
||||
if (data->unk_08_6 == 0)
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void sub_814407C(void)
|
||||
void BlankSavedWonderCard(void)
|
||||
{
|
||||
CpuFill32(0, &gSaveBlock1Ptr->unk_3120.buffer_1c0.data, sizeof(struct MEventBuffer_32E0_Sub));
|
||||
gSaveBlock1Ptr->unk_3120.buffer_1c0.crc = 0;
|
||||
CpuFill32(0, &gSaveBlock1Ptr->mysteryEventBuffers.mecard.data, sizeof(struct MEWonderCardData));
|
||||
gSaveBlock1Ptr->mysteryEventBuffers.mecard.crc = 0;
|
||||
}
|
||||
|
||||
void sub_81440B4(void)
|
||||
void BlankMEventBuffer2(void)
|
||||
{
|
||||
CpuFill32(0, sav1_get_mevent_buffer_2(), 18 * sizeof(u16));
|
||||
gSaveBlock1Ptr->unk_3120.buffer_310.crc = 0;
|
||||
gSaveBlock1Ptr->mysteryEventBuffers.buffer_310.crc = 0;
|
||||
}
|
||||
|
||||
u16 sub_81440E8(void)
|
||||
{
|
||||
if (ValidateReceivedWonderCard())
|
||||
return gSaveBlock1Ptr->unk_3120.buffer_1c0.data.unk_00;
|
||||
return gSaveBlock1Ptr->mysteryEventBuffers.mecard.data.unk_00;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void sub_814410C(struct MEventBuffer_32E0_Sub * buffer)
|
||||
void sub_814410C(struct MEWonderCardData * buffer)
|
||||
{
|
||||
if (buffer->unk_08_6 == 1)
|
||||
buffer->unk_08_6 = 0;
|
||||
@@ -707,11 +707,11 @@ bool32 sub_81441AC(const struct MEventBuffer_3430_Sub * data1, const u16 * data2
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool32 sub_81441F0(const u16 * data)
|
||||
static bool32 IsWonderCardSpeciesValid(const u16 * data)
|
||||
{
|
||||
if (data[1] == 0)
|
||||
return FALSE;
|
||||
if (data[0] == 0)
|
||||
if (data[0] == SPECIES_NONE)
|
||||
return FALSE;
|
||||
if (data[0] >= NUM_SPECIES)
|
||||
return FALSE;
|
||||
@@ -720,64 +720,72 @@ bool32 sub_81441F0(const u16 * data)
|
||||
|
||||
s32 sub_8144218(void)
|
||||
{
|
||||
struct MEventBuffer_32E0_Sub * data;
|
||||
struct MEWonderCardData * data;
|
||||
if (!ValidateReceivedWonderCard())
|
||||
return 0;
|
||||
data = &gSaveBlock1Ptr->unk_3120.buffer_1c0.data;
|
||||
data = &gSaveBlock1Ptr->mysteryEventBuffers.mecard.data;
|
||||
if (data->unk_08_0 != 1)
|
||||
return 0;
|
||||
return sub_8144184(&gSaveBlock1Ptr->unk_3120.buffer_310.data, data->unk_09);
|
||||
return sub_8144184(&gSaveBlock1Ptr->mysteryEventBuffers.buffer_310.data, data->unk_09);
|
||||
}
|
||||
|
||||
bool32 sub_8144254(const u16 * data)
|
||||
{
|
||||
struct MEventBuffer_32E0_Sub * buffer = &gSaveBlock1Ptr->unk_3120.buffer_1c0.data;
|
||||
struct MEWonderCardData * buffer = &gSaveBlock1Ptr->mysteryEventBuffers.mecard.data;
|
||||
s32 size = buffer->unk_09;
|
||||
s32 i;
|
||||
if (!sub_81441F0(data))
|
||||
if (!IsWonderCardSpeciesValid(data))
|
||||
return FALSE;
|
||||
if (sub_81441AC(&gSaveBlock1Ptr->unk_3120.buffer_310.data, data, size))
|
||||
if (sub_81441AC(&gSaveBlock1Ptr->mysteryEventBuffers.buffer_310.data, data, size))
|
||||
return FALSE;
|
||||
for (i = 0; i < size; i++)
|
||||
{
|
||||
if (gSaveBlock1Ptr->unk_3120.buffer_310.data.unk_08[1][i] == 0 && gSaveBlock1Ptr->unk_3120.buffer_310.data.unk_08[0][i] == 0)
|
||||
if (gSaveBlock1Ptr->mysteryEventBuffers.buffer_310.data.unk_08[1][i] == 0 && gSaveBlock1Ptr->mysteryEventBuffers.buffer_310.data.unk_08[0][i] == 0)
|
||||
{
|
||||
gSaveBlock1Ptr->unk_3120.buffer_310.data.unk_08[1][i] = data[1];
|
||||
gSaveBlock1Ptr->unk_3120.buffer_310.data.unk_08[0][i] = data[0];
|
||||
gSaveBlock1Ptr->mysteryEventBuffers.buffer_310.data.unk_08[1][i] = data[1];
|
||||
gSaveBlock1Ptr->mysteryEventBuffers.buffer_310.data.unk_08[0][i] = data[0];
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void sub_81442CC(struct MEventStruct_Unk1442CC * data)
|
||||
void BuildMEventClientHeader(struct MEventClientHeaderStruct * data)
|
||||
{
|
||||
s32 i;
|
||||
CpuFill32(0, data, sizeof(struct MEventStruct_Unk1442CC));
|
||||
CpuFill32(0, data, sizeof(struct MEventClientHeaderStruct));
|
||||
// Magic
|
||||
data->unk_00 = 0x101;
|
||||
data->unk_04 = 1;
|
||||
data->unk_08 = 1;
|
||||
data->unk_0C = 1;
|
||||
data->unk_10 = 1;
|
||||
|
||||
// Check whether a card already exists
|
||||
if (ValidateReceivedWonderCard())
|
||||
{
|
||||
data->unk_14 = GetSavedWonderCard()->unk_00;
|
||||
// Populate fields
|
||||
data->id = GetSavedWonderCard()->unk_00;
|
||||
data->unk_20 = *sav1_get_mevent_buffer_2();
|
||||
data->unk_44 = GetSavedWonderCard()->unk_09;
|
||||
}
|
||||
else
|
||||
data->unk_14 = 0;
|
||||
data->id = 0;
|
||||
|
||||
// Get something
|
||||
for (i = 0; i < 4; i++)
|
||||
data->unk_16[i] = gSaveBlock1Ptr->unk_3120.unk_338[i];
|
||||
CopyTrainerId(data->unk_4C, gSaveBlock2Ptr->playerTrainerId);
|
||||
StringCopy(data->unk_45, gSaveBlock2Ptr->playerName);
|
||||
data->unk_16[i] = gSaveBlock1Ptr->mysteryEventBuffers.ec_profile_maybe[i];
|
||||
|
||||
// Get player ID
|
||||
CopyTrainerId(data->playerTrainerId, gSaveBlock2Ptr->playerTrainerId);
|
||||
StringCopy(data->playerName, gSaveBlock2Ptr->playerName);
|
||||
for (i = 0; i < 6; i++)
|
||||
data->unk_50[i] = gSaveBlock1Ptr->easyChatProfile[i];
|
||||
memcpy(data->unk_5C, RomHeaderGameCode, 4);
|
||||
data->unk_60 = RomHeaderSoftwareVersion;
|
||||
data->easyChatProfile[i] = gSaveBlock1Ptr->easyChatProfile[i];
|
||||
memcpy(data->gameCode, RomHeaderGameCode, 4);
|
||||
data->version = RomHeaderSoftwareVersion;
|
||||
}
|
||||
|
||||
bool32 sub_81443D4(const struct MEventStruct_Unk1442CC * data)
|
||||
bool32 ValidateMEventClientHeader(const struct MEventClientHeaderStruct * data)
|
||||
{
|
||||
if (data->unk_00 != 0x101)
|
||||
return FALSE;
|
||||
@@ -792,16 +800,16 @@ bool32 sub_81443D4(const struct MEventStruct_Unk1442CC * data)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
u32 sub_8144418(const u16 * a0, const struct MEventStruct_Unk1442CC * a1, void * unused)
|
||||
u32 sub_8144418(const u16 * a0, const struct MEventClientHeaderStruct * a1, void * unused)
|
||||
{
|
||||
if (a1->unk_14 == 0)
|
||||
if (a1->id == 0)
|
||||
return 0;
|
||||
if (*a0 == a1->unk_14)
|
||||
if (*a0 == a1->id)
|
||||
return 1;
|
||||
return 2;
|
||||
}
|
||||
|
||||
u32 sub_8144434(const u16 * a0, const struct MEventStruct_Unk1442CC * a1, void * unused)
|
||||
u32 sub_8144434(const u16 * a0, const struct MEventClientHeaderStruct * a1, void * unused)
|
||||
{
|
||||
s32 r4 = a1->unk_44 - sub_8144184(&a1->unk_20, a1->unk_44);
|
||||
if (r4 == 0)
|
||||
@@ -813,7 +821,7 @@ u32 sub_8144434(const u16 * a0, const struct MEventStruct_Unk1442CC * a1, void *
|
||||
return 2;
|
||||
}
|
||||
|
||||
bool32 sub_8144474(const struct MEventStruct_Unk1442CC * a0, const u16 * a1)
|
||||
bool32 sub_8144474(const struct MEventClientHeaderStruct * a0, const u16 * a1)
|
||||
{
|
||||
s32 i;
|
||||
for (i = 0; i < 4; i++)
|
||||
@@ -824,12 +832,12 @@ bool32 sub_8144474(const struct MEventStruct_Unk1442CC * a0, const u16 * a1)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
s32 sub_814449C(const struct MEventStruct_Unk1442CC * a0)
|
||||
s32 sub_814449C(const struct MEventClientHeaderStruct * a0)
|
||||
{
|
||||
return sub_8144184(&a0->unk_20, a0->unk_44);
|
||||
}
|
||||
|
||||
u16 sub_81444B0(const struct MEventStruct_Unk1442CC * a0, u32 command)
|
||||
u16 sub_81444B0(const struct MEventClientHeaderStruct * a0, u32 command)
|
||||
{
|
||||
switch (command)
|
||||
{
|
||||
@@ -851,20 +859,20 @@ u16 sub_81444B0(const struct MEventStruct_Unk1442CC * a0, u32 command)
|
||||
|
||||
void sub_814451C(u32 command)
|
||||
{
|
||||
struct MEventBuffer_32E0_Sub * data = &gSaveBlock1Ptr->unk_3120.buffer_1c0.data;
|
||||
struct MEWonderCardData * data = &gSaveBlock1Ptr->mysteryEventBuffers.mecard.data;
|
||||
if (data->unk_08_0 == 2)
|
||||
{
|
||||
u16 * dest = NULL;
|
||||
switch (command)
|
||||
{
|
||||
case 0:
|
||||
dest = &gSaveBlock1Ptr->unk_3120.buffer_310.data.unk_00;
|
||||
dest = &gSaveBlock1Ptr->mysteryEventBuffers.buffer_310.data.unk_00;
|
||||
break;
|
||||
case 1:
|
||||
dest = &gSaveBlock1Ptr->unk_3120.buffer_310.data.unk_02;
|
||||
dest = &gSaveBlock1Ptr->mysteryEventBuffers.buffer_310.data.unk_02;
|
||||
break;
|
||||
case 2:
|
||||
dest = &gSaveBlock1Ptr->unk_3120.buffer_310.data.unk_04;
|
||||
dest = &gSaveBlock1Ptr->mysteryEventBuffers.buffer_310.data.unk_04;
|
||||
break;
|
||||
case 3:
|
||||
break;
|
||||
@@ -888,44 +896,44 @@ u16 sub_81445C0(u32 command)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
struct MEventBuffer_32E0_Sub * data = &gSaveBlock1Ptr->unk_3120.buffer_1c0.data;
|
||||
struct MEWonderCardData * data = &gSaveBlock1Ptr->mysteryEventBuffers.mecard.data;
|
||||
if (data->unk_08_0 == 2)
|
||||
{
|
||||
struct MEventBuffer_3430_Sub * buffer = &gSaveBlock1Ptr->unk_3120.buffer_310.data;
|
||||
struct MEventBuffer_3430_Sub * buffer = &gSaveBlock1Ptr->mysteryEventBuffers.buffer_310.data;
|
||||
return buffer->unk_00;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
struct MEventBuffer_32E0_Sub * data = &gSaveBlock1Ptr->unk_3120.buffer_1c0.data;
|
||||
struct MEWonderCardData * data = &gSaveBlock1Ptr->mysteryEventBuffers.mecard.data;
|
||||
if (data->unk_08_0 == 2)
|
||||
{
|
||||
struct MEventBuffer_3430_Sub * buffer = &gSaveBlock1Ptr->unk_3120.buffer_310.data;
|
||||
struct MEventBuffer_3430_Sub * buffer = &gSaveBlock1Ptr->mysteryEventBuffers.buffer_310.data;
|
||||
return buffer->unk_02;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
struct MEventBuffer_32E0_Sub * data = &gSaveBlock1Ptr->unk_3120.buffer_1c0.data;
|
||||
struct MEWonderCardData * data = &gSaveBlock1Ptr->mysteryEventBuffers.mecard.data;
|
||||
if (data->unk_08_0 == 2)
|
||||
{
|
||||
struct MEventBuffer_3430_Sub * buffer = &gSaveBlock1Ptr->unk_3120.buffer_310.data;
|
||||
struct MEventBuffer_3430_Sub * buffer = &gSaveBlock1Ptr->mysteryEventBuffers.buffer_310.data;
|
||||
return buffer->unk_04;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
struct MEventBuffer_32E0_Sub * data = &gSaveBlock1Ptr->unk_3120.buffer_1c0.data;
|
||||
struct MEWonderCardData * data = &gSaveBlock1Ptr->mysteryEventBuffers.mecard.data;
|
||||
if (data->unk_08_0 == 1)
|
||||
return sub_8144218();
|
||||
break;
|
||||
}
|
||||
case 4:
|
||||
{
|
||||
struct MEventBuffer_32E0_Sub * data = &gSaveBlock1Ptr->unk_3120.buffer_1c0.data;
|
||||
struct MEWonderCardData * data = &gSaveBlock1Ptr->mysteryEventBuffers.mecard.data;
|
||||
if (data->unk_08_0 == 1)
|
||||
return data->unk_09;
|
||||
break;
|
||||
@@ -947,7 +955,7 @@ bool32 sub_81446D0(u16 a0)
|
||||
return FALSE;
|
||||
if (!ValidateReceivedWonderCard())
|
||||
return FALSE;
|
||||
if (gSaveBlock1Ptr->unk_3120.buffer_1c0.data.unk_00 != a0)
|
||||
if (gSaveBlock1Ptr->mysteryEventBuffers.mecard.data.unk_00 != a0)
|
||||
return FALSE;
|
||||
gUnknown_203F3BC = TRUE;
|
||||
return TRUE;
|
||||
@@ -960,13 +968,13 @@ void sub_8144714(u32 a0, u32 a1)
|
||||
switch (a0)
|
||||
{
|
||||
case 2:
|
||||
sub_8144824(2, a1, gSaveBlock1Ptr->unk_3120.unk_344[1], 5);
|
||||
sub_8144824(2, a1, gSaveBlock1Ptr->mysteryEventBuffers.unk_344[1], 5);
|
||||
break;
|
||||
case 0:
|
||||
sub_8144824(0, a1, gSaveBlock1Ptr->unk_3120.unk_344[0], 5);
|
||||
sub_8144824(0, a1, gSaveBlock1Ptr->mysteryEventBuffers.unk_344[0], 5);
|
||||
break;
|
||||
case 1:
|
||||
sub_8144824(1, a1, gSaveBlock1Ptr->unk_3120.unk_344[0], 5);
|
||||
sub_8144824(1, a1, gSaveBlock1Ptr->mysteryEventBuffers.unk_344[0], 5);
|
||||
break;
|
||||
default:
|
||||
AGB_ASSERT_EX(0, "C:/WORK/POKeFRLG/src/pm_lgfr_ose/source/mevent.c", 988);
|
||||
@@ -976,7 +984,7 @@ void sub_8144714(u32 a0, u32 a1)
|
||||
|
||||
void sub_8144790(void)
|
||||
{
|
||||
CpuFill32(0, gSaveBlock1Ptr->unk_3120.unk_344, sizeof(gSaveBlock1Ptr->unk_3120.unk_344));
|
||||
CpuFill32(0, gSaveBlock1Ptr->mysteryEventBuffers.unk_344, sizeof(gSaveBlock1Ptr->mysteryEventBuffers.unk_344));
|
||||
}
|
||||
|
||||
bool32 sub_81447BC(u32 a0, u32 * a1, s32 size)
|
||||
|
||||
@@ -34,7 +34,7 @@ struct UnkStruct_203F3C8_02DC
|
||||
|
||||
struct UnkStruct_203F3C8
|
||||
{
|
||||
/*0000*/ struct MEventBuffer_32E0_Sub unk_0000;
|
||||
/*0000*/ struct MEWonderCardData unk_0000;
|
||||
/*014c*/ struct MEventBuffer_3430_Sub unk_014C;
|
||||
/*0170*/ const struct UnkStruct_8467FB8 * unk_0170;
|
||||
/*0174*/ u8 unk_0174;
|
||||
@@ -127,7 +127,7 @@ const struct UnkStruct_8467FB8 gUnknown_8467FB8[8] = {
|
||||
{1, 0, 0, 7, gUnknown_8467A7C, gUnknown_8467CAC, gUnknown_846716C}
|
||||
};
|
||||
|
||||
bool32 InitWonderCardResources(struct MEventBuffer_32E0_Sub * r5, struct MEventBuffer_3430_Sub * r6)
|
||||
bool32 InitWonderCardResources(struct MEWonderCardData * r5, struct MEventBuffer_3430_Sub * r6)
|
||||
{
|
||||
if (r5 == NULL || r6 == NULL)
|
||||
return FALSE;
|
||||
@@ -446,7 +446,7 @@ void sub_81461D8(void)
|
||||
|
||||
struct UnkStruct_203F3CC
|
||||
{
|
||||
/*0000*/ struct MEventBuffer_3120_Sub unk_0000;
|
||||
/*0000*/ struct MEWonderNewsData unk_0000;
|
||||
/*01bc*/ const struct UnkStruct_8467FB8 * unk_01BC;
|
||||
/*01c0*/ u8 unk_01C0_0:1;
|
||||
u8 unk_01C0_1:7;
|
||||
@@ -509,7 +509,7 @@ const struct UnkStruct_8467FB8 gUnknown_8468720[] = {
|
||||
{1, 0, 0, 0, gUnknown_84685B4, gUnknown_8468644, gUnknown_84680A0}
|
||||
};
|
||||
|
||||
bool32 InitWonderNewsResources(const struct MEventBuffer_3120_Sub * a0)
|
||||
bool32 InitWonderNewsResources(const struct MEWonderNewsData * a0)
|
||||
{
|
||||
if (a0 == NULL)
|
||||
return FALSE;
|
||||
|
||||
@@ -0,0 +1,289 @@
|
||||
#include "global.h"
|
||||
#include "malloc.h"
|
||||
#include "decompress.h"
|
||||
#include "overworld.h"
|
||||
#include "script.h"
|
||||
#include "battle_tower.h"
|
||||
#include "mystery_event_script.h"
|
||||
#include "mevent.h"
|
||||
#include "mevent_server.h"
|
||||
|
||||
static EWRAM_DATA struct mevent_client * s_mevent_client_ptr = NULL;
|
||||
|
||||
static void mevent_client_init(struct mevent_client *, u32, u32);
|
||||
static u32 mevent_client_exec(struct mevent_client *);
|
||||
static void mevent_client_free_resources(struct mevent_client *);
|
||||
|
||||
extern const struct mevent_client_cmd gMEventClientScript_InotialListen[];
|
||||
|
||||
void mevent_client_do_init(void)
|
||||
{
|
||||
s_mevent_client_ptr = AllocZeroed(sizeof(struct mevent_client));
|
||||
mevent_client_init(s_mevent_client_ptr, 1, 0);
|
||||
}
|
||||
|
||||
u32 mevent_client_do_exec(u16 * a0)
|
||||
{
|
||||
u32 result;
|
||||
if (s_mevent_client_ptr == NULL)
|
||||
return 6;
|
||||
result = mevent_client_exec(s_mevent_client_ptr);
|
||||
if (result == 6)
|
||||
{
|
||||
*a0 = s_mevent_client_ptr->param;
|
||||
mevent_client_free_resources(s_mevent_client_ptr);
|
||||
Free(s_mevent_client_ptr);
|
||||
s_mevent_client_ptr = NULL;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void mevent_client_inc_flag(void)
|
||||
{
|
||||
s_mevent_client_ptr->flag++;
|
||||
}
|
||||
|
||||
void * mevent_client_get_buffer(void)
|
||||
{
|
||||
return s_mevent_client_ptr->buffer;
|
||||
}
|
||||
|
||||
void mevent_client_set_param(u32 a0)
|
||||
{
|
||||
s_mevent_client_ptr->param = a0;
|
||||
}
|
||||
|
||||
static void mevent_client_init(struct mevent_client * svr, u32 sendPlayerNo, u32 recvPlayerNo)
|
||||
{
|
||||
svr->unk_00 = 0;
|
||||
svr->mainseqno = 0;
|
||||
svr->flag = 0;
|
||||
svr->sendBuffer = AllocZeroed(ME_SEND_BUF_SIZE);
|
||||
svr->recvBuffer = AllocZeroed(ME_SEND_BUF_SIZE);
|
||||
svr->cmdBuffer = AllocZeroed(ME_SEND_BUF_SIZE);
|
||||
svr->buffer = AllocZeroed(0x40);
|
||||
mevent_srv_sub_init(&svr->manager, sendPlayerNo, recvPlayerNo);
|
||||
}
|
||||
|
||||
static void mevent_client_free_resources(struct mevent_client * svr)
|
||||
{
|
||||
Free(svr->sendBuffer);
|
||||
Free(svr->recvBuffer);
|
||||
Free(svr->cmdBuffer);
|
||||
Free(svr->buffer);
|
||||
}
|
||||
|
||||
static void mevent_client_jmp_buffer(struct mevent_client * svr)
|
||||
{
|
||||
memcpy(svr->cmdBuffer, svr->recvBuffer, ME_SEND_BUF_SIZE);
|
||||
svr->cmdidx = 0;
|
||||
}
|
||||
|
||||
static void mevent_client_send_word(struct mevent_client * svr, u32 ident, u32 word)
|
||||
{
|
||||
CpuFill32(0, svr->sendBuffer, ME_SEND_BUF_SIZE);
|
||||
*(u32 *)svr->sendBuffer = word;
|
||||
mevent_srv_sub_init_send(&svr->manager, ident, svr->sendBuffer, sizeof(u32));
|
||||
}
|
||||
|
||||
static u32 client_mainseq_0(struct mevent_client * svr)
|
||||
{
|
||||
// init
|
||||
memcpy(svr->cmdBuffer, gMEventClientScript_InotialListen, ME_SEND_BUF_SIZE);
|
||||
svr->cmdidx = 0;
|
||||
svr->mainseqno = 4;
|
||||
svr->flag = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static u32 client_mainseq_1(struct mevent_client * svr)
|
||||
{
|
||||
// done
|
||||
return 6;
|
||||
}
|
||||
|
||||
static u32 client_mainseq_2(struct mevent_client * svr)
|
||||
{
|
||||
// do recv
|
||||
if (mevent_srv_sub_recv(&svr->manager))
|
||||
{
|
||||
svr->mainseqno = 4;
|
||||
svr->flag = 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static u32 client_mainseq_3(struct mevent_client * svr)
|
||||
{
|
||||
// do send
|
||||
if (mevent_srv_sub_send(&svr->manager))
|
||||
{
|
||||
svr->mainseqno = 4;
|
||||
svr->flag = 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static u32 client_mainseq_4(struct mevent_client * svr)
|
||||
{
|
||||
// process command
|
||||
struct mevent_client_cmd * cmd = &svr->cmdBuffer[svr->cmdidx];
|
||||
++svr->cmdidx;
|
||||
switch (cmd->instr)
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
svr->param = cmd->parameter;
|
||||
svr->mainseqno = 1;
|
||||
svr->flag = 0;
|
||||
break;
|
||||
case 2:
|
||||
mevent_srv_sub_init_recv(&svr->manager, cmd->parameter, svr->recvBuffer);
|
||||
svr->mainseqno = 2;
|
||||
svr->flag = 0;
|
||||
break;
|
||||
case 3:
|
||||
svr->mainseqno = 3;
|
||||
svr->flag = 0;
|
||||
break;
|
||||
case 20:
|
||||
mevent_srv_sub_init_send(&svr->manager, 0x14, svr->sendBuffer, 0);
|
||||
svr->mainseqno = 3;
|
||||
svr->flag = 0;
|
||||
break;
|
||||
case 19:
|
||||
mevent_client_send_word(svr, 0x12, GetGameStat(cmd->parameter));
|
||||
svr->mainseqno = 3;
|
||||
svr->flag = 0;
|
||||
break;
|
||||
case 6:
|
||||
if (svr->param == 0)
|
||||
mevent_client_jmp_buffer(svr);
|
||||
break;
|
||||
case 7:
|
||||
if (svr->param == 1)
|
||||
mevent_client_jmp_buffer(svr);
|
||||
break;
|
||||
case 4:
|
||||
mevent_client_jmp_buffer(svr);
|
||||
break;
|
||||
case 5:
|
||||
memcpy(svr->buffer, svr->recvBuffer, 0x40);
|
||||
svr->mainseqno = 5;
|
||||
svr->flag = 0;
|
||||
return 2;
|
||||
case 11:
|
||||
memcpy(svr->buffer, svr->recvBuffer, 0x40);
|
||||
svr->mainseqno = 5;
|
||||
svr->flag = 0;
|
||||
return 3;
|
||||
case 12:
|
||||
memcpy(svr->buffer, svr->recvBuffer, 0x40);
|
||||
svr->mainseqno = 5;
|
||||
svr->flag = 0;
|
||||
return 5;
|
||||
case 13:
|
||||
svr->mainseqno = 5;
|
||||
svr->flag = 0;
|
||||
return 4;
|
||||
case 8:
|
||||
BuildMEventClientHeader(svr->sendBuffer);
|
||||
mevent_srv_sub_init_send(&svr->manager, 0x11, svr->sendBuffer, sizeof(struct MEventClientHeaderStruct));
|
||||
break;
|
||||
case 14:
|
||||
mevent_client_send_word(svr, 0x13, svr->param);
|
||||
break;
|
||||
case 10:
|
||||
sub_8143F68(svr->recvBuffer);
|
||||
break;
|
||||
case 9:
|
||||
if (!sub_8143EF4(svr->recvBuffer))
|
||||
{
|
||||
sub_8143DC8(svr->recvBuffer);
|
||||
mevent_client_send_word(svr, 0x13, 0);
|
||||
}
|
||||
else
|
||||
mevent_client_send_word(svr, 0x13, 1);
|
||||
break;
|
||||
case 15:
|
||||
svr->mainseqno = 6;
|
||||
svr->flag = 0;
|
||||
break;
|
||||
case 16:
|
||||
sub_8144254(svr->recvBuffer);
|
||||
break;
|
||||
case 17:
|
||||
MEventSetRamScript(svr->recvBuffer, 1000);
|
||||
break;
|
||||
case 18:
|
||||
memcpy(&gSaveBlock2Ptr->unk_B0.field_3F0, svr->recvBuffer, sizeof(struct BattleTowerEReaderTrainer));
|
||||
ValidateEReaderTrainer();
|
||||
break;
|
||||
case 21:
|
||||
memcpy(gDecompressionBuffer, svr->recvBuffer, ME_SEND_BUF_SIZE);
|
||||
svr->mainseqno = 7;
|
||||
svr->flag = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static u32 client_mainseq_5(struct mevent_client * svr)
|
||||
{
|
||||
// wait flag
|
||||
if (svr->flag)
|
||||
{
|
||||
svr->mainseqno = 4;
|
||||
svr->flag = 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static u32 client_mainseq_6(struct mevent_client * svr)
|
||||
{
|
||||
// Run mevent buffer script
|
||||
switch (svr->flag)
|
||||
{
|
||||
case 0:
|
||||
MEventScript_InitContext(svr->recvBuffer);
|
||||
++svr->flag;
|
||||
break;
|
||||
case 1:
|
||||
if (!MEventScript_Run(&svr->param))
|
||||
{
|
||||
svr->mainseqno = 4;
|
||||
svr->flag = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static u32 client_mainseq_7(struct mevent_client * svr)
|
||||
{
|
||||
// exec arbitrary code
|
||||
u32 (*func)(u32 *, struct SaveBlock2 *, struct SaveBlock1 *) = (void *)gDecompressionBuffer;
|
||||
if (func(&svr->param, gSaveBlock2Ptr, gSaveBlock1Ptr) == 1)
|
||||
{
|
||||
svr->mainseqno = 4;
|
||||
svr->flag = 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static u32 mevent_client_exec(struct mevent_client * svr)
|
||||
{
|
||||
u32 (*funcs[])(struct mevent_client *) = {
|
||||
client_mainseq_0,
|
||||
client_mainseq_1,
|
||||
client_mainseq_2,
|
||||
client_mainseq_3,
|
||||
client_mainseq_4,
|
||||
client_mainseq_5,
|
||||
client_mainseq_6,
|
||||
client_mainseq_7
|
||||
};
|
||||
return funcs[svr->mainseqno](svr);
|
||||
}
|
||||
+20
-300
@@ -1,9 +1,6 @@
|
||||
#include "global.h"
|
||||
#include "malloc.h"
|
||||
#include "decompress.h"
|
||||
#include "util.h"
|
||||
#include "link.h"
|
||||
#include "link_rfu.h"
|
||||
#include "overworld.h"
|
||||
#include "script.h"
|
||||
#include "battle_tower.h"
|
||||
@@ -11,302 +8,25 @@
|
||||
#include "mevent.h"
|
||||
#include "mevent_server.h"
|
||||
|
||||
EWRAM_DATA struct mevent_client * s_mevent_client_ptr = NULL;
|
||||
EWRAM_DATA struct mevent_srv_common * s_mevent_srv_common_ptr = NULL;
|
||||
|
||||
static void mevent_client_init(struct mevent_client *, u32, u32);
|
||||
static u32 mevent_client_exec(struct mevent_client *);
|
||||
static void mevent_client_free_resources(struct mevent_client *);
|
||||
static void mevent_srv_init_common(struct mevent_srv_common *, const void *, u32, u32);
|
||||
static void mevent_srv_free_resources(struct mevent_srv_common *);
|
||||
static u32 mevent_srv_exec_common(struct mevent_srv_common *);
|
||||
|
||||
extern const u8 gUnknown_84687E0[];
|
||||
extern const struct mevent_cmd gUnknown_8468B6C[];
|
||||
extern const struct mevent_cmd gUnknown_8468BCC[];
|
||||
|
||||
void mevent_client_do_init(void)
|
||||
{
|
||||
s_mevent_client_ptr = AllocZeroed(sizeof(struct mevent_client));
|
||||
mevent_client_init(s_mevent_client_ptr, 1, 0);
|
||||
}
|
||||
|
||||
u32 mevent_client_do_exec(u16 * a0)
|
||||
{
|
||||
u32 result;
|
||||
if (s_mevent_client_ptr == NULL)
|
||||
return 6;
|
||||
result = mevent_client_exec(s_mevent_client_ptr);
|
||||
if (result == 6)
|
||||
{
|
||||
*a0 = s_mevent_client_ptr->param;
|
||||
mevent_client_free_resources(s_mevent_client_ptr);
|
||||
Free(s_mevent_client_ptr);
|
||||
s_mevent_client_ptr = NULL;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void mevent_client_inc_flag(void)
|
||||
{
|
||||
s_mevent_client_ptr->flag++;
|
||||
}
|
||||
|
||||
void * mevent_client_get_buffer(void)
|
||||
{
|
||||
return s_mevent_client_ptr->buffer;
|
||||
}
|
||||
|
||||
void mevent_client_set_param(u32 a0)
|
||||
{
|
||||
s_mevent_client_ptr->param = a0;
|
||||
}
|
||||
|
||||
static void mevent_client_init(struct mevent_client * svr, u32 sendPlayerNo, u32 recvPlayerNo)
|
||||
{
|
||||
svr->unk_00 = 0;
|
||||
svr->mainseqno = 0;
|
||||
svr->flag = 0;
|
||||
svr->sendBuffer = AllocZeroed(ME_SEND_BUF_SIZE);
|
||||
svr->recvBuffer = AllocZeroed(ME_SEND_BUF_SIZE);
|
||||
svr->cmdBuffer = AllocZeroed(ME_SEND_BUF_SIZE);
|
||||
svr->buffer = AllocZeroed(0x40);
|
||||
mevent_srv_sub_init(&svr->manager, sendPlayerNo, recvPlayerNo);
|
||||
}
|
||||
|
||||
static void mevent_client_free_resources(struct mevent_client * svr)
|
||||
{
|
||||
Free(svr->sendBuffer);
|
||||
Free(svr->recvBuffer);
|
||||
Free(svr->cmdBuffer);
|
||||
Free(svr->buffer);
|
||||
}
|
||||
|
||||
static void mevent_client_jmp_buffer(struct mevent_client * svr)
|
||||
{
|
||||
memcpy(svr->cmdBuffer, svr->recvBuffer, ME_SEND_BUF_SIZE);
|
||||
svr->cmdidx = 0;
|
||||
}
|
||||
|
||||
static void mevent_client_send_word(struct mevent_client * svr, u32 ident, u32 word)
|
||||
{
|
||||
CpuFill32(0, svr->sendBuffer, ME_SEND_BUF_SIZE);
|
||||
*(u32 *)svr->sendBuffer = word;
|
||||
mevent_srv_sub_init_send(&svr->manager, ident, svr->sendBuffer, sizeof(u32));
|
||||
}
|
||||
|
||||
static u32 ish_mainseq_0(struct mevent_client * svr)
|
||||
{
|
||||
// init
|
||||
memcpy(svr->cmdBuffer, gUnknown_84687E0, ME_SEND_BUF_SIZE);
|
||||
svr->cmdidx = 0;
|
||||
svr->mainseqno = 4;
|
||||
svr->flag = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static u32 ish_mainseq_1(struct mevent_client * svr)
|
||||
{
|
||||
// done
|
||||
return 6;
|
||||
}
|
||||
|
||||
static u32 ish_mainseq_2(struct mevent_client * svr)
|
||||
{
|
||||
// do recv
|
||||
if (mevent_srv_sub_recv(&svr->manager))
|
||||
{
|
||||
svr->mainseqno = 4;
|
||||
svr->flag = 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static u32 ish_mainseq_3(struct mevent_client * svr)
|
||||
{
|
||||
// do send
|
||||
if (mevent_srv_sub_send(&svr->manager))
|
||||
{
|
||||
svr->mainseqno = 4;
|
||||
svr->flag = 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static u32 ish_mainseq_4(struct mevent_client * svr)
|
||||
{
|
||||
// process command
|
||||
struct mevent_cmd_ish * cmd = &svr->cmdBuffer[svr->cmdidx];
|
||||
++svr->cmdidx;
|
||||
switch (cmd->instr)
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
svr->param = cmd->parameter;
|
||||
svr->mainseqno = 1;
|
||||
svr->flag = 0;
|
||||
break;
|
||||
case 2:
|
||||
mevent_srv_sub_init_recv(&svr->manager, cmd->parameter, svr->recvBuffer);
|
||||
svr->mainseqno = 2;
|
||||
svr->flag = 0;
|
||||
break;
|
||||
case 3:
|
||||
svr->mainseqno = 3;
|
||||
svr->flag = 0;
|
||||
break;
|
||||
case 20:
|
||||
mevent_srv_sub_init_send(&svr->manager, 0x14, svr->sendBuffer, 0);
|
||||
svr->mainseqno = 3;
|
||||
svr->flag = 0;
|
||||
break;
|
||||
case 19:
|
||||
mevent_client_send_word(svr, 0x12, GetGameStat(cmd->parameter));
|
||||
svr->mainseqno = 3;
|
||||
svr->flag = 0;
|
||||
break;
|
||||
case 6:
|
||||
if (svr->param == 0)
|
||||
mevent_client_jmp_buffer(svr);
|
||||
break;
|
||||
case 7:
|
||||
if (svr->param == 1)
|
||||
mevent_client_jmp_buffer(svr);
|
||||
break;
|
||||
case 4:
|
||||
mevent_client_jmp_buffer(svr);
|
||||
break;
|
||||
case 5:
|
||||
memcpy(svr->buffer, svr->recvBuffer, 0x40);
|
||||
svr->mainseqno = 5;
|
||||
svr->flag = 0;
|
||||
return 2;
|
||||
case 11:
|
||||
memcpy(svr->buffer, svr->recvBuffer, 0x40);
|
||||
svr->mainseqno = 5;
|
||||
svr->flag = 0;
|
||||
return 3;
|
||||
case 12:
|
||||
memcpy(svr->buffer, svr->recvBuffer, 0x40);
|
||||
svr->mainseqno = 5;
|
||||
svr->flag = 0;
|
||||
return 5;
|
||||
case 13:
|
||||
svr->mainseqno = 5;
|
||||
svr->flag = 0;
|
||||
return 4;
|
||||
case 8:
|
||||
sub_81442CC(svr->sendBuffer);
|
||||
mevent_srv_sub_init_send(&svr->manager, 0x11, svr->sendBuffer, sizeof(struct MEventStruct_Unk1442CC));
|
||||
break;
|
||||
case 14:
|
||||
mevent_client_send_word(svr, 0x13, svr->param);
|
||||
break;
|
||||
case 10:
|
||||
sub_8143F68(svr->recvBuffer);
|
||||
break;
|
||||
case 9:
|
||||
if (!sub_8143EF4(svr->recvBuffer))
|
||||
{
|
||||
sub_8143DC8(svr->recvBuffer);
|
||||
mevent_client_send_word(svr, 0x13, 0);
|
||||
}
|
||||
else
|
||||
mevent_client_send_word(svr, 0x13, 1);
|
||||
break;
|
||||
case 15:
|
||||
svr->mainseqno = 6;
|
||||
svr->flag = 0;
|
||||
break;
|
||||
case 16:
|
||||
sub_8144254(svr->recvBuffer);
|
||||
break;
|
||||
case 17:
|
||||
sub_8069EA4(svr->recvBuffer, 1000);
|
||||
break;
|
||||
case 18:
|
||||
memcpy(&gSaveBlock2Ptr->unk_B0.field_3F0, svr->recvBuffer, sizeof(struct BattleTowerEReaderTrainer));
|
||||
ValidateEReaderTrainer();
|
||||
break;
|
||||
case 21:
|
||||
memcpy(gDecompressionBuffer, svr->recvBuffer, ME_SEND_BUF_SIZE);
|
||||
svr->mainseqno = 7;
|
||||
svr->flag = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static u32 ish_mainseq_5(struct mevent_client * svr)
|
||||
{
|
||||
// wait flag
|
||||
if (svr->flag)
|
||||
{
|
||||
svr->mainseqno = 4;
|
||||
svr->flag = 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static u32 ish_mainseq_6(struct mevent_client * svr)
|
||||
{
|
||||
// ???
|
||||
switch (svr->flag)
|
||||
{
|
||||
case 0:
|
||||
sub_80DA89C(svr->recvBuffer);
|
||||
++svr->flag;
|
||||
break;
|
||||
case 1:
|
||||
if (!sub_80DA8B0(&svr->param))
|
||||
{
|
||||
svr->mainseqno = 4;
|
||||
svr->flag = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static u32 ish_mainseq_7(struct mevent_client * svr)
|
||||
{
|
||||
// exec arbitrary code
|
||||
u32 (*func)(u32 *, struct SaveBlock2 *, struct SaveBlock1 *) = (void *)gDecompressionBuffer;
|
||||
if (func(&svr->param, gSaveBlock2Ptr, gSaveBlock1Ptr) == 1)
|
||||
{
|
||||
svr->mainseqno = 4;
|
||||
svr->flag = 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static u32 mevent_client_exec(struct mevent_client * svr)
|
||||
{
|
||||
u32 (*funcs[])(struct mevent_client *) = {
|
||||
ish_mainseq_0,
|
||||
ish_mainseq_1,
|
||||
ish_mainseq_2,
|
||||
ish_mainseq_3,
|
||||
ish_mainseq_4,
|
||||
ish_mainseq_5,
|
||||
ish_mainseq_6,
|
||||
ish_mainseq_7
|
||||
};
|
||||
return funcs[svr->mainseqno](svr);
|
||||
}
|
||||
extern const struct mevent_server_cmd gMEventSrvScript_SendNews[];
|
||||
extern const struct mevent_server_cmd gMEventSrvScript_SendCard[];
|
||||
|
||||
void mevent_srv_init_wnews(void)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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)
|
||||
@@ -329,10 +49,10 @@ static void mevent_srv_init_common(struct mevent_srv_common * svr, const void *
|
||||
{
|
||||
svr->unk_00 = 0;
|
||||
svr->mainseqno = 0;
|
||||
svr->mevent_32e0 = AllocZeroed(sizeof(struct MEventBuffer_32E0_Sub));
|
||||
svr->mevent_3120 = AllocZeroed(sizeof(struct MEventBuffer_3120_Sub));
|
||||
svr->card = AllocZeroed(sizeof(struct MEWonderCardData));
|
||||
svr->news = AllocZeroed(sizeof(struct MEWonderNewsData));
|
||||
svr->recvBuffer = AllocZeroed(ME_SEND_BUF_SIZE);
|
||||
svr->mevent_unk1442cc = AllocZeroed(sizeof(struct MEventStruct_Unk1442CC));
|
||||
svr->mevent_unk1442cc = AllocZeroed(sizeof(struct MEventClientHeaderStruct));
|
||||
svr->cmdBuffer = cmdBuffer;
|
||||
svr->cmdidx = 0;
|
||||
mevent_srv_sub_init(&svr->manager, sendPlayerNo, recvPlayerNo);
|
||||
@@ -340,8 +60,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)
|
||||
{
|
||||
Free(svr->mevent_32e0);
|
||||
Free(svr->mevent_3120);
|
||||
Free(svr->card);
|
||||
Free(svr->news);
|
||||
Free(svr->recvBuffer);
|
||||
Free(svr->mevent_unk1442cc);
|
||||
}
|
||||
@@ -402,7 +122,7 @@ static u32 common_mainseq_3(struct mevent_srv_common * svr)
|
||||
static u32 common_mainseq_4(struct mevent_srv_common * svr)
|
||||
{
|
||||
// process command
|
||||
const struct mevent_cmd * cmd = &svr->cmdBuffer[svr->cmdidx];
|
||||
const struct mevent_server_cmd * cmd = &svr->cmdBuffer[svr->cmdidx];
|
||||
void * ptr;
|
||||
svr->cmdidx++;
|
||||
|
||||
@@ -429,12 +149,12 @@ static u32 common_mainseq_4(struct mevent_srv_common * svr)
|
||||
case 5:
|
||||
AGB_ASSERT_EX(cmd->flag == FALSE, "C:/WORK/POKeFRLG/src/pm_lgfr_ose/source/mevent_server.c", 376);
|
||||
AGB_ASSERT_EX(cmd->parameter == NULL, "C:/WORK/POKeFRLG/src/pm_lgfr_ose/source/mevent_server.c", 377);
|
||||
memcpy(svr->mevent_unk1442cc, svr->recvBuffer, sizeof(struct MEventStruct_Unk1442CC));
|
||||
memcpy(svr->mevent_unk1442cc, svr->recvBuffer, sizeof(struct MEventClientHeaderStruct));
|
||||
break;
|
||||
case 6:
|
||||
AGB_ASSERT_EX(cmd->flag == FALSE, "C:/WORK/POKeFRLG/src/pm_lgfr_ose/source/mevent_server.c", 382);
|
||||
AGB_ASSERT_EX(cmd->parameter == NULL, "C:/WORK/POKeFRLG/src/pm_lgfr_ose/source/mevent_server.c", 383);
|
||||
svr->param = sub_81443D4(svr->mevent_unk1442cc);
|
||||
svr->param = ValidateMEventClientHeader(svr->mevent_unk1442cc);
|
||||
break;
|
||||
case 4:
|
||||
if (svr->param == cmd->flag)
|
||||
@@ -445,7 +165,7 @@ static u32 common_mainseq_4(struct mevent_srv_common * svr)
|
||||
break;
|
||||
case 7:
|
||||
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);
|
||||
break;
|
||||
case 8:
|
||||
@@ -472,11 +192,11 @@ static u32 common_mainseq_4(struct mevent_srv_common * svr)
|
||||
break;
|
||||
case 14:
|
||||
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 MEWonderNewsData));
|
||||
break;
|
||||
case 13:
|
||||
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 MEWonderCardData));
|
||||
break;
|
||||
case 16:
|
||||
AGB_ASSERT_EX(cmd->flag == FALSE, "C:/WORK/POKeFRLG/src/pm_lgfr_ose/source/mevent_server.c", 444);
|
||||
@@ -506,11 +226,11 @@ static u32 common_mainseq_4(struct mevent_srv_common * svr)
|
||||
break;
|
||||
case 22:
|
||||
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;
|
||||
case 23:
|
||||
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;
|
||||
case 21:
|
||||
AGB_ASSERT_EX(cmd->flag == FALSE, "C:/WORK/POKeFRLG/src/pm_lgfr_ose/source/mevent_server.c", 491);
|
||||
@@ -526,12 +246,12 @@ static u32 common_mainseq_4(struct mevent_srv_common * svr)
|
||||
break;
|
||||
case 26:
|
||||
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);
|
||||
sub_814410C(svr->mevent_32e0);
|
||||
memcpy(svr->card, GetSavedWonderCard(), 332);
|
||||
sub_814410C(svr->card);
|
||||
break;
|
||||
case 27:
|
||||
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;
|
||||
case 28:
|
||||
AGB_ASSERT_EX(cmd->flag == FALSE && cmd->parameter == NULL, "C:/WORK/POKeFRLG/src/pm_lgfr_ose/source/mevent_server.c", 517);
|
||||
|
||||
@@ -67,12 +67,12 @@ static bool32 RunMysteryEventScriptCommand(struct ScriptContext *ctx)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void sub_80DA89C(u8 *script)
|
||||
void MEventScript_InitContext(u8 *script)
|
||||
{
|
||||
InitMysteryEventScript(&sMysteryEventScriptContext, script);
|
||||
}
|
||||
|
||||
bool32 sub_80DA8B0(u32 *a0)
|
||||
bool32 MEventScript_Run(u32 *a0)
|
||||
{
|
||||
bool32 ret = RunMysteryEventScriptCommand(&sMysteryEventScriptContext);
|
||||
*a0 = sMysteryEventScriptContext.data[2];
|
||||
@@ -83,8 +83,8 @@ bool32 sub_80DA8B0(u32 *a0)
|
||||
u32 RunMysteryEventScript(u8 *script)
|
||||
{
|
||||
u32 ret;
|
||||
sub_80DA89C(script);
|
||||
while (sub_80DA8B0(&ret));
|
||||
MEventScript_InitContext(script);
|
||||
while (MEventScript_Run(&ret));
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "global.h"
|
||||
#include "palette.h"
|
||||
#include "dma3.h"
|
||||
#include "gpu_regs.h"
|
||||
#include "bg.h"
|
||||
#include "task.h"
|
||||
@@ -915,7 +914,7 @@ bool32 mevent_save_game(u8 * state)
|
||||
(*state)++;
|
||||
break;
|
||||
case 1:
|
||||
TrySavingData(0);
|
||||
TrySavingData(SAVE_NORMAL);
|
||||
(*state)++;
|
||||
break;
|
||||
case 2:
|
||||
@@ -1095,7 +1094,7 @@ const u8 * mevent_message_stamp_card_etc_send_status(u32 * a0, u8 unused, u32 ms
|
||||
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;
|
||||
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:
|
||||
switch (mevent_client_do_exec(&data->curPromptWindowId))
|
||||
{
|
||||
case 6:
|
||||
case 6: // done
|
||||
task_add_05_task_del_08FA224_when_no_RfuFunc();
|
||||
data->prevPromptWindowId = data->curPromptWindowId;
|
||||
data->state = 13;
|
||||
|
||||
+1
-2
@@ -5624,8 +5624,7 @@ u8 GetNumberOfRelearnableMoves(struct Pokemon *mon)
|
||||
return numMoves;
|
||||
}
|
||||
|
||||
// SpeciesToPokedexNum?
|
||||
u16 sub_8043F90(u16 species)
|
||||
u16 SpeciesToPokedexNum(u16 species)
|
||||
{
|
||||
species = SpeciesToNationalPokedexNum(species);
|
||||
|
||||
|
||||
+1
-1
@@ -1067,7 +1067,7 @@ static void QuestLog_EndPlayback(void)
|
||||
{
|
||||
ResetSpecialVars();
|
||||
Save_ResetSaveCounters();
|
||||
Save_LoadGameData(0);
|
||||
Save_LoadGameData(SAVE_NORMAL);
|
||||
SetMainCallback2(sub_8057430);
|
||||
gFieldCallback2 = sub_8111F60;
|
||||
FreeAllWindowBuffers();
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "overworld.h"
|
||||
#include "malloc.h"
|
||||
|
||||
void sub_8079B7C(void)
|
||||
void ResetSaveHeap(void)
|
||||
{
|
||||
u16 imeBackup = REG_IME;
|
||||
|
||||
@@ -20,8 +20,8 @@ void sub_8079B7C(void)
|
||||
SetSaveBlocksPointers();
|
||||
ResetMenuAndMonGlobals();
|
||||
Save_ResetSaveCounters();
|
||||
Save_LoadGameData(0);
|
||||
if (gSaveFileStatus == 0 || gSaveFileStatus == 2)
|
||||
Save_LoadGameData(SAVE_NORMAL);
|
||||
if (gSaveFileStatus == SAVE_STATUS_EMPTY || gSaveFileStatus == SAVE_STATUS_INVALID)
|
||||
Sav2_ClearSetDefault();
|
||||
SetPokemonCryStereo(gSaveBlock2Ptr->optionsSound);
|
||||
InitHeap(gHeap, HEAP_SIZE);
|
||||
|
||||
+16
-16
@@ -672,7 +672,7 @@ u8 HandleSavingData(u8 saveType)
|
||||
for(i = 0; i < 5; i++)
|
||||
save_write_to_flash(i, gRamSaveSectionLocations);
|
||||
break;
|
||||
case EREADER_SAVE:
|
||||
case SAVE_EREADER:
|
||||
SaveSerializedGame();
|
||||
save_write_to_flash(0, gRamSaveSectionLocations);
|
||||
break;
|
||||
@@ -719,7 +719,7 @@ bool8 sub_80DA3D8(void)
|
||||
{
|
||||
u8 retVal = sub_80D9AA4(0xE, gRamSaveSectionLocations);
|
||||
if (gDamagedSaveSectors)
|
||||
DoSaveFailedScreen(0);
|
||||
DoSaveFailedScreen(SAVE_NORMAL);
|
||||
if (retVal == 0xFF)
|
||||
return 1;
|
||||
else
|
||||
@@ -730,7 +730,7 @@ u8 sub_80DA40C(void)
|
||||
{
|
||||
sub_80D9B04(0xE, gRamSaveSectionLocations);
|
||||
if (gDamagedSaveSectors)
|
||||
DoSaveFailedScreen(0);
|
||||
DoSaveFailedScreen(SAVE_NORMAL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -738,7 +738,7 @@ u8 sub_80DA434(void)
|
||||
{
|
||||
sav12_xor_get(0xE, gRamSaveSectionLocations);
|
||||
if (gDamagedSaveSectors)
|
||||
DoSaveFailedScreen(0);
|
||||
DoSaveFailedScreen(SAVE_NORMAL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -769,34 +769,34 @@ bool8 sub_80DA4A0(void)
|
||||
retVal = TRUE;
|
||||
}
|
||||
if (gDamagedSaveSectors)
|
||||
DoSaveFailedScreen(1);
|
||||
DoSaveFailedScreen(SAVE_LINK);
|
||||
return retVal;
|
||||
}
|
||||
|
||||
u8 Save_LoadGameData(u8 a1)
|
||||
u8 Save_LoadGameData(u8 saveType)
|
||||
{
|
||||
u8 result;
|
||||
|
||||
if (gFlashMemoryPresent != TRUE)
|
||||
{
|
||||
gSaveFileStatus = 4;
|
||||
return 0xFF;
|
||||
gSaveFileStatus = SAVE_STATUS_NO_FLASH;
|
||||
return SAVE_STATUS_ERROR;
|
||||
}
|
||||
|
||||
UpdateSaveAddresses();
|
||||
switch (a1)
|
||||
switch (saveType)
|
||||
{
|
||||
case 0:
|
||||
case SAVE_NORMAL:
|
||||
default:
|
||||
result = sub_80D9E14(0xFFFF, gRamSaveSectionLocations);
|
||||
LoadSerializedGame();
|
||||
gSaveFileStatus = result;
|
||||
gGameContinueCallback = 0;
|
||||
break;
|
||||
case 3:
|
||||
result = sub_80DA120(0x1C, gDecompressionBuffer, 0xF80);
|
||||
if(result == 1)
|
||||
result = sub_80DA120(0x1D, gDecompressionBuffer + 0xF80, 0xF80);
|
||||
case SAVE_HALL_OF_FAME:
|
||||
result = sub_80DA120(SECTOR_HOF(0), gDecompressionBuffer, 0xF80);
|
||||
if (result == SAVE_STATUS_OK)
|
||||
result = sub_80DA120(SECTOR_HOF(1), gDecompressionBuffer + 0xF80, 0xF80);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -809,7 +809,7 @@ u32 TryCopySpecialSaveSection(u8 sector, u8* dst)
|
||||
s32 size;
|
||||
u8* savData;
|
||||
|
||||
if (sector != 30 && sector != 31)
|
||||
if (sector != SECTOR_TTOWER(0) && sector != SECTOR_TTOWER(1))
|
||||
return 0xFF;
|
||||
ReadFlash(sector, 0, (u8 *)&gSaveDataBuffer, sizeof(struct SaveSection));
|
||||
if (*(u32*)(&gSaveDataBuffer.data[0]) != 0xB39D)
|
||||
@@ -830,7 +830,7 @@ u32 TryWriteSpecialSaveSection(u8 sector, u8* src)
|
||||
u8* savData;
|
||||
void* savDataBuffer;
|
||||
|
||||
if (sector != 30 && sector != 31)
|
||||
if (sector != SECTOR_TTOWER(0) && sector != SECTOR_TTOWER(1))
|
||||
return 0xFF;
|
||||
|
||||
savDataBuffer = &gSaveDataBuffer;
|
||||
|
||||
+1
-1
@@ -546,7 +546,7 @@ u8 *sub_8069E48(void)
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8069EA4(u8 *script, u16 scriptSize)
|
||||
void MEventSetRamScript(u8 *script, u16 scriptSize)
|
||||
{
|
||||
if (scriptSize > sizeof(gSaveBlock1Ptr->ramScript.data.script))
|
||||
scriptSize = sizeof(gSaveBlock1Ptr->ramScript.data.script);
|
||||
|
||||
+1
-1
@@ -621,7 +621,7 @@ static void SetTitleScreenScene_Cry(s16 * data)
|
||||
SetSaveBlocksPointers();
|
||||
ResetMenuAndMonGlobals();
|
||||
Save_ResetSaveCounters();
|
||||
Save_LoadGameData(0);
|
||||
Save_LoadGameData(SAVE_NORMAL);
|
||||
if (gSaveFileStatus == SAVE_STATUS_EMPTY || gSaveFileStatus == SAVE_STATUS_INVALID)
|
||||
Sav2_ClearSetDefault();
|
||||
SetPokemonCryStereo(gSaveBlock2Ptr->optionsSound);
|
||||
|
||||
+3
-3
@@ -105,7 +105,7 @@ static void Task_SelectTMAction_Type3(u8 taskId);
|
||||
static void Task_SelectTMAction_FromSellMenu(u8 taskId);
|
||||
static void Task_AskConfirmSaleWithAmount(u8 taskId);
|
||||
static void Task_PlaceYesNoBox(u8 taskId);
|
||||
static void Task_SaleOfTMsCancelled(u8 taskId);
|
||||
static void Task_SaleOfTMsCanceled(u8 taskId);
|
||||
static void Task_InitQuantitySelectUI(u8 taskId);
|
||||
static void SellTM_PrintQuantityAndSalePrice(s16 quantity, s32 value);
|
||||
static void Task_QuantitySelect_HandleInput(u8 taskId);
|
||||
@@ -178,7 +178,7 @@ static const struct MenuAction sMenuActions_UseGiveExit[] = {
|
||||
|
||||
static const u8 sMenuActionIndices_Field[] = {0, 1, 2};
|
||||
static const u8 sMenuActionIndices_UnionRoom[] = {1, 2};
|
||||
static const struct YesNoFuncTable sYesNoFuncTable = {Task_PrintSaleConfirmedText, Task_SaleOfTMsCancelled};
|
||||
static const struct YesNoFuncTable sYesNoFuncTable = {Task_PrintSaleConfirmedText, Task_SaleOfTMsCanceled};
|
||||
|
||||
static const u8 sText_ClearTo18[] = _("{CLEAR_TO 18}");
|
||||
static const u8 sText_SingleSpace[] = _(" ");
|
||||
@@ -1012,7 +1012,7 @@ static void Task_PlaceYesNoBox(u8 taskId)
|
||||
HandleCreateYesNoMenu(taskId, &sYesNoFuncTable);
|
||||
}
|
||||
|
||||
static void Task_SaleOfTMsCancelled(u8 taskId)
|
||||
static void Task_SaleOfTMsCanceled(u8 taskId)
|
||||
{
|
||||
s16 * data = gTasks[taskId].data;
|
||||
|
||||
|
||||
+13
-13
@@ -450,22 +450,13 @@ gUnknown_203AAB8: @ 203AAB8
|
||||
.include "src/intro.o"
|
||||
|
||||
.align 2
|
||||
gUnknown_203AB34: @ 203AB34
|
||||
.space 0x4
|
||||
|
||||
gUnknown_203AB38: @ 203AB38
|
||||
.space 0x4
|
||||
|
||||
gUnknown_203AB3C: @ 203AB3C
|
||||
.space 0x4
|
||||
|
||||
.include "src/hall_of_fame.o"
|
||||
.align 2
|
||||
.include "src/credits.o"
|
||||
|
||||
gUnknown_203AB44: @ 203AB44
|
||||
.space 0x4
|
||||
|
||||
.align 2
|
||||
.include "src/diploma.o"
|
||||
|
||||
.align 2
|
||||
gUnknown_203AB4C: @ 203AB4C
|
||||
.space 0x4
|
||||
|
||||
@@ -728,13 +719,22 @@ sLocationHistory: @ 203F3A8
|
||||
sRoamerLocation: @ 203F3AE
|
||||
.space 0x2
|
||||
|
||||
.align 2
|
||||
.include "src/mystery_gift_menu.o"
|
||||
.align 2
|
||||
.include "src/mevent.o"
|
||||
.align 2
|
||||
.include "src/mevent_server_helpers.o"
|
||||
.align 2
|
||||
.include "src/mevent_client.o"
|
||||
.align 2
|
||||
.include "src/mevent_server.o"
|
||||
.align 2
|
||||
.include "src/mevent_8145654.o"
|
||||
.align 2
|
||||
.include "src/seagallop.o"
|
||||
|
||||
.align 2
|
||||
gUnknown_203F3D4: @ 203F3D4
|
||||
.space 0x4
|
||||
|
||||
|
||||
Reference in New Issue
Block a user