Merge pull request #973 from cxd4/mempak-OCD

[Project64-core] OCD clean-ups with the mempak unit
This commit is contained in:
zilmar 2016-02-05 08:23:14 +11:00
commit 2ec7a92dfc
1 changed files with 6 additions and 6 deletions

View File

@ -14,7 +14,7 @@
#include <stdio.h>
#include <Common/path.h>
uint8_t Mempaks[4][0x8000];
uint8_t Mempaks[4][128 * 256]; /* [CONTROLLERS][PAGES][BYTES_PER_PAGE] */
CPath MempakNames[4];
void Mempak::Load()
@ -46,8 +46,8 @@ void Mempak::Load()
void Mempak::Format(int32_t Control)
{
uint8_t Initialize[] = {
0x81, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0C, 0x0D, 0x0E, 0x0F,
static const uint8_t Initialize[] = {
0x81, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F,
0xFF, 0xFF, 0xFF, 0xFF, 0x05, 0x1A, 0x5F, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0xFF, 0x66, 0x25, 0x99, 0xCD,
@ -66,11 +66,11 @@ void Mempak::Format(int32_t Control)
0x00, 0x71, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03,
};
memcpy(&Mempaks[Control][0], Initialize, 0x110);
memcpy(&Mempaks[Control][0], &Initialize[0], sizeof(Initialize));
for (int32_t count = 0x110; count < 0x8000; count += 2)
for (size_t count = sizeof(Initialize); count < 128 * 256; count += 2)
{
Mempaks[Control][count] = 0x00;
Mempaks[Control][count + 0] = 0x00;
Mempaks[Control][count + 1] = 0x03;
}
}