jtothebell / fake-08

A Pico-8 player/emulator for console homebrew
Other
583 stars 50 forks source link

Missing `_update()`, `_update60`, or `_draw` causes segmentation fault (if playing music?) #185

Open HTV04 opened 1 year ago

HTV04 commented 1 year ago

I tried running a simple program that plays music with the following code:

music(0)

However, this soon led to a segmentation fault. I then tried adding _init():

function _init()
music(0)
end

Still led to a segmentation fault. Finally, I tried running this:

music(0)

function _draw()
end

This runs fine, and also works for _update and _update60. Running FAKE-08 through a debugger reveals that this seems to be undefined behavior with SDL_RenderPresent(renderer), within sdl2basehost.cpp (line 76). Could this be an issue with the audio buffer? Why does it work when _update(), _update60, or _draw is present?