30 lines
843 B
C
30 lines
843 B
C
#ifndef SHROOMS_VB_NATIVE_EMULATION_
|
|
#define SHROOMS_VB_NATIVE_EMULATION_
|
|
|
|
#include "shrooms-vb-core/core/vb.h"
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
|
|
typedef struct SimContext {
|
|
bool hasFrame;
|
|
uint32_t samples[2][834];
|
|
uint32_t currentSample;
|
|
} SimContext;
|
|
|
|
typedef struct EmulationContext {
|
|
VB *sim;
|
|
SimContext *ctx;
|
|
} EmulationContext;
|
|
|
|
int emuInit(EmulationContext *emu);
|
|
void emuDestroy(EmulationContext *emu);
|
|
void emuLoadGame(EmulationContext *emu, uint8_t *rom, uint32_t romSize);
|
|
void emuReset(EmulationContext *emu);
|
|
bool emuIsGameLoaded(EmulationContext *emu);
|
|
|
|
void emuTick(EmulationContext *emu);
|
|
bool emuReadPixels(EmulationContext *emu, uint8_t *left, uint8_t *right);
|
|
void emuReadSamples(EmulationContext *emu, void **data, uint32_t *bytes);
|
|
void emuSetKeys(EmulationContext *emu, uint16_t keys);
|
|
|
|
#endif |