Skip to content

Instantly share code, notes, and snippets.

View VelocityRa's full-sized avatar

Nick Renieris VelocityRa

View GitHub Profile
@VelocityRa
VelocityRa / emudev_resources_general.md
Last active May 11, 2024 23:07
Content mirror of the EmuDev Discord's `#resources-general` channel

General Resources

@VelocityRa
VelocityRa / emudev_resources_systems.md
Last active May 11, 2024 19:49
Content mirror of the EmuDev Discord's `#resources-systems` channel

System-specific Resources

Below are some useful resources for various popular systems. If you're unsure what you want to work on we recommend starting with a CHIP-8 tutorial, of which there are many (just Google it).

After that, move to whatever system you want to. You don't need to "work your way up" to it or whatever as many seem to think. (relevant thread). Just make sure you have the basics down first, remember to study the source code of existing emulators (super important) and if you get stuck, ask questions on this server or in the emudev subreddit: https://reddit.com/r/EmuDev.

For potentially more resources on your system, also see pinned messages in relevant system channels.

Note: A great introduction to any system is to read its Architecture of Consoles entry, if available.

@VelocityRa
VelocityRa / lfm-rich-presence-headless.js
Created May 25, 2022 22:33
Discord Last.fm Rich Presence
// modified from https://github.com/PvtTyphoon/lfm-rich-presence
const rpc = require("discord-rpc");
const rp = new rpc.Client({
transport: "ipc",
});
const fetch = require("request-promise");
const prettyMilliseconds = require("pretty-ms");
function formatNumber(number) {
var x = number.split(".");
@VelocityRa
VelocityRa / FindPS2Vtables.py
Last active March 21, 2021 21:28
Ghidra script made to find all Sly 2 PS2 2002 proto vtable pointers
#TODO write a description for this script
#@author
#@category _NEW_
#@keybinding
#@menupath
#@toolbar
from ghidra.program.model.data import Pointer32DataType
from ghidra.program.model.util import CodeUnitInsertionException
@VelocityRa
VelocityRa / FindJumptableTargets.py
Last active March 14, 2021 08:27
Ghidra script that finds jumptable targets for PS3 jumptables (generated for C 'switch'es) and adds refs to their indirect jump instruction
# Finds jumptable targets for PS3 jumptables (generated for C 'switch'es) and adds
# refs to the indirect jump instruction so that decompilation for the cases is present
# (instead of Ghidra complaining with an error in the switch as it often does).
# Select the block with the address offsets before running (first mark them all as
# addresses with `P` and `[`).
# After you run this you'll probably want to select the indirect jump instruction
# (usually `bctr`) and run the SwitchOverride.java script.
#@author VelocityRa
#@category Repair
@VelocityRa
VelocityRa / sly1_ps3_W.bt
Last active October 11, 2020 00:24
[WIP] Extracts mesh information from Sly Cooper and the Thievius Raccoonus (PS3 US Release) "W" decompressed files
//------------------------------------------------
//--- 010 Editor v8.0 Binary Template
//
// File: sly1_ps3_W.bt
// Authors: VelocityRa (https://github.com/VelocityRa)
// Version:
// Purpose:
// Category:
// File Mask:
// ID Bytes:
@VelocityRa
VelocityRa / DNG.bt
Created April 20, 2020 16:34
010 Editor Template for .DNG files. Based on TIF.v1.7 template.
//------------------------------------------------
//--- 010 Editor v2.1 Binary Template
//
// File: TIF.bt
// Authors: Kevin O. Grover
// E-mail: kevin@kevingrover.net
// Version: 1.7
// Purpose: A template for parsing TIFF (Tagged Image File Format) files. Also now handles GeoTIFF files.
// Category: Image
// File Mask: *.tif,*.tiff
const DEMO_MODE : bool = false;
fn get_digit(num: u32, index: u32) -> u8 {
(num / 10u32.pow(index) % 10) as u8
}
/* Returns true if a number was emitted */
fn emit_units_tens_hundreds(num: u32, str: &mut String) -> bool {
let units_names = ["", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"];
let tens_names = ["", "ten", "twenty", "thirty", "fourty", "fifty", "sixty", "seventy", "eighty", "ninety"];
@VelocityRa
VelocityRa / relocations.cpp
Created September 6, 2018 14:46
Vita3K WIP code for newly discovered relocation entry types
// Vita3K emulator project
// Copyright (C) 2018 Vita3K team
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
@VelocityRa
VelocityRa / collect_vita3k_logs.py
Last active August 18, 2018 22:19
Retrieves log files from given repositories' Issues for offline/batch processing/searching
"""
Retrieves log files from given ("REPO_NAMES") repositories
for offline/batch processing/searching.
Iterates thought all issues, finds the last posted comment
that contains at least one file and downloads all files to
appropriately named directories, with the filename being
the Issue title (game name/titleID).
Replaces invalid characters in that file name with '-' and
if there are multiple files in an issue, appends the