Use bitfield for MxVideoParamFlags (#40)

* Use bitfield for MxVideoParamFlags

Using a bitfield for MxVideoParamFlags results in the same xor/and logic that was partially inlined in the header file. This approach is a lot cleaner and there's a good chance this is what the devs would have landed on.

The code generation is really finicky -- other inlines in the header influence the code just by being there -- so I decided to stub out all of them. This got the match to 100%.

While I was in isle.cpp::SetupVideoFlags, I changed the signature so that the `m_using16bit` parameter is just `using16bit`.

* fix: cast Set16Bit inline arg to byte
This commit is contained in:
MS
2023-06-23 02:00:51 -04:00
committed by GitHub
parent bd245dc6d8
commit 4f4863af6f
4 changed files with 71 additions and 112 deletions

View File

@@ -3,15 +3,13 @@
// OFFSET: LEGO1 0x100bec40
MxVideoParamFlags::MxVideoParamFlags()
{
// TODO: convert to EnableXXX function calls
unsigned char bVar1 = this->m_flags1;
this->m_flags1 = bVar1 & 0xfe;
this->m_flags1 = bVar1 & 0xfc;
this->m_flags1 = bVar1 & 0xf8;
this->m_flags1 = bVar1 & 0xf0;
this->m_flags1 = bVar1 & 0xe0;
this->m_flags2 = this->m_flags2 | 2;
this->m_flags1 = bVar1 & 0xc0;
this->m_flags1 = bVar1 & 0xc0 | 0x40;
this->m_flags1 = 0xc0;
this->SetFullScreen(0);
this->SetFlipSurfaces(0);
this->SetBackBuffers(0);
this->Set_f1bit3(0);
this->Set_f1bit4(0);
this->Set16Bit(0);
this->SetWideViewAngle(1);
this->Set_f1bit7(1);
this->Set_f2bit1(1);
}