Coder Social home page Coder Social logo

audetto / applewin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from applewin/applewin

46.0 46.0 11.0 17.37 MB

Apple II emulator for Linux

License: GNU General Public License v2.0

Batchfile 0.03% HTML 5.74% C 47.34% C++ 45.65% CSS 0.41% CMake 0.24% QMake 0.02% Hack 0.41% Shell 0.01% JavaScript 0.16%
apple apple2 emulators imgui libretro linux ncurses qt

applewin's People

Contributors

audetto avatar beevik avatar fabricecaruso avatar fenarinarsa avatar gemba avatar hasseily avatar ivanizag avatar kevinmarty avatar kiyolee avatar mahallon avatar medasaro avatar michaelangel007 avatar oliverschmidt avatar pedgarcia avatar peteri avatar ralph-irving avatar rmacri avatar rzumer avatar seanshpark avatar sh95014 avatar sicklittlemonkey avatar taeber avatar thorstenbr avatar tomcw avatar warthurton avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

applewin's Issues

New features (SDL)

Qt app: quit from menu. Ctrl-Q
SDL2: F6 full screen and some command line options.

No /proc/self/exe on macOS, use _NSGetExecutablePath() instead

I don't seem to have permission to create branches for a PR... anyway, here's the diff

diff --git a/source/frontends/common2/commonframe.cpp b/source/frontends/common2/commonframe.cpp
index 94e42cee..796b4052 100644
--- a/source/frontends/common2/commonframe.cpp
+++ b/source/frontends/common2/commonframe.cpp
@@ -12,6 +12,9 @@
 #include "Log.h"
 #include "Core.h"
 #include "config.h"
+#ifdef __APPLE__
+#include "mach-o/dyld.h"
+#endif
 
 namespace
 {
@@ -35,7 +38,12 @@ namespace
     std::vector<std::string> paths;
 
     char self[1024] = {0};
+#ifdef __APPLE__
+    uint32_t size = sizeof(self);
+    const int ch = _NSGetExecutablePath(self, &size);
+#else
     const int ch = readlink("/proc/self/exe", self,  sizeof(self));
+#endif
     if (ch != -1)
     {
       const char * path = dirname(self);

Verified that with the fix, ROMs are getting picked up from /usr/local/share/applewin/resource/ instead of the source directory.

[Bug] Open Apple key not working

I was attempting to use the Merlin assembler and the manual says you can use Open Apple + Q to quit from the editor, in AppleWin (main) thats left alt with Closed Apple being right alt. Pressing that key combination will just type Q. I assume neither are implemented however I haven't found a way to test Closed Apple yet.

Screenshot bug

From sh95014:

Anyway, I found a bug (at least as compiled on macOS) with the BMP export code in the AppleWin, where the generated BMP file is invalid. I dug a bit into it and found that the header is malformed because the compiler inserts padding after the nCookie[] member. The fix is simple enough:

--- a/source/Video.h
+++ b/source/Video.h
@@ -99,6 +99,8 @@ struct bgra_t
        uint8_t a; // reserved on Win32
 };

 
+#pragma pack(push)
+#pragma pack(1)
 struct WinBmpHeader_t
 {
        // BITMAPFILEHEADER     // Addr Size
@@ -126,6 +128,7 @@ struct WinBmpHeader_t
        // RGBQUAD
        // pixelmap
 };
+#pragma pack(pop)

 
 struct WinCIEXYZ
 {

Execute loop target cycles computation ignores full-speed?

Hiya, me again. So I was trying to chase down why my app (which does not use the main loop in source/frontends/sdl/main.cpp) seems to be much slower than sa2. I've found that sa2 actually calls the writeAudio-ProcessEvents-ExecuteOneFrame-VideoPresentScreen sequence in a tight loop. This is surprising to me, and it pegs my CPU at ~42%.

I might be missing something big here, but my implementation is actually driven off of a 60 Hz timer, so if it finishes executing a 1/60 slice of 1 MHz 6502 code in less time, it'll just take a nap. This approach keeps the CPU at ~25%, but is of course quite slow. As an experiment, I hacked in the same nap (which computes to about 6 ms each time) to sa2:

diff --git a/source/frontends/sdl/main.cpp b/source/frontends/sdl/main.cpp
index d7f3f0ff..25fe286e 100644
--- a/source/frontends/sdl/main.cpp
+++ b/source/frontends/sdl/main.cpp
@@ -138,6 +138,8 @@ void run_sdl(int argc, const char * argv [])
 
     do
     {
+      uint64_t begin = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count();
+            
       frameTimer.tic();
 
       eventTimer.tic();
@@ -156,6 +158,12 @@ void run_sdl(int argc, const char * argv [])
         refreshScreenTimer.toc();
       }
       frameTimer.toc();
+      
+      uint64_t end = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count();
+      if (oneFrame > end - begin)
+      {
+        usleep((oneFrame - (end - begin)) * 1000);
+      }
     } while (!quit);
 
     global.toc();

and it did slow down just like mine did, but CPU utilization also dropped to ~31%.

I dug into it, and I think the problem is that Speed::getCyclesTillNext() doesn't actually know how many cycles to run when at full-speed. It calls Speed::getCyclesAtFixedSpeed() and computes 16-ms (because 60 Hz) worth of 1 MHz cycles and returns it, when I think it should be instead computing how many 6502 instructions can actually be executed in a 16-ms slice of the host CPU's time.

I tried to basically live-benchmark the emulation to get a rough "6502 cycles per microsecond" and use that to determine how many 6502 instructions to try to run in our 16-ms timeslice if we were at full-speed:

diff --git a/source/frontends/common2/speed.cpp b/source/frontends/common2/speed.cpp
index 9933ce05..aee6ff70 100644
--- a/source/frontends/common2/speed.cpp
+++ b/source/frontends/common2/speed.cpp
@@ -25,9 +25,20 @@ namespace common2
     return cycles;
   }
 
-  uint64_t Speed::getCyclesTillNext(const size_t microseconds) const
+  uint64_t Speed::getCyclesAtFullSpeed(const size_t microseconds, const uint64_t microsecondsExecuting) const
   {
-    if (myFixedSpeed || g_bFullSpeed)
+    const uint64_t instructionsPerMicrosecond = g_nCumulativeCycles / microsecondsExecuting;
+    const uint64_t cycles = microseconds * instructionsPerMicrosecond;
+    return cycles;
+  }
+
+  uint64_t Speed::getCyclesTillNext(const size_t microseconds, const uint64_t microsecondsExecuting) const
+  {
+    if (g_bFullSpeed)
+    {
+        return getCyclesAtFullSpeed(microseconds, microsecondsExecuting);
+    }
+    else if (myFixedSpeed)
     {
       return getCyclesAtFixedSpeed(microseconds);
     }
diff --git a/source/frontends/common2/speed.h b/source/frontends/common2/speed.h
index ceb661bb..d3dd89ac 100644
--- a/source/frontends/common2/speed.h
+++ b/source/frontends/common2/speed.h
@@ -14,8 +14,9 @@ namespace common2
 
     // calculate the number of cycles to execute in the current period
     // assuming the next call will happen in x microseconds
-    uint64_t getCyclesTillNext(const size_t microseconds) const;
+    uint64_t getCyclesTillNext(const size_t microseconds, const uint64_t microsecondsExecuting) const;
     uint64_t getCyclesAtFixedSpeed(const size_t microseconds) const;
+    uint64_t getCyclesAtFullSpeed(const size_t microseconds, const uint64_t microsecondsExecuting) const;
 
   private:
 
diff --git a/source/frontends/sdl/sdlframe.cpp b/source/frontends/sdl/sdlframe.cpp
index dfb6448f..2364c063 100644
--- a/source/frontends/sdl/sdlframe.cpp
+++ b/source/frontends/sdl/sdlframe.cpp
@@ -133,6 +133,7 @@ namespace sa2
     , myDragAndDropDrive(DRIVE_1)
     , myScrollLockFullSpeed(false)
     , mySpeed(options.fixedSpeed)
+    , myMicrosecondsExecuting(0)
   {
   }
 
@@ -609,8 +610,12 @@ namespace sa2
   void SDLFrame::ExecuteInRunningMode(const size_t msNextFrame)
   {
     SetFullSpeed(CanDoFullSpeed());
-    const uint64_t cyclesToExecute = mySpeed.getCyclesTillNext(msNextFrame * 1000);  // this checks g_bFullSpeed
+    const uint64_t cyclesToExecute = mySpeed.getCyclesTillNext(msNextFrame * 1000, myMicrosecondsExecuting);  // this checks g_bFullSpeed
+      
+    uint64_t microsecondsBeforeExecution = std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::system_clock::now().time_since_epoch()).count();
     Execute(cyclesToExecute);
+    uint64_t microsecondsAfterExecution = std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::system_clock::now().time_since_epoch()).count();
+    myMicrosecondsExecuting += (microsecondsAfterExecution - microsecondsBeforeExecution);
   }
 
   void SDLFrame::ExecuteInDebugMode(const size_t msNextFrame)
diff --git a/source/frontends/sdl/sdlframe.h b/source/frontends/sdl/sdlframe.h
index a262b392..bfbfe23a 100644
--- a/source/frontends/sdl/sdlframe.h
+++ b/source/frontends/sdl/sdlframe.h
@@ -79,6 +79,9 @@ namespace sa2
     std::shared_ptr<SDL_Window> myWindow;
 
     CConfigNeedingRestart myHardwareConfig;
+      
+  private:
+    uint64_t myMicrosecondsExecuting;
   };
 
 }

Before I go too far down this rabbit hole, am I actually on the right track, or is the tight loop actually the preferred implementation? The patch above allows both sa2 and my app to run at approximately the same speed but with lower CPU utilization in both cases.

Thanks!

Minimum set of binaries for a linux package?

In linux.md is said that libapple (surely build/source/libappleii.so) plus the 4 frontends are the core of AppleWin emulator for Linux environment. I just separated libappleii.so and qapple binary to create a basic package. What i want to know is if other files are needed besides this one.

In AppleWin for Windows the release package has at least 3 other files:

  • A2_BASIC.SYM
  • APPLE2E.SYM
  • DELREG.INF

Do i need to put them inside my package? What they are intended for?

joystick device name?

How do I find the joystick device name and how do I tell if AppleWin registers the joystick as usable?

I'm running AppleWin inside the bullseye crouton instance on an arm Chromebook.

Applewin works great. The only difficult I have is figuring out how to associate the USB joystick I have connected.

If go to https://gamepad-tester.com in FireFox in the bullseye instance, it sees the joystick and responds to moving the stick and pressing the buttons so I know the joystick works and is connected to USB and visible to Bullseye.

using jstest-sdl from the command line also finds the joystick and responds to movement and buttons as expected.

when I run AppleWin with the MECC Computer inspector desk that has a joystick test I don't get any response to the joystick test (no button presses, no cursor movement)
https://archive.org/details/MECC-A240_Computer_Inspector_v1.0

./sa2 --gl-swap=0 --device-name /dev/input/by-id/??? -1 MECC-A240_Computer_Inspector_v1.0.dsk
Where ???
is any of:
usb-Trooper_V2_Trooper_V2-event-joystick (what is found in /dev/input/by-id/)
usb-Trooper_V2_Trooper_V2-joystick (what else is found in /dev/inpuit/by-id/)
event6 (what is found in ls -l /dev/input/by-id/)
js0 (what else is found in ls -l /dev/input/by-id/)

jstest-dsl identifies the JoyStick Name: 'Trooper V2'

CMake Error: install TARGETS given no RUNTIME DESTINATION

Latest Raspbian distro (Debian) running gcc 8.3.0 and cmake 3.13.4. Upon cmake .. I get the following output:

CMAKE_BUILD_TYPE: RELEASE
CMAKE_CXX_FLAGS: -Wno-multichar -Werror=return-type
CMAKE_CXX_FLAGS_RELEASE: -O3 -DNDEBUG
CMAKE_CXX_FLAGS_DEBUG: -g
CMAKE_CXX_FLAGS_RELWITHDEBINFO: -O2 -g -DNDEBUG
-- Boost version: 1.67.0
CMake Error at source/CMakeLists.txt:88 (install):
install TARGETS given no LIBRARY DESTINATION for shared library target
"appleii".

-- Boost version: 1.67.0
-- Found the following Boost libraries:
-- program_options
CMake Error at source/frontends/ncurses/CMakeLists.txt:45 (install):
install TARGETS given no RUNTIME DESTINATION for executable target
"applen".

CMake Error at source/frontends/qapple/CMakeLists.txt:39 (install):
install TARGETS given no RUNTIME DESTINATION for executable target
"qapple".

-- Configuring incomplete, errors occurred!

Before I try to edit the 3 indicated CMakeLists.txt files, is it possible to pass the TARGETS value as a flag for cmake (or something similar)?

applen alternately displays wrong text page when running A2osX text-based disk OS

First of all, this is such a cool project! I am having so much fun running AppleWin natively on Linux and it built without a hitch on my Kubuntu 20.04 system, using the packages I found in raspbian.list.txt.

I was blown away by how well I could run Aztec in the terminal and still make out the gist of the game. My next step was to run a text-based shell, like the currently-in-development A2osX.

I found that running this floppy image, which is an 80-column mode shell, resulted in my virtual Apple II display flickering between text pages way too much. It seems that when the input cursor is on an odd column, the display shows text page 2, which is garbage. Just advancing the cursor by one brings back the expected display of text page 1. Back and forth, it's unusable.

I tried a regular ProDOS disk, and I didn't notice this behavior in its 80-column display.

Regardless, I really hope that this work can be merged back into AppleWin.

[Feature Request] Mockingboard

Would it be feasible to add the mockingboard as an option for sound in Qapple? I know the original AppleWin has it so you might be able to it for reference.

[git][sdl2]Cannot boot automatically on prodos boot disk on restart with Applewin commit cd0a18d

Hello.

I noticed a regression introduced between commit db8997d and commit cd0a18d. Disk drive are not started after I asked for a computer reboot. Status is OFF instead of read. It also reset the content of disk drive 1. Ouch!

Even after I inserted a bootable prodos disk image and reset the emulator, nothing happens.

I set up an Apple IIe Enhanced with Mockingboard in both slot 4 and 5. Both disk drives are connected to slot 6. Enhanced speed is also on.

Log is empty :(

I tried to build commit 7ae280a, so I cannot say if this one or the other is guilty for the not starting disk drive.

I got this building error:

[ 61%] Linking CXX shared library libappleii.so
[ 61%] Built target appleii
make: *** [Makefile:156 : all] Error 2

Sorry.

Debian 10 Buster - cmake failed

Debian 10 Buster - kernel 4.19.0-17-686-pae (32 bits)

CMAKE failed to compile, missing yaml-0.1

There's a libyaml-0-2 but doesn't help.

Any clue?

Error Compiling AND Debian package creation

Error when compiling last update:

/media/Melchior/SVN/AppleWin-Audetto-TESTE/build$ make -j12
Scanning dependencies of target qhexview-lib_autogen
Scanning dependencies of target appleii
[  0%] Automatic MOC and UIC for target qhexview-lib
Scanning dependencies of target testcpu6502
[  1%] Building CXX object test/TestCPU6502/CMakeFiles/testcpu6502.dir/TestCPU6502.cpp.o
[  1%] Building CXX object test/TestCPU6502/CMakeFiles/testcpu6502.dir/__/__/source/SynchronousEventManager.cpp.o
[  2%] Building CXX object test/TestCPU6502/CMakeFiles/testcpu6502.dir/stdafx.cpp.o
[  3%] Building CXX object source/CMakeFiles/appleii.dir/Tfe/tfe.cpp.o
[  3%] Building CXX object source/CMakeFiles/appleii.dir/Tfe/tfesupp.cpp.o
[  3%] Building CXX object source/CMakeFiles/appleii.dir/Tfe/tfearch.cpp.o
[  4%] Building CXX object source/CMakeFiles/appleii.dir/Debugger/Debugger_Help.cpp.o
[  5%] Building CXX object source/CMakeFiles/appleii.dir/Debugger/Debug.cpp.o
[  6%] Building CXX object source/CMakeFiles/appleii.dir/Debugger/Debugger_Symbols.cpp.o
[  7%] Building CXX object source/CMakeFiles/appleii.dir/Debugger/Debugger_Disassembler.cpp.o
[  7%] Building CXX object source/CMakeFiles/appleii.dir/Debugger/Debugger_Color.cpp.o
[  7%] Building CXX object source/CMakeFiles/appleii.dir/Debugger/Debugger_DisassemblerData.cpp.o
[  8%] Building CXX object source/CMakeFiles/appleii.dir/Debugger/Debugger_Console.cpp.o
[  8%] Built target qhexview-lib_autogen
Scanning dependencies of target qhexview-lib
[  8%] Building CXX object source/CMakeFiles/appleii.dir/Debugger/Debugger_Assembler.cpp.o
[  9%] Building CXX object source/frontends/qt/QHexView/CMakeFiles/qhexview-lib.dir/qhexview-lib_autogen/mocs_compilation.cpp.o
/media/Melchior/SVN/AppleWin-Audetto-TESTE/source/Debugger/Debugger_Disassembler.cpp: In function ‘int GetDisassemblyLine(WORD, DisasmLine_t&)’:
/media/Melchior/SVN/AppleWin-Audetto-TESTE/source/Debugger/Debugger_Disassembler.cpp:336:35: warning: ‘%d’ directive writing between 1 and 10 bytes into a region of size 8 [-Wformat-overflow=]
  336 |     sprintf(line_.sTargetOffset, "%d", nAbsTargetOffset);
      |                                   ^~
/media/Melchior/SVN/AppleWin-Audetto-TESTE/source/Debugger/Debugger_Disassembler.cpp:336:34: note: directive argument in the range [0, 2147483647]
  336 |     sprintf(line_.sTargetOffset, "%d", nAbsTargetOffset);
      |                                  ^~~~
/media/Melchior/SVN/AppleWin-Audetto-TESTE/source/Debugger/Debugger_Disassembler.cpp:336:12: note: ‘sprintf’ output between 2 and 11 bytes into a destination of size 8
  336 |     sprintf(line_.sTargetOffset, "%d", nAbsTargetOffset);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ 10%] Building CXX object source/CMakeFiles/appleii.dir/Debugger/Debugger_Parser.cpp.o
[ 11%] Building CXX object source/CMakeFiles/appleii.dir/Debugger/Debugger_Range.cpp.o
In file included from /media/Melchior/SVN/AppleWin-Audetto-TESTE/source/Debugger/Debug.h:4,
                 from /media/Melchior/SVN/AppleWin-Audetto-TESTE/source/Debugger/Debugger_Symbols.cpp:31:
/media/Melchior/SVN/AppleWin-Audetto-TESTE/source/Debugger/Debugger_Symbols.cpp: In function ‘int ParseSymbolTable(const string&, SymbolTable_Index_e, int)’:
/media/Melchior/SVN/AppleWin-Audetto-TESTE/source/Debugger/../Common.h:10:34: warning: comparison between ‘enum DisasmDisplay_e’ and ‘enum<unnamed>’ [-Wenum-compare]
   10 | #define  MIN(a,b)          (((a) < (b)) ? (a) : (b))
      |                              ~~~~^~~~~
/media/Melchior/SVN/AppleWin-Audetto-TESTE/source/Debugger/Debugger_Symbols.cpp:560:22: note: in expansion of macro ‘MIN’
  560 |  const int nMaxLen = MIN(MAX_TARGET_LEN,MAX_SYMBOLS_LEN);
      |                      ^~~
/media/Melchior/SVN/AppleWin-Audetto-TESTE/source/Debugger/../Common.h:10:41: warning: enumerated mismatch in conditional expression: ‘DisasmDisplay_e’ vs ‘<unnamed enum>’ [-Wenum-compare]
   10 | #define  MIN(a,b)          (((a) < (b)) ? (a) : (b))
      |                             ~~~~~~~~~~~~^~~~~~~~~~~
/media/Melchior/SVN/AppleWin-Audetto-TESTE/source/Debugger/Debugger_Symbols.cpp:560:22: note: in expansion of macro ‘MIN’
  560 |  const int nMaxLen = MIN(MAX_TARGET_LEN,MAX_SYMBOLS_LEN);
      |                      ^~~
[ 11%] Building CXX object source/CMakeFiles/appleii.dir/Debugger/Debugger_Commands.cpp.o
[ 12%] Building CXX object source/CMakeFiles/appleii.dir/Debugger/Util_MemoryTextFile.cpp.o
[ 13%] Building CXX object source/CMakeFiles/appleii.dir/SSI263.cpp.o
[ 13%] Building CXX object source/CMakeFiles/appleii.dir/Speaker.cpp.o
[ 14%] Building CXX object source/CMakeFiles/appleii.dir/SoundCore.cpp.o
[ 14%] Building CXX object source/CMakeFiles/appleii.dir/AY8910.cpp.o
[ 15%] Building CXX object source/CMakeFiles/appleii.dir/Mockingboard.cpp.o
[ 16%] Building CXX object source/CMakeFiles/appleii.dir/Pravets.cpp.o
[ 16%] Building CXX object source/CMakeFiles/appleii.dir/YamlHelper.cpp.o
[ 17%] Building CXX object source/CMakeFiles/appleii.dir/Log.cpp.o
[ 18%] Building CXX object source/CMakeFiles/appleii.dir/Disk.cpp.o
[ 18%] Building CXX object source/CMakeFiles/appleii.dir/DiskFormatTrack.cpp.o
[ 19%] Building CXX object source/CMakeFiles/appleii.dir/DiskImage.cpp.o
[ 19%] Building CXX object source/CMakeFiles/appleii.dir/DiskImageHelper.cpp.o
[ 20%] Building CXX object source/CMakeFiles/appleii.dir/Harddisk.cpp.o
[ 20%] Building CXX object source/frontends/qt/QHexView/CMakeFiles/qhexview-lib.dir/document/buffer/qfilebuffer.cpp.o
[ 21%] Building CXX object source/CMakeFiles/appleii.dir/Memory.cpp.o
[ 21%] Building CXX object source/CMakeFiles/appleii.dir/CPU.cpp.o
[ 22%] Building CXX object source/CMakeFiles/appleii.dir/6821.cpp.o
[ 23%] Building CXX object source/CMakeFiles/appleii.dir/NoSlotClock.cpp.o
[ 23%] Building CXX object source/CMakeFiles/appleii.dir/SAM.cpp.o
[ 24%] Building CXX object source/CMakeFiles/appleii.dir/z80emu.cpp.o
[ 24%] Building CXX object source/CMakeFiles/appleii.dir/ParallelPrinter.cpp.o
/media/Melchior/SVN/AppleWin-Audetto-TESTE/source/Debugger/Debug.cpp: In function ‘Update_t DebuggerProcessCommand(bool)’:
/media/Melchior/SVN/AppleWin-Audetto-TESTE/source/Debugger/Debug.cpp:8701:35: warning: ‘%s’ directive writing up to 127 bytes into a region of size 66 [-Wformat-overflow=]
 8701 |    sprintf( sText, "Syntax error: %s", g_aArgs[0].sArg );
      |                                   ^~   ~~~~~~~~~~~~~~~
/media/Melchior/SVN/AppleWin-Audetto-TESTE/source/Debugger/Debug.cpp:8701:11: note: ‘sprintf’ output between 15 and 142 bytes into a destination of size 80
 8701 |    sprintf( sText, "Syntax error: %s", g_aArgs[0].sArg );
      |    ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ 25%] Building CXX object source/CMakeFiles/appleii.dir/MouseInterface.cpp.o
[ 26%] Building CXX object source/frontends/qt/QHexView/CMakeFiles/qhexview-lib.dir/document/buffer/qhexbuffer.cpp.o
[ 27%] Building CXX object source/CMakeFiles/appleii.dir/LanguageCard.cpp.o
[ 27%] Building CXX object source/CMakeFiles/appleii.dir/RGBMonitor.cpp.o
[ 28%] Building CXX object source/CMakeFiles/appleii.dir/NTSC.cpp.o
[ 29%] Building CXX object source/CMakeFiles/appleii.dir/NTSC_CharSet.cpp.o
[ 29%] Building CXX object source/CMakeFiles/appleii.dir/CardManager.cpp.o
[ 30%] Building CXX object source/CMakeFiles/appleii.dir/Disk2CardManager.cpp.o
[ 30%] Building CXX object source/CMakeFiles/appleii.dir/Riff.cpp.o
[ 31%] Building CXX object source/CMakeFiles/appleii.dir/SaveState.cpp.o
[ 32%] Building CXX object source/CMakeFiles/appleii.dir/SynchronousEventManager.cpp.o
[ 32%] Building CXX object source/CMakeFiles/appleii.dir/Video.cpp.o
[ 33%] Building CXX object source/frontends/qt/QHexView/CMakeFiles/qhexview-lib.dir/document/buffer/qmemorybuffer.cpp.o
[ 34%] Building CXX object source/CMakeFiles/appleii.dir/Core.cpp.o
[ 35%] Building CXX object source/CMakeFiles/appleii.dir/Utilities.cpp.o
[ 35%] Building CXX object source/CMakeFiles/appleii.dir/FrameBase.cpp.o
[ 36%] Building CXX object source/CMakeFiles/appleii.dir/CmdLine.cpp.o
[ 36%] Building CXX object source/CMakeFiles/appleii.dir/Configuration/PropertySheetHelper.cpp.o
/media/Melchior/SVN/AppleWin-Audetto-TESTE/source/Core.cpp: In function ‘void SetAppleWinVersion(UINT16, UINT16, UINT16, UINT16)’:
/media/Melchior/SVN/AppleWin-Audetto-TESTE/source/Core.cpp:260:59: warning: ‘%d’ directive output may be truncated writing between 1 and 5 bytes into a region of size between 4 and 12 [-Wformat-truncation=]
  260 |  StringCbPrintf(VERSIONSTRING, VERSIONSTRING_SIZE, "%d.%d.%d.%d", major, minor, fix, fix_minor);
      |                                                           ^~
/media/Melchior/SVN/AppleWin-Audetto-TESTE/source/Core.cpp:260:52: note: directive argument in the range [0, 65535]
  260 |  StringCbPrintf(VERSIONSTRING, VERSIONSTRING_SIZE, "%d.%d.%d.%d", major, minor, fix, fix_minor);
      |                                                    ^~~~~~~~~~~~~
/media/Melchior/SVN/AppleWin-Audetto-TESTE/source/Core.cpp:260:52: note: directive argument in the range [0, 65535]
/media/Melchior/SVN/AppleWin-Audetto-TESTE/source/Core.cpp:260:16: note: ‘snprintf’ output between 8 and 24 bytes into a destination of size 16
  260 |  StringCbPrintf(VERSIONSTRING, VERSIONSTRING_SIZE, "%d.%d.%d.%d", major, minor, fix, fix_minor);
[ 37%] Building CXX object source/CMakeFiles/appleii.dir/linux/windows/handles.cpp.o
[ 38%] Building CXX object source/CMakeFiles/appleii.dir/linux/windows/files.cpp.o
[ 38%] Building CXX object source/CMakeFiles/appleii.dir/linux/windows/time.cpp.o
[ 39%] Building CXX object source/CMakeFiles/appleii.dir/linux/windows/stringcb.cpp.o
[ 40%] Building CXX object source/CMakeFiles/appleii.dir/linux/windows/strings.cpp.o
[ 40%] Building CXX object source/CMakeFiles/appleii.dir/linux/windows/misc.cpp.o
[ 41%] Building CXX object source/CMakeFiles/appleii.dir/linux/windows/winbase.cpp.o
[ 41%] Building CXX object source/CMakeFiles/appleii.dir/linux/windows/winuser.cpp.o
[ 42%] Building CXX object source/CMakeFiles/appleii.dir/linux/windows/dsound.cpp.o
[ 43%] Building CXX object source/CMakeFiles/appleii.dir/linux/windows/guiddef.cpp.o
[ 43%] Building CXX object source/CMakeFiles/appleii.dir/linux/windows/dmusicc.cpp.o
[ 44%] Building CXX object source/CMakeFiles/appleii.dir/linux/windows/winnls.cpp.o
[ 45%] Building CXX object source/CMakeFiles/appleii.dir/linux/resources.cpp.o
[ 45%] Building CXX object source/frontends/qt/QHexView/CMakeFiles/qhexview-lib.dir/document/buffer/qmemoryrefbuffer.cpp.o
[ 45%] Building CXX object source/CMakeFiles/appleii.dir/linux/benchmark.cpp.o
[ 46%] Building CXX object source/CMakeFiles/appleii.dir/linux/paddle.cpp.o
[ 46%] Building CXX object source/CMakeFiles/appleii.dir/linux/version.cpp.o
[ 47%] Building CXX object source/CMakeFiles/appleii.dir/linux/registry.cpp.o
[ 48%] Building CXX object source/CMakeFiles/appleii.dir/linux/keyboard.cpp.o
[ 48%] Building CXX object source/CMakeFiles/appleii.dir/linux/linuxframe.cpp.o
[ 49%] Linking CXX executable ../../testcpu6502
[ 50%] Building CXX object source/CMakeFiles/appleii.dir/linux/context.cpp.o
[ 51%] Building CXX object source/CMakeFiles/appleii.dir/linux/tape.cpp.o
[ 51%] Built target testcpu6502
[ 51%] Building CXX object source/CMakeFiles/appleii.dir/linux/network/uthernet2.cpp.o
[ 52%] Building CXX object source/CMakeFiles/appleii.dir/linux/network/tfe2.cpp.o
[ 52%] Building CXX object source/CMakeFiles/appleii.dir/linux/network/slirp2.cpp.o
[ 53%] Building CXX object source/CMakeFiles/appleii.dir/linux/duplicates/Debugger_Display.cpp.o
[ 54%] Building CXX object source/CMakeFiles/appleii.dir/linux/duplicates/Debugger_Win32.cpp.o
[ 54%] Building CXX object source/CMakeFiles/appleii.dir/linux/duplicates/Joystick.cpp.o
[ 55%] Building CXX object source/CMakeFiles/appleii.dir/linux/duplicates/SerialComms.cpp.o
[ 56%] Building CXX object source/CMakeFiles/appleii.dir/linux/duplicates/PropertySheet.cpp.o
[ 57%] Building CXX object source/frontends/qt/QHexView/CMakeFiles/qhexview-lib.dir/document/commands/hexcommand.cpp.o
[ 57%] Building CXX object source/CMakeFiles/appleii.dir/linux/duplicates/Registry.cpp.o
[ 58%] Building CXX object source/CMakeFiles/appleii.dir/linux/duplicates/FourPlay.cpp.o
[ 58%] Building CXX object source/CMakeFiles/appleii.dir/linux/duplicates/SNESMAX.cpp.o
[ 59%] Building CXX object source/CMakeFiles/appleii.dir/linux/duplicates/Keyboard.cpp.o
[ 60%] Building CXX object source/CMakeFiles/appleii.dir/Z80VICE/z80.cpp.o
[ 60%] Building CXX object source/CMakeFiles/appleii.dir/Z80VICE/z80mem.cpp.o
[ 61%] Building CXX object source/CMakeFiles/appleii.dir/Z80VICE/daa.cpp.o
[ 62%] Building CXX object source/frontends/qt/QHexView/CMakeFiles/qhexview-lib.dir/document/commands/insertcommand.cpp.o
[ 62%] Building CXX object source/frontends/qt/QHexView/CMakeFiles/qhexview-lib.dir/document/commands/removecommand.cpp.o
[ 63%] Building CXX object source/frontends/qt/QHexView/CMakeFiles/qhexview-lib.dir/document/commands/replacecommand.cpp.o
[ 63%] Building CXX object source/frontends/qt/QHexView/CMakeFiles/qhexview-lib.dir/document/qhexcursor.cpp.o
[ 64%] Building CXX object source/frontends/qt/QHexView/CMakeFiles/qhexview-lib.dir/document/qhexdocument.cpp.o
[ 65%] Building CXX object source/frontends/qt/QHexView/CMakeFiles/qhexview-lib.dir/document/qhexmetadata.cpp.o
[ 65%] Building CXX object source/frontends/qt/QHexView/CMakeFiles/qhexview-lib.dir/document/qhexrenderer.cpp.o
[ 66%] Building CXX object source/frontends/qt/QHexView/CMakeFiles/qhexview-lib.dir/qhexview.cpp.o
[ 67%] Linking CXX static library libqhexview-lib.a
[ 67%] Built target qhexview-lib
[ 68%] Linking CXX shared library libappleii.so
[ 68%] Built target appleii
Scanning dependencies of target qapple_autogen
Scanning dependencies of target common2
[ 68%] Automatic MOC and UIC for target qapple
[ 69%] Building CXX object source/frontends/common2/CMakeFiles/common2.dir/ptreeregistry.cpp.o
[ 70%] Building CXX object source/frontends/common2/CMakeFiles/common2.dir/fileregistry.cpp.o
[ 70%] Building CXX object source/frontends/common2/CMakeFiles/common2.dir/commonframe.cpp.o
[ 71%] Building CXX object source/frontends/common2/CMakeFiles/common2.dir/timer.cpp.o
[ 71%] Building CXX object source/frontends/common2/CMakeFiles/common2.dir/programoptions.cpp.o
[ 71%] Building CXX object source/frontends/common2/CMakeFiles/common2.dir/speed.cpp.o
[ 72%] Building CXX object source/frontends/common2/CMakeFiles/common2.dir/utils.cpp.o
[ 72%] Built target qapple_autogen
[ 73%] Automatic RCC for qapple.qrc
Scanning dependencies of target qapple
[ 74%] Building CXX object source/frontends/qt/CMakeFiles/qapple.dir/qapple_autogen/mocs_compilation.cpp.o
[ 74%] Building CXX object source/frontends/qt/CMakeFiles/qapple.dir/main.cpp.o
[ 75%] Building CXX object source/frontends/qt/CMakeFiles/qapple.dir/qapple.cpp.o
[ 75%] Building CXX object source/frontends/qt/CMakeFiles/qapple.dir/preferences.cpp.o
[ 76%] Building CXX object source/frontends/qt/CMakeFiles/qapple.dir/emulator.cpp.o
[ 76%] Building CXX object source/frontends/qt/CMakeFiles/qapple.dir/memorycontainer.cpp.o
[ 77%] Building CXX object source/frontends/qt/CMakeFiles/qapple.dir/gamepadpaddle.cpp.o
[ 78%] Building CXX object source/frontends/qt/CMakeFiles/qapple.dir/qvideo.cpp.o
[ 78%] Building CXX object source/frontends/qt/CMakeFiles/qapple.dir/configuration.cpp.o
[ 79%] Building CXX object source/frontends/qt/CMakeFiles/qapple.dir/options.cpp.o
[ 79%] Building CXX object source/frontends/qt/CMakeFiles/qapple.dir/loggingcategory.cpp.o
[ 80%] Building CXX object source/frontends/qt/CMakeFiles/qapple.dir/viewbuffer.cpp.o
[ 81%] Building CXX object source/frontends/qt/CMakeFiles/qapple.dir/qdirectsound.cpp.o
[ 81%] Building CXX object source/frontends/qt/CMakeFiles/qapple.dir/qtframe.cpp.o
[ 82%] Building CXX object source/frontends/qt/CMakeFiles/qapple.dir/qapple_autogen/EWIEGA46WW/qrc_qapple.cpp.o
[ 83%] Linking CXX executable ../../../qapple
[ 83%] Built target qapple
[ 84%] Linking CXX static library libcommon2.a
[ 84%] Built target common2
Scanning dependencies of target sa2
Scanning dependencies of target applen
[ 85%] Building CXX object source/frontends/ncurses/CMakeFiles/applen.dir/nframe.cpp.o
[ 85%] Building CXX object source/frontends/ncurses/CMakeFiles/applen.dir/colors.cpp.o
[ 86%] Building CXX object source/frontends/ncurses/CMakeFiles/applen.dir/world.cpp.o
[ 87%] Building CXX object source/frontends/ncurses/CMakeFiles/applen.dir/evdevpaddle.cpp.o
[ 87%] Building CXX object source/frontends/ncurses/CMakeFiles/applen.dir/main.cpp.o
[ 87%] Building CXX object source/frontends/ncurses/CMakeFiles/applen.dir/asciiart.cpp.o
[ 87%] Building CXX object source/frontends/sdl/CMakeFiles/sa2.dir/gamepad.cpp.o
[ 87%] Building CXX object source/frontends/sdl/CMakeFiles/sa2.dir/sdlframe.cpp.o
[ 89%] Building CXX object source/frontends/sdl/CMakeFiles/sa2.dir/processfile.cpp.o
[ 89%] Building CXX object source/frontends/sdl/CMakeFiles/sa2.dir/main.cpp.o
[ 90%] Building CXX object source/frontends/sdl/CMakeFiles/sa2.dir/utils.cpp.o
[ 91%] Building CXX object source/frontends/sdl/CMakeFiles/sa2.dir/sdirectsound.cpp.o
[ 92%] Building CXX object source/frontends/sdl/CMakeFiles/sa2.dir/renderer/sdlrendererframe.cpp.o
[ 92%] Building CXX object source/frontends/sdl/CMakeFiles/sa2.dir/imgui/sdlimguiframe.cpp.o
[ 93%] Building CXX object source/frontends/sdl/CMakeFiles/sa2.dir/imgui/image.cpp.o
[ 93%] Building CXX object source/frontends/sdl/CMakeFiles/sa2.dir/imgui/settingshelper.cpp.o
[ 94%] Building CXX object source/frontends/sdl/CMakeFiles/sa2.dir/imgui/sdlsettings.cpp.o
[ 95%] Building CXX object source/frontends/sdl/CMakeFiles/sa2.dir/imgui/imgui/imgui.cpp.o
[ 95%] Building CXX object source/frontends/sdl/CMakeFiles/sa2.dir/imgui/imgui/imgui_demo.cpp.o
[ 96%] Building CXX object source/frontends/sdl/CMakeFiles/sa2.dir/imgui/imgui/imgui_draw.cpp.o
[ 97%] Building CXX object source/frontends/sdl/CMakeFiles/sa2.dir/imgui/imgui/imgui_tables.cpp.o
[ 97%] Building CXX object source/frontends/sdl/CMakeFiles/sa2.dir/imgui/imgui/imgui_widgets.cpp.o
[ 98%] Building CXX object source/frontends/sdl/CMakeFiles/sa2.dir/imgui/imgui/backends/imgui_impl_sdl.cpp.o
[ 98%] Building CXX object source/frontends/sdl/CMakeFiles/sa2.dir/imgui/imgui/backends/imgui_impl_opengl3.cpp.o
[ 99%] Linking CXX executable ../../../applen
/media/Melchior/SVN/AppleWin-Audetto-TESTE/source/frontends/sdl/imgui/sdlsettings.cpp: In member function ‘void sa2::ImGuiSettings::showSettings(sa2::SDLFrame*)’:
/media/Melchior/SVN/AppleWin-Audetto-TESTE/source/frontends/sdl/imgui/sdlsettings.cpp:222:18: error: ‘BeginDisabled’ is not a member of ‘ImGui’; did you mean ‘BeginTable’?
  222 |           ImGui::BeginDisabled();
      |                  ^~~~~~~~~~~~~
      |                  BeginTable
/media/Melchior/SVN/AppleWin-Audetto-TESTE/source/frontends/sdl/imgui/sdlsettings.cpp:224:18: error: ‘EndDisabled’ is not a member of ‘ImGui’; did you mean ‘EndTable’?
  224 |           ImGui::EndDisabled();
      |                  ^~~~~~~~~~~
      |                  EndTable
/media/Melchior/SVN/AppleWin-Audetto-TESTE/source/frontends/sdl/imgui/sdlsettings.cpp:557:20: error: ‘BeginDisabled’ is not a member of ‘ImGui’; did you mean ‘BeginTable’?
  557 |             ImGui::BeginDisabled();
      |                    ^~~~~~~~~~~~~
      |                    BeginTable
/media/Melchior/SVN/AppleWin-Audetto-TESTE/source/frontends/sdl/imgui/sdlsettings.cpp:571:20: error: ‘EndDisabled’ is not a member of ‘ImGui’; did you mean ‘EndTable’?
  571 |             ImGui::EndDisabled();
      |                    ^~~~~~~~~~~
      |                    EndTable
/media/Melchior/SVN/AppleWin-Audetto-TESTE/source/frontends/sdl/imgui/sdlsettings.cpp: In member function ‘void sa2::ImGuiSettings::drawDisassemblyTable(sa2::SDLFrame*)’:
/media/Melchior/SVN/AppleWin-Audetto-TESTE/source/frontends/sdl/imgui/sdlsettings.cpp:910:18: error: ‘BeginDisabled’ is not a member of ‘ImGui’; did you mean ‘BeginTable’?
  910 |           ImGui::BeginDisabled(g_nAppMode != MODE_DEBUG);
      |                  ^~~~~~~~~~~~~
      |                  BeginTable
/media/Melchior/SVN/AppleWin-Audetto-TESTE/source/frontends/sdl/imgui/sdlsettings.cpp:923:18: error: ‘EndDisabled’ is not a member of ‘ImGui’; did you mean ‘EndTable’?
  923 |           ImGui::EndDisabled();
      |                  ^~~~~~~~~~~
      |                  EndTable
[ 99%] Built target applen
make[2]: *** [source/frontends/sdl/CMakeFiles/sa2.dir/build.make:212: source/frontends/sdl/CMakeFiles/sa2.dir/imgui/sdlsettings.cpp.o] Erro 1
make[2]: ** Esperando que outros processos terminem.
make[1]: *** [CMakeFiles/Makefile2:455: source/frontends/sdl/CMakeFiles/sa2.dir/all] Erro 2
make: *** [Makefile:171: all] Erro 2

And command cpack -G DEB:

/media/Melchior/SVN/AppleWin-Audetto-TESTE/build$ cpack -G DEB
CPack: Create package using DEB
CPack: Install projects
CPack: - Run preinstall target for: applewin
CPack Error: Problem running install command: /usr/bin/cmake --build . --target "preinstall"
Please check /media/Melchior/SVN/AppleWin-Audetto-TESTE/build/_CPack_Packages/Linux/DEB/PreinstallOutput.log for errors
CPack Error: Error when generating package: applewin

Command line hard drive support

It looks like loading hard drive images requires a very specific set of steps, namely open Configuration menu, click disks, highlight the hard drive entry, then drag the drive image into this field. I'd really like to be able to load a hard drive from command-line.

Looking at the available flags, there doesn't appear to be one suitable for specifying hard drive images. I suspect this is more of a Linux thing or I would have posted in the main AppleWin repository.

Libretro: keyboard overlap with shortcuts

Some keys already have a meaning in RetroArch

O, F, P, K, Space...

It is hard to type in AppleWin avoiding them, but probably this is a symptom of a bigger issue.

RetroArch is only meant to be controlled via a RetroPad (i.e. a gamepad).

Can't build

Hello,

Trying to compile your fork :

stefan@debian:~/Projects/AppleWin$ cmake .
CMAKE_BUILD_TYPE:
CMAKE_CXX_FLAGS:                  -Wno-multichar -Werror=return-type
CMAKE_CXX_FLAGS_RELEASE:         -O3 -DNDEBUG
CMAKE_CXX_FLAGS_DEBUG:           -g
CMAKE_CXX_FLAGS_RELWITHDEBINFO:  -O2 -g -DNDEBUG
-- Boost version: 1.67.0
-- Boost version: 1.67.0
-- Found the following Boost libraries:
--   program_options
CMake Error at source/frontends/qt/CMakeLists.txt:11 (add_subdirectory):
The source directory
/home/stefan/Projects/AppleWin/source/frontends/qt/QHexView
does not contain a CMakeLists.txt file.

QHexView appears to be a an empty directory...

If I disable that directory from CMakeList.txt, I end up here:

[ 67%] Building CXX object source/CMakeFiles/appleii.dir/Z80VICE/z80.cpp.o
[ 68%] Building CXX object source/CMakeFiles/appleii.dir/Z80VICE/z80mem.cpp.o
[ 70%] Building CXX object source/CMakeFiles/appleii.dir/Z80VICE/daa.cpp.o
[ 71%] Linking CXX shared library libappleii.so
[ 71%] Built target appleii
Scanning dependencies of target common2
[ 72%] Building CXX object source/frontends/common2/CMakeFiles/common2.dir/commonframe.cpp.o
/home/stefan/Projects/AppleWin/source/frontends/common2/commonframe.cpp: In function ‘std::__cxx11::string {anonymous}::getResourcePath()’:
/home/stefan/Projects/AppleWin/source/frontends/common2/commonframe.cpp:41:51: error: ‘ROOT_PATH’ was not declared in this scope
paths.emplace_back(std::string(path) + '/'+ ROOT_PATH);
^~~~~~~~~
/home/stefan/Projects/AppleWin/source/frontends/common2/commonframe.cpp:41:51: note: suggested alternative: ‘O_PATH’
paths.emplace_back(std::string(path) + '/'+ ROOT_PATH);
^~~~~~~~~
O_PATH
make[2]: *** [source/frontends/common2/CMakeFiles/common2.dir/build.make:63: source/frontends/common2/CMakeFiles/common2.dir/commonframe.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:146: source/frontends/common2/CMakeFiles/common2.dir/all] Error 2
make: *** [Makefile:152: all] Error 2

Help ! :-)

Request that audio latency is set to 0ms on Linux platforms

I notice that qapple and sa2 have 200ms default audio latency values, which makes playing games not very satisfying. I've been watching this project for awhile and it was only recently that I tried changing the audio latency to 0 in qapple and have finally found that to work for me.

On the other hand, it's not obvious from the command line args to sa2 how to change the latency to 0ms.

Could both of these be set to 0 by default, at least on Linux platforms?

README.md issues

When I open the Audetto/AppleWin homepage on GitHub i get this one:
right

But when i click in README.md i get this one (Windows AppleWin README instead of Audetto):
wrong

The same "change" occurs with git clone and by clicking green button > download zip. But everythings works and compiles well.

libretro: compilation on Windows

It was mentioned here that the libretro code does not compile on Windows with MSYS2

#44 (comment)

I am allergic to Windows, but in small doses I could do something.
Is there any interest out there?

I could try to make it compile using Visual Studio 2019 (same compiler used by AW).
Any interest?

Ctrl+C missing in Qapple

I can't use Ctrl+C in Qapple on Linux to exit the monitor or running BASIC code. Is this a bug or is there a different keybind I'm supposed to use?

Refactoring to accommodate macOS-style app bundling

A macOS app is a bundle (specific directory structure) that defines where things like resources are placed, and this is proving tricky to override due to the "Unix" view of the filesystem in the commonframe and sdlframe code.

Some specific suggestions:

  • getResourcePath() should be pushed down from commonframe, with a new API that just lets a subclass magically provide a file path to any specified resource. In macOS, I actually can't easily give you a path where a subdirectory called resource exists, and if I don't then getResourcePath() throws an exception. (I may also just be too rusty with C++ but I don't think it's possible to override getResourcePath() in its current form?)
  • SDLFrame::GetBitmap() should call an API to get a file path back instead of composing its own. Something along these lines:
diff --git a/source/frontends/sdl/sdlframe.cpp b/source/frontends/sdl/sdlframe.cpp
index 8d4974bb..57d2f7d4 100644
--- a/source/frontends/sdl/sdlframe.cpp
+++ b/source/frontends/sdl/sdlframe.cpp
@@ -197,10 +197,15 @@ namespace sa2
     return myWindow;
   }
 
-  void SDLFrame::GetBitmap(LPCSTR lpBitmapName, LONG cb, LPVOID lpvBits)
+  const std::string SDLFrame::GetBitmapFilename(LPCSTR lpBitmapName)
   {
     const std::string filename = getBitmapFilename(lpBitmapName);
-    const std::string path = myResourcePath + filename;
+    return myResourcePath + filename;
+  }
+
+  void SDLFrame::GetBitmap(LPCSTR lpBitmapName, LONG cb, LPVOID lpvBits)
+  {
+    const std::string path = GetBitmapFilename(lpBitmapName);
 
     std::shared_ptr<SDL_Surface> surface(SDL_LoadBMP(path.c_str()), SDL_FreeSurface);
     if (surface)
diff --git a/source/frontends/sdl/sdlframe.h b/source/frontends/sdl/sdlframe.h
index e6304ea3..951a51c5 100644
--- a/source/frontends/sdl/sdlframe.h
+++ b/source/frontends/sdl/sdlframe.h
@@ -24,6 +24,7 @@ namespace sa2
 
     void FrameRefreshStatus(int drawflags) override;
     int FrameMessageBox(LPCSTR lpText, LPCSTR lpCaption, UINT uType) override;
+    virtual const std::string GetBitmapFilename(LPCSTR lpBitmapName);
     void GetBitmap(LPCSTR lpBitmapName, LONG cb, LPVOID lpvBits) override;
 
     void ProcessEvents(bool &quit);

It's not a big deal, but I was just trying to minimize the #ifdefs.

Thoughts? :)

libretro: how to handle keyboard

Currently the core handles all keyboard events it receives.

There is a problem with this, that by default all keys are first handled by RetroArch, so they are likely to trigger all sort of key bindings.

One should first enable "Game Focus" to ensure the keys only go to the core.

Ideally, the core should ignore key events unless "Game Focus" is enabled, but I dont know how to detect it.
Suggestion?

Segfault running sa2 / applen on Ubuntu 22.04 LTS

Hey guys! Was trying to compile and test this port of AppleWin (I'm 100% on linux and would love to have a version of AppleWin running natively on Linux). I was able to compile the SDL2 version and NCurses (I didn't test the QT since I'm trying to avoid installing QT). Both versions compiled fine after installing several dependencies. Unfortunately as soon as I start either version it segfaults. Here's the stack trace of both frontends. Let me know what other information you might need to point me a little to what can be the problem.

NCurses:

$ gdb ./applen 
GNU gdb (Ubuntu 12.0.90-0ubuntu1) 12.0.90
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./applen...
(No debugging symbols found in ./applen)
(gdb) r
Starting program: /home/miquel/Develop/AppleII/AppleWin-audetto-linux/build/applen 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[DSInit] PC=00000000, WC=00000000, Diff=00000000

Program received signal SIGSEGV, Segmentation fault.
0x00005555555ef267 in ClearOverscanVideoArea() ()
(gdb) bt
#0  0x00005555555ef267 in ClearOverscanVideoArea() ()
#1  0x00005555555f2604 in NTSC_SetVideoStyle() ()
#2  0x00005555555fb0de in Video::VideoReinitialize(bool) ()
#3  0x00005555555f277d in NTSC_VideoInit(unsigned char*) ()
#4  0x00005555555fcdc2 in Video::Initialize(unsigned char*, bool) ()
#5  0x0000555555607f63 in LinuxFrame::Initialize(bool) ()
#6  0x0000555555572040 in na2::NFrame::Initialize(bool) ()
#7  0x00005555556080fd in LinuxFrame::Begin() ()
#8  0x000055555556d330 in (anonymous namespace)::run_ncurses(int, char const**) ()
#9  0x000055555556d67c in main ()

ldd output:

$ ldd applen 
        linux-vdso.so.1 (0x00007ffe2c8e3000)
        libncurses.so.6 => /lib/x86_64-linux-gnu/libncurses.so.6 (0x00007f23e4b2b000)
        libtinfo.so.6 => /lib/x86_64-linux-gnu/libtinfo.so.6 (0x00007f23e4af9000)
        libevdev.so.2 => /lib/x86_64-linux-gnu/libevdev.so.2 (0x00007f23e4adc000)
        libyaml-0.so.2 => /lib/x86_64-linux-gnu/libyaml-0.so.2 (0x00007f23e4abb000)
        libminizip.so.1 => /lib/x86_64-linux-gnu/libminizip.so.1 (0x00007f23e4800000)
        libpcap.so.0.8 => /lib/x86_64-linux-gnu/libpcap.so.0.8 (0x00007f23e4a6c000)
        libslirp.so.0 => /lib/x86_64-linux-gnu/libslirp.so.0 (0x00007f23e4a4b000)
        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f23e4a2f000)
        libboost_program_options.so.1.74.0 => /lib/x86_64-linux-gnu/libboost_program_options.so.1.74.0 (0x00007f23e47bb000)
        libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f23e458f000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f23e44a8000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f23e4a0d000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f23e4280000)
        libdbus-1.so.3 => /lib/x86_64-linux-gnu/libdbus-1.so.3 (0x00007f23e4232000)
        libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f23e40f8000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f23e4f40000)
        libsystemd.so.0 => /lib/x86_64-linux-gnu/libsystemd.so.0 (0x00007f23e4031000)
        libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f23e3fbb000)
        liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f23e3f90000)
        libzstd.so.1 => /lib/x86_64-linux-gnu/libzstd.so.1 (0x00007f23e3ec1000)
        liblz4.so.1 => /lib/x86_64-linux-gnu/liblz4.so.1 (0x00007f23e3ea1000)
        libcap.so.2 => /lib/x86_64-linux-gnu/libcap.so.2 (0x00007f23e3e96000)
        libgcrypt.so.20 => /lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007f23e3d58000)
        libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007f23e3d30000)

SDL

$ gdb ./sa2                                                                                                                                             
GNU gdb (Ubuntu 12.0.90-0ubuntu1) 12.0.90                                                                                                                                                                          
Copyright (C) 2022 Free Software Foundation, Inc.                                                                                                                                                                  
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>                                                                                                                                      
This is free software: you are free to change and redistribute it.                                                                                                                                                 
There is NO WARRANTY, to the extent permitted by law.                                                                                                                                                              
Type "show copying" and "show warranty" for details.                                                                                                                                                               
This GDB was configured as "x86_64-linux-gnu".                                                                                                                                                                     
Type "show configuration" for configuration details. 
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./sa2...
(No debugging symbols found in ./sa2)
(gdb) r
Starting program: /home/miquel/Develop/AppleII/AppleWin-audetto-linux/build/sa2 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff667f640 (LWP 2539429)]
[New Thread 0x7fffeb7c7640 (LWP 2539431)]
[New Thread 0x7fffeafc6640 (LWP 2539432)]
[New Thread 0x7fffea7c5640 (LWP 2539433)]
[New Thread 0x7fffe9fc4640 (LWP 2539434)]
[New Thread 0x7fffe97c3640 (LWP 2539435)]
[New Thread 0x7fffe8fc2640 (LWP 2539436)]
[New Thread 0x7fffd3fff640 (LWP 2539437)]
[New Thread 0x7fffd37fe640 (LWP 2539438)]
[Thread 0x7fffd37fe640 (LWP 2539438) exited]
[New Thread 0x7fffd37fe640 (LWP 2539439)]
[Thread 0x7fffd37fe640 (LWP 2539439) exited]
[New Thread 0x7fffe854a640 (LWP 2539441)]
[New Thread 0x7fffd37fe640 (LWP 2539442)]
[Thread 0x7fffd37fe640 (LWP 2539442) exited]
[New Thread 0x7fffd37fe640 (LWP 2539443)]
IMGUI_VERSION: 1.88 WIP
GL_VENDOR: Intel
GL_RENDERER: Mesa Intel(R) Xe Graphics (TGL GT2)
GL_VERSION: OpenGL ES 3.2 Mesa 22.0.1
GL_SHADING_LANGUAGE_VERSION: OpenGL ES GLSL ES 3.20
Default GL swap interval: -1
[DSInit] PC=00000000, WC=00000000, Diff=00000000

Thread 1 "sa2" received signal SIGSEGV, Segmentation fault.
0x0000555555730c15 in ClearOverscanVideoArea() ()
(gdb) bt
#0  0x0000555555730c15 in ClearOverscanVideoArea() ()
#1  0x0000555555733fb2 in NTSC_SetVideoStyle() ()
#2  0x000055555573c610 in Video::VideoReinitialize(bool) ()
#3  0x000055555573412b in NTSC_VideoInit(unsigned char*) ()
#4  0x000055555573e2f4 in Video::Initialize(unsigned char*, bool) ()
#5  0x0000555555749537 in LinuxFrame::Initialize(bool) ()
#6  0x0000555555585903 in sa2::SDLImGuiFrame::Initialize(bool) ()
#7  0x00005555557496d1 in LinuxFrame::Begin() ()
#8  0x000055555557da70 in sa2::SDLFrame::Begin() ()
#9  0x0000555555573089 in run_sdl(int, char const**) ()
#10 0x0000555555573acf in main ()
(gdb)

ldd output

$ ldd sa2                                                                                                                                               
        linux-vdso.so.1 (0x00007ffca99cd000)                                                                                                                                                                       
        libSDL2-2.0.so.0 => /lib/x86_64-linux-gnu/libSDL2-2.0.so.0 (0x00007f6fe35f6000)                                                                                                                            
        libSDL2_image-2.0.so.0 => /lib/x86_64-linux-gnu/libSDL2_image-2.0.so.0 (0x00007f6fe35d3000)                                                                                                                
        libGLESv2.so.2 => /lib/x86_64-linux-gnu/libGLESv2.so.2 (0x00007f6fe35c0000)                                                                                                                                
        libyaml-0.so.2 => /lib/x86_64-linux-gnu/libyaml-0.so.2 (0x00007f6fe359f000)                                                                                                                                
        libminizip.so.1 => /lib/x86_64-linux-gnu/libminizip.so.1 (0x00007f6fe3200000)                                                                                                                              
        libpcap.so.0.8 => /lib/x86_64-linux-gnu/libpcap.so.0.8 (0x00007f6fe3550000)                                                                                                                                
        libslirp.so.0 => /lib/x86_64-linux-gnu/libslirp.so.0 (0x00007f6fe352f000)                                                                                                                                  
        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f6fe3513000)                                                                                                                                          
        libboost_program_options.so.1.74.0 => /lib/x86_64-linux-gnu/libboost_program_options.so.1.74.0 (0x00007f6fe34ce000)                                                                                        
        libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f6fe2fd4000)                                                                                                                                
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f6fe2eed000)                                                                                                                                          
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f6fe34ac000)                                                                                                                                  
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f6fe2cc5000)                                                                                                                                          
        libasound.so.2 => /lib/x86_64-linux-gnu/libasound.so.2 (0x00007f6fe2bc2000)                                                                                                                                
        libpulse.so.0 => /lib/x86_64-linux-gnu/libpulse.so.0 (0x00007f6fe3457000)                                                                                                                                  
        libX11.so.6 => /lib/x86_64-linux-gnu/libX11.so.6 (0x00007f6fe2a82000)                                                                                                                                      
        libXext.so.6 => /lib/x86_64-linux-gnu/libXext.so.6 (0x00007f6fe3442000)                                                                                                                                    
        libXcursor.so.1 => /lib/x86_64-linux-gnu/libXcursor.so.1 (0x00007f6fe3434000)                                                                                                                              
        libXinerama.so.1 => /lib/x86_64-linux-gnu/libXinerama.so.1 (0x00007f6fe342f000)                                                                                                                            
        libXi.so.6 => /lib/x86_64-linux-gnu/libXi.so.6 (0x00007f6fe341b000)                                                                                                                                        
        libXfixes.so.3 => /lib/x86_64-linux-gnu/libXfixes.so.3 (0x00007f6fe3413000)                                                                                                                                
        libXrandr.so.2 => /lib/x86_64-linux-gnu/libXrandr.so.2 (0x00007f6fe2a75000)                                                                                                                                
        libXss.so.1 => /lib/x86_64-linux-gnu/libXss.so.1 (0x00007f6fe340e000)                                                                                                                                      
        libXxf86vm.so.1 => /lib/x86_64-linux-gnu/libXxf86vm.so.1 (0x00007f6fe2a6e000)                                                                                                                              
        libdrm.so.2 => /lib/x86_64-linux-gnu/libdrm.so.2 (0x00007f6fe2a58000)                                                                                                                                      
        libgbm.so.1 => /lib/x86_64-linux-gnu/libgbm.so.1 (0x00007f6fe2a47000)                                                                                                                                      
        libwayland-egl.so.1 => /lib/x86_64-linux-gnu/libwayland-egl.so.1 (0x00007f6fe2a42000)                                                                                                                      
        libwayland-client.so.0 => /lib/x86_64-linux-gnu/libwayland-client.so.0 (0x00007f6fe2a32000)                                                                                                                
        libwayland-cursor.so.0 => /lib/x86_64-linux-gnu/libwayland-cursor.so.0 (0x00007f6fe2a28000)                                                                                                                
        libxkbcommon.so.0 => /lib/x86_64-linux-gnu/libxkbcommon.so.0 (0x00007f6fe29df000)                                                                                                                          
        libdecor-0.so.0 => /lib/x86_64-linux-gnu/libdecor-0.so.0 (0x00007f6fe29d5000)                                                                                                                              
        libpng16.so.16 => /lib/x86_64-linux-gnu/libpng16.so.16 (0x00007f6fe299a000)                                                                                                                                
        libjpeg.so.8 => /lib/x86_64-linux-gnu/libjpeg.so.8 (0x00007f6fe2919000)                                                                                                                                    
        libtiff.so.5 => /lib/x86_64-linux-gnu/libtiff.so.5 (0x00007f6fe2893000)                                                                                                                                    
        libwebp.so.7 => /lib/x86_64-linux-gnu/libwebp.so.7 (0x00007f6fe2827000)                                                                                                                                    
        libGLdispatch.so.0 => /lib/x86_64-linux-gnu/libGLdispatch.so.0 (0x00007f6fe276d000)                                                                                                                        
        libdbus-1.so.3 => /lib/x86_64-linux-gnu/libdbus-1.so.3 (0x00007f6fe271f000)                                                                                                                                
        libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f6fe25e5000)                                                                                                                            
        /lib64/ld-linux-x86-64.so.2 (0x00007f6fe3cbd000)                                                                                                                                                           
        libpulsecommon-15.99.so => /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-15.99.so (0x00007f6fe2560000)                                                                                               
        libxcb.so.1 => /lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f6fe2536000)                                                                                                                                      
        libXrender.so.1 => /lib/x86_64-linux-gnu/libXrender.so.1 (0x00007f6fe2527000)                                                                                                                              
        libwayland-server.so.0 => /lib/x86_64-linux-gnu/libwayland-server.so.0 (0x00007f6fe2511000)                                                                                                                
        libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f6fe24e0000)                                                                                                                                  
        libffi.so.8 => /lib/x86_64-linux-gnu/libffi.so.8 (0x00007f6fe24d3000)                                                                                                                                      
        libzstd.so.1 => /lib/x86_64-linux-gnu/libzstd.so.1 (0x00007f6fe2404000)
        liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f6fe23d7000)
        libjbig.so.0 => /lib/x86_64-linux-gnu/libjbig.so.0 (0x00007f6fe23c6000)
        libdeflate.so.0 => /lib/x86_64-linux-gnu/libdeflate.so.0 (0x00007f6fe23a2000)
        libsystemd.so.0 => /lib/x86_64-linux-gnu/libsystemd.so.0 (0x00007f6fe22db000)
        libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f6fe2265000)
        libsndfile.so.1 => /lib/x86_64-linux-gnu/libsndfile.so.1 (0x00007f6fe21e4000)
        libX11-xcb.so.1 => /lib/x86_64-linux-gnu/libX11-xcb.so.1 (0x00007f6fe21df000)
        libasyncns.so.0 => /lib/x86_64-linux-gnu/libasyncns.so.0 (0x00007f6fe21d7000)
        libapparmor.so.1 => /lib/x86_64-linux-gnu/libapparmor.so.1 (0x00007f6fe21c2000)
        libXau.so.6 => /lib/x86_64-linux-gnu/libXau.so.6 (0x00007f6fe21bc000)
        libXdmcp.so.6 => /lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f6fe21b4000)
        liblz4.so.1 => /lib/x86_64-linux-gnu/liblz4.so.1 (0x00007f6fe2192000)
        libcap.so.2 => /lib/x86_64-linux-gnu/libcap.so.2 (0x00007f6fe2187000)
        libgcrypt.so.20 => /lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007f6fe2049000)
        libFLAC.so.8 => /lib/x86_64-linux-gnu/libFLAC.so.8 (0x00007f6fe200d000)
        libvorbis.so.0 => /lib/x86_64-linux-gnu/libvorbis.so.0 (0x00007f6fe1fe0000)
        libvorbisenc.so.2 => /lib/x86_64-linux-gnu/libvorbisenc.so.2 (0x00007f6fe1f33000)
        libopus.so.0 => /lib/x86_64-linux-gnu/libopus.so.0 (0x00007f6fe1ed5000)
        libogg.so.0 => /lib/x86_64-linux-gnu/libogg.so.0 (0x00007f6fe1eca000)
        libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0 (0x00007f6fe1eb2000)
        libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007f6fe1e8c000)
        libmd.so.0 => /lib/x86_64-linux-gnu/libmd.so.0 (0x00007f6fe1e7d000)

Doesnt compile on latest ubuntu linux

CMake Error at /usr/share/cmake-3.22/Modules/FindPkgConfig.cmake:890 (message):
None of the required 'minizip' found
Call Stack (most recent call first):
source/CMakeLists.txt:6 (pkg_search_module)

dpkg -L minizip
/.
/usr
/usr/bin
/usr/bin/miniunzip
/usr/bin/minizip
/usr/share
/usr/share/doc
/usr/share/doc/minizip
/usr/share/doc/minizip/copyright
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/miniunzip.1.gz
/usr/share/man/man1/minizip.1.gz
/usr/share/doc/minizip/changelog.Debian.gz

Slirp Port Forwarding

Got a request to enable port forwarding when using libslirp.

I think I will add a command line option like: --nat 2222,22 to forward port 2222 of the host to 22 of the guest (i.e. Apple ][).

There only design decision I need to take is what to do if there are multiple Uthernet cards connected.

  1. disable
  2. single slirp (but then I need to know the guest IP)
  3. (current) multiple slirp (but then I need to know the slot)

Probably 1.

Build Issue

Hellon

trying to build under Debian 10, have this issue:
`CMAKE_BUILD_TYPE:
CMAKE_CXX_FLAGS: -Wno-multichar -Werror=return-type
CMAKE_CXX_FLAGS_RELEASE: -O3 -DNDEBUG
CMAKE_CXX_FLAGS_DEBUG: -g
CMAKE_CXX_FLAGS_RELWITHDEBINFO: -O2 -g -DNDEBUG
-- Boost version: 1.67.0
-- Boost version: 1.67.0
-- Found the following Boost libraries:
-- program_options
CMake Error at source/frontends/qapple/CMakeLists.txt:7 (add_subdirectory):
The source directory

/home/jvernet/Devel/AppleWin/source/frontends/qapple/QHexView

does not contain a CMakeLists.txt file.

-- Configuring incomplete, errors occurred!
See also "/home/jvernet/Devel/AppleWin/build/CMakeFiles/CMakeOutput.log".
`

Any help ?

[sa2] Initialisation / finalisation config file issues

Initialisation and finalisation have some issues.

  • applewin.conf is not created if it does not exist
  • information about this is not logged properly
  • LogFileTimeUntilFirstKeyReadReset not called properly
  • plus some more non uniform behaviour between applen, libretro and sa2

MacOsX Build

Hello,

I'm trying to build on MacOsX (10.13). cmake ask for libevdev and libglesv2. None of them seems to exist on MacOsX.

Are they totally mandatory ?

sa2: very slow on RPi4/Ubuntu22.04

Hi! I'm a big fan of AppleWin and glad to find this repo to play on Linux :)

I've tried to run this in Ubuntu 22.04 + Raspberry Pi 4 + SDL2.
Speed is extremely slow and first thought was it isn't working as expected.
I've tried with Qt and seemed working OK.

When I left the emulator running, DOS booted and prompt appeared.
So it's about the speed... but why?

This is the log when after several seconds.

IMGUI_VERSION: 1.89 WIP
GL_VENDOR: Broadcom
GL_RENDERER: V3D 4.2
GL_VERSION: OpenGL ES 3.1 Mesa 22.0.5
GL_SHADING_LANGUAGE_VERSION: OpenGL ES GLSL ES 3.10
Default GL swap interval: -1
[DSInit] PC=00000000, WC=00000000, Diff=00000000
Video refresh rate: 0 Hz, inf ms
Global:  total =    8583.48 ms, mean =    8583.48 ms, std =       0.00 ms, n =      1
Frame:   total =    8487.09 ms, mean =       0.06 ms, std =       0.49 ms, n = 154125
Screen:  total =    2321.12 ms, mean =       0.02 ms, std =       0.37 ms, n = 154125
Events:  total =    5797.36 ms, mean =       0.04 ms, std =       0.16 ms, n = 154125
CPU:     total =     237.41 ms, mean =       0.00 ms, std =       0.04 ms, n = 154125
Expected clock: 1020484.45 Hz, 0.70 s
Actual clock:   83466.89 Hz, 8.58 s

Some adaptions for Linux/Raspberry Pi OS

Hi there.
Thanks for the Linux adaptions and esp. for the libretro core.

The LR core works fine on the current RetroPie (based on Buster) with some adaptions, see full story there: https://retropie.org.uk/forum/post/284130

TL;DR:

  1. Workaround: static linking for stdc++ filesystem with GCC before v9 (C++17 Standard is supported but stdc++fs is marked experimental in GCC8):
diff --git a/source/frontends/libretro/CMakeLists.txt b/source/frontends/libretro/CMakeLists.txt
index 77c48a9f..3c1cce76 100644
--- a/source/frontends/libretro/CMakeLists.txt
+++ b/source/frontends/libretro/CMakeLists.txt
@@ -41,7 +41,12 @@ target_include_directories(applewin_libretro PRIVATE
   libretro-common/include
   )
 
+set(is_gnu "$<CXX_COMPILER_ID:GNU>")
+set(before_v9 "$<VERSION_LESS:$<CXX_COMPILER_VERSION>,9>")
+set(static_stdcpp_fs "$<AND:${is_gnu},${before_v9}>")
+
 target_link_libraries(applewin_libretro PRIVATE
+  $<${static_stdcpp_fs}:stdc++fs>
   appleii
   common2
   windows
  1. Minor: Update to raspbian.list.txt
diff --git a/source/linux/raspbian.list.txt b/source/linux/raspbian.list.txt
index 6feacc72..a40d8296 100644
--- a/source/linux/raspbian.list.txt
+++ b/source/linux/raspbian.list.txt
@@ -13,3 +13,5 @@ libsdl2-dev
 libgles-dev
 libpcap-dev
 libslirp-dev
+libminizip-dev
+libyaml-dev

Maybe you can apply it in the mainline?

Libretto core progress (mockingbird)

Are there plans to push ahead with mockingboard support in the libretto core? I would love to be able to have a front end for AppleWin on linux that lets users easily select games and provides some information about the game (screen shot/etc). I know about Total Replay but would love to be able to have it be so easy with other games (or at least easier than having to use the finder.)

Video_MakeScreenshot() leaves current file position at the end of the header upon exit

A recent change to Video_MakeScreenshot() tries to back-patch the file size in the header, which has the side effect of leaving the file's current position just past the header when it returns.

This appears to work fine for a real file, but my FILE * actually comes from a open_memstream() so that I can convert the BMP to PNG before saving. In this case, the "file" was truncated at the current position. This might be a bug in open_memstream() but it's easily worked around by seeking to the end of the file afterwards:

diff --git a/source/Video.cpp b/source/Video.cpp
index a75300f5..024fc967 100644
--- a/source/Video.cpp
+++ b/source/Video.cpp
@@ -585,6 +585,7 @@ void Video::Video_MakeScreenShot(FILE *pFile, const VideoScreenShot_e ScreenShot
        pBmp->nSizeFile = ftell(pFile);
        rewind(pFile);
        fwrite( pBmp, sizeof( WinBmpHeader_t ), 1, pFile );
+    fseek(pFile, 0, SEEK_END);
 }
 
 //===========================================================================

I could also do this very easily on my side before I fclose() but it seems slightly cleaner to have Video_MakeScreenshot() leave the file position at the end of the file. Let me know if you want to take this change, thanks!

[sa2] Crash right after dropping a prodos disk image on the dialog box.

Hello.

I noticed a really recent regression. When I drop a prodos disk image on the disk dialog box, instead of loading, I get a crash. It is disk image for the Apple II port of "Attack of the Petscii Robots".

My last working revision was: 1ac7710

Could it be related to this commit? 283a74d

Attaching the infos I got from a coredump analysis.

First stack:

Stack trace of thread 53521:
                #0  0x00007f1a50edc6e9 _ZN18Disk2InterfaceCard10InsertDiskEiPKcbb (libappleii.so + 0x786e9)
                #1  0x00005588639323ad n/a (sa2 + 0x1d3ad)
                #2  0x0000558863931708 n/a (sa2 + 0x1c708)
                #3  0x00005588639318fb n/a (sa2 + 0x1c8fb)
                #4  0x000055886392cd39 n/a (sa2 + 0x17d39)
                #5  0x000055886392affa n/a (sa2 + 0x15ffa)
                #6  0x00007f1a508d9b25 __libc_start_main (libc.so.6 + 0x27b25)
                #7  0x000055886392c1ce n/a (sa2 + 0x171ce)

coredump.txt

[Bug] Tab Broken

Pressing tab will stop input from working until you click inside the emulator subwindow until you click inside the subwindow again. It appears to switch control over to scrolling the main window with the arrow keys.

Full Screen with correct aspect ratio?

Is there a way to run AppleWin in bullseye/xfce that will run it full screen (not windowed) but maintain the correct aspect ratio (i.e. just put black bars on the unused portion of the screen for a 1366x768 screen rather than stretch the AppleWin image to fill the screen?

open-apple key doesn't seem to work

(Don't have a Raspberry Pi, this was observed in macOS)

sa2 UI:

  1. Boot into the ProDOS system disk, with the tabbed card menu
  2. At the bottom of the screen it says "(open-apple)? for Help".
  3. Press the Option key and "?" (or "/" without also holding down Shift), nothing happens.

Probably not related, but looking at the code I don't see a SetButtonReleased() call for Paddle::ourOpenApple or Paddle::ourSolidApple.

Libretro compilation

From gouchi:

Sorry to bother you. I was wondering how to compile AppleWin libretro
core but without success.

I tried to follow :
https://github.com/audetto/AppleWin/blob/master/linux.md#ra2

But the documentation should be

cmake -DLIBRETRO_COMMON_PATH=/path/to/libretro-common

not

cmake -DLIBRETRO_PATH=/path/to/libretro-common

According to :
https://github.com/audetto/AppleWin/blob/master/source/frontends/libretro/CMakeLists.txt#L3

But when I tried I got this issue :

cmake -DLIBRETRO_COMMON_PATH=/tmp/libretro-common ..
CMAKE_BUILD_TYPE:
CMAKE_CXX_FLAGS:
CMAKE_CXX_FLAGS_RELEASE: -O3 -DNDEBUG
CMAKE_CXX_FLAGS_DEBUG: -g
CMAKE_CXX_FLAGS_RELWITHDEBINFO: -O2 -g -DNDEBUG
-- Found Boost: /usr/lib64/cmake/Boost-1.76.0/BoostConfig.cmake (found
version "1.76.0")
-- Found Boost: /usr/lib64/cmake/Boost-1.76.0/BoostConfig.cmake (found
version "1.76.0") found components: program_options
CMake Error at /usr/lib64/cmake/Qt5/Qt5Config.cmake:28 (find_package):
Could not find a package configuration file provided by "Qt5Gamepad" with
any of the following names:

Qt5GamepadConfig.cmake
qt5gamepad-config.cmake

Add the installation prefix of "Qt5Gamepad" to CMAKE_PREFIX_PATH or set
"Qt5Gamepad_DIR" to a directory containing one of the above files. If
"Qt5Gamepad" provides a separate development package or SDK, be sure it has
been installed.
Call Stack (most recent call first):
source/frontends/qt/CMakeLists.txt:7 (find_package)

Why Libretro core needs QT5 ?

Thank you for your help.

Kind regards,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.