Merge pull request #539 from Rangi42/master

[RTM] Miscellaneous reorganization fixes
This commit is contained in:
yenatch 2018-07-17 18:16:12 -04:00 committed by GitHub
commit 3e14c1f26e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
45 changed files with 487 additions and 467 deletions

36
FAQ.md
View File

@ -4,9 +4,12 @@
## Questions ## Questions
- [What is pokecrystal11.gbc?](#what-is-pokecrystal11gbc) - [What is pokecrystal11.gbc?](#what-is-pokecrystal11gbc)
- [Can't build ROM; "ERROR: `UNION` already defined"](#cant-build-rom-error-union-already-defined) - [I can't build the ROM, `make` just prints an error!](#i-cant-build-the-rom-make-just-prints-an-error)
- [Can't build ROM; "Segmentation fault" from `rgbgfx`](#cant-build-rom-segmentation-fault-from-rgbgfx) - [`gcc`: command not found](#gcc-command-not-found)
- [Can't build ROM; "Section is too big" or "Unable to place section in bank"](#cant-build-rom-section-is-too-big-or-unable-to-place-section-in-bank) - ["ERROR: `UNION` already defined"](#error-union-already-defined)
- ["Segmentation fault" from `rgbgfx`](#segmentation-fault-from-rgbgfx)
- ["Section is too big" or "Unable to place section in bank"](#section-is-too-big-or-unable-to-place-section-in-bank)
- ["Invalid file or object file version"](#invalid-file-or-object-file-version)
- [How do I edit maps?](#how-do-i-edit-maps) - [How do I edit maps?](#how-do-i-edit-maps)
- [How do I write new features?](#how-do-i-write-new-features) - [How do I write new features?](#how-do-i-write-new-features)
- [I need more help!](#i-need-more-help) - [I need more help!](#i-need-more-help)
@ -17,31 +20,41 @@
Version 1.1 of Pokémon Crystal, which fixed some issues with the initial international release. `make crystal11` defines `_CRYSTAL11` so the assembly builds the changed version. Version 1.1 of Pokémon Crystal, which fixed some issues with the initial international release. `make crystal11` defines `_CRYSTAL11` so the assembly builds the changed version.
## Can't build ROM; "ERROR: `UNION` already defined" ## I can't build the ROM, `make` just prints an error!
Download [**rgbds 0.3.3**][rgbds]. Earlier versions will not work. Reread [INSTALL.md](INSTALL.md) carefully, and make sure you're following all its steps.
### `gcc`: command not found
## Can't build ROM; "Segmentation fault" from `rgbgfx` You need to install `gcc`. If you're using Cygwin, re-run its setup, and at "Select Packages", choose to install `gcc-core`.
### "ERROR: `UNION` already defined"
Download [the latest **rgbds** release][rgbds]. Versions earlier than 0.3.3 will not work.
### "Segmentation fault" from `rgbgfx`
If you are using 64-bit Windows, download [**64-bit Cygwin**][cygwin] and [**64-bit rgbds**][rgbds]. If you are using 64-bit Windows, download [**64-bit Cygwin**][cygwin] and [**64-bit rgbds**][rgbds].
### "Section is too big" or "Unable to place section in bank"
## Can't build ROM; "Section is too big" or "Unable to place section in bank"
If you have not changed any of the asm, make sure you have the latest version of pokecrystal and the correct version of rgbds (see [INSTALL.md](INSTALL.md)). If you have not changed any of the asm, make sure you have the latest version of pokecrystal and the correct version of rgbds (see [INSTALL.md](INSTALL.md)).
If you added or changed any code, it has to fit in the **memory banks**. The 2MB ROM is divided into 128 banks of 4KB each, numbered $00 to $7F. The linkerscript **pokecrystal.link** lists which `SECTION`s go in which banks. Try moving some code into a new section. If you added or changed any code, it has to fit in the **memory banks**. The 2MB ROM is divided into 128 banks of 4KB each, numbered $00 to $7F. The linkerscript **pokecrystal.link** lists which `SECTION`s go in which banks. Try moving some code into a new section.
### "Invalid file or object file version"
Run `make clean` to remove all the old `o` files, then re-run `make`.
## How do I edit maps? ## How do I edit maps?
For `asm` scripts, read [docs/map_event_scripts.md](docs/map_event_scripts.md). For `blk` layouts, try [crowdmap][crowdmap] or [Polished Map][polished-map]. For `asm` scripts, read [docs/map_event_scripts.md](docs/map_event_scripts.md). For `blk` layouts, try [Polished Map][polished-map] or [crowdmap][crowdmap].
## How do I write new features? ## How do I write new features?
There are a number of special-purpose scripting languages, as described in [docs](docs/). For more general features, you'll need to code directly in assembly language. See [docs/assembly_programming.md](docs/assembly_programming.md). There are a number of special-purpose scripting languages, as described in [docs](docs/). For more general features, you'll need to code directly in assembly language. See [docs/assembly_programming.md](docs/assembly_programming.md). Some of the [tutorials][tutorials] may also be helpful.
## I need more help! ## I need more help!
@ -50,5 +63,6 @@ Try asking on IRC or Discord (see [README.md](README.md)).
[cygwin]: https://cygwin.com/install.html [cygwin]: https://cygwin.com/install.html
[rgbds]: https://github.com/rednex/rgbds/releases [rgbds]: https://github.com/rednex/rgbds/releases
[crowdmap]: https://github.com/yenatch/crowdmap/
[polished-map]: https://github.com/Rangi42/polished-map [polished-map]: https://github.com/Rangi42/polished-map
[crowdmap]: https://github.com/yenatch/crowdmap/
[tutorials]: https://github.com/pret/pokecrystal/wiki/Tutorials

View File

@ -3650,8 +3650,8 @@ Sfx_2Boops_Ch5:
soundinput $8 soundinput $8
endchannel endchannel
Sfx_UnknownCB: Sfx_IntroWhoosh:
musicheader 1, 8, Sfx_UnknownCB_Ch8 musicheader 1, 8, Sfx_IntroWhoosh_Ch8
Sfx_Menu_Ch8: Sfx_Menu_Ch8:
noise __, 2, $e2, $33 noise __, 2, $e2, $33
@ -4703,7 +4703,7 @@ Sfx_Unknown60_Ch8:
noise __, 16, $f2, $43 noise __, 16, $f2, $43
endchannel endchannel
Sfx_UnknownCB_Ch8: Sfx_IntroWhoosh_Ch8:
noise __, 2, $10, $10 noise __, 2, $10, $10
noise __, 3, $20, $10 noise __, 3, $20, $10
noise __, 3, $30, $20 noise __, 3, $30, $20

View File

@ -204,7 +204,7 @@ SFX:
dba Sfx_IntroSuicune4 dba Sfx_IntroSuicune4
dba Sfx_GameFreakPresents dba Sfx_GameFreakPresents
dba Sfx_Tingle dba Sfx_Tingle
dba Sfx_UnknownCB dba Sfx_IntroWhoosh
dba Sfx_TwoPcBeeps dba Sfx_TwoPcBeeps
dba Sfx_4NoteDitty dba Sfx_4NoteDitty
dba Sfx_Twinkle dba Sfx_Twinkle

View File

@ -61,6 +61,7 @@ MOVE_LENGTH EQU const_value
const STAT_DEF const STAT_DEF
const STAT_SPD const STAT_SPD
const STAT_SATK const STAT_SATK
NUM_EXP_STATS EQU const_value + -1
const STAT_SDEF const STAT_SDEF
NUM_STATS EQU const_value NUM_STATS EQU const_value
STAT_SPC EQU STAT_SATK STAT_SPC EQU STAT_SATK

View File

@ -58,10 +58,6 @@ X_FLIP EQU 1 << OAM_X_FLIP ; $20
Y_FLIP EQU 1 << OAM_Y_FLIP ; $40 Y_FLIP EQU 1 << OAM_Y_FLIP ; $40
PRIORITY EQU 1 << OAM_PRIORITY ; $80 PRIORITY EQU 1 << OAM_PRIORITY ; $80
; Other useful constants
LCDC_DEFAULT EQU %11100011
LY_VBLANK EQU 144
; Hardware registers ; Hardware registers
rJOYP EQU $ff00 ; Joypad (R/W) rJOYP EQU $ff00 ; Joypad (R/W)
rSB EQU $ff01 ; Serial transfer data (R/W) rSB EQU $ff01 ; Serial transfer data (R/W)
@ -119,14 +115,20 @@ rWave_d EQU $ff3d
rWave_e EQU $ff3e rWave_e EQU $ff3e
rWave_f EQU $ff3f rWave_f EQU $ff3f
rLCDC EQU $ff40 ; LCD Control (R/W) rLCDC EQU $ff40 ; LCD Control (R/W)
rLCDC_BG_PRIORITY EQU 0 ; 0=Off, 1=On
rLCDC_SPRITES_ENABLE EQU 1 ; 0=Off, 1=On rLCDC_SPRITES_ENABLE EQU 1 ; 0=Off, 1=On
rLCDC_SPRITE_SIZE EQU 2 ; 0=8x8, 1=8x16 rLCDC_SPRITE_SIZE EQU 2 ; 0=8x8, 1=8x16
rLCDC_BG_TILEMAP EQU 3 ; 0=9800-9BFF, 1=9C00-9FFF
rLCDC_TILE_DATA EQU 4 ; 0=8800-97FF, 1=8000-8FFF
rLCDC_WINDOW_ENABLE EQU 5 ; 0=Off, 1=On
rLCDC_WINDOW_TILEMAP EQU 6 ; 0=9800-9BFF, 1=9C00-9FFF rLCDC_WINDOW_TILEMAP EQU 6 ; 0=9800-9BFF, 1=9C00-9FFF
rLCDC_ENABLE EQU 7 ; 0=Off, 1=On rLCDC_ENABLE EQU 7 ; 0=Off, 1=On
LCDC_DEFAULT EQU (1 << rLCDC_ENABLE) | (1 << rLCDC_WINDOW_TILEMAP) | (1 << rLCDC_WINDOW_ENABLE) | (1 << rLCDC_SPRITES_ENABLE) | (1 << rLCDC_BG_PRIORITY)
rSTAT EQU $ff41 ; LCDC Status (R/W) rSTAT EQU $ff41 ; LCDC Status (R/W)
rSCY EQU $ff42 ; Scroll Y (R/W) rSCY EQU $ff42 ; Scroll Y (R/W)
rSCX EQU $ff43 ; Scroll X (R/W) rSCX EQU $ff43 ; Scroll X (R/W)
rLY EQU $ff44 ; LCDC Y-Coordinate (R) rLY EQU $ff44 ; LCDC Y-Coordinate (R)
LY_VBLANK EQU 144
rLYC EQU $ff45 ; LY Compare (R/W) rLYC EQU $ff45 ; LY Compare (R/W)
rDMA EQU $ff46 ; DMA Transfer and Start Address (W) rDMA EQU $ff46 ; DMA Transfer and Start Address (W)
rBGP EQU $ff47 ; BG Palette Data (R/W) - Non CGB Mode Only rBGP EQU $ff47 ; BG Palette Data (R/W) - Non CGB Mode Only

View File

@ -19,6 +19,7 @@ NPCTRADE_PADDING EQU 31 ; db
const NPC_TRADE_CHRIS ; 4 const NPC_TRADE_CHRIS ; 4
const NPC_TRADE_KIM ; 5 const NPC_TRADE_KIM ; 5
const NPC_TRADE_FOREST ; 6 const NPC_TRADE_FOREST ; 6
NUM_NPC_TRADES EQU const_value
; trade gender limits ; trade gender limits
const_def const_def

View File

@ -128,7 +128,7 @@
const SFX_SWEET_KISS ; 7c const SFX_SWEET_KISS ; 7c
const SFX_SWEET_KISS_2 ; 7d const SFX_SWEET_KISS_2 ; 7d
const SFX_BELLY_DRUM ; 7e const SFX_BELLY_DRUM ; 7e
const SFX_UNKNOWN_7F ; 7f const SFX_TOXIC ; 7f
const SFX_SLUDGE_BOMB ; 80 const SFX_SLUDGE_BOMB ; 80
const SFX_FORESIGHT ; 81 const SFX_FORESIGHT ; 81
const SFX_SPITE ; 82 const SFX_SPITE ; 82
@ -206,7 +206,7 @@
const SFX_INTRO_SUICUNE_4 ; c8 const SFX_INTRO_SUICUNE_4 ; c8
const SFX_GAME_FREAK_PRESENTS ; c9 const SFX_GAME_FREAK_PRESENTS ; c9
const SFX_TINGLE ; ca const SFX_TINGLE ; ca
const SFX_UNKNOWN_CB ; cb const SFX_INTRO_WHOOSH ; cb
const SFX_TWO_PC_BEEPS ; cc const SFX_TWO_PC_BEEPS ; cc
const SFX_4_NOTE_DITTY ; cd const SFX_4_NOTE_DITTY ; cd
const SFX_TWINKLE ; ce const SFX_TWINKLE ; ce

View File

@ -20,17 +20,17 @@ AUTO_INPUT EQU $ff
GAMETIMERPAUSE_TIMER_PAUSED_F EQU 0 GAMETIMERPAUSE_TIMER_PAUSED_F EQU 0
GAMETIMERPAUSE_MOBILE_7_F EQU 7 GAMETIMERPAUSE_MOBILE_7_F EQU 7
; wOptions:: (bits 4-7) ; cfcc ; wOptions:: ; cfcc
TEXT_DELAY_MASK EQU %111
const_def 4 const_def 4
const NO_TEXT_SCROLL ; 4 const NO_TEXT_SCROLL ; 4
const STEREO ; 5 const STEREO ; 5
const BATTLE_SHIFT ; 6 const BATTLE_SHIFT ; 6
const BATTLE_SCENE ; 7 const BATTLE_SCENE ; 7
; wOptions:: (bits 0-2) ; cfcc TEXT_DELAY_FAST EQU %001 ; 1
TEXT_DELAY_FAST EQU 1 TEXT_DELAY_MED EQU %011 ; 3
TEXT_DELAY_MED EQU 3 TEXT_DELAY_SLOW EQU %101 ; 5
TEXT_DELAY_SLOW EQU 5
; wTextBoxFrame:: ; cfce ; wTextBoxFrame:: ; cfce
const_def const_def

View File

@ -1,13 +1,3 @@
CriticalHitMoves:
db KARATE_CHOP
db RAZOR_WIND
db RAZOR_LEAF
db CRABHAMMER
db SLASH
db AEROBLAST
db CROSS_CHOP
db -1
CriticalHitChances: CriticalHitChances:
db 7 percent ; 0 db 7 percent ; 0
db 12 percent + 2 ; +1 db 12 percent + 2 ; +1

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@ DefaultOptions:
; wOptions: med text speed ; wOptions: med text speed
db TEXT_DELAY_MED db TEXT_DELAY_MED
; wSaveFileExists: no ; wSaveFileExists: no
db $00 db FALSE
; wTextBoxFrame: frame 1 ; wTextBoxFrame: frame 1
db FRAME_1 db FRAME_1
; wTextBoxFlags: use text speed ; wTextBoxFlags: use text speed

View File

@ -41,7 +41,7 @@ OddEgg1:
bigdw 0 bigdw 0
bigdw 0 bigdw 0
bigdw 0 bigdw 0
db $0, $0 ; DVs dn 0, 0, 0, 0 ; DVs
db 30, 20, 10, 0 ; PP db 30, 20, 10, 0 ; PP
db 20 ; Happiness db 20 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data db 0, 0, 0 ; Pokerus, Caught data
@ -55,8 +55,8 @@ OddEgg1:
bigdw 8 ; SAtk bigdw 8 ; SAtk
bigdw 8 ; SDef bigdw 8 ; SDef
db "EGG@@@@@@@@" db "EGG@@@@@@@@"
OddEgg1End:
OddEgg2:
db PICHU db PICHU
db NO_ITEM db NO_ITEM
db THUNDERSHOCK, CHARM, DIZZY_PUNCH, 0 db THUNDERSHOCK, CHARM, DIZZY_PUNCH, 0
@ -68,7 +68,7 @@ OddEgg2:
bigdw 0 bigdw 0
bigdw 0 bigdw 0
bigdw 0 bigdw 0
db $2a, $aa ; DVs dn 2, 10, 10, 10 ; DVs
db 30, 20, 10, 0 ; PP db 30, 20, 10, 0 ; PP
db 20 ; Happiness db 20 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data db 0, 0, 0 ; Pokerus, Caught data
@ -120,7 +120,7 @@ OddEgg2:
bigdw 0 bigdw 0
bigdw 0 bigdw 0
bigdw 0 bigdw 0
db $2a, $aa ; DVs dn 2, 10, 10, 10 ; DVs
db 35, 20, 10, 0 ; PP db 35, 20, 10, 0 ; PP
db 20 ; Happiness db 20 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data db 0, 0, 0 ; Pokerus, Caught data
@ -172,7 +172,7 @@ OddEgg2:
bigdw 0 bigdw 0
bigdw 0 bigdw 0
bigdw 0 bigdw 0
db $2a, $aa ; DVs dn 2, 10, 10, 10 ; DVs
db 15, 20, 10, 0 ; PP db 15, 20, 10, 0 ; PP
db 20 ; Happiness db 20 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data db 0, 0, 0 ; Pokerus, Caught data
@ -224,7 +224,7 @@ OddEgg2:
bigdw 0 bigdw 0
bigdw 0 bigdw 0
bigdw 0 bigdw 0
db $2a, $aa ; DVs dn 2, 10, 10, 10 ; DVs
db 35, 30, 10, 0 ; PP db 35, 30, 10, 0 ; PP
db 20 ; Happiness db 20 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data db 0, 0, 0 ; Pokerus, Caught data
@ -276,7 +276,7 @@ OddEgg2:
bigdw 0 bigdw 0
bigdw 0 bigdw 0
bigdw 0 bigdw 0
db $2a, $aa ; DVs dn 2, 10, 10, 10 ; DVs
db 25, 10, 0, 0 ; PP db 25, 10, 0, 0 ; PP
db 20 ; Happiness db 20 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data db 0, 0, 0 ; Pokerus, Caught data
@ -328,7 +328,7 @@ OddEgg2:
bigdw 0 bigdw 0
bigdw 0 bigdw 0
bigdw 0 bigdw 0
db $2a, $aa ; DVs dn 2, 10, 10, 10 ; DVs
db 30, 30, 10, 0 ; PP db 30, 30, 10, 0 ; PP
db 20 ; Happiness db 20 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data db 0, 0, 0 ; Pokerus, Caught data
@ -380,7 +380,7 @@ OddEgg2:
bigdw 0 bigdw 0
bigdw 0 bigdw 0
bigdw 0 bigdw 0
db $2a, $aa ; DVs dn 2, 10, 10, 10 ; DVs
db 35, 10, 0, 0 ; PP db 35, 10, 0, 0 ; PP
db 20 ; Happiness db 20 ; Happiness
db 0, 0, 0 ; Pokerus, Caught data db 0, 0, 0 ; Pokerus, Caught data

View File

@ -1,107 +1,107 @@
landmark: MACRO landmark: MACRO
; x, y, name ; x, y, name
db \1, \2 db \1 + 8, \2 + 16
dw \3 dw \3
ENDM ENDM
Landmarks: Landmarks:
; entries correspond to constants/landmark_constants.asm ; entries correspond to constants/landmark_constants.asm
landmark 0, 0, SpecialMapName dbbw 0, 0, SpecialMapName
landmark 148, 116, NewBarkTownName landmark 140, 100, NewBarkTownName
landmark 136, 116, Route29Name landmark 128, 100, Route29Name
landmark 108, 116, CherrygroveCityName landmark 100, 100, CherrygroveCityName
landmark 108, 96, Route30Name landmark 100, 80, Route30Name
landmark 104, 76, Route31Name landmark 96, 60, Route31Name
landmark 92, 76, VioletCityName landmark 84, 60, VioletCityName
landmark 93, 74, SproutTowerName landmark 85, 58, SproutTowerName
landmark 92, 108, Route32Name landmark 84, 92, Route32Name
landmark 84, 92, RuinsOfAlphName landmark 76, 76, RuinsOfAlphName
landmark 92, 140, UnionCaveName landmark 84, 124, UnionCaveName
landmark 90, 140, Route33Name landmark 82, 124, Route33Name
landmark 76, 140, AzaleaTownName landmark 68, 124, AzaleaTownName
landmark 78, 138, SlowpokeWellName landmark 70, 122, SlowpokeWellName
landmark 60, 136, IlexForestName landmark 52, 120, IlexForestName
landmark 60, 128, Route34Name landmark 52, 112, Route34Name
landmark 60, 108, GoldenrodCityName landmark 52, 92, GoldenrodCityName
landmark 58, 108, RadioTowerName landmark 50, 92, RadioTowerName
landmark 60, 92, Route35Name landmark 52, 76, Route35Name
landmark 60, 76, NationalParkName landmark 52, 60, NationalParkName
landmark 72, 76, Route36Name landmark 64, 60, Route36Name
landmark 76, 68, Route37Name landmark 68, 52, Route37Name
landmark 76, 60, EcruteakCityName landmark 68, 44, EcruteakCityName
landmark 78, 58, TinTowerName landmark 70, 42, TinTowerName
landmark 74, 58, BurnedTowerName landmark 66, 42, BurnedTowerName
landmark 60, 60, Route38Name landmark 52, 44, Route38Name
landmark 44, 64, Route39Name landmark 36, 48, Route39Name
landmark 44, 76, OlivineCityName landmark 36, 60, OlivineCityName
landmark 46, 78, LighthouseName landmark 38, 62, LighthouseName
landmark 36, 72, BattleTowerName landmark 28, 56, BattleTowerName
landmark 36, 80, Route40Name landmark 28, 64, Route40Name
landmark 36, 108, WhirlIslandsName landmark 28, 92, WhirlIslandsName
landmark 36, 116, Route41Name landmark 28, 100, Route41Name
landmark 28, 116, CianwoodCityName landmark 20, 100, CianwoodCityName
landmark 100, 60, Route42Name landmark 92, 44, Route42Name
landmark 92, 60, MtMortarName landmark 84, 44, MtMortarName
landmark 116, 60, MahoganyTownName landmark 108, 44, MahoganyTownName
landmark 116, 52, Route43Name landmark 108, 36, Route43Name
landmark 116, 44, LakeOfRageName landmark 108, 28, LakeOfRageName
landmark 128, 60, Route44Name landmark 120, 44, Route44Name
landmark 138, 54, IcePathName landmark 130, 38, IcePathName
landmark 140, 60, BlackthornCityName landmark 132, 44, BlackthornCityName
landmark 140, 52, DragonsDenName landmark 132, 36, DragonsDenName
landmark 140, 80, Route45Name landmark 132, 64, Route45Name
landmark 120, 88, DarkCaveName landmark 112, 72, DarkCaveName
landmark 132, 104, Route46Name landmark 124, 88, Route46Name
landmark 156, 84, SilverCaveName landmark 148, 68, SilverCaveName
landmark 60, 124, PalletTownName landmark 52, 108, PalletTownName
landmark 60, 108, Route1Name landmark 52, 92, Route1Name
landmark 60, 92, ViridianCityName landmark 52, 76, ViridianCityName
landmark 60, 80, Route2Name landmark 52, 64, Route2Name
landmark 60, 68, PewterCityName landmark 52, 52, PewterCityName
landmark 72, 68, Route3Name landmark 64, 52, Route3Name
landmark 84, 68, MtMoonName landmark 76, 52, MtMoonName
landmark 96, 68, Route4Name landmark 88, 52, Route4Name
landmark 108, 68, CeruleanCityName landmark 100, 52, CeruleanCityName
landmark 108, 60, Route24Name landmark 100, 44, Route24Name
landmark 116, 52, Route25Name landmark 108, 36, Route25Name
landmark 108, 76, Route5Name landmark 100, 60, Route5Name
landmark 116, 92, UndergroundName landmark 108, 76, UndergroundName
landmark 108, 92, Route6Name landmark 100, 76, Route6Name
landmark 108, 100, VermilionCityName landmark 100, 84, VermilionCityName
landmark 96, 76, DiglettsCaveName landmark 88, 60, DiglettsCaveName
landmark 96, 84, Route7Name landmark 88, 68, Route7Name
landmark 124, 84, Route8Name landmark 116, 68, Route8Name
landmark 124, 68, Route9Name landmark 116, 52, Route9Name
landmark 140, 68, RockTunnelName landmark 132, 52, RockTunnelName
landmark 140, 72, Route10Name landmark 132, 56, Route10Name
landmark 140, 76, PowerPlantName landmark 132, 60, PowerPlantName
landmark 140, 84, LavenderTownName landmark 132, 68, LavenderTownName
landmark 148, 84, LavRadioTowerName landmark 140, 68, LavRadioTowerName
landmark 84, 84, CeladonCityName landmark 76, 68, CeladonCityName
landmark 108, 84, SaffronCityName landmark 100, 68, SaffronCityName
landmark 124, 100, Route11Name landmark 116, 84, Route11Name
landmark 140, 96, Route12Name landmark 132, 80, Route12Name
landmark 132, 116, Route13Name landmark 124, 100, Route13Name
landmark 124, 128, Route14Name landmark 116, 112, Route14Name
landmark 112, 132, Route15Name landmark 104, 116, Route15Name
landmark 76, 84, Route16Name landmark 68, 68, Route16Name
landmark 76, 108, Route17Name landmark 68, 92, Route17Name
landmark 88, 132, Route18Name landmark 80, 116, Route18Name
landmark 100, 132, FuchsiaCityName landmark 92, 116, FuchsiaCityName
landmark 100, 144, Route19Name landmark 92, 128, Route19Name
landmark 84, 148, Route20Name landmark 76, 132, Route20Name
landmark 76, 148, SeafoamIslandsName landmark 68, 132, SeafoamIslandsName
landmark 60, 148, CinnabarIslandName landmark 52, 132, CinnabarIslandName
landmark 60, 136, Route21Name landmark 52, 120, Route21Name
landmark 44, 84, Route22Name landmark 36, 68, Route22Name
landmark 36, 68, VictoryRoadName landmark 28, 52, VictoryRoadName
landmark 36, 60, Route23Name landmark 28, 44, Route23Name
landmark 36, 52, IndigoPlateauName landmark 28, 36, IndigoPlateauName
landmark 36, 108, Route26Name landmark 28, 92, Route26Name
landmark 28, 116, Route27Name landmark 20, 100, Route27Name
landmark 20, 116, TohjoFallsName landmark 12, 100, TohjoFallsName
landmark 28, 84, Route28Name landmark 20, 68, Route28Name
landmark 148, 132, FastShipName landmark 140, 116, FastShipName
NewBarkTownName: db "NEW BARK¯TOWN@" NewBarkTownName: db "NEW BARK¯TOWN@"
CherrygroveCityName: db "CHERRYGROVE¯CITY@" CherrygroveCityName: db "CHERRYGROVE¯CITY@"

View File

@ -4738,13 +4738,13 @@ BattleAnim_SludgeBomb_branch_cbc15:
BattleAnim_Sludge_branch_cbc15: BattleAnim_Sludge_branch_cbc15:
BattleAnim_Toxic_branch_cbc15: BattleAnim_Toxic_branch_cbc15:
.loop .loop
anim_sound 0, 1, SFX_UNKNOWN_7F anim_sound 0, 1, SFX_TOXIC
anim_obj ANIM_OBJ_1A, 132, 72, $0 anim_obj ANIM_OBJ_1A, 132, 72, $0
anim_wait 8 anim_wait 8
anim_sound 0, 1, SFX_UNKNOWN_7F anim_sound 0, 1, SFX_TOXIC
anim_obj ANIM_OBJ_1A, 116, 72, $0 anim_obj ANIM_OBJ_1A, 116, 72, $0
anim_wait 8 anim_wait 8
anim_sound 0, 1, SFX_UNKNOWN_7F anim_sound 0, 1, SFX_TOXIC
anim_obj ANIM_OBJ_1A, 148, 72, $0 anim_obj ANIM_OBJ_1A, 148, 72, $0
anim_wait 8 anim_wait 8
anim_loop 5, .loop anim_loop 5, .loop

View File

@ -0,0 +1,9 @@
CriticalHitMoves:
db KARATE_CHOP
db RAZOR_WIND
db RAZOR_LEAF
db CRABHAMMER
db SLASH
db AEROBLAST
db CROSS_CHOP
db -1

View File

@ -2,20 +2,20 @@ emote: MACRO
; graphics pointer, length, starting tile ; graphics pointer, length, starting tile
dw \1 dw \1
db \2 tiles, BANK(\1) db \2 tiles, BANK(\1)
dw vTiles1 tile \3 dw vTiles0 tile \3
ENDM ENDM
Emotes: Emotes:
; entries correspond to EMOTE_* constants ; entries correspond to EMOTE_* constants
emote ShockEmote, 4, $78 emote ShockEmote, 4, $f8
emote QuestionEmote, 4, $78 emote QuestionEmote, 4, $f8
emote HappyEmote, 4, $78 emote HappyEmote, 4, $f8
emote SadEmote, 4, $78 emote SadEmote, 4, $f8
emote HeartEmote, 4, $78 emote HeartEmote, 4, $f8
emote BoltEmote, 4, $78 emote BoltEmote, 4, $f8
emote SleepEmote, 4, $78 emote SleepEmote, 4, $f8
emote FishEmote, 4, $78 emote FishEmote, 4, $f8
emote JumpShadowGFX, 1, $7c emote JumpShadowGFX, 1, $fc
emote FishingRodGFX, 2, $7c emote FishingRodGFX, 2, $fc
emote BoulderDustGFX, 2, $7e emote BoulderDustGFX, 2, $fe
emote GrassRustleGFX, 1, $7e emote GrassRustleGFX, 1, $fe

View File

@ -93,7 +93,7 @@ UnknownText_0x1bc14f::
line "level @" line "level @"
deciram wCurPartyLevel, 1, 3 deciram wCurPartyLevel, 1, 3
text "!@" text "!@"
sound_dex_fanfare_50_79 sound_dex_fanfare_50_79 ; plays SFX_DEX_FANFARE_50_79, identical to SFX_LEVEL_UP
text_waitbutton text_waitbutton
db "@@" db "@@"

View File

@ -8,7 +8,7 @@ ENDM
; Associated data: ; Associated data:
; - The *GFX, *Meta, and *Coll are defined in gfx/tilesets.asm ; - The *GFX, *Meta, and *Coll are defined in gfx/tilesets.asm
; - The *PalMap are defined in gfx/tileset_palette_maps.asm ; - The *PalMap are defined in gfx/tileset_palette_maps.asm
; - The *Anim are defined in engine/tileset_anims.asm ; - The *Anim are defined in engine/tilesets/tileset_anims.asm
Tilesets:: Tilesets::
; entries correspond to TILESET_* constants ; entries correspond to TILESET_* constants

View File

@ -3619,10 +3619,10 @@ CheckPlayerPartyForFitMon:
ld e, a ld e, a
xor a xor a
ld hl, wPartyMon1HP ld hl, wPartyMon1HP
ld bc, wPartyMon2 - (wPartyMon1 + 1) ld bc, PARTYMON_STRUCT_LENGTH - 1
.loop .loop
or [hl] or [hl]
inc hl inc hl ; + 1
or [hl] or [hl]
add hl, bc add hl, bc
dec e dec e
@ -6992,7 +6992,7 @@ GiveExperiencePoints:
ld a, [wCurPartyMon] ld a, [wCurPartyMon]
ld c, a ld c, a
ld b, CHECK_FLAG ld b, CHECK_FLAG
ld d, $0 ld d, FALSE
predef SmallFarFlagAction predef SmallFarFlagAction
ld a, c ld a, c
and a and a
@ -7006,7 +7006,7 @@ GiveExperiencePoints:
ld e, l ld e, l
ld hl, wEnemyMonBaseStats - 1 ld hl, wEnemyMonBaseStats - 1
push bc push bc
ld c, $5 ld c, NUM_EXP_STATS
.loop1 .loop1
inc hl inc hl
ld a, [de] ld a, [de]
@ -7286,13 +7286,13 @@ GiveExperiencePoints:
ld [wMonType], a ld [wMonType], a
predef CopyMonToTempMon predef CopyMonToTempMon
hlcoord 9, 0 hlcoord 9, 0
ld b, $a ld b, 10
ld c, $9 ld c, 9
call TextBox call TextBox
hlcoord 11, 1 hlcoord 11, 1
ld bc, 4 ld bc, 4
predef PrintTempMonStats predef PrintTempMonStats
ld c, $1e ld c, 30
call DelayFrames call DelayFrames
call WaitPressAorB_BlinkCursor call WaitPressAorB_BlinkCursor
call Call_LoadTempTileMapToTileMap call Call_LoadTempTileMapToTileMap

View File

@ -1210,7 +1210,9 @@ BattleCommand_Critical:
ld [wCriticalHit], a ld [wCriticalHit], a
ret ret
INCLUDE "data/battle/critical_hits.asm" INCLUDE "data/moves/critical_hit_moves.asm"
INCLUDE "data/battle/critical_hit_chances.asm"
INCLUDE "engine/battle/move_effects/triple_kick.asm" INCLUDE "engine/battle/move_effects/triple_kick.asm"

View File

@ -40,4 +40,4 @@ BattleCommand_Metronome:
call UpdateMoveData call UpdateMoveData
jp ResetTurn jp ResetTurn
INCLUDE "data/battle/metronome_exception_moves.asm" INCLUDE "data/moves/metronome_exception_moves.asm"

View File

@ -16,7 +16,7 @@ FindFirstAliveMonAndStartBattle:
xor a xor a
ld [hMapAnims], a ld [hMapAnims], a
call DelayFrame call DelayFrame
ld b, 6 ld b, PARTY_LENGTH
ld hl, wPartyMon1HP ld hl, wPartyMon1HP
ld de, PARTYMON_STRUCT_LENGTH - 1 ld de, PARTYMON_STRUCT_LENGTH - 1

View File

@ -104,7 +104,7 @@ Function_LoadRandomBattleTowerMon:
ld a, [wBTChoiceOfLvlGroup] ld a, [wBTChoiceOfLvlGroup]
dec a dec a
ld hl, BattleTowerMons ld hl, BattleTowerMons
ld bc, BattleTowerMons2 - BattleTowerMons1 ld bc, BattleTowerMons2 - BattleTowerMons1 ; size of one level group
call AddNTimes call AddNTimes
ld a, [hRandomAdd] ld a, [hRandomAdd]

View File

@ -31,7 +31,7 @@ CelebiShrineEvent:
call GetCelebiSpriteTile call GetCelebiSpriteTile
inc d inc d
push de push de
ld a, $90 ld a, 36 * SPRITEOAMSTRUCT_LENGTH
ld [wCurrSpriteOAMAddr], a ld [wCurrSpriteOAMAddr], a
farcall DoNextFrameForAllSprites farcall DoNextFrameForAllSprites
call CelebiEvent_CountDown call CelebiEvent_CountDown

View File

@ -1,3 +1,7 @@
FIELDMOVE_GRASS EQU $80
FIELDMOVE_TREE EQU $84
FIELDMOVE_FLY EQU $84
PlayWhirlpoolSound: PlayWhirlpoolSound:
call WaitSFX call WaitSFX
ld de, SFX_SURF ld de, SFX_SURF
@ -20,11 +24,11 @@ BlindingFlash:
ShakeHeadbuttTree: ShakeHeadbuttTree:
farcall ClearSpriteAnims farcall ClearSpriteAnims
ld de, CutGrassGFX ld de, CutGrassGFX
ld hl, vTiles1 tile $00 ld hl, vTiles0 tile FIELDMOVE_GRASS
lb bc, BANK(CutGrassGFX), 4 lb bc, BANK(CutGrassGFX), 4
call Request2bpp call Request2bpp
ld de, HeadbuttTreeGFX ld de, HeadbuttTreeGFX
ld hl, vTiles1 tile $04 ld hl, vTiles0 tile FIELDMOVE_TREE
lb bc, BANK(HeadbuttTreeGFX), 8 lb bc, BANK(HeadbuttTreeGFX), 8
call Request2bpp call Request2bpp
call Cut_Headbutt_GetPixelFacing call Cut_Headbutt_GetPixelFacing
@ -32,8 +36,8 @@ ShakeHeadbuttTree:
call _InitSpriteAnimStruct call _InitSpriteAnimStruct
ld hl, SPRITEANIMSTRUCT_TILE_ID ld hl, SPRITEANIMSTRUCT_TILE_ID
add hl, bc add hl, bc
ld [hl], $84 ld [hl], FIELDMOVE_TREE
ld a, 36 * 4 ld a, 36 * SPRITEOAMSTRUCT_LENGTH
ld [wCurrSpriteOAMAddr], a ld [wCurrSpriteOAMAddr], a
farcall DoNextFrameForAllSprites farcall DoNextFrameForAllSprites
call HideHeadbuttTree call HideHeadbuttTree
@ -48,7 +52,7 @@ ShakeHeadbuttTree:
and a and a
jr z, .done jr z, .done
dec [hl] dec [hl]
ld a, 36 * 4 ld a, 36 * SPRITEOAMSTRUCT_LENGTH
ld [wCurrSpriteOAMAddr], a ld [wCurrSpriteOAMAddr], a
farcall DoNextFrameForAllSprites farcall DoNextFrameForAllSprites
call DelayFrame call DelayFrame
@ -111,7 +115,7 @@ OWCutAnimation:
; 0: Split tree in half ; 0: Split tree in half
; 1: Mow the lawn ; 1: Mow the lawn
ld a, e ld a, e
and $1 and 1
ld [wJumptableIndex], a ld [wJumptableIndex], a
call .LoadCutGFX call .LoadCutGFX
call WaitSFX call WaitSFX
@ -121,7 +125,7 @@ OWCutAnimation:
ld a, [wJumptableIndex] ld a, [wJumptableIndex]
bit 7, a bit 7, a
jr nz, .finish jr nz, .finish
ld a, 36 * 4 ld a, 36 * SPRITEOAMSTRUCT_LENGTH
ld [wCurrSpriteOAMAddr], a ld [wCurrSpriteOAMAddr], a
callfar DoNextFrameForAllSprites callfar DoNextFrameForAllSprites
call OWCutJumptable call OWCutJumptable
@ -134,11 +138,11 @@ OWCutAnimation:
.LoadCutGFX: .LoadCutGFX:
callfar ClearSpriteAnims ; pointless to farcall callfar ClearSpriteAnims ; pointless to farcall
ld de, CutGrassGFX ld de, CutGrassGFX
ld hl, vTiles1 tile $00 ld hl, vTiles0 tile FIELDMOVE_GRASS
lb bc, BANK(CutGrassGFX), 4 lb bc, BANK(CutGrassGFX), 4
call Request2bpp call Request2bpp
ld de, CutTreeGFX ld de, CutTreeGFX
ld hl, vTiles1 tile $04 ld hl, vTiles0 tile FIELDMOVE_TREE
lb bc, BANK(CutTreeGFX), 4 lb bc, BANK(CutTreeGFX), 4
call Request2bpp call Request2bpp
ret ret
@ -173,7 +177,7 @@ Cut_SpawnAnimateTree:
call _InitSpriteAnimStruct call _InitSpriteAnimStruct
ld hl, SPRITEANIMSTRUCT_TILE_ID ld hl, SPRITEANIMSTRUCT_TILE_ID
add hl, bc add hl, bc
ld [hl], $84 ld [hl], FIELDMOVE_TREE
ld a, 32 ld a, 32
ld [wFrameCounter], a ld [wFrameCounter], a
; Cut_StartWaiting ; Cut_StartWaiting
@ -226,7 +230,7 @@ Cut_SpawnLeaf:
call _InitSpriteAnimStruct call _InitSpriteAnimStruct
ld hl, SPRITEANIMSTRUCT_TILE_ID ld hl, SPRITEANIMSTRUCT_TILE_ID
add hl, bc add hl, bc
ld [hl], $80 ld [hl], FIELDMOVE_GRASS
ld hl, SPRITEANIMSTRUCT_0E ld hl, SPRITEANIMSTRUCT_0E
add hl, bc add hl, bc
ld [hl], $4 ld [hl], $4
@ -313,7 +317,7 @@ FlyFromAnim:
call _InitSpriteAnimStruct call _InitSpriteAnimStruct
ld hl, SPRITEANIMSTRUCT_TILE_ID ld hl, SPRITEANIMSTRUCT_TILE_ID
add hl, bc add hl, bc
ld [hl], $84 ld [hl], FIELDMOVE_FLY
ld hl, SPRITEANIMSTRUCT_ANIM_SEQ_ID ld hl, SPRITEANIMSTRUCT_ANIM_SEQ_ID
add hl, bc add hl, bc
ld [hl], SPRITE_ANIM_SEQ_FLY_FROM ld [hl], SPRITE_ANIM_SEQ_FLY_FROM
@ -323,7 +327,7 @@ FlyFromAnim:
ld a, [wJumptableIndex] ld a, [wJumptableIndex]
bit 7, a bit 7, a
jr nz, .exit jr nz, .exit
ld a, 0 * 4 ld a, 0 * SPRITEOAMSTRUCT_LENGTH
ld [wCurrSpriteOAMAddr], a ld [wCurrSpriteOAMAddr], a
callfar DoNextFrameForAllSprites callfar DoNextFrameForAllSprites
call FlyFunction_FrameTimer call FlyFunction_FrameTimer
@ -347,7 +351,7 @@ FlyToAnim:
call _InitSpriteAnimStruct call _InitSpriteAnimStruct
ld hl, SPRITEANIMSTRUCT_TILE_ID ld hl, SPRITEANIMSTRUCT_TILE_ID
add hl, bc add hl, bc
ld [hl], $84 ld [hl], FIELDMOVE_FLY
ld hl, SPRITEANIMSTRUCT_ANIM_SEQ_ID ld hl, SPRITEANIMSTRUCT_ANIM_SEQ_ID
add hl, bc add hl, bc
ld [hl], SPRITE_ANIM_SEQ_FLY_TO ld [hl], SPRITE_ANIM_SEQ_FLY_TO
@ -360,7 +364,7 @@ FlyToAnim:
ld a, [wJumptableIndex] ld a, [wJumptableIndex]
bit 7, a bit 7, a
jr nz, .exit jr nz, .exit
ld a, 0 * 4 ld a, 0 * SPRITEOAMSTRUCT_LENGTH
ld [wCurrSpriteOAMAddr], a ld [wCurrSpriteOAMAddr], a
callfar DoNextFrameForAllSprites callfar DoNextFrameForAllSprites
call FlyFunction_FrameTimer call FlyFunction_FrameTimer
@ -394,7 +398,7 @@ endr
FlyFunction_InitGFX: FlyFunction_InitGFX:
callfar ClearSpriteAnims callfar ClearSpriteAnims
ld de, CutGrassGFX ld de, CutGrassGFX
ld hl, vTiles1 tile $00 ld hl, vTiles0 tile FIELDMOVE_GRASS
lb bc, BANK(CutGrassGFX), 4 lb bc, BANK(CutGrassGFX), 4
call Request2bpp call Request2bpp
ld a, [wCurPartyMon] ld a, [wCurPartyMon]
@ -404,7 +408,7 @@ FlyFunction_InitGFX:
add hl, de add hl, de
ld a, [hl] ld a, [hl]
ld [wd265], a ld [wd265], a
ld e, $84 ld e, FIELDMOVE_FLY
farcall FlyFunction_GetMonIcon farcall FlyFunction_GetMonIcon
xor a xor a
ld [wJumptableIndex], a ld [wJumptableIndex], a
@ -446,5 +450,5 @@ FlyFunction_FrameTimer:
call _InitSpriteAnimStruct call _InitSpriteAnimStruct
ld hl, SPRITEANIMSTRUCT_TILE_ID ld hl, SPRITEANIMSTRUCT_TILE_ID
add hl, bc add hl, bc
ld [hl], $80 ld [hl], FIELDMOVE_GRASS
ret ret

View File

@ -17,7 +17,7 @@ LoadFishingGFX:
call .LoadGFX call .LoadGFX
ld hl, vTiles0 tile $0a ld hl, vTiles0 tile $0a
call .LoadGFX call .LoadGFX
ld hl, vTiles1 tile $7c ld hl, vTiles0 tile $fc
call .LoadGFX call .LoadGFX
pop af pop af

View File

@ -39,7 +39,7 @@ _GiveOddEgg:
.done .done
ld hl, OddEggs ld hl, OddEggs
ld a, OddEgg2 - OddEgg1 ld a, OddEgg1End - OddEgg1
call AddNTimes call AddNTimes
ld de, wOddEggSpecies ld de, wOddEggSpecies

View File

@ -19,11 +19,11 @@ _UnownPuzzle:
xor a xor a
call ByteFill call ByteFill
ld hl, UnownPuzzleCursorGFX ld hl, UnownPuzzleCursorGFX
ld de, vTiles1 tile $60 ld de, vTiles0 tile $e0
ld bc, 4 tiles ld bc, 4 tiles
call CopyBytes call CopyBytes
ld hl, UnownPuzzleStartCancelLZ ld hl, UnownPuzzleStartCancelLZ
ld de, vTiles1 tile $6d ld de, vTiles0 tile $ed
call Decompress call Decompress
call LoadUnownPuzzlePiecesGFX call LoadUnownPuzzlePiecesGFX
hlcoord 0, 0 hlcoord 0, 0

View File

@ -2039,7 +2039,7 @@ CheckTimeCapsuleCompatibility:
jr nc, .move_too_new jr nc, .move_too_new
dec c dec c
jr nz, .move_next jr nz, .move_next
ld de, wPartyMon2 - (wPartyMon1 + NUM_MOVES) ld de, PARTYMON_STRUCT_LENGTH - NUM_MOVES
add hl, de add hl, de
dec b dec b
jr nz, .move_loop jr nz, .move_loop

View File

@ -165,7 +165,7 @@ GetTextSpeed:
; converts TEXT_DELAY_* value in a to OPT_TEXT_SPEED_* value in c, ; converts TEXT_DELAY_* value in a to OPT_TEXT_SPEED_* value in c,
; with previous/next TEXT_DELAY_* values in d/e ; with previous/next TEXT_DELAY_* values in d/e
ld a, [wOptions] ld a, [wOptions]
and $7 and TEXT_DELAY_MASK
cp TEXT_DELAY_SLOW cp TEXT_DELAY_SLOW
jr z, .slow jr z, .slow
cp TEXT_DELAY_FAST cp TEXT_DELAY_FAST
@ -467,7 +467,7 @@ Options_Frame:
dec a dec a
.Save: .Save:
and $7 maskbits NUM_FRAMES
ld [hl], a ld [hl], a
UpdateFrame: UpdateFrame:
ld a, [wTextBoxFrame] ld a, [wTextBoxFrame]

View File

@ -89,7 +89,7 @@ MoveMonWOMail_InsertMon_SaveGame:
pop de pop de
ld a, e ld a, e
ld [wCurBox], a ld [wCurBox], a
ld a, $1 ld a, TRUE
ld [wSaveFileExists], a ld [wSaveFileExists], a
farcall StageRTCTimeForSave farcall StageRTCTimeForSave
farcall BackupMysteryGift farcall BackupMysteryGift
@ -253,7 +253,7 @@ SavedTheGame:
ret ret
SaveGameData_: SaveGameData_:
ld a, 1 ld a, TRUE
ld [wSaveFileExists], a ld [wSaveFileExists], a
farcall StageRTCTimeForSave farcall StageRTCTimeForSave
farcall BackupMysteryGift farcall BackupMysteryGift
@ -627,7 +627,7 @@ TryLoadSaveFile:
ret ret
TryLoadSaveData: TryLoadSaveData:
xor a xor a ; FALSE
ld [wSaveFileExists], a ld [wSaveFileExists], a
call CheckPrimarySaveFile call CheckPrimarySaveFile
ld a, [wSaveFileExists] ld a, [wSaveFileExists]
@ -690,7 +690,7 @@ CheckPrimarySaveFile:
ld bc, wOptionsEnd - wOptions ld bc, wOptionsEnd - wOptions
call CopyBytes call CopyBytes
call CloseSRAM call CloseSRAM
ld a, $1 ld a, TRUE
ld [wSaveFileExists], a ld [wSaveFileExists], a
.nope .nope

View File

@ -1481,7 +1481,7 @@ IntroScene28:
cp $8 cp $8
ret nz ret nz
ld de, SFX_UNKNOWN_CB ld de, SFX_INTRO_WHOOSH
call PlaySFX call PlaySFX
ret ret

View File

@ -246,8 +246,8 @@ SuicuneFrameIterator:
ret ret
.Frames: .Frames:
db $80 ; vTiles4 tile $00 db $80 ; vTiles3 tile $80
db $88 ; vTiles4 tile $08 db $88 ; vTiles3 tile $88
db $00 ; vTiles5 tile $00 db $00 ; vTiles5 tile $00
db $08 ; vTiles5 tile $08 db $08 ; vTiles5 tile $08

View File

@ -1085,17 +1085,18 @@ DecorationDesc_GiantOrnament:
db "@" db "@"
ToggleMaptileDecorations: ToggleMaptileDecorations:
lb de, 0, 4 ; tile coordinates work the same way as for changeblock
lb de, 0, 4 ; bed coordinates
ld a, [wDecoBed] ld a, [wDecoBed]
call SetDecorationTile call SetDecorationTile
lb de, 7, 4 lb de, 7, 4 ; plant coordinates
ld a, [wDecoPlant] ld a, [wDecoPlant]
call SetDecorationTile call SetDecorationTile
lb de, 6, 0 lb de, 6, 0 ; poster coordinates
ld a, [wDecoPoster] ld a, [wDecoPoster]
call SetDecorationTile call SetDecorationTile
call SetPosterVisibility call SetPosterVisibility
lb de, 0, 0 lb de, 0, 0 ; carpet top-left coordinates
call PadCoords_de call PadCoords_de
ld a, [wDecoCarpet] ld a, [wDecoCarpet]
and a and a
@ -1103,15 +1104,15 @@ ToggleMaptileDecorations:
call _GetDecorationSprite call _GetDecorationSprite
ld [hl], a ld [hl], a
push af push af
lb de, 0, 2 lb de, 0, 2 ; carpet bottom-left coordinates
call PadCoords_de call PadCoords_de
pop af pop af
inc a inc a
ld [hli], a ld [hli], a ; carpet bottom-left block
inc a inc a
ld [hli], a ld [hli], a ; carpet bottom-middle block
dec a dec a
ld [hl], a ld [hl], a ; carpet bottom-right block
ret ret
SetPosterVisibility: SetPosterVisibility:
@ -1177,6 +1178,7 @@ _GetDecorationSprite:
ret ret
PadCoords_de: PadCoords_de:
; adjusts coordinates, the same way as Script_changeblock
ld a, d ld a, d
add 4 add 4
ld d, a ld d, a

View File

@ -562,8 +562,8 @@ DoPlayerMovement::
.GetAction: .GetAction:
; Poll player input and update movement info. ; Poll player input and update movement info.
ld hl, .table ld hl, .action_table
ld de, .table2 - .table1 ld de, .action_table_1_end - .action_table_1
ld a, [wCurInput] ld a, [wCurInput]
bit D_DOWN_F, a bit D_DOWN_F, a
jr nz, .d_down jr nz, .d_down
@ -597,25 +597,20 @@ DoPlayerMovement::
ld [wWalkingTile], a ld [wWalkingTile], a
ret ret
.table player_action: MACRO
; struct: ; walk direction, facing, x movement, y movement, tile collision pointer
; walk direction db \1, \2, \3, \4
; facing dw \5
; x movement ENDM
; y movement
; tile collision pointer .action_table:
.table1 .action_table_1
db STANDING, FACE_CURRENT, 0, 0 player_action STANDING, FACE_CURRENT, 0, 0, wPlayerStandingTile
dw wPlayerStandingTile .action_table_1_end
.table2 player_action RIGHT, FACE_RIGHT, 1, 0, wTileRight
db RIGHT, FACE_RIGHT, 1, 0 player_action LEFT, FACE_LEFT, -1, 0, wTileLeft
dw wTileRight player_action UP, FACE_UP, 0, -1, wTileUp
db LEFT, FACE_LEFT, -1, 0 player_action DOWN, FACE_DOWN, 0, 1, wTileDown
dw wTileLeft
db UP, FACE_UP, 0, -1
dw wTileUp
db DOWN, FACE_DOWN, 0, 1
dw wTileDown
.CheckNPC: .CheckNPC:
; Returns 0 if there is an NPC in front that you can't move ; Returns 0 if there is an NPC in front that you can't move

View File

@ -1403,7 +1403,7 @@ CalcMonStats:
; hl is the path to the Stat EXP ; hl is the path to the Stat EXP
; de points to where the final stats will be saved ; de points to where the final stats will be saved
ld c, $0 ld c, STAT_HP - 1 ; first stat
.loop .loop
inc c inc c
call CalcMonStatC call CalcMonStatC
@ -1414,7 +1414,7 @@ CalcMonStats:
ld [de], a ld [de], a
inc de inc de
ld a, c ld a, c
cp STAT_SDEF cp STAT_SDEF ; last stat
jr nz, .loop jr nz, .loop
ret ret
@ -1434,14 +1434,14 @@ CalcMonStatC:
push hl push hl
ld hl, wBaseStats ld hl, wBaseStats
dec hl ; has to be decreased, because 'c' begins with 1 dec hl ; has to be decreased, because 'c' begins with 1
ld b, $0 ld b, 0
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
ld e, a ld e, a
pop hl pop hl
push hl push hl
ld a, c ld a, c
cp STAT_SDEF cp STAT_SDEF ; last stat
jr nz, .not_spdef jr nz, .not_spdef
dec hl dec hl
dec hl dec hl

View File

@ -40,7 +40,7 @@ TilesetKantoAnim:
dw NULL, WaitTileAnimation dw NULL, WaitTileAnimation
dw NULL, WaitTileAnimation dw NULL, WaitTileAnimation
dw NULL, WaitTileAnimation dw NULL, WaitTileAnimation
dw NULL, TileAnimationPalette dw NULL, AnimateWaterPalette
dw NULL, WaitTileAnimation dw NULL, WaitTileAnimation
dw NULL, AnimateFlowerTile dw NULL, AnimateFlowerTile
dw NULL, WaitTileAnimation dw NULL, WaitTileAnimation
@ -53,7 +53,7 @@ TilesetParkAnim:
dw NULL, WaitTileAnimation dw NULL, WaitTileAnimation
dw vTiles2 tile $5f, AnimateFountain dw vTiles2 tile $5f, AnimateFountain
dw NULL, WaitTileAnimation dw NULL, WaitTileAnimation
dw NULL, TileAnimationPalette dw NULL, AnimateWaterPalette
dw NULL, WaitTileAnimation dw NULL, WaitTileAnimation
dw NULL, AnimateFlowerTile dw NULL, AnimateFlowerTile
dw NULL, WaitTileAnimation dw NULL, WaitTileAnimation
@ -71,7 +71,7 @@ TilesetForestAnim:
dw NULL, ForestTreeRightAnimation2 dw NULL, ForestTreeRightAnimation2
dw NULL, AnimateFlowerTile dw NULL, AnimateFlowerTile
dw vTiles2 tile $14, AnimateWaterTile dw vTiles2 tile $14, AnimateWaterTile
dw NULL, TileAnimationPalette dw NULL, AnimateWaterPalette
dw NULL, StandingTileFrame8 dw NULL, StandingTileFrame8
dw NULL, DoneTileAnimation dw NULL, DoneTileAnimation
@ -79,7 +79,7 @@ TilesetJohtoAnim:
dw vTiles2 tile $14, AnimateWaterTile dw vTiles2 tile $14, AnimateWaterTile
dw NULL, WaitTileAnimation dw NULL, WaitTileAnimation
dw NULL, WaitTileAnimation dw NULL, WaitTileAnimation
dw NULL, TileAnimationPalette dw NULL, AnimateWaterPalette
dw NULL, WaitTileAnimation dw NULL, WaitTileAnimation
dw NULL, AnimateFlowerTile dw NULL, AnimateFlowerTile
dw WhirlpoolFrames1, AnimateWhirlpoolTile dw WhirlpoolFrames1, AnimateWhirlpoolTile
@ -122,7 +122,7 @@ TilesetPortAnim:
dw NULL, WaitTileAnimation dw NULL, WaitTileAnimation
dw NULL, WaitTileAnimation dw NULL, WaitTileAnimation
dw NULL, WaitTileAnimation dw NULL, WaitTileAnimation
dw NULL, TileAnimationPalette dw NULL, AnimateWaterPalette
dw NULL, WaitTileAnimation dw NULL, WaitTileAnimation
dw NULL, WaitTileAnimation dw NULL, WaitTileAnimation
dw NULL, WaitTileAnimation dw NULL, WaitTileAnimation
@ -178,7 +178,7 @@ TilesetDarkCaveAnim:
dw NULL, FlickeringCaveEntrancePalette dw NULL, FlickeringCaveEntrancePalette
dw vTiles2 tile $14, WriteTileFromBuffer dw vTiles2 tile $14, WriteTileFromBuffer
dw NULL, FlickeringCaveEntrancePalette dw NULL, FlickeringCaveEntrancePalette
dw NULL, TileAnimationPalette dw NULL, AnimateWaterPalette
dw NULL, FlickeringCaveEntrancePalette dw NULL, FlickeringCaveEntrancePalette
dw vTiles2 tile $40, WriteTileToBuffer dw vTiles2 tile $40, WriteTileToBuffer
dw NULL, FlickeringCaveEntrancePalette dw NULL, FlickeringCaveEntrancePalette
@ -199,7 +199,7 @@ TilesetIcePathAnim:
dw NULL, FlickeringCaveEntrancePalette dw NULL, FlickeringCaveEntrancePalette
dw vTiles2 tile $35, WriteTileFromBuffer dw vTiles2 tile $35, WriteTileFromBuffer
dw NULL, FlickeringCaveEntrancePalette dw NULL, FlickeringCaveEntrancePalette
dw NULL, TileAnimationPalette dw NULL, AnimateWaterPalette
dw NULL, FlickeringCaveEntrancePalette dw NULL, FlickeringCaveEntrancePalette
dw vTiles2 tile $31, WriteTileToBuffer dw vTiles2 tile $31, WriteTileToBuffer
dw NULL, FlickeringCaveEntrancePalette dw NULL, FlickeringCaveEntrancePalette
@ -852,7 +852,7 @@ endr
ld sp, hl ld sp, hl
ret ret
TileAnimationPalette: AnimateWaterPalette:
; Transition between color values 0-2 for color 0 in palette 3. ; Transition between color values 0-2 for color 0 in palette 3.
; No palette changes on DMG. ; No palette changes on DMG.

View File

@ -1176,7 +1176,7 @@ ScrollMapUp::
ld l, a ld l, a
ld a, [wBGMapAnchor + 1] ld a, [wBGMapAnchor + 1]
ld h, a ld h, a
ld bc, $0200 ld bc, BG_MAP_WIDTH tiles
add hl, bc add hl, bc
; cap d at HIGH(vBGMap0) ; cap d at HIGH(vBGMap0)
ld a, h ld a, h

View File

@ -1,11 +1,11 @@
; Syntactic sugar macros ; Syntactic sugar macros
lb: MACRO ; r, hi, lo lb: MACRO ; r, hi, lo
ld \1, (((\2) & $ff) << 8) | (((\3) & $ff)) ld \1, ((\2) & $ff) << 8 | ((\3) & $ff)
ENDM ENDM
ln: MACRO ; r, hi, lo ln: MACRO ; r, hi, lo
ld \1, (((\2) & $f) << 4) | (((\3) & $f)) ld \1, ((\2) & $f) << 4 | ((\3) & $f)
ENDM ENDM
ldpixel: MACRO ldpixel: MACRO

View File

@ -586,7 +586,7 @@ Function8b690:
ld a, BANK(GFX_17afa5) ld a, BANK(GFX_17afa5)
call FarCopyBytes call FarCopyBytes
ld hl, GFX_17afa5 + $514 + $160 ld hl, GFX_17afa5 + $514 + $160
ld de, vTiles1 tile $6e ld de, vTiles0 tile $ee
ld bc, $10 ld bc, $10
ld a, BANK(GFX_17afa5) ld a, BANK(GFX_17afa5)
call FarCopyBytes call FarCopyBytes

View File

@ -5543,7 +5543,7 @@ Function11ac51:
call Function11b314 call Function11b314
call Function11acb7 call Function11acb7
call Function11ad6e call Function11ad6e
ld a, 30 * 4 ld a, 30 * SPRITEOAMSTRUCT_LENGTH
ld [wCurrSpriteOAMAddr], a ld [wCurrSpriteOAMAddr], a
farcall DoNextFrameForAllSprites farcall DoNextFrameForAllSprites
farcall ReloadMapPart farcall ReloadMapPart

View File

@ -279,7 +279,7 @@ Function170d02:
ld a, $1 ld a, $1
ld [rVBK], a ld [rVBK], a
ld de, GFX_171848 ld de, GFX_171848
ld hl, vTiles1 tile $41 ld hl, vTiles0 tile $c1
lb bc, BANK(GFX_171848), 24 lb bc, BANK(GFX_171848), 24
call Get2bpp call Get2bpp
xor a xor a

View File

@ -605,7 +605,7 @@ Function17d370:
call ClearScreen call ClearScreen
farcall ReloadMapPart farcall ReloadMapPart
call DisableLCD call DisableLCD
ld hl, vTiles1 tile $6e ld hl, vTiles0 tile $ee
ld de, $c608 ld de, $c608
ld bc, 1 tiles ld bc, 1 tiles
call CopyBytes call CopyBytes
@ -620,7 +620,7 @@ Function17d370:
ld bc, 1 tiles ld bc, 1 tiles
call ByteFill call ByteFill
ld hl, $c608 ld hl, $c608
ld de, vTiles1 tile $6e ld de, vTiles0 tile $ee
ld bc, 1 tiles ld bc, 1 tiles
call CopyBytes call CopyBytes
xor a xor a
@ -652,7 +652,7 @@ Function17d3f6:
Function17d405: Function17d405:
call DisableLCD call DisableLCD
ld hl, vTiles1 tile $6e ld hl, vTiles0 tile $ee
ld de, $c608 ld de, $c608
ld bc, 1 tiles ld bc, 1 tiles
call CopyBytes call CopyBytes
@ -667,7 +667,7 @@ Function17d405:
ld bc, 1 tiles ld bc, 1 tiles
call ByteFill call ByteFill
ld hl, $c608 ld hl, $c608
ld de, vTiles1 tile $6e ld de, vTiles0 tile $ee
ld bc, 1 tiles ld bc, 1 tiles
call CopyBytes call CopyBytes
xor a xor a

View File

@ -2507,7 +2507,7 @@ wRegisteredItem:: db ; d95c
wPlayerState:: db ; d95d wPlayerState:: db ; d95d
wHallOfFameCount:: dw wHallOfFameCount:: dw
wTradeFlags:: flag_array PARTY_LENGTH ; d960 wTradeFlags:: flag_array NUM_NPC_TRADES ; d960
ds 1 ds 1
wMooMooBerries:: db ; d962 wMooMooBerries:: db ; d962
wUndergroundSwitchPositions:: db ; d963 wUndergroundSwitchPositions:: db ; d963