Skip to content

Instantly share code, notes, and snippets.

View colemancda's full-sized avatar
🏎️
Working with Swift on ARM

Alsey Coleman Miller colemancda

🏎️
Working with Swift on ARM
View GitHub Profile
@colemancda
colemancda / rp5-wine-ports.md
Created June 30, 2025 00:31 — forked from JeodC/rp5-wine-ports.md
A beginner's guide to creating wine ports for the Ayn Odin 2, Retroid Pocket 5, and Retroid Pocket Mini

Rocknix Wine Ports

Using wine is a deep rabbit hole for anyone not familiar with the software, and an even deeper rabbit hole when combined with box86 or box64. This guide attempts to serve as a basic introduction to using the built-in wine and box packages included with Rocknix on a Retroid Pocket 5. While the Retroid Pocket Mini is a similar setup chain, it is weaker hardware than the Retroid Pocket 5 and thus the examples provided here may not function as well.

Terminology - Wine and Box86/64

The first thing anyone should understand is the vernacular used throughout this guide. Two tools are used to make wine ports possible on ARM64:

  • Box86 and Box64 by ptitSeb are Linux x86 and x86_64 emulators targeting AARCH64/ARM64 architecture.

  • Wine is a software that allows Windows programs to run on Linux systems. Prebuilt wine binaries can be downloaded from the [wine-builds](https://github.com

@colemancda
colemancda / script.idc
Created May 6, 2024 03:23 — forked from lastbattle/script.idc
MapleStory IDC script
// IDC script for identifying functions and such
#include <idc.idc>
#define RenameFunction(a, b) Message("Found %s at %a\r\n", b, a); MakeName(a, b)
#define START_ADDR 0x00400000
static main() {
auto addr = BADADDR;
auto onMovePacket = FindAoBAndRename("25 0C FE FF FF 05 E8 03", "?OnMovePacket@CMovePath@@QAEXAAVCInPacket@@H@Z");
@colemancda
colemancda / Program.cs
Created April 18, 2024 03:55 — forked from angelsl/Program.cs
NX Benchmarks
// reNX is copyright angelsl, 2011 to 2012 inclusive.
//
// This file is part of reNX.
//
// reNX is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// reNX is distributed in the hope that it will be useful,
@colemancda
colemancda / CashRegister.swift
Last active July 28, 2023 18:29
Swift Register Command LIne
import Foundation
while let line: String = readLine() {
print(processInput(line))
}
func processInput(_ line: String) -> String {
let components = line.components(separatedBy: ";")
guard components.count == 2,
let price = Float(components[0]),
@colemancda
colemancda / DarwinNotificationCenter.swift
Created March 29, 2023 07:17 — forked from AvdLee/DarwinNotificationCenter.swift
A notification center for Darwin Notifications. MIT License applies.
//
// DarwinNotificationCenter.swift
//
// Copyright © 2017 WeTransfer. All rights reserved.
//
import Foundation
/// A Darwin notification payload. It does not contain any userInfo, a Darwin notification is purely event handling.
public struct DarwinNotification {
@colemancda
colemancda / main.go
Created December 13, 2022 09:15 — forked from diamondo25/main.go
Golang TinyMapleServer
package main
import (
"bufio"
"bytes"
"encoding/binary"
"encoding/hex"
"flag"
"fmt"
"net"
@colemancda
colemancda / 0001-stdlib-Add-RISCV64-support.patch
Last active November 3, 2022 07:36
Swift 5.7 StdLib patches for RISCV64
From a2e3e205250b3f0eddf06e5b0bc3c45231b85350 Mon Sep 17 00:00:00 2001
From: Alsey Coleman Miller <[email protected]>
Date: Thu, 3 Nov 2022 00:27:15 -0700
Subject: [PATCH 1/1] [stdlib] Add RISCV64 support
---
CMakeLists.txt | 2 ++
cmake/modules/SwiftConfigureSDK.cmake | 2 +-
cmake/modules/SwiftSetIfArchBitness.cmake | 3 ++-
lib/Basic/LangOptions.cpp | 5 +++++
@colemancda
colemancda / swift-5.6-AtomicWaitQueue.patch
Last active May 26, 2022 23:49
Swift 5.6.1 runtime patch for AtomicWaitQueue
diff --git a/include/swift/Runtime/AtomicWaitQueue.h b/include/swift/Runtime/AtomicWaitQueue.h
index 9fdd9288fe2..0985067828b 100644
--- a/include/swift/Runtime/AtomicWaitQueue.h
+++ b/include/swift/Runtime/AtomicWaitQueue.h
@@ -19,6 +19,8 @@
#ifndef SWIFT_RUNTIME_ATOMICWAITQUEUE_H
#define SWIFT_RUNTIME_ATOMICWAITQUEUE_H
+#include "swift/Runtime/Heap.h"
+#include "swift/Runtime/HeapObject.h"
@colemancda
colemancda / build-swift-package-buildroot.sh
Created May 23, 2022 20:21
Cross compile Swift package and embed into Buildroot
#!/bin/sh
# Configuration
SWIFT_BUILD_MODE="${SWIFT_BUILD_MODE:=release}"
# exit for failures
set -e
# build swift package
echo "Build Swift Package"
@colemancda
colemancda / swift-armv5-qemu-buildroot-config
Created May 23, 2022 04:42
swift-armv5-qemu-buildroot-config
#
# Automatically generated file; DO NOT EDIT.
# Buildroot -g4176269-dirty Configuration
#
BR2_HAVE_DOT_CONFIG=y
BR2_EXTERNAL_SwiftPackage_PATH="/home/coleman/Developer/swift-cross-compile-action"
BR2_HOST_GCC_AT_LEAST_4_9=y
BR2_HOST_GCC_AT_LEAST_5=y
BR2_HOST_GCC_AT_LEAST_6=y
BR2_HOST_GCC_AT_LEAST_7=y