Category Archives: Windows

Windows version (and screen mode control)

As mentioned in the earlier posts, a large amount of this Christmas vacation was spent on the Windows version of M.A.C.E. runtime, and creating something for Windows users to try out. Now all the core work has been done, and we have the first prototype of the Windows port of runtime – with all of the existing test applications now available also as Windows executables. Now, there are a couple important points:

  • The windows executables are currently built only for the 64-bit x64 architecture
  • They have only been tested on Windows 10 (and only on Toni’s brand new 3.06Ghz Xeon W3550, and whatever processor Pukka’s new PC has). We have no idea on what other computers they work (or do not work)
  • You might want to avoid running them under certain virtualization software applications, as at least on Toni’s VirtualBox the performance was… not very stellar, at least compared to a physical PC without virtualization.
  • The PC keys are (for now) mapped permanently as follows:
    • Left alt = Left command
    • Left ctrl = Left option
    • Right alt = Right command
    • Right ctrl = Left control
  • Under windows 10, the “windows square” key (between Ctrl and Alt) cannot be used by the emulator as command or option key, because the Windows OS doesn’t seem to allow it to be fully captured (only partially).
  • AltGr key does NOT work as Right alt, because on Windows AltGr actually simulates Left Ctrl + Left Alt key presses. We need to investigate this more in the future.
  • The filesystem package is cached under Users -> username -> AppData -> Roaming -> MACE, with individual cache folder for each pre-packaged test application. So, if you for example create cool Continuum Galaxy files, this is where you’ll find them. And as AppleDouble files, they are exchangeable between M.A.C.E. on Windows, M.A.C.E. on Mac OS X, and theoretically (but not tested) with the Executor emulator which also uses AppleDouble files.

Below is a screenshot of the currently available test apps running on Windows 10:

If you have Windows, you can right now try them out in the Downloads section on this page.

Screen mode control: Full-screen mode and pixel doubling

Another neat new feature that was added to the new M.A.C.E. runtime version, besides the Windows compatibility, is the ability to switch between windowed/fullscreen modes on the fly, and also toggling the pixel-doubling feature. The shortcuts for these are:

  • Cmd+Shift+1: Toggle pixel doubling mode
  • Cmd+Shift+2: Switch between windowed and full-screen modes

These keyboard shortcuts were chosen (for now) as they should conflict very little with existing Mac applications, as they were used as disk eject FKEYs on real Macs.

This new feature has been both updated into the existing Mac OS X test app bundles, as well as in the new Windows versions.

Full list of changes since last post

2020-01-07 00:39:56 +0200 • Skip unwanted packaged VFS entries
2020-01-06 23:40:32 +0200 • Don't cache OSX 10.6 vs 10.9 target in CMake
2020-01-06 20:32:52 +0200 • Fix typo in scaline range check in _StretchBits
2020-01-06 19:10:24 +0200 • Bump runtime version & tweak version info format
2020-01-06 07:08:39 +0200 • Load package VFS from Win32 resource on Windows
2020-01-06 07:07:18 +0200 • Include dynamically generated .rc in win32 targets
2020-01-06 07:06:34 +0200 • Fix encoding of special symbols in two test apps
2020-01-06 06:05:01 +0200 • Add extracting VFS archive in initialization code
2020-01-05 04:30:25 +0200 • Add file archive reader, and clean up CMake files
2020-01-04 23:20:46 +0200 • Sign-extend <32bit args to prevent ARM optimizat..
2020-01-04 04:18:12 +0200 • Try fix Raspberry hMenu bug, enforce 16-bit menuID
2020-01-03 22:22:10 +0200 • Lock SDL window data during screen mode switch
2020-01-03 21:52:42 +0200 • Refactor display toggles to use DynamicConfig keys
2020-01-03 21:50:30 +0200 • Add first part of DynamicConfig system (UserPrefs)
2020-01-01 17:54:41 +0000 • Disable JSON parser tests from build
2020-01-03 01:20:14 +0200 • Fix DynamicConfiguration JSON dependency + bin dir
2020-01-03 00:39:24 +0200 • Merge branch 'master' of 
2020-01-03 00:39:21 +0200 • Add missing header search path for JSON lib
2020-01-03 00:36:54 +0200 • Fix OSX target, CMP0066 and set SDL2 debug/release
2020-01-02 23:08:12 +0200 • Merge branch 'master' of 
2020-01-02 23:08:06 +0200 • Specialize OSX Cmake config to 10.6 and 10.9 bases
2020-01-02 20:36:10 +0200 • Add JSON parser to the MACE runtime (for configs)
2020-01-02 19:09:33 +0200 • Also fix the Mac icns for previously invalid icons
2020-01-02 18:51:14 +0200 • Add stub for DynamicConfiguration module
2020-01-02 18:50:30 +0200 • Sanitize Windows key mappings to be more usable
2020-01-02 04:13:26 +0200 • Add ICO files to EXEs, & use console only in debug
2020-01-02 04:11:18 +0200 • Use debug/release SDL2 lib depending on app target
2020-01-02 04:09:56 +0200 • Reconvert Windows ICO files
2020-01-02 04:09:39 +0200 • Fix incorrect icon assignments of couple test apps
2020-01-02 04:08:20 +0200 • Make SDL2-static compile on VC release mode
2020-01-02 00:51:30 +0200 • Add processing of Windows ICO files
2020-01-01 23:49:58 +0200 • Fix trap glue generator to use new byteswap macros
2020-01-01 23:48:56 +0200 • Refactor cmake to use offline icon conversion
2020-01-01 20:39:58 +0200 • Add lpng 1.6.37 to ThirdParty external libraries
2020-01-01 17:10:36 +0200 • Force redraw of screen on SDL expose events
2020-01-01 15:38:09 +0000 • Haiku compilation fixes

Happy New Year!

This is just a quick status update to celebrate the new year 2020. As teased in the Christmas update one week ago, there has been some progress on the cross-platform ports of M.A.C.E., and this update is just to give a brief glimpse of the state of Windows and Raspberry ports (with a new year celebration theme):

Platform port status: Raspberry PI

Thanks to the hard to work and big efforts done by Pukka on the Raspberry PI port this year, we finally got it to the stage where Toni was able to integrate the platform into CMake build system, and create working builds for the test applications. Pukka found some performance issues in the SDL rendering, which motivated Toni to also get a Raspberry PI to help debug and identify the problem.

It was figured out, that the SDL2 graphics implementation we had previously used had serious issues, and was rewritten mostly to remove dependency on SDL surfaces, using instead SDL texture for the rendering. With this change, the performance on Raspberry improved to the point of matching the Mac (and Windows) platforms. Additionally, we took this opportunity to improve the fullscreen & pixel-double rendering code to the point that they are also almost ready for public testing.

However, for some reason sound does not yet work on the builds done by Toni on Raspbian 10, although they seem to work on Pukka’s Raspbian 8. This need some more investigation, alongside some other issues on the platform. The basic X11 view driver + software renderer driver combination seems to offer however a good solution for the time being.

Platform port status: Windows

The Windows port, which we teased one week ago in the Christmas update, has advanced quickly and will soon be ready for testing. It took in total one week (the Christmas vacation) for fixing the code for MSVC compiler compatibility (a couple thousands errors), and getting the builds to run. The changes we needed to make include:

  • Fixing problems with zero-size struct arrays
  • Lack of typeof(x) macro leading to need to refactor all byte-swapping and RSAlloc macros (and places where they were used)
  • A couple header changes (such as alloca being defined in different headers on POSIX vs. MSVC)
  • Adding some Windows API code for file system iteration and manipulation alongside of POSIX/Std C code
  • Fixing some bugs that were surfaced by the new port, but were affecting all platforms
  • Other minor changes (clock API, refactoring unistd references, tweaking CMake configs, etc…)

The remaining tasks for first Windows test release are still integration with Windows executable resources, and storage of the NativeFS data on windows builds.

What’s next?

The year 2020 should definitely bring us to the point of releasing a more generic way to run M.A.C.E., including additional platform support, and compatibility with much more applications. At the moment the focus is – beside adding the new platform support – on getting as many of the known issues in the current test applications fixed (which you can follow in our status page). But looking forward to the stage #2 of project, we also hope to start work on Sound Manager and Color QuickDraw implementation in the second half of 2020.

Full list of changes since last post

2020-01-01 02:31:53 +0200 • Fix order of debugger setup in environment headers
2020-01-01 02:18:32 +0200 • Set MemErr to noErr if GetHandleSize succeeds     
2020-01-01 02:17:18 +0200 • Add Finnish Apple Macintosh Basics as test app    
2019-12-31 22:49:19 +0200 • Fix byteswap sign bug in CalcMask/SeedFill        
2019-12-31 04:47:15 +0200 • Only grab input in fullscreen mode                
2019-12-31 04:12:39 +0200 • Merge branch 'master' of  
2019-12-31 04:12:34 +0200 • Fix GCC byteswap macros for raspberry pi          
2019-12-31 03:59:25 +0200 • Use left control as command key on windows        
2019-12-31 01:46:39 +0200 • Refactor SDLPlatform to use Textures, not Surfaces
2019-12-31 00:07:32 +0200 • Merge branch 'master' of  
2019-12-31 00:07:13 +0200 • Update CMake configs and MacTCP for raspberry pi  
2019-12-30 22:25:41 +0200 • Merge branch 'master' of  
2019-12-30 22:24:27 +0200 • Fix buffer overflow in StretchBits dstScanlineBuf 
2019-12-30 21:43:20 +0200 • Fix case-sensitive FS filename issue in CMake file
2019-12-30 02:07:02 +0200 • Fix+optimize pixel-double and fullscreen rendering
2019-12-29 22:41:31 +0200 • Merge branch 'master' of  
2019-12-29 22:41:21 +0200 • Fix Windows build audio issue (SDL buffer format) 
2019-12-29 22:39:38 +0200 • Fix crash: Add missing Open/OpenDeny error checks 
2019-12-29 03:57:01 +0200 • Fix debug strcat in AVLTree.c for Mac version     
2019-12-29 03:33:38 +0200 • Refactor byteswapping (& clean up lot of warnings)
2019-12-29 03:25:58 +0200 • Enable console mode for now in MSVC (for debug)   
2019-12-29 03:25:18 +0200 • Fix signature of argc argument in main method     
2019-12-28 23:36:15 +0200 • Fix bug in path separator conversion in MSVC build
2019-12-28 17:32:02 +0000 • Fix some sign bugs, 1000 miles now starts on Win32
2019-12-28 17:29:58 +0000 • Use MSVC built-in byteswap macros for byteswapping
2019-12-28 17:28:21 +0000 • Fix SDL main & set executable as a Windows GUI app
2019-12-28 15:25:55 +0200 • Fix malloc.h/alloca.h header includes for MacOS   
2019-12-28 15:02:36 +0200 • Merge branch 'master' of  
2019-12-28 15:02:31 +0200 • Clean up misc debug macros etc before win32 merge 
2019-12-28 02:22:10 +0000 • A MAJOR Windows and MSVC compatibility update     
2019-12-27 21:59:06 +0000 • Fix potential timestamp conversion shift overflow 
2019-12-27 21:56:14 +0000 • Fix byteswap bug in fractional pen location init  
2019-12-27 00:39:38 +0000 • Don't try to return value from void function      
2019-12-27 00:00:32 +0000 • Fix wrong data size in low-mem Rect setter macro  
2019-12-26 23:00:41 +0000 • Merge branch 'master' of  
2019-12-26 23:00:27 +0000 • Ignore MacOS-specific files in MSVC cmake targets 
2019-12-26 22:58:38 +0000 • MSVC compatible SDL clock (and rotate macros)     
2019-12-27 00:09:04 +0200 • Init PortList and ChunkyDepth                     
2019-12-26 21:18:10 +0200 • Improve InitApplZone, add some CQD low-mem globals
2019-12-26 21:09:34 +0200 • Add proper alpha to SDL RGB output (->pixeldouble)
2019-12-26 21:08:03 +0200 • Add temporary IODone stack hack for MacTCP driver 
2019-12-26 21:04:59 +0200 • Use new enum for killCode in Sound Driver         
2019-12-26 21:04:20 +0200 • Add more logging to .IPP driver