Last active
September 17, 2016 14:53
-
-
Save HertzDevil/f0ac0f922ca8199c153afbcf475b632f to your computer and use it in GitHub Desktop.
how to write an MML decompiler
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
#! /usr/bin/lua | |
-- This Source Code Form is subject to the terms of the Mozilla Public | |
-- License, v. 2.0. If a copy of the MPL was not distributed with this | |
-- file, You can obtain one at http://mozilla.org/MPL/2.0/. | |
require "util.stringfuncs" | |
local Dumper = require "util.streamdumper" | |
local name = arg[1] | |
local s = Dumper() | |
s:setWidth(12) | |
s:add(0xE8, "uint8") | |
s:add(0xEA, "uint8") | |
s:add(0xEB, "uint8") | |
s:add(0xEF) | |
s:name "[":add(0xF0, "uint8") | |
s:name "]":add(0xF1) | |
s:final():add(0xF2, "uint16") | |
s:name "[":add(0xF3, "uint8") | |
s:name "]":add(0xF4) | |
s:add(0xF5, "uint8", "uint8") | |
s:add(0xF8, "uint8") | |
s:add(0xF9, "uint8", "uint8") | |
s:add(0xFA, "uint8") | |
s:add(0xFB, "uint8", "uint8", "uint8", "uint8") | |
s:add(0xFD, "uint8") | |
s:name "/*END*/":final():add(0xFF) | |
for i = 0xD0, 0xD7 do | |
s:name("o" .. (0xD7 - i)):add(i) | |
end | |
local notestr = {"c", "c+", "d", "d+", "e", "f", "f+", "g", "g+", "a", "a+", "b", "r"} | |
local lenstr = { "16", "8", "8.", "4", "4^16", "4.", "4..", "2", | |
"2^16", "2^8", "2^8.", "2.", "2.^16", "2..", "2...", "1"} | |
for i, n in ipairs(notestr) do for j, l in ipairs(lenstr) do | |
s:name(n .. l):add((i - 1) * 0x10 + (j - 1)) | |
end end | |
local f = io.open(name .. ".nsf", "rb") | |
local bin = f:read "*a" | |
f:close() | |
local adr; do | |
local LOAD = bin:readint(2, false, 0x8 + 1) | |
adr = function (x) | |
return bin:readint(2, false, x + 1) - LOAD + 0x80 | |
end; end | |
for track = 1, 14 do | |
io.output(io.open(("%s-%02d.mml"):format(name, track), "w")) | |
for ch = 1, 4 do | |
local streamadr = adr(adr(0x8F + 2 * (track - 1)) + 2 * ch) | |
local mml, suc = s:dump(bin, streamadr + 1, ("!%d"):format(ch)) | |
io.write(mml) | |
assert(suc) | |
end | |
end | |
io.output(io.open("engine/" .. name .. ".lua", "w")) | |
io.write(s:makeGrammar()) |
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
; Stream address: $1B9C - $1BDD (66 bytes) | |
!1 `0hFD,7 `0hFA,56 `0hFB,17,20,3,18 `0hE8,27 | |
`0hF9,14,82 o5 `0hF5,201,186 [2 o6 d+16 c16 | |
o5 g+16 ] o6 d+16 c16 [2 o6 d16 o5 a+16 | |
f16 ] o6 d16 o5 a+16 `0hF5,201,186 o6 d+16 d+16 | |
r16 g16 g16 r16 o7 c16 c16 r16 d16 o6 d16 d16 | |
e16 e16 f16 f16 `0hF2,47600 | |
; Stream address: $1BDE - $1C19 (60 bytes) | |
!2 `0hFD,7 `0hFA,120 `0hFB,17,19,3,18 `0hE8,20 | |
`0hF9,14,82 o6 `0hF5,178,186 d+16 c16 g16 d+16 c16 | |
g16 d+16 f16 d16 o5 a+16 o6 f16 d16 o5 a+16 o6 | |
f16 d16 `0hF5,178,186 g16 r16 o7 c16 c16 r16 d+16 | |
d+16 r16 g16 o6 g16 g16 a16 a16 b16 b16 | |
`0hF2,47667 | |
; Stream address: $1C1A - $1C6B (82 bytes) | |
!3 `0hFD,7 `0hFA,144 `0hFB,0,0,2,0 o5 c2... | |
c16 d+2... d+16 f2... f16 o4 g+8 o5 g+16 o4 g+16 g+16 | |
o5 g+8. o4 a+8 o5 a+16 o4 a+16 a+16 o5 a+8. c8 | |
c8 c16 c16 c8 c16 c16 c16 c8 c16 c8 d+8 d+8 | |
d+16 d+16 d+8 d+16 d+16 d+16 d+8 d+16 d+8 f8 f8 f16 | |
f16 f8 f16 f16 f16 f8 f16 f8 [3 g16 g8 | |
] g16 g16 g16 g16 f16 d+16 d16 `0hF2,47722 | |
; Stream address: $1C99 - $1CD8 (64 bytes) | |
!4 `0hFD,7 [3 c8 d16 c+16 d+8 d16 c+16 d+8 | |
d16 c+16 d+8 d16 c16 ] c16 c+16 f16 c+16 c16 f8 | |
c16 c16 c+16 f16 c+16 f16 f16 c16 f16 [3 c16 | |
c+16 f16 c+16 c16 c16 f16 c+16 c16 c16 f16 c16 c+16 | |
c16 f16 c+16 ] [4 f+16 f16 c16 ] f+16 f+16 | |
f+16 f+16 `0hF2,47841 | |
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
local Default = require "default" | |
local MML = require "mml" | |
local builder = MML.CmdBuilder() | |
local engine = Default.Engine() | |
builder:setTable(engine.parser.macros) | |
local Channel = engine.channel.__mt.__index | |
local Song = engine.song.__mt.__index | |
builder:setHandler(function (ch) | |
ch:addChunk(0xFF) | |
end):make "/*END*/" | |
builder:setHandler(function (ch, x1) | |
ch:addChunk(0xF3, x1) | |
end):param "Uint8":make "[" | |
builder:setHandler(function (ch) | |
ch:addChunk(0xF4) | |
end):make "]" | |
builder:setHandler(function (ch, x1) | |
ch:addChunk(0xE8, x1) | |
end):param "Uint8":make "`0hE8," | |
builder:setHandler(function (ch, x1) | |
ch:addChunk(0xEA, x1) | |
end):param "Uint8":make "`0hEA," | |
builder:setHandler(function (ch, x1) | |
ch:addChunk(0xEB, x1) | |
end):param "Uint8":make "`0hEB," | |
builder:setHandler(function (ch) | |
ch:addChunk(0xEF) | |
end):make "`0hEF," | |
builder:setHandler(function (ch, x1) | |
ch:addChunk(0xF2, x1 % 0x100, math.floor(x1 / 0x100)) | |
end):param "Uint16":make "`0hF2," | |
builder:setHandler(function (ch, x1, x2) | |
ch:addChunk(0xF5, x1, x2) | |
end):param "Uint8":param "Uint8":make "`0hF5," | |
builder:setHandler(function (ch, x1) | |
ch:addChunk(0xF8, x1) | |
end):param "Uint8":make "`0hF8," | |
builder:setHandler(function (ch, x1, x2) | |
ch:addChunk(0xF9, x1, x2) | |
end):param "Uint8":param "Uint8":make "`0hF9," | |
builder:setHandler(function (ch, x1) | |
ch:addChunk(0xFA, x1) | |
end):param "Uint8":make "`0hFA," | |
builder:setHandler(function (ch, x1, x2, x3, x4) | |
ch:addChunk(0xFB, x1, x2, x3, x4) | |
end):param "Uint8":param "Uint8":param "Uint8":param "Uint8":make "`0hFB," | |
builder:setHandler(function (ch, x1) | |
ch:addChunk(0xFD, x1) | |
end):param "Uint8":make "`0hFD," | |
builder:setHandler(function (ch) | |
ch:addChunk(0xAF) | |
end):make "a+1" | |
builder:setHandler(function (ch) | |
ch:addChunk(0xA0) | |
end):make "a+16" | |
builder:setHandler(function (ch) | |
ch:addChunk(0xA7) | |
end):make "a+2" | |
builder:setHandler(function (ch) | |
ch:addChunk(0xAB) | |
end):make "a+2." | |
builder:setHandler(function (ch) | |
ch:addChunk(0xAD) | |
end):make "a+2.." | |
builder:setHandler(function (ch) | |
ch:addChunk(0xAE) | |
end):make "a+2..." | |
builder:setHandler(function (ch) | |
ch:addChunk(0xAC) | |
end):make "a+2.^16" | |
builder:setHandler(function (ch) | |
ch:addChunk(0xA8) | |
end):make "a+2^16" | |
builder:setHandler(function (ch) | |
ch:addChunk(0xA9) | |
end):make "a+2^8" | |
builder:setHandler(function (ch) | |
ch:addChunk(0xAA) | |
end):make "a+2^8." | |
builder:setHandler(function (ch) | |
ch:addChunk(0xA3) | |
end):make "a+4" | |
builder:setHandler(function (ch) | |
ch:addChunk(0xA5) | |
end):make "a+4." | |
builder:setHandler(function (ch) | |
ch:addChunk(0xA6) | |
end):make "a+4.." | |
builder:setHandler(function (ch) | |
ch:addChunk(0xA4) | |
end):make "a+4^16" | |
builder:setHandler(function (ch) | |
ch:addChunk(0xA1) | |
end):make "a+8" | |
builder:setHandler(function (ch) | |
ch:addChunk(0xA2) | |
end):make "a+8." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x9F) | |
end):make "a1" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x90) | |
end):make "a16" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x97) | |
end):make "a2" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x9B) | |
end):make "a2." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x9D) | |
end):make "a2.." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x9E) | |
end):make "a2..." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x9C) | |
end):make "a2.^16" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x98) | |
end):make "a2^16" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x99) | |
end):make "a2^8" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x9A) | |
end):make "a2^8." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x93) | |
end):make "a4" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x95) | |
end):make "a4." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x96) | |
end):make "a4.." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x94) | |
end):make "a4^16" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x91) | |
end):make "a8" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x92) | |
end):make "a8." | |
builder:setHandler(function (ch) | |
ch:addChunk(0xBF) | |
end):make "b1" | |
builder:setHandler(function (ch) | |
ch:addChunk(0xB0) | |
end):make "b16" | |
builder:setHandler(function (ch) | |
ch:addChunk(0xB7) | |
end):make "b2" | |
builder:setHandler(function (ch) | |
ch:addChunk(0xBB) | |
end):make "b2." | |
builder:setHandler(function (ch) | |
ch:addChunk(0xBD) | |
end):make "b2.." | |
builder:setHandler(function (ch) | |
ch:addChunk(0xBE) | |
end):make "b2..." | |
builder:setHandler(function (ch) | |
ch:addChunk(0xBC) | |
end):make "b2.^16" | |
builder:setHandler(function (ch) | |
ch:addChunk(0xB8) | |
end):make "b2^16" | |
builder:setHandler(function (ch) | |
ch:addChunk(0xB9) | |
end):make "b2^8" | |
builder:setHandler(function (ch) | |
ch:addChunk(0xBA) | |
end):make "b2^8." | |
builder:setHandler(function (ch) | |
ch:addChunk(0xB3) | |
end):make "b4" | |
builder:setHandler(function (ch) | |
ch:addChunk(0xB5) | |
end):make "b4." | |
builder:setHandler(function (ch) | |
ch:addChunk(0xB6) | |
end):make "b4.." | |
builder:setHandler(function (ch) | |
ch:addChunk(0xB4) | |
end):make "b4^16" | |
builder:setHandler(function (ch) | |
ch:addChunk(0xB1) | |
end):make "b8" | |
builder:setHandler(function (ch) | |
ch:addChunk(0xB2) | |
end):make "b8." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x1F) | |
end):make "c+1" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x10) | |
end):make "c+16" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x17) | |
end):make "c+2" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x1B) | |
end):make "c+2." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x1D) | |
end):make "c+2.." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x1E) | |
end):make "c+2..." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x1C) | |
end):make "c+2.^16" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x18) | |
end):make "c+2^16" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x19) | |
end):make "c+2^8" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x1A) | |
end):make "c+2^8." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x13) | |
end):make "c+4" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x15) | |
end):make "c+4." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x16) | |
end):make "c+4.." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x14) | |
end):make "c+4^16" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x11) | |
end):make "c+8" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x12) | |
end):make "c+8." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x0F) | |
end):make "c1" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x00) | |
end):make "c16" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x07) | |
end):make "c2" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x0B) | |
end):make "c2." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x0D) | |
end):make "c2.." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x0E) | |
end):make "c2..." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x0C) | |
end):make "c2.^16" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x08) | |
end):make "c2^16" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x09) | |
end):make "c2^8" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x0A) | |
end):make "c2^8." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x03) | |
end):make "c4" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x05) | |
end):make "c4." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x06) | |
end):make "c4.." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x04) | |
end):make "c4^16" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x01) | |
end):make "c8" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x02) | |
end):make "c8." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x3F) | |
end):make "d+1" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x30) | |
end):make "d+16" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x37) | |
end):make "d+2" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x3B) | |
end):make "d+2." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x3D) | |
end):make "d+2.." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x3E) | |
end):make "d+2..." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x3C) | |
end):make "d+2.^16" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x38) | |
end):make "d+2^16" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x39) | |
end):make "d+2^8" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x3A) | |
end):make "d+2^8." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x33) | |
end):make "d+4" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x35) | |
end):make "d+4." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x36) | |
end):make "d+4.." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x34) | |
end):make "d+4^16" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x31) | |
end):make "d+8" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x32) | |
end):make "d+8." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x2F) | |
end):make "d1" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x20) | |
end):make "d16" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x27) | |
end):make "d2" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x2B) | |
end):make "d2." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x2D) | |
end):make "d2.." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x2E) | |
end):make "d2..." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x2C) | |
end):make "d2.^16" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x28) | |
end):make "d2^16" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x29) | |
end):make "d2^8" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x2A) | |
end):make "d2^8." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x23) | |
end):make "d4" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x25) | |
end):make "d4." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x26) | |
end):make "d4.." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x24) | |
end):make "d4^16" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x21) | |
end):make "d8" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x22) | |
end):make "d8." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x4F) | |
end):make "e1" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x40) | |
end):make "e16" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x47) | |
end):make "e2" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x4B) | |
end):make "e2." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x4D) | |
end):make "e2.." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x4E) | |
end):make "e2..." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x4C) | |
end):make "e2.^16" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x48) | |
end):make "e2^16" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x49) | |
end):make "e2^8" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x4A) | |
end):make "e2^8." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x43) | |
end):make "e4" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x45) | |
end):make "e4." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x46) | |
end):make "e4.." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x44) | |
end):make "e4^16" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x41) | |
end):make "e8" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x42) | |
end):make "e8." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x6F) | |
end):make "f+1" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x60) | |
end):make "f+16" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x67) | |
end):make "f+2" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x6B) | |
end):make "f+2." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x6D) | |
end):make "f+2.." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x6E) | |
end):make "f+2..." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x6C) | |
end):make "f+2.^16" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x68) | |
end):make "f+2^16" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x69) | |
end):make "f+2^8" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x6A) | |
end):make "f+2^8." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x63) | |
end):make "f+4" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x65) | |
end):make "f+4." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x66) | |
end):make "f+4.." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x64) | |
end):make "f+4^16" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x61) | |
end):make "f+8" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x62) | |
end):make "f+8." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x5F) | |
end):make "f1" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x50) | |
end):make "f16" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x57) | |
end):make "f2" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x5B) | |
end):make "f2." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x5D) | |
end):make "f2.." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x5E) | |
end):make "f2..." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x5C) | |
end):make "f2.^16" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x58) | |
end):make "f2^16" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x59) | |
end):make "f2^8" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x5A) | |
end):make "f2^8." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x53) | |
end):make "f4" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x55) | |
end):make "f4." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x56) | |
end):make "f4.." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x54) | |
end):make "f4^16" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x51) | |
end):make "f8" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x52) | |
end):make "f8." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x8F) | |
end):make "g+1" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x80) | |
end):make "g+16" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x87) | |
end):make "g+2" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x8B) | |
end):make "g+2." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x8D) | |
end):make "g+2.." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x8E) | |
end):make "g+2..." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x8C) | |
end):make "g+2.^16" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x88) | |
end):make "g+2^16" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x89) | |
end):make "g+2^8" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x8A) | |
end):make "g+2^8." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x83) | |
end):make "g+4" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x85) | |
end):make "g+4." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x86) | |
end):make "g+4.." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x84) | |
end):make "g+4^16" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x81) | |
end):make "g+8" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x82) | |
end):make "g+8." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x7F) | |
end):make "g1" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x70) | |
end):make "g16" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x77) | |
end):make "g2" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x7B) | |
end):make "g2." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x7D) | |
end):make "g2.." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x7E) | |
end):make "g2..." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x7C) | |
end):make "g2.^16" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x78) | |
end):make "g2^16" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x79) | |
end):make "g2^8" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x7A) | |
end):make "g2^8." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x73) | |
end):make "g4" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x75) | |
end):make "g4." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x76) | |
end):make "g4.." | |
builder:setHandler(function (ch) | |
ch:addChunk(0x74) | |
end):make "g4^16" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x71) | |
end):make "g8" | |
builder:setHandler(function (ch) | |
ch:addChunk(0x72) | |
end):make "g8." | |
builder:setHandler(function (ch) | |
ch:addChunk(0xD7) | |
end):make "o0" | |
builder:setHandler(function (ch) | |
ch:addChunk(0xD6) | |
end):make "o1" | |
builder:setHandler(function (ch) | |
ch:addChunk(0xD5) | |
end):make "o2" | |
builder:setHandler(function (ch) | |
ch:addChunk(0xD4) | |
end):make "o3" | |
builder:setHandler(function (ch) | |
ch:addChunk(0xD3) | |
end):make "o4" | |
builder:setHandler(function (ch) | |
ch:addChunk(0xD2) | |
end):make "o5" | |
builder:setHandler(function (ch) | |
ch:addChunk(0xD1) | |
end):make "o6" | |
builder:setHandler(function (ch) | |
ch:addChunk(0xD0) | |
end):make "o7" | |
builder:setHandler(function (ch) | |
ch:addChunk(0xCF) | |
end):make "r1" | |
builder:setHandler(function (ch) | |
ch:addChunk(0xC0) | |
end):make "r16" | |
builder:setHandler(function (ch) | |
ch:addChunk(0xC7) | |
end):make "r2" | |
builder:setHandler(function (ch) | |
ch:addChunk(0xCB) | |
end):make "r2." | |
builder:setHandler(function (ch) | |
ch:addChunk(0xCD) | |
end):make "r2.." | |
builder:setHandler(function (ch) | |
ch:addChunk(0xCE) | |
end):make "r2..." | |
builder:setHandler(function (ch) | |
ch:addChunk(0xCC) | |
end):make "r2.^16" | |
builder:setHandler(function (ch) | |
ch:addChunk(0xC8) | |
end):make "r2^16" | |
builder:setHandler(function (ch) | |
ch:addChunk(0xC9) | |
end):make "r2^8" | |
builder:setHandler(function (ch) | |
ch:addChunk(0xCA) | |
end):make "r2^8." | |
builder:setHandler(function (ch) | |
ch:addChunk(0xC3) | |
end):make "r4" | |
builder:setHandler(function (ch) | |
ch:addChunk(0xC5) | |
end):make "r4." | |
builder:setHandler(function (ch) | |
ch:addChunk(0xC6) | |
end):make "r4.." | |
builder:setHandler(function (ch) | |
ch:addChunk(0xC4) | |
end):make "r4^16" | |
builder:setHandler(function (ch) | |
ch:addChunk(0xC1) | |
end):make "r8" | |
builder:setHandler(function (ch) | |
ch:addChunk(0xC2) | |
end):make "r8." | |
return engine |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment