summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Chrissomallis <46578092+Nick-PC@users.noreply.github.com>2020-11-08 03:29:45 -0500
committerNick Chrissomallis <46578092+Nick-PC@users.noreply.github.com>2020-11-08 03:29:45 -0500
commita584e16393744dc8bff47dc408dc90285de84252 (patch)
tree4475ae1ab1a5736f2395b96fab9b1cb2b3183ab2
parent9cf4055710745379daa7c9495ccdbd9eb00c2eae (diff)
Updated Add a new TM or HM (markdown)
-rw-r--r--Add-a-new-TM-or-HM.md111
1 files changed, 64 insertions, 47 deletions
diff --git a/Add-a-new-TM-or-HM.md b/Add-a-new-TM-or-HM.md
index 8f3e3ff..079a257 100644
--- a/Add-a-new-TM-or-HM.md
+++ b/Add-a-new-TM-or-HM.md
@@ -212,7 +212,7 @@ ENDM
Basically it defines three variables `tms1`, `tms2`, and `tms3`, each of which can hold up to three bytes (that's 24 bits), and sets their bits according to which moves were listed; then it outputs those variables one byte at a time with `db` statements. Three variables with 24 bits each are sufficient for 72 learnable moves, but only eight `db`s are output, so beyond 64 moves we already have to update `tmhm`.
-Here's how to output a ninth byte, allowing up to 72 learnable moves:
+Here's how to output a ninth byte, allowing up to 72 learnable moves (62 TMs, 7 HMs, and 3 Move Tutor moves):
```diff
rept 3 ; TM01-TM24 (24/24)
@@ -224,32 +224,32 @@ Here's how to output a ninth byte, allowing up to 72 learnable moves:
tms2 = tms2 >> 8
endr
-rept 2 ; TM49-TM50 + HM01-HM07 + MT01-MT03 (12/16)
-+rept 3 ; TM49-TM72 (24/24)
++rept 3 ; TM49-TM62 + HM01-HM07 + MT01-MT03 (24/24)
db tms3 & $ff
tms3 = tms3 >> 8
endr
```
-Here's how to add a tenth byte (which also needs a fourth variable), allowing up to 80 learnable moves:
+Here's how to add a tenth byte (which also needs a fourth variable), allowing up to 80 learnable moves (70 TMs, 7 HMs, and 3 Move Tutor moves):
```diff
tmhm: MACRO
; used in data/pokemon/base_stats/*.asm
- tms1 = 0 ; TM01-TM24 (24)
- tms2 = 0 ; TM25-TM48 (24)
- tms3 = 0 ; TM49-TM50 + HM01-HM07 + MT01-MT03 (12/24)
-+tms4 = 0 ; TM73-TM80 (8/24)
+ _tms1 = 0 ; TM01-TM24 (24)
+ _tms2 = 0 ; TM25-TM48 (24)
+ _tms3 = 0 ; TM49-TM70 + HM01-HM02 (12/24)
++_tms4 = 0 ; HM03-HM07 + MT01-MT03 (8/8)
rept _NARG
if DEF(\1_TMNUM)
if \1_TMNUM < 24 + 1
- tms1 = tms1 | (1 << ((\1_TMNUM) - 1))
+ _tms1 = _tms1 | (1 << ((\1_TMNUM) - 1))
elif \1_TMNUM < 48 + 1
- tms2 = tms2 | (1 << ((\1_TMNUM) - 1 - 24))
+ _tms2 = _tms2 | (1 << ((\1_TMNUM) - 1 - 24))
- else
+ elif \1_TMNUM < 72 + 1
- tms3 = tms3 | (1 << ((\1_TMNUM) - 1 - 48))
+ _tms3 = _tms3 | (1 << ((\1_TMNUM) - 1 - 48))
+ else
-+tms4 = tms3 | (1 << ((\1_TMNUM) - 1 - 72))
++_tms4 = _tms3 | (1 << ((\1_TMNUM) - 1 - 72))
endc
else
fail "\1 is not a TM, HM, or move tutor move"
@@ -257,21 +257,21 @@ Here's how to add a tenth byte (which also needs a fourth variable), allowing up
shift
endr
rept 3 ; TM01-TM24 (24/24)
- db tms1 & $ff
- tms1 = tms1 >> 8
+ db _tms1 & $ff
+ _tms1 = _tms1 >> 8
endr
rept 3 ; TM25-TM48 (24/24)
- db tms2 & $ff
- tms2 = tms2 >> 8
+ db _tms2 & $ff
+ _tms2 = _tms2 >> 8
endr
-rept 2 ; TM49-TM50 + HM01-HM07 + MT01-MT03 (12/16)
-+rept 3 ; TM49-TM72 (24/24)
- db tms3 & $ff
- tms3 = tms3 >> 8
++rept 3 ; TM49-TM70 + HM01-HM02 (24/24)
+ db _tms3 & $ff
+ _tms3 = _tms3 >> 8
endr
-+rept 1 ; TM73-TM80 (8/24)
-+ db tms4 & $ff
-+tms4 = tms4 >> 8
++rept 1 ; HM03-HM07 + MT01-MT03 (8/8)
++ db _tms4 & $ff
++_tms4 = _tms4 >> 8
+endr
ENDM
```
@@ -290,39 +290,56 @@ First edit all the [data/pokemon/base_stats/\*.asm](../blob/master/data/pokemon/
- `db 100 ; unknown 1`
- `db 5 ; unknown 2`
-- `db 0, 0, 0, 0 ; padding`
+- `dw NULL, NULL ; unused (beta front/back pics)`
Then edit [wram.asm](../blob/master/wram.asm):
```diff
; corresponds to the data/pokemon/base_stats/*.asm contents
- wCurBaseData:: ; d236
- wBaseDexNo:: db ; d236
- wBaseStats:: ; d237
- wBaseHP:: db ; d237
- wBaseAttack:: db ; d238
- wBaseDefense:: db ; d239
- wBaseSpeed:: db ; d23a
- wBaseSpecialAttack:: db ; d23b
- wBaseSpecialDefense:: db ; d23c
- wBaseType:: ; d23d
- wBaseType1:: db ; d23d
- wBaseType2:: db ; d23e
- wBaseCatchRate:: db ; d23f
- wBaseExp:: db ; d240
- wBaseItems:: ; d241
- wBaseItem1:: db ; d241
- wBaseItem2:: db ; d242
- wBaseGender:: db ; d243
--wBaseUnknown1:: db ; d244
- wBaseEggSteps:: db ; d245
--wBaseUnknown2:: db ; d246
- wBasePicSize:: db ; d247
--wBasePadding:: ds 4 ; d248
- wBaseGrowthRate:: db ; d24c
- wBaseEggGroups:: db ; d24d
+ wCurBaseData::
+ wBaseDexNo:: db
+ wBaseStats::
+ wBaseHP:: db
+ wBaseAttack:: db
+ wBaseDefense:: db
+ wBaseSpeed:: db
+ wBaseSpecialAttack:: db
+ wBaseSpecialDefense:: db
+ wBaseType::
+ wBaseType1:: db
+ wBaseType2:: db
+ wBaseCatchRate:: db
+ wBaseExp:: db
+ wBaseItems::
+ wBaseItem1:: db
+ wBaseItem2:: db
+ wBaseGender:: db
+-wBaseUnknown1:: db
+ wBaseEggSteps:: db
+-wBaseUnknown2:: db
+ wBasePicSize:: db
+-wBaseUnusedFrontpic:: dw
+-wBaseUnusedBackpic:: dw
+ wBaseGrowthRate:: db
+ wBaseEggGroups:: db
wBaseTMHM:: flag_array NUM_TM_HM_TUTOR ; d24e
wCurBaseDataEnd::
```
+Additionally, the label wBaseUnusedFrontpic is used once in [home/pokemon.asm], but this reference is safe to comment out or delete entirely as it is only used in the Spaceworld Demo for Pokemon Gold.
+```
+-; Beta front and back sprites
+-; (see pokegold-spaceworld's data/pokemon/base_stats/*)
+- ld hl, wBaseUnusedFrontpic
+- ld [hl], e
+- inc hl
+- ld [hl], d
+- inc hl
+- ld [hl], e
+- inc hl
+- ld [hl], d
+- jr .end ; useless
+```
+This functionality is unused in the final game, so deleting or commenting out the entire function should create no issues.
+
That gives you enough free space for seven extra base data bytes per Pokémon. Plus the eight that are already used for learnable moves, that's up to 15 `tmhm` bytes, which would allow 120 learnable moves: easily enough for the 100 TMs of Gen 7, plus HMs and tutors. If you somehow need *even more* than that, you can figure out how to save more bytes by packing the base data more compactly.