Skip to content

Instantly share code, notes, and snippets.

View wheremyfoodat's full-sized avatar
😏
Shouting at clouds

wheremyfoodat

😏
Shouting at clouds
View GitHub Profile
@wheremyfoodat
wheremyfoodat / hips.hpp
Created May 5, 2024 22:45
Single-header patcher for IPS. UPS and BPS files
#pragma once
#include <algorithm>
#include <array>
#include <climits>
#include <cstdio>
#include <cstring>
#include <type_traits>
#include <utility>
#include <vector>
@wheremyfoodat
wheremyfoodat / post.md
Last active March 18, 2024 19:05
Why having multiple emulators is good

Forenote: Most of the following is simply my point of view as an emulator developer. Various names are omitted for privacy reasons.

I usually write blog posts aimed at developers, but I'd like to make an exception just this once. For a lot of game consoles you have likely noticed that there's multiple emulators for said console. Even for more modern systems like the Nintendo 3DS, you've got several active emulators such as Citra, Mikage and Panda3DS, and some less active ones at the moment such as Corgi3DS. This has made many people in the emulation community ask "Why do emulator developers not simply collaborate"? Thus, I'd like to dedicate this post to answering this question as an emulator developer myself.

1) We actually do collaborate!

Even when we're working on different emulators, we very often collaborate and help each other. A lot of people don't know, since it usually happens ov

@wheremyfoodat
wheremyfoodat / pand.md
Last active August 13, 2023 15:43
List of 3DS games I can confirm need region spoofing to function

I only know which PAL games break without region spoofing, since Panda would report USA for the longest time

Some PAL titles that need spoofing (and I assume their other versions require spoofing too) are:

  • Luigi's Mansion 1 (At least on EU)
  • Rhythm Paradise Megamix (Known as Rhythm Heaven Megamix in the USA)
  • Picross 2D Round 2
  • Hyrule Warriors (at least the demo seems to)
  • Paper Mario Sticker Star (Not sure if it 100% requires region spoof since it does not properly function on Panda, but it seems to get further with region spoof now)
  • ...
cmake_minimum_required(VERSION 3.10)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fbracket-depth=4096")
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
project(Alber)
@wheremyfoodat
wheremyfoodat / Poop.c
Created August 14, 2022 15:21
Pocketstation docking stuff
void Docking_Bullshit()
{
bool v0; // zf
bool v1; // nf
int v2; // r1
int v3; // r1
int v4; // r1
unsigned int v5; // r0
unsigned int v6; // r0
int v7; // r2
@wheremyfoodat
wheremyfoodat / aoc2021_day3_pt1.cc
Created December 5, 2021 14:18
Day 3 of AoC in aa64 (part 1 only)
#include <iostream>
__attribute__ ((naked)) void asm_main() {
__asm__ volatile (R"(
// x19: Pointer to file
// x20: Bit cache (12 * 4 bytes of storage). Incremented on ones, decremented on zeroes.
// If the final result is > 0 then the most common value is 1, otherwise it's 0
.equ NUM_BITS, 12
@wheremyfoodat
wheremyfoodat / aoc2021_day2.cc
Last active December 3, 2021 20:29
Day 2 of AoC in aa64
#include <iostream>
__attribute__ ((naked)) void asm_main() {
__asm__ volatile (R"(
// x19: Pointer to file
// x20: xpos
// x21: depth
// x22: aim
part1:
@wheremyfoodat
wheremyfoodat / aoc2021_day1.cc
Last active December 3, 2021 20:29
Day 1 of AOC 2021 in aarch64 assembly
#include <iostream>
__attribute__ ((naked)) void asm_main() {
__asm__ volatile (R"(
// x19: Pointer to file
// x20: Previous read number (or triplet for part 2)
// x21: number of increments
part1:
stp x19, x30, [sp, -16]! // save return address and x19, lower stack
@wheremyfoodat
wheremyfoodat / IWannaCry.c
Created March 23, 2021 22:50
Thanks Pocketstation
void __noreturn sub_4003240()
{
int v0; // r2
int v1; // r0
int i; // r0
int v3; // r1
int v4; // r2
int v5; // r0
int v6; // r0
int v7; // r0
@wheremyfoodat
wheremyfoodat / monta.asm
Last active March 3, 2021 11:39
monta ida output
; this is the caller function
BIOSCODE:BFC06EC4 # =============== S U B R O U T I N E =======================================
BIOSCODE:BFC06EC4
BIOSCODE:BFC06EC4
BIOSCODE:BFC06EC4 sub_BFC06EC4: # CODE XREF: start+418↑j
BIOSCODE:BFC06EC4
BIOSCODE:BFC06EC4 var_s0 = 0
BIOSCODE:BFC06EC4
BIOSCODE:BFC06EC4 addiu $sp, -0x18
BIOSCODE:BFC06EC8 sw $ra, 0x14+var_s0($sp) ; back up $ra in stack