Address should actually of been stored into a DWORD

This commit is contained in:
Emmet Young 2015-05-18 14:19:31 +10:00
parent a89f1d29f5
commit 007cbc1695
2 changed files with 6 additions and 9 deletions

View File

@ -129,7 +129,7 @@ BYTE Mempak::CalculateCrc(BYTE * DataToCrc)
void Mempak::ReadFrom(int Control, BYTE * command)
{
int address = (command[3] << 8) | (command[4] & 0xE0);
DWORD address = (command[3] << 8) | (command[4] & 0xE0);
if (address < 0x8000)
{
@ -149,7 +149,7 @@ void Mempak::ReadFrom(int Control, BYTE * command)
void Mempak::WriteTo(int Control, BYTE * command)
{
DWORD dwWritten;
int address = (command[3] << 8) | (command[4] & 0xE0);
DWORD address = (command[3] << 8) | (command[4] & 0xE0);
if (address < 0x8000)
{

View File

@ -12,24 +12,21 @@
void Rumblepak::ReadFrom(BYTE * command)
{
unsigned char data;
int address = (command[3] << 8) | (command[4] & 0xE0);
DWORD address = (command[3] << 8) | (command[4] & 0xE0);
if ((address >= 0x8000) && (address < 0x9000))
{
data = 0x80;
memset(&command[5], 0x80, 0x20);
}
else
{
data = 0x00;
memset(&command[5], 0x00, 0x20);
}
memset(&command[5], data, 0x20);
}
void Rumblepak::WriteTo(int Control, BYTE * command)
{
int address = (command[3] << 8) | (command[4] & 0xE0);
DWORD address = (command[3] << 8) | (command[4] & 0xE0);
if ((address) == 0xC000)
{