Skip to content

Instantly share code, notes, and snippets.

View gocha's full-sized avatar

gocha gocha

View GitHub Profile
@gocha
gocha / gist:11390609
Last active August 29, 2015 14:00
BizHawk: vargs support for LuaInterface (ported from NLua <https://github.com/NLua/NLua>, thanks a lot). Dirty test: <http://pastebin.com/d03N93z8>
Index: LuaInterface/LuaInterface/Metatables.cs
===================================================================
--- LuaInterface/LuaInterface/Metatables.cs (revision 6441)
+++ LuaInterface/LuaInterface/Metatables.cs (working copy)
@@ -745,6 +745,55 @@
LuaDLL.lua_pushnil(luaState);
return 1;
}
+ private static bool IsInteger(double x) {
+ return Math.Ceiling(x) == x;
@gocha
gocha / ida-hirom-test.asm
Last active August 29, 2015 14:19
IDA HiROM address test
.HIROM
; snes_header is actually broken
.SNESHEADER
ID "IDAX"
NAME "IDA HIROM TEST "
HIROM
FASTROM
CARTRIDGETYPE $02
ROMSIZE $0C
@gocha
gocha / ida-lorom-test.asm
Created April 24, 2015 14:38
IDA LoROM address test
.LOROM
; snes_header is actually broken
.SNESHEADER
ID "IDAX"
NAME "IDA LOROM TEST "
LOROM
FASTROM
CARTRIDGETYPE $02
ROMSIZE $0C
@gocha
gocha / goemon3-hanabi-sim.lua
Created May 8, 2015 22:20
Ganbare Goemon 3 - Hanabi Shuffle Simulator
if not bit then
bit = require("bit")
end
function Goemon3HanabiOrder(hanabi_num, initial_rng)
local next_rng = function(a, x)
local data_80 = {
0x18, 0xfb, 0x78, 0xd8, 0xc2, 0x30, 0xa2, 0xaf,
0x01, 0x9a, 0xc2, 0x30, 0x8b, 0xa9, 0x00, 0x00,
0x8f, 0x00, 0x00, 0x00, 0xa9, 0xfd, 0x1f, 0xa2,
@gocha
gocha / CMakeLists.txt
Last active June 2, 2016 04:08
Minimal CMakeLists.txt for craigsapp's midifile library
cmake_minimum_required(VERSION 2.8)
project(midifile CXX)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(VERSION "0.0.0")
include_directories(include)
@gocha
gocha / midifile.autopkg
Last active June 2, 2016 06:03
CoApp AutoPackage script for greedy NuGet package of midifile library
configurations {
Toolset {
key: "PlatformToolset";
choices: { v140, v140_xp, v120, v120_xp };
};
Configuration {
key: "Configuration";
choices: { Release, Debug };
};
@gocha
gocha / fmt.autopkg
Last active June 2, 2016 05:20
CoApp AutoPackage script for greedy NuGet package of fmt library
configurations {
Toolset {
key: "PlatformToolset";
choices: { v140, v140_xp, v120, v120_xp };
};
Configuration {
key: "Configuration";
choices: { Release, Debug };
};
@gocha
gocha / pugixml.autopkg
Last active June 2, 2016 05:54
CoApp AutoPackage script for greedy NuGet package of pugixml library
configurations {
Toolset {
key: "PlatformToolset";
choices: { v140, v140_xp, v120, v120_xp };
};
Configuration {
key: "Configuration";
choices: { Release, Debug };
};
@gocha
gocha / zlib.autopkg
Created June 2, 2016 05:59
CoApp AutoPackage script for greedy NuGet package of zlib library
configurations {
Toolset {
key: "PlatformToolset";
choices: { v140, v140_xp, v120, v120_xp };
};
Configuration {
key: "Configuration";
choices: { Release, Debug };
};
@gocha
gocha / stoimax.hpp
Created June 10, 2016 00:38
C++ wrapper for strtoimax and strtoumax.
/// @file
/// C++ wrapper for strtoimax and strtoumax.
#ifndef STOIMAX_
#define STOIMAX_
#include <cinttypes>
#include <string>
/// Interprets an unsigned integer value in the string.