Skip to content

Instantly share code, notes, and snippets.

View ChillMagic's full-sized avatar

Chill Magic ChillMagic

View GitHub Profile
@ChillMagic
ChillMagic / convert.py
Last active June 13, 2025 06:50
Convert 0cc-FamiTracker txt to midi
import enum
import dataclasses
from typing import Union, Dict, List, Optional
import sys
import re
from mido import MidiFile, Message, MetaMessage
import argparse
from pathlib import Path
ChannelTypeName = {
@ChillMagic
ChillMagic / dumpopcode.hpp
Last active July 21, 2024 02:07
8086 decoder
#include <string>
#include <vector>
const char *getOpcodeKindName(const OpcodeKind &kind) {
switch (kind) {
case OpcodeKind::Original: return "Original";
case OpcodeKind::Move: return "Move";
case OpcodeKind::Store: return "Store";
case OpcodeKind::LoadEA: return "LoadEA";
case OpcodeKind::LoadES: return "LoadES";
@ChillMagic
ChillMagic / convert_rpgmaker_2000_2003_tilesets.gd
Last active June 18, 2024 08:30
Convert RPG Maker 2000/2003 Chipset to Godot 4 Tileset
@tool
extends EditorScript
class Rect2iIterator:
var _begin: Vector2i
var _current: Vector2i
var _rect: Rect2i
static func from_vector2(vector2: Vector2i) -> Rect2iIterator:
@ChillMagic
ChillMagic / arg2cmdline.c
Last active June 11, 2024 16:24
Windows C function `arg2cmdline` and `arglist2cmdline` (aka `ArgvToCommandLineW` you need)
// Referenced the implementation of list2cmdline from CPython's subprocess.py.
#include <wchar.h>
#include <stdlib.h>
static void _append_bs(wchar_t **current, size_t bs_count) {
for (size_t i = 0; i < bs_count; i++) {
**current = '\\';
(*current)++;
}
@ChillMagic
ChillMagic / CMakeLists.txt
Last active December 9, 2020 12:45
Clang Demo
cmake_minimum_required(VERSION 3.5)
project(clangtest)
# Search LLVM
find_package(LLVM REQUIRED CONFIG
HINTS "${LLVM_INSTALL_PREFIX}/lib/cmake/llvm")
find_package(Clang REQUIRED CONFIG
HINTS "${LLVM_INSTALL_PREFIX}/lib/cmake/clang")
include_directories(${LLVM_INCLUDE_DIRS})
@ChillMagic
ChillMagic / SMRC.rb
Last active November 21, 2017 07:34
SMRC : A High-Speed Script of Accessible Area for 4 directions Map
#==============================================================================
# SMRC.rb
# Author : Chill
# Version : 5.2.0.3 BETA
# Date(V5) : 2015-06-20 to 2016-02-23
# Description: SRPG on Map of Ruby by Chill.
#==============================================================================
#=================================================
# Basic Method