From 778e5da3d2aba09d50d56ca016fe3b437ea93265 Mon Sep 17 00:00:00 2001 From: pokegold-spaceworld <110418063+gb-mobile@users.noreply.github.com> Date: Fri, 21 Jul 2023 20:04:50 -0400 Subject: [PATCH] Updates to 0.6.0 and international support for rankings - Applied all of Matze's latest fixes - Used IF DEFs to support the building of Japanese and international news in the same repo. --- Makefile | 10 +- README.md | 24 +- header.asm | 10 +- macros/news.asm | 4 +- macros/news_script_commands.asm | 200 +-- macros/news_text_commands.asm | 171 +- news/first_issue.asm | 630 ++++--- news_en/first_issue_en.asm | 1509 +++++++++++++++++ pokecrystal/charmap_int.asm | 418 +++++ pokecrystal/constants.asm | 15 +- pokecrystal/constants/audio_constants.asm | 144 +- .../constants/battle_anim_constants.asm | 418 ++--- pokecrystal/constants/battle_constants.asm | 186 +- .../constants/battle_tower_constants.asm | 27 +- pokecrystal/constants/collision_constants.asm | 250 +-- pokecrystal/constants/credits_constants.asm | 17 +- pokecrystal/constants/cry_constants.asm | 2 + pokecrystal/constants/deco_constants.asm | 36 +- pokecrystal/constants/engine_flags.asm | 78 +- pokecrystal/constants/event_flags.asm | 794 +-------- pokecrystal/constants/gfx_constants.asm | 71 +- pokecrystal/constants/hardware_constants.asm | 292 ++-- pokecrystal/constants/icon_constants.asm | 1 + pokecrystal/constants/input_constants.asm | 26 +- pokecrystal/constants/item_constants.asm | 72 +- pokecrystal/constants/item_data_constants.asm | 84 +- pokecrystal/constants/landmark_constants.asm | 204 +-- pokecrystal/constants/map_constants.asm | 135 +- pokecrystal/constants/map_data_constants.asm | 75 +- .../constants/map_object_constants.asm | 252 +-- pokecrystal/constants/map_setup_constants.asm | 53 +- pokecrystal/constants/mart_constants.asm | 1 + pokecrystal/constants/menu_constants.asm | 16 +- pokecrystal/constants/misc_constants.asm | 52 +- pokecrystal/constants/mobile_constants.asm | 82 +- pokecrystal/constants/move_constants.asm | 8 +- .../constants/move_effect_constants.asm | 1 + pokecrystal/constants/music_constants.asm | 13 +- pokecrystal/constants/npc_trade_constants.asm | 26 +- pokecrystal/constants/phone_constants.asm | 39 +- pokecrystal/constants/pokemon_constants.asm | 13 +- .../constants/pokemon_data_constants.asm | 217 +-- pokecrystal/constants/radio_constants.asm | 21 +- pokecrystal/constants/scgb_constants.asm | 25 +- pokecrystal/constants/script_constants.asm | 120 +- pokecrystal/constants/serial_constants.asm | 44 +- pokecrystal/constants/sfx_constants.asm | 7 +- .../constants/sprite_anim_constants.asm | 634 +++---- pokecrystal/constants/sprite_constants.asm | 18 +- .../constants/sprite_data_constants.asm | 17 +- pokecrystal/constants/text_constants.asm | 52 +- pokecrystal/constants/tileset_constants.asm | 9 +- pokecrystal/constants/trainer_constants.asm | 155 +- .../constants/trainer_data_constants.asm | 51 +- pokecrystal/constants/type_constants.asm | 28 +- pokecrystal/constants/wram_constants.asm | 242 +-- pokecrystal/macros.asm | 2 +- pokecrystal/macros/coords.asm | 55 +- pokecrystal/macros/data.asm | 157 +- pokecrystal/macros/gfx.asm | 68 +- pokecrystal/macros/scripts/text.asm | 124 +- ram/sram.asm | 11 + sram.asm => ram/sram_int.asm | 0 ram/wram.asm | 18 + wram.asm => ram/wram_int.asm | 0 65 files changed, 5134 insertions(+), 3400 deletions(-) create mode 100644 news_en/first_issue_en.asm create mode 100644 pokecrystal/charmap_int.asm create mode 100644 ram/sram.asm rename sram.asm => ram/sram_int.asm (100%) create mode 100644 ram/wram.asm rename wram.asm => ram/wram_int.asm (100%) diff --git a/Makefile b/Makefile index df88c19..da5aeb3 100644 --- a/Makefile +++ b/Makefile @@ -16,12 +16,14 @@ RGBLINK ?= $(RGBDS)rgblink ### Build targets .SUFFIXES: -.PHONY: all clean first_issue +.PHONY: all clean first_issue first_issue_en .SECONDEXPANSION: .PRECIOUS: .SECONDARY: all: first_issue +news: first_issue +news_en: first_issue_en clean: rm -f news/*.o *.bin @@ -30,3 +32,9 @@ first_issue: $(RGBASM) -o news/$@.o "news/$@.asm" $(RGBLINK) -x -o $@.bin news/$@.o python fix.py $@.bin + +first_issue_en: + $(RGBASM) -o news_en/$@.o "news_en/$@.asm" + $(RGBLINK) -x -o $@.bin news_en/$@.o + python fix.py $@.bin + diff --git a/README.md b/README.md index f68d6fd..7ebfb1e 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,26 @@ +Disassembly of Pokemon Crystal's Pokemon News. + +So far, only one of the four known news issues is disassembled. +The pokecrystal directory contains some useful constants and macros sourced from [pokecrystal]. + +To use this, install python and the tools required for assembling [pokecrystal]. + +[pokecrystal]: https://github.com/pret/pokecrystal + + ## Information -A WIP fork of a disassembly of Pokémon Crystal's Pokemon News by Sudel-Matze. - -Matze's initial repository contained a disassembly for one of the four known Pokémon News files. (Specifically 'news2.bin') +A disassembly of Pokémon Crystal's debug Pokemon News by Sudel-Matze. The Pokémon News was distributed via the Mobile Adapter and obtained via the in-game news machine - a feature originally only available to the Japanese version of the game. -This fork is designed to translate the news into English and to be used for the [pokecrystal-mobile-en] project. +This repository can be used to build the news in both Japanese (original) and English (for the [pokecrystal-mobile-en] project). + +To build a specific version, run one of these commands: + +- JP Version: `make` + +- EN Version: `make news_en` More information about Pokémon Crystal's mobile features can be found here: @@ -15,7 +29,7 @@ More information about Pokémon Crystal's mobile features can be found here: The pokecrystal directory contains some useful constants and macros sourced from [pokecrystal]. -Python and RGBDS 0.5.1 are required to build the news. +Python and RGBDS 0.6.0 are required to build the news. ## Screenshots diff --git a/header.asm b/header.asm index a6ecd66..2a3ccce 100644 --- a/header.asm +++ b/header.asm @@ -1,7 +1,13 @@ INCLUDE "pokecrystal/constants.asm" INCLUDE "macros.asm" -INCLUDE "wram.asm" -INCLUDE "sram.asm" +IF DEF(_NEWS_EN) +INCLUDE "ram/wram_int.asm" +INCLUDE "ram/sram_int.asm" +ELSE +INCLUDE "ram/wram.asm" +INCLUDE "ram/sram.asm" +ENDC + SECTION "header", ROM0[$0000] db $00 diff --git a/macros/news.asm b/macros/news.asm index 40dfa3b..487a5b9 100644 --- a/macros/news.asm +++ b/macros/news.asm @@ -1,4 +1,4 @@ -screenconfig: MACRO +MACRO screenconfig .curr_screen ENDM @@ -74,6 +74,6 @@ ENDM ;ENDR ;ENDM -relativepointer: MACRO +MACRO relativepointer dw \1 - .curr_screen ENDM \ No newline at end of file diff --git a/macros/news_script_commands.asm b/macros/news_script_commands.asm index 0bdc7e4..7faf6da 100644 --- a/macros/news_script_commands.asm +++ b/macros/news_script_commands.asm @@ -1,68 +1,68 @@ ; commands from Jumptable17d72a (mobile_5f) in pokecrystal - enum_start + const_def - enum nothing_command ; $00 -nothing: MACRO + const nothing_command ; $00 +MACRO nothing db nothing_command ENDM - enum loadscreen_command ; $01 -loadscreen: MACRO + const loadscreen_command ; $01 +MACRO loadscreen db loadscreen_command dw \1 - NewsDataStart ; pointer to screen data ENDM - enum playmusic_command ; $02 -playmusic: MACRO + const playmusic_command ; $02 +MACRO playmusic db playmusic_command db \1 ; music id ENDM - enum playsound_command ; $03 -playsound: MACRO + const playsound_command ; $03 +MACRO playsound db playsound_command db \1 ; sound id ENDM - enum playcry_command ; $04 -playcry: MACRO + const playcry_command ; $04 +MACRO playcry db playcry_command db \1 ; species ENDM - enum unknown05_command ; $05 -unknown05: MACRO + const unknown05_command ; $05 +MACRO unknown05 db unknown05_command ; TODO ENDM - enum specialtext_command ; $06 -specialtext: MACRO + const specialtext_command ; $06 +MACRO specialtext db specialtext_command dw \1 ; offset into screen buffer relativepointer \2 ; pointer to text ENDM - enum unknown07_command ; $07 -unknown07: MACRO + const unknown07_command ; $07 +MACRO unknown07 db unknown07_command ; TODO ENDM - enum unknown08_command ; $08 -unknown08: MACRO + const unknown08_command ; $08 +MACRO unknown08 db unknown08_command ; TODO ENDM - enum unknown09_command ; $09 -unknown09: MACRO + const unknown09_command ; $09 +MACRO unknown09 db unknown09_command ; TODO ENDM - enum pokemonsprite_command ; $0A -pokemonsprite: MACRO + const pokemonsprite_command ; $0A +MACRO pokemonsprite db pokemonsprite_command dw \1 ; offset into screen buffer db \2 ; species @@ -70,16 +70,16 @@ pokemonsprite: MACRO db \4 ; palette slot to use ENDM - enum trainersprite_command ; $0B -trainersprite: MACRO + const trainersprite_command ; $0B +MACRO trainersprite db trainersprite_command dw \1 ; offset into screen buffer db \2 ; trainer class db \3 ; palette slot to use ENDM - enum cpyvalram_command ; $0C -cpyvalram: MACRO + const cpyvalram_command ; $0C +MACRO cpyvalram db cpyvalram_command dw \1 ; source dw \2 ; destination @@ -87,84 +87,84 @@ cpyvalram: MACRO dw \3 ; length ENDM - enum unknown0D_command ; $0D -unknown0D: MACRO + const unknown0D_command ; $0D +MACRO unknown0D db unknown0D_command ; TODO ENDM - enum menuup_command ; $0E -menuup: MACRO + const menuup_command ; $0E +MACRO menuup db menuup_command ENDM - enum menudown_command ; $0F -menudown: MACRO + const menudown_command ; $0F +MACRO menudown db menudown_command ENDM - enum menuleft_command ; $10 -menuleft: MACRO + const menuleft_command ; $10 +MACRO menuleft db menuleft_command ENDM - enum menuright_command ; $11 -menuright: MACRO + const menuright_command ; $11 +MACRO menuright db menuright_command ENDM - enum unknown12_command ; $12 -unknown12: MACRO + const unknown12_command ; $12 +MACRO unknown12 db unknown12_command ; TODO ENDM - enum unknown13_command ; $13 -unknown13: MACRO + const unknown13_command ; $13 +MACRO unknown13 db unknown13_command ; TODO ENDM - enum unknown14_command ; $14 -unknown14: MACRO + const unknown14_command ; $14 +MACRO unknown14 db unknown14_command ; TODO ENDM - enum unknown15_command ; $15 -unknown15: MACRO + const unknown15_command ; $15 +MACRO unknown15 db unknown15_command ; TODO ENDM - enum unknown16_command ; $16 -unknown16: MACRO + const unknown16_command ; $16 +MACRO unknown16 db unknown16_command ; TODO ENDM - enum menuscript_command ; $17 -menuscript: MACRO + const menuscript_command ; $17 +MACRO menuscript db menuscript_command ENDM - enum printtext_command ; $18 -printtext: MACRO + const printtext_command ; $18 +MACRO printtext db printtext_command dw \1 ; offset into screen buffer relativepointer \2 ; pointer to text ENDM - enum cleartext_command ; $19 -cleartext: MACRO + const cleartext_command ; $19 +MACRO cleartext db cleartext_command dw \1 ; offset into screen buffer db \2 ; number of columns to clear db \3 ; number of rows to clear ENDM - enum cmpval_command ; $1A -cmpval: MACRO + const cmpval_command ; $1A +MACRO cmpval db cmpval_command db BANK(\1) ; wram or sram bank of value to compare dw \1 ; address of value to compare @@ -178,50 +178,50 @@ rept \5 endr ENDM - enum unknown1B_command ; $1B -unknown1B: MACRO + const unknown1B_command ; $1B +MACRO unknown1B db unknown1B_command ; TODO ENDM - enum unknown1C_command ; $1C -unknown1C: MACRO + const unknown1C_command ; $1C +MACRO unknown1C db unknown1C_command ; TODO ENDM - enum unknown1D_command ; $1D -unknown1D: MACRO + const unknown1D_command ; $1D +MACRO unknown1D db unknown1D_command ; TODO ENDM - enum unknown1E_command ; $1E -unknown1E: MACRO + const unknown1E_command ; $1E +MACRO unknown1E db unknown1E_command ; TODO ENDM - enum unknown1F_command ; $1F -unknown1F: MACRO + const unknown1F_command ; $1F +MACRO unknown1F db unknown1F_command ; TODO ENDM - enum unknown20_command ; $20 -unknown20: MACRO + const unknown20_command ; $20 +MACRO unknown20 db unknown20_command ; TODO ENDM - enum unknown21_command ; $21 -unknown21: MACRO + const unknown21_command ; $21 +MACRO unknown21 db unknown21_command ; TODO ENDM - enum cmpvalram_command ; $22 -cmpvalram: MACRO + const cmpvalram_command ; $22 +MACRO cmpvalram db cmpvalram_command db BANK(\1) ; wram or sram bank for first value dw \1 ; address of first value @@ -233,93 +233,93 @@ cmpvalram: MACRO relativepointer \6 ; script pointer to jump to if first value is greater ENDM - enum setval_command ; $23 -setval: MACRO + const setval_command ; $23 +MACRO setval db setval_command dw \1 ; address of value to set db \2 ; value ENDM - enum incval_command ; $24 -incval: MACRO + const incval_command ; $24 +MACRO incval db incval_command dw \1 ; address of value to increment db \2 ; increment ; TODO ENDM - enum decval_command ; $25 -decval: MACRO + const decval_command ; $25 +MACRO decval db decval_command dw \1 ; address of value to decrement db \2 ; decrement ENDM - enum incvalram_command ; $26 -incvalram: MACRO + const incvalram_command ; $26 +MACRO incvalram db incvalram_command dw \1 ; address of value to increment dw \2 ; address of increment ENDM - enum decvalram_command ; $27 -decvalram: MACRO + const decvalram_command ; $27 +MACRO decvalram db decvalram_command dw \1 ; address of value to decrement dw \2 ; address of decrement ENDM - enum updaterankings_command ; $28 -updaterankings: MACRO + const updaterankings_command ; $28 +MACRO updaterankings db updaterankings_command ENDM - enum unknown29_command ; $29 -unknown29: MACRO + const unknown29_command ; $29 +MACRO unknown29 db unknown29_command ; TODO ENDM - enum unknown2A_command ; $2A -unknown2A: MACRO + const unknown2A_command ; $2A +MACRO unknown2A db unknown2A_command ; TODO ENDM - enum unknown2B_command ; $2B -unknown2B: MACRO + const unknown2B_command ; $2B +MACRO unknown2B db unknown2B_command ; TODO ENDM - enum unknown2C_command ; $2C -unknown2C: MACRO + const unknown2C_command ; $2C +MACRO unknown2C db unknown2C_command ; TODO ENDM - enum unknown2D_command ; $2D -unknown2D: MACRO + const unknown2D_command ; $2D +MACRO unknown2D db unknown2D ; TODO ENDM - enum unknown2e_command ; $2E -unknown2e: MACRO + const unknown2e_command ; $2E +MACRO unknown2e db unknown2e_command ; TODO ENDM - enum menureturn_command ; $2F -menureturn: MACRO + const menureturn_command ; $2F +MACRO menureturn db menureturn_command ENDM - enum exit_command ; $30 -exit: MACRO + const exit_command ; $30 +MACRO exit db exit_command ENDM -end: MACRO +MACRO end db $FF ENDM diff --git a/macros/news_text_commands.asm b/macros/news_text_commands.asm index 200795e..2e84fc7 100644 --- a/macros/news_text_commands.asm +++ b/macros/news_text_commands.asm @@ -1,54 +1,155 @@ -; commands from RunMobileScript (mobile_5f) in pokecrystal - enum_start $03 - - enum newstext_easychat_command ; $03 -text_easychat: MACRO +MACRO news_text_start db "" - db newstext_easychat_command - dw \1 ; length +ENDM + +MACRO news_text_end db "@" ENDM - enum newstext_unknown04_command - enum newstext_unknown05_command - enum newstext_unknown06_command - enum newstext_unknown07_command - enum newstext_unknown08_command +; commands from RunMobileScript (mobile_5f) + const_def $01 - enum newstext_playername_command ; $09 -text_playername: MACRO - db "" - db newstext_playername_command - db \1 ; flags - db "@" + const news_text_ranking_number_command ; $01 +; prints a number from data in a rankings entry +MACRO news_text_ranking_number + db news_text_ranking_number_command + dw \1 ; offset in rankings entry data + db \2 ; byte size of value + flag (see MobilePrintNum) + db \3 ; amount of digits + db \4 ; offset of following text + db \5 ; digit to insert a character at (0 = disabled) + db \6 ; character to insert (e.g. decimal point) +ENDM + + const news_text_ranking_text_command ; $02 +; prints text from data in a rankings entry +MACRO news_text_ranking_text + db news_text_ranking_text_command + dw \1 ; offset in rankings entry data + db \2 +; if international == 0 +; db NAME_LENGTH_JAPANESE ; length of the data +; else +; db PLAYER_NAME_LENGTH - 1 +; endc + db \3 ; offset of following text ENDM - enum newstext_prefecture_command ; $0A -text_prefecture: MACRO - db "" - db newstext_prefecture_command - db \1 ; flags - db "@" + + const news_text_ranking_message_command ; $03 +; prints an easy chat message from data in a rankings entry +MACRO news_text_ranking_message + db news_text_ranking_message_command + dw \1 ; offset in rankings entry data ENDM - enum newstext_zip_command ; 0B -text_zip: MACRO - db "" - db newstext_zip_command - db \1 ; flags - db "@" + const news_text_ranking_region_command ; $04 +; prints a regions's name from data in a rankings entry +MACRO news_text_ranking_region + db news_text_ranking_region_command + dw \1 ; offset in rankings entry data + db \2 ; offset of following text ENDM - enum newstext_unknown0C_command + const news_text_ranking_pokemon_command ; $05 +; prints a pokemon species name from data in a rankings entry +MACRO news_text_ranking_pokemon + db news_text_ranking_pokemon_command + dw \1 ; offset in rankings entry data + db \2 ; offset of following text +ENDM - enum newstext_switch_command ; $0D -text_switch: MACRO - db "" - db newstext_switch_command + const news_text_ranking_gender_command ; $06 +; prints a gender from data in a rankings entry +MACRO news_text_ranking_gender + db news_text_ranking_gender_command + dw \1 ; offset in rankings entry data + db \2 ; offset of following text +ENDM + + const news_text_ranking_item_command ; $07 +; prints an item's name from data in a rankings entry +MACRO news_text_ranking_item + db news_text_ranking_item_command + dw \1 ; offset in rankings entry data + db \2 ; offset of following text +ENDM + + const news_text_ranking_indicator_command ; $08 +; prints the rank indicator +MACRO news_text_ranking_indicator + db news_text_ranking_indicator_command + db 2 ; amount of digits + db \1 ; offset of following text +ENDM + + const news_text_own_name_command ; $09 +; prints the player's own name +MACRO news_text_own_name + db news_text_own_name_command + db \1 ; offset of following text +ENDM + + const news_text_own_region_command ; $0a +; prints the player's current region +MACRO news_text_own_region_current + db news_text_own_region_command + db \1 ; offset of following text +ENDM + +; prints the player's backed-up region +MACRO news_text_own_region_backup + db news_text_own_region_command + db \1 | $80 ; offset of following text +ENDM + + const news_text_own_zip_command ; $0b +; prints the player's current zip code +MACRO news_text_own_zip_current + db news_text_own_zip_command + db \1 ; offset of following text +ENDM + +; prints the player's backed-up zip code +MACRO news_text_own_zip_backup + db news_text_own_zip_command + db \1 | $80 ; offset of following text +ENDM + + const news_text_own_message_command ; $0c +; prints the player's own message +MACRO news_text_own_message + db news_text_own_message_command +ENDM + + const news_text_switch_command ; $0d +; switches between different text based on a variable +MACRO news_text_switch + db news_text_switch_command db \1 ; number of entries dw \2 ; wram address containing offset REPT \1 relativepointer \3 ; pointer to text SHIFT ENDR +ENDM + + const news_text_nextrow_command ; $0e +; sets the offset to print text to the next screen row + the offset specified as parameter +MACRO news_text_nextrow + db news_text_nextrow_command + db \1 ; offset of following text +ENDM + + const news_text_number_command ; $0f +; prints a number from any location in memory +MACRO news_text_number + db news_text_number_command + db BANK(\1) ; memory bank + dw \1 ; address + db \2 ; byte size of value + flag (see MobilePrintNum) + db \3 ; amount of digits + db \4 ; offset of following text + db \5 ; digit to insert a character at (0 = disabled) + db \6 ; character to insert (e.g. decimal point) ENDM \ No newline at end of file diff --git a/news/first_issue.asm b/news/first_issue.asm index 067bbd0..dc081ac 100644 --- a/news/first_issue.asm +++ b/news/first_issue.asm @@ -26,7 +26,7 @@ NewsRootScreen: ; $0006 db $01 ; number of strings to draw dw $0029 ; offset into screen buffer - db "#MON NEWS No.1@" ; string + db "ポケモンニュース そうかんごう@" ; string db $02, $05 ; menu x, y db $01, $04 ; number of columns, rows @@ -82,16 +82,16 @@ NewsRootScreen: ; $0006 end .menuItemNewsGuideText - db "NEWS GUIDE@" + db "ニュースガイド@" .menuItemTrainerRankingsText - db "TRAINER RANKINGS@" + db "トレーナーランキング@" .menuItemPokemonQuizText - db "#MANIA QUIZ@" + db "ポケモンカルト@" .menuItemQuitText - db "CANCEL@" + db "やめる@" .menuItemNewsGuideScript cleartext $0105, $12, $04 @@ -114,35 +114,32 @@ NewsRootScreen: ; $0006 end .newsGuideText - text "We hope you enjoy" - line "the TRAINER RANK-" - cont "INGS and #MANIA" - cont "QUIZ in issue No.1" + text "#ニュース そうかんごうでは" + line "ランキングと" + cont "#カルトクイズで" + cont "おたのしみ ください!" - para "You can update" - line "your ranking at" - cont "any time." - - para "If you work hard" - line "you can reach the" - cont "top!" + para "あなたランキングせいせきは" + line "ランキングこうしんすれば" + cont "なんどでも かきかえられるので" + cont "がんばれば トップなれるかも!" done .menuItemNewsGuideDescription - db "Read an explan-" - line "ation of the NEWS@" + db "よみこんだ ニュースを" + line "かんたんせつめいします@" .menuItemTrainerRankingsDescription - db "Triple-theme" - line "trainer ranking!@" + db "3つテーマで" + line "ランキングします!@" .menuItemPokemonQuizDescription - db "Test your memory" - line "of your adventure!@" + db "これまでぼうけんどこまで" + line "おもいだせるか テストします!@" .menuItemQuitDescription - db "Stop reading the" - line "NEWS.@" + db "ニュースみるのを" + line "やめます@" PokemonQuizScreen: ; $0172 @@ -161,7 +158,8 @@ PokemonQuizScreen: ; $0172 db $01 ; number of strings to draw dw $0029 ; offset into screen buffer - text_switch 10, wQuizQuestionNo, \ + news_text_start + news_text_switch 10, wQuizQuestionNo, \ .question1Text, \ .question2Text, \ .question3Text, \ @@ -228,16 +226,16 @@ PokemonQuizScreen: ; $0172 end .menuItemAnswer1Text - db "1. @" + db "1ばん@" .menuItemAnswer2Text - db "2. @" + db "2ばん@" .menuItemAnswer3Text - db "3. @" + db "3ばん@" .menuItemQuitText - db "QUIT@" + db "やめる@" .menuItemAnswer1Script incval wQuizQuestionNo, $01 @@ -483,93 +481,92 @@ PokemonQuizScreen: ; $0172 db "@" .question1Text - db "Who was in the" - next "middle #BALL at" - next "PROF.ELM's LAB?" - next "1. TOTODILE" - next "2. CYNDAQUIL" - next "3. CHIKORITA" - next "@" - + db "ウツギはかせはじめに" + next "えらばせてくれた #" + next "まんなかいたのは?" + next "" + next "1.ワニノコ  2.チコりータ" + next "3.ヒノアラシ" + next "@" + .question2Text - db "What is inside" - next "the trash can" - next "next to PROF.ELM?" - next "1. LEFTOVERS" - next "2. JUICE BOTTLE" - next "3. SNACK WRAPPER" - next "@" - + db "ウツギはかせよこに" + next "ある ごみばこに" + next "はい いるのは?" + next "" + next "1.たべのこし 2.ジュースのびん" + next "3.おかしのふくろ" + next "@" + .question3Text - db "How many POTIONs" - next "did the DUDE who" - next "taught you to " - next "catch #MON have" - next "in his pack?" - next "1. 1 2. 2 3. 3" - next "@" - + db "#つかまえかたを" + next "おしえて くれる" + next "おにいさんりュックに" + next "きずくすりいくつ?" + next "1.1こ   2.2こ" + next "3.3こ" + next "@" + .question4Text - db "MOM's specialty" - next "dish is the" - next "CINNABAR VOLCANO ?" - next "1. BURGER" - next "2. CURRY" - next "3. NOODLES" - next "@" - + db "おかあさんの" + next "とくい りょうりは" + next "「グレンふう かざん ???」" + next "「???」なに?" + next "1.ハンバーグ  2.カレー" + next "3.やきそば" + next "@" + .question5Text - db "How many times" - next "does EARL spin" - next "from talking to" - next "him until he goes" - next "into the ACADEMY?" - next "1. 5 2. 6 3. 7" - next "@" - + db "ジョバンニせんせいは" + next "はなしかけてから" + next "じゅくはいるまで" + next "なんかい まわる?" + next "1.5かい   2.6かい" + next "3.7かい" + next "@" + .question6Text - db "Which of these" - next "items is not found" - next "in UNION CAVE?" - next "1. X ATTACK" - next "2. PARLYZ HEAL" - next "3. POTION" - next "@" + db "つながりのどうくつに" + next "おちていない どうぐは?" + next "" + next "1.プラスパワー 2.まひなおし" + next "3.きずぐすり" + next "@" .question7Text - db "What is the least" - next "amount of times" - next "you need to talk" - next "to FARFETCH'D to" - next "capture it?" - next "1. 3 2. 4 3. 5" + db "カモネギつかまえるとき" + next "いちばん すくない てかずは" + next "なんかい カモネギに" + next "はなしかければ いい?" + next "1.3かい  2.4かい" + next "3.5かい" next "@" .question8Text - db "How many SLOWPOKE" - next "were in the cave" - next "when you rescued" - next "them at SLOWPOKE" - next "WELL?" - next "1. 2 2. 3 3. 4" + db "ヤドンのいどに" + next "ヤドンたすけいったとき" + next "いどなかいるヤドンは" + next "なんひき だった?" + next "1.2ひき  2.3ひき" + next "3.4ひき" next "@" .question9Text - db "Which stop is the" - next "sea on the GUIDE" - next "GENT's tour around" - next "CHERRYGROVE CITY?" - next "1. 3rd 2. 4th " - next "3. 5th" + db "ヨシノシティいる" + next "あんないじいさんは" + next "うみ なんばんめに" + next "あんない してくれる?" + next "1.3ばんめ  2.4ばんめ" + next "3.5ばんめ" next "@" .question10Text - db "Which of these" - next "foreign items is" - next "not found in MR." - next "#MON's HOUSE?" - next "1. COIN 2. STAMP" - next "3. MAGAZINE" + db "#じいさんいえに" + next "がいこくものが" + next "あるけど このなかで" + next "ない ものは?" + next "1.コイン  2.き" + next "3.ざっし" next "@" @@ -591,10 +588,10 @@ QuizScoreEvaluationScreen: ; $0677 db $00, $00 ; offset into screen buffer db "@" ; string - db $02, $0A ; menu x, y ; $04, $0A ; Needs to be updated with PROF.OAK's REPORT + db $04, $0A ; menu x, y db $01, $01 ; number of columns, rows db $00, $00 ; column width, row height - db $01, $00, $00, $00, $02, $01 ; $03, $00, $00, $00, $02, $01 PROF OAK's REPORT location + db $03, $00, $00, $00, $02, $01 ; ? relativepointer .aButton ; script pointer a button relativepointer .aButton ; script pointer b button @@ -606,7 +603,7 @@ QuizScoreEvaluationScreen: ; $0677 dw $FFFF ; script pointer down button db $01 ; number of menu items - db $19, $01 ; screen buffer offset to print menu descriptions + dw $0119 ; screen buffer offset to print menu descriptions db $12, $04 ; width, height of blanked area db $00 ; load rankings table flag (table number should be specfied in 0:CD62) @@ -627,7 +624,7 @@ QuizScoreEvaluationScreen: ; $0677 end .menuItemText - db "PROF.OAK's REPORT@" + db "オーキドはかせの ひょうか@" .menuItemScript cmpval wQuizScore, .scorelow, .scorelow, .greater, $01, $05 @@ -673,63 +670,43 @@ QuizScoreEvaluationScreen: ; $0677 end .menuItemDescription - db "Take the quiz to" - line "receive a rating!@" + db "クイズ しゅうりょう" + line "ひょうかうけて ください!@" .textScoreLow - text "You still have" - line "lots to do." - - para "It's not enough to" - line "memorize things." - - para "#MANIACs can" - line "memorize things" - cont "they don't even" - cont "need to remember!" + text "ぜんぜん まだまだ じゃな" + line "これおぼえてなくても いいだろう" + cont "というような ことまで おぼえるのが" + cont "#マニアと いうものじゃ" done .textScoreAverage - text "Not quite…" - line "#MANIACs have a" - cont "lot more passion!" - - para "Be sure to look in" - line "every nook and" - cont "cranny!" + text "#マニアしてまだ" + line "ボりュームたりん!" + + para "いろいろな ものを" + line "むだでも くまなく みるのじゃ!" done .textScoreGood - text "Hmm…" - line "You're really" + text "ふむ がんばおるな" + line "それなり#マニア" + cont "らしく なきておるよ!" - para "starting to earn" - line "the title of" - cont "#MANIAC!" - - para "Are you talking" - line "with your friends?" - - para "It's tough to" - line "do this alone!" + para "ともだちと そうだん しているかな?" + line "ひとりでたいへん だからな" done .textScoreGreat - text "Excellent! You" - line "really like to" - - para "poke around in" - line "those nooks and" - cont "crannies, don't" - cont "you?" + text "エクセレントじゃ!" + line "きみじゅうばこすみを" + cont "つつくのすき なんじゃろ?" done .textScoreBest - text "Whoa! A perfect" - line "#MANIAC! I've" - - para "dreamt about this!" - line "Congratulations!" + text "おおっ ゆめにまで みた" + line "パーフェクトな #マニアの" + cont "かんせいじゃ! <……> おめでとう!" done @@ -754,8 +731,8 @@ TrainerRankingsScreen: ; $0857 db $04 ; palette db $01 ; number of strings to draw - db $29, $00 ; offset into screen buffer - db "TRAINER RANKINGS@" ; string + dw $0029 ; offset into screen buffer + db "トレーナーランキング@" ; string db $02, $05 ; menu x, y db $01, $04 ; number of columns, rows @@ -772,7 +749,7 @@ TrainerRankingsScreen: ; $0857 relativepointer .downButton ; script pointer down button db $04 ; number of menu items - db $19, $01 ; screen buffer offset to print menu descriptions + dw $0119 ; screen buffer offset to print menu descriptions db $12, $04 ; width, height of blanked area db $00 ; load rankings table flag (table number should be specfied in 0:CD62) @@ -811,16 +788,16 @@ TrainerRankingsScreen: ; $0857 end .menuItemViewRankingsText - db "VIEW RANKINGS@" + db "ランキング みる@" .menuItemUpdateRankingsText - db "UPDATE RANKINGS@" + db "ランキング こうしん@" .menuItemRankingsDescriptionText - db "RANKING INFO@" - + db "ランキング せつめい@" + .menuItemReturnText - db "CANCEL@" + db "やめる@" .menuItemViewRankingsScript cmpvalram sNewsId, $0C, sNewsIdBackup, .noRankingsData, .continueToCategoriesScreen, .noRankingsData @@ -857,21 +834,21 @@ TrainerRankingsScreen: ; $0857 end .rankingsUpdatedText - text "Rankings update" - line "was successful!" + text "ランキングこうしんを" + line "しました!" done .rankingsUpdateCancelledText - text "Rankings update" - line "was stopped." + text "ランキングこうしんを" + line "やめました" done .rankingsUpdateFailedText - text "Rankings update" - line "has failed…" - - para "Please download" - line "the latest NEWS." + text "ランキングこうしんに" + line "しっぱい⋯" + + para "あたらしい ニュースを" + line "よみこんで ください" done .menuItemRankingsDescriptionScript @@ -885,61 +862,46 @@ TrainerRankingsScreen: ; $0857 end .rankingsDescriptionText - text "BATTLE TOWER" - line "" + text "バトルタワーで かった かいすうは" + line "40ばんどうろバトルタワーで" + cont "あなたこれまでなんにんの" + cont "しょうぶかったか" + cont "にんずうで きそいます" - para "The number of" - line "#MON battles" - cont "won against other" - cont "S at the" - cont "BATTLE TOWER on" - cont "ROUTE 40." - - para "LARGEST MAGIKARP" - line "" + para "コイキングおおきさは" + line "いかりのみずうみいる" + cont "つりめいじんはかもらった" + cont "コイキングうち いちばん" + cont "おおきかった もので きそいます" - para "The size of the" - line "largest MAGIKARP" - cont "measured by the" - cont "FISHING GURU at" - cont "the LAKE OF RAGE." - - para "BUG-CATCHING" - line "" - - para "The highest score" - line "obtained at the" - cont "BUG-CATCHING Con-" - cont "test held in the" - cont "NATIONAL PARK." + para "むしとりたいかい こうとくてんは" + line "しぜんこうえんで おこなわれる" + cont "むしとりたいかいで これまでに" + cont "とった いちばん たかい" + cont "てんすうで きそいます" done .noRankingsDataText - text "There is no" - line "ranking data." - - para "Link to obtain" - line "ranking data." - + text "ランキングデータありません" + line "ランキングこうしんすれば" + cont "みることできます" para "" - line "" done .menuItemViewRankingsDescription - db "View the various" - line "rankings@" + db "いろいろな ランキングが" + line "みれます@" .menuItemUpdateRankingsDescription - db "Reload rankings to" - line "update your scores@" + db "ランキングよみこみなおします" + line "あなたせいせきも かわります@" .menuItemRankingsDescriptionDescription - db "An explanation of" - line "the ranking themes@" + db "こんかいランキングの" + line "テーマついて せつめいします@" .menuItemReturnDescription - db "Return to the" - line "first page@" + db "さいしょぺージもどります@" TrainerRankingsCategoriesScreen: ; $0AF2 @@ -963,8 +925,8 @@ TrainerRankingsCategoriesScreen: ; $0AF2 db $04 ; palette db $01 ; number of strings to draw - db $29, $00 ; offset into screen buffer - db "TRAINER RANKINGS@" ; string + dw $0029 ; offset into screen buffer + db "トレーナーランキング@" ; string db $02, $05 ; menu x, y db $01, $04 ; number of columns, rows @@ -981,7 +943,7 @@ TrainerRankingsCategoriesScreen: ; $0AF2 relativepointer .downButton ; script pointer down button db $04 ; number of menu items - db $19, $01 ; screen buffer offset to print menu descriptions + dw $0119 ; screen buffer offset to print menu descriptions db $12, $04 ; width, height of blanked area db $00 ; load rankings table flag (table number should be specfied in 0:CD62) @@ -1024,16 +986,16 @@ TrainerRankingsCategoriesScreen: ; $0AF2 end .menuItemBattleTowerWinsText - db "BATTLE TOWER@" + db "バトルタワーで かった かいすう@" .menuItemBugCatchingContestHighScoreText - db "BUG-CATCHING@" + db "むしとりたいかい こうとくてん@" .menuItemLargestMagikarpText - db "LARGEST MAGIKARP@" + db "つった コイキングおおきさ@" .menuItemReturnText - db "CANCEL@" + db "もどる@" .menuItemBattleTowerWinsScript setval wRankingsTable, $00 @@ -1054,8 +1016,8 @@ TrainerRankingsCategoriesScreen: ; $0AF2 end .menuItemDescription - db "Please choose a" - line "ranking to view@" + db "みたい ランキングを" + line "えらんで ください@" TrainerRankingsTypeScreen: ; $0BC4 @@ -1079,8 +1041,9 @@ TrainerRankingsTypeScreen: ; $0BC4 db $04 ; palette db $01 ; number of strings to draw - db $29, $00 ; offset into screen buffer - text_switch $03, wRankingsCategory, .battleTowerWinsText, .bugCatchingContestHighScoreText, .largestMagikarpText + dw $0029 ; offset into screen buffer + news_text_start + news_text_switch 3, wRankingsCategory, .battleTowerWinsText, .bugCatchingContestHighScoreText, .largestMagikarpText db "@" db $02, $05 ; menu x, y @@ -1098,7 +1061,7 @@ TrainerRankingsTypeScreen: ; $0BC4 relativepointer .downButton ; script pointer down button db $04 ; number of menu items - db $19, $01 ; screen buffer offset to print menu descriptions + dw $0119 ; screen buffer offset to print menu descriptions db $12, $04 ; width, height of blanked area db $00 ; load rankings table flag (table number should be specfied in 0:CD62) @@ -1139,18 +1102,23 @@ TrainerRankingsTypeScreen: ; $0BC4 end .menuItemNationalRankingText - db "NATIONAL RANKINGS@" + db "ぜんこく ランキング@" .menuItemPrefecturalRankingText - text_prefecture $80 - db " RANKINGS@" + news_text_start + news_text_own_region_backup 0 + news_text_end + db " ランキング@" .menuItemZipCodeRankingText - text_zip $83 - db " RANKINGS@" + db "■" + news_text_start + news_text_own_zip_backup 3 + news_text_end + db " ランキング@" .menuItemReturnText - db "CANCEL@" + db "もどる@" .menuItemNationalRankingScript setval wRankingsType, $00 @@ -1177,17 +1145,17 @@ TrainerRankingsTypeScreen: ; $0BC4 end .menuItemDescription - db "Choose an area to" - line "view the rankings@" + db "みたい ちいき を" + line "えらんで ください@" .battleTowerWinsText - db "BATTLE TOWER@" + db "バトルタワーで かった かいすう@" .bugCatchingContestHighScoreText - db "BUG-CATCHING@" + db "むしとりたいかい こうとくてん@" .largestMagikarpText - db "LARGEST MAGIKARP@" + db "つった コイキングおおきさ@" TrainerRankingsRankingsScreen: ; $0CBD @@ -1212,10 +1180,12 @@ TrainerRankingsRankingsScreen: ; $0CBD db $02 ; number of strings to draw dw $0029 ; offset into screen buffer - text_switch $03, wRankingsCategory, .headerText1, .headerText2, .headerText3 + news_text_start + news_text_switch 3, wRankingsCategory, .headerText1, .headerText2, .headerText3 db "@" dw $0066 ; offset into screen buffer - text_switch $03, wRankingsType, .headerText4, .headerText5, .headerText6 + news_text_start + news_text_switch 3, wRankingsType, .headerText4, .headerText5, .headerText6 db "@" db $02, $07 ; menu x, y @@ -1301,34 +1271,40 @@ TrainerRankingsRankingsScreen: ; $0CBD end .rankingsEntryText - text_switch $03, wRankingsCategory, .rankingsEntryBattleTowerWinsText, .rankingsEntryBugCatchingContestHighScoreText, .rankingsEntryLargestMagikarpText - db "@" + news_text_start + news_text_switch 3, wRankingsCategory, .rankingsEntryBattleTowerWinsText, .rankingsEntryBugCatchingContestHighScoreText, .rankingsEntryLargestMagikarpText + news_text_end .rankingsEntryBattleTowerWinsText - db $15 - db $08 - db $02, $03, $02, $00, $00, $06, $06, $01, $18, $00, $02, $05, $05, $00, $00 - db $50 - db "@" + news_text_start + news_text_ranking_indicator 3 + news_text_ranking_text 0, 6, 6 + news_text_ranking_number 24, 2, 5, 5, 0, 0 + news_text_end + db "かい@" .rankingsEntryBugCatchingContestHighScoreText - db $15 - db $08 - db $02, $03, $02, $00, $00, $06, $06, $01, $18, $00, $02, $05, $05, $00, $00 - db $50 - db "@" + news_text_start + news_text_ranking_indicator 3 + news_text_ranking_text 0, 6, 6 + news_text_ranking_number 24, 2, 5, 5, 0, 0 + news_text_end + db "てん@" .rankingsEntryLargestMagikarpText - db $15 - db $08 - db $02, $03, $02, $00, $00, $06, $06, $01, $18, $00, $82, $04, $05, $04, $F2 - db $50 - db "@" + news_text_start + news_text_ranking_indicator 3 + news_text_ranking_text 0, 6, 6 + news_text_ranking_number 24, 2 | PRINTNUM_LEADINGZEROS, 4, 5, 4, "" + news_text_end + db "センチ@" .ownRankText - text_playername $00 - db "'s RANK: @" - + news_text_start + news_text_own_name 0 + news_text_end + db " じゅんい@" + .rankingsEntryScript cmpvalram wcd22, $01, wcd5c, .somebodyRankedHere, .nobodyRankedHere, .nobodyRankedHere @@ -1345,8 +1321,8 @@ TrainerRankingsRankingsScreen: ; $0CBD end .nobodyRankedHereText - db "No one is" - next "ranked here." + db "ここにだれも" + next "ランクイン してません" para "@" .ownRankScript @@ -1376,127 +1352,119 @@ TrainerRankingsRankingsScreen: ; $0CBD end .giftText - text "For receiving a" - next "such a high rank," - - para "we have a nice" - line "gift for you." - cont "Enjoy!" + text "ランキングで トップとった" + next "あなたに⋯" + cont "すてきな プレゼントあります" + cont "おたのしみに!" done .rankedPlayerInfoText - db $15 - db $06 - db $0B, $00, $04, $01, $0A, $00, $01, $03, $04, $00, $00 - db $50 - db "" - db $15 - db $04 - db $07, $00, $07 - db $50 + news_text_start + news_text_ranking_gender 11, 4 + news_text_ranking_number 10, 1, 3, 4, 0, 0 + news_text_end + db "さい " + news_text_start + news_text_ranking_region 7, 7 + news_text_end para "@" .rankedPlayerMessage - text_easychat $000C + news_text_start + news_text_ranking_message 12 + news_text_end para "@" .playerRankedText - text_switch $03, wRankingsCategory, .ownBattleTowerWinsText, .ownBugCatchingContestHighScoreText, .ownLargestMagikarpText - text_playername $00 - db "'s RANK is…" + news_text_start + news_text_switch 3, wRankingsCategory, .ownBattleTowerWinsText, .ownBugCatchingContestHighScoreText, .ownLargestMagikarpText + news_text_start + news_text_own_name 0 + news_text_end + db " じゅんいは⋯" para "" - db $15 - db $0F - db BANK(wOwnRank) - dw wOwnRank - db $04, $04, $04, $00, $00 - db $50 - db "!" - line "Congratulations!" + news_text_start + news_text_number wOwnRank, 4, 4, 4, 0, 0 + news_text_end + db " ばん ランクイン!" + line "おめでとう!" para "@" .playerNotRankedText - text_switch $03, wRankingsCategory, .ownBattleTowerWinsText, .ownBugCatchingContestHighScoreText, .ownLargestMagikarpText - text_playername $00 - db "'s RANK is…" - para "Not currently in" - line "the rankings." + news_text_start + news_text_switch 3, wRankingsCategory, .ownBattleTowerWinsText, .ownBugCatchingContestHighScoreText, .ownLargestMagikarpText + news_text_start + news_text_own_name 0 + news_text_end + db " じゅんいは⋯" + para "ランクイン しなかった⋯" + line "ざんねん⋯" para "@" .ownBattleTowerWinsText - text_playername $00 - db "'s SCORE:" + news_text_start + news_text_own_name 0 + news_text_end + db " せいせきは" line "" - db $15 - db $0F - db BANK(sNumBattleTowerWins) - dw sNumBattleTowerWins - db $02 - db $05 - db $05 - db $00 - db $00 - db $50 - db " points" + news_text_start + news_text_number sNumBattleTowerWins, 2, 5, 5, 0, 0 + news_text_end + db "かい" para "@" .ownBugCatchingContestHighScoreText - text_playername $00 - db "'s SCORE:" + news_text_start + news_text_own_name 0 + news_text_end + db " せいせきは" line "" - db $15 - db $0F - db BANK(sBugContestHighscore) - dw sBugContestHighscore - db $02 - db $05 - db $05 - db $00 - db $00 - db $50 - db " points" + news_text_start + news_text_number sBugContestHighscore, 2, 5, 5, 0, 0 + news_text_end + db "てん" para "@" .ownLargestMagikarpText - text_playername $00 - db "'s SCORE:" + news_text_start + news_text_own_name 0 + news_text_end + db " せいせきは" line "" - db $15 - db $0F - db BANK(sLargestMagikarp) - dw sLargestMagikarp - db $82 - db $04 - db $05 - db $04 - db $F2 - db $50 - db " cm" + news_text_start + news_text_number sLargestMagikarp, 2 | PRINTNUM_LEADINGZEROS, 4, 5, 4, "" + news_text_end + db "センチ" para "@" .menuItemDescription - db "View the profile" - line "of this TRAINER.@" + db "えらんだ ひとプロフィールを" + line "みることできます@" .headerText1 - db "BATTLE TOWER@" + db "バトルタワーで かった かいすう@" .headerText2 - db "BUG-CATCHING@" + db "むしとりたいかい こうとくてん@" .headerText3 - db "LARGEST MAGIKARP@" + db "つった コイキングおおきさ@" .headerText4 - db "NATIONAL TOP 10!@" + db "ぜんこく トップ10!@" .headerText5 - text_prefecture $80 - db " TOP 10!@" + news_text_start + news_text_own_region_backup 0 + news_text_end + db " トップ10!@" .headerText6 - text_zip $83 - db " TOP 10!@" + db "■" + news_text_start + news_text_own_zip_backup 3 + news_text_end + db " トップ10!@" db $04 ; whatever this is supposed to be \ No newline at end of file diff --git a/news_en/first_issue_en.asm b/news_en/first_issue_en.asm new file mode 100644 index 0000000..76d1b76 --- /dev/null +++ b/news_en/first_issue_en.asm @@ -0,0 +1,1509 @@ +INCLUDE "header.asm" + +NewsRootScreen: ; $0006 + screenconfig + db MUSIC_PROF_ELM ; music + + db $00 ; number of custom palettes +; dw $0000 ; custom palette color 1 +; dw $0000 ; custom palette color 2 +; dw $0000 ; custom palette color 3 +; dw $0000 ; custom palette color 4 + + db $02 ; number of boxes to draw + db $00 ; x ; first box + db $03 ; y + db $14 ; width + db $0A ; height + db $01 ; border type + db $03 ; palette + db $00 ; x ; second box + db $0C ; y + db $14 ; width + db $06 ; height + db $02 ; border type + db $04 ; palette + + db $01 ; number of strings to draw + dw $0029 ; offset into screen buffer + db "#MON NEWS No.1@" ; string + + db $02, $05 ; menu x, y + db $01, $04 ; number of columns, rows + db $00, $02 ; column width, row height + db $12, $04, $07, $04, $02, $04 ; ? + + relativepointer .aButton ; script pointer a button + relativepointer .bButton ; script pointer b button + dw $FFFF ; script pointer select button + dw $FFFF ; script pointer start button + dw $FFFF ; script pointer left button + dw $FFFF ; script pointer right button + relativepointer .upButton ; script pointer up button + relativepointer .downButton ; script pointer down button + + db $04 ; number of menu items + dw $0119 ; screen buffer offset to print menu descriptions + db $12, $04 ; width, height of blanked area + + db $00 ; load rankings table flag (table number should be specfied in 0:CD62) + + relativepointer .menuItemNewsGuideText ; pointers to text for each menu item + relativepointer .menuItemTrainerRankingsText + relativepointer .menuItemPokemonQuizText + relativepointer .menuItemQuitText + + relativepointer .menuItemNewsGuideScript ; pointers to script for each menu item + relativepointer .menuItemTrainerRankingsScript + relativepointer .menuItemPokemonQuizScript + relativepointer .menuItemQuitScript + + relativepointer .menuItemNewsGuideDescription ; pointers to description text for each menu item + relativepointer .menuItemTrainerRankingsDescription + relativepointer .menuItemPokemonQuizDescription + relativepointer .menuItemQuitDescription + +.aButton + playsound SFX_READ_TEXT + menuscript + end + +.bButton + playsound SFX_MENU + exit + end + +.upButton + menuup + end + +.downButton + menudown + end + +.menuItemNewsGuideText + db "NEWS GUIDE@" + +.menuItemTrainerRankingsText + db "TRAINER RANKINGS@" + +.menuItemPokemonQuizText + db "#MANIA QUIZ@" + +.menuItemQuitText + db "CANCEL@" + +.menuItemNewsGuideScript + cleartext $0105, $12, $04 + printtext $0119, .newsGuideText + menureturn + end + +.menuItemTrainerRankingsScript + loadscreen TrainerRankingsScreen + end + +.menuItemPokemonQuizScript + setval wQuizQuestionNo, $00 + setval wQuizScore, $00 + loadscreen PokemonQuizScreen + end + +.menuItemQuitScript + exit + end + +.newsGuideText + text "We hope you enjoy" + line "the TRAINER RANK-" + cont "INGS and #MANIA" + cont "QUIZ in issue No.1" + + para "You can update" + line "your ranking at" + cont "any time." + + para "If you work hard" + line "you can reach the" + cont "top!" + done + +.menuItemNewsGuideDescription + db "Read an explan-" + line "ation of the NEWS@" + +.menuItemTrainerRankingsDescription + db "Triple-theme" + line "trainer ranking!@" + +.menuItemPokemonQuizDescription + db "Test your memory" + line "of your adventure!@" + +.menuItemQuitDescription + db "Stop reading the" + line "NEWS.@" + + +PokemonQuizScreen: ; $0172 + screenconfig + db MUSIC_GAME_CORNER ; music + + db $00 ; number of custom palettes + + db $01 ; number of boxes to draw + db $00 ; x + db $0E ; y + db $14 ; width + db $04 ; height + db $02 ; border type + db $04 ; palette + + db $01 ; number of strings to draw + dw $0029 ; offset into screen buffer + news_text_start + news_text_switch 10, wQuizQuestionNo, \ + .question1Text, \ + .question2Text, \ + .question3Text, \ + .question4Text, \ + .question5Text, \ + .question6Text, \ + .question7Text, \ + .question8Text, \ + .question9Text, \ + .question10Text + db "@" + + db $02, $10 ; menu x, y + db $04, $01 ; number of columns, rows + db $04, $02 ; column width, row height + db $01, $00, $00, $00, $00, $04 ; ? + + relativepointer .aButton ; script pointer a button + relativepointer .bButton ; script pointer b button + dw $FFFF ; script pointer select button + relativepointer .bButton ; script pointer start button + relativepointer .leftButton ; script pointer left button + relativepointer .rightButton ; script pointer right button + dw $FFFF ; script pointer up button + dw $FFFF ; script pointer down button + + db $04 ; number of menu items + dw $0119 ; screen buffer offset to print menu descriptions + db $12, $04 ; width, height of blanked area + + db $00 ; load rankings table flag (table number should be specfied in 0:CD62) + + relativepointer .menuItemAnswer1Text ; pointers to text for each menu item + relativepointer .menuItemAnswer2Text + relativepointer .menuItemAnswer3Text + relativepointer .menuItemQuitText + + relativepointer .menuItemAnswer1Script ; pointers to script for each menu item + relativepointer .menuItemAnswer2Script + relativepointer .menuItemAnswer3Script + relativepointer .menuItemQuitScript + + relativepointer .dummyDescription ; pointers to description text for each menu item + relativepointer .dummyDescription + relativepointer .dummyDescription + relativepointer .dummyDescription + +.aButton + playsound SFX_READ_TEXT + menuscript + end + +.leftButton + menuleft + end + +.rightButton + menuright + end + +.bButton + playsound SFX_MENU + loadscreen NewsRootScreen + end + +.menuItemAnswer1Text + db "1. @" + +.menuItemAnswer2Text + db "2. @" + +.menuItemAnswer3Text + db "3. @" + +.menuItemQuitText + db "QUIT@" + +.menuItemAnswer1Script + incval wQuizQuestionNo, $01 + cmpval wQuizQuestionNo, .answer1notquestion1, .answer1question1, .answer1notquestion1, $01, $01 + +.answer1question1 + incval wQuizScore, $01 + loadscreen PokemonQuizScreen + end + +.answer1notquestion1 + cmpval wQuizQuestionNo, .answer1notquestion2, .answer1question2, .answer1notquestion2, $01, $02 + +.answer1question2 + loadscreen PokemonQuizScreen + end + +.answer1notquestion2 + cmpval wQuizQuestionNo, .answer1notquestion3, .answer1question3, .answer1notquestion3, $01, $03 + +.answer1question3 + incval wQuizScore, $03 + loadscreen PokemonQuizScreen + end + +.answer1notquestion3 + cmpval wQuizQuestionNo, .answer1notquestion4, .answer1question4, .answer1notquestion4, $01, $04 + +.answer1question4 + incval wQuizScore, $01 + loadscreen PokemonQuizScreen + end + +.answer1notquestion4 + cmpval wQuizQuestionNo, .answer1notquestion5, .answer1question5, .answer1notquestion5, $01, $05 + +.answer1question5 + loadscreen PokemonQuizScreen + end + +.answer1notquestion5 + cmpval wQuizQuestionNo, .answer1notquestion6, .answer1question6, .answer1notquestion6, $01, $06 + +.answer1question6 + loadscreen PokemonQuizScreen + end + +.answer1notquestion6 + cmpval wQuizQuestionNo, .answer1notquestion7, .answer1question7, .answer1notquestion7, $01, $07 + +.answer1question7 + loadscreen PokemonQuizScreen + end + +.answer1notquestion7 + cmpval wQuizQuestionNo, .answer1notquestion8, .answer1question8, .answer1notquestion8, $01, $08 + +.answer1question8 + incval wQuizScore, $03 + loadscreen PokemonQuizScreen + end + +.answer1notquestion8 + cmpval wQuizQuestionNo, .answer1notquestion9, .answer1question9, .answer1notquestion9, $01, $09 + +.answer1question9 + loadscreen PokemonQuizScreen + end + +.answer1notquestion9 + cmpval wQuizQuestionNo, .answer1notquestion10, .answer1question10, .answer1notquestion10, $01, $0A + +.answer1question10 + loadscreen QuizScoreEvaluationScreen + end + +.answer1notquestion10 + end + + +.menuItemAnswer2Script + incval wQuizQuestionNo, $01 + cmpval wQuizQuestionNo, .answer2notquestion1, .answer2question1, .answer2notquestion1, $01, $01 + +.answer2question1 + loadscreen PokemonQuizScreen + end + +.answer2notquestion1 + cmpval wQuizQuestionNo, .answer2notquestion2, .answer2question2, .answer2notquestion2, $01, $02 + +.answer2question2 + loadscreen PokemonQuizScreen + end + +.answer2notquestion2 + cmpval wQuizQuestionNo, .answer2notquestion3, .answer2question3, .answer2notquestion3, $01, $03 + +.answer2question3 + loadscreen PokemonQuizScreen + end + +.answer2notquestion3 + cmpval wQuizQuestionNo, .answer2notquestion4, .answer2question4, .answer2notquestion4, $01, $04 + +.answer2question4 + loadscreen PokemonQuizScreen + end + +.answer2notquestion4 + cmpval wQuizQuestionNo, .answer2notquestion5, .answer2question5, .answer2notquestion5, $01, $05 + +.answer2question5 + loadscreen PokemonQuizScreen + end + +.answer2notquestion5 + cmpval wQuizQuestionNo, .answer2notquestion6, .answer2question6, .answer2notquestion6, $01, $06 + +.answer2question6 + incval wQuizScore, $01 + loadscreen PokemonQuizScreen + end + +.answer2notquestion6 + cmpval wQuizQuestionNo, .answer2notquestion7, .answer2question7, .answer2notquestion7, $01, $07 + +.answer2question7 + incval wQuizScore, $02 + loadscreen PokemonQuizScreen + end + +.answer2notquestion7 + cmpval wQuizQuestionNo, .answer2notquestion8, .answer2question8, .answer2notquestion8, $01, $08 + +.answer2question8 + loadscreen PokemonQuizScreen + end + +.answer2notquestion8 + cmpval wQuizQuestionNo, .answer2notquestion9, .answer2question9, .answer2notquestion9, $01, $09 + +.answer2question9 + incval wQuizScore, $02 + loadscreen PokemonQuizScreen + end + +.answer2notquestion9 + cmpval wQuizQuestionNo, .answer2notquestion10, .answer2question10, .answer2notquestion10, $01, $0A + +.answer2question10 + incval wQuizScore, $02 + loadscreen QuizScoreEvaluationScreen + end + +.answer2notquestion10 + end + + +.menuItemAnswer3Script + incval wQuizQuestionNo, $01 + cmpval wQuizQuestionNo, .answer3notquestion1, .answer3question1, .answer3notquestion1, $01, $01 + +.answer3question1 + loadscreen PokemonQuizScreen + end + +.answer3notquestion1 + cmpval wQuizQuestionNo, .answer3notquestion2, .answer3question2, .answer3notquestion2, $01, $02 + +.answer3question2 + incval wQuizScore, $02 + loadscreen PokemonQuizScreen + end + +.answer3notquestion2 + cmpval wQuizQuestionNo, .answer3notquestion3, .answer3question3, .answer3notquestion3, $01, $03 + +.answer3question3 + loadscreen PokemonQuizScreen + end + +.answer3notquestion3 + cmpval wQuizQuestionNo, .answer3notquestion4, .answer3question4, .answer3notquestion4, $01, $04 + +.answer3question4 + loadscreen PokemonQuizScreen + end + +.answer3notquestion4 + cmpval wQuizQuestionNo, .answer3notquestion5, .answer3question5, .answer3notquestion5, $01, $05 + +.answer3question5 + incval wQuizScore, $03 + loadscreen PokemonQuizScreen + end + +.answer3notquestion5 + cmpval wQuizQuestionNo, .answer3notquestion6, .answer3question6, .answer3notquestion6, $01, $06 + +.answer3question6 + loadscreen PokemonQuizScreen + end + +.answer3notquestion6 + cmpval wQuizQuestionNo, .answer3notquestion7, .answer3question7, .answer3notquestion7, $01, $07 + +.answer3question7 + loadscreen PokemonQuizScreen + end + +.answer3notquestion7 + cmpval wQuizQuestionNo, .answer3notquestion8, .answer3question8, .answer3notquestion8, $01, $08 + +.answer3question8 + loadscreen PokemonQuizScreen + end + +.answer3notquestion8 + cmpval wQuizQuestionNo, .answer3notquestion9, .answer3question9, .answer3notquestion9, $01, $09 + +.answer3question9 + loadscreen PokemonQuizScreen + end + +.answer3notquestion9 + cmpval wQuizQuestionNo, .answer3notquestion10, .answer3question10, .answer3notquestion10, $01, $0A + +.answer3question10 + loadscreen QuizScoreEvaluationScreen + end + +.answer3notquestion10 + end + + +.menuItemQuitScript + playsound SFX_MENU + loadscreen NewsRootScreen + end + +.dummyDescription + db "@" + +.question1Text + db "Who was in the" + next "middle #BALL at" + next "PROF.ELM's LAB?" + next "1. TOTODILE" + next "2. CYNDAQUIL" + next "3. CHIKORITA" + next "@" + +.question2Text + db "What is inside" + next "the trash can" + next "next to PROF.ELM?" + next "1. LEFTOVERS" + next "2. JUICE BOTTLE" + next "3. SNACK WRAPPER" + next "@" + +.question3Text + db "How many POTIONs" + next "did the DUDE who" + next "taught you to " + next "catch #MON have" + next "in his pack?" + next "1. 1 2. 2 3. 3" + next "@" + +.question4Text + db "MOM's specialty" + next "dish is the" + next "CINNABAR VOLCANO ?" + next "1. BURGER" + next "2. CURRY" + next "3. NOODLES" + next "@" + +.question5Text + db "How many times" + next "does EARL spin" + next "from talking to" + next "him until he goes" + next "into the ACADEMY?" + next "1. 5 2. 6 3. 7" + next "@" + +.question6Text + db "Which of these" + next "items is not found" + next "in UNION CAVE?" + next "1. X ATTACK" + next "2. PARLYZ HEAL" + next "3. POTION" + next "@" + +.question7Text + db "What is the least" + next "amount of times" + next "you need to talk" + next "to FARFETCH'D to" + next "capture it?" + next "1. 3 2. 4 3. 5" + next "@" + +.question8Text + db "How many SLOWPOKE" + next "were in the cave" + next "when you rescued" + next "them at SLOWPOKE" + next "WELL?" + next "1. 2 2. 3 3. 4" + next "@" + +.question9Text + db "Which stop is the" + next "sea on the GUIDE" + next "GENT's tour around" + next "CHERRYGROVE CITY?" + next "1. 3rd 2. 4th " + next "3. 5th" + next "@" + +.question10Text + db "Which of these" + next "foreign items is" + next "not found in MR." + next "#MON's HOUSE?" + next "1. COIN 2. STAMP" + next "3. MAGAZINE" + next "@" + + +QuizScoreEvaluationScreen: ; $0677 + screenconfig + db MUSIC_POKEMON_TALK ; music + + db $00 ; number of custom palettes + + db $01 ; number of boxes to draw + db $00 ; x + db $0C ; y + db $14 ; width + db $06 ; height + db $02 ; border type + db $04 ; palette + + db $01 ; number of strings to draw + db $00, $00 ; offset into screen buffer + db "@" ; string + + db $02, $0A ; menu x, y ; $04, $0A ; Needs to be updated with PROF.OAK's REPORT + db $01, $01 ; number of columns, rows + db $00, $00 ; column width, row height + db $01, $00, $00, $00, $02, $01 ; $03, $00, $00, $00, $02, $01 PROF OAK's REPORT location + + relativepointer .aButton ; script pointer a button + relativepointer .aButton ; script pointer b button + dw $FFFF ; script pointer select button + relativepointer .aButton ; script pointer start button + dw $FFFF ; script pointer left button + dw $FFFF ; script pointer right button + dw $FFFF ; script pointer up button + dw $FFFF ; script pointer down button + + db $01 ; number of menu items + dw $0119 ; screen buffer offset to print menu descriptions + db $12, $04 ; width, height of blanked area + + db $00 ; load rankings table flag (table number should be specfied in 0:CD62) + + relativepointer .menuItemText ; pointers to text for each menu item + + relativepointer .menuItemScript ; pointers to script for each menu item + + relativepointer .menuItemDescription ; pointers to description text for each menu item + +.aButton + playsound SFX_READ_TEXT + cleartext $0105, $12, $04 + trainersprite $002E, POKEMON_PROF, $07 + menuscript + menureturn + loadscreen NewsRootScreen + end + +.menuItemText + db "PROF.OAK's REPORT@" + +.menuItemScript + cmpval wQuizScore, .scorelow, .scorelow, .greater, $01, $05 + +.scorelow + printtext $0119, .textScoreLow + playsound SFX_DEX_FANFARE_LESS_THAN_20 + end + +.greater + cmpval wQuizScore, .scoreaverage, .scoreaverage, .greater2, $01, $0A + +.scoreaverage + printtext $0119, .textScoreAverage + playsound SFX_DEX_FANFARE_140_169 + end + +.greater2 + cmpval wQuizScore, .scoregood, .scoregood, .greater3, $01, $0F + +.scoregood + printtext $0119, .textScoreGood + playsound SFX_DEX_FANFARE_170_199 + end + +.greater3 + cmpval wQuizScore, .scoregreat, .scoregreat, .greater4, $01, $13 + +.scoregreat + printtext $0119, .textScoreGreat + playsound SFX_DEX_FANFARE_200_229 + end + +.greater4 + cmpval wQuizScore, .scorebest, .scorebest, .scoreoutofbounds, $01, $14 + +.scorebest + printtext $0119, .textScoreBest + playsound SFX_DEX_FANFARE_230_PLUS + end + +.scoreoutofbounds + end + +.menuItemDescription + db "Take the quiz to" + line "receive a rating!@" + +.textScoreLow + text "You still have" + line "lots to do." + + para "It's not enough to" + line "memorize things." + + para "#MANIACs can" + line "memorize things" + cont "they don't even" + cont "need to remember!" + done + +.textScoreAverage + text "Not quite…" + line "#MANIACs have a" + cont "lot more passion!" + + para "Be sure to look in" + line "every nook and" + cont "cranny!" + done + +.textScoreGood + text "Hmm…" + line "You're really" + + para "starting to earn" + line "the title of" + cont "#MANIAC!" + + para "Are you talking" + line "with your friends?" + + para "It's tough to" + line "do this alone!" + done + +.textScoreGreat + text "Excellent! You" + line "really like to" + + para "poke around in" + line "those nooks and" + cont "crannies, don't" + cont "you?" + done + +.textScoreBest + text "Whoa! A perfect" + line "#MANIAC! I've" + + para "dreamt about this!" + line "Congratulations!" + done + + +TrainerRankingsScreen: ; $0857 + screenconfig + db MUSIC_PROF_ELM ; music + + db $00 ; number of custom palettes + + db $02 ; number of boxes to draw + db $00 ; x ; first box + db $03 ; y + db $14 ; width + db $0A ; height + db $01 ; border type + db $03 ; palette + db $00 ; x ; second box + db $0C ; y + db $14 ; width + db $06 ; height + db $02 ; border type + db $04 ; palette + + db $01 ; number of strings to draw + dw $0029 ; offset into screen buffer + db "TRAINER RANKINGS@" ; string + + db $02, $05 ; menu x, y + db $01, $04 ; number of columns, rows + db $00, $02 ; column width, row height + db $12, $04, $07, $04, $02, $04 ; ? + + relativepointer .aButton ; script pointer a button + relativepointer .bButton ; script pointer b button + dw $FFFF ; script pointer select button + dw $FFFF ; script pointer start button + dw $FFFF ; script pointer left button + dw $FFFF ; script pointer right button + relativepointer .upButton ; script pointer up button + relativepointer .downButton ; script pointer down button + + db $04 ; number of menu items + dw $0119 ; screen buffer offset to print menu descriptions + db $12, $04 ; width, height of blanked area + + db $00 ; load rankings table flag (table number should be specfied in 0:CD62) + + relativepointer .menuItemViewRankingsText ; pointers to text for each menu item + relativepointer .menuItemUpdateRankingsText + relativepointer .menuItemRankingsDescriptionText + relativepointer .menuItemReturnText + + relativepointer .menuItemViewRankingsScript ; pointers to script for each menu item + relativepointer .menuItemUpdateRankingsScript + relativepointer .menuItemRankingsDescriptionScript + relativepointer .menuItemReturnScript + + relativepointer .menuItemViewRankingsDescription ; pointers to description text for each menu item + relativepointer .menuItemUpdateRankingsDescription + relativepointer .menuItemRankingsDescriptionDescription + relativepointer .menuItemReturnDescription + +.aButton + playsound SFX_READ_TEXT + menuscript + end + +.bButton + playsound SFX_MENU + loadscreen NewsRootScreen + end + +.upButton + menuup + end + +.downButton + menudown + end + +.menuItemViewRankingsText + db "VIEW RANKINGS@" + +.menuItemUpdateRankingsText + db "UPDATE RANKINGS@" + +.menuItemRankingsDescriptionText + db "RANKING INFO@" + +.menuItemReturnText + db "CANCEL@" + +.menuItemViewRankingsScript + cmpvalram sNewsId, $0C, sNewsIdBackup, .noRankingsData, .continueToCategoriesScreen, .noRankingsData + +.continueToCategoriesScreen + loadscreen TrainerRankingsCategoriesScreen + end + +.noRankingsData + cleartext $0105, $12, $04 + printtext $0119, .noRankingsDataText + end + +.menuItemUpdateRankingsScript + updaterankings + cmpval wRankingsUpdateResult, .rankingsUpdated, .rankingsUpdateCancelled, .rankingsUpdateFailed, $01, $01 + +.rankingsUpdated + cleartext $0105, $12, $04 + printtext $0119, .rankingsUpdatedText + menureturn + end + +.rankingsUpdateCancelled + cleartext $0105, $12, $04 + printtext $0119, .rankingsUpdateCancelledText + menureturn + end + +.rankingsUpdateFailed + cleartext $0105, $12, $04 + printtext $0119, .rankingsUpdateFailedText + menureturn + end + +.rankingsUpdatedText + text "Rankings update" + line "was successful!" + done + +.rankingsUpdateCancelledText + text "Rankings update" + line "was stopped." + done + +.rankingsUpdateFailedText + text "Rankings update" + line "has failed…" + + para "Please download" + line "the latest NEWS." + done + +.menuItemRankingsDescriptionScript + cleartext $0105, $12, $04 + printtext $0119, .rankingsDescriptionText + menureturn + end + +.menuItemReturnScript + loadscreen NewsRootScreen + end + +.rankingsDescriptionText + text "BATTLE TOWER" + line "" + + para "The number of" + line "#MON battles" + cont "won against other" + cont "S at the" + cont "BATTLE TOWER on" + cont "ROUTE 40." + + para "LARGEST MAGIKARP" + line "" + + para "The size of the" + line "largest MAGIKARP" + cont "measured by the" + cont "FISHING GURU at" + cont "the LAKE OF RAGE." + + para "BUG-CATCHING" + line "" + + para "The highest score" + line "obtained at the" + cont "BUG-CATCHING Con-" + cont "test held in the" + cont "NATIONAL PARK." + done + +.noRankingsDataText + text "There is no" + line "ranking data." + + para "Link to obtain" + line "ranking data." + + para "" + line "" + done + +.menuItemViewRankingsDescription + db "View the various" + line "rankings@" + +.menuItemUpdateRankingsDescription + db "Reload rankings to" + line "update your scores@" + +.menuItemRankingsDescriptionDescription + db "An explanation of" + line "the ranking themes@" + +.menuItemReturnDescription + db "Return to the" + line "first page@" + + +TrainerRankingsCategoriesScreen: ; $0AF2 + screenconfig + db MUSIC_PROF_ELM ; music + + db $00 ; number of custom palettes + + db $02 ; number of boxes to draw + db $00 ; x ; first box + db $03 ; y + db $14 ; width + db $0A ; height + db $01 ; border type + db $03 ; palette + db $00 ; x ; second box + db $0C ; y + db $14 ; width + db $06 ; height + db $02 ; border type + db $04 ; palette + + db $01 ; number of strings to draw + dw $0029 ; offset into screen buffer + db "TRAINER RANKINGS@" ; string + + db $02, $05 ; menu x, y + db $01, $04 ; number of columns, rows + db $00, $02 ; column width, row height + db $12, $04, $07, $04, $02, $04 ; ? + + relativepointer .aButton ; script pointer a button + relativepointer .bButton ; script pointer b button + dw $FFFF ; script pointer select button + relativepointer .bButton ; script pointer start button + dw $FFFF ; script pointer left button + dw $FFFF ; script pointer right button + relativepointer .upButton ; script pointer up button + relativepointer .downButton ; script pointer down button + + db $04 ; number of menu items + dw $0119 ; screen buffer offset to print menu descriptions + db $12, $04 ; width, height of blanked area + + db $00 ; load rankings table flag (table number should be specfied in 0:CD62) + + relativepointer .menuItemBattleTowerWinsText ; pointers to text for each menu item + relativepointer .menuItemBugCatchingContestHighScoreText + relativepointer .menuItemLargestMagikarpText + relativepointer .menuItemReturnText + + relativepointer .menuItemBattleTowerWinsScript ; pointers to script for each menu item + relativepointer .menuItemBugCatchingContestHighScoreScript + relativepointer .menuItemLargestMagikarpScript + relativepointer .menuItemReturnScript + + relativepointer .menuItemDescription ; pointers to description text for each menu item + relativepointer .menuItemDescription + relativepointer .menuItemDescription + relativepointer .menuItemDescription + + + +.aButton + playsound SFX_READ_TEXT + menuscript + end + +.upButton + menuup + end + +.downButton + menudown + end + +.bButton + playsound SFX_MENU + +.menuItemReturnScript + loadscreen TrainerRankingsScreen + end + +.menuItemBattleTowerWinsText + db "BATTLE TOWER@" + +.menuItemBugCatchingContestHighScoreText + db "BUG-CATCHING@" + +.menuItemLargestMagikarpText + db "LARGEST MAGIKARP@" + +.menuItemReturnText + db "CANCEL@" + +.menuItemBattleTowerWinsScript + setval wRankingsTable, $00 + setval wRankingsCategory, $00 + loadscreen TrainerRankingsTypeScreen + end + +.menuItemBugCatchingContestHighScoreScript + setval wRankingsTable, $03 + setval wRankingsCategory, $01 + loadscreen TrainerRankingsTypeScreen + end + +.menuItemLargestMagikarpScript + setval wRankingsTable, $06 + setval wRankingsCategory, $02 + loadscreen TrainerRankingsTypeScreen + end + +.menuItemDescription + db "Please choose a" + line "ranking to view@" + + +TrainerRankingsTypeScreen: ; $0BC4 + screenconfig + db MUSIC_PROF_ELM ; music + + db $00 ; number of custom palettes + + db $02 ; number of boxes to draw + db $00 ; x ; first box + db $03 ; y + db $14 ; width + db $0A ; height + db $01 ; border type + db $03 ; palette + db $00 ; x ; second box + db $0C ; y + db $14 ; width + db $06 ; height + db $02 ; border type + db $04 ; palette + + db $01 ; number of strings to draw + dw $0029 ; offset into screen buffer + news_text_start + news_text_switch 3, wRankingsCategory, .battleTowerWinsText, .bugCatchingContestHighScoreText, .largestMagikarpText + db "@" + + db $02, $05 ; menu x, y + db $01, $04 ; number of columns, rows + db $00, $02 ; column width, row height + db $12, $04, $07, $04, $02, $04 ; ? + + relativepointer .aButton ; script pointer a button + relativepointer .bButton ; script pointer b button + dw $FFFF ; script pointer select button + relativepointer .startButton ; script pointer start button + dw $FFFF ; script pointer left button + dw $FFFF ; script pointer right button + relativepointer .upButton ; script pointer up button + relativepointer .downButton ; script pointer down button + + db $04 ; number of menu items + dw $0119 ; screen buffer offset to print menu descriptions + db $12, $04 ; width, height of blanked area + + db $00 ; load rankings table flag (table number should be specfied in 0:CD62) + + relativepointer .menuItemNationalRankingText ; pointers to text for each menu item + relativepointer .menuItemPrefecturalRankingText + relativepointer .menuItemZipCodeRankingText + relativepointer .menuItemReturnText + + relativepointer .menuItemNationalRankingScript ; pointers to script for each menu item + relativepointer .menuItemPrefecturalRankingScript + relativepointer .menuItemZipCodeRankingScript + relativepointer .menuItemReturnScript + + relativepointer .menuItemDescription ; pointers to description text for each menu item + relativepointer .menuItemDescription + relativepointer .menuItemDescription + relativepointer .menuItemDescription + + + +.aButton + playsound SFX_READ_TEXT + menuscript + end + +.upButton + menuup + end + +.downButton + menudown + end + +.startButton + playsound SFX_MENU + loadscreen TrainerRankingsScreen + end + +.menuItemNationalRankingText + db "NATIONAL RANKINGS@" + +.menuItemPrefecturalRankingText + news_text_start + news_text_own_region_backup 0 + news_text_end + db " RANKINGS@" + +.menuItemZipCodeRankingText + news_text_start + news_text_own_zip_backup 3 + news_text_end + db " RANKINGS@" + +.menuItemReturnText + db "CANCEL@" + +.menuItemNationalRankingScript + setval wRankingsType, $00 + loadscreen TrainerRankingsRankingsScreen + end + +.menuItemPrefecturalRankingScript + incval wRankingsTable, $01 + setval wRankingsType, $01 + loadscreen TrainerRankingsRankingsScreen + end + +.menuItemZipCodeRankingScript + incval wRankingsTable, $02 + setval wRankingsType, $02 + loadscreen TrainerRankingsRankingsScreen + end + +.bButton + playsound SFX_MENU + +.menuItemReturnScript + loadscreen TrainerRankingsCategoriesScreen + end + +.menuItemDescription + db "Choose an area to" + line "view the rankings@" + +.battleTowerWinsText + db "BATTLE TOWER@" + +.bugCatchingContestHighScoreText + db "BUG-CATCHING@" + +.largestMagikarpText + db "LARGEST MAGIKARP@" + + +TrainerRankingsRankingsScreen: ; $0CBD + screenconfig + db MUSIC_PROF_ELM ; music + + db $00 ; number of custom palettes + + db $02 ; number of boxes to draw + db $00 ; x ; first box + db $03 ; y + db $14 ; width + db $0A ; height + db $01 ; border type + db $03 ; palette + db $00 ; x ; second box + db $0C ; y + db $14 ; width + db $06 ; height + db $02 ; border type + db $04 ; palette + + db $02 ; number of strings to draw + dw $0029 ; offset into screen buffer + news_text_start + news_text_switch 3, wRankingsCategory, .headerText1, .headerText2, .headerText3 + db "@" + dw $0066 ; offset into screen buffer + news_text_start + news_text_switch 3, wRankingsType, .headerText4, .headerText5, .headerText6 + db "@" + + db $02, $07 ; menu x, y + db $01, $03 ; number of columns, rows + db $00, $02 ; column width, row height + db $12, $04, $07, $03, $02, $03 ; ? + + relativepointer .aButton ; script pointer a button + relativepointer .bButton ; script pointer b button + dw $FFFF ; script pointer select button + relativepointer .startButton ; script pointer start button + dw $FFFF ; script pointer left button + dw $FFFF ; script pointer right button + relativepointer .upButton ; script pointer up button + relativepointer .downButton ; script pointer down button + + db $0B ; number of menu items + dw $0119 ; screen buffer offset to print menu descriptions + db $12, $04 ; width, height of blanked area + + db $01 ; load rankings table flag (table number should be specfied in 0:CD62) + + relativepointer .rankingsEntryText ; pointers to text for each menu item + relativepointer .rankingsEntryText + relativepointer .rankingsEntryText + relativepointer .rankingsEntryText + relativepointer .rankingsEntryText + relativepointer .rankingsEntryText + relativepointer .rankingsEntryText + relativepointer .rankingsEntryText + relativepointer .rankingsEntryText + relativepointer .rankingsEntryText + relativepointer .ownRankText + + relativepointer .rankingsEntryScript ; pointers to script for each menu item + relativepointer .rankingsEntryScript + relativepointer .rankingsEntryScript + relativepointer .rankingsEntryScript + relativepointer .rankingsEntryScript + relativepointer .rankingsEntryScript + relativepointer .rankingsEntryScript + relativepointer .rankingsEntryScript + relativepointer .rankingsEntryScript + relativepointer .rankingsEntryScript + relativepointer .ownRankScript + + relativepointer .menuItemDescription ; pointers to description text for each menu item + relativepointer .menuItemDescription + relativepointer .menuItemDescription + relativepointer .menuItemDescription + relativepointer .menuItemDescription + relativepointer .menuItemDescription + relativepointer .menuItemDescription + relativepointer .menuItemDescription + relativepointer .menuItemDescription + relativepointer .menuItemDescription + relativepointer .menuItemDescription + + + +.aButton + playsound SFX_READ_TEXT + menuscript + end + +.bButton + playsound SFX_MENU + decvalram wRankingsTable, wRankingsType + loadscreen TrainerRankingsTypeScreen + end + +.upButton + menuup + end + +.downButton + menudown + end + +.startButton + playsound SFX_MENU + loadscreen TrainerRankingsScreen + end + +.rankingsEntryText + news_text_start + news_text_switch 3, wRankingsCategory, .rankingsEntryBattleTowerWinsText, .rankingsEntryBugCatchingContestHighScoreText, .rankingsEntryLargestMagikarpText + news_text_end + +.rankingsEntryBattleTowerWinsText + news_text_start + news_text_ranking_indicator 3 + news_text_ranking_text 0, 7, 7 + news_text_ranking_number 24, 2, 5, 5, 0, 0 + news_text_end + db "@" + +.rankingsEntryBugCatchingContestHighScoreText + news_text_start + news_text_ranking_indicator 3 + news_text_ranking_text 0, 6, 6 + news_text_ranking_number 24, 2, 5, 5, 0, 0 + news_text_end + db "@" + +.rankingsEntryLargestMagikarpText + news_text_start + news_text_ranking_indicator 3 + news_text_ranking_text 0, 6, 6 + news_text_ranking_number 24, 2 | PRINTNUM_LEADINGZEROS, 4, 5, 4, "" + news_text_end + db "@" + +.ownRankText + news_text_start + news_text_own_name 0 + news_text_end + db "'s RANK: @" + +.rankingsEntryScript + cmpvalram wcd22, $01, wcd5c, .somebodyRankedHere, .nobodyRankedHere, .nobodyRankedHere + +.somebodyRankedHere + cleartext $0105, $12, $04 + specialtext $0119, .rankedPlayerInfoText + cleartext $0105, $12, $04 + specialtext $0119, .rankedPlayerMessage + end + +.nobodyRankedHere + cleartext $0105, $12, $04 + specialtext $0119, .nobodyRankedHereText + end + +.nobodyRankedHereText + db "No one is" + next "ranked here." + para "@" + +.ownRankScript + cmpvalram wOwnRank, $04, wNumRankedPlayers, .playerRanked, .playerRanked, .playerNotRanked + +.playerRanked + cleartext $0105, $12, $04 + specialtext $0119, .playerRankedText + cmpval wOwnRank, .doNothing, .checkGSBallEnabled, .doNothing, $04, $00, $00, $00, $01 + +.checkGSBallEnabled + cmpval sMobileEventIndex, .doNothing, .enableGSBall, .doNothing, $01, $00 + +.enableGSBall + setval wcd6a, $01 + cpyvalram wcd6a, sMobileEventIndex, $0001 + cleartext $0105, $12, $04 + printtext $0119, .giftText + menureturn + +.doNothing + end + +.playerNotRanked + cleartext $0105, $12, $04 + specialtext $0119, .playerNotRankedText + end + +.giftText + text "For receiving a" + next "such a high rank," + + para "we have a nice" + line "gift for you." + cont "Enjoy!" + done + +.rankedPlayerInfoText + news_text_start + news_text_ranking_gender 11, 4 + news_text_ranking_number 10, 1, 3, 4, 0, 0 + news_text_end + db "" + news_text_start + news_text_ranking_region 7, 7 + news_text_end + para "@" + +.rankedPlayerMessage + news_text_start + news_text_ranking_message 12 + news_text_end + para "@" + +.playerRankedText + news_text_start + news_text_switch 3, wRankingsCategory, .ownBattleTowerWinsText, .ownBugCatchingContestHighScoreText, .ownLargestMagikarpText + news_text_start + news_text_own_name 0 + news_text_end + db "'s RANK is…" + para "" + news_text_start + news_text_number wOwnRank, 4, 4, 4, 0, 0 + news_text_end + db "!" + line "Congratulations!" + para "@" + +.playerNotRankedText + news_text_start + news_text_switch 3, wRankingsCategory, .ownBattleTowerWinsText, .ownBugCatchingContestHighScoreText, .ownLargestMagikarpText + news_text_start + news_text_own_name 0 + news_text_end + db "'s RANK is…" + para "Not currently in" + line "the rankings." + para "@" + +.ownBattleTowerWinsText + news_text_start + news_text_own_name 0 + news_text_end + db "'s SCORE:" + line "" + news_text_start + news_text_number sNumBattleTowerWins, 2, 5, 5, 0, 0 + news_text_end + db " points" + para "@" + +.ownBugCatchingContestHighScoreText + news_text_start + news_text_own_name 0 + news_text_end + db "'s SCORE:" + line "" + news_text_start + news_text_number sBugContestHighscore, 2, 5, 5, 0, 0 + news_text_end + db " points" + para "@" + +.ownLargestMagikarpText + news_text_start + news_text_own_name 0 + news_text_end + db "'s SCORE:" + line "" + news_text_start + news_text_number sLargestMagikarp, 2 | PRINTNUM_LEADINGZEROS, 4, 5, 4, "" + news_text_end + db " cm" + para "@" + + +.menuItemDescription + db "View the profile" + line "of this TRAINER.@" + +.headerText1 + db "BATTLE TOWER@" + +.headerText2 + db "BUG-CATCHING@" + +.headerText3 + db "LARGEST MAGIKARP@" + +.headerText4 + db "NATIONAL TOP 10!@" + +.headerText5 + news_text_start + news_text_own_region_backup 0 + news_text_end + db " TOP 10!@" + +.headerText6 + news_text_start + news_text_own_zip_backup 3 + news_text_end + db " TOP 10!@" + + db $04 ; whatever this is supposed to be \ No newline at end of file diff --git a/pokecrystal/charmap_int.asm b/pokecrystal/charmap_int.asm new file mode 100644 index 0000000..d5bd2bc --- /dev/null +++ b/pokecrystal/charmap_int.asm @@ -0,0 +1,418 @@ +; $00-$16 are TX_* constants (see macros/scripts/text.asm) + +; Control characters (see home/text.asm) + + charmap "", $00 + charmap "", $14 ; "くん" or "ちゃん"; same as "" in English + charmap "", $15 + charmap "", $16 + charmap "¯", $1f ; soft linebreak + charmap "", $22 + charmap "", $24 ; "" + charmap "%", $25 ; soft linebreak in landmark names + charmap "", $38 ; wRedsName + charmap "", $39 ; wGreensName + charmap "", $3f + charmap "", $49 ; wMomsName + charmap "", $4a ; "" + charmap "<_CONT>", $4b ; implements "" + charmap "", $4c + charmap "", $4e + charmap "", $4f + charmap "@", $50 ; string terminator + charmap "", $51 + charmap "", $52 ; wPlayerName + charmap "", $53 ; wRivalName + charmap "#", $54 ; "POKé" + charmap "", $55 + charmap "<……>", $56 ; "……" + charmap "", $57 + charmap "", $58 + charmap "", $59 + charmap "", $5a + charmap "", $5b ; "PC" + charmap "", $5c ; "TM" + charmap "", $5d ; "TRAINER" + charmap "", $5e ; "ROCKET" + charmap "", $5f + +; Actual characters (from gfx/font/font_extra.png) + + charmap "", $60 ; unused + charmap "", $61 ; unused + charmap "", $62 ; unused + charmap "", $63 ; unused + charmap "", $64 ; unused + charmap "", $65 ; unused + charmap "", $66 ; unused + charmap "", $67 ; unused + charmap "", $68 ; unused + charmap "", $69 + charmap "", $6a + charmap "", $6b ; unused + charmap "", $6c ; unused + charmap "", $6d ; colon with tinier dots than ":" + charmap "ぃ", $6e ; hiragana small i, unused + charmap "ぅ", $6f ; hiragana small u, unused + charmap "", $70 + charmap "", $71 + charmap "“", $72 ; opening quote + charmap "”", $73 ; closing quote + charmap "·", $74 ; middle dot, unused + charmap "…", $75 ; ellipsis + charmap "ぁ", $76 ; hiragana small a, unused + charmap "ぇ", $77 ; hiragana small e, unused + charmap "ぉ", $78 ; hiragana small o, unused + + charmap "┌", $79 + charmap "─", $7a + charmap "┐", $7b + charmap "│", $7c + charmap "└", $7d + charmap "┘", $7e + charmap " ", $7f + +; Actual characters (from gfx/font/font_battle_extra.png) + + charmap "", $6e + + charmap "", $70 ; hiragana small do, unused + charmap "◀", $71 + charmap "『", $72 ; Japanese opening quote, unused + charmap "", $73 + charmap "№", $74 + +; Actual characters (from other graphics files) + + ; needed for _LoadFontsExtra1 (see engine/load_font.asm) + charmap "■", $60 ; gfx/font/black.2bpp + charmap "▲", $61 ; gfx/font/up_arrow.png + charmap "☎", $62 ; gfx/font/phone_icon.2bpp + + ; needed for MagikarpHouseSign (see engine/events/magikarp.asm) + charmap "′", $6e ; gfx/font/feet_inches.png + charmap "″", $6f ; gfx/font/feet_inches.png + + ; needed for StatsScreen_PlaceShinyIcon and PrintPartyMonPage1 + charmap "⁂", $3f ; gfx/stats/stats_tiles.png, tile 14 + +; Actual characters (from gfx/font/font.png) + + charmap "A", $80 + charmap "B", $81 + charmap "C", $82 + charmap "D", $83 + charmap "E", $84 + charmap "F", $85 + charmap "G", $86 + charmap "H", $87 + charmap "I", $88 + charmap "J", $89 + charmap "K", $8a + charmap "L", $8b + charmap "M", $8c + charmap "N", $8d + charmap "O", $8e + charmap "P", $8f + charmap "Q", $90 + charmap "R", $91 + charmap "S", $92 + charmap "T", $93 + charmap "U", $94 + charmap "V", $95 + charmap "W", $96 + charmap "X", $97 + charmap "Y", $98 + charmap "Z", $99 + + charmap "(", $9a + charmap ")", $9b + charmap ":", $9c + charmap ";", $9d + charmap "[", $9e + charmap "]", $9f + + charmap "a", $a0 + charmap "b", $a1 + charmap "c", $a2 + charmap "d", $a3 + charmap "e", $a4 + charmap "f", $a5 + charmap "g", $a6 + charmap "h", $a7 + charmap "i", $a8 + charmap "j", $a9 + charmap "k", $aa + charmap "l", $ab + charmap "m", $ac + charmap "n", $ad + charmap "o", $ae + charmap "p", $af + charmap "q", $b0 + charmap "r", $b1 + charmap "s", $b2 + charmap "t", $b3 + charmap "u", $b4 + charmap "v", $b5 + charmap "w", $b6 + charmap "x", $b7 + charmap "y", $b8 + charmap "z", $b9 + + charmap "Ä", $c0 + charmap "Ö", $c1 + charmap "Ü", $c2 + charmap "ä", $c3 + charmap "ö", $c4 + charmap "ü", $c5 + + charmap "'d", $d0 + charmap "'l", $d1 + charmap "'m", $d2 + charmap "'r", $d3 + charmap "'s", $d4 + charmap "'t", $d5 + charmap "'v", $d6 + + charmap "←", $df + charmap "'", $e0 + charmap "", $e1 + charmap "", $e2 + charmap "-", $e3 + + charmap "?", $e6 + charmap "!", $e7 + charmap ".", $e8 + charmap "&", $e9 + + charmap "é", $ea + charmap "→", $eb + charmap "▷", $ec + charmap "▶", $ed + charmap "▼", $ee + charmap "♂", $ef + charmap "¥", $f0 + charmap "×", $f1 + charmap "", $f2 ; decimal point; same as "." in English + charmap "/", $f3 + charmap ",", $f4 + charmap "♀", $f5 + + charmap "0", $f6 + charmap "1", $f7 + charmap "2", $f8 + charmap "3", $f9 + charmap "4", $fa + charmap "5", $fb + charmap "6", $fc + charmap "7", $fd + charmap "8", $fe + charmap "9", $ff + +; Japanese control characters (see home/text.asm) + + charmap "", $18 ; "ノ゛"? (ungrammatical) + charmap "", $1d ; "に " + charmap "", $1e ; "って" + charmap "", $1f ; "を " + charmap "", $22 ; "た!" + charmap "", $23 ; "こうげき" + charmap "", $24 ; "は " + charmap "", $25 ; "の " + charmap "", $35 ; "ばん どうろ" + charmap "", $36 ; "わたし" + charmap "", $37 ; "ここは" + charmap "", $4a ; "が " + +; Japanese kana, for those bits of text that were not translated to English + + charmap "ガ", $05 + charmap "ギ", $06 + charmap "グ", $07 + charmap "ゲ", $08 + charmap "ゴ", $09 + charmap "ザ", $0a + charmap "ジ", $0b + charmap "ズ", $0c + charmap "ゼ", $0d + charmap "ゾ", $0e + charmap "ダ", $0f + charmap "ヂ", $10 + charmap "ヅ", $11 + charmap "デ", $12 + charmap "ド", $13 + + charmap "バ", $19 + charmap "ビ", $1a + charmap "ブ", $1b + charmap "ボ", $1c + + charmap "が", $26 + charmap "ぎ", $27 + charmap "ぐ", $28 + charmap "げ", $29 + charmap "ご", $2a + charmap "ざ", $2b + charmap "じ", $2c + charmap "ず", $2d + charmap "ぜ", $2e + charmap "ぞ", $2f + charmap "だ", $30 + charmap "ぢ", $31 + charmap "づ", $32 + charmap "で", $33 + charmap "ど", $34 + + charmap "ば", $3a + charmap "び", $3b + charmap "ぶ", $3c + charmap "べ", $3d + charmap "ぼ", $3e + + charmap "パ", $40 + charmap "ピ", $41 + charmap "プ", $42 + charmap "ポ", $43 + charmap "ぱ", $44 + charmap "ぴ", $45 + charmap "ぷ", $46 + charmap "ぺ", $47 + charmap "ぽ", $48 + + charmap "「", $70 + charmap "」", $71 + charmap "』", $73 + charmap "⋯", $75 + + charmap " ", $7f + + charmap "ア", $80 + charmap "イ", $81 + charmap "ウ", $82 + charmap "エ", $83 + charmap "オ", $84 + charmap "カ", $85 + charmap "キ", $86 + charmap "ク", $87 + charmap "ケ", $88 + charmap "コ", $89 + charmap "サ", $8a + charmap "シ", $8b + charmap "ス", $8c + charmap "セ", $8d + charmap "ソ", $8e + charmap "タ", $8f + charmap "チ", $90 + charmap "ツ", $91 + charmap "テ", $92 + charmap "ト", $93 + charmap "ナ", $94 + charmap "ニ", $95 + charmap "ヌ", $96 + charmap "ネ", $97 + charmap "ノ", $98 + charmap "ハ", $99 + charmap "ヒ", $9a + charmap "フ", $9b + charmap "ホ", $9c + charmap "マ", $9d + charmap "ミ", $9e + charmap "ム", $9f + charmap "メ", $a0 + charmap "モ", $a1 + charmap "ヤ", $a2 + charmap "ユ", $a3 + charmap "ヨ", $a4 + charmap "ラ", $a5 + charmap "ル", $a6 + charmap "レ", $a7 + charmap "ロ", $a8 + charmap "ワ", $a9 + charmap "ヲ", $aa + charmap "ン", $ab + charmap "ッ", $ac + charmap "ャ", $ad + charmap "ュ", $ae + charmap "ョ", $af + charmap "ィ", $b0 + + charmap "あ", $b1 + charmap "い", $b2 + charmap "う", $b3 + charmap "え", $b4 + charmap "お", $b5 + charmap "か", $b6 + charmap "き", $b7 + charmap "く", $b8 + charmap "け", $b9 + charmap "こ", $ba + charmap "さ", $bb + charmap "し", $bc + charmap "す", $bd + charmap "せ", $be + charmap "そ", $bf + charmap "た", $c0 + charmap "ち", $c1 + charmap "つ", $c2 + charmap "て", $c3 + charmap "と", $c4 + charmap "な", $c5 + charmap "に", $c6 + charmap "ぬ", $c7 + charmap "ね", $c8 + charmap "の", $c9 + charmap "は", $ca + charmap "ひ", $cb + charmap "ふ", $cc + charmap "へ", $cd + charmap "ほ", $ce + charmap "ま", $cf + charmap "み", $d0 + charmap "む", $d1 + charmap "め", $d2 + charmap "も", $d3 + charmap "や", $d4 + charmap "ゆ", $d5 + charmap "よ", $d6 + charmap "ら", $d7 + charmap "り", $d8 + charmap "る", $d9 + charmap "れ", $da + charmap "ろ", $db + charmap "わ", $dc + charmap "を", $dd + charmap "ん", $de + charmap "っ", $df + charmap "ゃ", $e0 + charmap "ゅ", $e1 + charmap "ょ", $e2 + + charmap "ー", $e3 + charmap "゚", $e4 + charmap "゙", $e5 + + charmap "?", $e6 + charmap "!", $e7 + charmap "。", $e8 + + charmap "ァ", $e9 + charmap "ゥ", $ea + charmap "ェ", $eb + + charmap "円", $f0 + + charmap ".", $f2 + charmap "/", $f3 + + charmap "ォ", $f4 + + charmap "0", $f6 + charmap "1", $f7 + charmap "2", $f8 + charmap "3", $f9 + charmap "4", $fa + charmap "5", $fb + charmap "6", $fc + charmap "7", $fd + charmap "8", $fe + charmap "9", $ff diff --git a/pokecrystal/constants.asm b/pokecrystal/constants.asm index d84eb83..57a7b78 100644 --- a/pokecrystal/constants.asm +++ b/pokecrystal/constants.asm @@ -1,5 +1,8 @@ +IF DEF(_NEWS_EN) +INCLUDE "pokecrystal/charmap_int.asm" +ELSE INCLUDE "pokecrystal/charmap.asm" - +ENDC INCLUDE "pokecrystal/macros.asm" INCLUDE "pokecrystal/constants/hardware_constants.asm" @@ -12,15 +15,12 @@ INCLUDE "pokecrystal/constants/text_constants.asm" INCLUDE "pokecrystal/constants/audio_constants.asm" INCLUDE "pokecrystal/constants/battle_anim_constants.asm" INCLUDE "pokecrystal/constants/battle_constants.asm" -INCLUDE "pokecrystal/constants/battle_tower_constants.asm" INCLUDE "pokecrystal/constants/collision_constants.asm" INCLUDE "pokecrystal/constants/credits_constants.asm" INCLUDE "pokecrystal/constants/cry_constants.asm" INCLUDE "pokecrystal/constants/engine_flags.asm" INCLUDE "pokecrystal/constants/event_flags.asm" INCLUDE "pokecrystal/constants/icon_constants.asm" -INCLUDE "pokecrystal/constants/item_constants.asm" -INCLUDE "pokecrystal/constants/item_data_constants.asm" INCLUDE "pokecrystal/constants/landmark_constants.asm" INCLUDE "pokecrystal/constants/map_constants.asm" INCLUDE "pokecrystal/constants/map_data_constants.asm" @@ -28,26 +28,27 @@ INCLUDE "pokecrystal/constants/map_object_constants.asm" INCLUDE "pokecrystal/constants/map_setup_constants.asm" INCLUDE "pokecrystal/constants/mart_constants.asm" INCLUDE "pokecrystal/constants/menu_constants.asm" -INCLUDE "pokecrystal/constants/mobile_constants.asm" INCLUDE "pokecrystal/constants/move_constants.asm" INCLUDE "pokecrystal/constants/move_effect_constants.asm" +INCLUDE "pokecrystal/constants/item_constants.asm" +INCLUDE "pokecrystal/constants/item_data_constants.asm" INCLUDE "pokecrystal/constants/music_constants.asm" INCLUDE "pokecrystal/constants/npc_trade_constants.asm" INCLUDE "pokecrystal/constants/phone_constants.asm" INCLUDE "pokecrystal/constants/pokemon_constants.asm" INCLUDE "pokecrystal/constants/pokemon_data_constants.asm" +INCLUDE "pokecrystal/constants/mobile_constants.asm" INCLUDE "pokecrystal/constants/printer_constants.asm" INCLUDE "pokecrystal/constants/radio_constants.asm" INCLUDE "pokecrystal/constants/scgb_constants.asm" -INCLUDE "pokecrystal/constants/scene_constants.asm" INCLUDE "pokecrystal/constants/script_constants.asm" INCLUDE "pokecrystal/constants/serial_constants.asm" INCLUDE "pokecrystal/constants/sfx_constants.asm" INCLUDE "pokecrystal/constants/sprite_anim_constants.asm" INCLUDE "pokecrystal/constants/sprite_constants.asm" INCLUDE "pokecrystal/constants/sprite_data_constants.asm" -INCLUDE "pokecrystal/constants/std_constants.asm" INCLUDE "pokecrystal/constants/tileset_constants.asm" INCLUDE "pokecrystal/constants/trainer_constants.asm" INCLUDE "pokecrystal/constants/trainer_data_constants.asm" INCLUDE "pokecrystal/constants/type_constants.asm" +INCLUDE "pokecrystal/constants/battle_tower_constants.asm" diff --git a/pokecrystal/constants/audio_constants.asm b/pokecrystal/constants/audio_constants.asm index 1d092ed..f9b016c 100644 --- a/pokecrystal/constants/audio_constants.asm +++ b/pokecrystal/constants/audio_constants.asm @@ -1,7 +1,6 @@ ; pitch ; FrequencyTable indexes (see audio/notes.asm) - const_def - const __ ; 0 + const_def 1 const C_ ; 1 const C# ; 2 const D_ ; 3 @@ -14,7 +13,7 @@ const A_ ; a const A# ; b const B_ ; c - const CC ; d (used for pitchoffset) +DEF NUM_NOTES EQU const_value - 1 ; channel ; ChannelPointers indexes (see audio/engine.asm) @@ -23,55 +22,60 @@ const CHAN2 ; 1 const CHAN3 ; 2 const CHAN4 ; 3 -NUM_MUSIC_CHANS EQU const_value +DEF NUM_MUSIC_CHANS EQU const_value const CHAN5 ; 4 const CHAN6 ; 5 const CHAN7 ; 6 const CHAN8 ; 7 -NUM_NOISE_CHANS EQU const_value - NUM_MUSIC_CHANS -NUM_CHANNELS EQU const_value +DEF NUM_NOISE_CHANS EQU const_value - NUM_MUSIC_CHANS +DEF NUM_CHANNELS EQU const_value -; channel_struct members (see macros/wram.asm) -CHANNEL_MUSIC_ID EQUS "(wChannel1MusicID - wChannel1)" -CHANNEL_MUSIC_BANK EQUS "(wChannel1MusicBank - wChannel1)" -CHANNEL_FLAGS1 EQUS "(wChannel1Flags1 - wChannel1)" -CHANNEL_FLAGS2 EQUS "(wChannel1Flags2 - wChannel1)" -CHANNEL_FLAGS3 EQUS "(wChannel1Flags3 - wChannel1)" -CHANNEL_MUSIC_ADDRESS EQUS "(wChannel1MusicAddress - wChannel1)" -CHANNEL_LAST_MUSIC_ADDRESS EQUS "(wChannel1LastMusicAddress - wChannel1)" -CHANNEL_NOTE_FLAGS EQUS "(wChannel1NoteFlags - wChannel1)" -CHANNEL_CONDITION EQUS "(wChannel1Condition - wChannel1)" -CHANNEL_DUTY_CYCLE EQUS "(wChannel1DutyCycle - wChannel1)" -CHANNEL_INTENSITY EQUS "(wChannel1Intensity - wChannel1)" -CHANNEL_FREQUENCY EQUS "(wChannel1Frequency - wChannel1)" -CHANNEL_PITCH EQUS "(wChannel1Pitch - wChannel1)" -CHANNEL_OCTAVE EQUS "(wChannel1Octave - wChannel1)" -CHANNEL_PITCH_OFFSET EQUS "(wChannel1PitchOffset - wChannel1)" -CHANNEL_NOTE_DURATION EQUS "(wChannel1NoteDuration - wChannel1)" -CHANNEL_FIELD16 EQUS "(wChannel1Field16 - wChannel1)" -CHANNEL_LOOP_COUNT EQUS "(wChannel1LoopCount - wChannel1)" -CHANNEL_TEMPO EQUS "(wChannel1Tempo - wChannel1)" -CHANNEL_TRACKS EQUS "(wChannel1Tracks - wChannel1)" -CHANNEL_SFX_DUTY_LOOP EQUS "(wChannel1SFXDutyLoop - wChannel1)" -CHANNEL_VIBRATO_DELAY_COUNT EQUS "(wChannel1VibratoDelayCount - wChannel1)" -CHANNEL_VIBRATO_DELAY EQUS "(wChannel1VibratoDelay - wChannel1)" -CHANNEL_VIBRATO_EXTENT EQUS "(wChannel1VibratoExtent - wChannel1)" -CHANNEL_VIBRATO_RATE EQUS "(wChannel1VibratoRate - wChannel1)" -CHANNEL_PITCH_WHEEL_TARGET EQUS "(wChannel1PitchWheelTarget - wChannel1)" -CHANNEL_PITCH_WHEEL_AMOUNT EQUS "(wChannel1PitchWheelAmount - wChannel1)" -CHANNEL_PITCH_WHEEL_AMOUNT_FRACTION EQUS "(wChannel1PitchWheelAmountFraction - wChannel1)" -CHANNEL_FIELD25 EQUS "(wChannel1Field25 - wChannel1)" -CHANNEL_CRY_PITCH EQUS "(wChannel1CryPitch - wChannel1)" -CHANNEL_FIELD29 EQUS "(wChannel1Field29 - wChannel1)" -CHANNEL_FIELD2A EQUS "(wChannel1Field2a - wChannel1)" -CHANNEL_FIELD2C EQUS "(wChannel1Field2c - wChannel1)" -CHANNEL_NOTE_LENGTH EQUS "(wChannel1NoteLength - wChannel1)" -CHANNEL_FIELD2E EQUS "(wChannel1Field2e - wChannel1)" -CHANNEL_FIELD2F EQUS "(wChannel1Field2f - wChannel1)" -CHANNEL_FIELD30 EQUS "(wChannel1Field30 - wChannel1)" -CHANNEL_STRUCT_LENGTH EQUS "(wChannel2 - wChannel1)" +; channel_struct members (see macros/ram.asm) +rsreset +DEF CHANNEL_MUSIC_ID rw +DEF CHANNEL_MUSIC_BANK rb +DEF CHANNEL_FLAGS1 rb +DEF CHANNEL_FLAGS2 rb +DEF CHANNEL_FLAGS3 rb +DEF CHANNEL_MUSIC_ADDRESS rw +DEF CHANNEL_LAST_MUSIC_ADDRESS rw + rb_skip 2 +DEF CHANNEL_NOTE_FLAGS rb +DEF CHANNEL_CONDITION rb +DEF CHANNEL_DUTY_CYCLE rb +DEF CHANNEL_VOLUME_ENVELOPE rb +DEF CHANNEL_FREQUENCY rw +DEF CHANNEL_PITCH rb +DEF CHANNEL_OCTAVE rb +DEF CHANNEL_TRANSPOSITION rb +DEF CHANNEL_NOTE_DURATION rb +DEF CHANNEL_FIELD16 rb + rb_skip +DEF CHANNEL_LOOP_COUNT rb +DEF CHANNEL_TEMPO rw +DEF CHANNEL_TRACKS rb +DEF CHANNEL_DUTY_CYCLE_PATTERN rb +DEF CHANNEL_VIBRATO_DELAY_COUNT rb +DEF CHANNEL_VIBRATO_DELAY rb +DEF CHANNEL_VIBRATO_EXTENT rb +DEF CHANNEL_VIBRATO_RATE rb +DEF CHANNEL_PITCH_SLIDE_TARGET rw +DEF CHANNEL_PITCH_SLIDE_AMOUNT rb +DEF CHANNEL_PITCH_SLIDE_AMOUNT_FRACTION rb +DEF CHANNEL_FIELD25 rb + rb_skip +DEF CHANNEL_PITCH_OFFSET rw +DEF CHANNEL_FIELD29 rb +DEF CHANNEL_FIELD2A rw +DEF CHANNEL_FIELD2C rb +DEF CHANNEL_NOTE_LENGTH rb +DEF CHANNEL_FIELD2E rb +DEF CHANNEL_FIELD2F rb +DEF CHANNEL_FIELD30 rb + rb_skip +DEF CHANNEL_STRUCT_LENGTH EQU _RS -NOISE_CHAN_F EQU 2 ; bit set in CHAN5-CHAN7 +DEF NOISE_CHAN_F EQU 2 ; bit set in CHAN5-CHAN7 ; Flags1 const_def @@ -80,51 +84,51 @@ NOISE_CHAN_F EQU 2 ; bit set in CHAN5-CHAN7 const SOUND_LOOPING ; 2 const SOUND_SFX ; 3 const SOUND_NOISE ; 4 - const SOUND_REST ; 5 + const SOUND_CRY ; 5 ; Flags2 const_def - const SOUND_VIBRATO ; 0 - const SOUND_PITCH_WHEEL ; 1 - const SOUND_DUTY ; 2 - const SOUND_UNKN_0B ; 3 - const SOUND_CRY_PITCH ; 4 - const SOUND_UNKN_0D ; 5 - const SOUND_UNKN_0E ; 6 - const SOUND_UNKN_0F ; 7 + const SOUND_VIBRATO ; 0 + const SOUND_PITCH_SLIDE ; 1 + const SOUND_DUTY_LOOP ; 2 + const SOUND_UNKN_0B ; 3 + const SOUND_PITCH_OFFSET ; 4 + const SOUND_UNKN_0D ; 5 + const SOUND_UNKN_0E ; 6 + const SOUND_UNKN_0F ; 7 ; Flags3 const_def const SOUND_VIBRATO_DIR ; 0 - const SOUND_PITCH_WHEEL_DIR ; 1 + const SOUND_PITCH_SLIDE_DIR ; 1 ; NoteFlags const_def const NOTE_DUTY_OVERRIDE ; 0 const NOTE_FREQ_OVERRIDE ; 1 const NOTE_UNUSED ; 2 - const NOTE_UNKN_3 ; 3 + const NOTE_PITCH_SWEEP ; 3 const NOTE_NOISE_SAMPLING ; 4 const NOTE_REST ; 5 const NOTE_VIBRATO_OVERRIDE ; 6 ; wVolume -VOLUME_SO1_F EQU 3 -VOLUME_SO2_F EQU 7 -VOLUME_SO1_LEVEL EQU %00000111 -VOLUME_SO2_LEVEL EQU %01110000 -MAX_VOLUME EQU $77 +DEF VOLUME_SO1_F EQU 3 +DEF VOLUME_SO2_F EQU 7 +DEF VOLUME_SO1_LEVEL EQU %00000111 +DEF VOLUME_SO2_LEVEL EQU %01110000 +DEF MAX_VOLUME EQU $77 ; wSoundInput -SOUND_INPUT_CH1_F EQU 0 -SOUND_INPUT_CH2_F EQU 1 -SOUND_INPUT_CH3_F EQU 2 -SOUND_INPUT_CH4_F EQU 3 -SOUND_INPUT_GLOBAL_F EQU 7 +DEF SOUND_INPUT_CH1_F EQU 0 +DEF SOUND_INPUT_CH2_F EQU 1 +DEF SOUND_INPUT_CH3_F EQU 2 +DEF SOUND_INPUT_CH4_F EQU 3 +DEF SOUND_INPUT_GLOBAL_F EQU 7 ; wLowHealthAlarm -DANGER_PITCH_F EQU 4 -DANGER_ON_F EQU 7 +DEF DANGER_PITCH_F EQU 4 +DEF DANGER_ON_F EQU 7 ; wMusicFade -MUSIC_FADE_IN_F EQU 7 +DEF MUSIC_FADE_IN_F EQU 7 diff --git a/pokecrystal/constants/battle_anim_constants.asm b/pokecrystal/constants/battle_anim_constants.asm index fcd512b..bf6b45e 100644 --- a/pokecrystal/constants/battle_anim_constants.asm +++ b/pokecrystal/constants/battle_anim_constants.asm @@ -1,48 +1,46 @@ -; battle_anim_struct members (see macros/wram.asm) - const_def - const BATTLEANIMSTRUCT_INDEX - const BATTLEANIMSTRUCT_01 - const BATTLEANIMSTRUCT_02 - const BATTLEANIMSTRUCT_FRAMESET_ID - const BATTLEANIMSTRUCT_FUNCTION - const BATTLEANIMSTRUCT_PALETTE - const BATTLEANIMSTRUCT_TILEID - const BATTLEANIMSTRUCT_XCOORD - const BATTLEANIMSTRUCT_YCOORD - const BATTLEANIMSTRUCT_XOFFSET - const BATTLEANIMSTRUCT_YOFFSET - const BATTLEANIMSTRUCT_PARAM - const BATTLEANIMSTRUCT_DURATION - const BATTLEANIMSTRUCT_FRAME - const BATTLEANIMSTRUCT_ANON_JT_INDEX - const BATTLEANIMSTRUCT_0F - const BATTLEANIMSTRUCT_10 - const BATTLEANIMSTRUCT_11 - const BATTLEANIMSTRUCT_12 - const BATTLEANIMSTRUCT_13 - const BATTLEANIMSTRUCT_14 - const BATTLEANIMSTRUCT_15 - const BATTLEANIMSTRUCT_16 - const BATTLEANIMSTRUCT_17 -BATTLEANIMSTRUCT_LENGTH EQU const_value -NUM_ANIM_OBJECTS EQU 10 ; see wActiveAnimObjects +; battle_anim_struct members (see macros/ram.asm) +rsreset +DEF BATTLEANIMSTRUCT_INDEX rb +DEF BATTLEANIMSTRUCT_OAMFLAGS rb +DEF BATTLEANIMSTRUCT_FIX_Y rb +DEF BATTLEANIMSTRUCT_FRAMESET_ID rb +DEF BATTLEANIMSTRUCT_FUNCTION rb +DEF BATTLEANIMSTRUCT_PALETTE rb +DEF BATTLEANIMSTRUCT_TILEID rb +DEF BATTLEANIMOBJ_LENGTH EQU _RS - 1 ; discount BATTLEANIMSTRUCT_INDEX +DEF BATTLEANIMSTRUCT_XCOORD rb +DEF BATTLEANIMSTRUCT_YCOORD rb +DEF BATTLEANIMSTRUCT_XOFFSET rb +DEF BATTLEANIMSTRUCT_YOFFSET rb +DEF BATTLEANIMSTRUCT_PARAM rb +DEF BATTLEANIMSTRUCT_DURATION rb +DEF BATTLEANIMSTRUCT_FRAME rb +DEF BATTLEANIMSTRUCT_JUMPTABLE_INDEX rb +DEF BATTLEANIMSTRUCT_VAR1 rb +DEF BATTLEANIMSTRUCT_VAR2 rb + rb_skip 7 +DEF BATTLEANIMSTRUCT_LENGTH EQU _RS +DEF NUM_ANIM_OBJECTS EQU 10 ; see wActiveAnimObjects + +; wBattleAnimTileDict size (see wram.asm) +DEF NUM_BATTLEANIMTILEDICT_ENTRIES EQU 5 ; Start tile for battle animation graphics -BATTLEANIM_BASE_TILE EQU 7 * 7 ; Maximum size of a pokemon picture +DEF BATTLEANIM_BASE_TILE EQU 7 * 7 ; Maximum size of a pokemon picture ; BattleAnimObjects indexes (see data/battle_anims/objects.asm) const_def - const ANIM_OBJ_00 - const ANIM_OBJ_01 - const ANIM_OBJ_02 - const ANIM_OBJ_03 - const ANIM_OBJ_04 - const ANIM_OBJ_05 - const ANIM_OBJ_06 - const ANIM_OBJ_07 - const ANIM_OBJ_08 + const ANIM_OBJ_HIT_BIG_YFIX + const ANIM_OBJ_HIT_YFIX + const ANIM_OBJ_HIT_SMALL_YFIX + const ANIM_OBJ_HIT_BIG + const ANIM_OBJ_HIT + const ANIM_OBJ_HIT_SMALL + const ANIM_OBJ_PUNCH + const ANIM_OBJ_KICK + const ANIM_OBJ_PALM const ANIM_OBJ_FANG - const ANIM_OBJ_0A + const ANIM_OBJ_PUNCH_SHAKE const ANIM_OBJ_EMBER const ANIM_OBJ_DRAGON_RAGE const ANIM_OBJ_FLAMETHROWER @@ -50,16 +48,16 @@ BATTLEANIM_BASE_TILE EQU 7 * 7 ; Maximum size of a pokemon picture const ANIM_OBJ_FIRE_BLAST const ANIM_OBJ_BURNED const ANIM_OBJ_BLIZZARD - const ANIM_OBJ_12 + const ANIM_OBJ_ICE const ANIM_OBJ_ICE_BEAM const ANIM_OBJ_RAZOR_LEAF const ANIM_OBJ_POKE_BALL const ANIM_OBJ_POKE_BALL_BLOCKED - const ANIM_OBJ_17 - const ANIM_OBJ_18 - const ANIM_OBJ_19 - const ANIM_OBJ_1A - const ANIM_OBJ_1B + const ANIM_OBJ_EXPLOSION1 + const ANIM_OBJ_EXPLOSION2 + const ANIM_OBJ_ACID + const ANIM_OBJ_SLUDGE + const ANIM_OBJ_BETA_BALL_POOF const ANIM_OBJ_BALL_POOF const ANIM_OBJ_BIG_ROCK const ANIM_OBJ_SMALL_ROCK @@ -71,56 +69,56 @@ BATTLEANIM_BASE_TILE EQU 7 * 7 ; Maximum size of a pokemon picture const ANIM_OBJ_WATER_GUN const ANIM_OBJ_HYDRO_PUMP const ANIM_OBJ_POWDER - const ANIM_OBJ_27 - const ANIM_OBJ_28 + const ANIM_OBJ_BEAM + const ANIM_OBJ_BEAM_TIP const ANIM_OBJ_ICE_BUILDUP const ANIM_OBJ_FROZEN const ANIM_OBJ_MASTER_BALL_SPARKLE const ANIM_OBJ_RECOVER - const ANIM_OBJ_2D - const ANIM_OBJ_2E - const ANIM_OBJ_2F + const ANIM_OBJ_THUNDER1 + const ANIM_OBJ_THUNDER2 + const ANIM_OBJ_THUNDER3 const ANIM_OBJ_THUNDER_WAVE - const ANIM_OBJ_31 - const ANIM_OBJ_LIGHTNING_BOLT - const ANIM_OBJ_33 - const ANIM_OBJ_34 + const ANIM_OBJ_SPARKS_CIRCLE_BIG + const ANIM_OBJ_THUNDERBOLT_BALL + const ANIM_OBJ_SPARKS_CIRCLE + const ANIM_OBJ_THUNDERSHOCK_BALL const ANIM_OBJ_CLAMP const ANIM_OBJ_BITE - const ANIM_OBJ_37 - const ANIM_OBJ_38 - const ANIM_OBJ_39 - const ANIM_OBJ_3A - const ANIM_OBJ_3B - const ANIM_OBJ_3C - const ANIM_OBJ_3D + const ANIM_OBJ_CUT_DOWN_LEFT + const ANIM_OBJ_CUT_DOWN_RIGHT + const ANIM_OBJ_CUT_UP_RIGHT + const ANIM_OBJ_CUT_LONG_DOWN_LEFT + const ANIM_OBJ_CUT_LONG_DOWN_RIGHT + const ANIM_OBJ_SOLAR_BEAM_CHARGE + const ANIM_OBJ_ABSORB_CENTER const ANIM_OBJ_GUST - const ANIM_OBJ_3F - const ANIM_OBJ_40 - const ANIM_OBJ_41 - const ANIM_OBJ_42 + const ANIM_OBJ_VINE_WHIP1 + const ANIM_OBJ_VINE_WHIP2 + const ANIM_OBJ_RAZOR_WIND1 + const ANIM_OBJ_RAZOR_WIND2 const ANIM_OBJ_SONICBOOM_JP - const ANIM_OBJ_44 + const ANIM_OBJ_WARP const ANIM_OBJ_ABSORB const ANIM_OBJ_EGG - const ANIM_OBJ_47 - const ANIM_OBJ_48 - const ANIM_OBJ_49 + const ANIM_OBJ_FOCUS + const ANIM_OBJ_BIND1 + const ANIM_OBJ_BIND2 const ANIM_OBJ_LEECH_SEED - const ANIM_OBJ_4B + const ANIM_OBJ_SOUND const ANIM_OBJ_WAVE const ANIM_OBJ_CONFUSE_RAY - const ANIM_OBJ_4E - const ANIM_OBJ_4F + const ANIM_OBJ_LEER + const ANIM_OBJ_LEER_TIP const ANIM_OBJ_SCREEN const ANIM_OBJ_HARDEN const ANIM_OBJ_CHICK const ANIM_OBJ_AMNESIA const ANIM_OBJ_ASLEEP const ANIM_OBJ_SKULL - const ANIM_OBJ_56 - const ANIM_OBJ_57 - const ANIM_OBJ_58 + const ANIM_OBJ_DIG_SAND + const ANIM_OBJ_DIG_PILE + const ANIM_OBJ_SAND const ANIM_OBJ_PARALYZED const ANIM_OBJ_STRING_SHOT const ANIM_OBJ_HAZE @@ -128,11 +126,11 @@ BATTLEANIM_BASE_TILE EQU 7 * 7 ; Maximum size of a pokemon picture const ANIM_OBJ_SMOG const ANIM_OBJ_POISON_GAS const ANIM_OBJ_HORN - const ANIM_OBJ_60 + const ANIM_OBJ_NEEDLE const ANIM_OBJ_PETAL_DANCE const ANIM_OBJ_SLUDGE_BOMB const ANIM_OBJ_PAY_DAY - const ANIM_OBJ_64 + const ANIM_OBJ_SONICBOOM_JP_UNUSED const ANIM_OBJ_MIMIC const ANIM_OBJ_ATTRACT const ANIM_OBJ_BONEMERANG @@ -145,7 +143,7 @@ BATTLEANIM_BASE_TILE EQU 7 * 7 ; Maximum size of a pokemon picture const ANIM_OBJ_SKY_ATTACK const ANIM_OBJ_LICK const ANIM_OBJ_WITHDRAW - const ANIM_OBJ_71 + const ANIM_OBJ_DRAIN const ANIM_OBJ_GROWTH const ANIM_OBJ_CONVERSION2 const ANIM_OBJ_SMOKE @@ -154,8 +152,8 @@ BATTLEANIM_BASE_TILE EQU 7 * 7 ; Maximum size of a pokemon picture const ANIM_OBJ_SPEED_LINE const ANIM_OBJ_SHARPEN const ANIM_OBJ_DEFENSE_CURL - const ANIM_OBJ_7A - const ANIM_OBJ_7B + const ANIM_OBJ_METRONOME_HAND + const ANIM_OBJ_METRONOME_SPARKLE const ANIM_OBJ_DISABLE const ANIM_OBJ_AGILITY const ANIM_OBJ_HEART @@ -164,8 +162,8 @@ BATTLEANIM_BASE_TILE EQU 7 * 7 ; Maximum size of a pokemon picture const ANIM_OBJ_COTTON_SPORE const ANIM_OBJ_MILK_DRINK const ANIM_OBJ_ANGER - const ANIM_OBJ_84 - const ANIM_OBJ_85 + const ANIM_OBJ_HEAL_BELL + const ANIM_OBJ_HEAL_BELL_NOTE const ANIM_OBJ_BATON_PASS const ANIM_OBJ_LOCK_ON const ANIM_OBJ_MIND_READER @@ -179,21 +177,21 @@ BATTLEANIM_BASE_TILE EQU 7 * 7 ; Maximum size of a pokemon picture const ANIM_OBJ_DRAGONBREATH const ANIM_OBJ_CONVERSION const ANIM_OBJ_SPIDER_WEB - const ANIM_OBJ_93 + const ANIM_OBJ_CAKE_UNUSED const ANIM_OBJ_NIGHTMARE const ANIM_OBJ_IN_NIGHTMARE const ANIM_OBJ_LOVELY_KISS const ANIM_OBJ_SWEET_KISS const ANIM_OBJ_SKETCH - const ANIM_OBJ_99 - const ANIM_OBJ_9A + const ANIM_OBJ_ENCORE_HAND + const ANIM_OBJ_ENCORE_STAR const ANIM_OBJ_DESTINY_BOND const ANIM_OBJ_MORNING_SUN const ANIM_OBJ_GLIMMER const ANIM_OBJ_MOONLIGHT const ANIM_OBJ_HIDDEN_POWER - const ANIM_OBJ_A0 - const ANIM_OBJ_A1 + const ANIM_OBJ_CROSS_CHOP1 + const ANIM_OBJ_CROSS_CHOP2 const ANIM_OBJ_SANDSTORM const ANIM_OBJ_ZAP_CANNON const ANIM_OBJ_SPITE @@ -202,11 +200,11 @@ BATTLEANIM_BASE_TILE EQU 7 * 7 ; Maximum size of a pokemon picture const ANIM_OBJ_FORESIGHT const ANIM_OBJ_RAPID_SPIN const ANIM_OBJ_SWAGGER - const ANIM_OBJ_AA - const ANIM_OBJ_AB + const ANIM_OBJ_BELLY_DRUM_HAND + const ANIM_OBJ_BELLY_DRUM_NOTE const ANIM_OBJ_MEAN_LOOK - const ANIM_OBJ_AD - const ANIM_OBJ_AE + const ANIM_OBJ_BETA_PURSUIT + const ANIM_OBJ_SHOOTING_SPARKLE const ANIM_OBJ_RAIN const ANIM_OBJ_B0 const ANIM_OBJ_PSYCH_UP @@ -220,89 +218,91 @@ BATTLEANIM_BASE_TILE EQU 7 * 7 ; Maximum size of a pokemon picture const ANIM_OBJ_PLAYERHEAD_1ROW const ANIM_OBJ_ENEMYFEET_2ROW const ANIM_OBJ_PLAYERHEAD_2ROW +DEF NUM_ANIM_OBJS EQU const_value ; DoBattleAnimFrame arguments (see engine/battle_anims/functions.asm) const_def - const BATTLEANIMFUNC_00 - const BATTLEANIMFUNC_01 - const BATTLEANIMFUNC_02 - const BATTLEANIMFUNC_03 - const BATTLEANIMFUNC_04 - const BATTLEANIMFUNC_05 - const BATTLEANIMFUNC_06 - const BATTLEANIMFUNC_07 - const BATTLEANIMFUNC_08 - const BATTLEANIMFUNC_09 - const BATTLEANIMFUNC_0A + const BATTLEANIMFUNC_NULL + const BATTLEANIMFUNC_USER_TO_TARGET + const BATTLEANIMFUNC_USER_TO_TARGET_DISAPPEAR + const BATTLEANIMFUNC_MOVE_IN_CIRCLE + const BATTLEANIMFUNC_WAVE_TO_TARGET + const BATTLEANIMFUNC_THROW_TO_TARGET + const BATTLEANIMFUNC_THROW_TO_TARGET_DISAPPEAR + const BATTLEANIMFUNC_DROP + const BATTLEANIMFUNC_USER_TO_TARGET_SPIN + const BATTLEANIMFUNC_SHAKE + const BATTLEANIMFUNC_FIRE_BLAST const BATTLEANIMFUNC_RAZOR_LEAF - const BATTLEANIMFUNC_0C - const BATTLEANIMFUNC_0D - const BATTLEANIMFUNC_0E - const BATTLEANIMFUNC_0F - const BATTLEANIMFUNC_10 - const BATTLEANIMFUNC_11 - const BATTLEANIMFUNC_12 - const BATTLEANIMFUNC_13 - const BATTLEANIMFUNC_14 - const BATTLEANIMFUNC_15 - const BATTLEANIMFUNC_16 - const BATTLEANIMFUNC_17 - const BATTLEANIMFUNC_18 - const BATTLEANIMFUNC_19 - const BATTLEANIMFUNC_1A - const BATTLEANIMFUNC_1B - const BATTLEANIMFUNC_1C - const BATTLEANIMFUNC_1D - const BATTLEANIMFUNC_1E - const BATTLEANIMFUNC_1F + const BATTLEANIMFUNC_BUBBLE + const BATTLEANIMFUNC_SURF + const BATTLEANIMFUNC_SING + const BATTLEANIMFUNC_WATER_GUN + const BATTLEANIMFUNC_EMBER + const BATTLEANIMFUNC_POWDER + const BATTLEANIMFUNC_POKEBALL + const BATTLEANIMFUNC_POKEBALL_BLOCKED + const BATTLEANIMFUNC_RECOVER + const BATTLEANIMFUNC_THUNDER_WAVE + const BATTLEANIMFUNC_CLAMP_ENCORE + const BATTLEANIMFUNC_BITE + const BATTLEANIMFUNC_SOLAR_BEAM + const BATTLEANIMFUNC_GUST + const BATTLEANIMFUNC_RAZOR_WIND + const BATTLEANIMFUNC_KICK + const BATTLEANIMFUNC_ABSORB + const BATTLEANIMFUNC_EGG + const BATTLEANIMFUNC_MOVE_UP + const BATTLEANIMFUNC_WRAP const BATTLEANIMFUNC_LEECH_SEED - const BATTLEANIMFUNC_21 - const BATTLEANIMFUNC_22 - const BATTLEANIMFUNC_23 - const BATTLEANIMFUNC_24 - const BATTLEANIMFUNC_25 - const BATTLEANIMFUNC_26 - const BATTLEANIMFUNC_27 - const BATTLEANIMFUNC_28 - const BATTLEANIMFUNC_SPRIAL_DESCENT + const BATTLEANIMFUNC_SOUND + const BATTLEANIMFUNC_CONFUSE_RAY + const BATTLEANIMFUNC_DIZZY + const BATTLEANIMFUNC_AMNESIA + const BATTLEANIMFUNC_FLOAT_UP + const BATTLEANIMFUNC_DIG + const BATTLEANIMFUNC_STRING + const BATTLEANIMFUNC_PARALYZED + const BATTLEANIMFUNC_SPIRAL_DESCENT const BATTLEANIMFUNC_POISON_GAS const BATTLEANIMFUNC_HORN - const BATTLEANIMFUNC_2C - const BATTLEANIMFUNC_2D - const BATTLEANIMFUNC_2E - const BATTLEANIMFUNC_2F - const BATTLEANIMFUNC_30 - const BATTLEANIMFUNC_31 - const BATTLEANIMFUNC_32 - const BATTLEANIMFUNC_33 - const BATTLEANIMFUNC_34 - const BATTLEANIMFUNC_35 - const BATTLEANIMFUNC_36 - const BATTLEANIMFUNC_37 - const BATTLEANIMFUNC_38 - const BATTLEANIMFUNC_39 - const BATTLEANIMFUNC_3A - const BATTLEANIMFUNC_3B - const BATTLEANIMFUNC_3C - const BATTLEANIMFUNC_3D - const BATTLEANIMFUNC_3E - const BATTLEANIMFUNC_3F - const BATTLEANIMFUNC_40 - const BATTLEANIMFUNC_41 - const BATTLEANIMFUNC_42 - const BATTLEANIMFUNC_43 - const BATTLEANIMFUNC_44 - const BATTLEANIMFUNC_45 - const BATTLEANIMFUNC_46 - const BATTLEANIMFUNC_47 - const BATTLEANIMFUNC_48 - const BATTLEANIMFUNC_49 - const BATTLEANIMFUNC_4A - const BATTLEANIMFUNC_4B - const BATTLEANIMFUNC_4C - const BATTLEANIMFUNC_4D - const BATTLEANIMFUNC_4E - const BATTLEANIMFUNC_4F + const BATTLEANIMFUNC_NEEDLE + const BATTLEANIMFUNC_PETAL_DANCE + const BATTLEANIMFUNC_THIEF_PAYDAY + const BATTLEANIMFUNC_ABSORB_CIRCLE + const BATTLEANIMFUNC_BONEMERANG + const BATTLEANIMFUNC_SHINY + const BATTLEANIMFUNC_SKY_ATTACK + const BATTLEANIMFUNC_GROWTH_SWORDS_DANCE + const BATTLEANIMFUNC_SMOKE_FLAME_WHEEL + const BATTLEANIMFUNC_PRESENT_SMOKESCREEN + const BATTLEANIMFUNC_STRENGTH_SEISMIC_TOSS + const BATTLEANIMFUNC_SPEED_LINE + const BATTLEANIMFUNC_SLUDGE + const BATTLEANIMFUNC_METRONOME_HAND + const BATTLEANIMFUNC_METRONOME_SPARKLE_SKETCH + const BATTLEANIMFUNC_AGILITY + const BATTLEANIMFUNC_SACRED_FIRE + const BATTLEANIMFUNC_SAFEGUARD_PROTECT + const BATTLEANIMFUNC_LOCK_ON_MIND_READER + const BATTLEANIMFUNC_SPIKES + const BATTLEANIMFUNC_HEAL_BELL_NOTES + const BATTLEANIMFUNC_BATON_PASS + const BATTLEANIMFUNC_CONVERSION + const BATTLEANIMFUNC_ENCORE_BELLY_DRUM + const BATTLEANIMFUNC_SWAGGER_MORNING_SUN + const BATTLEANIMFUNC_HIDDEN_POWER + const BATTLEANIMFUNC_CURSE + const BATTLEANIMFUNC_PERISH_SONG + const BATTLEANIMFUNC_RAPID_SPIN + const BATTLEANIMFUNC_BETA_PURSUIT + const BATTLEANIMFUNC_RAIN_SANDSTORM + const BATTLEANIMFUNC_ANIM_OBJ_B0 + const BATTLEANIMFUNC_PSYCH_UP + const BATTLEANIMFUNC_ANCIENT_POWER + const BATTLEANIMFUNC_ROCK_SMASH + const BATTLEANIMFUNC_COTTON +DEF NUM_BATTLEANIMFUNCS EQU const_value ; BattleAnimFrameData indexes (see data/battle_anims/framesets.asm) const_def @@ -491,6 +491,7 @@ BATTLEANIM_BASE_TILE EQU 7 * 7 ; Maximum size of a pokemon picture const BATTLEANIMFRAMESET_B6 const BATTLEANIMFRAMESET_B7 const BATTLEANIMFRAMESET_B8 +DEF NUM_BATTLEANIMFRAMESETS EQU const_value ; BattleAnimOAMData indexes (see data/battle_anims/oam.asm) const_def @@ -710,6 +711,7 @@ BATTLEANIM_BASE_TILE EQU 7 * 7 ; Maximum size of a pokemon picture const BATTLEANIMOAMSET_D5 const BATTLEANIMOAMSET_D6 const BATTLEANIMOAMSET_D7 +DEF NUM_BATTLEANIMOAMSETS EQU const_value ; BattleBGEffects indexes (see engine/battle_anims/bg_effects.asm) const_def 1 @@ -718,9 +720,9 @@ BATTLEANIM_BASE_TILE EQU 7 * 7 ; Maximum size of a pokemon picture const ANIM_BG_WHITE_HUES const ANIM_BG_BLACK_HUES const ANIM_BG_ALTERNATE_HUES - const ANIM_BG_06 - const ANIM_BG_07 - const ANIM_BG_08 + const ANIM_BG_CYCLE_OBPALS_GRAY_AND_YELLOW + const ANIM_BG_CYCLE_MID_OBPALS_GRAY_AND_YELLOW + const ANIM_BG_CYCLE_BGPALS_INVERTED const ANIM_BG_HIDE_MON const ANIM_BG_SHOW_MON const ANIM_BG_ENTER_MON @@ -734,39 +736,41 @@ BATTLEANIM_BASE_TILE EQU 7 * 7 ; Maximum size of a pokemon picture const ANIM_BG_DOUBLE_TEAM const ANIM_BG_ACID_ARMOR const ANIM_BG_RAPID_FLASH - const ANIM_BG_16 - const ANIM_BG_17 - const ANIM_BG_18 - const ANIM_BG_19 - const ANIM_BG_1A - const ANIM_BG_1B - const ANIM_BG_1C - const ANIM_BG_1D - const ANIM_BG_1E - const ANIM_BG_1F - const ANIM_BG_20 + const ANIM_BG_FADE_MON_TO_LIGHT + const ANIM_BG_FADE_MON_TO_BLACK + const ANIM_BG_FADE_MON_TO_LIGHT_REPEATING + const ANIM_BG_FADE_MON_TO_BLACK_REPEATING + const ANIM_BG_CYCLE_MON_LIGHT_DARK_REPEATING + const ANIM_BG_FLASH_MON_REPEATING + const ANIM_BG_FADE_MONS_TO_BLACK_REPEATING + const ANIM_BG_FADE_MON_TO_WHITE_WAIT_FADE_BACK + const ANIM_BG_FADE_MON_FROM_WHITE + const ANIM_BG_SHAKE_SCREEN_X + const ANIM_BG_SHAKE_SCREEN_Y const ANIM_BG_WITHDRAW const ANIM_BG_BOUNCE_DOWN const ANIM_BG_DIG const ANIM_BG_TACKLE - const ANIM_BG_25 - const ANIM_BG_26 - const ANIM_BG_27 - const ANIM_BG_WAVE_DEFORM_USER - const ANIM_BG_PSYCHIC - const ANIM_BG_2A - const ANIM_BG_2B - const ANIM_BG_2C - const ANIM_BG_2D - const ANIM_BG_2E - const ANIM_BG_2F - const ANIM_BG_30 - const ANIM_BG_31 - const ANIM_BG_32 - const ANIM_BG_VIBRATE_MON + const ANIM_BG_BODY_SLAM const ANIM_BG_WOBBLE_MON - const ANIM_BG_35 + const ANIM_BG_REMOVE_MON + const ANIM_BG_WAVE_DEFORM_MON + const ANIM_BG_PSYCHIC + const ANIM_BG_BETA_SEND_OUT_MON1 + const ANIM_BG_BETA_SEND_OUT_MON2 + const ANIM_BG_FLAIL + const ANIM_BG_BETA_PURSUIT + const ANIM_BG_ROLLOUT + const ANIM_BG_VITAL_THROW + const ANIM_BG_START_WATER + const ANIM_BG_WATER + const ANIM_BG_END_WATER + const ANIM_BG_VIBRATE_MON + const ANIM_BG_WOBBLE_PLAYER + const ANIM_BG_WOBBLE_SCREEN +DEF NUM_ANIM_BGS EQU const_value - 1 +; wBattleAnimTileDict keys (see wram.asm) ; AnimObjGFX indexes (see data/battle_anims/object_gfx.asm) const_def 1 const ANIM_GFX_HIT @@ -810,15 +814,21 @@ BATTLEANIM_BASE_TILE EQU 7 * 7 ; Maximum size of a pokemon picture const ANIM_GFX_AEROBLAST const ANIM_GFX_PLAYERHEAD const ANIM_GFX_ENEMYFEET +DEF NUM_ANIM_GFX EQU const_value - 1 -; battle_bg_effect struct members (see macros/wram.asm) +; battle_bg_effect struct members (see macros/ram.asm) +rsreset +DEF BG_EFFECT_STRUCT_FUNCTION rb +DEF BG_EFFECT_STRUCT_JT_INDEX rb +DEF BG_EFFECT_STRUCT_BATTLE_TURN rb +DEF BG_EFFECT_STRUCT_PARAM rb +DEF BG_EFFECT_STRUCT_LENGTH EQU _RS +DEF NUM_BG_EFFECTS EQU 5 ; see wActiveBGEffects + +; anim_bgeffect battle turn values for some effects const_def - const BG_EFFECT_STRUCT_FUNCTION - const BG_EFFECT_STRUCT_JT_INDEX - const BG_EFFECT_STRUCT_BATTLE_TURN - const BG_EFFECT_STRUCT_03 -BG_EFFECT_STRUCT_LENGTH EQU const_value -NUM_BG_EFFECTS EQU 5 ; see wActiveBGEffects + const BG_EFFECT_TARGET ; 0 + const BG_EFFECT_USER ; 1 ; battle palettes const_def diff --git a/pokecrystal/constants/battle_constants.asm b/pokecrystal/constants/battle_constants.asm index a8a249a..e6a1f36 100644 --- a/pokecrystal/constants/battle_constants.asm +++ b/pokecrystal/constants/battle_constants.asm @@ -1,31 +1,31 @@ ; significant level values -MAX_LEVEL EQU 100 -MIN_LEVEL EQU 2 -EGG_LEVEL EQU 5 +DEF MAX_LEVEL EQU 100 +DEF MIN_LEVEL EQU 2 +DEF EGG_LEVEL EQU 5 ; maximum moves known per mon -NUM_MOVES EQU 4 +DEF NUM_MOVES EQU 4 ; significant stat values -BASE_STAT_LEVEL EQU 7 -MAX_STAT_LEVEL EQU 13 - -; minimum damage before type effectiveness -MIN_NEUTRAL_DAMAGE EQU 2 +DEF BASE_STAT_LEVEL EQU 7 +DEF MAX_STAT_LEVEL EQU 13 ; turns that sleep lasts -REST_SLEEP_TURNS EQU 2 -TREEMON_SLEEP_TURNS EQU 7 +DEF REST_SLEEP_TURNS EQU 2 +DEF TREEMON_SLEEP_TURNS EQU 7 ; default move priority -BASE_PRIORITY EQU 1 +DEF BASE_PRIORITY EQU 1 ; type effectiveness factors, scaled by 10 -SUPER_EFFECTIVE EQU 20 -MORE_EFFECTIVE EQU 15 -EFFECTIVE EQU 10 -NOT_VERY_EFFECTIVE EQU 05 -NO_EFFECT EQU 00 +DEF SUPER_EFFECTIVE EQU 20 +DEF MORE_EFFECTIVE EQU 15 +DEF EFFECTIVE EQU 10 +DEF NOT_VERY_EFFECTIVE EQU 05 +DEF NO_EFFECT EQU 00 + +; enemy AI behavior +DEF BASE_AI_SWITCH_SCORE EQU 10 ; wPlayerStatLevels and wEnemyStatLevels indexes (see wram.asm) ; GetStatName arguments (see data/battle/stat_names.asm) @@ -38,43 +38,43 @@ NO_EFFECT EQU 00 const ACCURACY const EVASION const ABILITY ; used for BattleCommand_Curse -NUM_LEVEL_STATS EQU const_value +DEF NUM_LEVEL_STATS EQU const_value ; move struct members (see data/moves/moves.asm) - const_def - const MOVE_ANIM ; 0 - const MOVE_EFFECT ; 1 - const MOVE_POWER ; 2 - const MOVE_TYPE ; 3 - const MOVE_ACC ; 4 - const MOVE_PP ; 5 - const MOVE_CHANCE ; 6 -MOVE_LENGTH EQU const_value +rsreset +DEF MOVE_ANIM rb ; 0 +DEF MOVE_EFFECT rb ; 1 +DEF MOVE_POWER rb ; 2 +DEF MOVE_TYPE rb ; 3 +DEF MOVE_ACC rb ; 4 +DEF MOVE_PP rb ; 5 +DEF MOVE_CHANCE rb ; 6 +DEF MOVE_LENGTH EQU _RS ; stat constants ; indexes for: ; - wPlayerStats and wEnemyStats (see wram.asm) -; - party_struct and battle_struct members (see macros/wram.asm) +; - party_struct and battle_struct members (see macros/ram.asm) const_def 1 const STAT_HP const STAT_ATK const STAT_DEF const STAT_SPD const STAT_SATK -NUM_EXP_STATS EQU const_value + -1 +DEF NUM_EXP_STATS EQU const_value - 1 const STAT_SDEF -NUM_STATS EQU const_value + -1 -NUM_BATTLE_STATS EQU NUM_STATS + -1 ; don't count HP +DEF NUM_STATS EQU const_value - 1 +DEF NUM_BATTLE_STATS EQU NUM_STATS - 1 ; don't count HP ; stat formula constants -STAT_MIN_NORMAL EQU 5 -STAT_MIN_HP EQU 10 +DEF STAT_MIN_NORMAL EQU 5 +DEF STAT_MIN_HP EQU 10 -MAX_STAT_VALUE EQU 999 +DEF MAX_STAT_VALUE EQU 999 ; shiny dvs -ATKDEFDV_SHINY EQU $EA -SPDSPCDV_SHINY EQU $AA +DEF ATKDEFDV_SHINY EQU $EA +DEF SPDSPCDV_SHINY EQU $AA ; battle classes (wBattleMode values) const_def 1 @@ -97,7 +97,7 @@ SPDSPCDV_SHINY EQU $AA const BATTLETYPE_CELEBI const BATTLETYPE_SUICUNE -; BattleVarPairs indexes (see home/battle.asm) +; BattleVarPairs indexes (see home/battle_vars.asm) const_def const BATTLE_VARS_SUBSTATUS1 const BATTLE_VARS_SUBSTATUS2 @@ -120,8 +120,9 @@ SPDSPCDV_SHINY EQU $AA const BATTLE_VARS_LAST_COUNTER_MOVE_OPP const BATTLE_VARS_LAST_MOVE const BATTLE_VARS_LAST_MOVE_OPP +DEF NUM_BATTLE_VARS EQU const_value -; BattleVarLocations indexes (see home/battle.asm) +; BattleVarLocations indexes (see home/battle_vars.asm) const_def const PLAYER_SUBSTATUS_1 const ENEMY_SUBSTATUS_1 @@ -149,71 +150,74 @@ SPDSPCDV_SHINY EQU $AA const ENEMY_COUNTER_MOVE const PLAYER_LAST_MOVE const ENEMY_LAST_MOVE +assert const_value % 2 == 0 +DEF NUM_BATTLE_VAR_LOCATION_PAIRS EQU const_value / 2 ; status condition bit flags -SLP EQU %111 ; 0-7 turns +DEF SLP_MASK EQU %111 ; 0-7 turns const_def 3 const PSN const BRN const FRZ const PAR -ALL_STATUS EQU (1 << PSN) | (1 << BRN) | (1 << FRZ) | (1 << PAR) | SLP +DEF ALL_STATUS EQU (1 << PSN) | (1 << BRN) | (1 << FRZ) | (1 << PAR) | SLP_MASK ; wPlayerSubStatus1 or wEnemySubStatus1 bit flags - enum_start 7, -1 - enum SUBSTATUS_IN_LOVE - enum SUBSTATUS_ROLLOUT - enum SUBSTATUS_ENDURE - enum SUBSTATUS_PERISH - enum SUBSTATUS_IDENTIFIED - enum SUBSTATUS_PROTECT - enum SUBSTATUS_CURSE - enum SUBSTATUS_NIGHTMARE + const_def + const SUBSTATUS_NIGHTMARE + const SUBSTATUS_CURSE + const SUBSTATUS_PROTECT + const SUBSTATUS_IDENTIFIED + const SUBSTATUS_PERISH + const SUBSTATUS_ENDURE + const SUBSTATUS_ROLLOUT + const SUBSTATUS_IN_LOVE ; wPlayerSubStatus2 or wEnemySubStatus2 bit flags -SUBSTATUS_CURLED EQU 0 + const_def + const SUBSTATUS_CURLED ; wPlayerSubStatus3 or wEnemySubStatus3 bit flags - enum_start 7, -1 - enum SUBSTATUS_CONFUSED - enum SUBSTATUS_FLYING - enum SUBSTATUS_UNDERGROUND - enum SUBSTATUS_CHARGED - enum SUBSTATUS_FLINCHED - enum SUBSTATUS_IN_LOOP - enum SUBSTATUS_RAMPAGE - enum SUBSTATUS_BIDE + const_def + const SUBSTATUS_BIDE + const SUBSTATUS_RAMPAGE + const SUBSTATUS_IN_LOOP + const SUBSTATUS_FLINCHED + const SUBSTATUS_CHARGED + const SUBSTATUS_UNDERGROUND + const SUBSTATUS_FLYING + const SUBSTATUS_CONFUSED ; wPlayerSubStatus4 or wEnemySubStatus4 bit flags - enum_start 7, -1 - enum SUBSTATUS_LEECH_SEED - enum SUBSTATUS_RAGE - enum SUBSTATUS_RECHARGE - enum SUBSTATUS_SUBSTITUTE - enum SUBSTATUS_UNKNOWN_1 - enum SUBSTATUS_FOCUS_ENERGY - enum SUBSTATUS_MIST - enum SUBSTATUS_X_ACCURACY + const_def + const SUBSTATUS_X_ACCURACY + const SUBSTATUS_MIST + const SUBSTATUS_FOCUS_ENERGY + const_skip + const SUBSTATUS_SUBSTITUTE + const SUBSTATUS_RECHARGE + const SUBSTATUS_RAGE + const SUBSTATUS_LEECH_SEED ; wPlayerSubStatus5 or wEnemySubStatus5 bit flags - enum_start 7, -1 - enum SUBSTATUS_CANT_RUN - enum SUBSTATUS_DESTINY_BOND - enum SUBSTATUS_LOCK_ON - enum SUBSTATUS_ENCORED - enum SUBSTATUS_TRANSFORMED - enum SUBSTATUS_UNKNOWN_2 - enum SUBSTATUS_UNKNOWN_3 - enum SUBSTATUS_TOXIC + const_def + const SUBSTATUS_TOXIC + const_skip + const_skip + const SUBSTATUS_TRANSFORMED + const SUBSTATUS_ENCORED + const SUBSTATUS_LOCK_ON + const SUBSTATUS_DESTINY_BOND + const SUBSTATUS_CANT_RUN ; wPlayerScreens or wEnemyScreens bit flags - enum_start 4, -1 - enum SCREENS_REFLECT - enum SCREENS_LIGHT_SCREEN - enum SCREENS_SAFEGUARD - enum SCREENS_UNUSED - enum SCREENS_SPIKES + const_def + const SCREENS_SPIKES + const_skip + const SCREENS_SAFEGUARD + const SCREENS_LIGHT_SCREEN + const SCREENS_REFLECT ; values in wBattleWeather const_def @@ -237,9 +241,9 @@ SUBSTATUS_CURLED EQU 0 const BATTLEACTION_SWITCH4 const BATTLEACTION_SWITCH5 const BATTLEACTION_SWITCH6 - const BATTLEACTION_A - const BATTLEACTION_B - const BATTLEACTION_C + const_skip + const_skip + const_skip const BATTLEACTION_SKIPTURN const BATTLEACTION_STRUGGLE const BATTLEACTION_FORFEIT @@ -256,6 +260,10 @@ SUBSTATUS_CURLED EQU 0 const LOSE const DRAW -BATTLERESULT_CAUGHT_CELEBI EQU 6 -BATTLERESULT_BOX_FULL EQU 7 -BATTLERESULT_BITMASK EQU (1 << BATTLERESULT_CAUGHT_CELEBI) | (1 << BATTLERESULT_BOX_FULL) +DEF BATTLERESULT_CAUGHT_CELEBI EQU 6 +DEF BATTLERESULT_BOX_FULL EQU 7 +DEF BATTLERESULT_BITMASK EQU (1 << BATTLERESULT_CAUGHT_CELEBI) | (1 << BATTLERESULT_BOX_FULL) + +; link_battle_record struct +DEF LINK_BATTLE_RECORD_LENGTH EQU 2 + (NAME_LENGTH - 1) + 2 * 3 +DEF NUM_LINK_BATTLE_RECORDS EQU 5 diff --git a/pokecrystal/constants/battle_tower_constants.asm b/pokecrystal/constants/battle_tower_constants.asm index 9945a08..27e9af1 100644 --- a/pokecrystal/constants/battle_tower_constants.asm +++ b/pokecrystal/constants/battle_tower_constants.asm @@ -1,11 +1,14 @@ -BATTLETOWER_PARTY_LENGTH EQU 3 -BATTLETOWER_STREAK_LENGTH EQU 7 +DEF BATTLETOWER_PARTY_LENGTH EQU 3 +DEF BATTLETOWER_STREAK_LENGTH EQU 7 -BATTLETOWER_NUM_UNIQUE_MON EQU 21 -BATTLETOWER_NUM_UNIQUE_TRAINERS EQU 70 +DEF BATTLETOWER_NUM_UNIQUE_MON EQU 21 +DEF BATTLETOWER_NUM_UNIQUE_TRAINERS EQU 70 -BATTLETOWER_TRAINERDATALENGTH EQU $24 -BATTLE_TOWER_STRUCT_LENGTH EQUS "(NAME_LENGTH + BATTLETOWER_PARTY_LENGTH * NICKNAMED_MON_STRUCT_LENGTH + BATTLETOWER_TRAINERDATALENGTH)" +DEF BATTLETOWER_TRAINERDATALENGTH EQU 18 * 2 ; $24 +DEF BATTLE_TOWER_STRUCT_LENGTH EQU NAME_LENGTH + BATTLETOWER_PARTY_LENGTH * NICKNAMED_MON_STRUCT_LENGTH + BATTLETOWER_TRAINERDATALENGTH ; $e0 + +DEF HONOR_ROLL_ENTRIES EQU 30 +DEF HONOR_ROLL_DATA_LENGTH EQU (PLAYER_NAME_LENGTH - 1) * HONOR_ROLL_ENTRIES ; BattleTowerAction setval arguments (see engine/events/battle_tower/battle_tower.asm) const_def @@ -25,10 +28,10 @@ BATTLE_TOWER_STRUCT_LENGTH EQUS "(NAME_LENGTH + BATTLETOWER_PARTY_LENGTH * NICKN const BATTLETOWERACTION_0D ; more time stuff in SRAM bank 5 const BATTLETOWERACTION_EGGTICKET const BATTLETOWERACTION_0F ; check w3_d090 - const BATTLETOWERACTION_10 ; dw based on 5:a800 - const BATTLETOWERACTION_11 ; store 0 in 5:aa8d - const BATTLETOWERACTION_12 ; store 1 in 5:aa8d - const BATTLETOWERACTION_13 ; check 5:aa8d + const BATTLETOWERACTION_10 ; dw based on s5_a800 + const BATTLETOWERACTION_11 ; store 0 in s5_aa8d + const BATTLETOWERACTION_12 ; store 1 in s5_aa8d + const BATTLETOWERACTION_13 ; check s5_aa8d const BATTLETOWERACTION_14 ; if save file is yours: bit 0, [sBattleTowerSaveFileFlags] const BATTLETOWERACTION_15 ; set 0, [sBattleTowerSaveFileFlags] const BATTLETOWERACTION_16 ; update time in SRAM bank 5 @@ -44,7 +47,7 @@ BATTLE_TOWER_STRUCT_LENGTH EQUS "(NAME_LENGTH + BATTLETOWER_PARTY_LENGTH * NICKN ; BattleTowerAction return values ; - from BATTLETOWERACTION_CHECKMOBILEEVENT -MOBILE_EVENT_OBJECT_GS_BALL EQU $b +DEF MOBILE_EVENT_OBJECT_GS_BALL EQU $b ; BattleTowerText arguments (see engine/events/battle_tower/trainer_text.asm) const_def 1 @@ -56,6 +59,6 @@ MOBILE_EVENT_OBJECT_GS_BALL EQU $b const_def const BATTLETOWER_NO_CHALLENGE const BATTLETOWER_SAVED_AND_LEFT - const BATTLETOWER_CHALLENGE_IN_PROGESS + const BATTLETOWER_CHALLENGE_IN_PROGRESS const BATTLETOWER_WON_CHALLENGE const BATTLETOWER_RECEIVED_REWARD diff --git a/pokecrystal/constants/collision_constants.asm b/pokecrystal/constants/collision_constants.asm index f9724da..a183e8c 100644 --- a/pokecrystal/constants/collision_constants.asm +++ b/pokecrystal/constants/collision_constants.asm @@ -1,129 +1,129 @@ -; collision permissions (see data/collision_permissions.asm) -LANDTILE EQU $00 -WATERTILE EQU $01 -WALLTILE EQU $0f -TALK EQU $10 +; collision permissions (see data/collision/collision_permissions.asm) +DEF LAND_TILE EQU $00 +DEF WATER_TILE EQU $01 +DEF WALL_TILE EQU $0f +DEF TALK EQU $10 ; collision data types (see data/tilesets/*_collision.asm) -; TileCollisionTable indexes (see data/collision_permissions.asm) -COLL_FLOOR EQU $00 -COLL_01 EQU $01 ; garbage -COLL_03 EQU $03 ; garbage -COLL_04 EQU $04 ; garbage -COLL_WALL EQU $07 -COLL_CUT_08 EQU $08 ; unused -COLL_TALL_GRASS_10 EQU $10 ; unused -COLL_CUT_TREE EQU $12 -COLL_LONG_GRASS EQU $14 -COLL_HEADBUTT_TREE EQU $15 -COLL_TALL_GRASS EQU $18 -COLL_CUT_TREE_1A EQU $1a ; unused -COLL_LONG_GRASS_1C EQU $1c ; unused -COLL_HEADBUTT_TREE_1D EQU $1d ; unused -COLL_WATER_21 EQU $21 ; ??? -COLL_ICE EQU $23 -COLL_WHIRLPOOL EQU $24 -COLL_BUOY EQU $27 -COLL_CUT_28 EQU $28 ; garbage -COLL_WATER EQU $29 -COLL_ICE_2B EQU $2b ; unused -COLL_WHIRLPOOL_2C EQU $2c ; unused -COLL_WATERFALL_RIGHT EQU $30 ; unused -COLL_WATERFALL_LEFT EQU $31 ; unused -COLL_WATERFALL_UP EQU $32 ; unused -COLL_WATERFALL EQU $33 -COLL_CURRENT_RIGHT EQU $38 ; unused -COLL_CURRENT_LEFT EQU $39 ; unused -COLL_CURRENT_UP EQU $3a ; unused -COLL_CURRENT_DOWN EQU $3b ; unused -COLL_BRAKE EQU $40 ; unused -COLL_WALK_RIGHT EQU $41 ; unused -COLL_WALK_LEFT EQU $42 ; unused -COLL_WALK_UP EQU $43 ; unused -COLL_WALK_DOWN EQU $44 ; unused -COLL_BRAKE_45 EQU $45 ; garbage -COLL_BRAKE_46 EQU $46 ; unused -COLL_BRAKE_47 EQU $47 ; unused -COLL_GRASS_48 EQU $48 ; unused -COLL_GRASS_49 EQU $49 ; unused -COLL_GRASS_4A EQU $4a ; garbage -COLL_GRASS_4B EQU $4b ; garbage -COLL_GRASS_4C EQU $4c ; unused -COLL_WALK_RIGHT_ALT EQU $50 ; unused -COLL_WALK_LEFT_ALT EQU $51 ; unused -COLL_WALK_UP_ALT EQU $52 ; unused -COLL_WALK_DOWN_ALT EQU $53 ; unused -COLL_BRAKE_ALT EQU $54 ; unused -COLL_BRAKE_55 EQU $55 ; unused -COLL_BRAKE_56 EQU $56 ; unused -COLL_BRAKE_57 EQU $57 ; unused -COLL_5B EQU $5b ; garbage -COLL_PIT EQU $60 -COLL_VIRTUAL_BOY EQU $61 ; garbage -COLL_64 EQU $64 ; garbage -COLL_65 EQU $65 ; garbage -COLL_PIT_68 EQU $68 ; unused -COLL_WARP_CARPET_DOWN EQU $70 -COLL_DOOR EQU $71 -COLL_LADDER EQU $72 -COLL_STAIRCASE_73 EQU $73 ; unused -COLL_CAVE_74 EQU $74 ; unused -COLL_DOOR_75 EQU $75 ; unused -COLL_WARP_CARPET_LEFT EQU $76 -COLL_WARP_77 EQU $77 ; unused -COLL_WARP_CARPET_UP EQU $78 -COLL_DOOR_79 EQU $79 ; unused -COLL_STAIRCASE EQU $7a -COLL_CAVE EQU $7b -COLL_WARP_PANEL EQU $7c -COLL_DOOR_7D EQU $7d ; unused -COLL_WARP_CARPET_RIGHT EQU $7e -COLL_WARP_7F EQU $7f ; unused -COLL_COUNTER EQU $90 -COLL_BOOKSHELF EQU $91 -COLL_PC EQU $93 -COLL_RADIO EQU $94 -COLL_TOWN_MAP EQU $95 -COLL_MART_SHELF EQU $96 -COLL_TV EQU $97 -COLL_COUNTER_98 EQU $98 ; unused -COLL_9C EQU $9c ; garbage -COLL_WINDOW EQU $9d -COLL_INCENSE_BURNER EQU $9f -COLL_HOP_RIGHT EQU $a0 -COLL_HOP_LEFT EQU $a1 -COLL_HOP_UP EQU $a2 ; unused -COLL_HOP_DOWN EQU $a3 -COLL_HOP_DOWN_RIGHT EQU $a4 -COLL_HOP_DOWN_LEFT EQU $a5 -COLL_HOP_UP_RIGHT EQU $a6 ; unused -COLL_HOP_UP_LEFT EQU $a7 ; unused -COLL_RIGHT_WALL EQU $b0 -COLL_LEFT_WALL EQU $b1 -COLL_UP_WALL EQU $b2 -COLL_DOWN_WALL EQU $b3 ; unused -COLL_DOWN_RIGHT_WALL EQU $b4 ; unused -COLL_DOWN_LEFT_WALL EQU $b5 ; unused -COLL_UP_RIGHT_WALL EQU $b6 ; unused -COLL_UP_LEFT_WALL EQU $b7 ; unused -COLL_RIGHT_BUOY EQU $c0 ; unused -COLL_LEFT_BUOY EQU $c1 ; unused -COLL_UP_BUOY EQU $c2 ; unused -COLL_DOWN_BUOY EQU $c3 ; unused -COLL_DOWN_RIGHT_BUOY EQU $c4 ; unused -COLL_DOWN_LEFT_BUOY EQU $c5 ; unused -COLL_UP_RIGHT_BUOY EQU $c6 ; unused -COLL_UP_LEFT_BUOY EQU $c7 ; unused -COLL_FF EQU $ff ; garbage +; TileCollisionTable indexes (see data/collision/collision_permissions.asm) +DEF COLL_FLOOR EQU $00 +DEF COLL_01 EQU $01 ; garbage +DEF COLL_03 EQU $03 ; garbage +DEF COLL_04 EQU $04 ; garbage +DEF COLL_WALL EQU $07 +DEF COLL_CUT_08 EQU $08 ; unused +DEF COLL_TALL_GRASS_10 EQU $10 ; unused +DEF COLL_CUT_TREE EQU $12 +DEF COLL_LONG_GRASS EQU $14 +DEF COLL_HEADBUTT_TREE EQU $15 +DEF COLL_TALL_GRASS EQU $18 +DEF COLL_CUT_TREE_1A EQU $1a ; unused +DEF COLL_LONG_GRASS_1C EQU $1c ; unused +DEF COLL_HEADBUTT_TREE_1D EQU $1d ; unused +DEF COLL_WATER_21 EQU $21 ; unused +DEF COLL_ICE EQU $23 +DEF COLL_WHIRLPOOL EQU $24 +DEF COLL_BUOY EQU $27 +DEF COLL_CUT_28 EQU $28 ; garbage +DEF COLL_WATER EQU $29 +DEF COLL_ICE_2B EQU $2b ; unused +DEF COLL_WHIRLPOOL_2C EQU $2c ; unused +DEF COLL_WATERFALL_RIGHT EQU $30 ; unused +DEF COLL_WATERFALL_LEFT EQU $31 ; unused +DEF COLL_WATERFALL_UP EQU $32 ; unused +DEF COLL_WATERFALL EQU $33 +DEF COLL_CURRENT_RIGHT EQU $38 ; unused +DEF COLL_CURRENT_LEFT EQU $39 ; unused +DEF COLL_CURRENT_UP EQU $3a ; unused +DEF COLL_CURRENT_DOWN EQU $3b ; unused +DEF COLL_BRAKE EQU $40 ; unused +DEF COLL_WALK_RIGHT EQU $41 ; unused +DEF COLL_WALK_LEFT EQU $42 ; unused +DEF COLL_WALK_UP EQU $43 ; unused +DEF COLL_WALK_DOWN EQU $44 ; unused +DEF COLL_BRAKE_45 EQU $45 ; garbage +DEF COLL_BRAKE_46 EQU $46 ; unused +DEF COLL_BRAKE_47 EQU $47 ; unused +DEF COLL_GRASS_48 EQU $48 ; unused +DEF COLL_GRASS_49 EQU $49 ; unused +DEF COLL_GRASS_4A EQU $4a ; garbage +DEF COLL_GRASS_4B EQU $4b ; garbage +DEF COLL_GRASS_4C EQU $4c ; unused +DEF COLL_WALK_RIGHT_ALT EQU $50 ; unused +DEF COLL_WALK_LEFT_ALT EQU $51 ; unused +DEF COLL_WALK_UP_ALT EQU $52 ; unused +DEF COLL_WALK_DOWN_ALT EQU $53 ; unused +DEF COLL_BRAKE_ALT EQU $54 ; unused +DEF COLL_BRAKE_55 EQU $55 ; unused +DEF COLL_BRAKE_56 EQU $56 ; unused +DEF COLL_BRAKE_57 EQU $57 ; unused +DEF COLL_5B EQU $5b ; garbage +DEF COLL_PIT EQU $60 +DEF COLL_VIRTUAL_BOY EQU $61 ; garbage +DEF COLL_64 EQU $64 ; garbage +DEF COLL_65 EQU $65 ; garbage +DEF COLL_PIT_68 EQU $68 ; unused +DEF COLL_WARP_CARPET_DOWN EQU $70 +DEF COLL_DOOR EQU $71 +DEF COLL_LADDER EQU $72 +DEF COLL_STAIRCASE_73 EQU $73 ; unused +DEF COLL_CAVE_74 EQU $74 ; unused +DEF COLL_DOOR_75 EQU $75 ; unused +DEF COLL_WARP_CARPET_LEFT EQU $76 +DEF COLL_WARP_77 EQU $77 ; unused +DEF COLL_WARP_CARPET_UP EQU $78 +DEF COLL_DOOR_79 EQU $79 ; unused +DEF COLL_STAIRCASE EQU $7a +DEF COLL_CAVE EQU $7b +DEF COLL_WARP_PANEL EQU $7c +DEF COLL_DOOR_7D EQU $7d ; unused +DEF COLL_WARP_CARPET_RIGHT EQU $7e +DEF COLL_WARP_7F EQU $7f ; unused +DEF COLL_COUNTER EQU $90 +DEF COLL_BOOKSHELF EQU $91 +DEF COLL_PC EQU $93 +DEF COLL_RADIO EQU $94 +DEF COLL_TOWN_MAP EQU $95 +DEF COLL_MART_SHELF EQU $96 +DEF COLL_TV EQU $97 +DEF COLL_COUNTER_98 EQU $98 ; unused +DEF COLL_9C EQU $9c ; garbage +DEF COLL_WINDOW EQU $9d +DEF COLL_INCENSE_BURNER EQU $9f +DEF COLL_HOP_RIGHT EQU $a0 +DEF COLL_HOP_LEFT EQU $a1 +DEF COLL_HOP_UP EQU $a2 ; unused +DEF COLL_HOP_DOWN EQU $a3 +DEF COLL_HOP_DOWN_RIGHT EQU $a4 +DEF COLL_HOP_DOWN_LEFT EQU $a5 +DEF COLL_HOP_UP_RIGHT EQU $a6 ; unused +DEF COLL_HOP_UP_LEFT EQU $a7 ; unused +DEF COLL_RIGHT_WALL EQU $b0 +DEF COLL_LEFT_WALL EQU $b1 +DEF COLL_UP_WALL EQU $b2 +DEF COLL_DOWN_WALL EQU $b3 ; unused +DEF COLL_DOWN_RIGHT_WALL EQU $b4 ; unused +DEF COLL_DOWN_LEFT_WALL EQU $b5 ; unused +DEF COLL_UP_RIGHT_WALL EQU $b6 ; unused +DEF COLL_UP_LEFT_WALL EQU $b7 ; unused +DEF COLL_RIGHT_BUOY EQU $c0 ; unused +DEF COLL_LEFT_BUOY EQU $c1 ; unused +DEF COLL_UP_BUOY EQU $c2 ; unused +DEF COLL_DOWN_BUOY EQU $c3 ; unused +DEF COLL_DOWN_RIGHT_BUOY EQU $c4 ; unused +DEF COLL_DOWN_LEFT_BUOY EQU $c5 ; unused +DEF COLL_UP_RIGHT_BUOY EQU $c6 ; unused +DEF COLL_UP_LEFT_BUOY EQU $c7 ; unused +DEF COLL_FF EQU $ff ; garbage ; collision data type nybbles -LO_NYBBLE_GRASS EQU $07 -HI_NYBBLE_TALL_GRASS EQU $10 -HI_NYBBLE_WATER EQU $20 -HI_NYBBLE_CURRENT EQU $30 -HI_NYBBLE_WALK EQU $40 -HI_NYBBLE_WALK_ALT EQU $50 -HI_NYBBLE_WARPS EQU $70 -HI_NYBBLE_LEDGES EQU $a0 -HI_NYBBLE_SIDE_WALLS EQU $b0 -HI_NYBBLE_SIDE_BUOYS EQU $c0 +DEF LO_NYBBLE_GRASS EQU $07 +DEF HI_NYBBLE_TALL_GRASS EQU $10 +DEF HI_NYBBLE_WATER EQU $20 +DEF HI_NYBBLE_CURRENT EQU $30 +DEF HI_NYBBLE_WALK EQU $40 +DEF HI_NYBBLE_WALK_ALT EQU $50 +DEF HI_NYBBLE_WARPS EQU $70 +DEF HI_NYBBLE_LEDGES EQU $a0 +DEF HI_NYBBLE_SIDE_WALLS EQU $b0 +DEF HI_NYBBLE_SIDE_BUOYS EQU $c0 diff --git a/pokecrystal/constants/credits_constants.asm b/pokecrystal/constants/credits_constants.asm index 7b23e11..0fed374 100644 --- a/pokecrystal/constants/credits_constants.asm +++ b/pokecrystal/constants/credits_constants.asm @@ -1,4 +1,4 @@ -; CreditsStrings indexes (see data/credits_strings.asm) +; CreditsStringsPointers indexes (see data/credits_strings.asm) const_def const SATOSHI_TAJIRI const JUNICHI_MASUDA @@ -103,13 +103,14 @@ const US_COORDINATION const TEXT_TRANSLATION const PAAD_TESTING +DEF NUM_CREDITS_STRINGS EQU const_value ; CreditsScript indexes (see data/credits_script.asm) - const_def -7 - const CREDITS_THEEND - const CREDITS_WAIT2 - const CREDITS_MUSIC - const CREDITS_CLEAR - const CREDITS_SCENE - const CREDITS_WAIT + const_def -1, -1 const CREDITS_END + const CREDITS_WAIT + const CREDITS_SCENE + const CREDITS_CLEAR + const CREDITS_MUSIC + const CREDITS_WAIT2 + const CREDITS_THEEND diff --git a/pokecrystal/constants/cry_constants.asm b/pokecrystal/constants/cry_constants.asm index 654aac5..6b5aba6 100644 --- a/pokecrystal/constants/cry_constants.asm +++ b/pokecrystal/constants/cry_constants.asm @@ -72,3 +72,5 @@ const CRY_AIPOM const CRY_DUNSPARCE const CRY_DONPHAN + +DEF NUM_CRIES EQU const_value diff --git a/pokecrystal/constants/deco_constants.asm b/pokecrystal/constants/deco_constants.asm index d180182..f877276 100644 --- a/pokecrystal/constants/deco_constants.asm +++ b/pokecrystal/constants/deco_constants.asm @@ -1,19 +1,30 @@ +; decoration attributes +rsreset +DEF DECOATTR_TYPE rb +DEF DECOATTR_NAME rb +DEF DECOATTR_ACTION rb +DEF DECOATTR_EVENT_FLAG rw +DEF DECOATTR_SPRITE rb +DEF DECOATTR_STRUCT_LENGTH EQU _RS + ; decoration types -const_value = 1 + const_def 1 const DECO_PLANT const DECO_BED const DECO_CARPET const DECO_POSTER const DECO_DOLL const DECO_BIGDOLL +DEF NUM_DECO_TYPES EQU const_value - 1 ; DecorationNames indexes (see data/decorations/names.asm) -const_value = 1 + const_def + const CANCEL_DECO const PUT_IT_AWAY const MAGNAPLANT const TROPICPLANT const JUMBOPLANT - const TOWN_MAP_D + const TOWN_MAP_POSTER const FAMICOM const SUPER_NES const NINTENDO_64 @@ -34,9 +45,10 @@ const_value = 1 const BLUE_CARPET const YELLOW_CARPET const GREEN_CARPET +DEF NUM_DECO_NAMES EQU const_value ; DoDecorationAction2.DecoActions indexes (see engine/overworld/decorations.asm) -const_value = 1 + const_def 1 const SET_UP_BED const PUT_AWAY_BED const SET_UP_CARPET @@ -51,19 +63,20 @@ const_value = 1 const PUT_AWAY_BIG_DOLL const SET_UP_DOLL const PUT_AWAY_DOLL - const SET_UP_ORNAMENT - const PUT_AWAY_ORNAMENT +DEF NUM_DECO_ACTIONS EQU const_value - 1 -deco: MACRO +DEF __deco_value__ = 0 + +MACRO deco const DECO_\1 - enum DECOFLAG_\1 + DEF DECOFLAG_\1 EQU __deco_value__ + DEF __deco_value__ += 1 ENDM ; decorations: ; - DecorationAttributes (see data/decorations/attributes.asm) ; - DecorationIDs (see data/decorations/decorations.asm) const_def 1 - enum_start ; FindOwnedBeds.beds values (see engine/overworld/decorations.asm) const BEDS deco FEATHERY_BED @@ -121,7 +134,8 @@ ENDM deco GEODUDE_DOLL deco MACHOP_DOLL deco TENTACOOL_DOLL -NUM_NON_TROPHY_DECOS EQU __enum__ +DEF NUM_NON_TROPHY_DECOS EQU __deco_value__ deco GOLD_TROPHY_DOLL deco SILVER_TROPHY_DOLL -NUM_DECOS EQU __enum__ +DEF NUM_DECOS EQU __deco_value__ +DEF NUM_DECO_CATEGORIES EQU const_value - 1 - NUM_DECOS diff --git a/pokecrystal/constants/engine_flags.asm b/pokecrystal/constants/engine_flags.asm index d6ef40b..bc029d5 100644 --- a/pokecrystal/constants/engine_flags.asm +++ b/pokecrystal/constants/engine_flags.asm @@ -1,4 +1,4 @@ -; EngineFlags indexes (see engine/engine_flags.asm) +; EngineFlags indexes (see data/events/engine_flags.asm) const_def ; wPokegearFlags const ENGINE_RADIO_CARD @@ -15,14 +15,14 @@ const ENGINE_MOM_SAVING_MONEY const ENGINE_MOM_ACTIVE ; wUnusedTwoDayTimerOn - const ENGINE_0A + const ENGINE_UNUSED_TWO_DAY_TIMER_ON ; wStatusFlags const ENGINE_POKEDEX const ENGINE_UNOWN_DEX const ENGINE_CAUGHT_POKERUS const ENGINE_ROCKET_SIGNAL_ON_CH20 const ENGINE_CREDITS_SKIP - const ENGINE_MAIN_MENU_MOBILE_CHOICES ; 10 + const ENGINE_MAIN_MENU_MOBILE_CHOICES ; wStatusFlags2 const ENGINE_BUG_CONTEST_TIMER const ENGINE_SAFARI_ZONE @@ -41,7 +41,7 @@ const ENGINE_PLAINBADGE const ENGINE_FOGBADGE const ENGINE_MINERALBADGE - const ENGINE_STORMBADGE ; 20 + const ENGINE_STORMBADGE const ENGINE_GLACIERBADGE const ENGINE_RISINGBADGE ; wKantoBadges @@ -59,12 +59,12 @@ const ENGINE_UNLOCKED_UNOWNS_S_TO_W const ENGINE_UNLOCKED_UNOWNS_X_TO_Z const ENGINE_UNLOCKED_UNOWNS_UNUSED_4 - const ENGINE_UNLOCKED_UNOWNS_UNUSED_5 ; 30 + const ENGINE_UNLOCKED_UNOWNS_UNUSED_5 const ENGINE_UNLOCKED_UNOWNS_UNUSED_6 const ENGINE_UNLOCKED_UNOWNS_UNUSED_7 ; wVisitedSpawns const ENGINE_FLYPOINT_PLAYERS_HOUSE - const ENGINE_FLYPOINT_VIRIDIAN_POKECENTER + const ENGINE_FLYPOINT_DEBUG const ENGINE_FLYPOINT_PALLET const ENGINE_FLYPOINT_VIRIDIAN const ENGINE_FLYPOINT_PEWTER @@ -76,7 +76,7 @@ const ENGINE_FLYPOINT_CELADON const ENGINE_FLYPOINT_FUCHSIA const ENGINE_FLYPOINT_CINNABAR - const ENGINE_FLYPOINT_INDIGO_PLATEAU ; 40 + const ENGINE_FLYPOINT_INDIGO_PLATEAU const ENGINE_FLYPOINT_NEW_BARK const ENGINE_FLYPOINT_CHERRYGROVE const ENGINE_FLYPOINT_VIOLET @@ -95,9 +95,9 @@ ; wStatusFlags2 const ENGINE_4F ; wDailyFlags1 - const ENGINE_KURT_MAKING_BALLS ; 50 + const ENGINE_KURT_MAKING_BALLS const ENGINE_DAILY_BUG_CONTEST - const ENGINE_FISH_SWARM + const ENGINE_QWILFISH_SWARM const ENGINE_TIME_CAPSULE const ENGINE_ALL_FRUIT_TREES const ENGINE_GOT_SHUCKIE_TODAY @@ -113,44 +113,44 @@ const ENGINE_DAILY_MOVE_TUTOR const ENGINE_BUENAS_PASSWORD ; wSwarmFlags - const ENGINE_BUENAS_PASSWORD_2 ; 60 + const ENGINE_BUENAS_PASSWORD_2 const ENGINE_GOLDENROD_DEPT_STORE_SALE_IS_ON -; wGameTimerPause +; wGameTimerPaused const ENGINE_62 ; wPlayerGender const ENGINE_PLAYER_IS_FEMALE ; wCelebiEvent const ENGINE_FOREST_IS_RESTLESS ; wDailyRematchFlags - const ENGINE_JACK - const ENGINE_HUEY - const ENGINE_GAVEN - const ENGINE_BETH - const ENGINE_JOSE - const ENGINE_REENA - const ENGINE_JOEY - const ENGINE_WADE - const ENGINE_RALPH - const ENGINE_LIZ - const ENGINE_ANTHONY - const ENGINE_TODD ; 70 - const ENGINE_GINA - const ENGINE_ARNIE - const ENGINE_ALAN - const ENGINE_DANA - const ENGINE_CHAD - const ENGINE_TULLY - const ENGINE_BRENT - const ENGINE_TIFFANY - const ENGINE_VANCE - const ENGINE_WILTON - const ENGINE_PARRY - const ENGINE_ERIN + const ENGINE_JACK_READY_FOR_REMATCH + const ENGINE_HUEY_READY_FOR_REMATCH + const ENGINE_GAVEN_READY_FOR_REMATCH + const ENGINE_BETH_READY_FOR_REMATCH + const ENGINE_JOSE_READY_FOR_REMATCH + const ENGINE_REENA_READY_FOR_REMATCH + const ENGINE_JOEY_READY_FOR_REMATCH + const ENGINE_WADE_READY_FOR_REMATCH + const ENGINE_RALPH_READY_FOR_REMATCH + const ENGINE_LIZ_READY_FOR_REMATCH + const ENGINE_ANTHONY_READY_FOR_REMATCH + const ENGINE_TODD_READY_FOR_REMATCH + const ENGINE_GINA_READY_FOR_REMATCH + const ENGINE_ARNIE_READY_FOR_REMATCH + const ENGINE_ALAN_READY_FOR_REMATCH + const ENGINE_DANA_READY_FOR_REMATCH + const ENGINE_CHAD_READY_FOR_REMATCH + const ENGINE_TULLY_READY_FOR_REMATCH + const ENGINE_BRENT_READY_FOR_REMATCH + const ENGINE_TIFFANY_READY_FOR_REMATCH + const ENGINE_VANCE_READY_FOR_REMATCH + const ENGINE_WILTON_READY_FOR_REMATCH + const ENGINE_PARRY_READY_FOR_REMATCH + const ENGINE_ERIN_READY_FOR_REMATCH ; wDailyPhoneItemFlags const ENGINE_BEVERLY_HAS_NUGGET const ENGINE_JOSE_HAS_STAR_PIECE const ENGINE_WADE_HAS_ITEM - const ENGINE_GINA_HAS_LEAF_STONE ; 80 + const ENGINE_GINA_HAS_LEAF_STONE const ENGINE_ALAN_HAS_FIRE_STONE const ENGINE_DANA_HAS_THUNDERSTONE const ENGINE_DEREK_HAS_NUGGET @@ -167,7 +167,7 @@ const ENGINE_JOEY_MONDAY_AFTERNOON const ENGINE_WADE_TUESDAY_NIGHT const ENGINE_RALPH_WEDNESDAY_MORNING - const ENGINE_LIZ_THURSDAY_AFTERNOON ; 90 + const ENGINE_LIZ_THURSDAY_AFTERNOON const ENGINE_ANTHONY_FRIDAY_NIGHT const ENGINE_TODD_SATURDAY_MORNING const ENGINE_GINA_SUNDAY_AFTERNOON @@ -185,6 +185,6 @@ ; wPlayerSpriteSetupFlags const ENGINE_KRIS_IN_CABLE_CLUB ; wSwarmFlags - const ENGINE_DUNSPARCE_SWARM ; a0 + const ENGINE_DUNSPARCE_SWARM const ENGINE_YANMA_SWARM -NUM_ENGINE_FLAGS EQU const_value +DEF NUM_ENGINE_FLAGS EQU const_value diff --git a/pokecrystal/constants/event_flags.asm b/pokecrystal/constants/event_flags.asm index c15e82d..cba3b54 100644 --- a/pokecrystal/constants/event_flags.asm +++ b/pokecrystal/constants/event_flags.asm @@ -1,7 +1,8 @@ ; wEventFlags bit flags + const_def ; The first eight flags are reset upon reloading the map - const EVENT_TEMPORARY_UNTIL_MAP_RELOAD_1 ; 000 + const EVENT_TEMPORARY_UNTIL_MAP_RELOAD_1 const EVENT_TEMPORARY_UNTIL_MAP_RELOAD_2 const EVENT_TEMPORARY_UNTIL_MAP_RELOAD_3 const EVENT_TEMPORARY_UNTIL_MAP_RELOAD_4 @@ -25,7 +26,7 @@ const EVENT_GOT_HM04_STRENGTH const EVENT_GOT_HM05_FLASH const EVENT_GOT_HM06_WHIRLPOOL - const EVENT_016 + const_skip ; unused ; Rods const EVENT_GOT_OLD_ROD const EVENT_GOT_GOOD_ROD @@ -64,12 +65,12 @@ const EVENT_LAKE_OF_RAGE_EXPLAINED_WEIRD_MAGIKARP const EVENT_LAKE_OF_RAGE_ASKED_FOR_MAGIKARP const EVENT_LAKE_OF_RAGE_ELIXIR_ON_STANDBY - const EVENT_03B - const EVENT_03C + const_skip ; unused + const_skip ; unused const EVENT_HEALED_MOOMOO const EVENT_GOT_TM13_SNORE_FROM_MOOMOO_FARM const EVENT_TALKED_TO_FARMER_ABOUT_MOOMOO - const EVENT_TALKED_TO_MOM_AFTER_MYSTERY_EGG_QUEST ; 040 + const EVENT_TALKED_TO_MOM_AFTER_MYSTERY_EGG_QUEST const EVENT_DUDE_TALKED_TO_YOU const EVENT_LEARNED_TO_CATCH_POKEMON const EVENT_ELM_CALLED_ABOUT_STOLEN_POKEMON @@ -85,7 +86,7 @@ const EVENT_GOT_MYSTIC_WATER_IN_CHERRYGROVE const EVENT_GOT_TM05_ROAR const EVENT_GOT_EEVEE - const EVENT_GOT_KENYA ; 050 + const EVENT_GOT_KENYA const EVENT_GAVE_KENYA const EVENT_GOT_HP_UP_FROM_RANDY const EVENT_GOT_TM50_NIGHTMARE @@ -101,7 +102,7 @@ const EVENT_GOT_MIRACLE_SEED_IN_ROUTE_32 const EVENT_GOT_CHARCOAL_IN_CHARCOAL_KILN const EVENT_GOT_TM02_HEADBUTT - const EVENT_DECIDED_TO_HELP_LANCE ; 060 + const EVENT_DECIDED_TO_HELP_LANCE const EVENT_GOT_TYROGUE_FROM_KIYO const EVENT_MET_FRIEDA_OF_FRIDAY const EVENT_GOT_POISON_BARB_FROM_FRIEDA @@ -116,7 +117,7 @@ const EVENT_MET_SANTOS_OF_SATURDAY const EVENT_GOT_SPELL_TAG_FROM_SANTOS const EVENT_MET_MONICA_OF_MONDAY - const EVENT_GOT_SHARP_BEAK_FROM_MONICA ; 070 + const EVENT_GOT_SHARP_BEAK_FROM_MONICA const EVENT_GOT_SOFT_SAND_FROM_KATE const EVENT_GOT_METAL_COAT_FROM_GRANDPA_ON_SS_AQUA const EVENT_GOT_BLACKGLASSES_IN_DARK_CAVE @@ -134,10 +135,10 @@ const EVENT_TIN_TOWER_4F_HIDDEN_MAX_POTION const EVENT_TIN_TOWER_5F_HIDDEN_FULL_RESTORE const EVENT_TIN_TOWER_5F_HIDDEN_CARBOS - const EVENT_BURNED_TOWER_1F_HIDDEN_ETHER ; 080 - const EVENT_081 - const EVENT_082 - const EVENT_083 + const EVENT_BURNED_TOWER_1F_HIDDEN_ETHER + const_skip ; unused in Crystal + const_skip ; unused in Crystal + const_skip ; unused in Crystal const EVENT_NATIONAL_PARK_HIDDEN_FULL_HEAL const EVENT_OLIVINE_LIGHTHOUSE_5F_HIDDEN_HYPER_POTION const EVENT_TEAM_ROCKET_BASE_B1F_HIDDEN_REVIVE @@ -201,12 +202,9 @@ const EVENT_GAVE_GS_BALL_TO_KURT const EVENT_FOREST_IS_RESTLESS const EVENT_ANSWERED_DRAGON_MASTER_QUIZ_WRONG - const EVENT_0C2 - const EVENT_0C3 - const EVENT_0C4 - const EVENT_0C5 - const EVENT_0C6 - const EVENT_0C7 +; Unused: next 6 events + + const_next 200 ; Kanto story events const EVENT_GOT_NUGGET_FROM_GUY const EVENT_RETURNED_MACHINE_PART @@ -221,7 +219,7 @@ const EVENT_GOT_LOST_ITEM_FROM_FAN_CLUB const EVENT_LISTENED_TO_FAN_CLUB_PRESIDENT_BUT_BAG_WAS_FULL const EVENT_LISTENED_TO_FAN_CLUB_PRESIDENT - const EVENT_TALKED_TO_SEAFOAM_GYM_GUY_ONCE + const EVENT_TALKED_TO_SEAFOAM_GYM_GUIDE_ONCE const EVENT_ENABLE_DIPLOMA_PRINTING const EVENT_CINNABAR_ROCKS_CLEARED const EVENT_CLEARED_NUGGET_BRIDGE @@ -270,346 +268,9 @@ const EVENT_DANA_GAVE_THUNDERSTONE const EVENT_TULLY_GAVE_WATER_STONE const EVENT_TIFFANY_GAVE_PINK_BOW -; ??? - const EVENT_105 - const EVENT_106 - const EVENT_107 - const EVENT_108 - const EVENT_109 - const EVENT_10A - const EVENT_10B - const EVENT_10C - const EVENT_10D - const EVENT_10E - const EVENT_10F - const EVENT_110 - const EVENT_111 - const EVENT_112 - const EVENT_113 - const EVENT_114 - const EVENT_115 - const EVENT_116 - const EVENT_117 - const EVENT_118 - const EVENT_119 - const EVENT_11A - const EVENT_11B - const EVENT_11C - const EVENT_11D - const EVENT_11E - const EVENT_11F - const EVENT_120 - const EVENT_121 - const EVENT_122 - const EVENT_123 - const EVENT_124 - const EVENT_125 - const EVENT_126 - const EVENT_127 - const EVENT_128 - const EVENT_129 - const EVENT_12A - const EVENT_12B - const EVENT_12C - const EVENT_12D - const EVENT_12E - const EVENT_12F - const EVENT_130 - const EVENT_131 - const EVENT_132 - const EVENT_133 - const EVENT_134 - const EVENT_135 - const EVENT_136 - const EVENT_137 - const EVENT_138 - const EVENT_139 - const EVENT_13A - const EVENT_13B - const EVENT_13C - const EVENT_13D - const EVENT_13E - const EVENT_13F - const EVENT_140 - const EVENT_141 - const EVENT_142 - const EVENT_143 - const EVENT_144 - const EVENT_145 - const EVENT_146 - const EVENT_147 - const EVENT_148 - const EVENT_149 - const EVENT_14A - const EVENT_14B - const EVENT_14C - const EVENT_14D - const EVENT_14E - const EVENT_14F - const EVENT_150 - const EVENT_151 - const EVENT_152 - const EVENT_153 - const EVENT_154 - const EVENT_155 - const EVENT_156 - const EVENT_157 - const EVENT_158 - const EVENT_159 - const EVENT_15A - const EVENT_15B - const EVENT_15C - const EVENT_15D - const EVENT_15E - const EVENT_15F - const EVENT_160 - const EVENT_161 - const EVENT_162 - const EVENT_163 - const EVENT_164 - const EVENT_165 - const EVENT_166 - const EVENT_167 - const EVENT_168 - const EVENT_169 - const EVENT_16A - const EVENT_16B - const EVENT_16C - const EVENT_16D - const EVENT_16E - const EVENT_16F - const EVENT_170 - const EVENT_171 - const EVENT_172 - const EVENT_173 - const EVENT_174 - const EVENT_175 - const EVENT_176 - const EVENT_177 - const EVENT_178 - const EVENT_179 - const EVENT_17A - const EVENT_17B - const EVENT_17C - const EVENT_17D - const EVENT_17E - const EVENT_17F - const EVENT_180 - const EVENT_181 - const EVENT_182 - const EVENT_183 - const EVENT_184 - const EVENT_185 - const EVENT_186 - const EVENT_187 - const EVENT_188 - const EVENT_189 - const EVENT_18A - const EVENT_18B - const EVENT_18C - const EVENT_18D - const EVENT_18E - const EVENT_18F - const EVENT_190 - const EVENT_191 - const EVENT_192 - const EVENT_193 - const EVENT_194 - const EVENT_195 - const EVENT_196 - const EVENT_197 - const EVENT_198 - const EVENT_199 - const EVENT_19A - const EVENT_19B - const EVENT_19C - const EVENT_19D - const EVENT_19E - const EVENT_19F - const EVENT_1A0 - const EVENT_1A1 - const EVENT_1A2 - const EVENT_1A3 - const EVENT_1A4 - const EVENT_1A5 - const EVENT_1A6 - const EVENT_1A7 - const EVENT_1A8 - const EVENT_1A9 - const EVENT_1AA - const EVENT_1AB - const EVENT_1AC - const EVENT_1AD - const EVENT_1AE - const EVENT_1AF - const EVENT_1B0 - const EVENT_1B1 - const EVENT_1B2 - const EVENT_1B3 - const EVENT_1B4 - const EVENT_1B5 - const EVENT_1B6 - const EVENT_1B7 - const EVENT_1B8 - const EVENT_1B9 - const EVENT_1BA - const EVENT_1BB - const EVENT_1BC - const EVENT_1BD - const EVENT_1BE - const EVENT_1BF - const EVENT_1C0 - const EVENT_1C1 - const EVENT_1C2 - const EVENT_1C3 - const EVENT_1C4 - const EVENT_1C5 - const EVENT_1C6 - const EVENT_1C7 - const EVENT_1C8 - const EVENT_1C9 - const EVENT_1CA - const EVENT_1CB - const EVENT_1CC - const EVENT_1CD - const EVENT_1CE - const EVENT_1CF - const EVENT_1D0 - const EVENT_1D1 - const EVENT_1D2 - const EVENT_1D3 - const EVENT_1D4 - const EVENT_1D5 - const EVENT_1D6 - const EVENT_1D7 - const EVENT_1D8 - const EVENT_1D9 - const EVENT_1DA - const EVENT_1DB - const EVENT_1DC - const EVENT_1DD - const EVENT_1DE - const EVENT_1DF - const EVENT_1E0 - const EVENT_1E1 - const EVENT_1E2 - const EVENT_1E3 - const EVENT_1E4 - const EVENT_1E5 - const EVENT_1E6 - const EVENT_1E7 - const EVENT_1E8 - const EVENT_1E9 - const EVENT_1EA - const EVENT_1EB - const EVENT_1EC - const EVENT_1ED - const EVENT_1EE - const EVENT_1EF - const EVENT_1F0 - const EVENT_1F1 - const EVENT_1F2 - const EVENT_1F3 - const EVENT_1F4 - const EVENT_1F5 - const EVENT_1F6 - const EVENT_1F7 - const EVENT_1F8 - const EVENT_1F9 - const EVENT_1FA - const EVENT_1FB - const EVENT_1FC - const EVENT_1FD - const EVENT_1FE - const EVENT_1FF - const EVENT_200 - const EVENT_201 - const EVENT_202 - const EVENT_203 - const EVENT_204 - const EVENT_205 - const EVENT_206 - const EVENT_207 - const EVENT_208 - const EVENT_209 - const EVENT_20A - const EVENT_20B - const EVENT_20C - const EVENT_20D - const EVENT_20E - const EVENT_20F - const EVENT_210 - const EVENT_211 - const EVENT_212 - const EVENT_213 - const EVENT_214 - const EVENT_215 - const EVENT_216 - const EVENT_217 - const EVENT_218 - const EVENT_219 - const EVENT_21A - const EVENT_21B - const EVENT_21C - const EVENT_21D - const EVENT_21E - const EVENT_21F - const EVENT_220 - const EVENT_221 - const EVENT_222 - const EVENT_223 - const EVENT_224 - const EVENT_225 - const EVENT_226 - const EVENT_227 - const EVENT_228 - const EVENT_229 - const EVENT_22A - const EVENT_22B - const EVENT_22C - const EVENT_22D - const EVENT_22E - const EVENT_22F - const EVENT_230 - const EVENT_231 - const EVENT_232 - const EVENT_233 - const EVENT_234 - const EVENT_235 - const EVENT_236 - const EVENT_237 - const EVENT_238 - const EVENT_239 - const EVENT_23A - const EVENT_23B - const EVENT_23C - const EVENT_23D - const EVENT_23E - const EVENT_23F - const EVENT_240 - const EVENT_241 - const EVENT_242 - const EVENT_243 - const EVENT_244 - const EVENT_245 - const EVENT_246 - const EVENT_247 - const EVENT_248 - const EVENT_249 - const EVENT_24A - const EVENT_24B - const EVENT_24C - const EVENT_24D - const EVENT_24E - const EVENT_24F - const EVENT_250 - const EVENT_251 - const EVENT_252 - const EVENT_253 - const EVENT_254 - const EVENT_255 - const EVENT_256 - const EVENT_257 +; Unused: next 339 events + + const_next 600 ; Kurt Apricorn events const EVENT_GAVE_KURT_RED_APRICORN const EVENT_GAVE_KURT_BLU_APRICORN @@ -620,11 +281,11 @@ const EVENT_GAVE_KURT_PNK_APRICORN ; Phone events const EVENT_JACK_ASKED_FOR_PHONE_NUMBER - const EVENT_260 + const_skip ; unused in Crystal const EVENT_BEVERLY_ASKED_FOR_PHONE_NUMBER - const EVENT_262 + const_skip ; unused in Crystal const EVENT_HUEY_ASKED_FOR_PHONE_NUMBER - const EVENT_264 + const_skip ; unused in Crystal const EVENT_GOT_PROTEIN_FROM_HUEY const EVENT_GOT_HP_UP_FROM_JOEY const EVENT_GOT_CARBOS_FROM_VANCE @@ -632,60 +293,60 @@ const EVENT_GOT_CALCIUM_FROM_ERIN const EVENT_KENJI_ON_BREAK const EVENT_GAVEN_ASKED_FOR_PHONE_NUMBER - const EVENT_26C + const_skip ; unused in Crystal const EVENT_BETH_ASKED_FOR_PHONE_NUMBER - const EVENT_26E + const_skip ; unused in Crystal const EVENT_JOSE_ASKED_FOR_PHONE_NUMBER - const EVENT_270 + const_skip ; unused in Crystal const EVENT_REENA_ASKED_FOR_PHONE_NUMBER - const EVENT_272 + const_skip ; unused in Crystal const EVENT_JOEY_ASKED_FOR_PHONE_NUMBER - const EVENT_274 + const_skip ; unused in Crystal const EVENT_WADE_ASKED_FOR_PHONE_NUMBER - const EVENT_276 + const_skip ; unused in Crystal const EVENT_RALPH_ASKED_FOR_PHONE_NUMBER - const EVENT_278 + const_skip ; unused in Crystal const EVENT_LIZ_ASKED_FOR_PHONE_NUMBER - const EVENT_27A + const_skip ; unused in Crystal const EVENT_ANTHONY_ASKED_FOR_PHONE_NUMBER - const EVENT_27C + const_skip ; unused in Crystal const EVENT_TODD_ASKED_FOR_PHONE_NUMBER - const EVENT_27E + const_skip ; unused in Crystal const EVENT_GINA_ASKED_FOR_PHONE_NUMBER - const EVENT_280 ; 280 + const_skip ; unused in Crystal const EVENT_IRWIN_ASKED_FOR_PHONE_NUMBER - const EVENT_282 + const_skip ; unused in Crystal const EVENT_ARNIE_ASKED_FOR_PHONE_NUMBER - const EVENT_284 + const_skip ; unused in Crystal const EVENT_ALAN_ASKED_FOR_PHONE_NUMBER - const EVENT_286 - const EVENT_287 - const EVENT_288 + const_skip ; unused in Crystal + const_skip ; unused + const_skip ; unused const EVENT_DANA_ASKED_FOR_PHONE_NUMBER - const EVENT_28A + const_skip ; unused in Crystal const EVENT_CHAD_ASKED_FOR_PHONE_NUMBER - const EVENT_28C + const_skip ; unused in Crystal const EVENT_DEREK_ASKED_FOR_PHONE_NUMBER - const EVENT_28E + const_skip ; unused in Crystal const EVENT_TULLY_ASKED_FOR_PHONE_NUMBER - const EVENT_290 ; 290 + const_skip ; unused in Crystal const EVENT_BRENT_ASKED_FOR_PHONE_NUMBER - const EVENT_292 + const_skip ; unused const EVENT_TIFFANY_ASKED_FOR_PHONE_NUMBER - const EVENT_294 + const_skip ; unused in Crystal const EVENT_VANCE_ASKED_FOR_PHONE_NUMBER - const EVENT_296 + const_skip ; unused in Crystal const EVENT_WILTON_ASKED_FOR_PHONE_NUMBER - const EVENT_298 + const_skip ; unused in Crystal const EVENT_KENJI_ASKED_FOR_PHONE_NUMBER - const EVENT_29A + const_skip ; unused in Crystal const EVENT_PARRY_ASKED_FOR_PHONE_NUMBER - const EVENT_29C + const_skip ; unused in Crystal const EVENT_ERIN_ASKED_FOR_PHONE_NUMBER const EVENT_BUENA_OFFERED_HER_PHONE_NUMBER_NO_BLUE_CARD - const EVENT_29F + const_skip ; unused ; Ruins of Alph puzzles - const EVENT_SOLVED_HO_OH_PUZZLE ; 2a0 + const EVENT_SOLVED_HO_OH_PUZZLE const EVENT_SOLVED_KABUTO_PUZZLE const EVENT_SOLVED_OMANYTE_PUZZLE const EVENT_SOLVED_AERODACTYL_PUZZLE @@ -701,10 +362,10 @@ const EVENT_DECO_PLANT_1 const EVENT_DECO_PLANT_2 const EVENT_DECO_PLANT_3 - const EVENT_DECO_PLANT_4 - const EVENT_DECO_POSTER_1 ; 2b0 + const EVENT_DECO_POSTER_1 const EVENT_DECO_POSTER_2 const EVENT_DECO_POSTER_3 + const EVENT_DECO_POSTER_4 const EVENT_DECO_FAMICOM const EVENT_DECO_SNES const EVENT_DECO_N64 @@ -718,7 +379,7 @@ const EVENT_DECO_SQUIRTLE_DOLL const EVENT_DECO_POLIWAG_DOLL const EVENT_DECO_DIGLETT_DOLL - const EVENT_DECO_STARMIE_DOLL ; 2c0 + const EVENT_DECO_STARMIE_DOLL const EVENT_DECO_MAGIKARP_DOLL const EVENT_DECO_ODDISH_DOLL const EVENT_DECO_GENGAR_DOLL @@ -734,7 +395,7 @@ const EVENT_DECO_GOLD_TROPHY const EVENT_DECO_SILVER_TROPHY const EVENT_DECO_BIG_SNORLAX_DOLL - const EVENT_DECO_BIG_ONIX_DOLL ; 2d0 + const EVENT_DECO_BIG_ONIX_DOLL const EVENT_DECO_BIG_LAPRAS_DOLL ; More Johto story events const EVENT_WARPED_FROM_ROUTE_35_NATIONAL_PARK_GATE @@ -751,7 +412,7 @@ const EVENT_SWITCH_10 const EVENT_SWITCH_11 const EVENT_SWITCH_12 - const EVENT_SWITCH_13 ; 2e0 + const EVENT_SWITCH_13 const EVENT_SWITCH_14 const EVENT_UNCOVERED_STAIRCASE_IN_MAHOGANY_MART const EVENT_TURNED_OFF_SECURITY_CAMERAS @@ -767,7 +428,7 @@ const EVENT_EXPLODING_TRAP_5 const EVENT_EXPLODING_TRAP_6 const EVENT_EXPLODING_TRAP_7 - const EVENT_EXPLODING_TRAP_8 ; 2f0 + const EVENT_EXPLODING_TRAP_8 const EVENT_EXPLODING_TRAP_9 const EVENT_EXPLODING_TRAP_10 const EVENT_EXPLODING_TRAP_11 @@ -783,7 +444,7 @@ const EVENT_EXPLODING_TRAP_21 const EVENT_EXPLODING_TRAP_22 const EVENT_LEARNED_HAIL_GIOVANNI - const EVENT_OPENED_DOOR_TO_ROCKET_HIDEOUT_TRANSMITTER ; 300 + const EVENT_OPENED_DOOR_TO_ROCKET_HIDEOUT_TRANSMITTER const EVENT_LEARNED_SLOWPOKETAIL const EVENT_LEARNED_RATICATE_TAIL const EVENT_OPENED_DOOR_TO_GIOVANNIS_OFFICE @@ -799,7 +460,7 @@ const EVENT_BRUNOS_ROOM_ENTRANCE_CLOSED const EVENT_BRUNOS_ROOM_EXIT_OPEN const EVENT_KARENS_ROOM_ENTRANCE_CLOSED - const EVENT_KARENS_ROOM_EXIT_OPEN ; 310 + const EVENT_KARENS_ROOM_EXIT_OPEN const EVENT_LANCES_ROOM_ENTRANCE_CLOSED const EVENT_LANCES_ROOM_EXIT_OPEN const EVENT_CONTEST_OFFICER_HAS_SUN_STONE @@ -815,7 +476,7 @@ const EVENT_SHOWED_STARYU_TO_BILLS_GRANDPA const EVENT_SHOWED_GROWLITHE_VULPIX_TO_BILLS_GRANDPA const EVENT_SHOWED_PICHU_TO_BILLS_GRANDPA - const EVENT_GOT_EVERSTONE_FROM_BILLS_GRANDPA ; 320 + const EVENT_GOT_EVERSTONE_FROM_BILLS_GRANDPA const EVENT_GOT_LEAF_STONE_FROM_BILLS_GRANDPA const EVENT_GOT_WATER_STONE_FROM_BILLS_GRANDPA const EVENT_GOT_FIRE_STONE_FROM_BILLS_GRANDPA @@ -849,174 +510,9 @@ const EVENT_GOT_ODD_EGG const EVENT_33F const EVENT_GOT_GS_BALL_FROM_POKECOM_CENTER -; ??? - const EVENT_341 - const EVENT_342 - const EVENT_343 - const EVENT_344 - const EVENT_345 - const EVENT_346 - const EVENT_347 - const EVENT_348 - const EVENT_349 - const EVENT_34A - const EVENT_34B - const EVENT_34C - const EVENT_34D - const EVENT_34E - const EVENT_34F - const EVENT_350 - const EVENT_351 - const EVENT_352 - const EVENT_353 - const EVENT_354 - const EVENT_355 - const EVENT_356 - const EVENT_357 - const EVENT_358 - const EVENT_359 - const EVENT_35A - const EVENT_35B - const EVENT_35C - const EVENT_35D - const EVENT_35E - const EVENT_35F - const EVENT_360 - const EVENT_361 - const EVENT_362 - const EVENT_363 - const EVENT_364 - const EVENT_365 - const EVENT_366 - const EVENT_367 - const EVENT_368 - const EVENT_369 - const EVENT_36A - const EVENT_36B - const EVENT_36C - const EVENT_36D - const EVENT_36E - const EVENT_36F - const EVENT_370 - const EVENT_371 - const EVENT_372 - const EVENT_373 - const EVENT_374 - const EVENT_375 - const EVENT_376 - const EVENT_377 - const EVENT_378 - const EVENT_379 - const EVENT_37A - const EVENT_37B - const EVENT_37C - const EVENT_37D - const EVENT_37E - const EVENT_37F - const EVENT_380 - const EVENT_381 - const EVENT_382 - const EVENT_383 - const EVENT_384 - const EVENT_385 - const EVENT_386 - const EVENT_387 - const EVENT_388 - const EVENT_389 - const EVENT_38A - const EVENT_38B - const EVENT_38C - const EVENT_38D - const EVENT_38E - const EVENT_38F - const EVENT_390 - const EVENT_391 - const EVENT_392 - const EVENT_393 - const EVENT_394 - const EVENT_395 - const EVENT_396 - const EVENT_397 - const EVENT_398 - const EVENT_399 - const EVENT_39A - const EVENT_39B - const EVENT_39C - const EVENT_39D - const EVENT_39E - const EVENT_39F - const EVENT_3A0 - const EVENT_3A1 - const EVENT_3A2 - const EVENT_3A3 - const EVENT_3A4 - const EVENT_3A5 - const EVENT_3A6 - const EVENT_3A7 - const EVENT_3A8 - const EVENT_3A9 - const EVENT_3AA - const EVENT_3AB - const EVENT_3AC - const EVENT_3AD - const EVENT_3AE - const EVENT_3AF - const EVENT_3B0 - const EVENT_3B1 - const EVENT_3B2 - const EVENT_3B3 - const EVENT_3B4 - const EVENT_3B5 - const EVENT_3B6 - const EVENT_3B7 - const EVENT_3B8 - const EVENT_3B9 - const EVENT_3BA - const EVENT_3BB - const EVENT_3BC - const EVENT_3BD - const EVENT_3BE - const EVENT_3BF - const EVENT_3C0 - const EVENT_3C1 - const EVENT_3C2 - const EVENT_3C3 - const EVENT_3C4 - const EVENT_3C5 - const EVENT_3C6 - const EVENT_3C7 - const EVENT_3C8 - const EVENT_3C9 - const EVENT_3CA - const EVENT_3CB - const EVENT_3CC - const EVENT_3CD - const EVENT_3CE - const EVENT_3CF - const EVENT_3D0 - const EVENT_3D1 - const EVENT_3D2 - const EVENT_3D3 - const EVENT_3D4 - const EVENT_3D5 - const EVENT_3D6 - const EVENT_3D7 - const EVENT_3D8 - const EVENT_3D9 - const EVENT_3DA - const EVENT_3DB - const EVENT_3DC - const EVENT_3DD - const EVENT_3DE - const EVENT_3DF - const EVENT_3E0 - const EVENT_3E1 - const EVENT_3E2 - const EVENT_3E3 - const EVENT_3E4 - const EVENT_3E5 - const EVENT_3E6 - const EVENT_3E7 +; Unused: next 167 events + + const_next 1000 ; Trainer flags ; Swimmer F const EVENT_BEAT_SWIMMERF_ELAINE @@ -1096,8 +592,7 @@ const EVENT_BEAT_BURGLAR_DUNCAN const EVENT_BEAT_BURGLAR_EDDIE const EVENT_BEAT_BURGLAR_COREY -; Unknown - const EVENT_430 + const_skip ; unused ; Biker const EVENT_BEAT_BIKER_BENNY const EVENT_BEAT_BIKER_KAZU @@ -1288,9 +783,8 @@ const EVENT_BEAT_POKEFANF_BEVERLY2 const EVENT_BEAT_POKEFANF_BEVERLY3 const EVENT_BEAT_POKEFANF_GEORGIA -; Unknown - const EVENT_4DE ; Kimono Girl + const_skip ; unused const EVENT_BEAT_KIMONO_GIRL_NAOKO const EVENT_BEAT_KIMONO_GIRL_SAYO const EVENT_BEAT_KIMONO_GIRL_ZUKI @@ -1548,123 +1042,9 @@ const EVENT_BEAT_SAGE_GAKU const EVENT_BEAT_SAGE_MASA const EVENT_BEAT_SAGE_KOJI -; ??? - const EVENT_5CC - const EVENT_5CD - const EVENT_5CE - const EVENT_5CF - const EVENT_5D0 - const EVENT_5D1 - const EVENT_5D2 - const EVENT_5D3 - const EVENT_5D4 - const EVENT_5D5 - const EVENT_5D6 - const EVENT_5D7 - const EVENT_5D8 - const EVENT_5D9 - const EVENT_5DA - const EVENT_5DB - const EVENT_5DC - const EVENT_5DD - const EVENT_5DE - const EVENT_5DF - const EVENT_5E0 - const EVENT_5E1 - const EVENT_5E2 - const EVENT_5E3 - const EVENT_5E4 - const EVENT_5E5 - const EVENT_5E6 - const EVENT_5E7 - const EVENT_5E8 - const EVENT_5E9 - const EVENT_5EA - const EVENT_5EB - const EVENT_5EC - const EVENT_5ED - const EVENT_5EE - const EVENT_5EF - const EVENT_5F0 - const EVENT_5F1 - const EVENT_5F2 - const EVENT_5F3 - const EVENT_5F4 - const EVENT_5F5 - const EVENT_5F6 - const EVENT_5F7 - const EVENT_5F8 - const EVENT_5F9 - const EVENT_5FA - const EVENT_5FB - const EVENT_5FC - const EVENT_5FD - const EVENT_5FE - const EVENT_5FF - const EVENT_600 - const EVENT_601 - const EVENT_602 - const EVENT_603 - const EVENT_604 - const EVENT_605 - const EVENT_606 - const EVENT_607 - const EVENT_608 - const EVENT_609 - const EVENT_60A - const EVENT_60B - const EVENT_60C - const EVENT_60D - const EVENT_60E - const EVENT_60F - const EVENT_610 - const EVENT_611 - const EVENT_612 - const EVENT_613 - const EVENT_614 - const EVENT_615 - const EVENT_616 - const EVENT_617 - const EVENT_618 - const EVENT_619 - const EVENT_61A - const EVENT_61B - const EVENT_61C - const EVENT_61D - const EVENT_61E - const EVENT_61F - const EVENT_620 - const EVENT_621 - const EVENT_622 - const EVENT_623 - const EVENT_624 - const EVENT_625 - const EVENT_626 - const EVENT_627 - const EVENT_628 - const EVENT_629 - const EVENT_62A - const EVENT_62B - const EVENT_62C - const EVENT_62D - const EVENT_62E - const EVENT_62F - const EVENT_630 - const EVENT_631 - const EVENT_632 - const EVENT_633 - const EVENT_634 - const EVENT_635 - const EVENT_636 - const EVENT_637 - const EVENT_638 - const EVENT_639 - const EVENT_63A - const EVENT_63B - const EVENT_63C - const EVENT_63D - const EVENT_63E - const EVENT_63F +; Unused: next 116 events + + const_next 1600 ; Sprite visibility flags ; When these events are cleared, the sprite becomes visible; when set, the sprite is hidden. ; The map script command macros `disappear` and `appear` set/clear these flags and immediately apply the effect on visibility. @@ -1677,8 +1057,8 @@ const EVENT_VIOLET_CITY_RARE_CANDY const EVENT_LAKE_OF_RAGE_ELIXER const EVENT_LAKE_OF_RAGE_TM_DETECT - const EVENT_SPROUT_TOWER1F_PARLYZ_HEAL - const EVENT_SPROUT_TOWER2F_X_ACCURACY + const EVENT_SPROUT_TOWER_1F_PARLYZ_HEAL + const EVENT_SPROUT_TOWER_2F_X_ACCURACY const EVENT_SPROUT_TOWER_3F_POTION const EVENT_SPROUT_TOWER_3F_ESCAPE_ROPE const EVENT_TIN_TOWER_3F_FULL_HEAL @@ -1849,7 +1229,7 @@ const EVENT_COPYCAT_2 const EVENT_GOLDENROD_SALE_OFF const EVENT_GOLDENROD_SALE_ON - const EVENT_6F2 + const_skip ; unused in Crystal const EVENT_ILEX_FOREST_APPRENTICE const EVENT_ILEX_FOREST_CHARCOAL_MASTER const EVENT_CHARCOAL_KILN_FARFETCH_D @@ -1927,7 +1307,7 @@ const EVENT_WHIRL_ISLAND_LUGIA_CHAMBER_LUGIA const EVENT_KURTS_HOUSE_KURT_1 const EVENT_KURTS_HOUSE_KURT_2 - const EVENT_SLOWPOKE_WELL_KURT ; 740 + const EVENT_SLOWPOKE_WELL_KURT const EVENT_PLAYERS_HOUSE_2F_CONSOLE const EVENT_PLAYERS_HOUSE_2F_DOLL_1 const EVENT_PLAYERS_HOUSE_2F_DOLL_2 @@ -1943,7 +1323,7 @@ const EVENT_BLACKTHORN_CITY_GRAMPS_NOT_BLOCKING_DRAGONS_DEN const EVENT_RUINS_OF_ALPH_KABUTO_CHAMBER_RECEPTIONIST const EVENT_OPENED_MT_SILVER - const EVENT_FOUGHT_SNORLAX ; 750 + const EVENT_FOUGHT_SNORLAX const EVENT_LAKE_OF_RAGE_RED_GYARADOS const EVENT_GOLDENROD_UNDERGROUND_GRANNY const EVENT_GOLDENROD_UNDERGROUND_GRAMPS @@ -1959,7 +1339,7 @@ const EVENT_BLACKTHORN_CITY_SANTOS_OF_SATURDAY const EVENT_ROUTE_40_MONICA_OF_MONDAY const EVENT_LANCES_ROOM_OAK_AND_MARY - const EVENT_UNION_CAVE_B2F_LAPRAS ; 760 + const EVENT_UNION_CAVE_B2F_LAPRAS const EVENT_TEAM_ROCKET_DISBANDED const EVENT_RED_IN_MT_SILVER const EVENT_GOLDENROD_DEPT_STORE_5F_HAPPINESS_EVENT_LADY @@ -1971,19 +1351,24 @@ const EVENT_FLORIA_AT_SUDOWOODO const EVENT_GOLDENROD_CITY_MOVE_TUTOR const EVENT_GOLDENROD_GAME_CORNER_MOVE_TUTOR +; Unused: next 0 events +; (In pokegold the previous 4 event flags were not defined, +; but in pokecrystal the 'const_next 1900' is redundant.) + + const_next 1900 ; Kanto people const EVENT_ROUTE_24_ROCKET const EVENT_CERULEAN_GYM_ROCKET const EVENT_ROUTE_25_MISTY_BOYFRIEND const EVENT_TRAINERS_IN_CERULEAN_GYM - const EVENT_VERMILION_CITY_SNORLAX ; 770 + const EVENT_VERMILION_CITY_SNORLAX const EVENT_ROUTE_5_6_POKEFAN_M_BLOCKS_UNDERGROUND_PATH const EVENT_SAFFRON_TRAIN_STATION_POPULATION const EVENT_COPYCATS_HOUSE_2F_DOLL const EVENT_VERMILION_FAN_CLUB_DOLL const EVENT_BLUE_IN_CINNABAR const EVENT_VIRIDIAN_GYM_BLUE - const EVENT_SEAFOAM_GYM_GYM_GUY + const EVENT_SEAFOAM_GYM_GYM_GUIDE const EVENT_MT_MOON_SQUARE_ROCK const EVENT_MT_MOON_SQUARE_CLEFAIRY const EVENT_MT_MOON_RIVAL @@ -1993,7 +1378,7 @@ const EVENT_PICKED_UP_FOCUS_BAND const EVENT_ROCK_TUNNEL_1F_ELIXER const EVENT_ROCK_TUNNEL_1F_TM_STEEL_WING - const EVENT_ROCK_TUNNEL_B1F_IRON ; 780 + const EVENT_ROCK_TUNNEL_B1F_IRON const EVENT_ROCK_TUNNEL_B1F_PP_UP const EVENT_ROCK_TUNNEL_B1F_REVIVE const EVENT_ROUTE_2_DIRE_HIT @@ -2010,7 +1395,7 @@ const EVENT_KURTS_HOUSE_GRANDDAUGHTER_2 const EVENT_RUINS_OF_ALPH_OUTSIDE_TOURIST_FISHER const EVENT_RUINS_OF_ALPH_OUTSIDE_TOURIST_YOUNGSTERS - const EVENT_DRAGON_SHRINE_CLAIR ; 790 + const EVENT_DRAGON_SHRINE_CLAIR const EVENT_BATTLE_TOWER_BATTLE_ROOM_YOUNGSTER const EVENT_PLAYERS_HOUSE_1F_NEIGHBOR const EVENT_PLAYERS_NEIGHBORS_HOUSE_NEIGHBOR @@ -2026,7 +1411,7 @@ const EVENT_PICKED_UP_MYSTIC_WATER_FROM_OMANYTE_ITEM_ROOM const EVENT_PICKED_UP_STARDUST_FROM_OMANYTE_ITEM_ROOM const EVENT_PICKED_UP_STAR_PIECE_FROM_OMANYTE_ITEM_ROOM - const EVENT_PICKED_UP_GOLD_BERRY_FROM_AERODACTYL_ITEM_ROOM ; 7a0 + const EVENT_PICKED_UP_GOLD_BERRY_FROM_AERODACTYL_ITEM_ROOM const EVENT_PICKED_UP_MOON_STONE_FROM_AERODACTYL_ITEM_ROOM const EVENT_PICKED_UP_HEAL_POWDER_FROM_AERODACTYL_ITEM_ROOM const EVENT_PICKED_UP_ENERGY_ROOT_FROM_AERODACTYL_ITEM_ROOM @@ -2042,7 +1427,7 @@ const EVENT_CIANWOOD_CITY_EUSINE const EVENT_SAW_SUICUNE_AT_CIANWOOD_CITY const EVENT_SAW_SUICUNE_ON_ROUTE_42 - const EVENT_SAW_SUICUNE_ON_ROUTE_36 ; 7b0 + const EVENT_SAW_SUICUNE_ON_ROUTE_36 const EVENT_ECRUTEAK_TIN_TOWER_ENTRANCE_WANDERING_SAGE const EVENT_TIN_TOWER_1F_SUICUNE const EVENT_TIN_TOWER_1F_ENTEI @@ -2058,7 +1443,7 @@ const EVENT_ROUTE_44_MAX_REPEL const EVENT_ICE_PATH_1F_PROTEIN const EVENT_DRAGONS_DEN_B1F_CALCIUM - const EVENT_DRAGONS_DEN_B1F_MAX_ELIXER ; 7c0 + const EVENT_DRAGONS_DEN_B1F_MAX_ELIXER const EVENT_SILVER_CAVE_ROOM_1_ULTRA_BALL const EVENT_SILVER_CAVE_ROOM_2_CALCIUM const EVENT_SILVER_CAVE_ROOM_2_ULTRA_BALL @@ -2073,5 +1458,8 @@ const EVENT_MOUNT_MORTAR_B1F_PP_UP const EVENT_RADIO_TOWER_5F_ULTRA_BALL const EVENT_DARK_CAVE_VIOLET_ENTRANCE_DIRE_HIT - const EVENT_BATTLE_TOWER_OUTSIDE_SAILOR -NUM_EVENTS EQU const_value ; 7d0 + const EVENT_BATTLE_TOWER_OPEN_CIVILIANS +; Unused: next 48 events + + const_next 2048 +DEF NUM_EVENTS EQU const_value ; 800 diff --git a/pokecrystal/constants/gfx_constants.asm b/pokecrystal/constants/gfx_constants.asm index f1d5308..4a56ce2 100644 --- a/pokecrystal/constants/gfx_constants.asm +++ b/pokecrystal/constants/gfx_constants.asm @@ -1,47 +1,48 @@ -TILE_WIDTH EQU 8 ; pixels -LEN_1BPP_TILE EQU 1 * TILE_WIDTH ; bytes -LEN_2BPP_TILE EQU 2 * TILE_WIDTH ; bytes +DEF TILE_WIDTH EQU 8 ; pixels +DEF LEN_1BPP_TILE EQU 1 * TILE_WIDTH ; bytes +DEF LEN_2BPP_TILE EQU 2 * TILE_WIDTH ; bytes -NUM_PAL_COLORS EQU 4 -PAL_COLOR_SIZE EQU 2 -PALETTE_SIZE EQU NUM_PAL_COLORS * PAL_COLOR_SIZE +DEF NUM_PAL_COLORS EQU 4 +DEF PAL_COLOR_SIZE EQU 2 +DEF PALETTE_SIZE EQU NUM_PAL_COLORS * PAL_COLOR_SIZE -PALRGB_WHITE EQUS "palred 31 + palgreen 31 + palblue 31" ; $7fff +DEF PALRGB_WHITE EQU palred 31 + palgreen 31 + palblue 31 ; $7fff -SCREEN_WIDTH EQU 20 ; tiles -SCREEN_HEIGHT EQU 18 ; tiles -SCREEN_WIDTH_PX EQU SCREEN_WIDTH * TILE_WIDTH ; pixels -SCREEN_HEIGHT_PX EQU SCREEN_HEIGHT * TILE_WIDTH ; pixels +DEF SCREEN_WIDTH EQU 20 ; tiles +DEF SCREEN_HEIGHT EQU 18 ; tiles +DEF SCREEN_WIDTH_PX EQU SCREEN_WIDTH * TILE_WIDTH ; pixels +DEF SCREEN_HEIGHT_PX EQU SCREEN_HEIGHT * TILE_WIDTH ; pixels -BG_MAP_WIDTH EQU 32 ; tiles -BG_MAP_HEIGHT EQU 32 ; tiles +DEF BG_MAP_WIDTH EQU 32 ; tiles +DEF BG_MAP_HEIGHT EQU 32 ; tiles -METATILE_WIDTH EQU 4 ; tiles -SCREEN_META_WIDTH EQU 6 ; metatiles -SCREEN_META_HEIGHT EQU 5 ; metatiles -SURROUNDING_WIDTH EQU SCREEN_META_WIDTH * METATILE_WIDTH ; tiles -SURROUNDING_HEIGHT EQU SCREEN_META_HEIGHT * METATILE_WIDTH ; tiles +DEF METATILE_WIDTH EQU 4 ; tiles +DEF SCREEN_META_WIDTH EQU 6 ; metatiles +DEF SCREEN_META_HEIGHT EQU 5 ; metatiles +DEF SURROUNDING_WIDTH EQU SCREEN_META_WIDTH * METATILE_WIDTH ; tiles +DEF SURROUNDING_HEIGHT EQU SCREEN_META_HEIGHT * METATILE_WIDTH ; tiles +DEF MAP_CONNECTION_PADDING_WIDTH EQU 3 ; metatiles -HP_BAR_LENGTH EQU 6 ; tiles -EXP_BAR_LENGTH EQU 8 ; tiles -HP_BAR_LENGTH_PX EQU HP_BAR_LENGTH * TILE_WIDTH ; pixels -EXP_BAR_LENGTH_PX EQU EXP_BAR_LENGTH * TILE_WIDTH ; pixels +DEF HP_BAR_LENGTH EQU 6 ; tiles +DEF EXP_BAR_LENGTH EQU 8 ; tiles +DEF HP_BAR_LENGTH_PX EQU HP_BAR_LENGTH * TILE_WIDTH ; pixels +DEF EXP_BAR_LENGTH_PX EQU EXP_BAR_LENGTH * TILE_WIDTH ; pixels -; GetHPPal return values (see home.asm) -HP_GREEN EQU 0 -HP_YELLOW EQU 1 -HP_RED EQU 2 +; GetHPPal return values (see home/tilemap.asm) +DEF HP_GREEN EQU 0 +DEF HP_YELLOW EQU 1 +DEF HP_RED EQU 2 -; sprite_oam_struct members (see macros/wram.asm) - const_def - const SPRITEOAMSTRUCT_YCOORD ; 0 - const SPRITEOAMSTRUCT_XCOORD ; 1 - const SPRITEOAMSTRUCT_TILE_ID ; 2 - const SPRITEOAMSTRUCT_ATTRIBUTES ; 3 -SPRITEOAMSTRUCT_LENGTH EQU const_value -NUM_SPRITE_OAM_STRUCTS EQU 40 ; see wVirtualOAM +; sprite_oam_struct members (see macros/ram.asm) +rsreset +DEF SPRITEOAMSTRUCT_YCOORD rb ; 0 +DEF SPRITEOAMSTRUCT_XCOORD rb ; 1 +DEF SPRITEOAMSTRUCT_TILE_ID rb ; 2 +DEF SPRITEOAMSTRUCT_ATTRIBUTES rb ; 3 +DEF SPRITEOAMSTRUCT_LENGTH EQU _RS +DEF NUM_SPRITE_OAM_STRUCTS EQU 40 ; see wShadowOAM -SPRITE_GFX_LIST_CAPACITY EQU 32 ; see wUsedSprites +DEF SPRITE_GFX_LIST_CAPACITY EQU 32 ; see wUsedSprites ; PokeAnims indexes (see engine/gfx/pic_animation.asm) const_def diff --git a/pokecrystal/constants/hardware_constants.asm b/pokecrystal/constants/hardware_constants.asm index 6205a1d..58379f0 100644 --- a/pokecrystal/constants/hardware_constants.asm +++ b/pokecrystal/constants/hardware_constants.asm @@ -1,164 +1,162 @@ -; Graciously aped from: -; http://nocash.emubase.de/pandocs.htm +; Graciously derived from: +; https://gbdev.io/pandocs/ +; https://github.com/gbdev/hardware.inc ; http://gameboy.mongenel.com/dmg/asmmemmap.html ; memory map -VRAM_Begin EQU $8000 -VRAM_End EQU $a000 -SRAM_Begin EQU $a000 -SRAM_End EQU $c000 -WRAM0_Begin EQU $c000 -WRAM0_End EQU $d000 -WRAM1_Begin EQU $d000 -WRAM1_End EQU $e000 +DEF VRAM_Begin EQU $8000 +DEF VRAM_End EQU $a000 +DEF SRAM_Begin EQU $a000 +DEF SRAM_End EQU $c000 +DEF WRAM0_Begin EQU $c000 +DEF WRAM0_End EQU $d000 +DEF WRAM1_Begin EQU $d000 +DEF WRAM1_End EQU $e000 ; hardware registers $ff00-$ff80 (see below) -HRAM_Begin EQU $ff80 -HRAM_End EQU $ffff +DEF HRAM_Begin EQU $ff80 +DEF HRAM_End EQU $ffff ; MBC3 -MBC3SRamEnable EQU $0000 -MBC3RomBank EQU $2000 -MBC3SRamBank EQU $4000 -MBC3LatchClock EQU $6000 -MBC3RTC EQU $a000 +DEF MBC3SRamEnable EQU $0000 +DEF MBC3RomBank EQU $2000 +DEF MBC3SRamBank EQU $4000 +DEF MBC3LatchClock EQU $6000 +DEF MBC3RTC EQU $a000 -SRAM_DISABLE EQU $00 -SRAM_ENABLE EQU $0a +DEF SRAM_DISABLE EQU $00 +DEF SRAM_ENABLE EQU $0a -NUM_SRAM_BANKS EQU 4 +DEF NUM_SRAM_BANKS EQU 8 -RTC_S EQU $08 ; Seconds 0-59 (0-3Bh) -RTC_M EQU $09 ; Minutes 0-59 (0-3Bh) -RTC_H EQU $0a ; Hours 0-23 (0-17h) -RTC_DL EQU $0b ; Lower 8 bits of Day Counter (0-FFh) -RTC_DH EQU $0c ; Upper 1 bit of Day Counter, Carry Bit, Halt Flag - ; Bit 0 Most significant bit of Day Counter (Bit 8) - ; Bit 6 Halt (0=Active, 1=Stop Timer) - ; Bit 7 Day Counter Carry Bit (1=Counter Overflow) +DEF RTC_S EQU $08 ; Seconds 0-59 (0-3Bh) +DEF RTC_M EQU $09 ; Minutes 0-59 (0-3Bh) +DEF RTC_H EQU $0a ; Hours 0-23 (0-17h) +DEF RTC_DL EQU $0b ; Lower 8 bits of Day Counter (0-FFh) +DEF RTC_DH EQU $0c ; Upper 1 bit of Day Counter, Carry Bit, Halt Flag + ; Bit 0 Most significant bit of Day Counter (Bit 8) + ; Bit 6 Halt (0=Active, 1=Stop Timer) + ; Bit 7 Day Counter Carry Bit (1=Counter Overflow) ; interrupt flags -VBLANK EQU 0 -LCD_STAT EQU 1 -TIMER EQU 2 -SERIAL EQU 3 -JOYPAD EQU 4 -IE_DEFAULT EQU (1 << SERIAL) | (1 << TIMER) | (1 << LCD_STAT) | (1 << VBLANK) +DEF VBLANK EQU 0 +DEF LCD_STAT EQU 1 +DEF TIMER EQU 2 +DEF SERIAL EQU 3 +DEF JOYPAD EQU 4 +DEF IE_DEFAULT EQU (1 << SERIAL) | (1 << TIMER) | (1 << LCD_STAT) | (1 << VBLANK) ; OAM attribute flags -OAM_TILE_BANK EQU 3 -OAM_OBP_NUM EQU 4 ; non CGB Mode Only -OAM_X_FLIP EQU 5 -OAM_Y_FLIP EQU 6 -OAM_PRIORITY EQU 7 ; 0: OBJ above BG, 1: OBJ behind BG (colors 1-3) +DEF OAM_TILE_BANK EQU 3 +DEF OAM_OBP_NUM EQU 4 ; non CGB Mode Only +DEF OAM_X_FLIP EQU 5 +DEF OAM_Y_FLIP EQU 6 +DEF OAM_PRIORITY EQU 7 ; 0: OBJ above BG, 1: OBJ behind BG (colors 1-3) ; BG Map attribute flags -PALETTE_MASK EQU %111 -VRAM_BANK_1 EQU 1 << OAM_TILE_BANK ; $08 -OBP_NUM EQU 1 << OAM_OBP_NUM ; $10 -X_FLIP EQU 1 << OAM_X_FLIP ; $20 -Y_FLIP EQU 1 << OAM_Y_FLIP ; $40 -PRIORITY EQU 1 << OAM_PRIORITY ; $80 +DEF PALETTE_MASK EQU %111 +DEF VRAM_BANK_1 EQU 1 << OAM_TILE_BANK ; $08 +DEF OBP_NUM EQU 1 << OAM_OBP_NUM ; $10 +DEF X_FLIP EQU 1 << OAM_X_FLIP ; $20 +DEF Y_FLIP EQU 1 << OAM_Y_FLIP ; $40 +DEF PRIORITY EQU 1 << OAM_PRIORITY ; $80 ; Hardware registers -rJOYP EQU $ff00 ; Joypad (R/W) -rSB EQU $ff01 ; Serial transfer data (R/W) -rSC EQU $ff02 ; Serial Transfer Control (R/W) -rSC_ON EQU 7 -rSC_CGB EQU 1 -rSC_CLOCK EQU 0 -rDIV EQU $ff04 ; Divider Register (R/W) -rTIMA EQU $ff05 ; Timer counter (R/W) -rTMA EQU $ff06 ; Timer Modulo (R/W) -rTAC EQU $ff07 ; Timer Control (R/W) -rTAC_ON EQU 2 -rTAC_4096_HZ EQU 0 -rTAC_262144_HZ EQU 1 -rTAC_65536_HZ EQU 2 -rTAC_16384_HZ EQU 3 -rIF EQU $ff0f ; Interrupt Flag (R/W) -rNR10 EQU $ff10 ; Channel 1 Sweep register (R/W) -rNR11 EQU $ff11 ; Channel 1 Sound length/Wave pattern duty (R/W) -rNR12 EQU $ff12 ; Channel 1 Volume Envelope (R/W) -rNR13 EQU $ff13 ; Channel 1 Frequency lo (Write Only) -rNR14 EQU $ff14 ; Channel 1 Frequency hi (R/W) -rNR20 EQU $ff15 ; Channel 2 Sweep register (R/W) -rNR21 EQU $ff16 ; Channel 2 Sound Length/Wave Pattern Duty (R/W) -rNR22 EQU $ff17 ; Channel 2 Volume Envelope (R/W) -rNR23 EQU $ff18 ; Channel 2 Frequency lo data (W) -rNR24 EQU $ff19 ; Channel 2 Frequency hi data (R/W) -rNR30 EQU $ff1a ; Channel 3 Sound on/off (R/W) -rNR31 EQU $ff1b ; Channel 3 Sound Length -rNR32 EQU $ff1c ; Channel 3 Select output level (R/W) -rNR33 EQU $ff1d ; Channel 3 Frequency's lower data (W) -rNR34 EQU $ff1e ; Channel 3 Frequency's higher data (R/W) -rNR40 EQU $ff1f ; Channel 4 Sweep register (R/W) -rNR41 EQU $ff20 ; Channel 4 Sound Length (R/W) -rNR42 EQU $ff21 ; Channel 4 Volume Envelope (R/W) -rNR43 EQU $ff22 ; Channel 4 Polynomial Counter (R/W) -rNR44 EQU $ff23 ; Channel 4 Counter/consecutive; Inital (R/W) -rNR50 EQU $ff24 ; Channel control / ON-OFF / Volume (R/W) -rNR51 EQU $ff25 ; Selection of Sound output terminal (R/W) -rNR52 EQU $ff26 ; Sound on/off -rWave_0 EQU $ff30 -rWave_1 EQU $ff31 -rWave_2 EQU $ff32 -rWave_3 EQU $ff33 -rWave_4 EQU $ff34 -rWave_5 EQU $ff35 -rWave_6 EQU $ff36 -rWave_7 EQU $ff37 -rWave_8 EQU $ff38 -rWave_9 EQU $ff39 -rWave_a EQU $ff3a -rWave_b EQU $ff3b -rWave_c EQU $ff3c -rWave_d EQU $ff3d -rWave_e EQU $ff3e -rWave_f EQU $ff3f -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_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_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) -rSCY EQU $ff42 ; Scroll Y (R/W) -rSCX EQU $ff43 ; Scroll X (R/W) -rLY EQU $ff44 ; LCDC Y-Coordinate (R) -LY_VBLANK EQU 144 -rLYC EQU $ff45 ; LY Compare (R/W) -rDMA EQU $ff46 ; DMA Transfer and Start Address (W) -rBGP EQU $ff47 ; BG Palette Data (R/W) - Non CGB Mode Only -rOBP0 EQU $ff48 ; Object Palette 0 Data (R/W) - Non CGB Mode Only -rOBP1 EQU $ff49 ; Object Palette 1 Data (R/W) - Non CGB Mode Only -rWY EQU $ff4a ; Window Y Position (R/W) -rWX EQU $ff4b ; Window X Position minus 7 (R/W) -rLCDMODE EQU $ff4c -rKEY1 EQU $ff4d ; CGB Mode Only - Prepare Speed Switch -rVBK EQU $ff4f ; CGB Mode Only - VRAM Bank -rBLCK EQU $ff50 -rHDMA1 EQU $ff51 ; CGB Mode Only - New DMA Source, High -rHDMA2 EQU $ff52 ; CGB Mode Only - New DMA Source, Low -rHDMA3 EQU $ff53 ; CGB Mode Only - New DMA Destination, High -rHDMA4 EQU $ff54 ; CGB Mode Only - New DMA Destination, Low -rHDMA5 EQU $ff55 ; CGB Mode Only - New DMA Length/Mode/Start -rRP EQU $ff56 ; CGB Mode Only - Infrared Communications Port -rBGPI EQU $ff68 ; CGB Mode Only - Background Palette Index -rBGPI_AUTO_INCREMENT EQU 7 ; increment rBGPI after write to rBGPD -rBGPD EQU $ff69 ; CGB Mode Only - Background Palette Data -rOBPI EQU $ff6a ; CGB Mode Only - Sprite Palette Index -rOBPI_AUTO_INCREMENT EQU 7 ; increment rOBPI after write to rOBPD -rOBPD EQU $ff6b ; CGB Mode Only - Sprite Palette Data -rUNKNOWN1 EQU $ff6c ; (FEh) Bit 0 (Read/Write) - CGB Mode Only -rSVBK EQU $ff70 ; CGB Mode Only - WRAM Bank -rUNKNOWN2 EQU $ff72 ; (00h) - Bit 0-7 (Read/Write) -rUNKNOWN3 EQU $ff73 ; (00h) - Bit 0-7 (Read/Write) -rUNKNOWN4 EQU $ff74 ; (00h) - Bit 0-7 (Read/Write) - CGB Mode Only -rUNKNOWN5 EQU $ff75 ; (8Fh) - Bit 4-6 (Read/Write) -rUNKNOWN6 EQU $ff76 ; (00h) - Always 00h (Read Only) -rUNKNOWN7 EQU $ff77 ; (00h) - Always 00h (Read Only) -rIE EQU $ffff ; Interrupt Enable (R/W) +DEF rJOYP EQU $ff00 ; Joypad (R/W) +DEF rSB EQU $ff01 ; Serial transfer data (R/W) +DEF rSC EQU $ff02 ; Serial Transfer Control (R/W) +DEF rSC_ON EQU 7 +DEF rSC_CGB EQU 1 +DEF rSC_CLOCK EQU 0 +DEF rDIV EQU $ff04 ; Divider Register (R/W) +DEF rTIMA EQU $ff05 ; Timer counter (R/W) +DEF rTMA EQU $ff06 ; Timer Modulo (R/W) +DEF rTAC EQU $ff07 ; Timer Control (R/W) +DEF rTAC_ON EQU 2 +DEF rTAC_4096_HZ EQU %00 +DEF rTAC_262144_HZ EQU %01 +DEF rTAC_65536_HZ EQU %10 +DEF rTAC_16384_HZ EQU %11 +DEF rIF EQU $ff0f ; Interrupt Flag (R/W) +DEF rNR10 EQU $ff10 ; Channel 1 Sweep register (R/W) +DEF rNR11 EQU $ff11 ; Channel 1 Sound length/Wave pattern duty (R/W) +DEF rNR12 EQU $ff12 ; Channel 1 Volume Envelope (R/W) +DEF rNR13 EQU $ff13 ; Channel 1 Frequency lo (Write Only) +DEF rNR14 EQU $ff14 ; Channel 1 Frequency hi (R/W) +DEF rNR21 EQU $ff16 ; Channel 2 Sound Length/Wave Pattern Duty (R/W) +DEF rNR22 EQU $ff17 ; Channel 2 Volume Envelope (R/W) +DEF rNR23 EQU $ff18 ; Channel 2 Frequency lo data (W) +DEF rNR24 EQU $ff19 ; Channel 2 Frequency hi data (R/W) +DEF rNR30 EQU $ff1a ; Channel 3 Sound on/off (R/W) +DEF rNR31 EQU $ff1b ; Channel 3 Sound Length +DEF rNR32 EQU $ff1c ; Channel 3 Select output level (R/W) +DEF rNR33 EQU $ff1d ; Channel 3 Frequency's lower data (W) +DEF rNR34 EQU $ff1e ; Channel 3 Frequency's higher data (R/W) +DEF rNR41 EQU $ff20 ; Channel 4 Sound Length (R/W) +DEF rNR42 EQU $ff21 ; Channel 4 Volume Envelope (R/W) +DEF rNR43 EQU $ff22 ; Channel 4 Polynomial Counter (R/W) +DEF rNR44 EQU $ff23 ; Channel 4 Counter/consecutive; Inital (R/W) +DEF rNR50 EQU $ff24 ; Channel control / ON-OFF / Volume (R/W) +DEF rNR51 EQU $ff25 ; Selection of Sound output terminal (R/W) +DEF rNR52 EQU $ff26 ; Sound on/off +DEF rWave_0 EQU $ff30 +DEF rWave_1 EQU $ff31 +DEF rWave_2 EQU $ff32 +DEF rWave_3 EQU $ff33 +DEF rWave_4 EQU $ff34 +DEF rWave_5 EQU $ff35 +DEF rWave_6 EQU $ff36 +DEF rWave_7 EQU $ff37 +DEF rWave_8 EQU $ff38 +DEF rWave_9 EQU $ff39 +DEF rWave_a EQU $ff3a +DEF rWave_b EQU $ff3b +DEF rWave_c EQU $ff3c +DEF rWave_d EQU $ff3d +DEF rWave_e EQU $ff3e +DEF rWave_f EQU $ff3f +DEF rLCDC EQU $ff40 ; LCD Control (R/W) +DEF rLCDC_BG_PRIORITY EQU 0 ; 0=Off, 1=On +DEF rLCDC_SPRITES_ENABLE EQU 1 ; 0=Off, 1=On +DEF rLCDC_SPRITE_SIZE EQU 2 ; 0=8x8, 1=8x16 +DEF rLCDC_BG_TILEMAP EQU 3 ; 0=9800-9BFF, 1=9C00-9FFF +DEF rLCDC_TILE_DATA EQU 4 ; 0=8800-97FF, 1=8000-8FFF +DEF rLCDC_WINDOW_ENABLE EQU 5 ; 0=Off, 1=On +DEF rLCDC_WINDOW_TILEMAP EQU 6 ; 0=9800-9BFF, 1=9C00-9FFF +DEF rLCDC_ENABLE EQU 7 ; 0=Off, 1=On +DEF LCDC_DEFAULT EQU (1 << rLCDC_ENABLE) | (1 << rLCDC_WINDOW_TILEMAP) | (1 << rLCDC_WINDOW_ENABLE) | (1 << rLCDC_SPRITES_ENABLE) | (1 << rLCDC_BG_PRIORITY) +DEF rSTAT EQU $ff41 ; LCDC Status (R/W) +DEF rSCY EQU $ff42 ; Scroll Y (R/W) +DEF rSCX EQU $ff43 ; Scroll X (R/W) +DEF rLY EQU $ff44 ; LCDC Y-Coordinate (R) +DEF LY_VBLANK EQU 144 +DEF rLYC EQU $ff45 ; LY Compare (R/W) +DEF rDMA EQU $ff46 ; DMA Transfer and Start Address (W) +DEF rBGP EQU $ff47 ; BG Palette Data (R/W) - Non CGB Mode Only +DEF rOBP0 EQU $ff48 ; Object Palette 0 Data (R/W) - Non CGB Mode Only +DEF rOBP1 EQU $ff49 ; Object Palette 1 Data (R/W) - Non CGB Mode Only +DEF rWY EQU $ff4a ; Window Y Position (R/W) +DEF rWX EQU $ff4b ; Window X Position minus 7 (R/W) +DEF rLCDMODE EQU $ff4c +DEF rKEY1 EQU $ff4d ; CGB Mode Only - Prepare Speed Switch +DEF rVBK EQU $ff4f ; CGB Mode Only - VRAM Bank +DEF rBLCK EQU $ff50 +DEF rHDMA1 EQU $ff51 ; CGB Mode Only - New DMA Source, High +DEF rHDMA2 EQU $ff52 ; CGB Mode Only - New DMA Source, Low +DEF rHDMA3 EQU $ff53 ; CGB Mode Only - New DMA Destination, High +DEF rHDMA4 EQU $ff54 ; CGB Mode Only - New DMA Destination, Low +DEF rHDMA5 EQU $ff55 ; CGB Mode Only - New DMA Length/Mode/Start +DEF rRP EQU $ff56 ; CGB Mode Only - Infrared Communications Port +DEF rRP_LED_ON EQU 0 +DEF rRP_RECEIVING EQU 1 +DEF rRP_ENABLE_READ_MASK EQU %11000000 +DEF rBGPI EQU $ff68 ; CGB Mode Only - Background Palette Index +DEF rBGPI_AUTO_INCREMENT EQU 7 ; increment rBGPI after write to rBGPD +DEF rBGPD EQU $ff69 ; CGB Mode Only - Background Palette Data +DEF rOBPI EQU $ff6a ; CGB Mode Only - Sprite Palette Index +DEF rOBPI_AUTO_INCREMENT EQU 7 ; increment rOBPI after write to rOBPD +DEF rOBPD EQU $ff6b ; CGB Mode Only - Sprite Palette Data +DEF rOPRI EQU $ff6c ; CGB Mode Only - Object Priority Mode +DEF rSVBK EQU $ff70 ; CGB Mode Only - WRAM Bank +DEF rPCM12 EQU $ff76 ; Channel 1 & 2 Amplitude (R) +DEF rPCM34 EQU $ff77 ; Channel 3 & 4 Amplitude (R) +DEF rIE EQU $ffff ; Interrupt Enable (R/W) diff --git a/pokecrystal/constants/icon_constants.asm b/pokecrystal/constants/icon_constants.asm index 870175f..8877c8b 100644 --- a/pokecrystal/constants/icon_constants.asm +++ b/pokecrystal/constants/icon_constants.asm @@ -39,6 +39,7 @@ const ICON_SLOWPOKE const ICON_SUDOWOODO const ICON_BIGMON +DEF NUM_ICONS EQU const_value - 1 ; LoadMenuMonIcon.Jumptable indexes (see engine/gfx/mon_icons.asm) const_def diff --git a/pokecrystal/constants/input_constants.asm b/pokecrystal/constants/input_constants.asm index 3042c3f..5319758 100644 --- a/pokecrystal/constants/input_constants.asm +++ b/pokecrystal/constants/input_constants.asm @@ -9,18 +9,18 @@ const D_UP_F ; 6 const D_DOWN_F ; 7 -NO_INPUT EQU %00000000 -A_BUTTON EQU 1 << A_BUTTON_F -B_BUTTON EQU 1 << B_BUTTON_F -SELECT EQU 1 << SELECT_F -START EQU 1 << START_F -D_RIGHT EQU 1 << D_RIGHT_F -D_LEFT EQU 1 << D_LEFT_F -D_UP EQU 1 << D_UP_F -D_DOWN EQU 1 << D_DOWN_F +DEF NO_INPUT EQU %00000000 +DEF A_BUTTON EQU 1 << A_BUTTON_F +DEF B_BUTTON EQU 1 << B_BUTTON_F +DEF SELECT EQU 1 << SELECT_F +DEF START EQU 1 << START_F +DEF D_RIGHT EQU 1 << D_RIGHT_F +DEF D_LEFT EQU 1 << D_LEFT_F +DEF D_UP EQU 1 << D_UP_F +DEF D_DOWN EQU 1 << D_DOWN_F -BUTTONS EQU A_BUTTON | B_BUTTON | SELECT | START -D_PAD EQU D_RIGHT | D_LEFT | D_UP | D_DOWN +DEF BUTTONS EQU A_BUTTON | B_BUTTON | SELECT | START +DEF D_PAD EQU D_RIGHT | D_LEFT | D_UP | D_DOWN -R_DPAD EQU %00100000 -R_BUTTONS EQU %00010000 +DEF R_DPAD EQU %00100000 +DEF R_BUTTONS EQU %00010000 diff --git a/pokecrystal/constants/item_constants.asm b/pokecrystal/constants/item_constants.asm index 4f7888c..9774b0c 100644 --- a/pokecrystal/constants/item_constants.asm +++ b/pokecrystal/constants/item_constants.asm @@ -103,7 +103,7 @@ const MYSTIC_WATER ; 5f const TWISTEDSPOON ; 60 const WHT_APRICORN ; 61 - const BLACKBELT ; 62 + const BLACKBELT_I ; 62 const BLK_APRICORN ; 63 const ITEM_64 ; 64 const PNK_APRICORN ; 65 @@ -196,18 +196,27 @@ const MUSIC_MAIL ; bc const MIRAGE_MAIL ; bd const ITEM_BE ; be +DEF NUM_ITEMS EQU const_value - 1 -add_tm: MACRO -if !DEF(TM01) -TM01 EQU const_value - enum_start 1 -endc - define _\@_1, "TM_\1" - const _\@_1 - enum \1_TMNUM +DEF __tmhm_value__ = 1 + +MACRO add_tmnum + DEF \1_TMNUM EQU __tmhm_value__ + DEF __tmhm_value__ += 1 +ENDM + +MACRO add_tm +; Defines three constants: +; - TM_\1: the item id, starting at $bf +; - \1_TMNUM: the learnable TM/HM flag, starting at 1 +; - TM##_MOVE: alias for the move id, equal to the value of \1 + const TM_\1 + DEF TM{02d:__tmhm_value__}_MOVE = \1 + add_tmnum \1 ENDM ; see data/moves/tmhm_moves.asm for moves +DEF TM01 EQU const_value add_tm DYNAMICPUNCH ; bf add_tm HEADBUTT ; c0 add_tm CURSE ; c1 @@ -260,17 +269,20 @@ ENDM add_tm FIRE_PUNCH ; f0 add_tm FURY_CUTTER ; f1 add_tm NIGHTMARE ; f2 -NUM_TMS EQU const_value - TM01 - 2 ; discount ITEM_C3 and ITEM_DC +DEF NUM_TMS EQU __tmhm_value__ - 1 -add_hm: MACRO -if !DEF(HM01) -HM01 EQU const_value -endc - define _\@_1, "HM_\1" - const _\@_1 - enum \1_TMNUM +MACRO add_hm +; Defines three constants: +; - HM_\1: the item id, starting at $f3 +; - \1_TMNUM: the learnable TM/HM flag, starting at 51 +; - HM##_MOVE: alias for the move id, equal to the value of \1 + const HM_\1 + DEF HM_VALUE = __tmhm_value__ - NUM_TMS + DEF HM{02d:HM_VALUE}_MOVE = \1 + add_tmnum \1 ENDM +DEF HM01 EQU const_value add_hm CUT ; f3 add_hm FLY ; f4 add_hm SURF ; f5 @@ -278,23 +290,31 @@ ENDM add_hm FLASH ; f7 add_hm WHIRLPOOL ; f8 add_hm WATERFALL ; f9 -NUM_HMS EQU const_value - HM01 +DEF NUM_HMS EQU __tmhm_value__ - NUM_TMS - 1 -add_mt: MACRO - enum \1_TMNUM +MACRO add_mt +; Defines two constants: +; - \1_TMNUM: the learnable TM/HM flag, starting at 58 +; - MT##_MOVE: alias for the move id, equal to the value of \1 + DEF MT_VALUE = __tmhm_value__ - NUM_TMS - NUM_HMS + DEF MT{02d:MT_VALUE}_MOVE = \1 + add_tmnum \1 ENDM +DEF MT01 EQU const_value add_mt FLAMETHROWER add_mt THUNDERBOLT add_mt ICE_BEAM -NUM_TM_HM_TUTOR EQU __enum__ + -1 +DEF NUM_TUTORS = __tmhm_value__ - NUM_TMS - NUM_HMS - 1 + +DEF NUM_TM_HM_TUTOR EQU NUM_TMS + NUM_HMS + NUM_TUTORS const ITEM_FA ; fa -USE_SCRIPT_VAR EQU $00 -ITEM_FROM_MEM EQU $ff +DEF USE_SCRIPT_VAR EQU $00 +DEF ITEM_FROM_MEM EQU $ff ; leftovers from red -SAFARI_BALL EQU $08 ; MOON_STONE -MOON_STONE_RED EQU $0a ; BURN_HEAL -FULL_HEAL_RED EQU $34 ; X_SPEED +DEF SAFARI_BALL EQU $08 ; MOON_STONE +DEF MOON_STONE_RED EQU $0a ; BURN_HEAL +DEF FULL_HEAL_RED EQU $34 ; X_SPEED diff --git a/pokecrystal/constants/item_data_constants.asm b/pokecrystal/constants/item_data_constants.asm index 5040ab0..af6b847 100644 --- a/pokecrystal/constants/item_data_constants.asm +++ b/pokecrystal/constants/item_data_constants.asm @@ -1,13 +1,15 @@ ; item_attributes struct members (see data/items/attributes.asm) - const_def - const ITEMATTR_PRICE - const ITEMATTR_PRICE_HI - const ITEMATTR_EFFECT - const ITEMATTR_PARAM - const ITEMATTR_PERMISSIONS - const ITEMATTR_POCKET - const ITEMATTR_HELP -ITEMATTR_STRUCT_LENGTH EQU const_value +rsreset +DEF ITEMATTR_PRICE rw +rsset ITEMATTR_PRICE +DEF ITEMATTR_PRICE_LO rb +DEF ITEMATTR_PRICE_HI rb +DEF ITEMATTR_EFFECT rb +DEF ITEMATTR_PARAM rb +DEF ITEMATTR_PERMISSIONS rb +DEF ITEMATTR_POCKET rb +DEF ITEMATTR_HELP rb +DEF ITEMATTR_STRUCT_LENGTH EQU _RS ; item types const_def 1 @@ -15,22 +17,25 @@ ITEMATTR_STRUCT_LENGTH EQU const_value const KEY_ITEM ; 2 const BALL ; 3 const TM_HM ; 4 +DEF NUM_ITEM_TYPES EQU const_value - 1 ; item menu types ; UseItem.dw indexes (see engine/items/pack.asm) ; UseRegisteredItem.SwitchTo indexes (see engine/overworld/select_menu.asm) -ITEMMENU_NOUSE EQU 0 -ITEMMENU_CURRENT EQU 4 -ITEMMENU_PARTY EQU 5 -ITEMMENU_CLOSE EQU 6 + const_def + const ITEMMENU_NOUSE ; 0 + const_skip 3 + const ITEMMENU_CURRENT ; 4 + const ITEMMENU_PARTY ; 5 + const ITEMMENU_CLOSE ; 6 ; item actions -CANT_SELECT_F EQU 6 -CANT_TOSS_F EQU 7 +DEF CANT_SELECT_F EQU 6 +DEF CANT_TOSS_F EQU 7 -NO_LIMITS EQU 0 -CANT_SELECT EQU 1 << CANT_SELECT_F -CANT_TOSS EQU 1 << CANT_TOSS_F +DEF NO_LIMITS EQU 0 +DEF CANT_SELECT EQU 1 << CANT_SELECT_F +DEF CANT_TOSS EQU 1 << CANT_TOSS_F ; pack pockets const_def @@ -38,18 +43,21 @@ CANT_TOSS EQU 1 << CANT_TOSS_F const BALL_POCKET ; 1 const KEY_ITEM_POCKET ; 2 const TM_HM_POCKET ; 3 -NUM_POCKETS EQU const_value +DEF NUM_POCKETS EQU const_value -MAX_ITEMS EQU 20 -MAX_BALLS EQU 12 -MAX_KEY_ITEMS EQU 25 -MAX_PC_ITEMS EQU 50 +DEF MAX_ITEMS EQU 20 +DEF MAX_BALLS EQU 12 +DEF MAX_KEY_ITEMS EQU 25 +DEF MAX_PC_ITEMS EQU 50 + +DEF MAX_ITEM_STACK EQU 99 ; mail -MAIL_LINE_LENGTH EQU $10 -MAIL_MSG_LENGTH EQU $20 -MAILBOX_CAPACITY EQU 10 -MAIL_STRUCT_LENGTH EQU $2f ; mailmsg struct +DEF MAIL_LINE_LENGTH EQU $10 +DEF MAIL_MSG_LENGTH EQU $20 +DEF MAILBOX_CAPACITY EQU 10 +DEF MAIL_STRUCT_LENGTH EQU $2f ; mailmsg struct +DEF MAIL_STRUCT_LENGTH_JP EQU $2a ; mailmsg_jp struct ; held item effects const_def @@ -57,13 +65,13 @@ MAIL_STRUCT_LENGTH EQU $2f ; mailmsg struct const HELD_BERRY const HELD_2 const HELD_LEFTOVERS - const HELD_4 + const_skip const HELD_5 const HELD_RESTORE_PP - const HELD_7 + const_skip const HELD_CLEANSE_TAG - const_def 10 + const_next 10 const HELD_HEAL_POISON const HELD_HEAL_FREEZE const HELD_HEAL_BURN @@ -72,7 +80,7 @@ MAIL_STRUCT_LENGTH EQU $2f ; mailmsg struct const HELD_HEAL_STATUS const HELD_HEAL_CONFUSION - const_def 20 + const_next 20 const HELD_PREVENT_POISON const HELD_PREVENT_BURN const HELD_PREVENT_FREEZE @@ -80,7 +88,7 @@ MAIL_STRUCT_LENGTH EQU $2f ; mailmsg struct const HELD_PREVENT_PARALYZE const HELD_PREVENT_CONFUSE - const_def 30 + const_next 30 const HELD_30 const HELD_ATTACK_UP const HELD_DEFENSE_UP @@ -91,12 +99,12 @@ MAIL_STRUCT_LENGTH EQU $2f ; mailmsg struct const HELD_EVASION_UP const HELD_38 - const_def 40 - const HELD_40 - const HELD_41 + const_next 40 + const_skip + const_skip const HELD_METAL_POWDER - const_def 50 + const_next 50 const HELD_NORMAL_BOOST const HELD_FIGHTING_BOOST const HELD_FLYING_BOOST @@ -115,7 +123,7 @@ MAIL_STRUCT_LENGTH EQU $2f ; mailmsg struct const HELD_DARK_BOOST const HELD_STEEL_BOOST - const_def 70 + const_next 70 const HELD_CATCH_CHANCE const HELD_71 const HELD_ESCAPE @@ -124,5 +132,5 @@ MAIL_STRUCT_LENGTH EQU $2f ; mailmsg struct const HELD_FLINCH const HELD_AMULET_COIN const HELD_BRIGHTPOWDER - const HELD_78 + const_skip const HELD_FOCUS_BAND diff --git a/pokecrystal/constants/landmark_constants.asm b/pokecrystal/constants/landmark_constants.asm index a07af44..058b70c 100644 --- a/pokecrystal/constants/landmark_constants.asm +++ b/pokecrystal/constants/landmark_constants.asm @@ -1,112 +1,112 @@ ; Landmarks indexes (see data/maps/landmarks.asm) const_def - + const LANDMARK_SPECIAL ; 00 ; Johto landmarks - const SPECIAL_MAP ; 00 - const NEW_BARK_TOWN ; 01 - const ROUTE_29 ; 02 - const CHERRYGROVE_CITY ; 03 - const ROUTE_30 ; 04 - const ROUTE_31 ; 05 - const VIOLET_CITY ; 06 - const SPROUT_TOWER ; 07 - const ROUTE_32 ; 08 - const RUINS_OF_ALPH ; 09 - const UNION_CAVE ; 0a - const ROUTE_33 ; 0b - const AZALEA_TOWN ; 0c - const SLOWPOKE_WELL ; 0d - const ILEX_FOREST ; 0e - const ROUTE_34 ; 0f - const GOLDENROD_CITY ; 10 - const RADIO_TOWER ; 11 - const ROUTE_35 ; 12 - const NATIONAL_PARK ; 13 - const ROUTE_36 ; 14 - const ROUTE_37 ; 15 - const ECRUTEAK_CITY ; 16 - const TIN_TOWER ; 17 - const BURNED_TOWER ; 18 - const ROUTE_38 ; 19 - const ROUTE_39 ; 1a - const OLIVINE_CITY ; 1b - const LIGHTHOUSE ; 1c - const BATTLE_TOWER ; 1d - const ROUTE_40 ; 1e - const WHIRL_ISLANDS ; 1f - const ROUTE_41 ; 20 - const CIANWOOD_CITY ; 21 - const ROUTE_42 ; 22 - const MT_MORTAR ; 23 - const MAHOGANY_TOWN ; 24 - const ROUTE_43 ; 25 - const LAKE_OF_RAGE ; 26 - const ROUTE_44 ; 27 - const ICE_PATH ; 28 - const BLACKTHORN_CITY ; 29 - const DRAGONS_DEN ; 2a - const ROUTE_45 ; 2b - const DARK_CAVE ; 2c - const ROUTE_46 ; 2d - const SILVER_CAVE ; 2e - -KANTO_LANDMARK EQU const_value - const PALLET_TOWN ; 2f - const ROUTE_1 ; 30 - const VIRIDIAN_CITY ; 31 - const ROUTE_2 ; 32 - const PEWTER_CITY ; 33 - const ROUTE_3 ; 34 - const MT_MOON ; 35 - const ROUTE_4 ; 36 - const CERULEAN_CITY ; 37 - const ROUTE_24 ; 38 - const ROUTE_25 ; 39 - const ROUTE_5 ; 3a - const UNDERGROUND_PATH ; 3b - const ROUTE_6 ; 3c - const VERMILION_CITY ; 3d - const DIGLETTS_CAVE ; 3e - const ROUTE_7 ; 3f - const ROUTE_8 ; 40 - const ROUTE_9 ; 41 - const ROCK_TUNNEL ; 42 - const ROUTE_10 ; 43 - const POWER_PLANT ; 44 - const LAVENDER_TOWN ; 45 - const LAV_RADIO_TOWER ; 46 - const CELADON_CITY ; 47 - const SAFFRON_CITY ; 48 - const ROUTE_11 ; 49 - const ROUTE_12 ; 4a - const ROUTE_13 ; 4b - const ROUTE_14 ; 4c - const ROUTE_15 ; 4d - const ROUTE_16 ; 4e - const ROUTE_17 ; 4f - const ROUTE_18 ; 50 - const FUCHSIA_CITY ; 51 - const ROUTE_19 ; 52 - const ROUTE_20 ; 53 - const SEAFOAM_ISLANDS ; 54 - const CINNABAR_ISLAND ; 55 - const ROUTE_21 ; 56 - const ROUTE_22 ; 57 - const VICTORY_ROAD ; 58 - const ROUTE_23 ; 59 - const INDIGO_PLATEAU ; 5a - const ROUTE_26 ; 5b - const ROUTE_27 ; 5c - const TOHJO_FALLS ; 5d - const ROUTE_28 ; 5e - const FAST_SHIP ; 5f + const LANDMARK_NEW_BARK_TOWN ; 01 + const LANDMARK_ROUTE_29 ; 02 + const LANDMARK_CHERRYGROVE_CITY ; 03 + const LANDMARK_ROUTE_30 ; 04 + const LANDMARK_ROUTE_31 ; 05 + const LANDMARK_VIOLET_CITY ; 06 + const LANDMARK_SPROUT_TOWER ; 07 + const LANDMARK_ROUTE_32 ; 08 + const LANDMARK_RUINS_OF_ALPH ; 09 + const LANDMARK_UNION_CAVE ; 0a + const LANDMARK_ROUTE_33 ; 0b + const LANDMARK_AZALEA_TOWN ; 0c + const LANDMARK_SLOWPOKE_WELL ; 0d + const LANDMARK_ILEX_FOREST ; 0e + const LANDMARK_ROUTE_34 ; 0f + const LANDMARK_GOLDENROD_CITY ; 10 + const LANDMARK_RADIO_TOWER ; 11 + const LANDMARK_ROUTE_35 ; 12 + const LANDMARK_NATIONAL_PARK ; 13 + const LANDMARK_ROUTE_36 ; 14 + const LANDMARK_ROUTE_37 ; 15 + const LANDMARK_ECRUTEAK_CITY ; 16 + const LANDMARK_TIN_TOWER ; 17 + const LANDMARK_BURNED_TOWER ; 18 + const LANDMARK_ROUTE_38 ; 19 + const LANDMARK_ROUTE_39 ; 1a + const LANDMARK_OLIVINE_CITY ; 1b + const LANDMARK_LIGHTHOUSE ; 1c + const LANDMARK_BATTLE_TOWER ; 1d + const LANDMARK_ROUTE_40 ; 1e + const LANDMARK_WHIRL_ISLANDS ; 1f + const LANDMARK_ROUTE_41 ; 20 + const LANDMARK_CIANWOOD_CITY ; 21 + const LANDMARK_ROUTE_42 ; 22 + const LANDMARK_MT_MORTAR ; 23 + const LANDMARK_MAHOGANY_TOWN ; 24 + const LANDMARK_ROUTE_43 ; 25 + const LANDMARK_LAKE_OF_RAGE ; 26 + const LANDMARK_ROUTE_44 ; 27 + const LANDMARK_ICE_PATH ; 28 + const LANDMARK_BLACKTHORN_CITY ; 29 + const LANDMARK_DRAGONS_DEN ; 2a + const LANDMARK_ROUTE_45 ; 2b + const LANDMARK_DARK_CAVE ; 2c + const LANDMARK_ROUTE_46 ; 2d + const LANDMARK_SILVER_CAVE ; 2e +DEF KANTO_LANDMARK EQU const_value + const LANDMARK_PALLET_TOWN ; 2f + const LANDMARK_ROUTE_1 ; 30 + const LANDMARK_VIRIDIAN_CITY ; 31 + const LANDMARK_ROUTE_2 ; 32 + const LANDMARK_PEWTER_CITY ; 33 + const LANDMARK_ROUTE_3 ; 34 + const LANDMARK_MT_MOON ; 35 + const LANDMARK_ROUTE_4 ; 36 + const LANDMARK_CERULEAN_CITY ; 37 + const LANDMARK_ROUTE_24 ; 38 + const LANDMARK_ROUTE_25 ; 39 + const LANDMARK_ROUTE_5 ; 3a + const LANDMARK_UNDERGROUND_PATH ; 3b + const LANDMARK_ROUTE_6 ; 3c + const LANDMARK_VERMILION_CITY ; 3d + const LANDMARK_DIGLETTS_CAVE ; 3e + const LANDMARK_ROUTE_7 ; 3f + const LANDMARK_ROUTE_8 ; 40 + const LANDMARK_ROUTE_9 ; 41 + const LANDMARK_ROCK_TUNNEL ; 42 + const LANDMARK_ROUTE_10 ; 43 + const LANDMARK_POWER_PLANT ; 44 + const LANDMARK_LAVENDER_TOWN ; 45 + const LANDMARK_LAV_RADIO_TOWER ; 46 + const LANDMARK_CELADON_CITY ; 47 + const LANDMARK_SAFFRON_CITY ; 48 + const LANDMARK_ROUTE_11 ; 49 + const LANDMARK_ROUTE_12 ; 4a + const LANDMARK_ROUTE_13 ; 4b + const LANDMARK_ROUTE_14 ; 4c + const LANDMARK_ROUTE_15 ; 4d + const LANDMARK_ROUTE_16 ; 4e + const LANDMARK_ROUTE_17 ; 4f + const LANDMARK_ROUTE_18 ; 50 + const LANDMARK_FUCHSIA_CITY ; 51 + const LANDMARK_ROUTE_19 ; 52 + const LANDMARK_ROUTE_20 ; 53 + const LANDMARK_SEAFOAM_ISLANDS ; 54 + const LANDMARK_CINNABAR_ISLAND ; 55 + const LANDMARK_ROUTE_21 ; 56 + const LANDMARK_ROUTE_22 ; 57 + const LANDMARK_VICTORY_ROAD ; 58 + const LANDMARK_ROUTE_23 ; 59 + const LANDMARK_INDIGO_PLATEAU ; 5a + const LANDMARK_ROUTE_26 ; 5b + const LANDMARK_ROUTE_27 ; 5c + const LANDMARK_TOHJO_FALLS ; 5d + const LANDMARK_ROUTE_28 ; 5e + const LANDMARK_FAST_SHIP ; 5f +DEF NUM_LANDMARKS EQU const_value ; used in CaughtData -GIFT_LOCATION EQU $7e -EVENT_LOCATION EQU $7f + const_def $7f, -1 + const LANDMARK_EVENT ; $7f + const LANDMARK_GIFT ; $7e ; Regions const_def const JOHTO_REGION ; 0 const KANTO_REGION ; 1 -NUM_REGIONS EQU const_value +DEF NUM_REGIONS EQU const_value diff --git a/pokecrystal/constants/map_constants.asm b/pokecrystal/constants/map_constants.asm index 7c07c9e..5f58877 100644 --- a/pokecrystal/constants/map_constants.asm +++ b/pokecrystal/constants/map_constants.asm @@ -1,16 +1,25 @@ -newgroup: MACRO -const_value = const_value + 1 - enum_start 1 +MACRO newgroup +;\1: group id + const_skip + DEF MAPGROUP_\1 EQU const_value + DEF CURRENT_NUM_MAPGROUP_MAPS EQUS "NUM_\1_MAPS" + DEF __map_value__ = 1 ENDM -map_const: MACRO +MACRO map_const ;\1: map id ;\2: width: in blocks ;\3: height: in blocks -GROUP_\1 EQU const_value - enum MAP_\1 -\1_WIDTH EQU \2 -\1_HEIGHT EQU \3 + DEF GROUP_\1 EQU const_value + DEF MAP_\1 EQU __map_value__ + DEF __map_value__ += 1 + DEF \1_WIDTH EQU \2 + DEF \1_HEIGHT EQU \3 +ENDM + +MACRO endgroup + DEF {CURRENT_NUM_MAPGROUP_MAPS} EQU __map_value__ - 1 + PURGE CURRENT_NUM_MAPGROUP_MAPS ENDM ; map group ids @@ -26,8 +35,7 @@ ENDM ; - scripts and events (see data/maps/scripts.asm) const_def - newgroup ; 1 - + newgroup OLIVINE ; 1 map_const OLIVINE_POKECENTER_1F, 5, 4 ; 1 map_const OLIVINE_GYM, 5, 8 ; 2 map_const OLIVINE_TIMS_HOUSE, 4, 4 ; 3 @@ -42,9 +50,9 @@ ENDM map_const ROUTE_38, 20, 9 ; 12 map_const ROUTE_39, 10, 18 ; 13 map_const OLIVINE_CITY, 20, 18 ; 14 + endgroup - newgroup ; 2 - + newgroup MAHOGANY ; 2 map_const MAHOGANY_RED_GYARADOS_SPEECH_HOUSE, 4, 4 ; 1 map_const MAHOGANY_GYM, 5, 9 ; 2 map_const MAHOGANY_POKECENTER_1F, 5, 4 ; 3 @@ -52,9 +60,9 @@ ENDM map_const ROUTE_42, 30, 9 ; 5 map_const ROUTE_44, 30, 9 ; 6 map_const MAHOGANY_TOWN, 10, 9 ; 7 + endgroup - newgroup ; 3 - + newgroup DUNGEONS ; 3 map_const SPROUT_TOWER_1F, 10, 8 ; 1 map_const SPROUT_TOWER_2F, 10, 8 ; 2 map_const SPROUT_TOWER_3F, 10, 8 ; 3 @@ -146,21 +154,21 @@ ENDM map_const SAFARI_ZONE_FUCHSIA_GATE_BETA, 5, 4 ; 89 map_const SAFARI_ZONE_BETA, 10, 18 ; 90 map_const VICTORY_ROAD, 10, 36 ; 91 + endgroup - newgroup ; 4 - + newgroup ECRUTEAK ; 4 map_const ECRUTEAK_TIN_TOWER_ENTRANCE, 10, 9 ; 1 map_const WISE_TRIOS_ROOM, 4, 4 ; 2 map_const ECRUTEAK_POKECENTER_1F, 5, 4 ; 3 map_const ECRUTEAK_LUGIA_SPEECH_HOUSE, 4, 4 ; 4 - map_const DANCE_THEATRE, 6, 7 ; 5 + map_const DANCE_THEATER, 6, 7 ; 5 map_const ECRUTEAK_MART, 6, 4 ; 6 map_const ECRUTEAK_GYM, 5, 9 ; 7 map_const ECRUTEAK_ITEMFINDER_HOUSE, 4, 4 ; 8 map_const ECRUTEAK_CITY, 20, 18 ; 9 + endgroup - newgroup ; 5 - + newgroup BLACKTHORN ; 5 map_const BLACKTHORN_GYM_1F, 5, 9 ; 1 map_const BLACKTHORN_GYM_2F, 5, 9 ; 2 map_const BLACKTHORN_DRAGON_SPEECH_HOUSE, 4, 4 ; 3 @@ -171,9 +179,9 @@ ENDM map_const ROUTE_45, 10, 45 ; 8 map_const ROUTE_46, 10, 18 ; 9 map_const BLACKTHORN_CITY, 20, 18 ; 10 + endgroup - newgroup ; 6 - + newgroup CINNABAR ; 6 map_const CINNABAR_POKECENTER_1F, 5, 4 ; 1 map_const CINNABAR_POKECENTER_2F_BETA, 8, 4 ; 2 map_const ROUTE_19_FUCHSIA_GATE, 5, 4 ; 3 @@ -182,9 +190,9 @@ ENDM map_const ROUTE_20, 30, 9 ; 6 map_const ROUTE_21, 10, 18 ; 7 map_const CINNABAR_ISLAND, 10, 9 ; 8 + endgroup - newgroup ; 7 - + newgroup CERULEAN ; 7 map_const CERULEAN_GYM_BADGE_SPEECH_HOUSE, 4, 4 ; 1 map_const CERULEAN_POLICE_STATION, 4, 4 ; 2 map_const CERULEAN_TRADE_SPEECH_HOUSE, 4, 4 ; 3 @@ -202,9 +210,9 @@ ENDM map_const ROUTE_24, 10, 9 ; 15 map_const ROUTE_25, 30, 9 ; 16 map_const CERULEAN_CITY, 20, 18 ; 17 + endgroup - newgroup ; 8 - + newgroup AZALEA ; 8 map_const AZALEA_POKECENTER_1F, 5, 4 ; 1 map_const CHARCOAL_KILN, 4, 4 ; 2 map_const AZALEA_MART, 6, 4 ; 3 @@ -212,18 +220,18 @@ ENDM map_const AZALEA_GYM, 5, 8 ; 5 map_const ROUTE_33, 10, 9 ; 6 map_const AZALEA_TOWN, 20, 9 ; 7 + endgroup - newgroup ; 9 - + newgroup LAKE_OF_RAGE ; 9 map_const LAKE_OF_RAGE_HIDDEN_POWER_HOUSE, 4, 4 ; 1 map_const LAKE_OF_RAGE_MAGIKARP_HOUSE, 4, 4 ; 2 map_const ROUTE_43_MAHOGANY_GATE, 5, 4 ; 3 map_const ROUTE_43_GATE, 5, 4 ; 4 map_const ROUTE_43, 10, 27 ; 5 map_const LAKE_OF_RAGE, 20, 18 ; 6 + endgroup - newgroup ; 10 - + newgroup VIOLET ; 10 map_const ROUTE_32, 10, 45 ; 1 map_const ROUTE_35, 10, 18 ; 2 map_const ROUTE_36, 30, 9 ; 3 @@ -241,9 +249,9 @@ ENDM map_const ROUTE_35_NATIONAL_PARK_GATE, 4, 4 ; 15 map_const ROUTE_36_RUINS_OF_ALPH_GATE, 5, 4 ; 16 map_const ROUTE_36_NATIONAL_PARK_GATE, 5, 4 ; 17 + endgroup - newgroup ; 11 - + newgroup GOLDENROD ; 11 map_const ROUTE_34, 10, 27 ; 1 map_const GOLDENROD_CITY, 20, 18 ; 2 map_const GOLDENROD_GYM, 10, 9 ; 3 @@ -263,14 +271,14 @@ ENDM map_const GOLDENROD_DEPT_STORE_ELEVATOR, 2, 2 ; 17 map_const GOLDENROD_DEPT_STORE_ROOF, 8, 4 ; 18 map_const GOLDENROD_GAME_CORNER, 10, 7 ; 19 - map_const GOLDENROD_POKECENTER_1F, 5, 4 ; 20 + map_const GOLDENROD_POKECENTER_1F, 16, 16 ; 20 map_const POKECOM_CENTER_ADMIN_OFFICE_MOBILE, 16, 16 ; 21 map_const ILEX_FOREST_AZALEA_GATE, 5, 4 ; 22 map_const ROUTE_34_ILEX_FOREST_GATE, 5, 4 ; 23 map_const DAY_CARE, 5, 4 ; 24 + endgroup - newgroup ; 12 - + newgroup VERMILION ; 12 map_const ROUTE_6, 10, 9 ; 1 map_const ROUTE_11, 20, 9 ; 2 map_const VERMILION_CITY, 20, 18 ; 3 @@ -284,18 +292,18 @@ ENDM map_const VERMILION_GYM, 5, 9 ; 11 map_const ROUTE_6_SAFFRON_GATE, 5, 4 ; 12 map_const ROUTE_6_UNDERGROUND_PATH_ENTRANCE, 4, 4 ; 13 + endgroup - newgroup ; 13 - + newgroup PALLET ; 13 map_const ROUTE_1, 10, 18 ; 1 map_const PALLET_TOWN, 10, 9 ; 2 map_const REDS_HOUSE_1F, 4, 4 ; 3 map_const REDS_HOUSE_2F, 4, 4 ; 4 map_const BLUES_HOUSE, 4, 4 ; 5 map_const OAKS_LAB, 5, 6 ; 6 + endgroup - newgroup ; 14 - + newgroup PEWTER ; 14 map_const ROUTE_3, 30, 9 ; 1 map_const PEWTER_CITY, 20, 18 ; 2 map_const PEWTER_NIDORAN_SPEECH_HOUSE, 4, 4 ; 3 @@ -304,9 +312,9 @@ ENDM map_const PEWTER_POKECENTER_1F, 5, 4 ; 6 map_const PEWTER_POKECENTER_2F_BETA, 8, 4 ; 7 map_const PEWTER_SNOOZE_SPEECH_HOUSE, 4, 4 ; 8 + endgroup - newgroup ; 15 - + newgroup FAST_SHIP ; 15 map_const OLIVINE_PORT, 10, 18 ; 1 map_const VERMILION_PORT, 10, 18 ; 2 map_const FAST_SHIP_1F, 16, 9 ; 3 @@ -319,9 +327,9 @@ ENDM map_const MOUNT_MOON_SQUARE, 15, 9 ; 10 map_const MOUNT_MOON_GIFT_SHOP, 4, 4 ; 11 map_const TIN_TOWER_ROOF, 10, 9 ; 12 + endgroup - newgroup ; 16 - + newgroup INDIGO ; 16 map_const ROUTE_23, 10, 9 ; 1 map_const INDIGO_PLATEAU_POKECENTER_1F, 9, 7 ; 2 map_const WILLS_ROOM, 5, 9 ; 3 @@ -330,9 +338,9 @@ ENDM map_const KARENS_ROOM, 5, 9 ; 6 map_const LANCES_ROOM, 5, 12 ; 7 map_const HALL_OF_FAME, 5, 7 ; 8 + endgroup - newgroup ; 17 - + newgroup FUCHSIA ; 17 map_const ROUTE_13, 30, 9 ; 1 map_const ROUTE_14, 10, 18 ; 2 map_const ROUTE_15, 20, 9 ; 3 @@ -346,9 +354,9 @@ ENDM map_const FUCHSIA_POKECENTER_2F_BETA, 8, 4 ; 11 map_const SAFARI_ZONE_WARDENS_HOME, 5, 4 ; 12 map_const ROUTE_15_FUCHSIA_GATE, 5, 4 ; 13 + endgroup - newgroup ; 18 - + newgroup LAVENDER ; 18 map_const ROUTE_8, 20, 9 ; 1 map_const ROUTE_12, 10, 27 ; 2 map_const ROUTE_10_SOUTH, 10, 9 ; 3 @@ -363,25 +371,25 @@ ENDM map_const LAV_RADIO_TOWER_1F, 10, 4 ; 12 map_const ROUTE_8_SAFFRON_GATE, 5, 4 ; 13 map_const ROUTE_12_SUPER_ROD_HOUSE, 4, 4 ; 14 + endgroup - newgroup ; 19 - + newgroup SILVER ; 19 map_const ROUTE_28, 20, 9 ; 1 map_const SILVER_CAVE_OUTSIDE, 20, 18 ; 2 map_const SILVER_CAVE_POKECENTER_1F, 5, 4 ; 3 map_const ROUTE_28_STEEL_WING_HOUSE, 4, 4 ; 4 + endgroup - newgroup ; 20 - + newgroup CABLE_CLUB ; 20 map_const POKECENTER_2F, 8, 4 ; 1 map_const TRADE_CENTER, 5, 4 ; 2 map_const COLOSSEUM, 5, 4 ; 3 map_const TIME_CAPSULE, 5, 4 ; 4 map_const MOBILE_TRADE_ROOM, 5, 4 ; 5 map_const MOBILE_BATTLE_ROOM, 5, 4 ; 6 + endgroup - newgroup ; 21 - + newgroup CELADON ; 21 map_const ROUTE_7, 10, 9 ; 1 map_const ROUTE_16, 10, 9 ; 2 map_const ROUTE_17, 10, 45 ; 3 @@ -408,9 +416,9 @@ ENDM map_const ROUTE_16_GATE, 5, 4 ; 24 map_const ROUTE_7_SAFFRON_GATE, 5, 4 ; 25 map_const ROUTE_17_ROUTE_18_GATE, 5, 4 ; 26 + endgroup - newgroup ; 22 - + newgroup CIANWOOD ; 22 map_const ROUTE_40, 10, 18 ; 1 map_const ROUTE_41, 25, 27 ; 2 map_const CIANWOOD_CITY, 15, 27 ; 3 @@ -427,9 +435,9 @@ ENDM map_const BATTLE_TOWER_HALLWAY, 11, 2 ; 14 map_const ROUTE_40_BATTLE_TOWER_GATE, 5, 4 ; 15 map_const BATTLE_TOWER_OUTSIDE, 10, 14 ; 16 + endgroup - newgroup ; 23 - + newgroup VIRIDIAN ; 23 map_const ROUTE_2, 10, 27 ; 1 map_const ROUTE_22, 20, 9 ; 2 map_const VIRIDIAN_CITY, 20, 18 ; 3 @@ -443,9 +451,9 @@ ENDM map_const ROUTE_2_NUGGET_HOUSE, 4, 4 ; 11 map_const ROUTE_2_GATE, 5, 4 ; 12 map_const VICTORY_ROAD_GATE, 10, 9 ; 13 + endgroup - newgroup ; 24 - + newgroup NEW_BARK ; 24 map_const ROUTE_26, 10, 54 ; 1 map_const ROUTE_27, 40, 9 ; 2 map_const ROUTE_29, 30, 9 ; 3 @@ -459,9 +467,9 @@ ENDM map_const DAY_OF_WEEK_SIBLINGS_HOUSE, 4, 4 ; 11 map_const ROUTE_27_SANDSTORM_HOUSE, 4, 4 ; 12 map_const ROUTE_29_ROUTE_46_GATE, 5, 4 ; 13 + endgroup - newgroup ; 25 - + newgroup SAFFRON ; 25 map_const ROUTE_5, 10, 9 ; 1 map_const SAFFRON_CITY, 20, 18 ; 2 map_const FIGHTING_DOJO, 5, 6 ; 3 @@ -477,9 +485,9 @@ ENDM map_const ROUTE_5_UNDERGROUND_PATH_ENTRANCE, 4, 4 ; 13 map_const ROUTE_5_SAFFRON_GATE, 5, 4 ; 14 map_const ROUTE_5_CLEANSE_TAG_HOUSE, 4, 4 ; 15 + endgroup - newgroup ; 26 - + newgroup CHERRYGROVE ; 26 map_const ROUTE_30, 10, 27 ; 1 map_const ROUTE_31, 20, 9 ; 2 map_const CHERRYGROVE_CITY, 20, 9 ; 3 @@ -491,3 +499,6 @@ ENDM map_const ROUTE_30_BERRY_HOUSE, 4, 4 ; 9 map_const MR_POKEMONS_HOUSE, 4, 4 ; 10 map_const ROUTE_31_VIOLET_GATE, 5, 4 ; 11 + endgroup + +DEF NUM_MAP_GROUPS EQU const_value ; 26 diff --git a/pokecrystal/constants/map_data_constants.asm b/pokecrystal/constants/map_data_constants.asm index 78b3c22..5d18ce3 100644 --- a/pokecrystal/constants/map_data_constants.asm +++ b/pokecrystal/constants/map_data_constants.asm @@ -1,21 +1,24 @@ -GROUP_N_A EQU -1 -MAP_N_A EQU -1 -GROUP_NONE EQU 0 -MAP_NONE EQU 0 +DEF MAPGROUP_N_A EQU -1 +DEF GROUP_N_A EQU -1 +DEF MAP_N_A EQU -1 +DEF MAPGROUP_NONE EQU 0 +DEF GROUP_NONE EQU 0 +DEF MAP_NONE EQU 0 ; map struct members (see data/maps/maps.asm) - const_def - const MAP_MAPATTRIBUTES_BANK ; 0 - const MAP_TILESET ; 1 - const MAP_ENVIRONMENT ; 2 - const MAP_MAPATTRIBUTES ; 3 - const MAP_MAPATTRIBUTES_HI ; 4 - const MAP_LOCATION ; 5 - const MAP_MUSIC ; 6 - const MAP_PALETTE ; 7 - const MAP_FISHGROUP ; 8 +rsreset +DEF MAP_MAPATTRIBUTES_BANK rb ; 0 +DEF MAP_TILESET rb ; 1 +DEF MAP_ENVIRONMENT rb ; 2 +DEF MAP_MAPATTRIBUTES rw ; 3 +DEF MAP_LOCATION rb ; 5 +DEF MAP_MUSIC rb ; 6 +DEF MAP_PALETTE rb ; 7 +DEF MAP_FISHGROUP rb ; 8 +DEF MAP_LENGTH EQU _RS ; map environments (wEnvironment) +; EnvironmentColorsPointers indexes (see data/maps/environment_colors.asm) const_def 1 const TOWN const ROUTE @@ -24,6 +27,7 @@ MAP_NONE EQU 0 const ENVIRONMENT_5 const GATE const DUNGEON +DEF NUM_ENVIRONMENTS EQU const_value - 1 ; map palettes (wEnvironment) const_def @@ -32,6 +36,7 @@ MAP_NONE EQU 0 const PALETTE_NITE const PALETTE_MORN const PALETTE_DARK +DEF NUM_MAP_PALETTES EQU const_value ; FishGroups indexes (see data/wild/fish.asm) const_def @@ -49,6 +54,7 @@ MAP_NONE EQU 0 const FISHGROUP_QWILFISH const FISHGROUP_REMORAID const FISHGROUP_QWILFISH_NO_SWARM +DEF NUM_FISHGROUPS EQU const_value - 1 ; connection directions (see data/maps/data.asm) const_def @@ -65,8 +71,7 @@ MAP_NONE EQU 0 shift_const NORTH ; SpawnPoints indexes (see data/maps/spawn_points.asm) -const_value = -1 - const SPAWN_N_A + const_def const SPAWN_HOME const SPAWN_DEBUG ; kanto @@ -97,6 +102,40 @@ const_value = -1 const SPAWN_BLACKTHORN const SPAWN_MT_SILVER const SPAWN_FAST_SHIP -NUM_SPAWNS EQU const_value +DEF NUM_SPAWNS EQU const_value -MAX_OUTDOOR_SPRITES EQU 23 ; see engine/overworld/overworld.asm +DEF SPAWN_N_A EQU -1 + +; Flypoints indexes (see data/maps/flypoints.asm) + const_def +; johto +DEF JOHTO_FLYPOINT EQU const_value + const FLY_NEW_BARK + const FLY_CHERRYGROVE + const FLY_VIOLET + const FLY_AZALEA + const FLY_GOLDENROD + const FLY_ECRUTEAK + const FLY_OLIVINE + const FLY_CIANWOOD + const FLY_MAHOGANY + const FLY_LAKE_OF_RAGE + const FLY_BLACKTHORN + const FLY_MT_SILVER +; kanto +DEF KANTO_FLYPOINT EQU const_value + const FLY_PALLET + const FLY_VIRIDIAN + const FLY_PEWTER + const FLY_CERULEAN + const FLY_VERMILION + const FLY_ROCK_TUNNEL + const FLY_LAVENDER + const FLY_CELADON + const FLY_SAFFRON + const FLY_FUCHSIA + const FLY_CINNABAR + const FLY_INDIGO +DEF NUM_FLYPOINTS EQU const_value + +DEF MAX_OUTDOOR_SPRITES EQU 23 ; see engine/overworld/overworld.asm diff --git a/pokecrystal/constants/map_object_constants.asm b/pokecrystal/constants/map_object_constants.asm index 00ddb77..b1a88ae 100644 --- a/pokecrystal/constants/map_object_constants.asm +++ b/pokecrystal/constants/map_object_constants.asm @@ -1,47 +1,47 @@ -; object_struct members (see macros/wram.asm) - const_def - const OBJECT_SPRITE ; 00 - const OBJECT_MAP_OBJECT_INDEX ; 01 - const OBJECT_SPRITE_TILE ; 02 - const OBJECT_MOVEMENTTYPE ; 03 - const OBJECT_FLAGS1 ; 04 - const OBJECT_FLAGS2 ; 05 - const OBJECT_PALETTE ; 06 - const OBJECT_DIRECTION_WALKING ; 07 - const OBJECT_FACING ; 08 - const OBJECT_STEP_TYPE ; 09 - const OBJECT_STEP_DURATION ; 0a - const OBJECT_ACTION ; 0b - const OBJECT_STEP_FRAME ; 0c - const OBJECT_FACING_STEP ; 0d - const OBJECT_NEXT_TILE ; 0e - const OBJECT_STANDING_TILE ; 0f - const OBJECT_NEXT_MAP_X ; 10 - const OBJECT_NEXT_MAP_Y ; 11 - const OBJECT_MAP_X ; 12 - const OBJECT_MAP_Y ; 13 - const OBJECT_INIT_X ; 14 - const OBJECT_INIT_Y ; 15 - const OBJECT_RADIUS ; 16 - const OBJECT_SPRITE_X ; 17 - const OBJECT_SPRITE_Y ; 18 - const OBJECT_SPRITE_X_OFFSET ; 19 - const OBJECT_SPRITE_Y_OFFSET ; 1a - const OBJECT_MOVEMENT_BYTE_INDEX ; 1b - const OBJECT_1C ; 1c - const OBJECT_1D ; 1d - const OBJECT_1E ; 1e - const OBJECT_1F ; 1f - const OBJECT_RANGE ; 20 - ; 21-27 are not used -OBJECT_STRUCT_LENGTH EQU 40 -NUM_OBJECT_STRUCTS EQU 13 ; see wObjectStructs +; object_struct members (see macros/ram.asm) +rsreset +DEF OBJECT_SPRITE rb ; 00 +DEF OBJECT_MAP_OBJECT_INDEX rb ; 01 +DEF OBJECT_SPRITE_TILE rb ; 02 +DEF OBJECT_MOVEMENT_TYPE rb ; 03 +DEF OBJECT_FLAGS1 rb ; 04 +DEF OBJECT_FLAGS2 rb ; 05 +DEF OBJECT_PALETTE rb ; 06 +DEF OBJECT_WALKING rb ; 07 +DEF OBJECT_DIRECTION rb ; 08 +DEF OBJECT_STEP_TYPE rb ; 09 +DEF OBJECT_STEP_DURATION rb ; 0a +DEF OBJECT_ACTION rb ; 0b +DEF OBJECT_STEP_FRAME rb ; 0c +DEF OBJECT_FACING rb ; 0d +DEF OBJECT_TILE rb ; 0e +DEF OBJECT_LAST_TILE rb ; 0f +DEF OBJECT_MAP_X rb ; 10 +DEF OBJECT_MAP_Y rb ; 11 +DEF OBJECT_LAST_MAP_X rb ; 12 +DEF OBJECT_LAST_MAP_Y rb ; 13 +DEF OBJECT_INIT_X rb ; 14 +DEF OBJECT_INIT_Y rb ; 15 +DEF OBJECT_RADIUS rb ; 16 +DEF OBJECT_SPRITE_X rb ; 17 +DEF OBJECT_SPRITE_Y rb ; 18 +DEF OBJECT_SPRITE_X_OFFSET rb ; 19 +DEF OBJECT_SPRITE_Y_OFFSET rb ; 1a +DEF OBJECT_MOVEMENT_INDEX rb ; 1b +DEF OBJECT_STEP_INDEX rb ; 1c +DEF OBJECT_1D rb ; 1d +DEF OBJECT_1E rb ; 1e +DEF OBJECT_JUMP_HEIGHT rb ; 1f +DEF OBJECT_RANGE rb ; 20 + rb_skip 7 +DEF OBJECT_LENGTH EQU _RS +DEF NUM_OBJECT_STRUCTS EQU 13 ; see wObjectStructs -; object_struct OBJECT_FACING values -OW_DOWN EQU DOWN << 2 -OW_UP EQU UP << 2 -OW_LEFT EQU LEFT << 2 -OW_RIGHT EQU RIGHT << 2 +; object_struct OBJECT_DIRECTION values +DEF OW_DOWN EQU DOWN << 2 +DEF OW_UP EQU UP << 2 +DEF OW_LEFT EQU LEFT << 2 +DEF OW_RIGHT EQU RIGHT << 2 ; object_struct OBJECT_FLAGS1 bit flags const_def @@ -54,14 +54,14 @@ OW_RIGHT EQU RIGHT << 2 const NOCLIP_OBJS_F ; 6 const EMOTE_OBJECT_F ; 7 -INVISIBLE EQU 1 << INVISIBLE_F -WONT_DELETE EQU 1 << WONT_DELETE_F -FIXED_FACING EQU 1 << FIXED_FACING_F -SLIDING EQU 1 << SLIDING_F -NOCLIP_TILES EQU 1 << NOCLIP_TILES_F -MOVE_ANYWHERE EQU 1 << MOVE_ANYWHERE_F -NOCLIP_OBJS EQU 1 << NOCLIP_OBJS_F -EMOTE_OBJECT EQU 1 << EMOTE_OBJECT_F +DEF INVISIBLE EQU 1 << INVISIBLE_F +DEF WONT_DELETE EQU 1 << WONT_DELETE_F +DEF FIXED_FACING EQU 1 << FIXED_FACING_F +DEF SLIDING EQU 1 << SLIDING_F +DEF NOCLIP_TILES EQU 1 << NOCLIP_TILES_F +DEF MOVE_ANYWHERE EQU 1 << MOVE_ANYWHERE_F +DEF NOCLIP_OBJS EQU 1 << NOCLIP_OBJS_F +DEF EMOTE_OBJECT EQU 1 << EMOTE_OBJECT_F ; object_struct OBJECT_FLAGS2 bit flags const_def @@ -70,14 +70,14 @@ EMOTE_OBJECT EQU 1 << EMOTE_OBJECT_F const OBJ_FLAGS2_2 ; 2 const OVERHEAD_F ; 3 const USE_OBP1_F ; 4 - const OBJ_FLAGS2_5 ; 5 + const FROZEN_F ; 5 const OBJ_FLAGS2_6 ; 6 const OBJ_FLAGS2_7 ; 7 -LOW_PRIORITY EQU 1 << LOW_PRIORITY_F -HIGH_PRIORITY EQU 1 << HIGH_PRIORITY_F -OVERHEAD EQU 1 << OVERHEAD_F -USE_OBP1 EQU 1 << USE_OBP1_F +DEF LOW_PRIORITY EQU 1 << LOW_PRIORITY_F +DEF HIGH_PRIORITY EQU 1 << HIGH_PRIORITY_F +DEF OVERHEAD EQU 1 << OVERHEAD_F +DEF USE_OBP1 EQU 1 << USE_OBP1_F ; object_struct OBJECT_PALETTE bit flags const_def 5 @@ -85,49 +85,48 @@ USE_OBP1 EQU 1 << USE_OBP1_F const STRENGTH_BOULDER_F ; 6 const BIG_OBJECT_F ; 7 -SWIMMING EQU 1 << SWIMMING_F -STRENGTH_BOULDER EQU 1 << STRENGTH_BOULDER_F -BIG_OBJECT EQU 1 << BIG_OBJECT_F +DEF SWIMMING EQU 1 << SWIMMING_F +DEF STRENGTH_BOULDER EQU 1 << STRENGTH_BOULDER_F +DEF BIG_OBJECT EQU 1 << BIG_OBJECT_F ; facing attribute bit flags -RELATIVE_ATTRIBUTES_F EQU 1 -ABSOLUTE_TILE_ID_F EQU 2 +DEF RELATIVE_ATTRIBUTES_F EQU 1 +DEF ABSOLUTE_TILE_ID_F EQU 2 -RELATIVE_ATTRIBUTES EQU 1 << RELATIVE_ATTRIBUTES_F -ABSOLUTE_TILE_ID EQU 1 << ABSOLUTE_TILE_ID_F +DEF RELATIVE_ATTRIBUTES EQU 1 << RELATIVE_ATTRIBUTES_F +DEF ABSOLUTE_TILE_ID EQU 1 << ABSOLUTE_TILE_ID_F -; map_object struct members (see macros/wram.asm) - const_def - const MAPOBJECT_OBJECT_STRUCT_ID ; 0 - const MAPOBJECT_SPRITE ; 1 - const MAPOBJECT_Y_COORD ; 2 - const MAPOBJECT_X_COORD ; 3 - const MAPOBJECT_MOVEMENT ; 4 - const MAPOBJECT_RADIUS ; 5 - const MAPOBJECT_HOUR ; 6 - const MAPOBJECT_TIMEOFDAY ; 7 - const MAPOBJECT_COLOR ; 8 - const MAPOBJECT_RANGE ; 9 - const MAPOBJECT_SCRIPT_POINTER ; a - const MAPOBJECT_POINTER_HI ; b - const MAPOBJECT_EVENT_FLAG ; c - const MAPOBJECT_FLAG_HI ; d - const MAPOBJECT_E ; unused - const MAPOBJECT_F ; unused -OBJECT_LENGTH EQU const_value +; map_object struct members (see macros/ram.asm) +rsreset +DEF MAPOBJECT_OBJECT_STRUCT_ID rb ; 0 +DEF MAPOBJECT_SPRITE rb ; 1 +DEF MAPOBJECT_Y_COORD rb ; 2 +DEF MAPOBJECT_X_COORD rb ; 3 +DEF MAPOBJECT_MOVEMENT rb ; 4 +DEF MAPOBJECT_RADIUS rb ; 5 +DEF MAPOBJECT_HOUR rb ; 6 +DEF MAPOBJECT_TIMEOFDAY rb ; 7 +DEF MAPOBJECT_COLOR rb ; 8 +DEF MAPOBJECT_RANGE rb ; 9 +DEF MAPOBJECT_SCRIPT_POINTER rw ; a +DEF MAPOBJECT_EVENT_FLAG rw ; c + rb_skip 2 +DEF MAPOBJECT_LENGTH EQU _RS +DEF NUM_OBJECTS EQU 16 +DEF PLAYER_OBJECT EQU 0 ; SpriteMovementData struct members (see data/sprites/map_objects.asm) - const_def - const SPRITEMOVEATTR_MOVEMENT ; 0 - const SPRITEMOVEATTR_FACING ; 1 - const SPRITEMOVEATTR_ACTION ; 2 - const SPRITEMOVEATTR_FLAGS1 ; 3 - const SPRITEMOVEATTR_FLAGS2 ; 4 - const SPRITEMOVEATTR_PALFLAGS ; 5 -NUM_SPRITEMOVEDATA_FIELDS EQU const_value +rsreset +DEF SPRITEMOVEATTR_MOVEMENT rb ; 0 +DEF SPRITEMOVEATTR_FACING rb ; 1 +DEF SPRITEMOVEATTR_ACTION rb ; 2 +DEF SPRITEMOVEATTR_FLAGS1 rb ; 3 +DEF SPRITEMOVEATTR_FLAGS2 rb ; 4 +DEF SPRITEMOVEATTR_PALFLAGS rb ; 5 +DEF NUM_SPRITEMOVEDATA_FIELDS EQU _RS -MAPOBJECT_SCREEN_WIDTH EQU (SCREEN_WIDTH / 2) + 2 -MAPOBJECT_SCREEN_HEIGHT EQU (SCREEN_HEIGHT / 2) + 2 +DEF MAPOBJECT_SCREEN_WIDTH EQU (SCREEN_WIDTH / 2) + 2 +DEF MAPOBJECT_SCREEN_HEIGHT EQU (SCREEN_HEIGHT / 2) + 2 ; SpriteMovementData indexes (see data/sprites/map_objects.asm) const_def @@ -143,8 +142,8 @@ MAPOBJECT_SCREEN_HEIGHT EQU (SCREEN_HEIGHT / 2) + 2 const SPRITEMOVEDATA_STANDING_RIGHT ; 09 const SPRITEMOVEDATA_SPINRANDOM_FAST ; 0a const SPRITEMOVEDATA_PLAYER ; 0b - const SPRITEMOVEDATA_0C ; 0c - const SPRITEMOVEDATA_0D ; 0d + const SPRITEMOVEDATA_INDEXED_1 ; 0c + const SPRITEMOVEDATA_INDEXED_2 ; 0d const SPRITEMOVEDATA_0E ; 0e const SPRITEMOVEDATA_0F ; 0f const SPRITEMOVEDATA_10 ; 10 @@ -168,9 +167,9 @@ MAPOBJECT_SCREEN_HEIGHT EQU (SCREEN_HEIGHT / 2) + 2 const SPRITEMOVEDATA_BOULDERDUST ; 22 const SPRITEMOVEDATA_GRASS ; 23 const SPRITEMOVEDATA_SWIM_WANDER ; 24 -NUM_SPRITEMOVEDATA EQU const_value +DEF NUM_SPRITEMOVEDATA EQU const_value -; MapObjectMovementPattern.Pointers indexes (see engine/overworld/map_objects.asm) +; StepFunction_FromMovement.Pointers indexes (see engine/overworld/map_objects.asm) const_def const SPRITEMOVEFN_00 ; 00 const SPRITEMOVEFN_RANDOM_WALK_Y ; 01 @@ -180,8 +179,8 @@ NUM_SPRITEMOVEDATA EQU const_value const SPRITEMOVEFN_FAST_RANDOM_SPIN ; 05 const SPRITEMOVEFN_STANDING ; 06 const SPRITEMOVEFN_OBEY_DPAD ; 07 - const SPRITEMOVEFN_08 ; 08 - const SPRITEMOVEFN_09 ; 09 + const SPRITEMOVEFN_INDEXED_1 ; 08 + const SPRITEMOVEFN_INDEXED_2 ; 09 const SPRITEMOVEFN_0A ; 0a const SPRITEMOVEFN_0B ; 0b const SPRITEMOVEFN_0C ; 0c @@ -200,35 +199,37 @@ NUM_SPRITEMOVEDATA EQU const_value const SPRITEMOVEFN_SPIN_COUNTERCLOCKWISE ; 19 const SPRITEMOVEFN_BOULDERDUST ; 1a const SPRITEMOVEFN_GRASS ; 1b +DEF NUM_SPRITEMOVEFN EQU const_value ; StepTypesJumptable indexes (see engine/overworld/map_objects.asm) const_def - const STEP_TYPE_00 ; 00 - const STEP_TYPE_SLEEP ; 01 - const STEP_TYPE_NPC_WALK ; 02 - const STEP_TYPE_03 ; 03 - const STEP_TYPE_04 ; 04 - const STEP_TYPE_05 ; 05 - const STEP_TYPE_PLAYER_WALK ; 06 - const STEP_TYPE_07 ; 07 - const STEP_TYPE_NPC_JUMP ; 08 - const STEP_TYPE_PLAYER_JUMP ; 09 - const STEP_TYPE_HALF_STEP ; 0a - const STEP_TYPE_BUMP ; 0b - const STEP_TYPE_TELEPORT_FROM ; 0c - const STEP_TYPE_TELEPORT_TO ; 0d - const STEP_TYPE_SKYFALL ; 0e - const STEP_TYPE_0F ; 0f - const STEP_TYPE_GOT_BITE ; 10 - const STEP_TYPE_ROCK_SMASH ; 11 - const STEP_TYPE_RETURN_DIG ; 12 - const STEP_TYPE_TRACKING_OBJECT ; 13 - const STEP_TYPE_14 ; 14 - const STEP_TYPE_15 ; 15 - const STEP_TYPE_16 ; 16 - const STEP_TYPE_17 ; 17 - const STEP_TYPE_18 ; 18 - const STEP_TYPE_SKYFALL_TOP ; 19 + const STEP_TYPE_RESET ; 00 + const STEP_TYPE_FROM_MOVEMENT ; 01 + const STEP_TYPE_NPC_WALK ; 02 + const STEP_TYPE_SLEEP ; 03 + const STEP_TYPE_STANDING ; 04 + const STEP_TYPE_RESTORE ; 05 + const STEP_TYPE_PLAYER_WALK ; 06 + const STEP_TYPE_CONTINUE_WALK ; 07 + const STEP_TYPE_NPC_JUMP ; 08 + const STEP_TYPE_PLAYER_JUMP ; 09 + const STEP_TYPE_TURN ; 0a + const STEP_TYPE_BUMP ; 0b + const STEP_TYPE_TELEPORT_FROM ; 0c + const STEP_TYPE_TELEPORT_TO ; 0d + const STEP_TYPE_SKYFALL ; 0e + const STEP_TYPE_STRENGTH_BOULDER ; 0f + const STEP_TYPE_GOT_BITE ; 10 + const STEP_TYPE_ROCK_SMASH ; 11 + const STEP_TYPE_RETURN_DIG ; 12 + const STEP_TYPE_TRACKING_OBJECT ; 13 + const STEP_TYPE_14 ; 14 + const STEP_TYPE_SCREENSHAKE ; 15 + const STEP_TYPE_16 ; 16 + const STEP_TYPE_17 ; 17 + const STEP_TYPE_DELETE ; 18 + const STEP_TYPE_SKYFALL_TOP ; 19 +DEF NUM_STEP_TYPES EQU const_value ; ObjectActionPairPointers indexes (see engine/overworld/map_object_action.asm) const_def @@ -249,6 +250,7 @@ NUM_SPRITEMOVEDATA EQU const_value const OBJECT_ACTION_BOULDER_DUST ; 0e const OBJECT_ACTION_GRASS_SHAKE ; 0f const OBJECT_ACTION_SKYFALL ; 10 +DEF NUM_OBJECT_ACTIONS EQU const_value ; Facings indexes (see data/sprites/facings.asm) const_def @@ -284,6 +286,7 @@ NUM_SPRITEMOVEDATA EQU const_value const FACING_BOULDER_DUST_2 ; 1d const FACING_GRASS_1 ; 1e const FACING_GRASS_2 ; 1f +DEF NUM_FACINGS EQU const_value ; DoPlayerMovement.DoStep arguments (see engine/overworld/player_movement.asm) const_def @@ -295,3 +298,4 @@ NUM_SPRITEMOVEDATA EQU const_value const STEP_TURN ; 5 const STEP_BACK_LEDGE ; 6 const STEP_WALK_IN_PLACE ; 7 +DEF NUM_STEPS EQU const_value diff --git a/pokecrystal/constants/map_setup_constants.asm b/pokecrystal/constants/map_setup_constants.asm index 426cbb2..42d806a 100644 --- a/pokecrystal/constants/map_setup_constants.asm +++ b/pokecrystal/constants/map_setup_constants.asm @@ -13,58 +13,7 @@ const MAPSETUP_SUBMENU ; fa const MAPSETUP_BADWARP ; fb const MAPSETUP_FLY ; fc - -; MapSetupCommands indexes (see engine/overworld/map_setup.asm) -; Names taken from Condensation water's scripting compendium -; https://hax.iimarck.us/files/scriptingcodes_eng.htm - const_def - const map_lcd_on ; 00 - const map_lcd_off ; 01 - const map_sound_off ; 02 - const map_music ; 03 - const map_start_music ; 04 - const map_fade_music ; 05 - const map_fade ; 06 - const map_bike_music ; 07 - const map_music_force ; 08 - const map_max_volume ; 09 - const map_load_blocks ; 0a - const map_connection_blocks ; 0b - const map_save_screen ; 0c - const map_buffer_screen ; 0d - const map_load_graphics ; 0e - const map_load_tileset ; 0f - const map_time_of_day ; 10 - const map_palettes ; 11 - const map_wildmons ; 12 - const map_sprites ; 13 - const map_change_callback ; 14 - const map_start_callback ; 15 - const map_load_objects ; 16 - const map_load_spawn ; 17 - const map_load_connection ; 18 - const map_load_warp ; 19 - const map_load_attributes ; 1a - const map_load_attributes_2 ; 1b - const map_clear_bg_palettes ; 1c - const map_fade_out_palettes ; 1d - const map_fade_in_palettes ; 1e - const map_anchor_screen ; 1f - const map_warp_face ; 20 - const map_face_down ; 21 - const map_spawn_coord ; 22 - const map_player_coord ; 23 - const map_prolong_sprites ; 24 - const map_delay_sprites ; 25 - const map_update_roam ; 26 - const map_keep_roam ; 27 - const map_fade_out_music ; 28 - const map_animations_on ; 29 - const map_animations_off ; 2a - const map_keep_palettes ; 2b - const map_text_scroll_off ; 2c - const map_stop_script ; 2d -map_end EQU -1 +DEF NUM_MAPSETUP_SCRIPTS EQU const_value - $f1 ; callback types const_def 1 diff --git a/pokecrystal/constants/mart_constants.asm b/pokecrystal/constants/mart_constants.asm index c4834f5..1a2d08f 100644 --- a/pokecrystal/constants/mart_constants.asm +++ b/pokecrystal/constants/mart_constants.asm @@ -42,3 +42,4 @@ const MART_MT_MOON const MART_INDIGO_PLATEAU const MART_UNDERGROUND +DEF NUM_MARTS EQU const_value diff --git a/pokecrystal/constants/menu_constants.asm b/pokecrystal/constants/menu_constants.asm index b2249db..63b0f5d 100644 --- a/pokecrystal/constants/menu_constants.asm +++ b/pokecrystal/constants/menu_constants.asm @@ -63,16 +63,17 @@ const MONMENUITEM_MOVE ; 19 const MONMENUITEM_MAIL ; 20 const MONMENUITEM_ERROR ; 21 +DEF NUM_MONMENUITEMS EQU const_value - 1 ; MonMenuOptions categories -MONMENU_FIELD_MOVE EQU 0 -MONMENU_MENUOPTION EQU 1 +DEF MONMENU_FIELD_MOVE EQU 0 +DEF MONMENU_MENUOPTION EQU 1 -NUM_MONMENU_ITEMS EQU 8 +DEF NUM_MONMENU_ITEMS EQU 8 ; start/select menu return values -HMENURETURN_SCRIPT EQU %10000000 -HMENURETURN_ASM EQU %11111111 +DEF HMENURETURN_SCRIPT EQU %10000000 +DEF HMENURETURN_ASM EQU %11111111 ; PartyMenuQualityPointers indexes (see data/party_menu_qualities.asm) const_def @@ -86,8 +87,9 @@ HMENURETURN_ASM EQU %11111111 const PARTYMENUACTION_GIVE_MON_FEMALE ; unused const PARTYMENUACTION_GIVE_ITEM const PARTYMENUACTION_MOBILE ; mobile +DEF NUM_PARTYMENUACTIONS EQU const_value ; PrintPartyMenuActionText arguments (see engine/pokemon/party_menu.asm) - const_def $f0 + const_next $f0 const PARTYMENUTEXT_HEAL_PSN const PARTYMENUTEXT_HEAL_BRN const PARTYMENUTEXT_HEAL_FRZ @@ -109,4 +111,4 @@ HMENURETURN_ASM EQU %11111111 const NAME_FRIEND const NAME_6 ; duplicate of NAME_MON const NAME_7 ; duplicate of NAME_MON -NUM_NAME_TYPES EQU const_value +DEF NUM_NAME_TYPES EQU const_value diff --git a/pokecrystal/constants/misc_constants.asm b/pokecrystal/constants/misc_constants.asm index b492e95..b909d57 100644 --- a/pokecrystal/constants/misc_constants.asm +++ b/pokecrystal/constants/misc_constants.asm @@ -1,10 +1,10 @@ ; Boolean checks -FALSE EQU 0 -TRUE EQU 1 +DEF FALSE EQU 0 +DEF TRUE EQU 1 ; genders -MALE EQU 0 -FEMALE EQU 1 +DEF MALE EQU 0 +DEF FEMALE EQU 1 ; FlagAction arguments (see home/flag.asm) const_def @@ -13,37 +13,37 @@ FEMALE EQU 1 const CHECK_FLAG ; G/S version ID: 0 = Gold, 1 = Silver (used by checkver) -GS_VERSION EQU 0 +; Mystery Gift uses incremented values 1 and 2 +DEF GS_VERSION EQU 0 +; Pokémon Pikachu 2, a step counter / virtual pet device (used by Mystery Gift) +DEF POKEMON_PIKACHU_2_VERSION EQU 3 +DEF RESERVED_GAME_VERSION EQU 4 ; save file corruption check values -SAVE_CHECK_VALUE_1 EQU 99 -SAVE_CHECK_VALUE_2 EQU 127 +DEF SAVE_CHECK_VALUE_1 EQU 99 +DEF SAVE_CHECK_VALUE_2 EQU 127 + +; RTC halted check value +DEF RTC_HALT_VALUE EQU $1234 ; time of day boundaries -MORN_HOUR EQU 4 ; 4 AM -DAY_HOUR EQU 10 ; 10 AM -NITE_HOUR EQU 18 ; 6 PM -NOON_HOUR EQU 12 ; 12 PM -MAX_HOUR EQU 24 ; 12 AM +DEF MORN_HOUR EQU 4 ; 4 AM +DEF DAY_HOUR EQU 10 ; 10 AM +DEF NITE_HOUR EQU 18 ; 6 PM +DEF NOON_HOUR EQU 12 ; 12 PM +DEF MAX_HOUR EQU 24 ; 12 AM ; significant money values -START_MONEY EQU 3000 -MOM_MONEY EQU 2300 -MAX_MONEY EQU 999999 -MAX_COINS EQU 9999 +DEF START_MONEY EQU 3000 +DEF MOM_MONEY EQU 2300 +DEF MAX_MONEY EQU 999999 +DEF MAX_COINS EQU 9999 ; link record -MAX_LINK_RECORD EQU 9999 +DEF MAX_LINK_RECORD EQU 9999 ; day-care -MAX_DAY_CARE_EXP EQU $500000 +DEF MAX_DAY_CARE_EXP EQU $500000 ; hall of fame -HOF_MASTER_COUNT EQU 200 - -; bug-catching contest -BUG_CONTEST_MINUTES EQU 20 -BUG_CONTEST_SECONDS EQU 0 -BUG_CONTEST_PLAYER EQU 1 -NUM_BUG_CONTESTANTS EQU 10 ; not counting the player -BUG_CONTESTANT_SIZE EQU 4 +DEF HOF_MASTER_COUNT EQU 200 diff --git a/pokecrystal/constants/mobile_constants.asm b/pokecrystal/constants/mobile_constants.asm index b5894b8..4bca87f 100644 --- a/pokecrystal/constants/mobile_constants.asm +++ b/pokecrystal/constants/mobile_constants.asm @@ -1,3 +1,40 @@ +; MobileAPI calls (see lib/mobile/main.asm:_MobileAPI) + const_def 0, 2 + const MOBILEAPI_00 + const MOBILEAPI_01 + const MOBILEAPI_02 + const MOBILEAPI_03 + const MOBILEAPI_04 + const MOBILEAPI_05 + const MOBILEAPI_06 + const MOBILEAPI_07 + const MOBILEAPI_08 + const MOBILEAPI_09 + const MOBILEAPI_0A + const MOBILEAPI_0B + const MOBILEAPI_0C + const MOBILEAPI_0D + const MOBILEAPI_0E + const MOBILEAPI_0F + const MOBILEAPI_10 + const MOBILEAPI_11 + const MOBILEAPI_12 + const MOBILEAPI_13 + const MOBILEAPI_14 + const MOBILEAPI_15 + const MOBILEAPI_16 + const MOBILEAPI_17 + const MOBILEAPI_SETTIMER + const MOBILEAPI_TELEPHONESTATUS + const MOBILEAPI_1A + const MOBILEAPI_1B + const MOBILEAPI_1C + const MOBILEAPI_1D + const MOBILEAPI_1E + const MOBILEAPI_1F + const MOBILEAPI_20 + const MOBILEAPI_21 + ; MobileEZChatCategoryPointers indexes (see mobile/fixed_words.asm) const_def const EZCHAT_POKEMON @@ -16,6 +53,47 @@ const EZCHAT_FAREWELLS const EZCHAT_THISANDTHAT -NUM_KANA EQU 45 ; length of SortedPokemon table (see mobile/fixed_words.asm) +DEF NUM_KANA EQU 45 ; length of SortedPokemon table (see mobile/fixed_words.asm) -MOBILE_LOGIN_PASSWORD_LENGTH EQU 17 +DEF MOBILE_LOGIN_PASSWORD_LENGTH EQU 17 +DEF MOBILE_PHONE_NUMBER_LENGTH EQU 20 + +; Maximum amount of time allowed for mobile battles each day +DEF MOBILE_BATTLE_ALLOWED_SECONDS EQU 0 +DEF MOBILE_BATTLE_ALLOWED_MINUTES EQU 10 + +; Trade corner request size +; DION addr $1e + request $8 + Name $5 +; + party struct $30 + OT $5 + NICK $5 +; + JP Mail struct $2a +DEF MOBILE_EMAIL_LENGTH EQU $1e +DEF TRADE_CORNER_TRADE_INFO_LENGTH EQU 8 +DEF TRADE_CORNER_CANCEL_REQUEST_LENGTH EQU MOBILE_EMAIL_LENGTH + TRADE_CORNER_TRADE_INFO_LENGTH +DEF TRADE_CORNER_RECEIVE_TRADE_LENGTH EQU PLAYER_NAME_LENGTH - 1 + PARTYMON_STRUCT_LENGTH + PLAYER_NAME_LENGTH - 1 + MON_NAME_LENGTH - 1 + MAIL_STRUCT_LENGTH +DEF TRADE_CORNER_TRADE_REQUEST_LENGTH EQU TRADE_CORNER_CANCEL_REQUEST_LENGTH + TRADE_CORNER_RECEIVE_TRADE_LENGTH + +DEF EASY_CHAT_MESSAGE_WORD_COUNT EQU 4 +DEF EASY_CHAT_MESSAGE_LENGTH EQU EASY_CHAT_MESSAGE_WORD_COUNT * 2 ; every word uses 2 bytes +DEF PHONE_NUMBER_LENGTH EQU 8 +DEF PHONE_NUMBER_DIGITS_QUANTITY EQU PHONE_NUMBER_LENGTH * 2 ; Two digits are saved per byte (1x 0-10 digit per nybble). +DEF PHONE_NUMBER_DIGITS_MIN_REQUIRED_QUANTITY EQU 6 +DEF NUM_CARD_FOLDER_ENTRIES EQU 40 +DEF CARD_FOLDER_ENTRY_LENGTH EQU 41 + +IF DEF(_CRYSTAL_AU) +DEF ZIPCODE_LENGTH EQU 4 +DEF NUM_REGION_CODES EQU 25 +DEF REGION_CODE_STRING_LENGTH EQU 7 +ELIF DEF(_CRYSTAL_EU) +DEF ZIPCODE_LENGTH EQU 7 +DEF NUM_REGION_CODES EQU 40 +DEF REGION_CODE_STRING_LENGTH EQU 6 +ELSE ; US +DEF ZIPCODE_LENGTH EQU 6 +DEF NUM_REGION_CODES EQU 64 +DEF REGION_CODE_STRING_LENGTH EQU 6 +ENDC + +DEF ZIPCODE_MAX_LENGTH EQU 7 +DEF ZIPCODE_FRAME_RIGHT_MARGIN EQU 1 +DEF REGION_NAME_MAX_LENGTH EQU 7 \ No newline at end of file diff --git a/pokecrystal/constants/move_constants.asm b/pokecrystal/constants/move_constants.asm index 472ff2d..6112966 100644 --- a/pokecrystal/constants/move_constants.asm +++ b/pokecrystal/constants/move_constants.asm @@ -257,13 +257,10 @@ const ROCK_SMASH ; f9 const WHIRLPOOL ; fa const BEAT_UP ; fb -NUM_ATTACKS EQU const_value + -1 - - const MOVE_OR_ANIM_FC ; fc - const MOVE_OR_ANIM_FD ; fd - const MOVE_OR_ANIM_FE ; fe +DEF NUM_ATTACKS EQU const_value - 1 ; Battle animations use the same constants as the moves up to this point + const_next $ff const ANIM_SWEET_SCENT_2 ; ff const ANIM_THROW_POKE_BALL ; 100 const ANIM_SEND_OUT_MON ; 101 @@ -288,6 +285,7 @@ NUM_ATTACKS EQU const_value + -1 const ANIM_WOBBLE ; 113 const ANIM_SHAKE ; 114 const ANIM_HIT_CONFUSION ; 115 +DEF NUM_BATTLE_ANIMS EQU const_value - 1 ; wNumHits uses offsets from ANIM_MISS const_def diff --git a/pokecrystal/constants/move_effect_constants.asm b/pokecrystal/constants/move_effect_constants.asm index 0ca97f3..0477a6b 100644 --- a/pokecrystal/constants/move_effect_constants.asm +++ b/pokecrystal/constants/move_effect_constants.asm @@ -157,3 +157,4 @@ const EFFECT_BEAT_UP const EFFECT_FLY const EFFECT_DEFENSE_CURL +DEF NUM_MOVE_EFFECTS EQU const_value diff --git a/pokecrystal/constants/music_constants.asm b/pokecrystal/constants/music_constants.asm index 83085ef..d64fa57 100644 --- a/pokecrystal/constants/music_constants.asm +++ b/pokecrystal/constants/music_constants.asm @@ -1,7 +1,6 @@ ; song ids ; Music indexes (see audio/music_pointers.asm) const_def - const MUSIC_NONE ; 00 const MUSIC_TITLE ; 01 const MUSIC_ROUTE_1 ; 02 @@ -95,7 +94,6 @@ const MUSIC_LAKE_OF_RAGE_ROCKET_RADIO ; 5a const MUSIC_PRINTER ; 5b const MUSIC_POST_CREDITS ; 5c - ; new to Crystal const MUSIC_CLAIR ; 5d const MUSIC_MOBILE_ADAPTER_MENU ; 5e @@ -107,14 +105,15 @@ const MUSIC_SUICUNE_BATTLE ; 64 const MUSIC_BATTLE_TOWER_LOBBY ; 65 const MUSIC_MOBILE_CENTER ; 66 +DEF NUM_MUSIC_SONGS EQU const_value ; GetMapMusic picks music for this value (see home/map.asm) -MUSIC_MAHOGANY_MART EQU $64 +DEF MUSIC_MAHOGANY_MART EQU $64 ; ExitPokegearRadio_HandleMusic uses these values -RESTART_MAP_MUSIC EQU $fe -ENTER_MAP_MUSIC EQU $ff +DEF RESTART_MAP_MUSIC EQU $fe +DEF ENTER_MAP_MUSIC EQU $ff ; GetMapMusic picks music for this bit flag -RADIO_TOWER_MUSIC_F EQU 7 -RADIO_TOWER_MUSIC EQU 1 << RADIO_TOWER_MUSIC_F +DEF RADIO_TOWER_MUSIC_F EQU 7 +DEF RADIO_TOWER_MUSIC EQU 1 << RADIO_TOWER_MUSIC_F diff --git a/pokecrystal/constants/npc_trade_constants.asm b/pokecrystal/constants/npc_trade_constants.asm index f84db5d..044b2e4 100644 --- a/pokecrystal/constants/npc_trade_constants.asm +++ b/pokecrystal/constants/npc_trade_constants.asm @@ -1,14 +1,16 @@ - ; npctrade struct members (see data/events/npc_trades.asm) -NPCTRADE_DIALOG EQU 0 ; db -NPCTRADE_GIVEMON EQU 1 ; db -NPCTRADE_GETMON EQU 2 ; db -NPCTRADE_NICK EQU 3 ; ds MON_NAME_LENGTH -NPCTRADE_DVS EQU 14 ; dw -NPCTRADE_ITEM EQU 16 ; db -NPCTRADE_OT_ID EQU 17 ; dw -NPCTRADE_OT_NAME EQU 19 ; ds NAME_LENGTH -NPCTRADE_GENDER EQU 30 ; db -NPCTRADE_PADDING EQU 31 ; db +; npctrade struct members (see data/events/npc_trades.asm) +rsreset +DEF NPCTRADE_DIALOG rb +DEF NPCTRADE_GIVEMON rb +DEF NPCTRADE_GETMON rb +DEF NPCTRADE_NICKNAME rb MON_NAME_LENGTH +DEF NPCTRADE_DVS rw +DEF NPCTRADE_ITEM rb +DEF NPCTRADE_OT_ID rw +DEF NPCTRADE_OT_NAME rb NAME_LENGTH +DEF NPCTRADE_GENDER rb + rb_skip +DEF NPCTRADE_STRUCT_LENGTH EQU _RS ; NPCTrades indexes (see data/events/npc_trades.asm) const_def @@ -19,7 +21,7 @@ NPCTRADE_PADDING EQU 31 ; db const NPC_TRADE_CHRIS ; 4 const NPC_TRADE_KIM ; 5 const NPC_TRADE_FOREST ; 6 -NUM_NPC_TRADES EQU const_value +DEF NUM_NPC_TRADES EQU const_value ; trade gender limits const_def diff --git a/pokecrystal/constants/phone_constants.asm b/pokecrystal/constants/phone_constants.asm index 2005bd3..0600dc2 100644 --- a/pokecrystal/constants/phone_constants.asm +++ b/pokecrystal/constants/phone_constants.asm @@ -8,9 +8,9 @@ const PHONE_SCHOOLBOY_JACK const PHONE_POKEFAN_BEVERLY const PHONE_SAILOR_HUEY - const PHONE_08 - const PHONE_09 - const PHONE_0A + const_skip + const_skip + const_skip const PHONE_COOLTRAINERM_GAVEN const PHONE_COOLTRAINERF_BETH const PHONE_BIRDKEEPER_JOSE @@ -25,7 +25,7 @@ const PHONE_JUGGLER_IRWIN const PHONE_BUG_CATCHER_ARNIE const PHONE_SCHOOLBOY_ALAN - const PHONE_19 + const_skip const PHONE_LASS_DANA const PHONE_SCHOOLBOY_CHAD const PHONE_POKEFANM_DEREK @@ -38,6 +38,7 @@ const PHONE_HIKER_PARRY const PHONE_PICNICKER_ERIN const PHONE_BUENA +DEF NUM_PHONE_CONTACTS EQU const_value - 1 ; SpecialPhoneCallList indexes (see data/phone/special_calls.asm) const_def @@ -50,22 +51,22 @@ const SPECIALCALL_BIKESHOP const SPECIALCALL_WORRIED const SPECIALCALL_MASTERBALL +DEF NUM_SPECIALCALLS EQU const_value - 1 +DEF SPECIALCALL_SIZE EQU 6 ; phone struct members - const_def - const PHONE_CONTACT_TRAINER_CLASS - const PHONE_CONTACT_TRAINER_NUMBER - const PHONE_CONTACT_MAP_GROUP - const PHONE_CONTACT_MAP_NUMBER - const PHONE_CONTACT_SCRIPT1_TIME - const PHONE_CONTACT_SCRIPT1_BANK - const PHONE_CONTACT_SCRIPT1_ADDR_LO - const PHONE_CONTACT_SCRIPT1_ADDR_HI - const PHONE_CONTACT_SCRIPT2_TIME - const PHONE_CONTACT_SCRIPT2_BANK - const PHONE_CONTACT_SCRIPT2_ADDR_LO - const PHONE_CONTACT_SCRIPT2_ADDR_HI -PHONE_CONTACT_SIZE EQU const_value +rsreset +DEF PHONE_CONTACT_TRAINER_CLASS rb +DEF PHONE_CONTACT_TRAINER_NUMBER rb +DEF PHONE_CONTACT_MAP_GROUP rb +DEF PHONE_CONTACT_MAP_NUMBER rb +DEF PHONE_CONTACT_SCRIPT1_TIME rb +DEF PHONE_CONTACT_SCRIPT1_BANK rb +DEF PHONE_CONTACT_SCRIPT1_ADDR rw +DEF PHONE_CONTACT_SCRIPT2_TIME rb +DEF PHONE_CONTACT_SCRIPT2_BANK rb +DEF PHONE_CONTACT_SCRIPT2_ADDR rw +DEF PHONE_CONTACT_SIZE EQU _RS ; maximum number of pokegear contacts -CONTACT_LIST_SIZE EQU 10 +DEF CONTACT_LIST_SIZE EQU 10 diff --git a/pokecrystal/constants/pokemon_constants.asm b/pokecrystal/constants/pokemon_constants.asm index 939ac72..36c4172 100644 --- a/pokecrystal/constants/pokemon_constants.asm +++ b/pokecrystal/constants/pokemon_constants.asm @@ -10,14 +10,14 @@ ; - PokemonPalettes (see data/pokemon/palettes.asm) ; - PokedexDataPointerTable (see data/pokemon/dex_entry_pointers.asm) ; - AlphabeticalPokedexOrder (see data/pokemon/dex_order_alpha.asm) -; - EZChat_SortedPokemon (see data/pokemon/ezchat_order.asm) ; - NewPokedexOrder (see data/pokemon/dex_order_new.asm) ; - Pokered_MonIndices (see data/pokemon/gen1_order.asm) +; - Footprints (see gfx/footprints.asm) ; - AnimationPointers (see gfx/pokemon/anim_pointers.asm) ; - AnimationIdlePointers (see gfx/pokemon/idle_pointers.asm) ; - BitmasksPointers (see gfx/pokemon/bitmask_pointers.asm) ; - FramesPointers (see gfx/pokemon/frame_pointers.asm) -; - Footprints (see gfx/footprints.asm) +; - EZChat_SortedPokemon (see data/pokemon/ezchat_order.asm) const_def 1 const BULBASAUR ; 01 const IVYSAUR ; 02 @@ -170,7 +170,7 @@ const DRAGONITE ; 95 const MEWTWO ; 96 const MEW ; 97 -JOHTO_POKEMON EQU const_value +DEF JOHTO_POKEMON EQU const_value const CHIKORITA ; 98 const BAYLEEF ; 99 const MEGANIUM ; 9a @@ -271,10 +271,9 @@ JOHTO_POKEMON EQU const_value const LUGIA ; f9 const HO_OH ; fa const CELEBI ; fb -NUM_POKEMON EQU const_value + -1 - const MON_FC ; fc +DEF NUM_POKEMON EQU const_value - 1 + const_skip ; fc const EGG ; fd - const MON_FE ; fe ; Unown forms ; indexes for: @@ -311,4 +310,4 @@ NUM_POKEMON EQU const_value + -1 const UNOWN_X ; 24 const UNOWN_Y ; 25 const UNOWN_Z ; 26 -NUM_UNOWN EQU const_value + -1 ; 26 +DEF NUM_UNOWN EQU const_value - 1 ; 26 diff --git a/pokecrystal/constants/pokemon_data_constants.asm b/pokecrystal/constants/pokemon_data_constants.asm index 9ba6953..365d4a9 100644 --- a/pokecrystal/constants/pokemon_data_constants.asm +++ b/pokecrystal/constants/pokemon_data_constants.asm @@ -1,38 +1,44 @@ ; base data struct members (see data/pokemon/base_stats/*.asm) -BASE_DEX_NO EQUS "(wBaseDexNo - wCurBaseData)" -BASE_STATS EQUS "(wBaseStats - wCurBaseData)" -BASE_HP EQUS "(wBaseHP - wCurBaseData)" -BASE_ATK EQUS "(wBaseAttack - wCurBaseData)" -BASE_SPD EQUS "(wBaseSpeed - wCurBaseData)" -BASE_SAT EQUS "(wBaseSpecialAttack - wCurBaseData)" -BASE_SDF EQUS "(wBaseSpecialDefense - wCurBaseData)" -BASE_TYPES EQUS "(wBaseType - wCurBaseData)" -BASE_TYPE_1 EQUS "(wBaseType1 - wCurBaseData)" -BASE_TYPE_2 EQUS "(wBaseType2 - wCurBaseData)" -BASE_CATCH_RATE EQUS "(wBaseCatchRate - wCurBaseData)" -BASE_EXP EQUS "(wBaseExp - wCurBaseData)" -BASE_ITEMS EQUS "(wBaseItems - wCurBaseData)" -BASE_ITEM_1 EQUS "(wBaseItem1 - wCurBaseData)" -BASE_ITEM_2 EQUS "(wBaseItem2 - wCurBaseData)" -BASE_GENDER EQUS "(wBaseGender - wCurBaseData)" -BASE_UNKNOWN_1 EQUS "(wBaseUnknown1 - wCurBaseData)" -BASE_EGG_STEPS EQUS "(wBaseEggSteps - wCurBaseData)" -BASE_UNKNOWN_2 EQUS "(wBaseUnknown2 - wCurBaseData)" -BASE_PIC_SIZE EQUS "(wBasePicSize - wCurBaseData)" -BASE_PADDING EQUS "(wBasePadding - wCurBaseData)" -BASE_GROWTH_RATE EQUS "(wBaseGrowthRate - wCurBaseData)" -BASE_EGG_GROUPS EQUS "(wBaseEggGroups - wCurBaseData)" -BASE_TMHM EQUS "(wBaseTMHM - wCurBaseData)" -BASE_DATA_SIZE EQUS "(wCurBaseDataEnd - wCurBaseData)" +rsreset +DEF BASE_DEX_NO rb +DEF BASE_STATS rb NUM_STATS +rsset BASE_STATS +DEF BASE_HP rb +DEF BASE_ATK rb +DEF BASE_DEF rb +DEF BASE_SPD rb +DEF BASE_SAT rb +DEF BASE_SDF rb +DEF BASE_TYPES rw +rsset BASE_TYPES +DEF BASE_TYPE_1 rb +DEF BASE_TYPE_2 rb +DEF BASE_CATCH_RATE rb +DEF BASE_EXP rb +DEF BASE_ITEMS rw +rsset BASE_ITEMS +DEF BASE_ITEM_1 rb +DEF BASE_ITEM_2 rb +DEF BASE_GENDER rb + rb_skip +DEF BASE_EGG_STEPS rb + rb_skip +DEF BASE_PIC_SIZE rb +DEF BASE_FRONTPIC rw +DEF BASE_BACKPIC rw +DEF BASE_GROWTH_RATE rb +DEF BASE_EGG_GROUPS rb +DEF BASE_TMHM rb (NUM_TM_HM_TUTOR + 7) / 8 +DEF BASE_DATA_SIZE EQU _RS ; gender ratio constants -GENDER_F0 EQU 0 percent -GENDER_F12_5 EQU 12 percent + 1 -GENDER_F25 EQU 25 percent -GENDER_F50 EQU 50 percent -GENDER_F75 EQU 75 percent -GENDER_F100 EQU 100 percent - 1 -GENDER_UNKNOWN EQU -1 +DEF GENDER_F0 EQU 0 percent +DEF GENDER_F12_5 EQU 12 percent + 1 +DEF GENDER_F25 EQU 25 percent +DEF GENDER_F50 EQU 50 percent +DEF GENDER_F75 EQU 75 percent +DEF GENDER_F100 EQU 100 percent - 1 +DEF GENDER_UNKNOWN EQU -1 ; wBaseGrowthRate values ; GrowthRates indexes (see data/growth_rates.asm) @@ -43,6 +49,7 @@ GENDER_UNKNOWN EQU -1 const GROWTH_MEDIUM_SLOW const GROWTH_FAST const GROWTH_SLOW +DEF NUM_GROWTH_RATES EQU const_value ; wBaseEggGroups values const_def 1 @@ -63,69 +70,82 @@ GENDER_UNKNOWN EQU -1 const EGG_NONE ; f (Undiscovered) ; pokedex entries (see data/pokemon/dex_entries.asm) -NUM_DEX_ENTRY_BANKS EQU 4 +DEF NUM_DEX_ENTRY_BANKS EQU 4 -; party_struct members (see macros/wram.asm) -MON_SPECIES EQUS "(wPartyMon1Species - wPartyMon1)" -MON_ITEM EQUS "(wPartyMon1Item - wPartyMon1)" -MON_MOVES EQUS "(wPartyMon1Moves - wPartyMon1)" -MON_ID EQUS "(wPartyMon1ID - wPartyMon1)" -MON_EXP EQUS "(wPartyMon1Exp - wPartyMon1)" -MON_STAT_EXP EQUS "(wPartyMon1StatExp - wPartyMon1)" -MON_HP_EXP EQUS "(wPartyMon1HPExp - wPartyMon1)" -MON_ATK_EXP EQUS "(wPartyMon1AtkExp - wPartyMon1)" -MON_DEF_EXP EQUS "(wPartyMon1DefExp - wPartyMon1)" -MON_SPD_EXP EQUS "(wPartyMon1SpdExp - wPartyMon1)" -MON_SPC_EXP EQUS "(wPartyMon1SpcExp - wPartyMon1)" -MON_DVS EQUS "(wPartyMon1DVs - wPartyMon1)" -MON_PP EQUS "(wPartyMon1PP - wPartyMon1)" -MON_HAPPINESS EQUS "(wPartyMon1Happiness - wPartyMon1)" -MON_PKRUS EQUS "(wPartyMon1PokerusStatus - wPartyMon1)" -MON_CAUGHTDATA EQUS "(wPartyMon1CaughtData - wPartyMon1)" -MON_CAUGHTLEVEL EQUS "(wPartyMon1CaughtLevel - wPartyMon1)" -MON_CAUGHTTIME EQUS "(wPartyMon1CaughtTime - wPartyMon1)" -MON_CAUGHTGENDER EQUS "(wPartyMon1CaughtGender - wPartyMon1)" -MON_CAUGHTLOCATION EQUS "(wPartyMon1CaughtLocation - wPartyMon1)" -MON_LEVEL EQUS "(wPartyMon1Level - wPartyMon1)" -MON_STATUS EQUS "(wPartyMon1Status - wPartyMon1)" -MON_HP EQUS "(wPartyMon1HP - wPartyMon1)" -MON_MAXHP EQUS "(wPartyMon1MaxHP - wPartyMon1)" -MON_ATK EQUS "(wPartyMon1Attack - wPartyMon1)" -MON_DEF EQUS "(wPartyMon1Defense - wPartyMon1)" -MON_SPD EQUS "(wPartyMon1Speed - wPartyMon1)" -MON_SAT EQUS "(wPartyMon1SpclAtk - wPartyMon1)" -MON_SDF EQUS "(wPartyMon1SpclDef - wPartyMon1)" -BOXMON_STRUCT_LENGTH EQUS "(wPartyMon1End - wPartyMon1)" -PARTYMON_STRUCT_LENGTH EQUS "(wPartyMon1StatsEnd - wPartyMon1)" +; party_struct members (see macros/ram.asm) +rsreset +DEF MON_SPECIES rb +DEF MON_ITEM rb +DEF MON_MOVES rb NUM_MOVES +DEF MON_ID rw +DEF MON_EXP rb 3 +DEF MON_STAT_EXP rw NUM_EXP_STATS +rsset MON_STAT_EXP +DEF MON_HP_EXP rw +DEF MON_ATK_EXP rw +DEF MON_DEF_EXP rw +DEF MON_SPD_EXP rw +DEF MON_SPC_EXP rw +DEF MON_DVS rw +DEF MON_PP rb NUM_MOVES +DEF MON_HAPPINESS rb +DEF MON_POKERUS rb +DEF MON_CAUGHTDATA rw +rsset MON_CAUGHTDATA +DEF MON_CAUGHTTIME rb +DEF MON_CAUGHTGENDER rb +rsset MON_CAUGHTDATA +DEF MON_CAUGHTLEVEL rb +DEF MON_CAUGHTLOCATION rb +DEF MON_LEVEL rb +DEF BOXMON_STRUCT_LENGTH EQU _RS +DEF MON_STATUS rb + rb_skip +DEF MON_HP rw +DEF MON_MAXHP rw +DEF MON_STATS rw NUM_BATTLE_STATS +rsset MON_STATS +DEF MON_ATK rw +DEF MON_DEF rw +DEF MON_SPD rw +DEF MON_SAT rw +DEF MON_SDF rw +DEF PARTYMON_STRUCT_LENGTH EQU _RS -NICKNAMED_MON_STRUCT_LENGTH EQUS "(PARTYMON_STRUCT_LENGTH + MON_NAME_LENGTH)" -REDMON_STRUCT_LENGTH EQU 44 +DEF NICKNAMED_MON_STRUCT_LENGTH EQU PARTYMON_STRUCT_LENGTH + MON_NAME_LENGTH +DEF REDMON_STRUCT_LENGTH EQU 44 ; caught data -CAUGHT_TIME_MASK EQU %11000000 -CAUGHT_LEVEL_MASK EQU %00111111 +DEF CAUGHT_TIME_MASK EQU %11000000 +DEF CAUGHT_LEVEL_MASK EQU %00111111 -CAUGHT_GENDER_MASK EQU %10000000 -CAUGHT_LOCATION_MASK EQU %01111111 +DEF CAUGHT_GENDER_MASK EQU %10000000 +DEF CAUGHT_LOCATION_MASK EQU %01111111 -CAUGHT_BY_UNKNOWN EQU 0 -CAUGHT_BY_GIRL EQU 1 -CAUGHT_BY_BOY EQU 2 +DEF CAUGHT_BY_UNKNOWN EQU 0 +DEF CAUGHT_BY_GIRL EQU 1 +DEF CAUGHT_BY_BOY EQU 2 -CAUGHT_EGG_LEVEL EQU 1 +DEF CAUGHT_EGG_LEVEL EQU 1 + +DEF MON_CRY_LENGTH EQU 6 ; maximum number of party pokemon -PARTY_LENGTH EQU 6 +DEF PARTY_LENGTH EQU 6 ; boxes -MONS_PER_BOX EQU 20 -NUM_BOXES EQU 14 +DEF MONS_PER_BOX EQU 20 +; box: count, species, mons, OTs, nicknames, padding +DEF BOX_LENGTH EQU 1 + MONS_PER_BOX + 1 + (BOXMON_STRUCT_LENGTH + NAME_LENGTH + MON_NAME_LENGTH) * MONS_PER_BOX + 2 ; $450 +DEF NUM_BOXES EQU 14 ; hall of fame -HOF_MON_LENGTH EQU 1 + 2 + 2 + 1 + (MON_NAME_LENGTH + -1) ; species, id, dvs, level, nick -HOF_LENGTH EQU 1 + HOF_MON_LENGTH * PARTY_LENGTH + 1 ; win count, party, terminator -NUM_HOF_TEAMS EQU 30 +; hof_mon: species, id, dvs, level, nicknames +DEF HOF_MON_LENGTH EQU 1 + 2 + 2 + 1 + (MON_NAME_LENGTH - 1) ; $10 +; hall_of_fame: win count, party, terminator +DEF HOF_LENGTH EQU 1 + HOF_MON_LENGTH * PARTY_LENGTH + 1 ; $62 +DEF NUM_HOF_TEAMS EQU 30 ; evolution types (used in data/pokemon/evos_attacks.asm) const_def 1 @@ -149,14 +169,14 @@ NUM_HOF_TEAMS EQU 30 ; wild data -NUM_GRASSMON EQU 7 ; data/wild/*_grass.asm table size -NUM_WATERMON EQU 3 ; data/wild/*_water.asm table size +DEF NUM_GRASSMON EQU 7 ; data/wild/*_grass.asm table size +DEF NUM_WATERMON EQU 3 ; data/wild/*_water.asm table size -GRASS_WILDDATA_LENGTH EQU 2 + (1 + NUM_GRASSMON * 2) * 3 -WATER_WILDDATA_LENGTH EQU 2 + (1 + NUM_WATERMON * 2) * 1 -FISHGROUP_DATA_LENGTH EQU 1 + 2 * 3 +DEF GRASS_WILDDATA_LENGTH EQU 2 + 3 + NUM_GRASSMON * 2 * 3 +DEF WATER_WILDDATA_LENGTH EQU 2 + 1 + NUM_WATERMON * 2 +DEF FISHGROUP_DATA_LENGTH EQU 1 + 2 * 3 -NUM_ROAMMON_MAPS EQU 16 ; RoamMaps table size (see data/wild/roammon_maps.asm) +DEF NUM_ROAMMON_MAPS EQU 16 ; RoamMaps table size (see data/wild/roammon_maps.asm) ; treemon sets ; TreeMons indexes (see data/wild/treemons.asm) @@ -169,7 +189,7 @@ NUM_ROAMMON_MAPS EQU 16 ; RoamMaps table size (see data/wild/roammon_maps.asm) const TREEMON_SET_LAKE const TREEMON_SET_FOREST const TREEMON_SET_ROCK -NUM_TREEMON_SETS EQU const_value +DEF NUM_TREEMON_SETS EQU const_value ; treemon scores const_def @@ -177,8 +197,8 @@ NUM_TREEMON_SETS EQU const_value const TREEMON_SCORE_GOOD ; 1 const TREEMON_SCORE_RARE ; 2 -; ChangeHappiness arguments (see data/happiness_changes.asm) -const_value = 1 +; ChangeHappiness arguments (see data/events/happiness_changes.asm) + const_def 1 const HAPPINESS_GAINLEVEL ; 01 const HAPPINESS_USEDITEM ; 02 const HAPPINESS_USEDXITEM ; 03 @@ -198,15 +218,16 @@ const_value = 1 const HAPPINESS_REVIVALHERB ; 11 const HAPPINESS_GROOMING ; 12 const HAPPINESS_GAINLEVELATHOME ; 13 +DEF NUM_HAPPINESS_CHANGES EQU const_value - 1 ; significant happiness values -BASE_HAPPINESS EQU 70 -FRIEND_BALL_HAPPINESS EQU 200 -HAPPINESS_TO_EVOLVE EQU 220 -HAPPINESS_THRESHOLD_1 EQU 100 -HAPPINESS_THRESHOLD_2 EQU 200 +DEF BASE_HAPPINESS EQU 70 +DEF FRIEND_BALL_HAPPINESS EQU 200 +DEF HAPPINESS_TO_EVOLVE EQU 220 +DEF HAPPINESS_THRESHOLD_1 EQU 100 +DEF HAPPINESS_THRESHOLD_2 EQU 200 ; PP -PP_UP_MASK EQU %11000000 -PP_UP_ONE EQU %01000000 -PP_MASK EQU %00111111 +DEF PP_UP_MASK EQU %11000000 +DEF PP_UP_ONE EQU %01000000 +DEF PP_MASK EQU %00111111 diff --git a/pokecrystal/constants/radio_constants.asm b/pokecrystal/constants/radio_constants.asm index 39eedbd..f719f2d 100644 --- a/pokecrystal/constants/radio_constants.asm +++ b/pokecrystal/constants/radio_constants.asm @@ -15,6 +15,7 @@ const POKE_FLUTE_RADIO ; 08 const UNOWN_RADIO ; 09 const EVOLUTION_RADIO ; 0a +DEF NUM_RADIO_CHANNELS EQU const_value ; internal indexes for channel segments const OAKS_POKEMON_TALK_2 ; 0b const OAKS_POKEMON_TALK_3 ; 0c @@ -93,8 +94,9 @@ const POKEDEX_SHOW_6 ; 55 const POKEDEX_SHOW_7 ; 56 const POKEDEX_SHOW_8 ; 57 +DEF NUM_RADIO_SEGMENTS EQU const_value -; PlayRadio.StationPointers indexes (see engine/pokegear/pokegear.asm) +; PlayRadioStationPointers indexes (see engine/pokegear/pokegear.asm) const_def const MAPRADIO_POKEMON_CHANNEL const MAPRADIO_OAKS_POKEMON_TALK @@ -105,17 +107,21 @@ const MAPRADIO_PLACES_PEOPLE const MAPRADIO_LETS_ALL_SING const MAPRADIO_ROCKET +DEF NUM_MAP_RADIO_STATIONS EQU const_value ; These tables in engine/pokegear/radio.asm are all sized to a power of 2 ; so there's no need for a rejection sampling loop -NUM_OAKS_POKEMON_TALK_ADVERBS EQU 16 ; OaksPKMNTalk8.Adverbs -NUM_OAKS_POKEMON_TALK_ADJECTIVES EQU 16 ; OaksPKMNTalk9.Adjectives -NUM_PNP_PEOPLE_ADJECTIVES EQU 16 ; PeoplePlaces5.Adjectives -NUM_PNP_PLACES_ADJECTIVES EQU 16 ; PeoplePlaces7.Adjectives +DEF NUM_OAKS_POKEMON_TALK_ADVERBS EQU 16 ; OaksPKMNTalk8.Adverbs +DEF NUM_OAKS_POKEMON_TALK_ADJECTIVES EQU 16 ; OaksPKMNTalk9.Adjectives +DEF NUM_PNP_PEOPLE_ADJECTIVES EQU 16 ; PeoplePlaces5.Adjectives +DEF NUM_PNP_PLACES_ADJECTIVES EQU 16 ; PeoplePlaces7.Adjectives ; BuenasPasswordTable sizes (see data/radio/buenas_passwords.asm) -NUM_PASSWORD_CATEGORIES EQU 11 -NUM_PASSWORDS_PER_CATEGORY EQU 3 +DEF NUM_PASSWORD_CATEGORIES EQU 11 +DEF NUM_PASSWORDS_PER_CATEGORY EQU 3 + +; BuenaPrizeItems size (see data/items/buena_prizes.asm) +DEF NUM_BUENA_PRIZES EQU 9 ; GetBuenasPassword.StringFunctionJumpTable indexes (see engine/pokegear/radio.asm) const_def @@ -123,3 +129,4 @@ NUM_PASSWORDS_PER_CATEGORY EQU 3 const BUENA_ITEM const BUENA_MOVE const BUENA_STRING +DEF NUM_BUENA_FUNCTIONS EQU const_value diff --git a/pokecrystal/constants/scgb_constants.asm b/pokecrystal/constants/scgb_constants.asm index 4c2faa4..449be75 100644 --- a/pokecrystal/constants/scgb_constants.asm +++ b/pokecrystal/constants/scgb_constants.asm @@ -1,4 +1,5 @@ -; GetSGBLayout arguments (see engine/gfx/cgb_layouts.asm and engine/gfx/sgb_layouts.asm) +; CGBLayoutJumptable indexes (see engine/gfx/cgb_layouts.asm) +; SGBLayoutJumptable indexes (see engine/gfx/sgb_layouts.asm) const_def const SCGB_BATTLE_GRAYSCALE const SCGB_BATTLE_COLORS @@ -31,14 +32,21 @@ const SCGB_TRAINER_OR_MON_FRONTPIC_PALS const SCGB_MYSTERY_GIFT const SCGB_1E +DEF NUM_SCGB_LAYOUTS EQU const_value -SCGB_PARTY_MENU_HP_PALS EQU -4 -SCGB_RAM EQU -1 +DEF SCGB_PARTY_MENU_HP_BARS EQU $fc +DEF SCGB_DEFAULT EQU $ff + +; GetCrystalCGBLayout arguments (see engine/gfx/crystal_layouts.asm) + const_def + const CRYSTAL_CGB_MOBILE_0 + const CRYSTAL_CGB_MOBILE_1 + const CRYSTAL_CGB_NAME_CARD ; PredefPals indexes (see gfx/sgb/predef.pal) ; GetPredefPal arguments (see engine/gfx/color.asm) const_def - const PREDEFPAL_00 + const PREDEFPAL_ROUTES const PREDEFPAL_PALLET const PREDEFPAL_VIRIDIAN const PREDEFPAL_PEWTER @@ -74,7 +82,7 @@ SCGB_RAM EQU -1 const PREDEFPAL_RB_GREENMON const PREDEFPAL_RB_PINKMON const PREDEFPAL_RB_YELLOWMON - const PREDEFPAL_CGB_BADGE ; RB_GREYMON + const PREDEFPAL_CGB_BADGE ; RB_GRAYMON const PREDEFPAL_BETA_SHINY_MEWMON const PREDEFPAL_BETA_SHINY_BLUEMON const PREDEFPAL_BETA_SHINY_REDMON @@ -84,7 +92,7 @@ SCGB_RAM EQU -1 const PREDEFPAL_BETA_SHINY_GREENMON const PREDEFPAL_BETA_SHINY_PINKMON const PREDEFPAL_BETA_SHINY_YELLOWMON - const PREDEFPAL_PARTY_ICON ; BETA_SHINY_GREYMON + const PREDEFPAL_PARTY_ICON ; BETA_SHINY_GRAYMON const PREDEFPAL_HP_GREEN const PREDEFPAL_HP_YELLOW const PREDEFPAL_HP_RED @@ -117,6 +125,7 @@ SCGB_RAM EQU -1 const PREDEFPAL_UNOWN_PUZZLE const PREDEFPAL_GAMEFREAK_LOGO_OB const PREDEFPAL_GAMEFREAK_LOGO_BG +DEF NUM_PREDEF_PALS EQU const_value ; SGB system command codes ; http://gbdev.gg8.se/wiki/articles/SGB_Functions#SGB_System_Command_Table @@ -138,7 +147,7 @@ SCGB_RAM EQU -1 const SGB_ICON_EN const SGB_DATA_SND const SGB_DATA_TRN - const SGB_MLT_REG + const SGB_MLT_REQ const SGB_JUMP const SGB_CHR_TRN const SGB_PCT_TRN @@ -147,4 +156,4 @@ SCGB_RAM EQU -1 const SGB_MASK_EN const SGB_OBJ_TRN -PALPACKET_LENGTH EQU $10 +DEF PALPACKET_LENGTH EQU $10 diff --git a/pokecrystal/constants/script_constants.asm b/pokecrystal/constants/script_constants.asm index 99275ef..899d654 100644 --- a/pokecrystal/constants/script_constants.asm +++ b/pokecrystal/constants/script_constants.asm @@ -1,13 +1,15 @@ -; person constants -PLAYER EQU 0 -LAST_TALKED EQU -2 +; object constants +DEF PLAYER EQU 0 +DEF LAST_TALKED EQU -2 ; string buffer constants const_def const STRING_BUFFER_3 ; use wStringBuffer3 const STRING_BUFFER_4 ; use wStringBuffer4 const STRING_BUFFER_5 ; use wStringBuffer5 -NUM_STRING_BUFFERS EQU const_value +DEF NUM_STRING_BUFFERS EQU const_value + +DEF STRING_BUFFER_LENGTH EQU 19 ; checkmoney/takemoney accounts const_def @@ -58,7 +60,7 @@ NUM_STRING_BUFFERS EQU const_value const VAR_MAPGROUP ; 0c const VAR_MAPNUMBER ; 0d const VAR_UNOWNCOUNT ; 0e - const VAR_ROOFPALETTE ; 0f + const VAR_ENVIRONMENT ; 0f const VAR_BOXSPACE ; 10 const VAR_CONTESTMINUTES ; 11 const VAR_XCOORD ; 12 @@ -70,12 +72,12 @@ NUM_STRING_BUFFERS EQU const_value const VAR_BLUECARDBALANCE ; 18 const VAR_BUENASPASSWORD ; 19 const VAR_KENJI_BREAK ; 1a -NUM_VARS EQU const_value ; 1b +DEF NUM_VARS EQU const_value ; variable action types -RETVAR_STRBUF2 EQU (0 << 6) -RETVAR_ADDR_DE EQU (1 << 6) -RETVAR_EXECUTE EQU (2 << 6) +DEF RETVAR_STRBUF2 EQU 0 << 6 +DEF RETVAR_ADDR_DE EQU 1 << 6 +DEF RETVAR_EXECUTE EQU 2 << 6 ; PlayerEventScriptPointers indexes (see engine/overworld/events.asm) const_def -1 @@ -90,18 +92,34 @@ RETVAR_EXECUTE EQU (2 << 6) const PLAYEREVENT_WHITEOUT const PLAYEREVENT_HATCH const PLAYEREVENT_JOYCHANGEFACING -NUM_PLAYER_EVENTS EQU const_value +DEF NUM_PLAYER_EVENTS EQU const_value + +; PlayerMovementPointers indexes (see engine/overworld/events.asm) + const_def + const PLAYERMOVEMENT_NORMAL + const PLAYERMOVEMENT_WARP + const PLAYERMOVEMENT_TURN + const PLAYERMOVEMENT_FORCE_TURN + const PLAYERMOVEMENT_FINISH + const PLAYERMOVEMENT_CONTINUE + const PLAYERMOVEMENT_EXIT_WATER + const PLAYERMOVEMENT_JUMP +DEF NUM_PLAYER_MOVEMENTS EQU const_value ; script data sizes (see macros/scripts/maps.asm) -SCENE_SCRIPT_SIZE EQU 4 ; scene_script -CALLBACK_SIZE EQU 3 ; callback -WARP_EVENT_SIZE EQU 5 ; warp_event -COORD_EVENT_SIZE EQU 8 ; coord_event -BG_EVENT_SIZE EQU 5 ; bg_event -OBJECT_EVENT_SIZE EQU 13 ; object_event +DEF SCENE_SCRIPT_SIZE EQU 4 ; scene_script +DEF CALLBACK_SIZE EQU 3 ; callback +DEF WARP_EVENT_SIZE EQU 5 ; warp_event +DEF COORD_EVENT_SIZE EQU 8 ; coord_event +DEF BG_EVENT_SIZE EQU 5 ; bg_event +DEF OBJECT_EVENT_SIZE EQU 13 ; object_event + +; A coord_event for scene -1 will always activate, +; regardless of the map's scene variable value. +DEF SCENE_ALWAYS EQU -1 ; bg_event types -; TryBGEvent arguments (see engine/overworld/events.asm) +; BGEventJumptable indexes (see engine/overworld/events.asm) const_def const BGEVENT_READ const BGEVENT_UP @@ -112,9 +130,10 @@ OBJECT_EVENT_SIZE EQU 13 ; object_event const BGEVENT_IFNOTSET const BGEVENT_ITEM const BGEVENT_COPY +DEF NUM_BGEVENTS EQU const_value ; object_event types -; TryObjectEvent arguments (see engine/overworld/events.asm) +; ObjectEventTypeArray indexes (see engine/overworld/events.asm) const_def const OBJECTTYPE_SCRIPT const OBJECTTYPE_ITEMBALL @@ -123,24 +142,27 @@ OBJECT_EVENT_SIZE EQU 13 ; object_event const OBJECTTYPE_4 const OBJECTTYPE_5 const OBJECTTYPE_6 +DEF NUM_OBJECT_TYPES EQU const_value ; command queue members -CMDQUEUE_TYPE EQU 0 -CMDQUEUE_ADDR EQU 1 -CMDQUEUE_03 EQU 3 -CMDQUEUE_04 EQU 4 -CMDQUEUE_05 EQU 5 -CMDQUEUE_ENTRY_SIZE EQU 6 -CMDQUEUE_CAPACITY EQU 4 +rsreset +DEF CMDQUEUE_TYPE rb +DEF CMDQUEUE_ADDR rb +DEF CMDQUEUE_02 rb +DEF CMDQUEUE_03 rb +DEF CMDQUEUE_04 rb +DEF CMDQUEUE_JUMPTABLE_INDEX rb +DEF CMDQUEUE_ENTRY_SIZE EQU _RS +DEF CMDQUEUE_CAPACITY EQU 4 ; HandleQueuedCommand.Jumptable indexes (see engine/overworld/events.asm) const_def const CMDQUEUE_NULL - const CMDQUEUE_NULL2 + const CMDQUEUE_TYPE1 const CMDQUEUE_STONETABLE const CMDQUEUE_TYPE3 const CMDQUEUE_TYPE4 -NUM_CMDQUEUE_TYPES EQU const_value +DEF NUM_CMDQUEUE_TYPES EQU const_value ; elevfloor macro values ; ElevatorFloorNames indexes (see data/events/elevator_floors.asm) @@ -161,23 +183,26 @@ NUM_CMDQUEUE_TYPES EQU const_value const FLOOR_10F const FLOOR_11F const FLOOR_ROOF +DEF NUM_FLOORS EQU const_value ; showemote arguments ; Emotes indexes (see data/sprites/emotes.asm) const_def - const EMOTE_SHOCK ; 0 - const EMOTE_QUESTION ; 1 - const EMOTE_HAPPY ; 2 - const EMOTE_SAD ; 3 - const EMOTE_HEART ; 4 - const EMOTE_BOLT ; 5 - const EMOTE_SLEEP ; 6 - const EMOTE_FISH ; 7 - const EMOTE_SHADOW ; 8 - const EMOTE_ROD ; 9 - const EMOTE_BOULDER_DUST ; 10 - const EMOTE_GRASS_RUSTLE ; 11 -EMOTE_FROM_MEM EQU -1 + const EMOTE_SHOCK + const EMOTE_QUESTION + const EMOTE_HAPPY + const EMOTE_SAD + const EMOTE_HEART + const EMOTE_BOLT + const EMOTE_SLEEP + const EMOTE_FISH + const EMOTE_SHADOW + const EMOTE_ROD + const EMOTE_BOULDER_DUST + const EMOTE_GRASS_RUSTLE +DEF NUM_EMOTES EQU const_value +DEF EMOTE_FROM_MEM EQU -1 +DEF EMOTE_LENGTH EQU 6 ; fruittree arguments ; FruitTreeItems indexes (see data/items/fruit_trees.asm) @@ -212,7 +237,7 @@ EMOTE_FROM_MEM EQU -1 const FRUITTREE_PEWTER_CITY_1 ; 1c const FRUITTREE_PEWTER_CITY_2 ; 1d const FRUITTREE_FUCHSIA_CITY ; 1e -NUM_FRUIT_TREES EQU const_value + -1 +DEF NUM_FRUIT_TREES EQU const_value - 1 ; describedecoration arguments ; DescribeDecoration.JumpTable indexes (see engine/overworld/decorations.asm) @@ -222,6 +247,7 @@ NUM_FRUIT_TREES EQU const_value + -1 const DECODESC_RIGHT_DOLL ; 2 const DECODESC_BIG_DOLL ; 3 const DECODESC_CONSOLE ; 4 +DEF NUM_DECODESCS EQU const_value ; swarm arguments ; StoreSwarmMapIndices arguments @@ -248,7 +274,7 @@ NUM_FRUIT_TREES EQU const_value + -1 const MAGIKARPLENGTH_TOO_SHORT ; 2 const MAGIKARPLENGTH_BEAT_RECORD ; 3 -; SpecialReturnShuckle return values +; ReturnShuckie return values const_def const SHUCKIE_WRONG_MON ; 0 const SHUCKIE_REFUSED ; 1 @@ -262,6 +288,14 @@ NUM_FRUIT_TREES EQU const_value + -1 const BUGCONTEST_BOXED_MON ; 1 const BUGCONTEST_NO_CATCH ; 2 +; Bug-Catching Contest values +DEF BUG_CONTEST_BALLS EQU 20 +DEF BUG_CONTEST_MINUTES EQU 20 +DEF BUG_CONTEST_SECONDS EQU 0 +DEF BUG_CONTEST_PLAYER EQU 1 +DEF NUM_BUG_CONTESTANTS EQU 10 ; not counting the player +DEF BUG_CONTESTANT_SIZE EQU 4 + ; HealMachineAnim setval arguments ; HealMachineAnim.Pointers indexes (see engine/events/heal_machine_anim.asm) const_def @@ -276,7 +310,7 @@ NUM_FRUIT_TREES EQU const_value + -1 const UNOWNPUZZLE_OMANYTE ; 1 const UNOWNPUZZLE_AERODACTYL ; 2 const UNOWNPUZZLE_HO_OH ; 3 -NUM_UNOWN_PUZZLES EQU const_value +DEF NUM_UNOWN_PUZZLES EQU const_value ; DisplayUnownWords setval arguments ; UnownWalls and MenuHeaders_UnownWalls indexes (see data/events/unown_walls.asm) diff --git a/pokecrystal/constants/serial_constants.asm b/pokecrystal/constants/serial_constants.asm index 757292e..791fad2 100644 --- a/pokecrystal/constants/serial_constants.asm +++ b/pokecrystal/constants/serial_constants.asm @@ -1,4 +1,4 @@ -; link types +; wLinkMode const_def const LINK_NULL ; 0 const LINK_TIMECAPSULE ; 1 @@ -7,24 +7,38 @@ const LINK_MOBILE ; 4 ; hSerialReceive high nybbles -SERIAL_TIMECAPSULE EQU $60 -SERIAL_TRADECENTER EQU $70 -SERIAL_BATTLE EQU $80 +DEF SERIAL_TIMECAPSULE EQU $60 +DEF SERIAL_TRADECENTER EQU $70 +DEF SERIAL_BATTLE EQU $80 -ESTABLISH_CONNECTION_WITH_INTERNAL_CLOCK EQU $01 -ESTABLISH_CONNECTION_WITH_EXTERNAL_CLOCK EQU $02 - -START_TRANSFER_EXTERNAL_CLOCK EQU $80 ; 1 << rSC_ON -START_TRANSFER_INTERNAL_CLOCK EQU $81 ; (1 << rSC_ON) | 1 +DEF ESTABLISH_CONNECTION_WITH_INTERNAL_CLOCK EQU $01 +DEF ESTABLISH_CONNECTION_WITH_EXTERNAL_CLOCK EQU $02 ; hSerialConnectionStatus -USING_EXTERNAL_CLOCK EQU $01 -USING_INTERNAL_CLOCK EQU $02 -CONNECTION_NOT_ESTABLISHED EQU $ff +DEF USING_EXTERNAL_CLOCK EQU $01 +DEF USING_INTERNAL_CLOCK EQU $02 +DEF CONNECTION_NOT_ESTABLISHED EQU $ff +; length of a patch list (less than any of the signal bytes) +DEF SERIAL_PATCH_LIST_LENGTH EQU $fc ; signals the start of an array of bytes transferred over the link cable -SERIAL_PREAMBLE_BYTE EQU $fd +DEF SERIAL_PREAMBLE_BYTE EQU $fd ; this byte is used when there is no data to send -SERIAL_NO_DATA_BYTE EQU $fe +DEF SERIAL_NO_DATA_BYTE EQU $fe ; signals the end of one part of a patch list (there are two parts) for player/enemy party data -SERIAL_PATCH_LIST_PART_TERMINATOR EQU $ff +DEF SERIAL_PATCH_LIST_PART_TERMINATOR EQU $ff +; used to replace SERIAL_NO_DATA_BYTE +DEF SERIAL_PATCH_REPLACEMENT_BYTE EQU $ff + +DEF SERIAL_PREAMBLE_LENGTH EQU 6 +DEF SERIAL_RN_PREAMBLE_LENGTH EQU 7 +DEF SERIAL_RNS_LENGTH EQU 10 + +DEF SERIAL_MAIL_PREAMBLE_BYTE EQU $20 +DEF SERIAL_MAIL_REPLACEMENT_BYTE EQU $21 +DEF SERIAL_MAIL_PREAMBLE_LENGTH EQU 5 + +; timeout duration after exchanging a byte +DEF SERIAL_LINK_BYTE_TIMEOUT EQU $5000 + +DEF MAX_MYSTERY_GIFT_PARTNERS EQU 5 diff --git a/pokecrystal/constants/sfx_constants.asm b/pokecrystal/constants/sfx_constants.asm index b58af59..b51e6dd 100644 --- a/pokecrystal/constants/sfx_constants.asm +++ b/pokecrystal/constants/sfx_constants.asm @@ -1,6 +1,5 @@ ; SFX indexes (see audio/sfx_pointers.asm) const_def - const SFX_DEX_FANFARE_50_79 ; 00 const SFX_ITEM ; 01 const SFX_CAUGHT_MON ; 02 @@ -150,8 +149,8 @@ const SFX_FANFARE_2 ; 92 const SFX_REGISTER_PHONE_NUMBER ; 93 const SFX_3RD_PLACE ; 94 - const SFX_GET_EGG_FROM_DAY_CARE_MAN ; 95 - const SFX_GET_EGG_FROM_DAY_CARE_LADY ; 96 + const SFX_GET_EGG_UNUSED ; 95 + const SFX_GET_EGG ; 96 const SFX_MOVE_DELETED ; 97 const SFX_2ND_PLACE ; 98 const SFX_1ST_PLACE ; 99 @@ -189,7 +188,6 @@ const SFX_TRAIN_ARRIVED ; b9 const SFX_STOP_SLOT ; ba const SFX_2_BOOPS ; bb - ; new to Crystal const SFX_GLASS_TING ; bc const SFX_GLASS_TING_2 ; bd @@ -210,3 +208,4 @@ const SFX_TWO_PC_BEEPS ; cc const SFX_4_NOTE_DITTY ; cd const SFX_TWINKLE ; ce +DEF NUM_SFX EQU const_value diff --git a/pokecrystal/constants/sprite_anim_constants.asm b/pokecrystal/constants/sprite_anim_constants.asm index 0fbc4d8..0d4257f 100644 --- a/pokecrystal/constants/sprite_anim_constants.asm +++ b/pokecrystal/constants/sprite_anim_constants.asm @@ -1,318 +1,342 @@ -; sprite_anim_struct members (see macros/wram.asm) +; sprite_anim_struct members (see macros/ram.asm) +rsreset +DEF SPRITEANIMSTRUCT_INDEX rb ; 0 +DEF SPRITEANIMSTRUCT_FRAMESET_ID rb ; 1 +DEF SPRITEANIMSTRUCT_ANIM_SEQ_ID rb ; 2 +DEF SPRITEANIMSTRUCT_TILE_ID rb ; 3 +DEF SPRITEANIMSTRUCT_XCOORD rb ; 4 +DEF SPRITEANIMSTRUCT_YCOORD rb ; 5 +DEF SPRITEANIMSTRUCT_XOFFSET rb ; 6 +DEF SPRITEANIMSTRUCT_YOFFSET rb ; 7 +DEF SPRITEANIMSTRUCT_DURATION rb ; 8 +DEF SPRITEANIMSTRUCT_DURATIONOFFSET rb ; 9 +DEF SPRITEANIMSTRUCT_FRAME rb ; a +DEF SPRITEANIMSTRUCT_JUMPTABLE_INDEX rb ; b +DEF SPRITEANIMSTRUCT_VAR1 rb ; c +DEF SPRITEANIMSTRUCT_VAR2 rb ; d +DEF SPRITEANIMSTRUCT_VAR3 rb ; e +DEF SPRITEANIMSTRUCT_VAR4 rb ; f +DEF SPRITEANIMSTRUCT_LENGTH EQU _RS +DEF NUM_SPRITE_ANIM_STRUCTS EQU 10 ; see wSpriteAnimationStructs + +; wSpriteAnimDict keys (see wram.asm) +; UnusedSpriteAnimGFX indexes (see data/sprite_anims/unused_gfx.asm) const_def - const SPRITEANIMSTRUCT_INDEX ; 0 - const SPRITEANIMSTRUCT_FRAMESET_ID ; 1 - const SPRITEANIMSTRUCT_ANIM_SEQ_ID ; 2 - const SPRITEANIMSTRUCT_TILE_ID ; 3 - const SPRITEANIMSTRUCT_XCOORD ; 4 - const SPRITEANIMSTRUCT_YCOORD ; 5 - const SPRITEANIMSTRUCT_XOFFSET ; 6 - const SPRITEANIMSTRUCT_YOFFSET ; 7 - const SPRITEANIMSTRUCT_DURATION ; 8 - const SPRITEANIMSTRUCT_DURATIONOFFSET ; 9 - const SPRITEANIMSTRUCT_FRAME ; a - const SPRITEANIMSTRUCT_JUMPTABLE_INDEX ; b - const SPRITEANIMSTRUCT_0C ; c - const SPRITEANIMSTRUCT_0D ; d - const SPRITEANIMSTRUCT_0E ; e - const SPRITEANIMSTRUCT_0F ; f -SPRITEANIMSTRUCT_LENGTH EQU const_value -NUM_SPRITE_ANIM_STRUCTS EQU 10 ; see wSpriteAnimationStructs + const SPRITE_ANIM_DICT_DEFAULT ; 0 + const_skip 4 ; unused + const SPRITE_ANIM_DICT_TEXT_CURSOR ; 5 + const SPRITE_ANIM_DICT_GS_SPLASH ; 6 + const SPRITE_ANIM_DICT_SLOTS ; 7 + const SPRITE_ANIM_DICT_ARROW_CURSOR ; 8 +DEF NUM_SPRITE_ANIM_GFX EQU const_value + +; wSpriteAnimDict size (see wram.asm) +DEF NUM_SPRITEANIMDICT_ENTRIES EQU 10 ; SpriteAnimSeqData indexes (see data/sprite_anims/sequences.asm) const_def - const SPRITE_ANIM_INDEX_PARTY_MON ; 00 - const SPRITE_ANIM_INDEX_GS_TITLE_TRAIL ; 01 - const SPRITE_ANIM_INDEX_NAMING_SCREEN_CURSOR ; 02 - const SPRITE_ANIM_INDEX_GAMEFREAK_LOGO ; 03 - const SPRITE_ANIM_INDEX_GS_INTRO_STAR ; 04 - const SPRITE_ANIM_INDEX_GS_INTRO_SPARKLE ; 05 - const SPRITE_ANIM_INDEX_SLOTS_GOLEM ; 06 - const SPRITE_ANIM_INDEX_SLOTS_CHANSEY ; 07 - const SPRITE_ANIM_INDEX_SLOTS_EGG ; 08 - const SPRITE_ANIM_INDEX_COMPOSE_MAIL_CURSOR ; 09 - const SPRITE_ANIM_INDEX_RED_WALK ; 0a - const SPRITE_ANIM_INDEX_UNUSED_CURSOR ; 0b - const SPRITE_ANIM_INDEX_DUMMY_GAME ; 0c - const SPRITE_ANIM_INDEX_POKEGEAR_ARROW ; 0d - const SPRITE_ANIM_INDEX_TRADE_POKE_BALL ; 0e - const SPRITE_ANIM_INDEX_TRADE_POOF ; 0f - const SPRITE_ANIM_INDEX_TRADE_TUBE_BULGE ; 10 - const SPRITE_ANIM_INDEX_TRADEMON_ICON ; 11 - const SPRITE_ANIM_INDEX_TRADEMON_BUBBLE ; 12 - const SPRITE_ANIM_INDEX_EVOLUTION_BALL_OF_LIGHT ; 13 - const SPRITE_ANIM_INDEX_RADIO_TUNING_KNOB ; 14 - const SPRITE_ANIM_INDEX_MAGNET_TRAIN_RED ; 15 - const SPRITE_ANIM_INDEX_LEAF ; 16 - const SPRITE_ANIM_INDEX_CUT_TREE ; 17 - const SPRITE_ANIM_INDEX_FLY_LEAF ; 18 - const SPRITE_ANIM_INDEX_EGG_CRACK ; 19 - const SPRITE_ANIM_INDEX_GS_INTRO_HO_OH ; 1a - const SPRITE_ANIM_INDEX_HEADBUTT ; 1b - const SPRITE_ANIM_INDEX_EGG_HATCH ; 1c - const SPRITE_ANIM_INDEX_EZCHAT_CURSOR ; 1d - const SPRITE_ANIM_INDEX_BLUE_WALK ; 1e - const SPRITE_ANIM_INDEX_MAGNET_TRAIN_BLUE ; 1f - const SPRITE_ANIM_INDEX_MOBILE_TRADE_SENT_BALL ; 20 - const SPRITE_ANIM_INDEX_MOBILE_TRADE_OT_BALL ; 21 - const SPRITE_ANIM_INDEX_MOBILE_TRADE_CABLE_BULGE ; 22 - const SPRITE_ANIM_INDEX_MOBILE_TRADE_SENT_PULSE ; 23 - const SPRITE_ANIM_INDEX_MOBILE_TRADE_OT_PULSE ; 24 - const SPRITE_ANIM_INDEX_MOBILE_TRADE_PING ; 25 - const SPRITE_ANIM_INDEX_INTRO_SUICUNE ; 26 - const SPRITE_ANIM_INDEX_INTRO_PICHU ; 27 - const SPRITE_ANIM_INDEX_INTRO_WOOPER ; 28 - const SPRITE_ANIM_INDEX_INTRO_UNOWN ; 29 - const SPRITE_ANIM_INDEX_INTRO_UNOWN_F ; 2a - const SPRITE_ANIM_INDEX_INTRO_SUICUNE_AWAY ; 2b - const SPRITE_ANIM_INDEX_CELEBI ; 2c + const SPRITE_ANIM_INDEX_PARTY_MON ; 00 + const SPRITE_ANIM_INDEX_GS_TITLE_TRAIL ; 01 + const SPRITE_ANIM_INDEX_NAMING_SCREEN_CURSOR ; 02 + const SPRITE_ANIM_INDEX_GAMEFREAK_LOGO ; 03 + const SPRITE_ANIM_INDEX_GS_GAMEFREAK_LOGO_STAR ; 04 + const SPRITE_ANIM_INDEX_GS_GAMEFREAK_LOGO_SPARKLE ; 05 + const SPRITE_ANIM_INDEX_SLOTS_GOLEM ; 06 + const SPRITE_ANIM_INDEX_SLOTS_CHANSEY ; 07 + const SPRITE_ANIM_INDEX_SLOTS_EGG ; 08 + const SPRITE_ANIM_INDEX_COMPOSE_MAIL_CURSOR ; 09 + const SPRITE_ANIM_INDEX_RED_WALK ; 0a + const SPRITE_ANIM_INDEX_UNUSED_CURSOR ; 0b + const SPRITE_ANIM_INDEX_MEMORY_GAME_CURSOR ; 0c + const SPRITE_ANIM_INDEX_POKEGEAR_ARROW ; 0d + const SPRITE_ANIM_INDEX_TRADE_POKE_BALL ; 0e + const SPRITE_ANIM_INDEX_TRADE_POOF ; 0f + const SPRITE_ANIM_INDEX_TRADE_TUBE_BULGE ; 10 + const SPRITE_ANIM_INDEX_TRADEMON_ICON ; 11 + const SPRITE_ANIM_INDEX_TRADEMON_BUBBLE ; 12 + const SPRITE_ANIM_INDEX_EVOLUTION_BALL_OF_LIGHT ; 13 + const SPRITE_ANIM_INDEX_RADIO_TUNING_KNOB ; 14 + const SPRITE_ANIM_INDEX_MAGNET_TRAIN_RED ; 15 + const SPRITE_ANIM_INDEX_LEAF ; 16 + const SPRITE_ANIM_INDEX_CUT_TREE ; 17 + const SPRITE_ANIM_INDEX_FLY_LEAF ; 18 + const SPRITE_ANIM_INDEX_EGG_CRACK ; 19 + const SPRITE_ANIM_INDEX_GS_INTRO_HO_OH_LUGIA ; 1a + const SPRITE_ANIM_INDEX_HEADBUTT ; 1b + const SPRITE_ANIM_INDEX_EGG_HATCH ; 1c + const SPRITE_ANIM_INDEX_EZCHAT_CURSOR ; 1d + const SPRITE_ANIM_INDEX_BLUE_WALK ; 1e + const SPRITE_ANIM_INDEX_MAGNET_TRAIN_BLUE ; 1f + const SPRITE_ANIM_INDEX_MOBILE_TRADE_SENT_BALL ; 20 + const SPRITE_ANIM_INDEX_MOBILE_TRADE_OT_BALL ; 21 + const SPRITE_ANIM_INDEX_MOBILE_TRADE_CABLE_BULGE ; 22 + const SPRITE_ANIM_INDEX_MOBILE_TRADE_SENT_PULSE ; 23 + const SPRITE_ANIM_INDEX_MOBILE_TRADE_OT_PULSE ; 24 + const SPRITE_ANIM_INDEX_MOBILE_TRADE_PING ; 25 + const SPRITE_ANIM_INDEX_INTRO_SUICUNE ; 26 + const SPRITE_ANIM_INDEX_INTRO_PICHU ; 27 + const SPRITE_ANIM_INDEX_INTRO_WOOPER ; 28 + const SPRITE_ANIM_INDEX_INTRO_UNOWN ; 29 + const SPRITE_ANIM_INDEX_INTRO_UNOWN_F ; 2a + const SPRITE_ANIM_INDEX_INTRO_SUICUNE_AWAY ; 2b + const SPRITE_ANIM_INDEX_CELEBI ; 2c +DEF NUM_SPRITE_ANIM_INDEXES EQU const_value ; DoAnimFrame.Jumptable indexes (see engine/gfx/sprite_anims.asm) const_def - const SPRITE_ANIM_SEQ_NULL ; 00 - const SPRITE_ANIM_SEQ_PARTY_MON ; 01 - const SPRITE_ANIM_SEQ_PARTY_MON_SWITCH ; 02 - const SPRITE_ANIM_SEQ_PARTY_MON_SELECTED ; 03 - const SPRITE_ANIM_SEQ_GS_TITLE_TRAIL ; 04 - const SPRITE_ANIM_SEQ_NAMING_SCREEN_CURSOR ; 05 - const SPRITE_ANIM_SEQ_GAMEFREAK_LOGO ; 06 - const SPRITE_ANIM_SEQ_GS_INTRO_STAR ; 07 - const SPRITE_ANIM_SEQ_GS_INTRO_SPARKLE ; 08 - const SPRITE_ANIM_SEQ_SLOTS_GOLEM ; 09 - const SPRITE_ANIM_SEQ_SLOTS_CHANSEY ; 0a - const SPRITE_ANIM_SEQ_SLOTS_EGG ; 0b - const SPRITE_ANIM_SEQ_MAIL_CURSOR ; 0c - const SPRITE_ANIM_SEQ_UNUSED_CURSOR ; 0d - const SPRITE_ANIM_SEQ_DUMMY_GAME_CURSOR ; 0e - const SPRITE_ANIM_SEQ_POKEGEAR_ARROW ; 0f - const SPRITE_ANIM_SEQ_TRADE_POKE_BALL ; 10 - const SPRITE_ANIM_SEQ_TRADE_TUBE_BULGE ; 11 - const SPRITE_ANIM_SEQ_TRADEMON_IN_TUBE ; 12 - const SPRITE_ANIM_SEQ_REVEAL_NEW_MON ; 13 - const SPRITE_ANIM_SEQ_RADIO_TUNING_KNOB ; 14 - const SPRITE_ANIM_SEQ_CUT_LEAVES ; 15 - const SPRITE_ANIM_SEQ_FLY_FROM ; 16 - const SPRITE_ANIM_SEQ_FLY_LEAF ; 17 - const SPRITE_ANIM_SEQ_FLY_TO ; 18 - const SPRITE_ANIM_SEQ_GS_INTRO_HO_OH ; 19 - const SPRITE_ANIM_SEQ_EZCHAT_CURSOR ; 1a - const SPRITE_ANIM_SEQ_MOBILE_TRADE_SENT_PULSE ; 1b - const SPRITE_ANIM_SEQ_MOBILE_TRADE_OT_PULSE ; 1c - const SPRITE_ANIM_SEQ_INTRO_SUICUNE ; 1d - const SPRITE_ANIM_SEQ_INTRO_PICHU_WOOPER ; 1e - const SPRITE_ANIM_SEQ_CELEBI ; 1f - const SPRITE_ANIM_SEQ_INTRO_UNOWN ; 20 - const SPRITE_ANIM_SEQ_INTRO_UNOWN_F ; 21 - const SPRITE_ANIM_SEQ_INTRO_SUICUNE_AWAY ; 22 + const SPRITE_ANIM_SEQ_NULL ; 00 + const SPRITE_ANIM_SEQ_PARTY_MON ; 01 + const SPRITE_ANIM_SEQ_PARTY_MON_SWITCH ; 02 + const SPRITE_ANIM_SEQ_PARTY_MON_SELECTED ; 03 + const SPRITE_ANIM_SEQ_GS_TITLE_TRAIL ; 04 + const SPRITE_ANIM_SEQ_NAMING_SCREEN_CURSOR ; 05 + const SPRITE_ANIM_SEQ_GAMEFREAK_LOGO ; 06 + const SPRITE_ANIM_SEQ_GS_GAMEFREAK_LOGO_STAR ; 07 + const SPRITE_ANIM_SEQ_GS_GAMEFREAK_LOGO_SPARKLE ; 08 + const SPRITE_ANIM_SEQ_SLOTS_GOLEM ; 09 + const SPRITE_ANIM_SEQ_SLOTS_CHANSEY ; 0a + const SPRITE_ANIM_SEQ_SLOTS_EGG ; 0b + const SPRITE_ANIM_SEQ_MAIL_CURSOR ; 0c + const SPRITE_ANIM_SEQ_UNUSED_CURSOR ; 0d + const SPRITE_ANIM_SEQ_MEMORY_GAME_CURSOR ; 0e + const SPRITE_ANIM_SEQ_POKEGEAR_ARROW ; 0f + const SPRITE_ANIM_SEQ_TRADE_POKE_BALL ; 10 + const SPRITE_ANIM_SEQ_TRADE_TUBE_BULGE ; 11 + const SPRITE_ANIM_SEQ_TRADEMON_IN_TUBE ; 12 + const SPRITE_ANIM_SEQ_REVEAL_NEW_MON ; 13 + const SPRITE_ANIM_SEQ_RADIO_TUNING_KNOB ; 14 + const SPRITE_ANIM_SEQ_CUT_LEAVES ; 15 + const SPRITE_ANIM_SEQ_FLY_FROM ; 16 + const SPRITE_ANIM_SEQ_FLY_LEAF ; 17 + const SPRITE_ANIM_SEQ_FLY_TO ; 18 + const SPRITE_ANIM_SEQ_GS_INTRO_HO_OH_LUGIA ; 19 + const SPRITE_ANIM_SEQ_EZCHAT_CURSOR ; 1a + const SPRITE_ANIM_SEQ_MOBILE_TRADE_SENT_PULSE ; 1b + const SPRITE_ANIM_SEQ_MOBILE_TRADE_OT_PULSE ; 1c + const SPRITE_ANIM_SEQ_INTRO_SUICUNE ; 1d + const SPRITE_ANIM_SEQ_INTRO_PICHU_WOOPER ; 1e + const SPRITE_ANIM_SEQ_CELEBI ; 1f + const SPRITE_ANIM_SEQ_INTRO_UNOWN ; 20 + const SPRITE_ANIM_SEQ_INTRO_UNOWN_F ; 21 + const SPRITE_ANIM_SEQ_INTRO_SUICUNE_AWAY ; 22 +DEF NUM_SPRITE_ANIM_SEQS EQU const_value ; SpriteAnimFrameData indexes (see data/sprite_anims/framesets.asm) const_def - const SPRITE_ANIM_FRAMESET_00 ; 00 - const SPRITE_ANIM_FRAMESET_PARTY_MON ; 01 - const SPRITE_ANIM_FRAMESET_PARTY_MON_WITH_MAIL ; 02 - const SPRITE_ANIM_FRAMESET_PARTY_MON_WITH_ITEM ; 03 - const SPRITE_ANIM_FRAMESET_PARTY_MON_FAST ; 04 - const SPRITE_ANIM_FRAMESET_PARTY_MON_WITH_MAIL_FAST ; 05 - const SPRITE_ANIM_FRAMESET_PARTY_MON_WITH_ITEM_FAST ; 06 - const SPRITE_ANIM_FRAMESET_GS_TITLE_TRAIL ; 07 - const SPRITE_ANIM_FRAMESET_TEXT_ENTRY_CURSOR ; 08 - const SPRITE_ANIM_FRAMESET_TEXT_ENTRY_CURSOR_BIG ; 09 - const SPRITE_ANIM_FRAMESET_GAMEFREAK_LOGO ; 0a - const SPRITE_ANIM_FRAMESET_GS_INTRO_STAR ; 0b - const SPRITE_ANIM_FRAMESET_GS_INTRO_SPARKLE ; 0c - const SPRITE_ANIM_FRAMESET_SLOTS_GOLEM ; 0d - const SPRITE_ANIM_FRAMESET_SLOTS_CHANSEY ; 0e - const SPRITE_ANIM_FRAMESET_SLOTS_CHANSEY_2 ; 0f - const SPRITE_ANIM_FRAMESET_SLOTS_EGG ; 10 - const SPRITE_ANIM_FRAMESET_RED_WALK ; 11 - const SPRITE_ANIM_FRAMESET_STILL_CURSOR ; 12 - const SPRITE_ANIM_FRAMESET_TRADE_POKE_BALL ; 13 - const SPRITE_ANIM_FRAMESET_TRADE_POKE_BALL_WOBBLE ; 14 - const SPRITE_ANIM_FRAMESET_TRADE_POOF ; 15 - const SPRITE_ANIM_FRAMESET_TRADE_TUBE_BULGE ; 16 - const SPRITE_ANIM_FRAMESET_TRADEMON_ICON ; 17 - const SPRITE_ANIM_FRAMESET_TRADEMON_BUBBLE ; 18 - const SPRITE_ANIM_FRAMESET_EVOLUTION_BALL_OF_LIGHT ; 19 - const SPRITE_ANIM_FRAMESET_RADIO_TUNING_KNOB ; 1a - const SPRITE_ANIM_FRAMESET_MAGNET_TRAIN_RED ; 1b - const SPRITE_ANIM_FRAMESET_UNUSED_1C ; 1c - const SPRITE_ANIM_FRAMESET_LEAF ; 1d - const SPRITE_ANIM_FRAMESET_CUT_TREE ; 1e - const SPRITE_ANIM_FRAMESET_EGG_CRACK ; 1f - const SPRITE_ANIM_FRAMESET_EGG_HATCH_1 ; 20 - const SPRITE_ANIM_FRAMESET_EGG_HATCH_2 ; 21 - const SPRITE_ANIM_FRAMESET_EGG_HATCH_3 ; 22 - const SPRITE_ANIM_FRAMESET_EGG_HATCH_4 ; 23 - const SPRITE_ANIM_FRAMESET_GS_INTRO_HO_OH ; 24 - const SPRITE_ANIM_FRAMESET_HEADBUTT ; 25 - const SPRITE_ANIM_FRAMESET_EZCHAT_CURSOR_1 ; 26 - const SPRITE_ANIM_FRAMESET_EZCHAT_CURSOR_2 ; 27 - const SPRITE_ANIM_FRAMESET_EZCHAT_CURSOR_3 ; 28 - const SPRITE_ANIM_FRAMESET_EZCHAT_CURSOR_4 ; 29 - const SPRITE_ANIM_FRAMESET_EZCHAT_CURSOR_5 ; 2a - const SPRITE_ANIM_FRAMESET_EZCHAT_CURSOR_6 ; 2b - const SPRITE_ANIM_FRAMESET_EZCHAT_CURSOR_7 ; 2c - const SPRITE_ANIM_FRAMESET_BLUE_WALK ; 2d - const SPRITE_ANIM_FRAMESET_MAGNET_TRAIN_BLUE ; 2e - const SPRITE_ANIM_FRAMESET_MOBILE_TRADE_SENT_BALL ; 2f - const SPRITE_ANIM_FRAMESET_MOBILE_TRADE_OT_BALL ; 30 - const SPRITE_ANIM_FRAMESET_MOBILE_TRADE_CABLE_BULGE ; 31 - const SPRITE_ANIM_FRAMESET_MOBILE_TRADE_SENT_PULSE ; 32 - const SPRITE_ANIM_FRAMESET_MOBILE_TRADE_OT_PULSE ; 33 - const SPRITE_ANIM_FRAMESET_MOBILE_TRADE_PING ; 34 - const SPRITE_ANIM_FRAMESET_INTRO_SUICUNE ; 35 - const SPRITE_ANIM_FRAMESET_INTRO_SUICUNE_2 ; 36 - const SPRITE_ANIM_FRAMESET_INTRO_PICHU ; 37 - const SPRITE_ANIM_FRAMESET_INTRO_WOOPER ; 38 - const SPRITE_ANIM_FRAMESET_INTRO_UNOWN_1 ; 39 - const SPRITE_ANIM_FRAMESET_INTRO_UNOWN_2 ; 3a - const SPRITE_ANIM_FRAMESET_INTRO_UNOWN_3 ; 3b - const SPRITE_ANIM_FRAMESET_INTRO_UNOWN_4 ; 3c - const SPRITE_ANIM_FRAMESET_INTRO_UNOWN_F_2 ; 3d - const SPRITE_ANIM_FRAMESET_INTRO_SUICUNE_AWAY ; 3e - const SPRITE_ANIM_FRAMESET_INTRO_UNOWN_F ; 3f - const SPRITE_ANIM_FRAMESET_CELEBI_LEFT ; 40 - const SPRITE_ANIM_FRAMESET_CELEBI_RIGHT ; 41 + const SPRITE_ANIM_FRAMESET_00 ; 00 + const SPRITE_ANIM_FRAMESET_PARTY_MON ; 01 + const SPRITE_ANIM_FRAMESET_PARTY_MON_WITH_MAIL ; 02 + const SPRITE_ANIM_FRAMESET_PARTY_MON_WITH_ITEM ; 03 + const SPRITE_ANIM_FRAMESET_PARTY_MON_FAST ; 04 + const SPRITE_ANIM_FRAMESET_PARTY_MON_WITH_MAIL_FAST ; 05 + const SPRITE_ANIM_FRAMESET_PARTY_MON_WITH_ITEM_FAST ; 06 + const SPRITE_ANIM_FRAMESET_GS_TITLE_TRAIL ; 07 + const SPRITE_ANIM_FRAMESET_TEXT_ENTRY_CURSOR ; 08 + const SPRITE_ANIM_FRAMESET_TEXT_ENTRY_CURSOR_BIG ; 09 + const SPRITE_ANIM_FRAMESET_GAMEFREAK_LOGO ; 0a + const SPRITE_ANIM_FRAMESET_GS_GAMEFREAK_LOGO_STAR ; 0b + const SPRITE_ANIM_FRAMESET_GS_GAMEFREAK_LOGO_SPARKLE ; 0c + const SPRITE_ANIM_FRAMESET_SLOTS_GOLEM ; 0d + const SPRITE_ANIM_FRAMESET_SLOTS_CHANSEY ; 0e + const SPRITE_ANIM_FRAMESET_SLOTS_CHANSEY_2 ; 0f + const SPRITE_ANIM_FRAMESET_SLOTS_EGG ; 10 + const SPRITE_ANIM_FRAMESET_RED_WALK ; 11 + const SPRITE_ANIM_FRAMESET_STILL_CURSOR ; 12 + const SPRITE_ANIM_FRAMESET_TRADE_POKE_BALL ; 13 + const SPRITE_ANIM_FRAMESET_TRADE_POKE_BALL_WOBBLE ; 14 + const SPRITE_ANIM_FRAMESET_TRADE_POOF ; 15 + const SPRITE_ANIM_FRAMESET_TRADE_TUBE_BULGE ; 16 + const SPRITE_ANIM_FRAMESET_TRADEMON_ICON ; 17 + const SPRITE_ANIM_FRAMESET_TRADEMON_BUBBLE ; 18 + const SPRITE_ANIM_FRAMESET_EVOLUTION_BALL_OF_LIGHT ; 19 + const SPRITE_ANIM_FRAMESET_RADIO_TUNING_KNOB ; 1a + const SPRITE_ANIM_FRAMESET_MAGNET_TRAIN_RED ; 1b + const SPRITE_ANIM_FRAMESET_UNUSED_1C ; 1c + const SPRITE_ANIM_FRAMESET_LEAF ; 1d + const SPRITE_ANIM_FRAMESET_CUT_TREE ; 1e + const SPRITE_ANIM_FRAMESET_EGG_CRACK ; 1f + const SPRITE_ANIM_FRAMESET_EGG_HATCH_1 ; 20 + const SPRITE_ANIM_FRAMESET_EGG_HATCH_2 ; 21 + const SPRITE_ANIM_FRAMESET_EGG_HATCH_3 ; 22 + const SPRITE_ANIM_FRAMESET_EGG_HATCH_4 ; 23 + const SPRITE_ANIM_FRAMESET_GS_INTRO_HO_OH_LUGIA ; 24 + const SPRITE_ANIM_FRAMESET_HEADBUTT ; 25 + const SPRITE_ANIM_FRAMESET_EZCHAT_CURSOR_1 ; 26 + const SPRITE_ANIM_FRAMESET_EZCHAT_CURSOR_2 ; 27 + const SPRITE_ANIM_FRAMESET_EZCHAT_CURSOR_3 ; 28 + const SPRITE_ANIM_FRAMESET_EZCHAT_CURSOR_4 ; 29 + const SPRITE_ANIM_FRAMESET_EZCHAT_CURSOR_5 ; 2a + const SPRITE_ANIM_FRAMESET_EZCHAT_CURSOR_6 ; 2b + const SPRITE_ANIM_FRAMESET_EZCHAT_CURSOR_7 ; 2c + const SPRITE_ANIM_FRAMESET_BLUE_WALK ; 2d + const SPRITE_ANIM_FRAMESET_MAGNET_TRAIN_BLUE ; 2e + const SPRITE_ANIM_FRAMESET_MOBILE_TRADE_SENT_BALL ; 2f + const SPRITE_ANIM_FRAMESET_MOBILE_TRADE_OT_BALL ; 30 + const SPRITE_ANIM_FRAMESET_MOBILE_TRADE_CABLE_BULGE ; 31 + const SPRITE_ANIM_FRAMESET_MOBILE_TRADE_SENT_PULSE ; 32 + const SPRITE_ANIM_FRAMESET_MOBILE_TRADE_OT_PULSE ; 33 + const SPRITE_ANIM_FRAMESET_MOBILE_TRADE_PING ; 34 + const SPRITE_ANIM_FRAMESET_INTRO_SUICUNE ; 35 + const SPRITE_ANIM_FRAMESET_INTRO_SUICUNE_2 ; 36 + const SPRITE_ANIM_FRAMESET_INTRO_PICHU ; 37 + const SPRITE_ANIM_FRAMESET_INTRO_WOOPER ; 38 + const SPRITE_ANIM_FRAMESET_INTRO_UNOWN_1 ; 39 + const SPRITE_ANIM_FRAMESET_INTRO_UNOWN_2 ; 3a + const SPRITE_ANIM_FRAMESET_INTRO_UNOWN_3 ; 3b + const SPRITE_ANIM_FRAMESET_INTRO_UNOWN_4 ; 3c + const SPRITE_ANIM_FRAMESET_INTRO_UNOWN_F_2 ; 3d + const SPRITE_ANIM_FRAMESET_INTRO_SUICUNE_AWAY ; 3e + const SPRITE_ANIM_FRAMESET_INTRO_UNOWN_F ; 3f + const SPRITE_ANIM_FRAMESET_CELEBI_LEFT ; 40 + const SPRITE_ANIM_FRAMESET_CELEBI_RIGHT ; 41 + const SPRITE_ANIM_FRAMESET_EZCHAT_CURSOR_8 ; 42 + const SPRITE_ANIM_FRAMESET_EZCHAT_CURSOR_9 ; 43 + const SPRITE_ANIM_FRAMESET_EZCHAT_CURSOR_10 ; 44 +DEF NUM_SPRITE_ANIM_FRAMESETS EQU const_value ; SpriteAnimOAMData indexes (see data/sprite_anims/oam.asm) const_def - const SPRITE_ANIM_OAMSET_RED_WALK_1 ; 00 - const SPRITE_ANIM_OAMSET_RED_WALK_2 ; 01 - const SPRITE_ANIM_OAMSET_GS_INTRO_BUBBLE_1 ; 02 - const SPRITE_ANIM_OAMSET_GS_INTRO_BUBBLE_2 ; 03 - const SPRITE_ANIM_OAMSET_GS_INTRO_SHELLDER_1 ; 04 - const SPRITE_ANIM_OAMSET_GS_INTRO_SHELLDER_2 ; 05 - const SPRITE_ANIM_OAMSET_GS_INTRO_MAGIKARP_1 ; 06 - const SPRITE_ANIM_OAMSET_GS_INTRO_MAGIKARP_2 ; 07 - const SPRITE_ANIM_OAMSET_GS_INTRO_LAPRAS_1 ; 08 - const SPRITE_ANIM_OAMSET_GS_INTRO_LAPRAS_2 ; 09 - const SPRITE_ANIM_OAMSET_GS_INTRO_LAPRAS_3 ; 0a - const SPRITE_ANIM_OAMSET_GS_INTRO_LAPRAS_4 ; 0b - const SPRITE_ANIM_OAMSET_GS_INTRO_NOTE ; 0c - const SPRITE_ANIM_OAMSET_GS_INTRO_INVISIBLE_NOTE ; 0d - const SPRITE_ANIM_OAMSET_GS_INTRO_JIGGLYPUFF_1 ; 0e - const SPRITE_ANIM_OAMSET_GS_INTRO_JIGGLYPUFF_2 ; 0f - const SPRITE_ANIM_OAMSET_GS_INTRO_JIGGLYPUFF_3 ; 10 - const SPRITE_ANIM_OAMSET_GS_INTRO_PIKACHU_1 ; 11 - const SPRITE_ANIM_OAMSET_GS_INTRO_PIKACHU_2 ; 12 - const SPRITE_ANIM_OAMSET_GS_INTRO_PIKACHU_3 ; 13 - const SPRITE_ANIM_OAMSET_GS_INTRO_PIKACHU_4 ; 14 - const SPRITE_ANIM_OAMSET_GS_INTRO_PIKACHU_TAIL_1 ; 15 - const SPRITE_ANIM_OAMSET_GS_INTRO_PIKACHU_TAIL_2 ; 16 - const SPRITE_ANIM_OAMSET_GS_INTRO_PIKACHU_TAIL_3 ; 17 - const SPRITE_ANIM_OAMSET_GS_INTRO_SMALL_FIREBALL ; 18 - const SPRITE_ANIM_OAMSET_GS_INTRO_MED_FIREBALL ; 19 - const SPRITE_ANIM_OAMSET_GS_INTRO_BIG_FIREBALL ; 1a - const SPRITE_ANIM_OAMSET_GS_INTRO_CHIKORITA ; 1b - const SPRITE_ANIM_OAMSET_GS_INTRO_CYNDAQUIL ; 1c - const SPRITE_ANIM_OAMSET_GS_INTRO_TOTODILE ; 1d - const SPRITE_ANIM_OAMSET_GS_TITLE_TRAIL_1 ; 1e - const SPRITE_ANIM_OAMSET_GS_TITLE_TRAIL_2 ; 1f - const SPRITE_ANIM_OAMSET_TEXT_ENTRY_CURSOR ; 20 - const SPRITE_ANIM_OAMSET_TEXT_ENTRY_CURSOR_BIG ; 21 - const SPRITE_ANIM_OAMSET_GS_INTRO_GAMEFREAK_LOGO ; 22 - const SPRITE_ANIM_OAMSET_GS_INTRO_STAR ; 23 - const SPRITE_ANIM_OAMSET_GS_INTRO_SPARKLE_1 ; 24 - const SPRITE_ANIM_OAMSET_GS_INTRO_SPARKLE_2 ; 25 - const SPRITE_ANIM_OAMSET_GS_INTRO_SPARKLE_3 ; 26 - const SPRITE_ANIM_OAMSET_SLOTS_GOLEM_1 ; 27 - const SPRITE_ANIM_OAMSET_SLOTS_GOLEM_2 ; 28 - const SPRITE_ANIM_OAMSET_SLOTS_CHANSEY_1 ; 29 - const SPRITE_ANIM_OAMSET_SLOTS_CHANSEY_2 ; 2a - const SPRITE_ANIM_OAMSET_SLOTS_CHANSEY_3 ; 2b - const SPRITE_ANIM_OAMSET_SLOTS_CHANSEY_4 ; 2c - const SPRITE_ANIM_OAMSET_SLOTS_CHANSEY_5 ; 2d - const SPRITE_ANIM_OAMSET_SLOTS_EGG ; 2e - const SPRITE_ANIM_OAMSET_STILL_CURSOR ; 2f - const SPRITE_ANIM_OAMSET_TRADE_POKE_BALL_1 ; 30 - const SPRITE_ANIM_OAMSET_TRADE_POKE_BALL_2 ; 31 - const SPRITE_ANIM_OAMSET_TRADE_POOF_1 ; 32 - const SPRITE_ANIM_OAMSET_TRADE_POOF_2 ; 33 - const SPRITE_ANIM_OAMSET_TRADE_POOF_3 ; 34 - const SPRITE_ANIM_OAMSET_TRADE_TUBE_BULGE_1 ; 35 - const SPRITE_ANIM_OAMSET_TRADE_TUBE_BULGE_2 ; 36 - const SPRITE_ANIM_OAMSET_TRADEMON_ICON_1 ; 37 - const SPRITE_ANIM_OAMSET_TRADEMON_ICON_2 ; 38 - const SPRITE_ANIM_OAMSET_TRADEMON_BUBBLE ; 39 - const SPRITE_ANIM_OAMSET_EVOLUTION_BALL_OF_LIGHT_1 ; 3a - const SPRITE_ANIM_OAMSET_EVOLUTION_BALL_OF_LIGHT_2 ; 3b - const SPRITE_ANIM_OAMSET_RADIO_TUNING_KNOB ; 3c - const SPRITE_ANIM_OAMSET_PARTY_MON_WITH_MAIL_1 ; 3d - const SPRITE_ANIM_OAMSET_PARTY_MON_WITH_MAIL_2 ; 3e - const SPRITE_ANIM_OAMSET_PARTY_MON_WITH_ITEM_1 ; 3f - const SPRITE_ANIM_OAMSET_PARTY_MON_WITH_ITEM_2 ; 40 - const SPRITE_ANIM_OAMSET_MAGNET_TRAIN_RED_1 ; 41 - const SPRITE_ANIM_OAMSET_MAGNET_TRAIN_RED_2 ; 42 - const SPRITE_ANIM_OAMSET_UNUSED_43 ; 43 - const SPRITE_ANIM_OAMSET_UNUSED_44 ; 44 - const SPRITE_ANIM_OAMSET_UNUSED_45 ; 45 - const SPRITE_ANIM_OAMSET_UNUSED_46 ; 46 - const SPRITE_ANIM_OAMSET_UNUSED_47 ; 47 - const SPRITE_ANIM_OAMSET_UNUSED_48 ; 48 - const SPRITE_ANIM_OAMSET_UNUSED_49 ; 49 - const SPRITE_ANIM_OAMSET_UNUSED_4A ; 4a - const SPRITE_ANIM_OAMSET_UNUSED_4B ; 4b - const SPRITE_ANIM_OAMSET_UNUSED_4C ; 4c - const SPRITE_ANIM_OAMSET_UNUSED_4D ; 4d - const SPRITE_ANIM_OAMSET_UNUSED_4E ; 4e - const SPRITE_ANIM_OAMSET_LEAF ; 4f - const SPRITE_ANIM_OAMSET_TREE_1 ; 50 - const SPRITE_ANIM_OAMSET_CUT_TREE_2 ; 51 - const SPRITE_ANIM_OAMSET_CUT_TREE_3 ; 52 - const SPRITE_ANIM_OAMSET_CUT_TREE_4 ; 53 - const SPRITE_ANIM_OAMSET_EGG_CRACK ; 54 - const SPRITE_ANIM_OAMSET_EGG_HATCH ; 55 - const SPRITE_ANIM_OAMSET_GS_INTRO_HO_OH_1 ; 56 - const SPRITE_ANIM_OAMSET_GS_INTRO_HO_OH_2 ; 57 - const SPRITE_ANIM_OAMSET_GS_INTRO_HO_OH_3 ; 58 - const SPRITE_ANIM_OAMSET_GS_INTRO_HO_OH_4 ; 59 - const SPRITE_ANIM_OAMSET_GS_INTRO_HO_OH_5 ; 5a - const SPRITE_ANIM_OAMSET_HEADBUTT_TREE_2 ; 5b - const SPRITE_ANIM_OAMSET_EZCHAT_CURSOR_1 ; 5c - const SPRITE_ANIM_OAMSET_EZCHAT_CURSOR_2 ; 5d - const SPRITE_ANIM_OAMSET_EZCHAT_CURSOR_3 ; 5e - const SPRITE_ANIM_OAMSET_EZCHAT_CURSOR_4 ; 5f - const SPRITE_ANIM_OAMSET_EZCHAT_CURSOR_5 ; 60 - const SPRITE_ANIM_OAMSET_EZCHAT_CURSOR_6 ; 61 - const SPRITE_ANIM_OAMSET_EZCHAT_CURSOR_7 ; 62 - const SPRITE_ANIM_OAMSET_BLUE_WALK_1 ; 63 - const SPRITE_ANIM_OAMSET_BLUE_WALK_2 ; 64 - const SPRITE_ANIM_OAMSET_MAGNET_TRAIN_BLUE_1 ; 65 - const SPRITE_ANIM_OAMSET_MAGNET_TRAIN_BLUE_2 ; 66 - const SPRITE_ANIM_OAMSET_MOBILE_TRADE_CABLE_BULGE_1 ; 67 - const SPRITE_ANIM_OAMSET_MOBILE_TRADE_CABLE_BULGE_2 ; 68 - const SPRITE_ANIM_OAMSET_MOBILE_TRADE_PING_1 ; 69 - const SPRITE_ANIM_OAMSET_MOBILE_TRADE_PING_2 ; 6a - const SPRITE_ANIM_OAMSET_MOBILE_TRADE_PING_3 ; 6b - const SPRITE_ANIM_OAMSET_MOBILE_TRADE_SENT_PULSE ; 6c - const SPRITE_ANIM_OAMSET_MOBILE_TRADE_OT_PULSE ; 6d - const SPRITE_ANIM_OAMSET_INTRO_SUICUNE_1 ; 6e - const SPRITE_ANIM_OAMSET_INTRO_SUICUNE_2 ; 6f - const SPRITE_ANIM_OAMSET_INTRO_SUICUNE_3 ; 70 - const SPRITE_ANIM_OAMSET_INTRO_SUICUNE_4 ; 71 - const SPRITE_ANIM_OAMSET_INTRO_PICHU_1 ; 72 - const SPRITE_ANIM_OAMSET_INTRO_PICHU_2 ; 73 - const SPRITE_ANIM_OAMSET_INTRO_PICHU_3 ; 74 - const SPRITE_ANIM_OAMSET_INTRO_WOOPER ; 75 - const SPRITE_ANIM_OAMSET_INTRO_UNOWN_1 ; 76 - const SPRITE_ANIM_OAMSET_INTRO_UNOWN_2 ; 77 - const SPRITE_ANIM_OAMSET_INTRO_UNOWN_3 ; 78 - const SPRITE_ANIM_OAMSET_INTRO_UNOWN_F_2_1 ; 79 - const SPRITE_ANIM_OAMSET_INTRO_UNOWN_F_2_2 ; 7a - const SPRITE_ANIM_OAMSET_INTRO_UNOWN_F_2_3 ; 7b - const SPRITE_ANIM_OAMSET_INTRO_UNOWN_F_2_4 ; 7c - const SPRITE_ANIM_OAMSET_INTRO_UNOWN_F_2_5 ; 7d - const SPRITE_ANIM_OAMSET_INTRO_SUICUNE_AWAY ; 7e - const SPRITE_ANIM_OAMSET_CELEBI_1 ; 7f - const SPRITE_ANIM_OAMSET_CELEBI_2 ; 80 - const SPRITE_ANIM_OAMSET_GAMEFREAK_LOGO_1 ; 81 - const SPRITE_ANIM_OAMSET_GAMEFREAK_LOGO_2 ; 82 - const SPRITE_ANIM_OAMSET_GAMEFREAK_LOGO_3 ; 83 - const SPRITE_ANIM_OAMSET_GAMEFREAK_LOGO_4 ; 84 - const SPRITE_ANIM_OAMSET_GAMEFREAK_LOGO_5 ; 85 - const SPRITE_ANIM_OAMSET_GAMEFREAK_LOGO_6 ; 86 - const SPRITE_ANIM_OAMSET_GAMEFREAK_LOGO_7 ; 87 - const SPRITE_ANIM_OAMSET_GAMEFREAK_LOGO_8 ; 88 - const SPRITE_ANIM_OAMSET_GAMEFREAK_LOGO_9 ; 89 - const SPRITE_ANIM_OAMSET_GAMEFREAK_LOGO_10 ; 8a - const SPRITE_ANIM_OAMSET_GAMEFREAK_LOGO_11 ; 8b + const SPRITE_ANIM_OAMSET_RED_WALK_1 ; 00 + const SPRITE_ANIM_OAMSET_RED_WALK_2 ; 01 + const SPRITE_ANIM_OAMSET_GS_INTRO_BUBBLE_1 ; 02 + const SPRITE_ANIM_OAMSET_GS_INTRO_BUBBLE_2 ; 03 + const SPRITE_ANIM_OAMSET_GS_INTRO_SHELLDER_1 ; 04 + const SPRITE_ANIM_OAMSET_GS_INTRO_SHELLDER_2 ; 05 + const SPRITE_ANIM_OAMSET_GS_INTRO_MAGIKARP_1 ; 06 + const SPRITE_ANIM_OAMSET_GS_INTRO_MAGIKARP_2 ; 07 + const SPRITE_ANIM_OAMSET_GS_INTRO_UNUSED_LAPRAS ; 08 + const SPRITE_ANIM_OAMSET_GS_INTRO_LAPRAS_1 ; 09 + const SPRITE_ANIM_OAMSET_GS_INTRO_LAPRAS_2 ; 0a + const SPRITE_ANIM_OAMSET_GS_INTRO_LAPRAS_3 ; 0b + const SPRITE_ANIM_OAMSET_GS_INTRO_NOTE ; 0c + const SPRITE_ANIM_OAMSET_GS_INTRO_INVISIBLE_NOTE ; 0d + const SPRITE_ANIM_OAMSET_GS_INTRO_JIGGLYPUFF_1 ; 0e + const SPRITE_ANIM_OAMSET_GS_INTRO_JIGGLYPUFF_2 ; 0f + const SPRITE_ANIM_OAMSET_GS_INTRO_JIGGLYPUFF_3 ; 10 + const SPRITE_ANIM_OAMSET_GS_INTRO_PIKACHU_1 ; 11 + const SPRITE_ANIM_OAMSET_GS_INTRO_PIKACHU_2 ; 12 + const SPRITE_ANIM_OAMSET_GS_INTRO_PIKACHU_3 ; 13 + const SPRITE_ANIM_OAMSET_GS_INTRO_PIKACHU_4 ; 14 + const SPRITE_ANIM_OAMSET_GS_INTRO_PIKACHU_TAIL_1 ; 15 + const SPRITE_ANIM_OAMSET_GS_INTRO_PIKACHU_TAIL_2 ; 16 + const SPRITE_ANIM_OAMSET_GS_INTRO_PIKACHU_TAIL_3 ; 17 + const SPRITE_ANIM_OAMSET_GS_INTRO_SMALL_FIREBALL ; 18 + const SPRITE_ANIM_OAMSET_GS_INTRO_MED_FIREBALL ; 19 + const SPRITE_ANIM_OAMSET_GS_INTRO_BIG_FIREBALL ; 1a + const SPRITE_ANIM_OAMSET_GS_INTRO_CHIKORITA ; 1b + const SPRITE_ANIM_OAMSET_GS_INTRO_CYNDAQUIL ; 1c + const SPRITE_ANIM_OAMSET_GS_INTRO_TOTODILE ; 1d + const SPRITE_ANIM_OAMSET_GS_TITLE_TRAIL_1 ; 1e + const SPRITE_ANIM_OAMSET_GS_TITLE_TRAIL_2 ; 1f + const SPRITE_ANIM_OAMSET_TEXT_ENTRY_CURSOR ; 20 + const SPRITE_ANIM_OAMSET_TEXT_ENTRY_CURSOR_BIG ; 21 + const SPRITE_ANIM_OAMSET_GS_GAMEFREAK_LOGO ; 22 + const SPRITE_ANIM_OAMSET_GS_GAMEFREAK_LOGO_STAR ; 23 + const SPRITE_ANIM_OAMSET_GS_GAMEFREAK_LOGO_SPARKLE_1 ; 24 + const SPRITE_ANIM_OAMSET_GS_GAMEFREAK_LOGO_SPARKLE_2 ; 25 + const SPRITE_ANIM_OAMSET_GS_GAMEFREAK_LOGO_SPARKLE_3 ; 26 + const SPRITE_ANIM_OAMSET_SLOTS_GOLEM_1 ; 27 + const SPRITE_ANIM_OAMSET_SLOTS_GOLEM_2 ; 28 + const SPRITE_ANIM_OAMSET_SLOTS_CHANSEY_1 ; 29 + const SPRITE_ANIM_OAMSET_SLOTS_CHANSEY_2 ; 2a + const SPRITE_ANIM_OAMSET_SLOTS_CHANSEY_3 ; 2b + const SPRITE_ANIM_OAMSET_SLOTS_CHANSEY_4 ; 2c + const SPRITE_ANIM_OAMSET_SLOTS_CHANSEY_5 ; 2d + const SPRITE_ANIM_OAMSET_SLOTS_EGG ; 2e + const SPRITE_ANIM_OAMSET_STILL_CURSOR ; 2f + const SPRITE_ANIM_OAMSET_TRADE_POKE_BALL_1 ; 30 + const SPRITE_ANIM_OAMSET_TRADE_POKE_BALL_2 ; 31 + const SPRITE_ANIM_OAMSET_TRADE_POOF_1 ; 32 + const SPRITE_ANIM_OAMSET_TRADE_POOF_2 ; 33 + const SPRITE_ANIM_OAMSET_TRADE_POOF_3 ; 34 + const SPRITE_ANIM_OAMSET_TRADE_TUBE_BULGE_1 ; 35 + const SPRITE_ANIM_OAMSET_TRADE_TUBE_BULGE_2 ; 36 + const SPRITE_ANIM_OAMSET_TRADEMON_ICON_1 ; 37 + const SPRITE_ANIM_OAMSET_TRADEMON_ICON_2 ; 38 + const SPRITE_ANIM_OAMSET_TRADEMON_BUBBLE ; 39 + const SPRITE_ANIM_OAMSET_EVOLUTION_BALL_OF_LIGHT_1 ; 3a + const SPRITE_ANIM_OAMSET_EVOLUTION_BALL_OF_LIGHT_2 ; 3b + const SPRITE_ANIM_OAMSET_RADIO_TUNING_KNOB ; 3c + const SPRITE_ANIM_OAMSET_PARTY_MON_WITH_MAIL_1 ; 3d + const SPRITE_ANIM_OAMSET_PARTY_MON_WITH_MAIL_2 ; 3e + const SPRITE_ANIM_OAMSET_PARTY_MON_WITH_ITEM_1 ; 3f + const SPRITE_ANIM_OAMSET_PARTY_MON_WITH_ITEM_2 ; 40 + const SPRITE_ANIM_OAMSET_MAGNET_TRAIN_RED_1 ; 41 + const SPRITE_ANIM_OAMSET_MAGNET_TRAIN_RED_2 ; 42 + const SPRITE_ANIM_OAMSET_UNUSED_43 ; 43 + const SPRITE_ANIM_OAMSET_UNUSED_44 ; 44 + const SPRITE_ANIM_OAMSET_UNUSED_45 ; 45 + const SPRITE_ANIM_OAMSET_UNUSED_46 ; 46 + const SPRITE_ANIM_OAMSET_UNUSED_47 ; 47 + const SPRITE_ANIM_OAMSET_UNUSED_48 ; 48 + const SPRITE_ANIM_OAMSET_UNUSED_49 ; 49 + const SPRITE_ANIM_OAMSET_UNUSED_4A ; 4a + const SPRITE_ANIM_OAMSET_UNUSED_4B ; 4b + const SPRITE_ANIM_OAMSET_UNUSED_4C ; 4c + const SPRITE_ANIM_OAMSET_UNUSED_4D ; 4d + const SPRITE_ANIM_OAMSET_UNUSED_4E ; 4e + const SPRITE_ANIM_OAMSET_LEAF ; 4f + const SPRITE_ANIM_OAMSET_TREE_1 ; 50 + const SPRITE_ANIM_OAMSET_CUT_TREE_2 ; 51 + const SPRITE_ANIM_OAMSET_CUT_TREE_3 ; 52 + const SPRITE_ANIM_OAMSET_CUT_TREE_4 ; 53 + const SPRITE_ANIM_OAMSET_EGG_CRACK ; 54 + const SPRITE_ANIM_OAMSET_EGG_HATCH ; 55 + const SPRITE_ANIM_OAMSET_GS_INTRO_HO_OH_LUGIA_1 ; 56 + const SPRITE_ANIM_OAMSET_GS_INTRO_HO_OH_LUGIA_2 ; 57 + const SPRITE_ANIM_OAMSET_GS_INTRO_HO_OH_LUGIA_3 ; 58 + const SPRITE_ANIM_OAMSET_GS_INTRO_HO_OH_LUGIA_4 ; 59 + const SPRITE_ANIM_OAMSET_GS_INTRO_HO_OH_LUGIA_5 ; 5a + const SPRITE_ANIM_OAMSET_HEADBUTT_TREE_2 ; 5b + const SPRITE_ANIM_OAMSET_EZCHAT_CURSOR_1 ; 5c + const SPRITE_ANIM_OAMSET_EZCHAT_CURSOR_2 ; 5d + const SPRITE_ANIM_OAMSET_EZCHAT_CURSOR_3 ; 5e + const SPRITE_ANIM_OAMSET_EZCHAT_CURSOR_4 ; 5f + const SPRITE_ANIM_OAMSET_EZCHAT_CURSOR_5 ; 60 + const SPRITE_ANIM_OAMSET_EZCHAT_CURSOR_6 ; 61 + const SPRITE_ANIM_OAMSET_EZCHAT_CURSOR_7 ; 62 + const SPRITE_ANIM_OAMSET_BLUE_WALK_1 ; 63 + const SPRITE_ANIM_OAMSET_BLUE_WALK_2 ; 64 + const SPRITE_ANIM_OAMSET_MAGNET_TRAIN_BLUE_1 ; 65 + const SPRITE_ANIM_OAMSET_MAGNET_TRAIN_BLUE_2 ; 66 + const SPRITE_ANIM_OAMSET_MOBILE_TRADE_CABLE_BULGE_1 ; 67 + const SPRITE_ANIM_OAMSET_MOBILE_TRADE_CABLE_BULGE_2 ; 68 + const SPRITE_ANIM_OAMSET_MOBILE_TRADE_PING_1 ; 69 + const SPRITE_ANIM_OAMSET_MOBILE_TRADE_PING_2 ; 6a + const SPRITE_ANIM_OAMSET_MOBILE_TRADE_PING_3 ; 6b + const SPRITE_ANIM_OAMSET_MOBILE_TRADE_SENT_PULSE ; 6c + const SPRITE_ANIM_OAMSET_MOBILE_TRADE_OT_PULSE ; 6d + const SPRITE_ANIM_OAMSET_INTRO_SUICUNE_1 ; 6e + const SPRITE_ANIM_OAMSET_INTRO_SUICUNE_2 ; 6f + const SPRITE_ANIM_OAMSET_INTRO_SUICUNE_3 ; 70 + const SPRITE_ANIM_OAMSET_INTRO_SUICUNE_4 ; 71 + const SPRITE_ANIM_OAMSET_INTRO_PICHU_1 ; 72 + const SPRITE_ANIM_OAMSET_INTRO_PICHU_2 ; 73 + const SPRITE_ANIM_OAMSET_INTRO_PICHU_3 ; 74 + const SPRITE_ANIM_OAMSET_INTRO_WOOPER ; 75 + const SPRITE_ANIM_OAMSET_INTRO_UNOWN_1 ; 76 + const SPRITE_ANIM_OAMSET_INTRO_UNOWN_2 ; 77 + const SPRITE_ANIM_OAMSET_INTRO_UNOWN_3 ; 78 + const SPRITE_ANIM_OAMSET_INTRO_UNOWN_F_2_1 ; 79 + const SPRITE_ANIM_OAMSET_INTRO_UNOWN_F_2_2 ; 7a + const SPRITE_ANIM_OAMSET_INTRO_UNOWN_F_2_3 ; 7b + const SPRITE_ANIM_OAMSET_INTRO_UNOWN_F_2_4 ; 7c + const SPRITE_ANIM_OAMSET_INTRO_UNOWN_F_2_5 ; 7d + const SPRITE_ANIM_OAMSET_INTRO_SUICUNE_AWAY ; 7e + const SPRITE_ANIM_OAMSET_CELEBI_1 ; 7f + const SPRITE_ANIM_OAMSET_CELEBI_2 ; 80 + const SPRITE_ANIM_OAMSET_GAMEFREAK_LOGO_1 ; 81 + const SPRITE_ANIM_OAMSET_GAMEFREAK_LOGO_2 ; 82 + const SPRITE_ANIM_OAMSET_GAMEFREAK_LOGO_3 ; 83 + const SPRITE_ANIM_OAMSET_GAMEFREAK_LOGO_4 ; 84 + const SPRITE_ANIM_OAMSET_GAMEFREAK_LOGO_5 ; 85 + const SPRITE_ANIM_OAMSET_GAMEFREAK_LOGO_6 ; 86 + const SPRITE_ANIM_OAMSET_GAMEFREAK_LOGO_7 ; 87 + const SPRITE_ANIM_OAMSET_GAMEFREAK_LOGO_8 ; 88 + const SPRITE_ANIM_OAMSET_GAMEFREAK_LOGO_9 ; 89 + const SPRITE_ANIM_OAMSET_GAMEFREAK_LOGO_10 ; 8a + const SPRITE_ANIM_OAMSET_GAMEFREAK_LOGO_11 ; 8b + const SPRITE_ANIM_OAMSET_EZCHAT_CURSOR_8 ; 8c + const SPRITE_ANIM_OAMSET_EZCHAT_CURSOR_9 ; 8d + const SPRITE_ANIM_OAMSET_EZCHAT_CURSOR_10 ; 8e +DEF NUM_SPRITE_ANIM_OAMSETS EQU const_value diff --git a/pokecrystal/constants/sprite_constants.asm b/pokecrystal/constants/sprite_constants.asm index caa6743..1181285 100644 --- a/pokecrystal/constants/sprite_constants.asm +++ b/pokecrystal/constants/sprite_constants.asm @@ -5,7 +5,7 @@ const SPRITE_CHRIS ; 01 const SPRITE_CHRIS_BIKE ; 02 const SPRITE_GAMEBOY_KID ; 03 - const SPRITE_SILVER ; 04 + const SPRITE_RIVAL ; 04 const SPRITE_OAK ; 05 const SPRITE_RED ; 06 const SPRITE_BLUE ; 07 @@ -43,7 +43,7 @@ const SPRITE_YOUNGSTER ; 27 const SPRITE_LASS ; 28 const SPRITE_TEACHER ; 29 - const SPRITE_BUENA ; 2a + const SPRITE_BEAUTY ; 2a const SPRITE_SUPER_NERD ; 2b const SPRITE_ROCKER ; 2c const SPRITE_POKEFAN_M ; 2d @@ -73,7 +73,7 @@ const SPRITE_SLOWPOKE ; 45 const SPRITE_CAPTAIN ; 46 const SPRITE_BIG_LAPRAS ; 47 - const SPRITE_GYM_GUY ; 48 + const SPRITE_GYM_GUIDE ; 48 const SPRITE_SAILOR ; 49 const SPRITE_BIKER ; 4a const SPRITE_PHARMACIST ; 4b @@ -104,10 +104,11 @@ const SPRITE_ENTEI ; 64 const SPRITE_RAIKOU ; 65 const SPRITE_STANDING_YOUNGSTER ; 66 +DEF NUM_OVERWORLD_SPRITES EQU const_value - 1 ; SpriteMons indexes (see data/sprites/sprite_mons.asm) - const_def $80 -SPRITE_POKEMON EQU const_value + const_next $80 +DEF SPRITE_POKEMON EQU const_value const SPRITE_UNOWN ; 80 const SPRITE_GEODUDE ; 81 const SPRITE_GROWLITHE ; 82 @@ -143,15 +144,16 @@ SPRITE_POKEMON EQU const_value const SPRITE_GYARADOS ; a0 const SPRITE_LUGIA ; a1 const SPRITE_HO_OH ; a2 +DEF NUM_POKEMON_SPRITES EQU const_value - SPRITE_POKEMON ; special GetMonSprite values (see engine/overworld/overworld.asm) - const_def $e0 + const_next $e0 const SPRITE_DAY_CARE_MON_1 ; e0 const SPRITE_DAY_CARE_MON_2 ; e1 ; wVariableSprites indexes (see wram.asm) - const_def $f0 -SPRITE_VARS EQU const_value + const_next $f0 +DEF SPRITE_VARS EQU const_value const SPRITE_CONSOLE ; f0 const SPRITE_DOLL_1 ; f1 const SPRITE_DOLL_2 ; f2 diff --git a/pokecrystal/constants/sprite_data_constants.asm b/pokecrystal/constants/sprite_data_constants.asm index 329833b..407252b 100644 --- a/pokecrystal/constants/sprite_data_constants.asm +++ b/pokecrystal/constants/sprite_data_constants.asm @@ -1,12 +1,11 @@ -; overworld_sprite struct members (see data/sprites.asm) - const_def - const SPRITEDATA_ADDR ; 0 - const SPRITEDATA_ADDR_HI ; 1 - const SPRITEDATA_SIZE ; 2 - const SPRITEDATA_BANK ; 3 - const SPRITEDATA_TYPE ; 4 - const SPRITEDATA_PALETTE ; 5 -NUM_SPRITEDATA_FIELDS EQU const_value +; overworld_sprite struct members (see data/sprites/sprites.asm) +rsreset +DEF SPRITEDATA_ADDR rw ; 0 +DEF SPRITEDATA_SIZE rb ; 2 +DEF SPRITEDATA_BANK rb ; 3 +DEF SPRITEDATA_TYPE rb ; 4 +DEF SPRITEDATA_PALETTE rb ; 5 +DEF NUM_SPRITEDATA_FIELDS EQU _RS ; sprite types const_def 1 diff --git a/pokecrystal/constants/text_constants.asm b/pokecrystal/constants/text_constants.asm index ee55895..67ed07e 100644 --- a/pokecrystal/constants/text_constants.asm +++ b/pokecrystal/constants/text_constants.asm @@ -1,12 +1,12 @@ ; name lengths -NAME_LENGTH EQU 11 -PLAYER_NAME_LENGTH EQU 8 -BOX_NAME_LENGTH EQU 9 -MON_NAME_LENGTH EQU 11 -MOVE_NAME_LENGTH EQU 13 -ITEM_NAME_LENGTH EQU 13 -TRAINER_CLASS_NAME_LENGTH EQU 13 -NAME_LENGTH_JAPANESE EQU 6 +DEF NAME_LENGTH EQU 11 +DEF PLAYER_NAME_LENGTH EQU 8 +DEF BOX_NAME_LENGTH EQU 9 +DEF MON_NAME_LENGTH EQU 11 +DEF MOVE_NAME_LENGTH EQU 13 +DEF ITEM_NAME_LENGTH EQU 13 +DEF TRAINER_CLASS_NAME_LENGTH EQU 13 +DEF NAME_LENGTH_JAPANESE EQU 6 ; GetName types (see home/names.asm) const_def 1 @@ -20,27 +20,33 @@ NAME_LENGTH_JAPANESE EQU 6 const MOVE_DESC_NAME_BROKEN ; 8 ; see home/text.asm -BORDER_WIDTH EQU 2 -TEXTBOX_WIDTH EQU SCREEN_WIDTH -TEXTBOX_INNERW EQU TEXTBOX_WIDTH - BORDER_WIDTH -TEXTBOX_HEIGHT EQU 6 -TEXTBOX_INNERH EQU TEXTBOX_HEIGHT - BORDER_WIDTH -TEXTBOX_X EQU 0 -TEXTBOX_INNERX EQU TEXTBOX_X + 1 -TEXTBOX_Y EQU SCREEN_HEIGHT - TEXTBOX_HEIGHT -TEXTBOX_INNERY EQU TEXTBOX_Y + 2 +DEF BORDER_WIDTH EQU 2 +DEF TEXTBOX_WIDTH EQU SCREEN_WIDTH +DEF TEXTBOX_INNERW EQU TEXTBOX_WIDTH - BORDER_WIDTH +DEF TEXTBOX_HEIGHT EQU 6 +DEF TEXTBOX_INNERH EQU TEXTBOX_HEIGHT - BORDER_WIDTH +DEF TEXTBOX_X EQU 0 +DEF TEXTBOX_INNERX EQU TEXTBOX_X + 1 +DEF TEXTBOX_Y EQU SCREEN_HEIGHT - TEXTBOX_HEIGHT +DEF TEXTBOX_INNERY EQU TEXTBOX_Y + 2 + +; see gfx/frames/*.png +DEF TEXTBOX_FRAME_TILES EQU 6 ; PrintNum bit flags const_def 5 const PRINTNUM_MONEY_F ; 5 - const PRINTNUM_RIGHTALIGN_F ; 6 + const PRINTNUM_LEFTALIGN_F ; 6 const PRINTNUM_LEADINGZEROS_F ; 7 ; PrintNum arguments (see engine/math/print_num.asm) -PRINTNUM_MONEY EQU 1 << PRINTNUM_MONEY_F -PRINTNUM_RIGHTALIGN EQU 1 << PRINTNUM_RIGHTALIGN_F -PRINTNUM_LEADINGZEROS EQU 1 << PRINTNUM_LEADINGZEROS_F +DEF PRINTNUM_MONEY EQU 1 << PRINTNUM_MONEY_F +DEF PRINTNUM_LEFTALIGN EQU 1 << PRINTNUM_LEFTALIGN_F +DEF PRINTNUM_LEADINGZEROS EQU 1 << PRINTNUM_LEADINGZEROS_F ; character sets (see charmap.asm) -FIRST_REGULAR_TEXT_CHAR EQU $60 -FIRST_HIRAGANA_DAKUTEN_CHAR EQU $20 +DEF FIRST_REGULAR_TEXT_CHAR EQU $60 +DEF FIRST_HIRAGANA_DAKUTEN_CHAR EQU $20 + +; gfx/font/unown_font.png +DEF FIRST_UNOWN_CHAR EQU $40 diff --git a/pokecrystal/constants/tileset_constants.asm b/pokecrystal/constants/tileset_constants.asm index e89714f..2b4f976 100644 --- a/pokecrystal/constants/tileset_constants.asm +++ b/pokecrystal/constants/tileset_constants.asm @@ -21,7 +21,7 @@ const TILESET_LIGHTHOUSE ; 13 const TILESET_PLAYERS_ROOM ; 14 const TILESET_POKECOM_CENTER ; 15 - const TILESET_BATTLE_TOWER ; 16 + const TILESET_BATTLE_TOWER_INSIDE ; 16 const TILESET_TOWER ; 17 const TILESET_CAVE ; 18 const TILESET_PARK ; 19 @@ -36,6 +36,13 @@ const TILESET_KABUTO_WORD_ROOM ; 22 const TILESET_OMANYTE_WORD_ROOM ; 23 const TILESET_AERODACTYL_WORD_ROOM ; 24 +DEF NUM_TILESETS EQU const_value - 1 + +; wTileset struct size +DEF TILESET_LENGTH EQU 15 + +; roof length (see gfx/tilesets/roofs) +DEF ROOF_LENGTH EQU 9 ; bg palette values (see gfx/tilesets/*_palette_map.asm) ; TilesetBGPalette indexes (see gfx/tilesets/bg_tiles.pal) diff --git a/pokecrystal/constants/trainer_constants.asm b/pokecrystal/constants/trainer_constants.asm index 7976fdf..a56ab82 100644 --- a/pokecrystal/constants/trainer_constants.asm +++ b/pokecrystal/constants/trainer_constants.asm @@ -1,6 +1,9 @@ -trainerclass: MACRO - enum \1 -const_value = 1 +DEF __trainer_class__ = 0 + +MACRO trainerclass + DEF \1 EQU __trainer_class__ + DEF __trainer_class__ += 1 + const_def 1 ENDM ; trainer class ids @@ -15,16 +18,16 @@ ENDM ; - BTTrainerClassSprites (see data/trainers/sprites.asm) ; - BTTrainerClassGenders (see data/trainers/genders.asm) ; trainer constants are Trainers indexes, for the sub-tables of TrainerGroups (see data/trainers/parties.asm) - enum_start -CHRIS EQU __enum__ +DEF CHRIS EQU __trainer_class__ trainerclass TRAINER_NONE ; 0 const PHONECONTACT_MOM const PHONECONTACT_BIKESHOP const PHONECONTACT_BILL const PHONECONTACT_ELM const PHONECONTACT_BUENA +DEF NUM_NONTRAINER_PHONECONTACTS EQU const_value - 1 -KRIS EQU __enum__ +DEF KRIS EQU __trainer_class__ trainerclass FALKNER ; 1 const FALKNER1 @@ -72,7 +75,7 @@ KRIS EQU __enum__ const WILL1 trainerclass CAL ; c - const CAL1 + const CAL1 ; unused const CAL2 const CAL3 @@ -182,8 +185,8 @@ KRIS EQU __enum__ const MICHELLE const DANA1 const ELLEN - const CONNIE2 - const CONNIE3 + const CONNIE2 ; unused + const CONNIE3 ; unused const DANA2 const DANA3 const DANA4 @@ -205,12 +208,12 @@ KRIS EQU __enum__ const GAVEN3 const BLAKE const BRIAN - const ERICK - const ANDY - const TYLER + const ERICK ; unused + const ANDY ; unused + const TYLER ; unused const SEAN const KEVIN - const STEVE + const STEVE ; unused const ALLEN const DARIN @@ -240,19 +243,19 @@ KRIS EQU __enum__ trainerclass BEAUTY ; 1d const VICTORIA const SAMANTHA - const JULIE - const JACLYN - const BRENDA + const JULIE ; unused + const JACLYN ; unused + const BRENDA ; unused const CASSIE - const CAROLINE - const CARLENE - const JESSICA - const RACHAEL - const ANGELICA - const KENDRA - const VERONICA + const CAROLINE ; unused + const CARLENE ; unused + const JESSICA ; unused + const RACHAEL ; unused + const ANGELICA ; unused + const KENDRA ; unused + const VERONICA ; unused const JULIA - const THERESA + const THERESA ; unused const VALERIE const OLIVIA @@ -285,7 +288,7 @@ KRIS EQU __enum__ const GRUNTM_9 const GRUNTM_10 const GRUNTM_11 - const GRUNTM_12 + const GRUNTM_12 ; unused const GRUNTM_13 const GRUNTM_14 const GRUNTM_15 @@ -295,22 +298,22 @@ KRIS EQU __enum__ const GRUNTM_19 const GRUNTM_20 const GRUNTM_21 - const GRUNTM_22 - const GRUNTM_23 + const GRUNTM_22 ; unused + const GRUNTM_23 ; unused const GRUNTM_24 const GRUNTM_25 - const GRUNTM_26 - const GRUNTM_27 + const GRUNTM_26 ; unused + const GRUNTM_27 ; unused const GRUNTM_28 const GRUNTM_29 - const GRUNTM_30 + const GRUNTM_30 ; unused const GRUNTM_31 trainerclass GENTLEMAN ; 20 const PRESTON const EDWARD const GREGORY - const VIRGIL + const VIRGIL ; unused const ALFRED trainerclass SKIER ; 21 @@ -382,18 +385,18 @@ KRIS EQU __enum__ const BERKE const KIRK const MATHEW - const HAL - const PATON - const DARYL - const WALTER - const TONY + const HAL ; unused + const PATON ; unused + const DARYL ; unused + const WALTER ; unused + const TONY ; unused const JEROME const TUCKER - const RICK + const RICK ; unused const CAMERON const SETH - const JAMES - const LEWIS + const JAMES ; unused + const LEWIS ; unused const PARKER trainerclass SWIMMERF ; 27 @@ -404,15 +407,15 @@ KRIS EQU __enum__ const DENISE const KARA const WENDY - const LISA - const JILL - const MARY - const KATIE + const LISA ; unused + const JILL ; unused + const MARY ; unused + const KATIE ; unused const DAWN - const TARA + const TARA ; unused const NICOLE const LORI - const JODY + const JODY ; unused const NIKKI const DIANA const BRIANA @@ -435,16 +438,16 @@ KRIS EQU __enum__ trainerclass SUPER_NERD ; 29 const STAN const ERIC - const GREGG - const JAY - const DAVE + const GREGG ; unused + const JAY ; unused + const DAVE ; unused const SAM const TOM const PAT const SHAWN const TERU - const RUSS - const NORTON + const RUSS ; unused + const NORTON ; unused const HUGH const MARKUS @@ -485,8 +488,8 @@ KRIS EQU __enum__ const ANTHONY5 trainerclass BIKER ; 2d - const BIKER_BENNY - const KAZU + const BIKER_BENNY ; unused + const KAZU ; unused const DWAYNE const HARRIS const ZEKE @@ -505,8 +508,8 @@ KRIS EQU __enum__ trainerclass FIREBREATHER ; 30 const OTIS - const DICK - const NED + const DICK ; unused + const NED ; unused const BURT const BILL const WALT @@ -517,14 +520,14 @@ KRIS EQU __enum__ const IRWIN1 const FRITZ const HORTON - const IRWIN2 - const IRWIN3 - const IRWIN4 + const IRWIN2 ; unused + const IRWIN3 ; unused + const IRWIN4 ; unused trainerclass BLACKBELT_T ; 32 - const KENJI1 + const KENJI1 ; unused const YOSHI - const KENJI2 + const KENJI2 ; unused const LAO const NOB const KIYO @@ -589,15 +592,15 @@ KRIS EQU __enum__ const LLOYD const DEAN const SID - const HARVEY - const DALE + const HARVEY ; unused + const DALE ; unused const TED const TODD2 const TODD3 - const THOMAS - const LEROY - const DAVID - const JOHN + const THOMAS ; unused + const LEROY ; unused + const DAVID ; unused + const JOHN ; unused const JERRY const SPENCER const TODD4 @@ -625,9 +628,9 @@ KRIS EQU __enum__ trainerclass MEDIUM ; 39 const MARTHA const GRACE - const BETHANY - const MARGRET - const ETHEL + const BETHANY ; unused + const MARGRET ; unused + const ETHEL ; unused const REBECCA const DORIS @@ -646,15 +649,15 @@ KRIS EQU __enum__ const BRANDON const JEREMY const COLIN - const DEREK2 - const DEREK3 + const DEREK2 ; unused + const DEREK3 ; unused const ALEX const REX const ALLAN trainerclass KIMONO_GIRL ; 3c - const NAOKO1 - const NAOKO2 + const NAOKO_UNUSED ; unused + const NAOKO const SAYO const ZUKI const KUNI @@ -670,13 +673,13 @@ KRIS EQU __enum__ const MEGANDPEG1 const MEGANDPEG2 const LEAANDPIA1 - const LEAANDPIA2 + const LEAANDPIA2 ; unused trainerclass POKEFANF ; 3e const BEVERLY1 const RUTH - const BEVERLY2 - const BEVERLY3 + const BEVERLY2 ; unused + const BEVERLY3 ; unused const GEORGIA const JAIME @@ -700,4 +703,4 @@ KRIS EQU __enum__ trainerclass MYSTICALMAN ; 43 const EUSINE -NUM_TRAINER_CLASSES EQU __enum__ +DEF NUM_TRAINER_CLASSES EQU __trainer_class__ - 1 diff --git a/pokecrystal/constants/trainer_data_constants.asm b/pokecrystal/constants/trainer_data_constants.asm index 00c1c6c..b08de9d 100644 --- a/pokecrystal/constants/trainer_data_constants.asm +++ b/pokecrystal/constants/trainer_data_constants.asm @@ -1,19 +1,15 @@ ; TrainerClassAttributes struct members (see data/trainers/attributes.asm) - const_def - const TRNATTR_ITEM1 ; 0 - const TRNATTR_ITEM2 ; 1 - const TRNATTR_BASEMONEY ; 2 - const TRNATTR_AI_MOVE_WEIGHTS ; 3 - const TRNATTR_AI2 ; 4 - const TRNATTR_AI_ITEM_SWITCH ; 5 - const TRNATTR_AI4 ; 6 -NUM_TRAINER_ATTRIBUTES EQU const_value +rsreset +DEF TRNATTR_ITEM1 rb ; 0 +DEF TRNATTR_ITEM2 rb ; 1 +DEF TRNATTR_BASEMONEY rb ; 2 +DEF TRNATTR_AI_MOVE_WEIGHTS rw ; 3 +DEF TRNATTR_AI_ITEM_SWITCH rw ; 5 +DEF NUM_TRAINER_ATTRIBUTES EQU _RS ; TRNATTR_AI_MOVE_WEIGHTS bit flags (wEnemyTrainerAIFlags) ; AIScoringPointers indexes (see engine/battle/ai/move.asm) const_def - const NO_AI -const_value = 0 shift_const AI_BASIC shift_const AI_SETUP shift_const AI_TYPES @@ -24,27 +20,24 @@ const_value = 0 shift_const AI_CAUTIOUS shift_const AI_STATUS shift_const AI_RISKY - shift_const AI_10 - shift_const AI_11 - shift_const AI_12 - shift_const AI_13 - shift_const AI_14 - shift_const AI_15 +DEF NO_AI EQU 0 ; TRNATTR_AI_ITEM_SWITCH bit flags -CONTEXT_USE_F EQU 6 -UNKNOWN_USE_F EQU 5 -ALWAYS_USE_F EQU 4 -SWITCH_SOMETIMES_F EQU 2 -SWITCH_RARELY_F EQU 1 -SWITCH_OFTEN_F EQU 0 + const_def + const SWITCH_OFTEN_F ; 0 + const SWITCH_RARELY_F ; 1 + const SWITCH_SOMETIMES_F ; 2 + const_skip ; 3 + const ALWAYS_USE_F ; 4 + const UNKNOWN_USE_F ; 5 + const CONTEXT_USE_F ; 6 -CONTEXT_USE EQU 1 << CONTEXT_USE_F -UNKNOWN_USE EQU 1 << UNKNOWN_USE_F -ALWAYS_USE EQU 1 << ALWAYS_USE_F -SWITCH_SOMETIMES EQU 1 << SWITCH_SOMETIMES_F -SWITCH_RARELY EQU 1 << SWITCH_RARELY_F -SWITCH_OFTEN EQU 1 << SWITCH_OFTEN_F +DEF SWITCH_OFTEN EQU 1 << SWITCH_OFTEN_F +DEF SWITCH_RARELY EQU 1 << SWITCH_RARELY_F +DEF SWITCH_SOMETIMES EQU 1 << SWITCH_SOMETIMES_F +DEF ALWAYS_USE EQU 1 << ALWAYS_USE_F +DEF UNKNOWN_USE EQU 1 << UNKNOWN_USE_F +DEF CONTEXT_USE EQU 1 << CONTEXT_USE_F ; TrainerTypes indexes (see engine/battle/read_trainer_party.asm) const_def diff --git a/pokecrystal/constants/type_constants.asm b/pokecrystal/constants/type_constants.asm index c3524e9..49fa661 100644 --- a/pokecrystal/constants/type_constants.asm +++ b/pokecrystal/constants/type_constants.asm @@ -6,7 +6,7 @@ ; - TypeBoostItems (see data/types/type_boost_items.asm) const_def -PHYSICAL EQU const_value +DEF PHYSICAL EQU const_value const NORMAL const FIGHTING const FLYING @@ -18,28 +18,22 @@ PHYSICAL EQU const_value const GHOST const STEEL -UNUSED_TYPES EQU const_value - const TYPE_10 - const TYPE_11 - const TYPE_12 - const TYPE_13 - const TYPE_14 - const TYPE_15 - const TYPE_16 - const TYPE_17 - const TYPE_18 - const CURSE_T -UNUSED_TYPES_END EQU const_value +DEF UNUSED_TYPES EQU const_value + const_next 19 + const CURSE_TYPE +DEF UNUSED_TYPES_END EQU const_value -SPECIAL EQU const_value +DEF SPECIAL EQU const_value const FIRE const WATER const GRASS const ELECTRIC - const PSYCHIC + const PSYCHIC_TYPE const ICE const DRAGON const DARK -TYPES_END EQU const_value +DEF TYPES_END EQU const_value -NUM_TYPES EQU TYPES_END + UNUSED_TYPES - UNUSED_TYPES_END +DEF NUM_TYPES EQU TYPES_END + UNUSED_TYPES - UNUSED_TYPES_END - 1 ; discount BIRD + +DEF POKEDEX_TYPE_STRING_LENGTH EQU 9 diff --git a/pokecrystal/constants/wram_constants.asm b/pokecrystal/constants/wram_constants.asm index 4a2c796..6cd206a 100644 --- a/pokecrystal/constants/wram_constants.asm +++ b/pokecrystal/constants/wram_constants.asm @@ -1,19 +1,19 @@ -; wInputType:: ; c2c7 -AUTO_INPUT EQU $ff +; wInputType:: +DEF AUTO_INPUT EQU $ff -; wDebugFlags:: ; c2cc +; wDebugFlags:: const_def const DEBUG_BATTLE_F const DEBUG_FIELD_F -; wCurDexMode:: ; c7d4 +; wCurDexMode:: const_def const DEXMODE_NEW const DEXMODE_OLD const DEXMODE_ABC const DEXMODE_UNOWN -; wMonType:: ; cf5f +; wMonType:: const_def const PARTYMON ; 0 const OTPARTYMON ; 1 @@ -21,23 +21,27 @@ AUTO_INPUT EQU $ff const TEMPMON ; 3 const WILDMON ; 4 -; wGameTimerPause:: ; cfbc -GAMETIMERPAUSE_TIMER_PAUSED_F EQU 0 -GAMETIMERPAUSE_MOBILE_7_F EQU 7 +; wGameTimerPaused:: +DEF GAME_TIMER_PAUSED_F EQU 0 +DEF GAME_TIMER_MOBILE_F EQU 7 -; wOptions:: ; cfcc -TEXT_DELAY_MASK EQU %111 +; wJoypadDisable:: +DEF JOYPAD_DISABLE_MON_FAINT_F EQU 6 +DEF JOYPAD_DISABLE_SGB_TRANSFER_F EQU 7 + +; wOptions1:: +DEF TEXT_DELAY_MASK EQU %111 const_def 4 const NO_TEXT_SCROLL ; 4 const STEREO ; 5 const BATTLE_SHIFT ; 6 const BATTLE_SCENE ; 7 -TEXT_DELAY_FAST EQU %001 ; 1 -TEXT_DELAY_MED EQU %011 ; 3 -TEXT_DELAY_SLOW EQU %101 ; 5 +DEF TEXT_DELAY_FAST EQU %001 ; 1 +DEF TEXT_DELAY_MED EQU %011 ; 3 +DEF TEXT_DELAY_SLOW EQU %101 ; 5 -; wTextboxFrame:: ; cfce +; wTextboxFrame:: const_def const FRAME_1 ; 0 const FRAME_2 ; 1 @@ -47,126 +51,130 @@ TEXT_DELAY_SLOW EQU %101 ; 5 const FRAME_6 ; 5 const FRAME_7 ; 6 const FRAME_8 ; 7 -NUM_FRAMES EQU const_value +DEF NUM_FRAMES EQU const_value -; wTextboxFlags:: ; cfcf +; wTextboxFlags:: const_def const FAST_TEXT_DELAY_F ; 0 const NO_TEXT_DELAY_F ; 1 -; wGBPrinterBrightness:: ; cfd0 -GBPRINTER_LIGHTEST EQU $00 -GBPRINTER_LIGHTER EQU $20 -GBPRINTER_NORMAL EQU $40 -GBPRINTER_DARKER EQU $60 -GBPRINTER_DARKEST EQU $7f +; wGBPrinterBrightness:: +DEF GBPRINTER_LIGHTEST EQU $00 +DEF GBPRINTER_LIGHTER EQU $20 +DEF GBPRINTER_NORMAL EQU $40 +DEF GBPRINTER_DARKER EQU $60 +DEF GBPRINTER_DARKEST EQU $7f -; wOptions2:: ; cfd1 +; wOptions2:: const_def const MENU_ACCOUNT ; 0 -; wWalkingDirection:: ; d043 +; wWalkingDirection:: const_def -1 const STANDING ; -1 const DOWN ; 0 const UP ; 1 const LEFT ; 2 const RIGHT ; 3 -NUM_DIRECTIONS EQU const_value +DEF NUM_DIRECTIONS EQU const_value -DOWN_MASK EQU 1 << DOWN -UP_MASK EQU 1 << UP -LEFT_MASK EQU 1 << LEFT -RIGHT_MASK EQU 1 << RIGHT +DEF DOWN_MASK EQU 1 << DOWN +DEF UP_MASK EQU 1 << UP +DEF LEFT_MASK EQU 1 << LEFT +DEF RIGHT_MASK EQU 1 << RIGHT -; wFacingDirection:: ; d044 -FACE_CURRENT EQU 0 -FACE_DOWN EQU 8 -FACE_UP EQU 4 -FACE_LEFT EQU 2 -FACE_RIGHT EQU 1 +; wFacingDirection:: + const_def NUM_DIRECTIONS - 1, -1 + shift_const FACE_DOWN ; 8 + shift_const FACE_UP ; 4 + shift_const FACE_LEFT ; 2 + shift_const FACE_RIGHT ; 1 +DEF FACE_CURRENT EQU 0 -; wPokemonWithdrawDepositParameter:: ; d10b -PC_WITHDRAW EQU 0 -PC_DEPOSIT EQU 1 -REMOVE_PARTY EQU 0 -REMOVE_BOX EQU 1 -DAY_CARE_WITHDRAW EQU 2 -DAY_CARE_DEPOSIT EQU 3 +; wPokemonWithdrawDepositParameter:: +DEF PC_WITHDRAW EQU 0 +DEF PC_DEPOSIT EQU 1 +DEF REMOVE_PARTY EQU 0 +DEF REMOVE_BOX EQU 1 +DEF DAY_CARE_WITHDRAW EQU 2 +DEF DAY_CARE_DEPOSIT EQU 3 -; wPlayerStepFlags:: ; d150 +; wPlayerStepFlags:: const_def 4 const PLAYERSTEP_MIDAIR_F ; 4 const PLAYERSTEP_CONTINUE_F ; 5 const PLAYERSTEP_STOP_F ; 6 const PLAYERSTEP_START_F ; 7 -; wInitListType:: ; d263 -INIT_ENEMYOT_LIST EQU 1 -INIT_BAG_ITEM_LIST EQU 2 -INIT_OTHER_ITEM_LIST EQU 3 -INIT_PLAYEROT_LIST EQU 4 -INIT_MON_LIST EQU 5 +; wInitListType:: +DEF INIT_ENEMYOT_LIST EQU 1 +DEF INIT_BAG_ITEM_LIST EQU 2 +DEF INIT_OTHER_ITEM_LIST EQU 3 +DEF INIT_PLAYEROT_LIST EQU 4 +DEF INIT_MON_LIST EQU 5 -; wTimeOfDay:: ; d269 +; wTimeOfDay:: const_def const MORN_F ; 0 const DAY_F ; 1 const NITE_F ; 2 const DARKNESS_F ; 3 -NUM_DAYTIMES EQU const_value +DEF NUM_DAYTIMES EQU const_value -MORN EQU 1 << MORN_F -DAY EQU 1 << DAY_F -NITE EQU 1 << NITE_F -DARKNESS EQU 1 << DARKNESS_F +DEF MORN EQU 1 << MORN_F +DEF DAY EQU 1 << DAY_F +DEF NITE EQU 1 << NITE_F +DEF DARKNESS EQU 1 << DARKNESS_F -ANYTIME EQU MORN | DAY | NITE +DEF ANYTIME EQU MORN | DAY | NITE -; wBattleAnimFlags:: ; d40f +; wTimeOfDayPalset:: +DEF DARKNESS_PALSET EQU (DARKNESS_F << 6) | (DARKNESS_F << 4) | (DARKNESS_F << 2) | DARKNESS_F + +; wBattleAnimFlags:: const_def const BATTLEANIM_STOP_F ; 0 const BATTLEANIM_IN_SUBROUTINE_F ; 1 const BATTLEANIM_IN_LOOP_F ; 2 const BATTLEANIM_KEEPSPRITES_F ; 3 -; wPlayerSpriteSetupFlags:: ; d45b -PLAYERSPRITESETUP_FACING_MASK EQU %11 -PLAYERSPRITESETUP_FEMALE_TO_MALE_F EQU 2 -PLAYERSPRITESETUP_CUSTOM_FACING_F EQU 5 -PLAYERSPRITESETUP_SKIP_RELOAD_GFX_F EQU 6 -PLAYERSPRITESETUP_RESET_ACTION_F EQU 7 +; wPlayerSpriteSetupFlags:: +DEF PLAYERSPRITESETUP_FACING_MASK EQU %11 +DEF PLAYERSPRITESETUP_FEMALE_TO_MALE_F EQU 2 +DEF PLAYERSPRITESETUP_CUSTOM_FACING_F EQU 5 +DEF PLAYERSPRITESETUP_SKIP_RELOAD_GFX_F EQU 6 +DEF PLAYERSPRITESETUP_RESET_ACTION_F EQU 7 -; wPlayerGender:: ; d472 -PLAYERGENDER_FEMALE_F EQU 0 +; wPlayerGender:: +DEF PLAYERGENDER_FEMALE_F EQU 0 -; wMapStatus:: ; d432 +; wMapStatus:: const_def const MAPSTATUS_START ; 0 const MAPSTATUS_ENTER ; 1 const MAPSTATUS_HANDLE ; 2 const MAPSTATUS_DONE ; 3 -; wMapEventStatus:: ; d433 +; wMapEventStatus:: const_def const MAPEVENTS_ON ; 0 const MAPEVENTS_OFF ; 1 -; wScriptFlags:: ; d434 -SCRIPT_RUNNING EQU 2 +; wScriptFlags:: +DEF SCRIPT_RUNNING EQU 2 -; wScriptMode:: ; d437 +; wScriptMode:: const_def const SCRIPT_OFF const SCRIPT_READ const SCRIPT_WAIT_MOVEMENT const SCRIPT_WAIT -; wSpawnAfterChampion:: ; d4b5 -SPAWN_LANCE EQU 1 -SPAWN_RED EQU 2 +; wSpawnAfterChampion:: +DEF SPAWN_LANCE EQU 1 +DEF SPAWN_RED EQU 2 -; wCurDay:: ; d4cb +; wCurDay:: const_def const SUNDAY ; 0 const MONDAY ; 1 @@ -176,11 +184,7 @@ SPAWN_RED EQU 2 const FRIDAY ; 5 const SATURDAY ; 6 -; wMapObjects:: ; d71e -PLAYER_OBJECT EQU 0 -NUM_OBJECTS EQU 16 - -; wStatusFlags:: ; d84c +; wStatusFlags:: const_def const STATUSFLAGS_POKEDEX_F ; 0 const STATUSFLAGS_UNOWN_DEX_F ; 1 @@ -191,7 +195,7 @@ NUM_OBJECTS EQU 16 const STATUSFLAGS_HALL_OF_FAME_F ; 6 const STATUSFLAGS_MAIN_MENU_MOBILE_CHOICES_F ; 7 -; wStatusFlags2:: ; d84d +; wStatusFlags2:: const_def const STATUSFLAGS2_ROCKETS_IN_RADIO_TOWER_F ; 0 const STATUSFLAGS2_SAFARI_GAME_F ; 1 @@ -202,15 +206,15 @@ NUM_OBJECTS EQU 16 const STATUSFLAGS2_REACHED_GOLDENROD_F ; 6 const STATUSFLAGS2_ROCKETS_IN_MAHOGANY_F ; 7 -; wMomSavingMoney:: ; d854 -MOM_SAVING_SOME_MONEY_F EQU 0 -MOM_SAVING_HALF_MONEY_F EQU 1 -MOM_SAVING_ALL_MONEY_F EQU 2 -MOM_ACTIVE_F EQU 7 +; wMomSavingMoney:: +DEF MOM_SAVING_SOME_MONEY_F EQU 0 +DEF MOM_SAVING_HALF_MONEY_F EQU 1 +DEF MOM_SAVING_ALL_MONEY_F EQU 2 +DEF MOM_ACTIVE_F EQU 7 -MOM_SAVING_MONEY_MASK EQU (1 << MOM_SAVING_SOME_MONEY_F) | (1 << MOM_SAVING_HALF_MONEY_F) | (1 << MOM_SAVING_ALL_MONEY_F) +DEF MOM_SAVING_MONEY_MASK EQU (1 << MOM_SAVING_SOME_MONEY_F) | (1 << MOM_SAVING_HALF_MONEY_F) | (1 << MOM_SAVING_ALL_MONEY_F) -; wJohtoBadges:: ; d857 +; wJohtoBadges:: const_def const ZEPHYRBADGE const HIVEBADGE @@ -220,9 +224,9 @@ MOM_SAVING_MONEY_MASK EQU (1 << MOM_SAVING_SOME_MONEY_F) | (1 << MOM_SAVING_HALF const STORMBADGE const GLACIERBADGE const RISINGBADGE -NUM_JOHTO_BADGES EQU const_value +DEF NUM_JOHTO_BADGES EQU const_value -; wKantoBadges:: ; d858 +; wKantoBadges:: const_def const BOULDERBADGE const CASCADEBADGE @@ -232,39 +236,39 @@ NUM_JOHTO_BADGES EQU const_value const MARSHBADGE const VOLCANOBADGE const EARTHBADGE -NUM_KANTO_BADGES EQU const_value -NUM_BADGES EQU NUM_JOHTO_BADGES + NUM_KANTO_BADGES +DEF NUM_KANTO_BADGES EQU const_value +DEF NUM_BADGES EQU NUM_JOHTO_BADGES + NUM_KANTO_BADGES -; wPokegearFlags:: ; d957 +; wPokegearFlags:: const_def const POKEGEAR_MAP_CARD_F ; 0 const POKEGEAR_RADIO_CARD_F ; 1 const POKEGEAR_PHONE_CARD_F ; 2 const POKEGEAR_EXPN_CARD_F ; 3 + const_skip 3 + const POKEGEAR_OBTAINED_F ; 7 -POKEGEAR_OBTAINED_F EQU 7 +; wWhichRegisteredItem:: +DEF REGISTERED_POCKET EQU %11000000 +DEF REGISTERED_NUMBER EQU %00111111 -; wWhichRegisteredItem:: ; d95b -REGISTERED_POCKET EQU %11000000 -REGISTERED_NUMBER EQU %00111111 +; wPlayerState:: +DEF PLAYER_NORMAL EQU 0 +DEF PLAYER_BIKE EQU 1 +DEF PLAYER_SKATE EQU 2 +DEF PLAYER_SURF EQU 4 +DEF PLAYER_SURF_PIKA EQU 8 -; wPlayerState:: ; d95d -PLAYER_NORMAL EQU 0 -PLAYER_BIKE EQU 1 -PLAYER_SKATE EQU 2 -PLAYER_SURF EQU 4 -PLAYER_SURF_PIKA EQU 8 +; wCelebiEvent:: +DEF CELEBIEVENT_FOREST_IS_RESTLESS_F EQU 2 -; wCelebiEvent:: ; dbf3 -CELEBIEVENT_FOREST_IS_RESTLESS_F EQU 2 - -; wBikeFlags:: ; dbf5 +; wBikeFlags:: const_def const BIKEFLAGS_STRENGTH_ACTIVE_F ; 0 const BIKEFLAGS_ALWAYS_ON_BIKE_F ; 1 const BIKEFLAGS_DOWNHILL_F ; 2 -; wDailyFlags1:: ; dc1e +; wDailyFlags1:: const_def const DAILYFLAGS1_KURT_MAKING_BALLS_F ; 0 const DAILYFLAGS1_BUG_CONTEST_F ; 1 @@ -275,7 +279,7 @@ CELEBIEVENT_FOREST_IS_RESTLESS_F EQU 2 const DAILYFLAGS1_GOLDENROD_UNDERGROUND_BARGAIN_F ; 6 const DAILYFLAGS1_TRAINER_HOUSE_F ; 7 -; wDailyFlags2:: ; dc1f +; wDailyFlags2:: const_def const DAILYFLAGS2_MT_MOON_SQUARE_CLEFAIRY_F ; 0 const DAILYFLAGS2_UNION_CAVE_LAPRAS_F ; 1 @@ -286,7 +290,7 @@ CELEBIEVENT_FOREST_IS_RESTLESS_F EQU 2 const DAILYFLAGS2_MOVE_TUTOR_F ; 6 const DAILYFLAGS2_BUENAS_PASSWORD_F ; 7 -; wSwarmFlags:: ; dc20 +; wSwarmFlags:: const_def const SWARMFLAGS_BUENAS_PASSWORD_F ; 0 const SWARMFLAGS_GOLDENROD_DEPT_STORE_SALE_F ; 1 @@ -294,15 +298,15 @@ CELEBIEVENT_FOREST_IS_RESTLESS_F EQU 2 const SWARMFLAGS_YANMA_SWARM_F ; 3 const SWARMFLAGS_MOBILE_4_F ; 4 -; wLuckyNumberShowFlag:: ; dc9d -LUCKYNUMBERSHOW_GAME_OVER_F EQU 0 +; wLuckyNumberShowFlag:: +DEF LUCKYNUMBERSHOW_GAME_OVER_F EQU 0 -; wDayCareMan:: ; def5 -DAYCAREMAN_HAS_MON_F EQU 0 -DAYCAREMAN_MONS_COMPATIBLE_F EQU 5 -DAYCAREMAN_HAS_EGG_F EQU 6 -DAYCAREMAN_ACTIVE_F EQU 7 +; wDayCareMan:: +DEF DAYCAREMAN_HAS_MON_F EQU 0 +DEF DAYCAREMAN_MONS_COMPATIBLE_F EQU 5 +DEF DAYCAREMAN_HAS_EGG_F EQU 6 +DEF DAYCAREMAN_ACTIVE_F EQU 7 -; wDayCareLady:: ; df2c -DAYCARELADY_HAS_MON_F EQU 0 -DAYCARELADY_ACTIVE_F EQU 7 +; wDayCareLady:: +DEF DAYCARELADY_HAS_MON_F EQU 0 +DEF DAYCARELADY_ACTIVE_F EQU 7 diff --git a/pokecrystal/macros.asm b/pokecrystal/macros.asm index ebdc5b2..21148a8 100644 --- a/pokecrystal/macros.asm +++ b/pokecrystal/macros.asm @@ -1,4 +1,4 @@ -INCLUDE "pokecrystal/macros/enum.asm" +INCLUDE "pokecrystal/macros/const.asm" INCLUDE "pokecrystal/macros/data.asm" INCLUDE "pokecrystal/macros/gfx.asm" diff --git a/pokecrystal/macros/coords.asm b/pokecrystal/macros/coords.asm index 0833c24..e899e68 100644 --- a/pokecrystal/macros/coords.asm +++ b/pokecrystal/macros/coords.asm @@ -1,52 +1,59 @@ -hlcoord EQUS "coord hl," -bccoord EQUS "coord bc," -decoord EQUS "coord de," +; Coordinate macros -coord: MACRO +DEF hlcoord EQUS "coord hl," +DEF bccoord EQUS "coord bc," +DEF decoord EQUS "coord de," + +MACRO coord ; register, x, y[, origin] if _NARG < 4 - ld \1, (\3) * SCREEN_WIDTH + (\2) + wTileMap + ld \1, (\3) * SCREEN_WIDTH + (\2) + wTilemap else - ld \1, (\3) * SCREEN_WIDTH + (\2) + \4 + ld \1, (\3) * SCREEN_WIDTH + (\2) + \4 endc ENDM -hlbgcoord EQUS "bgcoord hl," -bcbgcoord EQUS "bgcoord bc," -debgcoord EQUS "bgcoord de," +DEF hlbgcoord EQUS "bgcoord hl," +DEF bcbgcoord EQUS "bgcoord bc," +DEF debgcoord EQUS "bgcoord de," -bgcoord: MACRO +MACRO bgcoord ; register, x, y[, origin] if _NARG < 4 - ld \1, (\3) * BG_MAP_WIDTH + (\2) + vBGMap0 + ld \1, (\3) * BG_MAP_WIDTH + (\2) + vBGMap0 else - ld \1, (\3) * BG_MAP_WIDTH + (\2) + \4 + ld \1, (\3) * BG_MAP_WIDTH + (\2) + \4 endc ENDM -dwcoord: MACRO +MACRO dwcoord ; x, y -rept _NARG / 2 - dw (\2) * SCREEN_WIDTH + (\1) + wTileMap - shift - shift -endr + rept _NARG / 2 + dw (\2) * SCREEN_WIDTH + (\1) + wTilemap + shift 2 + endr ENDM -ldcoord_a: MACRO +MACRO ldcoord_a ; x, y[, origin] if _NARG < 3 - ld [(\2) * SCREEN_WIDTH + (\1) + wTileMap], a + ld [(\2) * SCREEN_WIDTH + (\1) + wTilemap], a else - ld [(\2) * SCREEN_WIDTH + (\1) + \3], a + ld [(\2) * SCREEN_WIDTH + (\1) + \3], a endc ENDM -lda_coord: MACRO +MACRO lda_coord ; x, y[, origin] if _NARG < 3 - ld a, [(\2) * SCREEN_WIDTH + (\1) + wTileMap] + ld a, [(\2) * SCREEN_WIDTH + (\1) + wTilemap] else - ld a, [(\2) * SCREEN_WIDTH + (\1) + \3] + ld a, [(\2) * SCREEN_WIDTH + (\1) + \3] endc ENDM + +MACRO menu_coords +; x1, y1, x2, y2 + db \2, \1 ; start coords + db \4, \3 ; end coords +ENDM diff --git a/pokecrystal/macros/data.asm b/pokecrystal/macros/data.asm index 59f518b..5962ec1 100644 --- a/pokecrystal/macros/data.asm +++ b/pokecrystal/macros/data.asm @@ -1,124 +1,101 @@ ; Value macros -percent EQUS "* $ff / 100" +; Many arbitrary percentages are simple base-10 or base-16 values: +; - 10 = 4 percent +; - 15 = 6 percent +; - $10 = 6 percent + 1 = 7 percent - 1 +; - 20 = 8 percent +; - 25 = 10 percent +; - 30 = 12 percent +; - 40 = 16 percent +; - 50 = 20 percent - 1 +; - 60 = 24 percent - 1 +; - 70 = 28 percent - 1 +; - 80 = 31 percent + 1 = 32 percent - 1 +; - 85 = 33 percent + 1 = 34 percent - 1 +; - 100 = 39 percent + 1 = 40 percent - 2 +; - 120 = 47 percent + 1 +; - 123 = 49 percent - 1 +; - 160 = 63 percent +; - 180 = 71 percent - 1 = 70 percent + 2 +; - 200 = 79 percent - 1 +; - 230 = 90 percent + 1 +DEF percent EQUS "* $ff / 100" + +; e.g. 1 out_of 2 == 50 percent + 1 == $80 +DEF out_of EQUS "* $100 /" + +MACRO assert_power_of_2 + assert (\1) & ((\1) - 1) == 0, "\1 must be a power of 2" +ENDM ; Constant data (db, dw, dl) macros -dwb: MACRO +MACRO dwb dw \1 db \2 ENDM -dbw: MACRO +MACRO dbw db \1 dw \2 ENDM -dbbw: MACRO - db \1, \2 - dw \3 +MACRO dn ; nybbles + rept _NARG / 2 + db ((\1) << 4) | (\2) + shift 2 + endr ENDM -dbww: MACRO - db \1 - dw \2, \3 +MACRO dc ; "crumbs" + rept _NARG / 4 + db ((\1) << 6) | ((\2) << 4) | ((\3) << 2) | (\4) + shift 4 + endr ENDM -dbwww: MACRO - db \1 - dw \2, \3, \4 +MACRO dt ; three-byte (big-endian) + db LOW((\1) >> 16), HIGH(\1), LOW(\1) ENDM -dn: MACRO ; nybbles -rept _NARG / 2 - db ((\1) << 4) | (\2) - shift - shift -endr +MACRO dd ; four-byte (big-endian) + db HIGH((\1) >> 16), LOW((\1) >> 16), HIGH(\1), LOW(\1) ENDM -dc: MACRO ; "crumbs" -rept _NARG / 4 - db ((\1) << 6) | ((\2) << 4) | ((\3) << 2) | (\4) - shift - shift - shift - shift -endr +MACRO bigdw ; big-endian word + db HIGH(\1), LOW(\1) ENDM -dx: MACRO -x = 8 * ((\1) - 1) -rept \1 - db ((\2) >> x) & $ff -x = x + -8 -endr +MACRO dba ; dbw bank, address + rept _NARG + dbw BANK(\1), \1 + shift + endr ENDM -dt: MACRO ; three-byte (big-endian) - dx 3, \1 +MACRO dab ; dwb address, bank + rept _NARG + dwb \1, BANK(\1) + shift + endr ENDM -dd: MACRO ; four-byte (big-endian) - dx 4, \1 -ENDM - -bigdw: MACRO ; big-endian word - dx 2, \1 ; db HIGH(\1), LOW(\1) -ENDM - -dba: MACRO ; dbw bank, address -rept _NARG - dbw BANK(\1), \1 - shift -endr -ENDM - -dab: MACRO ; dwb address, bank -rept _NARG - dwb \1, BANK(\1) - shift -endr -ENDM - -dba_pic: MACRO ; dbw bank, address +MACRO dba_pic ; dbw bank, address db BANK(\1) - PICS_FIX dw \1 ENDM -dbpixel: MACRO -if _NARG >= 4 -; x tile, x pxl, y tile, y pxl - db \1 * 8 + \3, \2 * 8 + \4 -else -; x, y - db \1 * 8, \2 * 8 -endc +MACRO bcd + rept _NARG + dn ((\1) % 100) / 10, (\1) % 10 + shift + endr ENDM -dsprite: MACRO -; y tile, y pxl, x tile, x pxl, vtile offset, attributes - db (\1 * 8) % $100 + \2, (\3 * 8) % $100 + \4, \5, \6 -ENDM - -menu_coords: MACRO -; x1, y1, x2, y2 - db \2, \1 ; start coords - db \4, \3 ; end coords -ENDM - -bcd: MACRO -rept _NARG - dn ((\1) % 100) / 10, (\1) % 10 - shift -endr -ENDM - -sine_table: MACRO -; \1 samples of sin(x) from x=0 to x<32768 (pi radians) -x = 0 -rept \1 - dw (sin(x) + (sin(x) & $ff)) >> 8 ; round up -x = x + DIV(32768, \1) ; a circle has 65536 "degrees" -endr +MACRO sine_table +; \1 samples of sin(x) from x=0 to x<0.5 turns (pi radians) + for x, \1 + dw sin(x * 0.5 / (\1)) + endr ENDM diff --git a/pokecrystal/macros/gfx.asm b/pokecrystal/macros/gfx.asm index 2753373..630b131 100644 --- a/pokecrystal/macros/gfx.asm +++ b/pokecrystal/macros/gfx.asm @@ -1,24 +1,60 @@ -RGB: MACRO -rept _NARG / 3 - dw palred (\1) + palgreen (\2) + palblue (\3) - shift - shift - shift -endr +; Graphics macros + +MACRO assert_valid_rgb + rept _NARG + assert 0 <= (\1) && (\1) <= 31, "RGB channel must be 0-31" + shift + endr ENDM -palred EQUS "(1 << 0) *" -palgreen EQUS "(1 << 5) *" -palblue EQUS "(1 << 10) *" +MACRO RGB + rept _NARG / 3 + assert_valid_rgb \1, \2, \3 + dw palred (\1) + palgreen (\2) + palblue (\3) + shift 3 + endr +ENDM -palettes EQUS "* PALETTE_SIZE" -palette EQUS "+ PALETTE_SIZE *" -color EQUS "+ PAL_COLOR_SIZE *" +DEF palred EQUS "(1 << 0) *" +DEF palgreen EQUS "(1 << 5) *" +DEF palblue EQUS "(1 << 10) *" -tiles EQUS "* LEN_2BPP_TILE" -tile EQUS "+ LEN_2BPP_TILE *" +DEF palettes EQUS "* PALETTE_SIZE" +DEF palette EQUS "+ PALETTE_SIZE *" +DEF color EQUS "+ PAL_COLOR_SIZE *" + +DEF tiles EQUS "* LEN_2BPP_TILE" +DEF tile EQUS "+ LEN_2BPP_TILE *" ; extracts the middle two colors from a 2bpp binary palette ; example usage: ; INCBIN "foo.gbcpal", middle_colors -middle_colors EQUS "PAL_COLOR_SIZE, PAL_COLOR_SIZE * 2" +DEF middle_colors EQUS "PAL_COLOR_SIZE, PAL_COLOR_SIZE * 2" + +MACRO dbpixel + if _NARG >= 4 + ; x tile, y tile, x pixel, y pixel + db \1 * TILE_WIDTH + \3, \2 * TILE_WIDTH + \4 + else + ; x tile, y tile + db \1 * TILE_WIDTH, \2 * TILE_WIDTH + endc +ENDM + +MACRO ldpixel + if _NARG >= 5 + ; register, x tile, y tile, x pixel, y pixel + lb \1, \2 * TILE_WIDTH + \4, \3 * TILE_WIDTH + \5 + else + ; register, x tile, y tile + lb \1, \2 * TILE_WIDTH, \3 * TILE_WIDTH + endc +ENDM + +DEF depixel EQUS "ldpixel de," +DEF bcpixel EQUS "ldpixel bc," + +MACRO dbsprite +; x tile, y tile, x pixel, y pixel, vtile offset, attributes + db (\2 * TILE_WIDTH) % $100 + \4, (\1 * TILE_WIDTH) % $100 + \3, \5, \6 +ENDM diff --git a/pokecrystal/macros/scripts/text.asm b/pokecrystal/macros/scripts/text.asm index dcdf0b2..fac922b 100644 --- a/pokecrystal/macros/scripts/text.asm +++ b/pokecrystal/macros/scripts/text.asm @@ -1,145 +1,147 @@ -text EQUS "db TX_START," ; Start writing text. -next EQUS "db \"\"," ; Move a line down. -line EQUS "db \"\"," ; Start writing at the bottom line. -page EQUS "db \"@\"," ; Start a new Pokédex page. -para EQUS "db \"\"," ; Start a new paragraph. -cont EQUS "db \"\"," ; Scroll to the next line. -done EQUS "db \"\"" ; End a text box. -prompt EQUS "db \"\"" ; Prompt the player to end a text box (initiating some other event). +DEF text EQUS "db TX_START," ; Start writing text. +DEF next EQUS "db \"\"," ; Move a line down. +DEF line EQUS "db \"\"," ; Start writing at the bottom line. +DEF page EQUS "db \"@\"," ; Start a new Pokédex page. +DEF para EQUS "db \"\"," ; Start a new paragraph. +DEF cont EQUS "db \"\"," ; Scroll to the next line. +DEF done EQUS "db \"\"" ; End a text box. +DEF prompt EQUS "db \"\"" ; Prompt the player to end a text box (initiating some other event). ; TextCommands indexes (see home/text.asm) - enum_start + const_def - enum TX_START ; $00 -text_start: MACRO + const TX_START ; $00 +MACRO text_start db TX_START ENDM - enum TX_RAM ; $01 -text_ram: MACRO + const TX_RAM ; $01 +MACRO text_ram db TX_RAM dw \1 ENDM - enum TX_BCD ; $02 -text_bcd: MACRO + const TX_BCD ; $02 +MACRO text_bcd db TX_BCD dw \1 db \2 ENDM - enum TX_MOVE ; $03 -text_move: MACRO + const TX_MOVE ; $03 +MACRO text_move db TX_MOVE dw \1 ENDM - enum TX_BOX ; $04 -text_box: MACRO + const TX_BOX ; $04 +MACRO text_box db TX_BOX dw \1 db \2, \3 ENDM - enum TX_LOW ; $05 -text_low: MACRO + const TX_LOW ; $05 +MACRO text_low db TX_LOW ENDM - enum TX_WAIT_BUTTON ; $06 -text_waitbutton: MACRO - db TX_WAIT_BUTTON + const TX_PROMPT_BUTTON ; $06 +MACRO text_promptbutton + db TX_PROMPT_BUTTON ENDM - enum TX_SCROLL ; $07 -text_scroll: MACRO + const TX_SCROLL ; $07 +MACRO text_scroll db TX_SCROLL ENDM - enum TX_START_ASM ; $08 -text_asm: MACRO + const TX_START_ASM ; $08 +MACRO text_asm db TX_START_ASM ENDM - enum TX_NUM ; $09 -text_decimal: MACRO - db TX_NUM + const TX_DECIMAL ; $09 +MACRO text_decimal + db TX_DECIMAL dw \1 ; address dn \2, \3 ; bytes, digits ENDM - enum TX_PAUSE ; $0a -text_pause: MACRO + const TX_PAUSE ; $0a +MACRO text_pause db TX_PAUSE ENDM - enum TX_SOUND_DEX_FANFARE_50_79 ; $0b -sound_dex_fanfare_50_79: MACRO + const TX_SOUND_DEX_FANFARE_50_79 ; $0b +MACRO sound_dex_fanfare_50_79 db TX_SOUND_DEX_FANFARE_50_79 ENDM - enum TX_DOTS ; $0c -text_dots: MACRO + const TX_DOTS ; $0c +MACRO text_dots db TX_DOTS db \1 ENDM - enum TX_LINK_WAIT_BUTTON ; $0d -text_linkwaitbutton: MACRO - db TX_LINK_WAIT_BUTTON + const TX_WAIT_BUTTON ; $0d +MACRO text_waitbutton + db TX_WAIT_BUTTON ENDM - enum TX_SOUND_DEX_FANFARE_20_49 ; $0e -sound_dex_fanfare_20_49: MACRO + const TX_SOUND_DEX_FANFARE_20_49 ; $0e +MACRO sound_dex_fanfare_20_49 db TX_SOUND_DEX_FANFARE_20_49 ENDM - enum TX_SOUND_ITEM ; $0f -sound_item: MACRO + const TX_SOUND_ITEM ; $0f +MACRO sound_item db TX_SOUND_ITEM ENDM - enum TX_SOUND_CAUGHT_MON ; $10 -sound_caught_mon: MACRO + const TX_SOUND_CAUGHT_MON ; $10 +MACRO sound_caught_mon db TX_SOUND_CAUGHT_MON ENDM - enum TX_SOUND_DEX_FANFARE_80_109 ; $11 -sound_dex_fanfare_80_109: MACRO + const TX_SOUND_DEX_FANFARE_80_109 ; $11 +MACRO sound_dex_fanfare_80_109 db TX_SOUND_DEX_FANFARE_80_109 ENDM - enum TX_SOUND_FANFARE ; $12 -sound_fanfare: MACRO + const TX_SOUND_FANFARE ; $12 +MACRO sound_fanfare db TX_SOUND_FANFARE ENDM - enum TX_SOUND_SLOT_MACHINE_START ; $13 -sound_slot_machine_start: MACRO + const TX_SOUND_SLOT_MACHINE_START ; $13 +MACRO sound_slot_machine_start db TX_SOUND_SLOT_MACHINE_START ENDM - enum TX_STRINGBUFFER ; $14 -text_buffer: MACRO + const TX_STRINGBUFFER ; $14 +MACRO text_buffer db TX_STRINGBUFFER db \1 ENDM - enum TX_DAY ; $15 -text_today: MACRO + const TX_DAY ; $15 +MACRO text_today db TX_DAY ENDM - enum TX_FAR ; $16 -text_far: MACRO + const TX_FAR ; $16 +MACRO text_far db TX_FAR dw \1 db BANK(\1) ENDM - enum_set $50 +DEF NUM_TEXT_CMDS EQU const_value - enum TX_END ; $50 -text_end: MACRO + const_next $50 + + const TX_END ; $50 +MACRO text_end db TX_END ENDM diff --git a/ram/sram.asm b/ram/sram.asm new file mode 100644 index 0000000..fe3d43c --- /dev/null +++ b/ram/sram.asm @@ -0,0 +1,11 @@ +SECTION "SRAM bank 5", SRAM, BANK[5] +sMobileEventIndex:: ds 1 ; a000 + ds 19 +sNumBattleTowerWins:: ds 2 ; a014 + ds 101 +sLargestMagikarp:: ds 2 ; a07b + ds 2 +sBugContestHighscore:: ds 2 ; a07f + ds 2546 +sNewsId:: ds 12 ; aa73 +sNewsIdBackup:: ds 12 ; aa7f \ No newline at end of file diff --git a/sram.asm b/ram/sram_int.asm similarity index 100% rename from sram.asm rename to ram/sram_int.asm diff --git a/ram/wram.asm b/ram/wram.asm new file mode 100644 index 0000000..87aa682 --- /dev/null +++ b/ram/wram.asm @@ -0,0 +1,18 @@ +SECTION "wram", WRAM0[$cd22] ; japan + +wcd22:: ds 1 ; cd22 + ds 49 +wNumRankedPlayers:: ds 4 ; cd54 +wOwnRank:: ds 4 ; cd58 +wcd5c:: ds 1 ; cd5c + ds 5 +wRankingsTable:: ds 1 ; cd62 +wRankingsCategory:: ds 1 ; cd63 +wRankingsType:: ds 1 ; cd64 + ds 2 +wQuizQuestionNo:: ds 1 ; cd67 +wQuizScore:: ds 1 ; cd68 + ds 1 +wcd6a:: ds 1 ; cd6a + ds 3 +wRankingsUpdateResult:: ds 1 ; cd6e \ No newline at end of file diff --git a/wram.asm b/ram/wram_int.asm similarity index 100% rename from wram.asm rename to ram/wram_int.asm