Files
GP2040-CE/headers/gpaddon.h
Luke A 2b2e528f3c Player Num Removal + Add-on Post Process Rewrite (#1285)
* Rewrote the add-ons and drivers a bit. This is a much cleaner way to do it, and should hopefully fix the timing in Turbo as well as any other add-ons having issues with USB reporting vs. actual timing.

* Removed player num, updated post process add-on call with a boolean if the USB report was sent. Fixed up add-ons config page and config.proto appropriately

* Moved headers for add-ons from tabs to spaces (we're not enforcing this yet but this gets us closer)

* Removing bitmaps.h with our very temporary old logo

Updated toaster and bounce to use current boot screen. Toaster now does a little more randomness

Changed web config as well
2025-03-13 12:17:02 -04:00

35 lines
826 B
C++

#ifndef _GPAddon_H_
#define _GPAddon_H_
#include "gamepad.h"
#include "usblistener.h"
#include <string>
class GPAddon
{
public:
virtual ~GPAddon() { }
virtual bool available() = 0;
virtual void setup() = 0;
virtual void process() = 0;
virtual void preprocess() = 0;
virtual void postprocess(bool) = 0;
virtual std::string name() = 0;
/**
* Reinitialize the addon --- only implement this if it makes sense to, e.g. if this
* addon allows its pin assignments to be changed, in which case it needs to rebuild
* its pin masks, as is needed for DDI and sliders.
*/
virtual void reinit() = 0;
// For add-ons that require a USB-host listener, get listener
virtual USBListener * getListener() { return listener; }
protected:
USBListener * listener;
};
#endif