Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disk Chooser List Issues #95

Open
ghedger opened this issue Mar 6, 2020 · 0 comments
Open

Disk Chooser List Issues #95

ghedger opened this issue Mar 6, 2020 · 0 comments
Assignees

Comments

@ghedger
Copy link
Contributor

ghedger commented Mar 6, 2020

The Disk Chooser, at present, runs in a constant spin loop where it rewinds the file/size lists and redraws the frame, as far as I can tell, at full speed. It is handled within an event handler called from Frame. This is very poor practice, to have a UI event loop within an event handler.

If a physical USB joystick is connected, about half the time selecting a file is extremely sluggish, sometimes requiring killing and restarting of the emulator. Cause has not been determined; only happens when a joystick is connected.

I propose we instead, building on the earlier DiskChoose refactor, further break up DiskChoose::ChooseAnImage() into

  • Initialize: garner sorted list
  • Message update

and, when F3/F4/other file choose is hit write to a a global state variable that dictates flow of the main outer message loop.

Loosely, the call cadence for the outer message loop is like this:
main() -> EnterMessageLoop() -> ContinueExecution()

This needs to live under EnterMessageLoop().

Furthermore, there's a homegrown templated data structure called List<>. List<> is defined in inc/list.h, contains comments in Spanish, and behaves like someone's class project. It was someone's valiant stab at a linked list. It has proven to be problematic, eliciting anomalous behavior, frequently double-printing some entries and omitting others, both of which are difficult to reproduce and seen typically in large directories. Now that we have access to C++11 features I suggest we explore replacing List<> with std::list<T, Allocator>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant