Skip to content

Instantly share code, notes, and snippets.

@hcs64
hcs64 / dec.py
Created February 1, 2023 21:57
Decode strings from some feelplus games
# Translate feelplus packed strings
# Derived from examples at https://pastebin.com/UkfBaSga
import itertools
import struct
# Unknown char 39 is shown as "{39}"
charset1 = ['{%s}'%(i,) for i in range(40)]
for i in range(10):
@hcs64
hcs64 / a.c
Last active August 9, 2022 19:40
Find and check matching codebooks
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include "vorbis_custom_data_wwise.h"
int main(void) {
#if 1
for (int ai = 0; ai < 0x256; ++ai) {
const wvc_info * ao = &wvc_list_aotuv603[ai];
@hcs64
hcs64 / script.txt
Last active July 4, 2022 08:43
Original Add Man
title Add Man
author Adam Gashlin
homepage gashlin.net
key_repeat_interval 0.5
noaction
========
OBJECTS
========
@hcs64
hcs64 / script.txt
Last active July 4, 2022 08:28
Time Loop
title Time Loop wip
author Adam Gashlin
homepage gashlin.net
key_repeat_interval 0.25
========
OBJECTS
========
@hcs64
hcs64 / readme.txt
Last active May 11, 2022 16:57 — forked from anonymous/readme.txt
Add Man 2
Play this game by pasting the script in http://www.puzzlescript.net/editor.html
@hcs64
hcs64 / ucode.asm
Created May 31, 2020 13:35
4bpp and 8bpp conversions
// RSP ucode for converting 2bpp NES to 4bpp and 8bpp N64
// TODO sprite priority
align(8)
scope Ucode: {
InitialDMEM:
pushvar base
base 0x0000
@hcs64
hcs64 / PPU2BPPTile8x8.asm
Created May 13, 2020 05:57
Faster PPU swizzle ucode
// N64 'Bare Metal' 16BPP 272x240 SNES PPU 2BPP Tile 8x8 Demo by krom (Peter Lemon):
// Modified for faster vector ops and benchmark output (count register) by hcs:
arch n64.cpu
endian msb
output "PPU2BPPTile8x8.N64", create
fill 1052672 // Set ROM Size
origin $00000000
base $80000000 // Entry Point Of Code
include "LIB/N64.INC" // Include N64 Definitions
@hcs64
hcs64 / Bugzilla hide by user.user.js
Last active November 15, 2018 18:08
Hide all Bugzilla comments by an author
// ==UserScript==
// @name Bugzilla hide by user
// @description Add a button to hide all comments by a user.
// @author Adam Gashlin <agashlin@mozilla.com>
// @version 4
// @grant none
// @match https://bugzilla.mozilla.org/*
// ==/UserScript==
function quoteCssString(s) {
@hcs64
hcs64 / readme.md
Last active October 25, 2018 16:39
Example of using a Rust crate in a binary

This creates a crate called lib_test in toolkit/mozapps/update/rust and links it into the updater.

Because we're only currently allowing one Rust static library per C++ program (see bug 1310063) it may be best to introduce a level of indirection in case we want to include any other Rust in the updater, e.g. an updater_rust crate that just reexports everything. toolkit/library/rust uses this setup.

The lib_test.h file for inclusion in C++ came out of cbindgen, it seems like we manually run that rather than autogenerating as part of the build, you can find some instructions in another such file at source/gfx/webrender_bindings/webrender_ffi_generated.h

Though... we added cbindgen to the build environment, so we may be able to use it to generate a header as in [bug 1478813](https://bugzil

@hcs64
hcs64 / main.cpp
Last active August 28, 2018 20:54
Fullscreen test
#include <windows.h>
#include <shobjidl.h>
void MarkFullscreen(HWND hWnd, bool fullscreen);
void
Fullscreen(HWND hWnd, bool removeFrame, bool fillScreen, bool less1Width, bool mark)
{
if (removeFrame) {
LONG_PTR style = GetWindowLong(hWnd, GWL_STYLE);