mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-03-21 17:49:58 -05:00
AMBaseboard: Convert union ICCommand into struct
This commit is contained in:
parent
85707891cf
commit
fcb4d27f1a
|
|
@ -174,11 +174,12 @@ void CSIDevice_AMBaseboard::ICCardSendReply(ICCommand* iccommand, u8* buffer, u3
|
|||
{
|
||||
iccommand->status = Common::swap16(iccommand->status);
|
||||
|
||||
const u8 crc = CheckSumXOR(iccommand->data + 2, iccommand->pktlen - 1);
|
||||
const auto iccommand_data = reinterpret_cast<const u8*>(iccommand);
|
||||
const u8 crc = CheckSumXOR(iccommand_data + 2, iccommand->pktlen - 1);
|
||||
|
||||
for (u32 i = 0; i < iccommand->pktlen + 1; ++i)
|
||||
{
|
||||
buffer[(*length)++] = iccommand->data[i];
|
||||
buffer[(*length)++] = iccommand_data[i];
|
||||
}
|
||||
|
||||
buffer[(*length)++] = crc;
|
||||
|
|
|
|||
|
|
@ -239,23 +239,20 @@ private:
|
|||
ProgramVersion = 0x76,
|
||||
};
|
||||
|
||||
union ICCommand
|
||||
// NOTE: Used to be an union with `u8 data[81 + 4 + 4 + 4]`
|
||||
// TODO: Should the struct be packed?
|
||||
struct ICCommand
|
||||
{
|
||||
u8 data[81 + 4 + 4 + 4] = {};
|
||||
u32 pktcmd : 8;
|
||||
u32 pktlen : 8;
|
||||
u32 fixed : 8;
|
||||
u32 command : 8;
|
||||
u32 flag : 8;
|
||||
u32 length : 8;
|
||||
u32 status : 16;
|
||||
|
||||
struct
|
||||
{
|
||||
u32 pktcmd : 8;
|
||||
u32 pktlen : 8;
|
||||
u32 fixed : 8;
|
||||
u32 command : 8;
|
||||
u32 flag : 8;
|
||||
u32 length : 8;
|
||||
u32 status : 16;
|
||||
|
||||
u8 extdata[81];
|
||||
u32 extlen;
|
||||
};
|
||||
u8 extdata[81];
|
||||
u32 extlen;
|
||||
};
|
||||
|
||||
u8 m_last[2][0x80] = {};
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user