Address should actually of been stored into a DWORD
This commit is contained in:
parent
a89f1d29f5
commit
007cbc1695
|
@ -129,7 +129,7 @@ BYTE Mempak::CalculateCrc(BYTE * DataToCrc)
|
||||||
|
|
||||||
void Mempak::ReadFrom(int Control, BYTE * command)
|
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)
|
if (address < 0x8000)
|
||||||
{
|
{
|
||||||
|
@ -149,7 +149,7 @@ void Mempak::ReadFrom(int Control, BYTE * command)
|
||||||
void Mempak::WriteTo(int Control, BYTE * command)
|
void Mempak::WriteTo(int Control, BYTE * command)
|
||||||
{
|
{
|
||||||
DWORD dwWritten;
|
DWORD dwWritten;
|
||||||
int address = (command[3] << 8) | (command[4] & 0xE0);
|
DWORD address = (command[3] << 8) | (command[4] & 0xE0);
|
||||||
|
|
||||||
if (address < 0x8000)
|
if (address < 0x8000)
|
||||||
{
|
{
|
||||||
|
|
|
@ -12,24 +12,21 @@
|
||||||
|
|
||||||
void Rumblepak::ReadFrom(BYTE * command)
|
void Rumblepak::ReadFrom(BYTE * command)
|
||||||
{
|
{
|
||||||
unsigned char data;
|
DWORD address = (command[3] << 8) | (command[4] & 0xE0);
|
||||||
int address = (command[3] << 8) | (command[4] & 0xE0);
|
|
||||||
|
|
||||||
if ((address >= 0x8000) && (address < 0x9000))
|
if ((address >= 0x8000) && (address < 0x9000))
|
||||||
{
|
{
|
||||||
data = 0x80;
|
memset(&command[5], 0x80, 0x20);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
data = 0x00;
|
memset(&command[5], 0x00, 0x20);
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(&command[5], data, 0x20);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Rumblepak::WriteTo(int Control, BYTE * command)
|
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)
|
if ((address) == 0xC000)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue