Skip to content

Instantly share code, notes, and snippets.

@heisvoid
heisvoid / gist:3048493
Created July 4, 2012 17:32
~/.fonts.conf for Chromium font rendering on Arch Linux
<!--?xml version="1.0"?-->
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- /etc/fonts/fonts.conf file to configure system font access -->
<fontconfig>
<!-- workaround for wrong style and weight in NanumTTF 2.020 -->
<match target="scan">
<test name="fullname" qual="any" compare="eq">
<string>NanumMyeongjoBold</string><string>나눔명조 Bold</string>
<string>NanumGothicBold</string><string>나눔고딕 Bold</string>
@heisvoid
heisvoid / main.c
Created September 15, 2012 01:36
Maplestory AD Killer
/*
* Maplestory AD Killer
*
* Copyright (C) 2012 heisvoid
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or (at
* your option) any later version.
*
@heisvoid
heisvoid / dump_one_palette.sh
Created May 29, 2014 11:20
Dump palette data from PCX
file_len=`stat -c %s "$1"`
pal_ofs=$(($file_len - 768))
dd if="$1" skip=$pal_ofs ibs=1 bs=1 count=768
@heisvoid
heisvoid / twgspr.magic
Created May 29, 2014 11:57
Magic file for TWG compressed sprite file
0 string New TWG Sprite
@heisvoid
heisvoid / structure_of_sprite_type_0_in_twg.txt
Last active July 20, 2019 10:24
Structure of sprite type 0 in TWG
offset length description
0 0x42 header string
0x42 2 number of sprites <N>
0x44 60 zero padding bytes
0x80 x N * (each sprite)
each sprite
offset length description
0 4 total length of compressed data <L>
4 2 width. 320 >= width
@heisvoid
heisvoid / extract_sprite.py
Last active July 20, 2019 10:31
Extract sprite file in TWG
# -*- coding: utf-8 -*-
# Extract sprites
import argparse
import struct
import os
# mode 13h resolution
MONITOR_WIDTH = 320
@heisvoid
heisvoid / chkspr0.py
Last active July 20, 2019 10:28
Verify type 0 sprite file in TWG
# -*- coding: utf-8 -*-
import argparse
import struct
import os
parser = argparse.ArgumentParser(description='Check sprite file.')
parser.add_argument('-f', required=True, help='sprite file', dest='spr')
args = parser.parse_args()
@heisvoid
heisvoid / chkspr3.py
Last active August 29, 2015 14:02
Verify /characte/*.nc2, *.bcr, *.wcr, *.mar, *.rcr in TWG
# -*- coding: utf-8 -*-
# .nc2, .bcr, .wcr, .mar, .rcr
import argparse
import struct
import os
parser = argparse.ArgumentParser(description='Verify sprite file.')
parser.add_argument('-f', required=True, help='sprite file', dest='spr')
@heisvoid
heisvoid / chkspr1.py
Last active July 20, 2019 10:36
Verify sprite type 1 in TWG
# -*- coding: utf-8 -*-
import argparse
import struct
import os
parser = argparse.ArgumentParser(description='Verify sprite file.')
parser.add_argument('-f', required=True, help='sprite file', dest='spr')
args = parser.parse_args()
@heisvoid
heisvoid / chkspr2.py
Last active July 20, 2019 10:45
Verify sprite type 2 in TWG
# -*- coding: utf-8 -*-
import argparse
import struct
import os
parser = argparse.ArgumentParser(description='Verify sprite file.')
parser.add_argument('-f', required=True, help='sprite file', dest='spr')
args = parser.parse_args()