libultraship
Reimplementations of libultra (N64 SDK) functions for modern hardware
Loading...
Searching...
No Matches
ControlDeck.h
Go to the documentation of this file.
1#pragma once
2
3#include "ship/controller/controldeck/ControlDeck.h"
5#include <vector>
10#include "ship/controller/controldevice/controller/mapping/ControllerDefaultMappings.h"
11#include "libultraship/libultra/controller.h"
12
13namespace LUS {
29class ControlDeck final : public Ship::ControlDeck {
30 public:
34 ControlDeck(std::shared_ptr<Ship::Window> window = nullptr,
35 std::shared_ptr<Ship::ConsoleVariable> consoleVariable = nullptr);
36
41 ControlDeck(std::vector<CONTROLLERBUTTONS_T> additionalBitmasks, std::shared_ptr<Ship::Window> window = nullptr,
42 std::shared_ptr<Ship::ConsoleVariable> consoleVariable = nullptr);
43
50 ControlDeck(std::vector<CONTROLLERBUTTONS_T> additionalBitmasks,
51 std::shared_ptr<Ship::ControllerDefaultMappings> controllerDefaultMappings,
52 std::unordered_map<CONTROLLERBUTTONS_T, std::string> buttonNames,
53 std::shared_ptr<Ship::Window> window = nullptr,
54 std::shared_ptr<Ship::ConsoleVariable> consoleVariable = nullptr);
55
62 OSContPad* GetPads();
63
72 void WriteToPad(void* pad) override;
73
74 private:
79 void WriteToOSContPad(OSContPad* pad);
80
81 OSContPad* mPads;
82};
83} // namespace LUS
Ship's N64-compatible ControlDeck implementation.
Definition ControlDeck.h:29
void WriteToPad(void *pad) override
Reads each connected controller and writes the result to the game's pad buffer.
OSContPad * GetPads()
Returns a pointer to the OSContPad buffer (one pad per port).
ControlDeck(std::shared_ptr< Ship::Window > window=nullptr, std::shared_ptr< Ship::ConsoleVariable > consoleVariable=nullptr)
Constructs a ControlDeck with the standard N64 button set and default mappings.
ControlDeck(std::vector< CONTROLLERBUTTONS_T > additionalBitmasks, std::shared_ptr< Ship::Window > window=nullptr, std::shared_ptr< Ship::ConsoleVariable > consoleVariable=nullptr)
Constructs a ControlDeck with the standard N64 buttons plus extra bitmasks.
ControlDeck(std::vector< CONTROLLERBUTTONS_T > additionalBitmasks, std::shared_ptr< Ship::ControllerDefaultMappings > controllerDefaultMappings, std::unordered_map< CONTROLLERBUTTONS_T, std::string > buttonNames, std::shared_ptr< Ship::Window > window=nullptr, std::shared_ptr< Ship::ConsoleVariable > consoleVariable=nullptr)
Full constructor: extra bitmasks, custom default mappings, and custom button names.
Manages all controller ports and routes input/blocking requests.
Definition ControlDeck.h:38
Definition ControlDeck.h:13