Rename nullsub_102

This commit is contained in:
Kermalis 2024-11-10 19:03:09 -05:00
parent c3cd344ad9
commit 2ec9296cc5
10 changed files with 26 additions and 28 deletions

View File

@ -3,10 +3,10 @@
#include "data_serializer.h"
void nullsub_102(DataSerializer *seri);
void ReadBits(DataSerializer *seri, void *dst, s32 numBits);
void WriteBits(DataSerializer *seri, void *src, s32 numBits);
void FinishBitSerializer(DataSerializer *seri);
void InitBitReader(DataSerializer *seri, u8 *buffer, s32 bufLen);
void InitBitWriter(DataSerializer *seri, u8 *buffer, s32 bufLen);
void ReadBits(DataSerializer *seri, void *dst, s32 numBits);
void WriteBits(DataSerializer *seri, void *src, s32 numBits);
#endif // GUARD_CODE_8092334_H

View File

@ -68,7 +68,7 @@ u8 sub_803D110(u8 *param_1, u8 *param_2, s32 size)
{
WriteBits(&auStack_88, &local_78[index1], 5);
}
nullsub_102(&auStack_88);
FinishBitSerializer(&auStack_88);
MemoryCopy8(param_2, auStack_40, save);
return 1;
}
@ -91,7 +91,7 @@ void sub_803D1A8(u8 *param_1, u8 *param_2, s32 size)
ReadBits(&auStack_5c, &local_4c[index], 5);
}
nullsub_102(&auStack_5c);
FinishBitSerializer(&auStack_5c);
for(index = 0; index < size; index++)
{
*param_1++ = sub_803D100(local_4c[index]);
@ -129,7 +129,7 @@ bool8 sub_803D204(u8 *buffer,unkStruct_203B480 *param_2)
if (local_c4[0] == checksum) {
InitBitReader(&uStack_30,&local_c4[1],33);
sub_8095774(&uStack_30,param_2);
nullsub_102(&uStack_30);
FinishBitSerializer(&uStack_30);
return TRUE;
}
}
@ -154,7 +154,7 @@ void sub_803D2C0(u8 *buffer, unkStruct_203B480 *mail)
InitBitWriter(&auStack_2c,&local_c0[1],33);
sub_8095824(&auStack_2c,mail);
nullsub_102(&auStack_2c);
FinishBitSerializer(&auStack_2c);
for(index = 1; index < 34; index++)
{
checksum += + local_c0[index] + index;
@ -201,7 +201,7 @@ bool8 DecodeWonderMailPassword(u8* buffer, WonderMail *mail)
if (local_70[0] == checksum) {
InitBitReader(&puVar1,&local_70[1],0xc);
ReadWonderMailBits(&puVar1,mail);
nullsub_102(&puVar1);
FinishBitSerializer(&puVar1);
return TRUE;
}
}
@ -225,7 +225,7 @@ void sub_803D414(u8 *buffer,WonderMail *mail)
InitBitWriter(&uStack_2c,&local_6c[1],12);
WriteWonderMailBits(&uStack_2c,mail);
nullsub_102(&uStack_2c);
FinishBitSerializer(&uStack_2c);
for(index = 1; index < 0xF; index++)
{

View File

@ -41,10 +41,8 @@ void InitBitWriter(DataSerializer *r0, u8 *buffer, s32 bufLen)
MemoryClear8(buffer, bufLen);
}
// Finish reading/writing bits
void nullsub_102(DataSerializer *r0)
void FinishBitSerializer(DataSerializer *seri)
{
}
void WriteBits(DataSerializer *r0, void *src, s32 numBits)

View File

@ -365,7 +365,7 @@ u32 sub_80954CC(u8 *buffer, u32 size)
ReadBits(&backup, &gUnknown_203B48C->unk4[i], 32);
}
nullsub_102(&backup);
FinishBitSerializer(&backup);
return backup.count;
}
@ -411,7 +411,7 @@ u32 sub_8095624(u8 *buffer, u32 b)
WriteBits(&backup, &gUnknown_203B48C->unk4[i], 32);
}
nullsub_102(&backup);
FinishBitSerializer(&backup);
return backup.count;
}

View File

@ -1379,7 +1379,7 @@ u32 RestoreMailInfo(u8 *r0, u32 size)
ReadBits(&backup, &gUnknown_203B490->unk230[index].sub.seed, 24);
ReadDungeonLocationBits(&backup, &gUnknown_203B490->unk230[index].sub.dungeon);
}
nullsub_102(&backup);
FinishBitSerializer(&backup);
return backup.count;
}
@ -1423,7 +1423,7 @@ u32 SaveMailInfo(u8 *r0, u32 size)
WriteBits(&backup, &gUnknown_203B490->unk230[index].sub.seed, 0x18);
WriteDungeonLocationBits(&backup, &gUnknown_203B490->unk230[index].sub.dungeon);
}
nullsub_102(&backup);
FinishBitSerializer(&backup);
return backup.count;
}

View File

@ -375,7 +375,7 @@ u32 SaveAdventureData(u8 *buffer, u32 bufLen)
WriteAdventureBits(&seri);
WriteExclusivePokemon(&seri);
nullsub_102(&seri);
FinishBitSerializer(&seri);
return seri.count;
}
@ -390,6 +390,6 @@ u32 RestoreAdventureData(u8 *buffer, u32 bufLen)
ReadAdventureBits(&seri);
ReadExclusivePokemon(&seri);
nullsub_102(&seri);
FinishBitSerializer(&seri);
return seri.count;
}

View File

@ -241,7 +241,7 @@ u32 SaveFriendAreas(u8 *r0, u32 size)
WriteBits(&unk, (u8*)&temp, 1);
}
nullsub_102(&unk);
FinishBitSerializer(&unk);
return unk.count;
}
@ -262,6 +262,6 @@ u32 ReadSavedFriendAreas(u8 *r0, s32 size)
gFriendAreas[i] = FALSE;
}
nullsub_102(&unk);
FinishBitSerializer(&unk);
return unk.count;
}

View File

@ -1127,7 +1127,7 @@ s32 SaveTeamInventory(u8* unk0, u32 size)
WriteBits(&unk, &gTeamInventoryRef->teamMoney, 24);
WriteBits(&unk, &gTeamInventoryRef->teamSavings, 24);
nullsub_102(&unk);
FinishBitSerializer(&unk);
return unk.count;
}
@ -1152,7 +1152,7 @@ s32 RestoreTeamInventory(u8 *unk0, u32 size)
ReadBits(&unk, &gTeamInventoryRef->teamMoney, 24);
ReadBits(&unk, &gTeamInventoryRef->teamSavings, 24);
nullsub_102(&unk);
FinishBitSerializer(&unk);
return unk.count;
}

View File

@ -706,7 +706,7 @@ s32 SaveRecruitedPokemon(u8 *a1, s32 a2)
// Team leader
WriteBits(&backup, &teamLeader, 16);
nullsub_102(&backup);
FinishBitSerializer(&backup);
return backup.count;
}
@ -745,7 +745,7 @@ s32 RestoreRecruitedPokemon(u8 *a1, s32 a2)
if ((u16)data_s16 < NUM_MONSTERS)
gRecruitedPokemonRef->pokemon[data_s16].isTeamLeader = TRUE;
nullsub_102(&backup);
FinishBitSerializer(&backup);
return backup.count;
}
@ -839,7 +839,7 @@ s32 SavePoke2s(u8* buffer, s32 size)
WriteBits(&backup, &pokemon2->name, 10 * 8);
}
nullsub_102(&backup);
FinishBitSerializer(&backup);
return backup.count;
}
@ -888,7 +888,7 @@ s32 RestorePoke2s(u8* a1, s32 size)
ReadBits(&backup, &pokemon2->name, 80);
}
nullsub_102(&backup);
FinishBitSerializer(&backup);
return backup.count;
}

View File

@ -134,7 +134,7 @@ u32 SaveRescueTeamInfo(u8 *param_1, u32 size)
puVar2 = &zero;
}
WriteBits(&auStack36,puVar2,1);
nullsub_102(&auStack36);
FinishBitSerializer(&auStack36);
return auStack36.count;
}
@ -148,6 +148,6 @@ u32 ReadRescueTeamInfo(u8 *param_1, u32 size)
ReadBits(&auStack32, &gRescueTeamInfoRef->teamRankPts, 0x20);
ReadBits(&auStack32, byteArray, 1);
gRescueTeamInfoRef->isTeamRenamed = byteArray[0] & 1;
nullsub_102(&auStack32);
FinishBitSerializer(&auStack32);
return auStack32.count;
}