diff options
| author | Admiral H. Curtiss <pikachu025@gmail.com> | 2018-11-19 00:27:31 +0100 |
|---|---|---|
| committer | Admiral H. Curtiss <pikachu025@gmail.com> | 2018-12-09 22:28:57 +0100 |
| commit | 4d4b5442bd2ecfaab2dad22be315fdf236dcbf9e (patch) | |
| tree | 7a10453a912a0d76d05cc18323a36b71eb2a2a7e /Source/Core | |
| parent | eb6cc3dbab0fe71bf67162a34211fd35c4fdba0c (diff) | |
GCMemcard: Use std::array and BigEndianValue for BlockAlloc.m_map.
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/Core/HW/GCMemcard/GCMemcard.cpp | 4 | ||||
| -rw-r--r-- | Source/Core/Core/HW/GCMemcard/GCMemcard.h | 6 |
2 files changed, 6 insertions, 4 deletions
diff --git a/Source/Core/Core/HW/GCMemcard/GCMemcard.cpp b/Source/Core/Core/HW/GCMemcard/GCMemcard.cpp index a88bf9ad12..99a87e68bd 100644 --- a/Source/Core/Core/HW/GCMemcard/GCMemcard.cpp +++ b/Source/Core/Core/HW/GCMemcard/GCMemcard.cpp @@ -586,7 +586,7 @@ u16 BlockAlloc::GetNextBlock(u16 Block) const if ((Block < MC_FST_BLOCKS) || (Block > 4091)) return 0; - return Common::swap16(m_map[Block - MC_FST_BLOCKS]); + return m_map[Block - MC_FST_BLOCKS]; } // Parameters and return value are expected as memory card block index, @@ -723,7 +723,7 @@ u32 GCMemcard::ImportFile(const DEntry& direntry, std::vector<GCMBlock>& saveBlo nextBlock = 0xFFFF; else nextBlock = UpdatedBat.NextFreeBlock(maxBlock, firstBlock + 1); - UpdatedBat.m_map[firstBlock - MC_FST_BLOCKS] = BE16(nextBlock); + UpdatedBat.m_map[firstBlock - MC_FST_BLOCKS] = nextBlock; UpdatedBat.m_last_allocated_block = firstBlock; firstBlock = nextBlock; } diff --git a/Source/Core/Core/HW/GCMemcard/GCMemcard.h b/Source/Core/Core/HW/GCMemcard/GCMemcard.h index 026e3a43e6..d23d1001bc 100644 --- a/Source/Core/Core/HW/GCMemcard/GCMemcard.h +++ b/Source/Core/Core/HW/GCMemcard/GCMemcard.h @@ -258,7 +258,9 @@ struct BlockAlloc Common::BigEndianValue<u16> m_update_counter; // 0x0004 2 Update Counter Common::BigEndianValue<u16> m_free_blocks; // 0x0006 2 Free Blocks Common::BigEndianValue<u16> m_last_allocated_block; // 0x0008 2 Last allocated Block - u16 m_map[BAT_SIZE]; // 0x000a 0x1ff8 Map of allocated Blocks + std::array<Common::BigEndianValue<u16>, BAT_SIZE> + m_map; // 0x000a 0x1ff8 Map of allocated Blocks + u16 GetNextBlock(u16 Block) const; u16 NextFreeBlock(u16 MaxBlock, u16 StartingBlock = MC_FST_BLOCKS) const; bool ClearBlocks(u16 StartingBlock, u16 Length); @@ -281,7 +283,7 @@ struct BlockAlloc u16 current = starting; while ((current - starting + 1) < length) { - m_map[current - 5] = BE16(current + 1); + m_map[current - 5] = current + 1; current++; } m_map[current - 5] = 0xFFFF; |
