From 242b2e05cf30bc47a53167baf6bd3134d1f47d18 Mon Sep 17 00:00:00 2001 From: SatoMew Date: Sun, 29 Nov 2020 20:17:29 +0000 Subject: Label and document hFFD7 more accurately --- engine/battle/core.asm | 6 +++--- engine/battle/init_battle_variables.asm | 2 +- engine/menus/league_pc.asm | 6 +++--- engine/menus/pokedex.asm | 6 +++--- engine/menus/save.asm | 4 ++-- engine/menus/start_sub_menus.asm | 6 +++--- engine/movie/evolution.asm | 2 +- engine/movie/hall_of_fame.asm | 2 +- engine/movie/oak_speech/oak_speech.asm | 2 +- engine/movie/title.asm | 2 +- engine/overworld/tilesets.asm | 2 +- engine/overworld/update_map.asm | 6 +++--- engine/pokemon/evos_moves.asm | 4 ++-- engine/pokemon/status_screen.asm | 12 ++++++------ home/init.asm | 2 +- home/overworld.asm | 2 +- home/pokemon.asm | 10 +++++----- home/vcopy.asm | 4 ++-- hram.asm | 10 +++++----- 19 files changed, 45 insertions(+), 45 deletions(-) diff --git a/engine/battle/core.asm b/engine/battle/core.asm index 5ea60cb4..7957c552 100644 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -51,7 +51,7 @@ SlidePlayerAndEnemySilhouettesOnScreen: ldh [hWY], a ldh [rWY], a xor a - ldh [hTilesetType], a + ldh [hTileAnimations], a ldh [hSCY], a dec a ld [wUpdateSpritesEnabled], a @@ -6275,7 +6275,7 @@ DoBattleTransitionAndInitBattleVariables: ldh [hAutoBGTransferEnabled], a ldh [hWY], a ldh [rWY], a - ldh [hTilesetType], a + ldh [hTileAnimations], a ld hl, wPlayerStatsToDouble ld [hli], a ld [hli], a @@ -6866,7 +6866,7 @@ _InitBattleCommon: pop af ld [wMapPalOffset], a ld a, [wSavedTilesetType] - ldh [hTilesetType], a + ldh [hTileAnimations], a scf ret .emptyString diff --git a/engine/battle/init_battle_variables.asm b/engine/battle/init_battle_variables.asm index 0d403b55..703f5f07 100644 --- a/engine/battle/init_battle_variables.asm +++ b/engine/battle/init_battle_variables.asm @@ -1,5 +1,5 @@ InitBattleVariables: - ldh a, [hTilesetType] + ldh a, [hTileAnimations] ld [wSavedTilesetType], a xor a ld [wActionResultOrTookBattleTurn], a diff --git a/engine/menus/league_pc.asm b/engine/menus/league_pc.asm index f2107c49..533454ad 100644 --- a/engine/menus/league_pc.asm +++ b/engine/menus/league_pc.asm @@ -6,10 +6,10 @@ PKMNLeaguePC: push hl ld a, [wUpdateSpritesEnabled] push af - ldh a, [hTilesetType] + ldh a, [hTileAnimations] push af xor a - ldh [hTilesetType], a + ldh [hTileAnimations], a ld [wSpriteFlipped], a ld [wUpdateSpritesEnabled], a ld [wHoFTeamIndex2], a @@ -40,7 +40,7 @@ PKMNLeaguePC: jr nz, .loop .doneShowingTeams pop af - ldh [hTilesetType], a + ldh [hTileAnimations], a pop af ld [wUpdateSpritesEnabled], a pop hl diff --git a/engine/menus/pokedex.asm b/engine/menus/pokedex.asm index 5660ecfb..2af8d714 100644 --- a/engine/menus/pokedex.asm +++ b/engine/menus/pokedex.asm @@ -410,10 +410,10 @@ ShowPokedexDataInternal: call RunPaletteCommand pop af ld [wd11e], a - ldh a, [hTilesetType] + ldh a, [hTileAnimations] push af xor a - ldh [hTilesetType], a + ldh [hTileAnimations], a hlcoord 0, 0 ld de, 1 @@ -577,7 +577,7 @@ ShowPokedexDataInternal: and A_BUTTON | B_BUTTON jr z, .waitForButtonPress pop af - ldh [hTilesetType], a + ldh [hTileAnimations], a call GBPalWhiteOut call ClearScreen call RunDefaultPaletteCommand diff --git a/engine/menus/save.asm b/engine/menus/save.asm index 45fed8a6..72c33d8e 100644 --- a/engine/menus/save.asm +++ b/engine/menus/save.asm @@ -70,7 +70,7 @@ LoadSAV0: ld bc, wSpriteDataEnd - wSpriteDataStart call CopyData ld a, [sTilesetType] - ldh [hTilesetType], a + ldh [hTileAnimations], a ld hl, sCurBoxData ld de, wBoxDataStart ld bc, wBoxDataEnd - wBoxDataStart @@ -217,7 +217,7 @@ SaveSAVtoSRAM0: ld de, sCurBoxData ld bc, wBoxDataEnd - wBoxDataStart call CopyData - ldh a, [hTilesetType] + ldh a, [hTileAnimations] ld [sTilesetType], a ld hl, sPlayerName ld bc, sMainDataCheckSum - sPlayerName diff --git a/engine/menus/start_sub_menus.asm b/engine/menus/start_sub_menus.asm index 6a98a10c..c0448121 100644 --- a/engine/menus/start_sub_menus.asm +++ b/engine/menus/start_sub_menus.asm @@ -454,10 +454,10 @@ StartMenu_TrainerInfo:: call GBPalWhiteOut call ClearScreen call UpdateSprites - ldh a, [hTilesetType] + ldh a, [hTileAnimations] push af xor a - ldh [hTilesetType], a + ldh [hTileAnimations], a call DrawTrainerInfo predef DrawBadges ; draw badges ld b, SET_PAL_TRAINER_CARD @@ -471,7 +471,7 @@ StartMenu_TrainerInfo:: call ReloadMapData call LoadGBPal pop af - ldh [hTilesetType], a + ldh [hTileAnimations], a jp RedisplayStartMenu ; loads tile patterns and draws everything except for gym leader faces / badges diff --git a/engine/movie/evolution.asm b/engine/movie/evolution.asm index cabe7254..77840556 100644 --- a/engine/movie/evolution.asm +++ b/engine/movie/evolution.asm @@ -19,7 +19,7 @@ EvolveMon: call Delay3 xor a ldh [hAutoBGTransferEnabled], a - ldh [hTilesetType], a + ldh [hTileAnimations], a ld a, [wEvoOldSpecies] ld [wWholeScreenPaletteMonSpecies], a ld c, 0 diff --git a/engine/movie/hall_of_fame.asm b/engine/movie/hall_of_fame.asm index a7d3ed40..d37d95f8 100644 --- a/engine/movie/hall_of_fame.asm +++ b/engine/movie/hall_of_fame.asm @@ -19,7 +19,7 @@ AnimateHallOfFame: call FillMemory xor a ld [wUpdateSpritesEnabled], a - ldh [hTilesetType], a + ldh [hTileAnimations], a ld [wSpriteFlipped], a ld [wLetterPrintingDelayFlags], a ; no delay ld [wHoFMonOrPlayer], a ; mon diff --git a/engine/movie/oak_speech/oak_speech.asm b/engine/movie/oak_speech/oak_speech.asm index 4b64f20d..93cdfaab 100644 --- a/engine/movie/oak_speech/oak_speech.asm +++ b/engine/movie/oak_speech/oak_speech.asm @@ -52,7 +52,7 @@ OakSpeech: ld [wDestinationMap], a call SpecialWarpIn xor a - ldh [hTilesetType], a + ldh [hTileAnimations], a ld a, [wd732] bit 1, a ; possibly a debug mode bit jp nz, .skipChoosingNames diff --git a/engine/movie/title.asm b/engine/movie/title.asm index ef015795..8f97f8fa 100644 --- a/engine/movie/title.asm +++ b/engine/movie/title.asm @@ -26,7 +26,7 @@ DisplayTitleScreen: ld a, $1 ldh [hAutoBGTransferEnabled], a xor a - ldh [hTilesetType], a + ldh [hTileAnimations], a ldh [hSCX], a ld a, $40 ldh [hSCY], a diff --git a/engine/overworld/tilesets.asm b/engine/overworld/tilesets.asm index f40cbbc2..fa5cf626 100644 --- a/engine/overworld/tilesets.asm +++ b/engine/overworld/tilesets.asm @@ -23,7 +23,7 @@ LoadTilesetHeader: dec c jr nz, .copyTilesetHeaderLoop ld a, [hl] - ldh [hTilesetType], a + ldh [hTileAnimations], a xor a ldh [hMovingBGTilesCounter1], a pop hl diff --git a/engine/overworld/update_map.asm b/engine/overworld/update_map.asm index 53a5592d..26334733 100644 --- a/engine/overworld/update_map.asm +++ b/engine/overworld/update_map.asm @@ -52,11 +52,11 @@ RedrawMapView: ret z ldh a, [hAutoBGTransferEnabled] push af - ldh a, [hTilesetType] + ldh a, [hTileAnimations] push af xor a ldh [hAutoBGTransferEnabled], a - ldh [hTilesetType], a ; no flower/water BG tile animations + ldh [hTileAnimations], a ; no flower/water BG tile animations call LoadCurrentMapView call RunDefaultPaletteCommand ld hl, wMapViewVRAMPointer @@ -112,7 +112,7 @@ RedrawMapView: dec c jr nz, .redrawRowLoop pop af - ldh [hTilesetType], a + ldh [hTileAnimations], a pop af ldh [hAutoBGTransferEnabled], a ret diff --git a/engine/pokemon/evos_moves.asm b/engine/pokemon/evos_moves.asm index ed44f9a6..21b1c9f4 100644 --- a/engine/pokemon/evos_moves.asm +++ b/engine/pokemon/evos_moves.asm @@ -11,7 +11,7 @@ TryEvolvingMon: ; this is only called after battle ; it is supposed to do level up evolutions, though there is a bug that allows item evolutions to occur EvolutionAfterBattle: - ldh a, [hTilesetType] + ldh a, [hTileAnimations] push af xor a ld [wEvolutionOccurred], a @@ -245,7 +245,7 @@ Evolution_PartyMonLoop: ; loop over party mons pop bc pop hl pop af - ldh [hTilesetType], a + ldh [hTileAnimations], a ld a, [wLinkState] cp LINK_STATE_TRADING ret z diff --git a/engine/pokemon/status_screen.asm b/engine/pokemon/status_screen.asm index d4a4e59a..33fef9e4 100644 --- a/engine/pokemon/status_screen.asm +++ b/engine/pokemon/status_screen.asm @@ -101,10 +101,10 @@ StatusScreen: ld hl, vChars2 tile $72 lb bc, BANK(PTile), 1 call CopyVideoDataDouble ; bold P (for PP) - ldh a, [hTilesetType] + ldh a, [hTileAnimations] push af xor a - ldh [hTilesetType], a + ldh [hTileAnimations], a hlcoord 19, 1 lb bc, 6, 10 call DrawLineBox ; Draws the box around name, HP and status @@ -174,7 +174,7 @@ StatusScreen: call PlayCry ; play Pokémon cry call WaitForTextScrollButtonPress ; wait for button pop af - ldh [hTilesetType], a + ldh [hTileAnimations], a ret .GetStringPointer @@ -296,10 +296,10 @@ StatsText: next "SPECIAL@" StatusScreen2: - ldh a, [hTilesetType] + ldh a, [hTileAnimations] push af xor a - ldh [hTilesetType], a + ldh [hTileAnimations], a ldh [hAutoBGTransferEnabled], a ld bc, NUM_MOVES + 1 ld hl, wMoves @@ -429,7 +429,7 @@ StatusScreen2: call Delay3 call WaitForTextScrollButtonPress ; wait for button pop af - ldh [hTilesetType], a + ldh [hTileAnimations], a ld hl, wd72c res 1, [hl] ld a, $77 diff --git a/home/init.asm b/home/init.asm index fe7dc9a9..e5840e65 100644 --- a/home/init.asm +++ b/home/init.asm @@ -65,7 +65,7 @@ rLCDC_DEFAULT EQU %11100011 call WriteDMACodeToHRAM xor a - ldh [hTilesetType], a + ldh [hTileAnimations], a ldh [rSTAT], a ldh [hSCX], a ldh [hSCY], a diff --git a/home/overworld.asm b/home/overworld.asm index a9cfba24..be2c5d55 100644 --- a/home/overworld.asm +++ b/home/overworld.asm @@ -813,7 +813,7 @@ LoadPlayerSpriteGraphics:: dec a jr z, .ridingBike - ldh a, [hTilesetType] + ldh a, [hTileAnimations] and a jr nz, .determineGraphics jr .startWalking diff --git a/home/pokemon.asm b/home/pokemon.asm index 5406c0ad..af83f7a0 100644 --- a/home/pokemon.asm +++ b/home/pokemon.asm @@ -175,10 +175,10 @@ GetCryData:: ret DisplayPartyMenu:: - ldh a, [hTilesetType] + ldh a, [hTileAnimations] push af xor a - ldh [hTilesetType], a + ldh [hTileAnimations], a call GBPalWhiteOutWithDelay3 call ClearSprites call PartyMenuInit @@ -186,10 +186,10 @@ DisplayPartyMenu:: jp HandlePartyMenuInput GoBackToPartyMenu:: - ldh a, [hTilesetType] + ldh a, [hTileAnimations] push af xor a - ldh [hTilesetType], a + ldh [hTileAnimations], a call PartyMenuInit call RedrawPartyMenu jp HandlePartyMenuInput @@ -251,7 +251,7 @@ HandlePartyMenuInput:: and a jp nz, .swappingPokemon pop af - ldh [hTilesetType], a + ldh [hTileAnimations], a bit 1, b jr nz, .noPokemonChosen ld a, [wPartyCount] diff --git a/home/vcopy.asm b/home/vcopy.asm index 458fa610..882773a8 100644 --- a/home/vcopy.asm +++ b/home/vcopy.asm @@ -379,7 +379,7 @@ UpdateMovingBgTiles:: ; Animate water and flower ; tiles in the overworld. - ldh a, [hTilesetType] + ldh a, [hTileAnimations] and a ret z ; no animations if indoors (or if a menu set this to 0) @@ -417,7 +417,7 @@ UpdateMovingBgTiles:: dec c jr nz, .left .done - ldh a, [hTilesetType] + ldh a, [hTileAnimations] rrca ret nc ; if in a cave, no flower animations diff --git a/hram.asm b/hram.asm index 0ccbc60c..f3567cd9 100644 --- a/hram.asm +++ b/hram.asm @@ -277,11 +277,11 @@ hFrameCounter:: db ; decremented every V-blank (used for delays) ; you can detect that the V-blank handler has run since then. hVBlankOccurred:: db -; 00 = indoor -; 01 = cave -; 02 = outdoor -; this is often set to 00 in order to turn off water and flower BG tile animations -hTilesetType:: db +; Controls whether flower and water tiles are animated. +; 00 = flowers and water are static (breaks Surf) +; 01 = flowers are static, water is animated +; 02 = flowers and water are animated +hTileAnimations:: db hMovingBGTilesCounter1:: db -- cgit v1.2.3 From a7dca30971a049a525e33bc43eaf2b18ce899c5e Mon Sep 17 00:00:00 2001 From: SatoMew Date: Sun, 29 Nov 2020 21:10:36 +0000 Subject: Identify what became GSC's Key Item fanfare --- audio.asm | 2 +- audio/sfx/unreferenced_fanfare.asm | 57 ++++++++++++++++++++++++++++++++++++++ audio/sfx/unused2_2.asm | 56 ------------------------------------- 3 files changed, 58 insertions(+), 57 deletions(-) create mode 100644 audio/sfx/unreferenced_fanfare.asm delete mode 100644 audio/sfx/unused2_2.asm diff --git a/audio.asm b/audio.asm index 7b8ceab7..f6646476 100644 --- a/audio.asm +++ b/audio.asm @@ -411,7 +411,7 @@ INCLUDE "audio/music/pokecenter.asm" SECTION "Music 2", ROMX INCLUDE "audio/sfx/pokeflute_ch5_ch6.asm" -INCLUDE "audio/sfx/unused2_2.asm" +INCLUDE "audio/sfx/unreferenced_fanfare.asm" INCLUDE "audio/music/gymleaderbattle.asm" INCLUDE "audio/music/trainerbattle.asm" INCLUDE "audio/music/wildbattle.asm" diff --git a/audio/sfx/unreferenced_fanfare.asm b/audio/sfx/unreferenced_fanfare.asm new file mode 100644 index 00000000..ffd1ad3b --- /dev/null +++ b/audio/sfx/unreferenced_fanfare.asm @@ -0,0 +1,57 @@ +; This corresponds to SFX_KEY_ITEM in pokegold and pokecrystal. +SFX_Unused2_Ch5: + execute_music + tempo 256 + volume 7, 7 + vibrato 6, 2, 6 + duty_cycle 2 + toggle_perfect_pitch + note_type 6, 11, 1 + octave 3 + note G#, 2 + note G#, 2 + note_type 6, 11, 3 + note G#, 2 + note B_, 2 + octave 4 + note E_, 8 + sound_ret + + +SFX_Unused2_Ch6: + execute_music + vibrato 8, 2, 7 + duty_cycle 2 + note_type 6, 12, 1 + octave 4 + note E_, 2 + note E_, 1 + note E_, 1 + note_type 6, 12, 3 + note E_, 2 + note G#, 2 + note B_, 8 + sound_ret + + +SFX_Unused2_Ch7: + execute_music + note_type 6, 1, 0 + octave 4 + note B_, 1 + rest 1 + note_type 3, 1, 0 + note B_, 1 + rest 1 + note B_, 1 + rest 1 + note_type 6, 1, 0 + note B_, 1 + rest 1 + octave 5 + note E_, 1 + rest 1 + octave 4 + note B_, 4 + rest 4 + sound_ret diff --git a/audio/sfx/unused2_2.asm b/audio/sfx/unused2_2.asm deleted file mode 100644 index aa93f91c..00000000 --- a/audio/sfx/unused2_2.asm +++ /dev/null @@ -1,56 +0,0 @@ -SFX_Unused2_Ch5: - execute_music - tempo 256 - volume 7, 7 - vibrato 6, 2, 6 - duty_cycle 2 - toggle_perfect_pitch - note_type 6, 11, 1 - octave 3 - note G#, 2 - note G#, 2 - note_type 6, 11, 3 - note G#, 2 - note B_, 2 - octave 4 - note E_, 8 - sound_ret - - -SFX_Unused2_Ch6: - execute_music - vibrato 8, 2, 7 - duty_cycle 2 - note_type 6, 12, 1 - octave 4 - note E_, 2 - note E_, 1 - note E_, 1 - note_type 6, 12, 3 - note E_, 2 - note G#, 2 - note B_, 8 - sound_ret - - -SFX_Unused2_Ch7: - execute_music - note_type 6, 1, 0 - octave 4 - note B_, 1 - rest 1 - note_type 3, 1, 0 - note B_, 1 - rest 1 - note B_, 1 - rest 1 - note_type 6, 1, 0 - note B_, 1 - rest 1 - octave 5 - note E_, 1 - rest 1 - octave 4 - note B_, 4 - rest 4 - sound_ret -- cgit v1.2.3 From 083cb38e33891d58158762ac2580bd3b62fcdaec Mon Sep 17 00:00:00 2001 From: SatoMew Date: Sun, 29 Nov 2020 21:28:38 +0000 Subject: Update related tile animation constants --- constants/map_data_constants.asm | 8 +++--- data/tilesets/tileset_headers.asm | 48 ++++++++++++++++----------------- engine/battle/core.asm | 2 +- engine/battle/init_battle_variables.asm | 2 +- engine/menus/save.asm | 4 +-- sram.asm | 2 +- wram.asm | 2 +- 7 files changed, 34 insertions(+), 34 deletions(-) diff --git a/constants/map_data_constants.asm b/constants/map_data_constants.asm index 5efd9928..bd55f753 100644 --- a/constants/map_data_constants.asm +++ b/constants/map_data_constants.asm @@ -9,8 +9,8 @@ MAP_BORDER EQU 3 shift_const SOUTH ; 4 shift_const NORTH ; 8 -; tileset environments +; flower and water tile animations const_def - const INDOOR ; 0 - const CAVE ; 1 - const OUTDOOR ; 2 + const STATIC_FLOWERS_WATER ; 0 + const STATIC_FLOWERS_ANIMATED_WATER ; 1 + const ANIMATED_FLOWERS_WATER ; 2 diff --git a/data/tilesets/tileset_headers.asm b/data/tilesets/tileset_headers.asm index 998c6cb1..5c60a55d 100644 --- a/data/tilesets/tileset_headers.asm +++ b/data/tilesets/tileset_headers.asm @@ -8,27 +8,27 @@ ENDM Tilesets: ; block, gfx, coll, 3 counter tiles, grass tile, permission - tileset Overworld_Block, Overworld_GFX, Overworld_Coll, $FF,$FF,$FF, $52, OUTDOOR - tileset RedsHouse1_Block, RedsHouse1_GFX, RedsHouse1_Coll, $FF,$FF,$FF, $FF, INDOOR - tileset Mart_Block, Mart_GFX, Mart_Coll, $18,$19,$1E, $FF, INDOOR - tileset Forest_Block, Forest_GFX, Forest_Coll, $FF,$FF,$FF, $20, CAVE - tileset RedsHouse2_Block, RedsHouse2_GFX, RedsHouse2_Coll, $FF,$FF,$FF, $FF, INDOOR - tileset Dojo_Block, Dojo_GFX, Dojo_Coll, $3A,$FF,$FF, $FF, OUTDOOR - tileset Pokecenter_Block, Pokecenter_GFX, Pokecenter_Coll, $18,$19,$1E, $FF, INDOOR - tileset Gym_Block, Gym_GFX, Gym_Coll, $3A,$FF,$FF, $FF, OUTDOOR - tileset House_Block, House_GFX, House_Coll, $FF,$FF,$FF, $FF, INDOOR - tileset ForestGate_Block, ForestGate_GFX, ForestGate_Coll, $17,$32,$FF, $FF, INDOOR - tileset Museum_Block, Museum_GFX, Museum_Coll, $17,$32,$FF, $FF, INDOOR - tileset Underground_Block, Underground_GFX, Underground_Coll, $FF,$FF,$FF, $FF, INDOOR - tileset Gate_Block, Gate_GFX, Gate_Coll, $17,$32,$FF, $FF, INDOOR - tileset Ship_Block, Ship_GFX, Ship_Coll, $FF,$FF,$FF, $FF, CAVE - tileset ShipPort_Block, ShipPort_GFX, ShipPort_Coll, $FF,$FF,$FF, $FF, CAVE - tileset Cemetery_Block, Cemetery_GFX, Cemetery_Coll, $12,$FF,$FF, $FF, INDOOR - tileset Interior_Block, Interior_GFX, Interior_Coll, $FF,$FF,$FF, $FF, INDOOR - tileset Cavern_Block, Cavern_GFX, Cavern_Coll, $FF,$FF,$FF, $FF, CAVE - tileset Lobby_Block, Lobby_GFX, Lobby_Coll, $15,$36,$FF, $FF, INDOOR - tileset Mansion_Block, Mansion_GFX, Mansion_Coll, $FF,$FF,$FF, $FF, INDOOR - tileset Lab_Block, Lab_GFX, Lab_Coll, $FF,$FF,$FF, $FF, INDOOR - tileset Club_Block, Club_GFX, Club_Coll, $07,$17,$FF, $FF, INDOOR - tileset Facility_Block, Facility_GFX, Facility_Coll, $12,$FF,$FF, $FF, CAVE - tileset Plateau_Block, Plateau_GFX, Plateau_Coll, $FF,$FF,$FF, $45, CAVE + tileset Overworld_Block, Overworld_GFX, Overworld_Coll, $FF,$FF,$FF, $52, ANIMATED_FLOWERS_WATER + tileset RedsHouse1_Block, RedsHouse1_GFX, RedsHouse1_Coll, $FF,$FF,$FF, $FF, STATIC_FLOWERS_WATER + tileset Mart_Block, Mart_GFX, Mart_Coll, $18,$19,$1E, $FF, STATIC_FLOWERS_WATER + tileset Forest_Block, Forest_GFX, Forest_Coll, $FF,$FF,$FF, $20, STATIC_FLOWERS_ANIMATED_WATER + tileset RedsHouse2_Block, RedsHouse2_GFX, RedsHouse2_Coll, $FF,$FF,$FF, $FF, STATIC_FLOWERS_WATER + tileset Dojo_Block, Dojo_GFX, Dojo_Coll, $3A,$FF,$FF, $FF, ANIMATED_FLOWERS_WATER + tileset Pokecenter_Block, Pokecenter_GFX, Pokecenter_Coll, $18,$19,$1E, $FF, STATIC_FLOWERS_WATER + tileset Gym_Block, Gym_GFX, Gym_Coll, $3A,$FF,$FF, $FF, ANIMATED_FLOWERS_WATER + tileset House_Block, House_GFX, House_Coll, $FF,$FF,$FF, $FF, STATIC_FLOWERS_WATER + tileset ForestGate_Block, ForestGate_GFX, ForestGate_Coll, $17,$32,$FF, $FF, STATIC_FLOWERS_WATER + tileset Museum_Block, Museum_GFX, Museum_Coll, $17,$32,$FF, $FF, STATIC_FLOWERS_WATER + tileset Underground_Block, Underground_GFX, Underground_Coll, $FF,$FF,$FF, $FF, STATIC_FLOWERS_WATER + tileset Gate_Block, Gate_GFX, Gate_Coll, $17,$32,$FF, $FF, STATIC_FLOWERS_WATER + tileset Ship_Block, Ship_GFX, Ship_Coll, $FF,$FF,$FF, $FF, STATIC_FLOWERS_ANIMATED_WATER + tileset ShipPort_Block, ShipPort_GFX, ShipPort_Coll, $FF,$FF,$FF, $FF, STATIC_FLOWERS_ANIMATED_WATER + tileset Cemetery_Block, Cemetery_GFX, Cemetery_Coll, $12,$FF,$FF, $FF, STATIC_FLOWERS_WATER + tileset Interior_Block, Interior_GFX, Interior_Coll, $FF,$FF,$FF, $FF, STATIC_FLOWERS_WATER + tileset Cavern_Block, Cavern_GFX, Cavern_Coll, $FF,$FF,$FF, $FF, STATIC_FLOWERS_ANIMATED_WATER + tileset Lobby_Block, Lobby_GFX, Lobby_Coll, $15,$36,$FF, $FF, STATIC_FLOWERS_WATER + tileset Mansion_Block, Mansion_GFX, Mansion_Coll, $FF,$FF,$FF, $FF, STATIC_FLOWERS_WATER + tileset Lab_Block, Lab_GFX, Lab_Coll, $FF,$FF,$FF, $FF, STATIC_FLOWERS_WATER + tileset Club_Block, Club_GFX, Club_Coll, $07,$17,$FF, $FF, STATIC_FLOWERS_WATER + tileset Facility_Block, Facility_GFX, Facility_Coll, $12,$FF,$FF, $FF, STATIC_FLOWERS_ANIMATED_WATER + tileset Plateau_Block, Plateau_GFX, Plateau_Coll, $FF,$FF,$FF, $45, STATIC_FLOWERS_ANIMATED_WATER diff --git a/engine/battle/core.asm b/engine/battle/core.asm index 7957c552..417516ae 100644 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -6865,7 +6865,7 @@ _InitBattleCommon: ld [wLetterPrintingDelayFlags], a pop af ld [wMapPalOffset], a - ld a, [wSavedTilesetType] + ld a, [wSavedTileAnimations] ldh [hTileAnimations], a scf ret diff --git a/engine/battle/init_battle_variables.asm b/engine/battle/init_battle_variables.asm index 703f5f07..dd9f9714 100644 --- a/engine/battle/init_battle_variables.asm +++ b/engine/battle/init_battle_variables.asm @@ -1,6 +1,6 @@ InitBattleVariables: ldh a, [hTileAnimations] - ld [wSavedTilesetType], a + ld [wSavedTileAnimations], a xor a ld [wActionResultOrTookBattleTurn], a ld [wBattleResult], a diff --git a/engine/menus/save.asm b/engine/menus/save.asm index 72c33d8e..194fb810 100644 --- a/engine/menus/save.asm +++ b/engine/menus/save.asm @@ -69,7 +69,7 @@ LoadSAV0: ld de, wSpriteDataStart ld bc, wSpriteDataEnd - wSpriteDataStart call CopyData - ld a, [sTilesetType] + ld a, [sTileAnimations] ldh [hTileAnimations], a ld hl, sCurBoxData ld de, wBoxDataStart @@ -218,7 +218,7 @@ SaveSAVtoSRAM0: ld bc, wBoxDataEnd - wBoxDataStart call CopyData ldh a, [hTileAnimations] - ld [sTilesetType], a + ld [sTileAnimations], a ld hl, sPlayerName ld bc, sMainDataCheckSum - sPlayerName call SAVCheckSum diff --git a/sram.asm b/sram.asm index 07cfdfba..48542dc7 100644 --- a/sram.asm +++ b/sram.asm @@ -17,7 +17,7 @@ sMainData:: ds wMainDataEnd - wMainDataStart sSpriteData:: ds wSpriteDataEnd - wSpriteDataStart sPartyData:: ds wPartyDataEnd - wPartyDataStart sCurBoxData:: ds wBoxDataEnd - wBoxDataStart -sTilesetType:: ds 1 +sTileAnimations:: ds 1 sMainDataCheckSum:: ds 1 diff --git a/wram.asm b/wram.asm index 3aca2431..3b1052d9 100644 --- a/wram.asm +++ b/wram.asm @@ -2000,7 +2000,7 @@ wMonHLearnset:: ds 1 wMonHeaderEnd:: -wSavedTilesetType:: +wSavedTileAnimations:: ; saved at the start of a battle and then written back at the end of the battle ds 1 -- cgit v1.2.3 From 3756ec6dd94daf1ea5826f9bd9e30e00087f242f Mon Sep 17 00:00:00 2001 From: SatoMew Date: Sun, 29 Nov 2020 22:07:26 +0000 Subject: Improve new constants and comment based on feedback --- constants/map_data_constants.asm | 14 ++++++------ data/tilesets/tileset_headers.asm | 48 +++++++++++++++++++-------------------- hram.asm | 8 +++---- 3 files changed, 35 insertions(+), 35 deletions(-) diff --git a/constants/map_data_constants.asm b/constants/map_data_constants.asm index bd55f753..605e7013 100644 --- a/constants/map_data_constants.asm +++ b/constants/map_data_constants.asm @@ -4,13 +4,13 @@ MAP_BORDER EQU 3 ; connection directions const_def - shift_const EAST ; 1 - shift_const WEST ; 2 - shift_const SOUTH ; 4 - shift_const NORTH ; 8 + shift_const EAST ; 1 + shift_const WEST ; 2 + shift_const SOUTH ; 4 + shift_const NORTH ; 8 ; flower and water tile animations const_def - const STATIC_FLOWERS_WATER ; 0 - const STATIC_FLOWERS_ANIMATED_WATER ; 1 - const ANIMATED_FLOWERS_WATER ; 2 + const TILEANIM_NONE ; 0 + const TILEANIM_WATER ; 1 + const TILEANIM_WATER_FLOWER ; 2 diff --git a/data/tilesets/tileset_headers.asm b/data/tilesets/tileset_headers.asm index 5c60a55d..c241eb71 100644 --- a/data/tilesets/tileset_headers.asm +++ b/data/tilesets/tileset_headers.asm @@ -8,27 +8,27 @@ ENDM Tilesets: ; block, gfx, coll, 3 counter tiles, grass tile, permission - tileset Overworld_Block, Overworld_GFX, Overworld_Coll, $FF,$FF,$FF, $52, ANIMATED_FLOWERS_WATER - tileset RedsHouse1_Block, RedsHouse1_GFX, RedsHouse1_Coll, $FF,$FF,$FF, $FF, STATIC_FLOWERS_WATER - tileset Mart_Block, Mart_GFX, Mart_Coll, $18,$19,$1E, $FF, STATIC_FLOWERS_WATER - tileset Forest_Block, Forest_GFX, Forest_Coll, $FF,$FF,$FF, $20, STATIC_FLOWERS_ANIMATED_WATER - tileset RedsHouse2_Block, RedsHouse2_GFX, RedsHouse2_Coll, $FF,$FF,$FF, $FF, STATIC_FLOWERS_WATER - tileset Dojo_Block, Dojo_GFX, Dojo_Coll, $3A,$FF,$FF, $FF, ANIMATED_FLOWERS_WATER - tileset Pokecenter_Block, Pokecenter_GFX, Pokecenter_Coll, $18,$19,$1E, $FF, STATIC_FLOWERS_WATER - tileset Gym_Block, Gym_GFX, Gym_Coll, $3A,$FF,$FF, $FF, ANIMATED_FLOWERS_WATER - tileset House_Block, House_GFX, House_Coll, $FF,$FF,$FF, $FF, STATIC_FLOWERS_WATER - tileset ForestGate_Block, ForestGate_GFX, ForestGate_Coll, $17,$32,$FF, $FF, STATIC_FLOWERS_WATER - tileset Museum_Block, Museum_GFX, Museum_Coll, $17,$32,$FF, $FF, STATIC_FLOWERS_WATER - tileset Underground_Block, Underground_GFX, Underground_Coll, $FF,$FF,$FF, $FF, STATIC_FLOWERS_WATER - tileset Gate_Block, Gate_GFX, Gate_Coll, $17,$32,$FF, $FF, STATIC_FLOWERS_WATER - tileset Ship_Block, Ship_GFX, Ship_Coll, $FF,$FF,$FF, $FF, STATIC_FLOWERS_ANIMATED_WATER - tileset ShipPort_Block, ShipPort_GFX, ShipPort_Coll, $FF,$FF,$FF, $FF, STATIC_FLOWERS_ANIMATED_WATER - tileset Cemetery_Block, Cemetery_GFX, Cemetery_Coll, $12,$FF,$FF, $FF, STATIC_FLOWERS_WATER - tileset Interior_Block, Interior_GFX, Interior_Coll, $FF,$FF,$FF, $FF, STATIC_FLOWERS_WATER - tileset Cavern_Block, Cavern_GFX, Cavern_Coll, $FF,$FF,$FF, $FF, STATIC_FLOWERS_ANIMATED_WATER - tileset Lobby_Block, Lobby_GFX, Lobby_Coll, $15,$36,$FF, $FF, STATIC_FLOWERS_WATER - tileset Mansion_Block, Mansion_GFX, Mansion_Coll, $FF,$FF,$FF, $FF, STATIC_FLOWERS_WATER - tileset Lab_Block, Lab_GFX, Lab_Coll, $FF,$FF,$FF, $FF, STATIC_FLOWERS_WATER - tileset Club_Block, Club_GFX, Club_Coll, $07,$17,$FF, $FF, STATIC_FLOWERS_WATER - tileset Facility_Block, Facility_GFX, Facility_Coll, $12,$FF,$FF, $FF, STATIC_FLOWERS_ANIMATED_WATER - tileset Plateau_Block, Plateau_GFX, Plateau_Coll, $FF,$FF,$FF, $45, STATIC_FLOWERS_ANIMATED_WATER + tileset Overworld_Block, Overworld_GFX, Overworld_Coll, $FF,$FF,$FF, $52, TILEANIM_WATER_FLOWER + tileset RedsHouse1_Block, RedsHouse1_GFX, RedsHouse1_Coll, $FF,$FF,$FF, $FF, TILEANIM_NONE + tileset Mart_Block, Mart_GFX, Mart_Coll, $18,$19,$1E, $FF, TILEANIM_NONE + tileset Forest_Block, Forest_GFX, Forest_Coll, $FF,$FF,$FF, $20, TILEANIM_WATER + tileset RedsHouse2_Block, RedsHouse2_GFX, RedsHouse2_Coll, $FF,$FF,$FF, $FF, TILEANIM_NONE + tileset Dojo_Block, Dojo_GFX, Dojo_Coll, $3A,$FF,$FF, $FF, TILEANIM_WATER_FLOWER + tileset Pokecenter_Block, Pokecenter_GFX, Pokecenter_Coll, $18,$19,$1E, $FF, TILEANIM_NONE + tileset Gym_Block, Gym_GFX, Gym_Coll, $3A,$FF,$FF, $FF, TILEANIM_WATER_FLOWER + tileset House_Block, House_GFX, House_Coll, $FF,$FF,$FF, $FF, TILEANIM_NONE + tileset ForestGate_Block, ForestGate_GFX, ForestGate_Coll, $17,$32,$FF, $FF, TILEANIM_NONE + tileset Museum_Block, Museum_GFX, Museum_Coll, $17,$32,$FF, $FF, TILEANIM_NONE + tileset Underground_Block, Underground_GFX, Underground_Coll, $FF,$FF,$FF, $FF, TILEANIM_NONE + tileset Gate_Block, Gate_GFX, Gate_Coll, $17,$32,$FF, $FF, TILEANIM_NONE + tileset Ship_Block, Ship_GFX, Ship_Coll, $FF,$FF,$FF, $FF, TILEANIM_WATER + tileset ShipPort_Block, ShipPort_GFX, ShipPort_Coll, $FF,$FF,$FF, $FF, TILEANIM_WATER + tileset Cemetery_Block, Cemetery_GFX, Cemetery_Coll, $12,$FF,$FF, $FF, TILEANIM_NONE + tileset Interior_Block, Interior_GFX, Interior_Coll, $FF,$FF,$FF, $FF, TILEANIM_NONE + tileset Cavern_Block, Cavern_GFX, Cavern_Coll, $FF,$FF,$FF, $FF, TILEANIM_WATER + tileset Lobby_Block, Lobby_GFX, Lobby_Coll, $15,$36,$FF, $FF, TILEANIM_NONE + tileset Mansion_Block, Mansion_GFX, Mansion_Coll, $FF,$FF,$FF, $FF, TILEANIM_NONE + tileset Lab_Block, Lab_GFX, Lab_Coll, $FF,$FF,$FF, $FF, TILEANIM_NONE + tileset Club_Block, Club_GFX, Club_Coll, $07,$17,$FF, $FF, TILEANIM_NONE + tileset Facility_Block, Facility_GFX, Facility_Coll, $12,$FF,$FF, $FF, TILEANIM_WATER + tileset Plateau_Block, Plateau_GFX, Plateau_Coll, $FF,$FF,$FF, $45, TILEANIM_WATER diff --git a/hram.asm b/hram.asm index f3567cd9..1d981ee6 100644 --- a/hram.asm +++ b/hram.asm @@ -277,10 +277,10 @@ hFrameCounter:: db ; decremented every V-blank (used for delays) ; you can detect that the V-blank handler has run since then. hVBlankOccurred:: db -; Controls whether flower and water tiles are animated. -; 00 = flowers and water are static (breaks Surf) -; 01 = flowers are static, water is animated -; 02 = flowers and water are animated +; Controls which tiles are animated. +; 0 = no animations (breaks Surf) +; 1 = water tile $14 is animated +; 2 = water tile $14 and flower tile $03 are animated hTileAnimations:: db hMovingBGTilesCounter1:: db -- cgit v1.2.3 From 5d9957293c28a4d1483a02d76020a895b23d36db Mon Sep 17 00:00:00 2001 From: SatoMew Date: Sun, 29 Nov 2020 22:47:51 +0000 Subject: Delete unnecessary comment --- engine/overworld/update_map.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/overworld/update_map.asm b/engine/overworld/update_map.asm index 26334733..dbf28dae 100644 --- a/engine/overworld/update_map.asm +++ b/engine/overworld/update_map.asm @@ -56,7 +56,7 @@ RedrawMapView: push af xor a ldh [hAutoBGTransferEnabled], a - ldh [hTileAnimations], a ; no flower/water BG tile animations + ldh [hTileAnimations], a call LoadCurrentMapView call RunDefaultPaletteCommand ld hl, wMapViewVRAMPointer -- cgit v1.2.3 From 330fa33236c100e019766d28752ca867420d00bd Mon Sep 17 00:00:00 2001 From: SatoMew Date: Mon, 30 Nov 2020 01:39:49 +0000 Subject: Rename the unreferenced fanfare's constants --- audio/sfx/unreferenced_fanfare.asm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/audio/sfx/unreferenced_fanfare.asm b/audio/sfx/unreferenced_fanfare.asm index ffd1ad3b..0d383e2f 100644 --- a/audio/sfx/unreferenced_fanfare.asm +++ b/audio/sfx/unreferenced_fanfare.asm @@ -1,5 +1,5 @@ ; This corresponds to SFX_KEY_ITEM in pokegold and pokecrystal. -SFX_Unused2_Ch5: +SFX_UnreferencedFanfare_Ch5: execute_music tempo 256 volume 7, 7 @@ -18,7 +18,7 @@ SFX_Unused2_Ch5: sound_ret -SFX_Unused2_Ch6: +SFX_UnreferencedFanfare_Ch6: execute_music vibrato 8, 2, 7 duty_cycle 2 @@ -34,7 +34,7 @@ SFX_Unused2_Ch6: sound_ret -SFX_Unused2_Ch7: +SFX_UnreferencedFanfare_Ch7: execute_music note_type 6, 1, 0 octave 4 -- cgit v1.2.3 From f99446fccb6035edca0cb88b6680bab82480a771 Mon Sep 17 00:00:00 2001 From: SatoMew Date: Mon, 30 Nov 2020 20:09:51 +0000 Subject: Be consistent with the unused and unreferenced terminology --- audio/sfx/unreferenced_fanfare.asm | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/audio/sfx/unreferenced_fanfare.asm b/audio/sfx/unreferenced_fanfare.asm index 0d383e2f..d41bb080 100644 --- a/audio/sfx/unreferenced_fanfare.asm +++ b/audio/sfx/unreferenced_fanfare.asm @@ -1,5 +1,5 @@ ; This corresponds to SFX_KEY_ITEM in pokegold and pokecrystal. -SFX_UnreferencedFanfare_Ch5: +SFX_UnusedFanfare_Ch5: ; unreferenced execute_music tempo 256 volume 7, 7 @@ -17,8 +17,7 @@ SFX_UnreferencedFanfare_Ch5: note E_, 8 sound_ret - -SFX_UnreferencedFanfare_Ch6: +SFX_UnusedFanfare_Ch6: ; unreferenced execute_music vibrato 8, 2, 7 duty_cycle 2 @@ -33,8 +32,7 @@ SFX_UnreferencedFanfare_Ch6: note B_, 8 sound_ret - -SFX_UnreferencedFanfare_Ch7: +SFX_UnusedFanfare_Ch7: ; unreferenced execute_music note_type 6, 1, 0 octave 4 -- cgit v1.2.3 From 6989cdb8c693ed4c4d8c4c3794253ca1f1626ed6 Mon Sep 17 00:00:00 2001 From: SatoMew Date: Mon, 30 Nov 2020 21:17:38 +0000 Subject: And extend this principle to the filename as well --- audio/sfx/unreferenced_fanfare.asm | 55 -------------------------------------- audio/sfx/unused_fanfare.asm | 55 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 55 deletions(-) delete mode 100644 audio/sfx/unreferenced_fanfare.asm create mode 100644 audio/sfx/unused_fanfare.asm diff --git a/audio/sfx/unreferenced_fanfare.asm b/audio/sfx/unreferenced_fanfare.asm deleted file mode 100644 index d41bb080..00000000 --- a/audio/sfx/unreferenced_fanfare.asm +++ /dev/null @@ -1,55 +0,0 @@ -; This corresponds to SFX_KEY_ITEM in pokegold and pokecrystal. -SFX_UnusedFanfare_Ch5: ; unreferenced - execute_music - tempo 256 - volume 7, 7 - vibrato 6, 2, 6 - duty_cycle 2 - toggle_perfect_pitch - note_type 6, 11, 1 - octave 3 - note G#, 2 - note G#, 2 - note_type 6, 11, 3 - note G#, 2 - note B_, 2 - octave 4 - note E_, 8 - sound_ret - -SFX_UnusedFanfare_Ch6: ; unreferenced - execute_music - vibrato 8, 2, 7 - duty_cycle 2 - note_type 6, 12, 1 - octave 4 - note E_, 2 - note E_, 1 - note E_, 1 - note_type 6, 12, 3 - note E_, 2 - note G#, 2 - note B_, 8 - sound_ret - -SFX_UnusedFanfare_Ch7: ; unreferenced - execute_music - note_type 6, 1, 0 - octave 4 - note B_, 1 - rest 1 - note_type 3, 1, 0 - note B_, 1 - rest 1 - note B_, 1 - rest 1 - note_type 6, 1, 0 - note B_, 1 - rest 1 - octave 5 - note E_, 1 - rest 1 - octave 4 - note B_, 4 - rest 4 - sound_ret diff --git a/audio/sfx/unused_fanfare.asm b/audio/sfx/unused_fanfare.asm new file mode 100644 index 00000000..d41bb080 --- /dev/null +++ b/audio/sfx/unused_fanfare.asm @@ -0,0 +1,55 @@ +; This corresponds to SFX_KEY_ITEM in pokegold and pokecrystal. +SFX_UnusedFanfare_Ch5: ; unreferenced + execute_music + tempo 256 + volume 7, 7 + vibrato 6, 2, 6 + duty_cycle 2 + toggle_perfect_pitch + note_type 6, 11, 1 + octave 3 + note G#, 2 + note G#, 2 + note_type 6, 11, 3 + note G#, 2 + note B_, 2 + octave 4 + note E_, 8 + sound_ret + +SFX_UnusedFanfare_Ch6: ; unreferenced + execute_music + vibrato 8, 2, 7 + duty_cycle 2 + note_type 6, 12, 1 + octave 4 + note E_, 2 + note E_, 1 + note E_, 1 + note_type 6, 12, 3 + note E_, 2 + note G#, 2 + note B_, 8 + sound_ret + +SFX_UnusedFanfare_Ch7: ; unreferenced + execute_music + note_type 6, 1, 0 + octave 4 + note B_, 1 + rest 1 + note_type 3, 1, 0 + note B_, 1 + rest 1 + note B_, 1 + rest 1 + note_type 6, 1, 0 + note B_, 1 + rest 1 + octave 5 + note E_, 1 + rest 1 + octave 4 + note B_, 4 + rest 4 + sound_ret -- cgit v1.2.3 From ae0e2fd1948dc040e42fcbeeb2cae3033af5ce9f Mon Sep 17 00:00:00 2001 From: SatoMew Date: Mon, 30 Nov 2020 21:34:29 +0000 Subject: Fix reference to unused_fanfare.asm --- audio.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audio.asm b/audio.asm index f6646476..df065576 100644 --- a/audio.asm +++ b/audio.asm @@ -411,7 +411,7 @@ INCLUDE "audio/music/pokecenter.asm" SECTION "Music 2", ROMX INCLUDE "audio/sfx/pokeflute_ch5_ch6.asm" -INCLUDE "audio/sfx/unreferenced_fanfare.asm" +INCLUDE "audio/sfx/unused_fanfare.asm" INCLUDE "audio/music/gymleaderbattle.asm" INCLUDE "audio/music/trainerbattle.asm" INCLUDE "audio/music/wildbattle.asm" -- cgit v1.2.3