Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ruby : Finalize mapping for Japanese version #598

Merged
merged 16 commits into from
Dec 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
159 changes: 91 additions & 68 deletions modules/data/symbols/patches/language/pokeruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,29 @@ CB2_OVERWORLD:
J: 0x8051618
# Door exit
sub_8080B9C:
J: ~
J: 0x807da78
Task_HandleYesNoInput:
J: ~
J: 0x80b0b4c
Task_FieldMessageBox:
J: ~
J: 0x8061c2c
# 0x7
Std_MsgboxDefault:
J: ~
# 0x6
J: 0x817f404
# 0x9
Std_MsgboxYesNo:
J: ~
J: 0x817f40c
WaitForAorBPress:
J: ~
J: 0x8064401
Task_DuckBGMForPokemonCry:
J: ~
J: 0x8072440
CB2_FlyRegionMap:
J: ~
J: 0x80f71b0
gMain:
J: 0x30016e0
gFieldMessageBoxWindow:
J: 0x202e5dc
J: 0x202e5d4
sScriptContext1:
J: 0x3000520
sScriptContext2:
J: 0x30005a0
#-------------------------------#
Expand All @@ -52,7 +55,7 @@ gMapHeader:
gPlayerAvatar:
J: 0x202e5b8
gRegionMap:
J: 0x20385e8
J: 0x20385C4
gSaveBlock1:
J: 0x2025494
gSaveBlock2:
Expand All @@ -63,31 +66,33 @@ gSaveBlock2:
# Main Menu #
#-----------------#
CB2_InitCopyrightScreenAfterBootup:
J: ~
J: 0x813668c
MainCB2_Intro:
J: ~
J: 0x813634c
CB2_InitTitleScreen:
J: ~
J: 0x80790c4
MainCB2:
J: ~
J: 0x8079418
CB2_MainMenu:
J: ~
J: 0x8006cd0
CB2_ReturnToFieldLocal:
J: ~
J: 0x8051880
#-----------------#

#---------------------------#
# SSR/SRA/SGR/Roamers #
#---------------------------#
gRngValue:
J: ~
J: 0x3004748
# Fly
Task_MapNamePopup:
J: ~
J: 0x809f568
CB2_LoadMap:
J: ~
J: 0x8051750
Task_BattleStart:
J: ~
J: 0x807e838
SummaryScreenHandleKeyInput:
J: 0x809aad8
#--------------------#
# Battling Symbols #
#--------------------#
Expand All @@ -100,7 +105,7 @@ gBattleMainFunc:
gBattleResults:
J: 0x3004210
gBattlerControllerFuncs:
J: 0x3004378
J: 0x3004260
gBattlescriptCurrInstr:
J: 0x2024970
GTASKS:
Expand Down Expand Up @@ -128,66 +133,65 @@ gBattleWeather:
gBattleOutcome:
J: 0x2024a86
gBattlePartyCurrentOrder:
J: 0x2038190

J: 0x203818c
# Turn selection
sub_8012324:
J: ~
J: 0x800f630
sub_802C098:
J: ~
J: 0x8029320
HandleAction_ChooseMove:
J: 0x80298fd
# Turn selection Safari
bx_battle_menu_t6_2:
J: ~
J: 0x8126310
HandleEndTurn_FinishBattle:
J: ~
J: 0x8010fa4
BattleScript_HandleFaintedMon:
J: ~
J: 0x81a9713
BattleScript_FaintedMonEnd:
J: ~
J: 0x81a981e
CB2_WhiteOut:
J: ~
J: 0x80516dc
gActionSelectionCursor:
J: 0x2024bc0
gMoveSelectionCursor:
J: 0x2024bc4
# Replace move
BattleScript_AskToLearnMove:
J: ~
J: 0x81a99b1
BattleScript_ForgotAndLearnedNewMove:
J: ~
# Replace move
J: 0x81a99de
sub_809E260:
J: ~
J: 0x809ab9c
CB2_EvolutionSceneUpdate:
J: ~
J: 0x810d168
Task_EvolutionScene:
J: ~
J: 0x810d304
RunBattleScriptCommands_PopCallbacksStack:
J: 0x801125c
#--------------------#

#----------------#
# Daycare Mode #
#----------------#
S_EggHatch:
J: ~
J: 0x818bee4
# EggHatch party identification
gSpecialVar_0x8004:
J: ~
J: 0x202e620
Task_Fanfare:
J: ~
J: 0x8071f50
#----------------#

#--------------#
# Listeners #
#--------------#

CB2_EggHatch_1:
J: ~
#---------------#

#-------------------------#
# PC Menu / Storage #
#-------------------------#
Task_PokemonStorageSystem:
J: ~
J: 0x8092a14
Task_HandleMultichoiceInput:
J: ~
J: 0x80b0928
SUB_8096B38:
J: ~
J: 0x809363c
#-------------------------#

#--------------#
Expand Down Expand Up @@ -252,66 +256,85 @@ sPokeMenuOptionsOrder:
# Fishing Mode #
#-------------------#
Task_Fishing:
J: ~
J: 0x80575c8
#-------------------#

#---------------------#
# Pokemon renaming #
#---------------------#
# 0xa
BattleScript_TryNicknameCaughtMon:
J: ~
J: 0x81aa97b
sub_80B5AA0:
J: ~
J: 0x80b10e0
Task_HandleInput:
J: ~
J: 0x80b1838
# 0x7
BattleScript_GiveCaughtMonEnd:
J: ~
J: 0x81aa990
# 0x6
BattleScript_GotAwaySafely:
J: ~
J: 0x81a98c1
namingScreenDataPtr:
J: ~
J: 0x83a3198

#---------------------#

#---------------------#
# Berry blending #
#---------------------#
SUB_80501FC:
J: ~
J: 0x804d378
gUnknown_08216303:
J: ~
J: 0x81ec313
gBerryBlenderData:
J: ~
J: 0x3004784
#---------------------#

#-----------#
# Feebas #
#-----------#
# Waterfall
sub_8086F64:
J: ~
J: 0x8083e20
# Surf
sub_8088954:
J: ~
J: 0x8085804
#-----------#

#---------------------#
# Starters Hoenn #
#---------------------#
Task_StarterChoose2:
J: ~
J: 0x81050f8
BattleBeginFirstTurn:
J: ~
J: 0x800ee0c
#---------------------#

#----------------#
# Listeners #
#----------------#
# 0x8
S_RepelWoreOff:
J: ~
J: 0x8195926
gEggHatchData:
J: ~
#----------------#
J: 0x300474c
CB2_EggHatch_1:
J: 0x804022d
# Poison faint 0x5
gUnknown_081A14B8:
J: 0x8180bf5
# 0x8
EventScript_StartTrainerBattle:
J: 0x817f41c
# 0x4
EventScript_DoTrainerBattle:
J: 0x817f503
#----------------#

# Ununsed symbols that were conflicting with currently used symbols
# We set them to 0x0 to 'get them out of our way' and correctly target the desired symbol
LilycoveCity_House4_Text_18BEE8:
J: 0x0
gTVRecentHappeningsText3:
J: 0x0
14 changes: 4 additions & 10 deletions modules/data/symbols/patches/language/pokeruby_rev1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -228,16 +228,6 @@ Task_Fanfare:
S: 0x80753d4
#----------------#

#--------------#
# Listeners #
#--------------#

CB2_EggHatch_1:
F: 0x804341c
I: 0x8043344
S: 0x804342c
#---------------#

#-------------------------#
# PC Menu / Storage #
#-------------------------#
Expand Down Expand Up @@ -423,6 +413,10 @@ gEggHatchData:
F: 0x300482c
I: 0x300482c
S: 0x300482c
CB2_EggHatch_1:
F: 0x804341c
I: 0x8043344
S: 0x804342c
# Poison faint 0x5
gUnknown_081A14B8:
F: 0x81a699c
Expand Down
5 changes: 4 additions & 1 deletion modules/keyboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from modules.modes import BotModeError
from modules.runtime import get_data_path
from modules.tasks import get_task
from modules.roms import ROMLanguage

if TYPE_CHECKING:
pass
Expand Down Expand Up @@ -120,11 +121,13 @@ def get_naming_screen_data() -> NamingScreen | None:
return None
data = context.emulator.read_bytes(pointer, 0x4A)
cursor_sprite = get_game_sprite_by_id(data[0x0F])
language_offset = 0 if context.rom.language == ROMLanguage.Japanese else 1

return NamingScreen(
enabled=bool(task.data_value(0)),
state=NamingScreenState(data[0x00]),
current_input=decode_string(data[0x11:0x21]),
keyboard_page=KeyboardPageType((data[0x0E] + 1) % 3),
keyboard_page=KeyboardPageType((data[0x0E] + language_offset) % 3),
cursor_position=(cursor_sprite.data_value(0), cursor_sprite.data_value(1)),
)
else:
Expand Down
15 changes: 12 additions & 3 deletions modules/modes/berry_blend.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

from modules.items import get_item_by_name, get_item_bag, get_pokeblocks
from modules.player import get_player_avatar
from modules.roms import ROMLanguage
from modules.context import context
from . import BotModeError
from ._interface import BotMode
from .util import scroll_to_item_in_bag
Expand Down Expand Up @@ -47,9 +49,16 @@ def run(self) -> Generator:
play_callback_name = "SUB_80501FC"
data_symbol = "gBerryBlenderData"
hit_range_symbol = "gUnknown_08216303"
arrow_position_offset = 84
speed_offset = 86
number_of_players_offset = 136

if context.rom.language == ROMLanguage.Japanese:
arrow_position_offset = 74
speed_offset = 76
number_of_players_offset = 126
else:
arrow_position_offset = 84
speed_offset = 86
number_of_players_offset = 136

else:
play_callback_name = "CB2_PLAYBLENDER"
data_symbol = "sBerryBlender"
Expand Down
2 changes: 1 addition & 1 deletion wiki/pages/Mode - Acro Bike Bunny Hop.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Register the Acro Bike and start the mode while in the overworld, in any patch o
| | 🟥 Ruby | 🔷 Sapphire | 🟢 Emerald |
|:---------|:-------:|:-----------:|:----------:|
| English | ✅ | ✅ | ✅ |
| Japanese | | ❌ | ✅ |
| Japanese | | ❌ | ✅ |
| German | ✅ | ❌ | ✅ |
| Spanish | ✅ | ❌ | ✅ |
| French | ✅ | ❌ | ✅ |
Expand Down
2 changes: 1 addition & 1 deletion wiki/pages/Mode - Berry Blender.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ one with 1-3 NPCs around it as the empty ones are for multiplayer only.)
| | 🟥 Ruby | 🔷 Sapphire | 🟢 Emerald |
|:---------|:-------:|:-----------:|:----------:|
| English | ✅ | ✅ | ✅ |
| Japanese | | ❌ | ✅ |
| Japanese | | ❌ | ✅ |
| German | ✅ | 🟨 | ✅ |
| Spanish | ✅ | ❌ | ✅ |
| French | ✅ | ❌ | ✅ |
Expand Down
Loading
Loading