diff --git a/constants/mobile_constants.asm b/constants/mobile_constants.asm index dfc4b2cba..95ff56235 100644 --- a/constants/mobile_constants.asm +++ b/constants/mobile_constants.asm @@ -68,3 +68,6 @@ DEF MOBILE_BATTLE_ALLOWED_MINUTES EQU 10 ; + JP Mail struct $2a DEF MOBILE_EMAIL_LENGTH EQU $1e DEF TRADE_CORNER_REQUEST_LENGTH EQU $8f + +DEF EASY_CHAT_MESSAGE_WORD_COUNT EQU 6 +DEF EASY_CHAT_MESSAGE_LENGTH EQU EASY_CHAT_MESSAGE_WORD_COUNT * 2 ; every word uses 2 bytes diff --git a/engine/events/battle_tower/battle_tower.asm b/engine/events/battle_tower/battle_tower.asm index 6bdab76c5..020b9dd72 100644 --- a/engine/events/battle_tower/battle_tower.asm +++ b/engine/events/battle_tower/battle_tower.asm @@ -147,10 +147,10 @@ Function170139: ; unreferenced dec a jr nz, .CopyLoop - ld a, BANK(s4_a013) + ld a, BANK(sEZChatBeginBattleMessage) call OpenSRAM - ld hl, s4_a013 - ld bc, 36 + ld hl, sEZChatBattleMessages + ld bc, EASY_CHAT_MESSAGE_LENGTH * 3 call CopyBytes call CloseSRAM diff --git a/engine/link/mystery_gift.asm b/engine/link/mystery_gift.asm index 2fa529904..abbc72c1f 100644 --- a/engine/link/mystery_gift.asm +++ b/engine/link/mystery_gift.asm @@ -1748,13 +1748,13 @@ StageDataForNameCard: ld a, [sCrystalData + 0] ld [de], a inc de - ld a, BANK(s4_a603) ; aka BANK(s4_a007) ; MBC30 bank used by JP Crystal; inaccessible by MBC3 + ld a, BANK(s4_a603) ; aka BANK(sEZChatMessages) ; MBC30 bank used by JP Crystal; inaccessible by MBC3 call OpenSRAM ld hl, s4_a603 ; address of MBC30 bank ld bc, 8 call CopyBytes - ld hl, s4_a007 ; address of MBC30 bank - ld bc, 12 + ld hl, sEZChatIntroductionMessage ; address of MBC30 bank + ld bc, EASY_CHAT_MESSAGE_LENGTH call CopyBytes call CloseSRAM ret diff --git a/engine/menus/save.asm b/engine/menus/save.asm index 00076de1b..3df36a70c 100644 --- a/engine/menus/save.asm +++ b/engine/menus/save.asm @@ -401,20 +401,28 @@ EraseHallOfFame: call ByteFill jp CloseSRAM -Function14d18: ; unreferenced - ld a, BANK(s4_a007) ; MBC30 bank used by JP Crystal; inaccessible by MBC3 +InitDefaultEZChatMsgs: ; unreferenced + ld a, BANK(sEZChatMessages) ; MBC30 bank used by JP Crystal; inaccessible by MBC3 call OpenSRAM ld hl, .Data - ld de, s4_a007 - ld bc, 4 * 12 + ld de, sEZChatMessages + ld bc, EASY_CHAT_MESSAGE_LENGTH * 4 call CopyBytes jp CloseSRAM .Data: - db $0d, $02, $00, $05, $00, $00, $22, $02, $01, $05, $00, $00 - db $03, $04, $05, $08, $03, $05, $0e, $06, $03, $02, $00, $00 - db $39, $07, $07, $04, $00, $05, $04, $07, $01, $05, $00, $00 - db $0f, $05, $14, $07, $05, $05, $11, $0c, $0c, $06, $06, $04 +; introduction + db $0d, EZCHAT_GREETINGS, $00, EZCHAT_EXCLAMATIONS, $00, EZCHAT_POKEMON + db $22, EZCHAT_GREETINGS, $01, EZCHAT_EXCLAMATIONS, $00, EZCHAT_POKEMON +; begin battle + db $03, EZCHAT_BATTLE, $05, EZCHAT_CONDITIONS, $03, EZCHAT_EXCLAMATIONS + db $0e, EZCHAT_CONVERSATION, $03, EZCHAT_GREETINGS, $00, EZCHAT_POKEMON +; win battle + db $39, EZCHAT_FEELINGS, $07, EZCHAT_BATTLE, $00, EZCHAT_EXCLAMATIONS + db $04, EZCHAT_FEELINGS, $01, EZCHAT_EXCLAMATIONS, $00, EZCHAT_POKEMON +; lose battle + db $0f, EZCHAT_EXCLAMATIONS, $14, EZCHAT_FEELINGS, $05, EZCHAT_EXCLAMATIONS + db $11, EZCHAT_TIME, $0c, EZCHAT_CONVERSATION, $06, EZCHAT_BATTLE EraseBattleTowerStatus: ld a, BANK(sBattleTowerChallengeState) diff --git a/mobile/fixed_words.asm b/mobile/fixed_words.asm index b60b2592a..a347555d3 100644 --- a/mobile/fixed_words.asm +++ b/mobile/fixed_words.asm @@ -339,9 +339,9 @@ Function11c1b9: Function11c254: push af - ld a, BANK(s4_a007) + ld a, BANK(sEZChatMessages) call OpenSRAM - ld hl, s4_a007 + ld hl, sEZChatMessages pop af sla a sla a @@ -352,7 +352,7 @@ Function11c254: ld b, 0 add hl, bc ld de, wcd36 - ld bc, 12 + ld bc, EASY_CHAT_MESSAGE_LENGTH call CopyBytes call CloseSRAM ret @@ -1762,9 +1762,9 @@ Function11cb66: ld a, [hl] and a jr nz, .asm_11cbd4 - ld a, BANK(s4_a007) + ld a, BANK(sEZChatMessages) call OpenSRAM - ld hl, s4_a007 + ld hl, sEZChatMessages ld a, [wMenuCursorY] dec a sla a @@ -1776,7 +1776,7 @@ Function11cb66: ld b, 0 add hl, bc ld de, wcd36 - ld c, 12 + ld c, EASY_CHAT_MESSAGE_LENGTH .asm_11cba2 ld a, [de] ld [hli], a diff --git a/mobile/mobile_40.asm b/mobile/mobile_40.asm index ce83fc0d2..2371fc9be 100644 --- a/mobile/mobile_40.asm +++ b/mobile/mobile_40.asm @@ -2423,14 +2423,14 @@ Unknown_100feb: db -1 ; end Unknown_100ff3: - macro_100fc0 wdc41, 1 - macro_100fc0 wPlayerName, NAME_LENGTH - macro_100fc0 wPlayerName, NAME_LENGTH - macro_100fc0 wPlayerID, 2 - macro_100fc0 wSecretID, 2 - macro_100fc0 wPlayerGender, 1 - macro_100fc0 s4_a603, 8 - macro_100fc0 s4_a007, PARTYMON_STRUCT_LENGTH + macro_100fc0 wdc41, 1 + macro_100fc0 wPlayerName, NAME_LENGTH + macro_100fc0 wPlayerName, NAME_LENGTH + macro_100fc0 wPlayerID, 2 + macro_100fc0 wSecretID, 2 + macro_100fc0 wPlayerGender, 1 + macro_100fc0 s4_a603, 8 + macro_100fc0 sEZChatMessages, EASY_CHAT_MESSAGE_LENGTH * 4 db -1 ; end Unknown_10102c: diff --git a/ram/sram.asm b/ram/sram.asm index 12dfd895e..2621f2ebf 100644 --- a/ram/sram.asm +++ b/ram/sram.asm @@ -201,11 +201,12 @@ SECTION "SRAM Mobile 1", SRAM ds $7 -s4_a007:: ; struct size $30 - - ds $c - -s4_a013:: ds 36 +sEZChatMessages:: +sEZChatIntroductionMessage:: ds EASY_CHAT_MESSAGE_LENGTH +sEZChatBattleMessages:: +sEZChatBeginBattleMessage:: ds EASY_CHAT_MESSAGE_LENGTH +sEZChatWinBattleMessage:: ds EASY_CHAT_MESSAGE_LENGTH +sEZChatLoseBattleMessage:: ds EASY_CHAT_MESSAGE_LENGTH s4_a037:: ds 4