Skip to content

Instantly share code, notes, and snippets.

@JohnnyonFlame
JohnnyonFlame / README.md
Last active May 28, 2024 11:41
Building NativeAOT games for old ARM Devices and outdated software.

DOTNET Runtime for old GLIBC (ArmHF support included)!

Our problem here is that there are classes of devices that are stuck on very old glibc versions (e.g. 2.26) and armhf.

We're solving this by compiling the .NET 9 artifacts with an Ubuntu bionic (18.04) rootfs, this should be close enough to just work. At the time of writing this, we had only .NET 9 preview 4 with armhf support, so that's what we're using (tag: v9.0.0-preview.4.24266.19, you can change this if necessary).

@JohnnyonFlame
JohnnyonFlame / mmap-patch.diff
Created February 17, 2024 20:23
VVVVVV mmaped music.
diff --git a/desktop_version/CMakeLists.txt b/desktop_version/CMakeLists.txt
index 9e60db8b..4d522961 100644
--- a/desktop_version/CMakeLists.txt
+++ b/desktop_version/CMakeLists.txt
@@ -22,7 +22,7 @@ if(OFFICIAL_BUILD AND NOT MAKEANDPLAY)
endif()
option(REMOVE_ABSOLUTE_PATHS "If supported by the compiler, replace all absolute paths to source directories compiled into the binary (if any) with relative paths" ON)
-
+option(USE_MMAP "Use memory mapped blobs where possible, lowering physical memory requirements." OFF)
@JohnnyonFlame
JohnnyonFlame / sharp-bilinear.hlsl
Created October 29, 2023 04:06
Sharp Bilinear as an Effect Shader for XNA/FNA
#define _vs(r) : register(vs, r)
#define _ps(r) : register(ps, r)
#define _cb(r)
float4x4 MatrixTransform _vs(c0) _cb(c0);
texture s0_texture : register(t0);
sampler2D s0_sampler = sampler_state {
Texture = (s0_texture);
MagFilter = Linear;
@JohnnyonFlame
JohnnyonFlame / auto_dispatch.hpp
Last active October 7, 2023 13:20
Atuomatic dispatch from variadic/array procedures (from fake_jni).
// Automatic generator for function dispatch
template <auto F>
struct dispatch
{
// The following nested structure does two things:
// 1: Unwraps details about the function (e.g. argument type list,
// return type) with the template.
// 2: Implements the dispatcher as needed (will extract from va_list and push)
// into the function call that is being wrapped, taking care to also return
// the value if applicable.
@JohnnyonFlame
JohnnyonFlame / eglconfig.c
Last active April 21, 2023 14:09
eglconfig for owl/rg35xx
#include <stdio.h>
#include <stddef.h>
#include <string.h>
#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#include <GLES2/gl2platform.h>
#include <sys/ioctl.h>
#include <linux/ioctl.h>
@JohnnyonFlame
JohnnyonFlame / 1.0_to_2.2.x.csx
Last active April 19, 2023 17:14
Convert older GMS games to newer runners w UTMT
using System.Windows;
using System.Reflection;
EnsureDataLoaded();
RunUMTScript(Path.Combine(ExePath, "Scripts/Technical Scripts/15_to_17_To_16.csx"));
MainWindow mainWindow = Application.Current.MainWindow as MainWindow;
Data.SetGMS2Version(2, 2, 0, 258);
foreach (var asset in Data.Backgrounds)
@JohnnyonFlame
JohnnyonFlame / Lauch.sh
Last active January 1, 2023 23:36
Jealousy for EVERSD
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2022-present JohnnyonFlame
cd /tmp
# Setup the basic overlay structure
mkdir {rootfs,enablement,overlay}
mount /mnt/sdcard/SYSTEM rootfs/
@JohnnyonFlame
JohnnyonFlame / configure_n2.sh
Last active September 1, 2022 00:05
Auto-configure fbdev-mali SDL2 backend for the Odroid N2 platform.
#!/bin/bash
# You might want to change DCMAKE_TOOLCHAIN_FILE :)
cmake -B build \
-DCMAKE_TOOLCHAIN_FILE=~/aarch64.cmake \
-DCMAKE_C_FLAGS=-I\ /home/johnny/opengl-meson/include \
-DSDL_STATIC=OFF \
-DSDL_LIBC=ON \
-DSDL_GCC_ATOMICS=ON \
@JohnnyonFlame
JohnnyonFlame / EiffelExtractor.cs
Last active June 17, 2022 01:31
EiffelExtractor - Extract ParisEngine assets.
// File Extractor for games using the ParisEngine (e.g. Panzer Paladin, TMNT: Shredder's Revenge)
// To compile this: mcs EiffelExtractor.cs /r:DotNetZip.dll
// This is free software, licensed under BSD-0, by Johnny on Flame, 2022.
using System;
using System.Text;
using System.IO;
using System.Collections.Generic;
using Ionic.Zlib;
@JohnnyonFlame
JohnnyonFlame / thunk_list.cpp
Last active June 17, 2022 20:19
Compile time automatic generation of softfp to hardfp thunks using templated specialization
// Compile time code-generation for conditional softfp->hardfp thunks using template specialization.
// As of June 2022 clang still doesn't generate correct code for this mixed ABI situation, use gcc.
// Special Thanks for the folks at FEX-Emu's discord for inspiration/help with this.
// Free software, Licensed under BSD-0.
#include <stdint.h>
#include <stdio.h>
#include <stdarg.h>
#include <stdint.h>