diff --git a/emulation.c b/emulation.c index a2217bb..09d133d 100644 --- a/emulation.c +++ b/emulation.c @@ -12,6 +12,9 @@ int emuInit(EmulationContext *emu) { vbInit(emu->sim); emu->ctx = malloc(sizeof(SimContext)); + emu->ctx->hasFrame = false; + emu->ctx->currentSample = 0; + vbSetSamples(emu->sim, emu->ctx->samples[emu->ctx->currentSample], VB_S16, 834); vbSetUserData(emu->sim, emu->ctx); vbSetFrameCallback(emu->sim, &onFrame); @@ -56,11 +59,11 @@ bool emuReadPixels(EmulationContext *emu, uint8_t *left, uint8_t *right) { void emuReadSamples(EmulationContext *emu, void **data, uint32_t *bytes) { uint32_t samplePairs; - *data = vbGetSamples(emu->sim, NULL, &samplePairs); + *data = vbGetSamples(emu->sim, NULL, NULL, &samplePairs); *bytes = samplePairs * 4; emu->ctx->currentSample += 1; emu->ctx->currentSample %= 2; - vbSetSamples(emu->sim, emu->ctx->samples[emu->ctx->currentSample], 834); + vbSetSamples(emu->sim, emu->ctx->samples[emu->ctx->currentSample], VB_S16, 834); } void emuSetKeys(EmulationContext *emu, uint16_t keys) { diff --git a/shrooms-vb-core b/shrooms-vb-core index b134903..ae22c95 160000 --- a/shrooms-vb-core +++ b/shrooms-vb-core @@ -1 +1 @@ -Subproject commit b1349038789c61b41321d6e4ea5d81bdee1eeb44 +Subproject commit ae22c95dbee3d0b338168bfdf98143e6eddc6c70