Skip to content

Instantly share code, notes, and snippets.

@Zinfidel
Zinfidel / net-receive.lua
Created August 29, 2021 19:14
Scripts for force-syncing movies in BizHawk (particularly N64 movies with different plug-in settings). See http://tasvideos.org/Zinfidel/SyncScripts.html for usage.
package.path = package.path .. ';luasocket/lua/?.lua;luasocket/lua/socket/?.lua'
package.cpath = package.cpath .. ';luasocket/?.dll;luasocket/mime/?.dll;luasocket/socket/?.dll'
local socket = require 'socket'
local socClient
local server
local onExitEvent = event.onexit(
function()
socClient:close()
@Zinfidel
Zinfidel / osample.c
Last active May 9, 2021 00:15
Opus original sample tag replacer
// See RFC 3533 for ogg header format (https://tools.ietf.org/html/rfc3533#section-6)
// See RFC 7845 for opus header format (https://tools.ietf.org/html/rfc7845#section-5)
#include <stdio.h>
#include <string.h>
#include "osample.h"
static word32 crc_table[256]; // Table of 8-bit remainders for crc
int main(int argc, char* argv[]) {
@Zinfidel
Zinfidel / hm-rng.lua
Last active January 15, 2020 22:02
SNES Harvest Moon BizHawk Scripts
--[[
Harvest Moon RNG Prediction Script for BizHawk
By Zinfidel
For Harvest Moon [SNES] [NTSC]
Harvest Moon's RNG Function:
The game's program uses a 24-bit, overlapped linear-feedback XORshift register for RNG values. It is
updated at least once per game engine loop. It is also updated an extra 1 time if there are any
actors on the screen, and once per vblank of the screen. The RNG assembler is presented at the bottom
of this script. The full RNG value is 24-bits long, but only the top 8 bits are returned and used. The
@Zinfidel
Zinfidel / ac_core.lua
Last active April 8, 2023 10:54
PSX Armored Core Overlay Scripts for BizHawk
--[[
Armored Core Common Script for BizHawk
By Zinfidel
For Armored Core 1.1 [SLUS-01323] [NTSC]
This is a common library for various other scripts for Armored Core. It does not need to be "run" by Bizhawk
but is instead referenced by other scripts. There are some constants that the user should set below, and if
they are changed while other scripts are running, the core script should be loaded into the lua console and
refreshed to updates the values.
--]]