This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# By Pigu | |
# Usage: dmf2pmd.py <input.dmf> <output.txt> | |
import io, math, string, sys, zlib | |
poke = lambda c,o,a,d: "y{},{}".format(a+(c%3)+o*4,d) | |
timerB = lambda x: math.floor(256.5-(10400/3/x)) | |
u8 = lambda x: int.from_bytes(x.read(1),byteorder="little") | |
s16 = lambda x: int.from_bytes(x.read(2),byteorder="little",signed=True) | |
s32 = lambda x: int.from_bytes(x.read(4),byteorder="little",signed=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- MDT filename is the only command line argument | |
local schar = function (f) | |
local z = string.byte(f:read(1)) | |
return z >= 0x80 and z - 0x100 or z | |
end | |
local char = function (f) | |
return string.byte(f:read(1)) | |
end | |
local sshort = function (f) |