Skip to content

Instantly share code, notes, and snippets.

View runlevel5's full-sized avatar

Trung Lê runlevel5

View GitHub Profile
@runlevel5
runlevel5 / gog_installer_unsupported_platform.md
Last active February 20, 2026 15:52
How to run GOG Installer (mojosetup) on unsupported architecture?

Installing GOG Games on PPC64LE with Native MojoSetup

GOG's Linux game installers (.sh files) are Makeself archives that bundle a custom mojosetup binary (x86_64) to handle the installation UI and file extraction. On non-x86 architectures like PPC64LE, the bundled binary won't run natively. This document describes how to compile mojosetup from source for your architecture and use it to run any GOG .sh installer, with support for stdio, ncurses (TUI), GTK2, GTK3, and GTK4 (graphical) interfaces.

Background

@runlevel5
runlevel5 / vinsertd_vextractd_ppc64le.md
Created February 19, 2026 12:05
PPC64LE's behaviour of vinsertd/vextractd

test_vinsertd.c:

#include <stdio.h>
#include <stdint.h>
#include <altivec.h>
typedef union {
    vector unsigned char v;
    uint64_t u64[2];
    uint32_t u32[4];
@runlevel5
runlevel5 / PLAN.md
Created February 8, 2026 13:17
Improvement plan to speed up Yamagi Quake 2 software renderer

SIMD Optimization Plan for the Software Renderer

This document covers the feasibility analysis and implementation plan for adding SIMD acceleration to the Yamagi Quake II software renderer (src/client/refresh/soft/).

Table of Contents

  1. Architecture Overview
  2. Current Bottlenecks

Great choice! Monkey Island 1 (The Secret of Monkey Island) uses the SCUMM engine (v5) and has well-established tooling. The Talkie CD version adds voice acting, which you'd keep while translating text. Overview You'll need to:

  1. Extract text strings from game data
  2. Translate to Vietnamese
  3. Create/modify fonts to support Vietnamese characters
  4. Repack the game data
  5. Test with ScummVM Tools You'll Need | Tool | Purpose |
@runlevel5
runlevel5 / zig-0.15.2-ppc64le.log
Created October 17, 2025 00:48
Full compilation log of zig 0.15.2 on Linux PPC64LE (Fedora 43)
[tle@fedora ~/W/zig]$ git diff
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0ab8e1cddd..eb2f60dbf1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -793,7 +793,7 @@ if(MSVC)
else()
set(ZIG_WASM2C_COMPILE_FLAGS "-std=c99 -O2")
set(ZIG1_COMPILE_FLAGS "-std=c99 -Os")
- set(ZIG2_COMPILE_FLAGS "-std=c99 -O0 -fno-sanitize=undefined -fno-stack-protector")
@runlevel5
runlevel5 / fish_toolbx.md
Last active September 17, 2025 13:21
How to have the special toolbox prompt for fish shell?

So if you happen to use fish shell for your toolbox container environment, you should set the fish_prompt by modify ~/.config/fish/config.fish:

if status is-interactive
  # Commands to run in interactive sessions can go here
  function is_toolbox
    if test -f /run/.toolboxenv
      set toolbox_name (grep -E '^name="' /run/.containerenv | cut -d \" -f 2)
      echo " ❱ $toolbox_name"
 end
@runlevel5
runlevel5 / instructions.md
Last active September 12, 2025 09:36
How to replace GNU coreutils with Rust uutils/coreutils locally in your user account in Fedora?

Run following bash script:

#!/bin/bash

# For binaries
SRC_BIN_DIR="/usr/bin"
DEST_BIN_DIR="$HOME/.local/uubin"

# Ensure destination directory exists
commit 3b6664a217eaea1ddb00dd978a5326b14ca57fa4
Author: Trung Lê <8@tle.id.au>
Date: Tue Aug 12 11:27:43 2025 +1000
new version 2.3.8
diff --git a/.gitignore b/.gitignore
index 8a39d88..d6d11eb 100644
--- a/.gitignore
+++ b/.gitignore
@runlevel5
runlevel5 / cde-9f0f015c4daf7d3eacb21c19b4f3912cac56e68e-f43.log
Created August 11, 2025 23:03
CDE sha-9f0f015c4daf7d3eacb21c19b4f3912cac56e68e compilation error on Fedora 43
$ export CC='gcc -std=c90'
$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether sleep supports fractional seconds... yes
checking filesystem timestamp resolution... 0.1
checking whether build environment is sane... yes
checking for a race-free mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
@runlevel5
runlevel5 / gcc15_fix_issort_compfunc.patch
Last active March 31, 2025 01:34
Common Desktop Environment: Fix Issort compare function definition
diff --git a/cde/lib/tt/mini_isam/isam_impl.h b/cde/lib/tt/mini_isam/isam_impl.h
index 8172077da..c11ac7820 100644
--- a/cde/lib/tt/mini_isam/isam_impl.h
+++ b/cde/lib/tt/mini_isam/isam_impl.h
@@ -381,7 +381,7 @@ typedef struct issort {
/* many records */
int ist_nrecs; /* number of records inserted */
int ist_currec; /* current position */
- int (*ist_compf) (); /* comparison function */
+ int (*ist_compf) (const void *, const void *); /* comparison function */