Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaizu committed Nov 14, 2023
2 parents ee0222c + c1cdc32 commit 4272155
Show file tree
Hide file tree
Showing 1,728 changed files with 80,375 additions and 31,763 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
jobs:
build:
runs-on: ubuntu-latest
container: devkitpro/devkitarm
env:
GAME_VERSION: EMERALD
GAME_REVISION: 0
Expand All @@ -27,7 +28,9 @@ jobs:
repository: pret/agbcc

- name: Install binutils
run: sudo apt install gcc-arm-none-eabi binutils-arm-none-eabi libelf-dev
run: |
sudo apt update
sudo apt install -y build-essential libpng-dev libelf-dev
# build-essential, git, and libpng-dev are already installed
# gcc-arm-none-eabi is only needed for the modern build
# as an alternative to dkP
Expand All @@ -39,6 +42,9 @@ jobs:
working-directory: agbcc

- name: Agbcc
env:
MODERN: 0
COMPARE: 0
run: make -j${nproc} -O all

- name: Modern
Expand All @@ -49,6 +55,7 @@ jobs:

- name: Test
env:
MODERN: 1
TEST: 1
run: |
make -j${nproc} -O pokeemerald-test.elf
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@ prefabs.json
*.diff
*.sym
*.js
src/data/map_group_count.h
10 changes: 5 additions & 5 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Some tips before proceeding:
4. Certain packages are required to build pokeemerald. Install these packages by running the following command:

```bash
sudo apt install build-essential binutils-arm-none-eabi git libpng-dev
sudo apt install build-essential binutils-arm-none-eabi gcc-arm-none-eabi libnewlib-arm-none-eabi git libpng-dev
```
<details>
<summary><i>Note...</i></summary>
Expand Down Expand Up @@ -329,28 +329,28 @@ Open Terminal and enter the following commands, depending on which distro you're
### Debian/Ubuntu-based distributions
Run the following command to install the necessary packages:
```bash
sudo apt install build-essential binutils-arm-none-eabi git libpng-dev
sudo apt install build-essential binutils-arm-none-eabi gcc-arm-none-eabi libnewlib-arm-none-eabi git libpng-dev
```
Then proceed to [Choosing where to store pokeemerald (Linux)](#choosing-where-to-store-pokeemerald-linux).
<details>
<summary><i>Note for legacy repos...</i></summary>

> If the repository you plan to build has an **[older revision of the INSTALL.md](https://github.com/pret/pokeemerald/blob/571c598/INSTALL.md)**,
> then you will have to install devkitARM. Install all the above packages except binutils-arm-none-eabi, and follow the instructions to
> then you will have to install devkitARM. Install all the above packages except for the arm-none-eabi packages, and follow the instructions to
> [install devkitARM on Debian/Ubuntu-based distributions](#installing-devkitarm-on-debianubuntu-based-distributions).
</details>

### Arch Linux
Run this command as root to install the necessary packages:
```bash
pacman -S base-devel arm-none-eabi-binutils git libpng
pacman -S base-devel arm-none-eabi-binutils arm-none-eabi-gcc arm-none-eabi-newlib git libpng
```
Then proceed to [Choosing where to store pokeemerald (Linux)](#choosing-where-to-store-pokeemerald-linux).
<details>
<summary><i>Note for legacy repos...</i></summary>

> If the repository you plan to build has an **[older revision of the INSTALL.md](https://github.com/pret/pokeemerald/blob/571c598/INSTALL.md)**,
> then you will have to install devkitARM. Install all the above packages except binutils-arm-none-eabi, and follow the instructions to
> then you will have to install devkitARM. Install all the above packages except for the arm-none-eabi packages, and follow the instructions to
> [install devkitARM on Arch Linux](#installing-devkitarm-on-arch-linux).
</details>

Expand Down
19 changes: 11 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ TITLE := POKEMON EMER
GAME_CODE := BPEE
MAKER_CODE := 01
REVISION := 0
MODERN ?= 0
MODERN ?= 1
TEST ?= 0
ANALYZE ?= 0

ifeq (modern,$(MAKECMDGOALS))
MODERN := 1
ifeq (agbcc,$(MAKECMDGOALS))
MODERN := 0
endif

ifeq (check,$(MAKECMDGOALS))
Expand All @@ -69,12 +69,12 @@ else
CPP := $(PREFIX)cpp
endif

ROM_NAME := pokeemerald.gba
ROM_NAME := pokeemerald_agbcc.gba
ELF_NAME := $(ROM_NAME:.gba=.elf)
MAP_NAME := $(ROM_NAME:.gba=.map)
OBJ_DIR_NAME := build/emerald

MODERN_ROM_NAME := pokeemerald_modern.gba
MODERN_ROM_NAME := pokeemerald.gba
MODERN_ELF_NAME := $(MODERN_ROM_NAME:.gba=.elf)
MODERN_MAP_NAME := $(MODERN_ROM_NAME:.gba=.map)
MODERN_OBJ_DIR_NAME := build/modern
Expand Down Expand Up @@ -123,7 +123,7 @@ LIBPATH := -L ../../tools/agbcc/lib
LIB := $(LIBPATH) -lgcc -lc -L../../libagbsyscall -lagbsyscall
else
CC1 = $(shell $(PATH_MODERNCC) --print-prog-name=cc1) -quiet
override CFLAGS += -mthumb -mthumb-interwork -O2 -mabi=apcs-gnu -mtune=arm7tdmi -march=armv4t -fno-toplevel-reorder -Wno-pointer-to-int-cast -std=gnu17
override CFLAGS += -mthumb -mthumb-interwork -O2 -mabi=apcs-gnu -mtune=arm7tdmi -march=armv4t -fno-toplevel-reorder -Wno-pointer-to-int-cast -std=gnu17 -Werror -Wall -Wno-strict-aliasing -Wno-attribute-alias -Woverride-init
ifeq ($(ANALYZE),1)
override CFLAGS += -fanalyzer
endif
Expand Down Expand Up @@ -182,15 +182,15 @@ MAKEFLAGS += --no-print-directory
# Secondary expansion is required for dependency variables in object rules.
.SECONDEXPANSION:

.PHONY: all rom clean compare tidy tools check-tools mostlyclean clean-tools clean-check-tools $(TOOLDIRS) $(CHECKTOOLDIRS) libagbsyscall modern tidymodern tidynonmodern check
.PHONY: all rom clean compare tidy tools check-tools mostlyclean clean-tools clean-check-tools $(TOOLDIRS) $(CHECKTOOLDIRS) libagbsyscall agbcc modern tidymodern tidynonmodern check

infoshell = $(foreach line, $(shell $1 | sed "s/ /__SPACE__/g"), $(info $(subst __SPACE__, ,$(line))))

# Build tools when building the rom
# Disable dependency scanning for clean/tidy/tools
# Use a separate minimal makefile for speed
# Since we don't need to reload most of this makefile
ifeq (,$(filter-out all rom compare modern check libagbsyscall syms $(TESTELF),$(MAKECMDGOALS)))
ifeq (,$(filter-out all rom compare agbcc modern check libagbsyscall syms $(TESTELF),$(MAKECMDGOALS)))
$(call infoshell, $(MAKE) -f make_tools.mk)
else
NODEP ?= 1
Expand Down Expand Up @@ -349,6 +349,7 @@ $(C_BUILDDIR)/librfu_intr.o: CC1 := tools/agbcc/bin/agbcc_arm$(EXE)
$(C_BUILDDIR)/librfu_intr.o: CFLAGS := -O2 -mthumb-interwork -quiet
else
$(C_BUILDDIR)/librfu_intr.o: CFLAGS := -mthumb-interwork -O2 -mabi=apcs-gnu -mtune=arm7tdmi -march=armv4t -fno-toplevel-reorder -Wno-pointer-to-int-cast
$(C_BUILDDIR)/pokedex_plus_hgss.o: CFLAGS := -mthumb -mthumb-interwork -O2 -mabi=apcs-gnu -mtune=arm7tdmi -march=armv4t -Wno-pointer-to-int-cast -std=gnu17 -Werror -Wall -Wno-strict-aliasing -Wno-attribute-alias -Woverride-init
endif

ifeq ($(DINFO),1)
Expand Down Expand Up @@ -484,6 +485,8 @@ $(ROM): $(ELF)
$(OBJCOPY) -O binary $< $@
$(FIX) $@ -p --silent

agbcc: all

modern: all

LD_SCRIPT_TEST := ld_script_test.txt
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,17 @@ The pokeemerald Expansion is a feature branch meant to be integrated into existi
- Feature branches incorporated:
- [RHH intro credits](https://github.com/Xhyzi/pokeemerald/tree/rhh-intro-credits) by Xhyzi.
- A small signature from all of us to show the collective effort in the project :)
- [Overworld debug]() by TheXaman
- [Overworld debug](https://github.com/TheXaman/pokeemerald/tree/tx_debug_system) by TheXaman
- May be disabled.
- Accesible by pressing `R + Start` in the overworld by default.
- **Additional features**:
- *Clear Boxes*: cleans every Pokémon from the Boxes.
- *Hatch an Egg*: lets you choose an Egg in your party and immediatly hatch it.
- [HGSS Pokédex](https://github.com/TheXaman/pokeemerald/tree/tx_pokedexPlus_hgss) by TheXaman
- May be disabled.
- **Additional features**:
- *Support for new evolution methods*.
- *Dark Mode*.
- Other features
- Pressing B while holding a Pokémon drops them like in modern games (configurable).
- Running indoors (configurable).
Expand Down
59 changes: 54 additions & 5 deletions asm/macros/battle_script.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1366,6 +1366,12 @@
.byte \battler
.endm

.macro trysetoctolock battler:req, failInstr:req
callnative BS_TrySetOctolock
.byte \battler
.4byte \failInstr
.endm

.macro setzeffect
callnative BS_SetZEffect
.endm
Expand Down Expand Up @@ -1461,6 +1467,49 @@
.4byte \failInstr
.endm

@ Used to active a different Max Move effects.
.macro setmaxmoveeffect
callnative BS_SetMaxMoveEffect
.endm

.macro setsteelsurge, failInstr:req
callnative BS_SetSteelsurge
.4byte \failInstr
.endm

.macro damagenontypes
callnative BS_DamageNonTypes
.endm

.macro trysetstatus1, ptr:req
callnative BS_TrySetStatus1
.4byte \ptr
.endm

.macro trysetstatus2, ptr:req
callnative BS_TrySetStatus2
.4byte \ptr
.endm

.macro tryhealsixthhealth, ptr:req
callnative BS_HealOneSixth
.4byte \ptr
.endm

.macro tryrecycleberry, ptr:req
callnative BS_TryRecycleBerry
.4byte \ptr
.endm
.macro updatedynamax
callnative BS_UpdateDynamax
.endm

.macro jumpiftargetdynamaxed, ptr:req
callnative BS_JumpIfDynamaxed
.4byte \ptr
.endm

@ various command changed to more readable macros
.macro cancelmultiturnmoves battler:req
various \battler, VARIOUS_CANCEL_MULTI_TURN_MOVES
Expand Down Expand Up @@ -2044,11 +2093,6 @@
.4byte \failInstr
.endm

.macro setoctolock battler:req, failInstr:req
various \battler, VARIOUS_SET_OCTOLOCK
.4byte \failInstr
.endm

.macro cutonethirdhpraisestats failInstr:req
various BS_ATTACKER, VARIOUS_CUT_1_3_HP_RAISE_STATS
.4byte \failInstr
Expand Down Expand Up @@ -2340,3 +2384,8 @@
getbattlerfainted \battler
jumpifbyte CMP_EQUAL, gBattleCommunication, \value, \ptr
.endm

.macro flushtextbox
printstring STRINGID_EMPTYSTRING3
waitmessage 1
.endm
1 change: 1 addition & 0 deletions charmap.txt
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ SUPER_RE = A0
'ä' = F4
'ö' = F5
'ü' = F6
EMOJI_DIZZYEGG = F7
TALL_PLUS = FC 0C FB
'$' = FF

Expand Down
Loading

0 comments on commit 4272155

Please sign in to comment.