diff options
33 files changed, 171 insertions, 143 deletions
diff --git a/.travis.yml b/.travis.yml index 1147a117..0d3b9f7a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ os: install: - |- ( cd - git clone -b v0.4.1 --depth=1 https://github.com/gbdev/rgbds + git clone -b v0.4.2 --depth=1 https://github.com/gbdev/rgbds sudo make -C rgbds install rm -rf rgbds ) @@ -42,9 +42,9 @@ Run setup and leave the default settings. At the "**Select Packages**" step, cho Double click on the text that says "**Skip**" next to each package to select the most recent version to install. -Then follow the [**rgbds** install instructions](https://rgbds.gbdev.io/install/windows) for Windows with Cygwin to install **rgbds 0.4.1**. +Then follow the [**rgbds** install instructions](https://rgbds.gbdev.io/install/windows) for Windows with Cygwin to install **rgbds 0.4.2**. -**Note:** If you already have an older rgbds, you will need to update to 0.4.1. Ignore this if you have never installed rgbds before. If a version newer than 0.4.1 does not work, try downloading 0.4.1. +**Note:** If you already have an older rgbds, you will need to update to 0.4.2. Ignore this if you have never installed rgbds before. If a version newer than 0.4.2 does not work, try downloading 0.4.2. Now open the **Cygwin terminal** and enter the following commands. @@ -67,7 +67,7 @@ Install [**Homebrew**](https://brew.sh/). Follow the official instructions. Open **Terminal** and prepare to enter commands. -Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install/macos) for macOS to install **rgbds 0.4.1**. +Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install/macos) for macOS to install **rgbds 0.4.2**. Now you're ready to [build **pokeyellow**](#build-pokeyellow). @@ -84,7 +84,7 @@ To install the software required for **pokeyellow**: sudo apt-get install make gcc git ``` -Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install/source) to build **rgbds 0.4.1** from source. +Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install/source) to build **rgbds 0.4.2** from source. ### OpenSUSE @@ -94,7 +94,7 @@ To install the software required for **pokeyellow**: sudo zypper install make gcc git ``` -Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install/source) to build **rgbds 0.4.1** from source. +Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install/source) to build **rgbds 0.4.2** from source. ### Arch Linux @@ -104,9 +104,9 @@ To install the software required for **pokeyellow**: sudo pacman -S make gcc git ``` -Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install/arch) for Arch Linux to install **rgbds 0.4.1**. +Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install/arch) for Arch Linux to install **rgbds 0.4.2**. -If you want to compile and install **rgbds** yourself instead, then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install/source) to build **rgbds 0.4.1** from source. +If you want to compile and install **rgbds** yourself instead, then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install/source) to build **rgbds 0.4.2** from source. ### Termux @@ -122,7 +122,7 @@ To install **rgbds**: sudo apt install rgbds ``` -If you want to compile and install **rgbds** yourself instead, then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install/source) to build **rgbds 0.4.1** from source. +If you want to compile and install **rgbds** yourself instead, then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install/source) to build **rgbds 0.4.2** from source. ### Other distros @@ -133,7 +133,7 @@ If your distro is not listed here, try to find the required software in its repo - `git` - `rgbds` -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. +If `rgbds` is not available, you'll need to follow the [**rgbds** instructions](https://rgbds.gbdev.io/install/source) to build **rgbds 0.4.2** from source. Now you're ready to [build **pokeyellow**](#build-pokeyellow). @@ -493,7 +493,7 @@ INCLUDE "audio/music/pokecenter.asm" SECTION "Music 2", ROMX -INCLUDE "audio/sfx/unused2_2.asm" +INCLUDE "audio/sfx/unused_fanfare.asm" INCLUDE "audio/music/gymleaderbattle.asm" INCLUDE "audio/music/trainerbattle.asm" INCLUDE "audio/music/wildbattle.asm" diff --git a/audio/sfx/unused2_2.asm b/audio/sfx/unused_fanfare.asm index aa93f91c..d41bb080 100644 --- a/audio/sfx/unused2_2.asm +++ b/audio/sfx/unused_fanfare.asm @@ -1,4 +1,5 @@ -SFX_Unused2_Ch5: +; This corresponds to SFX_KEY_ITEM in pokegold and pokecrystal. +SFX_UnusedFanfare_Ch5: ; unreferenced execute_music tempo 256 volume 7, 7 @@ -16,8 +17,7 @@ SFX_Unused2_Ch5: note E_, 8 sound_ret - -SFX_Unused2_Ch6: +SFX_UnusedFanfare_Ch6: ; unreferenced execute_music vibrato 8, 2, 7 duty_cycle 2 @@ -32,8 +32,7 @@ SFX_Unused2_Ch6: note B_, 8 sound_ret - -SFX_Unused2_Ch7: +SFX_UnusedFanfare_Ch7: ; unreferenced execute_music note_type 6, 1, 0 octave 4 diff --git a/constants/map_data_constants.asm b/constants/map_data_constants.asm index 5efd9928..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 -; tileset environments +; flower and water tile animations const_def - const INDOOR ; 0 - const CAVE ; 1 - const OUTDOOR ; 2 + const TILEANIM_NONE ; 0 + const TILEANIM_WATER ; 1 + const TILEANIM_WATER_FLOWER ; 2 diff --git a/data/pokemon/base_stats.asm b/data/pokemon/base_stats.asm index b4360286..620576a6 100644 --- a/data/pokemon/base_stats.asm +++ b/data/pokemon/base_stats.asm @@ -152,3 +152,5 @@ INCLUDE "data/pokemon/base_stats/dragonair.asm" INCLUDE "data/pokemon/base_stats/dragonite.asm" INCLUDE "data/pokemon/base_stats/mewtwo.asm" INCLUDE "data/pokemon/base_stats/mew.asm" +BaseStatsEnd:: + assert BaseStatsEnd - BaseStats == (wMonHeaderEnd - wMonHeader) * (NUM_POKEMON) diff --git a/data/tilesets/tileset_headers.asm b/data/tilesets/tileset_headers.asm index 4e055591..71c67ec3 100644 --- a/data/tilesets/tileset_headers.asm +++ b/data/tilesets/tileset_headers.asm @@ -3,33 +3,33 @@ tileset: MACRO dw \1, \2, \3 ; Block, GFX, Coll db \4, \5, \6 ; counter tiles db \7 ; grass tile - db \8 ; permission (indoor, cave, outdoor) + db \8 ; animations (TILEANIM_* value) 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 BeachHouse_Block, BeachHouse_GFX, BeachHouse_Coll, $FF,$FF,$FF, $FF, INDOOR + ; block, gfx, coll, 3 counter tiles, grass tile, animations + 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 + tileset BeachHouse_Block, BeachHouse_GFX, BeachHouse_Coll, $FF,$FF,$FF, $FF, TILEANIM_NONE diff --git a/engine/battle/core.asm b/engine/battle/core.asm index 415b287c..053d6a1e 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 @@ -2088,23 +2088,24 @@ DisplayBattleMenu:: .menuselected ld [wTextBoxID], a call DisplayTextBoxID + ; handle menu input if it's not the old man tutorial or prof. oak pikachu battle ld a, [wBattleType] cp BATTLE_TYPE_OLD_MAN - jr z, .doSimulatedMenuInput ; simulate menu input if it's the old man or prof. oak pikachu battle + jr z, .doSimulatedMenuInput cp BATTLE_TYPE_PIKACHU jr z, .doSimulatedMenuInput jp .handleBattleMenuInput ; the following happens for the old man tutorial and prof. oak pikachu battle .doSimulatedMenuInput - ; Temporarily save the player name in wGrassRate, - ; which is supposed to get overwritten when entering a - ; map with wild Pokémon. - ; In Red/Blue, due to an oversight, the data may not get - ; overwritten (on Cinnabar and Route 21) and the infamous - ; Missingno. glitch can show up. + ; Temporarily save the player name in wLinkEnemyTrainerName. + ; Since wLinkEnemyTrainerName == wGrassRate, this affects wild encounters. + ; The wGrassRate byte and following wGrassMons buffer are supposed + ; to get overwritten when entering a map with wild Pokémon, + ; but an oversight prevents this in Cinnabar and Route 21, + ; so the infamous MissingNo. glitch can show up. ; However, this has been fixed in Yellow. ld hl, wPlayerName - ld de, wGrassRate + ld de, wLinkEnemyTrainerName ld bc, NAME_LENGTH call CopyData ld hl, .oldManName @@ -6454,7 +6455,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 diff --git a/engine/battle/init_battle.asm b/engine/battle/init_battle.asm index d6ba51ed..6a6331b7 100644 --- a/engine/battle/init_battle.asm +++ b/engine/battle/init_battle.asm @@ -143,8 +143,8 @@ _InitBattleCommon: ld [wLetterPrintingDelayFlags], a pop af ld [wMapPalOffset], a - ld a, [wSavedTilesetType] - ldh [hTilesetType], a + ld a, [wSavedTileAnimations] + ldh [hTileAnimations], a scf ret .emptyString diff --git a/engine/battle/init_battle_variables.asm b/engine/battle/init_battle_variables.asm index 0d403b55..dd9f9714 100644 --- a/engine/battle/init_battle_variables.asm +++ b/engine/battle/init_battle_variables.asm @@ -1,6 +1,6 @@ InitBattleVariables: - ldh a, [hTilesetType] - ld [wSavedTilesetType], a + ldh a, [hTileAnimations] + ld [wSavedTileAnimations], a xor a ld [wActionResultOrTookBattleTurn], a ld [wBattleResult], a diff --git a/engine/menus/league_pc.asm b/engine/menus/league_pc.asm index 5551fd0b..882565ca 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 315e4805..8e4fef19 100644 --- a/engine/menus/pokedex.asm +++ b/engine/menus/pokedex.asm @@ -162,10 +162,10 @@ HandlePokedexSideMenu: jr .exitSideMenu .chosePrint - ldh a, [hTilesetType] + ldh a, [hTileAnimations] push af xor a - ldh [hTilesetType], a + ldh [hTileAnimations], a ld a, [wd11e] ld [wcf91], a callfar PrintPokedexEntry @@ -173,7 +173,7 @@ HandlePokedexSideMenu: ldh [hAutoBGTransferEnabled], a call ClearScreen pop af - ldh [hTilesetType], a + ldh [hTileAnimations], a ld b, $3 jr .exitSideMenu @@ -442,10 +442,10 @@ ShowPokedexDataInternal: set 1, [hl] ld a, $33 ; 3/7 volume ldh [rNR50], a - ldh a, [hTilesetType] + ldh a, [hTileAnimations] push af xor a - ldh [hTilesetType], a + ldh [hTileAnimations], a call GBPalWhiteOut ; zero all palettes ld a, [wd11e] ; pokemon ID ld [wcf91], a @@ -462,7 +462,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 bcb27ddf..13fdf729 100644 --- a/engine/menus/save.asm +++ b/engine/menus/save.asm @@ -67,8 +67,8 @@ LoadSAV0: ld de, wSpriteDataStart ld bc, wSpriteDataEnd - wSpriteDataStart call CopyData - ld a, [sTilesetType] - ldh [hTilesetType], a + ld a, [sTileAnimations] + ldh [hTileAnimations], a ld hl, sCurBoxData ld de, wBoxDataStart ld bc, wBoxDataEnd - wBoxDataStart @@ -211,8 +211,8 @@ SaveSAVtoSRAM0: ld de, sCurBoxData ld bc, wBoxDataEnd - wBoxDataStart call CopyData - ldh a, [hTilesetType] - ld [sTilesetType], a + ldh a, [hTileAnimations] + ld [sTileAnimations], a ld hl, sPlayerName ld bc, sMainDataCheckSum - sPlayerName call SAVCheckSum diff --git a/engine/menus/start_sub_menus.asm b/engine/menus/start_sub_menus.asm index c054761c..05a1fa56 100644 --- a/engine/menus/start_sub_menus.asm +++ b/engine/menus/start_sub_menus.asm @@ -471,10 +471,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 @@ -489,7 +489,7 @@ StartMenu_TrainerInfo:: farcall DrawStartMenu ; XXX what difference does this make? call LoadGBPal pop af - ldh [hTilesetType], a + ldh [hTileAnimations], a jp RedisplayStartMenu_DoNotDrawStartMenu ; loads tile patterns and draws everything except for gym leader faces / badges diff --git a/engine/minigame/surfing_pikachu.asm b/engine/minigame/surfing_pikachu.asm index 641c4f62..e66926d4 100644 --- a/engine/minigame/surfing_pikachu.asm +++ b/engine/minigame/surfing_pikachu.asm @@ -3,10 +3,10 @@ SurfingPikachuMinigame:: call DelayFrame call DelayFrame call DelayFrame - ldh a, [hTilesetType] + ldh a, [hTileAnimations] push af xor a - ldh [hTilesetType], a + ldh [hTileAnimations], a ld a, [wUpdateSpritesEnabled] push af ld a, $ff @@ -56,7 +56,7 @@ SurfingPikachuMinigame:: pop af ld [wUpdateSpritesEnabled], a pop af - ldh [hTilesetType], a + ldh [hTileAnimations], a ret SurfingPikachuLoop: diff --git a/engine/movie/evolution.asm b/engine/movie/evolution.asm index 624a7f5f..2cf841c8 100644 --- a/engine/movie/evolution.asm +++ b/engine/movie/evolution.asm @@ -17,7 +17,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 616a72e3..db3ab617 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 7acbd693..2ed61fda 100644 --- a/engine/movie/oak_speech/oak_speech.asm +++ b/engine/movie/oak_speech/oak_speech.asm @@ -60,7 +60,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 cf1eecdb..dfe057f3 100644 --- a/engine/movie/title.asm +++ b/engine/movie/title.asm @@ -21,7 +21,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 686fa50c..21101e7b 100644 --- a/engine/overworld/tilesets.asm +++ b/engine/overworld/tilesets.asm @@ -14,7 +14,7 @@ LoadTilesetHeader: ld bc, $b call CopyData 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..dbf28dae 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 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/pikachu/pikachu_pic_animation.asm b/engine/pikachu/pikachu_pic_animation.asm index 4f56d542..a5d9087f 100644 --- a/engine/pikachu/pikachu_pic_animation.asm +++ b/engine/pikachu/pikachu_pic_animation.asm @@ -616,10 +616,10 @@ PikaPicAnimCommand_loadgfx: push af xor a ldh [hAutoBGTransferEnabled], a - ldh a, [hTilesetType] + ldh a, [hTileAnimations] push af xor a - ldh [hTilesetType], a + ldh [hTileAnimations], a call GetPikaPicAnimByte ld [wPikaPicAnimCurGraphicID], a ld a, [wPikaPicAnimCurGraphicID] @@ -634,7 +634,7 @@ PikaPicAnimCommand_loadgfx: call DecompressRequestPikaPicAnimGFX .done pop af - ldh [hTilesetType], a + ldh [hTileAnimations], a pop af ldh [hAutoBGTransferEnabled], a pop af diff --git a/engine/pokemon/evos_moves.asm b/engine/pokemon/evos_moves.asm index 3df780c1..7c1476d3 100644 --- a/engine/pokemon/evos_moves.asm +++ b/engine/pokemon/evos_moves.asm @@ -12,7 +12,7 @@ EvolveTradeMon: ; 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 @@ -250,7 +250,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 a2cfb595..f1f3aa26 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 @@ -191,7 +191,7 @@ StatusScreen: .continue call WaitForTextScrollButtonPress ; wait for button pop af - ldh [hTilesetType], a + ldh [hTileAnimations], a ret .GetStringPointer @@ -311,10 +311,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 @@ -443,7 +443,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 331a3657..bb70615d 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 26451bf1..246a773b 100644 --- a/home/overworld.asm +++ b/home/overworld.asm @@ -802,7 +802,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 8e304fd3..8dec32d9 100644 --- a/home/pokemon.asm +++ b/home/pokemon.asm @@ -181,10 +181,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 @@ -192,10 +192,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 @@ -268,7 +268,7 @@ HandlePartyMenuInput:: and a jp nz, .swappingPokemon pop af - ldh [hTilesetType], a + ldh [hTileAnimations], a bit 1, b jr nz, .noPokemonChosen ld a, [wPartyCount] @@ -293,7 +293,7 @@ HandlePartyMenuInput:: xor a ld [wMenuItemToSwap], a pop af - ldh [hTilesetType], a + ldh [hTileAnimations], a .noPokemonChosen call BankswitchBack scf diff --git a/home/vcopy.asm b/home/vcopy.asm index 9b6efb3a..2b68eb09 100644 --- a/home/vcopy.asm +++ b/home/vcopy.asm @@ -349,7 +349,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) @@ -391,7 +391,7 @@ UpdateMovingBgTiles:: dec c jr nz, .left .done - ldh a, [hTilesetType] + ldh a, [hTileAnimations] rrca ret nc ; if in a cave, no flower animations @@ -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 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 diff --git a/rgbdscheck.asm b/rgbdscheck.asm index 73a10332..63df3575 100644 --- a/rgbdscheck.asm +++ b/rgbdscheck.asm @@ -1,12 +1,14 @@ -; pokered requires rgbds 0.4.1 or newer. +; pokered requires rgbds 0.4.2 or newer. MAJOR EQU 0 MINOR EQU 4 -PATCH EQU 1 +PATCH EQU 2 IF !DEF(__RGBDS_MAJOR__) || !DEF(__RGBDS_MINOR__) || !DEF(__RGBDS_PATCH__) - fail "pokered requires rgbds {MAJOR}.{MINOR}.{PATCH} or newer." -ELIF (__RGBDS_MAJOR__ < MAJOR) || \ + fail "pokered requires rgbds 0.4.2 or newer." +ELSE +IF (__RGBDS_MAJOR__ < MAJOR) || \ (__RGBDS_MAJOR__ == MAJOR && __RGBDS_MINOR__ < MINOR) || \ (__RGBDS_MAJOR__ == MAJOR && __RGBDS_MINOR__ == MINOR && __RGBDS_PATCH__ < PATCH) - fail "pokered requires rgbds {MAJOR}.{MINOR}.{PATCH} or newer." + fail "pokered requires rgbds 0.4.2 or newer." +ENDC ENDC @@ -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/tools/unnamed.py b/tools/unnamed.py index b2e9aea3..bee4e29b 100755 --- a/tools/unnamed.py +++ b/tools/unnamed.py @@ -82,17 +82,38 @@ for objfile in objects: elif magic == b'RGB9': obj_ver = 10 + unpack_file("<I", f)[0] - if obj_ver not in [6, 10, 11, 12, 13, 15]: + if obj_ver not in [6, 10, 11, 12, 13, 15, 16]: print("Error: File '%s' is of an unknown format." % objfile, file=stderr) exit(1) - num_symbols = unpack_file("<II", f)[0] + num_symbols = unpack_file("<I", f)[0] + unpack_file("<I", f) # skip num sections + + if obj_ver in [16]: + node_filenames = [] + num_nodes = unpack_file("<I", f)[0] + for x in range(num_nodes): + unpack_file("<II", f) # parent id, parent line no + node_type = unpack_file("<B", f)[0] + if node_type: + node_filenames.append(read_string(f)) + else: + node_filenames.append("rept") + depth = unpack_file("<I", f)[0] + for i in range(depth): + unpack_file("<I", f) # rept iterations + node_filenames.reverse() + for x in range(num_symbols): sym_name = read_string(f) sym_type = symtype(unpack_file("<B", f)[0] & 0x7f) if sym_type == symtype.IMPORT: continue - sym_filename = read_string(f) + if obj_ver in [16]: + sym_fileno = unpack_file("<I", f)[0] + sym_filename = node_filenames[sym_fileno] + else: + sym_filename = read_string(f) unpack_file("<III", f) if sym_name not in symbols: continue @@ -2287,10 +2287,11 @@ wMonHGrowthRate:: wMonHLearnset:: ; bit field - flag_array 50 + 5 + flag_array NUM_TMS + NUM_HMS ds 1 +wMonHeaderEnd:: -wSavedTilesetType:: +wSavedTileAnimations:: ; saved at the start of a battle and then written back at the end of the battle ds 1 @@ -3421,31 +3422,33 @@ wSecondLockTrashCanIndex:: wEventFlags:: flag_array NUM_EVENTS + +UNION +wGrassRate:: db +wGrassMons:: + ds 10 * 2 + + ds 8 + +wWaterRate:: db +wWaterMons:: + ds 10 * 2 + +NEXTU wLinkEnemyTrainerName:: ; linked game's trainer name + ds NAME_LENGTH -wGrassRate:: ds 1 -wGrassMons:: -; ds 20 - - ds 11 -; Overload wGrassMons wSerialEnemyDataBlock:: +; ds $1a8 + ds 9 wEnemyPartyCount:: ds 1 wEnemyPartyMons:: ds PARTY_LENGTH + 1 -; Overload enemy party data -UNION - -wWaterRate:: db -wWaterMons:: db - -NEXTU - wEnemyMons:: wEnemyMon1:: party_struct wEnemyMon1 wEnemyMon2:: party_struct wEnemyMon2 |