mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-02 06:40:42 -07:00
7c15452c1e
## Link to GitHub Issue, if one exists #41 (partially) ## Description of change This PR adds support for outputting IIDX tape LED data via spiceapi (`iidx_tapeled_get()`). It returns the data as a `dict`, with the key being the LED name and the value being the list of RGB values. You can optionally pass in a variadic list of names to filter the returned data. The new API function is only implemented in Python since I'm not able to test the wrappers in other languages. An example script using the new API is available in this Beef Board PR: https://github.com/HWXLR8/beef-board/pull/133. Demo use case: https://streamable.com/pq5e1e ## Testing Tested in IIDX 32 with custom Beef Board firmware along with a Python script to read and send the tape LED data over USB.
27 lines
724 B
C++
27 lines
724 B
C++
#pragma once
|
|
|
|
#include "api/module.h"
|
|
#include "api/request.h"
|
|
#include "games/iidx/iidx.h"
|
|
|
|
namespace api::modules {
|
|
|
|
class IIDX : public Module {
|
|
public:
|
|
IIDX();
|
|
|
|
private:
|
|
// state
|
|
robin_hood::unordered_map<std::string, std::reference_wrapper<tapeledutils::tape_led>> lights_by_names;
|
|
|
|
// function definitions
|
|
void ticker_get(Request &req, Response &res);
|
|
void ticker_set(Request &req, Response &res);
|
|
void ticker_reset(Request &req, Response &res);
|
|
void tapeled_get(Request &req, Response &res);
|
|
|
|
// helper
|
|
void copy_tapeled_data(Response &res, rapidjson::Value &response_object, const tapeledutils::tape_led &mapping);
|
|
};
|
|
}
|