Duckstation/src/core/pad.h

38 lines
826 B
C
Raw Normal View History

// SPDX-FileCopyrightText: 2019-2022 Connor McLaughlin <stenzek@gmail.com>
// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
#pragma once
#include "types.h"
#include <memory>
class StateWrapper;
class Controller;
2019-10-27 06:45:23 +00:00
class MemoryCard;
2023-01-11 09:10:21 +00:00
class Multitap;
2023-01-11 09:10:21 +00:00
namespace Pad {
2023-01-11 09:10:21 +00:00
static constexpr u32 NUM_SLOTS = 2;
2023-01-11 09:10:21 +00:00
void Initialize();
void Shutdown();
void Reset();
bool DoState(StateWrapper& sw, bool is_memory_state);
2019-09-29 15:07:38 +00:00
2023-01-11 09:10:21 +00:00
Controller* GetController(u32 slot);
void SetController(u32 slot, std::unique_ptr<Controller> dev);
2023-01-11 09:10:21 +00:00
MemoryCard* GetMemoryCard(u32 slot);
void SetMemoryCard(u32 slot, std::unique_ptr<MemoryCard> dev);
std::unique_ptr<MemoryCard> RemoveMemoryCard(u32 slot);
2021-01-21 07:59:40 +00:00
2023-01-11 09:10:21 +00:00
Multitap* GetMultitap(u32 slot);
2023-01-11 09:10:21 +00:00
u32 ReadRegister(u32 offset);
void WriteRegister(u32 offset, u32 value);
2023-01-11 09:10:21 +00:00
bool IsTransmitting();
2019-09-22 15:25:58 +00:00
2023-01-11 09:10:21 +00:00
} // namespace Pad