Skip to content

Instantly share code, notes, and snippets.

View shinyquagsire23's full-sized avatar
💭
Messing with Apple Vision

Max Thomas shinyquagsire23

💭
Messing with Apple Vision
View GitHub Profile
@shinyquagsire23
shinyquagsire23 / gist:2160f3a1361308aa3479730242f78a20
Created June 29, 2025 00:04
visionOS 26 maxRenderQuality=1.0 VRR map rates and estimated PPD
Drawable compressed dims: 2496 x 2432
Drawable decompressed dims: 6262 x 5020
Drawable texture dims: 2528 x 2528
VRR granularity: MTLSize(width: 32, height: 32, depth: 1)
0 Cell amt: 78 x 76
x 0 0.054792162 est PPD: 3.2858002
x 1 0.070024125 est PPD: 4.199237
x 2 0.086725116 est PPD: 5.2007694
x 3 0.10491543 est PPD: 6.291614
x 4 0.12499988 est PPD: 7.496047
@shinyquagsire23
shinyquagsire23 / _formats.swift
Last active July 5, 2025 16:00
Non-conclusive list of interesting private Metal pixel formats
//
// Non-conclusive list of interesting private Metal pixel formats
//
let MTLPixelFormatYCBCR8_420_2P: UInt = 500
let MTLPixelFormatYCBCR8_422_1P: UInt = 501
let MTLPixelFormatYCBCR8_422_2P: UInt = 502
let MTLPixelFormatYCBCR8_444_2P: UInt = 503
let MTLPixelFormatYCBCR10_444_1P: UInt = 504
let MTLPixelFormatYCBCR10_420_2P: UInt = 505
let MTLPixelFormatYCBCR10_422_2P: UInt = 506
@shinyquagsire23
shinyquagsire23 / DrawableWrapper.swift
Last active June 12, 2025 09:04
DrawableQueue/LowLevelTexture wrapper class for visionOS 2.0 beta
// Open license, I don't care what you do with this.
// idk how many of these are needed
import SwiftUI
import RealityKit
import Metal
import MetalKit
import Spatial
class DrawableWrapper {
Bus 000 Device 009: ID 05e3:0751 Genesys Logic, Inc. microSD Card Reader
Device Descriptor:
bcdUSB 2.00
bDeviceClass 0 UseInterfaceDescriptor
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x05e3 Genesys Logic, Inc.
idProduct 0x0751 microSD Card Reader
bcdDevice e.04
@shinyquagsire23
shinyquagsire23 / FPGBC_update.py
Last active January 30, 2024 01:48
FPGBC updater script for macOS (and maybe Linux) using Python
# pip3 install pyusb
# Requires root on macOS to kick the kernel driver off the device.
import usb.core
import usb.util
import struct
import time
import base64
import sys
@shinyquagsire23
shinyquagsire23 / gist:e431887f755df2e23851e62270896b11
Last active December 22, 2023 07:29
VIVE ultimate trackers lsusb -v
Bus 001 Device 007: ID 0bb4:0350 HTC (High Tech Computer Corp.) VIVE Wireless Dongle
Device Descriptor:
bcdUSB 2.00
bDeviceClass 0 UseInterfaceDescriptor
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x0bb4 HTC (High Tech Computer Corp.)
idProduct 0x0350
bcdDevice 1.00
@shinyquagsire23
shinyquagsire23 / recover_drive.py
Created October 12, 2023 16:12
Directly talking SCSI with a USB mass storage devices on Linux, to (attempt to) recover raw NAND data from a drive which lost configuration
import usb.core
import usb.util
import struct
import time
import os
# echo 1-1:1.0 > /sys/bus/usb/drivers/usb-storage/unbind
os.system("/bin/bash -c \"echo 1-1:1.0 > /sys/bus/usb/drivers/usb-storage/unbind\"")
@shinyquagsire23
shinyquagsire23 / gist:ab6f7c0f9b6514b6b54d69b9a57646be
Created July 26, 2023 20:24
Enabling USB device mode on Intel devices (Tweet archive)
https://twitter.com/ShinyQuagsire/status/1536432635643211777 12:37 PM · Jun 13, 2022
-----
I figured out how to enable USB device mode on my XPS 13 (9350) 🎉
Though for some ungodly reason, it uses the right-side full USB port. So a crossover cable is required.
-----
https://twitter.com/ShinyQuagsire/status/1536434057671716864 12:43 PM · Jun 13, 2022
-----
@shinyquagsire23
shinyquagsire23 / fixup.sh
Created July 18, 2023 02:20
Fixup iOS apps to run on visionOS sim
#!/bin/zsh
PWD=$(pwd)
app_path=$1
app_basename="${app_path%.*}"
if [ "$#" -ne 1 ]; then
echo "Usage: ./fixup.sh YourApp.app"
exit -1
fi
@shinyquagsire23
shinyquagsire23 / slc_unwrap.py
Created April 26, 2023 19:17
Convert Wii(U) NANDs with ECC to NAND images w/o ECC.
#!/usr/bin/python3
f = open("SLC.RAW", "rb")
f_out = open("SLC.partial.bin", "wb")
while True:
contents = f.read(0x840)
if len(contents) < 0x800:
break
unwrap = contents[:0x800]
f_out.write(unwrap)