diff --git a/.gitattributes b/.gitattributes index dca901b76..48b1085c8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -14,4 +14,4 @@ *.tilemap binary *.wav binary *.blk binary -*.pic binary \ No newline at end of file +*.pic binary diff --git a/.gitignore b/.gitignore index c5e70143c..80e4aad8c 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,9 @@ *.2bpp *.pic +# compiled audio +*.pcm + # compiled roms *.gbc *.gb @@ -21,9 +24,6 @@ *.pyc *$py.class -# converted audio data -*.pcm - # save game files *.sgm *.sav diff --git a/INSTALL.md b/INSTALL.md index f640e31e4..0d49fedc1 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -82,7 +82,7 @@ Open **Terminal** and enter the following commands, depending on which distro yo To install the software required for **pokeyellow**: ```bash -sudo apt-get install make gcc git +sudo apt-get install make gcc git python ``` Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install/source) to build **rgbds 0.4.1** from source. @@ -92,7 +92,7 @@ Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install/source) To install the software required for **pokeyellow**: ```bash -sudo zypper install make gcc git +sudo zypper install make gcc git python ``` Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install/source) to build **rgbds 0.4.1** from source. @@ -102,7 +102,7 @@ Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install/source) To install the software required for **pokeyellow**: ```bash -sudo pacman -S make gcc git +sudo pacman -S make gcc git python ``` Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install/arch) for Arch Linux to install **rgbds 0.4.1**. @@ -133,6 +133,7 @@ If your distro is not listed here, try to find the required software in its repo - `gcc` (or `clang`) - `git` - `rgbds` +- `python` If `rgbds` is not available, you'll need to follow the [**rgbds** instructions](https://rgbds.gbdev.io/install/source) to build **rgbds 0.4.1** from source. diff --git a/Makefile b/Makefile index a5366069f..434a31926 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,3 @@ -PYTHON := python -pcm := $(PYTHON) tools/pokemontools/pcm.py pcm - rom := pokeyellow.gbc rom_obj := \ @@ -11,6 +8,7 @@ maps.o \ text.o \ wram.o \ gfx/pics.o \ +gfx/pikachu.o \ gfx/sprites.o \ gfx/tilesets.o @@ -29,6 +27,9 @@ RGBFIX ?= $(RGBDS)rgbfix RGBGFX ?= $(RGBDS)rgbgfx RGBLINK ?= $(RGBDS)rgblink +PYTHON := python +pcm := $(PYTHON) tools/pokemontools/pcm.py pcm + ### Build targets @@ -42,7 +43,8 @@ all: $(rom) yellow: $(rom) clean: tidy - find . \( -iname '*.1bpp' -o -iname '*.2bpp' -o -iname '*.pic' -o -iname '*.pcm' \) -delete + find gfx \( -iname '*.1bpp' -o -iname '*.2bpp' -o -iname '*.pic' \) -delete + find audio/pikachu_cries \( -iname '*.pcm' \) -delete tidy: rm -f $(rom) $(rom_obj) $(rom:.gbc=.map) $(rom:.gbc=.sym) rgbdscheck.o @@ -105,11 +107,14 @@ gfx/slots/slots_1.2bpp: tools/gfx += --trim-whitespace gfx/tilesets/%.2bpp: tools/gfx += --trim-whitespace gfx/tilesets/reds_house.2bpp: tools/gfx += --preserve=0x48 +gfx/title/pokemon_logo.2bpp: tools/gfx += --trim-whitespace + gfx/trade/game_boy.2bpp: tools/gfx += --remove-duplicates gfx/sgb/border.2bpp: tools/gfx += --trim-whitespace -gfx/surfing_pikachu_1c.2bpp: tools/gfx += --trim-whitespace -gfx/surfing_pikachu_3.2bpp: tools/gfx += --trim-whitespace + +gfx/surfing_pikachu/surfing_pikachu_1c.2bpp: tools/gfx += --trim-whitespace +gfx/surfing_pikachu/surfing_pikachu_3.2bpp: tools/gfx += --trim-whitespace ### Catch-all graphics rules @@ -130,5 +135,9 @@ gfx/surfing_pikachu_3.2bpp: tools/gfx += --trim-whitespace tools/pkmncompress $< $@ +### Catch-all audio rules + %.wav: ; -%.pcm: %.wav ; @$(pcm) $< + +%.pcm: %.wav + @$(pcm) $< diff --git a/audio.asm b/audio.asm index 737e9f704..bd5b390d9 100644 --- a/audio.asm +++ b/audio.asm @@ -433,8 +433,6 @@ INCLUDE "audio/sfx/get_item2_4.asm" SECTION "Audio Engine 1", ROMX -AudioEngine1:: - INCLUDE "audio/play_battle_music.asm" INCLUDE "audio/engine_1.asm" INCLUDE "audio/alternate_tempo.asm" @@ -447,25 +445,18 @@ INCLUDE "audio/low_health_alarm.asm" SECTION "Audio Engine 2", ROMX -AudioEngine2:: - INCLUDE "audio/engine_2.asm" SECTION "Audio Engine 3", ROMX -AudioEngine3:: - INCLUDE "audio/pokedex_rating_sfx.asm" INCLUDE "audio/engine_3.asm" SECTION "Audio Engine 4", ROMX -SurfingPikachu1Graphics1:: INCBIN "gfx/surfing_pikachu_1a.2bpp" -SurfingPikachu1Graphics2:: INCBIN "gfx/surfing_pikachu_1b.2bpp" -SurfingPikachu1Graphics3:: INCBIN "gfx/surfing_pikachu_1c.2bpp" - +INCLUDE "gfx/surfing_pikachu.asm" INCLUDE "audio/engine_4.asm" @@ -550,5 +541,6 @@ INCLUDE "audio/music/meetjessiejames.asm" INCBIN "audio/unknown_832b9.bin" -; cries are in different banks + +; Pikachu cries are in different banks INCLUDE "audio/pikachu_cries.asm" diff --git a/audio/alternate_tempo.asm b/audio/alternate_tempo.asm index 87d08e18f..eb47d62d5 100644 --- a/audio/alternate_tempo.asm +++ b/audio/alternate_tempo.asm @@ -23,18 +23,17 @@ Music_RivalAlternateTempo:: ld a, MUSIC_MEET_RIVAL call PlayMusic ld de, Music_MeetRival_branch_b119 - jr asm_99ed + jr FinishAlternateRivalMusic ; applies both the alternate start and alternate tempo Music_RivalAlternateStartAndTempo:: call Music_RivalAlternateStart ld de, Music_MeetRival_branch_b19b -asm_99ed: +FinishAlternateRivalMusic: ld hl, wChannelCommandPointers jp Audio1_OverwriteChannelPointer -; XXX - ret + ret ; unused ; an alternate tempo for Cities1 which is used for the Hall of Fame room Music_Cities1AlternateTempo:: diff --git a/audio/engine_1.asm b/audio/engine_1.asm index a585cd43e..df3281cb9 100644 --- a/audio/engine_1.asm +++ b/audio/engine_1.asm @@ -1,4 +1,4 @@ -; The first of three duplicated sound engines. +; The first of four partially duplicated sound engines. Audio1_UpdateMusic:: ld c, Ch1 @@ -1064,7 +1064,7 @@ Audio1_IsCry: Audio1_96c3: ld a, [wAudioROMBank] - cp BANK(AudioEngine2) + cp BANK("Audio Engine 2") jr nz, .asm_96dc ld a, [wChannelSoundIDs + Ch8] ld b, a diff --git a/audio/engine_2.asm b/audio/engine_2.asm index 65c25c209..800a22467 100644 --- a/audio/engine_2.asm +++ b/audio/engine_2.asm @@ -1,4 +1,4 @@ -; The second of three duplicated sound engines. +; The second of four partially duplicated sound engines. ; This copy has a few differences relating to battle sound effects ; and the low health alarm that plays in battle diff --git a/audio/engine_3.asm b/audio/engine_3.asm index 108938683..06698ca52 100644 --- a/audio/engine_3.asm +++ b/audio/engine_3.asm @@ -1,4 +1,4 @@ -; The third of three duplicated sound engines. +; The third of four partially duplicated sound engines. Audio3_PlaySound:: ld [wSoundID], a diff --git a/audio/engine_4.asm b/audio/engine_4.asm index 850bb66a2..b3ed422e1 100644 --- a/audio/engine_4.asm +++ b/audio/engine_4.asm @@ -1,4 +1,4 @@ -; The fourth of three duplicated sound engines. +; The fourth of four partially duplicated sound engines. Audio4_PlaySound:: ld [wSoundID], a diff --git a/audio/music/dungeon1.asm b/audio/music/dungeon1.asm index 6bcb1fc09..445576bb5 100644 --- a/audio/music/dungeon1.asm +++ b/audio/music/dungeon1.asm @@ -6,10 +6,8 @@ Music_Dungeon1_Ch1:: vibrato 10, 1, 4 note_type 12, 4, -5 rest 8 - ; stereo_panning %1110, %1101 octave 4 note F#, 8 - ; stereo_panning %1111, %1111 Music_Dungeon1_branch_7dee5:: note_type 12, 11, 2 diff --git a/audio/pikachu_cries.asm b/audio/pikachu_cries.asm index a09425b3a..1f6bc2c47 100644 --- a/audio/pikachu_cries.asm +++ b/audio/pikachu_cries.asm @@ -5,12 +5,14 @@ pcm: MACRO .End: ENDM -SECTION "Pikachu Cries 1", ROMX ; BANK $21 + +; All of the pcm data has one trailing byte that is never processed. + +SECTION "Pikachu Cries 1", ROMX PikachuCry1:: pcm INCBIN "audio/pikachu_cries/pikachu_cry_1.pcm" db $77 ; unused - ; All of the pcm data has one trailing byte that is never processed. PikachuCry2:: pcm INCBIN "audio/pikachu_cries/pikachu_cry_2.pcm" @@ -25,7 +27,7 @@ PikachuCry4:: db $e0 ; unused -SECTION "Pikachu Cries 2", ROMX ; BANK $22 +SECTION "Pikachu Cries 2", ROMX PikachuCry5:: pcm INCBIN "audio/pikachu_cries/pikachu_cry_5.pcm" @@ -40,7 +42,7 @@ PikachuCry7:: db $ff ; unused -SECTION "Pikachu Cries 3", ROMX ; BANK $23 +SECTION "Pikachu Cries 3", ROMX PikachuCry8:: pcm INCBIN "audio/pikachu_cries/pikachu_cry_8.pcm" @@ -55,7 +57,7 @@ PikachuCry10:: db $ff ; unused -SECTION "Pikachu Cries 4", ROMX ; BANK $24 +SECTION "Pikachu Cries 4", ROMX PikachuCry11:: pcm INCBIN "audio/pikachu_cries/pikachu_cry_11.pcm" @@ -70,7 +72,7 @@ PikachuCry13:: db $f0 ; unused -SECTION "Pikachu Cries 5", ROMX ; BANK $25 +SECTION "Pikachu Cries 5", ROMX PikachuCry14:: pcm INCBIN "audio/pikachu_cries/pikachu_cry_14.pcm" @@ -80,7 +82,7 @@ PikachuCry15:: pcm INCBIN "audio/pikachu_cries/pikachu_cry_15.pcm" db $77 ; unused -SECTION "Pikachu Cries 6", ROMX ; BANK $31 +SECTION "Pikachu Cries 6", ROMX PikachuCry16:: pcm INCBIN "audio/pikachu_cries/pikachu_cry_16.pcm" @@ -95,7 +97,7 @@ PikachuCry22:: db $7e ; unused -SECTION "Pikachu Cries 7", ROMX ; BANK $32 +SECTION "Pikachu Cries 7", ROMX PikachuCry20:: pcm INCBIN "audio/pikachu_cries/pikachu_cry_20.pcm" @@ -106,7 +108,7 @@ PikachuCry21:: db $ff ; unused -SECTION "Pikachu Cries 8", ROMX ; BANK $33 +SECTION "Pikachu Cries 8", ROMX PikachuCry19:: pcm INCBIN "audio/pikachu_cries/pikachu_cry_19.pcm" @@ -120,7 +122,7 @@ PikachuCry26:: pcm INCBIN "audio/pikachu_cries/pikachu_cry_26.pcm" db $00 ; unused -SECTION "Pikachu Cries 9", ROMX ; BANK $34 +SECTION "Pikachu Cries 9", ROMX PikachuCry17:: pcm INCBIN "audio/pikachu_cries/pikachu_cry_17.pcm" @@ -135,7 +137,7 @@ PikachuCry25:: db $03 ; unused -SECTION "Pikachu Cries 10", ROMX ; BANK $35 +SECTION "Pikachu Cries 10", ROMX PikachuCry27:: pcm INCBIN "audio/pikachu_cries/pikachu_cry_27.pcm" @@ -157,7 +159,7 @@ PikachuCry31:: pcm INCBIN "audio/pikachu_cries/pikachu_cry_31.pcm" db $00 ; unused -SECTION "Pikachu Cries 11", ROMX ; BANK $36 +SECTION "Pikachu Cries 11", ROMX PikachuCry32:: pcm INCBIN "audio/pikachu_cries/pikachu_cry_32.pcm" @@ -176,7 +178,7 @@ PikachuCry41:: db $9b ; unused -SECTION "Pikachu Cries 12", ROMX ; BANK $37 +SECTION "Pikachu Cries 12", ROMX PikachuCry35:: pcm INCBIN "audio/pikachu_cries/pikachu_cry_35.pcm" @@ -191,7 +193,7 @@ PikachuCry39:: db $0f ; unused -SECTION "Pikachu Cries 13", ROMX ; BANK $38 +SECTION "Pikachu Cries 13", ROMX PikachuCry37:: pcm INCBIN "audio/pikachu_cries/pikachu_cry_37.pcm" diff --git a/audio/wave_instruments.asm b/audio/wave_instruments.asm index 5095cceda..911ce873c 100644 --- a/audio/wave_instruments.asm +++ b/audio/wave_instruments.asm @@ -8,7 +8,6 @@ dw .wave5 ; used in the Lavender Town and Pokemon Tower themes dw .wave5 ; unused dw .wave5 ; unused -; dw .wave5 ; unused ; these are the definitions for the channel 3 instruments ; each instrument definition is made up of 32 points (nibbles) that form diff --git a/constants.asm b/constants.asm index 21cd64004..2a2770013 100644 --- a/constants.asm +++ b/constants.asm @@ -35,4 +35,5 @@ INCLUDE "constants/tileset_constants.asm" INCLUDE "constants/event_constants.asm" INCLUDE "constants/text_constants.asm" INCLUDE "constants/menu_constants.asm" +INCLUDE "constants/sprite_anim_constants.asm" INCLUDE "constants/pikachu_emotion_constants.asm" diff --git a/constants/gfx_constants.asm b/constants/gfx_constants.asm index 912e58357..e6eb50db0 100644 --- a/constants/gfx_constants.asm +++ b/constants/gfx_constants.asm @@ -2,10 +2,18 @@ TILE_WIDTH EQU 8 ; pixels LEN_1BPP_TILE EQU 1 * TILE_WIDTH ; bytes LEN_2BPP_TILE EQU 2 * TILE_WIDTH ; bytes -NUM_PAL_COLORS EQU 4 + const_def + const SHADE_WHITE ; %00 + const SHADE_LIGHT ; %01 + const SHADE_DARK ; %10 + const SHADE_BLACK ; %11 +NUM_PAL_COLORS EQU const_value + PAL_COLOR_SIZE EQU 2 PALETTE_SIZE EQU NUM_PAL_COLORS * PAL_COLOR_SIZE +NUM_ACTIVE_PALS EQU 4 + SCREEN_WIDTH EQU 20 SCREEN_HEIGHT EQU 18 SCREEN_WIDTH_PX EQU SCREEN_WIDTH * TILE_WIDTH ; pixels @@ -16,6 +24,11 @@ BG_MAP_HEIGHT EQU 32 ; tiles SPRITEBUFFERSIZE EQU 7 * 7 * LEN_1BPP_TILE +; DMGPalToGBCPal +CONVERT_BGP EQU 0 +CONVERT_OBP0 EQU 1 +CONVERT_OBP1 EQU 2 + ; HP bar HP_BAR_GREEN EQU 0 HP_BAR_YELLOW EQU 1 diff --git a/constants/hide_show_constants.asm b/constants/hide_show_constants.asm index 54d277692..08bb26072 100755 --- a/constants/hide_show_constants.asm +++ b/constants/hide_show_constants.asm @@ -3,8 +3,7 @@ SHOW EQU $15 ; MissableObjects indexes (see data/maps/hide_show_data.asm) ; this is a list of the sprites that can be enabled/disabled during the game -; there may be unused sprites, but these will remain unmarked until -; the disassembly is complete +; TODO: mark sprite constants with an X that are never used const_def const HS_PALLET_TOWN_OAK ; 00 @@ -33,20 +32,20 @@ SHOW EQU $15 const HS_SAFFRON_CITY_D ; 17 const HS_SAFFRON_CITY_E ; 18 const HS_SAFFRON_CITY_F ; 19 - const HS_ROUTE_2_ITEM_1 ; 1A X - const HS_ROUTE_2_ITEM_2 ; 1B X - const HS_ROUTE_4_ITEM ; 1C X - const HS_ROUTE_9_ITEM ; 1D X + const HS_ROUTE_2_ITEM_1 ; 1A + const HS_ROUTE_2_ITEM_2 ; 1B + const HS_ROUTE_4_ITEM ; 1C + const HS_ROUTE_9_ITEM ; 1D const HS_ROUTE_12_SNORLAX ; 1E - const HS_ROUTE_12_ITEM_1 ; 1F X - const HS_ROUTE_12_ITEM_2 ; 20 X - const HS_ROUTE_15_ITEM ; 21 X + const HS_ROUTE_12_ITEM_1 ; 1F + const HS_ROUTE_12_ITEM_2 ; 20 + const HS_ROUTE_15_ITEM ; 21 const HS_ROUTE_16_SNORLAX ; 22 const HS_ROUTE_22_RIVAL_1 ; 23 const HS_ROUTE_22_RIVAL_2 ; 24 const HS_NUGGET_BRIDGE_GUY ; 25 - const HS_ROUTE_24_ITEM ; 26 X - const HS_ROUTE_25_ITEM ; 27 X + const HS_ROUTE_24_ITEM ; 26 + const HS_ROUTE_25_ITEM ; 27 const HS_DAISY_SITTING ; 28 const HS_DAISY_WALKING ; 29 const HS_TOWN_MAP ; 2A @@ -57,95 +56,95 @@ SHOW EQU $15 const HS_POKEDEX_2 ; 2F const HS_OAKS_LAB_OAK_2 ; 30 const HS_VIRIDIAN_GYM_GIOVANNI ; 31 - const HS_VIRIDIAN_GYM_ITEM ; 32 X + const HS_VIRIDIAN_GYM_ITEM ; 32 const HS_OLD_AMBER ; 33 const HS_CERULEAN_BULBASAUR ; 34 - const HS_CERULEAN_CAVE_1F_ITEM_1 ; 35 X - const HS_CERULEAN_CAVE_1F_ITEM_2 ; 36 X - const HS_CERULEAN_CAVE_1F_ITEM_3 ; 37 X - const HS_CERULEAN_CAVE_1F_ITEM_4 ; 38 X + const HS_CERULEAN_CAVE_1F_ITEM_1 ; 35 + const HS_CERULEAN_CAVE_1F_ITEM_2 ; 36 + const HS_CERULEAN_CAVE_1F_ITEM_3 ; 37 + const HS_CERULEAN_CAVE_1F_ITEM_4 ; 38 const HS_POKEMON_TOWER_2F_RIVAL ; 39 - const HS_POKEMON_TOWER_3F_ITEM ; 3A X - const HS_POKEMON_TOWER_4F_ITEM_1 ; 3B X - const HS_POKEMON_TOWER_4F_ITEM_2 ; 3C X - const HS_POKEMON_TOWER_4F_ITEM_3 ; 3D X - const HS_POKEMON_TOWER_5F_ITEM ; 3E X - const HS_POKEMON_TOWER_6F_ITEM_1 ; 3F X - const HS_POKEMON_TOWER_6F_ITEM_2 ; 40 X + const HS_POKEMON_TOWER_3F_ITEM ; 3A + const HS_POKEMON_TOWER_4F_ITEM_1 ; 3B + const HS_POKEMON_TOWER_4F_ITEM_2 ; 3C + const HS_POKEMON_TOWER_4F_ITEM_3 ; 3D + const HS_POKEMON_TOWER_5F_ITEM ; 3E + const HS_POKEMON_TOWER_6F_ITEM_1 ; 3F + const HS_POKEMON_TOWER_6F_ITEM_2 ; 40 const HS_POKEMON_TOWER_7F_JESSIE ; 41 const HS_POKEMON_TOWER_7F_JAMES ; 42 const HS_POKEMON_TOWER_7F_MR_FUJI ; 43 const HS_MR_FUJIS_HOUSE_MR_FUJI ; 44 const HS_CELADON_MANSION_EEVEE_GIFT ; 45 const HS_GAME_CORNER_ROCKET ; 46 - const HS_WARDENS_HOUSE_ITEM ; 47 X - const HS_POKEMON_MANSION_1F_ITEM_1 ; 48 X - const HS_POKEMON_MANSION_1F_ITEM_2 ; 49 X + const HS_WARDENS_HOUSE_ITEM ; 47 + const HS_POKEMON_MANSION_1F_ITEM_1 ; 48 + const HS_POKEMON_MANSION_1F_ITEM_2 ; 49 const HS_FIGHTING_DOJO_GIFT_1 ; 4A const HS_FIGHTING_DOJO_GIFT_2 ; 4B const HS_SILPH_CO_1F_RECEPTIONIST ; 4C - const HS_VOLTORB_1 ; 4D X - const HS_VOLTORB_2 ; 4E X - const HS_VOLTORB_3 ; 4F X - const HS_ELECTRODE_1 ; 50 X - const HS_VOLTORB_4 ; 51 X - const HS_VOLTORB_5 ; 52 X - const HS_ELECTRODE_2 ; 53 X - const HS_VOLTORB_6 ; 54 X - const HS_ZAPDOS ; 55 X - const HS_POWER_PLANT_ITEM_1 ; 56 X - const HS_POWER_PLANT_ITEM_2 ; 57 X - const HS_POWER_PLANT_ITEM_3 ; 58 X - const HS_POWER_PLANT_ITEM_4 ; 59 X - const HS_POWER_PLANT_ITEM_5 ; 5A X - const HS_MOLTRES ; 5B X - const HS_VICTORY_ROAD_2F_ITEM_1 ; 5C X - const HS_VICTORY_ROAD_2F_ITEM_2 ; 5D X - const HS_VICTORY_ROAD_2F_ITEM_3 ; 5E X - const HS_VICTORY_ROAD_2F_ITEM_4 ; 5F X + const HS_VOLTORB_1 ; 4D + const HS_VOLTORB_2 ; 4E + const HS_VOLTORB_3 ; 4F + const HS_ELECTRODE_1 ; 50 + const HS_VOLTORB_4 ; 51 + const HS_VOLTORB_5 ; 52 + const HS_ELECTRODE_2 ; 53 + const HS_VOLTORB_6 ; 54 + const HS_ZAPDOS ; 55 + const HS_POWER_PLANT_ITEM_1 ; 56 + const HS_POWER_PLANT_ITEM_2 ; 57 + const HS_POWER_PLANT_ITEM_3 ; 58 + const HS_POWER_PLANT_ITEM_4 ; 59 + const HS_POWER_PLANT_ITEM_5 ; 5A + const HS_MOLTRES ; 5B + const HS_VICTORY_ROAD_2F_ITEM_1 ; 5C + const HS_VICTORY_ROAD_2F_ITEM_2 ; 5D + const HS_VICTORY_ROAD_2F_ITEM_3 ; 5E + const HS_VICTORY_ROAD_2F_ITEM_4 ; 5F const HS_VICTORY_ROAD_2F_BOULDER ; 60 const HS_BILL_POKEMON ; 61 const HS_BILL_1 ; 62 const HS_BILL_2 ; 63 - const HS_VIRIDIAN_FOREST_ITEM_1 ; 64 X - const HS_VIRIDIAN_FOREST_ITEM_2 ; 65 X - const HS_VIRIDIAN_FOREST_ITEM_3 ; 66 X - const HS_MT_MOON_1F_ITEM_1 ; 67 X - const HS_MT_MOON_1F_ITEM_2 ; 68 X - const HS_MT_MOON_1F_ITEM_3 ; 69 X - const HS_MT_MOON_1F_ITEM_4 ; 6A X - const HS_MT_MOON_1F_ITEM_5 ; 6B X - const HS_MT_MOON_1F_ITEM_6 ; 6C X + const HS_VIRIDIAN_FOREST_ITEM_1 ; 64 + const HS_VIRIDIAN_FOREST_ITEM_2 ; 65 + const HS_VIRIDIAN_FOREST_ITEM_3 ; 66 + const HS_MT_MOON_1F_ITEM_1 ; 67 + const HS_MT_MOON_1F_ITEM_2 ; 68 + const HS_MT_MOON_1F_ITEM_3 ; 69 + const HS_MT_MOON_1F_ITEM_4 ; 6A + const HS_MT_MOON_1F_ITEM_5 ; 6B + const HS_MT_MOON_1F_ITEM_6 ; 6C const HS_MT_MOON_B2F_JESSIE ; 6D const HS_MT_MOON_B2F_JAMES ; 6E const HS_MT_MOON_B2F_FOSSIL_1 ; 6F const HS_MT_MOON_B2F_FOSSIL_2 ; 70 - const HS_MT_MOON_B2F_ITEM_1 ; 71 X - const HS_MT_MOON_B2F_ITEM_2 ; 72 X + const HS_MT_MOON_B2F_ITEM_1 ; 71 + const HS_MT_MOON_B2F_ITEM_2 ; 72 const HS_SS_ANNE_2F_RIVAL ; 73 - const HS_SS_ANNE_1F_ROOMS_ITEM ; 74 X - const HS_SS_ANNE_2F_ROOMS_ITEM_1 ; 75 X - const HS_SS_ANNE_2F_ROOMS_ITEM_2 ; 76 X - const HS_SS_ANNE_B1F_ROOMS_ITEM_1 ; 77 X - const HS_SS_ANNE_B1F_ROOMS_ITEM_2 ; 78 X - const HS_SS_ANNE_B1F_ROOMS_ITEM_3 ; 79 X - const HS_VICTORY_ROAD_3F_ITEM_1 ; 7A X - const HS_VICTORY_ROAD_3F_ITEM_2 ; 7B X + const HS_SS_ANNE_1F_ROOMS_ITEM ; 74 + const HS_SS_ANNE_2F_ROOMS_ITEM_1 ; 75 + const HS_SS_ANNE_2F_ROOMS_ITEM_2 ; 76 + const HS_SS_ANNE_B1F_ROOMS_ITEM_1 ; 77 + const HS_SS_ANNE_B1F_ROOMS_ITEM_2 ; 78 + const HS_SS_ANNE_B1F_ROOMS_ITEM_3 ; 79 + const HS_VICTORY_ROAD_3F_ITEM_1 ; 7A + const HS_VICTORY_ROAD_3F_ITEM_2 ; 7B const HS_VICTORY_ROAD_3F_BOULDER ; 7C - const HS_ROCKET_HIDEOUT_B1F_ITEM_1 ; 7D X - const HS_ROCKET_HIDEOUT_B1F_ITEM_2 ; 7E X - const HS_ROCKET_HIDEOUT_B2F_ITEM_1 ; 7F X - const HS_ROCKET_HIDEOUT_B2F_ITEM_2 ; 80 X - const HS_ROCKET_HIDEOUT_B2F_ITEM_3 ; 81 X - const HS_ROCKET_HIDEOUT_B2F_ITEM_4 ; 82 X - const HS_ROCKET_HIDEOUT_B3F_ITEM_1 ; 83 X - const HS_ROCKET_HIDEOUT_B3F_ITEM_2 ; 84 X + const HS_ROCKET_HIDEOUT_B1F_ITEM_1 ; 7D + const HS_ROCKET_HIDEOUT_B1F_ITEM_2 ; 7E + const HS_ROCKET_HIDEOUT_B2F_ITEM_1 ; 7F + const HS_ROCKET_HIDEOUT_B2F_ITEM_2 ; 80 + const HS_ROCKET_HIDEOUT_B2F_ITEM_3 ; 81 + const HS_ROCKET_HIDEOUT_B2F_ITEM_4 ; 82 + const HS_ROCKET_HIDEOUT_B3F_ITEM_1 ; 83 + const HS_ROCKET_HIDEOUT_B3F_ITEM_2 ; 84 const HS_ROCKET_HIDEOUT_B4F_GIOVANNI ; 85 const HS_ROCKET_HIDEOUT_B4F_JAMES ; 86 const HS_ROCKET_HIDEOUT_B4F_JESSIE ; 87 - const HS_ROCKET_HIDEOUT_B4F_ITEM_1 ; 88 X - const HS_ROCKET_HIDEOUT_B4F_ITEM_2 ; 89 X - const HS_ROCKET_HIDEOUT_B4F_ITEM_3 ; 8A X + const HS_ROCKET_HIDEOUT_B4F_ITEM_1 ; 88 + const HS_ROCKET_HIDEOUT_B4F_ITEM_2 ; 89 + const HS_ROCKET_HIDEOUT_B4F_ITEM_3 ; 8A const HS_ROCKET_HIDEOUT_B4F_ITEM_4 ; 8B const HS_ROCKET_HIDEOUT_B4F_ITEM_5 ; 8C const HS_SILPH_CO_2F_1 ; 8D XXX never (de)activated? @@ -155,32 +154,32 @@ SHOW EQU $15 const HS_SILPH_CO_2F_5 ; 91 const HS_SILPH_CO_3F_1 ; 92 const HS_SILPH_CO_3F_2 ; 93 - const HS_SILPH_CO_3F_ITEM ; 94 X + const HS_SILPH_CO_3F_ITEM ; 94 const HS_SILPH_CO_4F_1 ; 95 const HS_SILPH_CO_4F_2 ; 96 const HS_SILPH_CO_4F_3 ; 97 - const HS_SILPH_CO_4F_ITEM_1 ; 98 X - const HS_SILPH_CO_4F_ITEM_2 ; 99 X - const HS_SILPH_CO_4F_ITEM_3 ; 9A X + const HS_SILPH_CO_4F_ITEM_1 ; 98 + const HS_SILPH_CO_4F_ITEM_2 ; 99 + const HS_SILPH_CO_4F_ITEM_3 ; 9A const HS_SILPH_CO_5F_1 ; 9B const HS_SILPH_CO_5F_2 ; 9C const HS_SILPH_CO_5F_3 ; 9D const HS_SILPH_CO_5F_4 ; 9E - const HS_SILPH_CO_5F_ITEM_1 ; 9F X - const HS_SILPH_CO_5F_ITEM_2 ; A0 X - const HS_SILPH_CO_5F_ITEM_3 ; A1 X + const HS_SILPH_CO_5F_ITEM_1 ; 9F + const HS_SILPH_CO_5F_ITEM_2 ; A0 + const HS_SILPH_CO_5F_ITEM_3 ; A1 const HS_SILPH_CO_6F_1 ; A2 const HS_SILPH_CO_6F_2 ; A3 const HS_SILPH_CO_6F_3 ; A4 - const HS_SILPH_CO_6F_ITEM_1 ; A5 X - const HS_SILPH_CO_6F_ITEM_2 ; A6 X + const HS_SILPH_CO_6F_ITEM_1 ; A5 + const HS_SILPH_CO_6F_ITEM_2 ; A6 const HS_SILPH_CO_7F_1 ; A7 const HS_SILPH_CO_7F_2 ; A8 const HS_SILPH_CO_7F_3 ; A9 const HS_SILPH_CO_7F_4 ; AA const HS_SILPH_CO_7F_RIVAL ; AB - const HS_SILPH_CO_7F_ITEM_1 ; AC X - const HS_SILPH_CO_7F_ITEM_2 ; AD X + const HS_SILPH_CO_7F_ITEM_1 ; AC + const HS_SILPH_CO_7F_ITEM_2 ; AD const HS_SILPH_CO_7F_8 ; AE XXX sprite doesn't exist const HS_SILPH_CO_8F_1 ; AF const HS_SILPH_CO_8F_2 ; B0 @@ -191,44 +190,44 @@ SHOW EQU $15 const HS_SILPH_CO_10F_1 ; B5 const HS_SILPH_CO_10F_2 ; B6 const HS_SILPH_CO_10F_3 ; B7 XXX never (de)activated? - const HS_SILPH_CO_10F_ITEM_1 ; B8 X - const HS_SILPH_CO_10F_ITEM_2 ; B9 X - const HS_SILPH_CO_10F_ITEM_3 ; BA X + const HS_SILPH_CO_10F_ITEM_1 ; B8 + const HS_SILPH_CO_10F_ITEM_2 ; B9 + const HS_SILPH_CO_10F_ITEM_3 ; BA const HS_SILPH_CO_11F_1 ; BB const HS_SILPH_CO_11F_JAMES ; BC const HS_SILPH_CO_11F_2 ; BD const HS_SILPH_CO_11F_JESSIE ; BE const HS_UNUSED_MAP_F4_1 ; BF XXX sprite doesn't exist - const HS_POKEMON_MANSION_2F_ITEM ; C0 X - const HS_POKEMON_MANSION_3F_ITEM_1 ; C1 X - const HS_POKEMON_MANSION_3F_ITEM_2 ; C2 X - const HS_POKEMON_MANSION_B1F_ITEM_1 ; C3 X - const HS_POKEMON_MANSION_B1F_ITEM_2 ; C4 X - const HS_POKEMON_MANSION_B1F_ITEM_3 ; C5 X - const HS_POKEMON_MANSION_B1F_ITEM_4 ; C6 X - const HS_POKEMON_MANSION_B1F_ITEM_5 ; C7 X - const HS_SAFARI_ZONE_EAST_ITEM_1 ; C8 X - const HS_SAFARI_ZONE_EAST_ITEM_2 ; C9 X - const HS_SAFARI_ZONE_EAST_ITEM_3 ; CA X - const HS_SAFARI_ZONE_EAST_ITEM_4 ; CB X - const HS_SAFARI_ZONE_NORTH_ITEM_1 ; CC X - const HS_SAFARI_ZONE_NORTH_ITEM_2 ; CD X - const HS_SAFARI_ZONE_WEST_ITEM_1 ; CE X - const HS_SAFARI_ZONE_WEST_ITEM_2 ; CF X - const HS_SAFARI_ZONE_WEST_ITEM_3 ; D0 X - const HS_SAFARI_ZONE_WEST_ITEM_4 ; D1 X - const HS_SAFARI_ZONE_CENTER_ITEM ; D2 X - const HS_CERULEAN_CAVE_2F_ITEM_1 ; D3 X - const HS_CERULEAN_CAVE_2F_ITEM_2 ; D4 X - const HS_CERULEAN_CAVE_2F_ITEM_3 ; D5 X - const HS_CERULEAN_CAVE_2F_ITEM_4 ; D6 X - const HS_MEWTWO ; D7 X - const HS_CERULEAN_CAVE_B1F_ITEM_1 ; D8 X - const HS_CERULEAN_CAVE_B1F_ITEM_2 ; D9 X - const HS_CERULEAN_CAVE_B1F_ITEM_3 ; DA X - const HS_CERULEAN_CAVE_B1F_ITEM_4 ; DB X - const HS_VICTORY_ROAD_1F_ITEM_1 ; DC X - const HS_VICTORY_ROAD_1F_ITEM_2 ; DD X + const HS_POKEMON_MANSION_2F_ITEM ; C0 + const HS_POKEMON_MANSION_3F_ITEM_1 ; C1 + const HS_POKEMON_MANSION_3F_ITEM_2 ; C2 + const HS_POKEMON_MANSION_B1F_ITEM_1 ; C3 + const HS_POKEMON_MANSION_B1F_ITEM_2 ; C4 + const HS_POKEMON_MANSION_B1F_ITEM_3 ; C5 + const HS_POKEMON_MANSION_B1F_ITEM_4 ; C6 + const HS_POKEMON_MANSION_B1F_ITEM_5 ; C7 + const HS_SAFARI_ZONE_EAST_ITEM_1 ; C8 + const HS_SAFARI_ZONE_EAST_ITEM_2 ; C9 + const HS_SAFARI_ZONE_EAST_ITEM_3 ; CA + const HS_SAFARI_ZONE_EAST_ITEM_4 ; CB + const HS_SAFARI_ZONE_NORTH_ITEM_1 ; CC + const HS_SAFARI_ZONE_NORTH_ITEM_2 ; CD + const HS_SAFARI_ZONE_WEST_ITEM_1 ; CE + const HS_SAFARI_ZONE_WEST_ITEM_2 ; CF + const HS_SAFARI_ZONE_WEST_ITEM_3 ; D0 + const HS_SAFARI_ZONE_WEST_ITEM_4 ; D1 + const HS_SAFARI_ZONE_CENTER_ITEM ; D2 + const HS_CERULEAN_CAVE_2F_ITEM_1 ; D3 + const HS_CERULEAN_CAVE_2F_ITEM_2 ; D4 + const HS_CERULEAN_CAVE_2F_ITEM_3 ; D5 + const HS_CERULEAN_CAVE_2F_ITEM_4 ; D6 + const HS_MEWTWO ; D7 + const HS_CERULEAN_CAVE_B1F_ITEM_1 ; D8 + const HS_CERULEAN_CAVE_B1F_ITEM_2 ; D9 + const HS_CERULEAN_CAVE_B1F_ITEM_3 ; DA + const HS_CERULEAN_CAVE_B1F_ITEM_4 ; DB + const HS_VICTORY_ROAD_1F_ITEM_1 ; DC + const HS_VICTORY_ROAD_1F_ITEM_2 ; DD const HS_CHAMPIONS_ROOM_OAK ; DE const HS_SEAFOAM_ISLANDS_1F_BOULDER_1 ; DF const HS_SEAFOAM_ISLANDS_1F_BOULDER_2 ; E0 @@ -242,7 +241,7 @@ SHOW EQU $15 const HS_SEAFOAM_ISLANDS_B3F_BOULDER_4 ; E8 const HS_SEAFOAM_ISLANDS_B4F_BOULDER_1 ; E9 const HS_SEAFOAM_ISLANDS_B4F_BOULDER_2 ; EA - const HS_ARTICUNO ; EB X + const HS_ARTICUNO ; EB const HS_DAISY_SITTING_COPY ; EC const HS_DAISY_WALKING_COPY ; ED const HS_TOWN_MAP_COPY ; EE diff --git a/constants/map_constants.asm b/constants/map_constants.asm index 038c2ab29..366c86193 100644 --- a/constants/map_constants.asm +++ b/constants/map_constants.asm @@ -266,7 +266,7 @@ FIRST_INDOOR_MAP EQU const_value mapconst LORELEIS_ROOM, 6, 5 ; $F5 mapconst BRUNOS_ROOM, 6, 5 ; $F6 mapconst AGATHAS_ROOM, 6, 5 ; $F7 - mapconst BEACH_HOUSE, 4, 7 ; $F8 + mapconst SUMMER_BEACH_HOUSE, 4, 7 ; $F8 ; Indoor maps, such as houses, use this as the Map ID in their exit warps ; This map ID takes the player back to the last outdoor map they were on, stored in wLastMap diff --git a/constants/misc_constants.asm b/constants/misc_constants.asm index 6fb43490c..1bb32f8e4 100644 --- a/constants/misc_constants.asm +++ b/constants/misc_constants.asm @@ -7,26 +7,3 @@ TRUE EQU 1 const FLAG_RESET ; 0 const FLAG_SET ; 1 const FLAG_TEST ; 2 - -; pikachu happiness modifiers - const_def 1 - const PIKAHAPPY_LEVELUP - const PIKAHAPPY_USEDITEM - const PIKAHAPPY_USEDXITEM - const PIKAHAPPY_GYMLEADER - const PIKAHAPPY_USEDTMHM - const PIKAHAPPY_WALKING - const PIKAHAPPY_DEPOSITED - const PIKAHAPPY_FAINTED - const PIKAHAPPY_PSNFNT - const PIKAHAPPY_CARELESSTRAINER - const PIKAHAPPY_TRADE - -; DMGPalToGBCPal -CONVERT_BGP EQU 0 -CONVERT_OBP0 EQU 1 -CONVERT_OBP1 EQU 2 - -NUM_COLORS EQU 4 -PAL_SIZE EQU NUM_COLORS * 2 -NUM_ACTIVE_PALS EQU 4 diff --git a/constants/oam_constants.asm b/constants/oam_constants.asm index 7a80bdd25..be63dc244 100755 --- a/constants/oam_constants.asm +++ b/constants/oam_constants.asm @@ -15,18 +15,3 @@ OAM_OBP1 EQU 1 << OAM_OBP_NUM ; OBJ palette 1 OAM_HFLIP EQU 1 << OAM_X_FLIP ; horizontal flip OAM_VFLIP EQU 1 << OAM_Y_FLIP ; vertical flip OAM_BEHIND_BG EQU 1 << OAM_PRIORITY ; behind bg (except color 0) - -frame: MACRO - db \1 -x = \2 -REPT _NARG +- 2 -x = x | (\3 << 1) - shift -endr - db x - endm - -delanim EQUS "db $fc" -dorepeat EQUS "db $fd," -dorestart EQUS "db $fe" -endanim EQUS "db $ff" diff --git a/constants/pikachu_emotion_constants.asm b/constants/pikachu_emotion_constants.asm index feb4a4380..fa2a94573 100644 --- a/constants/pikachu_emotion_constants.asm +++ b/constants/pikachu_emotion_constants.asm @@ -1,29 +1,28 @@ -dpikapic: macro +; pikachu happiness modifiers + const_def 1 + const PIKAHAPPY_LEVELUP + const PIKAHAPPY_USEDITEM + const PIKAHAPPY_USEDXITEM + const PIKAHAPPY_GYMLEADER + const PIKAHAPPY_USEDTMHM + const PIKAHAPPY_WALKING + const PIKAHAPPY_DEPOSITED + const PIKAHAPPY_FAINTED + const PIKAHAPPY_PSNFNT + const PIKAHAPPY_CARELESSTRAINER + const PIKAHAPPY_TRADE + +dpikapic: MACRO db (\1_id - PikaPicAnimPointers) / 2 - endm - -ldpikapic: macro - ld \1, (\2_id - PikaPicAnimPointers) / 2 - endm +ENDM -dpikaemotion: macro +dpikaemotion: MACRO db (\1_id - PikachuEmotionTable) / 2 - endm +ENDM -ldpikaemotion: macro +ldpikaemotion: MACRO ld \1, (\2_id - PikachuEmotionTable) / 2 - endm - -dpikaanim: macro - db (\1_id - PikaPicAnimBGFramesPointers) / 2 - endm - -pikaframeend EQUS "db $e0" -pikaframe: macro - db (\1_id - PikaPicTilemapPointers) / 2, \2 - endm - -pikaframedelay EQUS "db 0," +ENDM ; Starter Pikachu emotion commands constants @@ -60,7 +59,7 @@ pikaframedelay EQUS "db 0," const PIKASTEPDIR_UP_RIGHT -; Macros for commands +; MACROs for commands pikaemotion_dummy1: MACRO db PIKAEMOTION_DUMMY1 ENDM @@ -117,108 +116,109 @@ pikaemotion_dummy3: MACRO ENDM pikacry_def: MACRO -\1_id:: dba \1 -endm +\1_id:: + dba \1 +ENDM dpikacry: MACRO db (\1_id - PikachuCriesPointerTable) / 3 - endm +ENDM ldpikacry: MACRO ld \1, (\2_id - PikachuCriesPointerTable) / 3 - ENDM +ENDM pikacry: MACRO ldpikacry a, \1 - endm +ENDM const_def const pikapic_nop_command -pikapic_nop: macro +pikapic_nop: MACRO db pikapic_nop_command - endm +ENDM const pikapic_writebyte_command -pikapic_writebyte: macro +pikapic_writebyte: MACRO db pikapic_writebyte_command, \1 - endm +ENDM const pikapic_loadgfx_command -pikapic_loadgfx: macro +pikapic_loadgfx: MACRO db pikapic_loadgfx_command, (\1_id - PikaPicAnimGFXHeaders) / 4 - endm +ENDM const pikapic_animation_command -pikapic_animation: macro +pikapic_animation: MACRO ; frameset pointer, starting vtile, y offset, x offset db pikapic_animation_command - dpikaanim \1 + db (\1_id - PikaPicAnimBGFramesPointers) / 2 db 0, \2, \3, \4 - endm +ENDM const pikapic_nop4_command -pikapic_nop4: macro +pikapic_nop4: MACRO db pikapic_nop4_command - endm +ENDM const pikapic_nop5_command -pikapic_nop5: macro +pikapic_nop5: MACRO db pikapic_nop5_command - endm +ENDM const pikapic_waitbgmapeleteobject_command -pikapic_waitbgmapeleteobject: macro +pikapic_waitbgmapeleteobject: MACRO db pikapic_waitbgmapeleteobject_command, \1 - endm +ENDM const pikapic_nop7_command -pikapic_nop7: macro +pikapic_nop7: MACRO db pikapic_nop7_command - endm +ENDM const pikapic_nop8_command -pikapic_nop8: macro +pikapic_nop8: MACRO db pikapic_nop8_command - endm +ENDM const pikapic_jump_command -pikapic_jump: macro ; 9 +pikapic_jump: MACRO ; 9 dbw pikapic_jump_command, \1 - endm +ENDM const pikapic_setduration_command -pikapic_setduration: macro ; a +pikapic_setduration: MACRO ; a dbw pikapic_setduration_command, \1 - endm +ENDM const pikapic_cry_command -pikapic_cry: macro ; b +pikapic_cry: MACRO ; b db pikapic_cry_command IF _NARG == 0 db $ff else dpikacry \1 endc - endm +ENDM const pikapic_thunderbolt_command -pikapic_thunderbolt: macro ; c +pikapic_thunderbolt: MACRO ; c db pikapic_thunderbolt_command - endm +ENDM const pikapic_waitbgmap_command -pikapic_waitbgmap: macro ; d +pikapic_waitbgmap: MACRO ; d db pikapic_waitbgmap_command - endm +ENDM const pikapic_ret_command -pikapic_ret: macro ; e +pikapic_ret: MACRO ; e db pikapic_ret_command - endm +ENDM -pikapic_looptofinish: macro +pikapic_looptofinish: MACRO .loop\@ pikapic_waitbgmap pikapic_jump .loop\@ - endm +ENDM diff --git a/constants/sprite_anim_constants.asm b/constants/sprite_anim_constants.asm new file mode 100644 index 000000000..f5a90ab9a --- /dev/null +++ b/constants/sprite_anim_constants.asm @@ -0,0 +1,17 @@ +; animated_object struct members (see macros/wram.asm) +ANIM_OBJ_INDEX EQUS "wAnimatedObject0Index - wAnimatedObject0" +ANIM_OBJ_FRAME_SET EQUS "wAnimatedObject0FramesetID - wAnimatedObject0" +ANIM_OBJ_CALLBACK EQUS "wAnimatedObject0AnimSeqID - wAnimatedObject0" +ANIM_OBJ_TILE EQUS "wAnimatedObject0TileID - wAnimatedObject0" +ANIM_OBJ_X_COORD EQUS "wAnimatedObject0XCoord - wAnimatedObject0" +ANIM_OBJ_Y_COORD EQUS "wAnimatedObject0YCoord - wAnimatedObject0" +ANIM_OBJ_X_OFFSET EQUS "wAnimatedObject0XOffset - wAnimatedObject0" +ANIM_OBJ_Y_OFFSET EQUS "wAnimatedObject0YOffset - wAnimatedObject0" +ANIM_OBJ_DURATION EQUS "wAnimatedObject0Duration - wAnimatedObject0" +ANIM_OBJ_DURATION_OFFSET EQUS "wAnimatedObject0DurationOffset - wAnimatedObject0" +ANIM_OBJ_FRAME_IDX EQUS "wAnimatedObject0FrameIndex - wAnimatedObject0" +ANIM_OBJ_FIELD_B EQUS "wAnimatedObject0FieldB - wAnimatedObject0" +ANIM_OBJ_FIELD_C EQUS "wAnimatedObject0FieldC - wAnimatedObject0" +ANIM_OBJ_FIELD_D EQUS "wAnimatedObject0FieldD - wAnimatedObject0" +ANIM_OBJ_FIELD_E EQUS "wAnimatedObject0FieldE - wAnimatedObject0" +ANIM_OBJ_FIELD_F EQUS "wAnimatedObject0FieldF - wAnimatedObject0" diff --git a/constants/sprite_constants.asm b/constants/sprite_constants.asm index da0b3b43f..2613f707d 100755 --- a/constants/sprite_constants.asm +++ b/constants/sprite_constants.asm @@ -32,7 +32,7 @@ const SPRITE_MIDDLE_AGED_WOMAN ; $1c const SPRITE_BRUNETTE_GIRL ; $1d const SPRITE_LANCE ; $1e - const SPRITE_UNUSED_SCIENTIST ; $1f + const SPRITE_UNUSED_RED_1 ; $1f const SPRITE_SCIENTIST ; $20 const SPRITE_ROCKER ; $21 const SPRITE_SWIMMER ; $22 @@ -51,11 +51,11 @@ const SPRITE_FISHER ; $2f const SPRITE_KOGA ; $30 const SPRITE_GUARD ; $31 - const SPRITE_UNUSED_GUARD ; $32 + const SPRITE_UNUSED_RED_2 ; $32 const SPRITE_MOM ; $33 const SPRITE_BALDING_GUY ; $34 const SPRITE_LITTLE_BOY ; $35 - const SPRITE_UNUSED_GAMEBOY_KID ; $36 + const SPRITE_UNUSED_RED_3 ; $36 const SPRITE_GAMEBOY_KID ; $37 const SPRITE_FAIRY ; $38 const SPRITE_AGATHA ; $39 diff --git a/constants/tileset_constants.asm b/constants/tileset_constants.asm index 12b30ffe4..3991ac4d2 100644 --- a/constants/tileset_constants.asm +++ b/constants/tileset_constants.asm @@ -25,4 +25,4 @@ const CLUB ; 21 const FACILITY ; 22 const PLATEAU ; 23 - const BEACH_HOUSE_TILESET ; 24 + const BEACH_HOUSE ; 24 diff --git a/data/bg_map_attributes.asm b/data/cgb/bg_map_attributes.asm similarity index 100% rename from data/bg_map_attributes.asm rename to data/cgb/bg_map_attributes.asm diff --git a/data/credits/credits_mons.asm b/data/credits/credits_mons.asm index 152120489..4dd694096 100755 --- a/data/credits/credits_mons.asm +++ b/data/credits/credits_mons.asm @@ -15,6 +15,6 @@ CreditsMons: db NIDOKING db PARASECT -rept 9 +REPT 9 db GENGAR -endr +ENDR diff --git a/data/maps/bit_5_maps.asm b/data/maps/bit_5_maps.asm new file mode 100644 index 000000000..c32bb114b --- /dev/null +++ b/data/maps/bit_5_maps.asm @@ -0,0 +1,30 @@ +; SetMapSpecificScriptFlagsOnMapReload sets bit 5 +; of wCurrentMapScriptFlags for these maps. + +Bit5Maps: + db SILPH_CO_2F + db SILPH_CO_3F + db SILPH_CO_4F + db SILPH_CO_5F + db SILPH_CO_6F + db SILPH_CO_7F + db SILPH_CO_8F + db SILPH_CO_9F + db SILPH_CO_10F + db SILPH_CO_11F + db POKEMON_MANSION_2F + db POKEMON_MANSION_3F + db POKEMON_MANSION_B1F + db POKEMON_MANSION_1F + db CINNABAR_GYM + db GAME_CORNER + db ROCKET_HIDEOUT_B1F + db ROCKET_HIDEOUT_B4F + db VICTORY_ROAD_3F + db VICTORY_ROAD_1F + db VICTORY_ROAD_2F + db LANCES_ROOM + db LORELEIS_ROOM + db BRUNOS_ROOM + db AGATHAS_ROOM + db -1 ; end diff --git a/data/maps/headers/BeachHouse.asm b/data/maps/headers/BeachHouse.asm deleted file mode 100644 index b1b69e5a4..000000000 --- a/data/maps/headers/BeachHouse.asm +++ /dev/null @@ -1,8 +0,0 @@ -BeachHouse_h: - db BEACH_HOUSE_TILESET - db BEACH_HOUSE_HEIGHT, BEACH_HOUSE_WIDTH ; dimensions (y, x) - dw BeachHouse_Blocks ; blocks - dw BeachHouse_TextPointers ; texts - dw BeachHouse_Script ; scripts - db 0 ; connections - dw BeachHouse_Object ; objects diff --git a/data/maps/headers/SummerBeachHouse.asm b/data/maps/headers/SummerBeachHouse.asm new file mode 100644 index 000000000..64f55acc2 --- /dev/null +++ b/data/maps/headers/SummerBeachHouse.asm @@ -0,0 +1,3 @@ + + map_header SummerBeachHouse, SUMMER_BEACH_HOUSE, BEACH_HOUSE, 0 + end_map_header diff --git a/data/maps/hide_show_data.asm b/data/maps/hide_show_data.asm index 0e26900f9..742519789 100755 --- a/data/maps/hide_show_data.asm +++ b/data/maps/hide_show_data.asm @@ -571,11 +571,8 @@ SeafoamIslandsB4FHS: db SEAFOAM_ISLANDS_B4F, $01, HIDE db SEAFOAM_ISLANDS_B4F, $02, HIDE db SEAFOAM_ISLANDS_B4F, $03, SHOW - -BluesHouseHSCopy: -; doesn't seem to be referenced +BluesHouseHSCopy: ; unreferenced db BLUES_HOUSE, $01, SHOW db BLUES_HOUSE, $02, HIDE db BLUES_HOUSE, $03, SHOW - - db $FF, $01, SHOW + db $FF, $01, SHOW ; end diff --git a/data/maps/map_header_banks.asm b/data/maps/map_header_banks.asm index 98e5b5f5c..bbc7e13cf 100644 --- a/data/maps/map_header_banks.asm +++ b/data/maps/map_header_banks.asm @@ -248,4 +248,4 @@ MapHeaderBanks:: db BANK(LoreleisRoom_h) db BANK(BrunosRoom_h) db BANK(AgathasRoom_h) - db BANK(BeachHouse_h) + db BANK(SummerBeachHouse_h) diff --git a/data/maps/map_header_pointers.asm b/data/maps/map_header_pointers.asm index 6ea31795d..25a814cf3 100644 --- a/data/maps/map_header_pointers.asm +++ b/data/maps/map_header_pointers.asm @@ -248,4 +248,4 @@ MapHeaderPointers:: dw LoreleisRoom_h dw BrunosRoom_h dw AgathasRoom_h ;247 - dw BeachHouse_h + dw SummerBeachHouse_h diff --git a/data/maps/objects/Route19.asm b/data/maps/objects/Route19.asm index 340c48f00..55511b211 100755 --- a/data/maps/objects/Route19.asm +++ b/data/maps/objects/Route19.asm @@ -2,7 +2,7 @@ Route19_Object: db $43 ; border block def_warps - warp 5, 9, 0, BEACH_HOUSE + warp 5, 9, 0, SUMMER_BEACH_HOUSE def_signs sign 11, 11, 11 diff --git a/data/maps/objects/Route2.asm b/data/maps/objects/Route2.asm index e939b0dd5..6977133bb 100755 --- a/data/maps/objects/Route2.asm +++ b/data/maps/objects/Route2.asm @@ -22,8 +22,7 @@ Route2_Object: ; unused warp_to 2, 7, 4 - dw $c712 - db $9, $7 + db $12, $c7, $9, $7 warp_to 2, 7, 4 warp_to 2, 7, 4 warp_to 2, 7, 4 diff --git a/data/maps/objects/BeachHouse.asm b/data/maps/objects/SummerBeachHouse.asm similarity index 83% rename from data/maps/objects/BeachHouse.asm rename to data/maps/objects/SummerBeachHouse.asm index 1ba99f873..c503b8a76 100644 --- a/data/maps/objects/BeachHouse.asm +++ b/data/maps/objects/SummerBeachHouse.asm @@ -1,4 +1,4 @@ -BeachHouse_Object: +SummerBeachHouse_Object: db $a ; border block def_warps @@ -15,4 +15,4 @@ BeachHouse_Object: object SPRITE_FISHING_GURU, 2, 3, STAY, DOWN, 1 ; surfin' dude object SPRITE_PIKACHU, 5, 3, WALK, 1, 2 ; pikachu - def_warps_to BEACH_HOUSE + def_warps_to SUMMER_BEACH_HOUSE diff --git a/data/maps/songs.asm b/data/maps/songs.asm index 1b043bfa6..afafe3b3f 100644 --- a/data/maps/songs.asm +++ b/data/maps/songs.asm @@ -247,4 +247,4 @@ MapSongBanks:: db MUSIC_GYM, BANK(Music_Gym) ; LORELEIS_ROOM db MUSIC_DUNGEON1, BANK(Music_Dungeon1) ; BRUNOS_ROOM db MUSIC_POKEMON_TOWER, BANK(Music_PokemonTower) ; AGATHAS_ROOM - db MUSIC_ROUTES3, BANK(Music_Routes3) ; BEACH_HOUSE + db MUSIC_ROUTES3, BANK(Music_Routes3) ; SUMMER_BEACH_HOUSE diff --git a/data/maps/town_map_entries.asm b/data/maps/town_map_entries.asm index 6e7545586..8ad4bc28a 100755 --- a/data/maps/town_map_entries.asm +++ b/data/maps/town_map_entries.asm @@ -114,5 +114,5 @@ InternalMapEntries: internal_map ROCK_TUNNEL_B1F, 14, 3, RockTunnelName internal_map SILPH_CO_ELEVATOR, 10, 5, SilphCoName internal_map AGATHAS_ROOM, 0, 2, PokemonLeagueName - internal_map BEACH_HOUSE, 6, 15, Route19Name + internal_map SUMMER_BEACH_HOUSE, 6, 15, Route19Name db -1 ; end diff --git a/data/moves/grammar.asm b/data/moves/grammar.asm index 5855c98c8..e44b1abc6 100644 --- a/data/moves/grammar.asm +++ b/data/moves/grammar.asm @@ -1,6 +1,4 @@ ExclamationPointMoveSets: -; a grammar mistake was fixed (only concerning japanese) -; BIDE is in category 3, moved from category 2 ; set 0 db SWORDS_DANCE db GROWTH @@ -18,7 +16,7 @@ ExclamationPointMoveSets: db TELEPORT db MIMIC db DOUBLE_TEAM - db BIDE + db BIDE ; corrected JP grammar: moved from set 1 in pokered db BARRAGE db 0 ; end set diff --git a/data/pikachu_emotions.asm b/data/pikachu/pikachu_emotions.asm similarity index 100% rename from data/pikachu_emotions.asm rename to data/pikachu/pikachu_emotions.asm diff --git a/data/pikachu_pic_animation.asm b/data/pikachu/pikachu_pic_animation.asm similarity index 98% rename from data/pikachu_pic_animation.asm rename to data/pikachu/pikachu_pic_animation.asm index d10f65ddd..a9e3c5e7e 100755 --- a/data/pikachu_pic_animation.asm +++ b/data/pikachu/pikachu_pic_animation.asm @@ -19,7 +19,7 @@ PikaPicAnimThunderboltPals: db 4, %11100100 db 4, %11000000 db 4, %11100100 - db $ff + db -1 ; end Data_fe26b: pikapic_loadgfx Pic_e4000 @@ -326,15 +326,18 @@ PikaPicAnimScript28: pikapic_cry pikapic_looptofinish -PikaPicAnimGFXHeaders: pikapicanimgfx: MACRO +IF _NARG == 2 \2_id:: db \1 ; size (-1 if compressed) dba \2 ; pointer - endm +ELSE + dbbw \1, \2, \3 ; size, bank, address +ENDC +ENDM -PikaPicAnimGFX_Null_id:: - dbbw 1, $39,$0000 ; 00 +PikaPicAnimGFXHeaders: + pikapicanimgfx 1, $39, NULL ; 00 pikapicanimgfx -1, Pic_e4000 ; 01 pikapicanimgfx 5, GFX_e40cc ; 02 pikapicanimgfx -1, Pic_e411c ; 03 diff --git a/data/pikachu_pic_objects.asm b/data/pikachu/pikachu_pic_objects.asm similarity index 98% rename from data/pikachu_pic_objects.asm rename to data/pikachu/pikachu_pic_objects.asm index 940c11415..c3a44bc92 100755 --- a/data/pikachu_pic_objects.asm +++ b/data/pikachu/pikachu_pic_objects.asm @@ -1,8 +1,9 @@ -PikaPicAnimBGFramesPointers: -pikaanim_def: macro -\1_id: dw \1 - endm +pikaanim_def: MACRO +\1_id: + dw \1 +ENDM +PikaPicAnimBGFramesPointers: pikaanim_def PikaPicAnimBGFrames_0 ; 00 pikaanim_def PikaPicAnimBGFrames_1 ; 01 pikaanim_def PikaPicAnimBGFrames_2 ; 02 @@ -40,6 +41,13 @@ pikaanim_def: macro pikaanim_def PikaPicAnimBGFrames_34 ; 22 pikaanim_def PikaPicAnimBGFrames_35 ; 23 +pikaframe: MACRO + db (\1_id - PikaPicTilemapPointers) / 2, \2 +ENDM + +pikaframedelay EQUS "db 0," +pikaframeend EQUS "db $e0" + PikaPicAnimBGFrames_0: PikaPicAnimBGFrames_1: ; Tilemap idx, duration diff --git a/data/pikachu_pic_tilemaps.asm b/data/pikachu/pikachu_pic_tilemaps.asm similarity index 98% rename from data/pikachu_pic_tilemaps.asm rename to data/pikachu/pikachu_pic_tilemaps.asm index 958827118..d11ba04e9 100755 --- a/data/pikachu_pic_tilemaps.asm +++ b/data/pikachu/pikachu_pic_tilemaps.asm @@ -1,8 +1,9 @@ -PikaPicTilemapPointers: -pikatilemap_def: macro -\1_id: dw \1 - endm +pikatilemap_def: MACRO +\1_id: + dw \1 +ENDM +PikaPicTilemapPointers: pikatilemap_def PikaAnimTilemap_0 pikatilemap_def PikaAnimTilemap_1 pikatilemap_def PikaAnimTilemap_2 @@ -48,10 +49,10 @@ pikatilemap_def: macro pikatilemap_def PikaAnimTilemap_42 PikaAnimTilemap_0: - db $ff ; unused + db -1 ; unused +; $ff inhibits overwriting that tile - ; $ff inhibits overwriting that tile PikaAnimTilemap_1: PikaAnimTilemap_42: db 5, 5 diff --git a/data/sprite_anims/intro_frames.asm b/data/sprite_anims/intro_frames.asm new file mode 100644 index 000000000..bed2aa6f1 --- /dev/null +++ b/data/sprite_anims/intro_frames.asm @@ -0,0 +1,70 @@ +YellowIntro_AnimatedObjectFramesData: + dw Unkn_fa100 + dw Unkn_fa103 + dw Unkn_fa10a + dw Unkn_fa111 + dw Unkn_fa118 + dw Unkn_fa11b + dw Unkn_fa11e + dw Unkn_fa121 + dw Unkn_fa124 + dw Unkn_fa127 + dw Unkn_fa138 + +Unkn_fa100: + frame $00, 32 + endanim + +Unkn_fa103: + frame $01, 4 + frame $02, 4 + frame $03, 4 + dorestart + +Unkn_fa10a: + frame $04, 4 + frame $05, 4 + frame $06, 4 + dorestart + +Unkn_fa111: + frame $07, 4 + frame $08, 4 + frame $09, 4 + dorestart + +Unkn_fa118: + frame $0a, 32 + endanim + +Unkn_fa11b: + frame $0b, 32 + endanim + +Unkn_fa11e: + frame $0c, 32 + endanim + +Unkn_fa121: + frame $0d, 32 + endanim + +Unkn_fa124: + frame $0e, 32 + endanim + +Unkn_fa127: + frame $0f, 31 + frame $11, 2 + frame $0f, 2 + frame $11, 2 + frame $0f, 31 + frame $11, 2 + frame $0f, 23 + frame $10, 32 + endanim + +Unkn_fa138: + frame $12, 4 + frame $13, 4 + dorestart diff --git a/data/animated_objects_3e_2.asm b/data/sprite_anims/intro_oam.asm old mode 100755 new mode 100644 similarity index 80% rename from data/animated_objects_3e_2.asm rename to data/sprite_anims/intro_oam.asm index 4e9f5b3c3..f966d0822 --- a/data/animated_objects_3e_2.asm +++ b/data/sprite_anims/intro_oam.asm @@ -1,74 +1,3 @@ -YellowIntro_AnimatedObjectFramesData: - dw Unkn_fa100 - dw Unkn_fa103 - dw Unkn_fa10a - dw Unkn_fa111 - dw Unkn_fa118 - dw Unkn_fa11b - dw Unkn_fa11e - dw Unkn_fa121 - dw Unkn_fa124 - dw Unkn_fa127 - dw Unkn_fa138 - -Unkn_fa100: - frame $00, 32 - endanim - -Unkn_fa103: - frame $01, 4 - frame $02, 4 - frame $03, 4 - dorestart - -Unkn_fa10a: - frame $04, 4 - frame $05, 4 - frame $06, 4 - dorestart - -Unkn_fa111: - frame $07, 4 - frame $08, 4 - frame $09, 4 - dorestart - -Unkn_fa118: - frame $0a, 32 - endanim - -Unkn_fa11b: - frame $0b, 32 - endanim - -Unkn_fa11e: - frame $0c, 32 - endanim - -Unkn_fa121: - frame $0d, 32 - endanim - -Unkn_fa124: - frame $0e, 32 - endanim - -Unkn_fa127: - frame $0f, 31 - frame $11, 2 - frame $0f, 2 - frame $11, 2 - frame $0f, 31 - frame $11, 2 - frame $0f, 23 - frame $10, 32 - endanim - -Unkn_fa138: - frame $12, 4 - frame $13, 4 - dorestart - YellowIntro_AnimatedObjectOAMData: dbw $00, Unkn_fa179 dbw $96, Unkn_fa17e diff --git a/data/sprite_anims/surfing_pikachu_frames.asm b/data/sprite_anims/surfing_pikachu_frames.asm new file mode 100755 index 000000000..cf3463a3a --- /dev/null +++ b/data/sprite_anims/surfing_pikachu_frames.asm @@ -0,0 +1,200 @@ +SurfingPikachuFrames: + dw Unkn_f943d ; 00 + dw Unkn_f9440 ; 01 + dw Unkn_f9445 ; 02 + dw Unkn_f944a ; 03 + dw Unkn_f944f ; 04 + dw Unkn_f9454 ; 05 + dw Unkn_f9459 ; 06 + dw Unkn_f945e ; 07 + dw Unkn_f9463 ; 08 + dw Unkn_f9468 ; 09 + dw Unkn_f946d ; 0a + dw Unkn_f9472 ; 0b + dw Unkn_f9477 ; 0c + dw Unkn_f947c ; 0d + dw Unkn_f9481 ; 0e + dw Unkn_f9486 ; 0f + dw Unkn_f948b ; 10 + dw Unkn_f9494 ; 11 + dw Unkn_f9499 ; 12 + dw Unkn_f949e ; 13 + dw Unkn_f94fb ; 14 + dw Unkn_f94a1 ; 15 + dw Unkn_f94b0 ; 16 + dw Unkn_f94bf ; 17 + dw Unkn_f94ce ; 18 + dw Unkn_f94dd ; 19 + dw Unkn_f94ec ; 1a + dw Unkn_f94fe ; 1b + +Unkn_f943d: + frame $00, 32 + endanim + +Unkn_f9440: + frame $01, 8 + frame $02, 8 + dorestart + +Unkn_f9445: + frame $03, 8 + frame $04, 8 + dorestart + +Unkn_f944a: + frame $05, 8 + frame $06, 8 + dorestart + +Unkn_f944f: + frame $07, 8 + frame $08, 8 + dorestart + +Unkn_f9454: + frame $09, 8 + frame $0a, 8 + dorestart + +Unkn_f9459: + frame $0b, 8 + frame $0c, 8 + dorestart + +Unkn_f945e: + frame $0d, 8 + frame $0e, 8 + dorestart + +Unkn_f9463: + frame $01, 8, OAM_HFLIP, OAM_VFLIP + frame $02, 8, OAM_HFLIP, OAM_VFLIP + dorestart + +Unkn_f9468: + frame $03, 8, OAM_HFLIP, OAM_VFLIP + frame $04, 8, OAM_HFLIP, OAM_VFLIP + dorestart + +Unkn_f946d: + frame $05, 8, OAM_HFLIP, OAM_VFLIP + frame $06, 8, OAM_HFLIP, OAM_VFLIP + dorestart + +Unkn_f9472: + frame $07, 8, OAM_HFLIP, OAM_VFLIP + frame $08, 8, OAM_HFLIP, OAM_VFLIP + dorestart + +Unkn_f9477: + frame $09, 8, OAM_HFLIP, OAM_VFLIP + frame $0a, 8, OAM_HFLIP, OAM_VFLIP + dorestart + +Unkn_f947c: + frame $0b, 8, OAM_HFLIP, OAM_VFLIP + frame $0c, 8, OAM_HFLIP, OAM_VFLIP + dorestart + +Unkn_f9481: + frame $0d, 8, OAM_HFLIP, OAM_VFLIP + frame $0e, 8, OAM_HFLIP, OAM_VFLIP + dorestart + +Unkn_f9486: + frame $11, 7 + frame $12, 7 + dorestart + +Unkn_f948b: + frame $13, 2 + frame $14, 2 + dorepeat 8 + frame $15, 2 + endanim + +Unkn_f9494: + frame $16, 32 + frame $16, 32 + delanim + +Unkn_f9499: + frame $17, 32 + frame $17, 32 + delanim + +Unkn_f949e: + frame $18, 32 + endanim + +Unkn_f94a1: + frame $1a, 4 + dorepeat 1 + frame $1a, 3 + dorepeat 1 + frame $1a, 2 + dorepeat 1 + frame $1a, 1 + delanim + +Unkn_f94b0: + frame $1b, 4 + dorepeat 1 + frame $1b, 3 + dorepeat 1 + frame $1b, 2 + dorepeat 1 + frame $1b, 1 + delanim + +Unkn_f94bf: + frame $1c, 4 + dorepeat 1 + frame $1c, 3 + dorepeat 1 + frame $1c, 2 + dorepeat 1 + frame $1c, 1 + delanim + +Unkn_f94ce: + frame $1d, 4 + dorepeat 1 + frame $1d, 3 + dorepeat 1 + frame $1d, 2 + dorepeat 1 + frame $1d, 1 + delanim + +Unkn_f94dd: + frame $1e, 4 + dorepeat 1 + frame $1e, 3 + dorepeat 1 + frame $1e, 2 + dorepeat 1 + frame $1e, 1 + delanim + +Unkn_f94ec: + frame $1f, 4 + dorepeat 1 + frame $1f, 3 + dorepeat 1 + frame $1f, 2 + dorepeat 1 + frame $1f, 1 + delanim + +Unkn_f94fb: + frame $19, 1 + delanim + +Unkn_f94fe: + frame $20, 7 + frame $21, 7 + frame $22, 7 + frame $23, 7 + dorestart diff --git a/data/animated_objects_3e_1.asm b/data/sprite_anims/surfing_pikachu_oam.asm old mode 100755 new mode 100644 similarity index 52% rename from data/animated_objects_3e_1.asm rename to data/sprite_anims/surfing_pikachu_oam.asm index 07b17ce57..d3aa441f2 --- a/data/animated_objects_3e_1.asm +++ b/data/sprite_anims/surfing_pikachu_oam.asm @@ -1,204 +1,3 @@ -SurfingPikachuFrames: - dw Unkn_f943d ; 00 - dw Unkn_f9440 ; 01 - dw Unkn_f9445 ; 02 - dw Unkn_f944a ; 03 - dw Unkn_f944f ; 04 - dw Unkn_f9454 ; 05 - dw Unkn_f9459 ; 06 - dw Unkn_f945e ; 07 - dw Unkn_f9463 ; 08 - dw Unkn_f9468 ; 09 - dw Unkn_f946d ; 0a - dw Unkn_f9472 ; 0b - dw Unkn_f9477 ; 0c - dw Unkn_f947c ; 0d - dw Unkn_f9481 ; 0e - dw Unkn_f9486 ; 0f - dw Unkn_f948b ; 10 - dw Unkn_f9494 ; 11 - dw Unkn_f9499 ; 12 - dw Unkn_f949e ; 13 - dw Unkn_f94fb ; 14 - dw Unkn_f94a1 ; 15 - dw Unkn_f94b0 ; 16 - dw Unkn_f94bf ; 17 - dw Unkn_f94ce ; 18 - dw Unkn_f94dd ; 19 - dw Unkn_f94ec ; 1a - dw Unkn_f94fe ; 1b - -Unkn_f943d: - frame $00, 32 - endanim - -Unkn_f9440: - frame $01, 8 - frame $02, 8 - dorestart - -Unkn_f9445: - frame $03, 8 - frame $04, 8 - dorestart - -Unkn_f944a: - frame $05, 8 - frame $06, 8 - dorestart - -Unkn_f944f: - frame $07, 8 - frame $08, 8 - dorestart - -Unkn_f9454: - frame $09, 8 - frame $0a, 8 - dorestart - -Unkn_f9459: - frame $0b, 8 - frame $0c, 8 - dorestart - -Unkn_f945e: - frame $0d, 8 - frame $0e, 8 - dorestart - -Unkn_f9463: - frame $01, 8, OAM_HFLIP, OAM_VFLIP - frame $02, 8, OAM_HFLIP, OAM_VFLIP - dorestart - -Unkn_f9468: - frame $03, 8, OAM_HFLIP, OAM_VFLIP - frame $04, 8, OAM_HFLIP, OAM_VFLIP - dorestart - -Unkn_f946d: - frame $05, 8, OAM_HFLIP, OAM_VFLIP - frame $06, 8, OAM_HFLIP, OAM_VFLIP - dorestart - -Unkn_f9472: - frame $07, 8, OAM_HFLIP, OAM_VFLIP - frame $08, 8, OAM_HFLIP, OAM_VFLIP - dorestart - -Unkn_f9477: - frame $09, 8, OAM_HFLIP, OAM_VFLIP - frame $0a, 8, OAM_HFLIP, OAM_VFLIP - dorestart - -Unkn_f947c: - frame $0b, 8, OAM_HFLIP, OAM_VFLIP - frame $0c, 8, OAM_HFLIP, OAM_VFLIP - dorestart - -Unkn_f9481: - frame $0d, 8, OAM_HFLIP, OAM_VFLIP - frame $0e, 8, OAM_HFLIP, OAM_VFLIP - dorestart - -Unkn_f9486: - frame $11, 7 - frame $12, 7 - dorestart - -Unkn_f948b: - frame $13, 2 - frame $14, 2 - dorepeat 8 - frame $15, 2 - endanim - -Unkn_f9494: - frame $16, 32 - frame $16, 32 - delanim - -Unkn_f9499: - frame $17, 32 - frame $17, 32 - delanim - -Unkn_f949e: - frame $18, 32 - endanim - -Unkn_f94a1: - frame $1a, 4 - dorepeat 1 - frame $1a, 3 - dorepeat 1 - frame $1a, 2 - dorepeat 1 - frame $1a, 1 - delanim - -Unkn_f94b0: - frame $1b, 4 - dorepeat 1 - frame $1b, 3 - dorepeat 1 - frame $1b, 2 - dorepeat 1 - frame $1b, 1 - delanim - -Unkn_f94bf: - frame $1c, 4 - dorepeat 1 - frame $1c, 3 - dorepeat 1 - frame $1c, 2 - dorepeat 1 - frame $1c, 1 - delanim - -Unkn_f94ce: - frame $1d, 4 - dorepeat 1 - frame $1d, 3 - dorepeat 1 - frame $1d, 2 - dorepeat 1 - frame $1d, 1 - delanim - -Unkn_f94dd: - frame $1e, 4 - dorepeat 1 - frame $1e, 3 - dorepeat 1 - frame $1e, 2 - dorepeat 1 - frame $1e, 1 - delanim - -Unkn_f94ec: - frame $1f, 4 - dorepeat 1 - frame $1f, 3 - dorepeat 1 - frame $1f, 2 - dorepeat 1 - frame $1f, 1 - delanim - -Unkn_f94fb: - frame $19, 1 - delanim - -Unkn_f94fe: - frame $20, 7 - frame $21, 7 - frame $22, 7 - frame $23, 7 - dorestart - SurfingPikachuOAMData: dbw $00, .Frame0 dbw $00, .Frame1 diff --git a/data/sprites/facings.asm b/data/sprites/facings.asm index e87a96274..d3455d74d 100644 --- a/data/sprites/facings.asm +++ b/data/sprites/facings.asm @@ -1,4 +1,5 @@ SpriteFacingAndAnimationTable: +; This table is used for overworld sprites $1-$9. dw .StandingDown ; facing down, walk animation frame 0 dw .WalkingDown ; facing down, walk animation frame 1 dw .StandingDown ; facing down, walk animation frame 2 @@ -35,97 +36,91 @@ SpriteFacingAndAnimationTable: dw .StandingDown dw .StandingDown ; special case - dw SpriteSpecialCase ; pikachu maybe? + dw .SpecialCase ; pikachu maybe? + +; Tables used as a reference to transform OAM data. + +; Format: +; db y, x, attributes, tile index .StandingDown: - db $04 -; Sprite OAM Parameters - db $00, $00, $00, $00 ; top left - db $00, $08, $01, $00 ; top right - db $08, $00, $02, OAMFLAG_CANBEMASKED ; bottom left - db $08, $08, $03, OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA ; bottom right + db 4 ; # + db 0, 0, $00, 0 + db 0, 8, $01, 0 + db 8, 0, $02, OAMFLAG_CANBEMASKED + db 8, 8, $03, OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA .WalkingDown: - db $04 -; Sprite OAM Parameters - db $00, $00, $80, $00 ; top left - db $00, $08, $81, $00 ; top right - db $08, $00, $82, OAMFLAG_CANBEMASKED ; bottom left - db $08, $08, $83, OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA ; bottom right + db 4 ; # + db 0, 0, $80, 0 + db 0, 8, $81, 0 + db 8, 0, $82, OAMFLAG_CANBEMASKED + db 8, 8, $83, OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA .WalkingDown2: - db $04 -; Sprite OAM Parameters - db $00, $08, $80, OAM_HFLIP ; top left - db $00, $00, $81, OAM_HFLIP ; top right - db $08, $08, $82, OAM_HFLIP | OAMFLAG_CANBEMASKED ; bottom left - db $08, $00, $83, OAM_HFLIP | OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA ; bottom right + db 4 ; # + db 0, 8, $80, OAM_HFLIP + db 0, 0, $81, OAM_HFLIP + db 8, 8, $82, OAM_HFLIP | OAMFLAG_CANBEMASKED + db 8, 0, $83, OAM_HFLIP | OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA .StandingUp: - db $04 -; Sprite OAM Parameters - db $00, $00, $04, $00 ; top left - db $00, $08, $05, $00 ; top right - db $08, $00, $06, OAMFLAG_CANBEMASKED ; bottom left - db $08, $08, $07, OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA ; bottom right + db 4 ; # + db 0, 0, $04, 0 + db 0, 8, $05, 0 + db 8, 0, $06, OAMFLAG_CANBEMASKED + db 8, 8, $07, OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA .WalkingUp: - db $04 -; Sprite OAM Parameters - db $00, $00, $84, $00 ; top left - db $00, $08, $85, $00 ; top right - db $08, $00, $86, OAMFLAG_CANBEMASKED ; bottom left - db $08, $08, $87, OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA ; bottom right + db 4 ; # + db 0, 0, $84, 0 + db 0, 8, $85, 0 + db 8, 0, $86, OAMFLAG_CANBEMASKED + db 8, 8, $87, OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA .WalkingUp2: - db $04 -; Sprite OAM Parameters - db $00, $08, $84, OAM_HFLIP ; top left - db $00, $00, $85, OAM_HFLIP ; top right - db $08, $08, $86, OAM_HFLIP | OAMFLAG_CANBEMASKED ; bottom left - db $08, $00, $87, OAM_HFLIP | OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA ; bottom right + db 4 ; # + db 0, 8, $84, OAM_HFLIP + db 0, 0, $85, OAM_HFLIP + db 8, 8, $86, OAM_HFLIP | OAMFLAG_CANBEMASKED + db 8, 0, $87, OAM_HFLIP | OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA .StandingLeft: - db $04 -; Sprite OAM Parameters - db $00, $00, $08, $00 ; top left - db $00, $08, $09, $00 ; top right - db $08, $00, $0a, OAMFLAG_CANBEMASKED ; bottom left - db $08, $08, $0b, OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA ; bottom right + db 4 ; # + db 0, 0, $08, 0 + db 0, 8, $09, 0 + db 8, 0, $0a, OAMFLAG_CANBEMASKED + db 8, 8, $0b, OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA .WalkingLeft: - db $04 -; Sprite OAM Parameters - db $00, $00, $88, $00 ; top left - db $00, $08, $89, $00 ; top right - db $08, $00, $8a, OAMFLAG_CANBEMASKED ; bottom left - db $08, $08, $8b, OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA ; bottom right + db 4 ; # + db 0, 0, $88, 0 + db 0, 8, $89, 0 + db 8, 0, $8a, OAMFLAG_CANBEMASKED + db 8, 8, $8b, OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA .StandingRight: - db $04 -; Sprite OAM Parameters - db $00, $08, $08, OAM_HFLIP ; top left - db $00, $00, $09, OAM_HFLIP ; top right - db $08, $08, $0a, OAM_HFLIP | OAMFLAG_CANBEMASKED ; bottom left - db $08, $00, $0b, OAM_HFLIP | OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA ; bottom right + db 4 ; # + db 0, 8, $08, OAM_HFLIP + db 0, 0, $09, OAM_HFLIP + db 8, 8, $0a, OAM_HFLIP | OAMFLAG_CANBEMASKED + db 8, 0, $0b, OAM_HFLIP | OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA .WalkingRight: - db $04 -; Sprite OAM Parameters - db $00, $08, $88, OAM_HFLIP ; top left - db $00, $00, $89, OAM_HFLIP ; top right - db $08, $08, $8a, OAM_HFLIP | OAMFLAG_CANBEMASKED ; bottom left - db $08, $00, $8b, OAM_HFLIP | OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA ; bottom right + db 4 ; # + db 0, 8, $88, OAM_HFLIP + db 0, 0, $89, OAM_HFLIP + db 8, 8, $8a, OAM_HFLIP | OAMFLAG_CANBEMASKED + db 8, 0, $8b, OAM_HFLIP | OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA -SpriteSpecialCase: - db $09 -; Sprite OAM Parameters - db -$4, -$4, $00, $00 - db -$4, $04, $01, $00 - db -$4, $0c, $00, OAM_HFLIP - db $04, -$4, $01, $00 - db $04, $04, $02, $00 - db $04, $0c, $01, $00 - db $0c, -$4, $00, OAM_VFLIP | OAMFLAG_CANBEMASKED - db $0c, $04, $01, OAMFLAG_CANBEMASKED - db $0c, $0c, $00, OAM_VFLIP | OAM_HFLIP | OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA +.SpecialCase: + db 9 ; # + db -4, -4, $00, 0 + db -4, 4, $01, 0 + db -4, 12, $00, OAM_HFLIP + db 4, -4, $01, 0 + db 4, 4, $02, 0 + db 4, 12, $01, 0 + db 12, -4, $00, OAM_VFLIP | OAMFLAG_CANBEMASKED + db 12, 4, $01, OAMFLAG_CANBEMASKED + db 12, 12, $00, OAM_VFLIP | OAM_HFLIP | OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA diff --git a/data/sprites/sprites.asm b/data/sprites/sprites.asm index b7bee609f..217ad8642 100644 --- a/data/sprites/sprites.asm +++ b/data/sprites/sprites.asm @@ -36,7 +36,7 @@ SpriteSheetPointerTable: overworld_sprite MiddleAgedWomanSprite, 12 ; SPRITE_MIDDLE_AGED_WOMAN overworld_sprite BrunetteGirlSprite, 12 ; SPRITE_BRUNETTE_GIRL overworld_sprite LanceSprite, 12 ; SPRITE_LANCE - overworld_sprite RedSprite, 12 ; SPRITE_UNUSED_SCIENTIST + overworld_sprite RedSprite, 12 ; SPRITE_UNUSED_RED_1 overworld_sprite ScientistSprite, 12 ; SPRITE_SCIENTIST overworld_sprite RockerSprite, 12 ; SPRITE_ROCKER overworld_sprite SwimmerSprite, 12 ; SPRITE_SWIMMER @@ -55,11 +55,11 @@ SpriteSheetPointerTable: overworld_sprite FisherSprite, 12 ; SPRITE_FISHER overworld_sprite KogaSprite, 12 ; SPRITE_KOGA overworld_sprite GuardSprite, 12 ; SPRITE_GUARD - overworld_sprite RedSprite, 12 ; SPRITE_UNUSED_GUARD + overworld_sprite RedSprite, 12 ; SPRITE_UNUSED_RED_2 overworld_sprite MomSprite, 12 ; SPRITE_MOM overworld_sprite BaldingGuySprite, 12 ; SPRITE_BALDING_GUY overworld_sprite LittleBoySprite, 12 ; SPRITE_LITTLE_BOY - overworld_sprite RedSprite, 12 ; SPRITE_UNUSED_GAMEBOY_KID + overworld_sprite RedSprite, 12 ; SPRITE_UNUSED_RED_3 overworld_sprite GameboyKidSprite, 12 ; SPRITE_GAMEBOY_KID overworld_sprite FairySprite, 12 ; SPRITE_FAIRY overworld_sprite AgathaSprite, 12 ; SPRITE_AGATHA diff --git a/data/trainers/parties.asm b/data/trainers/parties.asm index af33a273c..766a17132 100755 --- a/data/trainers/parties.asm +++ b/data/trainers/parties.asm @@ -272,14 +272,6 @@ BikerData: db 33, WEEZING, 0 db 26, GRIMER, GRIMER, GRIMER, GRIMER, 0 ; Route 17 - ; From https://www.smogon.com/smog/issue27/glitch: - ; 0E:5FC2 is offset of the ending 0 for this first Biker on Route 17. - ; BaseStats + (MonBaseStatsEnd - MonBaseStats) * (000 - 1) = $5FC2; - ; that's the formula from GetMonHeader for the base stats of mon #000. - ; (BaseStats = $43DE and BANK(BaseStats) = $0E.) - ; Finally, PokedexOrder lists 0 as the dex ID for every MissingNo. - ; The result is that this data gets interpreted as the base stats - ; for MissingNo: 0, 33, MUK, 0, 29, VOLTORB, VOLTORB, 0, ..., 28, GRIMER, GRIMER. db 28, WEEZING, KOFFING, WEEZING, 0 db 33, MUK, 0 db 29, VOLTORB, VOLTORB, 0 @@ -600,12 +592,12 @@ RocketData: ; Silph Co. 11F db 25, RATTATA, RATTATA, ZUBAT, RATTATA, EKANS, 0 db 32, CUBONE, DROWZEE, MAROWAK, 0 -;JessieJamesData: +; Jessie & James db 14, EKANS, MEOWTH, KOFFING, 0 db 25, KOFFING, MEOWTH, EKANS, 0 db 27, MEOWTH, ARBOK, WEEZING, 0 db 31, WEEZING, ARBOK, MEOWTH, 0 -; unused JessieJames trainers +; Unused db 16, KOFFING, 0 db 27, KOFFING, 0 db 29, WEEZING, 0 diff --git a/data/trainers/special_moves.asm b/data/trainers/special_moves.asm index f858fa574..d9c6b8936 100755 --- a/data/trainers/special_moves.asm +++ b/data/trainers/special_moves.asm @@ -1,7 +1,7 @@ -; yellow has its own format. - -; entry = trainerclass, trainerid, moveset+, 0 -; moveset = partymon location, partymon's move, moveid +; Yellow entry format: +; db trainerclass, trainerid +; repeat { db partymon location, partymon move, move id } +; db 0 SpecialTrainerMoves: db BUG_CATCHER, 15 diff --git a/data/wild/super_rod.asm b/data/wild/super_rod.asm index 154980cc6..7b3b64078 100755 --- a/data/wild/super_rod.asm +++ b/data/wild/super_rod.asm @@ -1,4 +1,4 @@ -FishingSlots:: +SuperRodFishingSlots:: db PALLET_TOWN, STARYU, 10, TENTACOOL, 10, STARYU, 5, TENTACOOL, 20 db VIRIDIAN_CITY, POLIWAG, 5, POLIWAG, 10, POLIWAG, 15, POLIWAG, 10 db CERULEAN_CITY, GOLDEEN, 25, GOLDEEN, 30, SEAKING, 30, SEAKING, 40 diff --git a/docs/bugs_and_glitches.md b/docs/bugs_and_glitches.md index cb4cfc819..fa1050fd1 100644 --- a/docs/bugs_and_glitches.md +++ b/docs/bugs_and_glitches.md @@ -13,12 +13,13 @@ Fixes are written in the `diff` format. If you've used Git before, this should l ## Contents -- [Options Menu Code Fails to Clear Joypad State on Initialization](#options-menu-code-fails-to-clear-joypad-state-on-initialization) -- [Battle Transitions Fail to Account for Scripted Battles](#battle-transitions-fail-to-account-for-scripted-battles) -- [wPikachuFollowCommandBuffer can Overflow](#wpikachufollowcommandbuffer-can-overflow) -- [Unexpected Counter Damage](#unexpected-counter-damage) +- [Options menu code fails to clear joypad state on initialization](#options-menu-code-fails-to-clear-joypad-state-on-initialization) +- [Battle transitions fail to account for scripted battles](#battle-transitions-fail-to-account-for-scripted-battles) +- [`wPikachuFollowCommandBuffer` can overflow](#wpikachufollowcommandbuffer-can-overflow) +- [Unexpected Counter damage](#unexpected-counter-damage) -## Options Menu Code Fails to Clear Joypad State on Initialization + +## Options menu code fails to clear joypad state on initialization This bug (or feature!) results in all options being shifted left or right if the respective direction is pressed on the same frame the options menu is opened. The bug also exists in pokegold and pokecrystal. @@ -32,7 +33,8 @@ The bug also exists in pokegold and pokecrystal. call InitOptionsMenu ``` -## Battle Transitions Fail to Account for Scripted Battles + +## Battle transitions fail to account for scripted battles When Oak Catches Pikachu in the Pallet Town cutscenes you don't yet have any Pokemon in Party. The Battle Transitions code has no error handling for this and reads wPartyMon1HP from wRivalName+6. @@ -41,7 +43,8 @@ A similar series of bugs appears to exist in pokecrystal. **Fix:** TBD in [engine/battle/battle_transitions.asm#L93](/engine/battle/battle_transitions.asm#L93) -## wPikachuFollowCommandBuffer can Overflow + +## `wPikachuFollowCommandBuffer` can overflow AppendPikachuFollowCommandToBuffer doesn't have any length checking for the buffer of Pikachu commands. This can be abused to write data into any address past d437, typically by putting pikachu to sleep in the Pewter Center with Jigglypuff. @@ -49,9 +52,10 @@ While in this state, walking down writes 01, up 02, left 03, and right 04. This bug is generally known as "Pikawalk." A typical use for this would be to force the in game time to 255:59. -**Fix:** TBD in [engine/pikachu_follow.asm#1165](/engine/pikachu_follow.asm#1165) +**Fix:** TBD in [engine/pikachu/pikachu_follow.asm#1165](/engine/pikachu/pikachu_follow.asm#1165) + -## Unexpected Counter Damage +## Unexpected Counter damage Counter simply doubles the value of wDamage which can hold the last value of damage dealt whether it was from you, your opponent, a switched out opponent, or a player in another battle. This is because wDamage is used for both the player's damage and opponent's damage, and is not cleared out between switching or battles. diff --git a/engine/bank3c.asm b/engine/bank3c.asm deleted file mode 100644 index 8eb328371..000000000 --- a/engine/bank3c.asm +++ /dev/null @@ -1,189 +0,0 @@ -INCLUDE "engine/pikachu_pcm.asm" -INCLUDE "engine/overworld/advance_player_sprite.asm" - -INCLUDE "engine/events/black_out.asm" - -SetMapSpecificScriptFlagsOnMapReload:: - ld a, [wCurMap] - cp VERMILION_GYM ; ??? new thing about verm gym? - jr z, .verm_gym - ld c, a - ld hl, .MapList -.search_loop - ld a, [hli] - cp c - jr z, .in_list - cp a, $ff - jr nz, .search_loop - ret - -.verm_gym - ld hl, wCurrentMapScriptFlags - set 6, [hl] - ret - -.in_list - ld hl, wCurrentMapScriptFlags - set 5, [hl] - ret - -.MapList - db SILPH_CO_2F - db SILPH_CO_3F - db SILPH_CO_4F - db SILPH_CO_5F - db SILPH_CO_6F - db SILPH_CO_7F - db SILPH_CO_8F - db SILPH_CO_9F - db SILPH_CO_10F - db SILPH_CO_11F - db POKEMON_MANSION_2F - db POKEMON_MANSION_3F - db POKEMON_MANSION_B1F - db POKEMON_MANSION_1F - db CINNABAR_GYM - db GAME_CORNER - db ROCKET_HIDEOUT_B1F - db ROCKET_HIDEOUT_B4F - db VICTORY_ROAD_3F - db VICTORY_ROAD_1F - db VICTORY_ROAD_2F - db LANCES_ROOM - db LORELEIS_ROOM - db BRUNOS_ROOM - db AGATHAS_ROOM - db $ff - -BeachHouse_GFX: - INCBIN "gfx/tilesets/beachhouse.2bpp" - ds 384 - -BeachHouse_Block: - INCBIN "gfx/blocksets/beachhouse.bst" - -Func_f0a54: - ret - -LoadUnusedBluesHouseMissableObjectData:: -; referenced in an unused function - ld hl, .MissableObjectsMaps -.loop - ld a, [hli] - cp a, $ff - ret z - ld b, a - ld a, [wCurMap] - cp b - jr z, .found - inc hl - inc hl - inc hl - jr .loop - -.found - ld a, [hli] - ld c, a - ld b, 0 - ld a, [hli] - ld h, [hl] - ld l, a - ld de, wMissableObjectList - call CopyData - ret - -.MissableObjectsMaps: - dbbw BLUES_HOUSE, .End - .Start, .Start - db $ff - -.Start: - db 1, HS_DAISY_SITTING_COPY - db 2, HS_DAISY_WALKING_COPY - db 3, HS_TOWN_MAP_COPY - db $ff -.End: - -TryApplyPikachuMovementData: - ld a, [wd472] - bit 7, a - ret z - ld a, [wWalkBikeSurfState] - and a - ret nz - push hl - push bc - callfar GetPikachuFacingDirectionAndReturnToE - pop bc - pop hl - ld a, b - cp e - ret nz - push hl - ld a, [wUpdateSpritesEnabled] - push af - ld a, $ff - ld [wUpdateSpritesEnabled], a - callfar LoadPikachuShadowIntoVRAM - pop af - ld [wUpdateSpritesEnabled], a - pop hl - call ApplyPikachuMovementData - callfar RefreshPikachuFollow - ret - -Pic_f0abf: -INCBIN "gfx/pikachu/unknown_f0abf.pic" -GFX_f0b64: -INCBIN "gfx/pikachu/unknown_f0b64.2bpp" -Pic_f0cf4: -INCBIN "gfx/pikachu/unknown_f0cf4.pic" -GFX_f0d82: -INCBIN "gfx/pikachu/unknown_f0d82.2bpp" - -PokecenterChanseyText:: - ld hl, NurseChanseyText - call PrintText - ld a, CHANSEY - call PlayCry - call WaitForSoundToFinish - ret - -NurseChanseyText: - text_far _NurseChanseyText - text_end - -INCLUDE "engine/movie/credits.asm" -INCLUDE "scripts/ViridianCity2.asm" -INCLUDE "scripts/VermilionCity2.asm" -INCLUDE "scripts/CeladonCity2.asm" -INCLUDE "scripts/Route1_2.asm" -INCLUDE "scripts/Route22_2.asm" -INCLUDE "scripts/RedsHouse1F2.asm" -INCLUDE "scripts/OaksLab2.asm" -INCLUDE "scripts/ViridianSchoolHouse2.asm" -INCLUDE "scripts/Museum1F2.asm" -INCLUDE "scripts/PewterPokecenter2.asm" -INCLUDE "scripts/PokemonTower2F_2.asm" -INCLUDE "scripts/CeladonMart3F_2.asm" -INCLUDE "scripts/CeladonMansion1F_2.asm" -INCLUDE "scripts/CeladonMansion3F_2.asm" -INCLUDE "scripts/GameCorner2.asm" -INCLUDE "scripts/CeladonDiner2.asm" -INCLUDE "scripts/SafariZoneGate2.asm" -INCLUDE "scripts/CinnabarGym3.asm" -INCLUDE "scripts/MtMoonPokecenter2.asm" - -INCLUDE "data/maps/headers/BeachHouse.asm" -INCLUDE "scripts/BeachHouse.asm" -BeachHouse_Blocks: -INCBIN "maps/BeachHouse.blk" -INCLUDE "data/maps/objects/BeachHouse.asm" - -INCLUDE "scripts/BeachHouse2.asm" -INCLUDE "scripts/BillsHouse2.asm" -INCLUDE "scripts/ViridianForest2.asm" -INCLUDE "scripts/SSAnne2FRooms_2.asm" -INCLUDE "scripts/SilphCo11F_2.asm" - -INCLUDE "engine/overworld/hidden_objects.asm" -INCLUDE "engine/vermilion_gym_trash_cans.asm" diff --git a/engine/bank3d.asm b/engine/bank3d.asm deleted file mode 100644 index e929e44e0..000000000 --- a/engine/bank3d.asm +++ /dev/null @@ -1,491 +0,0 @@ -INCLUDE "engine/battle/common_text.asm" -INCLUDE "engine/battle/link_battle_versus_text.asm" -INCLUDE "engine/battle/unused_stats_functions.asm" -INCLUDE "engine/battle/scroll_draw_trainer_pic.asm" - -StarterPikachuBattleEntranceAnimation: - hlcoord 0, 5 - ld c, 0 -.loop1 - inc c - ld a, c - cp 9 - ret z - ld d, 7 * 13 - push bc - push hl -.loop2 - call .PlaceColumn - dec hl - ld a, d - sub 7 - ld d, a - dec c - jr nz, .loop2 - ld c, 2 - call DelayFrames - pop hl - pop bc - inc hl - jr .loop1 - -.PlaceColumn: - push hl - push de - push bc - ld e, 7 -.loop3 - ld a, d - cp 7 * 7 - jr nc, .okay - ld a, $7f -.okay - ld [hl], a - ld bc, SCREEN_WIDTH - add hl, bc - inc d - dec e - jr nz, .loop3 - pop bc - pop de - pop hl - ret - -INCLUDE "engine/battle/decrement_pp.asm" - -ModifyPikachuHappiness:: - ld a, d - cp PIKAHAPPY_GYMLEADER - jr z, .checkanywhereinparty - cp PIKAHAPPY_WALKING - jr z, .checkanywhereinparty - push de - callfar IsThisPartymonStarterPikachu_Party - pop de - ret nc - jr .proceed - -.checkanywhereinparty - push de - callfar IsStarterPikachuInOurParty - pop de - ret nc - -.proceed - push de - ; Divide [wPikachuHappiness] by 100. Hold the integer part in e. - ld e, $0 - ld a, [wPikachuHappiness] - cp 100 - jr c, .wPikachuHappiness_div_100 - inc e - cp 200 - jr c, .wPikachuHappiness_div_100 - inc e -.wPikachuHappiness_div_100 - ; Get the (d, e) entry from HappinessChangeTable. - ld c, d - dec c - ld b, $0 - ld hl, HappinessChangeTable - add hl, bc - add hl, bc - add hl, bc - ld d, $0 - add hl, de - ld a, [hl] - ; If [hl] is positive, take min(0xff, [hl] + [wPikachuHappiness]). - ; If [hl] is negative, take max(0x00, [hl] + [wPikachuHappiness]). - ; Inexplicably, we're using 100 as the threshold for comparison. - cp 100 - ld a, [wPikachuHappiness] - jr nc, .negative - add [hl] - jr nc, .okay - ld a, -1 - jr .okay - -.negative - add [hl] - jr c, .okay - xor a -.okay - ld [wPikachuHappiness], a - - ; Restore d and get the d'th entry in PikachuMoods. - pop de - dec d - ld hl, PikachuMoods - ld e, d - ld d, $0 - add hl, de - ld a, [hl] - ld b, a - ; Modify Pikachu's mood - cp $80 - jr z, .done - ld a, [wPikachuMood] - jr c, .decreased - cp b - jr nc, .done - ld a, [wd49c] - and a - jr nz, .done - jr .update_mood - -.decreased - cp b - jr c, .done -.update_mood - ld a, b - ld [wPikachuMood], a -.done - ret - -HappinessChangeTable: - ; Increase - db 5, 3, 2 ; Gained a level - db 5, 3, 2 ; HP restore - db 1, 1, 0 ; Used X item - db 3, 2, 1 ; Challenged Gym Leader - db 1, 1, 0 ; Teach TM/HM - db 2, 1, 1 ; Walking around - ; Decrease - db -3, -3, -5 ; Deposited - db -1, -1, -1 ; Fainted in battle - db -5, -5, -10 ; Fainted due to Poison outside of battle - db -5, -5, -10 ; Fainted to opponent at least 30 levels higher - db -10, -10, -20 ; Traded away - -PikachuMoods: - ; Increase - db $8a ; Gained a level - db $83 ; HP restore - db $80 ; Teach TM/HM - db $80 ; Challenged Gym Leader - db $94 ; Unknown (d = 5) - db $80 ; Unknown (d = 6) - ; Decrease - db $62 ; Deposited - db $6c ; Fainted - db $62 ; Unknown (d = 9) - db $6c ; Unknown (d = 10) - db $00 ; Unknown (d = 11) - -RedPicBack: INCBIN "gfx/player/redb.pic" -OldManPic: INCBIN "gfx/battle/oldman.pic" -ProfOakPicBack: INCBIN "gfx/battle/prof.oakb.pic" - -LoadYellowTitleScreenGFX: - ld hl, PokemonLogoGraphics - ld de, vChars2 - ld bc, 115 * $10 - ld a, BANK(PokemonLogoGraphics) ; redundant because this function is in bank3d - call FarCopyData - ld hl, YellowLogoGraphics + 35 * $10 - ld de, vChars0 + 253 * $10 - ld bc, 3 * $10 - ld a, BANK(YellowLogoGraphics) - call FarCopyData - ld hl, YellowLogoGraphics + 38 * $10 - ld de, vChars1 - ld bc, 64 * $10 - ld a, BANK(YellowLogoGraphics) - call FarCopyData - ld hl, YellowLogoGraphics + 102 * $10 - ld de, vChars0 + 240 * $10 - ld bc, 12 * $10 - ld a, BANK(YellowLogoGraphics) - call FarCopyData - ret - -TitleScreen_PlacePokemonLogo: - hlcoord 2, 1 - ld de, TitleScreenPokemonLogoTilemap - lb bc, 7, 16 - call Bank3D_CopyBox - ret - -TitleScreen_PlacePikaSpeechBubble: - hlcoord 6, 4 - ld de, TitleScreenPikaBubbleTilemap - lb bc, 4, 7 - call Bank3D_CopyBox - hlcoord 9, 8 - ld [hl], $64 - inc hl - ld [hl], $65 - ret - -TitleScreen_PlacePikachu: - hlcoord 4, 8 - ld de, TitleScreenPikachuTilemap - lb bc, 9, 12 - call Bank3D_CopyBox - hlcoord 16, 10 - ld [hl], $96 - hlcoord 16, 11 - ld [hl], $9d - hlcoord 16, 12 - ld [hl], $a7 - hlcoord 16, 13 - ld [hl], $b1 - ld hl, TitleScreenPikachuEyesOAMData - ld de, wOAMBuffer - ld bc, $20 - call CopyData - ret - -TitleScreenPikachuEyesOAMData: - db $60, $40, $f1, $22 - db $60, $48, $f0, $22 - db $68, $40, $f3, $22 - db $68, $48, $f2, $22 - db $60, $60, $f0, $02 - db $60, $68, $f1, $02 - db $68, $60, $f2, $02 - db $68, $68, $f3, $02 - -Bank3D_CopyBox: -; copy cxb (xy) screen area from de to hl -.row - push bc - push hl -.col - ld a, [de] - inc de - ld [hli], a - dec c - jr nz, .col - pop hl - ld bc, SCREEN_WIDTH - add hl, bc - pop bc - dec b - jr nz, .row - ret - -TitleScreenPokemonLogoTilemap: -; 16x7 (xy) - db $f4, $f4, $f4, $f4, $f4, $f4, $49, $f4, $72, $30, $f4, $f4, $f4, $f4, $f4, $f4 - db $fd, $01, $02, $03, $04, $05, $06, $07, $08, $09, $0a, $0b, $f4, $0d, $0e, $0f - db $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $1a, $1b, $1c, $1d, $1e, $1f - db $20, $21, $22, $23, $24, $25, $26, $27, $28, $29, $2a, $2b, $2c, $2d, $2e, $2f - db $f4, $31, $32, $33, $34, $35, $36, $37, $38, $39, $3a, $3b, $3c, $3d, $3e, $3f - db $f4, $41, $42, $43, $44, $45, $46, $47, $48, $f4, $4a, $4b, $4c, $4d, $4e, $4f - db $f4, $6a, $6b, $6c, $6d, $f4, $f4, $f4, $f4, $f4, $f4, $6e, $6f, $70, $71, $f4 - -Pointer_f4669: -; Unreferenced - db $47, $48, $49, $4a, $4b, $4c, $4d, $4e, $4f, $5f - -TitleScreenPikaBubbleTilemap: -; 7x4 (xy) - db $24, $25, $66, $67, $68, $69, $2a - db $50, $51, $52, $53, $54, $55, $56 - db $57, $58, $59, $5a, $5b, $5c, $5d - db $6d, $5e, $5f, $60, $61, $62, $63 - -TitleScreenPikachuTilemap: -; 12x9 (xy) - db $80, $81, $82, $83, $00, $00, $00, $00, $84, $85, $86, $87 - db $88, $89, $8a, $8b, $8c, $8d, $8d, $8e, $8f, $8a, $90, $91 - db $00, $92, $93, $8a, $8a, $8a, $8a, $8a, $8a, $94, $95, $00 - db $00, $00, $97, $8a, $8a, $98, $99, $8a, $8a, $9a, $9b, $9c - db $00, $00, $9e, $9f, $a0, $a1, $a2, $a3, $a4, $a5, $a6, $8a - db $00, $a8, $a9, $aa, $8a, $ab, $ac, $8a, $ad, $ae, $af, $b0 - db $00, $b2, $b3, $b4, $8a, $8a, $8a, $8a, $b5, $b6, $b7, $b8 - db $00, $b9, $ba, $8a, $8a, $8a, $8a, $8a, $8a, $bb, $bc, $00 - db $00, $00, $bd, $8a, $8a, $8a, $8a, $8a, $8a, $be, $bf, $00 - -PokemonLogoGraphics: INCBIN "gfx/title/pokemon_logo.2bpp" -PokemonLogoGraphicsEnd: -YellowLogoGraphics: INCBIN "gfx/yellow_titlescreen.2bpp" -YellowLogoGraphicsEnd: - -INCLUDE "engine/menus/link_menu.asm" - -HandleMenuInputDouble: - xor a - ld [wPartyMenuAnimMonEnabled], a - -HandleMenuInputPokemonSelectionDouble: - ldh a, [hDownArrowBlinkCount1] - push af - ldh a, [hDownArrowBlinkCount2] - push af ; save existing values on stack - xor a - ldh [hDownArrowBlinkCount1], a ; blinking down arrow timing value 1 - ld a, $06 - ldh [hDownArrowBlinkCount2], a ; blinking down arrow timing value 2 -.loop1 - xor a - ld [wAnimCounter], a ; counter for pokemon shaking animation - call .UpdateCursorTile - call JoypadLowSensitivity - ldh a, [hJoy5] - and a ; was a key pressed? - jr nz, .keyPressed - pop af - ldh [hDownArrowBlinkCount2], a - pop af - ldh [hDownArrowBlinkCount1], a ; restore previous values - xor a - ld [wMenuWrappingEnabled], a ; disable menu wrapping - ret -.keyPressed - xor a - ld [wCheckFor180DegreeTurn], a - ldh a, [hJoy5] - ld b, a - bit 6, a ; pressed Up key? - jr z, .checkIfDownPressed -.upPressed - ld a, [wCurrentMenuItem] ; selected menu item - and a ; already at the top of the menu? - jr z, .checkOtherKeys -.notAtTop - dec a - ld [wCurrentMenuItem], a ; move selected menu item up one space - jr .checkOtherKeys -.checkIfDownPressed - bit 7, a - jr z, .checkOtherKeys -.downPressed - ld a, [wCurrentMenuItem] - inc a - ld c, a - ld a, [wMaxMenuItem] - cp c - jr c, .checkOtherKeys - ld a, c - ld [wCurrentMenuItem], a -.checkOtherKeys - ld a, [wMenuWatchedKeys] - and b ; does the menu care about any of the pressed keys? - jp z, .loop1 -.checkIfAButtonOrBButtonPressed - ldh a, [hJoy5] - and A_BUTTON | B_BUTTON - jr z, .skipPlayingSound -.AButtonOrBButtonPressed - ld a, SFX_PRESS_AB - call PlaySound ; play sound -.skipPlayingSound - pop af - ldh [hDownArrowBlinkCount2], a - pop af - ldh [hDownArrowBlinkCount1], a ; restore previous values - ldh a, [hJoy5] - ret - -.UpdateCursorTile: - ld a, [wTopMenuItemY] - and a - jr z, .asm_f5ac0 - hlcoord 0, 0 - ld bc, SCREEN_WIDTH -.loop - add hl, bc - dec a - jr nz, .loop -.asm_f5ac0 - ld a, [wTopMenuItemX] - ld b, $0 - ld c, a - add hl, bc - push hl - ld a, [wLastMenuItem] - and a - jr z, .asm_f5ad5 - ld bc, $28 -.loop2 - add hl, bc - dec a - jr nz, .loop2 -.asm_f5ad5 - ld a, [hl] - cp "â–¶" - jr nz, .asm_f5ade - ld a, [wTileBehindCursor] - ld [hl], a -.asm_f5ade - pop hl - ld a, [wCurrentMenuItem] - and a - jr z, .asm_f5aec - ld bc, $28 -.loop3 - add hl, bc - dec a - jr nz, .loop3 -.asm_f5aec - ld a, [hl] - cp "â–¶" - jr z, .asm_f5af4 - ld [wTileBehindCursor], a -.asm_f5af4 - ld a, "â–¶" - ld [hl], a - ld a, l - ld [wMenuCursorLocation], a - ld a, h - ld [wMenuCursorLocation + 1], a - ld a, [wCurrentMenuItem] - ld [wLastMenuItem], a - ret - -INCLUDE "engine/overworld/field_move_messages.asm" - -INCLUDE "engine/items/inventory.asm" - -INCLUDE "gfx/trainer_card.asm" - -ReadSuperRodData: - ld a, [wCurMap] - ld c, a - ld hl, FishingSlots -.loop - ld a, [hli] - cp $ff - jr z, .notfound - cp c - jr z, .found - ld de, $8 - add hl, de - jr .loop -.found - call GenerateRandomFishingEncounter - ret -.notfound - ld de, $0 - ret - -GenerateRandomFishingEncounter: - call Random - cp $66 - jr c, .asm_f5ed6 - inc hl - inc hl - cp $b2 - jr c, .asm_f5ed6 - inc hl - inc hl - cp $e5 - jr c, .asm_f5ed6 - inc hl - inc hl -.asm_f5ed6 - ld e, [hl] - inc hl - ld d, [hl] - ret - -INCLUDE "data/wild/super_rod.asm" -INCLUDE "engine/battle/bank3d_battle.asm" -INCLUDE "engine/items/tm_prices.asm" -INCLUDE "engine/math/multiply_divide.asm" -INCLUDE "engine/events/give_pokemon.asm" -INCLUDE "engine/battle/get_trainer_name.asm" -INCLUDE "engine/math/random.asm" -INCLUDE "engine/predefs.asm" diff --git a/engine/bank3e.asm b/engine/bank3e.asm deleted file mode 100644 index 32f5ebfd2..000000000 --- a/engine/bank3e.asm +++ /dev/null @@ -1,5 +0,0 @@ -INCLUDE "engine/surfing_minigame.asm" -INCLUDE "engine/yellow_intro.asm" -INCLUDE "data/animated_objects_3e_2.asm" -YellowIntroGraphics: INCBIN "gfx/yellow_intro.2bpp" -INCLUDE "engine/animated_objects_3e.asm" diff --git a/engine/bank3f.asm b/engine/bank3f.asm deleted file mode 100644 index c26e98347..000000000 --- a/engine/bank3f.asm +++ /dev/null @@ -1,23 +0,0 @@ -INCLUDE "data/maps/songs.asm" -INCLUDE "data/maps/map_header_pointers.asm" -INCLUDE "data/maps/map_header_banks.asm" -INCLUDE "engine/pikachu_follow.asm" -INCLUDE "engine/pikachu_status.asm" -INCLUDE "engine/pikachu_emotions.asm" -INCLUDE "engine/pikachu_movement.asm" -INCLUDE "engine/pikachu_pic_animation.asm" - -Func_fe66e: - ret - -OfficerJennySprite: INCBIN "gfx/sprites/officer_jenny.2bpp" -PikachuSprite: INCBIN "gfx/sprites/pikachu.2bpp" -SandshrewSprite: INCBIN "gfx/sprites/sandshrew.2bpp" -OddishSprite: INCBIN "gfx/sprites/oddish.2bpp" -BulbasaurSprite: INCBIN "gfx/sprites/bulbasaur.2bpp" -JigglypuffSprite: INCBIN "gfx/sprites/jigglypuff.2bpp" -ClefairySprite: INCBIN "gfx/sprites/clefairy.2bpp" -ChanseySprite: INCBIN "gfx/sprites/chansey.2bpp" -SurfingPikachuSprite:: INCBIN "gfx/sprites/surfing_pikachu.2bpp" -JessieSprite: INCBIN "gfx/sprites/jessie.2bpp" -JamesSprite: INCBIN "gfx/sprites/james.2bpp" diff --git a/engine/battle/animations.asm b/engine/battle/animations.asm index 4508dbaad..3b0fd4ec9 100755 --- a/engine/battle/animations.asm +++ b/engine/battle/animations.asm @@ -579,16 +579,16 @@ Func_78e98: xor a ldh [hAutoBGTransferEnabled], a call ClearScreen - ld h, vBGMap0 / $100 + ld h, HIGH(vBGMap0) call WriteLowerByteOfBGMapAndEnableBGTransfer call Delay3 xor a ldh [hAutoBGTransferEnabled], a call LoadScreenTilesFromBuffer2 - ld h, vBGMap1 / $100 + ld h, HIGH(vBGMap1) WriteLowerByteOfBGMapAndEnableBGTransfer: - ld l, vBGMap0 & $ff + ld l, LOW(vBGMap0) call BattleAnimCopyTileMapToVRAM ld a, $1 ldh [hAutoBGTransferEnabled], a diff --git a/engine/battle/bank3d_battle.asm b/engine/battle/init_battle.asm similarity index 92% rename from engine/battle/bank3d_battle.asm rename to engine/battle/init_battle.asm index 48c3cde3e..d6ba51ed6 100644 --- a/engine/battle/bank3d_battle.asm +++ b/engine/battle/init_battle.asm @@ -280,13 +280,3 @@ CopyUncompressedPicToHL:: dec b jr nz, .asm_f6227 ret - -INCLUDE "engine/battle/init_battle_variables.asm" -INCLUDE "engine/battle/move_effects/focus_energy.asm" -INCLUDE "engine/battle/move_effects/heal.asm" -INCLUDE "engine/battle/move_effects/transform.asm" -INCLUDE "engine/battle/move_effects/reflect_light_screen.asm" -INCLUDE "engine/battle/move_effects/mist.asm" -INCLUDE "engine/battle/move_effects/one_hit_ko.asm" -INCLUDE "engine/battle/move_effects/pay_day.asm" -INCLUDE "engine/battle/move_effects/paralyze.asm" diff --git a/engine/battle/pikachu_entrance_anim.asm b/engine/battle/pikachu_entrance_anim.asm new file mode 100644 index 000000000..8af65ceee --- /dev/null +++ b/engine/battle/pikachu_entrance_anim.asm @@ -0,0 +1,47 @@ +StarterPikachuBattleEntranceAnimation: + hlcoord 0, 5 + ld c, 0 +.loop1 + inc c + ld a, c + cp 9 + ret z + ld d, 7 * 13 + push bc + push hl +.loop2 + call .PlaceColumn + dec hl + ld a, d + sub 7 + ld d, a + dec c + jr nz, .loop2 + ld c, 2 + call DelayFrames + pop hl + pop bc + inc hl + jr .loop1 + +.PlaceColumn: + push hl + push de + push bc + ld e, 7 +.loop3 + ld a, d + cp 7 * 7 + jr nc, .okay + ld a, $7f +.okay + ld [hl], a + ld bc, SCREEN_WIDTH + add hl, bc + inc d + dec e + jr nz, .loop3 + pop bc + pop de + pop hl + ret diff --git a/engine/diploma_3a.asm b/engine/events/diploma2.asm similarity index 96% rename from engine/diploma_3a.asm rename to engine/events/diploma2.asm index 83a7345be..75ac104a5 100755 --- a/engine/diploma_3a.asm +++ b/engine/events/diploma2.asm @@ -166,3 +166,6 @@ Func_e9beb: dec c jr nz, .asm_e9bed ret + +SurfingPikachu3Graphics: INCBIN "gfx/surfing_pikachu/surfing_pikachu_3.2bpp" +SurfingPikachu3GraphicsEnd: diff --git a/engine/vermilion_gym_trash_cans.asm b/engine/events/hidden_objects/vermilion_gym_trash2.asm old mode 100755 new mode 100644 similarity index 100% rename from engine/vermilion_gym_trash_cans.asm rename to engine/events/hidden_objects/vermilion_gym_trash2.asm diff --git a/engine/events/pikachu_happiness.asm b/engine/events/pikachu_happiness.asm new file mode 100644 index 000000000..0d79e32b2 --- /dev/null +++ b/engine/events/pikachu_happiness.asm @@ -0,0 +1,118 @@ +ModifyPikachuHappiness:: + ld a, d + cp PIKAHAPPY_GYMLEADER + jr z, .checkanywhereinparty + cp PIKAHAPPY_WALKING + jr z, .checkanywhereinparty + push de + callfar IsThisPartymonStarterPikachu_Party + pop de + ret nc + jr .proceed + +.checkanywhereinparty + push de + callfar IsStarterPikachuInOurParty + pop de + ret nc + +.proceed + push de + ; Divide [wPikachuHappiness] by 100. Hold the integer part in e. + ld e, $0 + ld a, [wPikachuHappiness] + cp 100 + jr c, .wPikachuHappiness_div_100 + inc e + cp 200 + jr c, .wPikachuHappiness_div_100 + inc e +.wPikachuHappiness_div_100 + ; Get the (d, e) entry from HappinessChangeTable. + ld c, d + dec c + ld b, $0 + ld hl, HappinessChangeTable + add hl, bc + add hl, bc + add hl, bc + ld d, $0 + add hl, de + ld a, [hl] + ; If [hl] is positive, take min(0xff, [hl] + [wPikachuHappiness]). + ; If [hl] is negative, take max(0x00, [hl] + [wPikachuHappiness]). + ; Inexplicably, we're using 100 as the threshold for comparison. + cp 100 + ld a, [wPikachuHappiness] + jr nc, .negative + add [hl] + jr nc, .okay + ld a, -1 + jr .okay + +.negative + add [hl] + jr c, .okay + xor a +.okay + ld [wPikachuHappiness], a + + ; Restore d and get the d'th entry in PikachuMoods. + pop de + dec d + ld hl, PikachuMoods + ld e, d + ld d, $0 + add hl, de + ld a, [hl] + ld b, a + ; Modify Pikachu's mood + cp $80 + jr z, .done + ld a, [wPikachuMood] + jr c, .decreased + cp b + jr nc, .done + ld a, [wd49c] + and a + jr nz, .done + jr .update_mood + +.decreased + cp b + jr c, .done +.update_mood + ld a, b + ld [wPikachuMood], a +.done + ret + +HappinessChangeTable: + ; Increase + db 5, 3, 2 ; Gained a level + db 5, 3, 2 ; HP restore + db 1, 1, 0 ; Used X item + db 3, 2, 1 ; Challenged Gym Leader + db 1, 1, 0 ; Teach TM/HM + db 2, 1, 1 ; Walking around + ; Decrease + db -3, -3, -5 ; Deposited + db -1, -1, -1 ; Fainted in battle + db -5, -5, -10 ; Fainted due to Poison outside of battle + db -5, -5, -10 ; Fainted to opponent at least 30 levels higher + db -10, -10, -20 ; Traded away + +PikachuMoods: + ; Increase + db $8a ; Gained a level + db $83 ; HP restore + db $80 ; Teach TM/HM + db $80 ; Challenged Gym Leader + db $94 ; Unknown (d = 5) + db $80 ; Unknown (d = 6) + ; Decrease + db $62 ; Deposited + db $6c ; Fainted + db $62 ; Unknown (d = 9) + db $6c ; Unknown (d = 10) + db $00 ; Unknown (d = 11) diff --git a/engine/events/pokecenter_chansey.asm b/engine/events/pokecenter_chansey.asm new file mode 100644 index 000000000..d7c3a95b4 --- /dev/null +++ b/engine/events/pokecenter_chansey.asm @@ -0,0 +1,11 @@ +PokecenterChanseyText:: + ld hl, NurseChanseyText + call PrintText + ld a, CHANSEY + call PlayCry + call WaitForSoundToFinish + ret + +NurseChanseyText: + text_far _NurseChanseyText + text_end diff --git a/engine/events/try_pikachu_movement.asm b/engine/events/try_pikachu_movement.asm new file mode 100644 index 000000000..70cf65b41 --- /dev/null +++ b/engine/events/try_pikachu_movement.asm @@ -0,0 +1,27 @@ +TryApplyPikachuMovementData:: + ld a, [wd472] + bit 7, a + ret z + ld a, [wWalkBikeSurfState] + and a + ret nz + push hl + push bc + callfar GetPikachuFacingDirectionAndReturnToE + pop bc + pop hl + ld a, b + cp e + ret nz + push hl + ld a, [wUpdateSpritesEnabled] + push af + ld a, $ff + ld [wUpdateSpritesEnabled], a + callfar LoadPikachuShadowIntoVRAM + pop af + ld [wUpdateSpritesEnabled], a + pop hl + call ApplyPikachuMovementData + callfar RefreshPikachuFollow + ret diff --git a/engine/animated_objects_3e.asm b/engine/gfx/animated_objects.asm similarity index 98% rename from engine/animated_objects_3e.asm rename to engine/gfx/animated_objects.asm index 2373e19ea..971af6b5b 100755 --- a/engine/animated_objects_3e.asm +++ b/engine/gfx/animated_objects.asm @@ -28,10 +28,10 @@ RunObjectAnimations: jr nz, .loop ld a, [wCurrentAnimatedObjectOAMBufferOffset] ld l, a - ld h, wOAMBuffer / $100 + ld h, HIGH(wOAMBuffer) .deinit_unused_oam_loop ld a, l - cp wOAMBufferEnd % $100 + cp LOW(wOAMBufferEnd) jr nc, .quit xor a ld [hli], a @@ -158,7 +158,7 @@ UpdateCurrentAnimatedObjectFrame: push bc ld a, [wCurrentAnimatedObjectOAMBufferOffset] ld e, a - ld d, wOAMBuffer / $100 + ld d, HIGH(wOAMBuffer) ld a, [hli] ld c, a .loop @@ -205,7 +205,7 @@ UpdateCurrentAnimatedObjectFrame: inc de ld a, e ld [wCurrentAnimatedObjectOAMBufferOffset], a - cp wOAMBufferEnd % $100 + cp LOW(wOAMBufferEnd) jr nc, .oam_is_full dec c jr nz, .loop diff --git a/engine/bg_map_attributes.asm b/engine/gfx/bg_map_attributes.asm similarity index 98% rename from engine/bg_map_attributes.asm rename to engine/gfx/bg_map_attributes.asm index 4c50bcf8d..6f81af638 100644 --- a/engine/bg_map_attributes.asm +++ b/engine/gfx/bg_map_attributes.asm @@ -1,4 +1,4 @@ -INCLUDE "data/bg_map_attributes.asm" +INCLUDE "data/cgb/bg_map_attributes.asm" LoadBGMapAttributes:: ld hl, BGMapAttributesPointers @@ -195,9 +195,9 @@ HandlePartyHPBarAttributes: push hl ld a, [de] and $3 ; 4 possible palettes - rept 7 ; hp bar length in tiles +REPT 7 ; hp bar length in tiles ld [hli], a - endr +ENDR pop hl ld bc, $40 ; get 2nd party location add hl, bc diff --git a/engine/gfx/palettes.asm b/engine/gfx/palettes.asm index dd723afa3..c08992d3f 100755 --- a/engine/gfx/palettes.asm +++ b/engine/gfx/palettes.asm @@ -752,7 +752,7 @@ index = 0 ld a, [hli] inc hl - IF index < (NUM_ACTIVE_PALS + -1) + IF index < NUM_ACTIVE_PALS - 1 push hl ENDC @@ -823,7 +823,7 @@ DMGPalToGBCPal:: ld [wLastOBP1], a .convert color_index = 0 - REPT NUM_COLORS + REPT NUM_PAL_COLORS ld b, a and %11 call .GetColorAddress @@ -832,7 +832,7 @@ color_index = 0 ld a, [hl] ld [wGBCPal + color_index * 2 + 1], a - IF color_index < (NUM_COLORS + -1) + IF color_index < NUM_PAL_COLORS - 1 ld a, b rrca rrca @@ -863,14 +863,14 @@ TransferCurBGPData:: ldh a, [rLCDC] and rLCDC_ENABLE_MASK jr nz, .lcdEnabled - rept NUM_COLORS - call TransferPalColorLCDDisabled - endr + REPT NUM_PAL_COLORS + call TransferPalColorLCDDisabled + ENDR jr .done .lcdEnabled - rept NUM_COLORS - call TransferPalColorLCDEnabled - endr + REPT NUM_PAL_COLORS + call TransferPalColorLCDEnabled + ENDR .done pop de ret @@ -887,7 +887,7 @@ BufferBGPPal:: ld de, wBGPPalsBuffer add hl, de ld de, wGBCPal - ld c, PAL_SIZE + ld c, PALETTE_SIZE .loop ld a, [de] ld [hli], a @@ -918,7 +918,7 @@ TransferBGPPals:: ldh [rBGPI], a ld de, rBGPD ld hl, wBGPPalsBuffer - ld c, 4 * PAL_SIZE + ld c, 4 * PALETTE_SIZE .loop ld a, [hli] ld [de], a @@ -939,14 +939,14 @@ TransferCurOBPData: ldh a, [rLCDC] and rLCDC_ENABLE_MASK jr nz, .lcdEnabled - rept NUM_COLORS - call TransferPalColorLCDDisabled - endr + REPT NUM_PAL_COLORS + call TransferPalColorLCDDisabled + ENDR jr .done .lcdEnabled - rept NUM_COLORS - call TransferPalColorLCDEnabled - endr + REPT NUM_PAL_COLORS + call TransferPalColorLCDEnabled + ENDR .done pop de ret diff --git a/engine/gfx/sprite_oam.asm b/engine/gfx/sprite_oam.asm index 01b2c4123..b62d9d4bf 100644 --- a/engine/gfx/sprite_oam.asm +++ b/engine/gfx/sprite_oam.asm @@ -153,7 +153,7 @@ PrepareOAMData:: cp c ret nc ld l, a - ld h, wOAMBuffer / $100 + ld h, HIGH(wOAMBuffer) ld a, c ld de, $4 ; entry size ld b, $a0 diff --git a/engine/items/item_effects.asm b/engine/items/item_effects.asm index b1b458abe..d4c3ae187 100755 --- a/engine/items/item_effects.asm +++ b/engine/items/item_effects.asm @@ -1037,7 +1037,7 @@ ItemUseMedicine: push hl push de push bc - callfar Func_2fd6a + callfar RespawnOverworldPikachu pop bc pop de pop hl @@ -1542,7 +1542,7 @@ ItemUseMedicine: push af ld a, [wUsedItemOnWhichPokemon] ld [wWhichPokemon], a - callfar Func_2fd6a ; evolve pokemon, if appropriate + callfar RespawnOverworldPikachu ; evolve pokemon, if appropriate pop af ld [wWhichPokemon], a diff --git a/engine/items/super_rod.asm b/engine/items/super_rod.asm new file mode 100644 index 000000000..db82f5fb8 --- /dev/null +++ b/engine/items/super_rod.asm @@ -0,0 +1,41 @@ +ReadSuperRodData: + ld a, [wCurMap] + ld c, a + ld hl, SuperRodFishingSlots +.loop + ld a, [hli] + cp $ff + jr z, .notfound + cp c + jr z, .found + ld de, $8 + add hl, de + jr .loop +.found + call GenerateRandomFishingEncounter + ret +.notfound + ld de, $0 + ret + +GenerateRandomFishingEncounter: + call Random + cp $66 + jr c, .asm_f5ed6 + inc hl + inc hl + cp $b2 + jr c, .asm_f5ed6 + inc hl + inc hl + cp $e5 + jr c, .asm_f5ed6 + inc hl + inc hl +.asm_f5ed6 + ld e, [hl] + inc hl + ld d, [hl] + ret + +INCLUDE "data/wild/super_rod.asm" diff --git a/engine/menus/draw_badges.asm b/engine/menus/draw_badges.asm index 0bb433ccb..5e00a34e9 100644 --- a/engine/menus/draw_badges.asm +++ b/engine/menus/draw_badges.asm @@ -49,8 +49,7 @@ DrawBadges: hlcoord 2, 14 ld de, wTempObtainedBadgesBooleans + 4 -; call .DrawBadgeRow -; ret + ; fallthrough .DrawBadgeRow ; Draw 4 badges. diff --git a/engine/menus/start_sub_menus.asm b/engine/menus/start_sub_menus.asm index 84583a690..b9751e1e7 100755 --- a/engine/menus/start_sub_menus.asm +++ b/engine/menus/start_sub_menus.asm @@ -324,10 +324,11 @@ StartMenu_Item:: call PrintText jr .exitMenu .notInCableClubRoom + ; store item bag pointer in wListPointer (for DisplayListMenuID) ld hl, wListPointer - ld [hl], wNumBagItems & $ff + ld [hl], LOW(wNumBagItems) inc hl - ld [hl], wNumBagItems / $100 ; store item bag pointer in wListPointer (for DisplayListMenuID) + ld [hl], HIGH(wNumBagItems) xor a ld [wPrintItemPrices], a ld a, ITEMLISTMENU diff --git a/engine/menus/unused_input.asm b/engine/menus/unused_input.asm new file mode 100644 index 000000000..ad5c36df1 --- /dev/null +++ b/engine/menus/unused_input.asm @@ -0,0 +1,129 @@ +HandleMenuInputDuplicate: ; unreferenced + xor a + ld [wPartyMenuAnimMonEnabled], a + +HandleMenuInputPokemonSelectionDuplicate: ; unreferenced + ldh a, [hDownArrowBlinkCount1] + push af + ldh a, [hDownArrowBlinkCount2] + push af ; save existing values on stack + xor a + ldh [hDownArrowBlinkCount1], a ; blinking down arrow timing value 1 + ld a, 6 + ldh [hDownArrowBlinkCount2], a ; blinking down arrow timing value 2 +.loop1 + xor a + ld [wAnimCounter], a ; counter for pokemon shaking animation + call PlaceMenuCursorDuplicate + call JoypadLowSensitivity + ldh a, [hJoy5] + and a ; was a key pressed? + jr nz, .keyPressed + pop af + ldh [hDownArrowBlinkCount2], a + pop af + ldh [hDownArrowBlinkCount1], a ; restore previous values + xor a + ld [wMenuWrappingEnabled], a ; disable menu wrapping + ret +.keyPressed + xor a + ld [wCheckFor180DegreeTurn], a + ldh a, [hJoy5] + ld b, a + bit 6, a ; pressed Up key? + jr z, .checkIfDownPressed +.upPressed + ld a, [wCurrentMenuItem] ; selected menu item + and a ; already at the top of the menu? + jr z, .checkOtherKeys +.notAtTop + dec a + ld [wCurrentMenuItem], a ; move selected menu item up one space + jr .checkOtherKeys +.checkIfDownPressed + bit 7, a + jr z, .checkOtherKeys +.downPressed + ld a, [wCurrentMenuItem] + inc a + ld c, a + ld a, [wMaxMenuItem] + cp c + jr c, .checkOtherKeys + ld a, c + ld [wCurrentMenuItem], a +.checkOtherKeys + ld a, [wMenuWatchedKeys] + and b ; does the menu care about any of the pressed keys? + jp z, .loop1 +.checkIfAButtonOrBButtonPressed + ldh a, [hJoy5] + and A_BUTTON | B_BUTTON + jr z, .skipPlayingSound +.AButtonOrBButtonPressed + ld a, SFX_PRESS_AB + call PlaySound ; play sound +.skipPlayingSound + pop af + ldh [hDownArrowBlinkCount2], a + pop af + ldh [hDownArrowBlinkCount1], a ; restore previous values + ldh a, [hJoy5] + ret + +PlaceMenuCursorDuplicate: + ld a, [wTopMenuItemY] + and a + jr z, .asm_f5ac0 + hlcoord 0, 0 + ld bc, SCREEN_WIDTH +.loop + add hl, bc + dec a + jr nz, .loop +.asm_f5ac0 + ld a, [wTopMenuItemX] + ld b, $0 + ld c, a + add hl, bc + push hl + ld a, [wLastMenuItem] + and a + jr z, .asm_f5ad5 + ld bc, $28 +.loop2 + add hl, bc + dec a + jr nz, .loop2 +.asm_f5ad5 + ld a, [hl] + cp "â–¶" + jr nz, .asm_f5ade + ld a, [wTileBehindCursor] + ld [hl], a +.asm_f5ade + pop hl + ld a, [wCurrentMenuItem] + and a + jr z, .asm_f5aec + ld bc, $28 +.loop3 + add hl, bc + dec a + jr nz, .loop3 +.asm_f5aec + ld a, [hl] + cp "â–¶" + jr z, .asm_f5af4 + ld [wTileBehindCursor], a +.asm_f5af4 + ld a, "â–¶" + ld [hl], a + ld a, l + ld [wMenuCursorLocation], a + ld a, h + ld [wMenuCursorLocation + 1], a + ld a, [wCurrentMenuItem] + ld [wLastMenuItem], a + ret diff --git a/engine/surfing_minigame.asm b/engine/minigame/surfing_pikachu.asm similarity index 97% rename from engine/surfing_minigame.asm rename to engine/minigame/surfing_pikachu.asm index 578e6b1ed..6d319867b 100755 --- a/engine/surfing_minigame.asm +++ b/engine/minigame/surfing_pikachu.asm @@ -1,4 +1,4 @@ -SurfingPikachuMinigame: +SurfingPikachuMinigame:: call SurfingPikachuMinigame_BlankPals call DelayFrame call DelayFrame @@ -190,33 +190,33 @@ SurfingPikachuMinigame_LoadGFXAndLayout: ld a, BANK(SurfingPikachu1Graphics2) call FarCopyData - ld a, SurfingPikachuSpawnStateDataPointer % $100 + ld a, LOW(SurfingPikachuSpawnStateDataPointer) ld [wAnimatedObjectSpawnStateDataPointer], a - ld a, SurfingPikachuSpawnStateDataPointer / $100 + ld a, HIGH(SurfingPikachuSpawnStateDataPointer) ld [wAnimatedObjectSpawnStateDataPointer + 1], a - ld a, SurfingPikachuObjectJumptable % $100 + ld a, LOW(SurfingPikachuObjectJumptable) ld [wAnimatedObjectJumptablePointer], a - ld a, SurfingPikachuObjectJumptable / $100 + ld a, HIGH(SurfingPikachuObjectJumptable) ld [wAnimatedObjectJumptablePointer + 1], a - ld a, SurfingPikachuOAMData % $100 + ld a, LOW(SurfingPikachuOAMData) ld [wAnimatedObjectOAMDataPointer], a - ld a, SurfingPikachuOAMData / $100 + ld a, HIGH(SurfingPikachuOAMData) ld [wAnimatedObjectOAMDataPointer + 1], a - ld a, SurfingPikachuFrames % $100 + ld a, LOW(SurfingPikachuFrames) ld [wAnimatedObjectFramesDataPointer], a - ld a, SurfingPikachuFrames / $100 + ld a, HIGH(SurfingPikachuFrames) ld [wAnimatedObjectFramesDataPointer + 1], a ld hl, vBGMap0 - ld bc, $800 + ld bc, $80 tiles ld a, $0 call FillMemory ld hl, $98c0 - ld bc, $180 + ld bc, $18 tiles ld a, $b call FillMemory @@ -1470,7 +1470,7 @@ SurfingMinigame_DrawResultsScreen: ret .BeachTilemap: -INCBIN "gfx/unknown_f8946.map" +INCBIN "gfx/surfing_pikachu/unknown_f8946.map" .BeachTilemapEnd: .PlaceTextbox: @@ -2337,21 +2337,21 @@ SurfingPikachuMinigameIntro: ld bc, $900 ld a, BANK(SurfingPikachu1Graphics3) call FarCopyData - ld a, SurfingPikachuSpawnStateDataPointer % $100 + ld a, LOW(SurfingPikachuSpawnStateDataPointer) ld [wAnimatedObjectSpawnStateDataPointer], a - ld a, SurfingPikachuSpawnStateDataPointer / $100 + ld a, HIGH(SurfingPikachuSpawnStateDataPointer) ld [wAnimatedObjectSpawnStateDataPointer + 1], a - ld a, SurfingPikachuObjectJumptable % $100 + ld a, LOW(SurfingPikachuObjectJumptable) ld [wAnimatedObjectJumptablePointer], a - ld a, SurfingPikachuObjectJumptable / $100 + ld a, HIGH(SurfingPikachuObjectJumptable) ld [wAnimatedObjectJumptablePointer + 1], a - ld a, SurfingPikachuOAMData % $100 + ld a, LOW(SurfingPikachuOAMData) ld [wAnimatedObjectOAMDataPointer], a - ld a, SurfingPikachuOAMData / $100 + ld a, HIGH(SurfingPikachuOAMData) ld [wAnimatedObjectOAMDataPointer + 1], a - ld a, SurfingPikachuFrames % $100 + ld a, LOW(SurfingPikachuFrames) ld [wAnimatedObjectFramesDataPointer], a - ld a, SurfingPikachuFrames / $100 + ld a, HIGH(SurfingPikachuFrames) ld [wAnimatedObjectFramesDataPointer + 1], a ld a, $c lb de, $74, $58 @@ -2455,10 +2455,10 @@ DrawSurfingPikachuMinigameIntroBackground: jr nz, .fill_row ret -Tilemap_f90bc: INCBIN "gfx/unknown_f90bc.map" -Tilemap_f91ac: INCBIN "gfx/unknown_f91ac.map" -Tilemap_f91bb: INCBIN "gfx/unknown_f91bb.map" -Tilemap_f91c8: INCBIN "gfx/unknown_f91c8.map" +Tilemap_f90bc: INCBIN "gfx/surfing_pikachu/unknown_f90bc.map" +Tilemap_f91ac: INCBIN "gfx/surfing_pikachu/unknown_f91ac.map" +Tilemap_f91bb: INCBIN "gfx/surfing_pikachu/unknown_f91bb.map" +Tilemap_f91c8: INCBIN "gfx/surfing_pikachu/unknown_f91c8.map" SurfingMinigame_UpdateLYOverrides: ld hl, wLYOverrides + $10 @@ -2767,7 +2767,8 @@ SurfingPikachuObjectJumptable: SurfingMinigameAnimatedObjectFn_nop: ret -INCLUDE "data/animated_objects_3e_1.asm" +INCLUDE "data/sprite_anims/surfing_pikachu_frames.asm" +INCLUDE "data/sprite_anims/surfing_pikachu_oam.asm" SurfingMinigame_LYOverridesInitialSineWave: ; a sine wave with amplitude 2 diff --git a/engine/yellow_intro.asm b/engine/movie/intro_yellow.asm similarity index 94% rename from engine/yellow_intro.asm rename to engine/movie/intro_yellow.asm index 324ba86db..673d207cb 100755 --- a/engine/yellow_intro.asm +++ b/engine/movie/intro_yellow.asm @@ -323,7 +323,7 @@ YellowIntroScene6: call YellowIntro_BlankPalsDelay2AndDisableLCD ld c, $5 call UpdateMusicCTimes - ld a, rSCY - $ff00 + ld a, LOW(rSCY) ldh [hLCDCPointer], a call YellowIntro_Copy8BitSineWave ld hl, vBGMap0 @@ -456,9 +456,9 @@ YellowIntroScene10: jr nz, .fill_row ret -Unkn_f9b6e: INCBIN "gfx/unknown_f9b6e.map" -Unkn_f9be6: INCBIN "gfx/unknown_f9be6.map" -Unkn_f9bf2: INCBIN "gfx/unknown_f9bf2.map" +Unkn_f9b6e: INCBIN "gfx/intro/unknown_f9b6e.map" +Unkn_f9be6: INCBIN "gfx/intro/unknown_f9be6.map" +Unkn_f9bf2: INCBIN "gfx/intro/unknown_f9bf2.map" YellowIntroScene11: call YellowIntro_CheckFrameTimerDecrement @@ -473,7 +473,7 @@ YellowIntroScene11: sla a ld e, a ld d, $0 - ld hl, YellowIntroCloudGFX1 + ld hl, YellowIntroCloudGFX add hl, de ld a, l ldh [hVBlankCopySource], a @@ -492,8 +492,7 @@ YellowIntroScene11: call YellowIntro_NextScene ret -YellowIntroCloudGFX1: INCBIN "gfx/unknown_f9c2c.2bpp" -YellowIntroCloudGFX2: INCBIN "gfx/unknown_f9c6c.2bpp" ; indirectly referenced +YellowIntroCloudGFX: INCBIN "gfx/intro/clouds.2bpp" YellowIntroScene12: call YellowIntro_BlankPalsDelay2AndDisableLCD @@ -799,11 +798,11 @@ YellowIntro_Copy8BitSineWave: Request7TileTransferFromC810ToC710: ld a, $10 ldh [hVBlankCopySource], a - ld a, wLYOverridesBuffer / $100 + ld a, HIGH(wLYOverridesBuffer) ldh [hVBlankCopySource + 1], a ld a, $10 ldh [hVBlankCopyDest], a - ld a, wLYOverrides / $100 + ld a, HIGH(wLYOverrides) ldh [hVBlankCopyDest + 1], a ld a, $7 ldh [hVBlankCopySize], a @@ -833,13 +832,13 @@ InitYellowIntroGFXAndMusic: call DelayFrame xor a ldh [hAutoBGTransferEnabled], a - ld de, $6b5a - ld hl, $8000 - ld bc, $3eff + ld de, YellowIntroGraphics2 + ld hl, vChars0 + lb bc, BANK(YellowIntroGraphics2), (YellowIntroGraphics2End - YellowIntroGraphics2 - $10) / $10 call CopyVideoData - ld de, $635a - ld hl, $9000 - ld bc, $3e80 + ld de, YellowIntroGraphics1 + ld hl, vChars2 + lb bc, BANK(YellowIntroGraphics1), (YellowIntroGraphics1End - YellowIntroGraphics1) / $10 call CopyVideoData call ClearObjectAnimationBuffers call LoadYellowIntroObjectAnimationDataPointers @@ -857,21 +856,21 @@ InitYellowIntroGFXAndMusic: ret LoadYellowIntroObjectAnimationDataPointers: - ld a, YellowIntro_AnimatedObjectSpawnStateData % $100 + ld a, LOW(YellowIntro_AnimatedObjectSpawnStateData) ld [wAnimatedObjectSpawnStateDataPointer], a - ld a, YellowIntro_AnimatedObjectSpawnStateData / $100 + ld a, HIGH(YellowIntro_AnimatedObjectSpawnStateData) ld [wAnimatedObjectSpawnStateDataPointer + 1], a - ld a, YellowIntro_AnimatedObjectJumptable % $100 + ld a, LOW(YellowIntro_AnimatedObjectJumptable) ld [wAnimatedObjectJumptablePointer], a - ld a, YellowIntro_AnimatedObjectJumptable / $100 + ld a, HIGH(YellowIntro_AnimatedObjectJumptable) ld [wAnimatedObjectJumptablePointer + 1], a - ld a, YellowIntro_AnimatedObjectOAMData % $100 + ld a, LOW(YellowIntro_AnimatedObjectOAMData) ld [wAnimatedObjectOAMDataPointer], a - ld a, YellowIntro_AnimatedObjectOAMData / $100 + ld a, HIGH(YellowIntro_AnimatedObjectOAMData) ld [wAnimatedObjectOAMDataPointer + 1], a - ld a, YellowIntro_AnimatedObjectFramesData % $100 + ld a, LOW(YellowIntro_AnimatedObjectFramesData) ld [wAnimatedObjectFramesDataPointer], a - ld a, YellowIntro_AnimatedObjectFramesData / $100 + ld a, HIGH(YellowIntro_AnimatedObjectFramesData) ld [wAnimatedObjectFramesDataPointer + 1], a ret @@ -1079,3 +1078,8 @@ Func_fa08e: Unkn_fa0aa: sine_wave $100 + +INCLUDE "data/sprite_anims/intro_frames.asm" +INCLUDE "data/sprite_anims/intro_oam.asm" + +INCLUDE "gfx/yellow_intro.asm" diff --git a/engine/movie/title.asm b/engine/movie/title.asm index 1f2723a34..0b421d890 100755 --- a/engine/movie/title.asm +++ b/engine/movie/title.asm @@ -38,7 +38,7 @@ DisplayTitleScreen: call FarCopyData ld hl, NineTile ld de, vTitleLogo tile $6e - ld bc, $10 + ld bc, 1 tiles ld a, BANK(NineTile) call FarCopyData ld hl, GamefreakLogoGraphics diff --git a/engine/movie/title2.asm b/engine/movie/title_rb.asm similarity index 100% rename from engine/movie/title2.asm rename to engine/movie/title_rb.asm diff --git a/engine/movie/title_yellow.asm b/engine/movie/title_yellow.asm new file mode 100644 index 000000000..c70b87f94 --- /dev/null +++ b/engine/movie/title_yellow.asm @@ -0,0 +1,109 @@ +LoadYellowTitleScreenGFX: + ld hl, PokemonLogoGraphics + ld de, vChars2 + ld bc, PokemonLogoGraphicsEnd - PokemonLogoGraphics + ld a, BANK(PokemonLogoGraphics) + call FarCopyData + ld hl, PokemonLogoCornerGraphics + ld de, vChars1 tile $7d + ld bc, PokemonLogoCornerGraphicsEnd - PokemonLogoCornerGraphics + ld a, BANK(PokemonLogoCornerGraphics) + call FarCopyData + ld hl, TitlePikachuBGGraphics + ld de, vChars1 + ld bc, TitlePikachuBGGraphicsEnd - TitlePikachuBGGraphics + ld a, BANK(TitlePikachuBGGraphics) + call FarCopyData + ld hl, TitlePikachuOBGraphics + ld de, vChars1 tile $70 + ld bc, TitlePikachuOBGraphicsEnd - TitlePikachuOBGraphics + ld a, BANK(TitlePikachuOBGraphics) + call FarCopyData + ret + +TitleScreen_PlacePokemonLogo: + hlcoord 2, 1 + ld de, TitleScreenPokemonLogoTilemap + lb bc, 7, 16 + call Bank3D_CopyBox + ret + +TitleScreen_PlacePikaSpeechBubble: + hlcoord 6, 4 + ld de, TitleScreenPikaBubbleTilemap + lb bc, 4, 7 + call Bank3D_CopyBox + hlcoord 9, 8 + ld [hl], $64 + inc hl + ld [hl], $65 + ret + +TitleScreen_PlacePikachu: + hlcoord 4, 8 + ld de, TitleScreenPikachuTilemap + lb bc, 9, 12 + call Bank3D_CopyBox + hlcoord 16, 10 + ld [hl], $96 + hlcoord 16, 11 + ld [hl], $9d + hlcoord 16, 12 + ld [hl], $a7 + hlcoord 16, 13 + ld [hl], $b1 + ld hl, TitleScreenPikachuEyesOAMData + ld de, wOAMBuffer + ld bc, $20 + call CopyData + ret + +TitleScreenPikachuEyesOAMData: + db $60, $40, $f1, $22 + db $60, $48, $f0, $22 + db $68, $40, $f3, $22 + db $68, $48, $f2, $22 + db $60, $60, $f0, $02 + db $60, $68, $f1, $02 + db $68, $60, $f2, $02 + db $68, $68, $f3, $02 + +Bank3D_CopyBox: +; copy cxb (xy) screen area from de to hl +.row + push bc + push hl +.col + ld a, [de] + inc de + ld [hli], a + dec c + jr nz, .col + pop hl + ld bc, SCREEN_WIDTH + add hl, bc + pop bc + dec b + jr nz, .row + ret + +TitleScreenPokemonLogoTilemap: ; 16x7 + INCBIN "gfx/title/pokemon_logo.tilemap" + +Pointer_f4669: ; unreferenced + db $47, $48, $49, $4a, $4b, $4c, $4d, $4e, $4f, $5f + +TitleScreenPikaBubbleTilemap: ; 7x4 + INCBIN "gfx/title/pika_bubble.tilemap" + +TitleScreenPikachuTilemap: ; 12x9 + INCBIN "gfx/title/pikachu.tilemap" + +PokemonLogoGraphics: INCBIN "gfx/title/pokemon_logo.2bpp" +PokemonLogoGraphicsEnd: +PokemonLogoCornerGraphics: INCBIN "gfx/title/pokemon_logo_corner.2bpp" +PokemonLogoCornerGraphicsEnd: +TitlePikachuBGGraphics: INCBIN "gfx/title/pikachu_bg.2bpp" +TitlePikachuBGGraphicsEnd: +TitlePikachuOBGraphics: INCBIN "gfx/title/pikachu_ob.2bpp" +TitlePikachuOBGraphicsEnd: diff --git a/engine/overworld/healing_machine.asm b/engine/overworld/healing_machine.asm index e5fba7e1c..84891353a 100755 --- a/engine/overworld/healing_machine.asm +++ b/engine/overworld/healing_machine.asm @@ -34,7 +34,7 @@ AnimateHealingMachine: dec b jr nz, .partyLoop ld a, [wAudioROMBank] - cp BANK(AudioEngine3) + cp BANK("Audio Engine 3") ld [wAudioSavedROMBank], a jr nz, .next call StopAllMusic diff --git a/engine/overworld/missable_objects.asm b/engine/overworld/missable_objects.asm index 358a9b9fa..bcaa731b8 100644 --- a/engine/overworld/missable_objects.asm +++ b/engine/overworld/missable_objects.asm @@ -15,17 +15,13 @@ MarkTownVisitedAndLoadMissableObjects:: add hl, bc ld a, [hli] ; load missable objects pointer in hl ld h, [hl] - ; fall through - -; LoadMissableObjects: -; seems to not exist in yellow (predef replaced with something near TryPushingBoulder) ld l, a push hl ld a, l - sub MissableObjects & $ff ; calculate difference between out pointer and the base pointer + sub LOW(MissableObjects) ; calculate difference between out pointer and the base pointer ld l, a ld a, h - sbc MissableObjects / $100 + sbc HIGH(MissableObjects) ld h, a ld a, h ldh [hDividend], a diff --git a/engine/overworld/specific_script_flags.asm b/engine/overworld/specific_script_flags.asm new file mode 100644 index 000000000..d6f333ac2 --- /dev/null +++ b/engine/overworld/specific_script_flags.asm @@ -0,0 +1,25 @@ +SetMapSpecificScriptFlagsOnMapReload:: + ld a, [wCurMap] + cp VERMILION_GYM + jr z, .vermilion_gym + ld c, a + ld hl, Bit5Maps +.search_loop + ld a, [hli] + cp c + jr z, .in_list + cp a, $ff + jr nz, .search_loop + ret + +.vermilion_gym + ld hl, wCurrentMapScriptFlags + set 6, [hl] + ret + +.in_list + ld hl, wCurrentMapScriptFlags + set 5, [hl] + ret + +INCLUDE "data/maps/bit_5_maps.asm" diff --git a/engine/overworld/sprite_collisions.asm b/engine/overworld/sprite_collisions.asm index db81977bf..b29dc108e 100644 --- a/engine/overworld/sprite_collisions.asm +++ b/engine/overworld/sprite_collisions.asm @@ -1,5 +1,5 @@ _UpdateSprites:: - ld h, wSpriteStateData1 / $100 + ld h, HIGH(wSpriteStateData1) inc h ld a, SPRITESTATEDATA2_IMAGEBASEOFFSET .spriteLoop diff --git a/engine/overworld/unused_load_missable_object_data.asm b/engine/overworld/unused_load_missable_object_data.asm new file mode 100644 index 000000000..ce0c00d10 --- /dev/null +++ b/engine/overworld/unused_load_missable_object_data.asm @@ -0,0 +1,40 @@ +Func_f0a54: ; unreferenced + ret + +LoadMissableObjectData:: +; farcalled by an unreferenced function + ld hl, .MissableObjectsMaps +.loop + ld a, [hli] + cp -1 + ret z + ld b, a + ld a, [wCurMap] + cp b + jr z, .found + inc hl + inc hl + inc hl + jr .loop + +.found + ld a, [hli] + ld c, a + ld b, 0 + ld a, [hli] + ld h, [hl] + ld l, a + ld de, wMissableObjectList + call CopyData + ret + +.MissableObjectsMaps: + dbbw BLUES_HOUSE, .BluesHouseEnd - .BluesHouse, .BluesHouse + db -1 ; end + +.BluesHouse: + db 1, HS_DAISY_SITTING_COPY + db 2, HS_DAISY_WALKING_COPY + db 3, HS_TOWN_MAP_COPY + db -1 ; end +.BluesHouseEnd: diff --git a/engine/pikachu_emotions.asm b/engine/pikachu/pikachu_emotions.asm similarity index 98% rename from engine/pikachu_emotions.asm rename to engine/pikachu/pikachu_emotions.asm index 552624930..1378d3835 100755 --- a/engine/pikachu_emotions.asm +++ b/engine/pikachu/pikachu_emotions.asm @@ -10,9 +10,9 @@ IsPlayerTalkingToPikachu:: ldh [hSpriteIndexOrTextID], a ld [wd436], a ret - + InitializePikachuTextID:: - ld a, TEXT_PIKACHU_ANIM ; display + ld a, TEXT_PIKACHU_ANIM ; display ldh [hSpriteIndexOrTextID], a xor a ld [wPlayerMovingDirection], a @@ -49,7 +49,7 @@ DoStarterPikachuEmotions: .done ret - + StarterPikachuEmotionsJumptable: dw StarterPikachuEmotionCommand_nop ; 0 dw StarterPikachuEmotionCommand_text ; 1 @@ -62,7 +62,7 @@ StarterPikachuEmotionsJumptable: dw StarterPikachuEmotionCommand_nop2 ; 8 dw StarterPikachuEmotionCommand_9 ; 9 dw StarterPikachuEmotionCommand_nop3 ; a - + StarterPikachuEmotionCommand_nop: StarterPikachuEmotionCommand_nop3: ret @@ -78,7 +78,7 @@ StarterPikachuEmotionCommand_text: call PrintText pop de ret - + StarterPikachuEmotionCommand_pcm: ld a, [de] inc de @@ -94,7 +94,7 @@ PlayPikachuSoundClip_: ret z callfar PlayPikachuSoundClip ret - + StarterPikachuEmotionCommand_emote: ld a, [wUpdateSpritesEnabled] push af @@ -108,14 +108,14 @@ StarterPikachuEmotionCommand_emote: pop af ld [wUpdateSpritesEnabled], a ret - + ShowPikachuEmoteBubble: ld [wWhichEmotionBubble], a ld a, $f ; Pikachu ld [wEmotionBubbleSpriteIndex], a predef EmotionBubble ret - + StarterPikachuEmotionCommand_movement: ld a, [de] inc de @@ -128,7 +128,7 @@ StarterPikachuEmotionCommand_movement: call ApplyPikachuMovementData_ pop de ret - + StarterPikachuEmotionCommand_delay: ld a, [de] inc de @@ -137,7 +137,7 @@ StarterPikachuEmotionCommand_delay: call DelayFrames pop de ret - + StarterPikachuEmotionCommand_subcmd: ld a, [de] inc de @@ -162,10 +162,10 @@ StarterPikachuEmotionCommand_subcmd: dw PikachuPewterPokecenterCheck dw PikachuFanClubCheck dw PikachuBillsHouseCheck - + StarterPikachuEmotionCommand_nop2: ret - + StarterPikachuEmotionCommand_9: push de call StarterPikachuEmotionCommand_turnawayfromplayer @@ -178,12 +178,12 @@ StarterPikachuEmotionCommand_turnawayfromplayer: xor $4 ld [wSpritePikachuStateData1FacingDirection], a ret - + DeletedFunction_fcffb: ; Inexplicably empty. - rept 5 +REPT 5 nop - endr +ENDR ret PlaySpecificPikachuEmotion: @@ -200,12 +200,13 @@ load_expression: ld hl, PikachuEmotionTable call DoStarterPikachuEmotions ret - -PikachuEmotionTable: + pikaemotion_def: MACRO -\1_id: dw \1 - endm +\1_id: + dw \1 +ENDM +PikachuEmotionTable: pikaemotion_def PikachuEmotion0 pikaemotion_def PikachuEmotion1 pikaemotion_def PikachuEmotion2 @@ -240,10 +241,10 @@ pikaemotion_def: MACRO pikaemotion_def PikachuEmotion31 pikaemotion_def PikachuEmotion32 pikaemotion_def PikachuEmotion33 - + PikachuEmotion33: db $ff - + MapSpecificPikachuExpression: ld a, [wCurMap] cp POKEMON_FAN_CLUB @@ -305,14 +306,14 @@ MapSpecificPikachuExpression: .play_emotion scf ret - + .Emotions: dpikaemotion PikachuEmotion18 dpikaemotion PikachuEmotion21 dpikaemotion PikachuEmotion23 dpikaemotion PikachuEmotion24 dpikaemotion PikachuEmotion25 - + IsPlayerPikachuAsleepInParty: xor a ld [wWhichPokemon], a @@ -353,8 +354,8 @@ IsPlayerPikachuAsleepInParty: .done and a ret - -INCLUDE "data/pikachu_emotions.asm" + +INCLUDE "data/pikachu/pikachu_emotions.asm" PikachuWalksToNurseJoy: ld a, $40 diff --git a/engine/pikachu_follow.asm b/engine/pikachu/pikachu_follow.asm similarity index 99% rename from engine/pikachu_follow.asm rename to engine/pikachu/pikachu_follow.asm index fd2fbc47a..9575c3415 100755 --- a/engine/pikachu_follow.asm +++ b/engine/pikachu/pikachu_follow.asm @@ -642,10 +642,10 @@ asm_fc87f: ld a, [hl] dec a add a - add Pointer_fc8d6 % $100 + add LOW(Pointer_fc8d6) ld l, a - ld a, Pointer_fc8d6 / $100 - adc $0 + ld a, HIGH(Pointer_fc8d6) + adc 0 ld h, a ld a, [hli] ld [wd432], a @@ -1474,7 +1474,7 @@ AreThereAtLeastTwoStepsInPikachuFollowCommandBuffer: ret WillPikachuSpawnOnTheScreen: - ld h, wSpriteStateData2 / $100 + ld h, HIGH(wSpriteStateData2) ldh a, [hCurrentSpriteOffset] ; If we're here, this can only be $f0 add wSpritePikachuStateData2MapY - wSpritePikachuStateData2 ld l, a @@ -1515,7 +1515,7 @@ WillPikachuSpawnOnTheScreen: cp d jr c, .on_screen .not_on_screen - ld h, wSpriteStateData1 / $100 + ld h, HIGH(wSpriteStateData1) ldh a, [hCurrentSpriteOffset] add wSpritePikachuStateData1ImageIndex - wSpritePikachuStateData1 ld l, a @@ -1524,7 +1524,7 @@ WillPikachuSpawnOnTheScreen: jr .return .on_screen - ld h, wSpriteStateData2 / $100 + ld h, HIGH(wSpriteStateData2) ldh a, [hCurrentSpriteOffset] add wSpritePikachuStateData2GrassPriority - wSpritePikachuStateData2 ld l, a @@ -1540,7 +1540,7 @@ WillPikachuSpawnOnTheScreen: ret .GetNPCCurrentTile: - ld h, wSpriteStateData1 / $100 + ld h, HIGH(wSpriteStateData1) ldh a, [hCurrentSpriteOffset] add wSpritePikachuStateData1YPixels - wSpritePikachuStateData1 ld l, a @@ -1560,9 +1560,9 @@ WillPikachuSpawnOnTheScreen: ld d, 0 ld e, a ld hl, wTileMap - rept 5 +REPT 5 add hl, bc - endr +ENDR add hl, de ret diff --git a/engine/pikachu_movement.asm b/engine/pikachu/pikachu_movement.asm similarity index 94% rename from engine/pikachu_movement.asm rename to engine/pikachu/pikachu_movement.asm index 2d87e9470..6b912e61f 100755 --- a/engine/pikachu_movement.asm +++ b/engine/pikachu/pikachu_movement.asm @@ -237,29 +237,29 @@ PikachuMovementDatabase: PikaMovementFunc1Jumptable: dw PikaMovementFunc1_EndCommand_ ; 00 - dw PikaMovementFunc1_LoadPikachuCurrentPosition ; 01 - dw PikaMovementFunc1_DelayFrames ; 02 - dw PikaMovementFunc1_WalkInCurrentFacingDirection ; 03 - dw PikaMovementFunc1_WalkInOppositeFacingDirection ; 04 - dw PikaMovementFunc1_StepTurningCounterclockwise ; 05 - dw PikaMovementFunc1_StepTurningClockwise ; 06 - dw PikaMovementFunc1_StepForwardLeft ; 07 - dw PikaMovementFunc1_StepForwardRight ; 08 - dw PikaMovementFunc1_StepBackwardLeft ; 09 - dw PikaMovementFunc1_StepBackwardRight ; 0a - dw PikaMovementFunc1_MoveDown ; 0b - dw PikaMovementFunc1_MoveUp ; 0c - dw PikaMovementFunc1_MoveLeft ; 0d - dw PikaMovementFunc1_MoveRight ; 0e - dw PikaMovementFunc1_MoveDownLeft ; 0f - dw PikaMovementFunc1_MoveDownRight ; 10 - dw PikaMovementFunc1_MoveUpLeft ; 11 - dw PikaMovementFunc1_MoveUpRight ; 12 - dw PikaMovementFunc1_LookDown ; 13 - dw PikaMovementFunc1_LookUp ; 14 - dw PikaMovementFunc1_LookLeft ; 15 - dw PikaMovementFunc1_LookRight ; 16 - dw PikaMovementFunc1_EndCommand_ ; 17 + dw PikaMovementFunc1_LoadPikachuCurrentPosition ; 01 + dw PikaMovementFunc1_DelayFrames ; 02 + dw PikaMovementFunc1_WalkInCurrentFacingDirection ; 03 + dw PikaMovementFunc1_WalkInOppositeFacingDirection ; 04 + dw PikaMovementFunc1_StepTurningCounterclockwise ; 05 + dw PikaMovementFunc1_StepTurningClockwise ; 06 + dw PikaMovementFunc1_StepForwardLeft ; 07 + dw PikaMovementFunc1_StepForwardRight ; 08 + dw PikaMovementFunc1_StepBackwardLeft ; 09 + dw PikaMovementFunc1_StepBackwardRight ; 0a + dw PikaMovementFunc1_MoveDown ; 0b + dw PikaMovementFunc1_MoveUp ; 0c + dw PikaMovementFunc1_MoveLeft ; 0d + dw PikaMovementFunc1_MoveRight ; 0e + dw PikaMovementFunc1_MoveDownLeft ; 0f + dw PikaMovementFunc1_MoveDownRight ; 10 + dw PikaMovementFunc1_MoveUpLeft ; 11 + dw PikaMovementFunc1_MoveUpRight ; 12 + dw PikaMovementFunc1_LookDown ; 13 + dw PikaMovementFunc1_LookUp ; 14 + dw PikaMovementFunc1_LookLeft ; 15 + dw PikaMovementFunc1_LookRight ; 16 + dw PikaMovementFunc1_EndCommand_ ; 17 PikaMovementFunc1_EndCommand: ld a, [wPikachuMovementFlags] @@ -926,8 +926,8 @@ LedgeHoppingShadowGFX_3FEnd: LoadPikachuBallIconIntoVRAM: ld hl, vNPCSprites2 + $7e * $10 - ld de, GFX_fd86b - lb bc, BANK(GFX_fd86b), 1 + ld de, OverworldPikachuBallGFX + lb bc, BANK(OverworldPikachuBallGFX), 1 jp CopyVideoDataDoubleAlternate Func_fd851: @@ -936,8 +936,8 @@ Func_fd851: .loop push af push hl - ld de, GFX_fd86b - lb bc, BANK(GFX_fd86b), 4 + ld de, OverworldPikachuBallGFX + lb bc, BANK(OverworldPikachuBallGFX), 4 call CopyVideoDataAlternate pop hl ld de, 4 * $10 @@ -947,8 +947,8 @@ Func_fd851: jr nz, .loop ret -GFX_fd86b: -INCBIN "gfx/unknown_fd86b.2bpp" +OverworldPikachuBallGFX: +INCBIN "gfx/overworld/pikachu_ball.2bpp" LoadPikachuSpriteIntoVRAM: ld de, PikachuSprite diff --git a/engine/pikachu_pcm.asm b/engine/pikachu/pikachu_pcm.asm similarity index 100% rename from engine/pikachu_pcm.asm rename to engine/pikachu/pikachu_pcm.asm diff --git a/engine/pikachu_pic_animation.asm b/engine/pikachu/pikachu_pic_animation.asm similarity index 98% rename from engine/pikachu_pic_animation.asm rename to engine/pikachu/pikachu_pic_animation.asm index 7829c0482..33a3e504c 100755 --- a/engine/pikachu_pic_animation.asm +++ b/engine/pikachu/pikachu_pic_animation.asm @@ -163,11 +163,12 @@ LoadCurrentPikaPicAnimScriptPointer: call UpdatePikaPicAnimPointer ret -PikaPicAnimPointers: -pikapic_def: macro -\1_id: dw \1 -endm +pikapic_def: MACRO +\1_id: + dw \1 +ENDM +PikaPicAnimPointers: pikapic_def PikaPicAnimScript0 ; 00 pikapic_def PikaPicAnimScript1 ; 01 pikapic_def PikaPicAnimScript2 ; 02 @@ -406,7 +407,7 @@ LoadPikaPicAnimObjectData: .not_done ret -INCLUDE "data/pikachu_pic_objects.asm" +INCLUDE "data/pikachu/pikachu_pic_objects.asm" LoadCurPikaPicObjectTilemap: and a @@ -473,7 +474,7 @@ LoadCurPikaPicObjectTilemap: pop bc ret -INCLUDE "data/pikachu_pic_tilemaps.asm" +INCLUDE "data/pikachu/pikachu_pic_tilemaps.asm" LoadPikaPicAnimGFXHeader: push hl @@ -848,4 +849,7 @@ PikaPicAnimCommand_thunderbolt: call DelayFrames ret -INCLUDE "data/pikachu_pic_animation.asm" +INCLUDE "data/pikachu/pikachu_pic_animation.asm" + +Func_fe66e: + ret diff --git a/engine/pikachu_status.asm b/engine/pikachu/pikachu_status.asm similarity index 100% rename from engine/pikachu_status.asm rename to engine/pikachu/pikachu_status.asm diff --git a/engine/pikachu/respawn_overworld_pikachu.asm b/engine/pikachu/respawn_overworld_pikachu.asm new file mode 100644 index 000000000..4b6100850 --- /dev/null +++ b/engine/pikachu/respawn_overworld_pikachu.asm @@ -0,0 +1,6 @@ +RespawnOverworldPikachu: + callfar IsThisPartymonStarterPikachu_Party + ret nc + ld a, $3 + ld [wPikachuSpawnState], a + ret diff --git a/engine/printer.asm b/engine/printer/printer.asm similarity index 97% rename from engine/printer.asm rename to engine/printer/printer.asm index f0b681aff..18bb18a67 100644 --- a/engine/printer.asm +++ b/engine/printer/printer.asm @@ -1,16 +1,3 @@ - const_def - const PRINTER_STATUS_BLANK - const PRINTER_STATUS_CHECKING_LINK - const PRINTER_STATUS_TRANSMITTING - const PRINTER_STATUS_PRINTING - const PRINTER_ERROR_1 - const PRINTER_ERROR_2 - const PRINTER_ERROR_3 - const PRINTER_ERROR_4 - const PRINTER_ERROR_WRONG_DEVICE - -INCLUDE "engine/printer/serial.asm" - PrintPokedexEntry: ld a, [wUpdateSpritesEnabled] push af @@ -128,7 +115,7 @@ Printer_PrepareDexEntryForPrinting: callfar Pokedex_PrepareDexEntryForPrinting ret -PrintSurfingMinigameHighScore: +PrintSurfingMinigameHighScore:: xor a ldh [hCanceledPrinting], a call Printer_PlayPrinterMusic @@ -641,7 +628,7 @@ GBPrinter_UpdateStatusMessage: db "This is not the" next "Game Boy Printer!@" -Printer_PrepareSurfingMinigameHighScoreTileMap: +Printer_PrepareSurfingMinigameHighScoreTileMap:: call GBPalWhiteOutWithDelay3 call ClearScreen ld de, SurfingPikachu2Graphics @@ -788,7 +775,7 @@ CopySurfingMinigameScore: dec de ret -SurfingPikachu2Graphics: INCBIN "gfx/surfing_pikachu_2.2bpp" +SurfingPikachu2Graphics: INCBIN "gfx/surfing_pikachu/surfing_pikachu_2.2bpp" SurfingPikachu2GraphicsEnd: PrintPCBox_DrawPage1: diff --git a/engine/unknown_ea3ea.asm b/engine/printer/printer2.asm similarity index 99% rename from engine/unknown_ea3ea.asm rename to engine/printer/printer2.asm index c10f15554..180f044ca 100755 --- a/engine/unknown_ea3ea.asm +++ b/engine/printer/printer2.asm @@ -177,11 +177,11 @@ Printer_GetMonStats: db "--------------@" GFX_ea563: -INCBIN "gfx/stats_screen_hp.1bpp" +INCBIN "gfx/printer/hp.1bpp" GFX_ea563End: GFX_ea56b: -INCBIN "gfx/stats_screen_lv.1bpp" +INCBIN "gfx/printer/lv.1bpp" GFX_ea56bEnd: PrinterDebug_LoadGFX: @@ -208,7 +208,7 @@ PrinterDebug_LoadGFX: ret GFX_ea597: -INCBIN "gfx/zero_one_ea597.2bpp" +INCBIN "gfx/printer/01.2bpp" GFX_ea597End: PrinterDebug_ConvertStatusFlagsToTiles: diff --git a/engine/printer/serial.asm b/engine/printer/serial.asm index 97f655bbb..fd4dd0565 100755 --- a/engine/printer/serial.asm +++ b/engine/printer/serial.asm @@ -1,3 +1,14 @@ + const_def + const PRINTER_STATUS_BLANK + const PRINTER_STATUS_CHECKING_LINK + const PRINTER_STATUS_TRANSMITTING + const PRINTER_STATUS_PRINTING + const PRINTER_ERROR_1 + const PRINTER_ERROR_2 + const PRINTER_ERROR_3 + const PRINTER_ERROR_4 + const PRINTER_ERROR_WRONG_DEVICE + StartTransmission_Send9Rows: ld a, 9 Printer_StartTransmission: @@ -104,9 +115,9 @@ Printer_StartTransmittingTilemap: ld hl, PrinterDataPacket3 call CopyPrinterDataHeader call Printer_Convert2RowsTo2bpp - ld a, (wPrinterSendDataSource1End - wPrinterSendDataSource1) % $100 + ld a, LOW(wPrinterSendDataSource1End - wPrinterSendDataSource1) ld [wPrinterDataSize], a - ld a, (wPrinterSendDataSource1End - wPrinterSendDataSource1) / $100 + ld a, HIGH(wPrinterSendDataSource1End - wPrinterSendDataSource1) ld [wPrinterDataSize + 1], a call ComputePrinterChecksum call Printer_Next diff --git a/engine/bank30.bin b/garbage/bank30.bin similarity index 100% rename from engine/bank30.bin rename to garbage/bank30.bin diff --git a/gfx/blocksets/beachhouse.bst b/gfx/blocksets/beach_house.bst similarity index 100% rename from gfx/blocksets/beachhouse.bst rename to gfx/blocksets/beach_house.bst diff --git a/gfx/font.asm b/gfx/font.asm index 51d61de43..06b02fdf0 100644 --- a/gfx/font.asm +++ b/gfx/font.asm @@ -18,7 +18,7 @@ NintendoCopyrightLogoGraphics: INCBIN "gfx/splash/copyright.2bpp" GamefreakLogoGraphics: INCBIN "gfx/title/gamefreak_inc.2bpp" GamefreakLogoGraphicsEnd: -NineTile: INCBIN "gfx/9_tile.2bpp" +NineTile: INCBIN "gfx/title/nine.2bpp" TextBoxGraphics:: INCBIN "gfx/font/font_extra.2bpp" TextBoxGraphicsEnd:: diff --git a/gfx/intro/clouds.png b/gfx/intro/clouds.png new file mode 100644 index 000000000..872492b13 Binary files /dev/null and b/gfx/intro/clouds.png differ diff --git a/gfx/unknown_f9b6e.map b/gfx/intro/unknown_f9b6e.map similarity index 100% rename from gfx/unknown_f9b6e.map rename to gfx/intro/unknown_f9b6e.map diff --git a/gfx/unknown_f9be6.map b/gfx/intro/unknown_f9be6.map similarity index 100% rename from gfx/unknown_f9be6.map rename to gfx/intro/unknown_f9be6.map diff --git a/gfx/unknown_f9bf2.map b/gfx/intro/unknown_f9bf2.map similarity index 100% rename from gfx/unknown_f9bf2.map rename to gfx/intro/unknown_f9bf2.map diff --git a/gfx/intro/yellow_intro_1.png b/gfx/intro/yellow_intro_1.png new file mode 100644 index 000000000..f72581691 Binary files /dev/null and b/gfx/intro/yellow_intro_1.png differ diff --git a/gfx/intro/yellow_intro_2.png b/gfx/intro/yellow_intro_2.png new file mode 100644 index 000000000..dc5313c34 Binary files /dev/null and b/gfx/intro/yellow_intro_2.png differ diff --git a/gfx/unknown_fd86b.png b/gfx/overworld/pikachu_ball.png similarity index 100% rename from gfx/unknown_fd86b.png rename to gfx/overworld/pikachu_ball.png diff --git a/gfx/pics.asm b/gfx/pics.asm index 4019fe368..2e410ea3f 100644 --- a/gfx/pics.asm +++ b/gfx/pics.asm @@ -374,3 +374,10 @@ ChannelerPic:: INCBIN "gfx/trainers/channeler.pic" AgathaPic:: INCBIN "gfx/trainers/agatha.pic" LancePic:: INCBIN "gfx/trainers/lance.pic" JessieJamesPic:: INCBIN "gfx/trainers/yellow/jessiejames.pic" + + +SECTION "Pics 7", ROMX + +RedPicBack:: INCBIN "gfx/player/redb.pic" +OldManPic:: INCBIN "gfx/battle/oldman.pic" +ProfOakPicBack:: INCBIN "gfx/battle/prof.oakb.pic" diff --git a/gfx/pikachu.asm b/gfx/pikachu.asm new file mode 100644 index 000000000..6852e91e9 --- /dev/null +++ b/gfx/pikachu.asm @@ -0,0 +1,128 @@ +SECTION "Pikachu Graphics 1", ROMX + +Pic_e4000:: +INCBIN "gfx/pikachu/unknown_e4000.pic" +GFX_e40cc:: +INCBIN "gfx/pikachu/unknown_e40cc.2bpp" +Pic_e411c:: +INCBIN "gfx/pikachu/unknown_e411c.pic" +GFX_e41d2:: +INCBIN "gfx/pikachu/unknown_e41d2.2bpp" +Pic_e4272:: +INCBIN "gfx/pikachu/unknown_e4272.pic" +GFX_e4323:: +INCBIN "gfx/pikachu/unknown_e4323.2bpp" +Pic_e4383:: +INCBIN "gfx/pikachu/unknown_e4383.pic" +GFX_e444b:: +INCBIN "gfx/pikachu/unknown_e444b.2bpp" +Pic_e458b:: +INCBIN "gfx/pikachu/unknown_e458b.pic" +GFX_e463b:: +INCBIN "gfx/pikachu/unknown_e463b.2bpp" +Pic_e467b:: +INCBIN "gfx/pikachu/unknown_e467b.pic" +GFX_e472e:: +INCBIN "gfx/pikachu/unknown_e472e.2bpp" +Pic_e476e:: +INCBIN "gfx/pikachu/unknown_e476e.pic" +GFX_e4841:: +INCBIN "gfx/pikachu/unknown_e4841.2bpp" +Pic_e49d1:: +INCBIN "gfx/pikachu/unknown_e49d1.pic" +GFX_e4a99:: +INCBIN "gfx/pikachu/unknown_e4a99.2bpp" +Pic_e4b39:: +INCBIN "gfx/pikachu/unknown_e4b39.pic" +GFX_e4bde:: +INCBIN "gfx/pikachu/unknown_e4bde.2bpp" +Pic_e4c3e:: +INCBIN "gfx/pikachu/unknown_e4c3e.pic" +GFX_e4ce0:: +INCBIN "gfx/pikachu/unknown_e4ce0.2bpp" +GFX_e4e70:: +INCBIN "gfx/pikachu/unknown_e4e70.2bpp" +Pic_e5000:: +INCBIN "gfx/pikachu/unknown_e5000.pic" +GFX_e50af:: +INCBIN "gfx/pikachu/unknown_e50af.2bpp" +Pic_e523f:: +INCBIN "gfx/pikachu/unknown_e523f.pic" +GFX_e52fe:: +INCBIN "gfx/pikachu/unknown_e52fe.2bpp" +Pic_e548e:: +INCBIN "gfx/pikachu/unknown_e548e.pic" +GFX_e5541:: +INCBIN "gfx/pikachu/unknown_e5541.2bpp" +Pic_e56d1:: +INCBIN "gfx/pikachu/unknown_e56d1.pic" +GFX_e5794:: +INCBIN "gfx/pikachu/unknown_e5794.2bpp" +Pic_e5924:: +INCBIN "gfx/pikachu/unknown_e5924.pic" +GFX_e59ed:: +INCBIN "gfx/pikachu/unknown_e59ed.2bpp" +Pic_e5b7d:: +INCBIN "gfx/pikachu/unknown_e5b7d.pic" +GFX_e5c4d:: +INCBIN "gfx/pikachu/unknown_e5c4d.2bpp" +Pic_e5ddd:: +INCBIN "gfx/pikachu/unknown_e5ddd.pic" +GFX_e5e90:: +INCBIN "gfx/pikachu/unknown_e5e90.2bpp" +GFX_e6020:: +INCBIN "gfx/pikachu/unknown_e6020.2bpp" +GFX_e61b0:: +INCBIN "gfx/pikachu/unknown_e61b0.2bpp" +Pic_e6340:: +INCBIN "gfx/pikachu/unknown_e6340.pic" +GFX_e63f7:: +INCBIN "gfx/pikachu/unknown_e63f7.2bpp" +Pic_e6587:: +INCBIN "gfx/pikachu/unknown_e6587.pic" +GFX_e6646:: +INCBIN "gfx/pikachu/unknown_e6646.2bpp" +Pic_e67d6:: +INCBIN "gfx/pikachu/unknown_e67d6.pic" +GFX_e682f:: +INCBIN "gfx/pikachu/unknown_e682f.2bpp" +GFX_e69bf:: +INCBIN "gfx/pikachu/unknown_e69bf.2bpp" +GFX_e6b4f:: +INCBIN "gfx/pikachu/unknown_e6b4f.2bpp" +GFX_e6cdf:: +INCBIN "gfx/pikachu/unknown_e6cdf.2bpp" +GFX_e6e6f:: +INCBIN "gfx/pikachu/unknown_e6e6f.2bpp" +GFX_e6fff:: +INCBIN "gfx/pikachu/unknown_e6fff.2bpp" +GFX_e718f:: +INCBIN "gfx/pikachu/unknown_e718f.2bpp" +GFX_e731f:: +INCBIN "gfx/pikachu/unknown_e731f.2bpp" +GFX_e74af:: +INCBIN "gfx/pikachu/unknown_e74af.2bpp" +GFX_e763f:: +INCBIN "gfx/pikachu/unknown_e763f.2bpp" +Pic_e77cf:: +INCBIN "gfx/pikachu/unknown_e77cf.pic" +GFX_e7863:: +INCBIN "gfx/pikachu/unknown_e7863.2bpp" +GFX_e79f3:: +INCBIN "gfx/pikachu/unknown_e79f3.2bpp" +GFX_e7b83:: +INCBIN "gfx/pikachu/unknown_e7b83.2bpp" +GFX_e7d13:: +INCBIN "gfx/pikachu/unknown_e7d13.2bpp" + + +SECTION "Pikachu Graphics 2", ROMX + +Pic_f0abf:: +INCBIN "gfx/pikachu/unknown_f0abf.pic" +GFX_f0b64:: +INCBIN "gfx/pikachu/unknown_f0b64.2bpp" +Pic_f0cf4:: +INCBIN "gfx/pikachu/unknown_f0cf4.pic" +GFX_f0d82:: +INCBIN "gfx/pikachu/unknown_f0d82.2bpp" diff --git a/gfx/zero_one_ea597.png b/gfx/printer/01.png similarity index 100% rename from gfx/zero_one_ea597.png rename to gfx/printer/01.png diff --git a/gfx/stats_screen_hp.png b/gfx/printer/hp.png similarity index 100% rename from gfx/stats_screen_hp.png rename to gfx/printer/hp.png diff --git a/gfx/stats_screen_lv.png b/gfx/printer/lv.png similarity index 100% rename from gfx/stats_screen_lv.png rename to gfx/printer/lv.png diff --git a/gfx/sprites.asm b/gfx/sprites.asm index ebafac206..c54aef3de 100644 --- a/gfx/sprites.asm +++ b/gfx/sprites.asm @@ -72,3 +72,18 @@ AgathaSprite:: INCBIN "gfx/sprites/agatha.2bpp" BrunoSprite:: INCBIN "gfx/sprites/bruno.2bpp" LoreleiSprite:: INCBIN "gfx/sprites/lorelei.2bpp" SeelSprite:: INCBIN "gfx/sprites/seel.2bpp" + + +SECTION "NPC Sprites 3", ROMX + +OfficerJennySprite:: INCBIN "gfx/sprites/officer_jenny.2bpp" +PikachuSprite:: INCBIN "gfx/sprites/pikachu.2bpp" +SandshrewSprite:: INCBIN "gfx/sprites/sandshrew.2bpp" +OddishSprite:: INCBIN "gfx/sprites/oddish.2bpp" +BulbasaurSprite:: INCBIN "gfx/sprites/bulbasaur.2bpp" +JigglypuffSprite:: INCBIN "gfx/sprites/jigglypuff.2bpp" +ClefairySprite:: INCBIN "gfx/sprites/clefairy.2bpp" +ChanseySprite:: INCBIN "gfx/sprites/chansey.2bpp" +SurfingPikachuSprite:: INCBIN "gfx/sprites/surfing_pikachu.2bpp" +JessieSprite:: INCBIN "gfx/sprites/jessie.2bpp" +JamesSprite:: INCBIN "gfx/sprites/james.2bpp" diff --git a/gfx/surfing_pikachu.asm b/gfx/surfing_pikachu.asm new file mode 100644 index 000000000..51884db26 --- /dev/null +++ b/gfx/surfing_pikachu.asm @@ -0,0 +1,3 @@ +SurfingPikachu1Graphics1:: INCBIN "gfx/surfing_pikachu/surfing_pikachu_1a.2bpp" +SurfingPikachu1Graphics2:: INCBIN "gfx/surfing_pikachu/surfing_pikachu_1b.2bpp" +SurfingPikachu1Graphics3:: INCBIN "gfx/surfing_pikachu/surfing_pikachu_1c.2bpp" diff --git a/gfx/surfing_pikachu_1a.png b/gfx/surfing_pikachu/surfing_pikachu_1a.png similarity index 100% rename from gfx/surfing_pikachu_1a.png rename to gfx/surfing_pikachu/surfing_pikachu_1a.png diff --git a/gfx/surfing_pikachu_1b.png b/gfx/surfing_pikachu/surfing_pikachu_1b.png similarity index 100% rename from gfx/surfing_pikachu_1b.png rename to gfx/surfing_pikachu/surfing_pikachu_1b.png diff --git a/gfx/surfing_pikachu_1c.png b/gfx/surfing_pikachu/surfing_pikachu_1c.png similarity index 100% rename from gfx/surfing_pikachu_1c.png rename to gfx/surfing_pikachu/surfing_pikachu_1c.png diff --git a/gfx/surfing_pikachu_2.png b/gfx/surfing_pikachu/surfing_pikachu_2.png similarity index 100% rename from gfx/surfing_pikachu_2.png rename to gfx/surfing_pikachu/surfing_pikachu_2.png diff --git a/gfx/surfing_pikachu_3.png b/gfx/surfing_pikachu/surfing_pikachu_3.png similarity index 100% rename from gfx/surfing_pikachu_3.png rename to gfx/surfing_pikachu/surfing_pikachu_3.png diff --git a/gfx/unknown_f8946.map b/gfx/surfing_pikachu/unknown_f8946.map similarity index 100% rename from gfx/unknown_f8946.map rename to gfx/surfing_pikachu/unknown_f8946.map diff --git a/gfx/unknown_f90bc.map b/gfx/surfing_pikachu/unknown_f90bc.map similarity index 100% rename from gfx/unknown_f90bc.map rename to gfx/surfing_pikachu/unknown_f90bc.map diff --git a/gfx/unknown_f91ac.map b/gfx/surfing_pikachu/unknown_f91ac.map similarity index 100% rename from gfx/unknown_f91ac.map rename to gfx/surfing_pikachu/unknown_f91ac.map diff --git a/gfx/unknown_f91bb.map b/gfx/surfing_pikachu/unknown_f91bb.map similarity index 100% rename from gfx/unknown_f91bb.map rename to gfx/surfing_pikachu/unknown_f91bb.map diff --git a/gfx/unknown_f91c8.map b/gfx/surfing_pikachu/unknown_f91c8.map similarity index 100% rename from gfx/unknown_f91c8.map rename to gfx/surfing_pikachu/unknown_f91c8.map diff --git a/gfx/tilesets.asm b/gfx/tilesets.asm index e6db3c217..911ad34fd 100644 --- a/gfx/tilesets.asm +++ b/gfx/tilesets.asm @@ -62,3 +62,10 @@ Club_GFX:: INCBIN "gfx/tilesets/club.2bpp" Club_Block:: INCBIN "gfx/blocksets/club.bst" Underground_GFX:: INCBIN "gfx/tilesets/underground.2bpp" Underground_Block:: INCBIN "gfx/blocksets/underground.bst" + + +SECTION "Tilesets 4", ROMX + +BeachHouse_GFX:: INCBIN "gfx/tilesets/beach_house.2bpp" + ds 384 +BeachHouse_Block:: INCBIN "gfx/blocksets/beach_house.bst" diff --git a/gfx/tilesets/beachhouse.png b/gfx/tilesets/beach_house.png similarity index 100% rename from gfx/tilesets/beachhouse.png rename to gfx/tilesets/beach_house.png diff --git a/gfx/9_tile.png b/gfx/title/nine.png similarity index 100% rename from gfx/9_tile.png rename to gfx/title/nine.png diff --git a/gfx/title/pika_bubble.tilemap b/gfx/title/pika_bubble.tilemap new file mode 100644 index 000000000..892be3c77 --- /dev/null +++ b/gfx/title/pika_bubble.tilemap @@ -0,0 +1 @@ +$%fghi*PQRSTUVWXYZ[\]m^_`abc \ No newline at end of file diff --git a/gfx/title/pikachu.tilemap b/gfx/title/pikachu.tilemap new file mode 100644 index 000000000..9fc7de6fb Binary files /dev/null and b/gfx/title/pikachu.tilemap differ diff --git a/gfx/title/pikachu_bg.png b/gfx/title/pikachu_bg.png new file mode 100644 index 000000000..245fdbf6a Binary files /dev/null and b/gfx/title/pikachu_bg.png differ diff --git a/gfx/title/pikachu_ob.png b/gfx/title/pikachu_ob.png new file mode 100644 index 000000000..066221cbe Binary files /dev/null and b/gfx/title/pikachu_ob.png differ diff --git a/gfx/title/pokemon_logo.png b/gfx/title/pokemon_logo.png index 64f9b23f8..30b4a46dd 100644 Binary files a/gfx/title/pokemon_logo.png and b/gfx/title/pokemon_logo.png differ diff --git a/gfx/title/pokemon_logo.tilemap b/gfx/title/pokemon_logo.tilemap new file mode 100644 index 000000000..92488a1f1 --- /dev/null +++ b/gfx/title/pokemon_logo.tilemap @@ -0,0 +1,2 @@ +ôôôôôôIôr0ôôôôôôý + ô  !"#$%&'()*+,-./ô123456789:;<=>?ôABCDEFGHôJKLMNOôjklmôôôôôônopqô \ No newline at end of file diff --git a/gfx/title/pokemon_logo_corner.png b/gfx/title/pokemon_logo_corner.png new file mode 100644 index 000000000..ffb2a514d Binary files /dev/null and b/gfx/title/pokemon_logo_corner.png differ diff --git a/gfx/unknown_f9c2c.png b/gfx/unknown_f9c2c.png deleted file mode 100644 index b5c684240..000000000 Binary files a/gfx/unknown_f9c2c.png and /dev/null differ diff --git a/gfx/unknown_f9c6c.png b/gfx/unknown_f9c6c.png deleted file mode 100644 index 3725d6cc6..000000000 Binary files a/gfx/unknown_f9c6c.png and /dev/null differ diff --git a/gfx/yellow_intro.asm b/gfx/yellow_intro.asm new file mode 100644 index 000000000..4bdd1a3f4 --- /dev/null +++ b/gfx/yellow_intro.asm @@ -0,0 +1,4 @@ +YellowIntroGraphics1: INCBIN "gfx/intro/yellow_intro_1.2bpp" +YellowIntroGraphics1End:: +YellowIntroGraphics2: INCBIN "gfx/intro/yellow_intro_2.2bpp" +YellowIntroGraphics2End:: diff --git a/gfx/yellow_intro.png b/gfx/yellow_intro.png deleted file mode 100644 index a9a2773c0..000000000 Binary files a/gfx/yellow_intro.png and /dev/null differ diff --git a/gfx/yellow_titlescreen.png b/gfx/yellow_titlescreen.png deleted file mode 100644 index 285309ce5..000000000 Binary files a/gfx/yellow_titlescreen.png and /dev/null differ diff --git a/home.asm b/home.asm index 17701681c..b21eb4b80 100644 --- a/home.asm +++ b/home.asm @@ -16,70 +16,15 @@ INCLUDE "home/copy.asm" SECTION "Home", ROM0 -PlayPikachuPCM:: - ldh a, [hLoadedROMBank] - push af - ld a, b - call BankswitchCommon - ld a, [hli] - ld c, a - ld a, [hli] - ld b, a -.loop - ld a, [hli] - ld d, a - ld a, $3 -.playSingleSample - dec a - jr nz, .playSingleSample - - rept 7 - call LoadNextSoundClipSample - call PlaySoundClipSample - endr - - call LoadNextSoundClipSample - dec bc - ld a, c - or b - jr nz, .loop - pop af - call BankswitchCommon - ret - -LoadNextSoundClipSample:: - ld a, d - and $80 - srl a - srl a - ldh [rNR32], a - sla d - ret - -PlaySoundClipSample:: - ld a, $3 -.loop - dec a - jr nz, .loop - ret - +INCLUDE "home/pikachu_cries.asm" INCLUDE "home/start.asm" INCLUDE "home/joypad.asm" - INCLUDE "home/overworld.asm" INCLUDE "home/pokemon.asm" INCLUDE "home/print_bcd.asm" INCLUDE "home/pics.asm" - INCLUDE "home/pikachu.asm" - INCLUDE "home/lcdc.asm" - -IsTilePassable:: -; sets carry if tile is passable, resets carry otherwise - homecall_sf _IsTilePassable - ret - INCLUDE "home/copy2.asm" INCLUDE "home/text.asm" INCLUDE "home/vcopy.asm" @@ -98,11 +43,6 @@ INCLUDE "home/overworld_text.asm" INCLUDE "home/uncompress.asm" INCLUDE "home/reset_player_sprite.asm" INCLUDE "home/fade_audio.asm" - -UnknownText_2812:: - text_far _PokemonText - text_end - INCLUDE "home/text_script.asm" INCLUDE "home/start_menu.asm" INCLUDE "home/count_set_bits.asm" @@ -112,89 +52,7 @@ INCLUDE "home/names.asm" INCLUDE "home/reload_tiles.asm" INCLUDE "home/item.asm" INCLUDE "home/textbox.asm" - -UpdateGBCPal_BGP:: - push af - ldh a, [hGBC] - and a - jr z, .notGBC - push bc - push de - push hl - ldh a, [rBGP] - ld b, a - ld a, [wLastBGP] - cp b - jr z, .noChangeInBGP - farcall _UpdateGBCPal_BGP -.noChangeInBGP - pop hl - pop de - pop bc -.notGBC - pop af - ret - -UpdateGBCPal_OBP0:: - push af - ldh a, [hGBC] - and a - jr z, .notGBC - push bc - push de - push hl - ldh a, [rOBP0] - ld b, a - ld a, [wLastOBP0] - cp b - jr z, .noChangeInOBP0 - ld b, BANK(_UpdateGBCPal_OBP) - ld hl, _UpdateGBCPal_OBP - ld c, CONVERT_OBP0 - call Bankswitch -.noChangeInOBP0 - pop hl - pop de - pop bc -.notGBC - pop af - ret - -UpdateGBCPal_OBP1:: - push af - ldh a, [hGBC] - and a - jr z, .notGBC - push bc - push de - push hl - ldh a, [rOBP1] - ld b, a - ld a, [wLastOBP1] - cp b - jr z, .noChangeInOBP1 - ld b, BANK(_UpdateGBCPal_OBP) - ld hl, _UpdateGBCPal_OBP - ld c, CONVERT_OBP1 - call Bankswitch -.noChangeInOBP1 - pop hl - pop de - pop bc -.notGBC - pop af - ret - -Func_3082:: - ldh a, [hLoadedROMBank] - push af - call FadeOutAudio - callbs Music_DoLowHealthAlarm - callbs Audio1_UpdateMusic - pop af - call BankswitchCommon - ret - +INCLUDE "home/cgb_palettes.asm" INCLUDE "home/npc_movement.asm" INCLUDE "home/trainers.asm" INCLUDE "home/map_objects.asm" @@ -217,69 +75,13 @@ INCLUDE "home/array.asm" INCLUDE "home/compare.asm" INCLUDE "home/oam.asm" INCLUDE "home/window.asm" - -FarPrintText:: -; print text b:hl at (1, 14) - ldh a, [hLoadedROMBank] - push af - ld a, b - call BankswitchCommon - call PrintText - pop af - call BankswitchCommon - ret - INCLUDE "home/print_num.asm" INCLUDE "home/array2.asm" - -InitMapSprites:: - jpfar _InitMapSprites - INCLUDE "home/palettes.asm" INCLUDE "home/reload_sprites.asm" INCLUDE "home/give.asm" INCLUDE "home/random.asm" - -BankswitchCommon:: - ldh [hLoadedROMBank], a - ld [MBC1RomBank], a - ret - -Bankswitch:: -; self-contained bankswitch, use this when not in the home bank -; switches to the bank in b - ldh a, [hLoadedROMBank] - push af - ld a, b - ldh [hLoadedROMBank], a - ld [MBC1RomBank], a - call JumpToAddress - pop bc - ld a, b - ldh [hLoadedROMBank], a - ld [MBC1RomBank], a - ret -JumpToAddress:: - jp hl - -SwitchSRAMBankAndLatchClockData:: - push af - ld a, $1 - ld [MBC1SRamBankingMode], a - ld a, SRAM_ENABLE - ld [MBC1SRamEnable], a - pop af - ld [MBC1SRamBank], a - ret - -PrepareRTCDataAndDisableSRAM:: - push af - ld a, $0 - ld [MBC1SRamBankingMode], a - ld [MBC1SRamEnable], a - pop af - ret - +INCLUDE "home/bankswitch2.asm" INCLUDE "home/predef.asm" INCLUDE "home/hidden_objects.asm" INCLUDE "home/predef_text.asm" diff --git a/home/bankswitch2.asm b/home/bankswitch2.asm new file mode 100644 index 000000000..cc7169cd5 --- /dev/null +++ b/home/bankswitch2.asm @@ -0,0 +1,39 @@ +BankswitchCommon:: + ldh [hLoadedROMBank], a + ld [MBC1RomBank], a + ret + +Bankswitch:: +; self-contained bankswitch, use this when not in the home bank +; switches to the bank in b + ldh a, [hLoadedROMBank] + push af + ld a, b + ldh [hLoadedROMBank], a + ld [MBC1RomBank], a + call JumpToAddress + pop bc + ld a, b + ldh [hLoadedROMBank], a + ld [MBC1RomBank], a + ret +JumpToAddress:: + jp hl + +SwitchSRAMBankAndLatchClockData:: + push af + ld a, $1 + ld [MBC1SRamBankingMode], a + ld a, SRAM_ENABLE + ld [MBC1SRamEnable], a + pop af + ld [MBC1SRamBank], a + ret + +PrepareRTCDataAndDisableSRAM:: + push af + ld a, $0 + ld [MBC1SRamBankingMode], a + ld [MBC1SRamEnable], a + pop af + ret diff --git a/home/cgb_palettes.asm b/home/cgb_palettes.asm new file mode 100644 index 000000000..24738ae2c --- /dev/null +++ b/home/cgb_palettes.asm @@ -0,0 +1,81 @@ +UpdateGBCPal_BGP:: + push af + ldh a, [hGBC] + and a + jr z, .notGBC + push bc + push de + push hl + ldh a, [rBGP] + ld b, a + ld a, [wLastBGP] + cp b + jr z, .noChangeInBGP + farcall _UpdateGBCPal_BGP +.noChangeInBGP + pop hl + pop de + pop bc +.notGBC + pop af + ret + +UpdateGBCPal_OBP0:: + push af + ldh a, [hGBC] + and a + jr z, .notGBC + push bc + push de + push hl + ldh a, [rOBP0] + ld b, a + ld a, [wLastOBP0] + cp b + jr z, .noChangeInOBP0 + ld b, BANK(_UpdateGBCPal_OBP) + ld hl, _UpdateGBCPal_OBP + ld c, CONVERT_OBP0 + call Bankswitch +.noChangeInOBP0 + pop hl + pop de + pop bc +.notGBC + pop af + ret + +UpdateGBCPal_OBP1:: + push af + ldh a, [hGBC] + and a + jr z, .notGBC + push bc + push de + push hl + ldh a, [rOBP1] + ld b, a + ld a, [wLastOBP1] + cp b + jr z, .noChangeInOBP1 + ld b, BANK(_UpdateGBCPal_OBP) + ld hl, _UpdateGBCPal_OBP + ld c, CONVERT_OBP1 + call Bankswitch +.noChangeInOBP1 + pop hl + pop de + pop bc +.notGBC + pop af + ret + +Func_3082:: + ldh a, [hLoadedROMBank] + push af + call FadeOutAudio + callbs Music_DoLowHealthAlarm + callbs Audio1_UpdateMusic + pop af + call BankswitchCommon + ret diff --git a/home/copy2.asm b/home/copy2.asm index bff265706..6245ad5d5 100644 --- a/home/copy2.asm +++ b/home/copy2.asm @@ -1,3 +1,8 @@ +IsTilePassable:: +; sets carry if tile is passable, resets carry otherwise + homecall_sf _IsTilePassable + ret + FarCopyDataDouble:: ; Expand bc bytes of 1bpp image data ; from a:de to 2bpp data at hl. diff --git a/home/init.asm b/home/init.asm index 878f329a0..331a36571 100644 --- a/home/init.asm +++ b/home/init.asm @@ -128,7 +128,7 @@ ClearVram:: StopAllSounds:: - ld a, BANK(AudioEngine1) + ld a, BANK("Audio Engine 1") ld [wAudioROMBank], a ld [wAudioSavedROMBank], a xor a diff --git a/home/lcdc.asm b/home/lcdc.asm index dd3fb2fb1..4b350cc28 100644 --- a/home/lcdc.asm +++ b/home/lcdc.asm @@ -7,7 +7,7 @@ LCDC:: ; [C700 + [rLY]] --> [FF00 + [hLCDCPointer]] ldh a, [rLY] ld l, a - ld h, wLYOverrides / $100 + ld h, HIGH(wLYOverrides) ld h, [hl] ; h != not part of pointer ldh a, [hLCDCPointer] ld l, a diff --git a/home/overworld.asm b/home/overworld.asm index 0cd63cf7d..2909b01e9 100644 --- a/home/overworld.asm +++ b/home/overworld.asm @@ -1801,7 +1801,7 @@ LoadMapHeader:: jr asm_0dbd Func_0db5:: ; XXX - farcall LoadUnusedBluesHouseMissableObjectData + farcall LoadMissableObjectData asm_0dbd: ld a, [wCurMapTileset] ld [wUnusedD119], a @@ -2009,7 +2009,7 @@ ReloadMapAfterSurfingMinigame:: call ReloadMapSpriteTilePatterns pop af call BankswitchCommon - jr asm_0f4d + jr FinishReloadingMap ReloadMapAfterPrinter:: ldh a, [hLoadedROMBank] @@ -2019,9 +2019,9 @@ ReloadMapAfterPrinter:: call LoadTileBlockMap pop af call BankswitchCommon -asm_0f4d: +FinishReloadingMap: jpfar SetMapSpecificScriptFlagsOnMapReload - ret ; useless? + ret ; useless ResetMapVariables:: ld a, $98 diff --git a/home/palettes.asm b/home/palettes.asm index 3b944a03a..af66e74ba 100644 --- a/home/palettes.asm +++ b/home/palettes.asm @@ -1,3 +1,6 @@ +InitMapSprites:: + jpfar _InitMapSprites + RestoreScreenTilesAndReloadTilePatterns:: call ClearSprites ld a, $1 diff --git a/home/pikachu.asm b/home/pikachu.asm index c276b3d4b..c9c946352 100755 --- a/home/pikachu.asm +++ b/home/pikachu.asm @@ -56,7 +56,7 @@ SpawnPikachu:: dec a swap a ldh [hTilePlayerStandingOn], a - homecall SpawnPikachu_ ; 3f:46d5 + homecall SpawnPikachu_ ret Pikachu_IsInArray:: diff --git a/home/pikachu_cries.asm b/home/pikachu_cries.asm new file mode 100644 index 000000000..84889ef90 --- /dev/null +++ b/home/pikachu_cries.asm @@ -0,0 +1,46 @@ +PlayPikachuPCM:: + ldh a, [hLoadedROMBank] + push af + ld a, b + call BankswitchCommon + ld a, [hli] + ld c, a + ld a, [hli] + ld b, a +.loop + ld a, [hli] + ld d, a + ld a, $3 +.playSingleSample + dec a + jr nz, .playSingleSample + +REPT 7 + call LoadNextSoundClipSample + call PlaySoundClipSample +ENDR + + call LoadNextSoundClipSample + dec bc + ld a, c + or b + jr nz, .loop + pop af + call BankswitchCommon + ret + +LoadNextSoundClipSample:: + ld a, d + and $80 + srl a + srl a + ldh [rNR32], a + sla d + ret + +PlaySoundClipSample:: + ld a, $3 +.loop + dec a + jr nz, .loop + ret diff --git a/home/print_num.asm b/home/print_num.asm index e2628b1f4..d86527a64 100644 --- a/home/print_num.asm +++ b/home/print_num.asm @@ -1,3 +1,14 @@ +FarPrintText:: +; print text b:hl at (1, 14) + ldh a, [hLoadedROMBank] + push af + ld a, b + call BankswitchCommon + call PrintText + pop af + call BankswitchCommon + ret + PrintNumber:: ; Print the c-digit, b-byte value at de. ; Allows 2 to 7 digits. For 1-digit numbers, add diff --git a/home/text_script.asm b/home/text_script.asm index 1847e23ba..20cfb71d9 100644 --- a/home/text_script.asm +++ b/home/text_script.asm @@ -1,3 +1,7 @@ +UnknownText_2812:: ; unreferenced + text_far _PokemonText + text_end + ; this function is used to display sign messages, sprite dialog, etc. ; INPUT: [hSpriteIndexOrTextID] = sprite ID or text ID DisplayTextID:: diff --git a/layout.link b/layout.link index 1e1b7085d..ef6da3002 100644 --- a/layout.link +++ b/layout.link @@ -44,7 +44,7 @@ ROMX $2 ROMX $3 "bank3" ROMX $4 - "Font Graphics" + "bank4" "NPC Sprites 1" "Battle Engine 1" ROMX $5 @@ -57,7 +57,7 @@ ROMX $6 "Doors and Ledges" ROMX $7 "Maps 3" - "Pokémon Names" + "bank7" "Maps 4" "Hidden Objects 1" ROMX $8 @@ -83,7 +83,7 @@ ROMX $D "Pics 5" "Slot Machines" ROMX $E - "Battle Engine 7" + "Battle Engine 6" ROMX $F "Battle Core" ROMX $10 @@ -104,13 +104,13 @@ ROMX $14 "Hidden Objects 2" ROMX $15 "Maps 11" - "Battle Engine 9" + "Battle Engine 7" "Maps 12" "Diploma" "Trainer Sight" ROMX $16 "Maps 13" - "Battle Engine 10" + "bank16" "Maps 14" "Saffron Guards" ROMX $17 @@ -126,7 +126,7 @@ ROMX $18 ROMX $19 "Tilesets 1" ROMX $1A - "Battle Engine 11" + "Version Graphics" "Tilesets 2" ROMX $1B "Tilesets 3" @@ -184,7 +184,7 @@ ROMX $2E ROMX $2f "Move Names" org $5000 - "bank2f" + "BG Map Attributes" ROMX $30 "bank30" ROMX $31 @@ -204,18 +204,27 @@ ROMX $37 ROMX $38 "Pikachu Cries 13" ROMX $39 - "bank39" + "Pikachu Graphics 1" ROMX $3A "bank3A" -; bank $3b is empty +; bank $3B is empty ROMX $3C - "bank3C" + "Pikachu PCM" + "Tilesets 4" + "Try Pikachu Movement" + "Pikachu Graphics 2" + "Credits" + "Maps 22" + "Hidden Objects Core" ROMX $3D - "bank3D" + "Battle Engine 8" + "Pics 7" + "Battle Engine 9" ROMX $3E - "bank3E" + "Surfing Minigame" ROMX $3F - "bank3F" + "Overworld Pikachu" + "NPC Sprites 3" WRAM0 "WRAM" org $c100 diff --git a/macros.asm b/macros.asm index 3da4a691a..cf7f21efc 100644 --- a/macros.asm +++ b/macros.asm @@ -10,105 +10,4 @@ INCLUDE "macros/scripts/audio.asm" INCLUDE "macros/scripts/maps.asm" INCLUDE "macros/scripts/events.asm" INCLUDE "macros/scripts/text.asm" - -SHADE_BLACK EQU %11 -SHADE_DARK EQU %10 -SHADE_LIGHT EQU %01 -SHADE_WHITE EQU %00 - -setpal: MACRO - ld a, \1 << 6 | \2 << 4 | \3 << 2 | \4 -ENDM - -setpalBGP: MACRO - setpal SHADE_BLACK, SHADE_DARK, SHADE_LIGHT, SHADE_WHITE -ENDM - -setpalOBP: MACRO - setpal SHADE_BLACK, SHADE_DARK, SHADE_WHITE, SHADE_WHITE -ENDM - -homecall_jump: MACRO - ldh a, [hLoadedROMBank] - push af - ld a, BANK(\1) - call BankswitchCommon - call \1 - pop af - jp BankswitchCommon -ENDM - -homecall_jump_sf: MACRO - ldh a, [hLoadedROMBank] - push af - ld a, BANK(\1) - call BankswitchCommon - call \1 - pop bc - ld a, b - jp BankswitchCommon -ENDM - -homecall_sf: MACRO ; homecall but save flags by popping into bc instead of af - ldh a, [hLoadedROMBank] - push af - ld a, BANK(\1) - call BankswitchCommon - call \1 - pop bc - ld a, b - call BankswitchCommon -ENDM - -switchbank: MACRO - ld a, BANK(\1) - call BankswitchCommon -ENDM - -callbs: MACRO - ld a, BANK(\1) - call BankswitchCommon - call \1 -ENDM - -calladb_ModifyPikachuHappiness: MACRO - ld hl, ModifyPikachuHappiness - ld d, \1 - ld b, BANK(ModifyPikachuHappiness) - call Bankswitch -ENDM - -callabd_ModifyPikachuHappiness: MACRO - ld hl, ModifyPikachuHappiness - ld b, BANK(ModifyPikachuHappiness) - ld d, \1 - call Bankswitch -ENDM - -sine_wave: MACRO -; \1: amplitude - -x = 0 - rept $20 - ; Round up. - dw (sin(x) + (sin(x) & $ff)) >> 8 -x = x + (\1) * $40000 - endr -ENDM - -ANIM_OBJ_INDEX EQUS "wAnimatedObject0Index - wAnimatedObject0" -ANIM_OBJ_FRAME_SET EQUS "wAnimatedObject0FramesetID - wAnimatedObject0" -ANIM_OBJ_CALLBACK EQUS "wAnimatedObject0AnimSeqID - wAnimatedObject0" -ANIM_OBJ_TILE EQUS "wAnimatedObject0TileID - wAnimatedObject0" -ANIM_OBJ_X_COORD EQUS "wAnimatedObject0XCoord - wAnimatedObject0" -ANIM_OBJ_Y_COORD EQUS "wAnimatedObject0YCoord - wAnimatedObject0" -ANIM_OBJ_X_OFFSET EQUS "wAnimatedObject0XOffset - wAnimatedObject0" -ANIM_OBJ_Y_OFFSET EQUS "wAnimatedObject0YOffset - wAnimatedObject0" -ANIM_OBJ_DURATION EQUS "wAnimatedObject0Duration - wAnimatedObject0" -ANIM_OBJ_DURATION_OFFSET EQUS "wAnimatedObject0DurationOffset - wAnimatedObject0" -ANIM_OBJ_FRAME_IDX EQUS "wAnimatedObject0FrameIndex - wAnimatedObject0" -ANIM_OBJ_FIELD_B EQU $b -ANIM_OBJ_FIELD_C EQU $c -ANIM_OBJ_FIELD_D EQU $d -ANIM_OBJ_FIELD_E EQU $e -ANIM_OBJ_FIELD_F EQU $f +INCLUDE "macros/scripts/gfx_anims.asm" diff --git a/macros/data.asm b/macros/data.asm index 16742d53d..3f18fb6ee 100755 --- a/macros/data.asm +++ b/macros/data.asm @@ -78,3 +78,12 @@ dbbw: MACRO db \1, \2 dw \3 ENDM + +sine_wave: MACRO +; \1: amplitude +x = 0 +REPT $20 + dw (sin(x) + (sin(x) & $ff)) >> 8 ; round up +x = x + (\1) * $40000 +ENDR +ENDM diff --git a/macros/farcall.asm b/macros/farcall.asm index b4af8b2d7..e6ecdaae0 100644 --- a/macros/farcall.asm +++ b/macros/farcall.asm @@ -31,3 +31,60 @@ homecall: MACRO pop af call BankswitchCommon ENDM + +homecall_jump: MACRO + ldh a, [hLoadedROMBank] + push af + ld a, BANK(\1) + call BankswitchCommon + call \1 + pop af + jp BankswitchCommon +ENDM + +homecall_jump_sf: MACRO + ldh a, [hLoadedROMBank] + push af + ld a, BANK(\1) + call BankswitchCommon + call \1 + pop bc + ld a, b + jp BankswitchCommon +ENDM + +homecall_sf: MACRO ; homecall but save flags by popping into bc instead of af + ldh a, [hLoadedROMBank] + push af + ld a, BANK(\1) + call BankswitchCommon + call \1 + pop bc + ld a, b + call BankswitchCommon +ENDM + +switchbank: MACRO + ld a, BANK(\1) + call BankswitchCommon +ENDM + +callbs: MACRO + ld a, BANK(\1) + call BankswitchCommon + call \1 +ENDM + +calladb_ModifyPikachuHappiness: MACRO + ld hl, ModifyPikachuHappiness + ld d, \1 + ld b, BANK(ModifyPikachuHappiness) + call Bankswitch +ENDM + +callabd_ModifyPikachuHappiness: MACRO + ld hl, ModifyPikachuHappiness + ld b, BANK(ModifyPikachuHappiness) + ld d, \1 + call Bankswitch +ENDM diff --git a/macros/gfx.asm b/macros/gfx.asm index 98eabec44..ad428eb0e 100644 --- a/macros/gfx.asm +++ b/macros/gfx.asm @@ -16,6 +16,18 @@ color EQUS "+ PAL_COLOR_SIZE *" tiles EQUS "* LEN_2BPP_TILE" tile EQUS "+ LEN_2BPP_TILE *" +setpal: MACRO + ld a, \1 << 6 | \2 << 4 | \3 << 2 | \4 +ENDM + +setpalBGP: MACRO + setpal SHADE_BLACK, SHADE_DARK, SHADE_LIGHT, SHADE_WHITE +ENDM + +setpalOBP: MACRO + setpal SHADE_BLACK, SHADE_DARK, SHADE_WHITE, SHADE_WHITE +ENDM + dbsprite: MACRO ; x tile, y tile, x pixel, y pixel, vtile offset, attributes db (\2 * TILE_WIDTH) % $100 + \4, (\1 * TILE_WIDTH) % $100 + \3, \5, \6 diff --git a/macros/scripts/gfx_anims.asm b/macros/scripts/gfx_anims.asm new file mode 100644 index 000000000..f475ad8d4 --- /dev/null +++ b/macros/scripts/gfx_anims.asm @@ -0,0 +1,37 @@ +; pic + oam animations + +frame: MACRO + db \1 +x = \2 +IF _NARG > 2 +REPT _NARG - 2 +x = x | (\3 << 1) + shift +ENDR +ENDC + db x +ENDM + + const_def -1, -1 + + const endanim_command ; $ff +endanim: MACRO + db endanim_command +ENDM + + const dorestart_command ; $fe +dorestart: MACRO + db dorestart_command +ENDM + + const dorepeat_command ; $fd +dorepeat: MACRO + db dorepeat_command + db \1 ; command offset to jump to +ENDM + + const delanim_command ; $fc +delanim: MACRO +; Removes the object from the screen, as opposed to `endanim` which just stops all motion + db delanim_command +ENDM diff --git a/macros/wram.asm b/macros/wram.asm index 41fd1dad4..101636926 100644 --- a/macros/wram.asm +++ b/macros/wram.asm @@ -95,3 +95,23 @@ spritestatedata2: MACRO ds 1 \1End:: ENDM + +animated_object: MACRO +\1Index:: db ; 0 +\1FramesetID:: db ; 1 +\1AnimSeqID:: db ; 2 +\1TileID:: db ; 3 +\1XCoord:: db ; 4 +\1YCoord:: db ; 5 +\1XOffset:: db ; 6 +\1YOffset:: db ; 7 +\1Duration:: db ; 8 +\1DurationOffset:: db ; 9 +\1FrameIndex:: db ; a +\1FieldB:: db ; b +\1FieldC:: db ; c +\1FieldD:: db ; d +\1FieldE:: db ; e +\1FieldF:: db ; f +\1End:: +ENDM diff --git a/main.asm b/main.asm index e94dc292b..795204ddb 100755 --- a/main.asm +++ b/main.asm @@ -70,10 +70,9 @@ INCLUDE "engine/events/hidden_objects/town_map.asm" INCLUDE "engine/events/hidden_objects/pokemon_stuff.asm" -SECTION "Font Graphics", ROMX +SECTION "bank4", ROMX INCLUDE "gfx/font.asm" - INCLUDE "engine/pokemon/status_screen.asm" INCLUDE "engine/menus/party_menu.asm" INCLUDE "gfx/player.asm" @@ -97,6 +96,7 @@ INCLUDE "engine/overworld/map_sprites.asm" SECTION "Battle Engine 2", ROMX + INCLUDE "engine/battle/move_effects/substitute.asm" INCLUDE "engine/menus/pc.asm" @@ -108,7 +108,7 @@ INCLUDE "engine/overworld/doors.asm" INCLUDE "engine/overworld/ledges.asm" -SECTION "Pokémon Names", ROMX +SECTION "bank7", ROMX INCLUDE "engine/movie/oak_speech/clear_save.asm" INCLUDE "engine/events/elevator.asm" @@ -147,26 +147,19 @@ SECTION "Battle Engine 5", ROMX INCLUDE "engine/battle/display_effectiveness.asm" INCLUDE "engine/items/tmhm.asm" - -Func_2fd6a: - callfar IsThisPartymonStarterPikachu_Party - ret nc - ld a, $3 - ld [wPikachuSpawnState], a - ret - +INCLUDE "engine/pikachu/respawn_overworld_pikachu.asm" INCLUDE "engine/battle/scale_sprites.asm" INCLUDE "engine/slots/game_corner_slots2.asm" SECTION "Slot Machines", ROMX -INCLUDE "engine/movie/title2.asm" +INCLUDE "engine/movie/title_rb.asm" INCLUDE "engine/slots/slot_machine.asm" INCLUDE "engine/slots/game_corner_slots.asm" -SECTION "Battle Engine 7", ROMX +SECTION "Battle Engine 6", ROMX INCLUDE "data/moves/moves.asm" INCLUDE "data/pokemon/base_stats.asm" @@ -212,7 +205,7 @@ INCLUDE "engine/events/hidden_objects/fighting_dojo.asm" INCLUDE "engine/events/hidden_objects/indigo_plateau_hq.asm" -SECTION "Battle Engine 9", ROMX +SECTION "Battle Engine 7", ROMX INCLUDE "engine/battle/experience.asm" @@ -227,7 +220,7 @@ SECTION "Trainer Sight", ROMX INCLUDE "engine/overworld/trainer_sight.asm" -SECTION "Battle Engine 10", ROMX +SECTION "bank16", ROMX INCLUDE "engine/pokemon/experience.asm" INCLUDE "engine/pokemon/status_ailments.asm" @@ -270,7 +263,7 @@ INCLUDE "engine/events/hidden_objects/blues_room.asm" INCLUDE "engine/events/hidden_objects/pokecenter_pc.asm" -SECTION "Battle Engine 11", ROMX +SECTION "Version Graphics", ROMX INCLUDE "gfx/version.asm" @@ -312,172 +305,112 @@ SECTION "bank1E", ROMX INCLUDE "engine/battle/animations.asm" INCLUDE "engine/overworld/cut2.asm" INCLUDE "engine/overworld/dust_smoke.asm" - INCLUDE "gfx/fishing.asm" INCLUDE "data/moves/animations.asm" INCLUDE "data/battle_anims/subanimations.asm" INCLUDE "data/battle_anims/frame_blocks.asm" -SECTION "bank2f", ROMX +SECTION "BG Map Attributes", ROMX -INCLUDE "engine/bg_map_attributes.asm" +INCLUDE "engine/gfx/bg_map_attributes.asm" SECTION "bank30", ROMX ; This whole bank is garbage data. -INCBIN "engine/bank30.bin" - - -SECTION "bank39", ROMX - -Pic_e4000: -INCBIN "gfx/pikachu/unknown_e4000.pic" -GFX_e40cc: -INCBIN "gfx/pikachu/unknown_e40cc.2bpp" -Pic_e411c: -INCBIN "gfx/pikachu/unknown_e411c.pic" -GFX_e41d2: -INCBIN "gfx/pikachu/unknown_e41d2.2bpp" -Pic_e4272: -INCBIN "gfx/pikachu/unknown_e4272.pic" -GFX_e4323: -INCBIN "gfx/pikachu/unknown_e4323.2bpp" -Pic_e4383: -INCBIN "gfx/pikachu/unknown_e4383.pic" -GFX_e444b: -INCBIN "gfx/pikachu/unknown_e444b.2bpp" -Pic_e458b: -INCBIN "gfx/pikachu/unknown_e458b.pic" -GFX_e463b: -INCBIN "gfx/pikachu/unknown_e463b.2bpp" -Pic_e467b: -INCBIN "gfx/pikachu/unknown_e467b.pic" -GFX_e472e: -INCBIN "gfx/pikachu/unknown_e472e.2bpp" -Pic_e476e: -INCBIN "gfx/pikachu/unknown_e476e.pic" -GFX_e4841: -INCBIN "gfx/pikachu/unknown_e4841.2bpp" -Pic_e49d1: -INCBIN "gfx/pikachu/unknown_e49d1.pic" -GFX_e4a99: -INCBIN "gfx/pikachu/unknown_e4a99.2bpp" -Pic_e4b39: -INCBIN "gfx/pikachu/unknown_e4b39.pic" -GFX_e4bde: -INCBIN "gfx/pikachu/unknown_e4bde.2bpp" -Pic_e4c3e: -INCBIN "gfx/pikachu/unknown_e4c3e.pic" -GFX_e4ce0: -INCBIN "gfx/pikachu/unknown_e4ce0.2bpp" -GFX_e4e70: -INCBIN "gfx/pikachu/unknown_e4e70.2bpp" -Pic_e5000: -INCBIN "gfx/pikachu/unknown_e5000.pic" -GFX_e50af: -INCBIN "gfx/pikachu/unknown_e50af.2bpp" -Pic_e523f: -INCBIN "gfx/pikachu/unknown_e523f.pic" -GFX_e52fe: -INCBIN "gfx/pikachu/unknown_e52fe.2bpp" -Pic_e548e: -INCBIN "gfx/pikachu/unknown_e548e.pic" -GFX_e5541: -INCBIN "gfx/pikachu/unknown_e5541.2bpp" -Pic_e56d1: -INCBIN "gfx/pikachu/unknown_e56d1.pic" -GFX_e5794: -INCBIN "gfx/pikachu/unknown_e5794.2bpp" -Pic_e5924: -INCBIN "gfx/pikachu/unknown_e5924.pic" -GFX_e59ed: -INCBIN "gfx/pikachu/unknown_e59ed.2bpp" -Pic_e5b7d: -INCBIN "gfx/pikachu/unknown_e5b7d.pic" -GFX_e5c4d: -INCBIN "gfx/pikachu/unknown_e5c4d.2bpp" -Pic_e5ddd: -INCBIN "gfx/pikachu/unknown_e5ddd.pic" -GFX_e5e90: -INCBIN "gfx/pikachu/unknown_e5e90.2bpp" -GFX_e6020: -INCBIN "gfx/pikachu/unknown_e6020.2bpp" -GFX_e61b0: -INCBIN "gfx/pikachu/unknown_e61b0.2bpp" -Pic_e6340: -INCBIN "gfx/pikachu/unknown_e6340.pic" -GFX_e63f7: -INCBIN "gfx/pikachu/unknown_e63f7.2bpp" -Pic_e6587: -INCBIN "gfx/pikachu/unknown_e6587.pic" -GFX_e6646: -INCBIN "gfx/pikachu/unknown_e6646.2bpp" -Pic_e67d6: -INCBIN "gfx/pikachu/unknown_e67d6.pic" -GFX_e682f: -INCBIN "gfx/pikachu/unknown_e682f.2bpp" -GFX_e69bf: -INCBIN "gfx/pikachu/unknown_e69bf.2bpp" -GFX_e6b4f: -INCBIN "gfx/pikachu/unknown_e6b4f.2bpp" -GFX_e6cdf: -INCBIN "gfx/pikachu/unknown_e6cdf.2bpp" -GFX_e6e6f: -INCBIN "gfx/pikachu/unknown_e6e6f.2bpp" -GFX_e6fff: -INCBIN "gfx/pikachu/unknown_e6fff.2bpp" -GFX_e718f: -INCBIN "gfx/pikachu/unknown_e718f.2bpp" -GFX_e731f: -INCBIN "gfx/pikachu/unknown_e731f.2bpp" -GFX_e74af: -INCBIN "gfx/pikachu/unknown_e74af.2bpp" -GFX_e763f: -INCBIN "gfx/pikachu/unknown_e763f.2bpp" -Pic_e77cf: -INCBIN "gfx/pikachu/unknown_e77cf.pic" -GFX_e7863: -INCBIN "gfx/pikachu/unknown_e7863.2bpp" -GFX_e79f3: -INCBIN "gfx/pikachu/unknown_e79f3.2bpp" -GFX_e7b83: -INCBIN "gfx/pikachu/unknown_e7b83.2bpp" -GFX_e7d13: -INCBIN "gfx/pikachu/unknown_e7d13.2bpp" +INCBIN "garbage/bank30.bin" SECTION "bank3A", ROMX INCLUDE "data/pokemon/names.asm" INCLUDE "engine/overworld/is_player_just_outside_map.asm" -INCLUDE "engine/printer.asm" -INCLUDE "engine/diploma_3a.asm" +INCLUDE "engine/printer/serial.asm" +INCLUDE "engine/printer/printer.asm" +INCLUDE "engine/events/diploma2.asm" +INCLUDE "engine/printer/printer2.asm" +INCLUDE "engine/overworld/npc_movement_2.asm" -SurfingPikachu3Graphics: INCBIN "gfx/surfing_pikachu_3.2bpp" -SurfingPikachu3GraphicsEnd: -INCLUDE "engine/unknown_ea3ea.asm" -INCLUDE "engine/overworld/npc_movement_2.asm" +SECTION "Pikachu PCM", ROMX + +INCLUDE "engine/pikachu/pikachu_pcm.asm" +INCLUDE "engine/overworld/advance_player_sprite.asm" +INCLUDE "engine/events/black_out.asm" +INCLUDE "engine/overworld/specific_script_flags.asm" + -; bank $3b is empty +SECTION "Try Pikachu Movement", ROMX -SECTION "bank3C", ROMX +INCLUDE "engine/overworld/unused_load_missable_object_data.asm" +INCLUDE "engine/events/try_pikachu_movement.asm" -INCLUDE "engine/bank3c.asm" +SECTION "Credits", ROMX -SECTION "bank3D", ROMX +INCLUDE "engine/events/pokecenter_chansey.asm" +INCLUDE "engine/movie/credits.asm" -INCLUDE "engine/bank3d.asm" +SECTION "Hidden Objects Core", ROMX -SECTION "bank3E", ROMX +INCLUDE "engine/overworld/hidden_objects.asm" +INCLUDE "engine/events/hidden_objects/vermilion_gym_trash2.asm" -INCLUDE "engine/bank3e.asm" +SECTION "Battle Engine 8", ROMX -SECTION "bank3F", ROMX +INCLUDE "engine/battle/common_text.asm" +INCLUDE "engine/battle/link_battle_versus_text.asm" +INCLUDE "engine/battle/unused_stats_functions.asm" +INCLUDE "engine/battle/scroll_draw_trainer_pic.asm" +INCLUDE "engine/battle/pikachu_entrance_anim.asm" +INCLUDE "engine/battle/decrement_pp.asm" +INCLUDE "engine/events/pikachu_happiness.asm" + + +SECTION "Battle Engine 9", ROMX -INCLUDE "engine/bank3f.asm" +INCLUDE "engine/movie/title_yellow.asm" +INCLUDE "engine/menus/link_menu.asm" +INCLUDE "engine/menus/unused_input.asm" +INCLUDE "engine/overworld/field_move_messages.asm" +INCLUDE "engine/items/inventory.asm" +INCLUDE "gfx/trainer_card.asm" +INCLUDE "engine/items/super_rod.asm" +INCLUDE "engine/battle/init_battle.asm" +INCLUDE "engine/battle/init_battle_variables.asm" +INCLUDE "engine/battle/move_effects/focus_energy.asm" +INCLUDE "engine/battle/move_effects/heal.asm" +INCLUDE "engine/battle/move_effects/transform.asm" +INCLUDE "engine/battle/move_effects/reflect_light_screen.asm" +INCLUDE "engine/battle/move_effects/mist.asm" +INCLUDE "engine/battle/move_effects/one_hit_ko.asm" +INCLUDE "engine/battle/move_effects/pay_day.asm" +INCLUDE "engine/battle/move_effects/paralyze.asm" +INCLUDE "engine/items/tm_prices.asm" +INCLUDE "engine/math/multiply_divide.asm" +INCLUDE "engine/events/give_pokemon.asm" +INCLUDE "engine/battle/get_trainer_name.asm" +INCLUDE "engine/math/random.asm" +INCLUDE "engine/predefs.asm" + + +SECTION "Surfing Minigame", ROMX + +INCLUDE "engine/minigame/surfing_pikachu.asm" +INCLUDE "engine/movie/intro_yellow.asm" +INCLUDE "engine/gfx/animated_objects.asm" + + +SECTION "Overworld Pikachu", ROMX + +INCLUDE "data/maps/songs.asm" +INCLUDE "data/maps/map_header_pointers.asm" +INCLUDE "data/maps/map_header_banks.asm" +INCLUDE "engine/pikachu/pikachu_follow.asm" +INCLUDE "engine/pikachu/pikachu_status.asm" +INCLUDE "engine/pikachu/pikachu_emotions.asm" +INCLUDE "engine/pikachu/pikachu_movement.asm" +INCLUDE "engine/pikachu/pikachu_pic_animation.asm" diff --git a/maps.asm b/maps.asm index 2a7e33920..8a282e639 100644 --- a/maps.asm +++ b/maps.asm @@ -1224,3 +1224,38 @@ INCLUDE "data/maps/headers/AgathasRoom.asm" INCLUDE "scripts/AgathasRoom.asm" INCLUDE "data/maps/objects/AgathasRoom.asm" AgathasRoom_Blocks: INCBIN "maps/AgathasRoom.blk" + + +SECTION "Maps 22", ROMX + +INCLUDE "scripts/ViridianCity2.asm" +INCLUDE "scripts/VermilionCity2.asm" +INCLUDE "scripts/CeladonCity2.asm" +INCLUDE "scripts/Route1_2.asm" +INCLUDE "scripts/Route22_2.asm" +INCLUDE "scripts/RedsHouse1F2.asm" +INCLUDE "scripts/OaksLab2.asm" +INCLUDE "scripts/ViridianSchoolHouse2.asm" +INCLUDE "scripts/Museum1F2.asm" +INCLUDE "scripts/PewterPokecenter2.asm" +INCLUDE "scripts/PokemonTower2F_2.asm" +INCLUDE "scripts/CeladonMart3F_2.asm" +INCLUDE "scripts/CeladonMansion1F_2.asm" +INCLUDE "scripts/CeladonMansion3F_2.asm" +INCLUDE "scripts/GameCorner2.asm" +INCLUDE "scripts/CeladonDiner2.asm" +INCLUDE "scripts/SafariZoneGate2.asm" +INCLUDE "scripts/CinnabarGym3.asm" +INCLUDE "scripts/MtMoonPokecenter2.asm" + +INCLUDE "data/maps/headers/SummerBeachHouse.asm" +INCLUDE "scripts/SummerBeachHouse.asm" +SummerBeachHouse_Blocks: +INCBIN "maps/SummerBeachHouse.blk" +INCLUDE "data/maps/objects/SummerBeachHouse.asm" +INCLUDE "scripts/SummerBeachHouse2.asm" + +INCLUDE "scripts/BillsHouse2.asm" +INCLUDE "scripts/ViridianForest2.asm" +INCLUDE "scripts/SSAnne2FRooms_2.asm" +INCLUDE "scripts/SilphCo11F_2.asm" diff --git a/maps/BeachHouse.blk b/maps/SummerBeachHouse.blk similarity index 100% rename from maps/BeachHouse.blk rename to maps/SummerBeachHouse.blk diff --git a/replace.sh b/replace.sh deleted file mode 100644 index fe0e1ffb9..000000000 --- a/replace.sh +++ /dev/null @@ -1,3 +0,0 @@ -sed -i 's/\<'$1'\>/'$2'/' $(grep -lwr --include "*.asm" --exclude-dir=".git" --exclude-dir="extras" --exclude-dir="pic" --exclude-dir="gfx" $1) -# $1: phrase to find -# $2: phrase to replace $1 \ No newline at end of file diff --git a/scripts/BillsHouse2.asm b/scripts/BillsHouse2.asm index b1c6e8203..ca1a56add 100755 --- a/scripts/BillsHouse2.asm +++ b/scripts/BillsHouse2.asm @@ -83,7 +83,7 @@ BillsHouseText_f24a9: text_far _BillsHouseText_1e8da text_end -Func_f24ae: +Func_f24ae:: ld a, [wCurMap] cp BILLS_HOUSE jr nz, .asm_f24d2 diff --git a/scripts/SSAnneCaptainsRoom.asm b/scripts/SSAnneCaptainsRoom.asm index 593cd872a..9af4744ea 100755 --- a/scripts/SSAnneCaptainsRoom.asm +++ b/scripts/SSAnneCaptainsRoom.asm @@ -45,7 +45,7 @@ SSAnne7RubText: text_far _SSAnne7RubText text_asm ld a, [wAudioROMBank] - cp BANK(AudioEngine3) + cp BANK("Audio Engine 3") ld [wAudioSavedROMBank], a jr nz, .asm_61908 call StopAllMusic diff --git a/scripts/BeachHouse.asm b/scripts/SummerBeachHouse.asm similarity index 60% rename from scripts/BeachHouse.asm rename to scripts/SummerBeachHouse.asm index 2059f59d8..45e8032d3 100644 --- a/scripts/BeachHouse.asm +++ b/scripts/SummerBeachHouse.asm @@ -1,14 +1,14 @@ -BeachHouse_Script: +SummerBeachHouse_Script: call EnableAutoTextBoxDrawing ret -BeachHouse_TextPointers: +SummerBeachHouse_TextPointers: dw SurfinDudeText - dw BeachHousePikachuText - dw BeachHouseSign1Text - dw BeachHouseSign2Text - dw BeachHouseSign3Text - dw BeachHouseSign4Text + dw SummerBeachHousePikachuText + dw SummerBeachHouseSign1Text + dw SummerBeachHouseSign2Text + dw SummerBeachHouseSign3Text + dw SummerBeachHouseSign4Text SurfinDudeText: text_asm @@ -58,74 +58,74 @@ SurfinDudeText: text_far _SurfinDudeText4 text_end -BeachHousePikachuText: +SummerBeachHousePikachuText: text_asm - ld hl, .BeachHousePikachuText + ld hl, .SummerBeachHousePikachuText call PrintText ld a, PIKACHU call PlayCry call WaitForSoundToFinish jp TextScriptEnd -.BeachHousePikachuText - text_far _BeachHousePikachuText +.SummerBeachHousePikachuText + text_far _SummerBeachHousePikachuText text_end -BeachHouseSign1Text: +SummerBeachHouseSign1Text: text_asm - ld hl, .BeachHouseSign1Text2 + ld hl, .SummerBeachHouseSign1Text2 ld a, [wd472] bit 6, a jr z, .next - ld hl, .BeachHouseSign1Text1 + ld hl, .SummerBeachHouseSign1Text1 .next call PrintText jp TextScriptEnd -.BeachHouseSign1Text1 - text_far _BeachHouseSign1Text1 +.SummerBeachHouseSign1Text1 + text_far _SummerBeachHouseSign1Text1 text_end -.BeachHouseSign1Text2 - text_far _BeachHouseSign1Text2 +.SummerBeachHouseSign1Text2 + text_far _SummerBeachHouseSign1Text2 text_end -BeachHouseSign2Text: +SummerBeachHouseSign2Text: text_asm - ld hl, .BeachHouseSign2Text2 + ld hl, .SummerBeachHouseSign2Text2 ld a, [wd472] bit 6, a jr z, .next - ld hl, .BeachHouseSign2Text1 + ld hl, .SummerBeachHouseSign2Text1 .next call PrintText jp TextScriptEnd -.BeachHouseSign2Text1 - text_far _BeachHouseSign2Text1 +.SummerBeachHouseSign2Text1 + text_far _SummerBeachHouseSign2Text1 text_end -.BeachHouseSign2Text2 - text_far _BeachHouseSign2Text2 +.SummerBeachHouseSign2Text2 + text_far _SummerBeachHouseSign2Text2 text_end -BeachHouseSign3Text: +SummerBeachHouseSign3Text: text_asm - ld hl, .BeachHouseSign3Text2 + ld hl, .SummerBeachHouseSign3Text2 ld a, [wd472] bit 6, a jr z, .next - ld hl, .BeachHouseSign3Text1 + ld hl, .SummerBeachHouseSign3Text1 .next call PrintText jp TextScriptEnd -.BeachHouseSign3Text1 - text_far _BeachHouseSign3Text1 +.SummerBeachHouseSign3Text1 + text_far _SummerBeachHouseSign3Text1 text_end -.BeachHouseSign3Text2 - text_far _BeachHouseSign3Text2 +.SummerBeachHouseSign3Text2 + text_far _SummerBeachHouseSign3Text2 text_end -BeachHouseSign4Text: +SummerBeachHouseSign4Text: text_asm ld a, 1 ld [wDoNotWaitForButtonPressAfterDisplayingText], a @@ -139,7 +139,7 @@ BeachHouseSign4Text: ld a, 0 ld [wDoNotWaitForButtonPressAfterDisplayingText], a .next2 - ld hl, .BeachHousePrinterText2 + ld hl, .SummerBeachHousePrinterText2 call PrintText ld a, [wd492] bit 1, a @@ -147,7 +147,7 @@ BeachHouseSign4Text: ld a, 1 ld [wDoNotWaitForButtonPressAfterDisplayingText], a - ld hl, .BeachHousePrinterText3 + ld hl, .SummerBeachHousePrinterText3 call PrintText call YesNoChoice ld a, [wCurrentMenuItem] @@ -172,22 +172,25 @@ BeachHouseSign4Text: ld [wUpdateSpritesEnabled], a jr .asm_f236f .asm_f2369 - ld hl, .BeachHousePrinterText1 + ld hl, .SummerBeachHousePrinterText1 call PrintText .asm_f236f jp TextScriptEnd -.BeachHousePrinterText1 - text_far _BeachHousePrinterText1 +.SummerBeachHousePrinterText1 + text_far _SummerBeachHousePrinterText1 text_waitbutton text_end -.BeachHousePrinterText2 - text_far _BeachHousePrinterText2 + +.SummerBeachHousePrinterText2 + text_far _SummerBeachHousePrinterText2 text_waitbutton text_end -.BeachHousePrinterText3 - text_far _BeachHousePrinterText3 + +.SummerBeachHousePrinterText3 + text_far _SummerBeachHousePrinterText3 text_end -.BeachHousePrinterText4 - text_far _BeachHousePrinterText4 + +.SummerBeachHousePrinterText4 + text_far _SummerBeachHousePrinterText4 text_end diff --git a/scripts/BeachHouse2.asm b/scripts/SummerBeachHouse2.asm similarity index 87% rename from scripts/BeachHouse2.asm rename to scripts/SummerBeachHouse2.asm index 1cf570bcf..4ac1f7059 100755 --- a/scripts/BeachHouse2.asm +++ b/scripts/SummerBeachHouse2.asm @@ -23,11 +23,11 @@ Func_f23d0: jp TextScriptEnd Text_f240c: - text_far _BeachHousePrinterText5 + text_far _SummerBeachHousePrinterText5 text_waitbutton text_end Text_f2412: - text_far _BeachHousePrinterText6 + text_far _SummerBeachHousePrinterText6 text_waitbutton text_end diff --git a/text.asm b/text.asm index 3f76cc984..cb0218198 100644 --- a/text.asm +++ b/text.asm @@ -96,7 +96,7 @@ INCLUDE "text/Route16Gate2F.asm" INCLUDE "text/Route16FlyHouse.asm" INCLUDE "text/Route18Gate1F.asm" INCLUDE "text/Route18Gate2F.asm" -INCLUDE "text/BeachHouse.asm" +INCLUDE "text/SummerBeachHouse.asm" INCLUDE "text/Route22Gate.asm" INCLUDE "text/VictoryRoad2F.asm" INCLUDE "text/BillsHouse.asm" diff --git a/text/BeachHouse.asm b/text/SummerBeachHouse.asm similarity index 76% rename from text/BeachHouse.asm rename to text/SummerBeachHouse.asm index d15e0b9a5..ed28fe069 100644 --- a/text/BeachHouse.asm +++ b/text/SummerBeachHouse.asm @@ -26,11 +26,11 @@ _SurfinDudeText4:: line "on special today!" done -_BeachHousePikachuText:: +_SummerBeachHousePikachuText:: text "PIKACHU: Pikaa" done -_BeachHouseSign1Text1:: +_SummerBeachHouseSign1Text1:: text "SURFIN' DUDE's" line "scribbles..." @@ -39,12 +39,12 @@ _BeachHouseSign1Text1:: cont "hit the groove!" done -_BeachHouseSign1Text2:: +_SummerBeachHouseSign1Text2:: text "30 years of waves!" line "SURFIN' DUDE" done -_BeachHouseSign2Text1:: +_SummerBeachHouseSign2Text1:: text "SURFING TIP 1!" para "After flips, line" @@ -53,12 +53,12 @@ _BeachHouseSign2Text1:: cont "effect!" done -_BeachHouseSign2Text2:: +_SummerBeachHouseSign2Text2:: text "SUMMER BEACH HOUSE" line "#MON welcome!" done -_BeachHouseSign3Text1:: +_SummerBeachHouseSign3Text1:: text "SURFING TIP 2!" para "Pulling flips in" @@ -66,29 +66,29 @@ _BeachHouseSign3Text1:: cont "rad!" done -_BeachHouseSign3Text2:: +_SummerBeachHouseSign3Text2:: text "The sea unites" line "all in surfdom!" done -_BeachHousePrinterText1:: +_SummerBeachHousePrinterText1:: text "It's some sort of" line "a machine...@" text_end -_BeachHousePrinterText2:: +_SummerBeachHousePrinterText2:: text "SUMMER BEACH HOUSE" line "PRINTER, it says.@" text_end -_BeachHousePrinterText3:: +_SummerBeachHousePrinterText3:: text "The Hi-Score is" line "shown." para "PRINT it out?" done -_BeachHousePrinterText4:: +_SummerBeachHousePrinterText4:: text "SUMMER BEACH HOUSE" line "PRINTER, it says." @@ -98,10 +98,10 @@ _BeachHousePrinterText4:: para "PRINT it out?" done -_BeachHousePrinterText5:: +_SummerBeachHousePrinterText5:: text "PRINT completed.@" text_end -_BeachHousePrinterText6:: +_SummerBeachHousePrinterText6:: text "PRINT error!@" text_end diff --git a/wram.asm b/wram.asm index ed482c646..5ff2cebed 100755 --- a/wram.asm +++ b/wram.asm @@ -260,23 +260,8 @@ wAnimatedObjectsData:: wAnimatedObjectStartTileOffsets:: ds 10 * 2 -wAnimatedObjectDataStructs:: -animated_object: macro -\1Index:: db ; 0 -\1FramesetID:: db ; 1 -\1AnimSeqID:: db ; 2 -\1TileID:: db ; 3 -\1XCoord:: db ; 4 -\1YCoord:: db ; 5 -\1XOffset:: db ; 6 -\1YOffset:: db ; 7 -\1Duration:: db ; 8 -\1DurationOffset:: db ; 9 -\1FrameIndex:: db ; a - ds 5 -\1End:: - endm +wAnimatedObjectDataStructs:: wAnimatedObject0:: animated_object wAnimatedObject0 wAnimatedObject1:: animated_object wAnimatedObject1 wAnimatedObject2:: animated_object wAnimatedObject2 @@ -771,7 +756,7 @@ wPikaPicAnimObjectDataBuffer:: wNumStepsToTake:: ; used in Pallet Town scripted movement ds 23 -wPikaPicAnimObjectDataBufferEnd:: ;ccb8 +wPikaPicAnimObjectDataBufferEnd:: ds 26 wRLEByteCount:: @@ -3506,12 +3491,12 @@ wBoxMonNicksEnd:: wBoxDataEnd:: wGBCBasePalPointers:: ds NUM_ACTIVE_PALS * 2 -wGBCPal:: ds PAL_SIZE +wGBCPal:: ds PALETTE_SIZE wLastBGP:: ds 1 wLastOBP0:: ds 1 wLastOBP1:: ds 1 wdef5:: ds 1 -wBGPPalsBuffer:: ds NUM_ACTIVE_PALS * PAL_SIZE +wBGPPalsBuffer:: ds NUM_ACTIVE_PALS * PALETTE_SIZE SECTION "Stack", WRAMX wStack::