Skip to content

Instantly share code, notes, and snippets.

View Swyter's full-sized avatar

Swyter Swyter

View GitHub Profile
#include <stdlib.h>
#include <stdio.h>
int fusb_measure_vbus_bsearch_comp(const void *a, const void *b)
long unsigned int index = (long unsigned int) b; float volt = (index * 0.420f);
int val = volt <= 5.040000f ? 0x80 : 0;
printf("-- %u %u %f = %x\n", a, b, volt, val);
Swyter /
Last active April 12, 2024 17:41
PlayStation VR2 Sense controllers · Protocol and input notes · USB & Bluetooth HID packets

One needs to get HID feature report 5 (calibration) to switch each controller into the extended mode, unlike DualShock / DualSense they don't seem to report anything (input doesn't work) in the normal state after just connecting them via standard HID.

  data[00] always 0x31
  data[01] always 0x_1, with the upper byte being an incrementing counter from 0 to 0xf for each packet and wrapping around
  data[02] 0xff - L  / R  stick X-axis, 0 is left, 0xff is right  (analog) (same field for the respective stick in each controller) 
  data[03] 0xff - L  / R  stick Y-axis, 0 is   up, 0xff is  down  (analog) (same field for the respective stick in each controller) 

data[04] 0xff - L2 / R2 trigger pull, from 0 to fully pulled at 0xff (analog)

"fus_fixed_key": "hqzdurufm2c8mf6bsjezu1qgveouv7c7",
"fus_flexible_key_suffix": "w13r4cvf4hctaujv"
Swyter / farmer-notes.txt
Last active September 2, 2023 03:38
Sphinx -- Heliopolis Farmer Brothers scripting notes
HT_Objective_Hel_Exterior_Farm_PlotTime: in-game timestamp in seconds when they originally started to dig
(gettimer - gPlotTime > 300 seconds) means done
HT_Objective_Hel_Exterior_Farm_FarmerState: 0 = waiting for player to kill all eyes,
1 = waiting in the hut to pick a plot,
2 = walking to farm plot,
3 = digging,
4 = walking back to hut,
5 = waiting for player to give reward
HT_Objective_Hel_Exterior_Farm_Plot: Active/current plot index, from 1 to 16 (this and the one below are set by each plot context action)
HT_Objective_Hel_Exterior_Farm_PlotList: bitfield of spent/dug plots, the set bit index comes from the Farm_Plot objective
# Maintainer: Anastasios Vacharakis <>
pkgdesc="A tool for enabling gyroscopic controls on Steam Deck."
This is intended to be a resource for those who are working on older modifications, or those who are looking to port old modifications to new versions. I dont have anything older than v.0.202, which I just uploaded to the Repository.
[quote=—Viking Conquest—]
-: [URL=]v.2.005[/URL] (1.2 GB)
-: [URL=]v.2.012[/URL] (1.2 GB)
-: [URL=]v.2.021[/URL] (1.2 GB)
-: [URL=]v.2.025[/URL] (1.2 GB)
-: [URL=
Swyter /
Last active July 2, 2023 17:39
`mb_warband_linux` fixes

Enable trilinear texture filtering to fix the ugly line artifacts of the hard mipmap transitions when zooming in:

rglGraphics_context::set_sampler_state() at 0x081806d0:
08180910 c7 44 24 08 01 27 00 00      MOV        dword ptr [ESP + local_24],0x2701 # GL_LINEAR_MIPMAP_NEAREST (0x2701) -> GL_LINEAR_MIPMAP_LINEAR (0x2703)
08180920 c7 44 24 08 01 27 00 00      MOV        dword ptr [ESP + local_24],0x2701 # GL_LINEAR_MIPMAP_NEAREST (0x2701) -> GL_LINEAR_MIPMAP_LINEAR (0x2703)

SDL_GL_DEPTH_SIZE; Improve the depth buffer resolution/quality from 24 to 32 bits:

process_directx_call() at 0x082ec490:
Swyter /
Last active July 2, 2023 05:53
Intel GPA on Linux crashing on startup / closing due to CpuEnumerator::InconsistentProcessAffinity:
$ gpa-frame-analyzer
terminate called after throwing an instance of 'CpuEnumerator::InconsistentProcessAffinity'
  what():  This process is restricted and not able to run on all logical processors managed by OS
$ FA_PATH=/opt/intel/gpa
$ export LD_PRELOAD="/home/swyter/intel-gpa-bin/ $FA_PATH/python3/lib/"

v34 - Beyond Good and Evil - Symbolicated PS2 proto .elf
v36 - King Kong - (0xB398CC66 XOR key for headers) - Symbolicated .elf
v36 - Rayman Raving Rabbids - (0xB398CC66 XOR key for headers) - Symbolicated .elf
v36 - Rayman Raving Rabbids 2 - (0xB398CC66 XOR key for headers) - Multiple symbolicated .elf
v37 - Prince of Persia: The Sands of Time - PS2 proto symbol map file
v38 - Prince of Persia: Warrior Within -
v38 - Prince of Persia: The Two Thrones -
v42 - TMNT -
v42 - My Word Coach - Symbolicated .elf, unpacked data, uncompiled AI scripts
v42 - My Spanish Coach -

for (i=125; i>0; i--)