// Pitch(32-bit) must be equal to width and >= the "fb_width" specified in the MDFNGI struct for the emulated system.
// Height must be >= to the "fb_height" specified in the MDFNGI struct for the emulated system.
// The framebuffer pointed to by surface->pixels is written to by the system emulation code.
uint32*pixels;
intpitch32;
// Pointer to an array of int32, number of elements = fb_height, set by the driver code. Individual elements written
// to by system emulation code. If the emulated system doesn't support multiple screen widths per frame, or if you handle
// such a situation by outputting at a constant width-per-frame that is the least-common-multiple of the screen widths, then
// you can ignore this. If you do wish to use this, you must set all elements every frame.
int32*LineWidths;
// Pointer to sound buffer, set by the driver code, that the emulation code should render sound to.
int16*SoundBuf;
// Number of cycles that this frame consumed, using MDFNGI::MasterClock as a time base.
// Set by emulation code.
int64MasterCycles;
// Maximum size of the sound buffer, in frames. Set by the driver code.
int32SoundBufMaxSize;
// Number of frames currently in internal sound buffer. Set by the system emulation code, to be read by the driver code.
int32SoundBufSize;
// Set by the system emulation code every frame, to denote the horizontal and vertical offsets of the image, and the size
// of the image. If the emulated system sets the elements of LineWidths, then the width(w) of this structure
// is ignored while drawing the image.
int32x,y,h;
// Set(optionally) by emulation code. If InterlaceOn is true, then assume field height is 1/2 DisplayRect.h, and
// only every other line in surface (with the start line defined by InterlacedField) has valid data
// (it's up to internal Mednafen code to deinterlace it).
boolInterlaceOn;
boolInterlaceField;
}EmulateSpecStruct;
#define MDFN_printf(...)
#define MDFN_PrintError(...)
#define MDFN_FORMATSTR(...)
#define require assert
enumInputDeviceInputType:uint8
{
IDIT_BUTTON,// 1-bit
IDIT_BUTTON_CAN_RAPID,// 1-bit
IDIT_SWITCH,// ceil(log2(n))-bit
// Current switch position(default 0).
// Persistent, and bidirectional communication(can be modified driver side, and Mednafen core and emulation module side)
IDIT_STATUS,// ceil(log2(n))-bit
// emulation module->driver communication
IDIT_X_AXIS,// (mouse) 16-bits, signed - in-screen/window range: [0.0, nominal_width)
IDIT_Y_AXIS,// (mouse) 16-bits, signed - in-screen/window range: [0.0, nominal_height)
IDIT_X_AXIS_REL,// (mouse) 32-bits, signed
IDIT_Y_AXIS_REL,// (mouse) 32-bits, signed
IDIT_BYTE_SPECIAL,
IDIT_RESET_BUTTON,// 1-bit
IDIT_BUTTON_ANALOG,// 16-bits, 0 - 32767
IDIT_RUMBLE,// 16-bits, lower 8 bits are weak rumble(0-255), next 8 bits are strong rumble(0-255), 0=no rumble, 255=max rumble. Somewhat subjective, too...
// It's a rather special case of game module->driver code communication.
};
#define IDIT_BUTTON_ANALOG_FLAG_SQLR 0x00000001 // Denotes analog data that may need to be scaled to ensure a more squareish logical range(for emulated
// analog sticks).
structIDIIS_StatusState
{
constchar*ShortName;
constchar*Name;
int32Color;// (msb)0RGB(lsb), -1 for unused.
};
structInputDeviceInputInfoStruct
{
constchar*SettingName;// No spaces, shouldbe all a-z0-9 and _. Definitely no ~!
constchar*Name;
intConfigOrder;// Configuration order during in-game config process, -1 for no config.
InputDeviceInputTypeType;
constchar*ExcludeName;// SettingName of a button that can't be pressed at the same time as this button