-
Notifications
You must be signed in to change notification settings - Fork 92
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
mods folder and fast_gauge.md #322
Open
DylanDoesProgramming664
wants to merge
8
commits into
pret:main
Choose a base branch
from
DylanDoesProgramming664:mods
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+24
−6
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
4d1257d
Update index.md
DylanDoesProgramming664 4affa32
Update and rename fast_guage.md to fast_gauge.md
DylanDoesProgramming664 9b75fa3
Update fast_gauge.md
DylanDoesProgramming664 8a702a7
Merge branch 'pret:main' into mods
DylanDoesProgramming664 fadaeff
Merge branch 'pret:main' into mods
DylanDoesProgramming664 841788e
Merge pull request #1 from DylanDoesProgramming664/fixes
DylanDoesProgramming664 3553f19
Update README.md
DylanDoesProgramming664 0023047
Merge branch 'pret:main' into mods
DylanDoesProgramming664 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,5 @@ | ||
# Pokémon Platinum | ||
|
||
This is a WIP decompilation of Pokémon Platinum. For instructions on how to set up the repository, please read [INSTALL.md](INSTALL.md). | ||
This is a WIP branched fork of [pret/pokeplatinum](https://github.com/pret/pokeplatinum) dedicated to making a mod/hack friendly base. | ||
|
||
This repository builds the following ROMs: | ||
|
||
* [**pokeplatinum.us.nds**](https://datomatic.no-intro.org/index.php?page=show_record&s=28&n=3541) `sha1: ce81046eda7d232513069519cb2085349896dec7` | ||
|
||
For contacts and other pret projects, see [pret.github.io](https://pret.github.io/). In addition to the pret Discord, also see the [VoidMatrix Discord (#decomp)](https://discord.gg/prUAgd5). | ||
There will be a goals folder, modding info in the docs folder, and a changelog folder describing the changes made to pokeplatinum. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Fast Gauge | ||
|
||
This is a quick tutorial on how to modify the gauge of exp and health bars of Plat so that the bar visually updates in subpixels per second instead of points per second. | ||
|
||
This mod is a backport of the healthbar fix made by the contributors of [pret/pokeheartgold](https://github.com/pret/pokeheartgold/blob/src/battle/battle_hp_bar.c#L1497) for the heartgold/soulsilver decomp. | ||
|
||
Fixes are written in the `diff` format, as mentioned in [Bugs and Glitches](../bugs_and_glitches.md). | ||
|
||
## Edit | ||
|
||
1. Go to [/src/battle/healthbar.c](/src/battle/healthbar.c) | ||
2. Go to the ``UpdateGauge`` function. | ||
3. Edit the function like so: | ||
```diff | ||
if (max < corrected) { | ||
- ratio = max * 0x100 / corrected; | ||
+ ratio = (max << 8) / corrected; | ||
``` |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe that this is the correct link.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
USE_SUBPIXEL_TEST
definition is just an abstraction of a common comparison in the pokeheartgold code. The main difference in pokeplatinum is that we don't use the same variable names in all cases where that comparison is used. Regardless, that comparison is still in the pokeplatinum codebase when dealing with guages. However, the difference is is that pokeplat calculates adjusts the bar at a constant rate of 0x100, while the pokeheartgold uses bit shifting in order to standardize the rate in which health bars increase and decrease, regardless of size.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The bitshift in
pokeheartgold
is in the opposite direction (leftward instead of the rightward shift listed in this document below), and is functionally equivalent to multiplying by0x100
. To illustrate:So, I guess that I am confused... how does this mod work? What change does it institute? It may be worthwhile to further document the tiling system used by the HP bar as part of this PR.