Skip to content

Instantly share code, notes, and snippets.

intrnl /
Last active Sep 18, 2022
A guide to make Phantasy Star Online 2: New Genesis run faster on Linux.

PSO2 on Linux casefolding guide

This guide is primarily written for the Global Steam version of the game, however it should apply more or less the same with other versions, including the Japanese version in case it starts allowing Linux gameplay as well. (JP currently does not have an up-to-date version of GameGuard anticheat).

I do not hold any liability for what happens if you mess up, be warned.
I would recommend reading through the entire guide even if certain parts may not apply to you.

PSO2 has a unique structure where each assets are contained in their own tiny files, mostly ranging around 3-4 KiB in size, and would even try to load assets that may potentially exist even if it's guaranteed to not exist, in turn this adds quite the considerable overhead for Wine to try to load these files off disk.

View live-fragment.js
export class LiveFragment {
parentNode = null;
markerNode = document.createComment('fragment');
childNodes = [];
static from (content) {
let instance = new TemplateFragment();
let fragment = content.cloneNode(true);
View _reactivity.js
let effects = [];
let current = null;
let dirty = 0n;
let flushing = false;
export let access = Symbol();
export function state (flag, value) {
View middleware-runner.js
import http from 'node:http';
export function createRunner (middlewares) {
* @param {http.IncomingMessage} request
* @param {http.ServerResponse} response
* @param {(error?: any) => void} done
return function runner (request, response, done = createFinalHandler(request, response)) {
let idx = 0;
View fast-uuidv4.js
let map;
function generateUUID () {
const buf = crypto.getRandomValues(new Uint8Array(16));
buf[6] = (buf[6] & 0x0f) | 0x40;
buf[8] = (buf[8] & 0x3f) | 0x80;
if (!map) {
map = [];
intrnl /
Last active Jul 31, 2022
Create exclusion list for PSO2 NGS Global

Creates an exclusion list to only download the NGS version for PSO2 Global.

You can't use this on a mainline version of Legendary just yet, pull request is still pending

intrnl / bench.mjs
Last active Jul 24, 2022
HTML escape function #bench
View bench.mjs
import { run, bench, group } from '';
function escape (value) {
const str = '' + value;
const res = str.replace(/[&<]/g, (char) => '&#' + char.charCodeAt(0) + ';');
return res;
intrnl / proton-compact-userchrome.css
Last active Jul 9, 2022
Revert Firefox Proton to Photon compact
View proton-compact-userchrome.css
* Moved to a new repository.
:root {
--tab-min-height: 28px !important;
--toolbarbutton-inner-padding: 6px !important;
--toolbarbutton-outer-padding: 1px !important;
--toolbar-start-end-padding: 1px !important;
View log-update.js
import * as tty from 'node:tty';
const isTTY = tty.isatty(1) && process.env.TERM !== 'dumb' && !('CI' in process.env);
export function createLogger (options = {}) {
let { text = '', interval = 50, stream = process.stdout, hideCursor = false } = options;
let rows = 0;
let timer;
View x-target.js
* @param {HTMLElement} node
* @param {string} target
* @returns {?HTMLElement}
export function query (node, target) {
if (node.matches(`[x-target~='this.${target}']`)) {
return node;