Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/pret/pokered
Browse files Browse the repository at this point in the history
  • Loading branch information
dannye committed May 10, 2024
2 parents 8baf17a + 5f7b444 commit 57ece62
Show file tree
Hide file tree
Showing 22 changed files with 74 additions and 68 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
uses: actions/checkout@master
with:
path: rgbds
ref: v0.6.1
ref: v0.7.0
repository: gbdev/rgbds

- name: Install rgbds
Expand Down
20 changes: 10 additions & 10 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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#pre-built) for Windows with Cygwin to install **rgbds 0.6.1**.
Then follow the [**rgbds** install instructions](https://rgbds.gbdev.io/install#pre-built) for Windows with Cygwin to install **rgbds 0.7.0**.

**Note:** If you already have an installed rgbds older than 0.6.0, you will need to update to 0.6.0 or 0.6.1. Ignore this if you have never installed rgbds before. If a version newer than 0.6.1 does not work, try downloading 0.6.1.
**Note:** If you already have an installed rgbds older than 0.7.0, you will need to update to 0.7.0. Ignore this if you have never installed rgbds before. If a version newer than 0.7.0 does not work, try downloading 0.7.0.

Now open the **Cygwin terminal** and enter the following commands.

Expand All @@ -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#pre-built) for macOS to install **rgbds 0.6.1**.
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#pre-built) for macOS to install **rgbds 0.7.0**.

Now you're ready to [build **pokered-gbc**](#build-pokered-gbc).

Expand All @@ -84,7 +84,7 @@ To install the software required for **pokered-gbc**:
sudo apt-get install make gcc git
```

Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 0.6.1** from source.
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 0.7.0** from source.

### OpenSUSE

Expand All @@ -94,7 +94,7 @@ To install the software required for **pokered-gbc**:
sudo zypper install make gcc git
```

Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 0.6.1** from source.
Then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 0.7.0** from source.

### Arch Linux

Expand All @@ -104,7 +104,7 @@ To install the software required for **pokered-gbc**:
sudo pacman -S make gcc git rgbds
```

If you want to compile and install **rgbds** yourself instead, then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 0.6.1** from source.
If you want to compile and install **rgbds** yourself instead, then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 0.7.0** from source.

### Termux

Expand All @@ -120,7 +120,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#building-from-source) to build **rgbds 0.6.1** from source.
If you want to compile and install **rgbds** yourself instead, then follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 0.7.0** from source.

### Other distros

Expand All @@ -131,7 +131,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#building-from-source) to build **rgbds 0.6.1** from source.
If `rgbds` is not available, you'll need to follow the [**rgbds** instructions](https://rgbds.gbdev.io/install#building-from-source) to build **rgbds 0.7.0** from source.

Now you're ready to [build **pokered-gbc**](#build-pokered-gbc).

Expand All @@ -153,8 +153,8 @@ make

### Build with a local rgbds version

If you have different projects that require different versions of `rgbds`, it might not be convenient to install rgbds 0.6.1 globally. Instead, you can put its files in a directory within pokered-gbc, such as `pokered-gbc/rgbds-0.6.1/`. Then specify it when you run `make`:
If you have different projects that require different versions of `rgbds`, it might not be convenient to install rgbds 0.7.0 globally. Instead, you can put its files in a directory within pokered-gbc, such as `pokered/rgbds-0.7.0/`. Then specify it when you run `make`:

```bash
make RGBDS=rgbds-0.6.1/
make RGBDS=rgbds-0.7.0/
```
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ tools:
$(MAKE) -C tools/


RGBASMFLAGS = -hL -Q8 -P includes.asm -Weverything -Wnumeric-string=2 -Wtruncation=1
RGBASMFLAGS = -Q8 -P includes.asm -Weverything -Wnumeric-string=2 -Wtruncation=1
# Create a sym/map for debug purposes if `make` run with `DEBUG=1`
ifeq ($(DEBUG),1)
RGBASMFLAGS += -E
Expand Down
13 changes: 0 additions & 13 deletions constants/hardware_constants.asm
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,6 @@

DEF GBC EQU $11

; memory map
DEF VRAM_Begin EQU $8000
DEF VRAM_End EQU $a000
DEF SRAM_Begin EQU $a000
DEF SRAM_End EQU $c000
DEF WRAM0_Begin EQU $c000
DEF WRAM0_End EQU $d000
DEF WRAM1_Begin EQU $d000
DEF WRAM1_End EQU $e000
; hardware registers $ff00-$ff80 (see below)
DEF HRAM_Begin EQU $ff80
DEF HRAM_End EQU $ffff

; MBC1
DEF MBC1SRamEnable EQU $0000
DEF MBC1RomBank EQU $2000
Expand Down
7 changes: 5 additions & 2 deletions constants/item_constants.asm
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ DEF SAFARI_ROCK EQU CASCADEBADGE ; overload
const DOME_FOSSIL ; $29
const HELIX_FOSSIL ; $2A
const SECRET_KEY ; $2B
const ITEM_2C ; $2C
const ITEM_2C ; $2C ; unused
const BIKE_VOUCHER ; $2D
const X_ACCURACY ; $2E
const LEAF_STONE ; $2F
const CARD_KEY ; $30
const NUGGET ; $31
const ITEM_32 ; $32
const ITEM_32 ; $32 ; unused
const POKE_DOLL ; $33
const FULL_HEAL ; $34
const REVIVE ; $35
Expand Down Expand Up @@ -215,3 +215,6 @@ DEF NUM_TM_HM EQU NUM_TMS + NUM_HMS
; These fit in 7 bytes, with one unused bit left over.
DEF __tmhm_value__ = NUM_TM_HM + 1
DEF UNUSED_TMNUM EQU __tmhm_value__

DEF MAX_HIDDEN_ITEMS EQU 112
DEF MAX_HIDDEN_COINS EQU 16
2 changes: 2 additions & 0 deletions data/events/hidden_coins.asm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ MACRO hidden_coin
ENDM

HiddenCoinCoords:
table_width 3, HiddenCoinCoords
; map id, x, y
hidden_coin GAME_CORNER, 0, 8
hidden_coin GAME_CORNER, 1, 16
Expand All @@ -16,4 +17,5 @@ HiddenCoinCoords:
hidden_coin GAME_CORNER, 11, 7
hidden_coin GAME_CORNER, 15, 8
hidden_coin GAME_CORNER, 12, 15
assert_max_table_length MAX_HIDDEN_COINS
db -1 ; end
2 changes: 2 additions & 0 deletions data/events/hidden_item_coords.asm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ MACRO hidden_item
ENDM

HiddenItemCoords:
table_width 3, HiddenItemCoords
; map id, x, y
hidden_item VIRIDIAN_FOREST, 1, 18
hidden_item VIRIDIAN_FOREST, 16, 42
Expand Down Expand Up @@ -58,4 +59,5 @@ HiddenItemCoords:
hidden_item VERMILION_CITY, 14, 11
hidden_item CERULEAN_CITY, 15, 8
hidden_item ROUTE_4, 40, 3
assert_max_table_length MAX_HIDDEN_ITEMS
db -1 ; end
4 changes: 2 additions & 2 deletions data/moves/animations.asm
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ AttackAnimationPointers:
dw JumpKickAnim
dw RollingKickAnim
dw SandAttackAnim
dw HeadButtAnim
dw HeadbuttAnim
dw HornAttackAnim
dw FuryAttackAnim
dw HornDrillAnim
Expand Down Expand Up @@ -363,7 +363,7 @@ SandAttackAnim:
battle_anim SAND_ATTACK, SUBANIM_1_SAND, 1, 6
db -1 ; end

HeadButtAnim:
HeadbuttAnim:
battle_anim HEADBUTT, SUBANIM_1_STAR_BIG, 1, 6
db -1 ; end

Expand Down
2 changes: 1 addition & 1 deletion engine/events/starter_dex.asm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; this function temporarily makes the starters (and Ivysaur) seen
; this function temporarily makes the starters (and Ivysaur) owned
; so that the full Pokedex information gets displayed in Oak's lab
StarterDex:
ld a, 1 << (DEX_BULBASAUR - 1) | 1 << (DEX_IVYSAUR - 1) | 1 << (DEX_CHARMANDER - 1) | 1 << (DEX_SQUIRTLE - 1)
Expand Down
4 changes: 2 additions & 2 deletions engine/gfx/oam_dma.asm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ WriteDMACodeToHRAM::
; Since no other memory is available during OAM DMA,
; DMARoutine is copied to HRAM and executed there.
ld c, LOW(hDMARoutine)
ld b, DMARoutineEnd - DMARoutine
ld b, DMARoutine.End - DMARoutine
ld hl, DMARoutine
.copy
ld a, [hli]
Expand All @@ -25,4 +25,4 @@ hDMARoutine::
jr nz, .wait
ret
ENDL
DMARoutineEnd:
.End:
28 changes: 17 additions & 11 deletions engine/items/item_effects.asm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ ItemUsePtrTable:
dw ItemUseBall ; POKE_BALL
dw ItemUseTownMap ; TOWN_MAP
dw ItemUseBicycle ; BICYCLE
dw ItemUseSurfboard ; out-of-battle Surf effect
dw ItemUseSurfboard ; SURFBOARD
dw ItemUseBall ; SAFARI_BALL
dw ItemUsePokedex ; POKEDEX
dw ItemUseEvoStone ; MOON_STONE
Expand Down Expand Up @@ -60,19 +60,19 @@ ItemUsePtrTable:
dw UnusableItem ; DOME_FOSSIL
dw UnusableItem ; HELIX_FOSSIL
dw UnusableItem ; SECRET_KEY
dw UnusableItem
dw UnusableItem ; ITEM_2C
dw UnusableItem ; BIKE_VOUCHER
dw ItemUseXAccuracy ; X_ACCURACY
dw ItemUseEvoStone ; LEAF_STONE
dw ItemUseCardKey ; CARD_KEY
dw UnusableItem ; NUGGET
dw UnusableItem ; ??? PP_UP
dw ItemUsePokedoll ; POKE_DOLL
dw UnusableItem ; ITEM_32
dw ItemUsePokeDoll ; POKE_DOLL
dw ItemUseMedicine ; FULL_HEAL
dw ItemUseMedicine ; REVIVE
dw ItemUseMedicine ; MAX_REVIVE
dw ItemUseGuardSpec ; GUARD_SPEC
dw ItemUseSuperRepel ; SUPER_REPL
dw ItemUseSuperRepel ; SUPER_REPEL
dw ItemUseMaxRepel ; MAX_REPEL
dw ItemUseDireHit ; DIRE_HIT
dw UnusableItem ; COIN
Expand All @@ -89,13 +89,13 @@ ItemUsePtrTable:
dw ItemUseOaksParcel ; OAKS_PARCEL
dw ItemUseItemfinder ; ITEMFINDER
dw UnusableItem ; SILPH_SCOPE
dw ItemUsePokeflute ; POKE_FLUTE
dw ItemUsePokeFlute ; POKE_FLUTE
dw UnusableItem ; LIFT_KEY
dw UnusableItem ; EXP_ALL
dw ItemUseOldRod ; OLD_ROD
dw ItemUseGoodRod ; GOOD_ROD
dw ItemUseSuperRod ; SUPER_ROD
dw ItemUsePPUp ; PP_UP (real one)
dw ItemUsePPUp ; PP_UP
dw ItemUsePPRestore ; ETHER
dw ItemUsePPRestore ; MAX_ETHER
dw ItemUsePPRestore ; ELIXER
Expand Down Expand Up @@ -665,7 +665,7 @@ ItemUseBicycle:
.printText
jp PrintText

; used for Surf out-of-battle effect
; indirectly used by SURF in StartMenu_Pokemon.surf
ItemUseSurfboard:
ld a, [wWalkBikeSurfState]
ld [wWalkBikeSurfStateCopy], a
Expand Down Expand Up @@ -1427,6 +1427,9 @@ VitaminNoEffectText:

INCLUDE "data/battle/stat_names.asm"

; for BOULDERBADGE when used from the
; ITEM window, which corresponds to
; SAFARI_BAIT during Safari Game encounters
ItemUseBait:
ld hl, ThrewBaitText
call PrintText
Expand All @@ -1437,6 +1440,9 @@ ItemUseBait:
ld de, wSafariEscapeFactor ; escape factor
jr BaitRockCommon

; for CASCADEBADGE when used from the
; ITEM window, which corresponds to
; SAFARI_ROCK during Safari Game encounters
ItemUseRock:
ld hl, ThrewRockText
call PrintText
Expand Down Expand Up @@ -1482,7 +1488,7 @@ ThrewRockText:
text_far _ThrewRockText
text_end

; also used for Dig out-of-battle effect
; indirectly used by DIG in StartMenu_Pokemon.dig
ItemUseEscapeRope:
ld a, [wIsInBattle]
and a
Expand Down Expand Up @@ -1597,7 +1603,7 @@ ItemUseCardKey:

INCLUDE "data/events/card_key_coords.asm"

ItemUsePokedoll:
ItemUsePokeDoll:
ld a, [wIsInBattle]
dec a
jp nz, ItemUseNotTime
Expand Down Expand Up @@ -1662,7 +1668,7 @@ ItemUseXStat:
ld [hl], a ; restore [wPlayerMoveNum]
ret

ItemUsePokeflute:
ItemUsePokeFlute:
ld a, [wIsInBattle]
and a
jr nz, .inBattle
Expand Down
4 changes: 2 additions & 2 deletions engine/menus/save.asm
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,7 @@ ClearSAV:

PadSRAM_FF:
ld [MBC1SRamBank], a
ld hl, SRAM_Begin
ld bc, SRAM_End - SRAM_Begin
ld hl, STARTOF(SRAM)
ld bc, SIZEOF(SRAM)
ld a, $ff
jp FillMemory
2 changes: 1 addition & 1 deletion engine/movie/oak_speech/oak_speech2.asm
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ ChooseRivalName:
call ClearScreen
call Delay3
ld de, Rival1Pic
ld b, $13
ld b, BANK(Rival1Pic)
call IntroDisplayPicCenteredOrUpperRight
.done
ld hl, HisNameIsText
Expand Down
2 changes: 2 additions & 0 deletions home/header.asm
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,5 @@ jp InitializeColor
; This makes sure it doesn't get used for anything else.

ds $0150 - @

ENDSECTION
12 changes: 6 additions & 6 deletions home/init.asm
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ DEF rLCDC_DEFAULT EQU %11100011

ld sp, wStack

ld hl, WRAM0_Begin
ld bc, WRAM1_End - WRAM0_Begin
ld hl, STARTOF(WRAM0)
ld bc, SIZEOF(WRAM0)
.loop
ld [hl], 0
inc hl
Expand All @@ -53,8 +53,8 @@ DEF rLCDC_DEFAULT EQU %11100011

call ClearVram

ld hl, HRAM_Begin
ld bc, HRAM_End - HRAM_Begin
ld hl, STARTOF(HRAM)
ld bc, SIZEOF(HRAM)
call FillMemory

call ClearSprites
Expand Down Expand Up @@ -119,8 +119,8 @@ DEF rLCDC_DEFAULT EQU %11100011
jp PrepareTitleScreen

ClearVram::
ld hl, VRAM_Begin
ld bc, VRAM_End - VRAM_Begin
ld hl, STARTOF(VRAM)
ld bc, SIZEOF(VRAM)
xor a
jp FillMemory

Expand Down
2 changes: 1 addition & 1 deletion home/trainers.asm
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ SetSpritePosition1::
SetSpritePosition2::
ld hl, _SetSpritePosition2
SpritePositionBankswitch::
ld b, BANK(_GetSpritePosition1) ; BANK(_GetSpritePosition2), BANK(_SetSpritePosition1), BANK(_SetSpritePosition2)
ld b, BANK("Trainer Sight")
jp Bankswitch ; indirect jump to one of the four functions

CheckForEngagingTrainers::
Expand Down
6 changes: 6 additions & 0 deletions macros/asserts.asm
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ MACRO assert_table_length
"{CURRENT_TABLE_START}: expected {d:x} entries, each {d:CURRENT_TABLE_WIDTH} bytes"
ENDM

MACRO assert_max_table_length
DEF x = \1
ASSERT x * CURRENT_TABLE_WIDTH >= @ - {CURRENT_TABLE_START}, \
"{CURRENT_TABLE_START}: expected a maximum of {d:x} entries, each {d:CURRENT_TABLE_WIDTH} bytes"
ENDM

MACRO list_start
DEF list_index = 0
IF _NARG == 1
Expand Down
2 changes: 2 additions & 0 deletions ram/hram.asm
Original file line number Diff line number Diff line change
Expand Up @@ -405,3 +405,5 @@ hDelayFrameHookBank:: db
hColorHackTmp:: db

ds 3

ENDSECTION

0 comments on commit 57ece62

Please sign in to comment.