GeorgRottensteiner / C64Studio

C64Studio is a .NET based IDE specializing in game development for the C64 in assembler and BASIC
Other
245 stars 36 forks source link

Future support for aarm64 native application? #122

Closed tikikevin closed 2 weeks ago

tikikevin commented 1 month ago

Curious if you would consider providing a native Windows aarm64 build of this amazing product. Visual Studio should allow you to build it even on an x64 platform.

GeorgRottensteiner commented 1 month ago

I'd need to check with the libraries I'm depending on, but wouldn't the "Any CPU" target cover this indirectly when starting up?

tikikevin commented 1 month ago

Using "Any CPU" implies that your build will run on both x86 and x64, but the "target" architecture is still the same (Intel x86/x64). If you want to target a different architecture (Arm64) you will need to install the build tools for that architecture. Visual Studio will do that for you. You just need to add a new target architecture.

FYI, I have two of the new Snapdragon X Elite Laptops and am more than willing to test the builds for you.

I asked Bing Copilot for the steps, and this is what it created:

To target both x64 and ARM64 architectures for your C# application build in Visual Studio, follow these steps:

  1. Configure Your Project to Target ARM64 and x64:

    • Open your project in Visual Studio.
    • Go to Build > Configuration Manager.
    • In the Active solution platform list, choose a platform (e.g., ARM64).
    • If the desired platform doesn't appear, choose New to add it.
    • Install the necessary build tools for the platform using the Visual Studio Installer.
    • For .NET development targeting ARM64, use .NET 6 or later.
    • Repeat the process for x64.
  2. Build and Test:

    • Build your project for both ARM64 and x64 platforms.
    • Test your application on both architectures to ensure compatibility.
  3. Distribute Your Application:

    • The Electron Builder can generate distributables for Windows in both x64 and ARM64 architectures.
    • You'll find them in the following folders:
      • x64: dist/win-unpacked
      • ARM64: dist/win-arm64-unpacked

Remember that Visual Studio runs as a 64-bit application, but you can still target both 32-bit and 64-bit platforms. Happy coding! 🚀 ¹²³⁴

Source: Conversation with Copilot, 7/11/2024 (1) Configure projects to target platforms - Visual Studio (Windows). https://learn.microsoft.com/en-us/visualstudio/ide/how-to-configure-projects-to-target-platforms?view=vs-2022. (2) Build the cross-platform application | Arm Learning Paths. https://learn.arm.com/learning-paths/laptops-and-desktops/electron/how-to-2/. (3) Configure C++ projects for ARM processors | Microsoft Learn. https://learn.microsoft.com/en-us/cpp/build/configuring-programs-for-arm-processors-visual-cpp?view=msvc-[1](https://learn.microsoft.com/en-us/visualstudio/ide/how-to-configure-projects-to-target-platforms?view=vs-2022)70. (4) App package architectures - MSIX | Microsoft Learn. https://learn.microsoft.com/en-us/windows/msix/package/device-architecture.

GeorgRottensteiner commented 1 month ago

After a bit of fiddling the builds are running fine, even with 3.5 and 4.8. At least all executables result in "cannot run on your architecture".

I've uploaded a test release here: https://www.georg-rottensteiner.de/webmisc/C64StudioReleaseARM.zip

Could you please verify it runs on your systems?

Edit: Checked in changes with commit c74981b268e565a74c51aac97a8cbf4b2d78a51d

tikikevin commented 4 weeks ago

Wonderful work!

The .net 3.5 version doesn't seem to recognize the 3.5 libraries, so it won't run. The .net 4.8 version runs flawlessly! The .net 6.0 version runs, however, for some reason I can't build and run anything from the UI. That could be me.

Here is the error that the .net 6.0 version give me.

Element 'hello.bas' was not built successfully last time. Determined hello.bas as active document Running build on hello.bas with configuration Default Build successful, 0 warnings, 0 errors encountered Start address $0801 to $081F, size 31 bytes Memory Map: Compiled to file C:\Users\kevin\Apps\C64StudioReleaseARM\Solutions\hello_world\hello.prg, 33 bytes Running hello.bas Calling C:\Users\kevin\Apps\SDL2VICE-3.8-win64\x64sc.exe with -truedrive +virtualdev "C:\Users\kevin\Apps\C64StudioReleaseARM\Solutions\hello_world\hello.prg" Detecting DLL based HardSID boards. Cannot open hardsid.dll. LoadLibrary WPCAP.DLL failed! LoadLibrary WPCAP.DLL failed! Detecting PCI CatWeasel boards. No PCI CatWeasel found. Detecting libieee1284 ParSIDs. Unknown option '-truedrive'. No libieee1284 ParSIDs found. Error parsing command-line options, bailing out. For help use '-help' Initializing chip model "MOS8565" (63 cycles per line, 312 raster lines). VSP Bug: safe channels are: 01347. Emulation of memory corruption is disabled. Loading system file `C:\Users\kevin\Apps\SDL2VICE-3.8-win64\PRINTER\mps803-D7811G-111-U32053A.bin'. Run exited with result code -1


From: Georg Rottensteiner @.> Sent: Friday, July 12, 2024 11:06 PM To: GeorgRottensteiner/C64Studio @.> Cc: Kevin Orbaker @.>; Author @.> Subject: Re: [GeorgRottensteiner/C64Studio] Future support for aarm64 native application? (Issue #122)

After a bit of fiddling the builds are running fine, even with 3.5 and 4.8. At least all executables result in "cannot run on your architecture".

I've uploaded a test release here: https://www.georg-rottensteiner.de/webmisc/C64StudioReleaseARM.zip

Could you please verify it runs on your systems?

— Reply to this email directly, view it on GitHubhttps://github.com/GeorgRottensteiner/C64Studio/issues/122#issuecomment-2226789290, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AEDEAK3GN6WKA3XF4RWEMYTZMC7VFAVCNFSM6AAAAABKURCT2CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMRWG44DSMRZGA. You are receiving this because you authored the thread.Message ID: @.***>

GeorgRottensteiner commented 4 weeks ago

Well, that's already a lot better than I feared :)

Regarding the 6.0 version, this seems to just be the runtime argument "-truedrive" for VICE. With version 3.5 or 3.6 the VICE team changed the truedrive argument, and bails out if the old one is used.

For older VICEs use: True Drive On: -truedrive +virtualdev True Drive Off: +truedrive -virtualdev

For newer VICEs use: True Drive On: -drive8truedrive +virtualdev8 True Drive Off: +drive8truedrive -virtualdev8

I usually have several tool entries for different VICE versions, so it's just the selection of the emulator version in the toobar to flip.

GeorgRottensteiner commented 2 weeks ago

Closing this for now, beginning with the next full release there'll be ARM binaries now

tikikevin commented 2 weeks ago

That is great! Thank you. It seems to work just fine! I really appreciate it! Donation coming! 🙂


From: Georg Rottensteiner @.> Sent: Tuesday, July 30, 2024 10:55 PM To: GeorgRottensteiner/C64Studio @.> Cc: Kevin Orbaker @.>; Author @.> Subject: Re: [GeorgRottensteiner/C64Studio] Future support for aarm64 native application? (Issue #122)

Closing this for now, beginning with the next full release there'll be ARM binaries now

— Reply to this email directly, view it on GitHubhttps://github.com/GeorgRottensteiner/C64Studio/issues/122#issuecomment-2259727190, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AEDEAKZIKDVP2666BSFMS53ZPB34HAVCNFSM6AAAAABKURCT2CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJZG4ZDOMJZGA. You are receiving this because you authored the thread.Message ID: @.***>