mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-21 05:09:46 -06:00
remove some UB
- savestates used to read a four bytes from a single byte value - a few unassigned variables - some other things - also make the ROR macro an inline function
This commit is contained in:
@ -470,7 +470,7 @@ void DoSavestate(Savestate* file)
|
||||
file->VarArray(vtx->Color, sizeof(s32)*3);
|
||||
file->VarArray(vtx->TexCoords, sizeof(s16)*2);
|
||||
|
||||
file->Var32((u32*)&vtx->Clipped);
|
||||
file->Bool32(&vtx->Clipped);
|
||||
|
||||
file->VarArray(vtx->FinalPosition, sizeof(s32)*2);
|
||||
file->VarArray(vtx->FinalColor, sizeof(s32)*3);
|
||||
@ -507,7 +507,7 @@ void DoSavestate(Savestate* file)
|
||||
file->VarArray(vtx->Color, sizeof(s32)*3);
|
||||
file->VarArray(vtx->TexCoords, sizeof(s16)*2);
|
||||
|
||||
file->Var32((u32*)&vtx->Clipped);
|
||||
file->Bool32(&vtx->Clipped);
|
||||
|
||||
file->VarArray(vtx->FinalPosition, sizeof(s32)*2);
|
||||
file->VarArray(vtx->FinalColor, sizeof(s32)*3);
|
||||
@ -545,17 +545,17 @@ void DoSavestate(Savestate* file)
|
||||
|
||||
file->VarArray(poly->FinalZ, sizeof(s32)*10);
|
||||
file->VarArray(poly->FinalW, sizeof(s32)*10);
|
||||
file->Var32((u32*)&poly->WBuffer);
|
||||
file->Bool32(&poly->WBuffer);
|
||||
|
||||
file->Var32(&poly->Attr);
|
||||
file->Var32(&poly->TexParam);
|
||||
file->Var32(&poly->TexPalette);
|
||||
|
||||
file->Var32((u32*)&poly->FacingView);
|
||||
file->Var32((u32*)&poly->Translucent);
|
||||
file->Bool32(&poly->FacingView);
|
||||
file->Bool32(&poly->Translucent);
|
||||
|
||||
file->Var32((u32*)&poly->IsShadowMask);
|
||||
file->Var32((u32*)&poly->IsShadow);
|
||||
file->Bool32(&poly->IsShadowMask);
|
||||
file->Bool32(&poly->IsShadow);
|
||||
|
||||
if (file->IsAtleastVersion(4, 1))
|
||||
file->Var32((u32*)&poly->Type);
|
||||
|
Reference in New Issue
Block a user