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

a little cleanup #144

Merged
merged 1 commit into from
May 30, 2023
Merged
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
10 changes: 5 additions & 5 deletions src/communication_error.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ static const BGTEMPLATE sCommunicationErrorBgTemplate = {
};

static const WINDOWTEMPLATE sCommunicationErrorWindowTemplate = {
.bgId = 0,
.bgId = GF_BG_LYR_MAIN_0,
.left = 3,
.top = 3,
.width = 26,
Expand Down Expand Up @@ -120,8 +120,8 @@ void ShowCommunicationError(HeapID heap_id, u32 error, u32 error_code) {
break;
}

sub_0200FBF4(0, 0);
sub_0200FBF4(1, 0);
sub_0200FBF4(PM_LCD_TOP, 0);
sub_0200FBF4(PM_LCD_BOTTOM, 0);

OS_DisableIrqMask(OS_IE_VBLANK);
OS_SetIrqFunction(OS_IE_VBLANK, VBlankIntr);
Expand Down Expand Up @@ -176,8 +176,8 @@ void ShowCommunicationError(HeapID heap_id, u32 error, u32 error_code) {
// BUG: tmp_str is never destroyed.

GX_BothDispOn();
SetMasterBrightnessNeutral(0);
SetMasterBrightnessNeutral(1);
SetMasterBrightnessNeutral(PM_LCD_TOP);
SetMasterBrightnessNeutral(PM_LCD_BOTTOM);
SetBlendBrightness(0, 0x3F, 3);

RemoveWindow(&window);
Expand Down
14 changes: 7 additions & 7 deletions src/error_message_reset.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ static const BGTEMPLATE sErrorMessageBgTemplate = {
};

static const WINDOWTEMPLATE sErrorMessageWindowTemplate = {
.bgId = 0,
.bgId = GF_BG_LYR_MAIN_0,
.left = 3,
.top = 3,
.width = 26,
Expand Down Expand Up @@ -89,8 +89,8 @@ void PrintErrorMessageAndReset(void) {
OS_SetArenaLo(OS_ARENA_MAIN, OS_GetInitArenaLo(OS_ARENA_MAIN));
InitHeapSystem(&sErrorMessageHeapParams, 1, 1, 0);

sub_0200FBF4(0, 0);
sub_0200FBF4(1, 0);
sub_0200FBF4(PM_LCD_TOP, 0);
sub_0200FBF4(PM_LCD_BOTTOM, 0);

OS_DisableIrqMask(OS_IE_VBLANK);
OS_SetIrqFunction(OS_IE_VBLANK, VBlankIntr);
Expand Down Expand Up @@ -139,8 +139,8 @@ void PrintErrorMessageAndReset(void) {
String_dtor(error_str);

GX_BothDispOn();
SetMasterBrightnessNeutral(0);
SetMasterBrightnessNeutral(1);
SetMasterBrightnessNeutral(PM_LCD_TOP);
SetMasterBrightnessNeutral(PM_LCD_BOTTOM);
SetBlendBrightness(0, 0x3F, 3);

sub_02038D90();
Expand All @@ -166,8 +166,8 @@ void PrintErrorMessageAndReset(void) {
OS_WaitIrq(TRUE, OS_IE_VBLANK);
}

sub_0200FBF4(0, 0x7FFF);
sub_0200FBF4(1, 0x7FFF);
sub_0200FBF4(PM_LCD_TOP, 0x7FFF);
sub_0200FBF4(PM_LCD_BOTTOM, 0x7FFF);

RemoveWindow(&window);
DestroyMsgData(error_msgdata);
Expand Down
2 changes: 1 addition & 1 deletion src/font.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ u8 GetFontAttribute(FontID fontId, int attr) {
return ret;
}

void LoadFontPal0(enum GFBgLayer layer, u32 baseAddr, HeapID heapId) {
void LoadFontPal0(enum GFBgLayer layer, u32 baseAddr, HeapID heapId) { //todo sync with diamond
GfGfxLoader_GXLoadPal(NARC_graphic_font, 7, layer, baseAddr, 0x20, heapId);
}

Expand Down
1 change: 1 addition & 0 deletions src/gf_rtc.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "global.h"
#include "gf_rtc.h"

#define MAX_SECONDS (3155759999ll)
Expand Down
10 changes: 5 additions & 5 deletions src/msgdata.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ static void ReadMsgData_ExistingTable_ExistingArray(MAT *table, u32 num, u16 *de
CopyEncryptedMessage16(dest, (const u16 *)((u8 *)table + sp0.offset), &sp0);
Decrypt2(dest, sp0.length, num);
} else {
GF_ASSERT(0);
GF_ASSERT(FALSE);
}
}

Expand Down Expand Up @@ -78,7 +78,7 @@ static void ReadMsgData_ExistingTable_ExistingString(MAT * table, u32 num, STRIN
FreeToHeap(buf);
}
} else {
GF_ASSERT(0);
GF_ASSERT(FALSE);
StringSetEmpty(dest);
}
}
Expand All @@ -103,7 +103,7 @@ static STRING * ReadMsgData_ExistingTable_NewString(MAT * table, u32 num, u32 he
return NULL;
}
} else {
GF_ASSERT(0);
GF_ASSERT(FALSE);
return String_ctor(4, heap_id);
}
}
Expand Down Expand Up @@ -136,7 +136,7 @@ static void ReadMsgData_ExistingNarc_ExistingString(NARC * narc, u32 group, u32
return;
}
} else {
GF_ASSERT(0);
GF_ASSERT(FALSE);
StringSetEmpty(dest);
}
}
Expand Down Expand Up @@ -177,7 +177,7 @@ static STRING * ReadMsgData_ExistingNarc_NewString(NARC * narc, u32 group, u32 n
}
return dest;
} else {
GF_ASSERT(0);
GF_ASSERT(FALSE);
return String_ctor(4, heap_id);
}
}
Expand Down
18 changes: 9 additions & 9 deletions src/save_data_read_error.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ static const BGTEMPLATE sDataReadErrorBgTemplate = {
};

static const WINDOWTEMPLATE sDataReadErrorWindowTemplate = {
.bgId = 0,
.bgId = GF_BG_LYR_MAIN_0,
.left = 3,
.top = 3,
.width = 26,
Expand All @@ -64,8 +64,8 @@ static const WINDOWTEMPLATE sDataReadErrorWindowTemplate = {
void ShowSaveDataReadError(HeapID heap_id) {
WINDOW window;

sub_0200FBF4(0, 0);
sub_0200FBF4(1, 0);
sub_0200FBF4(PM_LCD_TOP, 0);
sub_0200FBF4(PM_LCD_BOTTOM, 0);

Main_SetVBlankIntrCB(NULL, NULL);
Main_SetHBlankIntrCB(NULL, NULL);
Expand Down Expand Up @@ -110,8 +110,8 @@ void ShowSaveDataReadError(HeapID heap_id) {
String_dtor(error_str);

GX_BothDispOn();
SetMasterBrightnessNeutral(0);
SetMasterBrightnessNeutral(1);
SetMasterBrightnessNeutral(PM_LCD_TOP);
SetMasterBrightnessNeutral(PM_LCD_BOTTOM);
SetBlendBrightness(0, 0x3F, 3);

while (TRUE) {
Expand All @@ -123,8 +123,8 @@ void ShowSaveDataReadError(HeapID heap_id) {
void ShowGBACartRemovedError(HeapID heap_id) {
WINDOW window;

sub_0200FBF4(0, 0);
sub_0200FBF4(1, 0);
sub_0200FBF4(PM_LCD_TOP, 0);
sub_0200FBF4(PM_LCD_BOTTOM, 0);

Main_SetVBlankIntrCB(NULL, NULL);
Main_SetHBlankIntrCB(NULL, NULL);
Expand Down Expand Up @@ -169,8 +169,8 @@ void ShowGBACartRemovedError(HeapID heap_id) {
String_dtor(error_str);

GX_BothDispOn();
SetMasterBrightnessNeutral(0);
SetMasterBrightnessNeutral(1);
SetMasterBrightnessNeutral(PM_LCD_TOP);
SetMasterBrightnessNeutral(PM_LCD_BOTTOM);
SetBlendBrightness(0, 0x3F, 3);

while (TRUE) {
Expand Down
10 changes: 5 additions & 5 deletions src/save_data_write_error.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ static const BGTEMPLATE sDataWriteErrorBgTemplate = {
};

static const WINDOWTEMPLATE sDataWriteErrorWindowTemplate = {
.bgId = 0,
.bgId = GF_BG_LYR_MAIN_0,
.left = 3,
.top = 3,
.width = 26,
Expand All @@ -71,8 +71,8 @@ void ShowSaveDataWriteError(HeapID heap_id, int code) {
msg_no = msg_0009_00000;
}

sub_0200FBF4(0, 0);
sub_0200FBF4(1, 0);
sub_0200FBF4(PM_LCD_TOP, 0);
sub_0200FBF4(PM_LCD_BOTTOM, 0);

sub_0201A0E0();

Expand Down Expand Up @@ -119,8 +119,8 @@ void ShowSaveDataWriteError(HeapID heap_id, int code) {
String_dtor(error_str);

GX_BothDispOn();
SetMasterBrightnessNeutral(0);
SetMasterBrightnessNeutral(1);
SetMasterBrightnessNeutral(PM_LCD_TOP);
SetMasterBrightnessNeutral(PM_LCD_BOTTOM);
SetBlendBrightness(0, 0x3F, 3);

while (TRUE) {
Expand Down