2021-09-10 12:57:55 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "Card.h"
|
|
|
|
#include "CmdLine.h"
|
|
|
|
|
|
|
|
class SNESMAXCard : public Card
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
SNESMAXCard(UINT slot) :
|
2021-11-01 21:01:28 +00:00
|
|
|
Card(CT_SNESMAX, slot)
|
2021-09-10 12:57:55 +00:00
|
|
|
{
|
2021-09-10 13:19:13 +00:00
|
|
|
m_buttonIndex = 0;
|
|
|
|
m_controller1Buttons = 0;
|
|
|
|
m_controller2Buttons = 0;
|
2021-09-10 12:57:55 +00:00
|
|
|
|
|
|
|
m_altControllerType[0] = g_cmdLine.snesMaxAltControllerType[0];
|
|
|
|
m_altControllerType[1] = g_cmdLine.snesMaxAltControllerType[1];
|
|
|
|
}
|
|
|
|
virtual ~SNESMAXCard(void) {}
|
|
|
|
|
2022-03-11 22:17:03 +00:00
|
|
|
virtual void Destroy(void) {}
|
2021-11-11 21:45:55 +00:00
|
|
|
virtual void Reset(const bool powerCycle) {}
|
2021-11-13 18:13:01 +00:00
|
|
|
virtual void Update(const ULONG nExecutedCycles) {}
|
2021-09-10 12:57:55 +00:00
|
|
|
|
2021-11-11 21:45:55 +00:00
|
|
|
virtual void InitializeIO(LPBYTE pCxRomPeripheral);
|
2021-09-10 12:57:55 +00:00
|
|
|
|
|
|
|
static BYTE __stdcall IORead(WORD pc, WORD addr, BYTE bWrite, BYTE value, ULONG nExecutedCycles);
|
|
|
|
static BYTE __stdcall IOWrite(WORD pc, WORD addr, BYTE bWrite, BYTE value, ULONG nExecutedCycles);
|
|
|
|
|
2022-02-28 20:52:18 +00:00
|
|
|
static const std::string& GetSnapshotCardName(void);
|
2021-11-25 20:23:21 +00:00
|
|
|
virtual void SaveSnapshot(YamlSaveHelper& yamlSaveHelper);
|
|
|
|
virtual bool LoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT version);
|
2021-09-10 12:57:55 +00:00
|
|
|
|
2022-12-15 14:45:00 +00:00
|
|
|
static bool ParseControllerMappingFile(UINT joyNum, const char* pathname, std::string& errorMsg);
|
|
|
|
|
2021-09-10 12:57:55 +00:00
|
|
|
private:
|
2022-12-15 14:45:00 +00:00
|
|
|
UINT GetControllerButtons(UINT joyNum, JOYINFOEX& infoEx, bool altControllerType);
|
|
|
|
|
|
|
|
enum Button { B, Y, SELECT, START, U, D, L, R, A, X, LB, RB, UNUSED1, UNUSED2, UNUSED3, UNUSED4, NUM_BUTTONS, UNUSED };
|
|
|
|
|
2021-09-10 13:19:13 +00:00
|
|
|
UINT m_buttonIndex;
|
|
|
|
UINT m_controller1Buttons;
|
|
|
|
UINT m_controller2Buttons;
|
2021-09-10 12:57:55 +00:00
|
|
|
|
2023-01-01 20:31:27 +00:00
|
|
|
static const UINT m_mainControllerButtons[NUM_BUTTONS];
|
2021-09-10 12:57:55 +00:00
|
|
|
bool m_altControllerType[2];
|
2022-12-15 14:45:00 +00:00
|
|
|
static UINT m_altControllerButtons[2][NUM_BUTTONS];
|
2021-09-10 12:57:55 +00:00
|
|
|
};
|