summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRangi <remy.oukaour+rangi42@gmail.com>2020-02-23 15:06:29 -0500
committerRangi <remy.oukaour+rangi42@gmail.com>2020-02-23 15:06:29 -0500
commit5fd2aceb81b56e95e5d74c8a26afb2e08173e059 (patch)
tree0fd72fd054490f035f4cbe4f3543d1a6bafd7525
parent0765d58a0346a31fda86c5a4c42e21956e5a5d89 (diff)
HOME
-rw-r--r--Tips-and-tricks.md53
1 files changed, 12 insertions, 41 deletions
diff --git a/Tips-and-tricks.md b/Tips-and-tricks.md
index 4958661..bfac646 100644
--- a/Tips-and-tricks.md
+++ b/Tips-and-tricks.md
@@ -10,7 +10,8 @@ This page is for small hints about how to edit pokecrystal that don't need an en
- [Lowercasing Pokémon names cuts off their first letter](#lowercasing-pokémon-names-cuts-off-their-first-letter)
- [Pan in cutscenes by making the player invisible](#pan-in-cutscenes-by-making-the-player-invisible)
- [Prevent NPCs' heads from flipping when they walk down](#prevent-NPCs-heads-from-flipping-when-they-walk-down)
-- [Use HGSS behavior for fainting without saving on the S.S. Aqua](#use-hgss-behavior-for-fainting-without-saving-on-the-s.s.-aqua)
+- [Use HG/SS behavior for fainting without saving on the S.S. Aqua](#use-hgss-behavior-for-fainting-without-saving-on-the-s.s.-aqua)
+- [Use more space in the home bank](#use-more-space-in-the-home-bank)
## Change the odds of encountering a shiny Pokémon
@@ -69,7 +70,7 @@ Edit [engine/pokemon/move_mon.asm](../blob/master/engine/pokemon/move_mon.asm):
; wCurPartySpecies/wCurPartyLevel specify the species and level.
; hl points to the wPartyMon struct to fill.
...
-
+
; Initialize happiness.
+ ld a, [wMonType]
+ and $f
@@ -79,7 +80,7 @@ Edit [engine/pokemon/move_mon.asm](../blob/master/engine/pokemon/move_mon.asm):
+.got_happiness
ld [de], a
inc de
-
+
...
```
@@ -154,47 +155,17 @@ To disable this flipping for all overworld sprites, edit [data/sprites/facings.a
Note that the player sprite in the naming screen and the Town Map are unaffected by this. Also, this prevents the bicycling player sprite from moving side to side.
-## Use HGSS behavior for fainting without saving on the S.S. Aqua
+## Use HG/SS behavior for fainting without saving on the S.S. Aqua
You may have noticed how when you get on the S.S. Aqua or go to either port without saving, then white out, that you're taken to either your cabin or the Vermilion/Olivine Pokémon Center instead of the Pokémon Center you last used.
-To fix this (using the HGSS behavior), edit `.LeaveFastShipScript` in [maps/OlivinePort.asm](https://github.com/pret/pokecrystal/blob/master/maps/OlivinePort.asm) and [maps/VermilionPort.asm](https://github.com/pret/pokecrystal/blob/master/maps/VermilionPort.asm):
-```diff
- applymovement PLAYER, MovementData_0x74a32
- appear OLIVINEPORT_SAILOR1
- setscene SCENE_DEFAULT
- setevent EVENT_TEMPORARY_UNTIL_MAP_RELOAD_1
-- blackoutmod OLIVINE_CITY
- end
-```
+To go to the last Pokémon Center, like HG/SS does, remove the `blackoutmod` script commands from [maps/OlivinePort.asm](../blob/master/maps/OlivinePort.asm), [maps/VermilionPort.asm](../blob/master/maps/VermilionPort.asm), and [maps/FastShip1F.asm](../blob/master/maps/FastShip1F.asm).
-```diff
- applymovement PLAYER, MovementData_0x74ef3
- appear VERMILIONPORT_SAILOR1
- setscene SCENE_DEFAULT
- setevent EVENT_FAST_SHIP_CABINS_SE_SSE_CAPTAINS_CABIN_TWIN_1
- setevent EVENT_FAST_SHIP_CABINS_SE_SSE_GENTLEMAN
- setevent EVENT_FAST_SHIP_PASSENGERS_FIRST_TRIP
- clearevent EVENT_OLIVINE_PORT_PASSAGE_POKEFAN_M
- setevent EVENT_FAST_SHIP_FIRST_TIME
- setevent EVENT_TEMPORARY_UNTIL_MAP_RELOAD_1
-- blackoutmod VERMILION_CITY
- end
-```
-Also edit `.EnterFastShipScript` in [maps/FastShip1F.asm](https://github.com/pret/pokecrystal/blob/master/maps/FastShip1F.asm):
+## Use more space in the home bank
-```diff
- applymovement FASTSHIP1F_SAILOR1, MovementData_0x7520e
- applymovement PLAYER, MovementData_0x75217
- applymovement FASTSHIP1F_SAILOR1, MovementData_0x75211
- pause 30
- playsound SFX_BOAT
- earthquake 30
-- blackoutmod FAST_SHIP_CABINS_SW_SSW_NW
- clearevent EVENT_FAST_SHIP_HAS_ARRIVED
- checkevent EVENT_FAST_SHIP_FIRST_TIME
- iftrue .SkipGrandpa
- setscene SCENE_FASTSHIP1F_MEET_GRANDPA
- end
-```
+The home bank, ROM0, is important because its code is accessible no matter which ROMX bank is currently switched to. It's only $4000 (16,384) bytes, and some of those are required for the `rst` and interrupt [jump vectors](https://gbdev.github.io/pandocs/#jump-vectors-in-first-rom-bank) and the [cartridge header](https://gbdev.github.io/pandocs/#cartridge-header-in-first-rom-bank).
+
+All the home code in pokecrystal is `INCLUDE`d in the "Home" `SECTION` in [home.asm](../blob/master/home.asm), [starting](../blob/master/pokecrystal.link) at address $0150. However, if you really need more space, you *can* put code in [home/header.asm](../blob/master/home/header.asm), as long as you're careful not to interfere with the interrupts or the cartridge header. In particular, between the joypad interrupt at $0060 and the cartridge header at $0150, there are 157 unused bytes ($0100 - $0060 = $00A0 = 160, three bytes of which are taken by `jp Joypad`).
+
+For very short pieces of code or data, you can even put them in the unused space of the `rst` and interrupt vectors. For example, `jp VBlank` only uses three of the eight bytes in the "vblank" `SECTION`.