Closed jc-SpaceXp closed 1 year ago
Messy code fragment I'm talking about
https://github.com/jc-SpaceXp/cNES/blob/12457aa82e7c7cfaec1e9fe5eb821935270a05a0/src/emu.c#L247-L274
e3a41dda4e0a18b7ed6da09d54b03ae77a6672d3 resolves this issue
Here is the new SDL game loop for the curious:
https://github.com/jc-SpaceXp/cNES/blob/e3a41dda4e0a18b7ed6da09d54b03ae77a6672d3/src/emu.c#L249-L272
Whilst recently looking at all the SDL2 code in my project I've noticed the main game loop is a bit of a mess. Mainly that the support of running the emulator for a specified number of cycles differs from how the emulator usually runs.
This bad coding structure has caused the fixed number of cycles version to not support any SDL2 inputs, either keyboard or window events such as closing a window