Skip to content

Instantly share code, notes, and snippets.

@emoose
emoose / compare.py
Last active April 18, 2025 21:33
compare.py with symbols/includes
# Save script as asm/maps/compare.py
# Then run
# python compare.py map0_s01 map0_s02
# This compares matching funcs in first maps matchings folder against nonmatchings in the second map
# For each pair that matches it removes comments & data/func refs and uses Levenshtein to compare them
# Funcs with distance 0 Levenshtein score will then be printed, along with lines to use in symbols.txt & #include lines to add to .c
import os
import re
import Levenshtein
@emoose
emoose / compare.py
Last active April 10, 2025 16:00
sh1 map compare
# Save script as asm/maps/compare.py
# Then run
# python compare.py map0_s01 map0_s02 0
# This will compare line count between files in each maps nonmatchings folder
# For each pair that matches it removes comments & data/func refs and uses Levenshtein to compare them
# Last param is max distance to show, use 0 to get exact matches, but can tweak it to find others if wanted.
# (since this only works with asm files in nonmatchings folder, it can't compare map0_s00 since we've matched some of them)
import os
import re
import Levenshtein
@emoose
emoose / sh_sys.h
Last active March 1, 2025 20:18
SH1 things
// struct SH_SYS at 0x800BC728, size 0x5D8
// struct SYS_W at 0x800B9FC0, size 0x2768
struct SH_SYS // 0x800BC728, size 0x5D8
{
ShControllerCfg controller;
char screen_x_1C;
char screen_y_1D;
unsigned __int8 sound_type_1E;
unsigned __int8 volume_BGM_1F;
@emoose
emoose / gist:3bf4a838dbce6ad1bb267f297743dd58
Created January 3, 2025 19:46
IDA Pro shift-jis cp932 japanese encoding

Always keep forgetting this...

ida -dCULTURE=Japanese -dENCODING=cp932

@emoose
emoose / UpdateDLSS.ps1
Last active April 15, 2025 22:37
PowerShell script/module that allows globally updating DLSS for all games
# Global DLSS update script by emoose - https://gist.github.com/emoose/11271bbb3b42fb3b1b0e1c83eef47c05
# Allows setting up driver to use a single global DLSS DLL for majority of DLSS2/3 games
# If the global version is newer than the one included with game, it should get loaded automatically
# (how this works: https://forums.guru3d.com/threads/.439761/page-143#post-6221767)
#
# Almost all DLSS3 games should work, DLSS2 is hit-and-miss
# (DLSS2 games with customized appid probably won't work, thanks to some pointless nvngx checks)
# DLSSD/DLSSG should work fine with nearly all games (re-run the script for each DLL you want to update)
#
# Usage:
@emoose
emoose / ida python idc analysis pause.txt
Last active April 9, 2023 14:16
IDA stop/pause analysis, hopefully google might pick this up...
idc: Analysis(0)
idapython: idc.set_flag(INF_GENFLAGS, INFFL_AUTO, 0)
@emoose
emoose / xam_table_1838.inc
Created September 6, 2022 21:00
Xenia xam_table for XEX1 / 1838
/**
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2021 Ben Vanik. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
******************************************************************************
*/
// This is a partial file designed to be included by other files when
@emoose
emoose / README.md
Last active March 30, 2025 22:23
Xenoblade Chronicles 2 1080p/1440p resolution patch for Yuzu

E: ah darn, seems this does cause some minor issues with certain things in game (namely map & cutscene effects), thanks to theboy181 for letting me know, who has tried making a res patch for it in the past, sadly seems it would take a lot of work to fix all the shaders etc - too bad, since as the comparison below shows, letting game scale itself does fix a lot of graphics issues :(

If you aren't bothered by those minor issues this still might be useful for some people though, who want the game to look its best, so I've left it up here.


So yuzu's resolution scaler is pretty awesome, but sadly XC2 has some issues with it causing weird lines to appear pretty often, decided to try looking into the game exe to see if a patch could be made to change resolution there instead, luckily wasn't too hard to find where it was setup, and with that changed the game seems to scale up fine without any weird artifacts :)

Comparison between yuzu 2x scale (left side) & patched game: https:

@emoose
emoose / dllmain.cpp
Last active February 19, 2022 23:30
Bloodstained RotN dialogue/menu resolution fix
// This code requires some files from my Arise-SDK project:
// https://github.com/emoose/Arise-SDK/tree/b73c7ea9fceea2c494cbb8ebc74c6b3d1d35cbf6
#include "pch.h"
#include <cstdio>
#define SDK_VERSION "0.1.25"
HMODULE DllHModule;
HMODULE GameHModule;
@emoose
emoose / NVNiTypes.h
Last active October 15, 2021 18:59
New Vegas structs
#pragma once
#include <nvse/NiNodes.h>
// Most definitions here taken from JIP LN NVSE:
// https://github.com/jazzisparis/JIP-LN-NVSE/blob/master/internal/netimmerse.h
// Though most lighting-related structs have had some extra things mapped out here
template <typename T_Data> struct DListNode
{
DListNode* next;