Support for loading files stored inside a zip file.
Treats zipped files as folders and allows loading files from inside the
zip file. Files are loaded on-demand from the archive.
Nested zip-files are currently not supported.
Replace file descriptor with a file stream in preparation for supporting
zipped files.
The API to miniz requires the use of file streams and since a file
descriptor can easily be extracted from a stream using `fileno` it's
much more convenient to use file streams everywhere.
The make rules for objects and dependency files must be unique per
language or make won't understand when to rebuild them. Before this
change, if a cpp-file was changed, make would match it to the rule for C
files because it comes first in the `Makefile` and not rebuild anything.
Yield at an interval during the loading of directory entries as well as
while sorting them in order to not starve the poll functions.
The maximum time between calls to `user_io_poll` in the main loop were
measured while loading a folder containing 29026 entries:
- Original main-loop: 591ms
- With coroutines + yields: 29ms
The amount of time it takes to load and sort the 29026 entries:
- Original main-loop: 591ms
- With coroutines + yields: 686ms
By increasing the value of `YieldIterations` in `file_io.cpp` the load
time will decrease while increasing the delay between calls to
`user_io_poll`.
Schedules tasks in the main loop using coroutines so that long running
tasks, particularly relating to the UI, can yield execution in order to
call the poll functions at a tighter interval.
Pin the MiSTer process to core #1 in order to stay clear of the hardware
interrupt handlers running in the Linux kernel on core #0. This gives a
consistent improvement in the main loop cycle time of about 6-7x.
Stores directory entries in a std::vector instead of an array of
hardcoded size. The vector will dynamically grow to the number of
available entries in a folder without having a hardcoded upper limit.