You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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)
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)
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
The text was updated successfully, but these errors were encountered: