2015-05-18 02:20:15 +00:00
|
|
|
/****************************************************************************
|
|
|
|
* *
|
2015-11-10 05:21:49 +00:00
|
|
|
* Project64 - A Nintendo 64 emulator. *
|
2015-05-18 02:20:15 +00:00
|
|
|
* http://www.pj64-emu.com/ *
|
|
|
|
* Copyright (C) 2012 Project64. All rights reserved. *
|
|
|
|
* *
|
|
|
|
* License: *
|
|
|
|
* GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html *
|
|
|
|
* *
|
|
|
|
****************************************************************************/
|
|
|
|
#include "stdafx.h"
|
2015-12-06 09:59:58 +00:00
|
|
|
#include "Rumblepak.h"
|
2016-01-13 15:20:05 +00:00
|
|
|
|
2015-12-06 09:59:58 +00:00
|
|
|
#include <Project64-core/N64System/SystemGlobals.h>
|
|
|
|
#include <Project64-core/Plugins/PluginClass.h>
|
|
|
|
#include <Project64-core/Plugins/ControllerPlugin.h>
|
2015-05-18 02:20:15 +00:00
|
|
|
|
2016-01-28 10:58:14 +00:00
|
|
|
void Rumblepak::ReadFrom(uint32_t address, uint8_t * data)
|
2015-05-18 02:20:15 +00:00
|
|
|
{
|
|
|
|
if ((address >= 0x8000) && (address < 0x9000))
|
|
|
|
{
|
2016-01-28 11:51:48 +00:00
|
|
|
memset(data, 0x80, 0x20);
|
2015-05-18 02:20:15 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2016-01-28 11:51:48 +00:00
|
|
|
memset(data, 0x00, 0x20);
|
2015-05-18 02:20:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-01-28 10:58:14 +00:00
|
|
|
void Rumblepak::WriteTo(int32_t Control, uint32_t address, uint8_t * data)
|
2015-05-18 02:20:15 +00:00
|
|
|
{
|
|
|
|
if ((address) == 0xC000)
|
|
|
|
{
|
|
|
|
if (g_Plugins->Control()->RumbleCommand != NULL)
|
|
|
|
{
|
2016-01-28 11:51:48 +00:00
|
|
|
g_Plugins->Control()->RumbleCommand(Control, *(int *)data);
|
2015-05-18 02:20:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|