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

Need to sperate gui actions and emulator core #9

Closed
pulkomandy opened this issue May 25, 2014 · 3 comments
Closed

Need to sperate gui actions and emulator core #9

pulkomandy opened this issue May 25, 2014 · 3 comments

Comments

@pulkomandy
Copy link
Member

From giot.romain on November 26, 2008 08:57:57

For the moment, there is no clear separation between the user interaction
code and the core of the emulator.

For example the file emulator.cpp contains refernces to SDL or wxWidget.
These references have to be elsewhere. There is the same problem with the
input.cpp file. Most of the common code must stay in this file in the core
of the emulator , but specifics things have to be in another source file
specific to the GUI, or in configuration files

It will be a problem for releasing emulator for other platforms (ie other
GUI toolkit or on console) so cleanup of these things is required.

Original issue: http://code.google.com/p/cpcsdk/issues/detail?id=9

@pulkomandy
Copy link
Member Author

From pulkoma...@gmail.com on November 26, 2008 04:40:15

I think the event handling in the emulator can still use SDL, as the functions used
are quite easy to reimplement and that is what we would do if removing them.
So, maybe keep these functions there, but clean them up so hey can use arbitrary
keycodes (i'm working on that, there is already a translation table in input.cpp that
will be moved to a config file), the only change in emulator.cpp will be adding some
config variables for ALT, CONTROL, and SHIFT modifiers.
The goal is to avoid having to convert keysyms twice, from wathever the gui is using
to some code for the emulator, then another time to the CPC mapping.

The other issue is video display, wich is already done properly with the render
class. Add a renderer for each new platform. There will be some cleanup to the
existing render, we will only keep :
-Doublesize wich renders to the wx window
-OpenGL wich will use hardware scaling for fullscreen display
-Maybe a "pure SDL" one for places were wx is not available and neither is OpenGL
(BeOS/Kaiku OS, GP2x, ?...)

Other problems may be :
-Sound (in audio.cpp), now using SDL
-Mouse, not supported
-File access (does fopen() exist on all consoles ? Endianness ?)

The idea is to try to keep the interfacing simple (should not end up with more code
just for cleanliness). So maybe we should keep sdl in some places (we are using many
structures from there, for example sdl_surface, but not many functions), these struct
are not a problem to reimplement where there is no SDL.
Functions like SDL_PollEvent() may give some more trouble, but we will have to
replace them with some other messaging system anyways if we remove them (i think we
need to be asynchronous here, so maye some kind of linked list of messages/events)

@pulkomandy
Copy link
Member Author

From pulkoma...@gmail.com on September 07, 2009 07:40:54

I just added a drive activity led to the wx interface. I did it by polling the FDC
in the idle loop of the wxWinow. It would be better if we had a generic GUI class to
inherit from, the emulator would then callback this class when there is something to
do, for example FDC_led(bool light), Display_frame(), ...

Beware not to loose the ability to render Climax :) (don't call Display_frame only
when there is a VBL)

@pulkomandy
Copy link
Member Author

From pulkoma...@gmail.com on July 02, 2010 08:34:00

The separation is now clean and clear.

Status: Fixed

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

No branches or pull requests

1 participant