diff --git a/INSTALL.md b/INSTALL.md index 3f775962..4e56c4d0 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -4,6 +4,7 @@ These instructions explain how to set up the tools required to build **pokegold* If you run into trouble, ask for help on IRC or Discord (see [README.md](README.md)). + ## Windows 10 Download and install [**Windows Subsystem for Linux**](https://docs.microsoft.com/en-us/windows/wsl/install-win10). Then open the **WSL terminal**. @@ -18,9 +19,10 @@ cd /mnt/c/Users//Desktop (The Windows `C:\` drive is called `/mnt/c/` in WSL. Replace *\* in the example path with your username.) -If successful, follow [the regular Linux instructions](#linux) below for whatever distribution you installed for WSL. +If this works, then follow [the instructions for **Linux**](#linux) below for whatever distribution you installed for WSL. + +Otherwise, continue reading below for [the older Windows instructions](#windows). -Otherwise, continue reading below for [the regular Windows instructions](#windows). ## Windows @@ -102,6 +104,36 @@ git clone -b v0.4.1 --depth=1 https://github.com/gbdev/rgbds sudo make -C rgbds install ``` +### Arch Linux + +To install the software required for **pokegold**: + +```bash +sudo pacman -S make gcc git rgbds +``` + +If you want to compile and install **rgbds** manually instead of using the Arch package: + +```bash +sudo pacman -S pkg-config flex bison libpng +git clone -b v0.4.1 --depth=1 https://github.com/gbdev/rgbds +sudo make -C rgbds install +``` + +### Termux + +To install the software required for **pokegold**: + +```bash +sudo apt install make clang git sed +``` + +To install **rgbds**: + +```bash +sudo apt install rgbds +``` + ### Other distros If your distro is not listed here, try to find the required software in its repositories: @@ -127,6 +159,7 @@ sudo make -C rgbds install Now you're ready to [build **pokegold**](#build-pokegold). + ## Build pokegold To download the **pokegold** source files: diff --git a/constants/engine_flags.asm b/constants/engine_flags.asm index 2f8f9260..d97c8033 100644 --- a/constants/engine_flags.asm +++ b/constants/engine_flags.asm @@ -15,7 +15,7 @@ const ENGINE_MOM_SAVING_MONEY const ENGINE_MOM_ACTIVE ; wUnusedTwoDayTimerOn - const ENGINE_0A + const ENGINE_UNUSED_TWO_DAY_TIMER_ON ; wStatusFlags const ENGINE_POKEDEX const ENGINE_UNOWN_DEX diff --git a/constants/gfx_constants.asm b/constants/gfx_constants.asm index dde6a63e..cd03d860 100644 --- a/constants/gfx_constants.asm +++ b/constants/gfx_constants.asm @@ -21,6 +21,7 @@ SCREEN_META_WIDTH EQU 6 ; metatiles SCREEN_META_HEIGHT EQU 5 ; metatiles SURROUNDING_WIDTH EQU SCREEN_META_WIDTH * METATILE_WIDTH ; tiles SURROUNDING_HEIGHT EQU SCREEN_META_HEIGHT * METATILE_WIDTH ; tiles +MAP_CONNECTION_PADDING_WIDTH EQU 3 ; metatiles HP_BAR_LENGTH EQU 6 ; tiles EXP_BAR_LENGTH EQU 8 ; tiles diff --git a/constants/pokemon_constants.asm b/constants/pokemon_constants.asm index d336521a..068998e2 100644 --- a/constants/pokemon_constants.asm +++ b/constants/pokemon_constants.asm @@ -12,6 +12,7 @@ ; - AlphabeticalPokedexOrder (see data/pokemon/dex_order_alpha.asm) ; - NewPokedexOrder (see data/pokemon/dex_order_new.asm) ; - Pokered_MonIndices (see data/pokemon/gen1_order.asm) +; - Footprints (see gfx/footprints.asm) const_def 1 const BULBASAUR ; 01 const IVYSAUR ; 02 diff --git a/constants/wram_constants.asm b/constants/wram_constants.asm index 9f93aa33..131621d3 100644 --- a/constants/wram_constants.asm +++ b/constants/wram_constants.asm @@ -83,11 +83,12 @@ LEFT_MASK EQU 1 << LEFT RIGHT_MASK EQU 1 << RIGHT ; wFacingDirection:: + const_def NUM_DIRECTIONS - 1, -1 + shift_const FACE_DOWN ; 8 + shift_const FACE_UP ; 4 + shift_const FACE_LEFT ; 2 + shift_const FACE_RIGHT ; 1 FACE_CURRENT EQU 0 -FACE_DOWN EQU 8 -FACE_UP EQU 4 -FACE_LEFT EQU 2 -FACE_RIGHT EQU 1 ; wPokemonWithdrawDepositParameter:: PC_WITHDRAW EQU 0 diff --git a/data/moves/tmhm_moves.asm b/data/moves/tmhm_moves.asm index 2834e7df..e2c44f23 100644 --- a/data/moves/tmhm_moves.asm +++ b/data/moves/tmhm_moves.asm @@ -32,6 +32,7 @@ endr db 0 ; end +; unused db 0 db 0 db 0 diff --git a/data/player_names.asm b/data/player_names.asm index 0155dac4..3291ea66 100644 --- a/data/player_names.asm +++ b/data/player_names.asm @@ -1,8 +1,8 @@ NameMenuHeader: - db STATICMENU_NO_TOP_SPACING + db STATICMENU_NO_TOP_SPACING ; flags menu_coords 0, 0, 10, TEXTBOX_Y - 1 dw .Names - db 1 + db 1 ; default option .Names: db STATICMENU_CURSOR | STATICMENU_PLACE_TITLE | STATICMENU_DISABLE_B ; flags @@ -21,5 +21,5 @@ ELIF DEF(_SILVER) db "OSCAR@" db "MAX@" ENDC - db 2 + db 2 ; ???? db "NAME@" ; title diff --git a/data/pokemon/palettes.asm b/data/pokemon/palettes.asm index e6fbf844..36d2c662 100644 --- a/data/pokemon/palettes.asm +++ b/data/pokemon/palettes.asm @@ -3,6 +3,7 @@ PokemonPalettes: ; Each back.gbcpal is generated from the corresponding .png, and ; only the middle two colors are included, not black or white. +; (Back sprites are used since they are the same in Gold and Silver.) ; Shiny palettes are defined directly, not generated. ; 000 diff --git a/data/radio/oaks_pkmn_talk_routes.asm b/data/radio/oaks_pkmn_talk_routes.asm index 254dd8e5..db244740 100644 --- a/data/radio/oaks_pkmn_talk_routes.asm +++ b/data/radio/oaks_pkmn_talk_routes.asm @@ -1,6 +1,7 @@ ; Oak's Pokémon Talk will list wild Pokémon on these maps. -OaksPKMNTalkRoutes:; there are NUM_OAKS_POKEMON_TALK_ROUTES entries +OaksPKMNTalkRoutes: +; there are NUM_OAKS_POKEMON_TALK_ROUTES entries map_id ROUTE_29 map_id ROUTE_46 map_id ROUTE_30 diff --git a/data/text/battle.asm b/data/text/battle.asm index fe14f938..811a8e8c 100644 --- a/data/text/battle.asm +++ b/data/text/battle.asm @@ -340,7 +340,7 @@ BattleText_StringBuffer1GrewToLevel: text_decimal wCurPartyLevel, 1, 3 text "!@" sound_dex_fanfare_50_79 - db "@" + text_end BattleText_WildMonIsEating: text "Wild @" @@ -1073,7 +1073,7 @@ BeatUpAttackText: ; BUG: Pokémon names 8-10 characters long can overflow the textbox, ; printing as "Enemy 1234567890 can't": up to 21 characters, over 18. -CantReceiveGiftText: +PresentFailedText: text " can't" line "receive the gift!" prompt diff --git a/docs/bugs_and_glitches.md b/docs/bugs_and_glitches.md index 965700b7..c30f74fb 100644 --- a/docs/bugs_and_glitches.md +++ b/docs/bugs_and_glitches.md @@ -70,12 +70,12 @@ All the bugs documented here were fixed in Pokémon Crystal. Any that weren't ar ## Present's text overflows when it fails to heal an enemy Pokémon with a long name -**Fix:** Edit `CantReceiveGiftText` in [data/text/battle.asm](https://github.com/pret/pokegold/blob/master/data/text/battle.asm): +**Fix:** Edit `PresentFailedText` in [data/text/battle.asm](https://github.com/pret/pokegold/blob/master/data/text/battle.asm): ```diff -; BUG: Pokémon names 8-10 characters long can overflow the textbox, -; printing as "Enemy 1234567890 can't": up to 21 characters, over 18. - CantReceiveGiftText: + PresentFailedText: - text " can't" - line "receive the gift!" + text "" diff --git a/engine/battle/move_effects/present.asm b/engine/battle/move_effects/present.asm index 33e172fb..0577e76b 100644 --- a/engine/battle/move_effects/present.asm +++ b/engine/battle/move_effects/present.asm @@ -67,7 +67,7 @@ BattleCommand_Present: add a jr nc, .do_animation call AnimateFailedMove - ld hl, CantReceiveGiftText + ld hl, PresentFailedText call StdBattleTextbox .do_animation jp EndMoveEffect diff --git a/home/map.asm b/home/map.asm index cc2c4ddc..22719788 100644 --- a/home/map.asm +++ b/home/map.asm @@ -124,12 +124,12 @@ LoadMetatiles:: ld a, [wOverworldMapAnchor + 1] ld d, a ld hl, wSurroundingTiles - ld b, SURROUNDING_HEIGHT / METATILE_WIDTH ; 5 + ld b, SCREEN_META_HEIGHT .row push de push hl - ld c, SURROUNDING_WIDTH / METATILE_WIDTH ; 6 + ld c, SCREEN_META_WIDTH .col push de @@ -195,7 +195,7 @@ endr add hl, de pop de ld a, [wMapWidth] - add 6 + add MAP_CONNECTION_PADDING_WIDTH * 2 add e ld e, a jr nc, .ok2 @@ -562,45 +562,43 @@ GetMapScreenCoords:: ld hl, wOverworldMapBlocks ld a, [wXCoord] bit 0, a - jr nz, .increment_then_halve1 + jr nz, .odd_x +; even x srl a - add $1 - jr .resume - -.increment_then_halve1 - add $1 + add 1 + jr .got_block_x +.odd_x + add 1 srl a - -.resume +.got_block_x ld c, a - ld b, $0 + ld b, 0 add hl, bc ld a, [wMapWidth] - add $6 + add MAP_CONNECTION_PADDING_WIDTH * 2 ld c, a - ld b, $0 + ld b, 0 ld a, [wYCoord] bit 0, a - jr nz, .increment_then_halve2 + jr nz, .odd_y +; even y srl a - add $1 - jr .resume2 - -.increment_then_halve2 - add $1 + add 1 + jr .got_block_y +.odd_y + add 1 srl a - -.resume2 +.got_block_y call AddNTimes ld a, l ld [wOverworldMapAnchor], a ld a, h ld [wOverworldMapAnchor + 1], a ld a, [wYCoord] - and $1 + and 1 ld [wMetatileStandingY], a ld a, [wXCoord] - and $1 + and 1 ld [wMetatileStandingX], a ret diff --git a/home/menu.asm b/home/menu.asm index 5ba4cde9..ed17e05e 100644 --- a/home/menu.asm +++ b/home/menu.asm @@ -251,6 +251,7 @@ MenuBoxCoord2Tile:: ld c, a ld a, [wMenuBorderTopCoord] ld b, a + ; fallthrough Coord2Tile:: ; Return the address of wTilemap(c, b) in hl. diff --git a/hram.asm b/hram.asm index d1d5d0ae..47cd297b 100644 --- a/hram.asm +++ b/hram.asm @@ -7,6 +7,7 @@ hRTCDayLo:: db hRTCHours:: db hRTCMinutes:: db hRTCSeconds:: db + ds 2 hHours:: db @@ -49,7 +50,6 @@ hMoveMon:: db UNION hMapObjectIndexBuffer:: db hObjectStructIndexBuffer:: db - NEXTU hConnectionStripLength:: db hConnectedMapWidth:: db diff --git a/macros/wram.asm b/macros/wram.asm index a2aa71df..b514bbde 100644 --- a/macros/wram.asm +++ b/macros/wram.asm @@ -77,7 +77,6 @@ battle_struct: MACRO \1Species:: db \1Item:: db \1Moves:: ds NUM_MOVES -\1MovesEnd:: \1DVs:: dw \1PP:: ds NUM_MOVES \1Happiness:: db