Merge branch 'master' into master-to-upcoming

Conflicts:
	include/constants/expansion.h
This commit is contained in:
Hedara 2025-11-03 11:11:07 +01:00
commit b0ccddac69
75 changed files with 664 additions and 218 deletions

View File

@ -43,9 +43,10 @@ body:
label: Version
description: What version of pokeemerald-expansion are you using?
options:
- 1.13.2 (Latest release)
- 1.13.3 (Latest release)
- master (default, unreleased bugfixes)
- upcoming (Edge)
- 1.13.2
- 1.13.1
- 1.13.0
- 1.12.3

View File

@ -43,9 +43,10 @@ body:
label: Version
description: What version of pokeemerald-expansion are you using?
options:
- 1.13.2 (Latest release)
- 1.13.3 (Latest release)
- master (default, unreleased bugfixes)
- upcoming (Edge)
- 1.13.2
- 1.13.1
- 1.13.0
- 1.12.3

View File

@ -43,9 +43,10 @@ body:
label: Version
description: What version of pokeemerald-expansion are you using?
options:
- 1.13.2 (Latest release)
- 1.13.3 (Latest release)
- master (default, unreleased bugfixes)
- upcoming (Edge)
- 1.13.2
- 1.13.1
- 1.13.0
- 1.12.3

View File

@ -17,7 +17,7 @@
If you use **`pokeemerald-expansion`**, please credit **RHH (Rom Hacking Hideout)**. Optionally, include the version number for clarity.
```
Based off RHH's pokeemerald-expansion 1.13.2 https://github.com/rh-hideout/pokeemerald-expansion/
Based off RHH's pokeemerald-expansion 1.13.3 https://github.com/rh-hideout/pokeemerald-expansion/
```
Please consider [crediting all contributors](CREDITS.md) involved in the project!

View File

@ -684,6 +684,14 @@
map \map
.endm
@ Set the player object's invisibility to FALSE.
.macro showplayer
.byte SCR_OP_SHOWOBJECTAT
.2byte LOCALID_PLAYER
.byte 0 @ map group
.byte 0 @ map num
.endm
@ Sets the specified object's invisibility to TRUE.
.macro hideobjectat localId:req, map:req
.byte SCR_OP_HIDEOBJECTAT
@ -691,6 +699,14 @@
map \map
.endm
@ Set the player object's invisibility to TRUE.
.macro hideplayer
.byte SCR_OP_HIDEOBJECTAT
.2byte LOCALID_PLAYER
.byte 0 @ map group
.byte 0 @ map num
.endm
@ Turns the currently selected object (if there is one) to face the player.
.macro faceplayer
.byte SCR_OP_FACEPLAYER

View File

@ -2,8 +2,12 @@
@ Takes a MAP constant and outputs the map group and map number as separate bytes
.macro map map_id:req
.ifdef \map_id
.byte \map_id >> 8 @ map group
.byte \map_id & 0xFF @ map num
.else
.error "undefined map (check for typos)"
.endif
.endm
@ Defines a map script. 'type' is any MAP_SCRIPT_* constant (see include/constants/map_scripts.h)

View File

@ -836,7 +836,7 @@ EventScript_UnusedBoardFerry::
delay 30
applymovement LOCALID_PLAYER, Common_Movement_WalkInPlaceFasterUp
waitmovement 0
showobjectat LOCALID_PLAYER, 0
showplayer
delay 30
applymovement LOCALID_PLAYER, Movement_UnusedBoardFerry
waitmovement 0
@ -851,7 +851,7 @@ Common_EventScript_FerryDepartIsland::
call_if_eq VAR_FACING, DIR_SOUTH, Ferry_EventScript_DepartIslandSouth
call_if_eq VAR_FACING, DIR_WEST, Ferry_EventScript_DepartIslandWest
delay 30
hideobjectat LOCALID_PLAYER, 0
hideplayer
call Common_EventScript_FerryDepart
return

View File

@ -333,7 +333,7 @@ LilycoveCity_Harbor_EventScript_BoardFerryWithSailor::
call_if_eq VAR_FACING, DIR_NORTH, LilycoveCity_Harbor_EventScript_PlayerBoardFerryNorth
call_if_eq VAR_FACING, DIR_EAST, LilycoveCity_Harbor_EventScript_PlayerBoardFerryEast
delay 30
hideobjectat LOCALID_PLAYER, 0
hideplayer
setvar VAR_0x8004, LOCALID_LILYCOVE_HARBOR_SS_TIDAL
call Common_EventScript_FerryDepart
return
@ -393,7 +393,7 @@ LilycoveCity_Harbor_EventScript_BoardFerry::
call_if_eq VAR_FACING, DIR_NORTH, LilycoveCity_Harbor_EventScript_PlayerBoardFerryNorth
call_if_eq VAR_FACING, DIR_EAST, LilycoveCity_Harbor_EventScript_PlayerBoardFerryEast
delay 30
hideobjectat LOCALID_PLAYER, 0
hideplayer
setvar VAR_0x8004, LOCALID_LILYCOVE_HARBOR_SS_TIDAL
call Common_EventScript_FerryDepart
return

View File

@ -156,7 +156,7 @@ LittlerootTown_EventScript_GoInsideWithMom::
waitmovement 0
setflag FLAG_HIDE_LITTLEROOT_TOWN_MOM_OUTSIDE
setvar VAR_LITTLEROOT_INTRO_STATE, 3
hideobjectat LOCALID_PLAYER, 0
hideplayer
closedoor VAR_0x8004, VAR_0x8005
waitdooranim
clearflag FLAG_HIDE_LITTLEROOT_TOWN_FAT_MAN

View File

@ -228,7 +228,7 @@ SlateportCity_Harbor_EventScript_BoardFerry::
call_if_eq VAR_FACING, DIR_NORTH, SlateportCity_Harbor_EventScript_BoardFerryNorth
call_if_eq VAR_FACING, DIR_EAST, SlateportCity_Harbor_EventScript_BoardFerryEast
delay 30
hideobjectat LOCALID_PLAYER, 0
hideplayer
setvar VAR_0x8004, LOCALID_SLATEPORT_HARBOR_SS_TIDAL
call Common_EventScript_FerryDepart
return

View File

@ -356,7 +356,7 @@ CableClub_EventScript_EnterColosseum::
waitdooranim
applymovement LOCALID_PLAYER, Movement_PlayerEnterLinkRoom
waitmovement 0
hideobjectat LOCALID_PLAYER, 0
hideplayer
closedoor 9, 1
waitdooranim
release
@ -450,7 +450,7 @@ CableClub_EventScript_EnterTradeCenter::
waitdooranim
applymovement LOCALID_PLAYER, Movement_PlayerEnterLinkRoom
waitmovement 0
hideobjectat LOCALID_PLAYER, 0
hideplayer
closedoor 9, 1
waitdooranim
release
@ -515,7 +515,7 @@ CableClub_EventScript_EnterRecordCorner::
waitdooranim
applymovement LOCALID_PLAYER, Movement_PlayerEnterLinkRoom
waitmovement 0
hideobjectat LOCALID_PLAYER, 0
hideplayer
closedoor 9, 1
waitdooranim
release
@ -902,7 +902,7 @@ CableClub_EventScript_EnterUnionRoom::
waitdooranim
applymovement LOCALID_PLAYER, Movement_PlayerEnterLinkRoom
waitmovement 0
hideobjectat LOCALID_PLAYER, 0
hideplayer
closedoor 5, 1
waitdooranim
special Script_ResetUnionRoomTrade
@ -1202,7 +1202,7 @@ CableClub_EventScript_EnterWirelessLinkRoom::
waitdooranim
applymovement LOCALID_PLAYER, Movement_PlayerEnterLinkRoom
waitmovement 0
hideobjectat LOCALID_PLAYER, 0
hideplayer
closedoor 9, 1
waitdooranim
release
@ -1384,7 +1384,7 @@ MossdeepCity_GameCorner_1F_EventScript_EnterMinigameRoom::
closemessage
applymovement LOCALID_PLAYER, Movement_PlayerEnterMinigameRoom
waitmovement 0
hideobjectat LOCALID_PLAYER, 0
hideplayer
release
waitstate
end

View File

@ -39,6 +39,7 @@
- [How to use Trainer Party Pools](tutorials/how_to_trainer_party_pool.md)
- [Changelog](./CHANGELOG.md)
- [1.13.x]()
- [Version 1.13.3](changelogs/1.13.x/1.13.3.md)
- [Version 1.13.2](changelogs/1.13.x/1.13.2.md)
- [Version 1.13.1](changelogs/1.13.x/1.13.1.md)
- [Version 1.13.0](changelogs/1.13.x/1.13.0.md)

View File

@ -0,0 +1,193 @@
```md
## How to update
- If you haven't set up a remote, run the command `git remote add RHH https://github.com/rh-hideout/pokeemerald-expansion`.
- Once you have your remote set up, run the command `git pull RHH expansion/1.13.3
`.
```
## 🧬 General 🧬
### Added
* Add test to detect save file shifting by @Bassoonian in [#8030](https://github.com/rh-hideout/pokeemerald-expansion/pull/8030)
### Changed
* 1.13.2 release by @hedara90 in [#7831](https://github.com/rh-hideout/pokeemerald-expansion/pull/7831)
* Remove unnecessary EWRAM and IWRAM variables from the Window code by @estellarc in [#7897](https://github.com/rh-hideout/pokeemerald-expansion/pull/7897)
* Replace magic numbers with define'd values in field_player_avatar.c by @FosterProgramming in [#7910](https://github.com/rh-hideout/pokeemerald-expansion/pull/7910)
* Pret merge (1st of November, 2025) by @hedara90 in [#8103](https://github.com/rh-hideout/pokeemerald-expansion/pull/8103)
### Fixed
* Fixes `EVO_BATTLE_END` evolutions not removing item with additional conditions by @PhallenTree in [#7841](https://github.com/rh-hideout/pokeemerald-expansion/pull/7841)
* Fix EV display in debug menu by @cawtds in [#7848](https://github.com/rh-hideout/pokeemerald-expansion/pull/7848)
* Fix right player position battle partner target display by @ravepossum in [#7878](https://github.com/rh-hideout/pokeemerald-expansion/pull/7878)
* Ensure last used ball and move description window sprites don't free palette too early by @ravepossum in [#7875](https://github.com/rh-hideout/pokeemerald-expansion/pull/7875)
* Fix fusion pokemon aquiring illegal movesets by @FosterProgramming in [#7896](https://github.com/rh-hideout/pokeemerald-expansion/pull/7896)
- Calyrex will now delete moves if they are not part of its learnset when unfusing
- Kyurem will now properly swap the moves Glaciate and Scary Face to its signature moves when fusing/unfusing
* Fix bug causing hgss dex to freeze by @FosterProgramming in [#7936](https://github.com/rh-hideout/pokeemerald-expansion/pull/7936)
- Fix a bug when checking evolutions info screen while search mode is active in the hgss dex
* Show convergent evolution to Gholdengo in HGSS dex by @FosterProgramming in [#7934](https://github.com/rh-hideout/pokeemerald-expansion/pull/7934)
* Fix HGSS dex sprites for gen9+ by @FosterProgramming in [#7922](https://github.com/rh-hideout/pokeemerald-expansion/pull/7922)
* Fix nicknames containing many / overflowing the party screen textbox by @hedara90 in [#7970](https://github.com/rh-hideout/pokeemerald-expansion/pull/7970)
* Fix ruination and nature's madness damage percentage by @FosterProgramming in [#7983](https://github.com/rh-hideout/pokeemerald-expansion/pull/7983)
* Fix ribbon colours by @hedara90 in [#7971](https://github.com/rh-hideout/pokeemerald-expansion/pull/7971)
* Fix long pokemon name in partner party not appearing properly by @FosterProgramming in [#8009](https://github.com/rh-hideout/pokeemerald-expansion/pull/8009)
* Fix battle dome bug (again) by @FosterProgramming in [#8007](https://github.com/rh-hideout/pokeemerald-expansion/pull/8007)
* Fix battle arena counting all judges loss for the opponent by @FosterProgramming in [#8046](https://github.com/rh-hideout/pokeemerald-expansion/pull/8046)
- Fix battle arena referees giving undeserved wins to the player
* Fix wrong gimmick spite showing when inputting too fast by @FosterProgramming in [#8066](https://github.com/rh-hideout/pokeemerald-expansion/pull/8066)
## 🗺️ Overworld 🗺️
### Fixed
* Fix LTO breaking with FREE_MYSTERY_GIFT set to TRUE by @DizzyEggg in [#7844](https://github.com/rh-hideout/pokeemerald-expansion/pull/7844)
* Fix dns palette weight by @FosterProgramming in [#7855](https://github.com/rh-hideout/pokeemerald-expansion/pull/7855)
* Bug Fix: NPC follower not inheriting facing direction upon creation by @Bivurnum in [#7895](https://github.com/rh-hideout/pokeemerald-expansion/pull/7895)
* Fix follower pokemon not playing animation when colliding by @FosterProgramming in [#7908](https://github.com/rh-hideout/pokeemerald-expansion/pull/7908)
* Fix incorrect font width in Dexnav search window hiding some elements by @FosterProgramming in [#7949](https://github.com/rh-hideout/pokeemerald-expansion/pull/7949)
* Fix dns color transition not applying weather blending by @FosterProgramming in [#7883](https://github.com/rh-hideout/pokeemerald-expansion/pull/7883)
* Fix follower NPC sidewaystair movement by @FosterProgramming in [#7909](https://github.com/rh-hideout/pokeemerald-expansion/pull/7909)
* Fix battle dome pre round 1 waiting room by @FosterProgramming in [#7976](https://github.com/rh-hideout/pokeemerald-expansion/pull/7976)
* Fix no_effect script command overwriting trainer data in trainer script by @FosterProgramming in [#7978](https://github.com/rh-hideout/pokeemerald-expansion/pull/7978)
* Setting wallclock time now properly sets fakeRTC by @FosterProgramming in [#7860](https://github.com/rh-hideout/pokeemerald-expansion/pull/7860)
- Fix time bug when setting wallclock in fakeRTC mode
- When setting the wall clock, it will start on current time instead of 10AM
- If FakeRTC is active, new game will start at 10AM
* Bugfix hidefollower not waiting properly by @FosterProgramming in [#7768](https://github.com/rh-hideout/pokeemerald-expansion/pull/7768)
* Bugfix Emotes not loading their palette by @estellarc in [#7843](https://github.com/rh-hideout/pokeemerald-expansion/pull/7843)
* Fix OW Pokémon VObjects by @HashtagMarky in [#7991](https://github.com/rh-hideout/pokeemerald-expansion/pull/7991)
* fix: hypertraining a stat now optionally reflects in the summary screen by @khbsd in [#8035](https://github.com/rh-hideout/pokeemerald-expansion/pull/8035)
* Fix pc turning on/off animation not working in battle frontier by @FosterProgramming in [#8048](https://github.com/rh-hideout/pokeemerald-expansion/pull/8048)
* Fix non-battle trainer script not running properly by @FosterProgramming in [#8056](https://github.com/rh-hideout/pokeemerald-expansion/pull/8056)
## 🐉 Pokémon 🐉
### Fixed
* Fixes shininess for givemon by @cawtds in [#7847](https://github.com/rh-hideout/pokeemerald-expansion/pull/7847)
* Fix Minior start of battle form by @hedara90 in [#7972](https://github.com/rh-hideout/pokeemerald-expansion/pull/7972)
* Add error messages for trying to send an illegal mon to the PC and fixes index in double wild battles by @hedara90 in [#7982](https://github.com/rh-hideout/pokeemerald-expansion/pull/7982)
* fix: hypertraining a stat now optionally reflects in the summary screen by @khbsd in [#8035](https://github.com/rh-hideout/pokeemerald-expansion/pull/8035)
* Add camera-facing right-walking Krabby and Kingler follower sprites by @rayrobdod in [#7881](https://github.com/rh-hideout/pokeemerald-expansion/pull/7881)
## ⚔️ Battle General ⚔️
### Changed
* Tests for Battery ability by @grintoul1 in [#7846](https://github.com/rh-hideout/pokeemerald-expansion/pull/7846)
* Aura Break tests by @grintoul1 in [#8099](https://github.com/rh-hideout/pokeemerald-expansion/pull/8099)
### Fixed
* Fixes Endure lasting forever by @AlexOn1ine in [#7838](https://github.com/rh-hideout/pokeemerald-expansion/pull/7838)
* Fix for uncaught mon with terrain active by @DizzyEggg in [#7868](https://github.com/rh-hideout/pokeemerald-expansion/pull/7868)
* Fixes Steadfast not activating + tests by @PhallenTree in [#7886](https://github.com/rh-hideout/pokeemerald-expansion/pull/7886)
* Fix hgss pokedex when catching mon with terrain by @DizzyEggg in [#7884](https://github.com/rh-hideout/pokeemerald-expansion/pull/7884)
* Fix SmartStrike crashing the game in double battles by @DizzyEggg in [#7902](https://github.com/rh-hideout/pokeemerald-expansion/pull/7902)
* Fix palaceUnableToUseMove falling through to change battle script by @ghoulslash in [#7912](https://github.com/rh-hideout/pokeemerald-expansion/pull/7912)
* Add new Move target types to GetBattlePalaceMoveGroup by @ghoulslash in [#7913](https://github.com/rh-hideout/pokeemerald-expansion/pull/7913)
* Fixes 2 instances of global usage in the `Cmd_adjustdamage` loop by @AlexOn1ine in [#7918](https://github.com/rh-hideout/pokeemerald-expansion/pull/7918)
* Fix Battle Anim monbg calls Part 1 by @ghoulslash in [#7906](https://github.com/rh-hideout/pokeemerald-expansion/pull/7906)
* Adds missing breakable flag for Bulletproof by @AlexOn1ine in [#7928](https://github.com/rh-hideout/pokeemerald-expansion/pull/7928)
* Fix multiple battle arena bugs by @FosterProgramming in [#7941](https://github.com/rh-hideout/pokeemerald-expansion/pull/7941)
* Fixes Cursed Body failing to disable moves on the last PP by @PhallenTree in [#7940](https://github.com/rh-hideout/pokeemerald-expansion/pull/7940)
* Fixed an issue related to Pokemon animation bleeding into attack anim… by @LinathanZel in [#7924](https://github.com/rh-hideout/pokeemerald-expansion/pull/7924)
* Fixes terrain not failing on duplicate by @AlexOn1ine in [#7939](https://github.com/rh-hideout/pokeemerald-expansion/pull/7939)
* Fix volt tackle not inflicting recoil by @FosterProgramming in [#7944](https://github.com/rh-hideout/pokeemerald-expansion/pull/7944)
* Fix Knock Off not being restored and Wild Battles by @ghoulslash in [#7952](https://github.com/rh-hideout/pokeemerald-expansion/pull/7952)
* Fix Anticipation type effectiveness check by @spindrift64 in [#7840](https://github.com/rh-hideout/pokeemerald-expansion/pull/7840)
* Fix Cherim and Castfrom not reverting to baseform when Teraform Zero is triggered by @FosterProgramming in [#7961](https://github.com/rh-hideout/pokeemerald-expansion/pull/7961)
* Fix Focus Energy boosting crit by the wrong amount with gen1 crit chance by @FosterProgramming in [#7956](https://github.com/rh-hideout/pokeemerald-expansion/pull/7956)
* Fix bug where transformed pokemon lose copied stats on levelup by @FosterProgramming in [#7969](https://github.com/rh-hideout/pokeemerald-expansion/pull/7969)
* Fixes Shields Down incorrectly preventing status on Minior Core form by @PhallenTree in [#7968](https://github.com/rh-hideout/pokeemerald-expansion/pull/7968)
* SetShellSideArmCategory avoid div by zero by @DizzyEggg in [#7980](https://github.com/rh-hideout/pokeemerald-expansion/pull/7980)
* CalcBarFilledPixels Safe Div by @DizzyEggg in [#7979](https://github.com/rh-hideout/pokeemerald-expansion/pull/7979)
* Fix psychic terrain affecting semi-invulnerable mons by @FosterProgramming in [#7986](https://github.com/rh-hideout/pokeemerald-expansion/pull/7986)
* Fixes Terrain Extender timer by @AlexOn1ine in [#7995](https://github.com/rh-hideout/pokeemerald-expansion/pull/7995)
* Fixed Max Move in-battle descriptions by @AsparagusEduardo in [#8004](https://github.com/rh-hideout/pokeemerald-expansion/pull/8004)
* Fixes Echoed Voice base power increase depending on attacker's use of the move by @PhallenTree in [#7997](https://github.com/rh-hideout/pokeemerald-expansion/pull/7997)
* Fixed Stomping Tantrum not doubling in damage if the user failed Protect by @AsparagusEduardo in [#8008](https://github.com/rh-hideout/pokeemerald-expansion/pull/8008)
* Fix badge boost not applying in gen1 and 2 by @FosterProgramming in [#8013](https://github.com/rh-hideout/pokeemerald-expansion/pull/8013)
* Fix toxic debris setting hazards on the wrong side when hit by an ally by @FosterProgramming in [#8026](https://github.com/rh-hideout/pokeemerald-expansion/pull/8026)
* Adds missing alive check for Rapid Spin by @AlexOn1ine in [#8024](https://github.com/rh-hideout/pokeemerald-expansion/pull/8024)
* Fixes visual glitch after Misty Explosion by @AlexOn1ine in [#8022](https://github.com/rh-hideout/pokeemerald-expansion/pull/8022)
* Fixes Protosynthesis not activating after weather was reset by @AlexOn1ine in [#8021](https://github.com/rh-hideout/pokeemerald-expansion/pull/8021)
* Fix Salt Cure script by @AlexOn1ine in [#8005](https://github.com/rh-hideout/pokeemerald-expansion/pull/8005)
* Fix emergency exit not triggering properly during wild battles by @FosterProgramming in [#8037](https://github.com/rh-hideout/pokeemerald-expansion/pull/8037)
* Fix target cancelling not working properly with z-move by @FosterProgramming in [#8067](https://github.com/rh-hideout/pokeemerald-expansion/pull/8067)
* Corrects battler partner identification in battle_ai_switch_items.c by @grintoul1 in [#8071](https://github.com/rh-hideout/pokeemerald-expansion/pull/8071)
* Fix Ally Switch being useable in Frontier Link Multi battles by @grintoul1 in [#8059](https://github.com/rh-hideout/pokeemerald-expansion/pull/8059)
* Fixes hazards and switch-in items not being reset when switching in by @PhallenTree in [#8074](https://github.com/rh-hideout/pokeemerald-expansion/pull/8074)
* Fixes Liquid Ooze dmg not blocked by Magic Guard by @AlexOn1ine in [#8036](https://github.com/rh-hideout/pokeemerald-expansion/pull/8036)
* Fix move description prompt window not appear when choosing a move after canceling target selection by @FosterProgramming in [#8055](https://github.com/rh-hideout/pokeemerald-expansion/pull/8055)
* Initialize DamageContext on declaration to zero by @AlexOn1ine in [#8076](https://github.com/rh-hideout/pokeemerald-expansion/pull/8076)
* Fixed Hunger Switch changing forms on switch out while Tera'd by @AsparagusEduardo in [#8080](https://github.com/rh-hideout/pokeemerald-expansion/pull/8080)
* Fixes Gooey/Tangling Hair ability pop up triggering on Clear Body by @AlexOn1ine in [#8083](https://github.com/rh-hideout/pokeemerald-expansion/pull/8083)
* Fixes intimidate activating on empty field by @AlexOn1ine in [#8058](https://github.com/rh-hideout/pokeemerald-expansion/pull/8058)
* Fix bug where mon selection doesn't properly account for party order by @FosterProgramming in [#8088](https://github.com/rh-hideout/pokeemerald-expansion/pull/8088)
* Fix bug when a captured pokemon replaces a party member who changed forms by @FosterProgramming in [#8091](https://github.com/rh-hideout/pokeemerald-expansion/pull/8091)
* Fixed Zygarde Complete disappearing upon catch by @AsparagusEduardo in [#8089](https://github.com/rh-hideout/pokeemerald-expansion/pull/8089)
* Initialize DamageContext struct with zero values by @AlexOn1ine in [#8107](https://github.com/rh-hideout/pokeemerald-expansion/pull/8107)
## 🤹 Moves 🤹
### Fixed
* Updated Mountain Gale's PP for Gen 9 by @fdeblasio in [#7856](https://github.com/rh-hideout/pokeemerald-expansion/pull/7856)
* Fix Brine move anim and document Water Spout anim by @ravepossum in [#7865](https://github.com/rh-hideout/pokeemerald-expansion/pull/7865)
* Add Struggle tests, weakness berry tests and prevent Struggle from activating Silk Scarf and Chilan Berry by @rayrobdod in [#7880](https://github.com/rh-hideout/pokeemerald-expansion/pull/7880)
* Fix Battle Anim monbg calls Part 1 by @ghoulslash in [#7906](https://github.com/rh-hideout/pokeemerald-expansion/pull/7906)
* Add missing end signal for AnimTask_SetAttackerInvisibleWaitForSignal by @hedara90 in [#7950](https://github.com/rh-hideout/pokeemerald-expansion/pull/7950)
* Fix Ally Switch being useable in Frontier Link Multi battles by @grintoul1 in [#8059](https://github.com/rh-hideout/pokeemerald-expansion/pull/8059)
* Fixed Belly Drum/Contrary interaction at max Attack by @AsparagusEduardo in [#8078](https://github.com/rh-hideout/pokeemerald-expansion/pull/8078)
## 🎭 Abilities 🎭
### Changed
* Tests for Battery ability by @grintoul1 in [#7846](https://github.com/rh-hideout/pokeemerald-expansion/pull/7846)
* Aura Break tests by @grintoul1 in [#8099](https://github.com/rh-hideout/pokeemerald-expansion/pull/8099)
## 🧶 Items 🧶
### Fixed
* Add gBallItemIds Array by @HashtagMarky in [#7905](https://github.com/rh-hideout/pokeemerald-expansion/pull/7905)
* Fix Persim Berry battle usage by @hedara90 in [#7963](https://github.com/rh-hideout/pokeemerald-expansion/pull/7963)
## 🤖 Battle AI 🤖
### Fixed
* Add failsafe to AI_DecideHoldEffectForTurn by @AlexOn1ine in [#7849](https://github.com/rh-hideout/pokeemerald-expansion/pull/7849)
* Fix some ai action check happening before the logic was computed by @FosterProgramming in [#7867](https://github.com/rh-hideout/pokeemerald-expansion/pull/7867)
- Roamers will now flee in the first turn of battle
* Fix ShouldPivot overwriting random memory by @DizzyEggg in [#7882](https://github.com/rh-hideout/pokeemerald-expansion/pull/7882)
* Fix AI seeing priority wrong for players choice lock by @MaximeGr00 in [#7899](https://github.com/rh-hideout/pokeemerald-expansion/pull/7899)
* fix (post-KO switch): force AI data recalc to see abilities on field correctly when pivot moves used by player by @ghostyboyy97 in [#7900](https://github.com/rh-hideout/pokeemerald-expansion/pull/7900)
* Add missing break to Power Split AI case by @ghoulslash in [#7959](https://github.com/rh-hideout/pokeemerald-expansion/pull/7959)
## 🧹 Other Cleanup 🧹
* Fix some failed and assume fail tests with `GEN_LATEST` = `GEN_5` by @AsparagusEduardo in [#7735](https://github.com/rh-hideout/pokeemerald-expansion/pull/7735)
* Update INSTALL.md by @RubyRaven6 in [#7852](https://github.com/rh-hideout/pokeemerald-expansion/pull/7852)
* Remove unnecessary EWRAM and IWRAM variables from the Window code by @estellarc in [#7897](https://github.com/rh-hideout/pokeemerald-expansion/pull/7897)
* Replace magic numbers with define'd values in field_player_avatar.c by @FosterProgramming in [#7910](https://github.com/rh-hideout/pokeemerald-expansion/pull/7910)
* Reverts wrongly applies fix to book.toml by @AlexOn1ine in [#8105](https://github.com/rh-hideout/pokeemerald-expansion/pull/8105)
## 🧪 Test Runner 🧪
### Changed
* Fix some failed and assume fail tests with `GEN_LATEST` = `GEN_5` by @AsparagusEduardo in [#7735](https://github.com/rh-hideout/pokeemerald-expansion/pull/7735)
* Tests for Battery ability by @grintoul1 in [#7846](https://github.com/rh-hideout/pokeemerald-expansion/pull/7846)
* Fixed fainting form change tests by @AsparagusEduardo in [#8079](https://github.com/rh-hideout/pokeemerald-expansion/pull/8079)
* Aura Break tests by @grintoul1 in [#8099](https://github.com/rh-hideout/pokeemerald-expansion/pull/8099)
### Fixed
* Fix Knock Off not being restored and Wild Battles by @ghoulslash in [#7952](https://github.com/rh-hideout/pokeemerald-expansion/pull/7952)
* Fixes Shields Down incorrectly preventing status on Minior Core form by @PhallenTree in [#7968](https://github.com/rh-hideout/pokeemerald-expansion/pull/7968)
* Fixed Stomping Tantrum not doubling in damage if the user failed Protect by @AsparagusEduardo in [#8008](https://github.com/rh-hideout/pokeemerald-expansion/pull/8008)
* Fix stats defined in tests being overwritteng by stat change by @FosterProgramming in [#8018](https://github.com/rh-hideout/pokeemerald-expansion/pull/8018)
## 📚 Documentation 📚
* Update INSTALL.md by @RubyRaven6 in [#7852](https://github.com/rh-hideout/pokeemerald-expansion/pull/7852)
* Updated PR template to make existing credit policy clearer by @pkmnsnfrn in [#7864](https://github.com/rh-hideout/pokeemerald-expansion/pull/7864)
* Fix image links in doc site by @rayrobdod in [#7948](https://github.com/rh-hideout/pokeemerald-expansion/pull/7948)
* Add all pages in `docs` to doc website by @rayrobdod in [#7907](https://github.com/rh-hideout/pokeemerald-expansion/pull/7907)
* Relativize doc links, to fix links in docs site by @rayrobdod in [#7964](https://github.com/rh-hideout/pokeemerald-expansion/pull/7964)
* Fix docs compile issue by @AlexOn1ine in [#8101](https://github.com/rh-hideout/pokeemerald-expansion/pull/8101)
* Reverts wrongly applies fix to book.toml by @AlexOn1ine in [#8105](https://github.com/rh-hideout/pokeemerald-expansion/pull/8105)
## New Contributors
* @HashtagMarky made their first contribution in [#7905](https://github.com/rh-hideout/pokeemerald-expansion/pull/7905)
* @MaximeGr00 made their first contribution in [#7899](https://github.com/rh-hideout/pokeemerald-expansion/pull/7899)
**Full Changelog**: https://github.com/rh-hideout/pokeemerald-expansion/compare/expansion/1.13.2...expansion/1.13.3
<!--Last PR: 8107-->
<!--Used to keep track of the last PR merged in case new ones come in before the changelog is done.-->

Binary file not shown.

Before

Width:  |  Height:  |  Size: 284 B

After

Width:  |  Height:  |  Size: 277 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 293 B

After

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 297 B

After

Width:  |  Height:  |  Size: 284 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 296 B

After

Width:  |  Height:  |  Size: 278 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 336 B

After

Width:  |  Height:  |  Size: 328 B

View File

@ -15,6 +15,7 @@
#include "battle_util2.h"
#include "battle_bg.h"
#include "pokeball.h"
#include "main.h"
#include "battle_debug.h"
#include "battle_dynamax.h"
#include "battle_terastal.h"
@ -1117,7 +1118,7 @@ extern u16 gBattleTurnCounter;
extern u8 gBattlerAbility;
extern struct QueuedStatBoost gQueuedStatBoosts[MAX_BATTLERS_COUNT];
extern void (*gPreBattleCallback1)(void);
extern MainCallback gPreBattleCallback1;
extern void (*gBattleMainFunc)(void);
extern struct BattleResults gBattleResults;
extern u8 gLeveledUpInBattle;

View File

@ -2,6 +2,8 @@
#define GUARD_BATTLE_PYRAMID_BAG_H
#include "list_menu.h"
#include "main.h"
#include "task.h"
enum {
PYRAMIDBAG_LOC_FIELD,
@ -29,7 +31,7 @@ enum {
struct PyramidBagMenu
{
void (*newScreenCallback)(void);
MainCallback newScreenCallback;
u8 tilemapBuffer[BG_SCREEN_SIZE];
u8 spriteIds[PBAG_SPRITE_COUNT];
u8 windowIds[5];
@ -49,7 +51,7 @@ struct PyramidBagMenu
struct PyramidBagMenuState
{
void (*exitCallback)(void);
MainCallback exitCallback;
u8 location;
u16 cursorPosition;
u16 scrollPosition;
@ -63,11 +65,11 @@ void CB2_PyramidBagMenuFromStartMenu(void);
void CB2_ReturnToPyramidBagMenu(void);
void UpdatePyramidBagList(void);
void UpdatePyramidBagCursorPos(void);
void GoToBattlePyramidBagMenu(u8 location, void (*exitCallback)(void));
void GoToBattlePyramidBagMenu(u8 location, MainCallback exitCallback);
void Task_CloseBattlePyramidBagMessage(u8 taskId);
void TryStoreHeldItemsInPyramidBag(void);
void ChooseItemsToTossFromPyramidBag(void);
void CloseBattlePyramidBag(u8 taskId);
void DisplayItemMessageInBattlePyramid(u8 taskId, const u8 *str, void (*callback)(u8 taskId));
void DisplayItemMessageInBattlePyramid(u8 taskId, const u8 *str, TaskFunc callback);
#endif // GUARD_BATTLE_PYRAMID_BAG_H

View File

@ -1,7 +1,7 @@
#ifndef GUARD_CONSTANTS_EXPANSION_H
#define GUARD_CONSTANTS_EXPANSION_H
// Last version: 1.13.2
// Last version: 1.13.3
#define EXPANSION_VERSION_MAJOR 1
#define EXPANSION_VERSION_MINOR 14
#define EXPANSION_VERSION_PATCH 0

View File

@ -3,11 +3,14 @@
#include "map_groups.h"
// Warps using this map will instead use the warp data stored in gSaveBlock1Ptr->dynamicWarp.
// Used for warps that need to change destinations, e.g. when stepping off an elevator.
#define MAP_DYNAMIC (0x7F | (0x7F << 8))
enum
{
// Warps using this map will instead use the warp data stored in gSaveBlock1Ptr->dynamicWarp.
// Used for warps that need to change destinations, e.g. when stepping off an elevator.
MAP_DYNAMIC = (0x7F | (0x7F << 8)),
#define MAP_UNDEFINED (0xFF | (0xFF << 8))
MAP_UNDEFINED = (0xFF | (0xFF << 8)),
};
#define MAP_GROUP(map) (map >> 8)
#define MAP_NUM(map) (map & 0xFF)

View File

@ -1,7 +1,9 @@
#ifndef GUARD_DODRIO_BERRY_PICKING_H
#define GUARD_DODRIO_BERRY_PICKING_H
void StartDodrioBerryPicking(u16 partyId, void (*exitCallback)(void));
#include "main.h"
void StartDodrioBerryPicking(u16 partyId, MainCallback exitCallback);
void IsDodrioInParty(void);
void ShowDodrioBerryPickingRecords(void);

67
include/gametypes.h Normal file
View File

@ -0,0 +1,67 @@
#ifndef GUARD_GAMETYPES_H
#define GUARD_GAMETYPES_H
#include "gba/types.h"
//
// This header includes typedefs for fields that commonly appear throughout
// the codebase, and which ROM hacks might benefit from being able to widen.
//
// These typedefs include the underlying type in their name for two reasons:
//
// - Game Freak wasn't fully consistent about field widths throughout
// their codebase. For example, when Region Map Sections are persistently
// stored in savedata, they're stored as 8-bit values; but much of the
// codebase handles them as 16-bit values.
//
// - Although Pokemon Emerald doesn't come close to maxing out RAM, it *does*
// use nearly all of its EEPROM. That is: the vanilla game uses 96% of the
// flash memory available for storing players' save files, leaving 2172
// bytes to spare within each of the game's two save files (primary and
// backup). These spare bytes are not contiguous: SaveBlock1 can only grow
// by 84 bytes, and SaveBlock2 can only grow by 120 bytes, with the rest
// of the free space located after the player's PC-boxed Pokemon.
//
// With so little flash memory to spare, keeping track of how much space
// you're using is vital -- and so is arranging struct members to minimize
// compiler-inserted padding. It's easier to deal with this when you can
// see these types' widths at a glance.
//
// Accordingly, this file generally doesn't contain just single types, but
// rather families of types. For example, Region Map Sections are saved as
// u8s within the player's save file, but are sometimes handled as u16s or
// even s16s and ints; and so there are multiple typedefs for Map Sections
// corresponding to each of these underlying types, and each typedef has a
// name which indicates the underlying type.
//
// For a given family of typedefs, the smallest one should be considered
// the "real" or "canonical" type. Continuing with Map Sections as our
// example, the smallest type is an 8-bit integer, and so any values that
// can't fit in an 8-bit integer will be truncated and lost at some point
// within the codebase. Therefore mapsec_u8_t is the "canonical" type for
// Map Sections, and the larger typedefs just exist to describe situations
// where the game handles Map Sections inconsistently with that "canon."
//
// Map Sections are named areas that can appear in the region map. Each
// individual map can be assigned to a Map Section as appropriate. The
// possible values are in constants/region_map_sections.h.
//
// If you choose to widen Map Sections, be aware that Met Locations (below)
// are based on Map Sections and will also be widened.
typedef u8 mapsec_u8_t;
typedef u16 mapsec_u16_t;
typedef s16 mapsec_s16_t;
typedef s32 mapsec_s32_t;
// Met Locations for caught Pokemon use the same values as Map Sections,
// except that 0xFD, 0xFE, and 0xFF have special meanings.
//
// Because this value appears inside every Pokemon's data, widening it will
// consume a lot more space within flash memory. The space usage will be
// greater than you expect due to how Pokemon substructs are laid out; you
// would have to rearrange the substructs' contents in order to minimize
// how much more space a wider Met Location would consume.
typedef mapsec_u8_t metloc_u8_t;
#endif //GUARD_GAMETYPES_H

View File

@ -169,7 +169,7 @@ struct MapHeader
/* 0x0C */ const struct MapConnections *connections;
/* 0x10 */ u16 music;
/* 0x12 */ u16 mapLayoutId;
/* 0x14 */ u8 regionMapSectionId;
/* 0x14 */ mapsec_u8_t regionMapSectionId;
/* 0x15 */ u8 cave;
/* 0x16 */ u8 weather;
/* 0x17 */ u8 mapType;

View File

@ -5,6 +5,7 @@
#include <limits.h>
#include "config/general.h" // we need to define config before gba headers as print stuff needs the functions nulled before defines.
#include "gba/gba.h"
#include "gametypes.h"
#include "siirtc.h"
#include "fpmath.h"
#include "metaprogram.h"

View File

@ -226,7 +226,7 @@ typedef union // size = 0x24
/*0x04*/ u8 filler_04[2];
/*0x06*/ u16 itemIds[SMARTSHOPPER_NUM_ITEMS];
/*0x0C*/ u16 itemAmounts[SMARTSHOPPER_NUM_ITEMS];
/*0x12*/ u8 shopLocation;
/*0x12*/ mapsec_u8_t shopLocation;
/*0x13*/ u8 playerName[PLAYER_NAME_LENGTH + 1];
/*0x1B*/ //u8 padding;
} smartshopperShow;
@ -241,7 +241,7 @@ typedef union // size = 0x24
/*0x0E*/ u16 species2;
/*0x10*/ u8 nBallsUsed;
/*0x11*/ u8 outcome;
/*0x12*/ u8 location;
/*0x12*/ mapsec_u8_t location;
/*0x13*/ u8 playerName[PLAYER_NAME_LENGTH + 1];
/*0x1B*/ //u8 padding;
} pokemonTodayFailed;
@ -267,7 +267,7 @@ typedef union // size = 0x24
/*0x04*/ u16 caughtPoke;
/*0x06*/ u16 steps;
/*0x08*/ u16 species;
/*0x0A*/ u8 location;
/*0x0A*/ mapsec_u8_t location;
/*0x0B*/ u8 language;
/*0x0C*/ u8 filler_0C[7];
/*0x13*/ u8 playerName[PLAYER_NAME_LENGTH + 1];
@ -282,7 +282,7 @@ typedef union // size = 0x24
/*0x04*/ u8 badgeCount;
/*0x05*/ u8 nSilverSymbols;
/*0x06*/ u8 nGoldSymbols;
/*0x07*/ u8 location;
/*0x07*/ mapsec_u8_t location;
/*0x08*/ u16 battlePoints;
/*0x0A*/ u16 mapLayoutId;
/*0x0C*/ u8 language;
@ -309,7 +309,7 @@ typedef union // size = 0x24
/*0x00*/ u8 kind;
/*0x01*/ bool8 active;
/*0x02*/ u16 item;
/*0x04*/ u8 location;
/*0x04*/ mapsec_u8_t location;
/*0x05*/ u8 language;
/*0x06*/ u16 mapLayoutId;
/*0x08*/ u8 filler_08[11];
@ -336,7 +336,7 @@ typedef union // size = 0x24
/*0x00*/ u8 kind;
/*0x01*/ bool8 active;
/*0x02*/ u16 lastOpponentSpecies;
/*0x04*/ u8 location;
/*0x04*/ mapsec_u8_t location;
/*0x05*/ u8 outcome;
/*0x06*/ u16 caughtMonBall;
/*0x08*/ u16 balls;
@ -505,7 +505,7 @@ struct GabbyAndTyData
/*2BA6*/ u16 mon2;
/*2BA8*/ u16 lastMove;
/*2BAA*/ u16 quote[1];
/*2BAC*/ u8 mapnum;
/*2BAC*/ mapsec_u8_t mapnum;
/*2BAD*/ u8 battleNum;
/*2BAE*/ u8 battleTookMoreThanOneTurn:1;
u8 playerLostAMon:1;

View File

@ -2,6 +2,7 @@
#define GUARD_ITEM_MENU_H
#include "item.h"
#include "main.h"
#include "menu_helpers.h"
enum {
@ -57,7 +58,7 @@ enum {
struct BagPosition
{
void (*exitCallback)(void);
MainCallback exitCallback;
u8 location;
u8 pocket;
u16 pocketSwitchArrowPos;
@ -69,7 +70,7 @@ extern struct BagPosition gBagPosition;
struct BagMenu
{
void (*newScreenCallback)(void);
MainCallback newScreenCallback;
u8 tilemapBuffer[BG_SCREEN_SIZE];
u8 spriteIds[ITEMMENUSPRITE_COUNT];
u8 windowIds[ITEMWIN_COUNT];
@ -106,16 +107,16 @@ void CB2_BagMenuFromStartMenu(void);
u8 GetItemListPosition(u8 pocketId);
bool8 UseRegisteredKeyItemOnField(void);
void CB2_GoToSellMenu(void);
void GoToBagMenu(u8 location, u8 pocket, void ( *exitCallback)());
void GoToBagMenu(u8 location, u8 pocket, MainCallback exitCallback);
void DoWallyTutorialBagMenu(void);
void ResetBagScrollPositions(void);
void ChooseBerryForMachine(void (*exitCallback)(void));
void ChooseBerryForMachine(MainCallback exitCallback);
void CB2_ChooseBerry(void);
void CB2_ChooseMulch(void);
void Task_FadeAndCloseBagMenu(u8 taskId);
void BagMenu_YesNo(u8 taskId, u8 windowType, const struct YesNoFuncTable *funcTable);
void UpdatePocketItemList(enum Pocket pocketId);
void DisplayItemMessage(u8 taskId, u8 fontId, const u8 *str, void (*callback)(u8 taskId));
void DisplayItemMessage(u8 taskId, u8 fontId, const u8 *str, TaskFunc callback);
void DisplayItemMessageOnField(u8 taskId, const u8 *string, TaskFunc callback);
void CloseItemMessage(u8 taskId);
void ItemMenu_RotomCatalog(u8 taskId);

View File

@ -1,6 +1,6 @@
#ifndef GUARD_LANDMARK_H
#define GUARD_LANDMARK_H
const u8 *GetLandmarkName(u8 mapSection, u8 id, u8 count);
const u8 *GetLandmarkName(mapsec_u8_t mapSection, u8 id, u8 count);
#endif // GUARD_LANDMARK_H

View File

@ -1,6 +1,8 @@
#ifndef GUARD_MAIL_H
#define GUARD_MAIL_H
#include "main.h"
#define IS_ITEM_MAIL(itemId) ((itemId == ITEM_ORANGE_MAIL \
|| itemId == ITEM_HARBOR_MAIL \
|| itemId == ITEM_GLITTER_MAIL \
@ -15,7 +17,7 @@
|| itemId == ITEM_RETRO_MAIL))
// mail.h
void ReadMail(struct Mail *mail, void (*exitCallback)(void), bool8 hasText);
void ReadMail(struct Mail *mail, MainCallback exitCallback, bool8 hasText);
// mail_data.h
void ClearAllMail(void);

View File

@ -135,8 +135,8 @@ enum MapType GetLastUsedWarpMapType(void);
bool8 IsMapTypeOutdoors(enum MapType mapType);
bool8 Overworld_MapTypeAllowsTeleportAndFly(enum MapType mapType);
bool8 IsMapTypeIndoors(enum MapType mapType);
u8 GetSavedWarpRegionMapSectionId(void);
u8 GetCurrentRegionMapSectionId(void);
mapsec_u8_t GetSavedWarpRegionMapSectionId(void);
mapsec_u8_t GetCurrentRegionMapSectionId(void);
enum MapBattleScene GetCurrentMapBattleScene(void);
void CleanupOverworldWindowsAndTilemaps(void);
bool32 IsOverworldLinkActive(void);

View File

@ -17,7 +17,7 @@ struct PokenavMonListItem
struct PokenavMatchCallEntry
{
bool8 isSpecialTrainer;
u8 mapSec;
mapsec_u8_t mapSec;
u16 headerId;
};
@ -413,7 +413,7 @@ void FreeMatchCallSubstruct1(void);
int IsMatchCallListInitFinished(void);
int GetNumberRegistered(void);
struct PokenavMatchCallEntry *GetMatchCallList(void);
u16 GetMatchCallMapSec(int index);
mapsec_u16_t GetMatchCallMapSec(int index);
bool32 ShouldDrawRematchPokeballIcon(int index);
void ClearRematchPokeballIcon(u16 windowId, u32 tileOffset);
int GetMatchCallTrainerPic(int index);
@ -422,7 +422,7 @@ const u8 *GetMatchCallMessageText(int index, bool8 *newRematchRequest);
u16 GetMatchCallOptionCursorPos(void);
u16 GetMatchCallOptionId(int optionId);
void BufferMatchCallNameAndDesc(struct PokenavMatchCallEntry *matchCallEntry, u8 *str);
u8 GetMatchTableMapSectionId(int rematchIndex);
mapsec_u8_t GetMatchTableMapSectionId(int rematchIndex);
int GetIndexDeltaOfNextCheckPageDown(int index);
int GetIndexDeltaOfNextCheckPageUp(int index);
bool32 IsRematchEntryRegistered(int rematchIndex);

View File

@ -1,6 +1,8 @@
#ifndef GUARD_RAYQUAZA_SCENE_H
#define GUARD_RAYQUAZA_SCENE_H
void DoRayquazaScene(u8 animId, bool8 endEarly, void (*exitCallback)(void));
#include "main.h"
void DoRayquazaScene(u8 animId, bool8 endEarly, MainCallback exitCallback);
#endif // GUARD_RAYQUAZA_SCENE_H

View File

@ -27,7 +27,7 @@ enum {
};
struct RegionMap {
/*0x000*/ u16 mapSecId;
/*0x000*/ mapsec_u16_t mapSecId;
/*0x002*/ u8 mapSecType;
/*0x003*/ u8 posWithinMapSec;
/*0x004*/ u8 mapSecName[20];
@ -100,14 +100,14 @@ void InitRegionMap(struct RegionMap *regionMap, bool8 zoomed);
u8 DoRegionMapInputCallback(void);
bool8 UpdateRegionMapZoom(void);
void FreeRegionMapIconResources(void);
u16 GetRegionMapSecIdAt(u16 x, u16 y);
mapsec_u16_t GetRegionMapSecIdAt(u16 x, u16 y);
void CreateRegionMapPlayerIcon(u16 tileTag, u16 paletteTag);
void CreateRegionMapCursor(u16 tileTag, u16 paletteTag);
bool32 IsEventIslandMapSecId(u8 mapSecId);
u8 *GetMapName(u8 *dest, u16 regionMapId, u16 padLength);
u8 *GetMapNameGeneric(u8 *dest, u16 mapSecId);
u8 *GetMapNameHandleAquaHideout(u8 *dest, u16 mapSecId);
u16 CorrectSpecialMapSecId(u16 mapSecId);
bool32 IsEventIslandMapSecId(mapsec_u8_t mapSecId);
u8 *GetMapName(u8 *dest, mapsec_u16_t regionMapId, u16 padLength);
u8 *GetMapNameGeneric(u8 *dest, mapsec_u16_t mapSecId);
u8 *GetMapNameHandleAquaHideout(u8 *dest, mapsec_u16_t mapSecId);
mapsec_u16_t CorrectSpecialMapSecId(mapsec_u16_t mapSecId);
void ShowRegionMapForPokedexAreaScreen(struct RegionMap *regionMap);
void PokedexAreaScreen_UpdateRegionMapVariablesAndVideoRegs(s16 x, s16 y);
void CB2_OpenFlyMap(void);

View File

@ -1,6 +1,8 @@
#ifndef GUARD_SAVE_H
#define GUARD_SAVE_H
#include "main.h"
// Each 4 KiB flash sector contains 3968 bytes of actual data followed by 116 bytes of SaveBlock3 and then 12 bytes of footer.
#define SECTOR_DATA_SIZE 3968
#define SAVE_BLOCK_3_CHUNK_SIZE 116
@ -87,7 +89,7 @@ extern u32 gSaveCounter;
extern struct SaveSector *gFastSaveSector;
extern u16 gIncrementalSectorId;
extern u16 gSaveFileStatus;
extern void (*gGameContinueCallback)(void);
extern MainCallback gGameContinueCallback;
extern struct SaveSectorLocation gRamSaveSectorLocations[];
extern struct SaveSector gSaveDataBuffer;

View File

@ -1,6 +1,7 @@
POKEMONGFXDIR := graphics/pokemon
OBJEVENTGFXDIR := graphics/object_events/pics
FLDEFFGFXDIR := graphics/field_effects/pics
BATINTGFXDIR := graphics/battle_interface
MISCGFXDIR := graphics/misc
$(OBJEVENTGFXDIR)/people/brendan/walking.4bpp: %.4bpp: %.png
@ -4940,3 +4941,18 @@ $(OBJEVENTGFXDIR)/misc/ball_%.4bpp: $(OBJEVENTGFXDIR)/misc/ball_%.png ; $(GFX) $
graphics/door_anims/battle_tower_multi_corridor.4bpp: %.4bpp: %.png
$(GFX) $< $@ -mwidth 2 -mheight 4
$(BATINTGFXDIR)/healthbox_doubles_opponent.4bpp: %.4bpp: %.png
$(GFX) $< $@ -mwidth 8 -mheight 4
$(BATINTGFXDIR)/healthbox_doubles_player.4bpp: %.4bpp: %.png
$(GFX) $< $@ -mwidth 8 -mheight 4
$(BATINTGFXDIR)/healthbox_safari.4bpp: %.4bpp: %.png
$(GFX) $< $@ -mwidth 8 -mheight 8
$(BATINTGFXDIR)/healthbox_singles_opponent.4bpp: %.4bpp: %.png
$(GFX) $< $@ -mwidth 8 -mheight 4
$(BATINTGFXDIR)/healthbox_singles_player.4bpp: %.4bpp: %.png
$(GFX) $< $@ -mwidth 8 -mheight 8

View File

@ -125,7 +125,7 @@ struct FactorySelectScreen
struct SwapScreenAction
{
u8 id;
void (*func)(u8 taskId);
TaskFunc func;
};
struct FactorySwapScreen
@ -253,7 +253,7 @@ static EWRAM_DATA u8 *sSwapMenuTilemapBuffer = NULL;
static EWRAM_DATA u8 *sSwapMonPicBgTilemapBuffer = NULL;
static struct FactorySelectScreen *sFactorySelectScreen;
static void (*sSwap_CurrentOptionFunc)(u8 taskId);
static TaskFunc sSwap_CurrentOptionFunc;
static struct FactorySwapScreen *sFactorySwapScreen;
COMMON_DATA u8 (*gFactorySelect_CurrentOptionFunc)(void) = NULL;
@ -886,7 +886,7 @@ static const struct SpriteTemplate sSpriteTemplate_Swap_MonPicBgAnim =
.callback = SpriteCallbackDummy
};
void static (*const sSwap_MenuOptionFuncs[])(u8 taskId) =
static const TaskFunc sSwap_MenuOptionFuncs[] =
{
Swap_OptionSummary,
Swap_OptionSwap,

View File

@ -245,7 +245,7 @@ EWRAM_DATA u8 gPartyCriticalHits[PARTY_SIZE] = {0};
EWRAM_DATA static u8 sTriedEvolving = 0;
EWRAM_DATA u8 gCategoryIconSpriteId = 0;
COMMON_DATA void (*gPreBattleCallback1)(void) = NULL;
COMMON_DATA MainCallback gPreBattleCallback1 = NULL;
COMMON_DATA void (*gBattleMainFunc)(void) = NULL;
COMMON_DATA struct BattleResults gBattleResults = {0};
COMMON_DATA u8 gLeveledUpInBattle = 0;

View File

@ -16,7 +16,6 @@
#include "item_use.h"
#include "list_menu.h"
#include "mail.h"
#include "main.h"
#include "malloc.h"
#include "menu.h"
#include "menu_helpers.h"
@ -414,7 +413,7 @@ void CB2_ReturnToPyramidBagMenu(void)
GoToBattlePyramidBagMenu(PYRAMIDBAG_LOC_PREV, gPyramidBagMenuState.exitCallback);
}
void GoToBattlePyramidBagMenu(u8 location, void (*exitCallback)(void))
void GoToBattlePyramidBagMenu(u8 location, MainCallback exitCallback)
{
gPyramidBagMenu = AllocZeroed(sizeof(*gPyramidBagMenu));
@ -1526,7 +1525,7 @@ static void CreatePyramidBagYesNo(u8 taskId, const struct YesNoFuncTable *yesNoT
CreateYesNoMenuWithCallbacks(taskId, &sWindowTemplates_MenuActions[MENU_WIN_YESNO], 1, 0, 2, 1, 0xE, yesNoTable);
}
void DisplayItemMessageInBattlePyramid(u8 taskId, const u8 *str, void (*callback)(u8 taskId))
void DisplayItemMessageInBattlePyramid(u8 taskId, const u8 *str, TaskFunc callback)
{
FillWindowPixelBuffer(WIN_MSG, PIXEL_FILL(1));
DisplayMessageAndContinueTask(taskId, WIN_MSG, 0xA, 0xD, FONT_NORMAL, GetPlayerTextSpeedDelay(), str, callback);

View File

@ -1750,7 +1750,7 @@ static void Cmd_damagecalc(void)
u32 moveTarget = GetBattlerMoveTargetType(gBattlerAttacker, gCurrentMove);
struct DamageContext ctx;
struct DamageContext ctx = {0};
ctx.battlerAtk = gBattlerAttacker;
ctx.move = gCurrentMove;
ctx.moveType = GetBattleMoveType(gCurrentMove);

View File

@ -1,4 +1,4 @@
static const u8 sRegionMap_MapSectionLayout[MAP_HEIGHT][MAP_WIDTH] = {
static const mapsec_u8_t sRegionMap_MapSectionLayout[MAP_HEIGHT][MAP_WIDTH] = {
{MAPSEC_NONE, MAPSEC_ROUTE_114, MAPSEC_ROUTE_114, MAPSEC_FALLARBOR_TOWN, MAPSEC_ROUTE_113, MAPSEC_ROUTE_113, MAPSEC_ROUTE_113, MAPSEC_ROUTE_113, MAPSEC_ROUTE_111, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_ROUTE_119, MAPSEC_FORTREE_CITY, MAPSEC_ROUTE_120, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE},
{MAPSEC_NONE, MAPSEC_ROUTE_114, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_MT_CHIMNEY, MAPSEC_MT_CHIMNEY, MAPSEC_ROUTE_111, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_ROUTE_119, MAPSEC_NONE, MAPSEC_ROUTE_120, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE},
{MAPSEC_ROUTE_115, MAPSEC_ROUTE_114, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_MT_CHIMNEY, MAPSEC_MT_CHIMNEY, MAPSEC_ROUTE_111, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_ROUTE_119, MAPSEC_NONE, MAPSEC_ROUTE_120, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_SAFARI_ZONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE, MAPSEC_NONE},

View File

@ -1106,7 +1106,7 @@ void CreateEgg(struct Pokemon *mon, u16 species, bool8 setHotSpringsLocation)
u8 metLevel;
enum PokeBall ball;
u8 language;
u8 metLocation;
metloc_u8_t metLocation;
u8 isEgg;
CreateMon(mon, species, EGG_HATCH_LEVEL, USE_RANDOM_IVS, FALSE, 0, OT_ID_PLAYER_ID, 0);

View File

@ -1517,7 +1517,7 @@ static u8 GetEncounterLevelFromMapData(u16 species, enum EncounterType environme
{
u32 headerId = GetCurrentMapWildMonHeaderId();
enum TimeOfDay timeOfDay;
u8 min = 100;
u8 min = MAX_LEVEL;
u8 max = 0;
u8 i;

View File

@ -11,7 +11,6 @@
#include "link.h"
#include "link_rfu.h"
#include "m4a.h"
#include "main.h"
#include "palette.h"
#include "minigame_countdown.h"
#include "random.h"
@ -224,7 +223,7 @@ struct DodrioGame_ScoreResults
struct DodrioGame
{
/*0x0000*/ void (*exitCallback)(void);
/*0x0000*/ MainCallback exitCallback;
/*0x0004*/ u8 ALIGNED(4) taskId;
/*0x0008*/ u8 ALIGNED(4) playersReceived;
/*0x000C*/ u8 ALIGNED(4) startState;
@ -662,7 +661,7 @@ static void (*const sMemberFuncs[])(void) =
[FUNC_WAIT_END_GAME] = WaitEndGame_Member
};
void StartDodrioBerryPicking(u16 partyId, void (*exitCallback)(void))
void StartDodrioBerryPicking(u16 partyId, MainCallback exitCallback)
{
sExitingGame = FALSE;

View File

@ -365,7 +365,7 @@ static void AddHatchedMonToParty(u8 id)
enum NationalDexOrder species;
u8 name[POKEMON_NAME_LENGTH + 1];
u16 metLevel;
u8 metLocation;
metloc_u8_t metLocation;
struct Pokemon *mon = &gPlayerParty[id];
CreateHatchedMon(mon, &gEnemyParty[0]);

View File

@ -339,9 +339,9 @@ bool8 IsComputerScreenCloseEffectActive(void)
#define tBlendCnt data[7]
#define tBlendY data[8]
static void CreateComputerScreenEffectTask(void (*taskfunc) (u8), u16 increment, u16 unused, u8 priority)
static void CreateComputerScreenEffectTask(TaskFunc func, u16 increment, u16 unused, u8 priority)
{
u8 taskId = CreateTask(taskfunc, priority);
u8 taskId = CreateTask(func, priority);
gTasks[taskId].tState = 0;
gTasks[taskId].tHorzIncrement = increment == 0 ? 16 : increment;

View File

@ -106,7 +106,7 @@ enum {
struct FrontierPassData
{
void (*callback)(void);
MainCallback callback;
u16 state;
u16 battlePoints;
s16 cursorX;
@ -137,14 +137,14 @@ struct FrontierPassGfx
struct FrontierPassSaved
{
void (*callback)(void);
MainCallback callback;
s16 cursorX;
s16 cursorY;
};
struct FrontierMapData
{
void (*callback)(void);
MainCallback callback;
struct Sprite *cursorSprite;
struct Sprite *playerHeadSprite;
struct Sprite *mapIndicatorSprite;
@ -160,8 +160,8 @@ static EWRAM_DATA struct FrontierPassGfx *sPassGfx = NULL;
static EWRAM_DATA struct FrontierMapData *sMapData = NULL;
static EWRAM_DATA struct FrontierPassSaved sSavedPassData = {0};
static u32 AllocateFrontierPassData(void (*callback)(void));
static void ShowFrontierMap(void (*callback)(void));
static u32 AllocateFrontierPassData(MainCallback callback);
static void ShowFrontierMap(MainCallback callback);
static void CB2_InitFrontierPass(void);
static void DrawFrontierPassBg(void);
static void FreeCursorAndSymbolSprites(void);
@ -604,9 +604,11 @@ static void LeaveFrontierPass(void)
FreeFrontierPassData();
}
static u32 AllocateFrontierPassData(void (*callback)(void))
static u32 AllocateFrontierPassData(MainCallback callback)
{
u8 i;
// This variable is a MAPSEC initially, but is recycled as a
// bare integer near the end of the function.
mapsec_u8_t i;
if (sPassData != NULL)
return ERR_ALREADY_DONE;
@ -1363,7 +1365,7 @@ static void PrintOnFrontierMap(void);
static void InitFrontierMapSprites(void);
static void HandleFrontierMapCursorMove(u8 direction);
static void ShowFrontierMap(void (*callback)(void))
static void ShowFrontierMap(MainCallback callback)
{
if (sMapData != NULL)
SetMainCallback2(callback); // This line doesn't make sense at all, since it gets overwritten later anyway.

View File

@ -24,7 +24,6 @@
#include "list_menu.h"
#include "link.h"
#include "mail.h"
#include "main.h"
#include "malloc.h"
#include "map_name_popup.h"
#include "menu.h"
@ -614,7 +613,7 @@ void CB2_ChooseMulch(void)
}
// Choosing berry for Berry Blender or Berry Crush
void ChooseBerryForMachine(void (*exitCallback)(void))
void ChooseBerryForMachine(MainCallback exitCallback)
{
GoToBagMenu(ITEMMENULOCATION_BERRY_BLENDER_CRUSH, POCKET_BERRIES, exitCallback);
}
@ -648,7 +647,7 @@ void QuizLadyOpenBagMenu(void)
gSpecialVar_Result = FALSE;
}
void GoToBagMenu(u8 location, u8 pocket, void ( *exitCallback)())
void GoToBagMenu(u8 location, u8 pocket, MainCallback exitCallback)
{
gBagMenu = AllocZeroed(sizeof(*gBagMenu));
if (gBagMenu == NULL)
@ -1208,7 +1207,7 @@ u8 GetItemListPosition(u8 pocketId)
return gBagPosition.scrollPosition[pocketId] + gBagPosition.cursorPosition[pocketId];
}
void DisplayItemMessage(u8 taskId, u8 fontId, const u8 *str, void (*callback)(u8 taskId))
void DisplayItemMessage(u8 taskId, u8 fontId, const u8 *str, TaskFunc callback)
{
s16 *data = gTasks[taskId].data;

View File

@ -97,7 +97,7 @@ static const u8 sText_PlayedPokeFlute[] = _("Played the POKé FLUTE.");
static const u8 sText_PokeFluteAwakenedMon[] = _("The POKé FLUTE awakened sleeping\nPOKéMON.{PAUSE_UNTIL_PRESS}");
// EWRAM variables
EWRAM_DATA static void(*sItemUseOnFieldCB)(u8 taskId) = NULL;
EWRAM_DATA static TaskFunc sItemUseOnFieldCB = NULL;
// Below is set TRUE by UseRegisteredKeyItemOnField
#define tUsingRegisteredKeyItem data[3]

View File

@ -10,7 +10,7 @@ struct Landmark
struct LandmarkList
{
u8 mapSection;
mapsec_u8_t mapSection;
u8 id;
const struct Landmark *const *landmarks;
};
@ -392,9 +392,9 @@ static const struct LandmarkList sLandmarkLists[] =
{MAPSEC_NONE, 0, NULL},
};
static const struct Landmark *const *GetLandmarks(u8 mapSection, u8 id);
static const struct Landmark *const *GetLandmarks(mapsec_u8_t mapSection, u8 id);
const u8 *GetLandmarkName(u8 mapSection, u8 id, u8 count)
const u8 *GetLandmarkName(mapsec_u8_t mapSection, u8 id, u8 count)
{
const struct Landmark *const *landmarks = GetLandmarks(mapSection, id);
@ -421,7 +421,7 @@ const u8 *GetLandmarkName(u8 mapSection, u8 id, u8 count)
return (*landmarks)->name;
}
static const struct Landmark *const *GetLandmarks(u8 mapSection, u8 id)
static const struct Landmark *const *GetLandmarks(mapsec_u8_t mapSection, u8 id)
{
u16 i = 0;

View File

@ -1,7 +1,6 @@
#include "global.h"
#include "mail.h"
#include "constants/items.h"
#include "main.h"
#include "overworld.h"
#include "task.h"
#include "scanline_effect.h"
@ -443,7 +442,7 @@ static const struct MailLayout sMailLayouts_Tall[] = {
},
};
void ReadMail(struct Mail *mail, void (*exitCallback)(void), bool8 hasText)
void ReadMail(struct Mail *mail, MainCallback exitCallback, bool8 hasText)
{
u16 buffer[2];
u16 species;

View File

@ -615,7 +615,7 @@ static void LoadMapNamePopUpWindowBg(void)
{
u8 popUpThemeId;
u8 popupWindowId = GetMapNamePopUpWindowId();
u16 regionMapSectionId = gMapHeader.regionMapSectionId;
mapsec_u16_t regionMapSectionId = gMapHeader.regionMapSectionId;
u8 secondaryPopUpWindowId;
if (OW_POPUP_GENERATION == GEN_5)

View File

@ -136,7 +136,7 @@ static u32 GetCurrentTotalMinutes(struct Time *);
static u32 GetNumRegisteredTrainers(void);
static u32 GetActiveMatchCallTrainerId(u32);
static int GetTrainerMatchCallId(int);
static u16 GetRematchTrainerLocation(int);
static mapsec_u16_t GetRematchTrainerLocation(int);
static bool32 TrainerIsEligibleForRematch(int);
static void StartMatchCall(void);
static void ExecuteMatchCall(u8);
@ -1496,7 +1496,7 @@ static bool32 TrainerIsEligibleForRematch(int matchCallId)
#endif //FREE_MATCH_CALL
}
static u16 GetRematchTrainerLocation(int matchCallId)
static mapsec_u16_t GetRematchTrainerLocation(int matchCallId)
{
const struct MapHeader *mapHeader = Overworld_GetMapHeaderByGroupAndId(gRematchTable[matchCallId].mapGroup, gRematchTable[matchCallId].mapNum);
return mapHeader->regionMapSectionId;

View File

@ -212,7 +212,7 @@ EWRAM_DATA struct WarpData gLastUsedWarp = {0};
EWRAM_DATA static struct WarpData sWarpDestination = {0}; // new warp position
EWRAM_DATA static struct WarpData sFixedDiveWarp = {0};
EWRAM_DATA static struct WarpData sFixedHoleWarp = {0};
EWRAM_DATA static u16 sLastMapSectionId = 0;
EWRAM_DATA static mapsec_u16_t sLastMapSectionId = 0;
EWRAM_DATA static struct InitialPlayerAvatarState sInitialPlayerAvatarState = {0};
EWRAM_DATA static u16 sAmbientCrySpecies = 0;
EWRAM_DATA static bool8 sIsAmbientCryWaterMon = FALSE;
@ -1468,12 +1468,12 @@ bool8 IsMapTypeIndoors(enum MapType mapType)
return FALSE;
}
u8 GetSavedWarpRegionMapSectionId(void)
mapsec_u8_t GetSavedWarpRegionMapSectionId(void)
{
return Overworld_GetMapHeaderByGroupAndId(gSaveBlock1Ptr->dynamicWarp.mapGroup, gSaveBlock1Ptr->dynamicWarp.mapNum)->regionMapSectionId;
}
u8 GetCurrentRegionMapSectionId(void)
mapsec_u8_t GetCurrentRegionMapSectionId(void)
{
return Overworld_GetMapHeaderByGroupAndId(gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum)->regionMapSectionId;
}

View File

@ -1271,7 +1271,7 @@ void BlendPalettesGradually(u32 selectedPalettes, s8 delay, u8 coeff, u8 coeffTa
{
u8 taskId;
taskId = CreateTask((void *)Task_BlendPalettesGradually, priority);
taskId = CreateTask(Task_BlendPalettesGradually, priority);
gTasks[taskId].tCoeff = coeff;
gTasks[taskId].tCoeffTarget = coeffTarget;

View File

@ -62,7 +62,7 @@ enum {
struct PokeblockMenuStruct
{
u8 tilemap[BG_SCREEN_SIZE];
void (*callbackOnUse)(void);
MainCallback callbackOnUse;
const u8 *pokeblockActionIds;
u8 numActions;
u8 caseId;
@ -80,7 +80,7 @@ struct PokeblockMenuStruct
struct PokeblockSavedData
{
void (*callback)(void);
MainCallback callback;
u16 selectedRow;
u16 scrollOffset;
};

View File

@ -75,7 +75,7 @@ struct OverworldArea
{
u8 mapGroup;
u8 mapNum;
u16 regionMapSectionId;
mapsec_u16_t regionMapSectionId;
};
struct
@ -96,7 +96,7 @@ struct
/*0x61C*/ u16 areaShadeBldArgHi;
/*0x61E*/ bool8 showingMarkers;
/*0x61F*/ u8 markerFlashCounter;
/*0x620*/ u16 specialAreaRegionMapSectionIds[MAX_AREA_MARKERS];
/*0x620*/ mapsec_u16_t specialAreaRegionMapSectionIds[MAX_AREA_MARKERS];
/*0x660*/ struct Sprite *areaMarkerSprites[MAX_AREA_MARKERS];
/*0x6E0*/ u16 numAreaMarkerSprites;
/*0x6E2*/ u16 alteringCaveCounter;
@ -116,7 +116,7 @@ static void FindMapsWithMon(u16);
static void BuildAreaGlowTilemap(void);
static void SetAreaHasMon(u16, u16);
static void SetSpecialMapHasMon(u16, u16);
static u16 GetRegionMapSectionId(u8, u8);
static mapsec_u16_t GetRegionMapSectionId(u8, u8);
static bool8 MapHasSpecies(const struct WildEncounterTypes *, u16);
static bool8 MonListHasSpecies(const struct WildPokemonInfo *, u16, u16);
static void DoAreaGlow(void);
@ -144,7 +144,7 @@ static void LoadHGSSScreenSelectBarSubmenu(void);
static const u16 sSpeciesHiddenFromAreaScreen[] = { SPECIES_WYNAUT };
static const u16 sMovingRegionMapSections[3] =
static const mapsec_u16_t sMovingRegionMapSections[3] =
{
MAPSEC_MARINE_CAVE,
MAPSEC_UNDERWATER_MARINE_CAVE,
@ -157,7 +157,7 @@ static const u16 sFeebasData[][3] =
{NUM_SPECIES}
};
static const u16 sLandmarkData[][2] =
static const mapsec_u16_t sLandmarkData[][2] =
{
{MAPSEC_SKY_PILLAR, FLAG_LANDMARK_SKY_PILLAR},
{MAPSEC_SEAFLOOR_CAVERN, FLAG_LANDMARK_SEAFLOOR_CAVERN},
@ -389,7 +389,7 @@ static void SetSpecialMapHasMon(u16 mapGroup, u16 mapNum)
if (sPokedexAreaScreen->numSpecialAreas < MAX_AREA_MARKERS)
{
u16 regionMapSectionId = GetRegionMapSectionId(mapGroup, mapNum);
mapsec_u16_t regionMapSectionId = GetRegionMapSectionId(mapGroup, mapNum);
if (regionMapSectionId < MAPSEC_NONE)
{
// Don't highlight the area if it's a moving area (Marine/Terra Cave)
@ -423,7 +423,7 @@ static void SetSpecialMapHasMon(u16 mapGroup, u16 mapNum)
}
}
static u16 GetRegionMapSectionId(u8 mapGroup, u8 mapNum)
static mapsec_u16_t GetRegionMapSectionId(u8 mapGroup, u8 mapNum)
{
return Overworld_GetMapHeaderByGroupAndId(mapGroup, mapNum)->regionMapSectionId;
}
@ -947,7 +947,7 @@ static void CreateAreaMarkerSprites(void)
s16 x;
s16 y;
s16 i;
s16 mapSecId;
mapsec_u16_t mapSecId;
s16 numSprites;
LoadSpriteSheet(&sAreaMarkerSpriteSheet);

View File

@ -2843,6 +2843,19 @@ u32 GetBoxMonData2(struct BoxPokemon *boxMon, s32 field)
#define SET8(lhs) (lhs) = *data
#define SET16(lhs) (lhs) = data[0] + (data[1] << 8)
#define SET32(lhs) (lhs) = data[0] + (data[1] << 8) + (data[2] << 16) + (data[3] << 24)
//
// Prefer SET_BY_WIDTH for fields whose types might be extended (e.g.
// anything whose typedef is in gametypes.h).
//
#define SET_BY_WIDTH(lhs) \
do { \
if (sizeof(lhs) == 1) \
SET8(lhs); \
else if (sizeof(lhs) == 2) \
SET16(lhs); \
else if (sizeof(lhs) == 4) \
SET32(lhs); \
} while (0)
void SetMonData(struct Pokemon *mon, s32 field, const void *dataArg)
{

View File

@ -141,7 +141,7 @@ static EWRAM_DATA struct PokemonSummaryScreenData
u8 ribbonCount; // 0x6
u8 ailment; // 0x7
u8 abilityNum; // 0x8
u8 metLocation; // 0x9
metloc_u8_t metLocation; // 0x9
u8 metLevel; // 0xA
u8 metGame; // 0xB
u32 pid; // 0xC
@ -734,7 +734,7 @@ static void (*const sTextPrinterFunctions[])(void) =
[PSS_PAGE_CONTEST_MOVES] = PrintContestMoves
};
static void (*const sTextPrinterTasks[])(u8 taskId) =
static const TaskFunc sTextPrinterTasks[] =
{
[PSS_PAGE_INFO] = Task_PrintInfoPage,
[PSS_PAGE_SKILLS] = Task_PrintSkillsPage,

View File

@ -34,13 +34,13 @@ typedef struct MatchCallTextDataStruct {
struct MatchCallStructCommon {
u8 type;
u8 mapSec;
mapsec_u8_t mapSec;
u16 flag;
};
struct MatchCallStructNPC {
u8 type;
u8 mapSec;
mapsec_u8_t mapSec;
u16 flag;
const u8 *desc;
const u8 *name;
@ -50,7 +50,7 @@ struct MatchCallStructNPC {
// Shared by MC_TYPE_TRAINER and MC_TYPE_LEADER
struct MatchCallStructTrainer {
u8 type;
u8 mapSec;
mapsec_u8_t mapSec;
u16 flag;
u16 rematchTableIdx;
const u8 *desc;
@ -60,12 +60,12 @@ struct MatchCallStructTrainer {
struct MatchCallLocationOverride {
u16 flag;
u8 mapSec;
mapsec_u8_t mapSec;
};
struct MatchCallWally {
u8 type;
u8 mapSec;
mapsec_u8_t mapSec;
u16 flag;
u16 rematchTableIdx;
const u8 *desc;
@ -75,7 +75,7 @@ struct MatchCallWally {
struct MatchCallBirch {
u8 type;
u8 mapSec;
mapsec_u8_t mapSec;
u16 flag;
const u8 *desc;
const u8 *name;
@ -117,11 +117,11 @@ static bool32 MatchCall_GetEnabled_Wally(match_call_t);
static bool32 MatchCall_GetEnabled_Birch(match_call_t);
static bool32 MatchCall_GetEnabled_Rival(match_call_t);
static u8 MatchCall_GetMapSec_NPC(match_call_t);
static u8 MatchCall_GetMapSec_Trainer(match_call_t);
static u8 MatchCall_GetMapSec_Wally(match_call_t);
static u8 MatchCall_GetMapSec_Birch(match_call_t);
static u8 MatchCall_GetMapSec_Rival(match_call_t);
static mapsec_u8_t MatchCall_GetMapSec_NPC(match_call_t);
static mapsec_u8_t MatchCall_GetMapSec_Trainer(match_call_t);
static mapsec_u8_t MatchCall_GetMapSec_Wally(match_call_t);
static mapsec_u8_t MatchCall_GetMapSec_Birch(match_call_t);
static mapsec_u8_t MatchCall_GetMapSec_Rival(match_call_t);
static bool32 MatchCall_IsRematchable_NPC(match_call_t);
static bool32 MatchCall_IsRematchable_Trainer(match_call_t);
@ -613,7 +613,7 @@ static bool32 (*const sMatchCallGetEnabledFuncs[])(match_call_t) = {
MatchCall_GetEnabled_Birch
};
static u8 (*const sMatchCallGetMapSecFuncs[])(match_call_t) = {
static mapsec_u8_t (*const sMatchCallGetMapSecFuncs[])(match_call_t) = {
MatchCall_GetMapSec_NPC,
MatchCall_GetMapSec_Trainer,
MatchCall_GetMapSec_Wally,
@ -796,7 +796,7 @@ static bool32 MatchCall_GetEnabled_Birch(match_call_t matchCall)
return FlagGet(matchCall.birch->flag);
}
u8 MatchCall_GetMapSec(u32 idx)
mapsec_u8_t MatchCall_GetMapSec(u32 idx)
{
match_call_t matchCall;
u32 i;
@ -808,17 +808,17 @@ u8 MatchCall_GetMapSec(u32 idx)
return sMatchCallGetMapSecFuncs[i](matchCall);
}
static u8 MatchCall_GetMapSec_NPC(match_call_t matchCall)
static mapsec_u8_t MatchCall_GetMapSec_NPC(match_call_t matchCall)
{
return matchCall.npc->mapSec;
}
static u8 MatchCall_GetMapSec_Trainer(match_call_t matchCall)
static mapsec_u8_t MatchCall_GetMapSec_Trainer(match_call_t matchCall)
{
return matchCall.trainer->mapSec;
}
static u8 MatchCall_GetMapSec_Wally(match_call_t matchCall)
static mapsec_u8_t MatchCall_GetMapSec_Wally(match_call_t matchCall)
{
s32 i;
@ -830,12 +830,12 @@ static u8 MatchCall_GetMapSec_Wally(match_call_t matchCall)
return matchCall.wally->locationData[i].mapSec;
}
static u8 MatchCall_GetMapSec_Rival(match_call_t matchCall)
static mapsec_u8_t MatchCall_GetMapSec_Rival(match_call_t matchCall)
{
return MAPSEC_NONE;
}
static u8 MatchCall_GetMapSec_Birch(match_call_t matchCall)
static mapsec_u8_t MatchCall_GetMapSec_Birch(match_call_t matchCall)
{
return MAPSEC_NONE;
}

View File

@ -1027,7 +1027,7 @@ static void PrintMatchCallLocation(struct Pokenav_MatchCallGfx *gfx, int delta)
u8 mapName[32];
int x;
int index = PokenavList_GetSelectedIndex() + delta;
int mapSec = GetMatchCallMapSec(index);
mapsec_s32_t mapSec = GetMatchCallMapSec(index);
if (mapSec != MAPSEC_NONE)
GetMapName(mapName, mapSec, 0);
else

View File

@ -308,7 +308,7 @@ struct PokenavMatchCallEntry *GetMatchCallList(void)
return state->matchCallEntries;
}
u16 GetMatchCallMapSec(int index)
mapsec_u16_t GetMatchCallMapSec(int index)
{
struct Pokenav_MatchCallMenu *state = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_MAIN);
return state->matchCallEntries[index].mapSec;
@ -430,7 +430,7 @@ void BufferMatchCallNameAndDesc(struct PokenavMatchCallEntry *matchCallEntry, u8
}
}
u8 GetMatchTableMapSectionId(int rematchIndex)
mapsec_u8_t GetMatchTableMapSectionId(int rematchIndex)
{
int mapGroup = gRematchTable[rematchIndex].mapGroup;
int mapNum = gRematchTable[rematchIndex].mapNum;

View File

@ -44,7 +44,7 @@ struct Pokenav_RegionMapGfx
struct CityMapEntry
{
u16 mapSecId;
mapsec_u16_t mapSecId;
u16 index;
const u32 *tilemap;
};
@ -66,8 +66,8 @@ static bool32 IsDma3ManagerBusyWithBgCopy_(struct Pokenav_RegionMapGfx *);
static void ChangeBgYForZoom(bool32);
static bool32 IsChangeBgYForZoomActive(void);
static void CreateCityZoomTextSprites(void);
static void DrawCityMap(struct Pokenav_RegionMapGfx *, int, int);
static void PrintLandmarkNames(struct Pokenav_RegionMapGfx *, int, int);
static void DrawCityMap(struct Pokenav_RegionMapGfx *, mapsec_s32_t, int);
static void PrintLandmarkNames(struct Pokenav_RegionMapGfx *, mapsec_s32_t, int);
static void SetCityZoomTextInvisibility(bool32);
static void Task_ChangeBgYForZoom(u8 taskId);
static void UpdateCityZoomTextPosition(void);
@ -664,7 +664,7 @@ static u32 LoopedTask_DecompressCityMaps(s32 taskState)
return LT_FINISH;
}
static void DrawCityMap(struct Pokenav_RegionMapGfx *state, int mapSecId, int pos)
static void DrawCityMap(struct Pokenav_RegionMapGfx *state, mapsec_s32_t mapSecId, int pos)
{
int i;
for (i = 0; i < NUM_CITY_MAPS && (sPokenavCityMaps[i].mapSecId != mapSecId || sPokenavCityMaps[i].index != pos); i++)
@ -677,7 +677,7 @@ static void DrawCityMap(struct Pokenav_RegionMapGfx *state, int mapSecId, int po
CopyToBgTilemapBufferRect(1, state->cityZoomPics[i], 18, 6, 10, 10);
}
static void PrintLandmarkNames(struct Pokenav_RegionMapGfx *state, int mapSecId, int pos)
static void PrintLandmarkNames(struct Pokenav_RegionMapGfx *state, mapsec_s32_t mapSecId, int pos)
{
int i = 0;
while (1)

View File

@ -5,7 +5,6 @@
#include "task.h"
#include "graphics.h"
#include "bg.h"
#include "main.h"
#include "malloc.h"
#include "palette.h"
#include "scanline_effect.h"
@ -1287,7 +1286,7 @@ static const struct BgTemplate sBgTemplates_ChasesAway[] =
}
};
void DoRayquazaScene(u8 animId, bool8 endEarly, void (*exitCallback)(void))
void DoRayquazaScene(u8 animId, bool8 endEarly, MainCallback exitCallback)
{
sRayScene = AllocZeroed(sizeof(*sRayScene));
sRayScene->animId = animId;

View File

@ -63,7 +63,7 @@ enum {
struct MultiNameFlyDest
{
const u8 *const *name;
u16 mapSecId;
mapsec_u16_t mapSecId;
u16 flag;
};
@ -72,7 +72,7 @@ static EWRAM_DATA struct RegionMap *sRegionMap = NULL;
static EWRAM_DATA struct {
void (*callback)(void);
u16 state;
u16 mapSecId;
mapsec_u16_t mapSecId;
struct RegionMap regionMap;
u8 tileBuffer[0x1c0];
u8 nameBuffer[0x26]; // never read
@ -86,15 +86,15 @@ static u8 MoveRegionMapCursor_Full(void);
static u8 ProcessRegionMapInput_Zoomed(void);
static u8 MoveRegionMapCursor_Zoomed(void);
static void CalcZoomScrollParams(s16 scrollX, s16 scrollY, s16 c, s16 d, u16 e, u16 f, u8 rotation);
static u16 GetMapSecIdAt(u16 x, u16 y);
static mapsec_u16_t GetMapSecIdAt(u16 x, u16 y);
static void RegionMap_SetBG2XAndBG2Y(s16 x, s16 y);
static void InitMapBasedOnPlayerLocation(void);
static void RegionMap_InitializeStateBasedOnSSTidalLocation(void);
static u8 GetMapsecType(u16 mapSecId);
static u16 CorrectSpecialMapSecId_Internal(u16 mapSecId);
static u16 GetTerraOrMarineCaveMapSecId(void);
static u8 GetMapsecType(mapsec_u16_t mapSecId);
static mapsec_u16_t CorrectSpecialMapSecId_Internal(mapsec_u16_t mapSecId);
static mapsec_u16_t GetTerraOrMarineCaveMapSecId(void);
static void GetMarineCaveCoords(u16 *x, u16 *y);
static bool32 IsPlayerInAquaHideout(u8 mapSecId);
static bool32 IsPlayerInAquaHideout(mapsec_u8_t mapSecId);
static void GetPositionOfCursorWithinMapSec(void);
static bool8 RegionMap_IsMapSecIdInNextRow(u16 y);
static void SpriteCB_CursorMapFull(struct Sprite *sprite);
@ -130,7 +130,7 @@ static const u8 sRegionMapPlayerIcon_MayGfx[] = INCBIN_U8("graphics/pokenav/regi
#include "data/region_map/region_map_layout.h"
#include "data/region_map/region_map_entries.h"
static const u16 sRegionMap_SpecialPlaceLocations[][2] =
static const mapsec_u16_t sRegionMap_SpecialPlaceLocations[][2] =
{
{MAPSEC_UNDERWATER_105, MAPSEC_ROUTE_105},
{MAPSEC_UNDERWATER_124, MAPSEC_ROUTE_124},
@ -162,14 +162,14 @@ static const u16 sRegionMap_SpecialPlaceLocations[][2] =
{MAPSEC_NONE, MAPSEC_NONE}
};
static const u16 sMarineCaveMapSecIds[] =
static const mapsec_u16_t sMarineCaveMapSecIds[] =
{
MAPSEC_MARINE_CAVE,
MAPSEC_UNDERWATER_MARINE_CAVE,
MAPSEC_UNDERWATER_MARINE_CAVE
};
static const u16 sTerraOrMarineCaveMapSecIds[ABNORMAL_WEATHER_LOCATIONS] =
static const mapsec_u16_t sTerraOrMarineCaveMapSecIds[ABNORMAL_WEATHER_LOCATIONS] =
{
[ABNORMAL_WEATHER_ROUTE_114_NORTH - 1] = MAPSEC_ROUTE_114,
[ABNORMAL_WEATHER_ROUTE_114_SOUTH - 1] = MAPSEC_ROUTE_114,
@ -203,7 +203,7 @@ static const struct UCoords16 sMarineCaveLocationCoords[MARINE_CAVE_LOCATIONS] =
[MARINE_CAVE_COORD(ROUTE_129_EAST)] = {24, 10}
};
static const u8 sMapSecAquaHideoutOld[] =
static const mapsec_u8_t sMapSecAquaHideoutOld[] =
{
MAPSEC_AQUA_HIDEOUT_OLD
};
@ -273,7 +273,7 @@ static const union AnimCmd *const sRegionMapPlayerIconAnimTable[] =
};
// Event islands that don't appear on map. (Southern Island does)
static const u8 sMapSecIdsOffMap[] =
static const mapsec_u8_t sMapSecIdsOffMap[] =
{
MAPSEC_BIRTH_ISLAND,
MAPSEC_FARAWAY_ISLAND,
@ -421,7 +421,7 @@ static const struct SpritePalette sFlyTargetIconsSpritePalette =
.tag = TAG_FLY_ICON
};
static const u16 sRedOutlineFlyDestinations[][2] =
static const mapsec_u16_t sRedOutlineFlyDestinations[][2] =
{
{
FLAG_LANDMARK_BATTLE_FRONTIER,
@ -694,7 +694,7 @@ static u8 ProcessRegionMapInput_Full(void)
static u8 MoveRegionMapCursor_Full(void)
{
u16 mapSecId;
mapsec_u16_t mapSecId;
if (sRegionMap->cursorMovementFrameCounter != 0)
return MAP_INPUT_MOVE_CONT;
@ -779,7 +779,7 @@ static u8 MoveRegionMapCursor_Zoomed(void)
{
u16 x;
u16 y;
u16 mapSecId;
mapsec_u16_t mapSecId;
sRegionMap->scrollY += sRegionMap->zoomedCursorDeltaY;
sRegionMap->scrollX += sRegionMap->zoomedCursorDeltaX;
@ -962,7 +962,7 @@ void PokedexAreaScreen_UpdateRegionMapVariablesAndVideoRegs(s16 x, s16 y)
}
}
static u16 GetMapSecIdAt(u16 x, u16 y)
static mapsec_u16_t GetMapSecIdAt(u16 x, u16 y)
{
if (y < MAPCURSOR_Y_MIN || y > MAPCURSOR_Y_MAX || x < MAPCURSOR_X_MIN || x > MAPCURSOR_X_MAX)
{
@ -1180,7 +1180,7 @@ static void RegionMap_InitializeStateBasedOnSSTidalLocation(void)
sRegionMap->cursorPosY = gRegionMapEntries[sRegionMap->mapSecId].y + y + MAPCURSOR_Y_MIN;
}
static u8 GetMapsecType(u16 mapSecId)
static u8 GetMapsecType(mapsec_u16_t mapSecId)
{
switch (mapSecId)
{
@ -1227,12 +1227,12 @@ static u8 GetMapsecType(u16 mapSecId)
}
}
u16 GetRegionMapSecIdAt(u16 x, u16 y)
mapsec_u16_t GetRegionMapSecIdAt(u16 x, u16 y)
{
return GetMapSecIdAt(x, y);
}
static u16 CorrectSpecialMapSecId_Internal(u16 mapSecId)
static mapsec_u16_t CorrectSpecialMapSecId_Internal(mapsec_u16_t mapSecId)
{
u32 i;
@ -1253,7 +1253,7 @@ static u16 CorrectSpecialMapSecId_Internal(u16 mapSecId)
return mapSecId;
}
static u16 GetTerraOrMarineCaveMapSecId(void)
static mapsec_u16_t GetTerraOrMarineCaveMapSecId(void)
{
s16 idx;
@ -1282,7 +1282,7 @@ static void GetMarineCaveCoords(u16 *x, u16 *y)
// Probably meant to be an "IsPlayerInIndoorDungeon" function, but in practice it only has the one mapsec
// Additionally, because the mapsec doesnt exist in Emerald, this function always returns FALSE
static bool32 IsPlayerInAquaHideout(u8 mapSecId)
static bool32 IsPlayerInAquaHideout(mapsec_u8_t mapSecId)
{
u32 i;
@ -1294,7 +1294,7 @@ static bool32 IsPlayerInAquaHideout(u8 mapSecId)
return FALSE;
}
u16 CorrectSpecialMapSecId(u16 mapSecId)
mapsec_u16_t CorrectSpecialMapSecId(mapsec_u16_t mapSecId)
{
return CorrectSpecialMapSecId_Internal(mapSecId);
}
@ -1573,7 +1573,7 @@ void TrySetPlayerIconBlink(void)
#undef sVisible
#undef sTimer
u8 *GetMapName(u8 *dest, u16 regionMapId, u16 padLength)
u8 *GetMapName(u8 *dest, mapsec_u16_t regionMapId, u16 padLength)
{
u8 *str;
u16 i;
@ -1606,7 +1606,7 @@ u8 *GetMapName(u8 *dest, u16 regionMapId, u16 padLength)
}
// TODO: probably needs a better name
u8 *GetMapNameGeneric(u8 *dest, u16 mapSecId)
u8 *GetMapNameGeneric(u8 *dest, mapsec_u16_t mapSecId)
{
switch (mapSecId)
{
@ -1619,7 +1619,7 @@ u8 *GetMapNameGeneric(u8 *dest, u16 mapSecId)
}
}
u8 *GetMapNameHandleAquaHideout(u8 *dest, u16 mapSecId)
u8 *GetMapNameHandleAquaHideout(u8 *dest, mapsec_u16_t mapSecId)
{
if (mapSecId == MAPSEC_AQUA_HIDEOUT_OLD)
return StringCopy(dest, gText_Hideout);
@ -1627,7 +1627,7 @@ u8 *GetMapNameHandleAquaHideout(u8 *dest, u16 mapSecId)
return GetMapNameGeneric(dest, mapSecId);
}
static void GetMapSecDimensions(u16 mapSecId, u16 *x, u16 *y, u16 *width, u16 *height)
static void GetMapSecDimensions(mapsec_u16_t mapSecId, u16 *x, u16 *y, u16 *width, u16 *height)
{
*x = gRegionMapEntries[mapSecId].x;
*y = gRegionMapEntries[mapSecId].y;
@ -1640,7 +1640,7 @@ bool8 IsRegionMapZoomed(void)
return sRegionMap->zoomed;
}
bool32 IsEventIslandMapSecId(u8 mapSecId)
bool32 IsEventIslandMapSecId(mapsec_u8_t mapSecId)
{
u32 i;
@ -1847,7 +1847,7 @@ static void LoadFlyDestIcons(void)
static void CreateFlyDestIcons(void)
{
u16 canFlyFlag;
u16 mapSecId;
mapsec_u16_t mapSecId;
u16 x;
u16 y;
u16 width;
@ -1895,7 +1895,7 @@ static void TryCreateRedOutlineFlyDestIcons(void)
u16 y;
u16 width;
u16 height;
u16 mapSecId;
mapsec_u16_t mapSecId;
u8 spriteId;
for (i = 0; sRedOutlineFlyDestinations[i][1] != MAPSEC_NONE; i++)

View File

@ -9,7 +9,6 @@
#include "overworld.h"
#include "hall_of_fame.h"
#include "pokemon_storage_system.h"
#include "main.h"
#include "trainer_hill.h"
#include "link.h"
#include "constants/game_stat.h"
@ -92,7 +91,7 @@ COMMON_DATA struct SaveSector *gReadWriteSector = NULL; // Pointer to a buffer f
COMMON_DATA u16 gIncrementalSectorId = 0;
COMMON_DATA u16 gSaveUnusedVar = 0;
COMMON_DATA u16 gSaveFileStatus = 0;
COMMON_DATA void (*gGameContinueCallback)(void) = NULL;
COMMON_DATA MainCallback gGameContinueCallback = NULL;
COMMON_DATA struct SaveSectorLocation gRamSaveSectorLocations[NUM_SECTORS_PER_SLOT] = {0};
COMMON_DATA u16 gSaveUnusedVar2 = 0;
COMMON_DATA u16 gSaveAttemptStatus = 0;
@ -897,7 +896,7 @@ u8 LoadGameSave(u8 saveType)
status = TryLoadSaveSlot(FULL_SAVE_SLOT, gRamSaveSectorLocations);
CopyPartyAndObjectsFromSave();
gSaveFileStatus = status;
gGameContinueCallback = 0;
gGameContinueCallback = NULL;
break;
case SAVE_HALL_OF_FAME:
if (gHoFSaveBuffer != NULL)

View File

@ -336,7 +336,7 @@ static void CB2_ReturnToTitleScreen(void)
}
else
{
SetMainCallback2((MainCallback)gGameContinueCallback);
SetMainCallback2(gGameContinueCallback);
gGameContinueCallback = NULL;
}
}

View File

@ -458,7 +458,7 @@ static void Task_GoToBuyOrSellMenu(u8 taskId)
if (!gPaletteFade.active)
{
DestroyTask(taskId);
SetMainCallback2((void *)((u16)tCallbackHi << 16 | (u16)tCallbackLo));
SetMainCallback2((MainCallback)((u16)tCallbackHi << 16 | (u16)tCallbackLo));
}
}

View File

@ -314,6 +314,11 @@ enum {
DIG_DISPLAY_BONUS_BIG
};
// IDs for the text windows
enum {
WIN_MSG,
WIN_INFO,
};
// How ReelTime works
// ==================
@ -1249,7 +1254,7 @@ static void SlotMachineSetup_LoadGfxAndTilemaps(void)
LoadSlotMachineGfx();
LoadMessageBoxGfx(0, 0x200, BG_PLTT_ID(15));
LoadUserWindowBorderGfx(0, 0x214, BG_PLTT_ID(14));
PutWindowTilemap(0);
PutWindowTilemap(WIN_MSG);
}
static void CreateSlotMachineSprites(void)
@ -1390,9 +1395,9 @@ static bool8 SlotTask_HandleBetInput(struct Task *task)
// SLOTTASK_MSG_NEED_3_COINS
static bool8 SlotTask_PrintMsg_Need3Coins(struct Task *task)
{
DrawDialogueFrame(0, FALSE);
AddTextPrinterParameterized(0, FONT_NORMAL, gText_YouDontHaveThreeCoins, 0, 1, 0, 0);
CopyWindowToVram(0, COPYWIN_FULL);
DrawDialogueFrame(WIN_MSG, FALSE);
AddTextPrinterParameterized(WIN_MSG, FONT_NORMAL, gText_YouDontHaveThreeCoins, 0, 1, 0, 0);
CopyWindowToVram(WIN_MSG, COPYWIN_FULL);
sSlotMachine->state = SLOTTASK_WAIT_MSG_NEED_3_COINS;
return FALSE;
}
@ -1402,7 +1407,7 @@ static bool8 SlotTask_WaitMsg_Need3Coins(struct Task *task)
{
if (JOY_NEW(A_BUTTON | B_BUTTON))
{
ClearDialogWindowAndFrame(0, TRUE);
ClearDialogWindowAndFrame(WIN_MSG, TRUE);
sSlotMachine->state = SLOTTASK_BET_INPUT;
}
return FALSE;
@ -1655,9 +1660,9 @@ static bool8 SlotTask_NoMatches(struct Task *task)
// SLOTTASK_ASK_QUIT
static bool8 SlotTask_AskQuit(struct Task *task)
{
DrawDialogueFrame(0, FALSE);
AddTextPrinterParameterized(0, FONT_NORMAL, gText_QuitTheGame, 0, 1, 0, 0);
CopyWindowToVram(0, COPYWIN_FULL);
DrawDialogueFrame(WIN_MSG, FALSE);
AddTextPrinterParameterized(WIN_MSG, FONT_NORMAL, gText_QuitTheGame, 0, 1, 0, 0);
CopyWindowToVram(WIN_MSG, COPYWIN_FULL);
CreateYesNoMenuParameterized(0x15, 7, 0x214, 0x180, 0xE, 0xF);
sSlotMachine->state = SLOTTASK_HANDLE_QUIT_INPUT;
return FALSE;
@ -1669,16 +1674,16 @@ static bool8 SlotTask_HandleQuitInput(struct Task *task)
s8 input = Menu_ProcessInputNoWrapClearOnChoose();
if (input == 0) // Chose to quit
{
ClearDialogWindowAndFrame(0, TRUE);
ClearDialogWindowAndFrame(WIN_MSG, TRUE);
DarkenBetTiles(0);
DarkenBetTiles(1);
DarkenBetTiles(2);
sSlotMachine->coins += sSlotMachine->bet;
sSlotMachine->state = SLOTTASK_END;
}
else if (input == 1 || input == -1) // Chose not to quit
else if (input == 1 || input == MENU_B_PRESSED) // Chose not to quit
{
ClearDialogWindowAndFrame(0, TRUE);
ClearDialogWindowAndFrame(WIN_MSG, TRUE);
sSlotMachine->state = SLOTTASK_BET_INPUT;
}
return FALSE;
@ -1687,9 +1692,9 @@ static bool8 SlotTask_HandleQuitInput(struct Task *task)
// SLOTTASK_MSG_MAX_COINS
static bool8 SlotTask_PrintMsg_MaxCoins(struct Task *task)
{
DrawDialogueFrame(0, FALSE);
AddTextPrinterParameterized(0, FONT_NORMAL, gText_YouveGot9999Coins, 0, 1, 0, 0);
CopyWindowToVram(0, COPYWIN_FULL);
DrawDialogueFrame(WIN_MSG, FALSE);
AddTextPrinterParameterized(WIN_MSG, FONT_NORMAL, gText_YouveGot9999Coins, 0, 1, 0, 0);
CopyWindowToVram(WIN_MSG, COPYWIN_FULL);
sSlotMachine->state = SLOTTASK_WAIT_MSG_MAX_COINS;
return FALSE;
}
@ -1699,7 +1704,7 @@ static bool8 SlotTask_WaitMsg_MaxCoins(struct Task *task)
{
if (JOY_NEW(A_BUTTON | B_BUTTON))
{
ClearDialogWindowAndFrame(0, TRUE);
ClearDialogWindowAndFrame(WIN_MSG, TRUE);
sSlotMachine->state = SLOTTASK_BET_INPUT;
}
return FALSE;
@ -1708,9 +1713,9 @@ static bool8 SlotTask_WaitMsg_MaxCoins(struct Task *task)
// SLOTTASK_MSG_NO_MORE_COINS
static bool8 SlotTask_PrintMsg_NoMoreCoins(struct Task *task)
{
DrawDialogueFrame(0, FALSE);
AddTextPrinterParameterized(0, FONT_NORMAL, gText_YouveRunOutOfCoins, 0, 1, 0, 0);
CopyWindowToVram(0, COPYWIN_FULL);
DrawDialogueFrame(WIN_MSG, FALSE);
AddTextPrinterParameterized(WIN_MSG, FONT_NORMAL, gText_YouveRunOutOfCoins, 0, 1, 0, 0);
CopyWindowToVram(WIN_MSG, COPYWIN_FULL);
sSlotMachine->state = SLOTTASK_WAIT_MSG_NO_MORE_COINS;
return FALSE;
}
@ -1720,7 +1725,7 @@ static bool8 SlotTask_WaitMsg_NoMoreCoins(struct Task *task)
{
if (JOY_NEW(A_BUTTON | B_BUTTON))
{
ClearDialogWindowAndFrame(0, TRUE);
ClearDialogWindowAndFrame(WIN_MSG, TRUE);
sSlotMachine->state = SLOTTASK_END;
}
return FALSE;
@ -3922,15 +3927,15 @@ static void InfoBox_DrawWindow(struct Task *task)
DestroyDigitalDisplayScene();
LoadInfoBoxTilemap();
AddWindow(&sWindowTemplate_InfoBox);
PutWindowTilemap(1);
FillWindowPixelBuffer(1, PIXEL_FILL(0));
PutWindowTilemap(WIN_INFO);
FillWindowPixelBuffer(WIN_INFO, PIXEL_FILL(0));
task->tState++;
}
static void InfoBox_AddText(struct Task *task)
{
AddTextPrinterParameterized3(1, FONT_NORMAL, 2, 5, sColors_ReeltimeHelp, 0, gText_ReelTimeHelp);
CopyWindowToVram(1, COPYWIN_FULL);
AddTextPrinterParameterized3(WIN_INFO, FONT_NORMAL, 2, 5, sColors_ReeltimeHelp, 0, gText_ReelTimeHelp);
CopyWindowToVram(WIN_INFO, COPYWIN_FULL);
BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK);
task->tState++;
}
@ -3939,10 +3944,10 @@ static void InfoBox_WaitInput(struct Task *task)
{
if (JOY_NEW(B_BUTTON | SELECT_BUTTON))
{
FillWindowPixelBuffer(1, PIXEL_FILL(0));
ClearWindowTilemap(1);
CopyWindowToVram(1, COPYWIN_MAP);
RemoveWindow(1);
FillWindowPixelBuffer(WIN_INFO, PIXEL_FILL(0));
ClearWindowTilemap(WIN_INFO);
CopyWindowToVram(WIN_INFO, COPYWIN_MAP);
RemoveWindow(WIN_INFO);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK);
task->tState++;
}

View File

@ -4535,7 +4535,7 @@ static void CreateInGameTradePokemonInternal(u8 whichPlayerMon, u8 whichInGameTr
u8 level = GetMonData(&gPlayerParty[whichPlayerMon], MON_DATA_LEVEL);
struct Mail mail;
u8 metLocation = METLOC_IN_GAME_TRADE;
metloc_u8_t metLocation = METLOC_IN_GAME_TRADE;
u8 mailNum;
struct Pokemon *pokemon = &gEnemyParty[0];

View File

@ -78,7 +78,7 @@ struct TrainerCardData
u8 cardType;
bool8 isHoenn;
u16 blendColor;
void (*callback2)(void);
MainCallback callback2;
struct TrainerCard trainerCard;
u16 frontTilemap[600];
u16 backTilemap[600];

View File

@ -50,7 +50,7 @@ enum {
struct UsePokeblockSession
{
void (*callback)(void);
void (*exitCallback)(void);
MainCallback exitCallback;
struct Pokeblock *pokeblock;
struct Pokemon *mon;
u8 stringBuffer[64];
@ -162,7 +162,7 @@ extern const u16 gConditionText_Pal[];
// The below 3 are saved for returning to the screen after feeding a pokeblock to a mon
// so that the rest of the data can be freed
static EWRAM_DATA struct UsePokeblockSession *sInfo = NULL;
static EWRAM_DATA void (*sExitCallback)(void) = NULL;
static EWRAM_DATA MainCallback sExitCallback = NULL;
static EWRAM_DATA struct Pokeblock *sPokeblock = NULL;
EWRAM_DATA u8 gPokeblockMonId = 0;
EWRAM_DATA s16 gPokeblockGain = 0;

View File

@ -1,21 +1,24 @@
#include "global.h"
#include "wild_encounter.h"
#include "pokemon.h"
#include "metatile_behavior.h"
#include "battle_setup.h"
#include "battle_pike.h"
#include "battle_pyramid.h"
#include "event_data.h"
#include "fieldmap.h"
#include "fishing.h"
#include "follower_npc.h"
#include "random.h"
#include "field_player_avatar.h"
#include "event_data.h"
#include "safari_zone.h"
#include "link.h"
#include "metatile_behavior.h"
#include "overworld.h"
#include "pokeblock.h"
#include "battle_setup.h"
#include "pokemon.h"
#include "random.h"
#include "roamer.h"
#include "tv.h"
#include "link.h"
#include "safari_zone.h"
#include "script.h"
#include "tv.h"
#include "wild_encounter.h"
#include "battle_debug.h"
#include "battle_pike.h"
#include "battle_pyramid.h"

View File

@ -1,6 +1,115 @@
#include "global.h"
#include "test/battle.h"
TO_DO_BATTLE_TEST("Aura Break inverts Fairy Aura's effect");
TO_DO_BATTLE_TEST("Aura Break inverts Dark Aura's effect");
TO_DO_BATTLE_TEST("Aura Break ignores Mold Breaker abilities");
DOUBLE_BATTLE_TEST("Aura Break inverts Fairy Aura's effect")
{
s16 damage[3];
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
PLAYER(SPECIES_WOBBUFFET);
PLAYER(SPECIES_XERNEAS) { Ability(ABILITY_FAIRY_AURA); }
OPPONENT(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_ZYGARDE_50) { Ability(ABILITY_AURA_BREAK); }
} WHEN {
TURN { MOVE(playerLeft, MOVE_PLAY_ROUGH, target:opponentLeft); }
TURN { MOVE(playerLeft, MOVE_PLAY_ROUGH, target:opponentLeft); SWITCH(playerRight, 2); }
TURN { MOVE(playerLeft, MOVE_PLAY_ROUGH, target:opponentLeft); SWITCH(opponentRight, 2); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_PLAY_ROUGH, playerLeft);
HP_BAR(opponentLeft, captureDamage: &damage[0]);
ANIMATION(ANIM_TYPE_MOVE, MOVE_PLAY_ROUGH, playerLeft);
HP_BAR(opponentLeft, captureDamage: &damage[1]);
ANIMATION(ANIM_TYPE_MOVE, MOVE_PLAY_ROUGH, playerLeft);
HP_BAR(opponentLeft, captureDamage: &damage[2]);
} THEN {
EXPECT_MUL_EQ(damage[0], UQ_4_12(1.33), damage[1]);
EXPECT_MUL_EQ(damage[0], UQ_4_12(0.75), damage[2]);
}
}
DOUBLE_BATTLE_TEST("Aura Break inverts Dark Aura's effect")
{
s16 damage[3];
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
PLAYER(SPECIES_WOBBUFFET);
PLAYER(SPECIES_YVELTAL) { Ability(ABILITY_DARK_AURA); }
OPPONENT(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_ZYGARDE_50) { Ability(ABILITY_AURA_BREAK); }
} WHEN {
TURN { MOVE(playerLeft, MOVE_BITE, target:opponentLeft); }
TURN { MOVE(playerLeft, MOVE_BITE, target:opponentLeft); SWITCH(playerRight, 2); }
TURN { MOVE(playerLeft, MOVE_BITE, target:opponentLeft); SWITCH(opponentRight, 2); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_BITE, playerLeft);
HP_BAR(opponentLeft, captureDamage: &damage[0]);
ANIMATION(ANIM_TYPE_MOVE, MOVE_BITE, playerLeft);
HP_BAR(opponentLeft, captureDamage: &damage[1]);
ANIMATION(ANIM_TYPE_MOVE, MOVE_BITE, playerLeft);
HP_BAR(opponentLeft, captureDamage: &damage[2]);
} THEN {
EXPECT_MUL_EQ(damage[0], UQ_4_12(1.33), damage[1]);
EXPECT_MUL_EQ(damage[0], UQ_4_12(0.75), damage[2]);
}
}
DOUBLE_BATTLE_TEST("Aura Break ignores Mold Breaker abilities")
{
s16 damage[6];
u32 species = SPECIES_WOBBUFFET, ability = ABILITY_NONE;
PARAMETRIZE { species = SPECIES_WOBBUFFET, ability = ABILITY_SHADOW_TAG; }
PARAMETRIZE { species = SPECIES_CRANIDOS, ability = ABILITY_MOLD_BREAKER; }
PARAMETRIZE { species = SPECIES_ZEKROM, ability = ABILITY_TERAVOLT; }
PARAMETRIZE { species = SPECIES_RESHIRAM, ability = ABILITY_TURBOBLAZE; }
GIVEN {
PLAYER(species) { Ability(ability); Level(50); }
PLAYER(SPECIES_WOBBUFFET);
PLAYER(SPECIES_YVELTAL) { Ability(ABILITY_DARK_AURA); }
PLAYER(SPECIES_XERNEAS) { Ability(ABILITY_FAIRY_AURA); }
OPPONENT(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_ZYGARDE_50) { Ability(ABILITY_AURA_BREAK); }
} WHEN {
TURN { MOVE(playerLeft, MOVE_BITE, target: opponentLeft); }
TURN { MOVE(playerLeft, MOVE_PLAY_ROUGH, target: opponentLeft); }
TURN { MOVE(playerLeft, MOVE_BITE, target: opponentLeft); SWITCH(playerRight, 2); }
TURN { MOVE(playerLeft, MOVE_PLAY_ROUGH, target: opponentLeft); SWITCH(playerRight, 3); }
TURN { MOVE(playerLeft, MOVE_BITE, target: opponentLeft); SWITCH(playerRight, 2); SWITCH(opponentRight, 2); }
TURN { MOVE(playerLeft, MOVE_PLAY_ROUGH, target: opponentLeft); SWITCH(playerRight, 3); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_BITE, playerLeft);
HP_BAR(opponentLeft, captureDamage: &damage[0]);
ANIMATION(ANIM_TYPE_MOVE, MOVE_PLAY_ROUGH, playerLeft);
HP_BAR(opponentLeft, captureDamage: &damage[1]);
ANIMATION(ANIM_TYPE_MOVE, MOVE_BITE, playerLeft);
HP_BAR(opponentLeft, captureDamage: &damage[2]);
ANIMATION(ANIM_TYPE_MOVE, MOVE_PLAY_ROUGH, playerLeft);
HP_BAR(opponentLeft, captureDamage: &damage[3]);
ANIMATION(ANIM_TYPE_MOVE, MOVE_BITE, playerLeft);
HP_BAR(opponentLeft, captureDamage: &damage[4]);
ANIMATION(ANIM_TYPE_MOVE, MOVE_PLAY_ROUGH, playerLeft);
HP_BAR(opponentLeft, captureDamage: &damage[5]);
} THEN {
EXPECT_MUL_EQ(damage[0], UQ_4_12(1.33), damage[2]);
EXPECT_MUL_EQ(damage[0], UQ_4_12(0.75), damage[4]);
EXPECT_MUL_EQ(damage[1], UQ_4_12(1.33), damage[3]);
EXPECT_MUL_EQ(damage[1], UQ_4_12(0.75), damage[5]);
}
}

View File

@ -530,12 +530,14 @@ string generate_map_constants_text(string groups_filepath, Json groups_data) {
text << "//\n// DO NOT MODIFY THIS FILE! It is auto-generated from data/maps/map_groups.json\n//\n\n";
text << "enum\n{\n";
int group_num = 0;
vector<int> map_count_vec; //DEBUG
for (auto &group : groups_data["group_order"].array_items()) {
string groupName = json_to_string(group);
text << "// " << groupName << "\n";
text << " // " << groupName << "\n";
vector<string> map_ids;
size_t max_length = 0;
@ -556,8 +558,8 @@ string generate_map_constants_text(string groups_filepath, Json groups_data) {
int map_id_num = 0;
for (string map_id : map_ids) {
text << "#define " << map_id << string((max_length - map_id.length() + 1), ' ')
<< "(" << map_id_num++ << " | (" << group_num << " << 8))\n";
text << " " << map_id << string(max_length - map_id.length(), ' ')
<< " = (" << map_id_num++ << " | (" << group_num << " << 8)),\n";
}
text << "\n";
@ -565,6 +567,8 @@ string generate_map_constants_text(string groups_filepath, Json groups_data) {
map_count_vec.push_back(map_count); //DEBUG
}
text << "};\n\n";
text << "#define MAP_GROUPS_COUNT " << group_num << "\n\n";
text << get_include_guard_end(guard_name);