Closed audetto closed 3 years ago
The SDL version creates a sa2
executable: https://github.com/audetto/AppleWin/blob/sdl/source/frontends/sa2/CMakeLists.txt
Without Qt, you will not be able to configure anything as SDL does not provide any widget. Liapple implemented a text menu in SDL, but I'd rather not to. You will have to use cmd line switches or manually change the config file (which is not always obvious).
Yes, it's definitely a disadvantage that SDL doesn't provide UI widgets. There are some attempts at providing a UI set (e.g. https://github.com/RTrave/sdl2_guitk).
There's a lengthy discussion on the topic here https://forums.libsdl.org/viewtopic.php?t=9247 and the conclusion seems to be that it's possible to mix Gtk or Qt widgets with SDL1.2 using a "hack," but not SDL2 (without a small tweak to the SDL2 codebase). The official documentation seems to be here http://sdl.beuc.net/sdl.wiki/FAQ_GUI.
Not sure if it's discussed in the above thread, but a workaround with SDL2 (if you don't want to make the library code change) would be to have the SDL emulator window and a separate floating menu in Gtk/Qt (like GIMP/Photoshop). I can actually imagine this working out okay with the floating "GUI window" perhaps having the actual menu and a few graphical buttons / icons (like reset & pause buttons and disk activity lights). Being able to set emulator state via command line (and a flag to disable the floating menu) provides two advantages: 1.) Ability to assign disk images in Linux and double-click to execute (since image path can be passed as an argument) and 2.) for headless execution like on RetroPie.
Does the SDL branch resolve the timing resolution issues you identified with Qt? Does this SDL branch support command line flags? It doesn't look like it's using the same config file that qapple uses... where is the sa2 config file? I think it's really valuable to keep the SDL build moving along with development of the codebase, even if you aren't able to give it the attention you'd like. Probably at some point the timing resolution will become a problem and attention will need to turn to SDL.
This is more updated https://github.com/audetto/AppleWin/tree/sdl2 You will need a conf file in the same folder like this one for now
[Configuration]
Printer Filename=Printer.txt
Video Emulation=0
Video Style=1
Monochrome Color=12632256
Video Refresh Rate=2
[Preferences]
Last Disk Image 1=/home/andrea/projects/cvs/A2E/build/../Disks/NoSlotClockTest.dsk
call it applen.conf
The format is the same as the windows registry used by AW.
About timings, OpenGL has a nice feature that syncs the redraw with the screen refresh so you don need any timer to get the right speed. On the Pi3, it only works with the OpenGL driver otherwise one needs manual sync.
Supported keys are listed in the code F9 Ctrl Shift F6 Ctrl F6
Got a few disk images to load, but it doesn't look like keyboard input is going to the emulator (keycode echo'd in console, but no response in Moon Patrol or Mario Bros). Doesn't look like sound works either, but that may be related to the accelerated disk load, since it breaks in the Qt version as well. I'll look through the code.
It'd be awesome if the SDL2 version could use the same config file generated by the Qt version. That would provide a stop-gap to a full-fledged SDL UI. I think BasiliskII (Mac emulator) is like this (separate UI for configuration).
Keyboard not implemented yet: easy but tedious. Audio not implemented yet: more technical. Joystick: easy to add Mouse: a bit more tedious
Other features for SDL2: what do you think?
A nice one from Linapple was ability to browse https://mirrors.apple2.org.za/ftp.apple.asimov.net/ which could probably be implemented easier in the Qt gui (?)
Reboot? There are some many reboot types in AppleWin, that I never really understood what they mean.
Keyboard, audio, joystick, mouse support are more important than the above niceties. Also, it's really useful to provide a switch argument for command line disk paths, e.g. -d1=path/to/dsk1 -d2=path/to/dsk2, so the underlying operating system (Linux) can map an "open with" operation (double-click) to the filetype. It's more useful to be able to doubleclick a disk image to open it than to line up the emulator and folder in such a way that I can drag and drop.
"Drag-n-drop" is ubiquitous on a Mac, but so hit and miss on Linux that the thought doesn't usually occur to me (unless I open up the app and notice a big message like "Drop image here").
I don't see much use in "Drop text" unless you mean it more abstractly as a shared text clipboard. Being able to copy and paste text between emulator and host machine is more important than a UI "drop" operation.
AppleWin + SDL2 sounds very promising. It seems likely that keyboard, mouse, and joystick support could be copied from something like the GS+ codebase (or even https://github.com/linappleii/linapple). Sound/audio in SDL2 seems to be the sticking point for several emulators (haven't found a reliable audio implementation). GS+ is the only A2-oriented emulator I'm aware of that's adopted SDL2 at this point.
You will be pleased to see 1) Keyboard, joystick are now available 2) disks can already be controlled via cmd line (see with -h) 3) audio will be there tomorrow (Speaker + Mockingboard) I have some stupid bug I am too tired to chase and fix tonight 4) MB speech too complicated until they simplify it in AW see https://github.com/AppleWin/AppleWin/tree/Improve-SSI263
Close as duplicate of https://github.com/audetto/AppleWin/issues/12
Initially from https://github.com/audetto/AppleWin/issues/9#issuecomment-705284889