forked from pret/pokestadium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
136 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,134 @@ | ||
#include "2E110.h" | ||
#include "src/3FB0.h" | ||
#include "src/memory.h" | ||
|
||
#pragma GLOBAL_ASM("asm/us/nonmatchings/2E110/func_8002D510.s") | ||
static BinArchive* D_800AF740; | ||
static char** D_800AF744; | ||
|
||
#pragma GLOBAL_ASM("asm/us/nonmatchings/2E110/func_8002D5AC.s") | ||
void func_8002D510(void) { | ||
s32 i; | ||
|
||
#pragma GLOBAL_ASM("asm/us/nonmatchings/2E110/func_8002D5D4.s") | ||
D_800AF740 = func_800044F4(_783760_ROM_START, NULL, 1, 0); | ||
D_800AF744 = main_pool_alloc(0xA8, 0); | ||
|
||
#pragma GLOBAL_ASM("asm/us/nonmatchings/2E110/func_8002D600.s") | ||
for (i = 0; i < 42; i++) { | ||
D_800AF744[i] = NULL; | ||
} | ||
} | ||
|
||
#pragma GLOBAL_ASM("asm/us/nonmatchings/2E110/func_8002D628.s") | ||
char* func_8002D5AC(s32 file_number) { | ||
return (char*)func_8000484C(D_800AF740, file_number); | ||
} | ||
|
||
#pragma GLOBAL_ASM("asm/us/nonmatchings/2E110/func_8002D7C0.s") | ||
void func_8002D5D4(u32 arg0, s32 arg1) { | ||
if ((arg0 >= 0x14) && (arg0 < 0x2A)) { | ||
D_800AF744[arg0] = arg1; | ||
} | ||
} | ||
|
||
#pragma GLOBAL_ASM("asm/us/nonmatchings/2E110/func_8002D80C.s") | ||
void func_8002D600(u32 arg0, s32 arg1) { | ||
if ((arg0 != 0) && (arg0 < 0xA)) { | ||
D_800AF744[arg0] = arg1; | ||
} | ||
} | ||
|
||
void func_8002D628(char* arg0, u32 arg1, s8* arg2) { | ||
u32 i; | ||
s32 var_s2; | ||
s32 temp_v0; | ||
char sp58[12]; | ||
s8* var_s4; | ||
char* sp54; | ||
u32 var_s3; | ||
|
||
var_s2 = 0; | ||
var_s3 = 0; | ||
sp54 = var_s4; | ||
var_s4 = sp54; | ||
i = 0; | ||
|
||
while (i < arg1 - 1u) { | ||
switch (var_s2) { | ||
case 0: | ||
temp_v0 = *arg2++; | ||
if (temp_v0 == 0) { | ||
goto end; | ||
} | ||
|
||
if (temp_v0 == 0x23) { | ||
temp_v0 = *arg2++; | ||
|
||
temp_v0 -= 0x30; | ||
temp_v0 = (*arg2++ + (temp_v0 * 10)) - 0x30; | ||
if ((temp_v0 > 0) && (temp_v0 < 0xA)) { | ||
sprintf(&sp58, "%d", D_800AF744[temp_v0]); | ||
var_s4 = &sp58; | ||
var_s2 = 1; | ||
continue; | ||
} | ||
|
||
if ((temp_v0 >= 0x14) && (temp_v0 < 0x2A)) { | ||
if (D_800AF744[temp_v0] != 0) { | ||
var_s4 = D_800AF744[temp_v0]; | ||
var_s2 = 1; | ||
} | ||
continue; | ||
} | ||
} else { | ||
*arg0++ = temp_v0; | ||
var_s3++; | ||
i++; | ||
} | ||
break; | ||
|
||
case 1: | ||
temp_v0 = *var_s4++; | ||
if (temp_v0 == 0) { | ||
var_s2 = 0; | ||
} else { | ||
*arg0++ = temp_v0; | ||
var_s3++; | ||
i++; | ||
} | ||
break; | ||
} | ||
} | ||
|
||
sp54 = var_s4; | ||
end: | ||
*arg0++ = 0; | ||
} | ||
|
||
char* func_8002D7C0(char* arg0, s32 arg1, char** arg2, s32 file_number) { | ||
char* sp1C; | ||
char* sp18 = (u32)arg2 + (u32)arg2[file_number + 1]; | ||
|
||
if (arg0 == NULL) { | ||
sp1C = sp18; | ||
} else { | ||
sp1C = arg0; | ||
func_8002D628(arg0, arg1, sp18); | ||
} | ||
|
||
return sp1C; | ||
} | ||
|
||
s32 func_8002D80C(s8* arg0) { | ||
s32 last_chr = 0; | ||
s32 line_count = 0; | ||
s32 chr = *arg0++; | ||
|
||
while (chr != 0) { | ||
last_chr = chr; | ||
if (chr == '\n') { | ||
line_count++; | ||
} | ||
chr = *arg0++; | ||
} | ||
|
||
if (last_chr != '\n') { | ||
line_count++; | ||
} | ||
|
||
return line_count; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters