Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some progress on the pret merge. #37

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@
<!-- If it doesn't apply, feel free to remove this section. -->

## **Discord contact info**
<!--- formatted as name#numbers, e.g. Lunos#4026 -->
<!--- Formatted as username (e.g. Lunos) or username#numbers (e.g. Lunos#4026 -->
<!--- Contributors must join https://discord.gg/6CzjAG6GZk -->
2 changes: 1 addition & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Unscientific benchmarks suggest **msys2 is 2x slower** than WSL1, and **Cygwin i

All of the Windows instructions assume that the default drive is C:\\. If this differs to your actual drive letter, then replace C with the correct drive letter when reading the instructions.

**A note of caution**: As Windows 7 is officially unsupported by Microsoft and Windows 8 has very little usage, some maintainers are unwilling to maintain the Windows 7/8 instructions. Thus, these instructions may break in the future with fixes taking longer than fixes to the Windows 10 instructions.
**A note of caution**: As Windows 7 and Windows 8 are officially unsupported by Microsoft, some maintainers are unwilling to maintain the Windows 7/8 instructions. Thus, these instructions may break in the future with fixes taking longer than fixes to the Windows 10/11 instructions.

## Windows 10/11 (WSL1)
WSL1 is the preferred terminal to build **pokeemerald Expansion**. The following instructions will explain how to install WSL1 (referred to interchangeably as WSL).
Expand Down
13 changes: 3 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ SYM := $(ROM:.gba=.sym)

# Commonly used directories
C_SUBDIR = src
GFLIB_SUBDIR = gflib
ASM_SUBDIR = asm
DATA_SRC_SUBDIR = src/data
DATA_ASM_SUBDIR = data
Expand All @@ -124,7 +123,6 @@ CRY_SUBDIR = sound/direct_sound_samples/cries
TEST_SUBDIR = test

C_BUILDDIR = $(OBJ_DIR)/$(C_SUBDIR)
GFLIB_BUILDDIR = $(OBJ_DIR)/$(GFLIB_SUBDIR)
ASM_BUILDDIR = $(OBJ_DIR)/$(ASM_SUBDIR)
DATA_ASM_BUILDDIR = $(OBJ_DIR)/$(DATA_ASM_SUBDIR)
SONG_BUILDDIR = $(OBJ_DIR)/$(SONG_SUBDIR)
Expand All @@ -141,7 +139,7 @@ INCLUDE_CPP_ARGS := $(INCLUDE_DIRS:%=-iquote %)
INCLUDE_SCANINC_ARGS := $(INCLUDE_DIRS:%=-I %)

O_LEVEL ?= 2
CPPFLAGS := $(INCLUDE_CPP_ARGS) -iquote $(GFLIB_SUBDIR) -Wno-trigraphs -DMODERN=$(MODERN) -DTESTING=$(TEST)
CPPFLAGS := $(INCLUDE_CPP_ARGS) -Wno-trigraphs -DMODERN=$(MODERN) -DTESTING=$(TEST)
ifeq ($(MODERN),0)
CPPFLAGS += -I tools/agbcc/include -I tools/agbcc -nostdinc -undef
CC1 := tools/agbcc/bin/agbcc$(EXE)
Expand Down Expand Up @@ -239,9 +237,6 @@ TEST_SRCS := $(foreach src,$(TEST_SRCS_IN),$(if $(findstring .inc.c,$(src)),,$(s
TEST_OBJS := $(patsubst $(TEST_SUBDIR)/%.c,$(TEST_BUILDDIR)/%.o,$(TEST_SRCS))
TEST_OBJS_REL := $(patsubst $(OBJ_DIR)/%,%,$(TEST_OBJS))

GFLIB_SRCS := $(wildcard $(GFLIB_SUBDIR)/*.c)
GFLIB_OBJS := $(patsubst $(GFLIB_SUBDIR)/%.c,$(GFLIB_BUILDDIR)/%.o,$(GFLIB_SRCS))

C_ASM_SRCS := $(wildcard $(C_SUBDIR)/*.s $(C_SUBDIR)/*/*.s $(C_SUBDIR)/*/*/*.s)
C_ASM_OBJS := $(patsubst $(C_SUBDIR)/%.s,$(C_BUILDDIR)/%.o,$(C_ASM_SRCS))

Expand All @@ -260,7 +255,7 @@ SONG_OBJS := $(patsubst $(SONG_SUBDIR)/%.s,$(SONG_BUILDDIR)/%.o,$(SONG_SRCS))
MID_SRCS := $(wildcard $(MID_SUBDIR)/*.mid)
MID_OBJS := $(patsubst $(MID_SUBDIR)/%.mid,$(MID_BUILDDIR)/%.o,$(MID_SRCS))

OBJS := $(C_OBJS) $(GFLIB_OBJS) $(C_ASM_OBJS) $(ASM_OBJS) $(DATA_ASM_OBJS) $(SONG_OBJS) $(MID_OBJS)
OBJS := $(C_OBJS) $(C_ASM_OBJS) $(ASM_OBJS) $(DATA_ASM_OBJS) $(SONG_OBJS) $(MID_OBJS)
OBJS_REL := $(patsubst $(OBJ_DIR)/%,%,$(OBJS))

SUBDIRS := $(sort $(dir $(OBJS) $(dir $(TEST_OBJS))))
Expand Down Expand Up @@ -415,17 +410,15 @@ endef
# Calls SCANINC to find dependencies
define C_SCANINC
ifneq ($(NODEP),1)
$1.o: $2 $$(shell $(SCANINC) $(INCLUDE_SCANINC_ARGS) -I tools/agbcc/include -I gflib $2)
$1.o: $2 $$(shell $(SCANINC) $(INCLUDE_SCANINC_ARGS) -I tools/agbcc/include $2)
endif
endef

# Create generic rules if no dependency scanning, else create the real rules
ifeq ($(NODEP),1)
$(eval $(call C_DEP,$(C_BUILDDIR)/%,$(C_SUBDIR)/%.c))
$(eval $(call C_DEP,$(GFLIB_BUILDDIR)/%,$(GFLIB_SUBDIR)/%.c))
else
$(foreach src,$(C_SRCS),$(eval $(call C_DEP,$(OBJ_DIR)/$(basename $(src)),$(src))))
$(foreach src,$(GFLIB_SRCS),$(eval $(call C_DEP,$(OBJ_DIR)/$(basename $(src)),$(src))))
endif

# Similar methodology for Assembly files
Expand Down
16 changes: 8 additions & 8 deletions asm/macros/contest_ai_script.inc
Original file line number Diff line number Diff line change
Expand Up @@ -141,25 +141,25 @@

.macro if_points_less_than num:req, destination:req
.byte 0x16
.byte \num
.2byte \num
.4byte \destination
.endm

.macro if_points_more_than num:req, destination:req
.byte 0x17
.byte \num
.2byte \num
.4byte \destination
.endm

.macro if_points_eq num:req, destination:req
.byte 0x18
.byte \num
.2byte \num
.4byte \destination
.endm

.macro if_points_not_eq num:req, destination:req
.byte 0x19
.byte \num
.2byte \num
.4byte \destination
.endm

Expand All @@ -171,25 +171,25 @@

.macro if_preliminary_points_less_than num:req, destination:req
.byte 0x1B
.byte \num
.2byte \num
.4byte \destination
.endm

.macro if_preliminary_points_more_than num:req, destination:req
.byte 0x1C
.byte \num
.2byte \num
.4byte \destination
.endm

.macro if_preliminary_points_eq num:req, destination:req
.byte 0x1D
.byte \num
.2byte \num
.4byte \destination
.endm

.macro if_preliminary_points_not_eq num:req, destination:req
.byte 0x1E
.byte \num
.2byte \num
.4byte \destination
.endm

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion include/secret_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ void SetCurSecretBaseIdFromPosition(const struct MapPosition *position, const st
void TrySetCurSecretBaseIndex(void);
void CheckPlayerHasSecretBase(void);
void ToggleSecretBaseEntranceMetatile(void);
void ScriptContext_Enable(void);
void ReceiveSecretBasesData(void *records, size_t recordSize, u8 linkIdx);

#endif //GUARD_SECRET_BASE_H
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion gflib/text.h → include/text.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef GUARD_TEXT_H
#define GUARD_TEXT_H

#include "characters.h"
#include "constants/characters.h"

// Given as a text speed when all the text should be
// loaded at once but not copied to vram yet.
Expand Down
File renamed without changes.
34 changes: 15 additions & 19 deletions ld_script.ld
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ SECTIONS {
{
INCLUDE "sym_ewram.ld"
src/*.o(.sbss);
gflib/*.o(.sbss);

*libc.a:impure.o(.data);
*libc.a:locale.o(.data);
Expand All @@ -47,7 +46,6 @@ SECTIONS {
/* .bss starts at 0x3000000 */
INCLUDE "sym_bss.ld"
src/*.o(.bss);
gflib/*.o(.bss);
data/*.o(.bss);

/* .bss.code starts at 0x3001AA8 */
Expand All @@ -69,15 +67,15 @@ SECTIONS {
src/rom_header_rhh.o(.text.*);
src/crt0.o(.text);
src/main.o(.text);
gflib/malloc.o(.text);
gflib/dma3_manager.o(.text);
gflib/gpu_regs.o(.text);
gflib/bg.o(.text);
gflib/blit.o(.text);
gflib/window.o(.text);
gflib/text.o(.text);
gflib/sprite.o(.text);
gflib/string_util.o(.text);
src/malloc.o(.text);
src/dma3_manager.o(.text);
src/gpu_regs.o(.text);
src/bg.o(.text);
src/blit.o(.text);
src/window.o(.text);
src/text.o(.text);
src/sprite.o(.text);
src/string_util.o(.text);
src/link.o(.text);
src/AgbRfu_LinkManager.o(.text);
src/link_rfu_3.o(.text);
Expand Down Expand Up @@ -464,12 +462,12 @@ SECTIONS {
src/rom_header.o(.rodata);
src/rom_header_gf.o(.rodata);
src/main.o(.rodata);
gflib/bg.o(.rodata);
gflib/window.o(.rodata);
gflib/text.o(.rodata);
gflib/sprite.o(.rodata);
gflib/io_reg.o(.rodata);
gflib/string_util.o(.rodata);
src/bg.o(.rodata);
src/window.o(.rodata);
src/text.o(.rodata);
src/sprite.o(.rodata);
src/io_reg.o(.rodata);
src/string_util.o(.rodata);
src/link.o(.rodata);
src/link.o(.rodata.str1.4);
src/AgbRfu_LinkManager.o(.rodata);
Expand Down Expand Up @@ -1336,9 +1334,7 @@ SECTIONS {
ALIGN(4)
{
src/*.o(.text);
gflib/*.o(.text);
src/*.o(.rodata);
gflib/*.o(.rodata);
data/*.o(.rodata);
} > ROM = 0

Expand Down
4 changes: 0 additions & 4 deletions ld_script_modern.ld
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,13 @@ SECTIONS {
ALIGN(4)
{
src/*.o(.bss);
gflib/*.o(.bss);
data/*.o(.bss);
*libc.a:*.o(.bss*);
*libnosys.a:*.o(.bss*);

src/m4a.o(.bss.code);

src/*.o(COMMON);
gflib/*.o(COMMON);
*libc.a:*.o(COMMON);
*libnosys.a:*.o(COMMON);
} > IWRAM
Expand All @@ -64,7 +62,6 @@ SECTIONS {
src/rom_header_rhh.o(.text.*);
src/crt0.o(.text);
src/main.o(.text);
gflib/*.o(.text*);
src/*.o(.text*);
asm/*.o(.text*);
} > ROM =0
Expand Down Expand Up @@ -100,7 +97,6 @@ SECTIONS {
ALIGN(4)
{
src/*.o(.rodata*);
gflib/*.o(.rodata*);
data/*.o(.rodata*);
} > ROM =0

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/mini_printf.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include "gba/types.h"
#include "gba/defines.h"
#include "config/general.h"
#include "characters.h"
#include "constants/characters.h"
#include "string_util.h"

#ifndef NDEBUG
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions sym_bss.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
.include "src/main.o"
.include "gflib/malloc.o"
.include "gflib/dma3_manager.o"
.include "gflib/gpu_regs.o"
.include "gflib/bg.o"
.include "gflib/text.o"
.include "gflib/sprite.o"
.include "src/malloc.o"
.include "src/dma3_manager.o"
.include "src/gpu_regs.o"
.include "src/bg.o"
.include "src/text.o"
.include "src/sprite.o"
.include "src/link.o"
.include "src/AgbRfu_LinkManager.o"
.include "src/link_rfu_3.o"
Expand Down
8 changes: 4 additions & 4 deletions sym_common.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
.space 0x8
.include "main.o"
@ ../gflib/bg.o
@ ../src/bg.o
.align 2
gWindowTileAutoAllocEnabled:
.space 4
@ ../gflib/window.o
@ ../src/window.o
.align 4
gTransparentTileNumber:
.space 1
.align 4
gWindowBgTilemapBuffers:
.space 16
@ ../gflib/text.o
@ ../src/text.o
.align 4
gFonts:
.space 4
Expand All @@ -24,7 +24,7 @@ gCurGlyph:
.align 2
gTextFlags:
.space 4
@ ../gflib/sprite.o
@ ../src/sprite.o
.align 2
gOamMatrixAllocBitmap:
.space 4
Expand Down
10 changes: 5 additions & 5 deletions sym_ewram.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
.include "gflib/malloc.o"
.include "src/malloc.o"
.include "src/decompress.o"
.include "src/main.o"
.include "gflib/window.o"
.include "gflib/text.o"
.include "gflib/sprite.o"
.include "gflib/string_util.o"
.include "src/window.o"
.include "src/text.o"
.include "src/sprite.o"
.include "src/string_util.o"
.include "src/link.o"
.include "src/AgbRfu_LinkManager.o"
.include "src/link_rfu_3.o"
Expand Down
2 changes: 1 addition & 1 deletion test/test_runner.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <stdarg.h>
#include "global.h"
#include "characters.h"
#include "constants/characters.h"
#include "gpu_regs.h"
#include "load_save.h"
#include "main.h"
Expand Down
2 changes: 1 addition & 1 deletion test/test_runner_battle.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "battle_controllers.h"
#include "battle_gimmick.h"
#include "battle_z_move.h"
#include "characters.h"
#include "constants/characters.h"
#include "event_data.h"
#include "fieldmap.h"
#include "item_menu.h"
Expand Down
2 changes: 1 addition & 1 deletion tools/preproc/asm_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include "char_util.h"
#include "utf8.h"
#include "string_parser.h"
#include "../../gflib/characters.h"
#include "../../include/constants/characters.h"
#include "io.h"

AsmFile::AsmFile(std::string filename, bool isStdin, bool doEnum) : m_filename(filename)
Expand Down
Loading