Skip to content

Instantly share code, notes, and snippets.

@infval
infval / qd2fds.py
Last active November 21, 2024 04:40 — forked from einstein95/qd2fds.py
Converts between QD and FDS disk images (Family Computer Disk System / Famicom)
#!/usr/bin/env python3
"""
Converts between QD and FDS disk images
"""
import struct
def create_fds_header(side_count):
return b"FDS\x1A" + bytes([side_count & 0xFF]) + bytes(11)
@infval
infval / translate.py
Last active February 3, 2020 18:05
Translate characters
#!/usr/bin/env python3
import argparse
from pathlib import Path
parser = argparse.ArgumentParser(description='Translate characters')
parser.add_argument('input', help='input file')
parser.add_argument('table', help='table file, "A=Z\\nB=2\\nK=M"')
parser.add_argument('output', help='output file')
parser.add_argument('-e', '--encoding', default="utf-8",
@infval
infval / ps2_psiops_movies_packer.py
Created March 21, 2020 21:40
[PS2] Psi-Ops MOVIES.MPK unpacker / packer (PlayStation 2, Psi-Ops: The Mindgate Conspiracy)
#!/usr/bin/env python3
__version__ = "1.0"
__author__ = "infval"
import argparse
from pathlib import Path
from struct import unpack, pack
@infval
infval / draw_round_numbers.py
Created April 4, 2020 21:42
Draw Round Numbers (Circle) | Python 3 + PIL
#!/usr/bin/env python3
from PIL import Image
from PIL import ImageDraw
FACTOR = 4 # Super sampling
H = 256 * FACTOR
HGAP = 16 * FACTOR
WLINE = 16 * FACTOR
numbers = (
@infval
infval / psx_fix_license.py
Last active June 14, 2022 21:29
Fix pirated PlayStation 1 BIN for OpenEmu, Mednafen | Исправление пиратских PlayStation 1 дисков для запуска на эмуляторах [ PSX, PS1, PSOne ]
#!/usr/bin/env python3
"""Fix pirated PlayStation 1 BIN for OpenEmu, Mednafen
usage:
script.py Image.bin [0|1|2]
0 - Japan, 1 - USA, 2 - Europe. Default: 1
examples:
script.py "Chrono Cross (USA) (Disc 1).bin"
script.py "Chrono Cross (USA) (Disc 1).bin" 1
script.py "Sexy Parodius (Japan).bin" 0
@infval
infval / sfd_demux.py
Last active April 22, 2025 15:17
Batch SFD mux / demux (Multiplexer / DeMultiplexer) | M1V, ADX, SFA | Python 3, ffmpeg, SFDmux
#!/usr/bin/env python3
from pathlib import Path
from os import system
import sys
overwrite = ''
if len(sys.argv) > 1 and sys.argv[1] == '-y':
overwrite = '-y'
p = Path('.')
@infval
infval / yuzuUpdater_mediafire.py
Last active July 6, 2020 00:26
Update yuzu EA from mediafire folder
#!/usr/bin/env python3
__version__ = '1.0.1'
import os
import re
import sys
import json
import shutil
import zipfile
@infval
infval / zudugo_fixer.py
Last active July 15, 2020 17:00
Fix Zudu-go ROM | 2udu-go, zudugo.bin (Macro Winners / Waixing) | CRC32: 0FA9D9AD | Python 3 | Emulators: NintendulatorNRS, MAME, EmuVT
#!/usr/bin/env python3
"""
Input: zudugo.bin (CRC32: 0FA9D9AD)
Usage:
script.py zudugo.bin
License: Unlicense
"""
__version__ = '1.0.0'
__author__ = "infval"
@infval
infval / Script-ImportTMX.cs
Last active January 26, 2021 16:26
Import TMX - CadEditor
using CadEditor;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.IO.Compression;
using System.Xml.Linq;
using System.Windows.Forms;
@infval
infval / Puggsy_(U)_Free_Player.lua
Last active March 30, 2021 09:35
Puggsy (U) | Free Player (Camera) | Lua, BizHawk, Sega Mega Drive / Genesis
-- For BizHawk
local player_x_addr = 0x06E0
local player_y_addr = 0x06E2
local cam_x_addr = 0x05BA
local cam_y_addr = 0x05BC
local invincibility_addr = 0x0728
local step = 1
local prev_keys = {}
local prev_mouse = {}