Skip to content

Commit

Permalink
Version 1.6.0 (#3350)
Browse files Browse the repository at this point in the history
  • Loading branch information
AsparagusEduardo authored Sep 27, 2023
2 parents a0e560e + 9f60202 commit 7b3f72f
Show file tree
Hide file tree
Showing 1,639 changed files with 31,563 additions and 34,793 deletions.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ MAKER_CODE := 01
REVISION := 0
MODERN ?= 0
TEST ?= 0
ANALYZE ?= 0

ifeq (modern,$(MAKECMDGOALS))
MODERN := 1
Expand Down Expand Up @@ -118,7 +119,10 @@ 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
override CFLAGS += -mthumb -mthumb-interwork -O2 -mabi=apcs-gnu -mtune=arm7tdmi -march=armv4t -fno-toplevel-reorder -Wno-pointer-to-int-cast -std=gnu17
ifeq ($(ANALYZE),1)
override CFLAGS += -fanalyzer
endif
ROM := $(MODERN_ROM_NAME)
OBJ_DIR := $(MODERN_OBJ_DIR_NAME)
LIBPATH := -L "$(dir $(shell $(PATH_MODERNCC) -mthumb -print-file-name=libgcc.a))" -L "$(dir $(shell $(PATH_MODERNCC) -mthumb -print-file-name=libnosys.a))" -L "$(dir $(shell $(PATH_MODERNCC) -mthumb -print-file-name=libc.a))"
Expand Down
2 changes: 1 addition & 1 deletion asm/macros/battle_frontier/frontier_util.inc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@ Get the status (CHALLENGE_STATUS_*) of the current challenge and store the result in VAR_TEMP_0
@ Get the status (CHALLENGE_STATUS_*) of the current challenge and store the result in VAR_TEMP_CHALLENGE_STATUS
.macro frontier_getstatus
setvar VAR_0x8004, FRONTIER_UTIL_FUNC_GET_STATUS
special CallFrontierUtilFunc
Expand Down
103 changes: 65 additions & 38 deletions asm/macros/battle_script.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1187,11 +1187,11 @@
.byte 0xe5
.endm

.macro doweatherformchangeanimation
.macro unused3
.byte 0xe6
.endm

.macro tryweatherformdatachange
.macro unused4
.byte 0xe7
.endm

Expand Down Expand Up @@ -1311,7 +1311,7 @@
callnative BS_CalcMetalBurstDmg
.4byte \failInstr
.endm

.macro jumpifcantfling battler:req, jumpInstr:req
callnative BS_JumpIfCantFling
.byte \battler
Expand Down Expand Up @@ -1361,6 +1361,11 @@
callnative BS_SetSnow
.endm

.macro applysaltcure battler:req
callnative BS_ApplySaltCure
.byte \battler
.endm

.macro setzeffect
callnative BS_SetZEffect
.endm
Expand All @@ -1382,6 +1387,57 @@
.4byte \ptr
.endm

.macro jumpifcantloseitem battler:req, ptr:req
callnative BS_JumpIfCantLoseItem
.byte \battler
.4byte \ptr
.endm

.macro handlemegaevo battler:req, case:req
callnative BS_HandleMegaEvolution
.byte \battler
.byte \case
.endm

.macro handleprimalreversion battler:req, case:req
callnative BS_HandlePrimalReversion
.byte \battler
.byte \case
.endm

.macro handleultraburst battler:req, case:req
callnative BS_HandleUltraBurst
.byte \battler
.byte \case
.endm

.macro jumpifshelltrap battler:req, jumpInstr:req
callnative BS_JumpIfShellTrap
.byte \battler
.4byte \jumpInstr
.endm

.macro jumpifemergencyexited battler:req, jumpInstr:req
callnative BS_JumpIfEmergencyExited
.byte \battler
.4byte \jumpInstr
.endm

.macro jumpifrodaffected battler:req, jumpInstr:req
callnative BS_JumpIfRod
.4byte \jumpInstr
.endm

.macro jumpifabsorbaffected battler:req, jumpInstr:req
callnative BS_JumpIfAbsorb
.4byte \jumpInstr
.endm

.macro jumpifmotoraffected battler:req, jumpInstr:req
callnative BS_JumpIfMotor
.4byte \jumpInstr
.endm

.macro jumpifargument argument:req, jumpInstr:req
callnative BS_JumpIfArgument
.byte \argument
Expand Down Expand Up @@ -1640,16 +1696,6 @@
.4byte \failInstr
.endm

.macro handlemegaevo battler:req, case:req
various \battler, VARIOUS_HANDLE_MEGA_EVO
.byte \case
.endm

.macro handleprimalreversion battler:req, case:req
various \battler, VARIOUS_HANDLE_PRIMAL_REVERSION
.byte \case
.endm

.macro handleformchange battler:req, case:req
various \battler, VARIOUS_HANDLE_FORM_CHANGE
.byte \case
Expand Down Expand Up @@ -2016,21 +2062,6 @@
various BS_ATTACKER, VARIOUS_SHELL_SIDE_ARM_CHECK
.endm

.macro jumpifrodaffected battler:req, jumpInstr:req
various \battler, VARIOUS_JUMP_IF_ROD
.4byte \jumpInstr
.endm

.macro jumpifabsorbaffected battler:req, jumpInstr:req
various \battler, VARIOUS_JUMP_IF_ABSORB
.4byte \jumpInstr
.endm

.macro jumpifmotoraffected battler:req, jumpInstr:req
various \battler, VARIOUS_JUMP_IF_MOTOR
.4byte \jumpInstr
.endm

.macro jumpifteanoberry jumpInstr:req
various BS_ATTACKER, VARIOUS_TEATIME_TARGETS
.4byte \jumpInstr
Expand Down Expand Up @@ -2295,16 +2326,6 @@
waitmessage B_WAIT_TIME_LONG
.endm

.macro jumpifemergencyexited battler:req, jumpInstr:req
various \battler, VARIOUS_JUMP_IF_EMERGENCY_EXITED
.4byte \jumpInstr
.endm

.macro jumpifshelltrap battler:req, ptr:req
various \battler, VARIOUS_JUMP_IF_SHELL_TRAP
.4byte \ptr
.endm

.macro hitswitchtargetfailed
various 0, VARIOUS_HIT_SWITCH_TARGET_FAILED
.endm
Expand All @@ -2313,3 +2334,9 @@
various 0, VARIOUS_TRY_REVIVAL_BLESSING
.4byte \jumpInstr
.endm

@ Will jump to script pointer if the specified battler has or has not fainted.
.macro jumpiffainted battler:req, value:req, ptr:req
getbattlerfainted \battler
jumpifbyte CMP_EQUAL, gBattleCommunication, \value, \ptr
.endm
7 changes: 7 additions & 0 deletions asm/macros/event.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2018,3 +2018,10 @@
setvar VAR_0x8002, \tryMultiple
special TrySpecialOverworldEvo
.endm
.macro ai_vs_ai_battle trainer1:req, trainer2:req
setflag B_FLAG_AI_VS_AI_BATTLE
setvar VAR_0x8004, \trainer1
callnative CreateTrainerPartyForPlayer
trainerbattle_no_intro \trainer2, NULL
.endm
6 changes: 3 additions & 3 deletions charmap.txt
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ B_ATK_PARTNER_NAME = FD 0E
B_ATK_NAME_WITH_PREFIX = FD 0F
B_DEF_NAME_WITH_PREFIX = FD 10
B_EFF_NAME_WITH_PREFIX = FD 11 @ EFF = short for gEffectBattler
B_ACTIVE_NAME_WITH_PREFIX = FD 12
@ FD 12 - preiously gActiveBattler with prefix
B_SCR_ACTIVE_NAME_WITH_PREFIX = FD 13
B_CURRENT_MOVE = FD 14
B_LAST_MOVE = FD 15
Expand Down Expand Up @@ -409,8 +409,8 @@ B_ATK_TEAM2 = FD 38
B_DEF_NAME = FD 39
B_DEF_TEAM1 = FD 3A
B_DEF_TEAM2 = FD 3B
B_ACTIVE_NAME = FD 3C
B_ACTIVE_NAME2 = FD 3D @ no Illusion check
@ FD 3C - preiously gActiveBattler
@ FD 3D - preiously gActiveBattler without Illusion Check

@ indicates the end of a town/city name (before " TOWN" or " CITY")
NAME_END = FC 00
Expand Down
3 changes: 3 additions & 0 deletions common_syms/battle_controllers.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
gBattlerControllerFuncs
gBattleControllerData
gBattlerControllerEndFuncs
2 changes: 0 additions & 2 deletions common_syms/battle_main.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ gPreBattleCallback1
gBattleMainFunc
gBattleResults
gLeveledUpInBattle
gBattlerControllerFuncs
gHealthboxSpriteIds
gMultiUsePlayerCursor
gNumberOfMovesToChoose
gBattleControllerData
1 change: 1 addition & 0 deletions constants/constants.inc
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.include "constants/gba_constants.inc"
.include "constants/global.inc"
.include "constants/tms_hms.inc"
5 changes: 5 additions & 0 deletions constants/gba_constants.inc
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#ifndef GUARD_CONSTANTS_GBA_CONSTANTS_INC
#define GUARD_CONSTANTS_GBA_CONSTANTS_INC

.set PSR_USR_MODE, 0x00000010
.set PSR_FIQ_MODE, 0x00000011
.set PSR_IRQ_MODE, 0x00000012
Expand Down Expand Up @@ -511,3 +514,5 @@
.set BLDCNT_TGT2_OBJ, 1 << 12
.set BLDCNT_TGT2_BD, 1 << 13
.set BLDCNT_TGT2_ALL, BLDCNT_TGT2_BG0 | BLDCNT_TGT2_BG1 | BLDCNT_TGT2_BG2 | BLDCNT_TGT2_BG3 | BLDCNT_TGT2_OBJ | BLDCNT_TGT2_BD

#endif @ GUARD_CONSTANTS_GBA_CONSTANTS_INC
5 changes: 5 additions & 0 deletions constants/global.inc
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#ifndef GUARD_CONSTANTS_GLOBAL_INC
#define GUARD_CONSTANTS_GLOBAL_INC

.set TRUE, 1
.set FALSE, 0

Expand All @@ -20,3 +23,5 @@

.set OBJ_IMAGE_ANIM_H_FLIP, 1 << 6
.set OBJ_IMAGE_ANIM_V_FLIP, 1 << 7

#endif @ GUARD_CONSTANTS_GLOBAL_INC
5 changes: 5 additions & 0 deletions constants/m4a_constants.inc
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#ifndef GUARD_CONSTANTS_M4A_CONSTANTS_INC
#define GUARD_CONSTANTS_M4A_CONSTANTS_INC

.equiv ID_NUMBER, 0x68736d53

.equiv PCM_DMA_BUF_SIZE, 1584
Expand Down Expand Up @@ -250,3 +253,5 @@
struct_field o_CgbChannel_nextChannelPointer, 4
struct_field o_CgbChannel_dummy4, 8
struct_field CgbChannel_size, 0

#endif @ GUARD_CONSTANTS_M4A_CONSTANTS_INC
22 changes: 22 additions & 0 deletions constants/tms_hms.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#ifndef GUARD_CONSTANTS_TMS_HMS_INC
#define GUARD_CONSTANTS_TMS_HMS_INC

#include "constants/tms_hms.h"

/* Expands to:
* enum_start ITEM_TM01
* enum ITEM_TM_FOCUS_PUNCH
* ...
* enum_start ITEM_HM01
* enum ITEM_HM_CUT
* ... */
#define EQUIV_TM(id) enum ITEM_TM_ ## id;
#define EQUIV_HM(id) enum ITEM_HM_ ## id;
enum_start ITEM_TM01
FOREACH_TM(EQUIV_TM)
enum_start ITEM_HM01
FOREACH_HM(EQUIV_HM)
#undef EQUIV_TM
#undef EQUIV_HM

#endif @ GUARD_CONSTANTS_TMS_HMS_INC
Loading

0 comments on commit 7b3f72f

Please sign in to comment.