auto luaprinter_type = sol().registry().create_simple_usertype<luaprinter>("new", sol::no_constructor);
luaprinter_type.set("clearpage", &luaprinter::clearpage);
luaprinter_type.set("drawpixel", &luaprinter::drawpixel);
luaprinter_type.set("getpixel", &luaprinter::getpixel);
luaprinter_type.set("setheadpos", &luaprinter::setheadpos);
luaprinter_type.set("savepage", &luaprinter::savepage);
luaprinter_type.set("getbuffer", &luaprinter::getbuffer);
luaprinter_type.set("getnextchar", &luaprinter::getnextchar);
luaprinter_type.set("putnextchar", &luaprinter::putnextchar);
luaprinter_type.set("getheadpos", &luaprinter::getheadpos);
luaprinter_type.set("setprintername", &luaprinter::setprintername);
luaprinter_type.set("getprintername", &luaprinter::getprintername);
luaprinter_type.set("fixcolons", &luaprinter::fixcolons);
luaprinter_type.set("sessiontime", &luaprinter::sessiontime);
luaprinter_type.set("simplename", &luaprinter::simplename);
luaprinter_type.set("tagname", &luaprinter::tagname);
luaprinter_type.set("count", &luaprinter::count);
luaprinter_type.set("getinitvalue", &luaprinter::getinitvalue);
luaprinter_type.set("pagewidth", &luaprinter::pagewidth);
luaprinter_type.set("pageheight", &luaprinter::pageheight);
sol().registry().set_usertype("luaprinter", luaprinter_type);
machine_type.set("lp", sol::property([this](running_machine &m) {
sol::table table = sol().create_table();
int i=1;
for(auto p : luaprinter::luaprinterlist)
{
table[i++] = p;
};
return table;
}));