Skip to content

Commit 5714b5e

Browse files
committed
Merge branch 'master' of github.com:profi200/open_agb_firm
2 parents dc03206 + 782596f commit 5714b5e

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

Makefile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,18 @@ export TARGET := open_agb_firm
99
ENTRY9 := 0x08000040
1010
ENTRY11 := 0x1FF89034
1111
SECTION0_ADR := 0x08000040
12+
ifeq ($(strip $(USE_FIRMTOOL)),1)
13+
SECTION0_TYPE := NDMA
14+
else
1215
SECTION0_TYPE := 0
16+
endif
1317
SECTION0_FILE := arm9/$(TARGET)9.bin
1418
SECTION1_ADR := 0x1FF89000
19+
ifeq ($(strip $(USE_FIRMTOOL)),1)
20+
SECTION1_TYPE := XDMA
21+
else
1522
SECTION1_TYPE := 1
23+
endif
1624
SECTION1_FILE := arm11/$(TARGET)11.bin
1725

1826

@@ -38,8 +46,13 @@ checkarm11:
3846

3947
#---------------------------------------------------------------------------------
4048
$(TARGET).firm: arm9/$(TARGET)9.bin arm11/$(TARGET)11.bin
49+
ifeq ($(strip $(USE_FIRMTOOL)),1)
50+
firmtool build $(TARGET).firm -n $(ENTRY9) -e $(ENTRY11) -A $(SECTION0_ADR) $(SECTION1_ADR) \
51+
-D $(SECTION0_FILE) $(SECTION1_FILE) -C $(SECTION0_TYPE) $(SECTION1_TYPE)
52+
else
4153
firm_builder $(TARGET).firm $(ENTRY9) $(ENTRY11) $(SECTION0_ADR) $(SECTION0_TYPE) \
4254
$(SECTION0_FILE) $(SECTION1_ADR) $(SECTION1_TYPE) $(SECTION1_FILE)
55+
endif
4356

4457
#---------------------------------------------------------------------------------
4558
arm9/$(TARGET)9.bin:
@@ -58,8 +71,13 @@ clean:
5871
release: clean
5972
@$(MAKE) -j4 --no-print-directory -C arm9 NO_DEBUG=1
6073
@$(MAKE) -j4 --no-print-directory -C arm11 NO_DEBUG=1
74+
ifeq ($(strip $(USE_FIRMTOOL)),1)
75+
firmtool build $(TARGET).firm -n $(ENTRY9) -e $(ENTRY11) -A $(SECTION0_ADR) $(SECTION1_ADR) \
76+
-D $(SECTION0_FILE) $(SECTION1_FILE) -C $(SECTION0_TYPE) $(SECTION1_TYPE)
77+
else
6178
firm_builder $(TARGET).firm $(ENTRY9) $(ENTRY11) $(SECTION0_ADR) $(SECTION0_TYPE) \
6279
$(SECTION0_FILE) $(SECTION1_ADR) $(SECTION1_TYPE) $(SECTION1_FILE)
80+
endif
6381
@7z a -mx -m0=ARM -m1=LZMA $(TARGET)$(VERS_STRING).7z $(TARGET).firm
6482
@7z u -mx -m0=LZMA $(TARGET)$(VERS_STRING).7z resources/gba_db.bin
6583
@7z u -mx -m0=PPMD $(TARGET)$(VERS_STRING).7z libn3ds/thirdparty/fatfs/LICENSE.txt thirdparty/inih/LICENSE.txt LICENSE.txt README.md

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,9 @@ A: First, please ensure that the GBA ROM you are playing is not modified in any
144144
To compile open_agb_firm, the following needs to be installed:
145145
* [devkitARM](https://devkitpro.org/wiki/devkitPro_pacman)
146146
* [Corelink DMA-330 Assembler](https://github.com/profi200/dma330as)
147-
* [CTR Firm Builder](https://github.com/derrekr/ctr_firm_builder)
147+
* [CTR Firm Builder](https://github.com/derrekr/ctr_firm_builder) or [firmtool](https://github.com/TuxSH/firmtool)
148148

149-
Additionally, `p7zip` (or if available, `p7zip-full`) needs to be installed to make release builds. Also, make sure that the `dma330as` and `firmbuilder` binaries are in the PATH environment variable and accessible to the Makefile.
149+
Additionally, `p7zip` (or if available, `p7zip-full`) needs to be installed to make release builds. Also, make sure that the `dma330as` and `firm_builder`/`firmtool` binaries are in the PATH environment variable and accessible to the Makefile.
150150

151151
Build open_agb_firm as a debug build via `make`, or as a release build via `make release`.
152152

0 commit comments

Comments
 (0)