project64/Source/Project64-core/N64System/Mips/Rumblepak.cpp

29 lines
680 B
C++
Raw Normal View History

#include "stdafx.h"
2022-10-10 00:22:17 +00:00
#include "Rumblepak.h"
2015-12-06 09:59:58 +00:00
#include <Project64-core/N64System/SystemGlobals.h>
#include <Project64-core/Plugins/ControllerPlugin.h>
2022-10-10 00:22:17 +00:00
#include <Project64-core/Plugins/Plugin.h>
void Rumblepak::ReadFrom(uint32_t address, uint8_t * data)
{
2022-10-10 00:22:17 +00:00
if ((address >= 0x8000) && (address < 0x9000))
{
memset(data, 0x80, 0x20);
}
else
{
memset(data, 0x00, 0x20);
}
}
void Rumblepak::WriteTo(int32_t Control, uint32_t address, uint8_t * data)
{
2022-10-10 00:22:17 +00:00
if ((address) == 0xC000)
{
if (g_Plugins->Control()->RumbleCommand != nullptr)
{
g_Plugins->Control()->RumbleCommand(Control, *(int *)data);
}
}
}