From 4a7a3df2052a2e0a5f88a8c087f47e75df3ed357 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Mon, 11 Jan 2021 10:36:53 -0500 Subject: Move SeedRngWithRtc fix to BUGFIX conditional --- src/main.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 9fd1d0a35..f0ad4ce94 100644 --- a/src/main.c +++ b/src/main.c @@ -75,7 +75,7 @@ static EWRAM_DATA u16 gTrainerId = 0; static void UpdateLinkAndCallCallbacks(void); static void InitMainCallbacks(void); static void CallCallbacks(void); -//static void SeedRngWithRtc(void); +static void SeedRngWithRtc(void); static void ReadKeys(void); void InitIntrHandlers(void); static void WaitForVBlank(void); @@ -102,7 +102,9 @@ void AgbMain() CheckForFlashMemory(); InitMainCallbacks(); InitMapMusic(); - //SeedRngWithRtc(); see comment at SeedRngWithRtc declaration below +#ifdef BUGFIX + SeedRngWithRtc(); // see comment at SeedRngWithRtc definition below +#endif ClearDma3Requests(); ResetBgs(); SetDefaultFontsPointer(); @@ -213,13 +215,15 @@ void EnableVCountIntrAtLine150(void) EnableInterrupts(INTR_FLAG_VCOUNT); } -// oops! FRLG commented this out to remove RTC, however Emerald didnt undo this! -//static void SeedRngWithRtc(void) -//{ -// u32 seed = RtcGetMinuteCount(); -// seed = (seed >> 16) ^ (seed & 0xFFFF); -// SeedRng(seed); -//} +// FRLG commented this out to remove RTC, however Emerald didn't undo this! +#ifdef BUGFIX +static void SeedRngWithRtc(void) +{ + u32 seed = RtcGetMinuteCount(); + seed = (seed >> 16) ^ (seed & 0xFFFF); + SeedRng(seed); +} +#endif void InitKeys(void) { -- cgit v1.2.3 From 4eca05ccf5cce480e8018527798d3632ee43e551 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 22 Jan 2021 02:48:22 -0500 Subject: Document remainder of battle_controllers.c --- src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index f0ad4ce94..854100a78 100644 --- a/src/main.c +++ b/src/main.c @@ -350,7 +350,7 @@ static void VBlankIntr(void) gPcmDmaCounter = gSoundInfo.pcmDmaCounter; m4aSoundMain(); - sub_8033648(); + TryReceiveLinkBattleData(); if (!gMain.inBattle || !(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_FRONTIER | BATTLE_TYPE_RECORDED))) Random(); -- cgit v1.2.3 From b1a29e501716edcd98be24811241289a66a39496 Mon Sep 17 00:00:00 2001 From: N <71219152+PokeCodec@users.noreply.github.com> Date: Mon, 25 Jan 2021 21:37:04 -0500 Subject: Use INTR_FLAG_VBLANK instead of constant 0x1 --- src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index f0ad4ce94..992d23ead 100644 --- a/src/main.c +++ b/src/main.c @@ -298,7 +298,7 @@ void InitIntrHandlers(void) REG_IME = 1; - EnableInterrupts(0x1); + EnableInterrupts(INTR_FLAG_VBLANK); } void SetVBlankCallback(IntrCallback callback) -- cgit v1.2.3 From a2f757c7a66772bf2f9bdc88d5a0898546e17a54 Mon Sep 17 00:00:00 2001 From: N <71219152+SleepyDweams@users.noreply.github.com> Date: Mon, 1 Mar 2021 12:04:55 -0500 Subject: Document BG_PLTT usage in Agb_Main --- src/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 8d6bd94fa..f6ade0a8b 100644 --- a/src/main.c +++ b/src/main.c @@ -1,4 +1,5 @@ #include "global.h" +#include "defines.h" #include "crt0.h" #include "malloc.h" #include "link.h" @@ -90,7 +91,7 @@ void AgbMain() #if !MODERN RegisterRamReset(RESET_ALL); #endif //MODERN - *(vu16 *)BG_PLTT = 0x7FFF; + *(vu16 *)BG_PLTT = RGB_WHITE; // Set the palette to white on startup InitGpuRegManager(); REG_WAITCNT = WAITCNT_PREFETCH_ENABLE | WAITCNT_WS0_S_1 | WAITCNT_WS0_N_3; InitKeys(); -- cgit v1.2.3 From d63431ae8822fee87190a52b2b719951cfbb4ab8 Mon Sep 17 00:00:00 2001 From: N <71219152+PokeCodec@users.noreply.github.com> Date: Mon, 1 Mar 2021 13:23:03 -0500 Subject: Fix comment --- src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index f6ade0a8b..30a69d2dd 100644 --- a/src/main.c +++ b/src/main.c @@ -91,7 +91,7 @@ void AgbMain() #if !MODERN RegisterRamReset(RESET_ALL); #endif //MODERN - *(vu16 *)BG_PLTT = RGB_WHITE; // Set the palette to white on startup + *(vu16 *)BG_PLTT = RGB_WHITE; // Set the backdrop to white on startup InitGpuRegManager(); REG_WAITCNT = WAITCNT_PREFETCH_ENABLE | WAITCNT_WS0_S_1 | WAITCNT_WS0_N_3; InitKeys(); -- cgit v1.2.3 From d5a63681e896079e46e061e7e5552aaf75002de4 Mon Sep 17 00:00:00 2001 From: N <71219152+PokeCodec@users.noreply.github.com> Date: Mon, 1 Mar 2021 14:19:41 -0500 Subject: Fixed faulty define --- src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 30a69d2dd..278b93542 100644 --- a/src/main.c +++ b/src/main.c @@ -1,5 +1,4 @@ #include "global.h" -#include "defines.h" #include "crt0.h" #include "malloc.h" #include "link.h" @@ -24,6 +23,7 @@ #include "intro.h" #include "main.h" #include "trainer_hill.h" +#include "constants/rgb.h" static void VBlankIntr(void); static void HBlankIntr(void); -- cgit v1.2.3 From 5b910a11b4f6d548b6643455ccb806c0e60f48a2 Mon Sep 17 00:00:00 2001 From: Kurausukun Date: Thu, 18 Mar 2021 20:35:39 -0400 Subject: port miscellaneous fr documentation --- src/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 278b93542..75861a3ac 100644 --- a/src/main.c +++ b/src/main.c @@ -132,7 +132,7 @@ void AgbMain() DoSoftReset(); } - if (sub_8087634() == 1) + if (Overworld_SendKeysToLinkIsRunning() == 1) { gLinkTransferringData = TRUE; UpdateLinkAndCallCallbacks(); @@ -143,7 +143,7 @@ void AgbMain() gLinkTransferringData = FALSE; UpdateLinkAndCallCallbacks(); - if (sub_80875C8() == 1) + if (Overworld_RecvKeysFromLinkIsRunning() == 1) { gMain.newKeys = 0; ClearSpriteCopyRequests(); -- cgit v1.2.3 From 79a8eb481f08a035d2b357b5f9c9a57cb54e99da Mon Sep 17 00:00:00 2001 From: Kurausukun Date: Mon, 29 Mar 2021 18:32:22 -0400 Subject: 1 to true --- src/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 75861a3ac..3125716e2 100644 --- a/src/main.c +++ b/src/main.c @@ -132,7 +132,7 @@ void AgbMain() DoSoftReset(); } - if (Overworld_SendKeysToLinkIsRunning() == 1) + if (Overworld_SendKeysToLinkIsRunning() == TRUE) { gLinkTransferringData = TRUE; UpdateLinkAndCallCallbacks(); @@ -143,7 +143,7 @@ void AgbMain() gLinkTransferringData = FALSE; UpdateLinkAndCallCallbacks(); - if (Overworld_RecvKeysFromLinkIsRunning() == 1) + if (Overworld_RecvKeysFromLinkIsRunning() == TRUE) { gMain.newKeys = 0; ClearSpriteCopyRequests(); -- cgit v1.2.3