From ba176dfe0729e8c8c46a8f79c2f1b6e732ee13c8 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Mon, 1 Jan 2018 17:41:34 +0100 Subject: start working on battle transition --- include/battle_transition.h | 2 ++ include/overworld.h | 2 ++ include/unk_transition.h | 13 +++++++++++++ 3 files changed, 17 insertions(+) create mode 100644 include/unk_transition.h (limited to 'include') diff --git a/include/battle_transition.h b/include/battle_transition.h index 84b5e37ec..108b6232b 100644 --- a/include/battle_transition.h +++ b/include/battle_transition.h @@ -1,6 +1,7 @@ #ifndef GUARD_BATTLE_TRANSITION_H #define GUARD_BATTLE_TRANSITION_H +void TestBattleTransition(u8 transitionId); void sub_8149DFC(u8 a1); void BattleTransition_StartOnField(u8 transitionID); void BattleTransition_Start(u8 transitionID); @@ -52,5 +53,6 @@ bool8 IsBattleTransitionDone(void); #define B_TRANSITION_39 39 #define B_TRANSITION_40 40 #define B_TRANSITION_41 41 +#define B_TRANSITION_COUNT 42 #endif // GUARD_BATTLE_TRANSITION_H diff --git a/include/overworld.h b/include/overworld.h index a5fba0c10..9f0f80a23 100644 --- a/include/overworld.h +++ b/include/overworld.h @@ -71,4 +71,6 @@ void mapldr_default(void); void IncrementGameStat(u8); u32 GetGameStat(u8); +void CB2_OverworldBasic(void); + #endif //GUARD_ROM4_H diff --git a/include/unk_transition.h b/include/unk_transition.h new file mode 100644 index 000000000..ef7b33ed7 --- /dev/null +++ b/include/unk_transition.h @@ -0,0 +1,13 @@ +#ifndef GUARD_UNK_TRANSITION_H +#define GUARD_UNK_TRANSITION_H + +void Phase2Task_Transition_34(u8 taskId); +void Phase2Task_Transition_35(u8 taskId); +void Phase2Task_Transition_36(u8 taskId); +void Phase2Task_Transition_37(u8 taskId); +void Phase2Task_Transition_38(u8 taskId); +void Phase2Task_Transition_39(u8 taskId); +void Phase2Task_Transition_40(u8 taskId); +void Phase2Task_Transition_41(u8 taskId); + +#endif // GUARD_UNK_TRANSITION_H -- cgit v1.2.3 From eb00e8ba4acab773b5bcebbc622563c60abb512d Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Tue, 2 Jan 2018 20:38:33 +0100 Subject: more work on battle transition --- include/battle_transition.h | 10 ++++++++ include/field_effect.h | 1 + include/gba/io_reg.h | 61 ++++++++++++++++++++++++++++++++++----------- include/unk_transition.h | 16 ++++++------ 4 files changed, 66 insertions(+), 22 deletions(-) (limited to 'include') diff --git a/include/battle_transition.h b/include/battle_transition.h index 108b6232b..2ad27dc29 100644 --- a/include/battle_transition.h +++ b/include/battle_transition.h @@ -7,6 +7,16 @@ void BattleTransition_StartOnField(u8 transitionID); void BattleTransition_Start(u8 transitionID); bool8 IsBattleTransitionDone(void); +enum // TRANSITION_MUGSHOT +{ + MUGSHOT_SYDNEY, + MUGSHOT_PHOEBE, + MUGSHOT_GLACIA, + MUGSHOT_DRAKE, + MUGSHOT_CHAMPION, + MUGSHOTS_COUNT +}; + // credits for the names go to Dyskinesia and Tetrable // names are naturally subject to change diff --git a/include/field_effect.h b/include/field_effect.h index 772b20d37..2d1d3b3b0 100644 --- a/include/field_effect.h +++ b/include/field_effect.h @@ -75,5 +75,6 @@ u32 FieldEffectStart(u8); bool8 FieldEffectActiveListContains(u8 id); void sub_80B69DC(void); void FieldEffectStop(struct Sprite *sprite, u8 id); +u8 CreateTrainerSprite(u8 trainerSpriteID, s16 x, s16 y, u8 subpriority, u8 *buffer); #endif //GUARD_FIELD_EFFECTS_H diff --git a/include/gba/io_reg.h b/include/gba/io_reg.h index f86f2434c..6dbe5e8ed 100644 --- a/include/gba/io_reg.h +++ b/include/gba/io_reg.h @@ -137,8 +137,6 @@ #define REG_OFFSET_DMA3CNT_H 0xde #define REG_OFFSET_TMCNT 0x100 -#define REG_OFFSET_TMCNT_L 0x100 -#define REG_OFFSET_TMCNT_H 0x102 #define REG_OFFSET_TM0CNT 0x100 #define REG_OFFSET_TM0CNT_L 0x100 #define REG_OFFSET_TM0CNT_H 0x102 @@ -300,8 +298,6 @@ #define REG_ADDR_DMA3CNT_H (REG_BASE + REG_OFFSET_DMA3CNT_H) #define REG_ADDR_TMCNT (REG_BASE + REG_OFFSET_TMCNT) -#define REG_ADDR_TMCNT_L (REG_BASE + REG_OFFSET_TMCNT_L) -#define REG_ADDR_TMCNT_H (REG_BASE + REG_OFFSET_TMCNT_H) #define REG_ADDR_TM0CNT (REG_BASE + REG_OFFSET_TM0CNT) #define REG_ADDR_TM0CNT_L (REG_BASE + REG_OFFSET_TM0CNT_L) #define REG_ADDR_TM0CNT_H (REG_BASE + REG_OFFSET_TM0CNT_H) @@ -462,8 +458,6 @@ #define REG_DMA3CNT_H (*(vu16 *)REG_ADDR_DMA3CNT_H) #define REG_TMCNT(n) (*(vu16 *)(REG_ADDR_TMCNT + ((n) * 4))) -#define REG_TMCNT_L(n) (*(vu16 *)(REG_ADDR_TMCNT_L + ((n) * 4))) -#define REG_TMCNT_H(n) (*(vu16 *)(REG_ADDR_TMCNT_H + ((n) * 4))) #define REG_TM0CNT (*(vu32 *)REG_ADDR_TM0CNT) #define REG_TM0CNT_L (*(vu16 *)REG_ADDR_TM0CNT_L) #define REG_TM0CNT_H (*(vu16 *)REG_ADDR_TM0CNT_H) @@ -501,12 +495,12 @@ // I/O register fields // DISPCNT -#define DISPCNT_MODE_0 0x0000 -#define DISPCNT_MODE_1 0x0001 -#define DISPCNT_MODE_2 0x0002 -#define DISPCNT_MODE_3 0x0003 -#define DISPCNT_MODE_4 0x0004 -#define DISPCNT_MODE_5 0x0005 +#define DISPCNT_MODE_0 0x0000 // BG0: text, BG1: text, BG2: text, BG3: text +#define DISPCNT_MODE_1 0x0001 // BG0: text, BG1: text, BG2: affine, BG3: off +#define DISPCNT_MODE_2 0x0002 // BG0: off, BG1: off, BG2: affine, BG3: affine +#define DISPCNT_MODE_3 0x0003 // Bitmap mode, 240x160, BGR555 color +#define DISPCNT_MODE_4 0x0004 // Bitmap mode, 240x160, 256 color palette +#define DISPCNT_MODE_5 0x0005 // Bitmap mode, 160x128, BGR555 color #define DISPCNT_OBJ_1D_MAP 0x0040 #define DISPCNT_FORCED_BLANK 0x0080 #define DISPCNT_BG0_ON 0x0100 @@ -527,7 +521,46 @@ #define DISPSTAT_HBLANK_INTR 0x0010 // H-Blank interrupt enabled #define DISPSTAT_VCOUNT_INTR 0x0020 // V-Count interrupt enabled +// BGCNT +#define BGCNT_PRIORITY(n) (n) // Values 0 - 3. Lower priority BGs will be drawn on top of higher priority BGs. +#define BGCNT_CHARBASE(n) ((n) << 2) // Values 0 - 3. Base block for tile pixel data. +#define BGCNT_MOSAIC 0x0040 +#define BGCNT_16COLOR 0x0000 // 4 bits per pixel +#define BGCNT_256COLOR 0x0080 // 8 bits per pixel +#define BGCNT_SCREENBASE(n) ((n) << 8) // Values 0 - 31. Base block for tile map. +#define BGCNT_WRAP 0x2000 // Only affects affine BGs. Text BGs wrap by default. +#define BGCNT_TXT256x256 0x0000 // Internal screen size size of text mode BG in pixels. +#define BGCNT_TXT512x256 0x4000 +#define BGCNT_TXT256x512 0x8000 +#define BGCNT_TXT512x512 0xC000 +#define BGCNT_AFF128x128 0x0000 // Internal screen size size of affine mode BG in pixels. +#define BGCNT_AFF256x256 0x4000 +#define BGCNT_AFF512x512 0x8000 +#define BGCNT_AFF1024x1024 0xC000 + // BLDCNT +// Bits 0-5 select layers for the 1st target +#define BLDCNT_TGT1_BG0 (1 << 0) +#define BLDCNT_TGT1_BG1 (1 << 1) +#define BLDCNT_TGT1_BG2 (1 << 2) +#define BLDCNT_TGT1_BG3 (1 << 3) +#define BLDCNT_TGT1_OBJ (1 << 4) +#define BLDCNT_TGT1_BD (1 << 5) +// Bits 6-7 select the special effect +#define BLDCNT_EFFECT_NONE (0 << 6) // no special effect +#define BLDCNT_EFFECT_BLEND (1 << 6) // 1st+2nd targets mixed (controlled by BLDALPHA) +#define BLDCNT_EFFECT_LIGHTEN (2 << 6) // 1st target becomes whiter (controlled by BLDY) +#define BLDCNT_EFFECT_DARKEN (3 << 6) // 1st target becomes blacker (controlled by BLDY) +// Bits 8-13 select layers for the 2nd target +#define BLDCNT_TGT2_BG0 (1 << 8) +#define BLDCNT_TGT2_BG1 (1 << 9) +#define BLDCNT_TGT2_BG2 (1 << 10) +#define BLDCNT_TGT2_BG3 (1 << 11) +#define BLDCNT_TGT2_OBJ (1 << 12) +#define BLDCNT_TGT2_BD (1 << 13) + +// BLDALPHA +#define BLDALPHA_BLEND(target1, target2) (((target2) << 8) | (target1)) // SOUNDCNT_H #define SOUND_CGB_MIX_QUARTER 0x0000 @@ -627,8 +660,8 @@ #define KEY_INTR_ENABLE 0x0400 #define KEY_OR_INTR 0x0000 #define KEY_AND_INTR 0x8000 - -#define DPAD_ANY ((DPAD_RIGHT | DPAD_LEFT | DPAD_UP | DPAD_DOWN)) +#define DPAD_ANY 0x00F0 +#define JOY_EXCL_DPAD 0x030F // interrupt flags #define INTR_FLAG_VBLANK (1 << 0) diff --git a/include/unk_transition.h b/include/unk_transition.h index ef7b33ed7..a9caac419 100644 --- a/include/unk_transition.h +++ b/include/unk_transition.h @@ -1,13 +1,13 @@ #ifndef GUARD_UNK_TRANSITION_H #define GUARD_UNK_TRANSITION_H -void Phase2Task_Transition_34(u8 taskId); -void Phase2Task_Transition_35(u8 taskId); -void Phase2Task_Transition_36(u8 taskId); -void Phase2Task_Transition_37(u8 taskId); -void Phase2Task_Transition_38(u8 taskId); -void Phase2Task_Transition_39(u8 taskId); -void Phase2Task_Transition_40(u8 taskId); -void Phase2Task_Transition_41(u8 taskId); +void Phase2Task_34(u8 taskId); +void Phase2Task_35(u8 taskId); +void Phase2Task_36(u8 taskId); +void Phase2Task_37(u8 taskId); +void Phase2Task_38(u8 taskId); +void Phase2Task_39(u8 taskId); +void Phase2Task_40(u8 taskId); +void Phase2Task_41(u8 taskId); #endif // GUARD_UNK_TRANSITION_H -- cgit v1.2.3 From 7be61cfb1a55feb9ab30cfda9e78ed33c74eb097 Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Sat, 6 Jan 2018 21:12:42 -0500 Subject: add assert support to pokeemerald. --- include/assert.h | 43 +++++++++++++++++++++++++++++++++++++++++++ include/config.h | 10 ++++++++++ include/global.h | 1 + 3 files changed, 54 insertions(+) create mode 100755 include/assert.h (limited to 'include') diff --git a/include/assert.h b/include/assert.h new file mode 100755 index 000000000..0c1e5bf77 --- /dev/null +++ b/include/assert.h @@ -0,0 +1,43 @@ +#ifndef GUARD_GBASDKASSERT_H +#define GUARD_GBASDKASSERT_H + +// this header is based on the +// GBA SDK IsAgbAssert.h. + +#ifdef NOAGBPRN + #define AGBPrintInit() + #define AGBPutc(pBuf) + #define AGBPrint(pBuf) + #define AGBPrintf(...) + #define AGBPrintFlush1Block() + #define AGBPrintFlush() + #define AGBAssert(pFile, nLine, pExpression, nStopProgram) +#else + // without NOAGBPRN defined, this enables asserts for usage + // on a standard GBA debugger unit or in emulators that + // support it. + + void AGBPrintInit(void); + void AGBPutc(const char pBuf); + void AGBPrint(const char *pBuf); + void AGBPrintf(const char *pBuf, ...); + void AGBPrintFlush1Block(void); + void AGBPrintFlush(void); + void AGBAssert(const char *pFile, int nLine, const char *pExpression, int nStopProgram); +#endif + +// when using AGB_WARNING, be sure to flush after as AGBAssert does not flush the string to console +// immediately after usage. +#ifdef NOAGBPRN + #define AGB_ASSERT(expression) +#else + #define AGB_ASSERT(expression) (expression) ? ((void *)0) : AGBAssert(__FILE__, __LINE__, #expression, 1); +#endif + +#ifdef NOAGBPRN + #define AGB_WARNING(expression) +#else + #define AGB_WARNING(expression) (expression) ? ((void *)0) : AGBAssert(__FILE__, __LINE__, #expression, 0); +#endif + +#endif diff --git a/include/config.h b/include/config.h index 162af3143..ce8e4ae74 100644 --- a/include/config.h +++ b/include/config.h @@ -1,6 +1,16 @@ #ifndef GUARD_CONFIG_H #define GUARD_CONFIG_H +// In the Generation 3 games, Asserts were used in various debug builds. +// Ruby/Sapphire and Emerald do not have these asserts while Fire Red +// still has them in the ROM. This is because the developers forgot +// to define NOAGBPRN before release, which is actually supposed to be +// NDEBUG, however this has been changed as Ruby's actual debug build +// does not use the AGBPrint features. +#define NOAGBPRN +// NOTE: Don't try to enable assert right now as many pointers +// still exist in defines and WILL likely result in a broken ROM. + #define ENGLISH #ifdef ENGLISH diff --git a/include/global.h b/include/global.h index 7943fc569..1d0962cf6 100644 --- a/include/global.h +++ b/include/global.h @@ -3,6 +3,7 @@ #include "gba/gba.h" #include "config.h" +#include "assert.h" // Prevent cross-jump optimization. #define BLOCK_CROSS_JUMP asm(""); -- cgit v1.2.3 From 419e6d885baa060506489a947718b8610173b450 Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Sat, 6 Jan 2018 21:38:34 -0500 Subject: use firered isagbprint header. --- include/assert.h | 43 ----------------------------------------- include/gba/gba.h | 1 + include/gba/isagbprint.h | 50 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+), 43 deletions(-) delete mode 100755 include/assert.h create mode 100755 include/gba/isagbprint.h (limited to 'include') diff --git a/include/assert.h b/include/assert.h deleted file mode 100755 index 0c1e5bf77..000000000 --- a/include/assert.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef GUARD_GBASDKASSERT_H -#define GUARD_GBASDKASSERT_H - -// this header is based on the -// GBA SDK IsAgbAssert.h. - -#ifdef NOAGBPRN - #define AGBPrintInit() - #define AGBPutc(pBuf) - #define AGBPrint(pBuf) - #define AGBPrintf(...) - #define AGBPrintFlush1Block() - #define AGBPrintFlush() - #define AGBAssert(pFile, nLine, pExpression, nStopProgram) -#else - // without NOAGBPRN defined, this enables asserts for usage - // on a standard GBA debugger unit or in emulators that - // support it. - - void AGBPrintInit(void); - void AGBPutc(const char pBuf); - void AGBPrint(const char *pBuf); - void AGBPrintf(const char *pBuf, ...); - void AGBPrintFlush1Block(void); - void AGBPrintFlush(void); - void AGBAssert(const char *pFile, int nLine, const char *pExpression, int nStopProgram); -#endif - -// when using AGB_WARNING, be sure to flush after as AGBAssert does not flush the string to console -// immediately after usage. -#ifdef NOAGBPRN - #define AGB_ASSERT(expression) -#else - #define AGB_ASSERT(expression) (expression) ? ((void *)0) : AGBAssert(__FILE__, __LINE__, #expression, 1); -#endif - -#ifdef NOAGBPRN - #define AGB_WARNING(expression) -#else - #define AGB_WARNING(expression) (expression) ? ((void *)0) : AGBAssert(__FILE__, __LINE__, #expression, 0); -#endif - -#endif diff --git a/include/gba/gba.h b/include/gba/gba.h index 42ae3cdde..349344031 100644 --- a/include/gba/gba.h +++ b/include/gba/gba.h @@ -7,5 +7,6 @@ #include "gba/multiboot.h" #include "gba/syscall.h" #include "gba/macro.h" +#include "gba/isagbprint.h" #endif // GUARD_GBA_GBA_H diff --git a/include/gba/isagbprint.h b/include/gba/isagbprint.h new file mode 100755 index 000000000..c5eb456c3 --- /dev/null +++ b/include/gba/isagbprint.h @@ -0,0 +1,50 @@ +#ifndef GUARD_GBA_ISAGBPRINT_H +#define GUARD_GBA_ISAGBPRINT_H + +#ifdef NDEBUG +#define AGBPrintInit() +#define AGBPutc(cChr) +#define AGBPrint(pBuf) +#define AGBPrintf(pBuf, ...) +#define AGBPrintFlush1Block() +#define AGBPrintFlush() +#define AGBAssert(pFile, nLine, pExpression, nStopProgram) +#else +void AGBPrintInit(void); +void AGBPutc(const char cChr); +void AGBPrint(const char *pBuf); +void AGBPrintf(const char *pBuf, ...); +void AGBPrintFlush1Block(void); +void AGBPrintFlush(void); +void AGBAssert(const char *pFile, int nLine, const char *pExpression, int nStopProgram); +#endif + +#undef AGB_ASSERT +#ifdef NDEBUG +#define AGB_ASSERT(exp) +#else +#define AGB_ASSERT(exp) (exp) ? ((void*)0) : AGBAssert(__FILE__, __LINE__, #exp, 1); +#endif + +#undef AGB_WARNING +#ifdef NDEBUG +#define AGB_WARNING(exp) +#else +#define AGB_WARNING(exp) (exp) ? ((void*)0) : AGBAssert(__FILE__, __LINE__, #exp, 0); +#endif + +// for matching purposes + +#ifdef NDEBUG +#define AGB_ASSERT_EX(exp, file, line) +#else +#define AGB_ASSERT_EX(exp, file, line) (exp) ? ((void*)0) : AGBAssert(file, line, #exp, 1); +#endif + +#ifdef NDEBUG +#define AGB_WARNING_EX(exp, file, line) +#else +#define AGB_WARNING_EX(exp, file, line) (exp) ? ((void*)0) : AGBAssert(file, line, #exp, 0); +#endif + +#endif // GUARD_GBA_ISAGBPRINT_H -- cgit v1.2.3 From 10ddfac7abab614d2c4488244cee35054ed06fa8 Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Sat, 6 Jan 2018 22:00:08 -0500 Subject: consistency --- include/config.h | 4 ++-- include/global.h | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/config.h b/include/config.h index ce8e4ae74..7ee4503c7 100644 --- a/include/config.h +++ b/include/config.h @@ -4,10 +4,10 @@ // In the Generation 3 games, Asserts were used in various debug builds. // Ruby/Sapphire and Emerald do not have these asserts while Fire Red // still has them in the ROM. This is because the developers forgot -// to define NOAGBPRN before release, which is actually supposed to be +// to define NDEBUG before release, which is actually supposed to be // NDEBUG, however this has been changed as Ruby's actual debug build // does not use the AGBPrint features. -#define NOAGBPRN +#define NDEBUG // NOTE: Don't try to enable assert right now as many pointers // still exist in defines and WILL likely result in a broken ROM. diff --git a/include/global.h b/include/global.h index 1d0962cf6..3e260fd2a 100644 --- a/include/global.h +++ b/include/global.h @@ -1,9 +1,8 @@ #ifndef GUARD_GLOBAL_H #define GUARD_GLOBAL_H +#include "config.h" // we need to define config before gba headers as print stuff needs the functions nulled before defines. #include "gba/gba.h" -#include "config.h" -#include "assert.h" // Prevent cross-jump optimization. #define BLOCK_CROSS_JUMP asm(""); -- cgit v1.2.3 From d98c14444ade7e975585e991ef89c7597295f1b4 Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Sun, 7 Jan 2018 23:46:35 -0500 Subject: NDEBUG which is supposed to be NDEBUG... --- include/config.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/config.h b/include/config.h index 7ee4503c7..53502c6c2 100644 --- a/include/config.h +++ b/include/config.h @@ -4,9 +4,8 @@ // In the Generation 3 games, Asserts were used in various debug builds. // Ruby/Sapphire and Emerald do not have these asserts while Fire Red // still has them in the ROM. This is because the developers forgot -// to define NDEBUG before release, which is actually supposed to be -// NDEBUG, however this has been changed as Ruby's actual debug build -// does not use the AGBPrint features. +// to define NDEBUG before release, however this has been changed as +// Ruby's actual debug build does not use the AGBPrint features. #define NDEBUG // NOTE: Don't try to enable assert right now as many pointers // still exist in defines and WILL likely result in a broken ROM. -- cgit v1.2.3 From 0bf530da12f671c678f7e524b4318213d49b30e0 Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Mon, 8 Jan 2018 22:03:07 -0500 Subject: nocashgba printf --- include/config.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include') diff --git a/include/config.h b/include/config.h index 53502c6c2..318ed39d8 100644 --- a/include/config.h +++ b/include/config.h @@ -7,6 +7,14 @@ // to define NDEBUG before release, however this has been changed as // Ruby's actual debug build does not use the AGBPrint features. #define NDEBUG + +// To enable print debugging, comment out "#define NDEBUG". This allows +// the various AGBPrint functions to be used. (See include/gba/isagbprint.h). +// Some emulators support a debug console window: uncomment NoCashGBAPrint() +// and NoCashGBAPrintf() in libisagbprn.c to use no$gba's own proprietary +// printing system. Use NoCashGBAPrint() and NoCashGBAPrintf() like you +// would normally use AGBPrint() and AGBPrintf(). + // NOTE: Don't try to enable assert right now as many pointers // still exist in defines and WILL likely result in a broken ROM. -- cgit v1.2.3 From 9106d8df1856c65b2bc85da6d61b6968669814ea Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sat, 13 Jan 2018 21:03:07 +0100 Subject: up to groudon transition --- include/battle_transition.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/battle_transition.h b/include/battle_transition.h index 2ad27dc29..bb8505edb 100644 --- a/include/battle_transition.h +++ b/include/battle_transition.h @@ -17,7 +17,7 @@ enum // TRANSITION_MUGSHOT MUGSHOTS_COUNT }; -// credits for the names go to Dyskinesia and Tetrable +// credits for the names go to Dyskinesia, Tetrable and Farore // names are naturally subject to change #define B_TRANSITION_BLUR 0 @@ -47,9 +47,9 @@ enum // TRANSITION_MUGSHOT #define B_TRANSITION_GROUDON 23 #define B_TRANSITION_RAYQUAZA 24 #define B_TRANSITION_25 25 -#define B_TRANSITION_26 26 -#define B_TRANSITION_27 27 -#define B_TRANSITION_28 28 +#define B_TRANSITION_BLACKHOLE1 26 +#define B_TRANSITION_BLACKHOLE2 27 +#define B_TRANSITION_RECTANGULAR_SPIRAL 28 #define B_TRANSITION_29 29 #define B_TRANSITION_30 30 #define B_TRANSITION_31 31 -- cgit v1.2.3 From fdbe7fa7de9b2e1f8a22efca87201901fcea32b4 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sun, 14 Jan 2018 20:45:44 +0100 Subject: up to 30 battle transitions --- include/battle_transition.h | 3 ++- include/field_camera.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/battle_transition.h b/include/battle_transition.h index bb8505edb..cd4cdd1b3 100644 --- a/include/battle_transition.h +++ b/include/battle_transition.h @@ -6,6 +6,7 @@ void sub_8149DFC(u8 a1); void BattleTransition_StartOnField(u8 transitionID); void BattleTransition_Start(u8 transitionID); bool8 IsBattleTransitionDone(void); +void Phase1_Task_RunFuncs(u8 taskId); enum // TRANSITION_MUGSHOT { @@ -46,7 +47,7 @@ enum // TRANSITION_MUGSHOT #define B_TRANSITION_KYOGRE 22 #define B_TRANSITION_GROUDON 23 #define B_TRANSITION_RAYQUAZA 24 -#define B_TRANSITION_25 25 +#define B_TRANSITION_SHRED_SPLIT 25 #define B_TRANSITION_BLACKHOLE1 26 #define B_TRANSITION_BLACKHOLE2 27 #define B_TRANSITION_RECTANGULAR_SPIRAL 28 diff --git a/include/field_camera.h b/include/field_camera.h index a8559e1c2..4686742d3 100644 --- a/include/field_camera.h +++ b/include/field_camera.h @@ -24,5 +24,6 @@ extern u16 gUnknown_03005DE8; void DrawWholeMapView(void); void CurrentMapDrawMetatileAt(int x, int y); +void sub_8089C08(s16 *a0, s16 *a1); #endif //GUARD_FIELD_CAMERA_H -- cgit v1.2.3 From d7644cd3d8070cb12c84263a4707ec0211bd434a Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sun, 14 Jan 2018 22:09:35 +0100 Subject: battle transition is decompiled --- include/battle_transition.h | 11 +++++++---- include/bg.h | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/battle_transition.h b/include/battle_transition.h index cd4cdd1b3..0d6ef3c83 100644 --- a/include/battle_transition.h +++ b/include/battle_transition.h @@ -2,11 +2,14 @@ #define GUARD_BATTLE_TRANSITION_H void TestBattleTransition(u8 transitionId); -void sub_8149DFC(u8 a1); -void BattleTransition_StartOnField(u8 transitionID); -void BattleTransition_Start(u8 transitionID); +void BattleTransition_StartOnField(u8 transitionId); +void BattleTransition_Start(u8 transitionId); bool8 IsBattleTransitionDone(void); -void Phase1_Task_RunFuncs(u8 taskId); +bool8 FldEff_Pokeball(void); +void TransitionPhase1_Task_RunFuncs(u8 taskId); +void sub_8149F58(u16 **a0, u16 **a1); + +extern const struct SpritePalette gFieldEffectObjectPaletteInfo10; enum // TRANSITION_MUGSHOT { diff --git a/include/bg.h b/include/bg.h index 0c6b4ac26..de3897fa4 100644 --- a/include/bg.h +++ b/include/bg.h @@ -70,7 +70,7 @@ void CopyToBgTilemapBuffer(u8 bg, const void *src, u16 mode, u16 destOffset); void CopyBgTilemapBufferToVram(u8 bg); void CopyToBgTilemapBufferRect(u8 bg, void* src, u8 destX, u8 destY, u8 width, u8 height); void CopyToBgTilemapBufferRect_ChangePalette(u8 bg, void *src, u8 destX, u8 destY, u8 rectWidth, u8 rectHeight, u8 palette); -void CopyRectToBgTilemapBufferRect(u8 bg, void* src, u8 srcX, u8 srcY, u8 srcWidth, u8 srcHeight, u8 destX, u8 destY, u8 rectWidth, u8 rectHeight, u8 palette1, u16 tileOffset, u16 palette2); +void CopyRectToBgTilemapBufferRect(u8 bg, const void *src, u8 srcX, u8 srcY, u8 srcWidth, u8 srcHeight, u8 destX, u8 destY, u8 rectWidth, u8 rectHeight, u8 palette1, u16 tileOffset, u16 palette2); void FillBgTilemapBufferRect_Palette0(u8 bg, u16 tileNum, u8 x, u8 y, u8 width, u8 height); void FillBgTilemapBufferRect(u8 bg, u16 tileNum, u8 x, u8 y, u8 width, u8 height, u8 palette); void WriteSequenceToBgTilemapBuffer(u8 bg, u16 firstTileNum, u8 x, u8 y, u8 width, u8 height, u8 paletteSlot, s16 tileNumDelta); -- cgit v1.2.3 From bc1a957674e84daf181c508afd2b623304de121d Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sun, 14 Jan 2018 22:15:50 +0100 Subject: make battle transition compile --- include/gba/io_reg.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/gba/io_reg.h b/include/gba/io_reg.h index 6dbe5e8ed..0364c38bc 100644 --- a/include/gba/io_reg.h +++ b/include/gba/io_reg.h @@ -137,6 +137,8 @@ #define REG_OFFSET_DMA3CNT_H 0xde #define REG_OFFSET_TMCNT 0x100 +#define REG_OFFSET_TMCNT_L 0x100 +#define REG_OFFSET_TMCNT_H 0x102 #define REG_OFFSET_TM0CNT 0x100 #define REG_OFFSET_TM0CNT_L 0x100 #define REG_OFFSET_TM0CNT_H 0x102 @@ -298,6 +300,8 @@ #define REG_ADDR_DMA3CNT_H (REG_BASE + REG_OFFSET_DMA3CNT_H) #define REG_ADDR_TMCNT (REG_BASE + REG_OFFSET_TMCNT) +#define REG_ADDR_TMCNT_L (REG_BASE + REG_OFFSET_TMCNT_L) +#define REG_ADDR_TMCNT_H (REG_BASE + REG_OFFSET_TMCNT_H) #define REG_ADDR_TM0CNT (REG_BASE + REG_OFFSET_TM0CNT) #define REG_ADDR_TM0CNT_L (REG_BASE + REG_OFFSET_TM0CNT_L) #define REG_ADDR_TM0CNT_H (REG_BASE + REG_OFFSET_TM0CNT_H) @@ -458,6 +462,8 @@ #define REG_DMA3CNT_H (*(vu16 *)REG_ADDR_DMA3CNT_H) #define REG_TMCNT(n) (*(vu16 *)(REG_ADDR_TMCNT + ((n) * 4))) +#define REG_TMCNT_L(n) (*(vu16 *)(REG_ADDR_TMCNT_L + ((n) * 4))) +#define REG_TMCNT_H(n) (*(vu16 *)(REG_ADDR_TMCNT_H + ((n) * 4))) #define REG_TM0CNT (*(vu32 *)REG_ADDR_TM0CNT) #define REG_TM0CNT_L (*(vu16 *)REG_ADDR_TM0CNT_L) #define REG_TM0CNT_H (*(vu16 *)REG_ADDR_TM0CNT_H) @@ -660,7 +666,7 @@ #define KEY_INTR_ENABLE 0x0400 #define KEY_OR_INTR 0x0000 #define KEY_AND_INTR 0x8000 -#define DPAD_ANY 0x00F0 +#define DPAD_ANY ((DPAD_RIGHT | DPAD_LEFT | DPAD_UP | DPAD_DOWN)) #define JOY_EXCL_DPAD 0x030F // interrupt flags -- cgit v1.2.3